solid-ui 2.4.22-9c4bbef1 → 2.4.22-a07bb683

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 (63) hide show
  1. package/dist/main.js +7944 -8151
  2. package/dist/main.js.map +1 -1
  3. package/lib/acl/access-controller.js +14 -9
  4. package/lib/acl/access-controller.js.map +1 -1
  5. package/lib/acl/access-groups.js +15 -10
  6. package/lib/acl/access-groups.js.map +1 -1
  7. package/lib/acl/acl-control.js +13 -9
  8. package/lib/acl/acl-control.js.map +1 -1
  9. package/lib/acl/acl.js +11 -7
  10. package/lib/acl/acl.js.map +1 -1
  11. package/lib/acl/add-agent-buttons.js +18 -13
  12. package/lib/acl/add-agent-buttons.js.map +1 -1
  13. package/lib/chat/bookmarks.js +21 -18
  14. package/lib/chat/bookmarks.js.map +1 -1
  15. package/lib/chat/chatLogic.js +15 -9
  16. package/lib/chat/chatLogic.js.map +1 -1
  17. package/lib/chat/dateFolder.js +17 -12
  18. package/lib/chat/dateFolder.js.map +1 -1
  19. package/lib/chat/infinite.js +37 -29
  20. package/lib/chat/infinite.js.map +1 -1
  21. package/lib/chat/message.js +14 -14
  22. package/lib/chat/message.js.map +1 -1
  23. package/lib/chat/messageTools.js +23 -10
  24. package/lib/chat/messageTools.js.map +1 -1
  25. package/lib/chat/thread.js +9 -4
  26. package/lib/chat/thread.js.map +1 -1
  27. package/lib/footer/index.js +10 -8
  28. package/lib/footer/index.js.map +1 -1
  29. package/lib/header/index.js +17 -9
  30. package/lib/header/index.js.map +1 -1
  31. package/lib/iconBase.js +3 -2
  32. package/lib/iconBase.js.map +1 -1
  33. package/lib/login/login.d.ts +9 -8
  34. package/lib/login/login.d.ts.map +1 -1
  35. package/lib/login/login.js +303 -313
  36. package/lib/login/login.js.map +1 -1
  37. package/lib/media/media-capture.js +20 -4
  38. package/lib/media/media-capture.js.map +1 -1
  39. package/lib/tabs.d.ts.map +1 -1
  40. package/lib/tabs.js +21 -18
  41. package/lib/tabs.js.map +1 -1
  42. package/lib/utils/headerFooterHelpers.js +7 -5
  43. package/lib/utils/headerFooterHelpers.js.map +1 -1
  44. package/lib/versionInfo.d.ts +9 -9
  45. package/lib/versionInfo.js +13 -13
  46. package/lib/versionInfo.js.map +1 -1
  47. package/lib/widgets/error.d.ts +0 -12
  48. package/lib/widgets/error.d.ts.map +1 -1
  49. package/lib/widgets/error.js +5 -0
  50. package/lib/widgets/error.js.map +1 -1
  51. package/lib/widgets/forms/autocomplete/autocompleteBar.js +15 -17
  52. package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
  53. package/lib/widgets/forms/autocomplete/autocompleteField.js +8 -5
  54. package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
  55. package/lib/widgets/forms/autocomplete/autocompletePicker.js +19 -21
  56. package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
  57. package/lib/widgets/forms/autocomplete/language.js +15 -8
  58. package/lib/widgets/forms/autocomplete/language.js.map +1 -1
  59. package/lib/widgets/forms/autocomplete/publicData.js +27 -22
  60. package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
  61. package/lib/widgets/forms.js +31 -20
  62. package/lib/widgets/forms.js.map +1 -1
  63. package/package.json +7 -5
