solid-ui 2.4.28-82fd8721 → 2.4.28-8ad823dc
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/805.solid-ui.min.js +1 -1
- package/dist/805.solid-ui.min.js.map +1 -1
- package/dist/solid-ui.js +1930 -1158
- package/dist/solid-ui.js.map +1 -1
- package/dist/solid-ui.min.js +1 -1
- package/dist/solid-ui.min.js.map +1 -1
- package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js +1938 -1938
- package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js.map +1 -1
- package/lib/chat/bookmarks.js +6 -7
- package/lib/chat/bookmarks.js.map +1 -1
- package/lib/chat/chatLogic.js +249 -65
- package/lib/chat/chatLogic.js.map +1 -1
- package/lib/chat/dateFolder.js +129 -126
- package/lib/chat/dateFolder.js.map +1 -1
- package/lib/chat/infinite.js +637 -423
- package/lib/chat/infinite.js.map +1 -1
- package/lib/chat/message.js +332 -193
- package/lib/chat/message.js.map +1 -1
- package/lib/chat/messageTools.js +463 -277
- package/lib/chat/messageTools.js.map +1 -1
- package/lib/chat/thread.js +299 -209
- package/lib/chat/thread.js.map +1 -1
- package/lib/header/index.js +5 -0
- package/lib/header/index.js.map +1 -1
- package/lib/log.js +5 -5
- package/lib/log.js.map +1 -1
- package/lib/login/login.d.ts.map +1 -1
- package/lib/login/login.js +54 -42
- package/lib/login/login.js.map +1 -1
- package/lib/pad.js +4 -1
- package/lib/pad.js.map +1 -1
- package/lib/participation.js +2 -1
- package/lib/participation.js.map +1 -1
- package/lib/preferences.js +4 -0
- package/lib/preferences.js.map +1 -1
- package/lib/utils/headerFooterHelpers.js +2 -0
- package/lib/utils/headerFooterHelpers.js.map +1 -1
- package/lib/versionInfo.js +6 -6
- package/lib/versionInfo.js.map +1 -1
- package/lib/widgets/buttons.js +0 -2
- package/lib/widgets/buttons.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteBar.js +8 -1
- package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompletePicker.js +8 -3
- package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
- package/lib/widgets/forms/autocomplete/language.js +5 -0
- package/lib/widgets/forms/autocomplete/language.js.map +1 -1
- package/lib/widgets/forms.js +4 -1
- package/lib/widgets/forms.js.map +1 -1
- package/lib/widgets/peoplePicker.js +11 -0
- package/lib/widgets/peoplePicker.js.map +1 -1
- package/package.json +3 -2
package/lib/chat/thread.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thread.js","names":["_iconBase","require","_solidLogic","_index","ns","_interopRequireWildcard","login","pad","$rdf","style","utils","widgets","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","UI","icons","media","thread","dom","kb","subject","messageStore","options","store","doc","WF","Namespace","DCT","newestFirst","messageBodyStyle","div","createElement","messageTable","me","updater","anchor","text","term","a","uri","setAttribute","addEventListener","openHrefInOutlineMode","textContent","mention","message","pre","appendChild","createTextNode","announce","log","warn","error","newMessageForm","form","lhs","middle","rhs","AJAR_date","sendMessage","field","disabled","_appendMsg","appendMsg","value","dateStamp","sts","sendComplete","success","body","errorMessageBlock","bindings","literal","renderMessage","update","sendButton","turnOnInput","creatorAndDate","innerHTML","rows","e","keyCode","altKey","button","iconBase","buttonStyle","context","ensureLoggedIn","then","fieldValue","oldMsg","arguments","length","undefined","now","Date","timestamp","getTime","sym","push","Statement","mostRecentVersion","wf","msgBody","concat","nick","sioc","foaf","person","s","any","label","td1","creator","date","nickAnchor","fetcher","nowOrWhenFetched","_ok","_body","syncMessages","about","displayed","ele","ele2","firstChild","nextSibling","AJAR_subject","messages","each","stored","forEach","m","addMessage","removeChild","msg","statementsMatching","_deleteMessage","_ref","_asyncToGenerator2","_regenerator","mark","_callee","deletions","wrap","_callee$","_context","prev","next","connectedStatements","sent","ok","stop","_x","apply","fresh","content","dateString","tr","done","insertBefore","shortDate","td2","td3","delButton","_event","cancelButton","sureButton","_appendMsg2","query","Query","v","vs","x","vars","variable","pat","add","dct","doneQuery","refresh"],"sources":["../../src/chat/thread.js"],"sourcesContent":["/**\n * Contains the [[thread]] function\n * @packageDocumentation\n */\n\nimport { icons } from '../iconBase'\nimport { store } from 'solid-logic'\nimport { media } from '../media/index'\nimport * as ns from '../ns'\nimport * as login from '../login/login'\nimport * as pad from '../pad'\nimport * as $rdf from 'rdflib' // pull in first avoid cross-refs\nimport * as style from '../style'\nimport * as utils from '../utils'\nimport * as widgets from '../widgets'\n\nconst UI = { icons, ns, media, pad, style, utils, widgets }\n\n/**\n * HTML component for a chat thread\n */\nexport function thread (dom, kb, subject, messageStore, options) {\n kb = kb || store\n messageStore = messageStore.doc() // No hash\n const ns = UI.ns\n const WF = $rdf.Namespace('http://www.w3.org/2005/01/wf/flow#')\n const DCT = $rdf.Namespace('http://purl.org/dc/terms/')\n\n options = options || {}\n\n const newestFirst = !!options.newestFirst\n\n const messageBodyStyle =\n 'white-space: pre-wrap; width: 90%; font-size:100%; border: 0.07em solid #eee; padding: .2em 0.5em; margin: 0.1em 1em 0.1em 1em;'\n // 'font-size: 100%; margin: 0.1em 1em 0.1em 1em; background-color: white; white-space: pre-wrap; padding: 0.1em;'\n\n const div = dom.createElement('div')\n // eslint-disable-next-line prefer-const\n let messageTable // Shared by initial build and addMessageFromBindings\n\n let me\n\n const updater = store.updater\n\n const anchor = function (text, term) {\n // If there is no link return an element anyway\n const a = dom.createElement('a')\n if (term && term.uri) {\n a.setAttribute('href', term.uri)\n a.addEventListener('click', UI.widgets.openHrefInOutlineMode, true)\n a.setAttribute('style', 'color: #3B5998; text-decoration: none; ') // font-weight: bold\n }\n a.textContent = text\n return a\n }\n\n const mention = function mention (message, style) {\n const pre = dom.createElement('pre')\n pre.setAttribute('style', style || 'color: grey')\n div.appendChild(pre)\n pre.appendChild(dom.createTextNode(message))\n return pre\n }\n\n const announce = {\n log: function (message) {\n mention(message, 'color: #111;')\n },\n warn: function (message) {\n mention(message, 'color: #880;')\n },\n error: function (message) {\n mention(message, 'color: #800;')\n }\n }\n\n /**\n * Form for a new message\n */\n const newMessageForm = function () {\n const form = dom.createElement('tr')\n const lhs = dom.createElement('td')\n const middle = dom.createElement('td')\n const rhs = dom.createElement('td')\n form.appendChild(lhs)\n form.appendChild(middle)\n form.appendChild(rhs)\n form.AJAR_date = '9999-01-01T00:00:00Z' // ISO format for field sort\n\n const sendMessage = function () {\n // titlefield.setAttribute('class','pendingedit')\n // titlefield.disabled = true\n field.setAttribute('class', 'pendingedit')\n field.disabled = true\n const { message, dateStamp, sts } = appendMsg(field.value)\n\n const sendComplete = function (uri, success, body) {\n if (!success) {\n form.appendChild(\n UI.widgets.errorMessageBlock(dom, 'Error writing message: ' + body)\n )\n } else {\n const bindings = {\n '?msg': message,\n '?content': store.literal(field.value),\n '?date': dateStamp,\n '?creator': me\n }\n renderMessage(bindings, false) // not green\n\n field.value = '' // clear from out for reuse\n field.setAttribute('class', '')\n field.disabled = false\n }\n }\n updater.update([], sts, sendComplete)\n }\n form.appendChild(dom.createElement('br'))\n\n let field, sendButton\n const turnOnInput = function () {\n creatorAndDate(lhs, me, '', null)\n\n field = dom.createElement('textarea')\n middle.innerHTML = ''\n middle.appendChild(field)\n field.rows = 3\n // field.cols = 40\n field.setAttribute('style', messageBodyStyle + 'background-color: #eef;')\n\n field.addEventListener(\n 'keyup',\n function (e) {\n // User preference?\n if (e.keyCode === 13) {\n if (!e.altKey) {\n // Alt-Enter just adds a new line\n sendMessage()\n }\n }\n },\n false\n )\n\n rhs.innerHTML = ''\n sendButton = UI.widgets.button(\n dom,\n UI.icons.iconBase + 'noun_383448.svg',\n 'Send'\n )\n sendButton.setAttribute('style', UI.style.buttonStyle + 'float: right;')\n sendButton.addEventListener('click', sendMessage, false)\n rhs.appendChild(sendButton)\n }\n\n const context = { div: middle, dom }\n login.ensureLoggedIn(context).then(context => {\n me = context.me\n turnOnInput()\n })\n\n return form\n }\n\n /* const sendMessage = function (oldMsg, options) { // alain\n // titlefield.setAttribute('class','pendingedit')\n // titlefield.disabled = true\n field.setAttribute('class', 'pendingedit')\n field.disabled = true\n const sts = []\n const now = new Date()\n const timestamp = '' + now.getTime()\n const dateStamp = $rdf.term(now)\n // http://www.w3schools.com/jsref/jsref_obj_date.asp\n const message = store.sym(messageStore.uri + '#' + 'Msg' + timestamp)\n\n if (options === 'edit' || options === 'delete') {\n sts.push(\n new $rdf.Statement(mostRecentVersion(oldMsg), DCT('isReplacedBy'), message, messageStore)\n )\n } else {\n sts.push(\n new $rdf.Statement(subject, ns.wf('message'), message, messageStore)\n )\n }\n // sts.push(new $rdf.Statement(message, ns.dc('title'), store.literal(titlefield.value), messageStore))\n const msgBody = options !== 'delete' ? field.value : `message deleted\\nby ${nick(me)}`\n sts.push(\n new $rdf.Statement(\n message,\n ns.sioc('content'),\n store.literal(msgBody),\n messageStore\n )\n )\n sts.push(\n new $rdf.Statement(message, DCT('created'), dateStamp, messageStore)\n )\n if (me) {\n sts.push(\n new $rdf.Statement(message, ns.foaf('maker'), me, messageStore)\n )\n }\n\n const sendComplete = function (uri, success, body) {\n if (!success) {\n form.appendChild(\n UI.widgets.errorMessageBlock(dom, 'Error writing message: ' + body)\n )\n } else {\n const bindings = {\n '?msg': message,\n '?content': store.literal(field.value),\n '?date': dateStamp,\n '?creator': me\n }\n renderMessage(bindings, false) // not green\n\n field.value = '' // clear from out for reuse\n field.setAttribute('class', '')\n field.disabled = false\n }\n }\n updater.update([], sts, sendComplete)\n } */\n\n const appendMsg = function (fieldValue, oldMsg = {}, options = '') { // alain\n const sts = []\n const now = new Date()\n const timestamp = '' + now.getTime()\n const dateStamp = $rdf.term(now)\n // http://www.w3schools.com/jsref/jsref_obj_date.asp\n const message = store.sym(messageStore.uri + '#' + 'Msg' + timestamp)\n\n if (options === 'edit' || options === 'delete') {\n sts.push(\n new $rdf.Statement(mostRecentVersion(oldMsg), DCT('isReplacedBy'), message, messageStore)\n )\n } else {\n sts.push(\n new $rdf.Statement(subject, ns.wf('message'), message, messageStore)\n )\n }\n // sts.push(new $rdf.Statement(message, ns.dc('title'), store.literal(titlefield.value), messageStore))\n const msgBody = options !== 'delete' ? fieldValue : `message deleted\\nby ${nick(me)}`\n sts.push(\n new $rdf.Statement(\n message,\n ns.sioc('content'),\n store.literal(msgBody),\n messageStore\n )\n )\n sts.push(\n new $rdf.Statement(message, DCT('created'), dateStamp, messageStore)\n )\n if (me) {\n sts.push(\n new $rdf.Statement(message, ns.foaf('maker'), me, messageStore)\n )\n }\n return { message, dateStamp, sts }\n }\n\n function nick (person) {\n const s = store.any(person, UI.ns.foaf('nick'))\n if (s) return '' + s.value\n return '' + utils.label(person)\n }\n\n function creatorAndDate (td1, creator, date, message) {\n const nickAnchor = td1.appendChild(anchor(nick(creator), creator))\n if (creator.uri) {\n store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (\n _ok,\n _body\n ) {\n nickAnchor.textContent = nick(creator)\n })\n }\n td1.appendChild(dom.createElement('br'))\n td1.appendChild(anchor(date, message))\n }\n\n // ///////////////////////////////////////////////////////////////////////\n\n function syncMessages (about, messageTable) {\n const displayed = {}\n let ele, ele2\n for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {\n if (ele.AJAR_subject) {\n displayed[ele.AJAR_subject.uri] = true\n }\n }\n const messages = store.each(about, ns.wf('message'))\n const stored = {}\n messages.forEach(function (m) {\n stored[m.uri] = true\n if (!displayed[m.uri]) {\n addMessage(m)\n }\n })\n\n // eslint-disable-next-line space-in-parens\n for (ele = messageTable.firstChild; ele; ) {\n ele2 = ele.nextSibling\n if (ele.AJAR_subject && !stored[ele.AJAR_subject.uri]) {\n messageTable.removeChild(ele)\n }\n ele = ele2\n }\n }\n\n const mostRecentVersion = function (message) {\n let msg = message\n // const listMsg = []\n while (msg) {\n // listMsg.push(msg)\n msg = store.statementsMatching(message, DCT('isReplacedBy'))\n }\n return msg\n }\n\n const _deleteMessage = async function (message) { // alain: must delete message and all linked with isReplacedBy\n // alain: check that me is not the author and ask for confirmation.\n const deletions = await store.connectedStatements(message, messageStore)\n updater.update(deletions, [], function (uri, ok, body) {\n if (!ok) {\n announce.error('Cant delete messages:' + body)\n } else {\n syncMessages(subject, messageTable)\n }\n })\n }\n\n const addMessage = function (message) {\n const bindings = {\n '?msg': message,\n '?creator': store.any(message, ns.foaf('maker')),\n '?date': store.any(message, DCT('created')),\n '?content': store.any(message, ns.sioc('content'))\n }\n renderMessage(bindings, true) // fresh from elsewhere\n }\n\n const renderMessage = function (bindings, fresh) {\n const creator = bindings['?creator']\n const message = bindings['?msg']\n const date = bindings['?date']\n const content = bindings['?content']\n\n const dateString = date.value\n const tr = dom.createElement('tr')\n tr.AJAR_date = dateString\n tr.AJAR_subject = message\n\n let done = false\n for (let ele = messageTable.firstChild; ; ele = ele.nextSibling) {\n if (!ele) {\n // empty\n break\n }\n if (\n (dateString > ele.AJAR_date && newestFirst) ||\n (dateString < ele.AJAR_date && !newestFirst)\n ) {\n messageTable.insertBefore(tr, ele)\n done = true\n break\n }\n }\n if (!done) {\n messageTable.appendChild(tr)\n }\n\n const td1 = dom.createElement('td')\n tr.appendChild(td1)\n creatorAndDate(td1, creator, UI.widgets.shortDate(dateString), message)\n\n const td2 = dom.createElement('td')\n tr.appendChild(td2)\n const pre = dom.createElement('p')\n pre.setAttribute(\n 'style',\n messageBodyStyle +\n (fresh ? 'background-color: #e8ffe8;' : 'background-color: #white;')\n )\n td2.appendChild(pre)\n pre.textContent = content.value\n\n const td3 = dom.createElement('td')\n tr.appendChild(td3)\n\n const delButton = dom.createElement('button')\n td3.appendChild(delButton)\n delButton.textContent = '-'\n\n tr.setAttribute('class', 'hoverControl') // See tabbedtab.css (sigh global CSS)\n delButton.setAttribute('class', 'hoverControlHide')\n delButton.setAttribute('style', 'color: red;')\n delButton.addEventListener(\n 'click',\n function (_event) {\n td3.removeChild(delButton) // Ask -- are you sure?\n const cancelButton = dom.createElement('button')\n cancelButton.textContent = 'cancel'\n td3.appendChild(cancelButton).addEventListener(\n 'click',\n function (_event) {\n td3.removeChild(sureButton)\n td3.removeChild(cancelButton)\n td3.appendChild(delButton)\n },\n false\n )\n const sureButton = dom.createElement('button')\n sureButton.textContent = 'Delete message'\n td3.appendChild(sureButton).addEventListener(\n 'click',\n function (_event) { // alain test for delete or edit depending on me = maker\n td3.removeChild(sureButton)\n td3.removeChild(cancelButton)\n // deleteMessage(message) // alain or sendMessage(message, 'delete' or 'edit') //alain\n if (me.value === store.any(message, ns.foaf('maker')).value) {\n const { sts } = appendMsg() // alain\n updater.update([], sts)\n }\n },\n false\n )\n },\n false\n )\n }\n\n // Messages with date, author etc\n\n messageTable = dom.createElement('table')\n messageTable.fresh = false\n div.appendChild(messageTable)\n messageTable.setAttribute('style', 'width: 100%;') // fill that div!\n\n const tr = newMessageForm()\n if (newestFirst) {\n messageTable.insertBefore(tr, messageTable.firstChild) // If newestFirst\n } else {\n messageTable.appendChild(tr) // not newestFirst\n }\n\n let query\n // Do this with a live query to pull in messages from web\n if (options.query) {\n query = options.query\n } else {\n query = new $rdf.Query('Messages')\n const v = {} // semicolon needed\n const vs = ['msg', 'date', 'creator', 'content']\n vs.forEach(function (x) {\n query.vars.push((v[x] = $rdf.variable(x)))\n })\n query.pat.add(subject, WF('message'), v.msg)\n query.pat.add(v.msg, ns.dct('created'), v.date)\n query.pat.add(v.msg, ns.foaf('maker'), v.creator)\n query.pat.add(v.msg, ns.sioc('content'), v.content)\n }\n\n function doneQuery () {\n messageTable.fresh = true // any new are fresh and so will be greenish\n }\n store.query(query, renderMessage, undefined, doneQuery)\n div.refresh = function () {\n syncMessages(subject, messageTable)\n }\n // syncMessages(subject, messageTable) // no the query will do this async\n return div\n}\n"],"mappings":";;;;;;;;;;AAKA,IAAAA,SAAA,GAAAC,OA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CAACpG,OAAO,EAAEY,YAAY,CAAC;EACrC,CAAC;EACD;EACA,OAAOF,GAAG;AACZ"}
|
|
1
|
+
{"version":3,"file":"thread.js","names":["_iconBase","require","_solidLogic","_index","ns","_interopRequireWildcard","login","pad","$rdf","style","utils","widgets","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","UI","icons","media","thread","dom","kb","subject","messageStore","options","store","doc","WF","Namespace","DCT","newestFirst","messageBodyStyle","div","createElement","messageTable","me","updater","anchor","text","term","a","uri","setAttribute","addEventListener","openHrefInOutlineMode","textContent","mention","message","pre","appendChild","createTextNode","announce","log","warn","error","newMessageForm","form","lhs","middle","rhs","AJAR_date","sendMessage","_ref","_asyncToGenerator2","_regenerator","mark","_callee2","_yield$appendMsg","dateStamp","sts","sendComplete","wrap","_callee2$","_context2","prev","next","field","disabled","appendMsg","value","sent","_ref2","_callee","success","body","bindings","_callee$","_context","errorMessageBlock","literal","renderMessage","stop","_x","_x2","_x3","apply","arguments","updateMany","sendButton","turnOnInput","creatorAndDate","innerHTML","rows","_ref3","_callee3","e","_callee3$","_context3","keyCode","altKey","_x4","button","iconBase","buttonStyle","context","ensureLoggedIn","then","_ref4","fieldValue","oldMsg","length","undefined","_callee4","now","timestamp","msgBody","_callee4$","_context4","Date","getTime","sym","t0","t1","Statement","mostRecentVersion","t2","t3","t4","t5","t6","push","wf","concat","nick","sioc","foaf","abrupt","_x5","person","s","any","label","td1","creator","date","nickAnchor","fetcher","nowOrWhenFetched","_ok","_body","syncMessages","about","displayed","ele","ele2","firstChild","nextSibling","AJAR_subject","messages","each","stored","forEach","m","addMessage","removeChild","msg","statementsMatching","_deleteMessage","_ref5","_callee5","deletions","_callee5$","_context5","connectedStatements","ok","_x6","_ref6","_callee6","_callee6$","_context6","_x7","_ref7","_callee9","fresh","content","dateString","tr","done","td2","td3","delButton","_callee9$","_context9","insertBefore","shortDate","_ref8","_callee8","_event","cancelButton","sureButton","_callee8$","_context8","_ref9","_callee7","_yield$appendMsg2","_callee7$","_context7","_x11","_x10","_x8","_x9","query","Query","v","vs","x","vars","variable","pat","add","dct","doneQuery","refresh"],"sources":["../../src/chat/thread.js"],"sourcesContent":["/**\n * Contains the [[thread]] function\n * @packageDocumentation\n */\n\nimport { icons } from '../iconBase'\nimport { store } from 'solid-logic'\nimport { media } from '../media/index'\nimport * as ns from '../ns'\nimport * as login from '../login/login'\nimport * as pad from '../pad'\nimport * as $rdf from 'rdflib' // pull in first avoid cross-refs\nimport * as style from '../style'\nimport * as utils from '../utils'\nimport * as widgets from '../widgets'\n\nconst UI = { icons, ns, media, pad, style, utils, widgets }\n\n/**\n * HTML component for a chat thread\n */\nexport function thread (dom, kb, subject, messageStore, options) {\n kb = kb || store\n messageStore = messageStore.doc() // No hash\n const ns = UI.ns\n const WF = $rdf.Namespace('http://www.w3.org/2005/01/wf/flow#')\n const DCT = $rdf.Namespace('http://purl.org/dc/terms/')\n\n options = options || {}\n\n const newestFirst = !!options.newestFirst\n\n const messageBodyStyle =\n 'white-space: pre-wrap; width: 90%; font-size:100%; border: 0.07em solid #eee; padding: .2em 0.5em; margin: 0.1em 1em 0.1em 1em;'\n // 'font-size: 100%; margin: 0.1em 1em 0.1em 1em; background-color: white; white-space: pre-wrap; padding: 0.1em;'\n\n const div = dom.createElement('div')\n // eslint-disable-next-line prefer-const\n let messageTable\n\n let me\n\n const updater = store.updater\n\n const anchor = function (text, term) {\n // If there is no link return an element anyway\n const a = dom.createElement('a')\n if (term && term.uri) {\n a.setAttribute('href', term.uri)\n a.addEventListener('click', UI.widgets.openHrefInOutlineMode, true)\n a.setAttribute('style', 'color: #3B5998; text-decoration: none; ') // font-weight: bold\n }\n a.textContent = text\n return a\n }\n\n const mention = function mention (message, style) {\n const pre = dom.createElement('pre')\n pre.setAttribute('style', style || 'color: grey')\n div.appendChild(pre)\n pre.appendChild(dom.createTextNode(message))\n return pre\n }\n\n const announce = {\n log: function (message) {\n mention(message, 'color: #111;')\n },\n warn: function (message) {\n mention(message, 'color: #880;')\n },\n error: function (message) {\n mention(message, 'color: #800;')\n }\n }\n\n /**\n * Form for a new message\n */\n const newMessageForm = function () {\n const form = dom.createElement('tr')\n const lhs = dom.createElement('td')\n const middle = dom.createElement('td')\n const rhs = dom.createElement('td')\n form.appendChild(lhs)\n form.appendChild(middle)\n form.appendChild(rhs)\n form.AJAR_date = '9999-01-01T00:00:00Z' // ISO format for field sort\n\n const sendMessage = async function () {\n // titlefield.setAttribute('class','pendingedit')\n // titlefield.disabled = true\n field.setAttribute('class', 'pendingedit')\n field.disabled = true\n const { message, dateStamp, sts } = await appendMsg(field.value)\n\n const sendComplete = async function (uri, success, body) {\n if (!success) {\n form.appendChild(\n UI.widgets.errorMessageBlock(dom, 'Error writing message: ' + body)\n )\n } else {\n const bindings = {\n '?msg': message,\n '?content': store.literal(field.value),\n '?date': dateStamp,\n '?creator': me\n }\n renderMessage(bindings, false) // not green\n\n field.value = '' // clear from out for reuse\n field.setAttribute('class', '')\n field.disabled = false\n }\n }\n await updater.updateMany([], sts, sendComplete)\n }\n form.appendChild(dom.createElement('br'))\n\n let field, sendButton\n const turnOnInput = function () {\n creatorAndDate(lhs, me, '', null)\n\n field = dom.createElement('textarea')\n middle.innerHTML = ''\n middle.appendChild(field)\n field.rows = 3\n // field.cols = 40\n field.setAttribute('style', messageBodyStyle + 'background-color: #eef;')\n\n field.addEventListener(\n 'keyup',\n async function (e) {\n // User preference?\n if (e.keyCode === 13) {\n if (!e.altKey) {\n // Alt-Enter just adds a new line\n await sendMessage()\n }\n }\n },\n false\n )\n\n rhs.innerHTML = ''\n sendButton = UI.widgets.button(\n dom,\n UI.icons.iconBase + 'noun_383448.svg',\n 'Send'\n )\n sendButton.setAttribute('style', UI.style.buttonStyle + 'float: right;')\n sendButton.addEventListener('click', sendMessage, false)\n rhs.appendChild(sendButton)\n }\n\n const context = { div: middle, dom }\n login.ensureLoggedIn(context).then(context => {\n me = context.me\n turnOnInput()\n })\n\n return form\n }\n\n const appendMsg = async function (fieldValue, oldMsg = {}, options = '') { // alain\n const sts = []\n const now = new Date()\n const timestamp = '' + now.getTime()\n const dateStamp = $rdf.term(now)\n // http://www.w3schools.com/jsref/jsref_obj_date.asp\n const message = store.sym(messageStore.uri + '#' + 'Msg' + timestamp)\n\n if (options === 'edit' || options === 'delete') {\n sts.push(\n new $rdf.Statement(await mostRecentVersion(oldMsg), DCT('isReplacedBy'), message, messageStore)\n )\n } else {\n sts.push(\n new $rdf.Statement(subject, ns.wf('message'), message, messageStore)\n )\n }\n // sts.push(new $rdf.Statement(message, ns.dc('title'), store.literal(titlefield.value), messageStore))\n const msgBody = options !== 'delete' ? fieldValue : `message deleted\\nby ${nick(me)}`\n sts.push(\n new $rdf.Statement(\n message,\n ns.sioc('content'),\n store.literal(msgBody),\n messageStore\n )\n )\n sts.push(\n new $rdf.Statement(message, DCT('created'), dateStamp, messageStore)\n )\n if (me) {\n sts.push(\n new $rdf.Statement(message, ns.foaf('maker'), me, messageStore)\n )\n }\n return { message, dateStamp, sts }\n }\n\n function nick (person) {\n const s = store.any(person, UI.ns.foaf('nick'))\n if (s) return '' + s.value\n return '' + utils.label(person)\n }\n\n function creatorAndDate (td1, creator, date, message) {\n const nickAnchor = td1.appendChild(anchor(nick(creator), creator))\n if (creator.uri) {\n store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (\n _ok,\n _body\n ) {\n nickAnchor.textContent = nick(creator)\n })\n }\n td1.appendChild(dom.createElement('br'))\n td1.appendChild(anchor(date, message))\n }\n\n // ///////////////////////////////////////////////////////////////////////\n\n function syncMessages (about, messageTable) {\n const displayed = {}\n let ele, ele2\n for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {\n if (ele.AJAR_subject) {\n displayed[ele.AJAR_subject.uri] = true\n }\n }\n const messages = store.each(about, ns.wf('message'))\n const stored = {}\n messages.forEach(function (m) {\n stored[m.uri] = true\n if (!displayed[m.uri]) {\n addMessage(m)\n }\n })\n\n // eslint-disable-next-line space-in-parens\n for (ele = messageTable.firstChild; ele; ) {\n ele2 = ele.nextSibling\n if (ele.AJAR_subject && !stored[ele.AJAR_subject.uri]) {\n messageTable.removeChild(ele)\n }\n ele = ele2\n }\n }\n\n const mostRecentVersion = function (message) {\n let msg = message\n // const listMsg = []\n while (msg) {\n message = msg\n // listMsg.push(msg)\n msg = store.statementsMatching(message, DCT('isReplacedBy'))\n }\n return message\n }\n\n const _deleteMessage = async function (message) { // alain: must delete message and all linked with isReplacedBy\n // alain: check that me is not the author and ask for confirmation.\n const deletions = await store.connectedStatements(message, messageStore)\n await updater.updateMany(deletions, [], function (uri, ok, body) {\n if (!ok) {\n announce.error('Cant delete messages:' + body)\n } else {\n syncMessages(subject, messageTable)\n }\n })\n }\n\n const addMessage = async function (message) {\n const bindings = {\n '?msg': message,\n '?creator': store.any(message, ns.foaf('maker')),\n '?date': store.any(message, DCT('created')),\n '?content': store.any(message, ns.sioc('content'))\n }\n await renderMessage(bindings, true) // fresh from elsewhere\n }\n\n const renderMessage = async function (bindings, fresh) {\n const creator = bindings['?creator']\n const message = bindings['?msg']\n const date = bindings['?date']\n const content = bindings['?content']\n\n const dateString = date.value\n const tr = dom.createElement('tr')\n tr.AJAR_date = dateString\n tr.AJAR_subject = message\n\n let done = false\n for (let ele = messageTable.firstChild; ; ele = ele.nextSibling) {\n if (!ele) {\n // empty\n break\n }\n if (\n (dateString > ele.AJAR_date && newestFirst) ||\n (dateString < ele.AJAR_date && !newestFirst)\n ) {\n messageTable.insertBefore(tr, ele)\n done = true\n break\n }\n }\n if (!done) {\n messageTable.appendChild(tr)\n }\n\n const td1 = dom.createElement('td')\n tr.appendChild(td1)\n creatorAndDate(td1, creator, UI.widgets.shortDate(dateString), message)\n\n const td2 = dom.createElement('td')\n tr.appendChild(td2)\n const pre = dom.createElement('p')\n pre.setAttribute(\n 'style',\n messageBodyStyle +\n (fresh ? 'background-color: #e8ffe8;' : 'background-color: #white;')\n )\n td2.appendChild(pre)\n pre.textContent = content.value\n\n const td3 = dom.createElement('td')\n tr.appendChild(td3)\n\n const delButton = dom.createElement('button')\n td3.appendChild(delButton)\n delButton.textContent = '-'\n\n tr.setAttribute('class', 'hoverControl') // See tabbedtab.css (sigh global CSS)\n delButton.setAttribute('class', 'hoverControlHide')\n delButton.setAttribute('style', 'color: red;')\n delButton.addEventListener(\n 'click',\n async function (_event) {\n td3.removeChild(delButton) // Ask -- are you sure?\n const cancelButton = dom.createElement('button')\n cancelButton.textContent = 'cancel'\n td3.appendChild(cancelButton).addEventListener(\n 'click',\n function (_event) {\n td3.removeChild(sureButton)\n td3.removeChild(cancelButton)\n td3.appendChild(delButton)\n },\n false\n )\n const sureButton = dom.createElement('button')\n sureButton.textContent = 'Delete message'\n td3.appendChild(sureButton).addEventListener(\n 'click',\n async function (_event) { // alain: test for delete or edit depending on me = maker\n td3.removeChild(sureButton)\n td3.removeChild(cancelButton)\n // deleteMessage(message) // alain or sendMessage(message, 'delete' or 'edit') //alain\n if (me.value === store.any(message, ns.foaf('maker')).value) {\n const { sts } = await appendMsg() // alain\n await updater.updateMany([], sts) // alain\n }\n },\n false\n )\n },\n false\n )\n }\n\n // Messages with date, author etc\n\n messageTable = dom.createElement('table')\n messageTable.fresh = false\n div.appendChild(messageTable)\n messageTable.setAttribute('style', 'width: 100%;') // fill that div!\n\n const tr = newMessageForm()\n if (newestFirst) {\n messageTable.insertBefore(tr, messageTable.firstChild) // If newestFirst\n } else {\n messageTable.appendChild(tr) // not newestFirst\n }\n\n let query\n // Do this with a live query to pull in messages from web\n if (options.query) {\n query = options.query\n } else {\n query = new $rdf.Query('Messages')\n const v = {} // semicolon needed\n const vs = ['msg', 'date', 'creator', 'content']\n vs.forEach(function (x) {\n query.vars.push((v[x] = $rdf.variable(x)))\n })\n query.pat.add(subject, WF('message'), v.msg)\n query.pat.add(v.msg, ns.dct('created'), v.date)\n query.pat.add(v.msg, ns.foaf('maker'), v.creator)\n query.pat.add(v.msg, ns.sioc('content'), v.content)\n }\n\n function doneQuery () {\n messageTable.fresh = true // any new are fresh and so will be greenish\n }\n store.query(query, renderMessage, undefined, doneQuery)\n div.refresh = function () {\n syncMessages(subject, messageTable)\n }\n // syncMessages(subject, messageTable) // no the query will do this async\n return div\n}\n"],"mappings":";;;;;;;;;;AAKA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,EAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAD,uBAAA,CAAAJ,OAAA;AACA,IAAAM,GAAA,GAAAF,uBAAA,CAAAJ,OAAA;AACA,IAAAO,IAAA,GAAAH,uBAAA,CAAAJ,OAAA;AACA,IAAAQ,KAAA,GAAAJ,uBAAA,CAAAJ,OAAA;AACA,IAAAS,KAAA,GAAAL,uBAAA,CAAAJ,OAAA;AACA,IAAAU,OAAA,GAAAN,uBAAA,CAAAJ,OAAA;AAAqC,SAAAW,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAR,wBAAAY,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAA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AC,SAAS,CAAC,EAAEoM,CAAC,CAAChD,GAAG,CAAC;IAC5C8C,KAAK,CAACO,GAAG,CAACC,GAAG,CAACN,CAAC,CAAChD,GAAG,EAAE7L,EAAE,CAACoP,GAAG,CAAC,SAAS,CAAC,EAAEP,CAAC,CAACrE,IAAI,CAAC;IAC/CmE,KAAK,CAACO,GAAG,CAACC,GAAG,CAACN,CAAC,CAAChD,GAAG,EAAE7L,EAAE,CAAC+J,IAAI,CAAC,OAAO,CAAC,EAAE8E,CAAC,CAACtE,OAAO,CAAC;IACjDoE,KAAK,CAACO,GAAG,CAACC,GAAG,CAACN,CAAC,CAAChD,GAAG,EAAE7L,EAAE,CAAC8J,IAAI,CAAC,SAAS,CAAC,EAAE+E,CAAC,CAAC7B,OAAO,CAAC;EACrD;EAEA,SAASqC,SAASA,CAAA,EAAI;IACpBrM,YAAY,CAAC+J,KAAK,GAAG,IAAI,EAAC;EAC5B;;EACAxK,iBAAK,CAACoM,KAAK,CAACA,KAAK,EAAEnI,aAAa,EAAE+B,SAAS,EAAE8G,SAAS,CAAC;EACvDvM,GAAG,CAACwM,OAAO,GAAG,YAAY;IACxBxE,YAAY,CAAC1I,OAAO,EAAEY,YAAY,CAAC;EACrC,CAAC;EACD;EACA,OAAOF,GAAG;AACZ"}
|
package/lib/header/index.js
CHANGED
|
@@ -39,6 +39,11 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
39
39
|
*/
|
|
40
40
|
var DEFAULT_HELP_MENU_ICON = _index.icons.iconBase + 'noun_help.svg';
|
|
41
41
|
var DEFAUL_SOLID_ICON_URL = 'https://solidproject.org/assets/img/solid-emblem.svg';
|
|
42
|
+
|
|
43
|
+
/*
|
|
44
|
+
HeaderOptions allow for customizing the logo and menu list. If a logo is not provided the default
|
|
45
|
+
is solid. Menulist will always show a link to logout and to the users profile.
|
|
46
|
+
*/
|
|
42
47
|
/**
|
|
43
48
|
* Initialize header component, the header object returned depends on whether the user is authenticated.
|
|
44
49
|
* @param store the data store
|
package/lib/header/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_index","require","_solidLogic","_login","widgets","_interopRequireWildcard","style","_emptyProfile","_headerFooterHelpers","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DEFAULT_HELP_MENU_ICON","icons","iconBase","DEFAUL_SOLID_ICON_URL","initHeader","_x","_x2","_x3","_initHeader","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee2","store","userMenuList","options","header","pod","wrap","_callee2$","_context2","prev","next","document","getElementById","abrupt","getPod","rebuildHeader","authSession","onLogout","onLogin","stop","_callee","user","_callee$","_context","authn","currentUser","innerHTML","t0","createBanner","t1","sent","appendChild","_x4","_x5","_x6","_x7","_x8","_createBanner","_callee3","podLink","image","userMenu","banner","leftSideOfHeader","helpMenu","_callee3$","_context3","createElement","href","uri","setAttribute","headerBannerLink","src","logo","headerBannerIcon","createUserMenu","createLoginSignUpButtons","headerBanner","headerBannerRightMenu","helpMenuList","createHelpMenu","helpMenuItems","headerUserMenuList","forEach","menuItem","menuItemType","url","createUserMenuItem","createUserMenuLink","label","target","createUserMenuButton","onclick","headerUserMenuNavigationMenuNotDisplayed","helpMenuContainer","headerBannerUserMenu","helpMenuTrigger","headerUserMenuTrigger","type","helpMenuIcon","helpIcon","headerUserMenuTriggerImg","throttledMenuToggle","throttle","event","toggleMenu","addEventListener","timer","setTimeout","clearTimeout","nav","headerUserMenuNavigationMenu","profileLoginButtonPre","headerBannerLogin","loginStatusBox","onClick","button","headerUserMenuButton","onmouseover","headerUserMenuButtonHover","onmouseout","innerText","link","headerUserMenuLink","headerUserMenuLinkHover","_x9","_x10","_x11","_createUserMenu","_callee4","fetcher","loggedInMenuList","loggedInMenu","loggedInMenuTrigger","profileImg","loggedInMenuContainer","_callee4$","_context4","load","getProfileImg","headerBannerUserMenuNotDisplayed","child","menuProfileItem","headerUserMenuListItem","profileUrl","findImage","emptyProfile","_unused","profileImage","headerUserMenuPhoto","backgroundImage","concat","trigger","menu","isExpanded","getAttribute","expand","close","toString"],"sources":["../../src/header/index.ts"],"sourcesContent":["/* global EventListenerOrEventListenerObject */\n/*\n This file was copied from mashlib/src/global/header.ts file. It is modified to\n work in solid-ui by adjusting where imported functions are found.\n */\nimport { IndexedFormula, NamedNode } from 'rdflib'\nimport { icons } from '../index'\nimport { authn, authSession } from 'solid-logic'\nimport { loginStatusBox } from '../login/login'\n// import { loginStatusBox, authSession, currentUser } from '../authn/authn'\nimport * as widgets from '../widgets'\nimport * as style from '../style'\nimport { emptyProfile } from './empty-profile'\nimport { getPod, throttle } from '../utils/headerFooterHelpers'\n\n/**\n * menu icons\n*/\nconst DEFAULT_HELP_MENU_ICON = icons.iconBase + 'noun_help.svg'\nconst DEFAUL_SOLID_ICON_URL = 'https://solidproject.org/assets/img/solid-emblem.svg'\n\nexport type MenuItemLink = {\n label: string,\n url: string,\n target?: string\n}\n\nexport type MenuItemButton = {\n label: string,\n onclick: () => void\n}\n\nexport type MenuItems = MenuItemLink | MenuItemButton\n\n/*\n HeaderOptions allow for customizing the logo and menu list. If a logo is not provided the default\n is solid. Menulist will always show a link to logout and to the users profile.\n */\nexport type HeaderOptions = {\n logo?: string,\n helpIcon?: string,\n helpMenuList?: MenuItems[]\n}\n\n/**\n * Initialize header component, the header object returned depends on whether the user is authenticated.\n * @param store the data store\n * @param userMenuList a list of menu items when the user is logged in\n * @param options allow the header to be customized with a personalized logo, help icon and a help menu list of links or buttons.\n * @returns a header for an authenticated user with menu items given or a login screen\n */\nexport async function initHeader (store: IndexedFormula, userMenuList: MenuItems[], options?: HeaderOptions) {\n const header = document.getElementById('PageHeader')\n if (!header) {\n return\n }\n\n const pod = getPod()\n rebuildHeader(header, store, pod, userMenuList, options)()\n authSession.onLogout(rebuildHeader(header, store, pod, userMenuList, options))\n authSession.onLogin(rebuildHeader(header, store, pod, userMenuList, options))\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function rebuildHeader (header: HTMLElement, store: IndexedFormula, pod: NamedNode, userMenuList: MenuItems[], options?: HeaderOptions) {\n return async () => {\n const user = authn.currentUser()\n header.innerHTML = ''\n header.appendChild(await createBanner(store, pod, user, userMenuList, options))\n }\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport async function createBanner (store: IndexedFormula, pod: NamedNode, user: NamedNode | null, userMenuList: MenuItems[], options?: HeaderOptions): Promise<HTMLElement> {\n const podLink = document.createElement('a')\n podLink.href = pod.uri\n podLink.setAttribute('style', style.headerBannerLink)\n const image = document.createElement('img')\n if (options) {\n image.src = options.logo ? options.logo : DEFAUL_SOLID_ICON_URL\n }\n image.setAttribute('style', style.headerBannerIcon)\n podLink.appendChild(image)\n\n const userMenu = user\n ? await createUserMenu(store, user, userMenuList)\n : createLoginSignUpButtons()\n\n const banner = document.createElement('div')\n banner.setAttribute('style', style.headerBanner)\n banner.appendChild(podLink)\n\n const leftSideOfHeader = document.createElement('div')\n leftSideOfHeader.setAttribute('style', style.headerBannerRightMenu)\n leftSideOfHeader.appendChild(userMenu)\n\n if (options && options.helpMenuList) {\n const helpMenu = createHelpMenu(options, options.helpMenuList)\n leftSideOfHeader.appendChild(helpMenu as HTMLDivElement)\n }\n\n banner.appendChild(leftSideOfHeader)\n\n return banner\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createHelpMenu (options: HeaderOptions, helpMenuItems: MenuItems[]) {\n if (!helpMenuItems) return\n const helpMenuList = document.createElement('ul')\n helpMenuList.setAttribute('style', style.headerUserMenuList)\n helpMenuItems.forEach(function (menuItem) {\n const menuItemType: string = (menuItem as MenuItemLink).url ? 'url' : 'onclick'\n if (menuItemType === 'url') {\n helpMenuList.appendChild(createUserMenuItem(createUserMenuLink(menuItem.label, (menuItem as MenuItemLink).url, (menuItem as MenuItemLink).target)))\n } else {\n helpMenuList.appendChild(createUserMenuItem(createUserMenuButton(menuItem.label, (menuItem as MenuItemButton).onclick)))\n }\n })\n\n const helpMenu = document.createElement('nav')\n\n helpMenu.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\n helpMenu.setAttribute('aria-hidden', 'true')\n helpMenu.setAttribute('id', 'helperNav')\n helpMenu.appendChild(helpMenuList)\n\n const helpMenuContainer = document.createElement('div')\n helpMenuContainer.setAttribute('style', style.headerBannerUserMenu)\n helpMenuContainer.appendChild(helpMenu)\n\n const helpMenuTrigger = document.createElement('button')\n helpMenuTrigger.setAttribute('style', style.headerUserMenuTrigger)\n helpMenuTrigger.type = 'button'\n\n const helpMenuIcon = document.createElement('img')\n helpMenuIcon.src = (options && options.helpIcon) ? options.helpIcon : icons.iconBase + DEFAULT_HELP_MENU_ICON\n helpMenuIcon.setAttribute('style', style.headerUserMenuTriggerImg)\n helpMenuContainer.appendChild(helpMenuTrigger)\n helpMenuTrigger.appendChild(helpMenuIcon)\n\n const throttledMenuToggle = throttle((event: Event) => toggleMenu(event, helpMenuTrigger, helpMenu), 50)\n helpMenuTrigger.addEventListener('click', throttledMenuToggle)\n let timer = setTimeout(() => null, 0)\n helpMenuContainer.addEventListener('mouseover', event => {\n clearTimeout(timer)\n throttledMenuToggle(event)\n const nav = document.getElementById('helperNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenu)\n })\n helpMenuContainer.addEventListener('mouseout', event => {\n timer = setTimeout(() => throttledMenuToggle(event), 200)\n const nav = document.getElementById('helperNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\n })\n\n return helpMenuContainer\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createLoginSignUpButtons () {\n const profileLoginButtonPre = document.createElement('div')\n profileLoginButtonPre.setAttribute('style', style.headerBannerLogin)\n profileLoginButtonPre.appendChild(loginStatusBox(document, null, {}))\n return profileLoginButtonPre\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createUserMenuButton (label: string, onClick: EventListenerOrEventListenerObject): HTMLElement {\n const button = document.createElement('button')\n button.setAttribute('style', style.headerUserMenuButton)\n button.onmouseover = function () {\n button.setAttribute('style', style.headerUserMenuButtonHover)\n }\n button.onmouseout = function () {\n button.setAttribute('style', style.headerUserMenuButton)\n }\n button.addEventListener('click', onClick)\n button.innerText = label\n return button\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createUserMenuLink (label: string, href: string, target?: string): HTMLElement {\n const link = document.createElement('a')\n link.setAttribute('style', style.headerUserMenuLink)\n link.onmouseover = function () {\n link.setAttribute('style', style.headerUserMenuLinkHover)\n }\n link.onmouseout = function () {\n link.setAttribute('style', style.headerUserMenuLink)\n }\n link.href = href\n link.innerText = label\n if (target) link.target = target\n return link\n}\n\n/**\n * @ignore exporting this only for the unit test\n */\nexport async function createUserMenu (store: IndexedFormula, user: NamedNode, userMenuList: MenuItems[]): Promise<HTMLElement> {\n const fetcher = (<any>store).fetcher\n if (fetcher) {\n // Making sure that Profile is loaded before building menu\n await fetcher.load(user)\n }\n\n const loggedInMenuList = document.createElement('ul')\n loggedInMenuList.setAttribute('style', style.headerUserMenuList)\n if (userMenuList) {\n userMenuList.forEach(function (menuItem) {\n const menuItemType: string = (menuItem as MenuItemLink).url ? 'url' : 'onclick'\n if (menuItemType === 'url') {\n loggedInMenuList.appendChild(createUserMenuItem(createUserMenuLink(menuItem.label, (menuItem as MenuItemLink).url, (menuItem as MenuItemLink).target)))\n } else {\n loggedInMenuList.appendChild(createUserMenuItem(createUserMenuButton(menuItem.label, (menuItem as MenuItemButton).onclick)))\n }\n })\n }\n const loggedInMenu = document.createElement('nav')\n\n loggedInMenu.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\n loggedInMenu.setAttribute('aria-hidden', 'true')\n loggedInMenu.setAttribute('id', 'loggedInNav')\n loggedInMenu.appendChild(loggedInMenuList)\n\n const loggedInMenuTrigger = document.createElement('button')\n loggedInMenuTrigger.setAttribute('style', style.headerUserMenuTrigger)\n loggedInMenuTrigger.type = 'button'\n const profileImg = getProfileImg(store, user)\n if (typeof profileImg === 'string') {\n loggedInMenuTrigger.innerHTML = profileImg\n } else {\n loggedInMenuTrigger.appendChild(profileImg)\n }\n\n const loggedInMenuContainer = document.createElement('div')\n loggedInMenuContainer.setAttribute('style', style.headerBannerUserMenuNotDisplayed)\n loggedInMenuContainer.appendChild(loggedInMenuTrigger)\n loggedInMenuContainer.appendChild(loggedInMenu)\n\n const throttledMenuToggle = throttle((event: Event) => toggleMenu(event, loggedInMenuTrigger, loggedInMenu), 50)\n loggedInMenuTrigger.addEventListener('click', throttledMenuToggle)\n let timer = setTimeout(() => null, 0)\n loggedInMenuContainer.addEventListener('mouseover', event => {\n clearTimeout(timer)\n throttledMenuToggle(event)\n const nav = document.getElementById('loggedInNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenu)\n })\n loggedInMenuContainer.addEventListener('mouseout', event => {\n timer = setTimeout(() => throttledMenuToggle(event), 200)\n const nav = document.getElementById('loggedInNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\n })\n\n return loggedInMenuContainer\n}\n\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createUserMenuItem (child: HTMLElement): HTMLElement {\n const menuProfileItem = document.createElement('li')\n menuProfileItem.setAttribute('style', style.headerUserMenuListItem)\n menuProfileItem.appendChild(child)\n return menuProfileItem\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function getProfileImg (store: IndexedFormula, user: NamedNode): string | HTMLElement {\n let profileUrl = null\n try {\n profileUrl = widgets.findImage(user)\n if (!profileUrl) {\n return emptyProfile\n }\n } catch {\n return emptyProfile\n }\n\n const profileImage = document.createElement('div')\n profileImage.setAttribute('style', style.headerUserMenuPhoto)\n profileImage.style.backgroundImage = `url(${profileUrl})`\n return profileImage\n}\n\n/**\n * @internal\n */\nfunction toggleMenu (event: Event, trigger: HTMLButtonElement, menu: HTMLElement): void {\n const isExpanded = trigger.getAttribute('aria-expanded') === 'true'\n const expand = event.type === 'mouseover'\n const close = event.type === 'mouseout'\n if ((isExpanded && expand) || (!isExpanded && close)) {\n return\n }\n trigger.setAttribute('aria-expanded', (!isExpanded).toString())\n menu.setAttribute('aria-hidden', isExpanded.toString())\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAMA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAD,uBAAA,CAAAJ,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,oBAAA,GAAAP,OAAA;AAA+D,SAAAQ,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV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,IAAI,KAAK,UAAU;EACvC,IAAKwD,UAAU,IAAIE,MAAM,IAAM,CAACF,UAAU,IAAIG,KAAM,EAAE;IACpD;EACF;EACAL,OAAO,CAAClF,YAAY,CAAC,eAAe,EAAE,CAAC,CAACoF,UAAU,EAAEI,QAAQ,EAAE,CAAC;EAC/DL,IAAI,CAACnF,YAAY,CAAC,aAAa,EAAEoF,UAAU,CAACI,QAAQ,EAAE,CAAC;AACzD"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_index","require","_solidLogic","_login","widgets","_interopRequireWildcard","style","_emptyProfile","_headerFooterHelpers","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","DEFAULT_HELP_MENU_ICON","icons","iconBase","DEFAUL_SOLID_ICON_URL","initHeader","_x","_x2","_x3","_initHeader","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee2","store","userMenuList","options","header","pod","wrap","_callee2$","_context2","prev","next","document","getElementById","abrupt","getPod","rebuildHeader","authSession","onLogout","onLogin","stop","_callee","user","_callee$","_context","authn","currentUser","innerHTML","t0","createBanner","t1","sent","appendChild","_x4","_x5","_x6","_x7","_x8","_createBanner","_callee3","podLink","image","userMenu","banner","leftSideOfHeader","helpMenu","_callee3$","_context3","createElement","href","uri","setAttribute","headerBannerLink","src","logo","headerBannerIcon","createUserMenu","createLoginSignUpButtons","headerBanner","headerBannerRightMenu","helpMenuList","createHelpMenu","helpMenuItems","headerUserMenuList","forEach","menuItem","menuItemType","url","createUserMenuItem","createUserMenuLink","label","target","createUserMenuButton","onclick","headerUserMenuNavigationMenuNotDisplayed","helpMenuContainer","headerBannerUserMenu","helpMenuTrigger","headerUserMenuTrigger","type","helpMenuIcon","helpIcon","headerUserMenuTriggerImg","throttledMenuToggle","throttle","event","toggleMenu","addEventListener","timer","setTimeout","clearTimeout","nav","headerUserMenuNavigationMenu","profileLoginButtonPre","headerBannerLogin","loginStatusBox","onClick","button","headerUserMenuButton","onmouseover","headerUserMenuButtonHover","onmouseout","innerText","link","headerUserMenuLink","headerUserMenuLinkHover","_x9","_x10","_x11","_createUserMenu","_callee4","fetcher","loggedInMenuList","loggedInMenu","loggedInMenuTrigger","profileImg","loggedInMenuContainer","_callee4$","_context4","load","getProfileImg","headerBannerUserMenuNotDisplayed","child","menuProfileItem","headerUserMenuListItem","profileUrl","findImage","emptyProfile","_unused","profileImage","headerUserMenuPhoto","backgroundImage","concat","trigger","menu","isExpanded","getAttribute","expand","close","toString"],"sources":["../../src/header/index.ts"],"sourcesContent":["/* global EventListenerOrEventListenerObject */\n/*\n This file was copied from mashlib/src/global/header.ts file. It is modified to\n work in solid-ui by adjusting where imported functions are found.\n */\nimport { IndexedFormula, NamedNode } from 'rdflib'\nimport { icons } from '../index'\nimport { authn, authSession } from 'solid-logic'\nimport { loginStatusBox } from '../login/login'\n// import { loginStatusBox, authSession, currentUser } from '../authn/authn'\nimport * as widgets from '../widgets'\nimport * as style from '../style'\nimport { emptyProfile } from './empty-profile'\nimport { getPod, throttle } from '../utils/headerFooterHelpers'\n\n/**\n * menu icons\n*/\nconst DEFAULT_HELP_MENU_ICON = icons.iconBase + 'noun_help.svg'\nconst DEFAUL_SOLID_ICON_URL = 'https://solidproject.org/assets/img/solid-emblem.svg'\n\nexport type MenuItemLink = {\n label: string,\n url: string,\n target?: string\n}\n\nexport type MenuItemButton = {\n label: string,\n onclick: () => void\n}\n\nexport type MenuItems = MenuItemLink | MenuItemButton\n\n/*\n HeaderOptions allow for customizing the logo and menu list. If a logo is not provided the default\n is solid. Menulist will always show a link to logout and to the users profile.\n */\nexport type HeaderOptions = {\n logo?: string,\n helpIcon?: string,\n helpMenuList?: MenuItems[]\n}\n\n/**\n * Initialize header component, the header object returned depends on whether the user is authenticated.\n * @param store the data store\n * @param userMenuList a list of menu items when the user is logged in\n * @param options allow the header to be customized with a personalized logo, help icon and a help menu list of links or buttons.\n * @returns a header for an authenticated user with menu items given or a login screen\n */\nexport async function initHeader (store: IndexedFormula, userMenuList: MenuItems[], options?: HeaderOptions) {\n const header = document.getElementById('PageHeader')\n if (!header) {\n return\n }\n\n const pod = getPod()\n rebuildHeader(header, store, pod, userMenuList, options)()\n authSession.onLogout(rebuildHeader(header, store, pod, userMenuList, options))\n authSession.onLogin(rebuildHeader(header, store, pod, userMenuList, options))\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function rebuildHeader (header: HTMLElement, store: IndexedFormula, pod: NamedNode, userMenuList: MenuItems[], options?: HeaderOptions) {\n return async () => {\n const user = authn.currentUser()\n header.innerHTML = ''\n header.appendChild(await createBanner(store, pod, user, userMenuList, options))\n }\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport async function createBanner (store: IndexedFormula, pod: NamedNode, user: NamedNode | null, userMenuList: MenuItems[], options?: HeaderOptions): Promise<HTMLElement> {\n const podLink = document.createElement('a')\n podLink.href = pod.uri\n podLink.setAttribute('style', style.headerBannerLink)\n const image = document.createElement('img')\n if (options) {\n image.src = options.logo ? options.logo : DEFAUL_SOLID_ICON_URL\n }\n image.setAttribute('style', style.headerBannerIcon)\n podLink.appendChild(image)\n\n const userMenu = user\n ? await createUserMenu(store, user, userMenuList)\n : createLoginSignUpButtons()\n\n const banner = document.createElement('div')\n banner.setAttribute('style', style.headerBanner)\n banner.appendChild(podLink)\n\n const leftSideOfHeader = document.createElement('div')\n leftSideOfHeader.setAttribute('style', style.headerBannerRightMenu)\n leftSideOfHeader.appendChild(userMenu)\n\n if (options && options.helpMenuList) {\n const helpMenu = createHelpMenu(options, options.helpMenuList)\n leftSideOfHeader.appendChild(helpMenu as HTMLDivElement)\n }\n\n banner.appendChild(leftSideOfHeader)\n\n return banner\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createHelpMenu (options: HeaderOptions, helpMenuItems: MenuItems[]) {\n if (!helpMenuItems) return\n const helpMenuList = document.createElement('ul')\n helpMenuList.setAttribute('style', style.headerUserMenuList)\n helpMenuItems.forEach(function (menuItem) {\n const menuItemType: string = (menuItem as MenuItemLink).url ? 'url' : 'onclick'\n if (menuItemType === 'url') {\n helpMenuList.appendChild(createUserMenuItem(createUserMenuLink(menuItem.label, (menuItem as MenuItemLink).url, (menuItem as MenuItemLink).target)))\n } else {\n helpMenuList.appendChild(createUserMenuItem(createUserMenuButton(menuItem.label, (menuItem as MenuItemButton).onclick)))\n }\n })\n\n const helpMenu = document.createElement('nav')\n\n helpMenu.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\n helpMenu.setAttribute('aria-hidden', 'true')\n helpMenu.setAttribute('id', 'helperNav')\n helpMenu.appendChild(helpMenuList)\n\n const helpMenuContainer = document.createElement('div')\n helpMenuContainer.setAttribute('style', style.headerBannerUserMenu)\n helpMenuContainer.appendChild(helpMenu)\n\n const helpMenuTrigger = document.createElement('button')\n helpMenuTrigger.setAttribute('style', style.headerUserMenuTrigger)\n helpMenuTrigger.type = 'button'\n\n const helpMenuIcon = document.createElement('img')\n helpMenuIcon.src = (options && options.helpIcon) ? options.helpIcon : icons.iconBase + DEFAULT_HELP_MENU_ICON\n helpMenuIcon.setAttribute('style', style.headerUserMenuTriggerImg)\n helpMenuContainer.appendChild(helpMenuTrigger)\n helpMenuTrigger.appendChild(helpMenuIcon)\n\n const throttledMenuToggle = throttle((event: Event) => toggleMenu(event, helpMenuTrigger, helpMenu), 50)\n helpMenuTrigger.addEventListener('click', throttledMenuToggle)\n let timer = setTimeout(() => null, 0)\n helpMenuContainer.addEventListener('mouseover', event => {\n clearTimeout(timer)\n throttledMenuToggle(event)\n const nav = document.getElementById('helperNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenu)\n })\n helpMenuContainer.addEventListener('mouseout', event => {\n timer = setTimeout(() => throttledMenuToggle(event), 200)\n const nav = document.getElementById('helperNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\n })\n\n return helpMenuContainer\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createLoginSignUpButtons () {\n const profileLoginButtonPre = document.createElement('div')\n profileLoginButtonPre.setAttribute('style', style.headerBannerLogin)\n profileLoginButtonPre.appendChild(loginStatusBox(document, null, {}))\n return profileLoginButtonPre\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createUserMenuButton (label: string, onClick: EventListenerOrEventListenerObject): HTMLElement {\n const button = document.createElement('button')\n button.setAttribute('style', style.headerUserMenuButton)\n button.onmouseover = function () {\n button.setAttribute('style', style.headerUserMenuButtonHover)\n }\n button.onmouseout = function () {\n button.setAttribute('style', style.headerUserMenuButton)\n }\n button.addEventListener('click', onClick)\n button.innerText = label\n return button\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createUserMenuLink (label: string, href: string, target?: string): HTMLElement {\n const link = document.createElement('a')\n link.setAttribute('style', style.headerUserMenuLink)\n link.onmouseover = function () {\n link.setAttribute('style', style.headerUserMenuLinkHover)\n }\n link.onmouseout = function () {\n link.setAttribute('style', style.headerUserMenuLink)\n }\n link.href = href\n link.innerText = label\n if (target) link.target = target\n return link\n}\n\n/**\n * @ignore exporting this only for the unit test\n */\nexport async function createUserMenu (store: IndexedFormula, user: NamedNode, userMenuList: MenuItems[]): Promise<HTMLElement> {\n const fetcher = (<any>store).fetcher\n if (fetcher) {\n // Making sure that Profile is loaded before building menu\n await fetcher.load(user)\n }\n\n const loggedInMenuList = document.createElement('ul')\n loggedInMenuList.setAttribute('style', style.headerUserMenuList)\n if (userMenuList) {\n userMenuList.forEach(function (menuItem) {\n const menuItemType: string = (menuItem as MenuItemLink).url ? 'url' : 'onclick'\n if (menuItemType === 'url') {\n loggedInMenuList.appendChild(createUserMenuItem(createUserMenuLink(menuItem.label, (menuItem as MenuItemLink).url, (menuItem as MenuItemLink).target)))\n } else {\n loggedInMenuList.appendChild(createUserMenuItem(createUserMenuButton(menuItem.label, (menuItem as MenuItemButton).onclick)))\n }\n })\n }\n const loggedInMenu = document.createElement('nav')\n\n loggedInMenu.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\n loggedInMenu.setAttribute('aria-hidden', 'true')\n loggedInMenu.setAttribute('id', 'loggedInNav')\n loggedInMenu.appendChild(loggedInMenuList)\n\n const loggedInMenuTrigger = document.createElement('button')\n loggedInMenuTrigger.setAttribute('style', style.headerUserMenuTrigger)\n loggedInMenuTrigger.type = 'button'\n const profileImg = getProfileImg(store, user)\n if (typeof profileImg === 'string') {\n loggedInMenuTrigger.innerHTML = profileImg\n } else {\n loggedInMenuTrigger.appendChild(profileImg)\n }\n\n const loggedInMenuContainer = document.createElement('div')\n loggedInMenuContainer.setAttribute('style', style.headerBannerUserMenuNotDisplayed)\n loggedInMenuContainer.appendChild(loggedInMenuTrigger)\n loggedInMenuContainer.appendChild(loggedInMenu)\n\n const throttledMenuToggle = throttle((event: Event) => toggleMenu(event, loggedInMenuTrigger, loggedInMenu), 50)\n loggedInMenuTrigger.addEventListener('click', throttledMenuToggle)\n let timer = setTimeout(() => null, 0)\n loggedInMenuContainer.addEventListener('mouseover', event => {\n clearTimeout(timer)\n throttledMenuToggle(event)\n const nav = document.getElementById('loggedInNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenu)\n })\n loggedInMenuContainer.addEventListener('mouseout', event => {\n timer = setTimeout(() => throttledMenuToggle(event), 200)\n const nav = document.getElementById('loggedInNav')\n nav?.setAttribute('style', style.headerUserMenuNavigationMenuNotDisplayed)\n })\n\n return loggedInMenuContainer\n}\n\n/**\n * @ignore exporting this only for the unit test\n */\nexport function createUserMenuItem (child: HTMLElement): HTMLElement {\n const menuProfileItem = document.createElement('li')\n menuProfileItem.setAttribute('style', style.headerUserMenuListItem)\n menuProfileItem.appendChild(child)\n return menuProfileItem\n}\n/**\n * @ignore exporting this only for the unit test\n */\nexport function getProfileImg (store: IndexedFormula, user: NamedNode): string | HTMLElement {\n let profileUrl = null\n try {\n profileUrl = widgets.findImage(user)\n if (!profileUrl) {\n return emptyProfile\n }\n } catch {\n return emptyProfile\n }\n\n const profileImage = document.createElement('div')\n profileImage.setAttribute('style', style.headerUserMenuPhoto)\n profileImage.style.backgroundImage = `url(${profileUrl})`\n return profileImage\n}\n\n/**\n * @internal\n */\nfunction toggleMenu (event: Event, trigger: HTMLButtonElement, menu: HTMLElement): void {\n const isExpanded = trigger.getAttribute('aria-expanded') === 'true'\n const expand = event.type === 'mouseover'\n const close = event.type === 'mouseout'\n if ((isExpanded && expand) || (!isExpanded && close)) {\n return\n }\n trigger.setAttribute('aria-expanded', (!isExpanded).toString())\n menu.setAttribute('aria-hidden', isExpanded.toString())\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAMA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAC,uBAAA,CAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAD,uBAAA,CAAAJ,OAAA;AACA,IAAAM,aAAA,GAAAN,OAAA;AACA,IAAAO,oBAAA,GAAAP,OAAA;AAA+D,SAAAQ,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAL,wBAAAS,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,aAAAE,OAAA,CAAAF,GAAA,yBAAAA,GAAA,uCAAAA,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cA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3C,UAAUA,CAAED,KAAY,EAAEgD,OAA0B,EAAEC,IAAiB,EAAQ;EACtF,IAAMC,UAAU,GAAGF,OAAO,CAACG,YAAY,CAAC,eAAe,CAAC,KAAK,MAAM;EACnE,IAAMC,MAAM,GAAGpD,KAAK,CAACN,IAAI,KAAK,WAAW;EACzC,IAAM2D,KAAK,GAAGrD,KAAK,CAACN,IAAI,KAAK,UAAU;EACvC,IAAKwD,UAAU,IAAIE,MAAM,IAAM,CAACF,UAAU,IAAIG,KAAM,EAAE;IACpD;EACF;EACAL,OAAO,CAAClF,YAAY,CAAC,eAAe,EAAE,CAAC,CAACoF,UAAU,EAAEI,QAAQ,EAAE,CAAC;EAC/DL,IAAI,CAACnF,YAAY,CAAC,aAAa,EAAEoF,UAAU,CAACI,QAAQ,EAAE,CAAC;AACzD"}
|
package/lib/log.js
CHANGED
|
@@ -38,10 +38,7 @@ var TDEBUG = 32;
|
|
|
38
38
|
var TALL = 63;
|
|
39
39
|
|
|
40
40
|
/** @internal */
|
|
41
|
-
var LogLevel
|
|
42
|
-
/** @internal */
|
|
43
|
-
exports.LogLevel = LogLevel;
|
|
44
|
-
(function (LogLevel) {
|
|
41
|
+
var LogLevel = /*#__PURE__*/function (LogLevel) {
|
|
45
42
|
LogLevel[LogLevel["Error"] = 1] = "Error";
|
|
46
43
|
LogLevel[LogLevel["Warning"] = 2] = "Warning";
|
|
47
44
|
LogLevel[LogLevel["Message"] = 4] = "Message";
|
|
@@ -49,7 +46,10 @@ exports.LogLevel = LogLevel;
|
|
|
49
46
|
LogLevel[LogLevel["Info"] = 16] = "Info";
|
|
50
47
|
LogLevel[LogLevel["Debug"] = 32] = "Debug";
|
|
51
48
|
LogLevel[LogLevel["All"] = 63] = "All";
|
|
52
|
-
|
|
49
|
+
return LogLevel;
|
|
50
|
+
}({});
|
|
51
|
+
/** @internal */
|
|
52
|
+
exports.LogLevel = LogLevel;
|
|
53
53
|
var _level = TERROR + TWARN + TMESG;
|
|
54
54
|
/** @internal */
|
|
55
55
|
var _ascending = false;
|
package/lib/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","names":["TERROR","TWARN","TMESG","TSUCCESS","TINFO","TDEBUG","TALL","LogLevel","exports","_level","_ascending","_dom","document","_window","window","log","str","type","arguments","length","undefined","typestr","logArea","getElementById","addendum","createElement","setAttribute","now","Date","innerHTML","concat","getHours","getMinutes","getSeconds","escapeForXML","insertBefore","firstChild","appendChild","console","msg","message","warn","debug","info","error","success","alert","clear","_dom2","setLevel","level","dumpHTML","_dom3","_dom3$body","body","logAscending","logDescending","replace","setInternals"],"sources":["../src/log.ts"],"sourcesContent":["// /////////////////////// Logging\n//\n// bitmask levels\n// const TNONE = 0\n/** @internal */\nconst TERROR = 1\n/** @internal */\nconst TWARN = 2\n/** @internal */\nconst TMESG = 4\n/** @internal */\nconst TSUCCESS = 8\n/** @internal */\nconst TINFO = 16\n/** @internal */\nconst TDEBUG = 32\n/** @internal */\nconst TALL = 63\n\n/** @internal */\nexport enum LogLevel {\n Error = TERROR,\n Warning = TWARN,\n Message = TMESG,\n Success = TSUCCESS,\n Info = TINFO,\n Debug = TDEBUG,\n All = TALL\n}\n\n/** @internal */\nlet _level: number = TERROR + TWARN + TMESG\n/** @internal */\nlet _ascending: boolean = false\n/** @internal */\nlet _dom: HTMLDocument = document // must be able to override for tests\n/** @internal */\nlet _window: Window = window // must be able to override for tests\n\n/** @internal */\nfunction log (str: string, type: number = TMESG, typestr: string = 'mesg') {\n if (!(_level & type)) return // bitmask\n\n if (typeof _dom !== 'undefined') {\n const logArea = _dom.getElementById('status')\n if (!logArea) return\n\n const addendum = _dom.createElement('span')\n addendum.setAttribute('class', typestr)\n const now = new Date()\n addendum.innerHTML = `${now.getHours()}:${now.getMinutes()}:${now.getSeconds()} [${typestr}] ${escapeForXML(str)}<br/>`\n if (_ascending) {\n logArea.insertBefore(addendum, logArea.firstChild)\n } else {\n logArea.appendChild(addendum)\n }\n } else if (typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.log(str)\n }\n}\n\n/**\n * Adds a message to the element with id \"status\". The messages are prepended with\n * time and type of message, in this case [mesg].\n */\nexport function msg (message: string) {\n log(message)\n}\n\n/**\n * Adds a warning message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [warn].\n */\nexport function warn (message: string): void {\n log(message, TWARN, 'warn')\n}\n\n/**\n * Adds a debugging message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [dbug].\n */\nexport function debug (message: string): void {\n log(message, TDEBUG, 'dbug')\n}\n\n/**\n * Adds a info message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [info].\n */\nexport function info (message: string): void {\n log(message, TINFO, 'info')\n}\n\n/**\n * Adds a error to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [eror].\n */\nexport function error (message: string): void {\n log(message, TERROR, 'eror')\n}\n\n/**\n * Adds a success message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [good].\n */\nexport function success (message: string): void {\n log(message, TSUCCESS, 'good')\n}\n\n/**\n * Uses the global alert to send an alert. If global alert is not available, it\n * will output the message using the method [[warning]]s.\n */\nexport function alert (message: string): void {\n if (_window && typeof _window.alert !== 'undefined') {\n _window.alert(message)\n } else {\n warn(message)\n }\n}\n\n/**\n * Will clear the content of the element with id \"status\".\n */\nexport function clear (): void {\n const logArea = _dom?.getElementById('status')\n if (!logArea) return\n logArea.innerHTML = ''\n}\n\n/**\n * Lets you configure which types of messages will be shown. The module uses\n * [bitmask](https://en.wikipedia.org/wiki/Mask_(computing)) to filter which\n * types of messages should be shown. E.g. if you only want warning messages\n * to be shown, pass 2 to the function, if you want warning and success to be\n * shown, pass 10 (2+8). By passing the sum of all, 63, you'll show all\n * types of messages.\n *\n * - Error: 1\n * - Warning: 2\n * - Message: 4\n * - Success: 8\n * - Info: 16\n * - Debug: 32\n */\nexport function setLevel (level: number): void {\n _level = TALL\n debug('Log level is now ' + level)\n _level = level\n}\n\n/**\n * Will dump the current HTML using the [[debug]] method.\n */\nexport function dumpHTML (): void {\n if (!_dom) return\n const level = _level\n _level = TALL\n debug(_dom?.body?.innerHTML || '')\n _level = level\n}\n\n/**\n * Will start prepending messages the list of log messages.\n */\nexport function logAscending () {\n _ascending = true\n}\n\n/**\n * Will start appending messages the list of log messages. (This is default\n * behavior.)\n */\nexport function logDescending () {\n _ascending = false\n}\n\n/** @internal */\nexport function escapeForXML (str: string): string {\n // can be replaced with function utils module when migrating\n return str\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n}\n\n/** @internal */\nexport function setInternals (window, document) {\n _window = window\n _dom = document\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA,IAAMA,MAAM,GAAG,CAAC;AAChB;AACA,IAAMC,KAAK,GAAG,CAAC;AACf;AACA,IAAMC,KAAK,GAAG,CAAC;AACf;AACA,IAAMC,QAAQ,GAAG,CAAC;AAClB;AACA,IAAMC,KAAK,GAAG,EAAE;AAChB;AACA,IAAMC,MAAM,GAAG,EAAE;AACjB;AACA,IAAMC,IAAI,GAAG,EAAE;;AAEf;AAAA,IACYC,QAAQ
|
|
1
|
+
{"version":3,"file":"log.js","names":["TERROR","TWARN","TMESG","TSUCCESS","TINFO","TDEBUG","TALL","LogLevel","exports","_level","_ascending","_dom","document","_window","window","log","str","type","arguments","length","undefined","typestr","logArea","getElementById","addendum","createElement","setAttribute","now","Date","innerHTML","concat","getHours","getMinutes","getSeconds","escapeForXML","insertBefore","firstChild","appendChild","console","msg","message","warn","debug","info","error","success","alert","clear","_dom2","setLevel","level","dumpHTML","_dom3","_dom3$body","body","logAscending","logDescending","replace","setInternals"],"sources":["../src/log.ts"],"sourcesContent":["// /////////////////////// Logging\n//\n// bitmask levels\n// const TNONE = 0\n/** @internal */\nconst TERROR = 1\n/** @internal */\nconst TWARN = 2\n/** @internal */\nconst TMESG = 4\n/** @internal */\nconst TSUCCESS = 8\n/** @internal */\nconst TINFO = 16\n/** @internal */\nconst TDEBUG = 32\n/** @internal */\nconst TALL = 63\n\n/** @internal */\nexport enum LogLevel {\n Error = TERROR,\n Warning = TWARN,\n Message = TMESG,\n Success = TSUCCESS,\n Info = TINFO,\n Debug = TDEBUG,\n All = TALL\n}\n\n/** @internal */\nlet _level: number = TERROR + TWARN + TMESG\n/** @internal */\nlet _ascending: boolean = false\n/** @internal */\nlet _dom: HTMLDocument = document // must be able to override for tests\n/** @internal */\nlet _window: Window = window // must be able to override for tests\n\n/** @internal */\nfunction log (str: string, type: number = TMESG, typestr: string = 'mesg') {\n if (!(_level & type)) return // bitmask\n\n if (typeof _dom !== 'undefined') {\n const logArea = _dom.getElementById('status')\n if (!logArea) return\n\n const addendum = _dom.createElement('span')\n addendum.setAttribute('class', typestr)\n const now = new Date()\n addendum.innerHTML = `${now.getHours()}:${now.getMinutes()}:${now.getSeconds()} [${typestr}] ${escapeForXML(str)}<br/>`\n if (_ascending) {\n logArea.insertBefore(addendum, logArea.firstChild)\n } else {\n logArea.appendChild(addendum)\n }\n } else if (typeof console !== 'undefined') {\n // eslint-disable-next-line no-console\n console.log(str)\n }\n}\n\n/**\n * Adds a message to the element with id \"status\". The messages are prepended with\n * time and type of message, in this case [mesg].\n */\nexport function msg (message: string) {\n log(message)\n}\n\n/**\n * Adds a warning message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [warn].\n */\nexport function warn (message: string): void {\n log(message, TWARN, 'warn')\n}\n\n/**\n * Adds a debugging message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [dbug].\n */\nexport function debug (message: string): void {\n log(message, TDEBUG, 'dbug')\n}\n\n/**\n * Adds a info message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [info].\n */\nexport function info (message: string): void {\n log(message, TINFO, 'info')\n}\n\n/**\n * Adds a error to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [eror].\n */\nexport function error (message: string): void {\n log(message, TERROR, 'eror')\n}\n\n/**\n * Adds a success message to the element with id \"status\". The messages are\n * prepended with time and type of message, in this case [good].\n */\nexport function success (message: string): void {\n log(message, TSUCCESS, 'good')\n}\n\n/**\n * Uses the global alert to send an alert. If global alert is not available, it\n * will output the message using the method [[warning]]s.\n */\nexport function alert (message: string): void {\n if (_window && typeof _window.alert !== 'undefined') {\n _window.alert(message)\n } else {\n warn(message)\n }\n}\n\n/**\n * Will clear the content of the element with id \"status\".\n */\nexport function clear (): void {\n const logArea = _dom?.getElementById('status')\n if (!logArea) return\n logArea.innerHTML = ''\n}\n\n/**\n * Lets you configure which types of messages will be shown. The module uses\n * [bitmask](https://en.wikipedia.org/wiki/Mask_(computing)) to filter which\n * types of messages should be shown. E.g. if you only want warning messages\n * to be shown, pass 2 to the function, if you want warning and success to be\n * shown, pass 10 (2+8). By passing the sum of all, 63, you'll show all\n * types of messages.\n *\n * - Error: 1\n * - Warning: 2\n * - Message: 4\n * - Success: 8\n * - Info: 16\n * - Debug: 32\n */\nexport function setLevel (level: number): void {\n _level = TALL\n debug('Log level is now ' + level)\n _level = level\n}\n\n/**\n * Will dump the current HTML using the [[debug]] method.\n */\nexport function dumpHTML (): void {\n if (!_dom) return\n const level = _level\n _level = TALL\n debug(_dom?.body?.innerHTML || '')\n _level = level\n}\n\n/**\n * Will start prepending messages the list of log messages.\n */\nexport function logAscending () {\n _ascending = true\n}\n\n/**\n * Will start appending messages the list of log messages. (This is default\n * behavior.)\n */\nexport function logDescending () {\n _ascending = false\n}\n\n/** @internal */\nexport function escapeForXML (str: string): string {\n // can be replaced with function utils module when migrating\n return str\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n}\n\n/** @internal */\nexport function setInternals (window, document) {\n _window = window\n _dom = document\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA,IAAMA,MAAM,GAAG,CAAC;AAChB;AACA,IAAMC,KAAK,GAAG,CAAC;AACf;AACA,IAAMC,KAAK,GAAG,CAAC;AACf;AACA,I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,aAAaA,CAAA,EAAI;EAC/B9C,UAAU,GAAG,KAAK;AACpB;;AAEA;AACO,SAASwB,YAAYA,CAAElB,GAAW,EAAU;EACjD;EACA,OAAOA,GAAG,CACPyC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CACtBA,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC,CACrBA,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;AAC1B;;AAEA;AACO,SAASC,YAAYA,CAAE5C,MAAM,EAAEF,QAAQ,EAAE;EAC9CC,OAAO,GAAGC,MAAM;EAChBH,IAAI,GAAGC,QAAQ;AACjB"}
|
package/lib/login/login.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/login/login.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAa,SAAS,EAAM,MAAM,QAAQ,CAAA;AAGjD,OAAO,EACL,UAAU,EACV,qBAAqB,EAYtB,MAAM,aAAa,CAAA;AAwBpB;;;;GAIG;AAEH,wBAAgB,cAAc,CAAE,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAwB9F;AAED;;;;;;;GAOG;AAEH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,qBAAqB,GAC7B,OAAO,CAAC,qBAAqB,CAAC,
|
|
1
|
+
{"version":3,"file":"login.d.ts","sourceRoot":"","sources":["../../src/login/login.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAa,SAAS,EAAM,MAAM,QAAQ,CAAA;AAGjD,OAAO,EACL,UAAU,EACV,qBAAqB,EAYtB,MAAM,aAAa,CAAA;AAwBpB;;;;GAIG;AAEH,wBAAgB,cAAc,CA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CAAC;CACjB,GACL,WAAW,CAwFb;AAyBD;;;GAGG;AAEH;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,YAAY,EACjB,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,GAC9D,WAAW,CA0Pb;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAC5B,GAAG,EAAE,YAAY,EACjB,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,GAC5D,WAAW,CAmBb;AACD;;;GAGG;AACH,wBAAsB,YAAY,IAAK,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,CAgB/D;AAED;;GAEG;AACH,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,GAC3B,OAAO,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAGhC"}
|
package/lib/login/login.js
CHANGED
|
@@ -34,7 +34,30 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
34
34
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
35
35
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
|
36
36
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
37
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
37
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } /* eslint-disable camelcase */ /**
|
|
38
|
+
* Signing in, signing up, profile and preferences reloading
|
|
39
|
+
* Type index management
|
|
40
|
+
*
|
|
41
|
+
* Many functions in this module take a context object which
|
|
42
|
+
* holds various RDF symbols, add to it, and return a promise of it.
|
|
43
|
+
*
|
|
44
|
+
* * `me` RDF symbol for the user's WebID
|
|
45
|
+
* * `publicProfile` The user's public profile, iff loaded
|
|
46
|
+
* * `preferencesFile` The user's personal preference file, iff loaded
|
|
47
|
+
* * `index.public` The user's public type index file
|
|
48
|
+
* * `index.private` The user's private type index file
|
|
49
|
+
*
|
|
50
|
+
* Not RDF symbols:
|
|
51
|
+
* * `noun` A string in english for the type of thing -- like "address book"
|
|
52
|
+
* * `instance` An array of nodes which are existing instances
|
|
53
|
+
* * `containers` An array of nodes of containers of instances
|
|
54
|
+
* * `div` A DOM element where UI can be displayed
|
|
55
|
+
* * `statusArea` A DOM element (opt) progress stuff can be displayed, or error messages
|
|
56
|
+
* *
|
|
57
|
+
* * Vocabulary: "load" loads a file if it exists;
|
|
58
|
+
* * 'Ensure" CREATES the file if it does not exist (if it can) and then loads it.
|
|
59
|
+
* @packageDocumentation
|
|
60
|
+
*/ // eslint-disable-next-line camelcase
|
|
38
61
|
var store = _solidLogic.solidLogicSingleton.store;
|
|
39
62
|
var _solidLogicSingleton$ = _solidLogic.solidLogicSingleton.profile,
|
|
40
63
|
loadPreferences = _solidLogicSingleton$.loadPreferences,
|
|
@@ -100,104 +123,93 @@ function ensureLoadedPreferences(_x) {
|
|
|
100
123
|
// used to be logInLoadProfile
|
|
101
124
|
function _ensureLoadedPreferences() {
|
|
102
125
|
_ensureLoadedPreferences = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(context) {
|
|
103
|
-
var
|
|
126
|
+
var progressDisplay, preferencesFile, m2;
|
|
104
127
|
return _regenerator["default"].wrap(function _callee4$(_context4) {
|
|
105
128
|
while (1) switch (_context4.prev = _context4.next) {
|
|
106
129
|
case 0:
|
|
107
|
-
complain = function _complain(message) {
|
|
108
|
-
message = "ensureLoadedPreferences: ".concat(message);
|
|
109
|
-
if (statusArea) {
|
|
110
|
-
// statusArea.innerHTML = ''
|
|
111
|
-
statusArea.appendChild(widgets.errorMessageBlock(context.dom, message));
|
|
112
|
-
}
|
|
113
|
-
debug.log(message);
|
|
114
|
-
// reject(new Error(message))
|
|
115
|
-
};
|
|
116
130
|
if (!context.preferencesFile) {
|
|
117
|
-
_context4.next =
|
|
131
|
+
_context4.next = 2;
|
|
118
132
|
break;
|
|
119
133
|
}
|
|
120
134
|
return _context4.abrupt("return", Promise.resolve(context));
|
|
121
|
-
case
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
_context4.prev = 4;
|
|
125
|
-
_context4.next = 7;
|
|
135
|
+
case 2:
|
|
136
|
+
_context4.prev = 2;
|
|
137
|
+
_context4.next = 5;
|
|
126
138
|
return ensureLoadedProfile(context);
|
|
127
|
-
case
|
|
139
|
+
case 5:
|
|
128
140
|
context = _context4.sent;
|
|
129
|
-
_context4.next =
|
|
141
|
+
_context4.next = 8;
|
|
130
142
|
return loadPreferences(context.me);
|
|
131
|
-
case
|
|
143
|
+
case 8:
|
|
132
144
|
preferencesFile = _context4.sent;
|
|
133
145
|
if (progressDisplay) {
|
|
134
146
|
progressDisplay.parentNode.removeChild(progressDisplay);
|
|
135
147
|
}
|
|
136
148
|
context.preferencesFile = preferencesFile;
|
|
137
|
-
_context4.next =
|
|
149
|
+
_context4.next = 49;
|
|
138
150
|
break;
|
|
139
|
-
case
|
|
140
|
-
_context4.prev =
|
|
141
|
-
_context4.t0 = _context4["catch"](
|
|
151
|
+
case 13:
|
|
152
|
+
_context4.prev = 13;
|
|
153
|
+
_context4.t0 = _context4["catch"](2);
|
|
142
154
|
if (!(_context4.t0 instanceof _solidLogic.UnauthorizedError)) {
|
|
143
|
-
_context4.next =
|
|
155
|
+
_context4.next = 20;
|
|
144
156
|
break;
|
|
145
157
|
}
|
|
146
158
|
m2 = 'Ooops - you are not authenticated (properly logged in) to for me to read your preference file. Try loggin out and logging in?';
|
|
147
159
|
(0, _log.alert)(m2);
|
|
148
|
-
_context4.next =
|
|
160
|
+
_context4.next = 49;
|
|
149
161
|
break;
|
|
150
|
-
case
|
|
162
|
+
case 20:
|
|
151
163
|
if (!(_context4.t0 instanceof _solidLogic.CrossOriginForbiddenError)) {
|
|
152
|
-
_context4.next =
|
|
164
|
+
_context4.next = 26;
|
|
153
165
|
break;
|
|
154
166
|
}
|
|
155
167
|
m2 = "Unauthorized: Assuming preference file blocked for origin ".concat(window.location.origin);
|
|
156
168
|
context.preferencesFileError = m2;
|
|
157
169
|
return _context4.abrupt("return", context);
|
|
158
|
-
case
|
|
170
|
+
case 26:
|
|
159
171
|
if (!(_context4.t0 instanceof _solidLogic.SameOriginForbiddenError)) {
|
|
160
|
-
_context4.next =
|
|
172
|
+
_context4.next = 32;
|
|
161
173
|
break;
|
|
162
174
|
}
|
|
163
175
|
m2 = 'You are not authorized to read your preference file. This may be because you are using an untrusted web app.';
|
|
164
176
|
debug.warn(m2);
|
|
165
177
|
return _context4.abrupt("return", context);
|
|
166
|
-
case
|
|
178
|
+
case 32:
|
|
167
179
|
if (!(_context4.t0 instanceof _solidLogic.NotEditableError)) {
|
|
168
|
-
_context4.next =
|
|
180
|
+
_context4.next = 38;
|
|
169
181
|
break;
|
|
170
182
|
}
|
|
171
183
|
m2 = 'You are not authorized to edit your preference file. This may be because you are using an untrusted web app.';
|
|
172
184
|
debug.warn(m2);
|
|
173
185
|
return _context4.abrupt("return", context);
|
|
174
|
-
case
|
|
186
|
+
case 38:
|
|
175
187
|
if (!(_context4.t0 instanceof _solidLogic.WebOperationError)) {
|
|
176
|
-
_context4.next =
|
|
188
|
+
_context4.next = 43;
|
|
177
189
|
break;
|
|
178
190
|
}
|
|
179
191
|
m2 = 'You are not authorized to edit your preference file. This may be because you are using an untrusted web app.';
|
|
180
192
|
debug.warn(m2);
|
|
181
|
-
_context4.next =
|
|
193
|
+
_context4.next = 49;
|
|
182
194
|
break;
|
|
183
|
-
case
|
|
195
|
+
case 43:
|
|
184
196
|
if (!(_context4.t0 instanceof _solidLogic.FetchError)) {
|
|
185
|
-
_context4.next =
|
|
197
|
+
_context4.next = 48;
|
|
186
198
|
break;
|
|
187
199
|
}
|
|
188
200
|
m2 = "Strange: Error ".concat(_context4.t0.status, " trying to read your preference file.").concat(_context4.t0.message);
|
|
189
201
|
(0, _log.alert)(m2);
|
|
190
|
-
_context4.next =
|
|
202
|
+
_context4.next = 49;
|
|
191
203
|
break;
|
|
192
|
-
case
|
|
204
|
+
case 48:
|
|
193
205
|
throw new Error("(via loadPrefs) ".concat(_context4.t0));
|
|
194
|
-
case
|
|
206
|
+
case 49:
|
|
195
207
|
return _context4.abrupt("return", context);
|
|
196
|
-
case
|
|
208
|
+
case 50:
|
|
197
209
|
case "end":
|
|
198
210
|
return _context4.stop();
|
|
199
211
|
}
|
|
200
|
-
}, _callee4, null, [[
|
|
212
|
+
}, _callee4, null, [[2, 13]]);
|
|
201
213
|
}));
|
|
202
214
|
return _ensureLoadedPreferences.apply(this, arguments);
|
|
203
215
|
}
|