solid-ui 2.4.28-df3d9431 → 2.4.28-e3ba3633

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.
Files changed (95) hide show
  1. package/dist/805.solid-ui.min.js +1 -1
  2. package/dist/805.solid-ui.min.js.map +1 -1
  3. package/dist/solid-ui.js +1606 -2297
  4. package/dist/solid-ui.js.map +1 -1
  5. package/dist/solid-ui.min.js +1 -1
  6. package/dist/solid-ui.min.js.map +1 -1
  7. package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js +1955 -1955
  8. package/dist/vendors-node_modules_jsonld_lib_jsonld_js.solid-ui.js.map +1 -1
  9. package/lib/chat/bookmarks.js +7 -6
  10. package/lib/chat/bookmarks.js.map +1 -1
  11. package/lib/chat/chatLogic.js +65 -249
  12. package/lib/chat/chatLogic.js.map +1 -1
  13. package/lib/chat/dateFolder.js +126 -129
  14. package/lib/chat/dateFolder.js.map +1 -1
  15. package/lib/chat/infinite.js +423 -637
  16. package/lib/chat/infinite.js.map +1 -1
  17. package/lib/chat/keys.d.ts +0 -3
  18. package/lib/chat/keys.d.ts.map +1 -1
  19. package/lib/chat/keys.js +80 -124
  20. package/lib/chat/keys.js.map +1 -1
  21. package/lib/chat/message.js +194 -333
  22. package/lib/chat/message.js.map +1 -1
  23. package/lib/chat/messageTools.js +277 -463
  24. package/lib/chat/messageTools.js.map +1 -1
  25. package/lib/chat/signature.d.ts +2 -0
  26. package/lib/chat/signature.d.ts.map +1 -1
  27. package/lib/chat/signature.js +70 -1
  28. package/lib/chat/signature.js.map +1 -1
  29. package/lib/chat/thread.js +209 -299
  30. package/lib/chat/thread.js.map +1 -1
  31. package/lib/header/index.js +0 -5
  32. package/lib/header/index.js.map +1 -1
  33. package/lib/log.js +5 -5
  34. package/lib/log.js.map +1 -1
  35. package/lib/login/login.d.ts.map +1 -1
  36. package/lib/login/login.js +31 -65
  37. package/lib/login/login.js.map +1 -1
  38. package/lib/media/media-capture.d.ts +2 -2
  39. package/lib/media/media-capture.d.ts.map +1 -1
  40. package/lib/media/media-capture.js +11 -15
  41. package/lib/media/media-capture.js.map +1 -1
  42. package/lib/pad.d.ts +2 -2
  43. package/lib/pad.d.ts.map +1 -1
  44. package/lib/pad.js +15 -41
  45. package/lib/pad.js.map +1 -1
  46. package/lib/participation.d.ts +5 -5
  47. package/lib/participation.d.ts.map +1 -1
  48. package/lib/participation.js +22 -23
  49. package/lib/participation.js.map +1 -1
  50. package/lib/preferences.js +0 -4
  51. package/lib/preferences.js.map +1 -1
  52. package/lib/style.js +35 -30
  53. package/lib/style.js.map +1 -1
  54. package/lib/styleConstants.js +34 -0
  55. package/lib/styleConstants.js.map +1 -0
  56. package/lib/tabs.d.ts +0 -125
  57. package/lib/tabs.d.ts.map +1 -1
  58. package/lib/tabs.js +15 -8
  59. package/lib/tabs.js.map +1 -1
  60. package/lib/utils/headerFooterHelpers.js +0 -2
  61. package/lib/utils/headerFooterHelpers.js.map +1 -1
  62. package/lib/utils/keyHelpers/accessData.d.ts +2 -2
  63. package/lib/utils/keyHelpers/accessData.d.ts.map +1 -1
  64. package/lib/utils/keyHelpers/accessData.js +131 -51
  65. package/lib/utils/keyHelpers/accessData.js.map +1 -1
  66. package/lib/versionInfo.js +6 -6
  67. package/lib/versionInfo.js.map +1 -1
  68. package/lib/widgets/buttons.js +2 -0
  69. package/lib/widgets/buttons.js.map +1 -1
  70. package/lib/widgets/dragAndDrop.js +10 -18
  71. package/lib/widgets/dragAndDrop.js.map +1 -1
  72. package/lib/widgets/error.d.ts.map +1 -1
  73. package/lib/widgets/error.js +9 -2
  74. package/lib/widgets/error.js.map +1 -1
  75. package/lib/widgets/forms/autocomplete/autocompleteBar.js +1 -8
  76. package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
  77. package/lib/widgets/forms/autocomplete/autocompletePicker.d.ts.map +1 -1
  78. package/lib/widgets/forms/autocomplete/autocompletePicker.js +5 -9
  79. package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
  80. package/lib/widgets/forms/autocomplete/language.js +0 -5
  81. package/lib/widgets/forms/autocomplete/language.js.map +1 -1
  82. package/lib/widgets/forms/basic.d.ts.map +1 -1
  83. package/lib/widgets/forms/basic.js +4 -3
  84. package/lib/widgets/forms/basic.js.map +1 -1
  85. package/lib/widgets/forms/fieldParams.js +2 -2
  86. package/lib/widgets/forms/fieldParams.js.map +1 -1
  87. package/lib/widgets/forms.js +10 -12
  88. package/lib/widgets/forms.js.map +1 -1
  89. package/lib/widgets/peoplePicker.js +0 -11
  90. package/lib/widgets/peoplePicker.js.map +1 -1
  91. package/package.json +2 -5
  92. package/lib/utils/keyHelpers/otherHelpers.d.ts +0 -3
  93. package/lib/utils/keyHelpers/otherHelpers.d.ts.map +0 -1
  94. package/lib/utils/keyHelpers/otherHelpers.js +0 -23
  95. package/lib/utils/keyHelpers/otherHelpers.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"infinite.js","names":["$rdf","_interopRequireWildcard","require","_solidLogic","debug","_iconBase","ns","widgets","_chatLogic","_message","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","_createForOfIteratorHelper","o","allowArrayLike","it","Symbol","iterator","Array","isArray","_unsupportedIterableToArray","length","i","F","s","n","done","value","e","_e2","f","TypeError","normalCompletion","didErr","err","step","next","_e3","minLen","_arrayLikeToArray","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","log","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","load","response","status","errorMessageBlock","_createMessageTable2","_x16","_x17","_removePreviousMessag","backwards","previousSibling","extr","_insertPreviousMessag2","_callee4","extremity","todayDoc","newMessageTable","_callee4$","_context4","limit","loadPrevious","concat","_insertPreviousMessag","_x15","_addMessage3","_callee3","id","_callee3$","_context3","isDeleted","showDeletedMessages","any","sioc","uri","_addMessage2","_x13","_x14","_syncMessages3","_callee2","displayed","ele2","messages","stored","_iterator","_step","m","_callee2$","_context2","AJAR_subject","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, isReplaced } 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\n const messages = store.each(chatChannel, ns.wf('message'), null, messageTable.chatDocument)\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\n await insertMessageIntoTable(channelObject,\n messageTable,\n message,\n messageTable.fresh,\n options,\n userContext\n ) // fresh from elsewhere\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.load(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\n\n // loadMessageTable(messageTable, chatDocument)\n messageTable.fresh = false\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(' inifinite: 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,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,SAAAV,wBAAAc,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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AAC2B,GAAG,EAAE,CAAC;cACjG,IAAIvB,UAAU,EAAE;gBACdH,QAAQ,CAAC6K,KAAK,GAAG,IAAIlJ,IAAI,CAACxB,UAAU,CAAC9G,KAAK,CAAC;gBAC3C3C,KAAK,CAACsM,GAAG,CAAC,8BAA8B,GAAGhD,QAAQ,CAAC6K,KAAK,CAAC;cAC5D;YACF;UACF;UAEIzK,IAAI,GAAG,KAAK;UAAAE,UAAA,CAAAxG,IAAA;UAAA,OAEV2F,kBAAkB,EAAE;QAAA;UAAA,OAAAa,UAAA,CAAA/C,MAAA,WACnBqC,GAAG;QAAA;QAAA;UAAA,OAAAU,UAAA,CAAAzC,IAAA;MAAA;IAAA,GAAAO,SAAA;EAAA,CACX;EAAA,OAAAD,oBAAA,CAAAxC,KAAA,OAAAC,SAAA;AAAA"}
