text/js/BaseReader-Cts4Uea0.chunk.m...

1 строка
3.6 KiB
Plaintext
Исходник Обычный вид История

{"version":3,"file":"BaseReader-Cts4Uea0.chunk.mjs","sources":["../src/components/BaseReader.vue"],"sourcesContent":["<!--\n - SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<div data-text-el=\"editor-content-wrapper\"\n\t\tclass=\"content-wrapper text-editor__content-wrapper\"\n\t\t:class=\"{\n\t\t\t'--show-outline': showOutline\n\t\t}\">\n\t\t<div v-if=\"showOutline\" class=\"text-editor__content-wrapper__left\">\n\t\t\t<EditorOutline />\n\t\t</div>\n\t\t<EditorContent v-if=\"$editor\"\n\t\t\tid=\"read-only-editor\"\n\t\t\tclass=\"editor__content text-editor__content\"\n\t\t\t:editor=\"$editor\" />\n\t\t<div class=\"text-editor__content-wrapper__right\" />\n\t</div>\n</template>\n\n<script>\nimport { Editor } from '@tiptap/core'\nimport { EditorContent } from '@tiptap/vue-2'\nimport { EDITOR } from './Editor.provider.js'\nimport { useOutlineStateMixin, useOutlineActions } from './Editor/Wrapper.provider.js'\nimport EditorOutline from './Editor/EditorOutline.vue'\n\nexport default {\n\tname: 'BaseReader',\n\tcomponents: {\n\t\tEditorContent,\n\t\tEditorOutline,\n\t},\n\n\tmixins: [useOutlineStateMixin, useOutlineActions],\n\n\tprovide() {\n\t\tconst val = {}\n\n\t\tObject.defineProperties(val, {\n\t\t\t[EDITOR]: {\n\t\t\t\tget: () => this.$editor,\n\t\t\t},\n\t\t})\n\n\t\treturn val\n\t},\n\n\t// extensions is a factory building a list of extensions for the editor\n\tinject: ['renderHtml', 'extensions'],\n\n\tprops: {\n\t\tcontent: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t},\n\n\tcomputed: {\n\t\thtmlContent() {\n\t\t\treturn this.renderHtml(this.content)\n\t\t},\n\t\tshowOutline() {\n\t\t\treturn this.$outlineState.visible\n\t\t},\n\t},\n\n\twatch: {\n\t\tcontent() {\n\t\t\tthis.updateContent()\n\t\t},\n\t},\n\n\tcreated() {\n\t\tthis.$editor = this.createEditor()\n\t\tthis.$editor.setEditable(false)\n\t},\n\n\tbeforeDestroy() {\n\t\tthis.$editor.destroy()\n\t},\n\n\tmethods: {\n\t\tcreateEditor() {\n\t\t\treturn new Editor({\n\t\t\t\tcontent: this.htmlContent,\n\t\t\t\textensions: this.extensions(),\n\t\t\t})\n\t\t},\n\n\t\tupdateContent() {\n\t\t\tthis.$editor.commands.setContent(this.htmlContent, true)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n.editor__content {\n\tmax-width: var(--text-editor-max-width);\n\tmargin: auto;\n\tposition: relative;\n\twidth: 100%;\n}\n\n.text-editor__content-wrapper {\n\t--side-width: calc((100% - var(--text-editor-max-width)) / 2);\n\tdisplay: grid;\n\tgrid-template-columns: 1fr auto;\n\t&.--show-outline {\n\t\tgrid-template-columns: var(--side-width) auto var(--side-width);\n\t}\n\t.text-editor__content-wrapper__left,\n\t.text-editor__content-wrapper__right {\n\t\theight: 100%;\n\t\tposition: relative;\n\t}\n}\n</style>\n"],"names":["_sfc_main","EditorContent","EditorOutline","useOutlineStateMixin","useOutlineActions","val","EDITOR","Editor"],"mappings":";kNA6BA,MAAAA,EAAA,CACA,KAAA,aACA,WAAA,CACA,cAAAC,EACA,cAAAC,CACA,EAEA,OAAA,CAAAC,EAAAC,CAAA,EAEA,SAAA,CACA,MAAAC,EAAA,CAAA,EAEA,OAAA,OAAA,iBAAAA,EAAA,CACA,CAAAC,CAAA,EAAA,CACA,IAAA,IAAA,KAAA,OACA,CACA,CAAA,EAEAD,CACA,EAGA,OAAA,CAAA,aAAA,YAAA,EAEA,MAAA,CACA,QAAA,CACA,KAAA,OACA,SAAA,EACA,CACA,EAEA,SAAA,CACA,aAAA,CACA,OAAA,KAAA,WAAA,KAAA,OAAA,CACA,EACA,aAAA,CACA,OAAA,KAAA,cAAA,OACA,CACA,EAEA,MAAA,CACA,SAAA,CACA,KAAA,cAAA,CACA,CACA,EAEA,SAAA,CACA,KAAA,QAAA,KAAA,aAAA,EACA,KAAA,QAAA,YAAA,EAAA,CACA,EAEA,eAAA,CACA,KAAA,QAAA,QAAA,CACA,EAEA,QAAA,CACA,cAAA,CACA,OAAA,IAAAE,EAAA,CACA,QAAA,KAAA,YACA,WAAA,KAAA,WAAA,CACA,CAAA,CACA,EAEA,eAAA,CACA,KAAA,QAAA,SAAA,WAAA,KAAA,YAAA,EAAA,CACA,CACA,CACA"}