From e1908d7f5fc078499ff610a6b2270537f1c00c9c Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 24 Sep 2025 11:48:45 +0100 Subject: [PATCH 01/16] Relocated "Bubble Menu" extension --- .../extensions/tiptap-umb-table.extension.ts | 529 ------------------ .../src/external/tiptap/index.ts | 1 - .../bubble-menu.tiptap-extension.ts} | 16 +- .../tiptap/extensions/bubble-menu/index.ts | 1 + .../src/packages/tiptap/extensions/index.ts | 1 + 5 files changed, 9 insertions(+), 539 deletions(-) delete mode 100644 src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-umb-table.extension.ts rename src/Umbraco.Web.UI.Client/src/{external/tiptap/extensions/tiptap-umb-bubble-menu.extension.ts => packages/tiptap/extensions/bubble-menu/bubble-menu.tiptap-extension.ts} (78%) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bubble-menu/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-umb-table.extension.ts b/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-umb-table.extension.ts deleted file mode 100644 index a06850f07669..000000000000 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-umb-table.extension.ts +++ /dev/null @@ -1,529 +0,0 @@ -import { UmbBubbleMenuPlugin } from './tiptap-umb-bubble-menu.extension.js'; -import { CellSelection, TableMap, TableView } from '@tiptap/pm/tables'; -import { Decoration, DecorationSet, EditorView } from '@tiptap/pm/view'; -import { EditorState, Plugin, Selection, Transaction } from '@tiptap/pm/state'; -import { findParentNode, Editor } from '@tiptap/core'; -import { Node as ProseMirrorNode, ResolvedPos } from '@tiptap/pm/model'; -import { Table } from '@tiptap/extension-table'; -import { TableCell } from '@tiptap/extension-table-cell'; -import { TableHeader } from '@tiptap/extension-table-header'; -import { TableRow } from '@tiptap/extension-table-row'; -import type { Rect } from '@tiptap/pm/tables'; - -// NOTE: Custom TableView, to allow for custom styles to be applied to the element. [LK] -// ref: https://github.com/ueberdosis/tiptap/blob/v2.11.5/packages/extension-table/src/TableView.ts -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export class UmbTableView extends TableView { - constructor(node: ProseMirrorNode, cellMinWidth: number) { - super(node, cellMinWidth); - this.#updateTableStyle(node); - } - - override update(node: ProseMirrorNode): boolean { - if (!super.update(node)) return false; - this.#updateTableStyle(node); - return true; - } - - #updateTableStyle(node: ProseMirrorNode) { - if (node.attrs.style) { - // NOTE: The `min-width` inline style is handled by the Tiptap TableView, so we need to preserve it. [LK] - const minWidth = this.table.style.minWidth; - const styles = node.attrs.style as string; - this.table.style.cssText = `${styles}; min-width: ${minWidth};`; - } - } -} - -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export const UmbTable = Table.configure({ resizable: true, View: UmbTableView }); - -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export const UmbTableRow = TableRow.extend({ - allowGapCursor: false, - content: '(tableCell | tableHeader)*', -}); - -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export const UmbTableHeader = TableHeader.extend({ - addAttributes() { - return { - colspan: { - default: 1, - }, - rowspan: { - default: 1, - }, - colwidth: { - default: null, - parseHTML: (element) => { - const colwidth = element.getAttribute('colwidth'); - const value = colwidth ? colwidth.split(',').map((item) => parseInt(item, 10)) : null; - - return value; - }, - }, - style: { - default: null, - }, - }; - }, - - addProseMirrorPlugins() { - const { editor } = this; - return [ - UmbBubbleMenuPlugin(this.editor, { - unique: 'table-column-menu', - placement: 'top', - elementName: 'umb-tiptap-menu', - menuAlias: 'Umb.Menu.Tiptap.TableColumn', - shouldShow(props) { - return isColumnGripSelected(props); - }, - }), - new Plugin({ - props: { - decorations: (state) => { - const { isEditable } = this.editor; - - if (!isEditable) { - return DecorationSet.empty; - } - - const { doc, selection } = state; - const decorations: Array = []; - const cells = getCellsInRow(0)(selection); - - if (cells) { - cells.forEach(({ pos }: { pos: number }, index: number) => { - decorations.push( - Decoration.widget(pos + 1, () => { - const colSelected = isColumnSelected(index)(selection); - - const grip = document.createElement('a'); - grip.appendChild(document.createElement('uui-symbol-more')); - - grip.className = colSelected ? 'grip-column selected' : 'grip-column'; - grip.setAttribute('popovertarget', colSelected ? 'table-column-menu' : ''); - - grip.addEventListener('mousedown', (event) => { - event.preventDefault(); - event.stopImmediatePropagation(); - this.editor.view.dispatch(selectColumn(index)(this.editor.state.tr)); - }); - - return grip; - }), - ); - }); - } - - return DecorationSet.create(doc, decorations); - }, - }, - }), - ]; - }, -}); - -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export const UmbTableCell = TableCell.extend({ - addAttributes() { - return { - colspan: { - default: 1, - parseHTML: (element) => { - const colspan = element.getAttribute('colspan'); - const value = colspan ? parseInt(colspan, 10) : 1; - - return value; - }, - }, - rowspan: { - default: 1, - parseHTML: (element) => { - const rowspan = element.getAttribute('rowspan'); - const value = rowspan ? parseInt(rowspan, 10) : 1; - - return value; - }, - }, - colwidth: { - default: null, - parseHTML: (element) => { - const colwidth = element.getAttribute('colwidth'); - const value = colwidth ? [parseInt(colwidth, 10)] : null; - - return value; - }, - }, - style: { - default: null, - }, - }; - }, - - addProseMirrorPlugins() { - const { editor } = this; - return [ - UmbBubbleMenuPlugin(this.editor, { - unique: 'table-row-menu', - placement: 'left', - elementName: 'umb-tiptap-menu', - menuAlias: 'Umb.Menu.Tiptap.TableRow', - shouldShow(props) { - return isRowGripSelected(props); - }, - }), - new Plugin({ - props: { - decorations: (state) => { - const { isEditable } = this.editor; - - if (!isEditable) { - return DecorationSet.empty; - } - - const { doc, selection } = state; - const decorations: Decoration[] = []; - const cells = getCellsInColumn(0)(selection); - - if (cells) { - cells.forEach(({ pos }: { pos: number }, index: number) => { - decorations.push( - Decoration.widget(pos + 1, () => { - const rowSelected = isRowSelected(index)(selection); - - const grip = document.createElement('a'); - grip.appendChild(document.createElement('uui-symbol-more')); - - grip.className = rowSelected ? 'grip-row selected' : 'grip-row'; - grip.setAttribute('popovertarget', rowSelected ? 'table-row-menu' : ''); - - grip.addEventListener('mousedown', (event) => { - event.preventDefault(); - event.stopImmediatePropagation(); - - this.editor.view.dispatch(selectRow(index)(this.editor.state.tr)); - }); - - return grip; - }), - ); - }); - } - - return DecorationSet.create(doc, decorations); - }, - }, - }), - ]; - }, -}); - -const isRectSelected = (rect: Rect) => (selection: CellSelection) => { - const map = TableMap.get(selection.$anchorCell.node(-1)); - const start = selection.$anchorCell.start(-1); - const cells = map.cellsInRect(rect); - const selectedCells = map.cellsInRect( - map.rectBetween(selection.$anchorCell.pos - start, selection.$headCell.pos - start), - ); - - for (let i = 0, count = cells.length; i < count; i += 1) { - if (selectedCells.indexOf(cells[i]) === -1) { - return false; - } - } - - return true; -}; - -const findTable = (selection: Selection) => - findParentNode((node) => node.type.spec.tableRole && node.type.spec.tableRole === 'table')(selection); - -const isCellSelection = (selection: Selection): selection is CellSelection => selection instanceof CellSelection; - -const isColumnSelected = (columnIndex: number) => (selection: Selection) => { - if (isCellSelection(selection)) { - const map = TableMap.get(selection.$anchorCell.node(-1)); - - return isRectSelected({ - left: columnIndex, - right: columnIndex + 1, - top: 0, - bottom: map.height, - })(selection); - } - - return false; -}; - -const isRowSelected = (rowIndex: number) => (selection: Selection) => { - if (isCellSelection(selection)) { - const map = TableMap.get(selection.$anchorCell.node(-1)); - - return isRectSelected({ - left: 0, - right: map.width, - top: rowIndex, - bottom: rowIndex + 1, - })(selection); - } - - return false; -}; - -const isTableSelected = (selection: Selection) => { - if (isCellSelection(selection)) { - const map = TableMap.get(selection.$anchorCell.node(-1)); - - return isRectSelected({ - left: 0, - right: map.width, - top: 0, - bottom: map.height, - })(selection); - } - - return false; -}; - -const getCellsInColumn = (columnIndex: number | number[]) => (selection: Selection) => { - const table = findTable(selection); - if (table) { - const map = TableMap.get(table.node); - const indexes = Array.isArray(columnIndex) ? columnIndex : Array.from([columnIndex]); - - return indexes.reduce( - (acc, index) => { - if (index >= 0 && index <= map.width - 1) { - const cells = map.cellsInRect({ - left: index, - right: index + 1, - top: 0, - bottom: map.height, - }); - - return acc.concat( - cells.map((nodePos) => { - const node = table.node.nodeAt(nodePos); - const pos = nodePos + table.start; - - return { pos, start: pos + 1, node }; - }), - ); - } - - return acc; - }, - [] as { pos: number; start: number; node: ProseMirrorNode | null | undefined }[], - ); - } - return null; -}; - -const getCellsInRow = (rowIndex: number | number[]) => (selection: Selection) => { - const table = findTable(selection); - - if (table) { - const map = TableMap.get(table.node); - const indexes = Array.isArray(rowIndex) ? rowIndex : Array.from([rowIndex]); - - return indexes.reduce( - (acc, index) => { - if (index >= 0 && index <= map.height - 1) { - const cells = map.cellsInRect({ - left: 0, - right: map.width, - top: index, - bottom: index + 1, - }); - - return acc.concat( - cells.map((nodePos) => { - const node = table.node.nodeAt(nodePos); - const pos = nodePos + table.start; - return { pos, start: pos + 1, node }; - }), - ); - } - - return acc; - }, - [] as { pos: number; start: number; node: ProseMirrorNode | null | undefined }[], - ); - } - - return null; -}; - -const getCellsInTable = (selection: Selection) => { - const table = findTable(selection); - - if (table) { - const map = TableMap.get(table.node); - const cells = map.cellsInRect({ - left: 0, - right: map.width, - top: 0, - bottom: map.height, - }); - - return cells.map((nodePos) => { - const node = table.node.nodeAt(nodePos); - const pos = nodePos + table.start; - - return { pos, start: pos + 1, node }; - }); - } - - return null; -}; - -const findParentNodeClosestToPos = ($pos: ResolvedPos, predicate: (node: ProseMirrorNode) => boolean) => { - for (let i = $pos.depth; i > 0; i -= 1) { - const node = $pos.node(i); - - if (predicate(node)) { - return { - pos: i > 0 ? $pos.before(i) : 0, - start: $pos.start(i), - depth: i, - node, - }; - } - } - - return null; -}; - -const findCellClosestToPos = ($pos: ResolvedPos) => { - const predicate = (node: ProseMirrorNode) => node.type.spec.tableRole && /cell/i.test(node.type.spec.tableRole); - - return findParentNodeClosestToPos($pos, predicate); -}; - -const select = (type: 'row' | 'column') => (index: number) => (tr: Transaction) => { - const table = findTable(tr.selection); - const isRowSelection = type === 'row'; - - if (table) { - const map = TableMap.get(table.node); - - // Check if the index is valid - if (index >= 0 && index < (isRowSelection ? map.height : map.width)) { - const left = isRowSelection ? 0 : index; - const top = isRowSelection ? index : 0; - const right = isRowSelection ? map.width : index + 1; - const bottom = isRowSelection ? index + 1 : map.height; - - const cellsInFirstRow = map.cellsInRect({ - left, - top, - right: isRowSelection ? right : left + 1, - bottom: isRowSelection ? top + 1 : bottom, - }); - - const cellsInLastRow = - bottom - top === 1 - ? cellsInFirstRow - : map.cellsInRect({ - left: isRowSelection ? left : right - 1, - top: isRowSelection ? bottom - 1 : top, - right, - bottom, - }); - - const head = table.start + cellsInFirstRow[0]; - const anchor = table.start + cellsInLastRow[cellsInLastRow.length - 1]; - const $head = tr.doc.resolve(head); - const $anchor = tr.doc.resolve(anchor); - - return tr.setSelection(new CellSelection($anchor, $head)); - } - } - return tr; -}; - -const selectColumn = select('column'); - -const selectRow = select('row'); - -const selectTable = (tr: Transaction) => { - const table = findTable(tr.selection); - - if (table) { - const { map } = TableMap.get(table.node); - - if (map && map.length) { - const head = table.start + map[0]; - const anchor = table.start + map[map.length - 1]; - const $head = tr.doc.resolve(head); - const $anchor = tr.doc.resolve(anchor); - - return tr.setSelection(new CellSelection($anchor, $head)); - } - } - - return tr; -}; - -const isColumnGripSelected = ({ - editor, - view, - state, - from, -}: { - editor: Editor; - view: EditorView; - state: EditorState; - from: number; -}) => { - const domAtPos = view.domAtPos(from).node as HTMLElement; - const nodeDOM = view.nodeDOM(from) as HTMLElement; - const node = nodeDOM || domAtPos; - - if (!editor.isActive(Table.name) || !node || isTableSelected(state.selection)) { - return false; - } - - let container = node; - - while (container && !['TD', 'TH'].includes(container.tagName)) { - container = container.parentElement!; - } - - const gripColumn = container && container.querySelector && container.querySelector('a.grip-column.selected'); - - return !!gripColumn; -}; - -const isRowGripSelected = ({ - editor, - view, - state, - from, -}: { - editor: Editor; - view: EditorView; - state: EditorState; - from: number; -}) => { - const domAtPos = view.domAtPos(from).node as HTMLElement; - const nodeDOM = view.nodeDOM(from) as HTMLElement; - const node = nodeDOM || domAtPos; - - if (!editor.isActive(Table.name) || !node || isTableSelected(state.selection)) { - return false; - } - - let container = node; - - while (container && !['TD', 'TH'].includes(container.tagName)) { - container = container.parentElement!; - } - - const gripRow = container && container.querySelector && container.querySelector('a.grip-row.selected'); - - return !!gripRow; -}; diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts index 6a81876800c9..f40a61163c1c 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts +++ b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts @@ -140,7 +140,6 @@ export * from './extensions/tiptap-html-global-attributes.extension.js'; export * from './extensions/tiptap-text-direction-extension.js'; export * from './extensions/tiptap-text-indent-extension.js'; export * from './extensions/tiptap-trailing-node.extension.js'; -export * from './extensions/tiptap-umb-bubble-menu.extension.js'; export * from './extensions/tiptap-umb-embedded-media.extension.js'; export * from './extensions/tiptap-umb-image.extension.js'; export * from './extensions/tiptap-umb-link.extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-umb-bubble-menu.extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bubble-menu/bubble-menu.tiptap-extension.ts similarity index 78% rename from src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-umb-bubble-menu.extension.ts rename to src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bubble-menu/bubble-menu.tiptap-extension.ts index a34064ae9ce6..b9c0ac76db5b 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-umb-bubble-menu.extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bubble-menu/bubble-menu.tiptap-extension.ts @@ -1,17 +1,17 @@ -import type { UUIPopoverContainerElement } from '../../uui/index.js'; -import { Extension } from '@tiptap/core'; -import { Editor } from '@tiptap/core'; -import { EditorState, Plugin, PluginKey } from '@tiptap/pm/state'; +/* eslint-disable @typescript-eslint/consistent-type-imports */ +/* eslint-disable local-rules/enforce-umbraco-external-imports */ + +import { Extension, Editor } from '@tiptap/core'; +import { EditorState, Plugin } from '@tiptap/pm/state'; import { EditorView } from '@tiptap/pm/view'; import type { PluginView } from '@tiptap/pm/state'; +import type { UUIPopoverContainerElement } from '@umbraco-cms/backoffice/external/uui'; -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ export interface UmbTiptapBubbleMenuElement extends HTMLElement { editor?: Editor; menuAlias?: string; } -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ export type UmbBubbleMenuPluginProps = { unique: string; placement?: UUIPopoverContainerElement['placement']; @@ -22,10 +22,8 @@ export type UmbBubbleMenuPluginProps = { | null; }; -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ export type UmbBubbleMenuOptions = UmbBubbleMenuPluginProps; -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ export const UmbBubbleMenu = Extension.create({ name: 'umbBubbleMenu', @@ -84,6 +82,7 @@ class UmbBubbleMenuPluginView implements PluginView { this.update(view, null); } + // eslint-disable-next-line @typescript-eslint/no-unused-vars update(view: EditorView, prevState: EditorState | null) { const editor = this.#editor; @@ -108,7 +107,6 @@ class UmbBubbleMenuPluginView implements PluginView { } } -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ export const UmbBubbleMenuPlugin = (editor: Editor, props: UmbBubbleMenuPluginProps) => { return new Plugin({ view(editorView) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bubble-menu/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bubble-menu/index.ts new file mode 100644 index 000000000000..e74142b55e4c --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bubble-menu/index.ts @@ -0,0 +1 @@ +export * from './bubble-menu.tiptap-extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts index e67d8949fb83..b7bde2a8a30b 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts @@ -1,6 +1,7 @@ export * from './tiptap-extension-api-base.js'; export * from './tiptap-toolbar-element-api-base.js'; export * from './anchor/index.js'; +export * from './bubble-menu/index.js'; export * from './character-map/index.js'; export * from './table/index.js'; From 803531d3f303aa9899ed3f085617d5e33179279b Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 24 Sep 2025 11:48:55 +0100 Subject: [PATCH 02/16] Relocated "Table" extension --- .../src/external/tiptap/index.ts | 1 - .../packages/tiptap/extensions/table/index.ts | 1 + .../extensions/table/table.tiptap-api.ts | 3 +- .../table/table.tiptap-extension.ts | 527 ++++++++++++++++++ 4 files changed, 529 insertions(+), 3 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/table.tiptap-extension.ts diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts index f40a61163c1c..bb25d56e5489 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts +++ b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts @@ -143,4 +143,3 @@ export * from './extensions/tiptap-trailing-node.extension.js'; export * from './extensions/tiptap-umb-embedded-media.extension.js'; export * from './extensions/tiptap-umb-image.extension.js'; export * from './extensions/tiptap-umb-link.extension.js'; -export * from './extensions/tiptap-umb-table.extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/index.ts index 9e897c4aa454..84128b3a501a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/index.ts @@ -1 +1,2 @@ +export * from './table.tiptap-extension.js'; export * from './modals/index.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/table.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/table.tiptap-api.ts index 4cb3a7e53edf..d45fbd085454 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/table.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/table.tiptap-api.ts @@ -1,11 +1,10 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; +import { UmbTable, UmbTableHeader, UmbTableRow, UmbTableCell } from './table.tiptap-extension.js'; import { css } from '@umbraco-cms/backoffice/external/lit'; -import { UmbTable, UmbTableHeader, UmbTableRow, UmbTableCell } from '@umbraco-cms/backoffice/external/tiptap'; import '../../components/menu/tiptap-menu.element.js'; export default class UmbTiptapTableExtensionApi extends UmbTiptapExtensionApiBase { - // eslint-disable-next-line @typescript-eslint/no-deprecated getTiptapExtensions = () => [UmbTable, UmbTableHeader, UmbTableRow, UmbTableCell]; override getStyles = () => css` diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/table.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/table.tiptap-extension.ts new file mode 100644 index 000000000000..9684a77ecc43 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/table.tiptap-extension.ts @@ -0,0 +1,527 @@ +/* eslint-disable @typescript-eslint/consistent-type-imports */ +/* eslint-disable local-rules/enforce-umbraco-external-imports */ + +import { UmbBubbleMenuPlugin } from '../bubble-menu/bubble-menu.tiptap-extension.js'; +import { CellSelection, TableMap, TableView } from '@tiptap/pm/tables'; +import { Decoration, DecorationSet, EditorView } from '@tiptap/pm/view'; +import { EditorState, Plugin, Selection, Transaction } from '@tiptap/pm/state'; +import { findParentNode, Editor } from '@tiptap/core'; +import { Node as ProseMirrorNode } from '@tiptap/pm/model'; +import { Table } from '@tiptap/extension-table'; +import { TableCell } from '@tiptap/extension-table-cell'; +import { TableHeader } from '@tiptap/extension-table-header'; +import { TableRow } from '@tiptap/extension-table-row'; +import type { Rect } from '@tiptap/pm/tables'; + +// NOTE: Custom TableView, to allow for custom styles to be applied to the
element. [LK] +// ref: https://github.com/ueberdosis/tiptap/blob/v2.11.5/packages/extension-table/src/TableView.ts +export class UmbTableView extends TableView { + constructor(node: ProseMirrorNode, cellMinWidth: number) { + super(node, cellMinWidth); + this.#updateTableStyle(node); + } + + override update(node: ProseMirrorNode): boolean { + if (!super.update(node)) return false; + this.#updateTableStyle(node); + return true; + } + + #updateTableStyle(node: ProseMirrorNode) { + if (node.attrs.style) { + // NOTE: The `min-width` inline style is handled by the Tiptap TableView, so we need to preserve it. [LK] + const minWidth = this.table.style.minWidth; + const styles = node.attrs.style as string; + this.table.style.cssText = `${styles}; min-width: ${minWidth};`; + } + } +} + +export const UmbTable = Table.configure({ resizable: true, View: UmbTableView }); + +export const UmbTableRow = TableRow.extend({ + allowGapCursor: false, + content: '(tableCell | tableHeader)*', +}); + +export const UmbTableHeader = TableHeader.extend({ + addAttributes() { + return { + colspan: { + default: 1, + }, + rowspan: { + default: 1, + }, + colwidth: { + default: null, + parseHTML: (element) => { + const colwidth = element.getAttribute('colwidth'); + const value = colwidth ? colwidth.split(',').map((item) => parseInt(item, 10)) : null; + + return value; + }, + }, + style: { + default: null, + }, + }; + }, + + addProseMirrorPlugins() { + //const { editor } = this; + return [ + UmbBubbleMenuPlugin(this.editor, { + unique: 'table-column-menu', + placement: 'top', + elementName: 'umb-tiptap-menu', + menuAlias: 'Umb.Menu.Tiptap.TableColumn', + shouldShow(props) { + return isColumnGripSelected(props); + }, + }), + new Plugin({ + props: { + decorations: (state) => { + const { isEditable } = this.editor; + + if (!isEditable) { + return DecorationSet.empty; + } + + const { doc, selection } = state; + const decorations: Array = []; + const cells = getCellsInRow(0)(selection); + + if (cells) { + cells.forEach(({ pos }: { pos: number }, index: number) => { + decorations.push( + Decoration.widget(pos + 1, () => { + const colSelected = isColumnSelected(index)(selection); + + const grip = document.createElement('a'); + grip.appendChild(document.createElement('uui-symbol-more')); + + grip.className = colSelected ? 'grip-column selected' : 'grip-column'; + grip.setAttribute('popovertarget', colSelected ? 'table-column-menu' : ''); + + grip.addEventListener('mousedown', (event) => { + event.preventDefault(); + event.stopImmediatePropagation(); + this.editor.view.dispatch(selectColumn(index)(this.editor.state.tr)); + }); + + return grip; + }), + ); + }); + } + + return DecorationSet.create(doc, decorations); + }, + }, + }), + ]; + }, +}); + +export const UmbTableCell = TableCell.extend({ + addAttributes() { + return { + colspan: { + default: 1, + parseHTML: (element) => { + const colspan = element.getAttribute('colspan'); + const value = colspan ? parseInt(colspan, 10) : 1; + + return value; + }, + }, + rowspan: { + default: 1, + parseHTML: (element) => { + const rowspan = element.getAttribute('rowspan'); + const value = rowspan ? parseInt(rowspan, 10) : 1; + + return value; + }, + }, + colwidth: { + default: null, + parseHTML: (element) => { + const colwidth = element.getAttribute('colwidth'); + const value = colwidth ? [parseInt(colwidth, 10)] : null; + + return value; + }, + }, + style: { + default: null, + }, + }; + }, + + addProseMirrorPlugins() { + //const { editor } = this; + return [ + UmbBubbleMenuPlugin(this.editor, { + unique: 'table-row-menu', + placement: 'left', + elementName: 'umb-tiptap-menu', + menuAlias: 'Umb.Menu.Tiptap.TableRow', + shouldShow(props) { + return isRowGripSelected(props); + }, + }), + new Plugin({ + props: { + decorations: (state) => { + const { isEditable } = this.editor; + + if (!isEditable) { + return DecorationSet.empty; + } + + const { doc, selection } = state; + const decorations: Decoration[] = []; + const cells = getCellsInColumn(0)(selection); + + if (cells) { + cells.forEach(({ pos }: { pos: number }, index: number) => { + decorations.push( + Decoration.widget(pos + 1, () => { + const rowSelected = isRowSelected(index)(selection); + + const grip = document.createElement('a'); + grip.appendChild(document.createElement('uui-symbol-more')); + + grip.className = rowSelected ? 'grip-row selected' : 'grip-row'; + grip.setAttribute('popovertarget', rowSelected ? 'table-row-menu' : ''); + + grip.addEventListener('mousedown', (event) => { + event.preventDefault(); + event.stopImmediatePropagation(); + + this.editor.view.dispatch(selectRow(index)(this.editor.state.tr)); + }); + + return grip; + }), + ); + }); + } + + return DecorationSet.create(doc, decorations); + }, + }, + }), + ]; + }, +}); + +const isRectSelected = (rect: Rect) => (selection: CellSelection) => { + const map = TableMap.get(selection.$anchorCell.node(-1)); + const start = selection.$anchorCell.start(-1); + const cells = map.cellsInRect(rect); + const selectedCells = map.cellsInRect( + map.rectBetween(selection.$anchorCell.pos - start, selection.$headCell.pos - start), + ); + + for (let i = 0, count = cells.length; i < count; i += 1) { + if (selectedCells.indexOf(cells[i]) === -1) { + return false; + } + } + + return true; +}; + +const findTable = (selection: Selection) => + findParentNode((node) => node.type.spec.tableRole && node.type.spec.tableRole === 'table')(selection); + +const isCellSelection = (selection: Selection): selection is CellSelection => selection instanceof CellSelection; + +const isColumnSelected = (columnIndex: number) => (selection: Selection) => { + if (isCellSelection(selection)) { + const map = TableMap.get(selection.$anchorCell.node(-1)); + + return isRectSelected({ + left: columnIndex, + right: columnIndex + 1, + top: 0, + bottom: map.height, + })(selection); + } + + return false; +}; + +const isRowSelected = (rowIndex: number) => (selection: Selection) => { + if (isCellSelection(selection)) { + const map = TableMap.get(selection.$anchorCell.node(-1)); + + return isRectSelected({ + left: 0, + right: map.width, + top: rowIndex, + bottom: rowIndex + 1, + })(selection); + } + + return false; +}; + +const isTableSelected = (selection: Selection) => { + if (isCellSelection(selection)) { + const map = TableMap.get(selection.$anchorCell.node(-1)); + + return isRectSelected({ + left: 0, + right: map.width, + top: 0, + bottom: map.height, + })(selection); + } + + return false; +}; + +const getCellsInColumn = (columnIndex: number | number[]) => (selection: Selection) => { + const table = findTable(selection); + if (table) { + const map = TableMap.get(table.node); + const indexes = Array.isArray(columnIndex) ? columnIndex : Array.from([columnIndex]); + + return indexes.reduce( + (acc, index) => { + if (index >= 0 && index <= map.width - 1) { + const cells = map.cellsInRect({ + left: index, + right: index + 1, + top: 0, + bottom: map.height, + }); + + return acc.concat( + cells.map((nodePos) => { + const node = table.node.nodeAt(nodePos); + const pos = nodePos + table.start; + + return { pos, start: pos + 1, node }; + }), + ); + } + + return acc; + }, + [] as { pos: number; start: number; node: ProseMirrorNode | null | undefined }[], + ); + } + return null; +}; + +const getCellsInRow = (rowIndex: number | number[]) => (selection: Selection) => { + const table = findTable(selection); + + if (table) { + const map = TableMap.get(table.node); + const indexes = Array.isArray(rowIndex) ? rowIndex : Array.from([rowIndex]); + + return indexes.reduce( + (acc, index) => { + if (index >= 0 && index <= map.height - 1) { + const cells = map.cellsInRect({ + left: 0, + right: map.width, + top: index, + bottom: index + 1, + }); + + return acc.concat( + cells.map((nodePos) => { + const node = table.node.nodeAt(nodePos); + const pos = nodePos + table.start; + return { pos, start: pos + 1, node }; + }), + ); + } + + return acc; + }, + [] as { pos: number; start: number; node: ProseMirrorNode | null | undefined }[], + ); + } + + return null; +}; + +// const getCellsInTable = (selection: Selection) => { +// const table = findTable(selection); + +// if (table) { +// const map = TableMap.get(table.node); +// const cells = map.cellsInRect({ +// left: 0, +// right: map.width, +// top: 0, +// bottom: map.height, +// }); + +// return cells.map((nodePos) => { +// const node = table.node.nodeAt(nodePos); +// const pos = nodePos + table.start; + +// return { pos, start: pos + 1, node }; +// }); +// } + +// return null; +// }; + +// const findParentNodeClosestToPos = ($pos: ResolvedPos, predicate: (node: ProseMirrorNode) => boolean) => { +// for (let i = $pos.depth; i > 0; i -= 1) { +// const node = $pos.node(i); + +// if (predicate(node)) { +// return { +// pos: i > 0 ? $pos.before(i) : 0, +// start: $pos.start(i), +// depth: i, +// node, +// }; +// } +// } + +// return null; +// }; + +// const findCellClosestToPos = ($pos: ResolvedPos) => { +// const predicate = (node: ProseMirrorNode) => node.type.spec.tableRole && /cell/i.test(node.type.spec.tableRole); + +// return findParentNodeClosestToPos($pos, predicate); +// }; + +const select = (type: 'row' | 'column') => (index: number) => (tr: Transaction) => { + const table = findTable(tr.selection); + const isRowSelection = type === 'row'; + + if (table) { + const map = TableMap.get(table.node); + + // Check if the index is valid + if (index >= 0 && index < (isRowSelection ? map.height : map.width)) { + const left = isRowSelection ? 0 : index; + const top = isRowSelection ? index : 0; + const right = isRowSelection ? map.width : index + 1; + const bottom = isRowSelection ? index + 1 : map.height; + + const cellsInFirstRow = map.cellsInRect({ + left, + top, + right: isRowSelection ? right : left + 1, + bottom: isRowSelection ? top + 1 : bottom, + }); + + const cellsInLastRow = + bottom - top === 1 + ? cellsInFirstRow + : map.cellsInRect({ + left: isRowSelection ? left : right - 1, + top: isRowSelection ? bottom - 1 : top, + right, + bottom, + }); + + const head = table.start + cellsInFirstRow[0]; + const anchor = table.start + cellsInLastRow[cellsInLastRow.length - 1]; + const $head = tr.doc.resolve(head); + const $anchor = tr.doc.resolve(anchor); + + return tr.setSelection(new CellSelection($anchor, $head)); + } + } + return tr; +}; + +const selectColumn = select('column'); + +const selectRow = select('row'); + +// const selectTable = (tr: Transaction) => { +// const table = findTable(tr.selection); + +// if (table) { +// const { map } = TableMap.get(table.node); + +// if (map && map.length) { +// const head = table.start + map[0]; +// const anchor = table.start + map[map.length - 1]; +// const $head = tr.doc.resolve(head); +// const $anchor = tr.doc.resolve(anchor); + +// return tr.setSelection(new CellSelection($anchor, $head)); +// } +// } + +// return tr; +// }; + +const isColumnGripSelected = ({ + editor, + view, + state, + from, +}: { + editor: Editor; + view: EditorView; + state: EditorState; + from: number; +}) => { + const domAtPos = view.domAtPos(from).node as HTMLElement; + const nodeDOM = view.nodeDOM(from) as HTMLElement; + const node = nodeDOM || domAtPos; + + if (!editor.isActive(Table.name) || !node || isTableSelected(state.selection)) { + return false; + } + + let container = node; + + while (container && !['TD', 'TH'].includes(container.tagName)) { + container = container.parentElement!; + } + + const gripColumn = container && container.querySelector && container.querySelector('a.grip-column.selected'); + + return !!gripColumn; +}; + +const isRowGripSelected = ({ + editor, + view, + state, + from, +}: { + editor: Editor; + view: EditorView; + state: EditorState; + from: number; +}) => { + const domAtPos = view.domAtPos(from).node as HTMLElement; + const nodeDOM = view.nodeDOM(from) as HTMLElement; + const node = nodeDOM || domAtPos; + + if (!editor.isActive(Table.name) || !node || isTableSelected(state.selection)) { + return false; + } + + let container = node; + + while (container && !['TD', 'TH'].includes(container.tagName)) { + container = container.parentElement!; + } + + const gripRow = container && container.querySelector && container.querySelector('a.grip-row.selected'); + + return !!gripRow; +}; From 90fdcf7097858f54b467133caaae11412259bcb7 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 24 Sep 2025 11:55:36 +0100 Subject: [PATCH 03/16] Relocated "Anchor" extension --- src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts | 1 - .../src/packages/tiptap/extensions/anchor/anchor.tiptap-api.ts | 3 +-- .../tiptap/extensions/anchor/anchor.tiptap-extension.ts} | 3 ++- .../tiptap/extensions/anchor/anchor.tiptap-toolbar-api.ts | 2 +- .../src/packages/tiptap/extensions/anchor/index.ts | 1 + 5 files changed, 5 insertions(+), 5 deletions(-) rename src/Umbraco.Web.UI.Client/src/{external/tiptap/extensions/tiptap-anchor.extension.ts => packages/tiptap/extensions/anchor/anchor.tiptap-extension.ts} (89%) diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts index bb25d56e5489..b73300940f52 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts +++ b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts @@ -131,7 +131,6 @@ export { export { StarterKit } from '@tiptap/starter-kit'; // CUSTOM EXTENSIONS -export * from './extensions/tiptap-anchor.extension.js'; export * from './extensions/tiptap-div.extension.js'; export * from './extensions/tiptap-figcaption.extension.js'; export * from './extensions/tiptap-figure.extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/anchor.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/anchor.tiptap-api.ts index af01b7e8657e..b17e241bf330 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/anchor.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/anchor.tiptap-api.ts @@ -1,9 +1,8 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; +import { Anchor } from './anchor.tiptap-extension.js'; import { css } from '@umbraco-cms/backoffice/external/lit'; -import { Anchor } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapAnchorExtensionApi extends UmbTiptapExtensionApiBase { - // eslint-disable-next-line @typescript-eslint/no-deprecated getTiptapExtensions = () => [Anchor]; override getStyles = () => css` diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-anchor.extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/anchor.tiptap-extension.ts similarity index 89% rename from src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-anchor.extension.ts rename to src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/anchor.tiptap-extension.ts index fda5a77bfcba..52ca3b8b015a 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-anchor.extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/anchor.tiptap-extension.ts @@ -1,6 +1,7 @@ +/* eslint-disable local-rules/enforce-umbraco-external-imports */ + import { Node, mergeAttributes } from '@tiptap/core'; -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ export const Anchor = Node.create({ name: 'anchor', diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/anchor.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/anchor.tiptap-toolbar-api.ts index 29635fd23132..effff8141fd4 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/anchor.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/anchor.tiptap-toolbar-api.ts @@ -1,6 +1,6 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; import { UMB_TIPTAP_ANCHOR_MODAL } from './modals/index.js'; -import { Anchor } from '@umbraco-cms/backoffice/external/tiptap'; +import { Anchor } from './anchor.tiptap-extension.js'; import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/index.ts index 9e897c4aa454..5b6ea41608d9 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/index.ts @@ -1 +1,2 @@ +export * from './anchor.tiptap-extension.js'; export * from './modals/index.js'; From 2d87cfb418d0808997bbd57986f042049c154e14 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 24 Sep 2025 12:03:31 +0100 Subject: [PATCH 04/16] Relocated "HTML Tag: Div" extension --- src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts | 1 - .../extensions/html-tag-div/html-tag-div.tiptap-api.ts | 3 +-- .../html-tag-div/html-tag-div.tiptap-extension.ts} | 8 ++++---- .../src/packages/tiptap/extensions/html-tag-div/index.ts | 1 + .../src/packages/tiptap/extensions/index.ts | 1 + 5 files changed, 7 insertions(+), 7 deletions(-) rename src/Umbraco.Web.UI.Client/src/{external/tiptap/extensions/tiptap-div.extension.ts => packages/tiptap/extensions/html-tag-div/html-tag-div.tiptap-extension.ts} (63%) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-div/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts index b73300940f52..ebc912d84ae7 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts +++ b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts @@ -131,7 +131,6 @@ export { export { StarterKit } from '@tiptap/starter-kit'; // CUSTOM EXTENSIONS -export * from './extensions/tiptap-div.extension.js'; export * from './extensions/tiptap-figcaption.extension.js'; export * from './extensions/tiptap-figure.extension.js'; export * from './extensions/tiptap-span.extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-div/html-tag-div.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-div/html-tag-div.tiptap-api.ts index 5c6f1cd5fbc0..d43430ff78d0 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-div/html-tag-div.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-div/html-tag-div.tiptap-api.ts @@ -1,7 +1,6 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; -import { Div } from '@umbraco-cms/backoffice/external/tiptap'; +import { Div } from './html-tag-div.tiptap-extension.js'; export default class UmbTiptapHtmlTagDivExtensionApi extends UmbTiptapExtensionApiBase { - // eslint-disable-next-line @typescript-eslint/no-deprecated getTiptapExtensions = () => [Div]; } diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-div.extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-div/html-tag-div.tiptap-extension.ts similarity index 63% rename from src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-div.extension.ts rename to src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-div/html-tag-div.tiptap-extension.ts index 374acf255777..1da4fc07a6dd 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-div.extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-div/html-tag-div.tiptap-extension.ts @@ -1,7 +1,8 @@ +/* eslint-disable local-rules/enforce-umbraco-external-imports */ + import { Node, mergeAttributes } from '@tiptap/core'; -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export interface DivOptions { +export interface UmbHtmlTagDivOptions { /** * HTML attributes to add to the element. * @default {} @@ -10,8 +11,7 @@ export interface DivOptions { HTMLAttributes: Record; } -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export const Div = Node.create({ +export const Div = Node.create({ name: 'div', priority: 50, diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-div/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-div/index.ts new file mode 100644 index 000000000000..a8406565fe75 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-div/index.ts @@ -0,0 +1 @@ +export * from './html-tag-div.tiptap-extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts index b7bde2a8a30b..901160c946e3 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts @@ -3,6 +3,7 @@ export * from './tiptap-toolbar-element-api-base.js'; export * from './anchor/index.js'; export * from './bubble-menu/index.js'; export * from './character-map/index.js'; +export * from './html-tag-div/index.js'; export * from './table/index.js'; export type * from './types.js'; From 4fb39c88dfaf073eafd3d7dd870cf8cd543ab9e7 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 24 Sep 2025 12:09:43 +0100 Subject: [PATCH 05/16] Relocated "HTML Tag: Span" extension --- src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts | 1 - .../extensions/html-tag-span/html-tag-span.tiptap-api.ts | 3 +-- .../html-tag-span/html-tag-span.tiptap-extension.ts} | 9 +++++---- .../packages/tiptap/extensions/html-tag-span/index.ts | 1 + .../src/packages/tiptap/extensions/index.ts | 1 + 5 files changed, 8 insertions(+), 7 deletions(-) rename src/Umbraco.Web.UI.Client/src/{external/tiptap/extensions/tiptap-span.extension.ts => packages/tiptap/extensions/html-tag-span/html-tag-span.tiptap-extension.ts} (90%) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-span/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts index ebc912d84ae7..0fdb882ccbb5 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts +++ b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts @@ -133,7 +133,6 @@ export { StarterKit } from '@tiptap/starter-kit'; // CUSTOM EXTENSIONS export * from './extensions/tiptap-figcaption.extension.js'; export * from './extensions/tiptap-figure.extension.js'; -export * from './extensions/tiptap-span.extension.js'; export * from './extensions/tiptap-html-global-attributes.extension.js'; export * from './extensions/tiptap-text-direction-extension.js'; export * from './extensions/tiptap-text-indent-extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-span/html-tag-span.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-span/html-tag-span.tiptap-api.ts index a4c7491dc8a1..70b9f4558acf 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-span/html-tag-span.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-span/html-tag-span.tiptap-api.ts @@ -1,7 +1,6 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; -import { Span } from '@umbraco-cms/backoffice/external/tiptap'; +import { Span } from './html-tag-span.tiptap-extension.js'; export default class UmbTiptapHtmlTagSpanExtensionApi extends UmbTiptapExtensionApiBase { - // eslint-disable-next-line @typescript-eslint/no-deprecated getTiptapExtensions = () => [Span]; } diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-span.extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-span/html-tag-span.tiptap-extension.ts similarity index 90% rename from src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-span.extension.ts rename to src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-span/html-tag-span.tiptap-extension.ts index bee0cd8632df..52bc401512b8 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-span.extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-span/html-tag-span.tiptap-extension.ts @@ -1,7 +1,9 @@ +/* eslint-disable jsdoc/require-jsdoc */ +/* eslint-disable local-rules/enforce-umbraco-external-imports */ + import { Mark, mergeAttributes } from '@tiptap/core'; -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export interface SpanOptions { +export interface UmbHtmlTagSpanOptions { /** * HTML attributes to add to the span element. * @default {} @@ -35,8 +37,7 @@ function serializeStyles(items: Record): string { ); } -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export const Span = Mark.create({ +export const Span = Mark.create({ name: 'span', priority: 50, diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-span/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-span/index.ts new file mode 100644 index 000000000000..35ed487577be --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-span/index.ts @@ -0,0 +1 @@ +export * from './html-tag-span.tiptap-extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts index 901160c946e3..de02266ad5a3 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts @@ -4,6 +4,7 @@ export * from './anchor/index.js'; export * from './bubble-menu/index.js'; export * from './character-map/index.js'; export * from './html-tag-div/index.js'; +export * from './html-tag-span/index.js'; export * from './table/index.js'; export type * from './types.js'; From 92262ab6a928aa0ffb11e20a2ad06ac83ff1d9ad Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 24 Sep 2025 12:18:01 +0100 Subject: [PATCH 06/16] Refactored "HTML Attribute" extensions --- ...tiptap-html-global-attributes.extension.ts | 143 ------------------ .../src/external/tiptap/index.ts | 1 - .../html-attr-class.tiptap-api.ts | 62 +------- .../html-attr-class.tiptap-extension.ts | 61 ++++++++ .../extensions/html-attr-class/index.ts | 1 + .../html-attr-dataset.tiptap-api.ts | 82 +--------- .../html-attr-dataset.tiptap-extension.ts | 81 ++++++++++ .../extensions/html-attr-dataset/index.ts | 1 + .../html-attr-id/html-attr-id.tiptap-api.ts | 60 +------- .../html-attr-id.tiptap-extension.ts | 59 ++++++++ .../tiptap/extensions/html-attr-id/index.ts | 1 + .../html-attr-style.tiptap-api.ts | 64 +------- .../html-attr-style.tiptap-extension.ts | 63 ++++++++ .../extensions/html-attr-style/index.ts | 1 + .../src/packages/tiptap/extensions/index.ts | 4 + 15 files changed, 276 insertions(+), 408 deletions(-) delete mode 100644 src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-html-global-attributes.extension.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-class/html-attr-class.tiptap-extension.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-class/index.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-dataset/html-attr-dataset.tiptap-extension.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-dataset/index.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-id/html-attr-id.tiptap-extension.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-id/index.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-style/html-attr-style.tiptap-extension.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-style/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-html-global-attributes.extension.ts b/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-html-global-attributes.extension.ts deleted file mode 100644 index 06454f82b9e8..000000000000 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-html-global-attributes.extension.ts +++ /dev/null @@ -1,143 +0,0 @@ -import { Extension } from '@tiptap/core'; -import type { Attributes } from '@tiptap/core'; - -/** - * Converts camelCase to kebab-case. - * @param {string} str - The string to convert. - * @returns {string} The converted string. - */ -function camelCaseToKebabCase(str: string): string { - return str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, ($, ofs) => (ofs ? '-' : '') + $.toLowerCase()); -} - -/** @deprecated No longer used internally. This will be removed in Umbraco 17. [LK] */ -export interface HtmlGlobalAttributesOptions { - /** - * The types where the text align attribute can be applied. - * @default [] - * @example ['heading', 'paragraph'] - */ - types: Array; -} - -/** @deprecated No longer used internally. This will be removed in Umbraco 17. [LK] */ -export const HtmlGlobalAttributes = Extension.create({ - name: 'htmlGlobalAttributes', - - addOptions() { - return { types: [] }; - }, - - addGlobalAttributes() { - return [ - { - types: this.options.types, - attributes: { - class: {}, - dataset: { - parseHTML: (element) => element.dataset, - renderHTML: (attributes) => { - const keys = attributes.dataset ? Object.keys(attributes.dataset) : []; - if (!keys.length) return {}; - const dataAtrrs: Record = {}; - keys.forEach((key) => { - dataAtrrs['data-' + camelCaseToKebabCase(key)] = attributes.dataset[key]; - }); - return dataAtrrs; - }, - }, - id: {}, - style: { - parseHTML: (element) => (element.style.length ? element.style.cssText : null), - }, - } as Attributes, - }, - ]; - }, - - addCommands() { - return { - setClassName: - (className, type) => - ({ commands }) => { - if (!className) return false; - const types = type ? [type] : this.options.types; - return types - .map((type) => commands.updateAttributes(type, { class: className })) - .every((response) => response); - }, - toggleClassName: - (className, type) => - ({ commands, editor }) => { - if (!className) return false; - const types = type ? [type] : this.options.types; - const existing = types.map((type) => editor.getAttributes(type)?.class as string).filter((x) => x); - return existing.length ? commands.unsetClassName(type) : commands.setClassName(className, type); - }, - unsetClassName: - (type) => - ({ commands }) => { - const types = type ? [type] : this.options.types; - return types.map((type) => commands.resetAttributes(type, 'class')).every((response) => response); - }, - setId: - (id, type) => - ({ commands }) => { - if (!id) return false; - const types = type ? [type] : this.options.types; - return types.map((type) => commands.updateAttributes(type, { id })).every((response) => response); - }, - toggleId: - (id, type) => - ({ commands, editor }) => { - if (!id) return false; - const types = type ? [type] : this.options.types; - const existing = types.map((type) => editor.getAttributes(type)?.id as string).filter((x) => x); - return existing.length ? commands.unsetId(type) : commands.setId(id, type); - }, - unsetId: - (type) => - ({ commands }) => { - const types = type ? [type] : this.options.types; - return types.map((type) => commands.resetAttributes(type, 'id')).every((response) => response); - }, - setStyles: - (style, type) => - ({ commands }) => { - if (!style) return false; - const types = type ? [type] : this.options.types; - return types.map((type) => commands.updateAttributes(type, { style })).every((response) => response); - }, - toggleStyles: - (style, type) => - ({ commands, editor }) => { - if (!style) return false; - const types = type ? [type] : this.options.types; - const existing = types.map((type) => editor.getAttributes(type)?.style as string).filter((x) => x); - return existing.length ? commands.unsetStyles(type) : commands.setStyles(style, type); - }, - unsetStyles: - (type) => - ({ commands }) => { - const types = type ? [type] : this.options.types; - return types.map((type) => commands.resetAttributes(type, 'style')).every((response) => response); - }, - }; - }, -}); - -declare module '@tiptap/core' { - interface Commands { - htmlGlobalAttributes: { - setClassName: (className?: string, type?: string) => ReturnType; - toggleClassName: (className?: string, type?: string) => ReturnType; - unsetClassName: (type?: string) => ReturnType; - setId: (id?: string, type?: string) => ReturnType; - toggleId: (id?: string, type?: string) => ReturnType; - unsetId: (type?: string) => ReturnType; - setStyles: (style?: string, type?: string) => ReturnType; - toggleStyles: (style?: string, type?: string) => ReturnType; - unsetStyles: (type?: string) => ReturnType; - }; - } -} diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts index 0fdb882ccbb5..50c64d01533f 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts +++ b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts @@ -133,7 +133,6 @@ export { StarterKit } from '@tiptap/starter-kit'; // CUSTOM EXTENSIONS export * from './extensions/tiptap-figcaption.extension.js'; export * from './extensions/tiptap-figure.extension.js'; -export * from './extensions/tiptap-html-global-attributes.extension.js'; export * from './extensions/tiptap-text-direction-extension.js'; export * from './extensions/tiptap-text-indent-extension.js'; export * from './extensions/tiptap-trailing-node.extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-class/html-attr-class.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-class/html-attr-class.tiptap-api.ts index a44680a341f1..961f0b1ee23e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-class/html-attr-class.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-class/html-attr-class.tiptap-api.ts @@ -1,65 +1,5 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; -import { Extension } from '@umbraco-cms/backoffice/external/tiptap'; -import type { Attributes } from '@umbraco-cms/backoffice/external/tiptap'; - -declare module '@tiptap/core' { - interface Commands { - htmlClassAttribute: { - setClassName: (className?: string, type?: string) => ReturnType; - toggleClassName: (className?: string, type?: string) => ReturnType; - unsetClassName: (type?: string) => ReturnType; - }; - } -} - -interface HtmlClassAttributeOptions { - types: Array; -} - -const HtmlClassAttribute = Extension.create({ - name: 'htmlClassAttribute', - - addOptions() { - return { types: [] }; - }, - - addGlobalAttributes() { - return [ - { - types: this.options.types, - attributes: { class: {} } as Attributes, - }, - ]; - }, - - addCommands() { - return { - setClassName: - (className, type) => - ({ commands }) => { - if (!className) return false; - const types = type ? [type] : this.options.types; - return types - .map((type) => commands.updateAttributes(type, { class: className })) - .every((response) => response); - }, - toggleClassName: - (className, type) => - ({ commands, editor }) => { - if (!className) return false; - const types = type ? [type] : this.options.types; - const existing = types.map((type) => editor.getAttributes(type)?.class as string).filter((x) => x); - return existing.length ? commands.unsetClassName(type) : commands.setClassName(className, type); - }, - unsetClassName: - (type) => - ({ commands }) => { - const types = type ? [type] : this.options.types; - return types.map((type) => commands.resetAttributes(type, 'class')).every((response) => response); - }, - }; - }, -}); +import { HtmlClassAttribute } from './html-attr-class.tiptap-extension.js'; export default class UmbTiptapHtmlAttributeClassExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [ diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-class/html-attr-class.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-class/html-attr-class.tiptap-extension.ts new file mode 100644 index 000000000000..f3ccb51115bb --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-class/html-attr-class.tiptap-extension.ts @@ -0,0 +1,61 @@ +import { Extension } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Attributes } from '@umbraco-cms/backoffice/external/tiptap'; + +declare module '@tiptap/core' { + interface Commands { + htmlClassAttribute: { + setClassName: (className?: string, type?: string) => ReturnType; + toggleClassName: (className?: string, type?: string) => ReturnType; + unsetClassName: (type?: string) => ReturnType; + }; + } +} + +interface UmbHtmlClassAttributeOptions { + types: Array; +} + +export const HtmlClassAttribute = Extension.create({ + name: 'htmlClassAttribute', + + addOptions() { + return { types: [] }; + }, + + addGlobalAttributes() { + return [ + { + types: this.options.types, + attributes: { class: {} } as Attributes, + }, + ]; + }, + + addCommands() { + return { + setClassName: + (className, type) => + ({ commands }) => { + if (!className) return false; + const types = type ? [type] : this.options.types; + return types + .map((type) => commands.updateAttributes(type, { class: className })) + .every((response) => response); + }, + toggleClassName: + (className, type) => + ({ commands, editor }) => { + if (!className) return false; + const types = type ? [type] : this.options.types; + const existing = types.map((type) => editor.getAttributes(type)?.class as string).filter((x) => x); + return existing.length ? commands.unsetClassName(type) : commands.setClassName(className, type); + }, + unsetClassName: + (type) => + ({ commands }) => { + const types = type ? [type] : this.options.types; + return types.map((type) => commands.resetAttributes(type, 'class')).every((response) => response); + }, + }; + }, +}); diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-class/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-class/index.ts new file mode 100644 index 000000000000..973f468a2130 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-class/index.ts @@ -0,0 +1 @@ +export * from './html-attr-class.tiptap-extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-dataset/html-attr-dataset.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-dataset/html-attr-dataset.tiptap-api.ts index 91bba989cb9d..274f58de5470 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-dataset/html-attr-dataset.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-dataset/html-attr-dataset.tiptap-api.ts @@ -1,85 +1,5 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; -import { Extension } from '@umbraco-cms/backoffice/external/tiptap'; -import type { Attributes } from '@umbraco-cms/backoffice/external/tiptap'; - -declare module '@tiptap/core' { - interface Commands { - htmlDatasetAttributes: { - setId: (id?: string, type?: string) => ReturnType; - toggleId: (id?: string, type?: string) => ReturnType; - unsetId: (type?: string) => ReturnType; - }; - } -} - -/** - * Converts camelCase to kebab-case. - * @param {string} str - The string to convert. - * @returns {string} The converted string. - */ -function camelCaseToKebabCase(str: string): string { - return str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, ($, ofs) => (ofs ? '-' : '') + $.toLowerCase()); -} - -interface HtmlDatasetAttributesOptions { - types: Array; -} - -const HtmlDatasetAttributes = Extension.create({ - name: 'htmlDatasetAttributes', - - addOptions() { - return { types: [] }; - }, - - addGlobalAttributes() { - return [ - { - types: this.options.types, - attributes: { - dataset: { - parseHTML: (element) => element.dataset, - renderHTML: (attributes) => { - const keys = attributes.dataset ? Object.keys(attributes.dataset) : []; - if (!keys.length) return {}; - const dataAtrrs: Record = {}; - keys.forEach((key) => { - dataAtrrs['data-' + camelCaseToKebabCase(key)] = attributes.dataset[key]; - }); - return dataAtrrs; - }, - }, - } as Attributes, - }, - ]; - }, - - addCommands() { - return { - setId: - (id, type) => - ({ commands }) => { - if (!id) return false; - const types = type ? [type] : this.options.types; - return types.map((type) => commands.updateAttributes(type, { id })).every((response) => response); - }, - toggleId: - (id, type) => - ({ commands, editor }) => { - if (!id) return false; - const types = type ? [type] : this.options.types; - const existing = types.map((type) => editor.getAttributes(type)?.id as string).filter((x) => x); - return existing.length ? commands.unsetId(type) : commands.setId(id, type); - }, - unsetId: - (type) => - ({ commands }) => { - const types = type ? [type] : this.options.types; - return types.map((type) => commands.resetAttributes(type, 'id')).every((response) => response); - }, - }; - }, -}); +import { HtmlDatasetAttributes } from './html-attr-dataset.tiptap-extension.js'; export default class UmbTiptapHtmlAttributeDatasetExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [ diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-dataset/html-attr-dataset.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-dataset/html-attr-dataset.tiptap-extension.ts new file mode 100644 index 000000000000..5d4428b402bd --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-dataset/html-attr-dataset.tiptap-extension.ts @@ -0,0 +1,81 @@ +import { Extension } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Attributes } from '@umbraco-cms/backoffice/external/tiptap'; + +declare module '@tiptap/core' { + interface Commands { + htmlDatasetAttributes: { + setId: (id?: string, type?: string) => ReturnType; + toggleId: (id?: string, type?: string) => ReturnType; + unsetId: (type?: string) => ReturnType; + }; + } +} + +/** + * Converts camelCase to kebab-case. + * @param {string} str - The string to convert. + * @returns {string} The converted string. + */ +function camelCaseToKebabCase(str: string): string { + return str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, ($, ofs) => (ofs ? '-' : '') + $.toLowerCase()); +} + +interface HtmlDatasetAttributesOptions { + types: Array; +} + +export const HtmlDatasetAttributes = Extension.create({ + name: 'htmlDatasetAttributes', + + addOptions() { + return { types: [] }; + }, + + addGlobalAttributes() { + return [ + { + types: this.options.types, + attributes: { + dataset: { + parseHTML: (element) => element.dataset, + renderHTML: (attributes) => { + const keys = attributes.dataset ? Object.keys(attributes.dataset) : []; + if (!keys.length) return {}; + const dataAtrrs: Record = {}; + keys.forEach((key) => { + dataAtrrs['data-' + camelCaseToKebabCase(key)] = attributes.dataset[key]; + }); + return dataAtrrs; + }, + }, + } as Attributes, + }, + ]; + }, + + addCommands() { + return { + setId: + (id, type) => + ({ commands }) => { + if (!id) return false; + const types = type ? [type] : this.options.types; + return types.map((type) => commands.updateAttributes(type, { id })).every((response) => response); + }, + toggleId: + (id, type) => + ({ commands, editor }) => { + if (!id) return false; + const types = type ? [type] : this.options.types; + const existing = types.map((type) => editor.getAttributes(type)?.id as string).filter((x) => x); + return existing.length ? commands.unsetId(type) : commands.setId(id, type); + }, + unsetId: + (type) => + ({ commands }) => { + const types = type ? [type] : this.options.types; + return types.map((type) => commands.resetAttributes(type, 'id')).every((response) => response); + }, + }; + }, +}); diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-dataset/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-dataset/index.ts new file mode 100644 index 000000000000..9c14e008c23e --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-dataset/index.ts @@ -0,0 +1 @@ +export * from './html-attr-dataset.tiptap-extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-id/html-attr-id.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-id/html-attr-id.tiptap-api.ts index 017d070585c8..4cd72092d1f7 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-id/html-attr-id.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-id/html-attr-id.tiptap-api.ts @@ -1,63 +1,5 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; -import { Extension } from '@umbraco-cms/backoffice/external/tiptap'; -import type { Attributes } from '@umbraco-cms/backoffice/external/tiptap'; - -declare module '@tiptap/core' { - interface Commands { - htmlIdAttribute: { - setId: (id?: string, type?: string) => ReturnType; - toggleId: (id?: string, type?: string) => ReturnType; - unsetId: (type?: string) => ReturnType; - }; - } -} - -interface HtmlIdAttributeOptions { - types: Array; -} - -const HtmlIdAttribute = Extension.create({ - name: 'htmlIdAttribute', - - addOptions() { - return { types: [] }; - }, - - addGlobalAttributes() { - return [ - { - types: this.options.types, - attributes: { id: {} } as Attributes, - }, - ]; - }, - - addCommands() { - return { - setId: - (id, type) => - ({ commands }) => { - if (!id) return false; - const types = type ? [type] : this.options.types; - return types.map((type) => commands.updateAttributes(type, { id })).every((response) => response); - }, - toggleId: - (id, type) => - ({ commands, editor }) => { - if (!id) return false; - const types = type ? [type] : this.options.types; - const existing = types.map((type) => editor.getAttributes(type)?.id as string).filter((x) => x); - return existing.length ? commands.unsetId(type) : commands.setId(id, type); - }, - unsetId: - (type) => - ({ commands }) => { - const types = type ? [type] : this.options.types; - return types.map((type) => commands.resetAttributes(type, 'id')).every((response) => response); - }, - }; - }, -}); +import { HtmlIdAttribute } from './html-attr-id.tiptap-extension.js'; export default class UmbTiptapHtmlAttributeIdExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [ diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-id/html-attr-id.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-id/html-attr-id.tiptap-extension.ts new file mode 100644 index 000000000000..5055232f26e9 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-id/html-attr-id.tiptap-extension.ts @@ -0,0 +1,59 @@ +import { Extension } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Attributes } from '@umbraco-cms/backoffice/external/tiptap'; + +declare module '@tiptap/core' { + interface Commands { + htmlIdAttribute: { + setId: (id?: string, type?: string) => ReturnType; + toggleId: (id?: string, type?: string) => ReturnType; + unsetId: (type?: string) => ReturnType; + }; + } +} + +interface HtmlIdAttributeOptions { + types: Array; +} + +export const HtmlIdAttribute = Extension.create({ + name: 'htmlIdAttribute', + + addOptions() { + return { types: [] }; + }, + + addGlobalAttributes() { + return [ + { + types: this.options.types, + attributes: { id: {} } as Attributes, + }, + ]; + }, + + addCommands() { + return { + setId: + (id, type) => + ({ commands }) => { + if (!id) return false; + const types = type ? [type] : this.options.types; + return types.map((type) => commands.updateAttributes(type, { id })).every((response) => response); + }, + toggleId: + (id, type) => + ({ commands, editor }) => { + if (!id) return false; + const types = type ? [type] : this.options.types; + const existing = types.map((type) => editor.getAttributes(type)?.id as string).filter((x) => x); + return existing.length ? commands.unsetId(type) : commands.setId(id, type); + }, + unsetId: + (type) => + ({ commands }) => { + const types = type ? [type] : this.options.types; + return types.map((type) => commands.resetAttributes(type, 'id')).every((response) => response); + }, + }; + }, +}); diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-id/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-id/index.ts new file mode 100644 index 000000000000..808faa8bbbc6 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-id/index.ts @@ -0,0 +1 @@ +export * from './html-attr-id.tiptap-extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-style/html-attr-style.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-style/html-attr-style.tiptap-api.ts index 324c968afe67..a499f451f7cf 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-style/html-attr-style.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-style/html-attr-style.tiptap-api.ts @@ -1,67 +1,5 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; -import { Extension } from '@umbraco-cms/backoffice/external/tiptap'; -import type { Attributes } from '@umbraco-cms/backoffice/external/tiptap'; - -declare module '@tiptap/core' { - interface Commands { - htmlStyleAttribute: { - setStyles: (style?: string, type?: string) => ReturnType; - toggleStyles: (style?: string, type?: string) => ReturnType; - unsetStyles: (type?: string) => ReturnType; - }; - } -} - -interface HtmlStyleAttributeOptions { - types: Array; -} - -const HtmlStyleAttribute = Extension.create({ - name: 'htmlStyleAttribute', - - addOptions() { - return { types: [] }; - }, - - addGlobalAttributes() { - return [ - { - types: this.options.types, - attributes: { - style: { - parseHTML: (element) => (element.style.length ? element.style.cssText : null), - }, - } as Attributes, - }, - ]; - }, - - addCommands() { - return { - setStyles: - (style, type) => - ({ commands }) => { - if (!style) return false; - const types = type ? [type] : this.options.types; - return types.map((type) => commands.updateAttributes(type, { style })).every((response) => response); - }, - toggleStyles: - (style, type) => - ({ commands, editor }) => { - if (!style) return false; - const types = type ? [type] : this.options.types; - const existing = types.map((type) => editor.getAttributes(type)?.style as string).filter((x) => x); - return existing.length ? commands.unsetStyles(type) : commands.setStyles(style, type); - }, - unsetStyles: - (type) => - ({ commands }) => { - const types = type ? [type] : this.options.types; - return types.map((type) => commands.resetAttributes(type, 'style')).every((response) => response); - }, - }; - }, -}); +import { HtmlStyleAttribute } from './html-attr-style.tiptap-extension.js'; export default class UmbTiptapHtmlAttributeStyleExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [ diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-style/html-attr-style.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-style/html-attr-style.tiptap-extension.ts new file mode 100644 index 000000000000..a17e9758a463 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-style/html-attr-style.tiptap-extension.ts @@ -0,0 +1,63 @@ +import { Extension } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Attributes } from '@umbraco-cms/backoffice/external/tiptap'; + +declare module '@tiptap/core' { + interface Commands { + htmlStyleAttribute: { + setStyles: (style?: string, type?: string) => ReturnType; + toggleStyles: (style?: string, type?: string) => ReturnType; + unsetStyles: (type?: string) => ReturnType; + }; + } +} + +interface HtmlStyleAttributeOptions { + types: Array; +} + +export const HtmlStyleAttribute = Extension.create({ + name: 'htmlStyleAttribute', + + addOptions() { + return { types: [] }; + }, + + addGlobalAttributes() { + return [ + { + types: this.options.types, + attributes: { + style: { + parseHTML: (element) => (element.style.length ? element.style.cssText : null), + }, + } as Attributes, + }, + ]; + }, + + addCommands() { + return { + setStyles: + (style, type) => + ({ commands }) => { + if (!style) return false; + const types = type ? [type] : this.options.types; + return types.map((type) => commands.updateAttributes(type, { style })).every((response) => response); + }, + toggleStyles: + (style, type) => + ({ commands, editor }) => { + if (!style) return false; + const types = type ? [type] : this.options.types; + const existing = types.map((type) => editor.getAttributes(type)?.style as string).filter((x) => x); + return existing.length ? commands.unsetStyles(type) : commands.setStyles(style, type); + }, + unsetStyles: + (type) => + ({ commands }) => { + const types = type ? [type] : this.options.types; + return types.map((type) => commands.resetAttributes(type, 'style')).every((response) => response); + }, + }; + }, +}); diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-style/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-style/index.ts new file mode 100644 index 000000000000..4268bf42f3a8 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-style/index.ts @@ -0,0 +1 @@ +export * from './html-attr-style.tiptap-extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts index de02266ad5a3..f1855aa308e5 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts @@ -3,6 +3,10 @@ export * from './tiptap-toolbar-element-api-base.js'; export * from './anchor/index.js'; export * from './bubble-menu/index.js'; export * from './character-map/index.js'; +export * from './html-attr-class/index.js'; +export * from './html-attr-dataset/index.js'; +export * from './html-attr-id/index.js'; +export * from './html-attr-style/index.js'; export * from './html-tag-div/index.js'; export * from './html-tag-span/index.js'; export * from './table/index.js'; From 48e6057081777e015e73e0a54b578019ef3c82c1 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 24 Sep 2025 12:22:01 +0100 Subject: [PATCH 07/16] Relocated "Figure" extension --- src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts | 2 -- .../extensions/figure/figcaption.tiptap-extension.ts} | 8 ++++---- .../tiptap/extensions/figure/figure.tiptap-api.ts | 4 ++-- .../tiptap/extensions/figure/figure.tiptap-extension.ts} | 8 ++++---- .../src/packages/tiptap/extensions/figure/index.ts | 2 ++ .../src/packages/tiptap/extensions/index.ts | 1 + 6 files changed, 13 insertions(+), 12 deletions(-) rename src/Umbraco.Web.UI.Client/src/{external/tiptap/extensions/tiptap-figcaption.extension.ts => packages/tiptap/extensions/figure/figcaption.tiptap-extension.ts} (60%) rename src/Umbraco.Web.UI.Client/src/{external/tiptap/extensions/tiptap-figure.extension.ts => packages/tiptap/extensions/figure/figure.tiptap-extension.ts} (73%) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts index 50c64d01533f..b0a040d72d2d 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts +++ b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts @@ -131,8 +131,6 @@ export { export { StarterKit } from '@tiptap/starter-kit'; // CUSTOM EXTENSIONS -export * from './extensions/tiptap-figcaption.extension.js'; -export * from './extensions/tiptap-figure.extension.js'; export * from './extensions/tiptap-text-direction-extension.js'; export * from './extensions/tiptap-text-indent-extension.js'; export * from './extensions/tiptap-trailing-node.extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-figcaption.extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figcaption.tiptap-extension.ts similarity index 60% rename from src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-figcaption.extension.ts rename to src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figcaption.tiptap-extension.ts index 8a1bce8d409e..fc9efe22762f 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-figcaption.extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figcaption.tiptap-extension.ts @@ -1,7 +1,8 @@ +/* eslint-disable local-rules/enforce-umbraco-external-imports */ + import { Node } from '@tiptap/core'; -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export interface FigcaptionOptions { +export interface UmbFigcaptionOptions { /** * HTML attributes to add to the image element. * @default {} @@ -10,8 +11,7 @@ export interface FigcaptionOptions { HTMLAttributes: Record; } -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export const Figcaption = Node.create({ +export const Figcaption = Node.create({ name: 'figcaption', addOptions() { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figure.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figure.tiptap-api.ts index eb1995474c2b..acee75850825 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figure.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figure.tiptap-api.ts @@ -1,7 +1,7 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; -import { Figure, Figcaption } from '@umbraco-cms/backoffice/external/tiptap'; +import { Figcaption } from './figcaption.tiptap-extension.js'; +import { Figure } from './figure.tiptap-extension.js'; export default class UmbTiptapFigureExtensionApi extends UmbTiptapExtensionApiBase { - // eslint-disable-next-line @typescript-eslint/no-deprecated getTiptapExtensions = () => [Figcaption, Figure]; } diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-figure.extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figure.tiptap-extension.ts similarity index 73% rename from src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-figure.extension.ts rename to src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figure.tiptap-extension.ts index 4e4b67a3081a..6bc0dcd4b40c 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-figure.extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figure.tiptap-extension.ts @@ -1,7 +1,8 @@ +/* eslint-disable local-rules/enforce-umbraco-external-imports */ + import { mergeAttributes, Node } from '@tiptap/core'; -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export interface FigureOptions { +export interface UmbFigureOptions { /** * HTML attributes to add to the image element. * @default {} @@ -10,8 +11,7 @@ export interface FigureOptions { HTMLAttributes: Record; } -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export const Figure = Node.create({ +export const Figure = Node.create({ name: 'figure', group: 'block', content: 'block+', diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/index.ts new file mode 100644 index 000000000000..7720234ef852 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/index.ts @@ -0,0 +1,2 @@ +export * from './figcaption.tiptap-extension.js'; +export * from './figure.tiptap-extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts index f1855aa308e5..caf1dce90b7a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts @@ -3,6 +3,7 @@ export * from './tiptap-toolbar-element-api-base.js'; export * from './anchor/index.js'; export * from './bubble-menu/index.js'; export * from './character-map/index.js'; +export * from './figure/index.js'; export * from './html-attr-class/index.js'; export * from './html-attr-dataset/index.js'; export * from './html-attr-id/index.js'; From 72114a791cc22df742d819453a68f996d9c91b4e Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 24 Sep 2025 12:25:17 +0100 Subject: [PATCH 08/16] Relocated "Text Direction" extension --- src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts | 1 - .../src/packages/tiptap/extensions/index.ts | 5 +++++ .../packages/tiptap/extensions/text-direction/index.ts | 1 + .../text-direction/text-direction.tiptap-api.ts | 3 +-- .../text-direction/text-direction.tiptap-extension.ts} | 8 ++++---- 5 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/index.ts rename src/Umbraco.Web.UI.Client/src/{external/tiptap/extensions/tiptap-text-direction-extension.ts => packages/tiptap/extensions/text-direction/text-direction.tiptap-extension.ts} (79%) diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts index b0a040d72d2d..10b919cf1ee8 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts +++ b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts @@ -131,7 +131,6 @@ export { export { StarterKit } from '@tiptap/starter-kit'; // CUSTOM EXTENSIONS -export * from './extensions/tiptap-text-direction-extension.js'; export * from './extensions/tiptap-text-indent-extension.js'; export * from './extensions/tiptap-trailing-node.extension.js'; export * from './extensions/tiptap-umb-embedded-media.extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts index caf1dce90b7a..014f026f944c 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts @@ -10,6 +10,11 @@ export * from './html-attr-id/index.js'; export * from './html-attr-style/index.js'; export * from './html-tag-div/index.js'; export * from './html-tag-span/index.js'; +//export * from './image/index.js'; +//export * from './link/index.js'; export * from './table/index.js'; +export * from './text-direction/index.js'; +//export * from './text-indent/index.js'; +//export * from './trailing-node/index.js'; export type * from './types.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/index.ts new file mode 100644 index 000000000000..d156da90d4c2 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/index.ts @@ -0,0 +1 @@ +export * from './text-direction.tiptap-extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction.tiptap-api.ts index c124f6b82ee4..2d9b0f1ce5c7 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction.tiptap-api.ts @@ -1,9 +1,8 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; -import { TextDirection } from '@umbraco-cms/backoffice/external/tiptap'; +import { TextDirection } from './text-direction.tiptap-extension.js'; export default class UmbTiptapTextDirectionExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [ - // eslint-disable-next-line @typescript-eslint/no-deprecated TextDirection.configure({ types: ['heading', 'paragraph', 'blockquote', 'orderedList', 'bulletList'], }), diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-text-direction-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction.tiptap-extension.ts similarity index 79% rename from src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-text-direction-extension.ts rename to src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction.tiptap-extension.ts index 96727e9dae23..2fb2a01cd978 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-text-direction-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction.tiptap-extension.ts @@ -1,13 +1,13 @@ +/* eslint-disable local-rules/enforce-umbraco-external-imports */ + import { Extension } from '@tiptap/core'; -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export interface TextDirectionOptions { +export interface UmbTextDirectionOptions { directions: Array<'auto' | 'ltr' | 'rtl'>; types: Array; } -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export const TextDirection = Extension.create({ +export const TextDirection = Extension.create({ name: 'textDirection', addOptions() { From f7d7a3e051cb014f5e63535f856e2aa59e20edca Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 24 Sep 2025 12:31:27 +0100 Subject: [PATCH 09/16] Relocated "Text Indent" extension --- src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts | 1 - .../src/packages/tiptap/extensions/index.ts | 2 +- .../src/packages/tiptap/extensions/text-indent/index.ts | 1 + .../extensions/text-indent/text-indent.tiptap-api.ts | 3 +-- .../text-indent/text-indent.tiptap-extension.ts} | 8 ++++---- 5 files changed, 7 insertions(+), 8 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/index.ts rename src/Umbraco.Web.UI.Client/src/{external/tiptap/extensions/tiptap-text-indent-extension.ts => packages/tiptap/extensions/text-indent/text-indent.tiptap-extension.ts} (90%) diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts index 10b919cf1ee8..00738e1e45d5 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts +++ b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts @@ -131,7 +131,6 @@ export { export { StarterKit } from '@tiptap/starter-kit'; // CUSTOM EXTENSIONS -export * from './extensions/tiptap-text-indent-extension.js'; export * from './extensions/tiptap-trailing-node.extension.js'; export * from './extensions/tiptap-umb-embedded-media.extension.js'; export * from './extensions/tiptap-umb-image.extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts index 014f026f944c..58d727b364a9 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts @@ -14,7 +14,7 @@ export * from './html-tag-span/index.js'; //export * from './link/index.js'; export * from './table/index.js'; export * from './text-direction/index.js'; -//export * from './text-indent/index.js'; +export * from './text-indent/index.js'; //export * from './trailing-node/index.js'; export type * from './types.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/index.ts new file mode 100644 index 000000000000..0f700c08a64f --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/index.ts @@ -0,0 +1 @@ +export * from './text-indent.tiptap-extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-indent.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-indent.tiptap-api.ts index 56f87e710d67..5a17b52fdaaf 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-indent.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-indent.tiptap-api.ts @@ -1,9 +1,8 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; -import { TextIndent } from '@umbraco-cms/backoffice/external/tiptap'; +import { TextIndent } from './text-indent.tiptap-extension.js'; export default class UmbTiptapTextIndentExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [ - // eslint-disable-next-line @typescript-eslint/no-deprecated TextIndent.configure({ types: ['div', 'heading', 'paragraph', 'blockquote', 'listItem', 'orderedList', 'bulletList'], }), diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-text-indent-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-indent.tiptap-extension.ts similarity index 90% rename from src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-text-indent-extension.ts rename to src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-indent.tiptap-extension.ts index a39c10605d28..5018af68f301 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-text-indent-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-indent.tiptap-extension.ts @@ -1,3 +1,5 @@ +/* eslint-disable local-rules/enforce-umbraco-external-imports */ + /* This Source Code has been derived from Tiptiz. * https://github.com/tiptiz/editor/blob/main/packages/tiptiz-extension-indent/src/indent.ts * SPDX-License-Identifier: MIT @@ -11,15 +13,13 @@ import type { EditorState, Transaction } from '@tiptap/pm/state'; import { Extension } from '@tiptap/core'; import { AllSelection, TextSelection } from '@tiptap/pm/state'; -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export interface TextIndentOptions { +export interface UmbTextIndentOptions { minLevel: number; maxLevel: number; types: Array; } -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export const TextIndent = Extension.create({ +export const TextIndent = Extension.create({ name: 'textIndent', addOptions() { From 841eb4759baabafe8b104a0a98b275842f5184c6 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 24 Sep 2025 14:09:05 +0100 Subject: [PATCH 10/16] Relocated "Trailing Node" extension --- src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts | 1 - .../src/packages/tiptap/extensions/index.ts | 2 +- .../packages/tiptap/extensions/trailing-node/index.ts | 1 + .../trailing-node/trailing-node.tiptap-api.ts | 3 +-- .../trailing-node/trailing-node.tiptap-extension.ts} | 10 ++++++---- 5 files changed, 9 insertions(+), 8 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/trailing-node/index.ts rename src/Umbraco.Web.UI.Client/src/{external/tiptap/extensions/tiptap-trailing-node.extension.ts => packages/tiptap/extensions/trailing-node/trailing-node.tiptap-extension.ts} (83%) diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts index 00738e1e45d5..2d65d8b4aea1 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts +++ b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts @@ -131,7 +131,6 @@ export { export { StarterKit } from '@tiptap/starter-kit'; // CUSTOM EXTENSIONS -export * from './extensions/tiptap-trailing-node.extension.js'; export * from './extensions/tiptap-umb-embedded-media.extension.js'; export * from './extensions/tiptap-umb-image.extension.js'; export * from './extensions/tiptap-umb-link.extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts index 58d727b364a9..c6eafb2a39e5 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts @@ -15,6 +15,6 @@ export * from './html-tag-span/index.js'; export * from './table/index.js'; export * from './text-direction/index.js'; export * from './text-indent/index.js'; -//export * from './trailing-node/index.js'; +export * from './trailing-node/index.js'; export type * from './types.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/trailing-node/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/trailing-node/index.ts new file mode 100644 index 000000000000..db3bca0c1e93 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/trailing-node/index.ts @@ -0,0 +1 @@ +export * from './trailing-node.tiptap-extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/trailing-node/trailing-node.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/trailing-node/trailing-node.tiptap-api.ts index f476e59d6851..521ceab4a0d1 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/trailing-node/trailing-node.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/trailing-node/trailing-node.tiptap-api.ts @@ -1,7 +1,6 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; -import { TrailingNode } from '@umbraco-cms/backoffice/external/tiptap'; +import { TrailingNode } from './trailing-node.tiptap-extension.js'; export default class UmbTiptapTrailingNodeExtensionApi extends UmbTiptapExtensionApiBase { - // eslint-disable-next-line @typescript-eslint/no-deprecated getTiptapExtensions = () => [TrailingNode]; } diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-trailing-node.extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/trailing-node/trailing-node.tiptap-extension.ts similarity index 83% rename from src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-trailing-node.extension.ts rename to src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/trailing-node/trailing-node.tiptap-extension.ts index ec7f4144f1c5..a761f95f6d9b 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-trailing-node.extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/trailing-node/trailing-node.tiptap-extension.ts @@ -1,3 +1,6 @@ +/* eslint-disable jsdoc/require-jsdoc */ +/* eslint-disable local-rules/enforce-umbraco-external-imports */ + /* This Source Code has been derived from Tiptap. * https://github.com/ueberdosis/tiptap/blob/v2.11.5/demos/src/Experiments/TrailingNode/Vue/trailing-node.ts * SPDX-License-Identifier: MIT @@ -8,19 +11,18 @@ import { Extension } from '@tiptap/core'; import { Plugin, PluginKey } from '@tiptap/pm/state'; +// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore function nodeEqualsType({ types, node }) { return (Array.isArray(types) && types.includes(node.type)) || node.type === types; } -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export interface TrailingNodeOptions { +export interface UmbTrailingNodeOptions { node: string; notAfter: string[]; } -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export const TrailingNode = Extension.create({ +export const TrailingNode = Extension.create({ name: 'trailingNode', addOptions() { From 5cc30738939ef3cc2dad9a7f2e61bb7cccdb81fa Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 24 Sep 2025 14:12:44 +0100 Subject: [PATCH 11/16] Relocated "Embedded Media" extension --- src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts | 1 - .../extensions/embedded-media/embedded-media.tiptap-api.ts | 3 +-- .../embedded-media/embedded-media.tiptap-extension.ts} | 4 ++-- .../embedded-media/embedded-media.tiptap-toolbar-api.ts | 2 +- .../src/packages/tiptap/extensions/embedded-media/index.ts | 1 + .../src/packages/tiptap/extensions/index.ts | 1 + 6 files changed, 6 insertions(+), 6 deletions(-) rename src/Umbraco.Web.UI.Client/src/{external/tiptap/extensions/tiptap-umb-embedded-media.extension.ts => packages/tiptap/extensions/embedded-media/embedded-media.tiptap-extension.ts} (88%) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts index 2d65d8b4aea1..cdf14229225a 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts +++ b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts @@ -131,6 +131,5 @@ export { export { StarterKit } from '@tiptap/starter-kit'; // CUSTOM EXTENSIONS -export * from './extensions/tiptap-umb-embedded-media.extension.js'; export * from './extensions/tiptap-umb-image.extension.js'; export * from './extensions/tiptap-umb-link.extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/embedded-media.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/embedded-media.tiptap-api.ts index 425df096b3c2..35539b9d1b4a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/embedded-media.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/embedded-media.tiptap-api.ts @@ -1,9 +1,8 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; +import { umbEmbeddedMedia } from './embedded-media.tiptap-extension.js'; import { css } from '@umbraco-cms/backoffice/external/lit'; -import { umbEmbeddedMedia } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapEmbeddedMediaExtensionApi extends UmbTiptapExtensionApiBase { - // eslint-disable-next-line @typescript-eslint/no-deprecated getTiptapExtensions = () => [umbEmbeddedMedia.configure({ inline: true })]; override getStyles = () => css` diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-umb-embedded-media.extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/embedded-media.tiptap-extension.ts similarity index 88% rename from src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-umb-embedded-media.extension.ts rename to src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/embedded-media.tiptap-extension.ts index fce7c67a4863..17a82d995517 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-umb-embedded-media.extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/embedded-media.tiptap-extension.ts @@ -1,11 +1,11 @@ +/* eslint-disable local-rules/enforce-umbraco-external-imports */ + import { mergeAttributes, Node } from '@tiptap/core'; -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ export interface UmbEmbeddedMediaOptions { inline: boolean; } -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ export const umbEmbeddedMedia = Node.create({ name: 'umbEmbeddedMedia', group() { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/embedded-media.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/embedded-media.tiptap-toolbar-api.ts index 4657e783da75..79fe1549c664 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/embedded-media.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/embedded-media.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import { umbEmbeddedMedia } from '@umbraco-cms/backoffice/external/tiptap'; +import { umbEmbeddedMedia } from './embedded-media.tiptap-extension.js'; import { UMB_EMBEDDED_MEDIA_MODAL } from '@umbraco-cms/backoffice/embedded-media'; import { umbOpenModal } from '@umbraco-cms/backoffice/modal'; import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/index.ts new file mode 100644 index 000000000000..3c63cca8a40d --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/index.ts @@ -0,0 +1 @@ +export * from './embedded-media.tiptap-extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts index c6eafb2a39e5..9226413f1298 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts @@ -3,6 +3,7 @@ export * from './tiptap-toolbar-element-api-base.js'; export * from './anchor/index.js'; export * from './bubble-menu/index.js'; export * from './character-map/index.js'; +export * from './embedded-media/index.js'; export * from './figure/index.js'; export * from './html-attr-class/index.js'; export * from './html-attr-dataset/index.js'; From 03d54b6e64804be21f48b2d8bc13b9301aa57ea0 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 24 Sep 2025 14:18:47 +0100 Subject: [PATCH 12/16] Relocated "Link" extension --- src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts | 1 - .../src/packages/tiptap/extensions/index.ts | 2 +- .../src/packages/tiptap/extensions/link/index.ts | 1 + .../src/packages/tiptap/extensions/link/link.tiptap-api.ts | 3 +-- .../tiptap/extensions/link/link.tiptap-extension.ts} | 3 +-- .../packages/tiptap/extensions/link/link.tiptap-toolbar-api.ts | 2 +- 6 files changed, 5 insertions(+), 7 deletions(-) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/index.ts rename src/Umbraco.Web.UI.Client/src/{external/tiptap/extensions/tiptap-umb-link.extension.ts => packages/tiptap/extensions/link/link.tiptap-extension.ts} (88%) diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts index cdf14229225a..77484f1b9c26 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts +++ b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts @@ -132,4 +132,3 @@ export { StarterKit } from '@tiptap/starter-kit'; // CUSTOM EXTENSIONS export * from './extensions/tiptap-umb-image.extension.js'; -export * from './extensions/tiptap-umb-link.extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts index 9226413f1298..c5a4389c3eb4 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts @@ -12,7 +12,7 @@ export * from './html-attr-style/index.js'; export * from './html-tag-div/index.js'; export * from './html-tag-span/index.js'; //export * from './image/index.js'; -//export * from './link/index.js'; +export * from './link/index.js'; export * from './table/index.js'; export * from './text-direction/index.js'; export * from './text-indent/index.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/index.ts new file mode 100644 index 000000000000..db8320810c71 --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/index.ts @@ -0,0 +1 @@ +export * from './link.tiptap-extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/link.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/link.tiptap-api.ts index 300df0ef2f55..635d96a704c8 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/link.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/link.tiptap-api.ts @@ -1,7 +1,6 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; -import { UmbLink } from '@umbraco-cms/backoffice/external/tiptap'; +import { UmbLink } from './link.tiptap-extension.js'; export default class UmbTiptapLinkExtensionApi extends UmbTiptapExtensionApiBase { - // eslint-disable-next-line @typescript-eslint/no-deprecated getTiptapExtensions = () => [UmbLink.configure({ openOnClick: false })]; } diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-umb-link.extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/link.tiptap-extension.ts similarity index 88% rename from src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-umb-link.extension.ts rename to src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/link.tiptap-extension.ts index ef7e66617ed3..fe5c6ac94410 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-umb-link.extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/link.tiptap-extension.ts @@ -1,6 +1,5 @@ -import Link from '@tiptap/extension-link'; +import { Link } from '@umbraco-cms/backoffice/external/tiptap'; -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ export const UmbLink = Link.extend({ name: 'umbLink', diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/link.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/link.tiptap-toolbar-api.ts index 9038afedb1fe..622bc4f1f76d 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/link.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/link.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import { UmbLink } from '@umbraco-cms/backoffice/external/tiptap'; +import { UmbLink } from './link.tiptap-extension.js'; import { UMB_LINK_PICKER_MODAL } from '@umbraco-cms/backoffice/multi-url-picker'; import { umbOpenModal } from '@umbraco-cms/backoffice/modal'; import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; From 2cf15dc2ce09db1c7814c43ffe56bc1d12314254 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 24 Sep 2025 14:22:09 +0100 Subject: [PATCH 13/16] Relocated "Image" extension --- src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts | 3 --- .../src/packages/tiptap/extensions/image/image.tiptap-api.ts | 3 +-- .../tiptap/extensions/image/image.tiptap-extension.ts} | 4 +--- .../src/packages/tiptap/extensions/image/index.ts | 1 + .../src/packages/tiptap/extensions/index.ts | 2 +- 5 files changed, 4 insertions(+), 9 deletions(-) rename src/Umbraco.Web.UI.Client/src/{external/tiptap/extensions/tiptap-umb-image.extension.ts => packages/tiptap/extensions/image/image.tiptap-extension.ts} (78%) create mode 100644 src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/image/index.ts diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts index 77484f1b9c26..b5443ee31993 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts +++ b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts @@ -129,6 +129,3 @@ export { /** @deprecated No longer used internally. This will be removed in Umbraco 17. [LK] */ export { StarterKit } from '@tiptap/starter-kit'; - -// CUSTOM EXTENSIONS -export * from './extensions/tiptap-umb-image.extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/image/image.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/image/image.tiptap-api.ts index 3c09402edc30..6c2167b5d636 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/image/image.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/image/image.tiptap-api.ts @@ -1,9 +1,8 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; +import { UmbImage } from './image.tiptap-extension.js'; import { css } from '@umbraco-cms/backoffice/external/lit'; -import { UmbImage } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapImageExtensionApi extends UmbTiptapExtensionApiBase { - // eslint-disable-next-line @typescript-eslint/no-deprecated getTiptapExtensions = () => [UmbImage.configure({ inline: true })]; override getStyles = () => css` diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-umb-image.extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/image/image.tiptap-extension.ts similarity index 78% rename from src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-umb-image.extension.ts rename to src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/image/image.tiptap-extension.ts index 1f91f7e95829..7fa651bc16fa 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-umb-image.extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/image/image.tiptap-extension.ts @@ -1,6 +1,5 @@ -import Image from '@tiptap/extension-image'; +import { Image } from '@umbraco-cms/backoffice/external/tiptap'; -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ export interface UmbImageAttributes { src: string; alt?: string; @@ -14,7 +13,6 @@ export interface UmbImageAttributes { 'data-udi'?: string; } -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ export const UmbImage = Image.extend({ addAttributes() { return { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/image/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/image/index.ts new file mode 100644 index 000000000000..9735009bf19d --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/image/index.ts @@ -0,0 +1 @@ +export * from './image.tiptap-extension.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts index c5a4389c3eb4..6303cdf51ace 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/index.ts @@ -11,7 +11,7 @@ export * from './html-attr-id/index.js'; export * from './html-attr-style/index.js'; export * from './html-tag-div/index.js'; export * from './html-tag-span/index.js'; -//export * from './image/index.js'; +export * from './image/index.js'; export * from './link/index.js'; export * from './table/index.js'; export * from './text-direction/index.js'; From a246fe43abad7dc15048a5d4d04821858e58152f Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 24 Sep 2025 15:28:12 +0100 Subject: [PATCH 14/16] Removed "@umbraco-backoffice/external-tiptap" package relocated Tiptap exports to the "@umbraco-cms/backoffice/tiptap" package. --- src/Umbraco.Web.UI.Client/package-lock.json | 115 +++++---------- src/Umbraco.Web.UI.Client/package.json | 1 - .../src/external/tiptap/index.ts | 131 ------------------ .../src/external/tiptap/package.json | 44 ------ .../src/external/tiptap/vite.config.ts | 18 --- .../input-tiptap/input-tiptap.element.ts | 4 +- .../statusbar/tiptap-statusbar.element.ts | 2 +- .../toolbar/tiptap-toolbar-button.element.ts | 2 +- .../toolbar/tiptap-toolbar-menu.element.ts | 2 +- .../toolbar/tiptap-toolbar.element.ts | 2 +- .../tiptap/contexts/tiptap-rte.context.ts | 2 +- .../anchor/anchor.tiptap-toolbar-api.ts | 4 +- .../extensions/block/block.tipap-api.ts | 2 +- .../block/block.tiptap-toolbar-api.ts | 2 +- .../blockquote/blockquote.tiptap-api.ts | 2 +- .../blockquote.tiptap-toolbar-api.ts | 2 +- .../tiptap/extensions/bold/bold.tiptap-api.ts | 2 +- .../bold/bold.tiptap-toolbar-api.ts | 2 +- .../bullet-list/bullet-list.tiptap-api.ts | 2 +- .../bullet-list.tiptap-toolbar-api.ts | 2 +- .../character-map.tiptap-toolbar-api.ts | 2 +- .../clear-formatting.tiptap-toolbar-api.ts | 2 +- .../code-block/code-block.tiptap-api.ts | 2 +- .../code-block.tiptap-toolbar-api.ts | 2 +- .../core/rich-text-essentials.tiptap-api.ts | 10 +- .../element-path.tiptap-statusbar-element.ts | 2 +- .../embedded-media.tiptap-toolbar-api.ts | 2 +- .../font-family.tiptap-toolbar-api.ts | 2 +- .../font-size/font-size.tiptap-toolbar-api.ts | 2 +- .../extensions/heading/heading.tiptap-api.ts | 2 +- .../heading/heading1.tiptap-toolbar-api.ts | 2 +- .../heading/heading2.tiptap-toolbar-api.ts | 2 +- .../heading/heading3.tiptap-toolbar-api.ts | 2 +- .../horizontal-rule.tiptap-api.ts | 2 +- .../horizontal-rule.tiptap-toolbar-api.ts | 2 +- .../html-attr-class.tiptap-extension.ts | 4 +- .../html-attr-dataset.tiptap-extension.ts | 4 +- .../html-attr-id.tiptap-extension.ts | 4 +- .../html-attr-style.tiptap-extension.ts | 4 +- .../image/image.tiptap-extension.ts | 2 +- .../extensions/italic/italic.tiptap-api.ts | 2 +- .../italic/italic.tiptap-toolbar-api.ts | 2 +- .../extensions/link/link.tiptap-extension.ts | 2 +- .../link/link.tiptap-toolbar-api.ts | 2 +- .../link/unlink.tiptap-toolbar-api.ts | 2 +- .../media-picker.tiptap-toolbar-api.ts | 2 +- .../media-upload/media-upload.tiptap-api.ts | 4 +- .../ordered-list/ordered-list.tiptap-api.ts | 2 +- .../ordered-list.tiptap-toolbar-api.ts | 4 +- .../extensions/strike/strike.tiptap-api.ts | 2 +- .../strike/strike.tiptap-toolbar-api.ts | 2 +- .../style-menu.tiptap-toolbar-api.ts | 2 +- .../subscript/subscript.tiptap-api.ts | 2 +- .../subscript/subscript.tiptap-toolbar-api.ts | 2 +- .../superscript/superscript.tiptap-api.ts | 2 +- .../superscript.tiptap-toolbar-api.ts | 2 +- .../table/actions/table-properties.action.ts | 2 +- .../components/table-column-menu.element.ts | 3 +- .../table/components/table-insert.element.ts | 2 +- .../components/table-row-menu.element.ts | 3 +- .../table/table.tiptap-toolbar-api.ts | 2 +- .../text-align-center.tiptap-toolbar-api.ts | 2 +- .../text-align-justify.tiptap-toolbar-api.ts | 2 +- .../text-align-left.tiptap-toolbar-api.ts | 2 +- .../text-align-right.tiptap-toolbar-api.ts | 2 +- .../text-align/text-align.tiptap-api.ts | 2 +- ...ext-color-background.tiptap-toolbar-api.ts | 2 +- ...ext-color-foreground.tiptap-toolbar-api.ts | 2 +- .../text-direction-ltr.tiptap-toolbar-api.ts | 2 +- .../text-direction-rtl.tiptap-toolbar-api.ts | 2 +- .../text-indent.tiptap-toolbar-api.ts | 2 +- .../text-outdent.tiptap-toolbar-api.ts | 2 +- .../extensions/tiptap-extension-api-base.ts | 2 +- .../tiptap-toolbar-element-api-base.ts | 2 +- .../src/packages/tiptap/extensions/types.ts | 2 +- .../underline/underline.tiptap-api.ts | 2 +- .../underline/underline.tiptap-toolbar-api.ts | 2 +- .../undo-redo/redo.tiptap-toolbar-api.ts | 2 +- .../undo-redo/undo.tiptap-toolbar-api.ts | 2 +- .../source-editor.tiptap-toolbar-api.ts | 2 +- .../word-count/word-count.tiptap-api.ts | 2 +- .../word-count.tiptap-statusbar-element.ts | 2 +- .../src/packages/tiptap/externals.ts | 35 +++++ .../src/packages/tiptap/index.ts | 1 + .../src/packages/tiptap/package.json | 35 +++++ src/Umbraco.Web.UI.Client/tsconfig.json | 1 - 86 files changed, 195 insertions(+), 366 deletions(-) delete mode 100644 src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts delete mode 100644 src/Umbraco.Web.UI.Client/src/external/tiptap/package.json delete mode 100644 src/Umbraco.Web.UI.Client/src/external/tiptap/vite.config.ts create mode 100644 src/Umbraco.Web.UI.Client/src/packages/tiptap/externals.ts diff --git a/src/Umbraco.Web.UI.Client/package-lock.json b/src/Umbraco.Web.UI.Client/package-lock.json index f9445c5a30dc..a13cc5b774bc 100644 --- a/src/Umbraco.Web.UI.Client/package-lock.json +++ b/src/Umbraco.Web.UI.Client/package-lock.json @@ -1,6 +1,6 @@ { "name": "@umbraco-cms/backoffice", - "version": "16.2.0-rc", + "version": "17.0.0-rc", "lockfileVersion": 3, "requires": true, "packages": { @@ -2616,39 +2616,6 @@ "url": "https://github.com/sponsors/ueberdosis" } }, - "node_modules/@tiptap/starter-kit": { - "version": "2.26.1", - "resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-2.26.1.tgz", - "integrity": "sha512-oziMGCds8SVQ3s5dRpBxVdEKZAmO/O//BjZ69mhA3q4vJdR0rnfLb5fTxSeQvHiqB878HBNn76kNaJrHrV35GA==", - "license": "MIT", - "dependencies": { - "@tiptap/core": "^2.26.1", - "@tiptap/extension-blockquote": "^2.26.1", - "@tiptap/extension-bold": "^2.26.1", - "@tiptap/extension-bullet-list": "^2.26.1", - "@tiptap/extension-code": "^2.26.1", - "@tiptap/extension-code-block": "^2.26.1", - "@tiptap/extension-document": "^2.26.1", - "@tiptap/extension-dropcursor": "^2.26.1", - "@tiptap/extension-gapcursor": "^2.26.1", - "@tiptap/extension-hard-break": "^2.26.1", - "@tiptap/extension-heading": "^2.26.1", - "@tiptap/extension-history": "^2.26.1", - "@tiptap/extension-horizontal-rule": "^2.26.1", - "@tiptap/extension-italic": "^2.26.1", - "@tiptap/extension-list-item": "^2.26.1", - "@tiptap/extension-ordered-list": "^2.26.1", - "@tiptap/extension-paragraph": "^2.26.1", - "@tiptap/extension-strike": "^2.26.1", - "@tiptap/extension-text": "^2.26.1", - "@tiptap/extension-text-style": "^2.26.1", - "@tiptap/pm": "^2.26.1" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/ueberdosis" - } - }, "node_modules/@tootallnate/quickjs-emscripten": { "version": "0.23.0", "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", @@ -3580,10 +3547,6 @@ "resolved": "src/packages/extension-insights", "link": true }, - "node_modules/@umbraco-backoffice/external-tiptap": { - "resolved": "src/external/tiptap", - "link": true - }, "node_modules/@umbraco-backoffice/health-check": { "resolved": "src/packages/health-check", "link": true @@ -17060,45 +17023,6 @@ "@microsoft/signalr": "9.0.6" } }, - "src/external/tiptap": { - "name": "@umbraco-backoffice/external-tiptap", - "dependencies": { - "@tiptap/core": "2.26.1", - "@tiptap/extension-blockquote": "2.26.1", - "@tiptap/extension-bold": "2.26.1", - "@tiptap/extension-bullet-list": "2.26.1", - "@tiptap/extension-character-count": "2.26.1", - "@tiptap/extension-code": "2.26.1", - "@tiptap/extension-code-block": "2.26.1", - "@tiptap/extension-document": "2.26.1", - "@tiptap/extension-dropcursor": "2.26.1", - "@tiptap/extension-gapcursor": "2.26.1", - "@tiptap/extension-hard-break": "2.26.1", - "@tiptap/extension-heading": "2.26.1", - "@tiptap/extension-history": "2.26.1", - "@tiptap/extension-horizontal-rule": "2.26.1", - "@tiptap/extension-image": "2.26.1", - "@tiptap/extension-italic": "2.26.1", - "@tiptap/extension-link": "2.26.1", - "@tiptap/extension-list-item": "2.26.1", - "@tiptap/extension-ordered-list": "2.26.1", - "@tiptap/extension-paragraph": "2.26.1", - "@tiptap/extension-placeholder": "2.26.1", - "@tiptap/extension-strike": "2.26.1", - "@tiptap/extension-subscript": "2.26.1", - "@tiptap/extension-superscript": "2.26.1", - "@tiptap/extension-table": "2.26.1", - "@tiptap/extension-table-cell": "2.26.1", - "@tiptap/extension-table-header": "2.26.1", - "@tiptap/extension-table-row": "2.26.1", - "@tiptap/extension-text": "2.26.1", - "@tiptap/extension-text-align": "2.26.1", - "@tiptap/extension-text-style": "2.26.1", - "@tiptap/extension-underline": "2.26.1", - "@tiptap/pm": "2.26.1", - "@tiptap/starter-kit": "2.26.1" - } - }, "src/external/uui": { "name": "@umbraco-backoffice/uui", "dependencies": { @@ -17229,7 +17153,42 @@ "name": "@umbraco-backoffice/templating" }, "src/packages/tiptap": { - "name": "@umbraco-backoffice/tiptap" + "name": "@umbraco-backoffice/tiptap", + "dependencies": { + "@tiptap/core": "2.26.1", + "@tiptap/extension-blockquote": "2.26.1", + "@tiptap/extension-bold": "2.26.1", + "@tiptap/extension-bullet-list": "2.26.1", + "@tiptap/extension-character-count": "2.26.1", + "@tiptap/extension-code": "2.26.1", + "@tiptap/extension-code-block": "2.26.1", + "@tiptap/extension-document": "2.26.1", + "@tiptap/extension-dropcursor": "2.26.1", + "@tiptap/extension-gapcursor": "2.26.1", + "@tiptap/extension-hard-break": "2.26.1", + "@tiptap/extension-heading": "2.26.1", + "@tiptap/extension-history": "2.26.1", + "@tiptap/extension-horizontal-rule": "2.26.1", + "@tiptap/extension-image": "2.26.1", + "@tiptap/extension-italic": "2.26.1", + "@tiptap/extension-link": "2.26.1", + "@tiptap/extension-list-item": "2.26.1", + "@tiptap/extension-ordered-list": "2.26.1", + "@tiptap/extension-paragraph": "2.26.1", + "@tiptap/extension-placeholder": "2.26.1", + "@tiptap/extension-strike": "2.26.1", + "@tiptap/extension-subscript": "2.26.1", + "@tiptap/extension-superscript": "2.26.1", + "@tiptap/extension-table": "2.26.1", + "@tiptap/extension-table-cell": "2.26.1", + "@tiptap/extension-table-header": "2.26.1", + "@tiptap/extension-table-row": "2.26.1", + "@tiptap/extension-text": "2.26.1", + "@tiptap/extension-text-align": "2.26.1", + "@tiptap/extension-text-style": "2.26.1", + "@tiptap/extension-underline": "2.26.1", + "@tiptap/pm": "2.26.1" + } }, "src/packages/translation": { "name": "@umbraco-backoffice/translation" diff --git a/src/Umbraco.Web.UI.Client/package.json b/src/Umbraco.Web.UI.Client/package.json index 9f709c5d12a2..314b99fc378a 100644 --- a/src/Umbraco.Web.UI.Client/package.json +++ b/src/Umbraco.Web.UI.Client/package.json @@ -130,7 +130,6 @@ "./external/openid": "./dist-cms/external/openid/index.js", "./external/rxjs": "./dist-cms/external/rxjs/index.js", "./external/signalr": "./dist-cms/external/signalr/index.js", - "./external/tiptap": "./dist-cms/external/tiptap/index.js", "./external/uui": "./dist-cms/external/uui/index.js" }, "files": [ diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts b/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts deleted file mode 100644 index b5443ee31993..000000000000 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts +++ /dev/null @@ -1,131 +0,0 @@ -// REQUIRED EXTENSIONS -export * from '@tiptap/core'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - Document, -} from '@tiptap/extension-document'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - Dropcursor, -} from '@tiptap/extension-dropcursor'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - Gapcursor, -} from '@tiptap/extension-gapcursor'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - HardBreak, -} from '@tiptap/extension-hard-break'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - History, -} from '@tiptap/extension-history'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - Paragraph, -} from '@tiptap/extension-paragraph'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - Placeholder, -} from '@tiptap/extension-placeholder'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - Text, -} from '@tiptap/extension-text'; - -// OPTIONAL EXTENSIONS -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - Blockquote, -} from '@tiptap/extension-blockquote'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - Bold, -} from '@tiptap/extension-bold'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - BulletList, -} from '@tiptap/extension-bullet-list'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - CharacterCount, -} from '@tiptap/extension-character-count'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - Code, -} from '@tiptap/extension-code'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - CodeBlock, -} from '@tiptap/extension-code-block'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - Heading, -} from '@tiptap/extension-heading'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - HorizontalRule, -} from '@tiptap/extension-horizontal-rule'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - Image, -} from '@tiptap/extension-image'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - Italic, -} from '@tiptap/extension-italic'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - Link, -} from '@tiptap/extension-link'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - ListItem, -} from '@tiptap/extension-list-item'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - OrderedList, -} from '@tiptap/extension-ordered-list'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - Strike, -} from '@tiptap/extension-strike'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - Subscript, -} from '@tiptap/extension-subscript'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - Superscript, -} from '@tiptap/extension-superscript'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - Table, -} from '@tiptap/extension-table'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - TableCell, -} from '@tiptap/extension-table-cell'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - TableHeader, -} from '@tiptap/extension-table-header'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - TableRow, -} from '@tiptap/extension-table-row'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - TextAlign, -} from '@tiptap/extension-text-align'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - TextStyle, -} from '@tiptap/extension-text-style'; -export { - /** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ - Underline, -} from '@tiptap/extension-underline'; - -/** @deprecated No longer used internally. This will be removed in Umbraco 17. [LK] */ -export { StarterKit } from '@tiptap/starter-kit'; diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/package.json b/src/Umbraco.Web.UI.Client/src/external/tiptap/package.json deleted file mode 100644 index 61a34ee1c9f5..000000000000 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/package.json +++ /dev/null @@ -1,44 +0,0 @@ -{ - "name": "@umbraco-backoffice/external-tiptap", - "private": true, - "type": "module", - "scripts": { - "build": "vite build" - }, - "dependencies": { - "@tiptap/core": "2.26.1", - "@tiptap/extension-blockquote": "2.26.1", - "@tiptap/extension-bold": "2.26.1", - "@tiptap/extension-bullet-list": "2.26.1", - "@tiptap/extension-character-count": "2.26.1", - "@tiptap/extension-code-block": "2.26.1", - "@tiptap/extension-code": "2.26.1", - "@tiptap/extension-document": "2.26.1", - "@tiptap/extension-dropcursor": "2.26.1", - "@tiptap/extension-gapcursor": "2.26.1", - "@tiptap/extension-hard-break": "2.26.1", - "@tiptap/extension-heading": "2.26.1", - "@tiptap/extension-history": "2.26.1", - "@tiptap/extension-horizontal-rule": "2.26.1", - "@tiptap/extension-image": "2.26.1", - "@tiptap/extension-italic": "2.26.1", - "@tiptap/extension-link": "2.26.1", - "@tiptap/extension-list-item": "2.26.1", - "@tiptap/extension-ordered-list": "2.26.1", - "@tiptap/extension-paragraph": "2.26.1", - "@tiptap/extension-placeholder": "2.26.1", - "@tiptap/extension-strike": "2.26.1", - "@tiptap/extension-subscript": "2.26.1", - "@tiptap/extension-superscript": "2.26.1", - "@tiptap/extension-table": "2.26.1", - "@tiptap/extension-table-cell": "2.26.1", - "@tiptap/extension-table-header": "2.26.1", - "@tiptap/extension-table-row": "2.26.1", - "@tiptap/extension-text-align": "2.26.1", - "@tiptap/extension-text-style": "2.26.1", - "@tiptap/extension-text": "2.26.1", - "@tiptap/extension-underline": "2.26.1", - "@tiptap/pm": "2.26.1", - "@tiptap/starter-kit": "2.26.1" - } -} diff --git a/src/Umbraco.Web.UI.Client/src/external/tiptap/vite.config.ts b/src/Umbraco.Web.UI.Client/src/external/tiptap/vite.config.ts deleted file mode 100644 index a2f3625dce24..000000000000 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/vite.config.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { defineConfig } from 'vite'; -import { rmSync } from 'fs'; -import { getDefaultConfig } from '../../vite-config-base'; - -const dist = '../../../dist-cms/external/tiptap'; - -// delete the unbundled dist folder -rmSync(dist, { recursive: true, force: true }); - -export default defineConfig({ - ...getDefaultConfig({ - dist, - base: '/umbraco/backoffice/external/tiptap', - entry: { - index: './index.ts', - }, - }), -}); diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/components/input-tiptap/input-tiptap.element.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/components/input-tiptap/input-tiptap.element.ts index 2e898bf7e864..323ee84e5fe9 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/components/input-tiptap/input-tiptap.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/components/input-tiptap/input-tiptap.element.ts @@ -1,4 +1,6 @@ +import { Editor } from '../../externals.js'; import { UmbTiptapRteContext } from '../../contexts/tiptap-rte.context.js'; +import type { Extensions } from '../../externals.js'; import type { UmbTiptapExtensionApi } from '../../extensions/types.js'; import type { UmbTiptapStatusbarValue, UmbTiptapToolbarValue } from '../types.js'; import { @@ -13,12 +15,10 @@ import { } from '@umbraco-cms/backoffice/external/lit'; import { loadManifestApi } from '@umbraco-cms/backoffice/extension-api'; import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry'; -import { Editor } from '@umbraco-cms/backoffice/external/tiptap'; import { UmbChangeEvent } from '@umbraco-cms/backoffice/event'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; import { UmbFormControlMixin } from '@umbraco-cms/backoffice/validation'; import type { CSSResultGroup } from '@umbraco-cms/backoffice/external/lit'; -import type { Extensions } from '@umbraco-cms/backoffice/external/tiptap'; import type { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor'; import '../toolbar/tiptap-toolbar.element.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/components/statusbar/tiptap-statusbar.element.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/components/statusbar/tiptap-statusbar.element.ts index 83aba098b2c7..8f8b24b64913 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/components/statusbar/tiptap-statusbar.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/components/statusbar/tiptap-statusbar.element.ts @@ -1,10 +1,10 @@ import type { UmbTiptapStatusbarValue } from '../types.js'; +import type { Editor } from '../../externals.js'; import { css, customElement, html, nothing, property, repeat } from '@umbraco-cms/backoffice/external/lit'; import { debounce } from '@umbraco-cms/backoffice/utils'; import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; import { UmbExtensionsElementInitializer } from '@umbraco-cms/backoffice/extension-api'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; import type { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor'; /** diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/components/toolbar/tiptap-toolbar-button.element.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/components/toolbar/tiptap-toolbar-button.element.ts index 5360b665487d..172f80193eb2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/components/toolbar/tiptap-toolbar-button.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/components/toolbar/tiptap-toolbar-button.element.ts @@ -1,6 +1,6 @@ +import type { Editor } from '../../externals.js'; import type { ManifestTiptapToolbarExtensionButtonKind } from '../../extensions/index.js'; import type { UmbTiptapToolbarElementApi } from '../../extensions/types.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; import { customElement, html, state, when } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/components/toolbar/tiptap-toolbar-menu.element.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/components/toolbar/tiptap-toolbar-menu.element.ts index 17f55d6c2fd1..621d73f877f7 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/components/toolbar/tiptap-toolbar-menu.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/components/toolbar/tiptap-toolbar-menu.element.ts @@ -1,3 +1,4 @@ +import type { Editor } from '../../externals.js'; import type { ManifestTiptapToolbarExtensionMenuKind, MetaTiptapToolbarMenuItem, @@ -6,7 +7,6 @@ import type { import type { UmbCascadingMenuItem } from '../cascading-menu-popover/cascading-menu-popover.element.js'; import { css, customElement, html, state, when } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; import type { ManifestMenu } from '@umbraco-cms/backoffice/menu'; import '../cascading-menu-popover/cascading-menu-popover.element.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/components/toolbar/tiptap-toolbar.element.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/components/toolbar/tiptap-toolbar.element.ts index 50e548eec36b..0598f6122325 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/components/toolbar/tiptap-toolbar.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/components/toolbar/tiptap-toolbar.element.ts @@ -1,10 +1,10 @@ +import type { Editor } from '../../externals.js'; import type { UmbTiptapToolbarValue } from '../types.js'; import { css, customElement, html, nothing, property, repeat } from '@umbraco-cms/backoffice/external/lit'; import { debounce } from '@umbraco-cms/backoffice/utils'; import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry'; import { UmbExtensionsElementAndApiInitializer } from '@umbraco-cms/backoffice/extension-api'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; import type { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor'; import '../cascading-menu-popover/cascading-menu-popover.element.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/contexts/tiptap-rte.context.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/contexts/tiptap-rte.context.ts index 67b79680f840..1ffa0faabe0f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/contexts/tiptap-rte.context.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/contexts/tiptap-rte.context.ts @@ -1,6 +1,6 @@ +import type { Editor } from '../externals.js'; import { UMB_TIPTAP_RTE_CONTEXT } from './tiptap-rte.context-token.js'; import { UmbContextBase } from '@umbraco-cms/backoffice/class-api'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; export class UmbTiptapRteContext extends UmbContextBase { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/anchor.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/anchor.tiptap-toolbar-api.ts index effff8141fd4..c14747d632ee 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/anchor.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/anchor.tiptap-toolbar-api.ts @@ -1,8 +1,8 @@ +import type { Editor } from '../../externals.js'; import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import { UMB_TIPTAP_ANCHOR_MODAL } from './modals/index.js'; import { Anchor } from './anchor.tiptap-extension.js'; +import { UMB_TIPTAP_ANCHOR_MODAL } from './modals/index.js'; import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapToolbarAnchorExtensionApi extends UmbTiptapToolbarElementApiBase { override async execute(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/block/block.tipap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/block/block.tipap-api.ts index 04344ca85a08..f5f6b131bd33 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/block/block.tipap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/block/block.tipap-api.ts @@ -1,6 +1,6 @@ +import { Node } from '../../externals.js'; import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; import { distinctUntilChanged } from '@umbraco-cms/backoffice/external/rxjs'; -import { Node } from '@umbraco-cms/backoffice/external/tiptap'; import { UMB_BLOCK_RTE_DATA_CONTENT_KEY } from '@umbraco-cms/backoffice/rte'; import { UMB_BLOCK_RTE_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/block-rte'; import type { UmbBlockDataModel } from '@umbraco-cms/backoffice/block'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/block/block.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/block/block.tiptap-toolbar-api.ts index 822f52a9b984..98f5981381d3 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/block/block.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/block/block.tiptap-toolbar-api.ts @@ -1,6 +1,6 @@ +import type { Editor } from '../../externals.js'; import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; import { UMB_BLOCK_RTE_MANAGER_CONTEXT, UMB_BLOCK_RTE_ENTRIES_CONTEXT } from '@umbraco-cms/backoffice/block-rte'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; import type { UmbBlockTypeBaseModel } from '@umbraco-cms/backoffice/block-type'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/blockquote/blockquote.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/blockquote/blockquote.tiptap-api.ts index 4f8875b256ab..ea5ef9ad00ed 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/blockquote/blockquote.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/blockquote/blockquote.tiptap-api.ts @@ -1,6 +1,6 @@ +import { Blockquote } from '../../externals.js'; import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; import { css } from '@umbraco-cms/backoffice/external/lit'; -import { Blockquote } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapBlockquoteExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [Blockquote]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/blockquote/blockquote.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/blockquote/blockquote.tiptap-toolbar-api.ts index d1ad325bec48..6aba2ae3ac8e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/blockquote/blockquote.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/blockquote/blockquote.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ +import type { Editor } from '../../externals.js'; import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapToolbarBlockquoteExtensionApi extends UmbTiptapToolbarElementApiBase { override execute(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bold/bold.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bold/bold.tiptap-api.ts index 728eea4327e5..96e342487f59 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bold/bold.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bold/bold.tiptap-api.ts @@ -1,5 +1,5 @@ +import { Bold } from '../../externals.js'; import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; -import { Bold } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapBoldExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [Bold]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bold/bold.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bold/bold.tiptap-toolbar-api.ts index 347eef751c2e..ac10192a3afb 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bold/bold.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bold/bold.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ +import type { Editor } from '../../externals.js'; import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapToolbarBoldExtensionApi extends UmbTiptapToolbarElementApiBase { override execute(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bullet-list/bullet-list.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bullet-list/bullet-list.tiptap-api.ts index 48a6c6b648f2..afc7f01e9019 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bullet-list/bullet-list.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bullet-list/bullet-list.tiptap-api.ts @@ -1,6 +1,6 @@ +import { BulletList, ListItem } from '../../externals.js'; import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; import { css } from '@umbraco-cms/backoffice/external/lit'; -import { BulletList, ListItem } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapBulletListExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [ListItem, BulletList]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bullet-list/bullet-list.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bullet-list/bullet-list.tiptap-toolbar-api.ts index c22320cadb86..fe6040dcb1dc 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bullet-list/bullet-list.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bullet-list/bullet-list.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ +import type { Editor } from '../../externals.js'; import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapToolbarBulletListExtensionApi extends UmbTiptapToolbarElementApiBase { override execute(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/character-map/character-map.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/character-map/character-map.tiptap-toolbar-api.ts index ad9167997661..da9e0e26bb70 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/character-map/character-map.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/character-map/character-map.tiptap-toolbar-api.ts @@ -1,7 +1,7 @@ +import type { Editor } from '../../externals.js'; import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; import { UMB_TIPTAP_CHARACTER_MAP_MODAL } from './modals/index.js'; import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapToolbarCharacterMapExtensionApi extends UmbTiptapToolbarElementApiBase { override async execute(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/clear-formatting/clear-formatting.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/clear-formatting/clear-formatting.tiptap-toolbar-api.ts index 100ed185cbf4..0ee6d1efbede 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/clear-formatting/clear-formatting.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/clear-formatting/clear-formatting.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ +import type { Editor } from '../../externals.js'; import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapToolbarClearFormattingExtensionApi extends UmbTiptapToolbarElementApiBase { override execute(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/code-block/code-block.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/code-block/code-block.tiptap-api.ts index b3a4228ecbcd..41399e9b56b9 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/code-block/code-block.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/code-block/code-block.tiptap-api.ts @@ -1,6 +1,6 @@ +import { Code, CodeBlock } from '../../externals.js'; import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; import { css } from '@umbraco-cms/backoffice/external/lit'; -import { Code, CodeBlock } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapCodeBlockExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [Code, CodeBlock]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/code-block/code-block.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/code-block/code-block.tiptap-toolbar-api.ts index 496148f69b81..79b7a6841d83 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/code-block/code-block.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/code-block/code-block.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ +import type { Editor } from '../../externals.js'; import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapToolbarCodeBlockExtensionApi extends UmbTiptapToolbarElementApiBase { override execute(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/core/rich-text-essentials.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/core/rich-text-essentials.tiptap-api.ts index c67a42801e61..694d2b2e79fe 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/core/rich-text-essentials.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/core/rich-text-essentials.tiptap-api.ts @@ -1,13 +1,5 @@ +import { Document, Dropcursor, Gapcursor, HardBreak, History, Paragraph, Text } from '../../externals.js'; import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; -import { - Document, - Dropcursor, - Gapcursor, - HardBreak, - History, - Paragraph, - Text, -} from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapRichTextEssentialsExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [Document, Dropcursor, Gapcursor, HardBreak, History, Paragraph, Text]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/element-path/element-path.tiptap-statusbar-element.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/element-path/element-path.tiptap-statusbar-element.ts index 181e5c2267da..aed522edfc04 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/element-path/element-path.tiptap-statusbar-element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/element-path/element-path.tiptap-statusbar-element.ts @@ -1,6 +1,6 @@ +import type { Editor } from '../../externals.js'; import { css, customElement, html, map, nothing, state } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; @customElement('umb-tiptap-statusbar-element-path') export class UmbTiptapStatusbarElementPathElement extends UmbLitElement { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/embedded-media.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/embedded-media.tiptap-toolbar-api.ts index 79fe1549c664..dd463516dcf6 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/embedded-media.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/embedded-media.tiptap-toolbar-api.ts @@ -1,8 +1,8 @@ +import type { Editor } from '../../externals.js'; import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; import { umbEmbeddedMedia } from './embedded-media.tiptap-extension.js'; import { UMB_EMBEDDED_MEDIA_MODAL } from '@umbraco-cms/backoffice/embedded-media'; import { umbOpenModal } from '@umbraco-cms/backoffice/modal'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapToolbarEmbeddedMediaExtensionApi extends UmbTiptapToolbarElementApiBase { override async execute(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/font-family/font-family.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/font-family/font-family.tiptap-toolbar-api.ts index fa5e1a7a9a24..ae1256b6a4e3 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/font-family/font-family.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/font-family/font-family.tiptap-toolbar-api.ts @@ -1,6 +1,6 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; +import type { Editor } from '../../externals.js'; import type { MetaTiptapToolbarMenuItem } from '../types.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapToolbarFontFamilyExtensionApi extends UmbTiptapToolbarElementApiBase { override isActive(editor?: Editor, item?: MetaTiptapToolbarMenuItem) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/font-size/font-size.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/font-size/font-size.tiptap-toolbar-api.ts index 29ad66e40d5c..4dc099d5f9a5 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/font-size/font-size.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/font-size/font-size.tiptap-toolbar-api.ts @@ -1,6 +1,6 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; +import type { Editor } from '../../externals.js'; import type { MetaTiptapToolbarMenuItem } from '../types.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapToolbarFontSizeExtensionApi extends UmbTiptapToolbarElementApiBase { override isActive(editor?: Editor, item?: MetaTiptapToolbarMenuItem) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/heading/heading.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/heading/heading.tiptap-api.ts index 240f330e7070..ca0b418d91a7 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/heading/heading.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/heading/heading.tiptap-api.ts @@ -1,6 +1,6 @@ +import { Heading } from '../../externals.js'; import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; import { css } from '@umbraco-cms/backoffice/external/lit'; -import { Heading } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapHeadingExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [Heading]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/heading/heading1.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/heading/heading1.tiptap-toolbar-api.ts index 3f1993557c09..838a12beb1d3 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/heading/heading1.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/heading/heading1.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ +import type { Editor } from '../../externals.js'; import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapToolbarHeading1ExtensionApi extends UmbTiptapToolbarElementApiBase { override isActive(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/heading/heading2.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/heading/heading2.tiptap-toolbar-api.ts index 345824512abc..4aaa7365013a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/heading/heading2.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/heading/heading2.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ +import type { Editor } from '../../externals.js'; import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapToolbarHeading2ExtensionApi extends UmbTiptapToolbarElementApiBase { override isActive(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/heading/heading3.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/heading/heading3.tiptap-toolbar-api.ts index 3706b6c8bcf4..9caa0e1d4c35 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/heading/heading3.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/heading/heading3.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ +import type { Editor } from '../../externals.js'; import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapToolbarHeading3ExtensionApi extends UmbTiptapToolbarElementApiBase { override isActive(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/horizontal-rule/horizontal-rule.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/horizontal-rule/horizontal-rule.tiptap-api.ts index b07d0ca74de0..d056215a689b 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/horizontal-rule/horizontal-rule.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/horizontal-rule/horizontal-rule.tiptap-api.ts @@ -1,5 +1,5 @@ +import { HorizontalRule } from '../../externals.js'; import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; -import { HorizontalRule } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapHorizontalRuleExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [HorizontalRule]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/horizontal-rule/horizontal-rule.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/horizontal-rule/horizontal-rule.tiptap-toolbar-api.ts index 2305c5d8dcaf..79a60bd168b5 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/horizontal-rule/horizontal-rule.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/horizontal-rule/horizontal-rule.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ +import type { Editor } from '../../externals.js'; import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapToolbarHorizontalRuleExtensionApi extends UmbTiptapToolbarElementApiBase { override execute(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-class/html-attr-class.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-class/html-attr-class.tiptap-extension.ts index f3ccb51115bb..ac4239293b07 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-class/html-attr-class.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-class/html-attr-class.tiptap-extension.ts @@ -1,5 +1,5 @@ -import { Extension } from '@umbraco-cms/backoffice/external/tiptap'; -import type { Attributes } from '@umbraco-cms/backoffice/external/tiptap'; +import { Extension } from '../../externals.js'; +import type { Attributes } from '../../externals.js'; declare module '@tiptap/core' { interface Commands { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-dataset/html-attr-dataset.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-dataset/html-attr-dataset.tiptap-extension.ts index 5d4428b402bd..1069a5b654f3 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-dataset/html-attr-dataset.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-dataset/html-attr-dataset.tiptap-extension.ts @@ -1,5 +1,5 @@ -import { Extension } from '@umbraco-cms/backoffice/external/tiptap'; -import type { Attributes } from '@umbraco-cms/backoffice/external/tiptap'; +import { Extension } from '../../externals.js'; +import type { Attributes } from '../../externals.js'; declare module '@tiptap/core' { interface Commands { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-id/html-attr-id.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-id/html-attr-id.tiptap-extension.ts index 5055232f26e9..192bed6882a1 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-id/html-attr-id.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-id/html-attr-id.tiptap-extension.ts @@ -1,5 +1,5 @@ -import { Extension } from '@umbraco-cms/backoffice/external/tiptap'; -import type { Attributes } from '@umbraco-cms/backoffice/external/tiptap'; +import { Extension } from '../../externals.js'; +import type { Attributes } from '../../externals.js'; declare module '@tiptap/core' { interface Commands { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-style/html-attr-style.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-style/html-attr-style.tiptap-extension.ts index a17e9758a463..d0e25ee600b6 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-style/html-attr-style.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-style/html-attr-style.tiptap-extension.ts @@ -1,5 +1,5 @@ -import { Extension } from '@umbraco-cms/backoffice/external/tiptap'; -import type { Attributes } from '@umbraco-cms/backoffice/external/tiptap'; +import { Extension } from '../../externals.js'; +import type { Attributes } from '../../externals.js'; declare module '@tiptap/core' { interface Commands { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/image/image.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/image/image.tiptap-extension.ts index 7fa651bc16fa..6663595415cb 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/image/image.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/image/image.tiptap-extension.ts @@ -1,4 +1,4 @@ -import { Image } from '@umbraco-cms/backoffice/external/tiptap'; +import { Image } from '../../externals.js'; export interface UmbImageAttributes { src: string; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/italic/italic.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/italic/italic.tiptap-api.ts index 29300a4ee545..c0093a516016 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/italic/italic.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/italic/italic.tiptap-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; -import { Italic } from '@umbraco-cms/backoffice/external/tiptap'; +import { Italic } from '../../externals.js'; export default class UmbTiptapItalicExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [Italic]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/italic/italic.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/italic/italic.tiptap-toolbar-api.ts index 68d1f7620b03..f7b406fa9448 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/italic/italic.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/italic/italic.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Editor } from '../../externals.js'; export default class UmbTiptapToolbarItalicExtensionApi extends UmbTiptapToolbarElementApiBase { override execute(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/link.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/link.tiptap-extension.ts index fe5c6ac94410..65f96785954e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/link.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/link.tiptap-extension.ts @@ -1,4 +1,4 @@ -import { Link } from '@umbraco-cms/backoffice/external/tiptap'; +import { Link } from '../../externals.js'; export const UmbLink = Link.extend({ name: 'umbLink', diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/link.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/link.tiptap-toolbar-api.ts index 622bc4f1f76d..50f3ecb684a7 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/link.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/link.tiptap-toolbar-api.ts @@ -1,8 +1,8 @@ +import type { Editor } from '../../externals.js'; import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; import { UmbLink } from './link.tiptap-extension.js'; import { UMB_LINK_PICKER_MODAL } from '@umbraco-cms/backoffice/multi-url-picker'; import { umbOpenModal } from '@umbraco-cms/backoffice/modal'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; import type { UmbLinkPickerLink } from '@umbraco-cms/backoffice/multi-url-picker'; import type { UUIModalSidebarSize } from '@umbraco-cms/backoffice/external/uui'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/unlink.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/unlink.tiptap-toolbar-api.ts index 43c8ea90132c..b3e89a4e9972 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/unlink.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/link/unlink.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ +import type { Editor } from '../../externals.js'; import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapToolbarUnlinkExtensionApi extends UmbTiptapToolbarElementApiBase { override isActive = (editor?: Editor) => editor?.isActive('umbLink') === true; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/media-picker/media-picker.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/media-picker/media-picker.tiptap-toolbar-api.ts index 7971a4254097..f07fd645308e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/media-picker/media-picker.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/media-picker/media-picker.tiptap-toolbar-api.ts @@ -1,10 +1,10 @@ +import type { Editor } from '../../externals.js'; import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; import { getGuidFromUdi, imageSize } from '@umbraco-cms/backoffice/utils'; import { ImageCropModeModel } from '@umbraco-cms/backoffice/external/backend-api'; import { UmbImagingRepository } from '@umbraco-cms/backoffice/imaging'; import { UMB_MEDIA_CAPTION_ALT_TEXT_MODAL, UMB_MEDIA_PICKER_MODAL } from '@umbraco-cms/backoffice/media'; import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import type { UmbMediaCaptionAltTextModalValue } from '@umbraco-cms/backoffice/media'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/media-upload/media-upload.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/media-upload/media-upload.tiptap-api.ts index 46dfaa0620a0..d158b9e51bf0 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/media-upload/media-upload.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/media-upload/media-upload.tiptap-api.ts @@ -1,12 +1,12 @@ +import { Extension } from '../../externals.js'; import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; +import type { Editor } from '../../externals.js'; import type { UmbTiptapExtensionArgs } from '../types.js'; import { imageSize } from '@umbraco-cms/backoffice/utils'; -import { Extension } from '@umbraco-cms/backoffice/external/tiptap'; import { TemporaryFileStatus, UmbTemporaryFileManager } from '@umbraco-cms/backoffice/temporary-file'; import { UmbId } from '@umbraco-cms/backoffice/id'; import { UmbLocalizationController } from '@umbraco-cms/backoffice/localization-api'; import { UMB_NOTIFICATION_CONTEXT } from '@umbraco-cms/backoffice/notification'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; import type { UmbControllerHost } from '@umbraco-cms/backoffice/controller-api'; import type { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor'; import type { UmbTemporaryFileModel } from '@umbraco-cms/backoffice/temporary-file'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/ordered-list/ordered-list.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/ordered-list/ordered-list.tiptap-api.ts index 8583b4e860c5..bf8382e5e7eb 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/ordered-list/ordered-list.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/ordered-list/ordered-list.tiptap-api.ts @@ -1,6 +1,6 @@ +import { ListItem, OrderedList } from '../../externals.js'; import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; import { css } from '@umbraco-cms/backoffice/external/lit'; -import { ListItem, OrderedList } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTiptapOrderedListExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [ListItem, OrderedList]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/ordered-list/ordered-list.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/ordered-list/ordered-list.tiptap-toolbar-api.ts index 77a3932eebaa..437b5d781387 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/ordered-list/ordered-list.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/ordered-list/ordered-list.tiptap-toolbar-api.ts @@ -1,6 +1,6 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import { OrderedList, ListItem } from '@umbraco-cms/backoffice/external/tiptap'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import { OrderedList, ListItem } from '../../externals.js'; +import type { Editor } from '../../externals.js'; export default class UmbTiptapToolbarOrderedListExtensionApi extends UmbTiptapToolbarElementApiBase { getTiptapExtensions = () => [OrderedList, ListItem]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/strike/strike.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/strike/strike.tiptap-api.ts index 7d77e786f3ac..f5acf26df213 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/strike/strike.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/strike/strike.tiptap-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; -import { Strike } from '@umbraco-cms/backoffice/external/tiptap'; +import { Strike } from '../../externals.js'; export default class UmbTiptapStrikeExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [Strike]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/strike/strike.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/strike/strike.tiptap-toolbar-api.ts index a006983323b0..a0e8329aadcc 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/strike/strike.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/strike/strike.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Editor } from '../../externals.js'; export default class UmbTiptapToolbarStrikeExtensionApi extends UmbTiptapToolbarElementApiBase { override execute(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/style-menu/style-menu.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/style-menu/style-menu.tiptap-toolbar-api.ts index 9d68f0e176f7..f3b991cb4959 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/style-menu/style-menu.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/style-menu/style-menu.tiptap-toolbar-api.ts @@ -1,6 +1,6 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; import type { MetaTiptapToolbarStyleMenuItem } from '../../extensions/types.js'; -import type { ChainedCommands, Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { ChainedCommands, Editor } from '../../externals.js'; type UmbTiptapToolbarStyleMenuCommandType = { type: string; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/subscript/subscript.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/subscript/subscript.tiptap-api.ts index d1d14d23d537..708ba4270996 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/subscript/subscript.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/subscript/subscript.tiptap-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; -import { Subscript } from '@umbraco-cms/backoffice/external/tiptap'; +import { Subscript } from '../../externals.js'; export default class UmbTiptapBoldExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [Subscript]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/subscript/subscript.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/subscript/subscript.tiptap-toolbar-api.ts index 90a5d9e3ec1f..0212acaa2bc9 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/subscript/subscript.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/subscript/subscript.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Editor } from '../../externals.js'; export default class UmbTiptapToolbarSubscriptExtensionApi extends UmbTiptapToolbarElementApiBase { override execute(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/superscript/superscript.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/superscript/superscript.tiptap-api.ts index ec72e4be6f8f..1b365698c49c 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/superscript/superscript.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/superscript/superscript.tiptap-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; -import { Superscript } from '@umbraco-cms/backoffice/external/tiptap'; +import { Superscript } from '../../externals.js'; export default class UmbTiptapBoldExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [Superscript]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/superscript/superscript.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/superscript/superscript.tiptap-toolbar-api.ts index 38141e2a2046..f38360c40b96 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/superscript/superscript.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/superscript/superscript.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Editor } from '../../externals.js'; export default class UmbTiptapToolbarSuperscriptExtensionApi extends UmbTiptapToolbarElementApiBase { override execute(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/actions/table-properties.action.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/actions/table-properties.action.ts index 64add0ac0517..cd6984d38b1e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/actions/table-properties.action.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/actions/table-properties.action.ts @@ -1,8 +1,8 @@ +import type { Editor } from '../../../externals.js'; import { UmbTiptapMenuItemActionApi } from '../../../components/menu/tiptap-menu-item-api-base.js'; import { UMB_TIPTAP_RTE_CONTEXT } from '../../../contexts/tiptap-rte.context-token.js'; import { UMB_TIPTAP_TABLE_PROPERTIES_MODAL } from '../modals/table-properties-modal.token.js'; import { UMB_MODAL_MANAGER_CONTEXT } from '@umbraco-cms/backoffice/modal'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; export default class UmbTablePropertiesAction extends UmbTiptapMenuItemActionApi { async #tableProperties(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/components/table-column-menu.element.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/components/table-column-menu.element.ts index a8b434b62a68..c7715c789d78 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/components/table-column-menu.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/components/table-column-menu.element.ts @@ -1,6 +1,7 @@ +import type { Editor } from '../../../externals.js'; +import type { UmbTiptapBubbleMenuElement } from '../../bubble-menu/bubble-menu.tiptap-extension.js'; import { css, customElement, html, property } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; -import type { Editor, UmbTiptapBubbleMenuElement } from '@umbraco-cms/backoffice/external/tiptap'; /** @deprecated No longer used internally. This will be removed in Umbraco 17. [LK] */ @customElement('umb-tiptap-table-column-menu') diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/components/table-insert.element.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/components/table-insert.element.ts index 3f229a250c62..dc9fc8d0092f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/components/table-insert.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/components/table-insert.element.ts @@ -1,7 +1,7 @@ +import type { Editor } from '../../../externals.js'; import { css, customElement, html, state } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; import type { TemplateResult } from '@umbraco-cms/backoffice/external/lit'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; @customElement('umb-tiptap-table-insert') export class UmbTiptapTableInsertElement extends UmbLitElement { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/components/table-row-menu.element.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/components/table-row-menu.element.ts index 13e38c867ad9..1ed84bc8c52d 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/components/table-row-menu.element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/components/table-row-menu.element.ts @@ -1,6 +1,7 @@ +import type { Editor } from '../../../externals.js'; +import type { UmbTiptapBubbleMenuElement } from '../../bubble-menu/bubble-menu.tiptap-extension.js'; import { css, customElement, html, property } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; -import type { Editor, UmbTiptapBubbleMenuElement } from '@umbraco-cms/backoffice/external/tiptap'; /** @deprecated No longer used internally. This will be removed in Umbraco 17. [LK] */ @customElement('umb-tiptap-table-row-menu') diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/table.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/table.tiptap-toolbar-api.ts index d9bd0b95538d..7b4a992aeb1e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/table.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/table.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Editor } from '../../externals.js'; export default class UmbTiptapToolbarTableExtensionApi extends UmbTiptapToolbarElementApiBase { override isActive(editor?: Editor, item?: unknown) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-align/text-align-center.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-align/text-align-center.tiptap-toolbar-api.ts index 314a82b8c9cc..b9640305ae16 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-align/text-align-center.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-align/text-align-center.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Editor } from '../../externals.js'; export default class UmbTiptapToolbarTextAlignCenterExtensionApi extends UmbTiptapToolbarElementApiBase { override isActive(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-align/text-align-justify.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-align/text-align-justify.tiptap-toolbar-api.ts index 5b986d8d8d26..1136345d6bce 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-align/text-align-justify.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-align/text-align-justify.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Editor } from '../../externals.js'; export default class UmbTiptapToolbarTextAlignJustifyExtensionApi extends UmbTiptapToolbarElementApiBase { override isActive(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-align/text-align-left.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-align/text-align-left.tiptap-toolbar-api.ts index 308e054c3a22..e0d8817fc609 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-align/text-align-left.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-align/text-align-left.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Editor } from '../../externals.js'; export default class UmbTiptapToolbarTextAlignLeftExtensionApi extends UmbTiptapToolbarElementApiBase { override isActive(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-align/text-align-right.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-align/text-align-right.tiptap-toolbar-api.ts index b5e296a59279..ce9e00a2fda6 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-align/text-align-right.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-align/text-align-right.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Editor } from '../../externals.js'; export default class UmbTiptapToolbarTextAlignRightExtensionApi extends UmbTiptapToolbarElementApiBase { override isActive(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-align/text-align.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-align/text-align.tiptap-api.ts index a6db738a3a96..99446f908628 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-align/text-align.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-align/text-align.tiptap-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; -import { TextAlign } from '@umbraco-cms/backoffice/external/tiptap'; +import { TextAlign } from '../../externals.js'; export default class UmbTiptapTextAlignExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [ diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-color/text-color-background.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-color/text-color-background.tiptap-toolbar-api.ts index 4af0aa442918..a41f0c5a7359 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-color/text-color-background.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-color/text-color-background.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Editor } from '../../externals.js'; export default class UmbTiptapToolbarTextColorBackgroundExtensionApi extends UmbTiptapToolbarElementApiBase { override execute(editor?: Editor, selectedColor?: string) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-color/text-color-foreground.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-color/text-color-foreground.tiptap-toolbar-api.ts index 5c023a789e60..16f8aaac41ff 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-color/text-color-foreground.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-color/text-color-foreground.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Editor } from '../../externals.js'; export default class UmbTiptapToolbarTextColorForegroundExtensionApi extends UmbTiptapToolbarElementApiBase { override execute(editor?: Editor, selectedColor?: string) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction-ltr.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction-ltr.tiptap-toolbar-api.ts index b3d7c88d2f5e..1bc19bba3e32 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction-ltr.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction-ltr.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Editor } from '../../externals.js'; export default class UmbTiptapToolbarTextDirectionLtrExtensionApi extends UmbTiptapToolbarElementApiBase { override isActive = (editor?: Editor) => diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction-rtl.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction-rtl.tiptap-toolbar-api.ts index bf4631769d27..2a66a86feb75 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction-rtl.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction-rtl.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Editor } from '../../externals.js'; export default class UmbTiptapToolbarTextDirectionRtlExtensionApi extends UmbTiptapToolbarElementApiBase { override isActive = (editor?: Editor) => editor?.isActive({ textDirection: 'rtl' }) === true; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-indent.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-indent.tiptap-toolbar-api.ts index c0f8791f0e7c..d9fbe1c885cb 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-indent.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-indent.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Editor } from '../../externals.js'; export default class UmbTiptapToolbarTextIndentExtensionApi extends UmbTiptapToolbarElementApiBase { override execute(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-outdent.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-outdent.tiptap-toolbar-api.ts index a11aa01e7c10..838835dedaa7 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-outdent.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-outdent.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Editor } from '../../externals.js'; export default class UmbTiptapToolbarTextOutdentExtensionApi extends UmbTiptapToolbarElementApiBase { override execute(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/tiptap-extension-api-base.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/tiptap-extension-api-base.ts index fd34d161d780..1f8ba068567f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/tiptap-extension-api-base.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/tiptap-extension-api-base.ts @@ -1,7 +1,7 @@ +import type { Editor, Extension, Mark, Node } from '../externals.js'; import type { ManifestTiptapExtension, UmbTiptapExtensionApi, UmbTiptapExtensionArgs } from './types.js'; import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api'; import type { CSSResultGroup } from '@umbraco-cms/backoffice/external/lit'; -import type { Editor, Extension, Mark, Node } from '@umbraco-cms/backoffice/external/tiptap'; export abstract class UmbTiptapExtensionApiBase extends UmbControllerBase implements UmbTiptapExtensionApi { /** diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/tiptap-toolbar-element-api-base.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/tiptap-toolbar-element-api-base.ts index 012a5f2ec7d5..26d4620ef3fd 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/tiptap-toolbar-element-api-base.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/tiptap-toolbar-element-api-base.ts @@ -1,6 +1,6 @@ +import type { Editor } from '../externals.js'; import type { ManifestTiptapToolbarExtension, UmbTiptapToolbarElementApi } from './types.js'; import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; import type { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor'; export abstract class UmbTiptapToolbarElementApiBase extends UmbControllerBase implements UmbTiptapToolbarElementApi { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/types.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/types.ts index 68d57116931a..64941ba3a960 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/types.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/types.ts @@ -1,7 +1,7 @@ +import type { Editor, Extension, Mark, Node } from '../externals.js'; import type { ManifestTiptapExtension } from './tiptap.extension.js'; import type { ManifestTiptapToolbarExtension } from './tiptap-toolbar.extension.js'; import type { CSSResultGroup } from '@umbraco-cms/backoffice/external/lit'; -import type { Editor, Extension, Mark, Node } from '@umbraco-cms/backoffice/external/tiptap'; import type { UmbApi } from '@umbraco-cms/backoffice/extension-api'; import type { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/underline/underline.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/underline/underline.tiptap-api.ts index f5c9ba3d0b41..4cb62b705e71 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/underline/underline.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/underline/underline.tiptap-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; -import { Underline } from '@umbraco-cms/backoffice/external/tiptap'; +import { Underline } from '../../externals.js'; export default class UmbTiptapUnderlineExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [Underline]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/underline/underline.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/underline/underline.tiptap-toolbar-api.ts index 74b3a028d012..adfac9982ce9 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/underline/underline.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/underline/underline.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Editor } from '../../externals.js'; export default class UmbTiptapToolbarUnderlineExtensionApi extends UmbTiptapToolbarElementApiBase { override execute(editor?: Editor) { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/undo-redo/redo.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/undo-redo/redo.tiptap-toolbar-api.ts index f41165d5ca6f..d57e1b92c20f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/undo-redo/redo.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/undo-redo/redo.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Editor } from '../../externals.js'; export default class UmbTiptapToolbarRedoExtensionApi extends UmbTiptapToolbarElementApiBase { override isActive = (editor?: Editor) => editor?.can().redo() === true; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/undo-redo/undo.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/undo-redo/undo.tiptap-toolbar-api.ts index 476ab16e8844..64d833a98515 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/undo-redo/undo.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/undo-redo/undo.tiptap-toolbar-api.ts @@ -1,5 +1,5 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Editor } from '../../externals.js'; export default class UmbTiptapToolbarUndoExtensionApi extends UmbTiptapToolbarElementApiBase { override isActive = (editor?: Editor) => editor?.can().undo() === true; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/view-source/source-editor.tiptap-toolbar-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/view-source/source-editor.tiptap-toolbar-api.ts index c14d35e76cda..5cfbde5e26f0 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/view-source/source-editor.tiptap-toolbar-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/view-source/source-editor.tiptap-toolbar-api.ts @@ -1,7 +1,7 @@ import { UmbTiptapToolbarElementApiBase } from '../tiptap-toolbar-element-api-base.js'; import { UMB_CODE_EDITOR_MODAL } from '@umbraco-cms/backoffice/code-editor'; import { umbOpenModal } from '@umbraco-cms/backoffice/modal'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Editor } from '../../externals.js'; import { UmbLocalizationController } from '@umbraco-cms/backoffice/localization-api'; export default class UmbTiptapToolbarSourceEditorExtensionApi extends UmbTiptapToolbarElementApiBase { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/word-count/word-count.tiptap-api.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/word-count/word-count.tiptap-api.ts index 3ad80c0aa7b1..16ffae9cc864 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/word-count/word-count.tiptap-api.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/word-count/word-count.tiptap-api.ts @@ -1,6 +1,6 @@ import { UmbTiptapExtensionApiBase } from '../tiptap-extension-api-base.js'; import { css } from '@umbraco-cms/backoffice/external/lit'; -import { CharacterCount } from '@umbraco-cms/backoffice/external/tiptap'; +import { CharacterCount } from '../../externals.js'; export default class UmbTiptapWordCountExtensionApi extends UmbTiptapExtensionApiBase { getTiptapExtensions = () => [CharacterCount.configure()]; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/word-count/word-count.tiptap-statusbar-element.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/word-count/word-count.tiptap-statusbar-element.ts index e3e67dafa1dd..95b7c24b29a3 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/word-count/word-count.tiptap-statusbar-element.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/word-count/word-count.tiptap-statusbar-element.ts @@ -1,5 +1,5 @@ import { customElement, html, state } from '@umbraco-cms/backoffice/external/lit'; -import type { Editor } from '@umbraco-cms/backoffice/external/tiptap'; +import type { Editor } from '../../externals.js'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; @customElement('umb-tiptap-statusbar-word-count') diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/externals.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/externals.ts new file mode 100644 index 000000000000..7340599c4bbe --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/externals.ts @@ -0,0 +1,35 @@ +// REQUIRED EXTENSIONS +export * from '@tiptap/core'; +export { Document } from '@tiptap/extension-document'; +export { Dropcursor } from '@tiptap/extension-dropcursor'; +export { Gapcursor } from '@tiptap/extension-gapcursor'; +export { HardBreak } from '@tiptap/extension-hard-break'; +export { History } from '@tiptap/extension-history'; +export { Paragraph } from '@tiptap/extension-paragraph'; +export { Placeholder } from '@tiptap/extension-placeholder'; +export { Text } from '@tiptap/extension-text'; + +// OPTIONAL EXTENSIONS +export { Blockquote } from '@tiptap/extension-blockquote'; +export { Bold } from '@tiptap/extension-bold'; +export { BulletList } from '@tiptap/extension-bullet-list'; +export { CharacterCount } from '@tiptap/extension-character-count'; +export { Code } from '@tiptap/extension-code'; +export { CodeBlock } from '@tiptap/extension-code-block'; +export { Heading } from '@tiptap/extension-heading'; +export { HorizontalRule } from '@tiptap/extension-horizontal-rule'; +export { Image } from '@tiptap/extension-image'; +export { Italic } from '@tiptap/extension-italic'; +export { Link } from '@tiptap/extension-link'; +export { ListItem } from '@tiptap/extension-list-item'; +export { OrderedList } from '@tiptap/extension-ordered-list'; +export { Strike } from '@tiptap/extension-strike'; +export { Subscript } from '@tiptap/extension-subscript'; +export { Superscript } from '@tiptap/extension-superscript'; +export { Table } from '@tiptap/extension-table'; +export { TableCell } from '@tiptap/extension-table-cell'; +export { TableHeader } from '@tiptap/extension-table-header'; +export { TableRow } from '@tiptap/extension-table-row'; +export { TextAlign } from '@tiptap/extension-text-align'; +export { TextStyle } from '@tiptap/extension-text-style'; +export { Underline } from '@tiptap/extension-underline'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/index.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/index.ts index 9e12e5c64c48..92de3285f682 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/index.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/index.ts @@ -1,3 +1,4 @@ +export * from './externals.js'; export * from './constants.js'; export * from './components/index.js'; export * from './contexts/index.js'; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/package.json b/src/Umbraco.Web.UI.Client/src/packages/tiptap/package.json index 00d278e4d95d..25f5cd443ce6 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/package.json +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/package.json @@ -4,5 +4,40 @@ "type": "module", "scripts": { "build": "vite build" + }, + "dependencies": { + "@tiptap/core": "2.26.1", + "@tiptap/extension-blockquote": "2.26.1", + "@tiptap/extension-bold": "2.26.1", + "@tiptap/extension-bullet-list": "2.26.1", + "@tiptap/extension-character-count": "2.26.1", + "@tiptap/extension-code-block": "2.26.1", + "@tiptap/extension-code": "2.26.1", + "@tiptap/extension-document": "2.26.1", + "@tiptap/extension-dropcursor": "2.26.1", + "@tiptap/extension-gapcursor": "2.26.1", + "@tiptap/extension-hard-break": "2.26.1", + "@tiptap/extension-heading": "2.26.1", + "@tiptap/extension-history": "2.26.1", + "@tiptap/extension-horizontal-rule": "2.26.1", + "@tiptap/extension-image": "2.26.1", + "@tiptap/extension-italic": "2.26.1", + "@tiptap/extension-link": "2.26.1", + "@tiptap/extension-list-item": "2.26.1", + "@tiptap/extension-ordered-list": "2.26.1", + "@tiptap/extension-paragraph": "2.26.1", + "@tiptap/extension-placeholder": "2.26.1", + "@tiptap/extension-strike": "2.26.1", + "@tiptap/extension-subscript": "2.26.1", + "@tiptap/extension-superscript": "2.26.1", + "@tiptap/extension-table": "2.26.1", + "@tiptap/extension-table-cell": "2.26.1", + "@tiptap/extension-table-header": "2.26.1", + "@tiptap/extension-table-row": "2.26.1", + "@tiptap/extension-text-align": "2.26.1", + "@tiptap/extension-text-style": "2.26.1", + "@tiptap/extension-text": "2.26.1", + "@tiptap/extension-underline": "2.26.1", + "@tiptap/pm": "2.26.1" } } diff --git a/src/Umbraco.Web.UI.Client/tsconfig.json b/src/Umbraco.Web.UI.Client/tsconfig.json index c2ec31a43d91..28abd9fc1fee 100644 --- a/src/Umbraco.Web.UI.Client/tsconfig.json +++ b/src/Umbraco.Web.UI.Client/tsconfig.json @@ -159,7 +159,6 @@ DON'T EDIT THIS FILE DIRECTLY. It is generated by /devops/tsconfig/index.js "@umbraco-cms/backoffice/external/openid": ["./src/external/openid/index.ts"], "@umbraco-cms/backoffice/external/rxjs": ["./src/external/rxjs/index.ts"], "@umbraco-cms/backoffice/external/signalr": ["./src/external/signalr/index.ts"], - "@umbraco-cms/backoffice/external/tiptap": ["./src/external/tiptap/index.ts"], "@umbraco-cms/backoffice/external/uui": ["./src/external/uui/index.ts"] } }, From 4c2971ecd961a16d824bb5f25adc9913ae24ea41 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 24 Sep 2025 16:34:28 +0100 Subject: [PATCH 15/16] `import` fixes --- .../anchor/anchor.tiptap-extension.ts | 4 +- .../bubble-menu.tiptap-extension.ts | 10 +- .../embedded-media.tiptap-extension.ts | 4 +- .../figure/figcaption.tiptap-extension.ts | 4 +- .../figure/figure.tiptap-extension.ts | 4 +- .../html-tag-div.tiptap-extension.ts | 4 +- .../html-tag-span.tiptap-extension.ts | 7 +- .../table/table.tiptap-extension.ts | 138 +++++++++--------- .../text-direction.tiptap-extension.ts | 4 +- .../text-indent.tiptap-extension.ts | 6 +- .../trailing-node.tiptap-extension.ts | 5 +- 11 files changed, 88 insertions(+), 102 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/anchor.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/anchor.tiptap-extension.ts index 52ca3b8b015a..56e4bfa38c48 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/anchor.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/anchor/anchor.tiptap-extension.ts @@ -1,6 +1,4 @@ -/* eslint-disable local-rules/enforce-umbraco-external-imports */ - -import { Node, mergeAttributes } from '@tiptap/core'; +import { Node, mergeAttributes } from '../../externals.js'; export const Anchor = Node.create({ name: 'anchor', diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bubble-menu/bubble-menu.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bubble-menu/bubble-menu.tiptap-extension.ts index b9c0ac76db5b..65aef4ee8dfc 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bubble-menu/bubble-menu.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bubble-menu/bubble-menu.tiptap-extension.ts @@ -1,10 +1,10 @@ -/* eslint-disable @typescript-eslint/consistent-type-imports */ /* eslint-disable local-rules/enforce-umbraco-external-imports */ -import { Extension, Editor } from '@tiptap/core'; -import { EditorState, Plugin } from '@tiptap/pm/state'; -import { EditorView } from '@tiptap/pm/view'; -import type { PluginView } from '@tiptap/pm/state'; +import { Extension } from '../../externals.js'; +import type { Editor } from '../../externals.js'; +import { Plugin } from '@tiptap/pm/state'; +import type { EditorState, PluginView } from '@tiptap/pm/state'; +import type { EditorView } from '@tiptap/pm/view'; import type { UUIPopoverContainerElement } from '@umbraco-cms/backoffice/external/uui'; export interface UmbTiptapBubbleMenuElement extends HTMLElement { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/embedded-media.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/embedded-media.tiptap-extension.ts index 17a82d995517..f7e981ad4fb2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/embedded-media.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/embedded-media/embedded-media.tiptap-extension.ts @@ -1,6 +1,4 @@ -/* eslint-disable local-rules/enforce-umbraco-external-imports */ - -import { mergeAttributes, Node } from '@tiptap/core'; +import { mergeAttributes, Node } from '../../externals.js'; export interface UmbEmbeddedMediaOptions { inline: boolean; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figcaption.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figcaption.tiptap-extension.ts index fc9efe22762f..242d39fcfc06 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figcaption.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figcaption.tiptap-extension.ts @@ -1,6 +1,4 @@ -/* eslint-disable local-rules/enforce-umbraco-external-imports */ - -import { Node } from '@tiptap/core'; +import { Node } from '../../externals.js'; export interface UmbFigcaptionOptions { /** diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figure.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figure.tiptap-extension.ts index 6bc0dcd4b40c..663714407e70 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figure.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figure.tiptap-extension.ts @@ -1,6 +1,4 @@ -/* eslint-disable local-rules/enforce-umbraco-external-imports */ - -import { mergeAttributes, Node } from '@tiptap/core'; +import { mergeAttributes, Node } from '../../externals.js'; export interface UmbFigureOptions { /** diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-div/html-tag-div.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-div/html-tag-div.tiptap-extension.ts index 1da4fc07a6dd..bf4c830c0f46 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-div/html-tag-div.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-div/html-tag-div.tiptap-extension.ts @@ -1,6 +1,4 @@ -/* eslint-disable local-rules/enforce-umbraco-external-imports */ - -import { Node, mergeAttributes } from '@tiptap/core'; +import { Node, mergeAttributes } from '../../externals.js'; export interface UmbHtmlTagDivOptions { /** diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-span/html-tag-span.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-span/html-tag-span.tiptap-extension.ts index 52bc401512b8..98436fd59e4a 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-span/html-tag-span.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-span/html-tag-span.tiptap-extension.ts @@ -1,7 +1,4 @@ -/* eslint-disable jsdoc/require-jsdoc */ -/* eslint-disable local-rules/enforce-umbraco-external-imports */ - -import { Mark, mergeAttributes } from '@tiptap/core'; +import { Mark, mergeAttributes } from '../../externals.js'; export interface UmbHtmlTagSpanOptions { /** @@ -12,6 +9,7 @@ export interface UmbHtmlTagSpanOptions { HTMLAttributes: Record; } +// eslint-disable-next-line jsdoc/require-jsdoc function parseStyles(style: string | undefined): Record { const items: Record = {}; @@ -29,6 +27,7 @@ function parseStyles(style: string | undefined): Record { return items; } +// eslint-disable-next-line jsdoc/require-jsdoc function serializeStyles(items: Record): string { return ( Object.entries(items) diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/table.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/table.tiptap-extension.ts index 9684a77ecc43..66c92500ab3b 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/table.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/table.tiptap-extension.ts @@ -1,16 +1,13 @@ -/* eslint-disable @typescript-eslint/consistent-type-imports */ /* eslint-disable local-rules/enforce-umbraco-external-imports */ - +import { findParentNode, Table, TableCell, TableHeader, TableRow } from '../../externals.js'; import { UmbBubbleMenuPlugin } from '../bubble-menu/bubble-menu.tiptap-extension.js'; +import type { Editor } from '../../externals.js'; import { CellSelection, TableMap, TableView } from '@tiptap/pm/tables'; -import { Decoration, DecorationSet, EditorView } from '@tiptap/pm/view'; -import { EditorState, Plugin, Selection, Transaction } from '@tiptap/pm/state'; -import { findParentNode, Editor } from '@tiptap/core'; -import { Node as ProseMirrorNode } from '@tiptap/pm/model'; -import { Table } from '@tiptap/extension-table'; -import { TableCell } from '@tiptap/extension-table-cell'; -import { TableHeader } from '@tiptap/extension-table-header'; -import { TableRow } from '@tiptap/extension-table-row'; +import { Decoration, DecorationSet } from '@tiptap/pm/view'; +import { Plugin } from '@tiptap/pm/state'; +import type { EditorView } from '@tiptap/pm/view'; +import type { EditorState, Selection, Transaction } from '@tiptap/pm/state'; +import type { Node as ProseMirrorNode, ResolvedPos } from '@tiptap/pm/model'; import type { Rect } from '@tiptap/pm/tables'; // NOTE: Custom TableView, to allow for custom styles to be applied to the
element. [LK] @@ -69,9 +66,9 @@ export const UmbTableHeader = TableHeader.extend({ }, addProseMirrorPlugins() { - //const { editor } = this; + const { editor } = this; return [ - UmbBubbleMenuPlugin(this.editor, { + UmbBubbleMenuPlugin(editor, { unique: 'table-column-menu', placement: 'top', elementName: 'umb-tiptap-menu', @@ -83,7 +80,7 @@ export const UmbTableHeader = TableHeader.extend({ new Plugin({ props: { decorations: (state) => { - const { isEditable } = this.editor; + const { isEditable } = editor; if (!isEditable) { return DecorationSet.empty; @@ -108,7 +105,7 @@ export const UmbTableHeader = TableHeader.extend({ grip.addEventListener('mousedown', (event) => { event.preventDefault(); event.stopImmediatePropagation(); - this.editor.view.dispatch(selectColumn(index)(this.editor.state.tr)); + editor.view.dispatch(selectColumn(index)(editor.state.tr)); }); return grip; @@ -162,9 +159,9 @@ export const UmbTableCell = TableCell.extend({ }, addProseMirrorPlugins() { - //const { editor } = this; + const { editor } = this; return [ - UmbBubbleMenuPlugin(this.editor, { + UmbBubbleMenuPlugin(editor, { unique: 'table-row-menu', placement: 'left', elementName: 'umb-tiptap-menu', @@ -176,7 +173,7 @@ export const UmbTableCell = TableCell.extend({ new Plugin({ props: { decorations: (state) => { - const { isEditable } = this.editor; + const { isEditable } = editor; if (!isEditable) { return DecorationSet.empty; @@ -202,7 +199,7 @@ export const UmbTableCell = TableCell.extend({ event.preventDefault(); event.stopImmediatePropagation(); - this.editor.view.dispatch(selectRow(index)(this.editor.state.tr)); + editor.view.dispatch(selectRow(index)(editor.state.tr)); }); return grip; @@ -355,51 +352,53 @@ const getCellsInRow = (rowIndex: number | number[]) => (selection: Selection) => return null; }; -// const getCellsInTable = (selection: Selection) => { -// const table = findTable(selection); - -// if (table) { -// const map = TableMap.get(table.node); -// const cells = map.cellsInRect({ -// left: 0, -// right: map.width, -// top: 0, -// bottom: map.height, -// }); +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const getCellsInTable = (selection: Selection) => { + const table = findTable(selection); -// return cells.map((nodePos) => { -// const node = table.node.nodeAt(nodePos); -// const pos = nodePos + table.start; + if (table) { + const map = TableMap.get(table.node); + const cells = map.cellsInRect({ + left: 0, + right: map.width, + top: 0, + bottom: map.height, + }); -// return { pos, start: pos + 1, node }; -// }); -// } + return cells.map((nodePos) => { + const node = table.node.nodeAt(nodePos); + const pos = nodePos + table.start; -// return null; -// }; + return { pos, start: pos + 1, node }; + }); + } -// const findParentNodeClosestToPos = ($pos: ResolvedPos, predicate: (node: ProseMirrorNode) => boolean) => { -// for (let i = $pos.depth; i > 0; i -= 1) { -// const node = $pos.node(i); + return null; +}; -// if (predicate(node)) { -// return { -// pos: i > 0 ? $pos.before(i) : 0, -// start: $pos.start(i), -// depth: i, -// node, -// }; -// } -// } +const findParentNodeClosestToPos = ($pos: ResolvedPos, predicate: (node: ProseMirrorNode) => boolean) => { + for (let i = $pos.depth; i > 0; i -= 1) { + const node = $pos.node(i); + + if (predicate(node)) { + return { + pos: i > 0 ? $pos.before(i) : 0, + start: $pos.start(i), + depth: i, + node, + }; + } + } -// return null; -// }; + return null; +}; -// const findCellClosestToPos = ($pos: ResolvedPos) => { -// const predicate = (node: ProseMirrorNode) => node.type.spec.tableRole && /cell/i.test(node.type.spec.tableRole); +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const findCellClosestToPos = ($pos: ResolvedPos) => { + const predicate = (node: ProseMirrorNode) => node.type.spec.tableRole && /cell/i.test(node.type.spec.tableRole); -// return findParentNodeClosestToPos($pos, predicate); -// }; + return findParentNodeClosestToPos($pos, predicate); +}; const select = (type: 'row' | 'column') => (index: number) => (tr: Transaction) => { const table = findTable(tr.selection); @@ -447,24 +446,25 @@ const selectColumn = select('column'); const selectRow = select('row'); -// const selectTable = (tr: Transaction) => { -// const table = findTable(tr.selection); +// eslint-disable-next-line @typescript-eslint/no-unused-vars +const selectTable = (tr: Transaction) => { + const table = findTable(tr.selection); -// if (table) { -// const { map } = TableMap.get(table.node); + if (table) { + const { map } = TableMap.get(table.node); -// if (map && map.length) { -// const head = table.start + map[0]; -// const anchor = table.start + map[map.length - 1]; -// const $head = tr.doc.resolve(head); -// const $anchor = tr.doc.resolve(anchor); + if (map && map.length) { + const head = table.start + map[0]; + const anchor = table.start + map[map.length - 1]; + const $head = tr.doc.resolve(head); + const $anchor = tr.doc.resolve(anchor); -// return tr.setSelection(new CellSelection($anchor, $head)); -// } -// } + return tr.setSelection(new CellSelection($anchor, $head)); + } + } -// return tr; -// }; + return tr; +}; const isColumnGripSelected = ({ editor, diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction.tiptap-extension.ts index 2fb2a01cd978..0a02674540f2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction.tiptap-extension.ts @@ -1,6 +1,4 @@ -/* eslint-disable local-rules/enforce-umbraco-external-imports */ - -import { Extension } from '@tiptap/core'; +import { Extension } from '../../externals.js'; export interface UmbTextDirectionOptions { directions: Array<'auto' | 'ltr' | 'rtl'>; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-indent.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-indent.tiptap-extension.ts index 5018af68f301..53b4ababb129 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-indent.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-indent.tiptap-extension.ts @@ -7,11 +7,11 @@ * Modifications are licensed under the MIT License. */ -import type { Dispatch } from '@tiptap/core'; -import type { EditorState, Transaction } from '@tiptap/pm/state'; +import { Extension } from '../../externals.js'; +import type { Dispatch } from '../../externals.js'; -import { Extension } from '@tiptap/core'; import { AllSelection, TextSelection } from '@tiptap/pm/state'; +import type { EditorState, Transaction } from '@tiptap/pm/state'; export interface UmbTextIndentOptions { minLevel: number; diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/trailing-node/trailing-node.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/trailing-node/trailing-node.tiptap-extension.ts index a761f95f6d9b..5f37ae3d5d34 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/trailing-node/trailing-node.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/trailing-node/trailing-node.tiptap-extension.ts @@ -1,6 +1,4 @@ -/* eslint-disable jsdoc/require-jsdoc */ /* eslint-disable local-rules/enforce-umbraco-external-imports */ - /* This Source Code has been derived from Tiptap. * https://github.com/ueberdosis/tiptap/blob/v2.11.5/demos/src/Experiments/TrailingNode/Vue/trailing-node.ts * SPDX-License-Identifier: MIT @@ -8,11 +6,12 @@ * Modifications are licensed under the MIT License. */ -import { Extension } from '@tiptap/core'; +import { Extension } from '../../externals.js'; import { Plugin, PluginKey } from '@tiptap/pm/state'; // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore +// eslint-disable-next-line jsdoc/require-jsdoc function nodeEqualsType({ types, node }) { return (Array.isArray(types) && types.includes(node.type)) || node.type === types; } From 1bab919eac1fbc39ea852ad875f2abb7e1bc1069 Mon Sep 17 00:00:00 2001 From: leekelleher Date: Wed, 24 Sep 2025 16:41:48 +0100 Subject: [PATCH 16/16] Naming of Tiptap extension option interfaces --- .../bubble-menu/bubble-menu.tiptap-extension.ts | 10 +++++----- .../extensions/figure/figcaption.tiptap-extension.ts | 4 ++-- .../extensions/figure/figure.tiptap-extension.ts | 4 ++-- .../html-attr-class.tiptap-extension.ts | 4 ++-- .../html-attr-dataset.tiptap-extension.ts | 4 ++-- .../html-attr-id/html-attr-id.tiptap-extension.ts | 4 ++-- .../html-attr-style.tiptap-extension.ts | 4 ++-- .../html-tag-div/html-tag-div.tiptap-extension.ts | 4 ++-- .../html-tag-span/html-tag-span.tiptap-extension.ts | 4 ++-- .../text-direction/text-direction.tiptap-extension.ts | 4 ++-- .../text-indent/text-indent.tiptap-extension.ts | 4 ++-- .../trailing-node/trailing-node.tiptap-extension.ts | 4 ++-- 12 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bubble-menu/bubble-menu.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bubble-menu/bubble-menu.tiptap-extension.ts index 65aef4ee8dfc..816a3c9e4042 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bubble-menu/bubble-menu.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/bubble-menu/bubble-menu.tiptap-extension.ts @@ -12,7 +12,7 @@ export interface UmbTiptapBubbleMenuElement extends HTMLElement { menuAlias?: string; } -export type UmbBubbleMenuPluginProps = { +export type UmbTiptapBubbleMenuPluginProps = { unique: string; placement?: UUIPopoverContainerElement['placement']; elementName?: string | null; @@ -22,7 +22,7 @@ export type UmbBubbleMenuPluginProps = { | null; }; -export type UmbBubbleMenuOptions = UmbBubbleMenuPluginProps; +export type UmbBubbleMenuOptions = UmbTiptapBubbleMenuPluginProps; export const UmbBubbleMenu = Extension.create({ name: 'umbBubbleMenu', @@ -58,9 +58,9 @@ class UmbBubbleMenuPluginView implements PluginView { #popover: UUIPopoverContainerElement; - #shouldShow: UmbBubbleMenuPluginProps['shouldShow']; + #shouldShow: UmbTiptapBubbleMenuPluginProps['shouldShow']; - constructor(editor: Editor, view: EditorView, props: UmbBubbleMenuPluginProps) { + constructor(editor: Editor, view: EditorView, props: UmbTiptapBubbleMenuPluginProps) { this.#editor = editor; this.#shouldShow = props.shouldShow ?? null; @@ -107,7 +107,7 @@ class UmbBubbleMenuPluginView implements PluginView { } } -export const UmbBubbleMenuPlugin = (editor: Editor, props: UmbBubbleMenuPluginProps) => { +export const UmbBubbleMenuPlugin = (editor: Editor, props: UmbTiptapBubbleMenuPluginProps) => { return new Plugin({ view(editorView) { return new UmbBubbleMenuPluginView(editor, editorView, props); diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figcaption.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figcaption.tiptap-extension.ts index 242d39fcfc06..882ada162fd0 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figcaption.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figcaption.tiptap-extension.ts @@ -1,6 +1,6 @@ import { Node } from '../../externals.js'; -export interface UmbFigcaptionOptions { +export interface UmbTiptapFigcaptionOptions { /** * HTML attributes to add to the image element. * @default {} @@ -9,7 +9,7 @@ export interface UmbFigcaptionOptions { HTMLAttributes: Record; } -export const Figcaption = Node.create({ +export const Figcaption = Node.create({ name: 'figcaption', addOptions() { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figure.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figure.tiptap-extension.ts index 663714407e70..3db25d519ae4 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figure.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figure.tiptap-extension.ts @@ -1,6 +1,6 @@ import { mergeAttributes, Node } from '../../externals.js'; -export interface UmbFigureOptions { +export interface UmbTiptapFigureOptions { /** * HTML attributes to add to the image element. * @default {} @@ -9,7 +9,7 @@ export interface UmbFigureOptions { HTMLAttributes: Record; } -export const Figure = Node.create({ +export const Figure = Node.create({ name: 'figure', group: 'block', content: 'block+', diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-class/html-attr-class.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-class/html-attr-class.tiptap-extension.ts index ac4239293b07..3f8bbdee192e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-class/html-attr-class.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-class/html-attr-class.tiptap-extension.ts @@ -11,11 +11,11 @@ declare module '@tiptap/core' { } } -interface UmbHtmlClassAttributeOptions { +export interface UmbTiptapHtmlClassAttributeOptions { types: Array; } -export const HtmlClassAttribute = Extension.create({ +export const HtmlClassAttribute = Extension.create({ name: 'htmlClassAttribute', addOptions() { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-dataset/html-attr-dataset.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-dataset/html-attr-dataset.tiptap-extension.ts index 1069a5b654f3..9dcbb7b6184e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-dataset/html-attr-dataset.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-dataset/html-attr-dataset.tiptap-extension.ts @@ -20,11 +20,11 @@ function camelCaseToKebabCase(str: string): string { return str.replace(/[A-Z]+(?![a-z])|[A-Z]/g, ($, ofs) => (ofs ? '-' : '') + $.toLowerCase()); } -interface HtmlDatasetAttributesOptions { +export interface UmbTiptapHtmlDatasetAttributesOptions { types: Array; } -export const HtmlDatasetAttributes = Extension.create({ +export const HtmlDatasetAttributes = Extension.create({ name: 'htmlDatasetAttributes', addOptions() { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-id/html-attr-id.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-id/html-attr-id.tiptap-extension.ts index 192bed6882a1..31665c7ac054 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-id/html-attr-id.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-id/html-attr-id.tiptap-extension.ts @@ -11,11 +11,11 @@ declare module '@tiptap/core' { } } -interface HtmlIdAttributeOptions { +export interface UmbTiptapHtmlIdAttributeOptions { types: Array; } -export const HtmlIdAttribute = Extension.create({ +export const HtmlIdAttribute = Extension.create({ name: 'htmlIdAttribute', addOptions() { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-style/html-attr-style.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-style/html-attr-style.tiptap-extension.ts index d0e25ee600b6..02628c55be3f 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-style/html-attr-style.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-attr-style/html-attr-style.tiptap-extension.ts @@ -11,11 +11,11 @@ declare module '@tiptap/core' { } } -interface HtmlStyleAttributeOptions { +export interface UmbTiptapHtmlStyleAttributeOptions { types: Array; } -export const HtmlStyleAttribute = Extension.create({ +export const HtmlStyleAttribute = Extension.create({ name: 'htmlStyleAttribute', addOptions() { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-div/html-tag-div.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-div/html-tag-div.tiptap-extension.ts index bf4c830c0f46..1fc7ff25e4e8 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-div/html-tag-div.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-div/html-tag-div.tiptap-extension.ts @@ -1,6 +1,6 @@ import { Node, mergeAttributes } from '../../externals.js'; -export interface UmbHtmlTagDivOptions { +export interface UmbTiptapHtmlTagDivOptions { /** * HTML attributes to add to the element. * @default {} @@ -9,7 +9,7 @@ export interface UmbHtmlTagDivOptions { HTMLAttributes: Record; } -export const Div = Node.create({ +export const Div = Node.create({ name: 'div', priority: 50, diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-span/html-tag-span.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-span/html-tag-span.tiptap-extension.ts index 98436fd59e4a..87953ac5f176 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-span/html-tag-span.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/html-tag-span/html-tag-span.tiptap-extension.ts @@ -1,6 +1,6 @@ import { Mark, mergeAttributes } from '../../externals.js'; -export interface UmbHtmlTagSpanOptions { +export interface UmbTiptapHtmlTagSpanOptions { /** * HTML attributes to add to the span element. * @default {} @@ -36,7 +36,7 @@ function serializeStyles(items: Record): string { ); } -export const Span = Mark.create({ +export const Span = Mark.create({ name: 'span', priority: 50, diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction.tiptap-extension.ts index 0a02674540f2..016f48058317 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-direction/text-direction.tiptap-extension.ts @@ -1,11 +1,11 @@ import { Extension } from '../../externals.js'; -export interface UmbTextDirectionOptions { +export interface UmbTiptapTextDirectionOptions { directions: Array<'auto' | 'ltr' | 'rtl'>; types: Array; } -export const TextDirection = Extension.create({ +export const TextDirection = Extension.create({ name: 'textDirection', addOptions() { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-indent.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-indent.tiptap-extension.ts index 53b4ababb129..dc0212aa16f2 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-indent.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/text-indent/text-indent.tiptap-extension.ts @@ -13,13 +13,13 @@ import type { Dispatch } from '../../externals.js'; import { AllSelection, TextSelection } from '@tiptap/pm/state'; import type { EditorState, Transaction } from '@tiptap/pm/state'; -export interface UmbTextIndentOptions { +export interface UmbTiptapTextIndentOptions { minLevel: number; maxLevel: number; types: Array; } -export const TextIndent = Extension.create({ +export const TextIndent = Extension.create({ name: 'textIndent', addOptions() { diff --git a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/trailing-node/trailing-node.tiptap-extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/trailing-node/trailing-node.tiptap-extension.ts index 5f37ae3d5d34..28ff71a50f0e 100644 --- a/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/trailing-node/trailing-node.tiptap-extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/trailing-node/trailing-node.tiptap-extension.ts @@ -16,12 +16,12 @@ function nodeEqualsType({ types, node }) { return (Array.isArray(types) && types.includes(node.type)) || node.type === types; } -export interface UmbTrailingNodeOptions { +export interface UmbTiptapTrailingNodeOptions { node: string; notAfter: string[]; } -export const TrailingNode = Extension.create({ +export const TrailingNode = Extension.create({ name: 'trailingNode', addOptions() {