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/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 deleted file mode 100644 index 6a81876800c9..000000000000 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/index.ts +++ /dev/null @@ -1,147 +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'; - -// 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'; -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'; -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'; -export * from './extensions/tiptap-umb-table.extension.js'; 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-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 83% 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..56e4bfa38c48 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,5 @@ -import { Node, mergeAttributes } from '@tiptap/core'; +import { Node, mergeAttributes } from '../../externals.js'; -/** @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..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 { Anchor } from './anchor.tiptap-extension.js'; import { UMB_TIPTAP_ANCHOR_MODAL } from './modals/index.js'; -import { Anchor } from '@umbraco-cms/backoffice/external/tiptap'; 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/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'; 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/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 66% 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..816a3c9e4042 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,18 +1,18 @@ -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'; -import { EditorView } from '@tiptap/pm/view'; -import type { PluginView } from '@tiptap/pm/state'; - -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ +/* eslint-disable local-rules/enforce-umbraco-external-imports */ + +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 { editor?: Editor; menuAlias?: string; } -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export type UmbBubbleMenuPluginProps = { +export type UmbTiptapBubbleMenuPluginProps = { unique: string; placement?: UUIPopoverContainerElement['placement']; elementName?: string | null; @@ -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; +export type UmbBubbleMenuOptions = UmbTiptapBubbleMenuPluginProps; -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ export const UmbBubbleMenu = Extension.create({ name: 'umbBubbleMenu', @@ -60,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; @@ -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,8 +107,7 @@ 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) => { +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/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/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-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 85% 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..f7e981ad4fb2 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,9 @@ -import { mergeAttributes, Node } from '@tiptap/core'; +import { mergeAttributes, Node } from '../../externals.js'; -/** @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..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 '@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'; export default class UmbTiptapToolbarEmbeddedMediaExtensionApi extends UmbTiptapToolbarElementApiBase { override async execute(editor?: Editor) { 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/external/tiptap/extensions/tiptap-figcaption.extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/figure/figcaption.tiptap-extension.ts similarity index 55% 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..882ada162fd0 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,6 @@ -import { Node } from '@tiptap/core'; +import { Node } from '../../externals.js'; -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export interface FigcaptionOptions { +export interface UmbTiptapFigcaptionOptions { /** * HTML attributes to add to the image element. * @default {} @@ -10,8 +9,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 68% 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..3db25d519ae4 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,6 @@ -import { mergeAttributes, Node } from '@tiptap/core'; +import { mergeAttributes, Node } from '../../externals.js'; -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export interface FigureOptions { +export interface UmbTiptapFigureOptions { /** * HTML attributes to add to the image element. * @default {} @@ -10,8 +9,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/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-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..3f8bbdee192e --- /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 '../../externals.js'; +import type { Attributes } from '../../externals.js'; + +declare module '@tiptap/core' { + interface Commands { + htmlClassAttribute: { + setClassName: (className?: string, type?: string) => ReturnType; + toggleClassName: (className?: string, type?: string) => ReturnType; + unsetClassName: (type?: string) => ReturnType; + }; + } +} + +export interface UmbTiptapHtmlClassAttributeOptions { + 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..9dcbb7b6184e --- /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 '../../externals.js'; +import type { Attributes } from '../../externals.js'; + +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()); +} + +export interface UmbTiptapHtmlDatasetAttributesOptions { + 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..31665c7ac054 --- /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 '../../externals.js'; +import type { Attributes } from '../../externals.js'; + +declare module '@tiptap/core' { + interface Commands { + htmlIdAttribute: { + setId: (id?: string, type?: string) => ReturnType; + toggleId: (id?: string, type?: string) => ReturnType; + unsetId: (type?: string) => ReturnType; + }; + } +} + +export interface UmbTiptapHtmlIdAttributeOptions { + 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..02628c55be3f --- /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 '../../externals.js'; +import type { Attributes } from '../../externals.js'; + +declare module '@tiptap/core' { + interface Commands { + htmlStyleAttribute: { + setStyles: (style?: string, type?: string) => ReturnType; + toggleStyles: (style?: string, type?: string) => ReturnType; + unsetStyles: (type?: string) => ReturnType; + }; + } +} + +export interface UmbTiptapHtmlStyleAttributeOptions { + 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/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 56% 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..1fc7ff25e4e8 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,6 @@ -import { Node, mergeAttributes } from '@tiptap/core'; +import { Node, mergeAttributes } from '../../externals.js'; -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export interface DivOptions { +export interface UmbTiptapHtmlTagDivOptions { /** * HTML attributes to add to the element. * @default {} @@ -10,8 +9,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/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 89% 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..87953ac5f176 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,6 @@ -import { Mark, mergeAttributes } from '@tiptap/core'; +import { Mark, mergeAttributes } from '../../externals.js'; -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export interface SpanOptions { +export interface UmbTiptapHtmlTagSpanOptions { /** * HTML attributes to add to the span element. * @default {} @@ -10,6 +9,7 @@ export interface SpanOptions { HTMLAttributes: Record; } +// eslint-disable-next-line jsdoc/require-jsdoc function parseStyles(style: string | undefined): Record { const items: Record = {}; @@ -27,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) @@ -35,8 +36,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/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..6663595415cb 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 '../../externals.js'; -/** @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 e67d8949fb83..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 @@ -1,7 +1,21 @@ 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 './embedded-media/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'; +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/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/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..65f96785954e 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 '../../externals.js'; -/** @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..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 '@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'; 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/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/external/tiptap/extensions/tiptap-umb-table.extension.ts b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/table.tiptap-extension.ts similarity index 89% rename from src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-umb-table.extension.ts rename to src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/table.tiptap-extension.ts index a06850f07669..66c92500ab3b 100644 --- a/src/Umbraco.Web.UI.Client/src/external/tiptap/extensions/tiptap-umb-table.extension.ts +++ b/src/Umbraco.Web.UI.Client/src/packages/tiptap/extensions/table/table.tiptap-extension.ts @@ -1,18 +1,17 @@ -import { UmbBubbleMenuPlugin } from './tiptap-umb-bubble-menu.extension.js'; +/* 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, 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 { 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] // 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); @@ -35,16 +34,13 @@ export class UmbTableView extends TableView { } } -/** @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 { @@ -72,7 +68,7 @@ export const UmbTableHeader = TableHeader.extend({ addProseMirrorPlugins() { const { editor } = this; return [ - UmbBubbleMenuPlugin(this.editor, { + UmbBubbleMenuPlugin(editor, { unique: 'table-column-menu', placement: 'top', elementName: 'umb-tiptap-menu', @@ -84,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; @@ -109,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; @@ -126,7 +122,6 @@ export const UmbTableHeader = TableHeader.extend({ }, }); -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ export const UmbTableCell = TableCell.extend({ addAttributes() { return { @@ -166,7 +161,7 @@ export const UmbTableCell = TableCell.extend({ addProseMirrorPlugins() { const { editor } = this; return [ - UmbBubbleMenuPlugin(this.editor, { + UmbBubbleMenuPlugin(editor, { unique: 'table-row-menu', placement: 'left', elementName: 'umb-tiptap-menu', @@ -178,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; @@ -204,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; @@ -357,6 +352,7 @@ const getCellsInRow = (rowIndex: number | number[]) => (selection: Selection) => return null; }; +// eslint-disable-next-line @typescript-eslint/no-unused-vars const getCellsInTable = (selection: Selection) => { const table = findTable(selection); @@ -397,6 +393,7 @@ const findParentNodeClosestToPos = ($pos: ResolvedPos, predicate: (node: ProseMi return null; }; +// 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); @@ -449,6 +446,7 @@ const selectColumn = select('column'); const selectRow = select('row'); +// eslint-disable-next-line @typescript-eslint/no-unused-vars const selectTable = (tr: Transaction) => { const table = findTable(tr.selection); 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/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-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-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 76% 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..016f48058317 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,11 @@ -import { Extension } from '@tiptap/core'; +import { Extension } from '../../externals.js'; -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export interface TextDirectionOptions { +export interface UmbTiptapTextDirectionOptions { 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() { 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 87% 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..dc0212aa16f2 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 @@ -5,21 +7,19 @@ * 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'; -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export interface TextIndentOptions { +export interface UmbTiptapTextIndentOptions { 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() { 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/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 81% 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..28ff71a50f0e 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,4 @@ +/* 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 @@ -5,22 +6,22 @@ * 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; } -/** @deprecated This will be relocated in Umbraco 17 to the "@umbraco-cms/backoffice/tiptap" module. [LK] */ -export interface TrailingNodeOptions { +export interface UmbTiptapTrailingNodeOptions { 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() { 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"] } },