diff --git a/src/packages/rte/tiny-mce/property-editors/block/property-editor-ui-block-rte-type-configuration.element.ts b/src/packages/rte/tiny-mce/property-editors/block/property-editor-ui-block-rte-type-configuration.element.ts index 873121f6dc..a830297e36 100644 --- a/src/packages/rte/tiny-mce/property-editors/block/property-editor-ui-block-rte-type-configuration.element.ts +++ b/src/packages/rte/tiny-mce/property-editors/block/property-editor-ui-block-rte-type-configuration.element.ts @@ -1,14 +1,15 @@ -import { type UmbBlockTypeBaseModel, UmbInputBlockTypeElement } from '@umbraco-cms/backoffice/block-type'; -import { UMB_BLOCK_RTE_TYPE } from '@umbraco-cms/backoffice/block-rte'; -import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/property-editor'; -import { html, customElement, property, state, nothing } from '@umbraco-cms/backoffice/external/lit'; -import { - UmbPropertyValueChangeEvent, - type UmbPropertyEditorConfigCollection, -} from '@umbraco-cms/backoffice/property-editor'; +import { customElement, html, property, state, nothing } from '@umbraco-cms/backoffice/external/lit'; +import { UmbInputBlockTypeElement } from '@umbraco-cms/backoffice/block-type'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; -import { UMB_WORKSPACE_MODAL } from '@umbraco-cms/backoffice/workspace'; import { UmbModalRouteRegistrationController } from '@umbraco-cms/backoffice/router'; +import { UmbPropertyValueChangeEvent } from '@umbraco-cms/backoffice/property-editor'; +import { UMB_BLOCK_RTE_TYPE } from '@umbraco-cms/backoffice/block-rte'; +import { UMB_WORKSPACE_MODAL } from '@umbraco-cms/backoffice/workspace'; +import type { UmbBlockTypeBaseModel } from '@umbraco-cms/backoffice/block-type'; +import type { + UmbPropertyEditorUiElement, + UmbPropertyEditorConfigCollection, +} from '@umbraco-cms/backoffice/property-editor'; /** * @element umb-property-editor-ui-block-rte-type-configuration diff --git a/src/packages/rte/tiny-mce/property-editors/stylesheets/property-editor-ui-tiny-mce-stylesheets-configuration.element.ts b/src/packages/rte/tiny-mce/property-editors/stylesheets/property-editor-ui-tiny-mce-stylesheets-configuration.element.ts index 98f4510c25..a0efa34c22 100644 --- a/src/packages/rte/tiny-mce/property-editors/stylesheets/property-editor-ui-tiny-mce-stylesheets-configuration.element.ts +++ b/src/packages/rte/tiny-mce/property-editors/stylesheets/property-editor-ui-tiny-mce-stylesheets-configuration.element.ts @@ -1,9 +1,11 @@ -import { UmbServerFilePathUniqueSerializer } from '@umbraco-cms/backoffice/server-file-system'; import { customElement, html, property } from '@umbraco-cms/backoffice/external/lit'; import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; -import type { UmbPropertyEditorConfigCollection } from '@umbraco-cms/backoffice/property-editor'; import { UmbPropertyValueChangeEvent } from '@umbraco-cms/backoffice/property-editor'; -import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/property-editor'; +import { UmbServerFilePathUniqueSerializer } from '@umbraco-cms/backoffice/server-file-system'; +import type { + UmbPropertyEditorConfigCollection, + UmbPropertyEditorUiElement, +} from '@umbraco-cms/backoffice/property-editor'; import type { UmbStylesheetInputElement } from '@umbraco-cms/backoffice/stylesheet'; /** diff --git a/src/packages/rte/tiny-mce/property-editors/toolbar/property-editor-ui-tiny-mce-toolbar-configuration.element.ts b/src/packages/rte/tiny-mce/property-editors/toolbar/property-editor-ui-tiny-mce-toolbar-configuration.element.ts index a7d2208b1b..9559126d33 100644 --- a/src/packages/rte/tiny-mce/property-editors/toolbar/property-editor-ui-tiny-mce-toolbar-configuration.element.ts +++ b/src/packages/rte/tiny-mce/property-editors/toolbar/property-editor-ui-tiny-mce-toolbar-configuration.element.ts @@ -1,15 +1,15 @@ +import { css, customElement, html, property, state, repeat } from '@umbraco-cms/backoffice/external/lit'; +import { firstValueFrom } from '@umbraco-cms/backoffice/external/rxjs'; +import { tinymce } from '@umbraco-cms/backoffice/external/tinymce'; +import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry'; +import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; +import { UmbPropertyValueChangeEvent } from '@umbraco-cms/backoffice/property-editor'; import { UmbTextStyles } from '@umbraco-cms/backoffice/style'; import type { PropertyValueMap } from '@umbraco-cms/backoffice/external/lit'; -import { customElement, css, html, property, state, repeat } from '@umbraco-cms/backoffice/external/lit'; -import { UmbLitElement } from '@umbraco-cms/backoffice/lit-element'; -import type { UmbPropertyEditorUiElement } from '@umbraco-cms/backoffice/property-editor'; -import { umbExtensionsRegistry } from '@umbraco-cms/backoffice/extension-registry'; -import { firstValueFrom } from '@umbraco-cms/backoffice/external/rxjs'; -import { - UmbPropertyValueChangeEvent, - type UmbPropertyEditorConfigCollection, +import type { + UmbPropertyEditorUiElement, + UmbPropertyEditorConfigCollection, } from '@umbraco-cms/backoffice/property-editor'; -import { tinymce } from '@umbraco-cms/backoffice/external/tinymce'; const tinyIconSet = tinymce.IconManager.get('default'); diff --git a/src/packages/rte/tiptap/components/input-tiptap/input-tiptap.element.ts b/src/packages/rte/tiptap/components/input-tiptap/input-tiptap.element.ts index 786045550d..dee7a0609d 100644 --- a/src/packages/rte/tiptap/components/input-tiptap/input-tiptap.element.ts +++ b/src/packages/rte/tiptap/components/input-tiptap/input-tiptap.element.ts @@ -30,7 +30,7 @@ export class UmbInputTiptapElement extends UmbFormControlMixin = []; + private readonly _extensions: Array = []; @property({ type: String }) override set value(value: string) { @@ -312,9 +312,10 @@ export class UmbInputTiptapElement extends UmbFormControlMixin = new Set(); + readonly #inUse: Set = new Set(); #currentDragItem?: { alias: string; @@ -55,17 +55,17 @@ export class UmbPropertyEditorUiTiptapToolbarConfigurationElement }); } - #onDragStart = (event: DragEvent, alias: string, fromPos?: [number, number, number]) => { + #onDragStart(event: DragEvent, alias: string, fromPos?: [number, number, number]) { event.dataTransfer!.effectAllowed = 'move'; this.#currentDragItem = { alias, fromPos }; - }; + } - #onDragOver = (event: DragEvent) => { + #onDragOver(event: DragEvent) { event.preventDefault(); event.dataTransfer!.dropEffect = 'move'; - }; + } - #onDragEnd = (event: DragEvent) => { + #onDragEnd(event: DragEvent) { event.preventDefault(); if (event.dataTransfer?.dropEffect === 'none') { const { fromPos } = this.#currentDragItem ?? {}; @@ -73,9 +73,9 @@ export class UmbPropertyEditorUiTiptapToolbarConfigurationElement this.#removeItem(fromPos); } - }; + } - #onDrop = (event: DragEvent, toPos?: [number, number, number]) => { + #onDrop(event: DragEvent, toPos?: [number, number, number]) { event.preventDefault(); const { alias, fromPos } = this.#currentDragItem ?? {}; @@ -93,9 +93,9 @@ export class UmbPropertyEditorUiTiptapToolbarConfigurationElement if (alias && toPos) { this.#insertItem(alias, toPos); } - }; + } - #moveItem = (from: [number, number, number], to: [number, number, number]) => { + #moveItem(from: [number, number, number], to: [number, number, number]) { const [rowIndex, groupIndex, itemIndex] = from; // Get the item to move from the 'from' position @@ -105,9 +105,9 @@ export class UmbPropertyEditorUiTiptapToolbarConfigurationElement this.#value[rowIndex][groupIndex].splice(itemIndex, 1); this.#insertItem(itemToMove, to); - }; + } - #insertItem = (alias: string, toPos: [number, number, number]) => { + #insertItem(alias: string, toPos: [number, number, number]) { const [rowIndex, groupIndex, itemIndex] = toPos; // Insert the item into the new position @@ -115,7 +115,7 @@ export class UmbPropertyEditorUiTiptapToolbarConfigurationElement inserted.forEach((alias) => this.#inUse.add(alias)); this.dispatchEvent(new UmbPropertyValueChangeEvent()); - }; + } #removeItem(from: [number, number, number]) { const [rowIndex, groupIndex, itemIndex] = from; @@ -126,12 +126,12 @@ export class UmbPropertyEditorUiTiptapToolbarConfigurationElement this.dispatchEvent(new UmbPropertyValueChangeEvent()); } - #addGroup = (rowIndex: number, groupIndex: number) => { + #addGroup(rowIndex: number, groupIndex: number) { this.#value[rowIndex].splice(groupIndex, 0, []); this.dispatchEvent(new UmbPropertyValueChangeEvent()); - }; + } - #removeGroup = (rowIndex: number, groupIndex: number) => { + #removeGroup(rowIndex: number, groupIndex: number) { if (this.#value[rowIndex].length > groupIndex) { const removed = this.#value[rowIndex].splice(groupIndex, 1); removed.forEach((group) => group.forEach((alias) => this.#inUse.delete(alias))); @@ -143,14 +143,14 @@ export class UmbPropertyEditorUiTiptapToolbarConfigurationElement } this.dispatchEvent(new UmbPropertyValueChangeEvent()); - }; + } - #addRow = (rowIndex: number) => { + #addRow(rowIndex: number) { this.#value.splice(rowIndex, 0, [[]]); this.dispatchEvent(new UmbPropertyValueChangeEvent()); - }; + } - #removeRow = (rowIndex: number) => { + #removeRow(rowIndex: number) { if (this.#value.length > rowIndex) { const removed = this.#value.splice(rowIndex, 1); removed.forEach((row) => row.forEach((group) => group.forEach((alias) => this.#inUse.delete(alias)))); @@ -162,7 +162,7 @@ export class UmbPropertyEditorUiTiptapToolbarConfigurationElement } this.dispatchEvent(new UmbPropertyValueChangeEvent()); - }; + } override render() { return html` @@ -250,7 +250,7 @@ export class UmbPropertyEditorUiTiptapToolbarConfigurationElement `; } - static override styles = [ + static override readonly styles = [ UmbTextStyles, css` :host {