1
+ {"version":3,"file":"infinite.js","names":["$rdf","_interopRequireWildcard","require","_solidLogic","debug","_iconBase","ns","widgets","_chatLogic","_message","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","desktopNotification","str","window","warn","Notification","permission","requestPermission","then","insertMessageIntoTable","channelObject","messageTable","message","fresh","options","userContext","messageRow","renderMessageRow","selectedMessage","sameTerm","style","backgroundColor","selectedElement","done","ele","firstChild","nextSibling","newestFirst","newestfirst","dateString","AJAR_date","insertBefore","appendChild","infiniteMessageArea","_x","_x2","_x3","_x4","_infiniteMessageArea","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee12","dom","wasStore","chatChannel","syncMessages","addMessage","insertPreviousMessages","_insertPreviousMessages","removePreviousMessages","createMessageTable","_createMessageTable","renderMessageTable","addNewChatDocumentIfNewDay","_addNewChatDocumentIfNewDay","appendCurrentMessages","_appendCurrentMessages","loadMoreWhereNeeded","_loadMoreWhereNeeded","loadInitialContent","_loadInitialContent","dateFolder","div","statusArea","liveMessageTable","earliest","latest","lock","wrap","_callee12$","_context12","prev","next","_loadInitialContent3","_callee11","yank","fixScroll","live","selectedDocument","now","todayDocument","selectedMessageTable","selectedDate","_callee11$","_context11","_fixScroll","scrollIntoView","block","inputRow","_yank","doc","Date","leafDocumentFromDate","dateFromLeafDocument","sent","setTimeout","addEventListener","solo","document","body","stop","_loadInitialContent2","_loadMoreWhereNeeded3","_callee10","event","freeze","magicZone","scrollBottom","scrollTop","_callee10$","_context10","abrupt","initial","extendBackwards","scrollHeight","log","clientHeight","extendForwards","_loadMoreWhereNeeded2","_x10","_x11","_appendCurrentMessage2","_callee9","chatDocument","_callee9$","_context9","refresh","_callee8","_callee8$","_context8","store","updater","addDownstreamChangeListener","_appendCurrentMessage","_addNewChatDocumentIf2","_callee7","newChatDocument","oldChatDocument","sts","_callee7$","_context7","removeChild","holds","rdfs","st","update","err","alert","_addNewChatDocumentIf","_renderMessageTable","date","scrollBackbutton","scrollForwardButton","_extendBackwards","_callee","_callee$","_context","setAttribute","icons","iconBase","disabled","extendedBack","setScrollBackbuttonIcon","sense","scrollBackIcon","getScrollbackIcon","scrollBackbuttonHandler","_x8","_scrollBackbuttonHandler","_callee2","_event","_callee2$","_context2","_extendForwards","_callee3","_callee3$","_context3","extendedForwards","setScrollForwardButtonIcon","scrollForwardIcon","getScrollForwardButtonIcon","scrollForwardButtonHandler","_x9","_scrollForwardButtonHandler","_callee4","_callee4$","_context4","createElement","tr","renderMessageEditor","infinite","scrollBackbuttonTR","scrollBackbuttonCell","button","dateCell","textContent","shortDate","toISOString","scrollForwardButtonCell","extendedForward","statementsMatching","wf","length","forEach","object","_createMessageTable3","_callee6","statusTR","_callee6$","_context6","fetcher","load","t0","response","status","errorMessageBlock","_createMessageTable2","_x6","_x7","_removePreviousMessag","backwards","previousSibling","extr","_insertPreviousMessag2","_callee5","extremity","todayDoc","newMessageTable","_callee5$","_context5","loadPrevious","concat","_insertPreviousMessag","_x5","_addMessage","mostRecentVersion","isDeleted","showDeletedMessages","_syncMessages","about","displayed","ele2","AJAR_subject","uri","messages","map","stored","m","refreshTree","authorDateOnLeft","ChatChannel"],"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, mostRecentVersion } 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 function insertMessageIntoTable (channelObject, messageTable, message, fresh, options, userContext) {\n const messageRow = 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 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\n const messages = store\n .statementsMatching(\n about,\n ns.wf('message'),\n null,\n messageTable.chatDocument\n )\n .map(st => {\n return st.object\n })\n const stored = {}\n messages.forEach(function (m) {\n stored[m.uri] = true\n if (!displayed[m.uri]) {\n 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 function addMessage (message, messageTable) {\n const latest = mostRecentVersion(message)\n // const content = store.any(latest, ns.sioc('content'))\n if (isDeleted(latest) && !options.showDeletedMessages) {\n return // ignore deleted messaged -- @@ could also leave a placeholder\n }\n insertMessageIntoTable(channelObject,\n messageTable,\n message,\n messageTable.fresh,\n options,\n userContext\n ) // fresh from elsewhere\n }\n\n /* Add a new messageTable at the top/bottom\n */\n async function insertPreviousMessages (backwards) {\n const extremity = backwards ? earliest : latest\n let date = extremity.messageTable.date // day in mssecs\n\n date = await dateFolder.loadPrevious(date, backwards) // backwards\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.load(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 renderMessageTable(date, live) // no mssage file is fine.. will be craeted 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 renderMessageTable(date, live)\n }\n\n function renderMessageTable (date, live) {\n let scrollBackbutton\n let scrollForwardButton\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 async function scrollBackbuttonHandler (_event) {\n if (messageTable.extendedBack) {\n removePreviousMessages(true, messageTable)\n messageTable.extendedBack = false\n setScrollBackbuttonIcon()\n } else {\n await extendBackwards()\n }\n }\n\n /// ////////////// Scroll up adding more below\n\n async function extendForwards () {\n const done = await insertPreviousMessages(false)\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 return done\n }\n\n function setScrollForwardButtonIcon () {\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 const messageTable = dom.createElement('table')\n\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 if (options.infinite) {\n const scrollBackbuttonTR = dom.createElement('tr')\n const scrollBackbuttonCell = scrollBackbuttonTR.appendChild(\n dom.createElement('td')\n )\n // up traingles: noun_1369237.svg\n // down triangles: noun_1369241.svg\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 = scrollBackbuttonTR.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 = scrollBackbuttonTR.appendChild(\n dom.createElement('td')\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(scrollBackbuttonTR, messageTable.firstChild) // If not newestFirst\n } else {\n messageTable.appendChild(scrollBackbuttonTR) // 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 sts.forEach(st => {\n addMessage(st.object, messageTable)\n })\n messageTable.fresh = true\n\n // loadMessageTable(messageTable, chatDocument)\n messageTable.fresh = false\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 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 // console.log(' chat/loadMoreWhereNeeded: trying later...')\n setTimeout(loadMoreWhereNeeded, 2000) // couple be less\n lock = false\n return // abandon now, do later\n }\n // console.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 selectedMessageTable.selectedElement.scrollIntoView({ block: 'center' })\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\n if (options.selectedMessage) {\n selectedDocument = options.selectedMessage.doc()\n const now = new Date()\n const todayDocument = dateFolder.leafDocumentFromDate(now)\n live = todayDocument.sameTerm(selectedDocument)\n }\n let selectedMessageTable\n if (options.selectedMessage && !live) {\n const selectedDate = dateFolder.dateFromLeafDocument(selectedDocument)\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 // const messageTable = dom.createElement('table') // @@ check does this go in renderMessageTable\n\n let liveMessageTable\n const earliest = { messageTable: null } // Stuff about each end of the loaded days\n const latest = { messageTable: null }\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,GAAA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,KAAK,GAAG,IAAIb,OAAO,CAACa,WAAW,KAAK,IAAI,EAAC;UAE1EjB,aAAa,GAAG,IAAImP,sBAAW,CAAC9M,WAAW,EAAEjC,OAAO,CAAC;UACrDkD,UAAU,GAAGtD,aAAa,CAACsD,UAAU;UAErCC,GAAG,GAAGpB,GAAG,CAACiJ,aAAa,CAAC,KAAK,CAAC;UACpCpL,aAAa,CAACuD,GAAG,GAAGA,GAAG;UAEjBC,UAAU,GAAGD,GAAG,CAACjC,WAAW,CAACa,GAAG,CAACiJ,aAAa,CAAC,KAAK,CAAC,CAAC;UACtD/K,WAAW,GAAG;YAAE8B,GAAG,EAAHA,GAAG;YAAEqB,UAAU,EAAVA,UAAU;YAAED,GAAG,EAAEC;UAAW,CAAC,EAAC;UAEzD;UAGME,QAAQ,GAAG;YAAEzD,YAAY,EAAE;UAAK,CAAC,EAAC;UAClC0D,MAAM,GAAG;YAAE1D,YAAY,EAAE;UAAK,CAAC;UAEjC2D,IAAI,GAAG,KAAK;UAAAG,UAAA,CAAAE,IAAA;UAAA,OAEVb,kBAAkB,EAAE;QAAA;UAAA,OAAAW,UAAA,CAAAyC,MAAA,WACnBjD,GAAG;QAAA;QAAA;UAAA,OAAAQ,UAAA,CAAA8B,IAAA;MAAA;IAAA,GAAA3D,SAAA;EAAA,CACX;EAAA,OAAAN,oBAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA"}
@@ -9,8 +9,5 @@ export declare function generatePublicKey(privateKey: string): string;
9
9
  * @returns string | undefined