@@ -1 +1 @@
1
- {"version":3,"file":"message.js","names":["dom","window","document","messageBodyStyle","style","label","utils","elementForImageURI","imageUri","options","img","createElement","height","inlineImageHeightEms","trim","setAttribute","anchor","appendChild","widgets","makeDraggable","$rdf","sym","text","term","a","uri","addEventListener","openHrefInOutlineMode","textContent","nick","person","s","store","any","ns","foaf","value","creatorAndDate","td1","creator","date","message","nickAnchor","fetcher","nowOrWhenFetched","doc","undefined","_ok","_body","creatorAndDateHorizontal","dateBit","fontSize","marginLeft","renderMessageRow","channelObject","fresh","userContext","colorizeByAuthor","dct","latestVersion","mostRecentVersion","content","sioc","originalMessage","originalVersion","edited","sameTerm","sortDate","the","messageRow","AJAR_date","AJAR_subject","authorDateOnLeft","setImage","shortDate","bothDates","td2","isURI","test","para","isImage","expandImagesInline","anc","href","bgcolor","pad","lightColorHash","getBgColor","strip","sentimentStripLinked","children","length","td3","toolsButton","button","icons","iconBase","_event","toolTR","parentNode","removeChild","toolsTR","tools","messageToolbar","nextSibling","parentElement","insertBefore","toolsTD","switchToEditor","messageTable","editRow","renderMessageEditor","originalRow","visibility","revertEditing","messageEditor","handleFieldInput","sendMessage","field","fromMainField","sendComplete","_text2","insertMessageIntoTable","oldRow","debug","warn","backgroundColor","disabled","scrollIntoView","newestFirst","focus","select","updateMessage","statusArea","errorMessageBlock","droppedFileHandler","files","base","chatDocument","dir","uploadFiles","theFile","destURI","droppedURIHandler","uris","turnOnInput","getImageDoc","imageDoc","Date","now","tookPicture","menuButton","menuHandler","buttonStyle","rhs","me","authn","currentUser","menuOptions","div","newBase","event","chatChannel","lhs","middle","innerHTML","rows","anyValue","e","code","shiftKey","shiftEnterSendsMessage","makeDropTarget","sendButton","sendIcon","cancelButton","dateFolder","leafDocumentFromDate","media","cameraButton","recordParticipation","channel","context","ensureLoggedIn","then","Object","assign","findBookmarkDocument","_context"],"sources":["../../src/chat/message.js"],"sourcesContent":["/** UI code for individual messages: display them, edit them\n *\n * @packageDocumentation\n */\n\n/* global $rdf */\nimport { insertMessageIntoTable } from './infinite'\nimport { messageToolbar, sentimentStripLinked } from './messageTools'\nimport { findBookmarkDocument } from './bookmarks'\nimport { mostRecentVersion, originalVersion } from './chatLogic'\nimport * as debug from '../debug'\nimport { icons } from '../iconBase'\nimport { store, authn } from 'solid-logic'\nimport { ensureLoggedIn } from '../login/login'\nimport { media } from '../media/index'\nimport * as ns from '../ns'\nimport * as pad from '../pad'\nimport * as style from '../style'\nimport * as utils from '../utils'\nimport * as widgets from '../widgets'\n\nconst dom = window.document\nconst messageBodyStyle = style.messageBodyStyle\n\nconst label = utils.label\n\n/**\n * HTML component for an image\n */\nexport function elementForImageURI (imageUri, options) {\n const img = dom.createElement('img')\n let height = '10'\n if (options.inlineImageHeightEms) {\n height = ('' + options.inlineImageHeightEms).trim()\n }\n img.setAttribute(\n 'style',\n 'max-height: ' + height + 'em; border-radius: 1em; margin: 0.7em;'\n )\n // widgets.makeDropTarget(img, handleURIsDroppedOnMugshot, droppedFileHandler)\n if (imageUri) img.setAttribute('src', imageUri)\n const anchor = dom.createElement('a')\n anchor.setAttribute('href', imageUri)\n anchor.setAttribute('target', 'images')\n anchor.appendChild(img)\n widgets.makeDraggable(img, $rdf.sym(imageUri))\n return anchor\n}\n\nconst anchor = function (text, term) {\n // If there is no link return an element anyway\n const a = dom.createElement('a')\n if (term && term.uri) {\n a.setAttribute('href', term.uri)\n a.addEventListener('click', widgets.openHrefInOutlineMode, true)\n a.setAttribute('style', 'color: #3B5998; text-decoration: none; ') // font-weight: bold\n }\n a.textContent = text\n return a\n}\n\nfunction nick (person) {\n const s = store.any(person, ns.foaf('nick'))\n if (s) return '' + s.value\n return '' + label(person)\n}\n\n/**\n * Displays creator and date for a chat message\n * inside the `td1` element\n */\nexport function creatorAndDate (td1, creator, date, message) {\n const nickAnchor = td1.appendChild(anchor(nick(creator), creator))\n if (creator.uri) {\n store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (\n _ok,\n _body\n ) {\n nickAnchor.textContent = nick(creator)\n })\n }\n td1.appendChild(dom.createElement('br'))\n td1.appendChild(anchor(date, message))\n}\n\n/**\n * Horizontally displays creator and date for a chat message\n * inside the `td1` element\n */\nexport function creatorAndDateHorizontal (td1, creator, date, message) {\n const nickAnchor = td1.appendChild(anchor(label(creator), creator))\n if (creator.uri) {\n store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (\n _ok,\n _body\n ) {\n nickAnchor.textContent = nick(creator)\n })\n }\n const dateBit = td1.appendChild(anchor(date, message))\n dateBit.style.fontSize = '80%'\n dateBit.style.marginLeft = '1em'\n td1.appendChild(dom.createElement('br'))\n}\n\n/**\n * Renders a chat message, read-only mode\n */\nexport function renderMessageRow (channelObject, message, fresh, options, userContext) {\n const colorizeByAuthor =\n options.colorizeByAuthor === '1' || options.colorizeByAuthor === true\n\n const creator = store.any(message, ns.foaf('maker'))\n const date = store.any(message, ns.dct('created'))\n const latestVersion = mostRecentVersion(message)\n const content = store.any(latestVersion, ns.sioc('content'))\n\n const originalMessage = originalVersion(message)\n const edited = !message.sameTerm(originalMessage)\n\n const sortDate = store.the(originalMessage, ns.dct('created'), null, originalMessage.doc()) // In message\n\n const messageRow = dom.createElement('tr')\n messageRow.AJAR_date = sortDate.value\n messageRow.AJAR_subject = message\n\n const td1 = dom.createElement('td')\n messageRow.appendChild(td1)\n if (!options.authorDateOnLeft) {\n const img = dom.createElement('img')\n img.setAttribute(\n 'style',\n 'max-height: 2.5em; max-width: 2.5em; border-radius: 0.5em; margin: auto;'\n )\n widgets.setImage(img, creator)\n td1.appendChild(img)\n } else {\n creatorAndDate(td1, creator, widgets.shortDate(sortDate.value), message)\n }\n let bothDates = widgets.shortDate(sortDate.value)\n if (edited) {\n bothDates += ' ... ' + widgets.shortDate(date.value)\n }\n\n // Render the content ot the message itself\n const td2 = messageRow.appendChild(dom.createElement('td'))\n\n if (!options.authorDateOnLeft) {\n creatorAndDateHorizontal(\n td2,\n creator,\n bothDates, // widgets.shortDate(dateString)\n message\n )\n }\n const text = content.value.trim()\n const isURI = /^https?:\\/[^ <>]*$/i.test(text)\n let para = null\n if (isURI) {\n const isImage = /\\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(text) // @@ Should use content-type not URI\n if (isImage && options.expandImagesInline) {\n const img = elementForImageURI(text, options)\n td2.appendChild(img)\n } else {\n // Link but not Image\n const anc = td2.appendChild(dom.createElement('a'))\n para = anc.appendChild(dom.createElement('p'))\n anc.href = text\n para.textContent = text\n td2.appendChild(anc)\n }\n } else {\n // text\n para = dom.createElement('p')\n td2.appendChild(para)\n para.textContent = text\n }\n if (para) {\n const bgcolor = colorizeByAuthor\n ? pad.lightColorHash(creator)\n : getBgColor(fresh)\n para.setAttribute(\n 'style',\n messageBodyStyle + 'background-color: ' + bgcolor + ';'\n )\n }\n\n function getBgColor (fresh) {\n return fresh ? '#e8ffe8' : 'white'\n }\n\n // Sentiment strip\n const strip = sentimentStripLinked(message, message.doc())\n if (strip.children.length) {\n td2.appendChild(dom.createElement('br'))\n td2.appendChild(strip)\n }\n\n // Message tool bar button\n const td3 = dom.createElement('td')\n messageRow.appendChild(td3)\n const toolsButton = widgets.button(\n dom,\n icons.iconBase + 'noun_243787.svg',\n '...'\n )\n td3.appendChild(toolsButton)\n toolsButton.addEventListener('click', function (_event) {\n if (messageRow.toolTR) {\n // already got a toolbar? Toogle\n messageRow.parentNode.removeChild(messageRow.toolTR)\n delete messageRow.toolTR\n return\n }\n const toolsTR = dom.createElement('tr')\n const tools = messageToolbar(message, messageRow, userContext, channelObject)\n tools.style =\n 'border: 0.05em solid #888; border-radius: 0 0 0.7em 0.7em; border-top: 0; height:3.5em; background-color: #fff;' // @@ fix\n if (messageRow.nextSibling) {\n messageRow.parentElement.insertBefore(toolsTR, messageRow.nextSibling)\n } else {\n messageRow.parentElement.appendChild(toolsTR)\n }\n messageRow.toolTR = toolsTR\n toolsTR.appendChild(dom.createElement('td')) // left\n const toolsTD = toolsTR.appendChild(dom.createElement('td'))\n toolsTR.appendChild(dom.createElement('td')) // right\n toolsTD.appendChild(tools)\n })\n return messageRow\n}\n\nexport function switchToEditor (messageRow, message, channelObject, userContext) {\n const messageTable = messageRow.parentNode\n const editRow = renderMessageEditor(channelObject, messageTable, userContext,\n channelObject.options, mostRecentVersion(message))\n messageTable.insertBefore(editRow, messageRow)\n editRow.originalRow = messageRow\n messageRow.style.visibility = 'hidden' // Hide the original message. unhide if user cancels edit\n}\n/* Control for a new message -- or editing an old message ***************\n *\n */\nexport function renderMessageEditor (channelObject, messageTable, userContext, options, originalMessage) {\n function revertEditing (messageEditor) {\n messageEditor.originalRow.style.visibility = 'visible' // restore read-only version\n messageEditor.parentNode.removeChild(messageEditor)\n }\n\n async function handleFieldInput (_event) {\n await sendMessage(field.value, true)\n }\n\n async function sendMessage (text, fromMainField) {\n function sendComplete (message, _text2) {\n // const dateStamp = store.any(message, ns.dct('created'), null, message.doc())\n // const content = $rdf.literal(text2)\n insertMessageIntoTable(channelObject, messageTable, message, false, options, userContext) // not green\n\n if (originalMessage) { // editing another message\n const oldRow = messageEditor.originalRow\n // oldRow.style.display = '' // restore read-only version, re-attack\n if (oldRow.parentNode) {\n oldRow.parentNode.removeChild(oldRow) // No longer needed old version\n } else {\n debug.warn('No parentNode on old message ' + oldRow.textContent)\n oldRow.style.backgroundColor = '#fee'\n oldRow.style.visibility = 'hidden' // @@ FIX THIS AND REMOVE FROM DOM INSTEAD\n }\n messageEditor.parentNode.removeChild(messageEditor) // no longer need editor\n } else {\n if (fromMainField) {\n field.value = '' // clear from out for reuse\n field.setAttribute('style', messageBodyStyle)\n field.disabled = false\n field.scrollIntoView(options.newestFirst) // allign bottom (top)\n field.focus() // Start typing next line immediately\n field.select()\n }\n }\n // await channelObject.div.refresh() // Add new day if nec @@ add back\n }\n\n // const me = authn.currentUser() // Must be logged on or wuld have got login button\n if (fromMainField) {\n field.setAttribute('style', messageBodyStyle + 'color: #bbb;') // pendingedit\n field.disabled = true\n }\n\n let message\n try {\n message = await channelObject.updateMessage(text, originalMessage)\n } catch (err) {\n const statusArea = userContext.statusArea || messageEditor\n statusArea.appendChild(\n widgets.errorMessageBlock(dom, 'Error writing message: ' + err)\n )\n return\n }\n sendComplete(message, text)\n } // sendMessage\n\n // DRAG AND DROP\n function droppedFileHandler (files) {\n const base = messageTable.chatDocument.dir().uri\n widgets.uploadFiles(\n store.fetcher,\n files,\n base + 'Files',\n base + 'Pictures',\n async function (theFile, destURI) {\n // @@@@@@ Wait for each if several\n await sendMessage(destURI)\n }\n )\n }\n\n // When a set of URIs are dropped on the field\n const droppedURIHandler = async function (uris) {\n for (const uri of uris) {\n await sendMessage(uri)\n }\n }\n\n // When we are actually logged on\n function turnOnInput () {\n function getImageDoc () {\n imageDoc = $rdf.sym(\n chatDocument.dir().uri + 'Image_' + Date.now() + '.png'\n )\n return imageDoc\n }\n\n async function tookPicture (imageDoc) {\n if (imageDoc) {\n await sendMessage(imageDoc.uri)\n }\n }\n\n // Body of turnOnInput\n\n let menuButton\n if (options.menuHandler) {\n const menuButton = widgets.button(\n dom, icons.iconBase + 'noun_243787.svg', 'More')\n menuButton.setAttribute('style', style.buttonStyle + 'float: right;')\n // menuButton.addEventListener('click', _event => sendMessage(), false) (done in turnoninput)\n rhs.appendChild(menuButton)\n }\n\n if (options.menuHandler && menuButton) {\n const me = authn.currentUser()\n const menuOptions = {\n me,\n dom,\n div: null, // @@ was: div\n newBase: messageTable.chatDocument.dir().uri\n }\n menuButton.addEventListener(\n 'click',\n event => {\n options.menuHandler(event, channelObject.chatChannel, menuOptions)\n },\n false\n )\n }\n\n const me = authn.currentUser() // If already logged on\n creatorAndDate(lhs, me, '', null)\n\n field = dom.createElement('textarea')\n middle.innerHTML = ''\n middle.appendChild(field)\n field.rows = 3\n if (originalMessage) {\n field.value = store.anyValue(originalMessage, ns.sioc('content'), null, originalMessage.doc())\n }\n // field.cols = 40\n field.setAttribute('style', messageBodyStyle + 'background-color: #eef;')\n\n // Trap the Enter BEFORE it is used ti make a newline\n\n field.addEventListener(\n 'keydown',\n async function (e) {\n // User preference?\n if (e.code === 'Enter') {\n // if (e.keyCode === 13) { // deprocated https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode\n if ((!e.shiftKey && !options.shiftEnterSendsMessage) || (e.shiftKey && options.shiftEnterSendsMessage)) {\n // Shift-Enter just adds a new line\n // (note alt-enter doesn't add newline anyway on my setup - so have to use shift.\n await handleFieldInput(e)\n }\n }\n },\n false\n )\n\n widgets.makeDropTarget(field, droppedURIHandler, droppedFileHandler)\n\n rhs.innerHTML = ''\n\n sendButton = widgets.button(dom, sendIcon, 'Send')\n sendButton.style.float = 'right'\n sendButton.addEventListener('click', _event => handleFieldInput(), false)\n rhs.appendChild(sendButton)\n\n if (originalMessage) { // Are we editing another message?\n const cancelButton = rhs.appendChild(widgets.cancelButton(dom))\n cancelButton.style.float = 'left'\n // cancelButton.firstChild.style.opacity = '0.3' // moved to buttons\n cancelButton.addEventListener('click', _event => revertEditing(messageEditor), false)\n rhs.appendChild(cancelButton)\n }\n\n const chatDocument = channelObject.dateFolder.leafDocumentFromDate(new Date())\n let imageDoc\n\n middle.appendChild(\n media.cameraButton(dom, store, getImageDoc, tookPicture)\n )\n\n pad.recordParticipation(channelObject.channel, channelObject.channel.doc()) // participation =\n } // turn on inpuut\n\n // Body of renderMessageEditor\n\n let sortDate, sendIcon\n if (originalMessage) {\n sortDate = store.anyValue(originalMessage, ns.dct('created'), null, originalMessage.doc())\n // text = store.anyValue(originalMessage, ns.sioc('content'), null, originalMessage.doc())\n sendIcon = icons.iconBase + 'noun_1180158.svg' // Green check\n // cancelIcon = icons.iconBase + 'noun_1180156.svg' // Black cross\n } else {\n sendIcon = icons.iconBase + 'noun_383448.svg'\n sortDate = '9999-01-01T00:00:00Z' // ISO format for field sort\n // text = ''\n }\n const messageEditor = dom.createElement('tr')\n const lhs = dom.createElement('td')\n const middle = dom.createElement('td')\n const rhs = dom.createElement('td')\n messageEditor.appendChild(lhs)\n messageEditor.appendChild(middle)\n messageEditor.appendChild(rhs)\n messageEditor.AJAR_date = sortDate\n // messageEditor.appendChild(dom.createElement('br'))\n\n let field, sendButton\n const context = { div: middle, dom }\n\n ensureLoggedIn(context).then(context => {\n // me = context.me\n turnOnInput()\n Object.assign(context, userContext)\n findBookmarkDocument(context).then(_context => {\n // console.log('Bookmark file: ' + context.bookmarkDocument)\n })\n })\n\n return messageEditor\n} // renderMessageEditor\n"],"mappings":";;;;;;;;;;;;;;;;;;AAMA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;+CAlBA,oJ;;AAoBA,IAAMA,GAAG,GAAGC,MAAM,CAACC,QAAnB;AACA,IAAMC,g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EACD,IAAMgD,aAAa,GAAGnH,GAAG,CAACW,aAAJ,CAAkB,IAAlB,CAAtB;EACA,IAAMwJ,GAAG,GAAGnK,GAAG,CAACW,aAAJ,CAAkB,IAAlB,CAAZ;EACA,IAAMyJ,MAAM,GAAGpK,GAAG,CAACW,aAAJ,CAAkB,IAAlB,CAAf;EACA,IAAM+I,GAAG,GAAG1J,GAAG,CAACW,aAAJ,CAAkB,IAAlB,CAAZ;EACAwG,aAAa,CAAClG,WAAd,CAA0BkJ,GAA1B;EACAhD,aAAa,CAAClG,WAAd,CAA0BmJ,MAA1B;EACAjD,aAAa,CAAClG,WAAd,CAA0ByI,GAA1B;EACAvC,aAAa,CAAC7C,SAAd,GAA0BH,QAA1B,CA1MuG,CA2MvG;;EAEA,IAAImD,KAAJ,EAAWuD,UAAX;EACA,IAAMS,OAAO,GAAG;IAAEvB,GAAG,EAAEK,MAAP;IAAepK,GAAG,EAAHA;EAAf,CAAhB;EAEA,IAAAuL,qBAAA,EAAeD,OAAf,EAAwBE,IAAxB,CAA6B,UAAAF,OAAO,EAAI;IACtC;IACArC,WAAW;IACXwC,MAAM,CAACC,MAAP,CAAcJ,OAAd,EAAuB9H,WAAvB;IACA,IAAAmI,+BAAA,EAAqBL,OAArB,EAA8BE,IAA9B,CAAmC,UAAAI,QAAQ,EAAI,CAC7C;IACD,CAFD;EAGD,CAPD;EASA,OAAOzE,aAAP;AACD,C,CAAC"}
1
+ {"version":3,"file":"message.js","names":["dom","window","document","messageBodyStyle","style","label","utils","elementForImageURI","imageUri","options","img","createElement","height","inlineImageHeightEms","trim","setAttribute","anchor","appendChild","widgets","makeDraggable","$rdf","sym","text","term","a","uri","addEventListener","openHrefInOutlineMode","textContent","nick","person","s","store","any","ns","foaf","value","creatorAndDate","td1","creator","date","message","nickAnchor","fetcher","nowOrWhenFetched","doc","undefined","_ok","_body","creatorAndDateHorizontal","dateBit","fontSize","marginLeft","renderMessageRow","channelObject","fresh","userContext","colorizeByAuthor","dct","latestVersion","mostRecentVersion","content","sioc","originalMessage","originalVersion","edited","sameTerm","sortDate","the","messageRow","AJAR_date","AJAR_subject","authorDateOnLeft","setImage","shortDate","bothDates","td2","isURI","test","para","isImage","expandImagesInline","anc","href","bgcolor","pad","lightColorHash","getBgColor","strip","sentimentStripLinked","children","length","td3","toolsButton","button","icons","iconBase","_event","toolTR","parentNode","removeChild","toolsTR","tools","messageToolbar","nextSibling","parentElement","insertBefore","toolsTD","switchToEditor","messageTable","editRow","renderMessageEditor","originalRow","visibility","revertEditing","messageEditor","handleFieldInput","sendMessage","field","fromMainField","sendComplete","_text2","insertMessageIntoTable","oldRow","debug","warn","backgroundColor","disabled","scrollIntoView","newestFirst","focus","select","updateMessage","statusArea","errorMessageBlock","droppedFileHandler","files","base","chatDocument","dir","uploadFiles","theFile","destURI","droppedURIHandler","uris","turnOnInput","getImageDoc","imageDoc","Date","now","tookPicture","menuButton","menuHandler","buttonStyle","rhs","me","authn","currentUser","menuOptions","div","newBase","event","chatChannel","lhs","middle","innerHTML","rows","anyValue","e","code","shiftKey","shiftEnterSendsMessage","makeDropTarget","sendButton","sendIcon","cancelButton","dateFolder","leafDocumentFromDate","media","cameraButton","recordParticipation","channel","context","ensureLoggedIn","then","Object","assign","findBookmarkDocument","_context"],"sources":["../../src/chat/message.js"],"sourcesContent":["/** UI code for individual messages: display them, edit them\n *\n * @packageDocumentation\n */\n\n/* global $rdf */\nimport { insertMessageIntoTable } from './infinite'\nimport { messageToolbar, sentimentStripLinked } from './messageTools'\nimport { findBookmarkDocument } from './bookmarks'\nimport { mostRecentVersion, originalVersion } from './chatLogic'\nimport * as debug from '../debug'\nimport { icons } from '../iconBase'\nimport { store, authn } from 'solid-logic'\nimport { ensureLoggedIn } from '../login/login'\nimport { media } from '../media/index'\nimport * as ns from '../ns'\nimport * as pad from '../pad'\nimport * as style from '../style'\nimport * as utils from '../utils'\nimport * as widgets from '../widgets'\n\nconst dom = window.document\nconst messageBodyStyle = style.messageBodyStyle\n\nconst label = utils.label\n\n/**\n * HTML component for an image\n */\nexport function elementForImageURI (imageUri, options) {\n const img = dom.createElement('img')\n let height = '10'\n if (options.inlineImageHeightEms) {\n height = ('' + options.inlineImageHeightEms).trim()\n }\n img.setAttribute(\n 'style',\n 'max-height: ' + height + 'em; border-radius: 1em; margin: 0.7em;'\n )\n // widgets.makeDropTarget(img, handleURIsDroppedOnMugshot, droppedFileHandler)\n if (imageUri) img.setAttribute('src', imageUri)\n const anchor = dom.createElement('a')\n anchor.setAttribute('href', imageUri)\n anchor.setAttribute('target', 'images')\n anchor.appendChild(img)\n widgets.makeDraggable(img, $rdf.sym(imageUri))\n return anchor\n}\n\nconst anchor = function (text, term) {\n // If there is no link return an element anyway\n const a = dom.createElement('a')\n if (term && term.uri) {\n a.setAttribute('href', term.uri)\n a.addEventListener('click', widgets.openHrefInOutlineMode, true)\n a.setAttribute('style', 'color: #3B5998; text-decoration: none; ') // font-weight: bold\n }\n a.textContent = text\n return a\n}\n\nfunction nick (person) {\n const s = store.any(person, ns.foaf('nick'))\n if (s) return '' + s.value\n return '' + label(person)\n}\n\n/**\n * Displays creator and date for a chat message\n * inside the `td1` element\n */\nexport function creatorAndDate (td1, creator, date, message) {\n const nickAnchor = td1.appendChild(anchor(nick(creator), creator))\n if (creator.uri) {\n store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (\n _ok,\n _body\n ) {\n nickAnchor.textContent = nick(creator)\n })\n }\n td1.appendChild(dom.createElement('br'))\n td1.appendChild(anchor(date, message))\n}\n\n/**\n * Horizontally displays creator and date for a chat message\n * inside the `td1` element\n */\nexport function creatorAndDateHorizontal (td1, creator, date, message) {\n const nickAnchor = td1.appendChild(anchor(label(creator), creator))\n if (creator.uri) {\n store.fetcher.nowOrWhenFetched(creator.doc(), undefined, function (\n _ok,\n _body\n ) {\n nickAnchor.textContent = nick(creator)\n })\n }\n const dateBit = td1.appendChild(anchor(date, message))\n dateBit.style.fontSize = '80%'\n dateBit.style.marginLeft = '1em'\n td1.appendChild(dom.createElement('br'))\n}\n\n/**\n * Renders a chat message, read-only mode\n */\nexport function renderMessageRow (channelObject, message, fresh, options, userContext) {\n const colorizeByAuthor =\n options.colorizeByAuthor === '1' || options.colorizeByAuthor === true\n\n const creator = store.any(message, ns.foaf('maker'))\n const date = store.any(message, ns.dct('created'))\n const latestVersion = mostRecentVersion(message)\n const content = store.any(latestVersion, ns.sioc('content'))\n\n const originalMessage = originalVersion(message)\n const edited = !message.sameTerm(originalMessage)\n\n const sortDate = store.the(originalMessage, ns.dct('created'), null, originalMessage.doc()) // In message\n\n const messageRow = dom.createElement('tr')\n messageRow.AJAR_date = sortDate.value\n messageRow.AJAR_subject = message\n\n const td1 = dom.createElement('td')\n messageRow.appendChild(td1)\n if (!options.authorDateOnLeft) {\n const img = dom.createElement('img')\n img.setAttribute(\n 'style',\n 'max-height: 2.5em; max-width: 2.5em; border-radius: 0.5em; margin: auto;'\n )\n widgets.setImage(img, creator)\n td1.appendChild(img)\n } else {\n creatorAndDate(td1, creator, widgets.shortDate(sortDate.value), message)\n }\n let bothDates = widgets.shortDate(sortDate.value)\n if (edited) {\n bothDates += ' ... ' + widgets.shortDate(date.value)\n }\n\n // Render the content ot the message itself\n const td2 = messageRow.appendChild(dom.createElement('td'))\n\n if (!options.authorDateOnLeft) {\n creatorAndDateHorizontal(\n td2,\n creator,\n bothDates, // widgets.shortDate(dateString)\n message\n )\n }\n const text = content.value.trim()\n const isURI = /^https?:\\/[^ <>]*$/i.test(text)\n let para = null\n if (isURI) {\n const isImage = /\\.(gif|jpg|jpeg|tiff|png|svg)$/i.test(text) // @@ Should use content-type not URI\n if (isImage && options.expandImagesInline) {\n const img = elementForImageURI(text, options)\n td2.appendChild(img)\n } else {\n // Link but not Image\n const anc = td2.appendChild(dom.createElement('a'))\n para = anc.appendChild(dom.createElement('p'))\n anc.href = text\n para.textContent = text\n td2.appendChild(anc)\n }\n } else {\n // text\n para = dom.createElement('p')\n td2.appendChild(para)\n para.textContent = text\n }\n if (para) {\n const bgcolor = colorizeByAuthor\n ? pad.lightColorHash(creator)\n : getBgColor(fresh)\n para.setAttribute(\n 'style',\n messageBodyStyle + 'background-color: ' + bgcolor + ';'\n )\n }\n\n function getBgColor (fresh) {\n return fresh ? '#e8ffe8' : 'white'\n }\n\n // Sentiment strip\n const strip = sentimentStripLinked(message, message.doc())\n if (strip.children.length) {\n td2.appendChild(dom.createElement('br'))\n td2.appendChild(strip)\n }\n\n // Message tool bar button\n const td3 = dom.createElement('td')\n messageRow.appendChild(td3)\n const toolsButton = widgets.button(\n dom,\n icons.iconBase + 'noun_243787.svg',\n '...'\n )\n td3.appendChild(toolsButton)\n toolsButton.addEventListener('click', function (_event) {\n if (messageRow.toolTR) {\n // already got a toolbar? Toogle\n messageRow.parentNode.removeChild(messageRow.toolTR)\n delete messageRow.toolTR\n return\n }\n const toolsTR = dom.createElement('tr')\n const tools = messageToolbar(message, messageRow, userContext, channelObject)\n tools.style =\n 'border: 0.05em solid #888; border-radius: 0 0 0.7em 0.7em; border-top: 0; height:3.5em; background-color: #fff;' // @@ fix\n if (messageRow.nextSibling) {\n messageRow.parentElement.insertBefore(toolsTR, messageRow.nextSibling)\n } else {\n messageRow.parentElement.appendChild(toolsTR)\n }\n messageRow.toolTR = toolsTR\n toolsTR.appendChild(dom.createElement('td')) // left\n const toolsTD = toolsTR.appendChild(dom.createElement('td'))\n toolsTR.appendChild(dom.createElement('td')) // right\n toolsTD.appendChild(tools)\n })\n return messageRow\n}\n\nexport function switchToEditor (messageRow, message, channelObject, userContext) {\n const messageTable = messageRow.parentNode\n const editRow = renderMessageEditor(channelObject, messageTable, userContext,\n channelObject.options, mostRecentVersion(message))\n messageTable.insertBefore(editRow, messageRow)\n editRow.originalRow = messageRow\n messageRow.style.visibility = 'hidden' // Hide the original message. unhide if user cancels edit\n}\n/* Control for a new message -- or editing an old message ***************\n *\n */\nexport function renderMessageEditor (channelObject, messageTable, userContext, options, originalMessage) {\n function revertEditing (messageEditor) {\n messageEditor.originalRow.style.visibility = 'visible' // restore read-only version\n messageEditor.parentNode.removeChild(messageEditor)\n }\n\n async function handleFieldInput (_event) {\n await sendMessage(field.value, true)\n }\n\n async function sendMessage (text, fromMainField) {\n function sendComplete (message, _text2) {\n // const dateStamp = store.any(message, ns.dct('created'), null, message.doc())\n // const content = $rdf.literal(text2)\n insertMessageIntoTable(channelObject, messageTable, message, false, options, userContext) // not green\n\n if (originalMessage) { // editing another message\n const oldRow = messageEditor.originalRow\n // oldRow.style.display = '' // restore read-only version, re-attack\n if (oldRow.parentNode) {\n oldRow.parentNode.removeChild(oldRow) // No longer needed old version\n } else {\n debug.warn('No parentNode on old message ' + oldRow.textContent)\n oldRow.style.backgroundColor = '#fee'\n oldRow.style.visibility = 'hidden' // @@ FIX THIS AND REMOVE FROM DOM INSTEAD\n }\n messageEditor.parentNode.removeChild(messageEditor) // no longer need editor\n } else {\n if (fromMainField) {\n field.value = '' // clear from out for reuse\n field.setAttribute('style', messageBodyStyle)\n field.disabled = false\n field.scrollIntoView(options.newestFirst) // allign bottom (top)\n field.focus() // Start typing next line immediately\n field.select()\n }\n }\n // await channelObject.div.refresh() // Add new day if nec @@ add back\n }\n\n // const me = authn.currentUser() // Must be logged on or wuld have got login button\n if (fromMainField) {\n field.setAttribute('style', messageBodyStyle + 'color: #bbb;') // pendingedit\n field.disabled = true\n }\n\n let message\n try {\n message = await channelObject.updateMessage(text, originalMessage)\n } catch (err) {\n const statusArea = userContext.statusArea || messageEditor\n statusArea.appendChild(\n widgets.errorMessageBlock(dom, 'Error writing message: ' + err)\n )\n return\n }\n sendComplete(message, text)\n } // sendMessage\n\n // DRAG AND DROP\n function droppedFileHandler (files) {\n const base = messageTable.chatDocument.dir().uri\n widgets.uploadFiles(\n store.fetcher,\n files,\n base + 'Files',\n base + 'Pictures',\n async function (theFile, destURI) {\n // @@@@@@ Wait for each if several\n await sendMessage(destURI)\n }\n )\n }\n\n // When a set of URIs are dropped on the field\n const droppedURIHandler = async function (uris) {\n for (const uri of uris) {\n await sendMessage(uri)\n }\n }\n\n // When we are actually logged on\n function turnOnInput () {\n function getImageDoc () {\n imageDoc = $rdf.sym(\n chatDocument.dir().uri + 'Image_' + Date.now() + '.png'\n )\n return imageDoc\n }\n\n async function tookPicture (imageDoc) {\n if (imageDoc) {\n await sendMessage(imageDoc.uri)\n }\n }\n\n // Body of turnOnInput\n\n let menuButton\n if (options.menuHandler) {\n const menuButton = widgets.button(\n dom, icons.iconBase + 'noun_243787.svg', 'More')\n menuButton.setAttribute('style', style.buttonStyle + 'float: right;')\n // menuButton.addEventListener('click', _event => sendMessage(), false) (done in turnoninput)\n rhs.appendChild(menuButton)\n }\n\n if (options.menuHandler && menuButton) {\n const me = authn.currentUser()\n const menuOptions = {\n me,\n dom,\n div: null, // @@ was: div\n newBase: messageTable.chatDocument.dir().uri\n }\n menuButton.addEventListener(\n 'click',\n event => {\n options.menuHandler(event, channelObject.chatChannel, menuOptions)\n },\n false\n )\n }\n\n const me = authn.currentUser() // If already logged on\n creatorAndDate(lhs, me, '', null)\n\n field = dom.createElement('textarea')\n middle.innerHTML = ''\n middle.appendChild(field)\n field.rows = 3\n if (originalMessage) {\n field.value = store.anyValue(originalMessage, ns.sioc('content'), null, originalMessage.doc())\n }\n // field.cols = 40\n field.setAttribute('style', messageBodyStyle + 'background-color: #eef;')\n\n // Trap the Enter BEFORE it is used ti make a newline\n\n field.addEventListener(\n 'keydown',\n async function (e) {\n // User preference?\n if (e.code === 'Enter') {\n // if (e.keyCode === 13) { // deprocated https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode\n if ((!e.shiftKey && !options.shiftEnterSendsMessage) || (e.shiftKey && options.shiftEnterSendsMessage)) {\n // Shift-Enter just adds a new line\n // (note alt-enter doesn't add newline anyway on my setup - so have to use shift.\n await handleFieldInput(e)\n }\n }\n },\n false\n )\n\n widgets.makeDropTarget(field, droppedURIHandler, droppedFileHandler)\n\n rhs.innerHTML = ''\n\n sendButton = widgets.button(dom, sendIcon, 'Send')\n sendButton.style.float = 'right'\n sendButton.addEventListener('click', _event => handleFieldInput(), false)\n rhs.appendChild(sendButton)\n\n if (originalMessage) { // Are we editing another message?\n const cancelButton = rhs.appendChild(widgets.cancelButton(dom))\n cancelButton.style.float = 'left'\n // cancelButton.firstChild.style.opacity = '0.3' // moved to buttons\n cancelButton.addEventListener('click', _event => revertEditing(messageEditor), false)\n rhs.appendChild(cancelButton)\n }\n\n const chatDocument = channelObject.dateFolder.leafDocumentFromDate(new Date())\n let imageDoc\n\n middle.appendChild(\n media.cameraButton(dom, store, getImageDoc, tookPicture)\n )\n\n pad.recordParticipation(channelObject.channel, channelObject.channel.doc()) // participation =\n } // turn on inpuut\n\n // Body of renderMessageEditor\n\n let sortDate, sendIcon\n if (originalMessage) {\n sortDate = store.anyValue(originalMessage, ns.dct('created'), null, originalMessage.doc())\n // text = store.anyValue(originalMessage, ns.sioc('content'), null, originalMessage.doc())\n sendIcon = icons.iconBase + 'noun_1180158.svg' // Green check\n // cancelIcon = icons.iconBase + 'noun_1180156.svg' // Black cross\n } else {\n sendIcon = icons.iconBase + 'noun_383448.svg'\n sortDate = '9999-01-01T00:00:00Z' // ISO format for field sort\n // text = ''\n }\n const messageEditor = dom.createElement('tr')\n const lhs = dom.createElement('td')\n const middle = dom.createElement('td')\n const rhs = dom.createElement('td')\n messageEditor.appendChild(lhs)\n messageEditor.appendChild(middle)\n messageEditor.appendChild(rhs)\n messageEditor.AJAR_date = sortDate\n // messageEditor.appendChild(dom.createElement('br'))\n\n let field, sendButton\n const context = { div: middle, dom }\n\n ensureLoggedIn(context).then(context => {\n // me = context.me\n turnOnInput()\n Object.assign(context, userContext)\n findBookmarkDocument(context).then(_context => {\n // console.log('Bookmark file: ' + context.bookmarkDocument)\n })\n })\n\n return messageEditor\n} // renderMessageEditor\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAMA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;A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,QAAN,GAAiB,iBAA5B;IACA7B,QAAQ,GAAG,sBAAX,CAFK,CAE6B;IAClC;EACD;;EACD,IAAMgD,aAAa,GAAGnH,GAAG,CAACW,aAAJ,CAAkB,IAAlB,CAAtB;EACA,IAAMwJ,GAAG,GAAGnK,GAAG,CAACW,aAAJ,CAAkB,IAAlB,CAAZ;EACA,IAAMyJ,MAAM,GAAGpK,GAAG,CAACW,aAAJ,CAAkB,IAAlB,CAAf;EACA,IAAM+I,GAAG,GAAG1J,GAAG,CAACW,aAAJ,CAAkB,IAAlB,CAAZ;EACAwG,aAAa,CAAClG,WAAd,CAA0BkJ,GAA1B;EACAhD,aAAa,CAAClG,WAAd,CAA0BmJ,MAA1B;EACAjD,aAAa,CAAClG,WAAd,CAA0ByI,GAA1B;EACAvC,aAAa,CAAC7C,SAAd,GAA0BH,QAA1B,CA1MuG,CA2MvG;;EAEA,IAAImD,KAAJ,EAAWuD,UAAX;EACA,IAAMS,OAAO,GAAG;IAAEvB,GAAG,EAAEK,MAAP;IAAepK,GAAG,EAAHA;EAAf,CAAhB;EAEA,IAAAuL,qBAAA,EAAeD,OAAf,EAAwBE,IAAxB,CAA6B,UAAAF,OAAO,EAAI;IACtC;IACArC,WAAW;IACXwC,MAAM,CAACC,MAAP,CAAcJ,OAAd,EAAuB9H,WAAvB;IACA,IAAAmI,+BAAA,EAAqBL,OAArB,EAA8BE,IAA9B,CAAmC,UAAAI,QAAQ,EAAI,CAC7C;IACD,CAFD;EAGD,CAPD;EASA,OAAOzE,aAAP;AACD,C,CAAC"}
@@ -11,6 +11,8 @@ exports.messageToolbar = messageToolbar;
11
11
  exports.sentimentStrip = sentimentStrip;
12
12
  exports.sentimentStripLinked = sentimentStripLinked;
13
13
 
14
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
15
+
14
16
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
15
17
 
16
18
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
@@ -39,8 +41,19 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
39
41
 
40
42
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
41
43
 
42
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
43
-
44
+ /**
45
+ * Tools for doing things with a message
46
+ * Let us be creative here. Allow all sorts of things to
47
+ * be done to a message - linking to new or old objects in an open way
48
+ *
49
+ * Ideas: Bookmark, Like, star, pin at top of chat, reply as new thread,
50
+ * If you made it originally: edit, delete, attach
51
+ * @packageDocumentation
52
+ */
53
+ // import { media } from '../media/index'
54
+ // import * as pad from '../pad'
55
+ // pull in first avoid cross-refs
56
+ // import * as style from '../style'
44
57
  var dom = window.document; // THE UNUSED ICONS are here as reminders for possible future functionality
45
58
  // const BOOKMARK_ICON = 'noun_45961.svg'
46
59
  // const HEART_ICON = 'noun_130259.svg' -> Add this to my (private) favorites
@@ -131,9 +144,9 @@ function messageToolbar(message, messageRow, userContext, channelObject) {
131
144
  }
132
145
 
133
146
  function _deleteMessage() {
134
- _deleteMessage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
147
+ _deleteMessage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2() {
135
148
  var author, msg, area;
136
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
149
+ return _regenerator["default"].wrap(function _callee2$(_context2) {
137
150
  while (1) {
138
151
  switch (_context2.prev = _context2.next) {
139
152
  case 0:
@@ -198,8 +211,8 @@ function messageToolbar(message, messageRow, userContext, channelObject) {
198
211
 
199
212
 
200
213
  function _editMessage() {
201
- _editMessage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(messageRow) {
202
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
214
+ _editMessage = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(messageRow) {
215
+ return _regenerator["default"].wrap(function _callee3$(_context3) {
203
216
  while (1) {
204
217
  switch (_context3.prev = _context3.next) {
205
218
  case 0:
@@ -233,8 +246,8 @@ function messageToolbar(message, messageRow, userContext, channelObject) {
233
246
 
234
247
 
235
248
  function _deleteThingThen() {
236
- _deleteThingThen = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(x) {
237
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
249
+ _deleteThingThen = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee4(x) {
250
+ return _regenerator["default"].wrap(function _callee4$(_context4) {
238
251
  while (1) {
239
252
  switch (_context4.prev = _context4.next) {
240
253
  case 0:
@@ -292,9 +305,9 @@ function messageToolbar(message, messageRow, userContext, channelObject) {
292
305
  }
293
306
 
294
307
  var button = widgets.button(dom, icon, utils.label(actionClass), /*#__PURE__*/function () {
295
- var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_event) {
308
+ var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(_event) {
296
309
  var insertMe, dirty, i, a;
297
- return _regeneratorRuntime().wrap(function _callee$(_context) {
310
+ return _regenerator["default"].wrap(function _callee$(_context) {
298
311
  while (1) {
299
312
  switch (_context.prev = _context.next) {
300
313
  case 0:
@@ -1 +1 @@
1
- {"version":3,"file":"messageTools.js","names":["dom","window","document","PENCIL_ICON","THUMBS_UP_ICON","THUMBS_DOWN_ICON","emoji","ns","schema","sentimentStrip","target","doc","latest","mostRecentVersion","actions","store","holds","value","each","sentiments","map","a","any","rdf","sort","strings","x","createTextNode","join","sentimentStripLinked","strip","createElement","refresh","innerHTML","uri","forEach","ss","theClass","agent","res","setAttribute","textContent","appendChild","messageToolbar","message","messageRow","userContext","channelObject","deleteMessage","author","foaf","me","alert","sameTerm","msg","debug","warn","area","statusArea","parentNode","widgets","errorMessageBlock","removeChild","closeToolbar","editMessage","switchToEditor","div","parentElement","deleteThingThen","updater","update","connectedStatements","authn","currentUser","deleteButtonWithCheck","button","icons","iconBase","renderBookmarksButton","then","bookmarkButton","sentimentButton","context","icon","actionClass","mutuallyExclusive","setColor","style","backgroundColor","action","utils","label","_event","newThing","insertMe","st","dirty","i","length","existingAction","refreshTree","filter","context1","cancelButton","firstChild","opacity","addEventListener"],"sources":["../../src/chat/messageTools.js"],"sourcesContent":["/**\n * Tools for doing things with a message\n * Let us be creative here. Allow all sorts of things to\n * be done to a message - linking to new or old objects in an open way\n *\n * Ideas: Bookmark, Like, star, pin at top of chat, reply as new thread,\n * If you made it originally: edit, delete, attach\n * @packageDocumentation\n */\nimport * as debug from '../debug'\nimport { icons } from '../iconBase'\n// import { media } from '../media/index'\nimport * as ns from '../ns'\n// import * as pad from '../pad'\nimport * as rdf from 'rdflib' // pull in first avoid cross-refs\n// import * as style from '../style'\nimport * as utils from '../utils'\nimport * as widgets from '../widgets'\nimport { renderBookmarksButton } from './bookmarks'\nimport { authn, store } from 'solid-logic'\n\nimport { mostRecentVersion } from './chatLogic'\nimport { switchToEditor } from './message'\n\nconst dom = window.document\n\n// THE UNUSED ICONS are here as reminders for possible future functionality\n// const BOOKMARK_ICON = 'noun_45961.svg'\n// const HEART_ICON = 'noun_130259.svg' -> Add this to my (private) favorites\n// const MENU_ICON = 'noun_897914.svg'\n// const PAPERCLIP_ICON = 'noun_25830.svg' -> add attachments to this message\n// const PIN_ICON = 'noun_562340.svg' -> pin this message permanently in the chat UI\nconst PENCIL_ICON = 'noun_253504.svg' // edit a message\n// const SPANNER_ICON = 'noun_344563.svg' -> settings\nconst THUMBS_UP_ICON = 'noun_1384132.svg'\nconst THUMBS_DOWN_ICON = 'noun_1384135.svg'\n/**\n * Emoji in Unicode\n */\nconst emoji = {}\nemoji[ns.schema('AgreeAction')] = '👍'\nemoji[ns.schema('DisagreeAction')] = '👎'\nemoji[ns.schema('EndorseAction')] = '⭐️'\nemoji[ns.schema('LikeAction')] = '❤️'\n\n/**\n * Create strip of sentiments expressed\n */\nexport function sentimentStrip (target, doc) { // alain seems not used\n const latest = mostRecentVersion(target)\n const actions = store.holds(latest, ns.schema('dateDeleted').value, null, latest.doc()) ? store.each(null, ns.schema('target'), target, doc) : []\n const sentiments = actions.map(a => store.any(a, ns.rdf('type'), null, doc))\n sentiments.sort()\n const strings = sentiments.map(x => emoji[x] || '')\n return dom.createTextNode(strings.join(' '))\n}\n/**\n * Create strip of sentiments expressed, with hyperlinks\n *\n * @param target {NamedNode} - The thing about which they are expressed\n * @param doc {NamedNode} - The document in which they are expressed\n */\nexport function sentimentStripLinked (target, doc) {\n const strip = dom.createElement('span')\n function refresh () {\n strip.innerHTML = ''\n const actions = (mostRecentVersion(target).uri !== ns.schema('dateDeleted').uri) ? store.each(null, ns.schema('target'), target, doc) : []\n const sentiments = actions.map(a => [\n store.any(a, ns.rdf('type'), null, doc),\n store.any(a, ns.schema('agent'), null, doc)\n ])\n sentiments.sort()\n sentiments.forEach(ss => {\n const [theClass, agent] = ss\n let res\n if (agent) {\n res = dom.createElement('a')\n res.setAttribute('href', agent.uri)\n } else {\n res = dom.createTextNode('')\n }\n res.textContent = emoji[theClass] || '*'\n strip.appendChild(res)\n })\n }\n refresh()\n strip.refresh = refresh\n return strip\n}\n/**\n * Creates a message toolbar component\n */\nexport function messageToolbar (message, messageRow, userContext, channelObject) {\n async function deleteMessage () {\n const author = store.any(message, ns.foaf('maker'))\n if (!me) {\n alert('You can\\'t delete the message, you are not logged in.')\n } else if (me.sameTerm(author)) {\n try {\n await channelObject.deleteMessage(message)\n } catch (err) {\n const msg = 'Error deleting messaage ' + err\n debug.warn(msg)\n alert(msg)\n const area = userContext.statusArea || messageRow.parentNode\n area.appendChild(widgets.errorMessageBlock(dom, msg))\n }\n messageRow.parentNode.removeChild(messageRow)\n } else {\n alert('You can\\'t delete the message, you are not logged in as the author, ' + author)\n }\n closeToolbar()\n }\n\n async function editMessage (messageRow) {\n if (me.value === store.any(message, ns.foaf('maker')).value) {\n closeToolbar() // edit is a one-off action\n switchToEditor(messageRow, message, channelObject, userContext)\n }\n }\n\n // alain TODO allow chat owner to fully delete message + sentiments and replacing messages\n\n const div = dom.createElement('div')\n // is message deleted ?\n if (mostRecentVersion(message).value === ns.schema('dateDeleted').value) return div\n function closeToolbar () {\n div.parentElement.parentElement.removeChild(div.parentElement) // remive the TR\n }\n\n async function deleteThingThen (x) {\n await store.updater.update(store.connectedStatements(x), [])\n }\n\n // Things only the original author can do\n let me = authn.currentUser() // If already logged on\n if (me && store.holds(message, ns.foaf('maker'), me)) {\n // button to delete the message\n div.appendChild(widgets.deleteButtonWithCheck(dom, div, 'message', deleteMessage))\n // button to edit the message\n div.appendChild(widgets.button(dom, icons.iconBase + PENCIL_ICON, 'edit', () => editMessage(messageRow)))\n } // if mine\n // Things anyone can do if they have a bookmark list async\n /*\n var bookmarkButton = await bookmarks.renderBookmarksButton(userContext)\n if (bookmarkButton) {\n div.appendChild(bookmarkButton)\n }\n */\n // Things anyone can do if they have a bookmark list\n\n renderBookmarksButton(userContext).then(bookmarkButton => {\n if (bookmarkButton) div.appendChild(bookmarkButton)\n })\n\n /** Button to allow user to express a sentiment (like, endorse, etc) about a target\n *\n * @param context {Object} - Provide dom and me\n * @param target {NamedNode} - The thing the user expresses an opnion about\n * @param icon {uristring} - The icon to be used for the button\n * @param actionClass {NamedNode} - The RDF class - typically a subclass of schema:Action\n * @param doc - {NamedNode} - the Solid document iunto which the data should be written\n * @param mutuallyExclusive {Array<NamedNode>} - Any RDF classes of sentimentswhich are mutiually exclusive\n */\n function sentimentButton (\n context,\n target,\n icon,\n actionClass,\n doc,\n mutuallyExclusive\n ) {\n function setColor () {\n button.style.backgroundColor = action ? 'yellow' : 'white'\n }\n const button = widgets.button(\n dom,\n icon,\n utils.label(actionClass),\n async function (_event) {\n if (action) {\n await deleteThingThen(action)\n action = null\n setColor()\n } else {\n // no action\n action = widgets.newThing(doc)\n const insertMe = [\n rdf.st(action, ns.schema('agent'), context.me, doc),\n rdf.st(action, ns.rdf('type'), actionClass, doc),\n rdf.st(action, ns.schema('target'), target, doc)\n ]\n await store.updater.update([], insertMe)\n setColor()\n\n if (mutuallyExclusive) {\n // Delete incompative sentiments\n let dirty = false\n for (let i = 0; i < mutuallyExclusive.length; i++) {\n const a = existingAction(mutuallyExclusive[i])\n if (a) {\n await deleteThingThen(a) // but how refresh? refreshTree the parent?\n dirty = true\n }\n }\n if (dirty) {\n // widgets.refreshTree(button.parentNode) // requires them all to be immediate siblings\n widgets.refreshTree(messageRow) // requires them all to be immediate siblings\n }\n }\n }\n }\n )\n function existingAction (actionClass) {\n const actions = store\n .each(null, ns.schema('agent'), context.me, doc)\n .filter(x => store.holds(x, ns.rdf('type'), actionClass, doc))\n .filter(x => store.holds(x, ns.schema('target'), target, doc))\n return actions.length ? actions[0] : null\n }\n function refresh () {\n action = existingAction(actionClass)\n setColor()\n }\n let action\n button.refresh = refresh // If the file changes, refresh live\n refresh()\n return button\n }\n\n // THUMBS_UP_ICON\n // https://schema.org/AgreeAction\n me = authn.currentUser() // If already logged on\n // debug.log('Actions 3' + mostRecentVersion(message).value + ' ' + ns.schema('dateDeleted').value + ' ' + (mostRecentVersion(message).value !== ns.schema('dateDeleted').value))\n\n if (me && (mostRecentVersion(message).value !== ns.schema('dateDeleted').value)) {\n const context1 = { me, dom, div }\n div.appendChild(\n sentimentButton(\n context1,\n message, // @@ TODO use widgets.sentimentButton\n icons.iconBase + THUMBS_UP_ICON,\n ns.schema('AgreeAction'),\n message.doc(),\n [ns.schema('DisagreeAction')]\n )\n )\n // Thumbs down\n div.appendChild(\n sentimentButton(\n context1,\n message,\n icons.iconBase + THUMBS_DOWN_ICON,\n ns.schema('DisagreeAction'),\n message.doc(),\n [ns.schema('AgreeAction')]\n )\n )\n }\n // X button to remove the tool UI itself\n const cancelButton = div.appendChild(widgets.cancelButton(dom))\n cancelButton.style.float = 'right'\n cancelButton.firstChild.style.opacity = '0.3'\n cancelButton.addEventListener('click', closeToolbar)\n return div\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AASA;;AACA;;AAEA;;AAEA;;AAEA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;+CArBA,oJ;;AAuBA,IAAMA,GAAG,GAAGC,MAAM,CAACC,QAAnB,C,CAEA;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMC,WAAW,GAAG,iBAApB,C,CAAsC;AACtC;;AACA,IAAMC,cAAc,GAAG,kBAAvB;AACA,IAAMC,gBAAgB,GAAG,kBAAzB;AACA;AACA;AACA;;AACA,IAAMC,KAAK,GAAG,EAAd;AACAA,KAAK,CAACC,EAAE,CAACC,MAAH,CAAU,aAAV,CAAD,CAAL,GAAkC,IAAlC;AACAF,KAAK,CAACC,EAAE,CAACC,MAAH,CAAU,gBAAV,CAAD,CAAL,GAAqC,IAArC;AACAF,KAAK,CAACC,EAAE,CAACC,MAAH,CAAU,eAAV,CAAD,CAAL,GAAoC,IAApC;AACAF,KAAK,CAACC,EAAE,CAACC,MAAH,CAAU,YAAV,CAAD,CAAL,GAAiC,IAAjC;AAEA;AACA;AACA;;AACO,SAASC,cAAT,CAAyBC,MAAzB,EAAiCC,GAAjC,EAAsC;EAAE;EAC7C,IAAMC,MAAM,GAAG,IAAAC,4BAAA,EAAkBH,MAAlB,CAAf;EACA,IAAMI,OAAO,GAAGC,iBAAA,CAAMC,KAAN,CAAYJ,MAAZ,EAAoBL,EAAE,CAACC,MAAH,CAAU,aAAV,EAAyBS,KAA7C,EAAoD,IAApD,EAA0DL,MAAM,CAACD,GAAP,EAA1D,IAA0EI,iBAAA,CAAMG,IAAN,CAAW,IAAX,EAAiBX,EAAE,CAACC,MAAH,CAAU,QAAV,CAAjB,EAAsCE,MAAtC,EAA8CC,GAA9C,CAA1E,GAA+H,EAA/I;EACA,IAAMQ,UAAU,GAAGL,OAAO,CAACM,GAAR,CAAY,UAAAC,C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,CAACG,gBAAb,CAA8B,OAA9B,EAAuC3C,YAAvC;EACA,OAAOG,GAAP;AACD"}
1
+ {"version":3,"file":"messageTools.js","names":["dom","window","document","PENCIL_ICON","THUMBS_UP_ICON","THUMBS_DOWN_ICON","emoji","ns","schema","sentimentStrip","target","doc","latest","mostRecentVersion","actions","store","holds","value","each","sentiments","map","a","any","rdf","sort","strings","x","createTextNode","join","sentimentStripLinked","strip","createElement","refresh","innerHTML","uri","forEach","ss","theClass","agent","res","setAttribute","textContent","appendChild","messageToolbar","message","messageRow","userContext","channelObject","deleteMessage","author","foaf","me","alert","sameTerm","msg","debug","warn","area","statusArea","parentNode","widgets","errorMessageBlock","removeChild","closeToolbar","editMessage","switchToEditor","div","parentElement","deleteThingThen","updater","update","connectedStatements","authn","currentUser","deleteButtonWithCheck","button","icons","iconBase","renderBookmarksButton","then","bookmarkButton","sentimentButton","context","icon","actionClass","mutuallyExclusive","setColor","style","backgroundColor","action","utils","label","_event","newThing","insertMe","st","dirty","i","length","existingAction","refreshTree","filter","context1","cancelButton","firstChild","opacity","addEventListener"],"sources":["../../src/chat/messageTools.js"],"sourcesContent":["/**\n * Tools for doing things with a message\n * Let us be creative here. Allow all sorts of things to\n * be done to a message - linking to new or old objects in an open way\n *\n * Ideas: Bookmark, Like, star, pin at top of chat, reply as new thread,\n * If you made it originally: edit, delete, attach\n * @packageDocumentation\n */\nimport * as debug from '../debug'\nimport { icons } from '../iconBase'\n// import { media } from '../media/index'\nimport * as ns from '../ns'\n// import * as pad from '../pad'\nimport * as rdf from 'rdflib' // pull in first avoid cross-refs\n// import * as style from '../style'\nimport * as utils from '../utils'\nimport * as widgets from '../widgets'\nimport { renderBookmarksButton } from './bookmarks'\nimport { authn, store } from 'solid-logic'\n\nimport { mostRecentVersion } from './chatLogic'\nimport { switchToEditor } from './message'\n\nconst dom = window.document\n\n// THE UNUSED ICONS are here as reminders for possible future functionality\n// const BOOKMARK_ICON = 'noun_45961.svg'\n// const HEART_ICON = 'noun_130259.svg' -> Add this to my (private) favorites\n// const MENU_ICON = 'noun_897914.svg'\n// const PAPERCLIP_ICON = 'noun_25830.svg' -> add attachments to this message\n// const PIN_ICON = 'noun_562340.svg' -> pin this message permanently in the chat UI\nconst PENCIL_ICON = 'noun_253504.svg' // edit a message\n// const SPANNER_ICON = 'noun_344563.svg' -> settings\nconst THUMBS_UP_ICON = 'noun_1384132.svg'\nconst THUMBS_DOWN_ICON = 'noun_1384135.svg'\n/**\n * Emoji in Unicode\n */\nconst emoji = {}\nemoji[ns.schema('AgreeAction')] = '👍'\nemoji[ns.schema('DisagreeAction')] = '👎'\nemoji[ns.schema('EndorseAction')] = '⭐️'\nemoji[ns.schema('LikeAction')] = '❤️'\n\n/**\n * Create strip of sentiments expressed\n */\nexport function sentimentStrip (target, doc) { // alain seems not used\n const latest = mostRecentVersion(target)\n const actions = store.holds(latest, ns.schema('dateDeleted').value, null, latest.doc()) ? store.each(null, ns.schema('target'), target, doc) : []\n const sentiments = actions.map(a => store.any(a, ns.rdf('type'), null, doc))\n sentiments.sort()\n const strings = sentiments.map(x => emoji[x] || '')\n return dom.createTextNode(strings.join(' '))\n}\n/**\n * Create strip of sentiments expressed, with hyperlinks\n *\n * @param target {NamedNode} - The thing about which they are expressed\n * @param doc {NamedNode} - The document in which they are expressed\n */\nexport function sentimentStripLinked (target, doc) {\n const strip = dom.createElement('span')\n function refresh () {\n strip.innerHTML = ''\n const actions = (mostRecentVersion(target).uri !== ns.schema('dateDeleted').uri) ? store.each(null, ns.schema('target'), target, doc) : []\n const sentiments = actions.map(a => [\n store.any(a, ns.rdf('type'), null, doc),\n store.any(a, ns.schema('agent'), null, doc)\n ])\n sentiments.sort()\n sentiments.forEach(ss => {\n const [theClass, agent] = ss\n let res\n if (agent) {\n res = dom.createElement('a')\n res.setAttribute('href', agent.uri)\n } else {\n res = dom.createTextNode('')\n }\n res.textContent = emoji[theClass] || '*'\n strip.appendChild(res)\n })\n }\n refresh()\n strip.refresh = refresh\n return strip\n}\n/**\n * Creates a message toolbar component\n */\nexport function messageToolbar (message, messageRow, userContext, channelObject) {\n async function deleteMessage () {\n const author = store.any(message, ns.foaf('maker'))\n if (!me) {\n alert('You can\\'t delete the message, you are not logged in.')\n } else if (me.sameTerm(author)) {\n try {\n await channelObject.deleteMessage(message)\n } catch (err) {\n const msg = 'Error deleting messaage ' + err\n debug.warn(msg)\n alert(msg)\n const area = userContext.statusArea || messageRow.parentNode\n area.appendChild(widgets.errorMessageBlock(dom, msg))\n }\n messageRow.parentNode.removeChild(messageRow)\n } else {\n alert('You can\\'t delete the message, you are not logged in as the author, ' + author)\n }\n closeToolbar()\n }\n\n async function editMessage (messageRow) {\n if (me.value === store.any(message, ns.foaf('maker')).value) {\n closeToolbar() // edit is a one-off action\n switchToEditor(messageRow, message, channelObject, userContext)\n }\n }\n\n // alain TODO allow chat owner to fully delete message + sentiments and replacing messages\n\n const div = dom.createElement('div')\n // is message deleted ?\n if (mostRecentVersion(message).value === ns.schema('dateDeleted').value) return div\n function closeToolbar () {\n div.parentElement.parentElement.removeChild(div.parentElement) // remive the TR\n }\n\n async function deleteThingThen (x) {\n await store.updater.update(store.connectedStatements(x), [])\n }\n\n // Things only the original author can do\n let me = authn.currentUser() // If already logged on\n if (me && store.holds(message, ns.foaf('maker'), me)) {\n // button to delete the message\n div.appendChild(widgets.deleteButtonWithCheck(dom, div, 'message', deleteMessage))\n // button to edit the message\n div.appendChild(widgets.button(dom, icons.iconBase + PENCIL_ICON, 'edit', () => editMessage(messageRow)))\n } // if mine\n // Things anyone can do if they have a bookmark list async\n /*\n var bookmarkButton = await bookmarks.renderBookmarksButton(userContext)\n if (bookmarkButton) {\n div.appendChild(bookmarkButton)\n }\n */\n // Things anyone can do if they have a bookmark list\n\n renderBookmarksButton(userContext).then(bookmarkButton => {\n if (bookmarkButton) div.appendChild(bookmarkButton)\n })\n\n /** Button to allow user to express a sentiment (like, endorse, etc) about a target\n *\n * @param context {Object} - Provide dom and me\n * @param target {NamedNode} - The thing the user expresses an opnion about\n * @param icon {uristring} - The icon to be used for the button\n * @param actionClass {NamedNode} - The RDF class - typically a subclass of schema:Action\n * @param doc - {NamedNode} - the Solid document iunto which the data should be written\n * @param mutuallyExclusive {Array<NamedNode>} - Any RDF classes of sentimentswhich are mutiually exclusive\n */\n function sentimentButton (\n context,\n target,\n icon,\n actionClass,\n doc,\n mutuallyExclusive\n ) {\n function setColor () {\n button.style.backgroundColor = action ? 'yellow' : 'white'\n }\n const button = widgets.button(\n dom,\n icon,\n utils.label(actionClass),\n async function (_event) {\n if (action) {\n await deleteThingThen(action)\n action = null\n setColor()\n } else {\n // no action\n action = widgets.newThing(doc)\n const insertMe = [\n rdf.st(action, ns.schema('agent'), context.me, doc),\n rdf.st(action, ns.rdf('type'), actionClass, doc),\n rdf.st(action, ns.schema('target'), target, doc)\n ]\n await store.updater.update([], insertMe)\n setColor()\n\n if (mutuallyExclusive) {\n // Delete incompative sentiments\n let dirty = false\n for (let i = 0; i < mutuallyExclusive.length; i++) {\n const a = existingAction(mutuallyExclusive[i])\n if (a) {\n await deleteThingThen(a) // but how refresh? refreshTree the parent?\n dirty = true\n }\n }\n if (dirty) {\n // widgets.refreshTree(button.parentNode) // requires them all to be immediate siblings\n widgets.refreshTree(messageRow) // requires them all to be immediate siblings\n }\n }\n }\n }\n )\n function existingAction (actionClass) {\n const actions = store\n .each(null, ns.schema('agent'), context.me, doc)\n .filter(x => store.holds(x, ns.rdf('type'), actionClass, doc))\n .filter(x => store.holds(x, ns.schema('target'), target, doc))\n return actions.length ? actions[0] : null\n }\n function refresh () {\n action = existingAction(actionClass)\n setColor()\n }\n let action\n button.refresh = refresh // If the file changes, refresh live\n refresh()\n return button\n }\n\n // THUMBS_UP_ICON\n // https://schema.org/AgreeAction\n me = authn.currentUser() // If already logged on\n // debug.log('Actions 3' + mostRecentVersion(message).value + ' ' + ns.schema('dateDeleted').value + ' ' + (mostRecentVersion(message).value !== ns.schema('dateDeleted').value))\n\n if (me && (mostRecentVersion(message).value !== ns.schema('dateDeleted').value)) {\n const context1 = { me, dom, div }\n div.appendChild(\n sentimentButton(\n context1,\n message, // @@ TODO use widgets.sentimentButton\n icons.iconBase + THUMBS_UP_ICON,\n ns.schema('AgreeAction'),\n message.doc(),\n [ns.schema('DisagreeAction')]\n )\n )\n // Thumbs down\n div.appendChild(\n sentimentButton(\n context1,\n message,\n icons.iconBase + THUMBS_DOWN_ICON,\n ns.schema('DisagreeAction'),\n message.doc(),\n [ns.schema('AgreeAction')]\n )\n )\n }\n // X button to remove the tool UI itself\n const cancelButton = div.appendChild(widgets.cancelButton(dom))\n cancelButton.style.float = 'right'\n cancelButton.firstChild.style.opacity = '0.3'\n cancelButton.addEventListener('click', closeToolbar)\n return div\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AASA;;AACA;;AAEA;;AAEA;;AAEA;;AACA;;AACA;;AACA;;AAEA;;AACA;;;;;;AAtBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGA;AAEA;AAC8B;AAC9B;AASA,IAAMA,GAAG,GAAGC,MAAM,CAACC,QAAnB,C,CAEA;AACA;AACA;AACA;AACA;AACA;;AACA,IAAMC,WAAW,GAAG,iBAApB,C,CAAsC;AACtC;;AACA,IAAMC,cAAc,GAAG,kBAAvB;AACA,IAAMC,gBAAgB,GAAG,kBAAzB;AACA;AACA;AACA;;AACA,IAAMC,KAAK,GAAG,EAAd;AACAA,KAAK,CAACC,EAAE,CAACC,MAAH,CAAU,aAAV,CAAD,CAAL,GAAkC,IAAlC;AACAF,KAAK,CAACC,EAAE,CAACC,MAAH,CAAU,gBAAV,CAAD,CAAL,GAAqC,IAArC;AACAF,KAAK,CAACC,EAAE,CAACC,MAAH,CAAU,eAAV,CAAD,CAAL,GAAoC,IAApC;AACAF,KAAK,CAACC,EAAE,CAACC,MAAH,CAAU,YAAV,CAAD,CAAL,GAAiC,IAAjC;AAEA;AACA;AACA;;AACO,SAASC,cAAT,CAAyBC,MAAzB,EAAiCC,GAAjC,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GbgC,eAAA,CAAMC,QAAN,GAAiBxE,gBAHJ,EAIbE,EAAE,CAACC,MAAH,CAAU,gBAAV,CAJa,EAKboC,OAAO,CAACjC,GAAR,EALa,EAMb,CAACJ,EAAE,CAACC,MAAH,CAAU,aAAV,CAAD,CANa,CADjB;EAUD,CAtK8E,CAuK/E;;;EACA,IAAM+F,YAAY,GAAGrC,GAAG,CAACxB,WAAJ,CAAgBkB,OAAO,CAAC2C,YAAR,CAAqBvG,GAArB,CAAhB,CAArB;EACAuG,YAAY,CAAChB,KAAb,YAA2B,OAA3B;EACAgB,YAAY,CAACC,UAAb,CAAwBjB,KAAxB,CAA8BkB,OAA9B,GAAwC,KAAxC;EACAF,YAAY,CAACG,gBAAb,CAA8B,OAA9B,EAAuC3C,YAAvC;EACA,OAAOG,GAAP;AACD"}
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "__esModule", {
9
9
  });
10
10
  exports.thread = thread;
11
11
 
12
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
13
+
12
14
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
13
15
 
14
16
  var _iconBase = require("../iconBase");
@@ -35,8 +37,11 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
35
37
 
36
38
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
37
39
 
38
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return generator._invoke = function (innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; }(innerFn, self, context), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; this._invoke = function (method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, "throw" === context.method) { if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel; context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (object) { var keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, "catch": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
39
-
40
+ /**
41
+ * Contains the [[thread]] function
42
+ * @packageDocumentation
43
+ */
44
+ // pull in first avoid cross-refs
40
45
  var UI = {
41
46
  icons: _iconBase.icons,
42
47
  ns: ns,
@@ -343,9 +348,9 @@ function thread(dom, kb, subject, messageStore, options) {
343
348
  };
344
349
 
345
350
  var _deleteMessage = /*#__PURE__*/function () {
346
- var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(message) {
351
+ var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(message) {
347
352
  var deletions;
348
- return _regeneratorRuntime().wrap(function _callee$(_context) {
353
+ return _regenerator["default"].wrap(function _callee$(_context) {
349
354
  while (1) {
350
355
  switch (_context.prev = _context.next) {
351
356
  case 0: