mirror of
https://github.com/nextcloud/server.git
synced 2026-04-04 16:45:22 -04:00
1 line
No EOL
32 KiB
XML
1 line
No EOL
32 KiB
XML
{"version":3,"mappings":";uvCAGA,MAAMA,GAAY,CAChB,KAAM,mBACR,EACMC,GAAa,CACjB,MAAO,2CACP,KAAM,WACR,EACA,SAASC,GAAYC,EAAMC,EAAQC,EAAQC,EAAQC,EAAOC,EAAU,CAClE,OAAOC,EAAS,EAAIC,EAAmB,KAAMT,EAAU,CACzD,CACA,MAAMU,GAAoCC,GAAYZ,GAAW,CAAC,CAAC,SAAUE,EAAW,EAAG,CAAC,YAAa,iBAAiB,CAAC,CAAC,ECOvHF,GAAU,CACb,KAAM,YACN,MAAO,CAAC,OAAO,EACf,MAAO,CACL,MAAO,CACL,KAAM,QAER,UAAW,CACT,KAAM,OACN,QAAS,gBAEX,KAAM,CACJ,KAAM,OACN,QAAS,EACX,CACF,CACF,+DAxBYa,GAAA,GAAE,+GAA+G,iDAX3HC,EAeO,OAfPC,EAAcZ,EAAA,OAAM,CACb,cAAaE,EAAA,MAAK,YAClB,aAAYA,EAAA,MACb,MAAM,kCACN,KAAK,MACJ,QAAKD,EAAA,KAAAA,EAAA,GAAAY,GAAEb,EAAA,MAAK,QAAUa,CAAM,WACjCF,EAQM,OARA,KAAMT,EAAA,UACP,MAAM,4BACL,MAAOA,EAAA,KACP,OAAQA,EAAA,KACT,QAAQ,cACXY,EAEO,OAFPJ,GAEO,CADQR,EAAA,OAAba,EAAA,EAAAJ,EAAuC,aAAhBT,EAAA,KAAK,gECCpC,eAAAc,GAA8BC,EAAsBC,EAAoBC,EAAmB,CAC1F,MAAMC,EAAc,CAAC,GAAIH,EAAcC,EAAYC,CAAS,EAAE,KAAK,GAAG,EAGtE,MAAME,EAAO,WAAWD,CAAW,CACpC,CCJA,eAAAE,GAA8BL,EAAsBC,EAAoBC,EAAmBI,EAAiB,CAC3G,MAAMH,EAAc,CAAC,GAAIH,EAAcC,EAAYC,CAAS,EAAE,KAAK,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YK,EAAA,OAAO,mECI9B8F,GAAeC,EAAgB,CAC9B,MAAO,CACN,WAAY,CACX,KAAM,OACN,SAAU,IAEX,aAAc,CACb,KAAM,OACN,QAAS,QACV,EAED,MAAO,CACN,MAAO,CACN,WAAY,CACX,iBAAkBjE,IAAkB,YACpC,QAASA,IAAkB,IAC3B,IAAK,UAEN,SAAU,GACV,kBAAmB,KAAK,WAE1B,EACA,QAAS,CAOR,MAAM,aAAakE,EAAQC,EAAU,CACpC,KAAM,CAAE,KAAAC,GAAS,MAAMtE,EAAM,IAAIuE,EAAe,uBAAuB,EAAG,CACzE,OAAQ,CACP,OAAAH,EACA,SAAU,KAAK,aACf,OAAQ,KAAK,kBACb,OAAQ,8BACR,MAAOI,GAAU,WAAY,wBAAwB,EACtD,CACA,EAED,OAAAF,EAAK,IAAI,KAAK,QAASrC,GAAS,CAC/B,KAAK,SAASA,EAAK,EAAE,EAAIA,CAC1B,CAAC,EACMoC,EAAS,OAAO,OAAO,KAAK,QAAQ,CAAC,CAC7C,EAQA,gBAAgBrC,EAAyC,CACxD,cAAO,OAAOA,CAAQ,EACpB,OACA,QAASyC,GAAY,CACrB,KAAK,SAASA,EAAQ,SAAS,EAAI,CAElC,KAAM,YACN,GAAIA,EAAQ,UACZ,MAAOA,EAAQ,mBACf,OAAQ,QACR,QAASvE,EAAA,GAAkB,MAAQuE,EAAQ,UAE7C,CAAC,EACK,KAAK,QACb,EAEF,CAAC","names":["_sfc_main","_hoisted_1","_sfc_render","_ctx","_cache","$props","$setup","$data","$options","openBlock","createElementBlock","NcActionSeparator","_export_sfc","_hoisted_3","_createElementBlock","_mergeProps","$event","_createElementVNode","_openBlock","DeleteComment","resourceType","resourceId","commentId","commentPath","client","EditComment","message","decodeHtmlEntities","value","passes","parser","decoded","i","NewComment","resourcePath","response","axios","getRootPath","getCurrentUser","comment","props","useDeletedCommentLimbo","defineStore","id","index","CommentMixin","mapStores","logger","error","showError","timeOutDelete","TOAST_UNDO_TIMEOUT","showUndo","newComment","NcRichContenteditable","defineAsyncComponent","NcRichText","n","IconArrowRight","IconClose","IconTrashCanOutline","IconPencilOutline","NcActionButton","NcActions","NcAvatar","NcButton","NcDateTime","NcLoadingIcon","mentions","user","key","regex","NcUserBubble","t","_hoisted_2","_hoisted_4","_hoisted_6","_hoisted_7","_withDirectives","_createBlock","_resolveDynamicComponent","_normalizeClass","_createVNode","_component_NcAvatar","_toDisplayString","_component_NcActions","_component_NcActionButton","_component_IconClose","_createTextVNode","_Fragment","_component_IconPencilOutline","_component_NcActionSeparator","_component_IconTrashCanOutline","_hoisted_5","_component_NcDateTime","_component_NcRichContenteditable","_component_NcButton","_component_NcLoadingIcon","_component_IconArrowRight","_hoisted_8","_component_NcRichText","_vShow","CommentView","defineComponent","search","callback","data","generateOcsUrl","loadState","mention"],"ignoreList":[0,1],"sources":["../node_modules/@nextcloud/vue/dist/chunks/NcActionSeparator-B9pNQaji.mjs","../node_modules/vue-material-design-icons/Close.vue","../build/frontend/apps/comments/src/services/DeleteComment.ts","../build/frontend/apps/comments/src/services/EditComment.ts","../build/frontend/apps/comments/src/utils/decodeHtmlEntities.ts","../build/frontend/apps/comments/src/services/NewComment.ts","../build/frontend/apps/comments/src/store/deletedCommentLimbo.ts","../build/frontend/apps/comments/src/mixins/CommentMixin.ts","../build/frontend/apps/comments/src/components/Comment.vue","../build/frontend/apps/comments/src/mixins/CommentView.ts"],"sourcesContent":["import '../assets/NcActionSeparator-Ct2RnclR.css';\nimport { openBlock, createElementBlock } from \"vue\";\nimport { _ as _export_sfc } from \"./_plugin-vue_export-helper-1tPrXgE0.mjs\";\nconst _sfc_main = {\n name: \"NcActionSeparator\"\n};\nconst _hoisted_1 = {\n class: \"action action-separator action--disabled\",\n role: \"separator\"\n};\nfunction _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {\n return openBlock(), createElementBlock(\"li\", _hoisted_1);\n}\nconst NcActionSeparator = /* @__PURE__ */ _export_sfc(_sfc_main, [[\"render\", _sfc_render], [\"__scopeId\", \"data-v-3e2324b7\"]]);\nexport {\n NcActionSeparator as N\n};\n//# sourceMappingURL=NcActionSeparator-B9pNQaji.mjs.map\n","<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon close-icon\"\n role=\"img\"\n @click=\"$emit('click', $event)\">\n <svg :fill=\"fillColor\"\n class=\"material-design-icon__svg\"\n :width=\"size\"\n :height=\"size\"\n viewBox=\"0 0 24 24\">\n <path d=\"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"CloseIcon\",\n emits: ['click'],\n props: {\n title: {\n type: String,\n },\n fillColor: {\n type: String,\n default: \"currentColor\"\n },\n size: {\n type: Number,\n default: 24\n }\n }\n}\n</script>","/**\n * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport client from './DavClient.ts'\n\n/**\n * Delete a comment\n *\n * @param resourceType the resource type\n * @param resourceId the resource ID\n * @param commentId the comment iD\n */\nexport default async function(resourceType: string, resourceId: number, commentId: number) {\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.ts'\n\n/**\n * Edit an existing comment\n *\n * @param resourceType the resource type\n * @param resourceId the resource ID\n * @param commentId the comment iD\n * @param message the message content\n */\nexport default async function(resourceType: string, resourceId: number, commentId: number, message: string) {\n\tconst commentPath = ['', resourceType, resourceId, commentId].join('/')\n\n\treturn await client.customRequest(commentPath, {\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: 2021 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n/**\n * @param value - the string to decode\n * @param passes - the number of times to decode the string, default is 1\n */\nexport function decodeHtmlEntities(value: string, 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: 2020 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getCurrentUser } from '@nextcloud/auth'\nimport axios from '@nextcloud/axios'\nimport { getRootPath } from '../utils/davUtils.ts'\nimport { decodeHtmlEntities } from '../utils/decodeHtmlEntities.ts'\nimport client from './DavClient.ts'\n\n/**\n * Retrieve the comments list\n *\n * @param resourceType the resource type\n * @param resourceId the resource ID\n * @param message the message\n * @return The new comment\n */\nexport default async function(resourceType: string, resourceId: number, message: string) {\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\treturn this.idsInLimbo.includes(id)\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 { showError, showUndo, TOAST_UNDO_TIMEOUT } from '@nextcloud/dialogs'\nimport { mapStores } from 'pinia'\nimport logger from '../logger.ts'\nimport DeleteComment from '../services/DeleteComment.ts'\nimport EditComment from '../services/EditComment.ts'\nimport NewComment from '../services/NewComment.ts'\nimport { useDeletedCommentLimbo } from '../store/deletedCommentLimbo.ts'\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\tlogger.error('An error occurred while trying to edit the comment', { 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\tlogger.error('An error occurred while trying to delete the comment', { 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\tlogger.error('An error occurred while trying to create the comment', { 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<template>\n\t<component\n\t\t: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\n\t\t\t\tclass=\"comment__avatar\"\n\t\t\t\t:displayName=\"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\n\t\t\t\t\t\t\tcloseAfterClick\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<IconPencilOutline :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\n\t\t\t\t\t\t\tcloseAfterClick\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<IconTrashCanOutline :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\n\t\t\t\t\tv-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:ignoreSeconds=\"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\n\t\t\t\t\t\tref=\"editor\"\n\t\t\t\t\t\tv-model=\"localMessage\"\n\t\t\t\t\t\t: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:userData\n\t\t\t\t\t\taria-describedby=\"tab-comments__editor-description\"\n\t\t\t\t\t\t@update:modelValue=\"submitted = false\"\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\n\t\t\t\t\t\t\tvariant=\"tertiary-no-background\"\n\t\t\t\t\t\t\ttype=\"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<NcRichText\n\t\t\t\tv-else\n\t\t\t\tclass=\"comment__message\"\n\t\t\t\t:class=\"{ 'comment__message--expanded': expanded }\"\n\t\t\t\t:text=\"richContent.message\"\n\t\t\t\t:arguments=\"richContent.mentions\"\n\t\t\t\tuseMarkdown\n\t\t\t\t@click=\"onExpand\" />\n\t\t</div>\n\t</component>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport { translate as t } from '@nextcloud/l10n'\nimport { mapStores } from 'pinia'\nimport { defineAsyncComponent } from 'vue'\nimport NcActionButton from '@nextcloud/vue/components/NcActionButton'\nimport NcActions from '@nextcloud/vue/components/NcActions'\nimport NcActionSeparator from '@nextcloud/vue/components/NcActionSeparator'\nimport NcAvatar from '@nextcloud/vue/components/NcAvatar'\nimport NcButton from '@nextcloud/vue/components/NcButton'\nimport NcDateTime from '@nextcloud/vue/components/NcDateTime'\nimport NcLoadingIcon from '@nextcloud/vue/components/NcLoadingIcon'\nimport NcUserBubble from '@nextcloud/vue/components/NcUserBubble'\nimport IconArrowRight from 'vue-material-design-icons/ArrowRight.vue'\nimport IconClose from 'vue-material-design-icons/Close.vue'\nimport IconPencilOutline from 'vue-material-design-icons/PencilOutline.vue'\nimport IconTrashCanOutline from 'vue-material-design-icons/TrashCanOutline.vue'\nimport CommentMixin from '../mixins/CommentMixin.ts'\nimport { useDeletedCommentLimbo } from '../store/deletedCommentLimbo.ts'\n\n// Dynamic loading\nconst NcRichContenteditable = defineAsyncComponent(() => import('@nextcloud/vue/components/NcRichContenteditable'))\nconst NcRichText = defineAsyncComponent(() => import('@nextcloud/vue/components/NcRichText'))\n\nexport default {\n\t/* eslint vue/multi-word-component-names: \"warn\" */\n\tname: 'Comment',\n\n\tcomponents: {\n\t\tIconArrowRight,\n\t\tIconClose,\n\t\tIconTrashCanOutline,\n\t\tIconPencilOutline,\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\tNcRichText,\n\t},\n\n\tmixins: [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\n\t\tactorId: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\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\tuserData: {\n\t\t\ttype: Object,\n\t\t\tdefault: () => ({}),\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\trichContent() {\n\t\t\tconst mentions = {}\n\t\t\tlet message = this.localMessage\n\n\t\t\tObject.keys(this.userData).forEach((user, index) => {\n\t\t\t\tconst key = `mention-${index}`\n\t\t\t\tconst regex = new RegExp(`@${user}|@\"${user}\"`, 'g')\n\t\t\t\tmessage = message.replace(regex, `{${key}}`)\n\t\t\t\tmentions[key] = {\n\t\t\t\t\tcomponent: NcUserBubble,\n\t\t\t\t\tprops: {\n\t\t\t\t\t\tuser,\n\t\t\t\t\t\tdisplayName: this.userData[user].label,\n\t\t\t\t\t\tprimary: this.userData[user].primary,\n\t\t\t\t\t},\n\t\t\t\t}\n\t\t\t})\n\n\t\t\treturn { mentions, message }\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\tcontainer-type: inline-size;\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: normal;\n\t\tmax-height: 200px;\n\t\toverflow: auto;\n\t\tscrollbar-gutter: stable;\n\t\tscrollbar-width: thin;\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\t:deep(img) {\n\t\t\tmax-width: 100%;\n\t\t\theight: auto;\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","/*!\n * SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport { getCurrentUser } from '@nextcloud/auth'\nimport axios from '@nextcloud/axios'\nimport { loadState } from '@nextcloud/initial-state'\nimport { generateOcsUrl } from '@nextcloud/router'\nimport { defineComponent } from 'vue'\n\nexport default defineComponent({\n\tprops: {\n\t\tresourceId: {\n\t\t\ttype: 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\tdata() {\n\t\treturn {\n\t\t\teditorData: {\n\t\t\t\tactorDisplayName: getCurrentUser()!.displayName as string,\n\t\t\t\tactorId: getCurrentUser()!.uid as string,\n\t\t\t\tkey: 'editor',\n\t\t\t},\n\t\t\tuserData: {},\n\t\t\tcurrentResourceId: this.resourceId,\n\t\t}\n\t},\n\tmethods: {\n\t\t/**\n\t\t * Autocomplete `@mentions`\n\t\t *\n\t\t * @param search the query\n\t\t * @param callback the callback to process the results with\n\t\t */\n\t\tasync autoComplete(search, callback) {\n\t\t\tconst { data } = await axios.get(generateOcsUrl('core/autocomplete/get'), {\n\t\t\t\tparams: {\n\t\t\t\t\tsearch,\n\t\t\t\t\titemType: this.resourceType,\n\t\t\t\t\titemId: this.currentResourceId,\n\t\t\t\t\tsorter: 'commenters|share-recipients',\n\t\t\t\t\tlimit: loadState('comments', 'maxAutoCompleteResults'),\n\t\t\t\t},\n\t\t\t})\n\t\t\t// Save user data so it can be used by the editor to replace mentions\n\t\t\tdata.ocs.data.forEach((user) => {\n\t\t\t\tthis.userData[user.id] = user\n\t\t\t})\n\t\t\treturn callback(Object.values(this.userData))\n\t\t},\n\n\t\t/**\n\t\t * Make sure we have all mentions as Array of objects\n\t\t *\n\t\t * @param mentions the mentions list\n\t\t */\n\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\tgenMentionsData(mentions: any[]): Record<string, object> {\n\t\t\tObject.values(mentions)\n\t\t\t\t.flat()\n\t\t\t\t.forEach((mention) => {\n\t\t\t\t\tthis.userData[mention.mentionId] = {\n\t\t\t\t\t\t// TODO: support groups\n\t\t\t\t\t\ticon: 'icon-user',\n\t\t\t\t\t\tid: mention.mentionId,\n\t\t\t\t\t\tlabel: mention.mentionDisplayName,\n\t\t\t\t\t\tsource: 'users',\n\t\t\t\t\t\tprimary: getCurrentUser()?.uid === mention.mentionId,\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\treturn this.userData\n\t\t},\n\t},\n})\n"],"file":"CommentView-CB2dr6mD.chunk.mjs"} |