10
10
  */
11
11
  export declare function getPublicKey(webId: NamedNode): Promise<string | undefined>;
12
- export declare function validPublicKey(webId: NamedNode, publicKey: string | undefined, privateKey: string): boolean;
13
- export declare function generateAndStoreNewPublicKey(webId: NamedNode, privateKey: string, publicKey: string | undefined, publicKeyDoc: string): Promise<void>;
14
- export declare function createAndSaveKeyPairs(webId: NamedNode, publicKey: string | undefined, privateKeyDoc: string, publicKeyDoc: string): Promise<string>;
15
12
  export declare function getPrivateKey(webId: NamedNode): Promise<string>;
16
13
  //# sourceMappingURL=keys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/chat/keys.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAKlC,wBAAgB,kBAAkB,IAAK,MAAM,CAE5C;AAED,wBAAgB,iBAAiB,CAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAE,KAAK,EAAE,SAAS,+BAgBnD;AAED,wBAAgB,cAAc,CAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAM5G;AAED,wBAAsB,4BAA4B,CAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,YAAY,EAAE,MAAM,iBAK5I;AAED,wBAAsB,qBAAqB,CAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,mBAQxI;AAED,wBAAsB,aAAa,CAAE,KAAK,EAAE,SAAS,mBAoBpD"}
1
+ {"version":3,"file":"keys.d.ts","sourceRoot":"","sources":["../../src/chat/keys.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAA;AAKlC,wBAAgB,kBAAkB,IAAK,MAAM,CAE5C;AAED,wBAAgB,iBAAiB,CAAE,UAAU,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAE,KAAK,EAAE,SAAS,+BAUnD;AAED,wBAAsB,aAAa,CAAE,KAAK,EAAE,SAAS,mBA4CpD"}
package/lib/chat/keys.js CHANGED
@@ -5,13 +5,10 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.createAndSaveKeyPairs = createAndSaveKeyPairs;
9
- exports.generateAndStoreNewPublicKey = generateAndStoreNewPublicKey;
10
8
  exports.generatePrivateKey = generatePrivateKey;
11
9
  exports.generatePublicKey = generatePublicKey;
12
10
  exports.getPrivateKey = getPrivateKey;
13
11
  exports.getPublicKey = getPublicKey;
14
- exports.validPublicKey = validPublicKey;
15
12
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
16
13
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
17
14
  var debug = _interopRequireWildcard(require("../debug"));
@@ -47,150 +44,109 @@ function _getPublicKey() {
47
44
  return _regenerator["default"].wrap(function _callee2$(_context2) {
48
45
  while (1) switch (_context2.prev = _context2.next) {
49
46
  case 0:
50
- _context2.prev = 0;
51
- _context2.next = 3;
47
+ _context2.next = 2;
52
48
  return _solidLogic.store.fetcher.load(webId);
53
- case 3:
54
- _context2.next = 5;
49
+ case 2:
50
+ _context2.next = 4;
55
51
  return (0, _accessData.pubKeyUrl)(webId);
56
- case 5:
52
+ case 4:
57
53
  publicKeyDoc = _context2.sent;
58
- _context2.prev = 6;
59
- _context2.next = 9;
54
+ _context2.prev = 5;
55
+ _context2.next = 8;
60
56
  return _solidLogic.store.fetcher.load(publicKeyDoc);
61
- case 9:
57
+ case 8:
62
58
  // url.href)
63
59
  key = _solidLogic.store.any(webId, ns.solid('publicKey'));
64
60
  return _context2.abrupt("return", key === null || key === void 0 ? void 0 : key.value);
65
- case 13:
66
- _context2.prev = 13;
67
- _context2.t0 = _context2["catch"](6);
68
- debug.error(_context2.t0);
61
+ case 12:
62
+ _context2.prev = 12;
63
+ _context2.t0 = _context2["catch"](5);
69
64
  return _context2.abrupt("return", undefined);
70
- case 17:
71
- _context2.next = 23;
72
- break;
73
- case 19:
74
- _context2.prev = 19;
75
- _context2.t1 = _context2["catch"](0);
76
- debug.error(_context2.t1);
77
- return _context2.abrupt("return", undefined);
78
- case 23:
65
+ case 15:
79
66
  case "end":
80
67
  return _context2.stop();
81
68
  }
82
- }, _callee2, null, [[0, 19], [6, 13]]);
69
+ }, _callee2, null, [[5, 12]]);
83
70
  }));
