f7cloud_client/apps/text/js/Wrapper-CwuUv6cL.chunk.mjs.map
root 8b6a0139db f7cloud_client
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-17 22:59:26 +00:00

1 line
101 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{"version":3,"file":"Wrapper-CwuUv6cL.chunk.mjs","sources":["../node_modules/y-prosemirror/src/plugins/undo-plugin.js","../node_modules/@tiptap/extension-collaboration/dist/index.js","../src/composables/useEditorWidth.ts","../node_modules/@tiptap/extension-node-range/dist/index.js","../node_modules/@tiptap/extension-drag-handle/dist/index.js","../node_modules/@tiptap/extension-drag-handle-vue-2/dist/index.js","../node_modules/vue-material-design-icons/DragVertical.vue","../src/components/Editor/FloatingButtons.vue","../src/components/Editor/ContentContainer.vue","../src/apis/attach.ts","../src/components/Editor/MediaHandler.vue","../src/components/Editor/MainContainer.vue","../src/components/Editor/Wrapper.vue"],"sourcesContent":["import { Plugin } from 'prosemirror-state'\n\nimport { getRelativeSelection } from './sync-plugin.js'\nimport { UndoManager, Item, ContentType, XmlElement, Text } from 'yjs'\nimport { yUndoPluginKey, ySyncPluginKey } from './keys.js'\n\n/**\n * @typedef {Object} UndoPluginState\n * @property {import('yjs').UndoManager} undoManager\n * @property {ReturnType<typeof getRelativeSelection> | null} prevSel\n * @property {boolean} hasUndoOps\n * @property {boolean} hasRedoOps\n */\n\n/**\n * Undo the last user action\n *\n * @param {import('prosemirror-state').EditorState} state\n * @return {boolean} whether a change was undone\n */\nexport const undo = state => yUndoPluginKey.getState(state)?.undoManager?.undo() != null\n\n/**\n * Redo the last user action\n *\n * @param {import('prosemirror-state').EditorState} state\n * @return {boolean} whether a change was undone\n */\nexport const redo = state => yUndoPluginKey.getState(state)?.undoManager?.redo() != null\n\n/**\n * Undo the last user action if there are undo operations available\n * @type {import('prosemirror-state').Command}\n */\nexport const undoCommand = (state, dispatch) => dispatch == null ? yUndoPluginKey.getState(state)?.undoManager?.canUndo() : undo(state)\n\n/**\n * Redo the last user action if there are redo operations available\n * @type {import('prosemirror-state').Command}\n */\nexport const redoCommand = (state, dispatch) => dispatch == null ? yUndoPluginKey.getState(state)?.undoManager?.canRedo() : redo(state)\n\nexport const defaultProtectedNodes = new Set(['paragraph'])\n\n/**\n * @param {import('yjs').Item} item\n * @param {Set<string>} protectedNodes\n * @returns {boolean}\n */\nexport const defaultDeleteFilter = (item, protectedNodes) => !(item instanceof Item) ||\n !(item.content instanceof ContentType) ||\n !(item.content.type instanceof Text ||\n (item.content.type instanceof XmlElement && protectedNodes.has(item.content.type.nodeName))) ||\n item.content.type._length === 0\n\n/**\n * @param {object} [options]\n * @param {Set<string>} [options.protectedNodes]\n * @param {any[]} [options.trackedOrigins]\n * @param {import('yjs').UndoManager | null} [options.undoManager]\n */\nexport const yUndoPlugin = ({ protectedNodes = defaultProtectedNodes, trackedOrigins = [], undoManager = null } = {}) => new Plugin({\n key: yUndoPluginKey,\n state: {\n init: (initargs, state) => {\n // TODO: check if plugin order matches and fix\n const ystate = ySyncPluginKey.getState(state)\n const _undoManager = undoManager || new UndoManager(ystate.type, {\n trackedOrigins: new Set([ySyncPluginKey].concat(trackedOrigins)),\n deleteFilter: (item) => defaultDeleteFilter(item, protectedNodes),\n captureTransaction: tr => tr.meta.get('addToHistory') !== false\n })\n return {\n undoManager: _undoManager,\n prevSel: null,\n hasUndoOps: _undoManager.undoStack.length > 0,\n hasRedoOps: _undoManager.redoStack.length > 0\n }\n },\n apply: (tr, val, oldState, state) => {\n const binding = ySyncPluginKey.getState(state).binding\n const undoManager = val.undoManager\n const hasUndoOps = undoManager.undoStack.length > 0\n const hasRedoOps = undoManager.redoStack.length > 0\n if (binding) {\n return {\n undoManager,\n prevSel: getRelativeSelection(binding, oldState),\n hasUndoOps,\n hasRedoOps\n }\n } else {\n if (hasUndoOps !== val.hasUndoOps || hasRedoOps !== val.hasRedoOps) {\n return Object.assign({}, val, {\n hasUndoOps: undoManager.undoStack.length > 0,\n hasRedoOps: undoManager.redoStack.length > 0\n })\n } else { // nothing changed\n return val\n }\n }\n }\n },\n view: view => {\n const ystate = ySyncPluginKey.getState(view.state)\n const undoManager = yUndoPluginKey.getState(view.state).undoManager\n undoManager.on('stack-item-added', ({ stackItem }) => {\n const binding = ystate.binding\n if (binding) {\n stackItem.meta.set(binding, yUndoPluginKey.getState(view.state).prevSel)\n }\n })\n undoManager.on('stack-item-popped', ({ stackItem }) => {\n const binding = ystate.binding\n if (binding) {\n binding.beforeTransactionSelection = stackItem.meta.get(binding) || binding.beforeTransactionSelection\n }\n })\n return {\n destroy: () => {\n undoManager.destroy()\n }\n }\n }\n})\n","import { Extension } from '@tiptap/core';\nimport { Plugin, PluginKey } from '@tiptap/pm/state';\nimport { yUndoPluginKey, undo, redo, yUndoPlugin, ySyncPlugin, yXmlFragmentToProsemirrorJSON, ySyncPluginKey } from 'y-prosemirror';\n\n/**\n * This extension allows you to collaborate with others in real-time.\n * @see https://tiptap.dev/api/extensions/collaboration\n */\nconst Collaboration = Extension.create({\n name: 'collaboration',\n priority: 1000,\n addOptions() {\n return {\n document: null,\n field: 'default',\n fragment: null,\n };\n },\n addStorage() {\n return {\n isDisabled: false,\n };\n },\n onCreate() {\n if (this.editor.extensionManager.extensions.find(extension => extension.name === 'history')) {\n console.warn('[tiptap warn]: \"@tiptap/extension-collaboration\" comes with its own history support and is not compatible with \"@tiptap/extension-history\".');\n }\n },\n addCommands() {\n return {\n undo: () => ({ tr, state, dispatch }) => {\n tr.setMeta('preventDispatch', true);\n const undoManager = yUndoPluginKey.getState(state).undoManager;\n if (undoManager.undoStack.length === 0) {\n return false;\n }\n if (!dispatch) {\n return true;\n }\n return undo(state);\n },\n redo: () => ({ tr, state, dispatch }) => {\n tr.setMeta('preventDispatch', true);\n const undoManager = yUndoPluginKey.getState(state).undoManager;\n if (undoManager.redoStack.length === 0) {\n return false;\n }\n if (!dispatch) {\n return true;\n }\n return redo(state);\n },\n };\n },\n addKeyboardShortcuts() {\n return {\n 'Mod-z': () => this.editor.commands.undo(),\n 'Mod-y': () => this.editor.commands.redo(),\n 'Shift-Mod-z': () => this.editor.commands.redo(),\n };\n },\n addProseMirrorPlugins() {\n var _a;\n const fragment = this.options.fragment\n ? this.options.fragment\n : this.options.document.getXmlFragment(this.options.field);\n // Quick fix until there is an official implementation (thanks to @hamflx).\n // See https://github.com/yjs/y-prosemirror/issues/114 and https://github.com/yjs/y-prosemirror/issues/102\n const yUndoPluginInstance = yUndoPlugin(this.options.yUndoOptions);\n const originalUndoPluginView = yUndoPluginInstance.spec.view;\n yUndoPluginInstance.spec.view = (view) => {\n const { undoManager } = yUndoPluginKey.getState(view.state);\n if (undoManager.restore) {\n undoManager.restore();\n undoManager.restore = () => {\n // noop\n };\n }\n const viewRet = originalUndoPluginView ? originalUndoPluginView(view) : undefined;\n return {\n destroy: () => {\n const hasUndoManSelf = undoManager.trackedOrigins.has(undoManager);\n // eslint-disable-next-line no-underscore-dangle\n const observers = undoManager._observers;\n undoManager.restore = () => {\n if (hasUndoManSelf) {\n undoManager.trackedOrigins.add(undoManager);\n }\n undoManager.doc.on('afterTransaction', undoManager.afterTransactionHandler);\n // eslint-disable-next-line no-underscore-dangle\n undoManager._observers = observers;\n };\n if (viewRet === null || viewRet === void 0 ? void 0 : viewRet.destroy) {\n viewRet.destroy();\n }\n },\n };\n };\n const ySyncPluginOptions = {\n ...this.options.ySyncOptions,\n onFirstRender: this.options.onFirstRender,\n };\n const ySyncPluginInstance = ySyncPlugin(fragment, ySyncPluginOptions);\n if (this.editor.options.enableContentCheck) {\n (_a = fragment.doc) === null || _a === void 0 ? void 0 : _a.on('beforeTransaction', () => {\n try {\n const jsonContent = (yXmlFragmentToProsemirrorJSON(fragment));\n if (jsonContent.content.length === 0) {\n return;\n }\n this.editor.schema.nodeFromJSON(jsonContent).check();\n }\n catch (error) {\n this.editor.emit('contentError', {\n error: error,\n editor: this.editor,\n disableCollaboration: () => {\n var _a;\n (_a = fragment.doc) === null || _a === void 0 ? void 0 : _a.destroy();\n this.storage.isDisabled = true;\n },\n });\n // If the content is invalid, return false to prevent the transaction from being applied\n return false;\n }\n });\n }\n return [\n ySyncPluginInstance,\n yUndoPluginInstance,\n // Only add the filterInvalidContent plugin if content checking is enabled\n this.editor.options.enableContentCheck\n && new Plugin({\n key: new PluginKey('filterInvalidContent'),\n filterTransaction: () => {\n var _a;\n // When collaboration is disabled, prevent any sync transactions from being applied\n if (this.storage.isDisabled) {\n // Destroy the Yjs document to prevent any further sync transactions\n (_a = fragment.doc) === null || _a === void 0 ? void 0 : _a.destroy();\n return true;\n }\n return true;\n },\n }),\n ].filter(Boolean);\n },\n});\n\n/**\n * Checks if a transaction was originated from a Yjs change.\n * @param {Transaction} transaction - The transaction to check.\n * @returns {boolean} - True if the transaction was originated from a Yjs change, false otherwise.\n * @example\n * const transaction = new Transaction(doc)\n * const isOrigin = isChangeOrigin(transaction) // returns false\n */\nfunction isChangeOrigin(transaction) {\n return !!transaction.getMeta(ySyncPluginKey);\n}\n\nexport { Collaboration, Collaboration as default, isChangeOrigin };\n//# sourceMappingURL=index.js.map\n","/**\n * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\n/*\n * Handle the state of the full editor width toggle.\n *\n * If the css variable `--text-editor-max-width` is already set\n * for `document.body` it will be left as is and\n * no toggle will be shown in the text ui.\n * This way the collectives app handles it's per document width setting.\n *\n * Otherwise this composable handles the `is_full_width_editor` initial state.\n * It sets the css variable on the document accordingly.\n * The state is stored in a singleton to preserve and reuse it on the next mount.\n * It is persisted in the user settings across page reloads.\n *\n */\n\nimport axios from '@nextcloud/axios'\nimport { emit, subscribe } from '@nextcloud/event-bus'\nimport { loadState } from '@nextcloud/initial-state'\nimport { generateUrl } from '@nextcloud/router'\nimport {\n\tcomputed,\n\tinject,\n\tprovide,\n\treadonly,\n\tref,\n\twatch,\n\ttype InjectionKey,\n\ttype Ref,\n} from 'vue'\n\n// Keep the current value around when leaving the editor and reopening\nlet valueSingleton = loadState('text', 'is_full_width_editor', false)\n\n// This is either the reactive value of the editor width toggle\n// or null if the width has already been set outside of text.\nexport const editorWidthKey = Symbol('text:editor:width') as InjectionKey<\n\tReadonly<Ref<boolean> | null>\n>\n\n/**\n * Detect if other apps (such as collectives) already configured texts max width.\n *\n * Check if document.body has a css variable `--text-editor-max-width` (either set or inherited).\n * Get the value set by text in the documentElement style.\n * If both values are set and match we assume text is handling the width.\n */\nfunction maxWidthSetOutsideOfText() {\n\tconst alreadySet = getComputedStyle(document.body).getPropertyValue(\n\t\t'--text-editor-max-width',\n\t)\n\tconst setByText = document.documentElement.style.getPropertyValue(\n\t\t'--text-editor-max-width',\n\t)\n\treturn Boolean(alreadySet) && alreadySet !== setByText\n}\n\nexport const provideEditorWidth = () => {\n\t// keep style that is already set - for example by collectives\n\tif (maxWidthSetOutsideOfText()) {\n\t\tprovide(editorWidthKey, null)\n\t\treturn { applyEditorWidth: () => {} }\n\t}\n\tconst isFullWidth = ref(valueSingleton)\n\tprovide(editorWidthKey, readonly(isFullWidth))\n\tsubscribe('text:editor:full-width', ({ value }) => {\n\t\tvalueSingleton = value\n\t\tisFullWidth.value = value\n\t})\n\tconst width = computed(() => (isFullWidth.value ? '100%' : '80ch'))\n\tconst applyEditorWidth = () => {\n\t\tdocument.documentElement.style.setProperty(\n\t\t\t'--text-editor-max-width',\n\t\t\twidth.value,\n\t\t)\n\t}\n\twatch(width, applyEditorWidth)\n\treturn { applyEditorWidth }\n}\n\nexport const useEditorWidth = () => {\n\t// This will be null if the width is already configured outside of text.\n\tconst isFullWidth = inject(editorWidthKey)\n\tif (isFullWidth === null) {\n\t\treturn { canToggleWidth: false }\n\t}\n\tconst setFullWidth = (checked: boolean) => {\n\t\taxios.post(generateUrl('/apps/text/settings'), {\n\t\t\tkey: 'is_full_width_editor',\n\t\t\tvalue: checked ? '1' : '0',\n\t\t})\n\t\temit('text:editor:full-width', { value: checked })\n\t}\n\treturn { canToggleWidth: true, isFullWidth, setFullWidth }\n}\n","import { Extension } from '@tiptap/core';\nimport { SelectionRange, Selection, Plugin, PluginKey } from '@tiptap/pm/state';\nimport { DecorationSet, Decoration } from '@tiptap/pm/view';\nimport { NodeRange as NodeRange$1 } from '@tiptap/pm/model';\n\nfunction getNodeRangeDecorations(ranges) {\n if (!ranges.length) {\n return DecorationSet.empty;\n }\n const decorations = [];\n const doc = ranges[0].$from.node(0);\n ranges.forEach(range => {\n const pos = range.$from.pos;\n const node = range.$from.nodeAfter;\n if (!node) {\n return;\n }\n decorations.push(Decoration.node(pos, pos + node.nodeSize, {\n class: 'ProseMirror-selectednoderange',\n }));\n });\n return DecorationSet.create(doc, decorations);\n}\n\nfunction getSelectionRanges($from, $to, depth) {\n const ranges = [];\n const doc = $from.node(0);\n // eslint-disable-next-line\n depth = (typeof depth === 'number' && depth >= 0)\n ? depth\n : $from.sameParent($to)\n ? Math.max(0, $from.sharedDepth($to.pos) - 1)\n : $from.sharedDepth($to.pos);\n const nodeRange = new NodeRange$1($from, $to, depth);\n const offset = nodeRange.depth === 0\n ? 0\n : doc.resolve(nodeRange.start).posAtIndex(0);\n nodeRange.parent.forEach((node, pos) => {\n const from = offset + pos;\n const to = from + node.nodeSize;\n if (from < nodeRange.start || from >= nodeRange.end) {\n return;\n }\n const selectionRange = new SelectionRange(doc.resolve(from), doc.resolve(to));\n ranges.push(selectionRange);\n });\n return ranges;\n}\n\nclass NodeRangeBookmark {\n constructor(anchor, head) {\n this.anchor = anchor;\n this.head = head;\n }\n map(mapping) {\n return new NodeRangeBookmark(mapping.map(this.anchor), mapping.map(this.head));\n }\n resolve(doc) {\n const $anchor = doc.resolve(this.anchor);\n const $head = doc.resolve(this.head);\n return new NodeRangeSelection($anchor, $head);\n }\n}\n\nclass NodeRangeSelection extends Selection {\n constructor($anchor, $head, depth, bias = 1) {\n // if there is only a cursor we cant calculate a direction of the selection\n // thats why we adjust the head position by 1 in the desired direction\n const { doc } = $anchor;\n const isCursor = $anchor === $head;\n const isCursorAtEnd = $anchor.pos === doc.content.size && $head.pos === doc.content.size;\n const $correctedHead = isCursor && !isCursorAtEnd\n ? doc.resolve($head.pos + (bias > 0 ? 1 : -1))\n : $head;\n const $correctedAnchor = isCursor && isCursorAtEnd\n ? doc.resolve($anchor.pos - (bias > 0 ? 1 : -1))\n : $anchor;\n const ranges = getSelectionRanges($correctedAnchor.min($correctedHead), $correctedAnchor.max($correctedHead), depth);\n // get the smallest range start position\n // this will become the $anchor\n const $rangeFrom = ($correctedHead.pos >= $anchor.pos)\n ? ranges[0].$from\n : ranges[ranges.length - 1].$to;\n // get the biggest range end position\n // this will become the $head\n const $rangeTo = ($correctedHead.pos >= $anchor.pos)\n ? ranges[ranges.length - 1].$to\n : ranges[0].$from;\n super($rangeFrom, $rangeTo, ranges);\n this.depth = depth;\n }\n // we can safely ignore this TypeScript error: https://github.com/Microsoft/TypeScript/issues/338\n // @ts-ignore\n get $to() {\n return this.ranges[this.ranges.length - 1].$to;\n }\n eq(other) {\n return other instanceof NodeRangeSelection\n && other.$from.pos === this.$from.pos\n && other.$to.pos === this.$to.pos;\n }\n map(doc, mapping) {\n const $anchor = doc.resolve(mapping.map(this.anchor));\n const $head = doc.resolve(mapping.map(this.head));\n return new NodeRangeSelection($anchor, $head);\n }\n toJSON() {\n return {\n type: 'nodeRange',\n anchor: this.anchor,\n head: this.head,\n };\n }\n get isForwards() {\n return this.head >= this.anchor;\n }\n get isBackwards() {\n return !this.isForwards;\n }\n extendBackwards() {\n const { doc } = this.$from;\n if (this.isForwards && this.ranges.length > 1) {\n const ranges = this.ranges.slice(0, -1);\n const $from = ranges[0].$from;\n const $to = ranges[ranges.length - 1].$to;\n return new NodeRangeSelection($from, $to, this.depth);\n }\n const firstRange = this.ranges[0];\n const $from = doc.resolve(Math.max(0, firstRange.$from.pos - 1));\n return new NodeRangeSelection(this.$anchor, $from, this.depth);\n }\n extendForwards() {\n const { doc } = this.$from;\n if (this.isBackwards && this.ranges.length > 1) {\n const ranges = this.ranges.slice(1);\n const $from = ranges[0].$from;\n const $to = ranges[ranges.length - 1].$to;\n return new NodeRangeSelection($to, $from, this.depth);\n }\n const lastRange = this.ranges[this.ranges.length - 1];\n const $to = doc.resolve(Math.min(doc.content.size, lastRange.$to.pos + 1));\n return new NodeRangeSelection(this.$anchor, $to, this.depth);\n }\n static fromJSON(doc, json) {\n return new NodeRangeSelection(doc.resolve(json.anchor), doc.resolve(json.head));\n }\n static create(doc, anchor, head, depth, bias = 1) {\n return new this(doc.resolve(anchor), doc.resolve(head), depth, bias);\n }\n getBookmark() {\n return new NodeRangeBookmark(this.anchor, this.head);\n }\n}\nNodeRangeSelection.prototype.visible = false;\n\nfunction isNodeRangeSelection(value) {\n return value instanceof NodeRangeSelection;\n}\n\nconst NodeRange = Extension.create({\n name: 'nodeRange',\n addOptions() {\n return {\n depth: undefined,\n key: 'Mod',\n };\n },\n addKeyboardShortcuts() {\n return {\n // extend NodeRangeSelection upwards\n 'Shift-ArrowUp': ({ editor }) => {\n const { depth } = this.options;\n const { view, state } = editor;\n const { doc, selection, tr } = state;\n const { anchor, head } = selection;\n if (!isNodeRangeSelection(selection)) {\n const nodeRangeSelection = NodeRangeSelection.create(doc, anchor, head, depth, -1);\n tr.setSelection(nodeRangeSelection);\n view.dispatch(tr);\n return true;\n }\n const nodeRangeSelection = selection.extendBackwards();\n tr.setSelection(nodeRangeSelection);\n view.dispatch(tr);\n return true;\n },\n // extend NodeRangeSelection downwards\n 'Shift-ArrowDown': ({ editor }) => {\n const { depth } = this.options;\n const { view, state } = editor;\n const { doc, selection, tr } = state;\n const { anchor, head } = selection;\n if (!isNodeRangeSelection(selection)) {\n const nodeRangeSelection = NodeRangeSelection.create(doc, anchor, head, depth);\n tr.setSelection(nodeRangeSelection);\n view.dispatch(tr);\n return true;\n }\n const nodeRangeSelection = selection.extendForwards();\n tr.setSelection(nodeRangeSelection);\n view.dispatch(tr);\n return true;\n },\n // add `NodeRangeSelection` to all nodes\n 'Mod-a': ({ editor }) => {\n const { depth } = this.options;\n const { view, state } = editor;\n const { doc, tr } = state;\n const nodeRangeSelection = NodeRangeSelection.create(doc, 0, doc.content.size, depth);\n tr.setSelection(nodeRangeSelection);\n view.dispatch(tr);\n return true;\n },\n };\n },\n onSelectionUpdate() {\n const { selection } = this.editor.state;\n if (isNodeRangeSelection(selection)) {\n this.editor.view.dom.classList.add('ProseMirror-noderangeselection');\n }\n },\n addProseMirrorPlugins() {\n let hideTextSelection = false;\n let activeMouseSelection = false;\n return [\n new Plugin({\n key: new PluginKey('nodeRange'),\n props: {\n attributes: () => {\n if (hideTextSelection) {\n return {\n class: 'ProseMirror-noderangeselection',\n };\n }\n return { class: '' };\n },\n handleDOMEvents: {\n mousedown: (view, event) => {\n const { key } = this.options;\n const isMac = /Mac/.test(navigator.platform);\n const isShift = !!event.shiftKey;\n const isControl = !!event.ctrlKey;\n const isAlt = !!event.altKey;\n const isMeta = !!event.metaKey;\n const isMod = isMac\n ? isMeta\n : isControl;\n if (key === null\n || key === undefined\n || (key === 'Shift' && isShift)\n || (key === 'Control' && isControl)\n || (key === 'Alt' && isAlt)\n || (key === 'Meta' && isMeta)\n || (key === 'Mod' && isMod)) {\n activeMouseSelection = true;\n }\n if (!activeMouseSelection) {\n return false;\n }\n document.addEventListener('mouseup', () => {\n activeMouseSelection = false;\n const { state } = view;\n const { doc, selection, tr } = state;\n const { $anchor, $head } = selection;\n if ($anchor.sameParent($head)) {\n return;\n }\n const nodeRangeSelection = NodeRangeSelection.create(doc, $anchor.pos, $head.pos, this.options.depth);\n tr.setSelection(nodeRangeSelection);\n view.dispatch(tr);\n }, { once: true });\n return false;\n },\n },\n // when selecting some text we want to render some decorations\n // to preview a `NodeRangeSelection`\n decorations: state => {\n const { selection } = state;\n const isNodeRange = isNodeRangeSelection(selection);\n hideTextSelection = false;\n if (!activeMouseSelection) {\n if (!isNodeRange) {\n return null;\n }\n hideTextSelection = true;\n return getNodeRangeDecorations(selection.ranges);\n }\n const { $from, $to } = selection;\n // selection is probably in the same node like a paragraph\n // so we dont render decorations and show\n // a simple text selection instead\n if (!isNodeRange && $from.sameParent($to)) {\n return null;\n }\n // try to calculate some node ranges\n const nodeRanges = getSelectionRanges($from, $to, this.options.depth);\n if (!nodeRanges.length) {\n return null;\n }\n hideTextSelection = true;\n return getNodeRangeDecorations(nodeRanges);\n },\n },\n }),\n ];\n },\n});\n\nexport { NodeRange, NodeRangeSelection, NodeRange as default, getNodeRangeDecorations, getSelectionRanges, isNodeRangeSelection };\n//# sourceMappingURL=index.js.map\n","import { Extension } from '@tiptap/core';\nimport { isChangeOrigin } from '@tiptap/extension-collaboration';\nimport { PluginKey, Plugin } from '@tiptap/pm/state';\nimport tippy from 'tippy.js';\nimport { ySyncPluginKey, absolutePositionToRelativePosition, relativePositionToAbsolutePosition } from 'y-prosemirror';\nimport { getSelectionRanges, NodeRangeSelection } from '@tiptap/extension-node-range';\n\nfunction getCSSText(element) {\n let value = '';\n const style = getComputedStyle(element);\n for (let i = 0; i < style.length; i += 1) {\n value += `${style[i]}:${style.getPropertyValue(style[i])};`;\n }\n return value;\n}\nfunction cloneElement(node) {\n const clonedNode = node.cloneNode(true);\n const sourceElements = [node, ...Array.from(node.getElementsByTagName('*'))];\n const targetElements = [clonedNode, ...Array.from(clonedNode.getElementsByTagName('*'))];\n sourceElements.forEach((sourceElement, index) => {\n targetElements[index].style.cssText = getCSSText(sourceElement);\n });\n return clonedNode;\n}\n\nconst findElementNextToCoords = (options) => {\n const { x, y, direction, editor, } = options;\n let resultElement = null;\n let resultNode = null;\n let pos = null;\n let currentX = x;\n while (resultNode === null && currentX < window.innerWidth && currentX > 0) {\n const allElements = document.elementsFromPoint(currentX, y);\n const prosemirrorIndex = allElements.findIndex(element => element.classList.contains('ProseMirror'));\n const filteredElements = allElements.slice(0, prosemirrorIndex);\n if (filteredElements.length > 0) {\n const target = filteredElements[0];\n resultElement = target;\n pos = editor.view.posAtDOM(target, 0);\n if (pos >= 0) {\n resultNode = editor.state.doc.nodeAt(Math.max(pos - 1, 0));\n if (resultNode === null || resultNode === void 0 ? void 0 : resultNode.isText) {\n resultNode = editor.state.doc.nodeAt(Math.max(pos - 1, 0));\n }\n if (!resultNode) {\n resultNode = editor.state.doc.nodeAt(Math.max(pos, 0));\n }\n break;\n }\n }\n if (direction === 'left') {\n currentX -= 1;\n }\n else {\n currentX += 1;\n }\n }\n return { resultElement, resultNode, pos: pos !== null && pos !== void 0 ? pos : null };\n};\n\nfunction getComputedStyle$1(node, property) {\n const style = window.getComputedStyle(node);\n return style[property];\n}\n\nfunction minMax(value = 0, min = 0, max = 0) {\n return Math.min(Math.max(value, min), max);\n}\n\nfunction getInnerCoords(view, x, y) {\n const paddingLeft = parseInt(getComputedStyle$1(view.dom, 'paddingLeft'), 10);\n const paddingRight = parseInt(getComputedStyle$1(view.dom, 'paddingRight'), 10);\n const borderLeft = parseInt(getComputedStyle$1(view.dom, 'borderLeftWidth'), 10);\n const borderRight = parseInt(getComputedStyle$1(view.dom, 'borderLeftWidth'), 10);\n const bounds = view.dom.getBoundingClientRect();\n const coords = {\n left: minMax(x, bounds.left + paddingLeft + borderLeft, bounds.right - paddingRight - borderRight),\n top: y,\n };\n return coords;\n}\n\nfunction removeNode(node) {\n var _a;\n (_a = node.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(node);\n}\n\nfunction getDragHandleRanges(event, editor) {\n const { doc } = editor.view.state;\n const result = findElementNextToCoords({\n editor, x: event.clientX, y: event.clientY, direction: 'right',\n });\n if (!result.resultNode || result.pos === null) {\n return [];\n }\n const x = event.clientX;\n // @ts-ignore\n const coords = getInnerCoords(editor.view, x, event.clientY);\n const posAtCoords = editor.view.posAtCoords(coords);\n if (!posAtCoords) {\n return [];\n }\n const { pos } = posAtCoords;\n const nodeAt = doc.resolve(pos).parent;\n if (!nodeAt) {\n return [];\n }\n const $from = doc.resolve(result.pos);\n const $to = doc.resolve(result.pos + 1);\n return getSelectionRanges($from, $to, 0);\n}\nfunction dragHandler(event, editor) {\n const { view } = editor;\n if (!event.dataTransfer) {\n return;\n }\n const { empty, $from, $to } = view.state.selection;\n const dragHandleRanges = getDragHandleRanges(event, editor);\n const selectionRanges = getSelectionRanges($from, $to, 0);\n const isDragHandleWithinSelection = selectionRanges.some(range => {\n return dragHandleRanges.find(dragHandleRange => {\n return dragHandleRange.$from === range.$from\n && dragHandleRange.$to === range.$to;\n });\n });\n const ranges = empty || !isDragHandleWithinSelection\n ? dragHandleRanges\n : selectionRanges;\n if (!ranges.length) {\n return;\n }\n const { tr } = view.state;\n const wrapper = document.createElement('div');\n const from = ranges[0].$from.pos;\n const to = ranges[ranges.length - 1].$to.pos;\n const selection = NodeRangeSelection.create(view.state.doc, from, to);\n const slice = selection.content();\n ranges.forEach(range => {\n const element = view.nodeDOM(range.$from.pos);\n const clonedElement = cloneElement(element);\n wrapper.append(clonedElement);\n });\n wrapper.style.position = 'absolute';\n wrapper.style.top = '-10000px';\n document.body.append(wrapper);\n event.dataTransfer.clearData();\n event.dataTransfer.setDragImage(wrapper, 0, 0);\n // tell ProseMirror the dragged content\n view.dragging = { slice, move: true };\n tr.setSelection(selection);\n view.dispatch(tr);\n // clean up\n document.addEventListener('drop', () => removeNode(wrapper), { once: true });\n}\n\nconst getOuterNodePos = (doc, pos) => {\n const resolvedPos = doc.resolve(pos);\n const { depth } = resolvedPos;\n if (depth === 0) {\n return pos;\n }\n const a = resolvedPos.pos - resolvedPos.parentOffset;\n return a - 1;\n};\nconst getOuterNode = (doc, pos) => {\n const node = doc.nodeAt(pos);\n const resolvedPos = doc.resolve(pos);\n let { depth } = resolvedPos;\n let parent = node;\n while (depth > 0) {\n const currentNode = resolvedPos.node(depth);\n depth -= 1;\n if (depth === 0) {\n parent = currentNode;\n }\n }\n return parent;\n};\n\nconst getRelativePos = (state, absolutePos) => {\n const ystate = ySyncPluginKey.getState(state);\n if (!ystate) {\n return null;\n }\n return absolutePositionToRelativePosition(absolutePos, ystate.type, ystate.binding.mapping);\n};\nconst getAbsolutePos = (state, relativePos) => {\n const ystate = ySyncPluginKey.getState(state);\n if (!ystate) {\n return -1;\n }\n return (relativePositionToAbsolutePosition(ystate.doc, ystate.type, relativePos, ystate.binding.mapping) || 0);\n};\nconst getOuterDomNode = (view, domNode) => {\n let tmpDomNode = domNode;\n // Traverse to top level node.\n while (tmpDomNode && tmpDomNode.parentNode) {\n if (tmpDomNode.parentNode === view.dom) {\n break;\n }\n tmpDomNode = tmpDomNode.parentNode;\n }\n return tmpDomNode;\n};\nconst dragHandlePluginDefaultKey = new PluginKey('dragHandle');\nconst DragHandlePlugin = ({ pluginKey = dragHandlePluginDefaultKey, element, editor, tippyOptions, onNodeChange, }) => {\n const wrapper = document.createElement('div');\n let popup = null;\n let locked = false;\n let currentNode = null;\n let currentNodePos = -1;\n let currentNodeRelPos;\n element.addEventListener('dragstart', e => {\n // Push this to the end of the event cue\n // Fixes bug where incorrect drag pos is returned if drag handle has position: absolute\n // @ts-ignore\n dragHandler(e, editor);\n setTimeout(() => {\n if (element) {\n element.style.pointerEvents = 'none';\n }\n }, 0);\n });\n element.addEventListener('dragend', () => {\n if (element) {\n element.style.pointerEvents = 'auto';\n }\n });\n return new Plugin({\n key: typeof pluginKey === 'string' ? new PluginKey(pluginKey) : pluginKey,\n state: {\n init() {\n return { locked: false };\n },\n apply(tr, value, oldState, state) {\n const isLocked = tr.getMeta('lockDragHandle');\n const hideDragHandle = tr.getMeta('hideDragHandle');\n if (isLocked !== undefined) {\n locked = isLocked;\n }\n if (hideDragHandle && popup) {\n popup.hide();\n locked = false;\n currentNode = null;\n currentNodePos = -1;\n onNodeChange === null || onNodeChange === void 0 ? void 0 : onNodeChange({ editor, node: null, pos: -1 });\n return value;\n }\n // Something has changed and drag handler is visible…\n if (tr.docChanged && currentNodePos !== -1 && element && popup) {\n // Yjs replaces the entire document on every incoming change and needs a special handling.\n // If change comes from another user …\n if (isChangeOrigin(tr)) {\n // https://discuss.yjs.dev/t/y-prosemirror-mapping-a-single-relative-position-when-doc-changes/851/3\n const newPos = getAbsolutePos(state, currentNodeRelPos);\n if (newPos !== currentNodePos) {\n // Set the new position for our current node.\n currentNodePos = newPos;\n // We will get the outer node with data and position in views update method.\n }\n }\n else {\n // … otherwise use ProseMirror mapping to update the position.\n const newPos = tr.mapping.map(currentNodePos);\n if (newPos !== currentNodePos) {\n // TODO: Remove\n // console.log('Position has changed …', { old: currentNodePos, new: newPos }, tr);\n // Set the new position for our current node.\n currentNodePos = newPos;\n // Memorize relative position to retrieve absolute position in case of collaboration\n currentNodeRelPos = getRelativePos(state, currentNodePos);\n // We will get the outer node with data and position in views update method.\n }\n }\n }\n return value;\n },\n },\n view: view => {\n var _a;\n element.draggable = true;\n element.style.pointerEvents = 'auto';\n (_a = editor.view.dom.parentElement) === null || _a === void 0 ? void 0 : _a.appendChild(wrapper);\n wrapper.appendChild(element);\n wrapper.style.pointerEvents = 'none';\n wrapper.style.position = 'absolute';\n wrapper.style.top = '0';\n wrapper.style.left = '0';\n return {\n update(_, oldState) {\n if (!element) {\n return;\n }\n if (!editor.isEditable) {\n popup === null || popup === void 0 ? void 0 : popup.destroy();\n popup = null;\n return;\n }\n if (!popup) {\n popup = tippy(view.dom, {\n getReferenceClientRect: null,\n interactive: true,\n trigger: 'manual',\n placement: 'left-start',\n hideOnClick: false,\n duration: 100,\n popperOptions: {\n modifiers: [\n { name: 'flip', enabled: false },\n {\n name: 'preventOverflow',\n options: {\n rootBoundary: 'document',\n mainAxis: false,\n },\n },\n ],\n },\n ...tippyOptions,\n appendTo: wrapper,\n content: element,\n });\n }\n // Prevent element being draggend while being open.\n if (locked) {\n element.draggable = false;\n }\n else {\n element.draggable = true;\n }\n // Do not close on updates (e.g. changing padding of a section or collaboration events)\n // popup?.hide();\n // Recalculate popup position if doc has changend and drag handler is visible.\n if (view.state.doc.eq(oldState.doc) || currentNodePos === -1) {\n return;\n }\n // Get domNode from (new) position.\n let domNode = view.nodeDOM(currentNodePos);\n // Since old element could have been wrapped, we need to find\n // the outer node and take its position and node data.\n domNode = getOuterDomNode(view, domNode);\n // Skip if domNode is editor dom.\n if (domNode === view.dom) {\n return;\n }\n // We only want `Element`.\n if ((domNode === null || domNode === void 0 ? void 0 : domNode.nodeType) !== 1) {\n return;\n }\n const domNodePos = view.posAtDOM(domNode, 0);\n const outerNode = getOuterNode(editor.state.doc, domNodePos);\n const outerNodePos = getOuterNodePos(editor.state.doc, domNodePos); // TODO: needed?\n currentNode = outerNode;\n currentNodePos = outerNodePos;\n // Memorize relative position to retrieve absolute position in case of collaboration\n currentNodeRelPos = getRelativePos(view.state, currentNodePos);\n // TODO: Remove\n // console.log('View has updated: callback with new data and repositioning of popup …', {\n // domNode,\n // currentNodePos,\n // currentNode,\n // rect: (domNode as Element).getBoundingClientRect(),\n // });\n onNodeChange === null || onNodeChange === void 0 ? void 0 : onNodeChange({ editor, node: currentNode, pos: currentNodePos });\n // Update Tippys getReferenceClientRect since domNode might have changed.\n popup.setProps({\n getReferenceClientRect: () => domNode.getBoundingClientRect(),\n });\n },\n // TODO: Kills even on hot reload\n destroy() {\n popup === null || popup === void 0 ? void 0 : popup.destroy();\n if (element) {\n removeNode(wrapper);\n }\n },\n };\n },\n props: {\n handleDOMEvents: {\n keydown(view) {\n if (popup && popup.state.isVisible && view.hasFocus()) {\n popup.hide();\n return false;\n }\n return false;\n },\n mouseleave(_view, e) {\n // Do not hide open popup on mouseleave.\n if (locked) {\n return false;\n }\n // If e.target is not inside the wrapper, hide.\n if (e.target && !wrapper.contains(e.relatedTarget)) {\n popup === null || popup === void 0 ? void 0 : popup.hide();\n currentNode = null;\n currentNodePos = -1;\n onNodeChange === null || onNodeChange === void 0 ? void 0 : onNodeChange({ editor, node: null, pos: -1 });\n }\n return false;\n },\n mousemove(view, e) {\n // Do not continue if popup is not initialized or open.\n if (!element || !popup || locked) {\n return false;\n }\n const nodeData = findElementNextToCoords({\n x: e.clientX,\n y: e.clientY,\n direction: 'right',\n editor,\n });\n // Skip if there is no node next to coords\n if (!nodeData.resultElement) {\n return false;\n }\n let domNode = nodeData.resultElement;\n domNode = getOuterDomNode(view, domNode);\n // Skip if domNode is editor dom.\n if (domNode === view.dom) {\n return false;\n }\n // We only want `Element`.\n if ((domNode === null || domNode === void 0 ? void 0 : domNode.nodeType) !== 1) {\n return false;\n }\n const domNodePos = view.posAtDOM(domNode, 0);\n const outerNode = getOuterNode(editor.state.doc, domNodePos);\n if (outerNode !== currentNode) {\n const outerNodePos = getOuterNodePos(editor.state.doc, domNodePos);\n currentNode = outerNode;\n currentNodePos = outerNodePos;\n // Memorize relative position to retrieve absolute position in case of collaboration\n currentNodeRelPos = getRelativePos(view.state, currentNodePos);\n // TODO: Remove\n // console.log('Mousemove with changed node / node data …', {\n // domNode,\n // currentNodePos,\n // currentNode,\n // rect: (domNode as Element).getBoundingClientRect(),\n // });\n onNodeChange === null || onNodeChange === void 0 ? void 0 : onNodeChange({ editor, node: currentNode, pos: currentNodePos });\n // Set nodes clientRect.\n popup.setProps({\n getReferenceClientRect: () => domNode.getBoundingClientRect(),\n });\n popup.show();\n }\n return false;\n },\n },\n },\n });\n};\n\nconst DragHandle = Extension.create({\n name: 'dragHandle',\n addOptions() {\n return {\n render() {\n const element = document.createElement('div');\n element.classList.add('drag-handle');\n return element;\n },\n tippyOptions: {},\n locked: false,\n onNodeChange: () => { return null; },\n };\n },\n addCommands() {\n return {\n lockDragHandle: () => ({ editor }) => {\n this.options.locked = true;\n return editor.commands.setMeta('lockDragHandle', this.options.locked);\n },\n unlockDragHandle: () => ({ editor }) => {\n this.options.locked = false;\n return editor.commands.setMeta('lockDragHandle', this.options.locked);\n },\n toggleDragHandle: () => ({ editor }) => {\n this.options.locked = !this.options.locked;\n return editor.commands.setMeta('lockDragHandle', this.options.locked);\n },\n };\n },\n addProseMirrorPlugins() {\n const element = this.options.render();\n return [\n DragHandlePlugin({\n tippyOptions: this.options.tippyOptions,\n element,\n editor: this.editor,\n onNodeChange: this.options.onNodeChange,\n }),\n ];\n },\n});\n\nexport { DragHandle, DragHandlePlugin, DragHandle as default, dragHandlePluginDefaultKey };\n//# sourceMappingURL=index.js.map\n","import { dragHandlePluginDefaultKey, DragHandlePlugin } from '@tiptap/extension-drag-handle';\nimport Vue from 'vue';\n\nconst DragHandle = Vue.extend({\n name: 'DragHandleVue',\n props: {\n pluginKey: {\n type: [String, Object],\n default: () => dragHandlePluginDefaultKey,\n },\n editor: {\n type: Object,\n required: true,\n },\n tippyOptions: {\n type: Object,\n default: () => ({}),\n },\n onNodeChange: {\n type: Function,\n default: null,\n },\n class: {\n type: String,\n default: 'drag-handle',\n },\n },\n mounted() {\n const { editor, pluginKey, onNodeChange, tippyOptions, } = this.$props;\n editor.registerPlugin(DragHandlePlugin({\n editor,\n element: this.$el,\n pluginKey,\n tippyOptions,\n onNodeChange,\n }));\n },\n // eslint-disable-next-line vue/no-deprecated-destroyed-lifecycle\n beforeDestroy() {\n const { pluginKey, editor } = this.$props;\n editor.unregisterPlugin(pluginKey);\n },\n render(h) {\n return h('div', {\n class: this.class,\n }, this.$slots.default);\n },\n});\n\nexport { DragHandle, DragHandle as default };\n//# sourceMappingURL=index.js.map\n","<template>\n <span v-bind=\"$attrs\"\n :aria-hidden=\"title ? null : 'true'\"\n :aria-label=\"title\"\n class=\"material-design-icon drag-vertical-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=\"M9,3H11V5H9V3M13,3H15V5H13V3M9,7H11V9H9V7M13,7H15V9H13V7M9,11H11V13H9V11M13,11H15V13H13V11M9,15H11V17H9V15M13,15H15V17H13V15M9,19H11V21H9V19M13,19H15V21H13V19Z\">\n <title v-if=\"title\">{{ title }}</title>\n </path>\n </svg>\n </span>\n</template>\n\n<script>\nexport default {\n name: \"DragVerticalIcon\",\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: 2025 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<DragHandle\n\t\t:editor=\"editor\"\n\t\tclass=\"floating-buttons\"\n\t\t:class=\"{ heading: isHeadingNode }\"\n\t\t:on-node-change=\"onNodeChange\">\n\t\t<NcButton\n\t\t\ttype=\"tertiary-no-background\"\n\t\t\tsize=\"small\"\n\t\t\t:title=\"t('text', 'Insert below')\"\n\t\t\t:aria-label=\"t('text', 'Insert below')\"\n\t\t\t@click=\"onOpenSmartPicker\">\n\t\t\t<template #icon>\n\t\t\t\t<PlusIcon :size=\"16\" />\n\t\t\t</template>\n\t\t</NcButton>\n\t\t<NcButton\n\t\t\ttype=\"tertiary-no-background\"\n\t\t\tsize=\"small\"\n\t\t\tclass=\"drag-button\"\n\t\t\t:title=\"t('text', 'Click for options, hold to drag')\"\n\t\t\t:aria-label=\"t('text', 'Click for options, hold to drag')\">\n\t\t\t<template #icon>\n\t\t\t\t<DragVerticalIcon :size=\"16\" />\n\t\t\t</template>\n\t\t</NcButton>\n\t</DragHandle>\n</template>\n\n<script>\nimport { t } from '@nextcloud/l10n'\nimport NcButton from '@nextcloud/vue/components/NcButton'\nimport { DragHandle } from '@tiptap/extension-drag-handle-vue-2'\nimport DragVerticalIcon from 'vue-material-design-icons/DragVertical.vue'\nimport PlusIcon from 'vue-material-design-icons/Plus.vue'\nimport { useEditor } from '../../composables/useEditor.ts'\n\nexport default {\n\tname: 'FloatingButtons',\n\n\tcomponents: {\n\t\tDragHandle,\n\t\tDragVerticalIcon,\n\t\tNcButton,\n\t\tPlusIcon,\n\t},\n\n\tsetup() {\n\t\tconst { editor } = useEditor()\n\t\treturn { editor }\n\t},\n\n\tdata() {\n\t\treturn {\n\t\t\tnode: null,\n\t\t\tpos: -1,\n\t\t}\n\t},\n\n\tcomputed: {\n\t\tisHeadingNode() {\n\t\t\treturn this.node?.type === this.editor.schema.nodes.heading\n\t\t},\n\t},\n\n\tmethods: {\n\t\tonNodeChange({ node, pos }) {\n\t\t\tthis.node = node\n\t\t\tthis.pos = pos\n\t\t},\n\t\tonOpenSmartPicker() {\n\t\t\tif (!this.node || this.pos === -1) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\t// Node has no children or just text children and no text content\n\t\t\tconst { schema } = this.editor\n\t\t\tconst emptyNode =\n\t\t\t\tthis.node.textContent.trim() === ''\n\t\t\t\t&& (this.node.children.length === 0\n\t\t\t\t\t|| this.node.children.every((n) => n.type === schema.nodes.text))\n\n\t\t\t// Insert at the end of the node\n\t\t\tconst pos = emptyNode ? this.pos + 1 : this.pos + this.node.nodeSize\n\t\t\tthis.editor.chain().insertContentAt(pos, '/').focus().run()\n\t\t},\n\t\tt,\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n.floating-buttons {\n\tdisplay: flex;\n\n\t&.heading {\n\t\tmargin-right: 16px;\n\t}\n}\n\n.drag-button {\n\tcursor: grab;\n\n\t:deep(span),\n\t:deep(svg) {\n\t\tcursor: grab !important;\n\t}\n}\n</style>\n","<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<div\n\t\tdata-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<slot />\n\t\t<FloatingButtons v-if=\"showFloatingButtons\" />\n\t\t<EditorContent\n\t\t\trole=\"document\"\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 { useIsMobile } from '@nextcloud/vue/composables/useIsMobile'\nimport { EditorContent } from '@tiptap/vue-2'\nimport { useEditor } from '../../composables/useEditor.ts'\nimport { useEditorFlags } from '../../composables/useEditorFlags.ts'\nimport { useEditorWidth } from '../../composables/useEditorWidth.ts'\nimport EditorOutline from './EditorOutline.vue'\nimport FloatingButtons from './FloatingButtons.vue'\nimport { useOutlineStateMixin } from './Wrapper.provider.js'\n\nexport default {\n\tname: 'ContentContainer',\n\tcomponents: {\n\t\tEditorContent,\n\t\tEditorOutline,\n\t\tFloatingButtons,\n\t},\n\tmixins: [useOutlineStateMixin],\n\tprops: {\n\t\treadOnly: {\n\t\t\ttype: Boolean,\n\t\t\trequired: true,\n\t\t},\n\t},\n\tsetup() {\n\t\tconst isMobile = useIsMobile()\n\t\tconst { editor } = useEditor()\n\t\tconst { isRichEditor, isRichWorkspace } = useEditorFlags()\n\t\tconst { isFullWidth } = useEditorWidth()\n\t\treturn { editor, isMobile, isFullWidth, isRichEditor, isRichWorkspace }\n\t},\n\tcomputed: {\n\t\tshowOutline() {\n\t\t\treturn this.$outlineState.visible\n\t\t},\n\t\tshowFloatingButtons() {\n\t\t\treturn (\n\t\t\t\t!this.readOnly\n\t\t\t\t&& !this.isMobile\n\t\t\t\t&& !this.isFullWidth\n\t\t\t\t&& this.isRichEditor\n\t\t\t\t&& !this.isRichWorkspace\n\t\t\t)\n\t\t},\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n.editor__content {\n\tmax-width: min(var(--text-editor-max-width), calc(100vw - 16px));\n\tmargin: 0 auto;\n\tposition: relative;\n\twidth: 100%;\n\t:deep([contenteditable]) {\n\t\t// drop off obsolete server styles\n\t\tmargin: 0 !important;\n\t}\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\toverflow: auto;\n\tflex: 1;\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\n.is-rich-workspace {\n\t.text-editor__content-wrapper {\n\t\t--side-width: var(--text-editor-max-width);\n\t\tgrid-template-columns: var(--side-width) auto;\n\t\t.text-editor__content-wrapper__left,\n\t\t.text-editor__content-wrapper__right {\n\t\t\tdisplay: none;\n\t\t}\n\t}\n}\n</style>\n","/**\n * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors\n * SPDX-License-Identifier: AGPL-3.0-or-later\n */\n\nimport axios from '@nextcloud/axios'\nimport { generateUrl } from '@nextcloud/router'\nimport { unref, type ShallowRef } from 'vue'\nimport type { Connection } from '../composables/useConnection.js'\n\n/**\n * Upload an attachment to the server.\n * @param connection the active connection.\n * @param file upload this file.\n */\nexport function uploadAttachment(\n\tconnection: ShallowRef<Connection> | Connection,\n\tfile: string | Blob,\n) {\n\tconst {\n\t\tdocumentId,\n\t\tsessionId,\n\t\tsessionToken,\n\t\tshareToken: token,\n\t} = unref(connection)\n\tconst formData = new FormData()\n\tformData.append('file', file)\n\tconst url = generateUrl(`apps/text/attachment/upload?`)\n\treturn axios.post(url, formData, {\n\t\theaders: { 'Content-Type': 'multipart/form-data' },\n\t\tparams: { documentId, sessionId, sessionToken, token },\n\t})\n}\n\n/**\n * Create a new attachment based on the given template\n * @param connection the active connection\n * @param template create the attachment based on this\n * @param template.app app to create the attachment with\n * @param template.extension extension to use\n */\nexport function createAttachment(\n\tconnection: ShallowRef<Connection> | Connection,\n\ttemplate: { app: string; extension: string },\n) {\n\tconst { documentId, sessionId, sessionToken } = unref(connection)\n\tconst url = generateUrl(`apps/text/attachment/create`)\n\treturn axios.post(url, {\n\t\tdocumentId,\n\t\tsessionId,\n\t\tsessionToken,\n\t\tfileName: `${template.app}${template.extension}`,\n\t})\n}\n\n/**\n * Create a new attachment based on the given template\n * @param connection the active connection\n * @param filePath path to the file on the server.\n */\nexport function insertAttachmentFile(\n\tconnection: ShallowRef<Connection> | Connection,\n\tfilePath: string,\n) {\n\tconst { documentId, sessionId, sessionToken } = unref(connection)\n\tconst url = generateUrl(`apps/text/attachment/filepath`)\n\treturn axios.post(url, {\n\t\tdocumentId,\n\t\tsessionId,\n\t\tsessionToken,\n\t\tfilePath,\n\t})\n}\n","<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<div\n\t\tclass=\"editor editor-media-handler\"\n\t\tdata-text-el=\"editor-media-handler\"\n\t\t:class=\"{ draggedOver, 'is-mobile': isMobile }\"\n\t\t@image-paste=\"onPaste\"\n\t\t@dragover.prevent.stop=\"setDraggedOver(true, $event)\"\n\t\t@dragleave.prevent.stop=\"setDraggedOver(false, $event)\"\n\t\t@drop.prevent.stop=\"setDraggedOver(false, $event)\"\n\t\t@file-drop=\"onEditorDrop\">\n\t\t<input\n\t\t\tv-show=\"false\"\n\t\t\tref=\"attachmentFileInput\"\n\t\t\tdata-text-el=\"attachment-file-input\"\n\t\t\ttype=\"file\"\n\t\t\taccept=\"*/*\"\n\t\t\tmultiple\n\t\t\t@change=\"onAttachmentUploadFilePicked\" />\n\t\t<slot />\n\t</div>\n</template>\n\n<script>\nimport { getCurrentUser } from '@nextcloud/auth'\nimport { showError } from '@nextcloud/dialogs'\nimport { emit } from '@nextcloud/event-bus'\nimport { generateUrl } from '@nextcloud/router'\nimport { useIsMobile } from '@nextcloud/vue/composables/useIsMobile'\nimport {\n\tcreateAttachment,\n\tinsertAttachmentFile,\n\tuploadAttachment,\n} from '../../apis/attach.ts'\nimport { logger } from '../../helpers/logger.js'\n\nimport { useEditor } from '../../composables/useEditor.ts'\nimport { useFileMixin } from '../Editor.provider.ts'\n\nimport { useConnection } from '../../composables/useConnection.ts'\nimport {\n\tACTION_ATTACHMENT_PROMPT,\n\tACTION_CHOOSE_LOCAL_ATTACHMENT,\n\tACTION_CREATE_ATTACHMENT,\n\tSTATE_UPLOADING,\n} from './MediaHandler.provider.js'\n\nconst getDir = (val) => val.split('/').slice(0, -1).join('/')\n\nexport default {\n\tname: 'MediaHandler',\n\tmixins: [useFileMixin],\n\tprovide() {\n\t\tconst val = {}\n\n\t\tObject.defineProperties(val, {\n\t\t\t[ACTION_ATTACHMENT_PROMPT]: {\n\t\t\t\tget: () => this.showAttachmentPrompt,\n\t\t\t},\n\t\t\t[ACTION_CHOOSE_LOCAL_ATTACHMENT]: {\n\t\t\t\tget: () => this.chooseLocalFile,\n\t\t\t},\n\t\t\t[ACTION_CREATE_ATTACHMENT]: {\n\t\t\t\tget: () => this.createAttachment,\n\t\t\t},\n\t\t\t[STATE_UPLOADING]: {\n\t\t\t\tget: () => this.state,\n\t\t\t},\n\t\t})\n\n\t\treturn val\n\t},\n\tsetup() {\n\t\tconst { connection } = useConnection()\n\t\tconst isMobile = useIsMobile()\n\t\tconst { editor } = useEditor()\n\t\treturn {\n\t\t\tconnection,\n\t\t\teditor,\n\t\t\tisMobile,\n\t\t}\n\t},\n\tdata() {\n\t\treturn {\n\t\t\tlastFilePath: null,\n\t\t\tdraggedOver: false,\n\t\t\t// make it reactive to be used inject/provide\n\t\t\tstate: {\n\t\t\t\tisUploadingAttachments: false,\n\t\t\t},\n\t\t}\n\t},\n\tcomputed: {\n\t\tinitialFilePath() {\n\t\t\treturn this.lastFilePath ?? getDir(this.$file?.relativePath ?? '/')\n\t\t},\n\t},\n\tmethods: {\n\t\tsetDraggedOver(val, event) {\n\t\t\tif (event.dataTransfer.types.includes('Files')) {\n\t\t\t\tthis.draggedOver = val\n\t\t\t}\n\t\t},\n\t\tonPaste(e) {\n\t\t\tthis.uploadAttachmentFiles(e.detail.files)\n\t\t},\n\t\tonEditorDrop(e) {\n\t\t\tthis.uploadAttachmentFiles(e.detail.files, e.detail.position)\n\t\t},\n\t\tonAttachmentUploadFilePicked(event) {\n\t\t\tthis.uploadAttachmentFiles(event.target.files)\n\t\t\t// Clear input to ensure that the change event will be emitted if\n\t\t\t// the same file is picked again.\n\t\t\tevent.target.value = ''\n\t\t},\n\t\tchooseLocalFile() {\n\t\t\tthis.$refs.attachmentFileInput.click()\n\t\t},\n\t\tasync uploadAttachmentFiles(files, position = null) {\n\t\t\tif (!files) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tthis.state.isUploadingAttachments = true\n\n\t\t\tconst uploadPromises = [...files].map((file) => {\n\t\t\t\treturn this.uploadAttachmentFile(file, position)\n\t\t\t})\n\n\t\t\treturn Promise.all(uploadPromises)\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tlogger.error('Uploading multiple attachments failed', { error })\n\t\t\t\t\tshowError(t('text', 'Uploading multiple attachments failed.'))\n\t\t\t\t})\n\t\t\t\t.then(() => {\n\t\t\t\t\tthis.state.isUploadingAttachments = false\n\t\t\t\t})\n\t\t},\n\t\tasync uploadAttachmentFile(file, position = null) {\n\t\t\tthis.state.isUploadingAttachments = true\n\n\t\t\treturn uploadAttachment(this.connection, file)\n\t\t\t\t.then((response) => {\n\t\t\t\t\tthis.insertAttachment(\n\t\t\t\t\t\tresponse.data?.name,\n\t\t\t\t\t\tresponse.data?.id,\n\t\t\t\t\t\tfile.type,\n\t\t\t\t\t\tposition,\n\t\t\t\t\t\tresponse.data?.dirname,\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tlogger.error('Uploading attachment failed', { error })\n\t\t\t\t\tif (error.response?.data.error) {\n\t\t\t\t\t\tshowError(\n\t\t\t\t\t\t\tt('text', 'Uploading attachment failed: {error}', {\n\t\t\t\t\t\t\t\terror: error.response.data.error,\n\t\t\t\t\t\t\t}),\n\t\t\t\t\t\t)\n\t\t\t\t\t} else {\n\t\t\t\t\t\tshowError(t('text', 'Uploading attachment failed.'))\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t\t.then(() => {\n\t\t\t\t\tthis.state.isUploadingAttachments = false\n\t\t\t\t})\n\t\t},\n\t\tshowAttachmentPrompt() {\n\t\t\tconst currentUser = getCurrentUser()\n\t\t\tif (!currentUser) {\n\t\t\t\treturn\n\t\t\t}\n\n\t\t\tOC.dialogs.filepicker(\n\t\t\t\tt('text', 'Insert an attachment'),\n\t\t\t\t(filePath) => {\n\t\t\t\t\tthis.insertFromPath(filePath)\n\t\t\t\t},\n\t\t\t\tfalse,\n\t\t\t\t[],\n\t\t\t\ttrue,\n\t\t\t\tundefined,\n\t\t\t\tthis.initialFilePath,\n\t\t\t)\n\t\t},\n\t\tinsertFromPath(filePath) {\n\t\t\tthis.lastFilePath = getDir(filePath)\n\n\t\t\tthis.state.isUploadingAttachments = true\n\n\t\t\treturn insertAttachmentFile(this.connection, filePath)\n\t\t\t\t.then((response) => {\n\t\t\t\t\tthis.insertAttachment(\n\t\t\t\t\t\tresponse.data?.name,\n\t\t\t\t\t\tresponse.data?.id,\n\t\t\t\t\t\tresponse.data?.mimetype,\n\t\t\t\t\t\tnull,\n\t\t\t\t\t\tresponse.data?.dirname,\n\t\t\t\t\t)\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tlogger.error('Failed to insert from Files', { error })\n\t\t\t\t\tshowError(t('text', 'Failed to insert from Files'))\n\t\t\t\t})\n\t\t\t\t.then(() => {\n\t\t\t\t\tthis.state.isUploadingAttachments = false\n\t\t\t\t})\n\t\t},\n\t\tcreateAttachment(template) {\n\t\t\tthis.state.isUploadingAttachments = true\n\t\t\treturn createAttachment(this.connection, template)\n\t\t\t\t.then((response) => {\n\t\t\t\t\tthis.insertAttachmentPreview(response.data?.id)\n\t\t\t\t})\n\t\t\t\t.catch((error) => {\n\t\t\t\t\tlogger.error('Failed to create attachment', { error })\n\t\t\t\t\tshowError(t('text', 'Failed to create attachment'))\n\t\t\t\t})\n\t\t\t\t.then(() => {\n\t\t\t\t\tthis.state.isUploadingAttachments = false\n\t\t\t\t})\n\t\t},\n\t\tinsertAttachmentPreview(fileId) {\n\t\t\tconst url = new URL(generateUrl(`/f/${fileId}`), window.origin)\n\t\t\tconst href = url.href.replaceAll(' ', '%20')\n\t\t\tthis.editor.chain().focus().insertPreview(href).run()\n\t\t},\n\t\tinsertAttachment(name, fileId, mimeType, position = null, dirname = '') {\n\t\t\t// inspired by the fixedEncodeURIComponent function suggested in\n\t\t\t// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent\n\t\t\tconst src =\n\t\t\t\tdirname\n\t\t\t\t+ '/'\n\t\t\t\t+ encodeURIComponent(name).replace(/[!'()*]/g, (c) => {\n\t\t\t\t\treturn '%' + c.charCodeAt(0).toString(16).toUpperCase()\n\t\t\t\t})\n\t\t\t// simply get rid of brackets to make sure link text is valid\n\t\t\t// as it does not need to be unique and matching the real file name\n\t\t\tconst alt = name.replaceAll(/[[\\]]/g, '')\n\n\t\t\tconst chain = position\n\t\t\t\t? this.editor.chain().focus(position)\n\t\t\t\t: this.editor.chain()\n\n\t\t\tchain.setImage({ src, alt }).run()\n\n\t\t\tconst selection = this.editor.view.state.selection\n\t\t\tif (!selection.empty) {\n\t\t\t\t// If inserted image is first element, it is selected and would get overwritten by\n\t\t\t\t// subsequent editor inserts (see tiptap#3355). So unselect the image by placing\n\t\t\t\t// the cursor at the end of the selection.\n\t\t\t\tthis.editor.commands.focus(selection.to)\n\t\t\t}\n\n\t\t\t// Scroll image into view\n\t\t\tthis.editor.commands.scrollIntoView()\n\n\t\t\t// Store last inserted attachment src to focus it in ImageView.vue\n\t\t\tthis.editor.commands.setMeta('insertedAttachmentSrc', { src })\n\n\t\t\temit('text:image-node:add', null)\n\t\t},\n\t},\n}\n</script>\n","<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<div class=\"editor\">\n\t\t<MediaHandler v-if=\"$editorUpload\" class=\"text-editor__main\">\n\t\t\t<slot />\n\t\t</MediaHandler>\n\t\t<slot v-else />\n\t</div>\n</template>\n\n<script>\nimport { useEditorUpload } from '../Editor.provider.ts'\nimport MediaHandler from './MediaHandler.vue'\n\nexport default {\n\tname: 'MainContainer',\n\tcomponents: {\n\t\tMediaHandler,\n\t},\n\tmixins: [useEditorUpload],\n}\n</script>\n\n<style scoped lang=\"scss\">\n.text-editor__main,\n.editor {\n\tdisplay: flex;\n\tflex-direction: column;\n\tbackground: var(--color-main-background);\n\tcolor: var(--color-main-text);\n\tbackground-clip: padding-box;\n\tborder-radius: var(--border-radius);\n\tpadding: 0;\n\tposition: relative;\n\twidth: 100%;\n}\n\n.text-editor__main {\n\t&.is-mobile {\n\t\tflex-grow: 1;\n\t\tflex-direction: column-reverse;\n\t}\n}\n</style>\n","<!--\n - SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors\n - SPDX-License-Identifier: AGPL-3.0-or-later\n-->\n\n<template>\n\t<div\n\t\tclass=\"text-editor__wrapper\"\n\t\t:class=\"{\n\t\t\t'has-conflicts': isResolvingConflict,\n\t\t\t'is-rich-workspace': isRichWorkspace,\n\t\t\t'is-rich-editor': isRichEditor,\n\t\t}\">\n\t\t<slot />\n\t</div>\n</template>\n\n<script>\nimport { subscribe, unsubscribe } from '@nextcloud/event-bus'\nimport { useEditorFlags } from '../../composables/useEditorFlags.ts'\nimport {\n\tOUTLINE_ACTIONS,\n\tOUTLINE_STATE,\n\tREAD_ONLY_ACTIONS,\n} from './Wrapper.provider.js'\n\nexport default {\n\tname: 'Wrapper',\n\tprovide() {\n\t\tconst val = {}\n\n\t\tObject.defineProperties(val, {\n\t\t\t[OUTLINE_STATE]: {\n\t\t\t\tget: () => this.outline,\n\t\t\t},\n\t\t\t[OUTLINE_ACTIONS]: {\n\t\t\t\tget: () => ({\n\t\t\t\t\ttoggle: this.outlineToggle,\n\t\t\t\t}),\n\t\t\t},\n\t\t\t[READ_ONLY_ACTIONS]: {\n\t\t\t\tget: () => ({\n\t\t\t\t\ttoggle: this.readOnlyToggle,\n\t\t\t\t}),\n\t\t\t},\n\t\t})\n\n\t\treturn val\n\t},\n\n\tprops: {\n\t\tisResolvingConflict: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\thasConnectionIssue: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tcontentLoaded: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: true,\n\t\t},\n\t\tshowOutlineOutside: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t},\n\n\tsetup() {\n\t\tconst { isRichEditor, isRichWorkspace } = useEditorFlags()\n\t\treturn { isRichEditor, isRichWorkspace }\n\t},\n\n\tdata: () => ({\n\t\toutline: {\n\t\t\tvisible: false,\n\t\t\tenable: false,\n\t\t},\n\t}),\n\n\tcomputed: {\n\t\tshowOutline() {\n\t\t\treturn this.isAbleToShowOutline ? this.outline.visible : false\n\t\t},\n\t\tisAbleToShowOutline() {\n\t\t\tif (this.isRichWorkspace) {\n\t\t\t\treturn false\n\t\t\t}\n\n\t\t\treturn true\n\t\t},\n\t},\n\n\twatch: {\n\t\tshowOutlineOutside() {\n\t\t\tthis.outline.visible = this.showOutlineOutside\n\t\t},\n\t},\n\n\tmounted() {\n\t\tsubscribe('text:keyboard:outline', this.outlineToggle)\n\t\tthis.outline.enable = this.isAbleToShowOutline\n\n\t\tthis.$watch(\n\t\t\t() => this.isAbleToShowOutline,\n\t\t\t(enable) => {\n\t\t\t\t// make outline state reactive through the provider\n\t\t\t\tObject.assign(this.outline, { enable })\n\t\t\t},\n\t\t)\n\t},\n\n\tbeforeDestroy() {\n\t\tunsubscribe('text:keyboard:outline', this.outlineToggle)\n\t},\n\n\tmethods: {\n\t\toutlineToggle() {\n\t\t\tthis.outline.visible = !this.outline.visible\n\t\t\tthis.$emit('outline-toggled', this.outline.visible)\n\t\t},\n\t\treadOnlyToggle() {\n\t\t\tthis.$emit('read-only-toggled')\n\t\t},\n\t},\n}\n</script>\n\n<style scoped lang=\"scss\">\n.text-editor__wrapper {\n\tdisplay: flex;\n\tflex-grow: 1;\n\n\twidth: 100%;\n\n\t.ProseMirror {\n\t\tmargin-top: 0 !important;\n\t}\n}\n</style>\n"],"names":["undo","state","yUndoPluginKey","redo","defaultProtectedNodes","defaultDeleteFilter","item","protectedNodes","Item","ContentType","Text","XmlElement","yUndoPlugin","trackedOrigins","undoManager","Plugin","initargs","ystate","ySyncPluginKey","_undoManager","UndoManager","tr","val","oldState","binding","hasUndoOps","hasRedoOps","getRelativeSelection","view","stackItem","Collaboration","Extension","extension","dispatch","_a","fragment","yUndoPluginInstance","originalUndoPluginView","viewRet","hasUndoManSelf","observers","ySyncPluginOptions","ySyncPluginInstance","ySyncPlugin","jsonContent","yXmlFragmentToProsemirrorJSON","error","PluginKey","isChangeOrigin","transaction","valueSingleton","loadState","editorWidthKey","maxWidthSetOutsideOfText","alreadySet","setByText","provideEditorWidth","provide","isFullWidth","ref","readonly","subscribe","value","width","computed","applyEditorWidth","watch","useEditorWidth","inject","checked","axios","generateUrl","emit","getNodeRangeDecorations","ranges","DecorationSet","decorations","doc","range","pos","node","Decoration","getSelectionRanges","$from","$to","depth","nodeRange","NodeRange$1","offset","from","to","selectionRange","SelectionRange","NodeRangeBookmark","anchor","head","mapping","$anchor","$head","NodeRangeSelection","Selection","bias","isCursor","isCursorAtEnd","$correctedHead","$correctedAnchor","$rangeFrom","$rangeTo","other","firstRange","lastRange","json","isNodeRangeSelection","editor","selection","nodeRangeSelection","hideTextSelection","activeMouseSelection","event","key","isMac","isShift","isControl","isAlt","isMeta","isMod","isNodeRange","nodeRanges","getCSSText","element","style","i","cloneElement","clonedNode","sourceElements","targetElements","sourceElement","index","findElementNextToCoords","options","x","y","direction","resultElement","resultNode","currentX","allElements","prosemirrorIndex","filteredElements","target","getComputedStyle$1","property","minMax","min","max","getInnerCoords","paddingLeft","paddingRight","borderLeft","borderRight","bounds","removeNode","getDragHandleRanges","result","coords","posAtCoords","dragHandler","empty","dragHandleRanges","selectionRanges","isDragHandleWithinSelection","dragHandleRange","wrapper","slice","clonedElement","getOuterNodePos","resolvedPos","getOuterNode","parent","currentNode","getRelativePos","absolutePos","absolutePositionToRelativePosition","getAbsolutePos","relativePos","relativePositionToAbsolutePosition","getOuterDomNode","domNode","tmpDomNode","dragHandlePluginDefaultKey","DragHandlePlugin","pluginKey","tippyOptions","onNodeChange","popup","locked","currentNodePos","currentNodeRelPos","e","isLocked","hideDragHandle","newPos","_","tippy","domNodePos","outerNode","outerNodePos","_view","nodeData","DragHandle","Vue","h","_sfc_main","DragVerticalIcon","NcButton","PlusIcon","useEditor","schema","n","t","EditorContent","EditorOutline","FloatingButtons","useOutlineStateMixin","isMobile","useIsMobile","isRichEditor","isRichWorkspace","useEditorFlags","uploadAttachment","connection","file","documentId","sessionId","sessionToken","token","unref","formData","url","createAttachment","template","insertAttachmentFile","filePath","getDir","useFileMixin","ACTION_ATTACHMENT_PROMPT","ACTION_CHOOSE_LOCAL_ATTACHMENT","ACTION_CREATE_ATTACHMENT","STATE_UPLOADING","useConnection","files","position","uploadPromises","logger","showError","response","getCurrentUser","fileId","href","name","mimeType","dirname","src","c","alt","MediaHandler","useEditorUpload","OUTLINE_STATE","OUTLINE_ACTIONS","READ_ONLY_ACTIONS","enable","unsubscribe"],"mappings":"q6BAoBO,MAAMA,GAAOC,GAASC,EAAe,SAASD,CAAK,GAAG,aAAa,QAAU,KAQvEE,GAAOF,GAASC,EAAe,SAASD,CAAK,GAAG,aAAa,QAAU,KAcvEG,GAAwB,IAAI,IAAI,CAAC,WAAW,CAAC,EAO7CC,GAAsB,CAACC,EAAMC,IAAmB,EAAED,aAAgBE,KAC7E,EAAEF,EAAK,mBAAmBG,KAC1B,EAAEH,EAAK,QAAQ,gBAAgBI,IAC9BJ,EAAK,QAAQ,gBAAgBK,IAAcJ,EAAe,IAAID,EAAK,QAAQ,KAAK,QAAQ,IACzFA,EAAK,QAAQ,KAAK,UAAY,EAQnBM,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