solid-ui 2.4.33 → 2.4.34-bd841bfc
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/841.solid-ui.min.js +1 -1
- package/dist/841.solid-ui.min.js.map +1 -1
- package/dist/solid-ui.js +4463 -1872
- package/dist/solid-ui.js.map +1 -1
- package/dist/solid-ui.min.js +1 -1
- package/dist/solid-ui.min.js.LICENSE.txt +7 -0
- package/dist/solid-ui.min.js.map +1 -1
- package/lib/acl/access-controller.js +4 -4
- package/lib/acl/access-controller.js.map +1 -1
- package/lib/acl/access-groups.js +3 -3
- package/lib/acl/access-groups.js.map +1 -1
- package/lib/acl/acl-control.js +2 -2
- package/lib/acl/acl-control.js.map +1 -1
- package/lib/acl/acl.js +14 -14
- package/lib/acl/acl.js.map +1 -1
- package/lib/acl/add-agent-buttons.js +6 -6
- package/lib/acl/add-agent-buttons.js.map +1 -1
- package/lib/chat/bookmarks.js +5 -5
- package/lib/chat/bookmarks.js.map +1 -1
- package/lib/chat/chatLogic.js +6 -6
- package/lib/chat/chatLogic.js.map +1 -1
- package/lib/chat/dateFolder.js +5 -5
- package/lib/chat/dateFolder.js.map +1 -1
- package/lib/chat/infinite.js +18 -18
- package/lib/chat/infinite.js.map +1 -1
- package/lib/chat/keys.js +3 -3
- package/lib/chat/keys.js.map +1 -1
- package/lib/chat/message.js +13 -13
- package/lib/chat/message.js.map +1 -1
- package/lib/chat/messageTools.js +10 -10
- package/lib/chat/messageTools.js.map +1 -1
- package/lib/chat/thread.js +8 -8
- package/lib/chat/thread.js.map +1 -1
- package/lib/footer/index.js +2 -2
- package/lib/footer/index.js.map +1 -1
- package/lib/header/index.js +4 -4
- package/lib/header/index.js.map +1 -1
- package/lib/login/login.js +14 -14
- package/lib/login/login.js.map +1 -1
- package/lib/media/media-capture.js +1 -1
- package/lib/media/media-capture.js.map +1 -1
- package/lib/messageArea.js.map +1 -1
- package/lib/pad.js +16 -16
- package/lib/pad.js.map +1 -1
- package/lib/participation.js +4 -4
- package/lib/participation.js.map +1 -1
- package/lib/tabs.js +3 -3
- package/lib/tabs.js.map +1 -1
- package/lib/utils/headerFooterHelpers.js +1 -1
- package/lib/utils/headerFooterHelpers.js.map +1 -1
- package/lib/utils/index.js.map +1 -1
- package/lib/utils/keyHelpers/accessData.js +3 -3
- package/lib/utils/keyHelpers/accessData.js.map +1 -1
- package/lib/utils/keyHelpers/acl.js +1 -1
- package/lib/utils/keyHelpers/acl.js.map +1 -1
- package/lib/versionInfo.js +19 -19
- package/lib/versionInfo.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteBar.js +9 -9
- package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteField.js +2 -2
- package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompletePicker.js +11 -11
- package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
- package/lib/widgets/forms/autocomplete/language.js +2 -2
- package/lib/widgets/forms/autocomplete/language.js.map +1 -1
- package/lib/widgets/forms/autocomplete/publicData.js +9 -9
- package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
- package/lib/widgets/forms.js +12 -12
- package/lib/widgets/forms.js.map +1 -1
- package/lib/widgets/multiSelect.js.map +1 -1
- package/lib/widgets/peoplePicker.js.map +1 -1
- package/package.json +2 -2
package/lib/chat/infinite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"infinite.js","names":["$rdf","_interopRequireWildcard","require","_solidLogic","debug","_iconBase","ns","widgets","_chatLogic","_message","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","F","s","done","value","_e2","f","TypeError","normalCompletion","didErr","err","step","next","_e3","minLen","_arrayLikeToArray","prototype","toString","slice","constructor","name","from","test","arr","len","arr2","desktopNotification","str","window","warn","Notification","permission","requestPermission","then","insertMessageIntoTable","_x","_x2","_x3","_x4","_x5","_x6","_insertMessageIntoTable","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee","channelObject","messageTable","message","fresh","options","userContext","messageRow","ele","newestFirst","dateString","wrap","_callee$","_context","prev","renderMessageRow","sent","selectedMessage","sameTerm","style","backgroundColor","selectedElement","firstChild","abrupt","newestfirst","AJAR_date","insertBefore","nextSibling","appendChild","stop","infiniteMessageArea","_x7","_x8","_x9","_x10","_infiniteMessageArea","_callee15","dom","wasStore","chatChannel","syncMessages","_syncMessages","addMessage","_addMessage","insertPreviousMessages","_insertPreviousMessages","removePreviousMessages","createMessageTable","_createMessageTable","renderMessageTable","_renderMessageTable","addNewChatDocumentIfNewDay","_addNewChatDocumentIfNewDay","appendCurrentMessages","_appendCurrentMessages","loadMoreWhereNeeded","_loadMoreWhereNeeded","loadInitialContent","_loadInitialContent","dateFolder","div","statusArea","liveMessageTable","threadRootMessage","earliest","latest","thread","threadTime","lock","_callee15$","_context15","_loadInitialContent3","_callee14","yank","fixScroll","live","selectedDocument","threadRootDocument","initialDocment","now","todayDocument","selectedMessageTable","selectedDate","_callee14$","_context14","_fixScroll","scrollIntoView","block","inputRow","_yank","doc","Date","leafDocumentFromDate","dateFromLeafDocument","setTimeout","addEventListener","solo","document","body","_loadInitialContent2","_loadMoreWhereNeeded3","_callee13","event","freeze","magicZone","scrollBottom","scrollTop","_callee13$","_context13","initial","extendBackwards","scrollHeight","clientHeight","extendForwards","_loadMoreWhereNeeded2","_x20","_x21","_appendCurrentMessage2","_callee12","chatDocument","_callee12$","_context12","refresh","_callee11","_callee11$","_context11","store","updater","addDownstreamChangeListener","_appendCurrentMessage","_addNewChatDocumentIf2","_callee10","newChatDocument","oldChatDocument","sts","_callee10$","_context10","removeChild","holds","rdfs","st","update","alert","_addNewChatDocumentIf","_renderMessageTable3","_callee9","date","scrollBackbutton","scrollForwardButton","_extendBackwards","setScrollBackbuttonIcon","_extendForwards","setScrollForwardButtonIcon","scrollForwardButtonHandler","_scrollForwardButtonHandler","tr","titleTR","scrollBackbuttonCell","dateCell","scrollForwardButtonCell","_iterator2","_step2","_callee9$","_context9","_scrollForwardButtonH2","_callee8","_event","_callee8$","_context8","extendedForwards","_scrollForwardButtonH","_x22","_setScrollForwardButt","sense","scrollForwardIcon","getScrollForwardButtonIcon","setAttribute","icons","iconBase","_extendForwards3","_callee7","_callee7$","_context7","_extendForwards2","_setScrollBackbuttonI","extendedBack","scrollBackIcon","getScrollbackIcon","_extendBackwards3","_callee6","_callee6$","_context6","disabled","_extendBackwards2","createElement","width","renderMessageEditor","textContent","shortDate","toISOString","includeRemoveButton","cancelButton","_e","parentNode","statementsMatching","wf","object","t0","finish","_renderMessageTable2","_x18","_x19","_createMessageTable3","_callee5","statusTR","_callee5$","_context5","fetcher","createIfNotExists","response","status","log","errorMessageBlock","_createMessageTable2","_x16","_x17","_removePreviousMessag","backwards","previousSibling","extr","_insertPreviousMessag2","_callee4","extremity","todayDoc","newMessageTable","_callee4$","_context4","limit","loadPrevious","_insertPreviousMessag","_x15","_addMessage3","_callee3","id","_callee3$","_context3","isDeleted","showDeletedMessages","any","sioc","_addMessage2","_x13","_x14","_syncMessages3","_callee2","displayed","ele2","messages","stored","_iterator","_step","m","_callee2$","_context2","AJAR_subject","uri","each","refreshTree","_syncMessages2","_x11","_x12","authorDateOnLeft","ChatChannel","dct"],"sources":["../../src/chat/infinite.js"],"sourcesContent":["/**\n * Contains the [[infiniteMessageArea]] class\n * @packageDocumentation\n */\n// import { findBookmarkDocument } from './bookmarks'\nimport * as $rdf from 'rdflib' // pull in first avoid cross-refs\nimport { store } from 'solid-logic'\nimport * as debug from '../debug'\nimport { icons } from '../iconBase'\nimport * as ns from '../ns'\n// import * as style from '../style'\n// import * as utils from '../utils'\nimport * as widgets from '../widgets'\n// import * as pad from '../pad'\n// import { DateFolder } from './dateFolder'\nimport { ChatChannel, isDeleted } from './chatLogic'\nimport { renderMessageEditor, renderMessageRow } from './message'\n\n// const UI = { authn, icons, ns, media, pad, $rdf, store, style, utils, widgets }\n\nexport function desktopNotification (str) {\n // Let's check if the browser supports notifications\n if (!('Notification' in window)) {\n debug.warn('This browser does no t support desktop notification')\n } else if (Notification.permission === 'granted') {\n // Let's check whether notificatio n permissions have already been granted\n // eslint-disable-next-line no-new\n new Notification(str)\n } else if (Notification.permission !== 'denied') {\n // Otherwise, we need to ask the user for permission\n Notification.requestPermission().then(function (permission) {\n // If the user accepts, let's create a notification\n if (permission === 'granted') {\n // eslint-disable-next-line no-new\n new Notification(str)\n }\n })\n }\n // At last, if the user has denied notifications, and you\n // want to be respectful there is no need to bother them any more.\n}\n\n/**\n * Renders a chat message inside a `messageTable`\n */\nexport async function insertMessageIntoTable (channelObject, messageTable, message, fresh, options, userContext) {\n const messageRow = await renderMessageRow(channelObject,\n message,\n fresh,\n options,\n userContext\n )\n\n // const message = messageRow.AJAR_subject\n if (options.selectedMessage && options.selectedMessage.sameTerm(message)) {\n messageRow.style.backgroundColor = 'yellow'\n options.selectedElement = messageRow\n messageTable.selectedElement = messageRow\n }\n\n let done = false\n for (let ele = messageTable.firstChild; ; ele = ele.nextSibling) {\n if (!ele) {\n // empty\n break\n }\n const newestFirst = options.newestfirst === true\n const dateString = messageRow.AJAR_date\n if (\n (dateString > ele.AJAR_date && newestFirst) ||\n (dateString < ele.AJAR_date && !newestFirst)\n ) {\n messageTable.insertBefore(messageRow, ele)\n done = true\n break\n }\n }\n if (!done) {\n messageTable.appendChild(messageRow)\n }\n}\n\n/**\n * Common code for a chat (discussion area of messages about something)\n * This version runs over a series of files for different time periods\n *\n * Parameters for the whole chat like its title are stored on\n * index.ttl#this and the chats messages are stored in YYYY/MM/DD/chat.ttl\n *\n * Use to import store as param 2, now ignores it and uses the UI main store\n *\n * Options include:\n\n - shiftEnterSendsMessage: Use shift/enter to send message, Enter to add newline, instead of the reverse.\n - authorDateOnLeft: Display the author's anme and date of the message in the left column instead of first above the content\n - selectedMessage: Display one message highlighted with the chat around it\n - solo: By itelf on a webpage, so user scroll anywhere in the web page scan scroll the chat.\n - newestFirst: Arrange the chat messages chronologically newest at the top insted of at the bottom\n - infinite: Use infinite scroll\n - showDeletedMessages: Show messages which have been delted as \"deleted message\". Otherwise hide them.\n - expandImagesInline: If a URI by itself in a message looks like an image URI, replace it with the image\n - inlineImageHeightEms: The height (in ems) of images expaned from their URIs in the chat.\n\n */\nexport async function infiniteMessageArea (dom, wasStore, chatChannel, options) {\n // ///////////////////////////////////////////////////////////////////////\n\n async function syncMessages (chatChannel, 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(chatChannel, ns.wf('message'), null, messageTable.chatDocument)\n\n const stored = {}\n for (const m of messages) {\n stored[m.uri] = true\n if (!displayed[m.uri]) {\n await addMessage(m, messageTable)\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 for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {\n if (ele.AJAR_subject) {\n // Refresh thumbs up etc\n widgets.refreshTree(ele) // Things inside may have changed too\n }\n }\n } // syncMessages\n\n // Called once per original message displayed\n async function addMessage (message, messageTable) {\n // const latest = await mostRecentVersion(message)\n // const content = store.any(latest, ns.sioc('content'))\n if (isDeleted(message) && !options.showDeletedMessages) {\n return // ignore deleted messaged -- @@ could also leave a placeholder\n }\n /* if (isReplaced(message)) { //\n return // this is old version\n } */\n let thread = store.any(null, ns.sioc('has_member'), message, message.doc())\n const id = store.any(message, ns.sioc('id'), null, message.doc())\n if (id && !thread) {\n thread = store.any(null, ns.sioc('has_member'), id, message.doc())\n }\n\n if (options.thread) { // only show things in thread\n if (store.holds(message, ns.sioc('has_reply'), options.thread)) { // root of thread\n // debug.log(' addMessage: displaying root of thread ' + thread)\n } else if (thread && thread.sameTerm(options.thread)) {\n // debug.log(' addMessage: Displaying body of thread ' + message.uri.slice(-10))\n } else {\n // debug.log(' addMessage: Suppress non-thread message in thread table ' + message.uri.slice(-10))\n return // suppress message not in thread\n }\n } else { // Not threads\n if (thread) {\n // debug.log(' addMessage: Suppress thread message in non-thread table ' + message.uri.slice(-10))\n return // supress thread messages in body\n } else {\n // debug.log(' addMessage: Normal non-thread message in non-thread table ' + message.uri.slice(-10))\n }\n }\n if (!messageTable.fresh) { // if messageTable has been updated with insertMessageIntoTable() don't do it again\n // debug.log('@@@ infinite insertMessageIntoTable ' + message) // alain\n // debug.log('fresh ' + messageTable.fresh)\n // debug.log(messageTable)\n await insertMessageIntoTable(channelObject,\n messageTable,\n message,\n messageTable.fresh,\n options,\n userContext\n ) // fresh from elsewhere\n }\n }\n\n /* Add a new messageTable at the top/bottom\n\n */\n async function insertPreviousMessages (backwards) {\n const extremity = backwards ? earliest : latest\n let date = extremity.messageTable.date // day in mssecs\n\n // Are we at the top of a thread?\n if (backwards && earliest.limit && date <= earliest.limit) {\n if (!liveMessageTable) await appendCurrentMessages() // If necessary skip to today and add that\n return true // done\n }\n // debug.log(' insertPreviousMessages: loadPrevious given date ' + date)\n\n date = await dateFolder.loadPrevious(date, backwards) // backwards\n // debug.log(' insertPreviousMessages: loadPrevious returns date ' + date)\n\n /* debug.log(\n `insertPreviousMessages: from ${\n backwards ? 'backwards' : 'forwards'\n } loadPrevious: ${date}`\n ) */\n if (!date && !backwards && !liveMessageTable) {\n await appendCurrentMessages() // If necessary skip to today and add that\n }\n if (!date) return true // done\n let live = false\n if (!backwards) {\n const todayDoc = dateFolder.leafDocumentFromDate(new Date())\n const doc = dateFolder.leafDocumentFromDate(date)\n live = doc.sameTerm(todayDoc) // Is this todays?\n }\n const newMessageTable = await createMessageTable(date, live)\n extremity.messageTable = newMessageTable // move pointer to earliest\n if (backwards ? newestFirst : !newestFirst) {\n // put on bottom or top\n div.appendChild(newMessageTable)\n } else {\n // put on top as we scroll back\n div.insertBefore(newMessageTable, div.firstChild)\n }\n return live // not done\n }\n\n /* Remove message tables earlier than this one\n */\n function removePreviousMessages (backwards, messageTable) {\n if (backwards ? newestFirst : !newestFirst) {\n // it was put on bottom\n while (messageTable.nextSibling) {\n div.removeChild(messageTable.nextSibling)\n }\n } else {\n // it was put on top as we scroll back\n while (messageTable.previousSibling) {\n div.removeChild(messageTable.previousSibling)\n }\n }\n const extr = backwards ? earliest : latest\n extr.messageTable = messageTable\n }\n\n /* Load and render message table\n ** @returns DOM element generates\n */\n async function createMessageTable (date, live) {\n // debug.log(' createMessageTable for ' + date)\n const chatDocument = dateFolder.leafDocumentFromDate(date)\n try {\n await store.fetcher.createIfNotExists(chatDocument)\n } catch (err) {\n const messageTable = dom.createElement('table')\n const statusTR = messageTable.appendChild(dom.createElement('tr')) // ### find status in exception\n if (err.response && err.response.status && err.response.status === 404) {\n // debug.log('Error 404 for chat file ' + chatDocument)\n return await renderMessageTable(date, live) // no message file is fine. will be created later\n // statusTR.appendChild(widgets.errorMessageBlock(dom, 'no message file', 'white'))\n } else {\n debug.log('*** Error NON 404 for chat file ' + chatDocument)\n statusTR.appendChild(widgets.errorMessageBlock(dom, err, 'pink'))\n }\n return statusTR\n }\n return await renderMessageTable(date, live)\n }\n\n async function renderMessageTable (date, live) {\n const scrollBackbutton = null // was let\n const scrollForwardButton = null // was let\n\n /// ///////////////// Scroll down adding more above\n\n async function extendBackwards () {\n const done = await insertPreviousMessages(true)\n if (done) {\n if (scrollBackbutton) {\n scrollBackbutton.firstChild.setAttribute(\n 'src',\n icons.iconBase + 'noun_T-Block_1114655_000000.svg'\n ) // T\n scrollBackbutton.disabled = true\n }\n messageTable.initial = true\n } else {\n messageTable.extendedBack = true\n }\n setScrollBackbuttonIcon()\n return done\n }\n\n function setScrollBackbuttonIcon () {\n if (!scrollBackbutton) {\n return\n }\n const sense = messageTable.extendedBack ? !newestFirst : newestFirst\n const scrollBackIcon = messageTable.initial\n ? 'noun_T-Block_1114655_000000.svg'\n : getScrollbackIcon(sense)\n scrollBackbutton.firstChild.setAttribute(\n 'src',\n icons.iconBase + scrollBackIcon\n )\n\n function getScrollbackIcon (sense) {\n return sense ? 'noun_1369241.svg' : 'noun_1369237.svg'\n }\n }\n\n /// ////////////// Scroll up adding more below\n\n async function extendForwards () {\n const done = await insertPreviousMessages(false)\n /*\n if (done) {\n scrollForwardButton.firstChild.setAttribute(\n 'src',\n icons.iconBase + 'noun_T-Block_1114655_000000.svg'\n )\n scrollForwardButton.disabled = true\n messageTable.final = true\n } else {\n messageTable.extendedForwards = true\n }\n setScrollForwardButtonIcon()\n */\n return done\n }\n\n function setScrollForwardButtonIcon () {\n if (!scrollForwardButton) return\n const sense = messageTable.extendedForwards ? !newestFirst : newestFirst // noun_T-Block_1114657_000000.svg\n const scrollForwardIcon = messageTable.final\n ? 'noun_T-Block_1114657_000000.svg'\n : getScrollForwardButtonIcon(sense)\n scrollForwardButton.firstChild.setAttribute(\n 'src',\n icons.iconBase + scrollForwardIcon\n )\n\n function getScrollForwardButtonIcon (sense) {\n return !sense ? 'noun_1369241.svg' : 'noun_1369237.svg'\n }\n }\n\n async function scrollForwardButtonHandler (_event) {\n if (messageTable.extendedForwards) {\n removePreviousMessages(false, messageTable)\n messageTable.extendedForwards = false\n setScrollForwardButtonIcon()\n } else {\n await extendForwards() // async\n latest.messageTable.scrollIntoView(newestFirst)\n }\n }\n\n /// ///////////////////////\n /*\n options = options || {}\n options.authorDateOnLeft = true\n const newestFirst = options.newestFirst === '1' || options.newestFirst === true // hack for now\n const channelObject = new ChatChannel(chatChannel, options)\n const dateFolder = channelObject.dateFolder\n\n const div = dom.createElement('div')\n const statusArea = div.appendChild(dom.createElement('div'))\n const userContext = { dom, statusArea, div: statusArea } // logged on state, pointers to user's stuff\n\n*/\n // debug.log('Options for called message Area', options)\n const messageTable = dom.createElement('table')\n messageTable.style.width = '100%' // fill the pane div\n messageTable.extendBackwards = extendBackwards // Make function available to scroll stuff\n messageTable.extendForwards = extendForwards // Make function available to scroll stuff\n\n messageTable.date = date\n const chatDocument = dateFolder.leafDocumentFromDate(date)\n messageTable.chatDocument = chatDocument\n\n messageTable.fresh = false\n messageTable.setAttribute('style', 'width: 100%;') // fill that div!\n if (live) {\n messageTable.final = true\n liveMessageTable = messageTable\n latest.messageTable = messageTable\n const tr = renderMessageEditor(channelObject, messageTable, userContext, options)\n if (newestFirst) {\n messageTable.insertBefore(tr, messageTable.firstChild) // If newestFirst\n } else {\n messageTable.appendChild(tr) // not newestFirst\n }\n messageTable.inputRow = tr\n }\n\n /// ///// Infinite scroll\n //\n // @@ listen for swipe past end event not just button\n const test = true\n if (test) { // ws options.infinite but need for non-infinite\n const titleTR = dom.createElement('tr')\n const scrollBackbuttonCell = titleTR.appendChild(\n dom.createElement('td')\n )\n // up traingles: noun_1369237.svg\n // down triangles: noun_1369241.svg\n /*\n const scrollBackIcon = newestFirst\n ? 'noun_1369241.svg'\n : 'noun_1369237.svg' // down and up arrows respoctively\n scrollBackbutton = widgets.button(\n dom,\n icons.iconBase + scrollBackIcon,\n 'Previous messages ...'\n )\n scrollBackbuttonCell.style = 'width:3em; height:3em;'\n scrollBackbutton.addEventListener('click', scrollBackbuttonHandler, false)\n messageTable.extendedBack = false\n scrollBackbuttonCell.appendChild(scrollBackbutton)\n setScrollBackbuttonIcon()\n */\n const dateCell = titleTR.appendChild(dom.createElement('td'))\n dateCell.style =\n 'text-align: center; vertical-align: middle; color: #888; font-style: italic;'\n dateCell.textContent = widgets.shortDate(date.toISOString(), true) // no time, only date\n\n // @@@@@@@@@@@ todo move this button to other end of message cell, o\n const scrollForwardButtonCell = titleTR.appendChild(\n dom.createElement('td')\n )\n if (options.includeRemoveButton) {\n scrollForwardButtonCell.appendChild(widgets.cancelButton(dom, _e => {\n div.parentNode.removeChild(div)\n }))\n }\n /*\n const scrollForwardIcon = newestFirst\n ? 'noun_1369241.svg'\n : 'noun_1369237.svg' // down and up arrows respoctively\n scrollForwardButton = widgets.button(\n dom,\n icons.iconBase + scrollForwardIcon,\n 'Later messages ...'\n )\n scrollForwardButtonCell.appendChild(scrollForwardButton)\n scrollForwardButtonCell.style = 'width:3em; height:3em;'\n scrollForwardButton.addEventListener(\n 'click',\n scrollForwardButtonHandler,\n false\n )\n messageTable.extendedForward = false\n setScrollForwardButtonIcon()\n */\n messageTable.extendedForwards = false\n\n if (!newestFirst) {\n // opposite end from the entry field\n messageTable.insertBefore(titleTR, messageTable.firstChild) // If not newestFirst\n } else {\n messageTable.appendChild(titleTR) // newestFirst\n }\n }\n\n const sts = store.statementsMatching(null, ns.wf('message'), null, chatDocument)\n if (!live && sts.length === 0) {\n // not todays\n // no need buttomns at the moment\n // messageTable.style.visibility = 'collapse' // Hide files with no messages\n }\n for (const st of sts) {\n await addMessage(st.object, messageTable)\n }\n messageTable.fresh = true // message table updated with insertMessageIntoTable()\n return messageTable\n } // renderMessageTable\n\n async function addNewChatDocumentIfNewDay () {\n // @@ Remove listener from previous table as it is now static\n const newChatDocument = dateFolder.leafDocumentFromDate(new Date())\n if (!newChatDocument.sameTerm(latest.messageTable.chatDocument)) {\n // It is a new day\n if (liveMessageTable.inputRow) {\n liveMessageTable.removeChild(liveMessageTable.inputRow)\n delete liveMessageTable.inputRow\n }\n const oldChatDocument = latest.messageTable.chatDocument\n await appendCurrentMessages()\n // Adding a link in the document will ping listeners to add the new block too\n if (\n !store.holds(\n oldChatDocument,\n ns.rdfs('seeAlso'),\n newChatDocument,\n oldChatDocument\n )\n ) {\n const sts = [\n $rdf.st(\n oldChatDocument,\n ns.rdfs('seeAlso'),\n newChatDocument,\n oldChatDocument\n )\n ]\n try {\n store.updater.update([], sts)\n } catch (err) {\n alert('Unable to link old chat file to new one:' + err)\n }\n }\n }\n }\n\n /*\n function messageCount () {\n var n = 0\n const tables = div.children\n for (let i = 0; i < tables.length; i++) {\n n += tables[i].children.length - 1\n // debug.log(' table length:' + tables[i].children.length)\n }\n return n\n }\n*/\n\n /* Add the live message block with entry field for today\n */\n async function appendCurrentMessages () {\n const now = new Date()\n const chatDocument = dateFolder.leafDocumentFromDate(now)\n\n /// ///////////////////////////////////////////////////////////\n const messageTable = await createMessageTable(now, true)\n div.appendChild(messageTable)\n div.refresh = async function () {\n // only the last messageTable is live\n await addNewChatDocumentIfNewDay(new Date())\n await syncMessages(chatChannel, messageTable) // @@ livemessagetable??\n desktopNotification(chatChannel)\n } // The short chat version the live update listening is done in the pane but we do it in the widget @@\n store.updater.addDownstreamChangeListener(chatDocument, div.refresh) // Live update\n liveMessageTable = messageTable\n latest.messageTable = liveMessageTable\n return messageTable\n }\n\n async function loadMoreWhereNeeded (event, fixScroll) {\n if (lock) return\n lock = true\n const freeze = !fixScroll\n const magicZone = 150\n // const top = div.scrollTop\n // const bottom = div.scrollHeight - top - div.clientHeight\n let done\n\n while (\n div.scrollTop < magicZone &&\n earliest.messageTable &&\n !earliest.messageTable.initial &&\n earliest.messageTable.extendBackwards\n ) {\n // If this has been called before the element is actually in the\n // user's DOM tree, then this scrollTop check won't work -> loop forever\n // https://github.com/solidos/solid-ui/issues/366\n if (div.scrollHeight === 0) {\n // debug.log(' chat/loadMoreWhereNeeded: trying later...')\n setTimeout(loadMoreWhereNeeded, 2000) // couple be less\n lock = false\n return // abandon now, do later\n }\n // debug.log(' chat/loadMoreWhereNeeded: Going now')\n const scrollBottom = div.scrollHeight - div.scrollTop\n // debug.log('infinite scroll: adding above: top ' + div.scrollTop)\n done = await earliest.messageTable.extendBackwards()\n if (freeze) {\n div.scrollTop = div.scrollHeight - scrollBottom\n }\n if (fixScroll) fixScroll()\n if (done) break\n }\n while (\n options.selectedMessage && // we started in the middle not at the bottom\n div.scrollHeight - div.scrollTop - div.clientHeight < magicZone && // we are scrolled right to the bottom\n latest.messageTable &&\n !latest.messageTable.final && // there is more data to come\n latest.messageTable.extendForwards\n ) {\n const scrollTop = div.scrollTop\n /* debug.log(\n 'infinite scroll: adding below: bottom: ' +\n (div.scrollHeight - div.scrollTop - div.clientHeight)\n ) */\n done = await latest.messageTable.extendForwards() // then add more data on the bottom\n if (freeze) {\n div.scrollTop = scrollTop // while adding below keep same things in view\n }\n if (fixScroll) fixScroll()\n if (done) break\n }\n lock = false\n }\n\n async function loadInitialContent () {\n function yank () {\n if (selectedMessageTable && selectedMessageTable.selectedElement) {\n selectedMessageTable.selectedElement.scrollIntoView({ block: 'center' })\n }\n }\n\n // During initial load ONLY keep scroll to selected thing or bottom\n function fixScroll () {\n if (options.selectedElement) {\n options.selectedElement.scrollIntoView({ block: 'center' }) // align tops or bottoms\n } else {\n if (liveMessageTable.inputRow.scrollIntoView) {\n liveMessageTable.inputRow.scrollIntoView(newestFirst) // align tops or bottoms\n }\n }\n }\n\n let live, selectedDocument, threadRootDocument\n if (options.selectedMessage) {\n selectedDocument = options.selectedMessage.doc()\n }\n if (threadRootMessage) {\n threadRootDocument = threadRootMessage.doc()\n }\n const initialDocment = selectedDocument || threadRootDocument\n\n if (initialDocment) {\n const now = new Date()\n const todayDocument = dateFolder.leafDocumentFromDate(now)\n live = todayDocument.sameTerm(initialDocment)\n }\n\n let selectedMessageTable\n if (initialDocment && !live) {\n const selectedDate = dateFolder.dateFromLeafDocument(initialDocment)\n selectedMessageTable = await createMessageTable(selectedDate, live)\n div.appendChild(selectedMessageTable)\n earliest.messageTable = selectedMessageTable\n latest.messageTable = selectedMessageTable\n yank()\n setTimeout(yank, 1000) // @@ kludge - restore position distubed by other cHANGES\n } else {\n // Live end\n await appendCurrentMessages()\n earliest.messageTable = liveMessageTable\n latest.messageTable = liveMessageTable\n }\n\n await loadMoreWhereNeeded(null, fixScroll)\n div.addEventListener('scroll', loadMoreWhereNeeded)\n if (options.solo) {\n document.body.addEventListener('scroll', loadMoreWhereNeeded)\n }\n }\n\n // Body of main function\n\n options = options || {}\n options.authorDateOnLeft = false // @@ make a user optiosn\n const newestFirst = options.newestFirst === '1' || options.newestFirst === true // hack for now\n\n const channelObject = new ChatChannel(chatChannel, options)\n const dateFolder = channelObject.dateFolder\n\n const div = dom.createElement('div')\n channelObject.div = div\n\n const statusArea = div.appendChild(dom.createElement('div'))\n const userContext = { dom, statusArea, div: statusArea } // logged on state, pointers to user's stuff\n\n let liveMessageTable\n let threadRootMessage\n const earliest = { messageTable: null } // Stuff about each end of the loaded days\n const latest = { messageTable: null }\n\n if (options.thread) {\n const thread = options.thread\n threadRootMessage = store.any(null, ns.sioc('has_reply'), thread, thread.doc())\n if (threadRootMessage) {\n const threadTime = store.any(threadRootMessage, ns.dct('created'), null, threadRootMessage.doc())\n if (threadTime) {\n earliest.limit = new Date(threadTime.value)\n // debug.log(' infinite: thread start at ' + earliest.limit)\n }\n }\n }\n\n let lock = false\n\n await loadInitialContent()\n return div\n}\n"],"mappings":";;;;;;;;;;;;AAKA,IAAAA,IAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,EAAA,GAAAL,uBAAA,CAAAC,OAAA;AAGA,IAAAK,OAAA,GAAAN,uBAAA,CAAAC,OAAA;AAGA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAAiE,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAA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","widgets","_chatLogic","_message","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_createForOfIteratorHelper","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","_n","F","s","done","value","f","TypeError","o","next","_arrayLikeToArray","toString","slice","constructor","name","from","test","desktopNotification","str","window","warn","Notification","permission","requestPermission","then","insertMessageIntoTable","_x","_x2","_x3","_x4","_x5","_x6","_insertMessageIntoTable","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee","channelObject","messageTable","message","fresh","options","userContext","messageRow","ele","newestFirst","dateString","wrap","_callee$","_context","prev","renderMessageRow","sent","selectedMessage","sameTerm","style","backgroundColor","selectedElement","firstChild","abrupt","newestfirst","AJAR_date","insertBefore","nextSibling","appendChild","stop","infiniteMessageArea","_x7","_x8","_x9","_x10","_infiniteMessageArea","_callee15","dom","wasStore","chatChannel","syncMessages","_syncMessages","addMessage","_addMessage","insertPreviousMessages","_insertPreviousMessages","removePreviousMessages","createMessageTable","_createMessageTable","renderMessageTable","_renderMessageTable","addNewChatDocumentIfNewDay","_addNewChatDocumentIfNewDay","appendCurrentMessages","_appendCurrentMessages","loadMoreWhereNeeded","_loadMoreWhereNeeded","loadInitialContent","_loadInitialContent","dateFolder","div","statusArea","liveMessageTable","threadRootMessage","earliest","latest","thread","threadTime","lock","_callee15$","_context15","_loadInitialContent3","_callee14","yank","fixScroll","live","selectedDocument","threadRootDocument","initialDocment","now","todayDocument","selectedMessageTable","selectedDate","_callee14$","_context14","_fixScroll","scrollIntoView","block","inputRow","_yank","doc","Date","leafDocumentFromDate","dateFromLeafDocument","setTimeout","addEventListener","solo","document","body","_loadInitialContent2","_loadMoreWhereNeeded3","_callee13","event","freeze","magicZone","scrollBottom","scrollTop","_callee13$","_context13","initial","extendBackwards","scrollHeight","clientHeight","extendForwards","_loadMoreWhereNeeded2","_x20","_x21","_appendCurrentMessage2","_callee12","chatDocument","_callee12$","_context12","refresh","_callee11","_callee11$","_context11","store","updater","addDownstreamChangeListener","_appendCurrentMessage","_addNewChatDocumentIf2","_callee10","newChatDocument","oldChatDocument","sts","_callee10$","_context10","removeChild","holds","rdfs","st","update","err","alert","_addNewChatDocumentIf","_renderMessageTable3","_callee9","date","scrollBackbutton","scrollForwardButton","_extendBackwards","setScrollBackbuttonIcon","_extendForwards","setScrollForwardButtonIcon","scrollForwardButtonHandler","_scrollForwardButtonHandler","tr","titleTR","scrollBackbuttonCell","dateCell","scrollForwardButtonCell","_iterator2","_step2","_callee9$","_context9","_scrollForwardButtonH2","_callee8","_event","_callee8$","_context8","extendedForwards","_scrollForwardButtonH","_x22","_setScrollForwardButt","sense","scrollForwardIcon","getScrollForwardButtonIcon","setAttribute","icons","iconBase","_extendForwards3","_callee7","_callee7$","_context7","_extendForwards2","_setScrollBackbuttonI","extendedBack","scrollBackIcon","getScrollbackIcon","_extendBackwards3","_callee6","_callee6$","_context6","disabled","_extendBackwards2","createElement","width","renderMessageEditor","textContent","shortDate","toISOString","includeRemoveButton","cancelButton","_e","parentNode","statementsMatching","wf","object","t0","finish","_renderMessageTable2","_x18","_x19","_createMessageTable3","_callee5","statusTR","_callee5$","_context5","fetcher","createIfNotExists","response","status","log","errorMessageBlock","_createMessageTable2","_x16","_x17","_removePreviousMessag","backwards","previousSibling","extr","_insertPreviousMessag2","_callee4","extremity","todayDoc","newMessageTable","_callee4$","_context4","limit","loadPrevious","_insertPreviousMessag","_x15","_addMessage3","_callee3","id","_callee3$","_context3","isDeleted","showDeletedMessages","any","sioc","_addMessage2","_x13","_x14","_syncMessages3","_callee2","displayed","ele2","messages","stored","_iterator","_step","m","_callee2$","_context2","AJAR_subject","uri","each","refreshTree","_syncMessages2","_x11","_x12","authorDateOnLeft","ChatChannel","dct"],"sources":["../../src/chat/infinite.js"],"sourcesContent":["/**\n * Contains the [[infiniteMessageArea]] class\n * @packageDocumentation\n */\n// import { findBookmarkDocument } from './bookmarks'\nimport * as $rdf from 'rdflib' // pull in first avoid cross-refs\nimport { store } from 'solid-logic'\nimport * as debug from '../debug'\nimport { icons } from '../iconBase'\nimport * as ns from '../ns'\n// import * as style from '../style'\n// import * as utils from '../utils'\nimport * as widgets from '../widgets'\n// import * as pad from '../pad'\n// import { DateFolder } from './dateFolder'\nimport { ChatChannel, isDeleted } from './chatLogic'\nimport { renderMessageEditor, renderMessageRow } from './message'\n\n// const UI = { authn, icons, ns, media, pad, $rdf, store, style, utils, widgets }\n\nexport function desktopNotification (str) {\n // Let's check if the browser supports notifications\n if (!('Notification' in window)) {\n debug.warn('This browser does no t support desktop notification')\n } else if (Notification.permission === 'granted') {\n // Let's check whether notificatio n permissions have already been granted\n // eslint-disable-next-line no-new\n new Notification(str)\n } else if (Notification.permission !== 'denied') {\n // Otherwise, we need to ask the user for permission\n Notification.requestPermission().then(function (permission) {\n // If the user accepts, let's create a notification\n if (permission === 'granted') {\n // eslint-disable-next-line no-new\n new Notification(str)\n }\n })\n }\n // At last, if the user has denied notifications, and you\n // want to be respectful there is no need to bother them any more.\n}\n\n/**\n * Renders a chat message inside a `messageTable`\n */\nexport async function insertMessageIntoTable (channelObject, messageTable, message, fresh, options, userContext) {\n const messageRow = await renderMessageRow(channelObject,\n message,\n fresh,\n options,\n userContext\n )\n\n // const message = messageRow.AJAR_subject\n if (options.selectedMessage && options.selectedMessage.sameTerm(message)) {\n messageRow.style.backgroundColor = 'yellow'\n options.selectedElement = messageRow\n messageTable.selectedElement = messageRow\n }\n\n let done = false\n for (let ele = messageTable.firstChild; ; ele = ele.nextSibling) {\n if (!ele) {\n // empty\n break\n }\n const newestFirst = options.newestfirst === true\n const dateString = messageRow.AJAR_date\n if (\n (dateString > ele.AJAR_date && newestFirst) ||\n (dateString < ele.AJAR_date && !newestFirst)\n ) {\n messageTable.insertBefore(messageRow, ele)\n done = true\n break\n }\n }\n if (!done) {\n messageTable.appendChild(messageRow)\n }\n}\n\n/**\n * Common code for a chat (discussion area of messages about something)\n * This version runs over a series of files for different time periods\n *\n * Parameters for the whole chat like its title are stored on\n * index.ttl#this and the chats messages are stored in YYYY/MM/DD/chat.ttl\n *\n * Use to import store as param 2, now ignores it and uses the UI main store\n *\n * Options include:\n\n - shiftEnterSendsMessage: Use shift/enter to send message, Enter to add newline, instead of the reverse.\n - authorDateOnLeft: Display the author's anme and date of the message in the left column instead of first above the content\n - selectedMessage: Display one message highlighted with the chat around it\n - solo: By itelf on a webpage, so user scroll anywhere in the web page scan scroll the chat.\n - newestFirst: Arrange the chat messages chronologically newest at the top insted of at the bottom\n - infinite: Use infinite scroll\n - showDeletedMessages: Show messages which have been delted as \"deleted message\". Otherwise hide them.\n - expandImagesInline: If a URI by itself in a message looks like an image URI, replace it with the image\n - inlineImageHeightEms: The height (in ems) of images expaned from their URIs in the chat.\n\n */\nexport async function infiniteMessageArea (dom, wasStore, chatChannel, options) {\n // ///////////////////////////////////////////////////////////////////////\n\n async function syncMessages (chatChannel, 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(chatChannel, ns.wf('message'), null, messageTable.chatDocument)\n\n const stored = {}\n for (const m of messages) {\n stored[m.uri] = true\n if (!displayed[m.uri]) {\n await addMessage(m, messageTable)\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 for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {\n if (ele.AJAR_subject) {\n // Refresh thumbs up etc\n widgets.refreshTree(ele) // Things inside may have changed too\n }\n }\n } // syncMessages\n\n // Called once per original message displayed\n async function addMessage (message, messageTable) {\n // const latest = await mostRecentVersion(message)\n // const content = store.any(latest, ns.sioc('content'))\n if (isDeleted(message) && !options.showDeletedMessages) {\n return // ignore deleted messaged -- @@ could also leave a placeholder\n }\n /* if (isReplaced(message)) { //\n return // this is old version\n } */\n let thread = store.any(null, ns.sioc('has_member'), message, message.doc())\n const id = store.any(message, ns.sioc('id'), null, message.doc())\n if (id && !thread) {\n thread = store.any(null, ns.sioc('has_member'), id, message.doc())\n }\n\n if (options.thread) { // only show things in thread\n if (store.holds(message, ns.sioc('has_reply'), options.thread)) { // root of thread\n // debug.log(' addMessage: displaying root of thread ' + thread)\n } else if (thread && thread.sameTerm(options.thread)) {\n // debug.log(' addMessage: Displaying body of thread ' + message.uri.slice(-10))\n } else {\n // debug.log(' addMessage: Suppress non-thread message in thread table ' + message.uri.slice(-10))\n return // suppress message not in thread\n }\n } else { // Not threads\n if (thread) {\n // debug.log(' addMessage: Suppress thread message in non-thread table ' + message.uri.slice(-10))\n return // supress thread messages in body\n } else {\n // debug.log(' addMessage: Normal non-thread message in non-thread table ' + message.uri.slice(-10))\n }\n }\n if (!messageTable.fresh) { // if messageTable has been updated with insertMessageIntoTable() don't do it again\n // debug.log('@@@ infinite insertMessageIntoTable ' + message) // alain\n // debug.log('fresh ' + messageTable.fresh)\n // debug.log(messageTable)\n await insertMessageIntoTable(channelObject,\n messageTable,\n message,\n messageTable.fresh,\n options,\n userContext\n ) // fresh from elsewhere\n }\n }\n\n /* Add a new messageTable at the top/bottom\n\n */\n async function insertPreviousMessages (backwards) {\n const extremity = backwards ? earliest : latest\n let date = extremity.messageTable.date // day in mssecs\n\n // Are we at the top of a thread?\n if (backwards && earliest.limit && date <= earliest.limit) {\n if (!liveMessageTable) await appendCurrentMessages() // If necessary skip to today and add that\n return true // done\n }\n // debug.log(' insertPreviousMessages: loadPrevious given date ' + date)\n\n date = await dateFolder.loadPrevious(date, backwards) // backwards\n // debug.log(' insertPreviousMessages: loadPrevious returns date ' + date)\n\n /* debug.log(\n `insertPreviousMessages: from ${\n backwards ? 'backwards' : 'forwards'\n } loadPrevious: ${date}`\n ) */\n if (!date && !backwards && !liveMessageTable) {\n await appendCurrentMessages() // If necessary skip to today and add that\n }\n if (!date) return true // done\n let live = false\n if (!backwards) {\n const todayDoc = dateFolder.leafDocumentFromDate(new Date())\n const doc = dateFolder.leafDocumentFromDate(date)\n live = doc.sameTerm(todayDoc) // Is this todays?\n }\n const newMessageTable = await createMessageTable(date, live)\n extremity.messageTable = newMessageTable // move pointer to earliest\n if (backwards ? newestFirst : !newestFirst) {\n // put on bottom or top\n div.appendChild(newMessageTable)\n } else {\n // put on top as we scroll back\n div.insertBefore(newMessageTable, div.firstChild)\n }\n return live // not done\n }\n\n /* Remove message tables earlier than this one\n */\n function removePreviousMessages (backwards, messageTable) {\n if (backwards ? newestFirst : !newestFirst) {\n // it was put on bottom\n while (messageTable.nextSibling) {\n div.removeChild(messageTable.nextSibling)\n }\n } else {\n // it was put on top as we scroll back\n while (messageTable.previousSibling) {\n div.removeChild(messageTable.previousSibling)\n }\n }\n const extr = backwards ? earliest : latest\n extr.messageTable = messageTable\n }\n\n /* Load and render message table\n ** @returns DOM element generates\n */\n async function createMessageTable (date, live) {\n // debug.log(' createMessageTable for ' + date)\n const chatDocument = dateFolder.leafDocumentFromDate(date)\n try {\n await store.fetcher.createIfNotExists(chatDocument)\n } catch (err) {\n const messageTable = dom.createElement('table')\n const statusTR = messageTable.appendChild(dom.createElement('tr')) // ### find status in exception\n if (err.response && err.response.status && err.response.status === 404) {\n // debug.log('Error 404 for chat file ' + chatDocument)\n return await renderMessageTable(date, live) // no message file is fine. will be created later\n // statusTR.appendChild(widgets.errorMessageBlock(dom, 'no message file', 'white'))\n } else {\n debug.log('*** Error NON 404 for chat file ' + chatDocument)\n statusTR.appendChild(widgets.errorMessageBlock(dom, err, 'pink'))\n }\n return statusTR\n }\n return await renderMessageTable(date, live)\n }\n\n async function renderMessageTable (date, live) {\n const scrollBackbutton = null // was let\n const scrollForwardButton = null // was let\n\n /// ///////////////// Scroll down adding more above\n\n async function extendBackwards () {\n const done = await insertPreviousMessages(true)\n if (done) {\n if (scrollBackbutton) {\n scrollBackbutton.firstChild.setAttribute(\n 'src',\n icons.iconBase + 'noun_T-Block_1114655_000000.svg'\n ) // T\n scrollBackbutton.disabled = true\n }\n messageTable.initial = true\n } else {\n messageTable.extendedBack = true\n }\n setScrollBackbuttonIcon()\n return done\n }\n\n function setScrollBackbuttonIcon () {\n if (!scrollBackbutton) {\n return\n }\n const sense = messageTable.extendedBack ? !newestFirst : newestFirst\n const scrollBackIcon = messageTable.initial\n ? 'noun_T-Block_1114655_000000.svg'\n : getScrollbackIcon(sense)\n scrollBackbutton.firstChild.setAttribute(\n 'src',\n icons.iconBase + scrollBackIcon\n )\n\n function getScrollbackIcon (sense) {\n return sense ? 'noun_1369241.svg' : 'noun_1369237.svg'\n }\n }\n\n /// ////////////// Scroll up adding more below\n\n async function extendForwards () {\n const done = await insertPreviousMessages(false)\n /*\n if (done) {\n scrollForwardButton.firstChild.setAttribute(\n 'src',\n icons.iconBase + 'noun_T-Block_1114655_000000.svg'\n )\n scrollForwardButton.disabled = true\n messageTable.final = true\n } else {\n messageTable.extendedForwards = true\n }\n setScrollForwardButtonIcon()\n */\n return done\n }\n\n function setScrollForwardButtonIcon () {\n if (!scrollForwardButton) return\n const sense = messageTable.extendedForwards ? !newestFirst : newestFirst // noun_T-Block_1114657_000000.svg\n const scrollForwardIcon = messageTable.final\n ? 'noun_T-Block_1114657_000000.svg'\n : getScrollForwardButtonIcon(sense)\n scrollForwardButton.firstChild.setAttribute(\n 'src',\n icons.iconBase + scrollForwardIcon\n )\n\n function getScrollForwardButtonIcon (sense) {\n return !sense ? 'noun_1369241.svg' : 'noun_1369237.svg'\n }\n }\n\n async function scrollForwardButtonHandler (_event) {\n if (messageTable.extendedForwards) {\n removePreviousMessages(false, messageTable)\n messageTable.extendedForwards = false\n setScrollForwardButtonIcon()\n } else {\n await extendForwards() // async\n latest.messageTable.scrollIntoView(newestFirst)\n }\n }\n\n /// ///////////////////////\n /*\n options = options || {}\n options.authorDateOnLeft = true\n const newestFirst = options.newestFirst === '1' || options.newestFirst === true // hack for now\n const channelObject = new ChatChannel(chatChannel, options)\n const dateFolder = channelObject.dateFolder\n\n const div = dom.createElement('div')\n const statusArea = div.appendChild(dom.createElement('div'))\n const userContext = { dom, statusArea, div: statusArea } // logged on state, pointers to user's stuff\n\n*/\n // debug.log('Options for called message Area', options)\n const messageTable = dom.createElement('table')\n messageTable.style.width = '100%' // fill the pane div\n messageTable.extendBackwards = extendBackwards // Make function available to scroll stuff\n messageTable.extendForwards = extendForwards // Make function available to scroll stuff\n\n messageTable.date = date\n const chatDocument = dateFolder.leafDocumentFromDate(date)\n messageTable.chatDocument = chatDocument\n\n messageTable.fresh = false\n messageTable.setAttribute('style', 'width: 100%;') // fill that div!\n if (live) {\n messageTable.final = true\n liveMessageTable = messageTable\n latest.messageTable = messageTable\n const tr = renderMessageEditor(channelObject, messageTable, userContext, options)\n if (newestFirst) {\n messageTable.insertBefore(tr, messageTable.firstChild) // If newestFirst\n } else {\n messageTable.appendChild(tr) // not newestFirst\n }\n messageTable.inputRow = tr\n }\n\n /// ///// Infinite scroll\n //\n // @@ listen for swipe past end event not just button\n const test = true\n if (test) { // ws options.infinite but need for non-infinite\n const titleTR = dom.createElement('tr')\n const scrollBackbuttonCell = titleTR.appendChild(\n dom.createElement('td')\n )\n // up traingles: noun_1369237.svg\n // down triangles: noun_1369241.svg\n /*\n const scrollBackIcon = newestFirst\n ? 'noun_1369241.svg'\n : 'noun_1369237.svg' // down and up arrows respoctively\n scrollBackbutton = widgets.button(\n dom,\n icons.iconBase + scrollBackIcon,\n 'Previous messages ...'\n )\n scrollBackbuttonCell.style = 'width:3em; height:3em;'\n scrollBackbutton.addEventListener('click', scrollBackbuttonHandler, false)\n messageTable.extendedBack = false\n scrollBackbuttonCell.appendChild(scrollBackbutton)\n setScrollBackbuttonIcon()\n */\n const dateCell = titleTR.appendChild(dom.createElement('td'))\n dateCell.style =\n 'text-align: center; vertical-align: middle; color: #888; font-style: italic;'\n dateCell.textContent = widgets.shortDate(date.toISOString(), true) // no time, only date\n\n // @@@@@@@@@@@ todo move this button to other end of message cell, o\n const scrollForwardButtonCell = titleTR.appendChild(\n dom.createElement('td')\n )\n if (options.includeRemoveButton) {\n scrollForwardButtonCell.appendChild(widgets.cancelButton(dom, _e => {\n div.parentNode.removeChild(div)\n }))\n }\n /*\n const scrollForwardIcon = newestFirst\n ? 'noun_1369241.svg'\n : 'noun_1369237.svg' // down and up arrows respoctively\n scrollForwardButton = widgets.button(\n dom,\n icons.iconBase + scrollForwardIcon,\n 'Later messages ...'\n )\n scrollForwardButtonCell.appendChild(scrollForwardButton)\n scrollForwardButtonCell.style = 'width:3em; height:3em;'\n scrollForwardButton.addEventListener(\n 'click',\n scrollForwardButtonHandler,\n false\n )\n messageTable.extendedForward = false\n setScrollForwardButtonIcon()\n */\n messageTable.extendedForwards = false\n\n if (!newestFirst) {\n // opposite end from the entry field\n messageTable.insertBefore(titleTR, messageTable.firstChild) // If not newestFirst\n } else {\n messageTable.appendChild(titleTR) // newestFirst\n }\n }\n\n const sts = store.statementsMatching(null, ns.wf('message'), null, chatDocument)\n if (!live && sts.length === 0) {\n // not todays\n // no need buttomns at the moment\n // messageTable.style.visibility = 'collapse' // Hide files with no messages\n }\n for (const st of sts) {\n await addMessage(st.object, messageTable)\n }\n messageTable.fresh = true // message table updated with insertMessageIntoTable()\n return messageTable\n } // renderMessageTable\n\n async function addNewChatDocumentIfNewDay () {\n // @@ Remove listener from previous table as it is now static\n const newChatDocument = dateFolder.leafDocumentFromDate(new Date())\n if (!newChatDocument.sameTerm(latest.messageTable.chatDocument)) {\n // It is a new day\n if (liveMessageTable.inputRow) {\n liveMessageTable.removeChild(liveMessageTable.inputRow)\n delete liveMessageTable.inputRow\n }\n const oldChatDocument = latest.messageTable.chatDocument\n await appendCurrentMessages()\n // Adding a link in the document will ping listeners to add the new block too\n if (\n !store.holds(\n oldChatDocument,\n ns.rdfs('seeAlso'),\n newChatDocument,\n oldChatDocument\n )\n ) {\n const sts = [\n $rdf.st(\n oldChatDocument,\n ns.rdfs('seeAlso'),\n newChatDocument,\n oldChatDocument\n )\n ]\n try {\n store.updater.update([], sts)\n } catch (err) {\n alert('Unable to link old chat file to new one:' + err)\n }\n }\n }\n }\n\n /*\n function messageCount () {\n var n = 0\n const tables = div.children\n for (let i = 0; i < tables.length; i++) {\n n += tables[i].children.length - 1\n // debug.log(' table length:' + tables[i].children.length)\n }\n return n\n }\n*/\n\n /* Add the live message block with entry field for today\n */\n async function appendCurrentMessages () {\n const now = new Date()\n const chatDocument = dateFolder.leafDocumentFromDate(now)\n\n /// ///////////////////////////////////////////////////////////\n const messageTable = await createMessageTable(now, true)\n div.appendChild(messageTable)\n div.refresh = async function () {\n // only the last messageTable is live\n await addNewChatDocumentIfNewDay(new Date())\n await syncMessages(chatChannel, messageTable) // @@ livemessagetable??\n desktopNotification(chatChannel)\n } // The short chat version the live update listening is done in the pane but we do it in the widget @@\n store.updater.addDownstreamChangeListener(chatDocument, div.refresh) // Live update\n liveMessageTable = messageTable\n latest.messageTable = liveMessageTable\n return messageTable\n }\n\n async function loadMoreWhereNeeded (event, fixScroll) {\n if (lock) return\n lock = true\n const freeze = !fixScroll\n const magicZone = 150\n // const top = div.scrollTop\n // const bottom = div.scrollHeight - top - div.clientHeight\n let done\n\n while (\n div.scrollTop < magicZone &&\n earliest.messageTable &&\n !earliest.messageTable.initial &&\n earliest.messageTable.extendBackwards\n ) {\n // If this has been called before the element is actually in the\n // user's DOM tree, then this scrollTop check won't work -> loop forever\n // https://github.com/solidos/solid-ui/issues/366\n if (div.scrollHeight === 0) {\n // debug.log(' chat/loadMoreWhereNeeded: trying later...')\n setTimeout(loadMoreWhereNeeded, 2000) // couple be less\n lock = false\n return // abandon now, do later\n }\n // debug.log(' chat/loadMoreWhereNeeded: Going now')\n const scrollBottom = div.scrollHeight - div.scrollTop\n // debug.log('infinite scroll: adding above: top ' + div.scrollTop)\n done = await earliest.messageTable.extendBackwards()\n if (freeze) {\n div.scrollTop = div.scrollHeight - scrollBottom\n }\n if (fixScroll) fixScroll()\n if (done) break\n }\n while (\n options.selectedMessage && // we started in the middle not at the bottom\n div.scrollHeight - div.scrollTop - div.clientHeight < magicZone && // we are scrolled right to the bottom\n latest.messageTable &&\n !latest.messageTable.final && // there is more data to come\n latest.messageTable.extendForwards\n ) {\n const scrollTop = div.scrollTop\n /* debug.log(\n 'infinite scroll: adding below: bottom: ' +\n (div.scrollHeight - div.scrollTop - div.clientHeight)\n ) */\n done = await latest.messageTable.extendForwards() // then add more data on the bottom\n if (freeze) {\n div.scrollTop = scrollTop // while adding below keep same things in view\n }\n if (fixScroll) fixScroll()\n if (done) break\n }\n lock = false\n }\n\n async function loadInitialContent () {\n function yank () {\n if (selectedMessageTable && selectedMessageTable.selectedElement) {\n selectedMessageTable.selectedElement.scrollIntoView({ block: 'center' })\n }\n }\n\n // During initial load ONLY keep scroll to selected thing or bottom\n function fixScroll () {\n if (options.selectedElement) {\n options.selectedElement.scrollIntoView({ block: 'center' }) // align tops or bottoms\n } else {\n if (liveMessageTable.inputRow.scrollIntoView) {\n liveMessageTable.inputRow.scrollIntoView(newestFirst) // align tops or bottoms\n }\n }\n }\n\n let live, selectedDocument, threadRootDocument\n if (options.selectedMessage) {\n selectedDocument = options.selectedMessage.doc()\n }\n if (threadRootMessage) {\n threadRootDocument = threadRootMessage.doc()\n }\n const initialDocment = selectedDocument || threadRootDocument\n\n if (initialDocment) {\n const now = new Date()\n const todayDocument = dateFolder.leafDocumentFromDate(now)\n live = todayDocument.sameTerm(initialDocment)\n }\n\n let selectedMessageTable\n if (initialDocment && !live) {\n const selectedDate = dateFolder.dateFromLeafDocument(initialDocment)\n selectedMessageTable = await createMessageTable(selectedDate, live)\n div.appendChild(selectedMessageTable)\n earliest.messageTable = selectedMessageTable\n latest.messageTable = selectedMessageTable\n yank()\n setTimeout(yank, 1000) // @@ kludge - restore position distubed by other cHANGES\n } else {\n // Live end\n await appendCurrentMessages()\n earliest.messageTable = liveMessageTable\n latest.messageTable = liveMessageTable\n }\n\n await loadMoreWhereNeeded(null, fixScroll)\n div.addEventListener('scroll', loadMoreWhereNeeded)\n if (options.solo) {\n document.body.addEventListener('scroll', loadMoreWhereNeeded)\n }\n }\n\n // Body of main function\n\n options = options || {}\n options.authorDateOnLeft = false // @@ make a user optiosn\n const newestFirst = options.newestFirst === '1' || options.newestFirst === true // hack for now\n\n const channelObject = new ChatChannel(chatChannel, options)\n const dateFolder = channelObject.dateFolder\n\n const div = dom.createElement('div')\n channelObject.div = div\n\n const statusArea = div.appendChild(dom.createElement('div'))\n const userContext = { dom, statusArea, div: statusArea } // logged on state, pointers to user's stuff\n\n let liveMessageTable\n let threadRootMessage\n const earliest = { messageTable: null } // Stuff about each end of the loaded days\n const latest = { messageTable: null }\n\n if (options.thread) {\n const thread = options.thread\n threadRootMessage = store.any(null, ns.sioc('has_reply'), thread, thread.doc())\n if (threadRootMessage) {\n const threadTime = store.any(threadRootMessage, ns.dct('created'), null, threadRootMessage.doc())\n if (threadTime) {\n earliest.limit = new Date(threadTime.value)\n // debug.log(' infinite: thread start at ' + earliest.limit)\n }\n }\n }\n\n let lock = false\n\n await loadInitialContent()\n return div\n}\n"],"mappings":";;;;;;;;;;;;AAKA,IAAAA,IAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAH,uBAAA,CAAAC,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,EAAA,GAAAL,uBAAA,CAAAC,OAAA;AAGA,IAAAK,OAAA,GAAAN,uBAAA,CAAAC,OAAA;AAGA,IAAAM,UAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AAAiE,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CA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D,oBAAA,CAAAxC,KAAA,OAAAC,SAAA;AAAA","ignoreList":[]}
|
package/lib/chat/keys.js
CHANGED
|
@@ -39,7 +39,7 @@ function getPublicKey(_x) {
|
|
|
39
39
|
return _getPublicKey.apply(this, arguments);
|
|
40
40
|
}
|
|
41
41
|
function _getPublicKey() {
|
|
42
|
-
_getPublicKey = (0, _asyncToGenerator2["default"])(
|
|
42
|
+
_getPublicKey = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(webId) {
|
|
43
43
|
var publicKeyDoc, key;
|
|
44
44
|
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
45
45
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -74,7 +74,7 @@ function getPrivateKey(_x2) {
|
|
|
74
74
|
return _getPrivateKey.apply(this, arguments);
|
|
75
75
|
}
|
|
76
76
|
function _getPrivateKey() {
|
|
77
|
-
_getPrivateKey = (0, _asyncToGenerator2["default"])(
|
|
77
|
+
_getPrivateKey = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(webId) {
|
|
78
78
|
var publicKeyDoc, privateKeyDoc, publicKey, privateKey, validPublicKey, del, add, newPublicKey, keyContainer;
|
|
79
79
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
80
80
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -151,7 +151,7 @@ function _getPrivateKey() {
|
|
|
151
151
|
return _getPrivateKey.apply(this, arguments);
|
|
152
152
|
}
|
|
153
153
|
var deleteKeyAcl = /*#__PURE__*/function () {
|
|
154
|
-
var _ref = (0, _asyncToGenerator2["default"])(
|
|
154
|
+
var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(keyDoc) {
|
|
155
155
|
var keyAclDoc, response;
|
|
156
156
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
157
157
|
while (1) switch (_context.prev = _context.next) {
|
package/lib/chat/keys.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keys.js","names":["debug","_interopRequireWildcard","require","_secp256k","_utils","ns","_solidLogic","$rdf","_accessData","_acl","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","generatePrivateKey","bytesToHex","schnorr","utils","randomPrivateKey","generatePublicKey","privateKey","getPublicKey","_x","_getPublicKey","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee2","webId","publicKeyDoc","key","wrap","_callee2$","_context2","prev","next","store","fetcher","load","pubKeyUrl","sent","any","solid","abrupt","value","t0","undefined","stop","getPrivateKey","_x2","_getPrivateKey","_callee3","privateKeyDoc","publicKey","validPublicKey","del","add","newPublicKey","keyContainer","_callee3$","_context3","privKeyUrl","getExistingPublicKey","getExistingPrivateKey","confirm","uri","st","literal","sym","saveKey","lit","log","substring","lastIndexOf","setAcl","keyContainerAclBody","deleteKeyAcl","_ref","_callee","keyDoc","keyAclDoc","response","_callee$","_context","webOperation","status","Error","_x3","_x4","_x5","_x6","_saveKey","me","length","_callee4","aclBody","_callee4$","_context4","updater","updateMany","keyAclBody"],"sources":["../../src/chat/keys.ts"],"sourcesContent":["import * as debug from '../debug'\r\nimport { schnorr } from '@noble/curves/secp256k1'\r\nimport { bytesToHex } from '@noble/hashes/utils'\r\nimport * as ns from '../ns'\r\nimport { store } from 'solid-logic'\r\nimport { NamedNode } from 'rdflib'\r\nimport * as $rdf from 'rdflib'\r\nimport { getExistingPublicKey, pubKeyUrl, privKeyUrl, getExistingPrivateKey } from '../utils/keyHelpers/accessData'\r\nimport { setAcl, keyContainerAclBody, keyAclBody } from '../utils/keyHelpers/acl'\r\n\r\nexport function generatePrivateKey (): string {\r\n return bytesToHex(schnorr.utils.randomPrivateKey())\r\n}\r\n\r\nexport function generatePublicKey (privateKey: string): string {\r\n return bytesToHex(schnorr.getPublicKey(privateKey))\r\n}\r\n\r\n/**\r\n * getPublicKey\r\n * used for displaying messages in chat, therefore does not\r\n * create a new key if not found\r\n * @param webId\r\n * @returns string | undefined\r\n */\r\nexport async function getPublicKey (webId: NamedNode) {\r\n await store.fetcher.load(webId)\r\n const publicKeyDoc = await pubKeyUrl(webId)\r\n try {\r\n await store.fetcher.load(publicKeyDoc) // url.href)\r\n const key = store.any(webId, ns.solid('publicKey'))\r\n return key?.value // as NamedNode\r\n } catch (err) {\r\n return undefined\r\n }\r\n}\r\n\r\nexport async function getPrivateKey (webId: NamedNode) {\r\n await store.fetcher.load(webId)\r\n // find keys url's\r\n const publicKeyDoc = await pubKeyUrl(webId)\r\n const privateKeyDoc = await privKeyUrl(webId)\r\n\r\n // find key pair\r\n const publicKey = await getExistingPublicKey(webId, publicKeyDoc)\r\n let privateKey = await getExistingPrivateKey(webId, privateKeyDoc)\r\n\r\n // is publicKey valid ?\r\n let validPublicKey = true\r\n if (privateKey && (publicKey !== generatePublicKey(privateKey as string))) {\r\n if (confirm('This is strange the publicKey is not valid for\\n' + webId?.uri +\r\n '\\'shall we repair keeping the private key ?')) validPublicKey = false\r\n }\r\n\r\n // create key pair or repair publicKey\r\n if (!privateKey || !publicKey || !validPublicKey) {\r\n let del: any[] = []\r\n let add: any[] = []\r\n\r\n if (!privateKey) {\r\n // add = []\r\n privateKey = generatePrivateKey()\r\n add = [$rdf.st(webId, ns.solid('privateKey'), $rdf.literal(privateKey), store.sym(privateKeyDoc))]\r\n await saveKey(privateKeyDoc, [], add, webId.uri)\r\n }\r\n if (!publicKey || !validPublicKey) {\r\n del = []\r\n // delete invalid public key\r\n if (publicKey) {\r\n del = [$rdf.st(webId, ns.solid('publicKey'), $rdf.lit(publicKey), store.sym(publicKeyDoc))]\r\n debug.log('delete invalid publicKey ' + del)\r\n }\r\n // update new valid key\r\n const newPublicKey = generatePublicKey(privateKey)\r\n add = [$rdf.st(webId, ns.solid('publicKey'), $rdf.literal(newPublicKey), store.sym(publicKeyDoc))]\r\n await saveKey(publicKeyDoc, del, add)\r\n }\r\n const keyContainer = privateKeyDoc.substring(0, privateKeyDoc.lastIndexOf('/') + 1)\r\n await setAcl(keyContainer, keyContainerAclBody(webId.uri)) // includes DELETE and PUT\r\n }\r\n return privateKey as string\r\n}\r\n\r\nconst deleteKeyAcl = async (keyDoc: string) => {\r\n await store.fetcher.load(keyDoc)\r\n\r\n const keyAclDoc = store.any(store.sym(keyDoc), store.sym('http://www.iana.org/assignments/link-relations/acl'))\r\n if (keyAclDoc) {\r\n // delete READ only keyAclDoc. This is possible if the webId is an owner\r\n try {\r\n const response = await store.fetcher.webOperation('DELETE', keyAclDoc.value) // this may fail if webId is not an owner\r\n debug.log('delete keyAcl' + keyAclDoc.value + ' ' + response.status) // should test 404 and 2xx\r\n } catch (err) {\r\n if (err.response.status !== 404) { throw new Error(err) }\r\n debug.log('delete keyAcl' + keyAclDoc.value + ' ' + err.response.status) // should test 404 and 2xx\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * delete acl if keydoc exists\r\n * create/edit keyDoc\r\n * set keyDoc acl\r\n */\r\nasync function saveKey (keyDoc: string, del, add, me: string = '') {\r\n await deleteKeyAcl(keyDoc)\r\n // save key\r\n await store.updater.updateMany(del, add) // or a promise store.updater.update ?\r\n\r\n // create READ only ACL\r\n const aclBody = keyAclBody(keyDoc, me)\r\n await setAcl(keyDoc, aclBody)\r\n}\r\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,EAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAEA,IAAAK,IAAA,GAAAN,uBAAA,CAAAC,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AAAiF,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA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AtE,SAAA,QAAAuB,SAAA,GAAAvB,SAAA,MAAG,EAAE;IAAA,oBAAAE,YAAA,YAAAC,IAAA,UAAAoE,SAAA;MAAA,IAAAC,OAAA;MAAA,OAAAtE,YAAA,YAAAM,IAAA,UAAAiE,UAAAC,SAAA;QAAA,kBAAAA,SAAA,CAAA/D,IAAA,GAAA+D,SAAA,CAAA9D,IAAA;UAAA;YAAA8D,SAAA,CAAA9D,IAAA;YAAA,OACzDyC,YAAY,CAACG,MAAM,CAAC;UAAA;YAAAkB,SAAA,CAAA9D,IAAA;YAAA,OAEpBC,iBAAK,CAAC8D,OAAO,CAACC,UAAU,CAAC5C,GAAG,EAAEC,GAAG,CAAC;UAAA;YAAC;YAEzC;YACMuC,OAAO,GAAG,IAAAK,eAAU,EAACrB,MAAM,EAAEa,EAAE,CAAC;YAAAK,SAAA,CAAA9D,IAAA;YAAA,OAChC,IAAAuC,WAAM,EAACK,MAAM,EAAEgB,OAAO,CAAC;UAAA;UAAA;YAAA,OAAAE,SAAA,CAAAlD,IAAA;QAAA;MAAA,GAAA+C,QAAA;IAAA;EAAA,CAC9B;EAAA,OAAAH,QAAA,CAAArE,KAAA,OAAAC,SAAA;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"keys.js","names":["debug","_interopRequireWildcard","require","_secp256k","_utils","ns","_solidLogic","$rdf","_accessData","_acl","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","generatePrivateKey","bytesToHex","schnorr","utils","randomPrivateKey","generatePublicKey","privateKey","getPublicKey","_x","_getPublicKey","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee2","webId","publicKeyDoc","key","wrap","_callee2$","_context2","prev","next","store","fetcher","load","pubKeyUrl","sent","any","solid","abrupt","value","t0","undefined","stop","getPrivateKey","_x2","_getPrivateKey","_callee3","privateKeyDoc","publicKey","validPublicKey","del","add","newPublicKey","keyContainer","_callee3$","_context3","privKeyUrl","getExistingPublicKey","getExistingPrivateKey","confirm","uri","st","literal","sym","saveKey","lit","log","substring","lastIndexOf","setAcl","keyContainerAclBody","deleteKeyAcl","_ref","_callee","keyDoc","keyAclDoc","response","_callee$","_context","webOperation","status","Error","_x3","_x4","_x5","_x6","_saveKey","me","length","_callee4","aclBody","_callee4$","_context4","updater","updateMany","keyAclBody"],"sources":["../../src/chat/keys.ts"],"sourcesContent":["import * as debug from '../debug'\r\nimport { schnorr } from '@noble/curves/secp256k1'\r\nimport { bytesToHex } from '@noble/hashes/utils'\r\nimport * as ns from '../ns'\r\nimport { store } from 'solid-logic'\r\nimport { NamedNode } from 'rdflib'\r\nimport * as $rdf from 'rdflib'\r\nimport { getExistingPublicKey, pubKeyUrl, privKeyUrl, getExistingPrivateKey } from '../utils/keyHelpers/accessData'\r\nimport { setAcl, keyContainerAclBody, keyAclBody } from '../utils/keyHelpers/acl'\r\n\r\nexport function generatePrivateKey (): string {\r\n return bytesToHex(schnorr.utils.randomPrivateKey())\r\n}\r\n\r\nexport function generatePublicKey (privateKey: string): string {\r\n return bytesToHex(schnorr.getPublicKey(privateKey))\r\n}\r\n\r\n/**\r\n * getPublicKey\r\n * used for displaying messages in chat, therefore does not\r\n * create a new key if not found\r\n * @param webId\r\n * @returns string | undefined\r\n */\r\nexport async function getPublicKey (webId: NamedNode) {\r\n await store.fetcher.load(webId)\r\n const publicKeyDoc = await pubKeyUrl(webId)\r\n try {\r\n await store.fetcher.load(publicKeyDoc) // url.href)\r\n const key = store.any(webId, ns.solid('publicKey'))\r\n return key?.value // as NamedNode\r\n } catch (err) {\r\n return undefined\r\n }\r\n}\r\n\r\nexport async function getPrivateKey (webId: NamedNode) {\r\n await store.fetcher.load(webId)\r\n // find keys url's\r\n const publicKeyDoc = await pubKeyUrl(webId)\r\n const privateKeyDoc = await privKeyUrl(webId)\r\n\r\n // find key pair\r\n const publicKey = await getExistingPublicKey(webId, publicKeyDoc)\r\n let privateKey = await getExistingPrivateKey(webId, privateKeyDoc)\r\n\r\n // is publicKey valid ?\r\n let validPublicKey = true\r\n if (privateKey && (publicKey !== generatePublicKey(privateKey as string))) {\r\n if (confirm('This is strange the publicKey is not valid for\\n' + webId?.uri +\r\n '\\'shall we repair keeping the private key ?')) validPublicKey = false\r\n }\r\n\r\n // create key pair or repair publicKey\r\n if (!privateKey || !publicKey || !validPublicKey) {\r\n let del: any[] = []\r\n let add: any[] = []\r\n\r\n if (!privateKey) {\r\n // add = []\r\n privateKey = generatePrivateKey()\r\n add = [$rdf.st(webId, ns.solid('privateKey'), $rdf.literal(privateKey), store.sym(privateKeyDoc))]\r\n await saveKey(privateKeyDoc, [], add, webId.uri)\r\n }\r\n if (!publicKey || !validPublicKey) {\r\n del = []\r\n // delete invalid public key\r\n if (publicKey) {\r\n del = [$rdf.st(webId, ns.solid('publicKey'), $rdf.lit(publicKey), store.sym(publicKeyDoc))]\r\n debug.log('delete invalid publicKey ' + del)\r\n }\r\n // update new valid key\r\n const newPublicKey = generatePublicKey(privateKey)\r\n add = [$rdf.st(webId, ns.solid('publicKey'), $rdf.literal(newPublicKey), store.sym(publicKeyDoc))]\r\n await saveKey(publicKeyDoc, del, add)\r\n }\r\n const keyContainer = privateKeyDoc.substring(0, privateKeyDoc.lastIndexOf('/') + 1)\r\n await setAcl(keyContainer, keyContainerAclBody(webId.uri)) // includes DELETE and PUT\r\n }\r\n return privateKey as string\r\n}\r\n\r\nconst deleteKeyAcl = async (keyDoc: string) => {\r\n await store.fetcher.load(keyDoc)\r\n\r\n const keyAclDoc = store.any(store.sym(keyDoc), store.sym('http://www.iana.org/assignments/link-relations/acl'))\r\n if (keyAclDoc) {\r\n // delete READ only keyAclDoc. This is possible if the webId is an owner\r\n try {\r\n const response = await store.fetcher.webOperation('DELETE', keyAclDoc.value) // this may fail if webId is not an owner\r\n debug.log('delete keyAcl' + keyAclDoc.value + ' ' + response.status) // should test 404 and 2xx\r\n } catch (err) {\r\n if (err.response.status !== 404) { throw new Error(err) }\r\n debug.log('delete keyAcl' + keyAclDoc.value + ' ' + err.response.status) // should test 404 and 2xx\r\n }\r\n }\r\n}\r\n\r\n/**\r\n * delete acl if keydoc exists\r\n * create/edit keyDoc\r\n * set keyDoc acl\r\n */\r\nasync function saveKey (keyDoc: string, del, add, me: string = '') {\r\n await deleteKeyAcl(keyDoc)\r\n // save key\r\n await store.updater.updateMany(del, add) // or a promise store.updater.update ?\r\n\r\n // create READ only ACL\r\n const aclBody = keyAclBody(keyDoc, me)\r\n await setAcl(keyDoc, aclBody)\r\n}\r\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AACA,IAAAG,EAAA,GAAAJ,uBAAA,CAAAC,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAEA,IAAAK,IAAA,GAAAN,uBAAA,CAAAC,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AACA,IAAAO,IAAA,GAAAP,OAAA;AAAiF,SAAAQ,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAV,wBAAAU,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,OAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,C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a,EAAE,CAAC;YAAAK,SAAA,CAAA9D,IAAA;YAAA,OAChC,IAAAuC,WAAM,EAACK,MAAM,EAAEgB,OAAO,CAAC;UAAA;UAAA;YAAA,OAAAE,SAAA,CAAAlD,IAAA;QAAA;MAAA,GAAA+C,QAAA;IAAA;EAAA,CAC9B;EAAA,OAAAH,QAAA,CAAArE,KAAA,OAAAC,SAAA;AAAA","ignoreList":[]}
|
package/lib/chat/message.js
CHANGED
|
@@ -34,9 +34,9 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
34
34
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
35
35
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
36
36
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
37
|
-
function _createForOfIteratorHelper(
|
|
38
|
-
function _unsupportedIterableToArray(
|
|
39
|
-
function _arrayLikeToArray(
|
|
37
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
38
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
39
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } /** UI code for individual messages: display them, edit them
|
|
40
40
|
*
|
|
41
41
|
* @packageDocumentation
|
|
42
42
|
*/ /* global $rdf */
|
|
@@ -142,7 +142,7 @@ function renderMessageRow(_x, _x2, _x3, _x4, _x5) {
|
|
|
142
142
|
return _renderMessageRow.apply(this, arguments);
|
|
143
143
|
} // END OF RENDERMESSAGE
|
|
144
144
|
function _renderMessageRow() {
|
|
145
|
-
_renderMessageRow = (0, _asyncToGenerator2["default"])(
|
|
145
|
+
_renderMessageRow = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee9(channelObject, message, fresh, options, userContext) {
|
|
146
146
|
var unsignedMessage, colorizeByAuthor, creator, date, latestVersion, latestVersionCreator, msgId, content, versions, replies, thread, straightReplies, _iterator2, _step2, reply, signature, msg, originalMessage, edited, sortDate, messageRow, td1, img, bothDates, td2, text, isURI, para, isImage, _img, anc, bgcolor, getBgColor, strip, td3, toolsButton;
|
|
147
147
|
return _regenerator["default"].wrap(function _callee9$(_context10) {
|
|
148
148
|
while (1) switch (_context10.prev = _context10.next) {
|
|
@@ -302,7 +302,7 @@ function _renderMessageRow() {
|
|
|
302
302
|
toolsButton = widgets.button(dom, _iconBase.icons.iconBase + 'noun_243787.svg', '...');
|
|
303
303
|
td3.appendChild(toolsButton);
|
|
304
304
|
toolsButton.addEventListener('click', /*#__PURE__*/function () {
|
|
305
|
-
var _ref4 = (0, _asyncToGenerator2["default"])(
|
|
305
|
+
var _ref4 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee8(_event) {
|
|
306
306
|
var toolsTR, tools, toolsTD;
|
|
307
307
|
return _regenerator["default"].wrap(function _callee8$(_context9) {
|
|
308
308
|
while (1) switch (_context9.prev = _context9.next) {
|
|
@@ -369,7 +369,7 @@ function switchToEditor(_x6, _x7, _x8, _x9) {
|
|
|
369
369
|
*
|
|
370
370
|
*/
|
|
371
371
|
function _switchToEditor() {
|
|
372
|
-
_switchToEditor = (0, _asyncToGenerator2["default"])(
|
|
372
|
+
_switchToEditor = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee10(messageRow, message, channelObject, userContext) {
|
|
373
373
|
var messageTable, editRow;
|
|
374
374
|
return _regenerator["default"].wrap(function _callee10$(_context11) {
|
|
375
375
|
while (1) switch (_context11.prev = _context11.next) {
|
|
@@ -405,7 +405,7 @@ function renderMessageEditor(channelObject, messageTable, userContext, options,
|
|
|
405
405
|
return _handleFieldInput.apply(this, arguments);
|
|
406
406
|
}
|
|
407
407
|
function _handleFieldInput() {
|
|
408
|
-
_handleFieldInput = (0, _asyncToGenerator2["default"])(
|
|
408
|
+
_handleFieldInput = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5(_event) {
|
|
409
409
|
return _regenerator["default"].wrap(function _callee5$(_context6) {
|
|
410
410
|
while (1) switch (_context6.prev = _context6.next) {
|
|
411
411
|
case 0:
|
|
@@ -424,13 +424,13 @@ function renderMessageEditor(channelObject, messageTable, userContext, options,
|
|
|
424
424
|
} // sendMessage
|
|
425
425
|
// DRAG AND DROP
|
|
426
426
|
function _sendMessage() {
|
|
427
|
-
_sendMessage = (0, _asyncToGenerator2["default"])(
|
|
427
|
+
_sendMessage = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee7(text, fromMainField) {
|
|
428
428
|
var sendComplete, _sendComplete, message, statusArea;
|
|
429
429
|
return _regenerator["default"].wrap(function _callee7$(_context8) {
|
|
430
430
|
while (1) switch (_context8.prev = _context8.next) {
|
|
431
431
|
case 0:
|
|
432
432
|
_sendComplete = function _sendComplete3() {
|
|
433
|
-
_sendComplete = (0, _asyncToGenerator2["default"])(
|
|
433
|
+
_sendComplete = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee6(message, _text2) {
|
|
434
434
|
var oldRow;
|
|
435
435
|
return _regenerator["default"].wrap(function _callee6$(_context7) {
|
|
436
436
|
while (1) switch (_context7.prev = _context7.next) {
|
|
@@ -504,7 +504,7 @@ function renderMessageEditor(channelObject, messageTable, userContext, options,
|
|
|
504
504
|
function droppedFileHandler(files) {
|
|
505
505
|
var base = messageTable.chatDocument.dir().uri;
|
|
506
506
|
widgets.uploadFiles(_solidLogic.store.fetcher, files, base + 'Files', base + 'Pictures', /*#__PURE__*/function () {
|
|
507
|
-
var _ref = (0, _asyncToGenerator2["default"])(
|
|
507
|
+
var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee(theFile, destURI) {
|
|
508
508
|
return _regenerator["default"].wrap(function _callee$(_context2) {
|
|
509
509
|
while (1) switch (_context2.prev = _context2.next) {
|
|
510
510
|
case 0:
|
|
@@ -524,7 +524,7 @@ function renderMessageEditor(channelObject, messageTable, userContext, options,
|
|
|
524
524
|
|
|
525
525
|
// When a set of URIs are dropped on the field
|
|
526
526
|
var droppedURIHandler = /*#__PURE__*/function () {
|
|
527
|
-
var _ref2 = (0, _asyncToGenerator2["default"])(
|
|
527
|
+
var _ref2 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2(uris) {
|
|
528
528
|
var _iterator, _step, uri;
|
|
529
529
|
return _regenerator["default"].wrap(function _callee2$(_context3) {
|
|
530
530
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -575,7 +575,7 @@ function renderMessageEditor(channelObject, messageTable, userContext, options,
|
|
|
575
575
|
return _tookPicture.apply(this, arguments);
|
|
576
576
|
} // Body of turnOnInput
|
|
577
577
|
function _tookPicture() {
|
|
578
|
-
_tookPicture = (0, _asyncToGenerator2["default"])(
|
|
578
|
+
_tookPicture = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4(imageDoc) {
|
|
579
579
|
return _regenerator["default"].wrap(function _callee4$(_context5) {
|
|
580
580
|
while (1) switch (_context5.prev = _context5.next) {
|
|
581
581
|
case 0:
|
|
@@ -628,7 +628,7 @@ function renderMessageEditor(channelObject, messageTable, userContext, options,
|
|
|
628
628
|
// Trap the Enter BEFORE it is used ti make a newline
|
|
629
629
|
|
|
630
630
|
field.addEventListener('keydown', /*#__PURE__*/function () {
|
|
631
|
-
var _ref3 = (0, _asyncToGenerator2["default"])(
|
|
631
|
+
var _ref3 = (0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3(e) {
|
|
632
632
|
return _regenerator["default"].wrap(function _callee3$(_context4) {
|
|
633
633
|
while (1) switch (_context4.prev = _context4.next) {
|
|
634
634
|
case 0:
|