84
71
  return _getPublicKey.apply(this, arguments);
85
72
  }
86
- function validPublicKey(webId, publicKey, privateKey) {
87
- if (privateKey && publicKey !== generatePublicKey(privateKey)) {
88
- if (confirm('This is strange the publicKey is not valid for\n' + (webId === null || webId === void 0 ? void 0 : webId.uri) + '\'shall we repair keeping the private key ?')) return false;
89
- }
90
- return true;
91
- }
92
- function generateAndStoreNewPublicKey(_x2, _x3, _x4, _x5) {
93
- return _generateAndStoreNewPublicKey.apply(this, arguments);
94
- }
95
- function _generateAndStoreNewPublicKey() {
96
- _generateAndStoreNewPublicKey = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(webId, privateKey, publicKey, publicKeyDoc) {
97
- var del, newPublicKey, add;
98
- return _regenerator["default"].wrap(function _callee3$(_context3) {
99
- while (1) switch (_context3.prev = _context3.next) {
100
- case 0:
101
- del = [$rdf.st(webId, ns.solid('publicKey'), $rdf.lit(publicKey || ''), _solidLogic.store.sym(publicKeyDoc))];
102
- newPublicKey = generatePublicKey(privateKey);
103
- add = [$rdf.st(webId, ns.solid('publicKey'), $rdf.literal(newPublicKey), _solidLogic.store.sym(publicKeyDoc))];
104
- _context3.next = 5;
105
- return saveKeyAndHandleAcl(publicKeyDoc, del, add);
106
- case 5:
107
- case "end":
108
- return _context3.stop();
109
- }
110
- }, _callee3);
111
- }));
112
- return _generateAndStoreNewPublicKey.apply(this, arguments);
113
- }
114
- function createAndSaveKeyPairs(_x6, _x7, _x8, _x9) {
115
- return _createAndSaveKeyPairs.apply(this, arguments);
116
- }
117
- function _createAndSaveKeyPairs() {
118
- _createAndSaveKeyPairs = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(webId, publicKey, privateKeyDoc, publicKeyDoc) {
119
- var privateKey, add;
120
- return _regenerator["default"].wrap(function _callee4$(_context4) {
121
- while (1) switch (_context4.prev = _context4.next) {
122
- case 0:
123
- privateKey = generatePrivateKey();
124
- add = [$rdf.st(webId, ns.solid('privateKey'), $rdf.literal(privateKey), _solidLogic.store.sym(privateKeyDoc))];
125
- _context4.next = 4;
126
- return saveKeyAndHandleAcl(privateKeyDoc, [], add, webId.uri);
127
- case 4:
128
- _context4.next = 6;
129
- return generateAndStoreNewPublicKey(webId, privateKey, publicKey, publicKeyDoc);
130
- case 6:
131
- return _context4.abrupt("return", privateKey);
132
- case 7:
133
- case "end":
134
- return _context4.stop();
135
- }
136
- }, _callee4);
137
- }));
138
- return _createAndSaveKeyPairs.apply(this, arguments);
139
- }
140
- function getPrivateKey(_x10) {
73
+ function getPrivateKey(_x2) {
141
74
  return _getPrivateKey.apply(this, arguments);
142
75
  }
143
76
  function _getPrivateKey() {
144
- _getPrivateKey = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee5(webId) {
145
- var publicKeyDoc, privateKeyDoc, publicKey, privateKey, keyContainer;
146
- return _regenerator["default"].wrap(function _callee5$(_context5) {
147
- while (1) switch (_context5.prev = _context5.next) {
77
+ _getPrivateKey = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(webId) {
78
+ var publicKeyDoc, privateKeyDoc, publicKey, privateKey, validPublicKey, del, add, newPublicKey, keyContainer;
79
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
80
+ while (1) switch (_context3.prev = _context3.next) {
148
81
  case 0:
149
- _context5.next = 2;
82
+ _context3.next = 2;
150
83
  return _solidLogic.store.fetcher.load(webId);
151
84
  case 2:
152
- _context5.next = 4;
85
+ _context3.next = 4;
153
86
  return (0, _accessData.pubKeyUrl)(webId);
154
87
  case 4:
155
- publicKeyDoc = _context5.sent;
156
- _context5.next = 7;
88
+ publicKeyDoc = _context3.sent;
89
+ _context3.next = 7;
157
90
  return (0, _accessData.privKeyUrl)(webId);
158
91
  case 7:
159
- privateKeyDoc = _context5.sent;
160
- _context5.next = 10;
92
+ privateKeyDoc = _context3.sent;
93
+ _context3.next = 10;
161
94
  return (0, _accessData.getExistingPublicKey)(webId, publicKeyDoc);
162
95
  case 10:
163
- publicKey = _context5.sent;
164
- _context5.next = 13;
96
+ publicKey = _context3.sent;
97
+ _context3.next = 13;
165
98
  return (0, _accessData.getExistingPrivateKey)(webId, privateKeyDoc);
166
99
  case 13:
167
- privateKey = _context5.sent;
100
+ privateKey = _context3.sent;
101
+ // is publicKey valid ?
102
+ validPublicKey = true;
103
+ if (privateKey && publicKey !== generatePublicKey(privateKey)) {
104
+ if (confirm('This is strange the publicKey is not valid for\n' + (webId === null || webId === void 0 ? void 0 : webId.uri) + '\'shall we repair keeping the private key ?')) validPublicKey = false;
105
+ }
106
+
107
+ // create key pair or repair publicKey
108
+ if (!(!privateKey || !publicKey || !validPublicKey)) {
109
+ _context3.next = 34;
110
+ break;
111
+ }
112
+ del = [];
113
+ add = [];
168
114
  if (privateKey) {
169
- _context5.next = 18;
115
+ _context3.next = 24;
170
116
  break;
171
117
  }
172
- _context5.next = 17;
173
- return createAndSaveKeyPairs(webId, publicKey, privateKeyDoc, publicKeyDoc);
174
- case 17:
175
- privateKey = _context5.sent;
176
- case 18:
177
- if (validPublicKey(webId, publicKey, privateKey)) {
178
- _context5.next = 21;
118
+ // add = []
119
+ privateKey = generatePrivateKey();
120
+ add = [$rdf.st(webId, ns.solid('privateKey'), $rdf.literal(privateKey), _solidLogic.store.sym(privateKeyDoc))];
121
+ _context3.next = 24;
122
+ return saveKey(privateKeyDoc, [], add, webId.uri);
123
+ case 24:
124
+ if (!(!publicKey || !validPublicKey)) {
125
+ _context3.next = 31;
179
126
  break;
180
127
  }
181
- _context5.next = 21;
182
- return generateAndStoreNewPublicKey(webId, privateKey, publicKey, publicKeyDoc);
183
- case 21:
128
+ del = [];
129
+ // delete invalid public key
130
+ if (publicKey) {
131
+ del = [$rdf.st(webId, ns.solid('publicKey'), $rdf.lit(publicKey), _solidLogic.store.sym(publicKeyDoc))];
132
+ debug.log(del);
133
+ }
134
+ // update new valid key
135
+ newPublicKey = generatePublicKey(privateKey);
136
+ add = [$rdf.st(webId, ns.solid('publicKey'), $rdf.literal(newPublicKey), _solidLogic.store.sym(publicKeyDoc))];
137
+ _context3.next = 31;
138
+ return saveKey(publicKeyDoc, del, add);
139
+ case 31:
184
140
  keyContainer = privateKeyDoc.substring(0, privateKeyDoc.lastIndexOf('/') + 1);
185
- _context5.next = 24;
141
+ _context3.next = 34;
186
142
  return (0, _acl.setAcl)(keyContainer, (0, _acl.keyContainerAclBody)(webId.uri));
187
- case 24:
188
- return _context5.abrupt("return", privateKey);
189
- case 25:
143
+ case 34:
144
+ return _context3.abrupt("return", privateKey);
145
+ case 35:
190
146
  case "end":
191
- return _context5.stop();
147
+ return _context3.stop();
192
148
  }
193
- }, _callee5);
149
+ }, _callee3);
194
150
  }));
195
151
  return _getPrivateKey.apply(this, arguments);
196
152
  }
