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AC,MAAQX,EAAIP,UAAUmB,YAAYZ,EAAIa,GAAG,CAAC,CAAClF,IAAI,OAAOmF,GAAG,WAAW,MAAO,CAAEd,EAAIhK,QAASiK,EAAG,iBAAiBA,EAAG,iBAAiB,CAACO,MAAM,CAAC,KAAO,MAAM,EAAEO,OAAM,IAAO,MAAK,EAAM,cAAc,IAAI,GAAGf,EAAIS,GAAG,KAAKR,EAAG,MAAM,CAACK,YAAY,8BAA8BE,MAAM,CAAC,GAAK,qCAAqC,CAACR,EAAIS,GAAG,aAAaT,EAAIU,GAAGV,EAAIhJ,EAAE,WAAY,oDAAoD,gBAAgBiJ,EAAG,MAAM,CAACK,YAAY,mBAAmBC,MAAM,CAAC,6BAA8BP,EAAIpB,UAAUwC,SAAS,CAAC,UAAYpB,EAAIU,GAAGV,EAAIjB,kBAAkB4B,GAAG,CAAC,MAAQX,EAAIF,eACruG,EACIuB,EAAkB,E,sECClBC,E,MAA0B,GAA4B,KAE1DA,EAAwB/G,KAAK,CAACgH,EAAOnM,GAAI,ytCAA0tC,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,wDAAwD,MAAQ,GAAG,SAAW,udAAud,WAAa,MAEh1D,S,yJCIIoM,EAAU,CAAC,EAEfA,EAAQC,kBAAoB,IAC5BD,EAAQE,cAAgB,IACxBF,EAAQG,OAAS,SAAc,KAAM,QACrCH,EAAQI,OAAS,IACjBJ,EAAQK,mBAAqB,IAEhB,IAAI,IAASL,GAKJ,KAAW,IAAQM,QAAS,IAAQA,M,qECL1D,SAXgB,E,SAAA,GACd,IACA,IACA,KACA,EACA,KACA,WACA,MAI8B,O,mCCnBmJ,Q,SAAkB,C","sources":["webpack:///nextcloud/apps/comments/src/mixins/CommentMixin.js","webpack:///nextcloud/apps/comments/src/services/DeleteComment.js","webpack:///nextcloud/apps/comments/src/services/EditComment.js","webpack:///nextcloud/apps/comments/src/services/NewComment.js","webpack:///nextcloud/apps/comments/src/store/deletedCommentLimbo.js","webpack:///nextcloud/apps/comments/src/utils/decodeHtmlEntities.js","webpack:///nextcloud/apps/comments/src/mixins/CommentView.ts","webpack:///nextcloud/apps/comments/src/components/Comment.vue","webpack://nextcloud/./apps/comments/src/components/Comment.vue?d1f7","webpack:///nextcloud/apps/comments/src/components/Comment.vue?vue&type=style&index=0&id=1f6341c6&prod&lang=scss&scoped=true","webpack://nextcloud/./apps/comments/src/components/Comment.vue?1444","webpack://nextcloud/./apps/comments/src/components/Comment.vue?7f26","webpack:///nextcloud/apps/comments/src/components/Comment.vue?vue&type=script&lang=js"],"sourcesContent":["/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { showError, showUndo, TOAST_UNDO_TIMEOUT } from '@nextcloud/dialogs'\nimport NewComment from '../services/NewComment.js'\nimport DeleteComment from '../services/DeleteComment.js'\nimport EditComment from '../services/EditComment.js'\nimport { mapStores } from 'pinia'\nimport { useDeletedCommentLimbo } from '../store/deletedCommentLimbo.js'\nimport logger from '../logger.js'\n\nexport default {\n\tprops: {\n\t\tid: {\n\t\t\ttype: Number,\n\t\t\tdefault: null,\n\t\t},\n\t\tmessage: {\n\t\t\ttype: String,\n\t\t\tdefault: '',\n\t\t},\n\t\tresourceId: {\n\t\t\ttype: [String, Number],\n\t\t\trequired: true,\n\t\t},\n\t\tresourceType: {\n\t\t\ttype: String,\n\t\t\tdefault: 'files',\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tdeleted: false,\n\t\t\tediting: false,\n\t\t\tloading: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t...mapStores(useDeletedCommentLimbo),\n\t},\n\n\tmethods: {\n\t\t// EDITION\n\t\tonEdit() {\n\t\t\tthis.editing = true\n\t\t},\n\t\tonEditCancel() {\n\t\t\tthis.editing = false\n\t\t\t// Restore original value\n\t\t\tthis.updateLocalMessage(this.message)\n\t\t},\n\t\tasync onEditComment(message) {\n\t\t\tthis.loading = true\n\t\t\ttry {\n\t\t\t\tawait EditComment(this.resourceType, this.resourceId, this.id, message)\n\t\t\t\tlogger.debug('Comment edited', { resourceType: this.resourceType, resourceId: this.resourceId, id: this.id, message })\n\t\t\t\tthis.$emit('update:message', message)\n\t\t\t\tthis.editing = false\n\t\t\t} catch (error) {\n\t\t\t\tshowError(t('comments', 'An error occurred while trying to edit the comment'))\n\t\t\t\tconsole.error(error)\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\n\t\t// DELETION\n\t\tonDeleteWithUndo() {\n\t\t\tthis.$emit('delete')\n\t\t\tthis.deleted = true\n\t\t\tthis.deletedCommentLimboStore.addId(this.id)\n\t\t\tconst timeOutDelete = setTimeout(this.onDelete, TOAST_UNDO_TIMEOUT)\n\t\t\tshowUndo(t('comments', 'Comment deleted'), () => {\n\t\t\t\tclearTimeout(timeOutDelete)\n\t\t\t\tthis.deleted = false\n\t\t\t\tthis.deletedCommentLimboStore.removeId(this.id)\n\t\t\t})\n\t\t},\n\t\tasync onDelete() {\n\t\t\ttry {\n\t\t\t\tawait DeleteComment(this.resourceType, this.resourceId, this.id)\n\t\t\t\tlogger.debug('Comment deleted', { resourceType: this.resourceType, resourceId: this.resourceId, id: this.id })\n\t\t\t\tthis.$emit('delete', this.id)\n\t\t\t} catch (error) {\n\t\t\t\tshowError(t('comments', 'An error occurred while trying to delete the comment'))\n\t\t\t\tconsole.error(error)\n\t\t\t\tthis.deleted = false\n\t\t\t\tthis.deletedCommentLimboStore.removeId(this.id)\n\t\t\t}\n\t\t},\n\n\t\t// CREATION\n\t\tasync onNewComment(message) {\n\t\t\tthis.loading = true\n\t\t\ttry {\n\t\t\t\tconst newComment = await NewComment(this.resourceType, this.resourceId, message)\n\t\t\t\tlogger.debug('New comment posted', { resourceType: this.resourceType, resourceId: this.resourceId, newComment })\n\t\t\t\tthis.$emit('new', newComment)\n\n\t\t\t\t// Clear old content\n\t\t\t\tthis.$emit('update:message', '')\n\t\t\t\tthis.localMessage = ''\n\t\t\t} catch (error) {\n\t\t\t\tshowError(t('comments', 'An error occurred while trying to create the comment'))\n\t\t\t\tconsole.error(error)\n\t\t\t} finally {\n\t\t\t\tthis.loading = false\n\t\t\t}\n\t\t},\n\t},\n}\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport client from './DavClient.js'\n\n/**\n * Delete a comment\n *\n * @param {string} resourceType the resource type\n * @param {number} resourceId the resource ID\n * @param {number} commentId the comment iD\n */\nexport default async function(resourceType, resourceId, commentId) {\n\tconst commentPath = ['', resourceType, resourceId, commentId].join('/')\n\n\t// Fetch newly created comment data\n\tawait client.deleteFile(commentPath)\n}\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport client from './DavClient.js'\n\n/**\n * Edit an existing comment\n *\n * @param {string} resourceType the resource type\n * @param {number} resourceId the resource ID\n * @param {number} commentId the comment iD\n * @param {string} message the message content\n */\nexport default async function(resourceType, resourceId, commentId, message) {\n\tconst commentPath = ['', resourceType, resourceId, commentId].join('/')\n\n\treturn await client.customRequest(commentPath, Object.assign({\n\t\tmethod: 'PROPPATCH',\n\t\tdata: `<?xml version=\"1.0\"?>\n\t\t\t<d:propertyupdate\n\t\t\t\txmlns:d=\"DAV:\"\n\t\t\t\txmlns:oc=\"http://owncloud.org/ns\">\n\t\t\t<d:set>\n\t\t\t\t<d:prop>\n\t\t\t\t\t<oc:message>${message}</oc:message>\n\t\t\t\t</d:prop>\n\t\t\t</d:set>\n\t\t\t</d:propertyupdate>`,\n\t}))\n}\n","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getCurrentUser } from '@nextcloud/auth'\nimport { getRootPath } from '../utils/davUtils.js'\nimport { decodeHtmlEntities } from '../utils/decodeHtmlEntities.js'\nimport axios from '@nextcloud/axios'\nimport client from './DavClient.js'\n\n/**\n * Retrieve the comments list\n *\n * @param {string} resourceType the resource type\n * @param {number} resourceId the resource ID\n * @param {string} message the message\n * @return {object} the new comment\n */\nexport default async function(resourceType, resourceId, message) {\n\tconst resourcePath = ['', resourceType, resourceId].join('/')\n\n\tconst response = await axios.post(getRootPath() + resourcePath, {\n\t\tactorDisplayName: getCurrentUser().displayName,\n\t\tactorId: getCurrentUser().uid,\n\t\tactorType: 'users',\n\t\tcreationDateTime: (new Date()).toUTCString(),\n\t\tmessage,\n\t\tobjectType: resourceType,\n\t\tverb: 'comment',\n\t})\n\n\t// Retrieve comment id from resource location\n\tconst commentId = parseInt(response.headers['content-location'].split('/').pop())\n\tconst commentPath = resourcePath + '/' + commentId\n\n\t// Fetch newly created comment data\n\tconst comment = await client.stat(commentPath, {\n\t\tdetails: true,\n\t})\n\n\tconst props = comment.data.props\n\t// Decode twice to handle potentially double-encoded entities\n\t// FIXME Remove this once https://github.com/nextcloud/server/issues/29306\n\t// is resolved\n\tprops.actorDisplayName = decodeHtmlEntities(props.actorDisplayName, 2)\n\tprops.message = decodeHtmlEntities(props.message, 2)\n\n\treturn comment.data\n}\n","/**\n * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { defineStore } from 'pinia'\n\nexport const useDeletedCommentLimbo = defineStore('deletedCommentLimbo', {\n\tstate: () => ({\n\t\tidsInLimbo: [],\n\t}),\n\tactions: {\n\t\taddId(id) {\n\t\t\tthis.idsInLimbo.push(id)\n\t\t},\n\n\t\tremoveId(id) {\n\t\t\tconst index = this.idsInLimbo.indexOf(id)\n\t\t\tif (index > -1) {\n\t\t\t\tthis.idsInLimbo.splice(index, 1)\n\t\t\t}\n\t\t},\n\n\t\tcheckForId(id) {\n\t\t\tthis.idsInLimbo.includes(id)\n\t\t},\n\t},\n})\n","/**\n * SPDX-FileCopyrightText: 2021 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n/**\n * @param {any} value -\n * @param {any} passes -\n */\nexport function decodeHtmlEntities(value, passes = 1) {\n\tconst parser = new DOMParser()\n\tlet decoded = value\n\tfor (let i = 0; i < passes; i++) {\n\t\tdecoded = parser.parseFromString(decoded, 'text/html').documentElement.textContent\n\t}\n\treturn decoded\n}\n","/**\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\nimport axios from '@nextcloud/axios';\nimport { getCurrentUser } from '@nextcloud/auth';\nimport { loadState } from '@nextcloud/initial-state';\nimport { generateOcsUrl } from '@nextcloud/router';\nimport { defineComponent } from 'vue';\nexport default defineComponent({\n props: {\n resourceId: {\n type: Number,\n required: true,\n },\n resourceType: {\n type: String,\n default: 'files',\n },\n },\n data() {\n return {\n editorData: {\n actorDisplayName: getCurrentUser().displayName,\n actorId: getCurrentUser().uid,\n key: 'editor',\n },\n userData: {},\n };\n },\n methods: {\n /**\n * Autocomplete @mentions\n *\n * @param {string} search the query\n * @param {Function} callback the callback to process the results with\n */\n async autoComplete(search, callback) {\n const { data } = await axios.get(generateOcsUrl('core/autocomplete/get'), {\n params: {\n search,\n itemType: 'files',\n itemId: this.resourceId,\n sorter: 'commenters|share-recipients',\n limit: loadState('comments', 'maxAutoCompleteResults'),\n },\n });\n // Save user data so it can be used by the editor to replace mentions\n data.ocs.data.forEach(user => { this.userData[user.id] = user; });\n return callback(Object.values(this.userData));\n },\n /**\n * Make sure we have all mentions as Array of objects\n *\n * @param mentions the mentions list\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n genMentionsData(mentions) {\n Object.values(mentions)\n .flat()\n .forEach(mention => {\n this.userData[mention.mentionId] = {\n // TODO: support groups\n icon: 'icon-user',\n id: mention.mentionId,\n label: mention.mentionDisplayName,\n source: 'users',\n primary: getCurrentUser()?.uid === mention.mentionId,\n };\n });\n return this.userData;\n },\n },\n});\n","<!--\n - SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n<template>\n\t<component :is=\"tag\"\n\t\tv-show=\"!deleted && !isLimbo\"\n\t\t:class=\"{'comment--loading': loading}\"\n\t\tclass=\"comment\">\n\t\t<!-- Comment header toolbar -->\n\t\t<div class=\"comment__side\">\n\t\t\t<!-- Author -->\n\t\t\t<NcAvatar class=\"comment__avatar\"\n\t\t\t\t:display-name=\"actorDisplayName\"\n\t\t\t\t:user=\"actorId\"\n\t\t\t\t:size=\"32\" />\n\t\t</div>\n\t\t<div class=\"comment__body\">\n\t\t\t<div class=\"comment__header\">\n\t\t\t\t<span class=\"comment__author\">{{ actorDisplayName }}</span>\n\n\t\t\t\t<!-- Comment actions,\n\t\t\t\t\tshow if we have a message id and current user is author -->\n\t\t\t\t<NcActions v-if=\"isOwnComment && id && !loading\" class=\"comment__actions\">\n\t\t\t\t\t<template v-if=\"!editing\">\n\t\t\t\t\t\t<NcActionButton close-after-click\n\t\t\t\t\t\t\t@click=\"onEdit\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<IconEdit :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ t('comments', 'Edit comment') }}\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t\t<NcActionSeparator />\n\t\t\t\t\t\t<NcActionButton close-after-click\n\t\t\t\t\t\t\t@click=\"onDeleteWithUndo\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<IconDelete :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t\t{{ t('comments', 'Delete comment') }}\n\t\t\t\t\t\t</NcActionButton>\n\t\t\t\t\t</template>\n\n\t\t\t\t\t<NcActionButton v-else @click=\"onEditCancel\">\n\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t<IconClose :size=\"20\" />\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t{{ t('comments', 'Cancel edit') }}\n\t\t\t\t\t</NcActionButton>\n\t\t\t\t</NcActions>\n\n\t\t\t\t<!-- Show loading if we're editing or deleting, not on new ones -->\n\t\t\t\t<div v-if=\"id && loading\" class=\"comment_loading icon-loading-small\" />\n\n\t\t\t\t<!-- Relative time to the comment creation -->\n\t\t\t\t<NcDateTime v-else-if=\"creationDateTime\"\n\t\t\t\t\tclass=\"comment__timestamp\"\n\t\t\t\t\t:timestamp=\"timestamp\"\n\t\t\t\t\t:ignore-seconds=\"true\" />\n\t\t\t</div>\n\n\t\t\t<!-- Message editor -->\n\t\t\t<form v-if=\"editor || editing\" class=\"comment__editor\" @submit.prevent>\n\t\t\t\t<div class=\"comment__editor-group\">\n\t\t\t\t\t<NcRichContenteditable ref=\"editor\"\n\t\t\t\t\t\t:auto-complete=\"autoComplete\"\n\t\t\t\t\t\t:contenteditable=\"!loading\"\n\t\t\t\t\t\t:label=\"editor ? t('comments', 'New comment') : t('comments', 'Edit comment')\"\n\t\t\t\t\t\t:placeholder=\"t('comments', 'Write a comment …')\"\n\t\t\t\t\t\t:value=\"localMessage\"\n\t\t\t\t\t\t:user-data=\"userData\"\n\t\t\t\t\t\taria-describedby=\"tab-comments__editor-description\"\n\t\t\t\t\t\t@update:value=\"updateLocalMessage\"\n\t\t\t\t\t\t@submit=\"onSubmit\" />\n\t\t\t\t\t<div class=\"comment__submit\">\n\t\t\t\t\t\t<NcButton type=\"tertiary-no-background\"\n\t\t\t\t\t\t\tnative-type=\"submit\"\n\t\t\t\t\t\t\t:aria-label=\"t('comments', 'Post comment')\"\n\t\t\t\t\t\t\t:disabled=\"isEmptyMessage\"\n\t\t\t\t\t\t\t@click=\"onSubmit\">\n\t\t\t\t\t\t\t<template #icon>\n\t\t\t\t\t\t\t\t<NcLoadingIcon v-if=\"loading\" />\n\t\t\t\t\t\t\t\t<IconArrowRight v-else :size=\"20\" />\n\t\t\t\t\t\t\t</template>\n\t\t\t\t\t\t</NcButton>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div id=\"tab-comments__editor-description\" class=\"comment__editor-description\">\n\t\t\t\t\t{{ t('comments', '@ for mentions, : for emoji, / for smart picker') }}\n\t\t\t\t</div>\n\t\t\t</form>\n\n\t\t\t<!-- Message content -->\n\t\t\t<!-- The html is escaped and sanitized before rendering -->\n\t\t\t<!-- eslint-disable vue/no-v-html-->\n\t\t\t<div v-else\n\t\t\t\t:class=\"{'comment__message--expanded': expanded}\"\n\t\t\t\tclass=\"comment__message\"\n\t\t\t\t@click=\"onExpand\"\n\t\t\t\tv-html=\"renderedContent\" />\n\t\t\t<!-- eslint-enable vue/no-v-html-->\n\t\t</div>\n\t</component>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport { translate as t } from '@nextcloud/l10n'\n\nimport NcActionButton from '@nextcloud/vue/dist/Components/NcActionButton.js'\nimport NcActions from '@nextcloud/vue/dist/Components/NcActions.js'\nimport NcActionSeparator from '@nextcloud/vue/dist/Components/NcActionSeparator.js'\nimport NcAvatar from '@nextcloud/vue/dist/Components/NcAvatar.js'\nimport NcButton from '@nextcloud/vue/dist/Components/NcButton.js'\nimport NcDateTime from '@nextcloud/vue/dist/Components/NcDateTime.js'\nimport NcLoadingIcon from '@nextcloud/vue/dist/Components/NcLoadingIcon.js'\nimport RichEditorMixin from '@nextcloud/vue/dist/Mixins/richEditor.js'\n\nimport IconArrowRight from 'vue-material-design-icons/ArrowRight.vue'\nimport IconClose from 'vue-material-design-icons/Close.vue'\nimport IconDelete from 'vue-material-design-icons/Delete.vue'\nimport IconEdit from 'vue-material-design-icons/Pencil.vue'\n\nimport CommentMixin from '../mixins/CommentMixin.js'\nimport { mapStores } from 'pinia'\nimport { useDeletedCommentLimbo } from '../store/deletedCommentLimbo.js'\n\n// Dynamic loading\nconst NcRichContenteditable = () => import('@nextcloud/vue/dist/Components/NcRichContenteditable.js')\n\nexport default {\n\tname: 'Comment',\n\n\tcomponents: {\n\t\tIconArrowRight,\n\t\tIconClose,\n\t\tIconDelete,\n\t\tIconEdit,\n\t\tNcActionButton,\n\t\tNcActions,\n\t\tNcActionSeparator,\n\t\tNcAvatar,\n\t\tNcButton,\n\t\tNcDateTime,\n\t\tNcLoadingIcon,\n\t\tNcRichContenteditable,\n\t},\n\tmixins: [RichEditorMixin, CommentMixin],\n\n\tinheritAttrs: false,\n\n\tprops: {\n\t\tactorDisplayName: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tactorId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\tcreationDateTime: {\n\t\t\ttype: String,\n\t\t\tdefault: null,\n\t\t},\n\n\t\t/**\n\t\t * Force the editor display\n\t\t */\n\t\teditor: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\n\t\t/**\n\t\t * Provide the autocompletion data\n\t\t */\n\t\tautoComplete: {\n\t\t\ttype: Function,\n\t\t\trequired: true,\n\t\t},\n\n\t\ttag: {\n\t\t\ttype: String,\n\t\t\tdefault: 'div',\n\t\t},\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\texpanded: false,\n\t\t\t// Only change data locally and update the original\n\t\t\t// parent data when the request is sent and resolved\n\t\t\tlocalMessage: '',\n\t\t\tsubmitted: false,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\t...mapStores(useDeletedCommentLimbo),\n\n\t\t/**\n\t\t * Is the current user the author of this comment\n\t\t *\n\t\t * @return {boolean}\n\t\t */\n\t\tisOwnComment() {\n\t\t\treturn getCurrentUser().uid === this.actorId\n\t\t},\n\n\t\t/**\n\t\t * Rendered content as html string\n\t\t *\n\t\t * @return {string}\n\t\t */\n\t\trenderedContent() {\n\t\t\tif (this.isEmptyMessage) {\n\t\t\t\treturn ''\n\t\t\t}\n\t\t\treturn this.renderContent(this.localMessage)\n\t\t},\n\n\t\tisEmptyMessage() {\n\t\t\treturn !this.localMessage || this.localMessage.trim() === ''\n\t\t},\n\n\t\t/**\n\t\t * Timestamp of the creation time (in ms UNIX time)\n\t\t */\n\t\ttimestamp() {\n\t\t\treturn Date.parse(this.creationDateTime)\n\t\t},\n\n\t\tisLimbo() {\n\t\t\treturn this.deletedCommentLimboStore.checkForId(this.id)\n\t\t},\n\t},\n\n\twatch: {\n\t\t// If the data change, update the local value\n\t\tmessage(message) {\n\t\t\tthis.updateLocalMessage(message)\n\t\t},\n\t},\n\n\tbeforeMount() {\n\t\t// Init localMessage\n\t\tthis.updateLocalMessage(this.message)\n\t},\n\n\tmethods: {\n\t\tt,\n\n\t\t/**\n\t\t * Update local Message on outer change\n\t\t *\n\t\t * @param {string} message the message to set\n\t\t */\n\t\tupdateLocalMessage(message) {\n\t\t\tthis.localMessage = message.toString()\n\t\t\tthis.submitted = false\n\t\t},\n\n\t\t/**\n\t\t * Dispatch message between edit and create\n\t\t */\n\t\tonSubmit() {\n\t\t\t// Do not submit if message is empty\n\t\t\tif (this.localMessage.trim() === '') {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tif (this.editor) {\n\t\t\t\tthis.onNewComment(this.localMessage.trim())\n\t\t\t\tthis.$nextTick(() => {\n\t\t\t\t\t// Focus the editor again\n\t\t\t\t\tthis.$refs.editor.$el.focus()\n\t\t\t\t})\n\t\t\t\treturn\n\t\t\t}\n\t\t\tthis.onEditComment(this.localMessage.trim())\n\t\t},\n\n\t\tonExpand() {\n\t\t\tthis.expanded = true\n\t\t},\n\t},\n\n}\n</script>\n\n<style lang=\"scss\" scoped>\n@use \"sass:math\";\n\n$comment-padding: 10px;\n\n.comment {\n\tdisplay: flex;\n\tgap: 8px;\n\tpadding: 5px $comment-padding;\n\n\t&__side {\n\t\tdisplay: flex;\n\t\talign-items: flex-start;\n\t\tpadding-top: 6px;\n\t}\n\n\t&__body {\n\t\tdisplay: flex;\n\t\tflex-grow: 1;\n\t\tflex-direction: column;\n\t}\n\n\t&__header {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tmin-height: 44px;\n\t}\n\n\t&__actions {\n\t\tmargin-inline-start: $comment-padding !important;\n\t}\n\n\t&__author {\n\t\toverflow: hidden;\n\t\twhite-space: nowrap;\n\t\ttext-overflow: ellipsis;\n\t\tcolor: var(--color-text-maxcontrast);\n\t}\n\n\t&_loading,\n\t&__timestamp {\n\t\tmargin-inline-start: auto;\n\t\ttext-align: end;\n\t\twhite-space: nowrap;\n\t\tcolor: var(--color-text-maxcontrast);\n\t}\n\n\t&__editor-group {\n\t\tposition: relative;\n\t}\n\n\t&__editor-description {\n\t\tcolor: var(--color-text-maxcontrast);\n\t\tpadding-block: var(--default-grid-baseline);\n\t}\n\n\t&__submit {\n\t\tposition: absolute !important;\n\t\tbottom: 5px;\n\t\tinset-inline-end: 0;\n\t}\n\n\t&__message {\n\t\twhite-space: pre-wrap;\n\t\tword-break: break-word;\n\t\tmax-height: 70px;\n\t\toverflow: hidden;\n\t\tmargin-top: -6px;\n\t\t&--expanded {\n\t\t\tmax-height: none;\n\t\t\toverflow: visible;\n\t\t}\n\t}\n}\n\n.rich-contenteditable__input {\n\tmin-height: 44px;\n\tmargin: 0;\n\tpadding: $comment-padding;\n}\n\n</style>\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c(_vm.tag,{directives:[{name:\"show\",rawName:\"v-show\",value:(!_vm.deleted && !_vm.isLimbo),expression:\"!deleted && !isLimbo\"}],tag:\"component\",staticClass:\"comment\",class:{'comment--loading': _vm.loading}},[_c('div',{staticClass:\"comment__side\"},[_c('NcAvatar',{staticClass:\"comment__avatar\",attrs:{\"display-name\":_vm.actorDisplayName,\"user\":_vm.actorId,\"size\":32}})],1),_vm._v(\" \"),_c('div',{staticClass:\"comment__body\"},[_c('div',{staticClass:\"comment__header\"},[_c('span',{staticClass:\"comment__author\"},[_vm._v(_vm._s(_vm.actorDisplayName))]),_vm._v(\" \"),(_vm.isOwnComment && _vm.id && !_vm.loading)?_c('NcActions',{staticClass:\"comment__actions\"},[(!_vm.editing)?[_c('NcActionButton',{attrs:{\"close-after-click\":\"\"},on:{\"click\":_vm.onEdit},scopedSlots:_vm._u([{key:\"icon\",fn:function(){return [_c('IconEdit',{attrs:{\"size\":20}})]},proxy:true}],null,false,649782975)},[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\"+_vm._s(_vm.t('comments', 'Edit comment'))+\"\\n\\t\\t\\t\\t\\t\")]),_vm._v(\" \"),_c('NcActionSeparator'),_vm._v(\" \"),_c('NcActionButton',{attrs:{\"close-after-click\":\"\"},on:{\"click\":_vm.onDeleteWithUndo},scopedSlots:_vm._u([{key:\"icon\",fn:function(){return [_c('IconDelete',{attrs:{\"size\":20}})]},proxy:true}],null,false,881161434)},[_vm._v(\"\\n\\t\\t\\t\\t\\t\\t\"+_vm._s(_vm.t('comments', 'Delete comment'))+\"\\n\\t\\t\\t\\t\\t\")])]:_c('NcActionButton',{on:{\"click\":_vm.onEditCancel},scopedSlots:_vm._u([{key:\"icon\",fn:function(){return [_c('IconClose',{attrs:{\"size\":20}})]},proxy:true}],null,false,2888946197)},[_vm._v(\"\\n\\t\\t\\t\\t\\t\"+_vm._s(_vm.t('comments', 'Cancel edit'))+\"\\n\\t\\t\\t\\t\")])],2):_vm._e(),_vm._v(\" \"),(_vm.id && _vm.loading)?_c('div',{staticClass:\"comment_loading icon-loading-small\"}):(_vm.creationDateTime)?_c('NcDateTime',{staticClass:\"comment__timestamp\",attrs:{\"timestamp\":_vm.timestamp,\"ignore-seconds\":true}}):_vm._e()],1),_vm._v(\" \"),(_vm.editor || _vm.editing)?_c('form',{staticClass:\"comment__editor\",on:{\"submit\":function($event){$event.preventDefault();}}},[_c('div',{staticClass:\"comment__editor-group\"},[_c('NcRichContenteditable',{ref:\"editor\",attrs:{\"auto-complete\":_vm.autoComplete,\"contenteditable\":!_vm.loading,\"label\":_vm.editor ? _vm.t('comments', 'New comment') : _vm.t('comments', 'Edit comment'),\"placeholder\":_vm.t('comments', 'Write a comment …'),\"value\":_vm.localMessage,\"user-data\":_vm.userData,\"aria-describedby\":\"tab-comments__editor-description\"},on:{\"update:value\":_vm.updateLocalMessage,\"submit\":_vm.onSubmit}}),_vm._v(\" \"),_c('div',{staticClass:\"comment__submit\"},[_c('NcButton',{attrs:{\"type\":\"tertiary-no-background\",\"native-type\":\"submit\",\"aria-label\":_vm.t('comments', 'Post comment'),\"disabled\":_vm.isEmptyMessage},on:{\"click\":_vm.onSubmit},scopedSlots:_vm._u([{key:\"icon\",fn:function(){return [(_vm.loading)?_c('NcLoadingIcon'):_c('IconArrowRight',{attrs:{\"size\":20}})]},proxy:true}],null,false,758946661)})],1)],1),_vm._v(\" \"),_c('div',{staticClass:\"comment__editor-description\",attrs:{\"id\":\"tab-comments__editor-description\"}},[_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.t('comments', '@ for mentions, : for emoji, / for smart picker'))+\"\\n\\t\\t\\t\")])]):_c('div',{staticClass:\"comment__message\",class:{'comment__message--expanded': _vm.expanded},domProps:{\"innerHTML\":_vm._s(_vm.renderedContent)},on:{\"click\":_vm.onExpand}})])])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.comment[data-v-1f6341c6]{display:flex;gap:8px;padding:5px 10px}.comment__side[data-v-1f6341c6]{display:flex;align-items:flex-start;padding-top:6px}.comment__body[data-v-1f6341c6]{display:flex;flex-grow:1;flex-direction:column}.comment__header[data-v-1f6341c6]{display:flex;align-items:center;min-height:44px}.comment__actions[data-v-1f6341c6]{margin-inline-start:10px !important}.comment__author[data-v-1f6341c6]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:var(--color-text-maxcontrast)}.comment_loading[data-v-1f6341c6],.comment__timestamp[data-v-1f6341c6]{margin-inline-start:auto;text-align:end;white-space:nowrap;color:var(--color-text-maxcontrast)}.comment__editor-group[data-v-1f6341c6]{position:relative}.comment__editor-description[data-v-1f6341c6]{color:var(--color-text-maxcontrast);padding-block:var(--default-grid-baseline)}.comment__submit[data-v-1f6341c6]{position:absolute !important;bottom:5px;inset-inline-end:0}.comment__message[data-v-1f6341c6]{white-space:pre-wrap;word-break:break-word;max-height:70px;overflow:hidden;margin-top:-6px}.comment__message--expanded[data-v-1f6341c6]{max-height:none;overflow:visible}.rich-contenteditable__input[data-v-1f6341c6]{min-height:44px;margin:0;padding:10px}`, \"\",{\"version\":3,\"sources\":[\"webpack://./apps/comments/src/components/Comment.vue\"],\"names\":[],\"mappings\":\"AAKA,0BACC,YAAA,CACA,OAAA,CACA,gBAAA,CAEA,gCACC,YAAA,CACA,sBAAA,CACA,eAAA,CAGD,gCACC,YAAA,CACA,WAAA,CACA,qBAAA,CAGD,kCACC,YAAA,CACA,kBAAA,CACA,eAAA,CAGD,mCACC,mCAAA,CAGD,kCACC,eAAA,CACA,kBAAA,CACA,sBAAA,CACA,mCAAA,CAGD,uEAEC,wBAAA,CACA,cAAA,CACA,kBAAA,CACA,mCAAA,CAGD,wCACC,iBAAA,CAGD,8CACC,mCAAA,CACA,0CAAA,CAGD,kCACC,4BAAA,CACA,UAAA,CACA,kBAAA,CAGD,mCACC,oBAAA,CACA,qBAAA,CACA,eAAA,CACA,eAAA,CACA,eAAA,CACA,6CACC,eAAA,CACA,gBAAA,CAKH,8CACC,eAAA,CACA,QAAA,CACA,YA3EiB\",\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\n import API from \"!../../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Comment.vue?vue&type=style&index=0&id=1f6341c6&prod&lang=scss&scoped=true\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\noptions.insert = insertFn.bind(null, \"head\");\noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../../../node_modules/css-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../../node_modules/sass-loader/dist/cjs.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Comment.vue?vue&type=style&index=0&id=1f6341c6&prod&lang=scss&scoped=true\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./Comment.vue?vue&type=template&id=1f6341c6&scoped=true\"\nimport script from \"./Comment.vue?vue&type=script&lang=js\"\nexport * from \"./Comment.vue?vue&type=script&lang=js\"\nimport style0 from \"./Comment.vue?vue&type=style&index=0&id=1f6341c6&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"1f6341c6\",\n null\n \n)\n\nexport default component.exports","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Comment.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Comment.vue?vue&type=script&lang=js\""],"names":["props","id","type","Number","default","message","String","resourceId","required","resourceType","data","deleted","editing","loading","computed","mapStores","useDeletedCommentLimbo","methods","onEdit","this","onEditCancel","updateLocalMessage","onEditComment","EditComment","logger","debug","$emit","error","showError","t","console","onDeleteWithUndo","deletedCommentLimboStore","addId","timeOutDelete","setTimeout","onDelete","TOAST_UNDO_TIMEOUT","showUndo","clearTimeout","removeId","DeleteComment","onNewComment","newComment","NewComment","localMessage","async","commentId","commentPath","join","client","deleteFile","customRequest","Object","assign","method","resourcePath","response","axios","post","getRootPath","actorDisplayName","getCurrentUser","displayName","actorId","uid","actorType","creationDateTime","Date","toUTCString","objectType","verb","parseInt","headers","split","pop","comment","stat","details","decodeHtmlEntities","defineStore","state","idsInLimbo","actions","push","index","indexOf","splice","checkForId","includes","value","passes","arguments","length","undefined","parser","DOMParser","decoded","i","parseFromString","documentElement","textContent","defineComponent","editorData","key","userData","autoComplete","search","callback","get","generateOcsUrl","params","itemType","itemId","sorter","limit","loadState","ocs","forEach","user","values","genMentionsData","mentions","flat","mention","mentionId","icon","label","mentionDisplayName","source","primary","name","components","IconArrowRight","IconClose","IconDelete","IconEdit","NcActionButton","NcActions","NcActionSeparator","NcAvatar","NcButton","NcDateTime","NcLoadingIcon","NcRichContenteditable","mixins","RichEditorMixin","CommentMixin","inheritAttrs","editor","Boolean","Function","tag","expanded","submitted","isOwnComment","renderedContent","isEmptyMessage","renderContent","trim","timestamp","parse","isLimbo","watch","beforeMount","toString","onSubmit","$nextTick","$refs","$el","focus","onExpand","render","_vm","_c","_self","directives","rawName","expression","staticClass","class","attrs","_v","_s","on","scopedSlots","_u","fn","proxy","_e","$event","preventDefault","ref","domProps","staticRenderFns","___CSS_LOADER_EXPORT___","module","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","locals"],"sourceRoot":""}
|