diff --git a/lit-code-block/src/components/editor/ui/button/button.ts b/lit-code-block/src/components/editor/ui/button/button.ts index aef47e4e1f..e9979fb5c3 100644 --- a/lit-code-block/src/components/editor/ui/button/button.ts +++ b/lit-code-block/src/components/editor/ui/button/button.ts @@ -45,31 +45,37 @@ class LitButton extends LitElement { ?disabled=${this.disabled} @mousedown=${this.handleMouseDown} > - ${this.icon - ? html` -
- ` - : nothing} - ${tooltip - ? html` - ${tooltip} - ` - : nothing} + ${ + this.icon + ? html` +
+ ` + : nothing + } + ${ + tooltip + ? html` + ${tooltip} + ` + : nothing + } - ${tooltip - ? html` - - - ${tooltip} - - - ` - : nothing} + + ${tooltip} + + + ` + : nothing + } ` } diff --git a/lit-code-block/src/components/editor/ui/image-upload-popover/image-upload-popover.ts b/lit-code-block/src/components/editor/ui/image-upload-popover/image-upload-popover.ts index 4ddfdbce9a..6fae6c64ba 100644 --- a/lit-code-block/src/components/editor/ui/image-upload-popover/image-upload-popover.ts +++ b/lit-code-block/src/components/editor/ui/image-upload-popover/image-upload-popover.ts @@ -127,51 +127,59 @@ class LitImageUploadPopover extends LitElement { - ${!this.file - ? html` - - - ` - : nothing} - ${!this.url - ? html` - - - ` - : nothing} - ${this.url - ? html` - - ` - : nothing} - ${this.file - ? html` - - ` - : nothing} + ${ + !this.file + ? html` + + + ` + : nothing + } + ${ + !this.url + ? html` + + + ` + : nothing + } + ${ + this.url + ? html` + + ` + : nothing + } + ${ + this.file + ? html` + + ` + : nothing + } diff --git a/lit-code-block/src/components/editor/ui/toolbar/toolbar.ts b/lit-code-block/src/components/editor/ui/toolbar/toolbar.ts index 11c3f99372..99762750ca 100644 --- a/lit-code-block/src/components/editor/ui/toolbar/toolbar.ts +++ b/lit-code-block/src/components/editor/ui/toolbar/toolbar.ts @@ -220,8 +220,7 @@ class LitToolbar extends LitElement { override render() { const editor = this.editorConsumer.value as - | Editor - | undefined + Editor | undefined if (!editor) { return nothing } @@ -232,226 +231,266 @@ class LitToolbar extends LitElement {
- ${items.undo - ? html` - - ` - : nothing} - ${items.redo - ? html` - - ` - : nothing} - ${items.bold - ? html` - - ` - : nothing} - ${items.italic - ? html` - - ` - : nothing} - ${items.underline - ? html` - - ` - : nothing} - ${items.strike - ? html` - - ` - : nothing} - ${items.code - ? html` - - ` - : nothing} - ${items.codeBlock - ? html` - - ` - : nothing} - ${items.heading1 - ? html` - - ` - : nothing} - ${items.heading2 - ? html` - - ` - : nothing} - ${items.heading3 - ? html` - - ` - : nothing} - ${items.horizontalRule - ? html` - - ` - : nothing} - ${items.blockquote - ? html` - - ` - : nothing} - ${items.bulletList - ? html` - - ` - : nothing} - ${items.orderedList - ? html` - - ` - : nothing} - ${items.taskList - ? html` - - ` - : nothing} - ${items.toggleList - ? html` - - ` - : nothing} - ${items.indentList - ? html` - - ` - : nothing} - ${items.dedentList - ? html` - - ` - : nothing} - ${this.uploader && items.insertImage - ? html` - - ` - : nothing} + ${ + items.undo + ? html` + + ` + : nothing + } + ${ + items.redo + ? html` + + ` + : nothing + } + ${ + items.bold + ? html` + + ` + : nothing + } + ${ + items.italic + ? html` + + ` + : nothing + } + ${ + items.underline + ? html` + + ` + : nothing + } + ${ + items.strike + ? html` + + ` + : nothing + } + ${ + items.code + ? html` + + ` + : nothing + } + ${ + items.codeBlock + ? html` + + ` + : nothing + } + ${ + items.heading1 + ? html` + + ` + : nothing + } + ${ + items.heading2 + ? html` + + ` + : nothing + } + ${ + items.heading3 + ? html` + + ` + : nothing + } + ${ + items.horizontalRule + ? html` + + ` + : nothing + } + ${ + items.blockquote + ? html` + + ` + : nothing + } + ${ + items.bulletList + ? html` + + ` + : nothing + } + ${ + items.orderedList + ? html` + + ` + : nothing + } + ${ + items.taskList + ? html` + + ` + : nothing + } + ${ + items.toggleList + ? html` + + ` + : nothing + } + ${ + items.indentList + ? html` + + ` + : nothing + } + ${ + items.dedentList + ? html` + + ` + : nothing + } + ${ + this.uploader && items.insertImage + ? html` + + ` + : nothing + }
` } diff --git a/lit-full/src/components/editor/ui/button/button.ts b/lit-full/src/components/editor/ui/button/button.ts index aef47e4e1f..e9979fb5c3 100644 --- a/lit-full/src/components/editor/ui/button/button.ts +++ b/lit-full/src/components/editor/ui/button/button.ts @@ -45,31 +45,37 @@ class LitButton extends LitElement { ?disabled=${this.disabled} @mousedown=${this.handleMouseDown} > - ${this.icon - ? html` -
- ` - : nothing} - ${tooltip - ? html` - ${tooltip} - ` - : nothing} + ${ + this.icon + ? html` +
+ ` + : nothing + } + ${ + tooltip + ? html` + ${tooltip} + ` + : nothing + } - ${tooltip - ? html` - - - ${tooltip} - - - ` - : nothing} + + ${tooltip} + + + ` + : nothing + } ` } diff --git a/lit-full/src/components/editor/ui/image-upload-popover/image-upload-popover.ts b/lit-full/src/components/editor/ui/image-upload-popover/image-upload-popover.ts index 4ddfdbce9a..6fae6c64ba 100644 --- a/lit-full/src/components/editor/ui/image-upload-popover/image-upload-popover.ts +++ b/lit-full/src/components/editor/ui/image-upload-popover/image-upload-popover.ts @@ -127,51 +127,59 @@ class LitImageUploadPopover extends LitElement { - ${!this.file - ? html` - - - ` - : nothing} - ${!this.url - ? html` - - - ` - : nothing} - ${this.url - ? html` - - ` - : nothing} - ${this.file - ? html` - - ` - : nothing} + ${ + !this.file + ? html` + + + ` + : nothing + } + ${ + !this.url + ? html` + + + ` + : nothing + } + ${ + this.url + ? html` + + ` + : nothing + } + ${ + this.file + ? html` + + ` + : nothing + } diff --git a/lit-full/src/components/editor/ui/image-view/image-view.ts b/lit-full/src/components/editor/ui/image-view/image-view.ts index 4ec54fd1c7..852a70faff 100644 --- a/lit-full/src/components/editor/ui/image-view/image-view.ts +++ b/lit-full/src/components/editor/ui/image-view/image-view.ts @@ -128,40 +128,46 @@ class ImageNodeView { ?data-selected=${this.selected} @resizeEnd=${this.handleResizeEnd} > - ${url && !this.error - ? html` - upload preview - ` - : ''} - ${uploading && !this.error - ? html` -
+ ${ + url && !this.error + ? html` + upload preview + ` + : '' + } + ${ + uploading && !this.error + ? html`
-
${Math.round(this.progress * 100)}%
-
- ` - : ''} - ${this.error - ? html` -
-
- -
- ` - : ''} + ` + : '' + } + ${ + this.error + ? html` +
+
+ +
+ ` + : '' + } diff --git a/lit-full/src/components/editor/ui/inline-menu/inline-menu.ts b/lit-full/src/components/editor/ui/inline-menu/inline-menu.ts index efc7cc3a96..7cd3843f60 100644 --- a/lit-full/src/components/editor/ui/inline-menu/inline-menu.ts +++ b/lit-full/src/components/editor/ui/inline-menu/inline-menu.ts @@ -152,8 +152,7 @@ class LitInlineMenu extends LitElement { override render() { const editor = this.editorConsumer.value as - | Editor - | undefined + Editor | undefined if (!editor) { return nothing } @@ -176,100 +175,114 @@ class LitInlineMenu extends LitElement { data-testid="inline-menu-main" class="box-border origin-(--transform-origin) transition-[opacity,scale] transition-discrete motion-reduce:transition-none data-[state=closed]:duration-150 data-[state=closed]:opacity-0 starting:opacity-0 data-[state=closed]:scale-95 starting:scale-95 duration-40 border border-gray-200 dark:border-gray-800 shadow-lg bg-[canvas] relative flex min-w-32 space-x-1 overflow-auto whitespace-nowrap rounded-lg p-1" > - ${items.bold - ? html` - - ` - : nothing} - ${items.italic - ? html` - - ` - : nothing} - ${items.underline - ? html` - - ` - : nothing} - ${items.strike - ? html` - - ` - : nothing} - ${items.code - ? html` - - ` - : nothing} - ${items.link && items.link.canExec - ? html` - { + ${ + items.bold + ? html` + + ` + : nothing + } + ${ + items.italic + ? html` + + ` + : nothing + } + ${ + items.underline + ? html` + + ` + : nothing + } + ${ + items.strike + ? html` + + ` + : nothing + } + ${ + items.code + ? html` + + ` + : nothing + } + ${ + items.link && items.link.canExec + ? html` + { items.link?.command?.() this.linkMenuOpen = !this.linkMenuOpen }} - > - ` - : nothing} + > + ` + : nothing + } - ${items.link - ? html` - { + ${ + items.link + ? html` + { this.linkMenuOpen = event.detail }} - > - - - ${this.linkMenuOpen - ? html` -
{ + + ${ + this.linkMenuOpen + ? html` + { event.preventDefault() const target = event.target as HTMLFormElement | null @@ -278,32 +291,35 @@ class LitInlineMenu extends LitElement { ?.value?.trim() this.handleLinkUpdate(editor, href) }} - > - - - ` - : nothing} - ${items.link.isActive - ? html` - - ` - : nothing} -
-
-
- ` - : nothing} + > + + + ` + : nothing + } + ${ + items.link.isActive + ? html` + + ` + : nothing + } + + +
+ ` + : nothing + } ` } } diff --git a/lit-full/src/components/editor/ui/slash-menu/slash-menu-item.ts b/lit-full/src/components/editor/ui/slash-menu/slash-menu-item.ts index ad7bd23cf7..3cc7c0e4bb 100644 --- a/lit-full/src/components/editor/ui/slash-menu/slash-menu-item.ts +++ b/lit-full/src/components/editor/ui/slash-menu/slash-menu-item.ts @@ -31,13 +31,15 @@ export class SlashMenuItemElement extends LitElement { class="relative flex items-center justify-between min-w-32 scroll-my-1 rounded-md px-3 py-1.5 text-sm box-border cursor-default select-none whitespace-nowrap outline-hidden data-highlighted:bg-gray-100 dark:data-highlighted:bg-gray-800" > ${this.label} - ${this.kbd + ${ + this.kbd ? html` ${this.kbd} ` - : ''} + : '' + } ` } diff --git a/lit-full/src/components/editor/ui/slash-menu/slash-menu.ts b/lit-full/src/components/editor/ui/slash-menu/slash-menu.ts index f4cc8b3ada..0b75c62abc 100644 --- a/lit-full/src/components/editor/ui/slash-menu/slash-menu.ts +++ b/lit-full/src/components/editor/ui/slash-menu/slash-menu.ts @@ -31,8 +31,7 @@ class SlashMenuElement extends LitElement { override render() { const editor = this.editorConsumer.value as - | Editor - | undefined + Editor | undefined if (!editor) { return html`` } diff --git a/lit-full/src/components/editor/ui/table-handle/table-handle.ts b/lit-full/src/components/editor/ui/table-handle/table-handle.ts index 0cedbd8247..d314b1bb93 100644 --- a/lit-full/src/components/editor/ui/table-handle/table-handle.ts +++ b/lit-full/src/components/editor/ui/table-handle/table-handle.ts @@ -124,8 +124,7 @@ class LitTableHandle extends LitElement { override render() { const editor = this.editorConsumer.value as - | Editor - | undefined + Editor | undefined if (!editor) { return nothing } @@ -163,7 +162,8 @@ class LitTableHandle extends LitElement { - ${state.addTableColumnBefore.canExec + ${ + state.addTableColumnBefore.canExec ? html` Insert Left ` - : nothing} - ${state.addTableColumnAfter.canExec + : nothing + } + ${ + state.addTableColumnAfter.canExec ? html` Insert Right ` - : nothing} - ${state.deleteCellSelection.canExec + : nothing + } + ${ + state.deleteCellSelection.canExec ? html` ` - : nothing} - ${state.deleteTableColumn.canExec + : nothing + } + ${ + state.deleteTableColumn.canExec ? html` Delete Column ` - : nothing} - ${state.deleteTable.canExec + : nothing + } + ${ + state.deleteTable.canExec ? html` Delete Table ` - : nothing} + : nothing + } @@ -247,7 +256,8 @@ class LitTableHandle extends LitElement { - ${state.addTableRowAbove.canExec + ${ + state.addTableRowAbove.canExec ? html` Insert Above ` - : nothing} - ${state.addTableRowBelow.canExec + : nothing + } + ${ + state.addTableRowBelow.canExec ? html` Insert Below ` - : nothing} - ${state.deleteCellSelection.canExec + : nothing + } + ${ + state.deleteCellSelection.canExec ? html` ` - : nothing} - ${state.deleteTableRow.canExec + : nothing + } + ${ + state.deleteTableRow.canExec ? html` Delete Row ` - : nothing} - ${state.deleteTable.canExec + : nothing + } + ${ + state.deleteTable.canExec ? html` Delete Table ` - : nothing} + : nothing + } diff --git a/lit-full/src/components/editor/ui/tag-menu/tag-menu.ts b/lit-full/src/components/editor/ui/tag-menu/tag-menu.ts index 9db33b32e3..d465fc045a 100644 --- a/lit-full/src/components/editor/ui/tag-menu/tag-menu.ts +++ b/lit-full/src/components/editor/ui/tag-menu/tag-menu.ts @@ -52,8 +52,7 @@ class TagMenuElement extends LitElement { override render() { const editor = this.editorConsumer.value as - | Editor> - | undefined + Editor> | undefined if (!editor) { return nothing } @@ -75,18 +74,17 @@ class TagMenuElement extends LitElement { No results ${repeat( - this.tags, - (tag) => tag.id, - (tag) => html` - - this.handleTagInsert(editor, tag.id, tag.label)} - > - ${'#' + tag.label} - - `, - )} + this.tags, + (tag) => tag.id, + (tag) => html` + this.handleTagInsert(editor, tag.id, tag.label)} + > + ${'#' + tag.label} + + `, + )} diff --git a/lit-full/src/components/editor/ui/toolbar/toolbar.ts b/lit-full/src/components/editor/ui/toolbar/toolbar.ts index 11c3f99372..99762750ca 100644 --- a/lit-full/src/components/editor/ui/toolbar/toolbar.ts +++ b/lit-full/src/components/editor/ui/toolbar/toolbar.ts @@ -220,8 +220,7 @@ class LitToolbar extends LitElement { override render() { const editor = this.editorConsumer.value as - | Editor - | undefined + Editor | undefined if (!editor) { return nothing } @@ -232,226 +231,266 @@ class LitToolbar extends LitElement {
- ${items.undo - ? html` - - ` - : nothing} - ${items.redo - ? html` - - ` - : nothing} - ${items.bold - ? html` - - ` - : nothing} - ${items.italic - ? html` - - ` - : nothing} - ${items.underline - ? html` - - ` - : nothing} - ${items.strike - ? html` - - ` - : nothing} - ${items.code - ? html` - - ` - : nothing} - ${items.codeBlock - ? html` - - ` - : nothing} - ${items.heading1 - ? html` - - ` - : nothing} - ${items.heading2 - ? html` - - ` - : nothing} - ${items.heading3 - ? html` - - ` - : nothing} - ${items.horizontalRule - ? html` - - ` - : nothing} - ${items.blockquote - ? html` - - ` - : nothing} - ${items.bulletList - ? html` - - ` - : nothing} - ${items.orderedList - ? html` - - ` - : nothing} - ${items.taskList - ? html` - - ` - : nothing} - ${items.toggleList - ? html` - - ` - : nothing} - ${items.indentList - ? html` - - ` - : nothing} - ${items.dedentList - ? html` - - ` - : nothing} - ${this.uploader && items.insertImage - ? html` - - ` - : nothing} + ${ + items.undo + ? html` + + ` + : nothing + } + ${ + items.redo + ? html` + + ` + : nothing + } + ${ + items.bold + ? html` + + ` + : nothing + } + ${ + items.italic + ? html` + + ` + : nothing + } + ${ + items.underline + ? html` + + ` + : nothing + } + ${ + items.strike + ? html` + + ` + : nothing + } + ${ + items.code + ? html` + + ` + : nothing + } + ${ + items.codeBlock + ? html` + + ` + : nothing + } + ${ + items.heading1 + ? html` + + ` + : nothing + } + ${ + items.heading2 + ? html` + + ` + : nothing + } + ${ + items.heading3 + ? html` + + ` + : nothing + } + ${ + items.horizontalRule + ? html` + + ` + : nothing + } + ${ + items.blockquote + ? html` + + ` + : nothing + } + ${ + items.bulletList + ? html` + + ` + : nothing + } + ${ + items.orderedList + ? html` + + ` + : nothing + } + ${ + items.taskList + ? html` + + ` + : nothing + } + ${ + items.toggleList + ? html` + + ` + : nothing + } + ${ + items.indentList + ? html` + + ` + : nothing + } + ${ + items.dedentList + ? html` + + ` + : nothing + } + ${ + this.uploader && items.insertImage + ? html` + + ` + : nothing + }
` } diff --git a/lit-full/src/components/editor/ui/user-menu/user-menu.ts b/lit-full/src/components/editor/ui/user-menu/user-menu.ts index 10d97c2ef7..17b60b8298 100644 --- a/lit-full/src/components/editor/ui/user-menu/user-menu.ts +++ b/lit-full/src/components/editor/ui/user-menu/user-menu.ts @@ -66,8 +66,7 @@ class UserMenuElement extends LitElement { override render() { const editor = this.editorConsumer.value as - | Editor> - | undefined + Editor> | undefined if (!editor) { return nothing } @@ -94,20 +93,19 @@ class UserMenuElement extends LitElement { ${this.loading ? 'Loading...' : 'No results'} ${repeat( - this.users, - (user) => user.id, - (user) => html` - - this.handleUserInsert(editor, user.id, user.name)} - > - - ${user.name} - - - `, - )} + this.users, + (user) => user.id, + (user) => html` + this.handleUserInsert(editor, user.id, user.name)} + > + + ${user.name} + + + `, + )} diff --git a/lit-inline-menu/src/components/editor/ui/button/button.ts b/lit-inline-menu/src/components/editor/ui/button/button.ts index aef47e4e1f..e9979fb5c3 100644 --- a/lit-inline-menu/src/components/editor/ui/button/button.ts +++ b/lit-inline-menu/src/components/editor/ui/button/button.ts @@ -45,31 +45,37 @@ class LitButton extends LitElement { ?disabled=${this.disabled} @mousedown=${this.handleMouseDown} > - ${this.icon - ? html` -
- ` - : nothing} - ${tooltip - ? html` - ${tooltip} - ` - : nothing} + ${ + this.icon + ? html` +
+ ` + : nothing + } + ${ + tooltip + ? html` + ${tooltip} + ` + : nothing + } - ${tooltip - ? html` - - - ${tooltip} - - - ` - : nothing} + + ${tooltip} + + + ` + : nothing + } ` } diff --git a/lit-inline-menu/src/components/editor/ui/inline-menu/inline-menu.ts b/lit-inline-menu/src/components/editor/ui/inline-menu/inline-menu.ts index efc7cc3a96..7cd3843f60 100644 --- a/lit-inline-menu/src/components/editor/ui/inline-menu/inline-menu.ts +++ b/lit-inline-menu/src/components/editor/ui/inline-menu/inline-menu.ts @@ -152,8 +152,7 @@ class LitInlineMenu extends LitElement { override render() { const editor = this.editorConsumer.value as - | Editor - | undefined + Editor | undefined if (!editor) { return nothing } @@ -176,100 +175,114 @@ class LitInlineMenu extends LitElement { data-testid="inline-menu-main" class="box-border origin-(--transform-origin) transition-[opacity,scale] transition-discrete motion-reduce:transition-none data-[state=closed]:duration-150 data-[state=closed]:opacity-0 starting:opacity-0 data-[state=closed]:scale-95 starting:scale-95 duration-40 border border-gray-200 dark:border-gray-800 shadow-lg bg-[canvas] relative flex min-w-32 space-x-1 overflow-auto whitespace-nowrap rounded-lg p-1" > - ${items.bold - ? html` - - ` - : nothing} - ${items.italic - ? html` - - ` - : nothing} - ${items.underline - ? html` - - ` - : nothing} - ${items.strike - ? html` - - ` - : nothing} - ${items.code - ? html` - - ` - : nothing} - ${items.link && items.link.canExec - ? html` - { + ${ + items.bold + ? html` + + ` + : nothing + } + ${ + items.italic + ? html` + + ` + : nothing + } + ${ + items.underline + ? html` + + ` + : nothing + } + ${ + items.strike + ? html` + + ` + : nothing + } + ${ + items.code + ? html` + + ` + : nothing + } + ${ + items.link && items.link.canExec + ? html` + { items.link?.command?.() this.linkMenuOpen = !this.linkMenuOpen }} - > - ` - : nothing} + > + ` + : nothing + } - ${items.link - ? html` - { + ${ + items.link + ? html` + { this.linkMenuOpen = event.detail }} - > - - - ${this.linkMenuOpen - ? html` -
{ + + ${ + this.linkMenuOpen + ? html` + { event.preventDefault() const target = event.target as HTMLFormElement | null @@ -278,32 +291,35 @@ class LitInlineMenu extends LitElement { ?.value?.trim() this.handleLinkUpdate(editor, href) }} - > - - - ` - : nothing} - ${items.link.isActive - ? html` - - ` - : nothing} -
-
-
- ` - : nothing} + > + + + ` + : nothing + } + ${ + items.link.isActive + ? html` + + ` + : nothing + } + + +
+ ` + : nothing + } ` } } diff --git a/lit-slash-menu/src/components/editor/ui/slash-menu/slash-menu-item.ts b/lit-slash-menu/src/components/editor/ui/slash-menu/slash-menu-item.ts index ad7bd23cf7..3cc7c0e4bb 100644 --- a/lit-slash-menu/src/components/editor/ui/slash-menu/slash-menu-item.ts +++ b/lit-slash-menu/src/components/editor/ui/slash-menu/slash-menu-item.ts @@ -31,13 +31,15 @@ export class SlashMenuItemElement extends LitElement { class="relative flex items-center justify-between min-w-32 scroll-my-1 rounded-md px-3 py-1.5 text-sm box-border cursor-default select-none whitespace-nowrap outline-hidden data-highlighted:bg-gray-100 dark:data-highlighted:bg-gray-800" > ${this.label} - ${this.kbd + ${ + this.kbd ? html` ${this.kbd} ` - : ''} + : '' + } ` } diff --git a/lit-slash-menu/src/components/editor/ui/slash-menu/slash-menu.ts b/lit-slash-menu/src/components/editor/ui/slash-menu/slash-menu.ts index f4cc8b3ada..0b75c62abc 100644 --- a/lit-slash-menu/src/components/editor/ui/slash-menu/slash-menu.ts +++ b/lit-slash-menu/src/components/editor/ui/slash-menu/slash-menu.ts @@ -31,8 +31,7 @@ class SlashMenuElement extends LitElement { override render() { const editor = this.editorConsumer.value as - | Editor - | undefined + Editor | undefined if (!editor) { return html`` } diff --git a/lit-table/src/components/editor/ui/table-handle/table-handle.ts b/lit-table/src/components/editor/ui/table-handle/table-handle.ts index 0cedbd8247..d314b1bb93 100644 --- a/lit-table/src/components/editor/ui/table-handle/table-handle.ts +++ b/lit-table/src/components/editor/ui/table-handle/table-handle.ts @@ -124,8 +124,7 @@ class LitTableHandle extends LitElement { override render() { const editor = this.editorConsumer.value as - | Editor - | undefined + Editor | undefined if (!editor) { return nothing } @@ -163,7 +162,8 @@ class LitTableHandle extends LitElement { - ${state.addTableColumnBefore.canExec + ${ + state.addTableColumnBefore.canExec ? html` Insert Left ` - : nothing} - ${state.addTableColumnAfter.canExec + : nothing + } + ${ + state.addTableColumnAfter.canExec ? html` Insert Right ` - : nothing} - ${state.deleteCellSelection.canExec + : nothing + } + ${ + state.deleteCellSelection.canExec ? html` ` - : nothing} - ${state.deleteTableColumn.canExec + : nothing + } + ${ + state.deleteTableColumn.canExec ? html` Delete Column ` - : nothing} - ${state.deleteTable.canExec + : nothing + } + ${ + state.deleteTable.canExec ? html` Delete Table ` - : nothing} + : nothing + } @@ -247,7 +256,8 @@ class LitTableHandle extends LitElement { - ${state.addTableRowAbove.canExec + ${ + state.addTableRowAbove.canExec ? html` Insert Above ` - : nothing} - ${state.addTableRowBelow.canExec + : nothing + } + ${ + state.addTableRowBelow.canExec ? html` Insert Below ` - : nothing} - ${state.deleteCellSelection.canExec + : nothing + } + ${ + state.deleteCellSelection.canExec ? html` ` - : nothing} - ${state.deleteTableRow.canExec + : nothing + } + ${ + state.deleteTableRow.canExec ? html` Delete Row ` - : nothing} - ${state.deleteTable.canExec + : nothing + } + ${ + state.deleteTable.canExec ? html` Delete Table ` - : nothing} + : nothing + } diff --git a/lit-toolbar/src/components/editor/ui/button/button.ts b/lit-toolbar/src/components/editor/ui/button/button.ts index aef47e4e1f..e9979fb5c3 100644 --- a/lit-toolbar/src/components/editor/ui/button/button.ts +++ b/lit-toolbar/src/components/editor/ui/button/button.ts @@ -45,31 +45,37 @@ class LitButton extends LitElement { ?disabled=${this.disabled} @mousedown=${this.handleMouseDown} > - ${this.icon - ? html` -
- ` - : nothing} - ${tooltip - ? html` - ${tooltip} - ` - : nothing} + ${ + this.icon + ? html` +
+ ` + : nothing + } + ${ + tooltip + ? html` + ${tooltip} + ` + : nothing + } - ${tooltip - ? html` - - - ${tooltip} - - - ` - : nothing} + + ${tooltip} + + + ` + : nothing + } ` } diff --git a/lit-toolbar/src/components/editor/ui/image-upload-popover/image-upload-popover.ts b/lit-toolbar/src/components/editor/ui/image-upload-popover/image-upload-popover.ts index 4ddfdbce9a..6fae6c64ba 100644 --- a/lit-toolbar/src/components/editor/ui/image-upload-popover/image-upload-popover.ts +++ b/lit-toolbar/src/components/editor/ui/image-upload-popover/image-upload-popover.ts @@ -127,51 +127,59 @@ class LitImageUploadPopover extends LitElement { - ${!this.file - ? html` - - - ` - : nothing} - ${!this.url - ? html` - - - ` - : nothing} - ${this.url - ? html` - - ` - : nothing} - ${this.file - ? html` - - ` - : nothing} + ${ + !this.file + ? html` + + + ` + : nothing + } + ${ + !this.url + ? html` + + + ` + : nothing + } + ${ + this.url + ? html` + + ` + : nothing + } + ${ + this.file + ? html` + + ` + : nothing + } diff --git a/lit-toolbar/src/components/editor/ui/toolbar/toolbar.ts b/lit-toolbar/src/components/editor/ui/toolbar/toolbar.ts index 11c3f99372..99762750ca 100644 --- a/lit-toolbar/src/components/editor/ui/toolbar/toolbar.ts +++ b/lit-toolbar/src/components/editor/ui/toolbar/toolbar.ts @@ -220,8 +220,7 @@ class LitToolbar extends LitElement { override render() { const editor = this.editorConsumer.value as - | Editor - | undefined + Editor | undefined if (!editor) { return nothing } @@ -232,226 +231,266 @@ class LitToolbar extends LitElement {
- ${items.undo - ? html` - - ` - : nothing} - ${items.redo - ? html` - - ` - : nothing} - ${items.bold - ? html` - - ` - : nothing} - ${items.italic - ? html` - - ` - : nothing} - ${items.underline - ? html` - - ` - : nothing} - ${items.strike - ? html` - - ` - : nothing} - ${items.code - ? html` - - ` - : nothing} - ${items.codeBlock - ? html` - - ` - : nothing} - ${items.heading1 - ? html` - - ` - : nothing} - ${items.heading2 - ? html` - - ` - : nothing} - ${items.heading3 - ? html` - - ` - : nothing} - ${items.horizontalRule - ? html` - - ` - : nothing} - ${items.blockquote - ? html` - - ` - : nothing} - ${items.bulletList - ? html` - - ` - : nothing} - ${items.orderedList - ? html` - - ` - : nothing} - ${items.taskList - ? html` - - ` - : nothing} - ${items.toggleList - ? html` - - ` - : nothing} - ${items.indentList - ? html` - - ` - : nothing} - ${items.dedentList - ? html` - - ` - : nothing} - ${this.uploader && items.insertImage - ? html` - - ` - : nothing} + ${ + items.undo + ? html` + + ` + : nothing + } + ${ + items.redo + ? html` + + ` + : nothing + } + ${ + items.bold + ? html` + + ` + : nothing + } + ${ + items.italic + ? html` + + ` + : nothing + } + ${ + items.underline + ? html` + + ` + : nothing + } + ${ + items.strike + ? html` + + ` + : nothing + } + ${ + items.code + ? html` + + ` + : nothing + } + ${ + items.codeBlock + ? html` + + ` + : nothing + } + ${ + items.heading1 + ? html` + + ` + : nothing + } + ${ + items.heading2 + ? html` + + ` + : nothing + } + ${ + items.heading3 + ? html` + + ` + : nothing + } + ${ + items.horizontalRule + ? html` + + ` + : nothing + } + ${ + items.blockquote + ? html` + + ` + : nothing + } + ${ + items.bulletList + ? html` + + ` + : nothing + } + ${ + items.orderedList + ? html` + + ` + : nothing + } + ${ + items.taskList + ? html` + + ` + : nothing + } + ${ + items.toggleList + ? html` + + ` + : nothing + } + ${ + items.indentList + ? html` + + ` + : nothing + } + ${ + items.dedentList + ? html` + + ` + : nothing + } + ${ + this.uploader && items.insertImage + ? html` + + ` + : nothing + }
` } diff --git a/package.json b/package.json index 585197d27b..e93e1d5b87 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "dependencies": { "@types/bun": "1.3.14", "@types/node": "24.13.2", - "prettier": "3.8.5", + "prettier": "3.9.1", "prettier-plugin-packagejson": "3.0.2", "prosekit-registry": "0.0.20260601211356" }