@@ -233,7 +189,7 @@ var deleteKeyAcl = /*#__PURE__*/function () {
233
189
  }
234
190
  }, _callee, null, [[4, 11]]);
235
191
  }));
236
- return function deleteKeyAcl(_x11) {
192
+ return function deleteKeyAcl(_x3) {
237
193
  return _ref.apply(this, arguments);
238
194
  };
239
195
  }();
@@ -243,35 +199,35 @@ var deleteKeyAcl = /*#__PURE__*/function () {
243
199
  * create/edit keyDoc
244
200
  * set keyDoc acl
245
201
  */
246
- function saveKeyAndHandleAcl(_x12, _x13, _x14) {
247
- return _saveKeyAndHandleAcl.apply(this, arguments);
202
+ function saveKey(_x4, _x5, _x6) {
203
+ return _saveKey.apply(this, arguments);
248
204
  }
249
- function _saveKeyAndHandleAcl() {
250
- _saveKeyAndHandleAcl = (0, _asyncToGenerator2["default"])(function (keyDoc, del, add) {
205
+ function _saveKey() {
206
+ _saveKey = (0, _asyncToGenerator2["default"])(function (keyDoc, del, add) {
251
207
  var me = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
252
- return /*#__PURE__*/_regenerator["default"].mark(function _callee6() {
208
+ return /*#__PURE__*/_regenerator["default"].mark(function _callee4() {
253
209
  var aclBody;
254
- return _regenerator["default"].wrap(function _callee6$(_context6) {
255
- while (1) switch (_context6.prev = _context6.next) {
210
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
211
+ while (1) switch (_context4.prev = _context4.next) {
256
212
  case 0:
257
- _context6.next = 2;
213
+ _context4.next = 2;
258
214
  return deleteKeyAcl(keyDoc);
259
215
  case 2:
260
- _context6.next = 4;
216
+ _context4.next = 4;
261
217
  return _solidLogic.store.updater.updateMany(del, add);
262
218
  case 4:
263
219
  // or a promise store.updater.update ?
264
220
  // create READ only ACL
265
221
  aclBody = (0, _acl.keyAclBody)(keyDoc, me);
266
- _context6.next = 7;
222
+ _context4.next = 7;
267
223
  return (0, _acl.setAcl)(keyDoc, aclBody);
268
224
  case 7:
269
225
  case "end":
270
- return _context6.stop();
226
+ return _context4.stop();
271
227
  }
272
- }, _callee6);
228
+ }, _callee4);
273
229
  })();
274
230
  });
275
- return _saveKeyAndHandleAcl.apply(this, arguments);
231
+ return _saveKey.apply(this, arguments);
276
232
  }
277
233
  //# sourceMappingURL=keys.js.map