@@ -4,9 +4,8 @@ import { css, html, LitElement, type PropertyValues, unsafeCSS } from 'lit';
44import { state } from 'lit/decorators.js' ;
55import { repeat } from 'lit/directives/repeat.js' ;
66import './emoji-button' ;
7- import { CharacterCount } from '@tiptap/extensions' ;
8- import CodeBlockShiki from 'tiptap-extension-code-block-shiki' ;
97import contentStyles from './styles/content.css?inline' ;
8+ import './comment-editor-skeleton' ;
109
1110interface ActionItem {
1211 name ?: string ;
@@ -87,6 +86,10 @@ export class CommentEditor extends LitElement {
8786 const { Editor } = await import ( '@tiptap/core' ) ;
8887 const { Placeholder } = await import ( '@tiptap/extensions' ) ;
8988 const { StarterKit } = await import ( '@tiptap/starter-kit' ) ;
89+ const { CodeBlockShiki } = await import (
90+ 'tiptap-extension-code-block-shiki'
91+ ) ;
92+ const { CharacterCount } = await import ( '@tiptap/extensions' ) ;
9093
9194 this . loading = false ;
9295
@@ -139,7 +142,7 @@ export class CommentEditor extends LitElement {
139142 }
140143
141144 protected override render ( ) {
142- return html ` ${ this . renderSkeleton ( ) }
145+ return html ` ${ this . loading ? html `<comment - edi to r - skele to n > < / comment - edi to r - skele to n > ` : '' }
143146 <div
144147 class= "border rounded-md border-solid border-[var(--component-form-input-border-color)] focus-within:border-[var(--component-form-input-border-color-focus)] transition-all"
145148 ?hidden= ${ this . loading }
@@ -160,30 +163,6 @@ export class CommentEditor extends LitElement {
160163 </ div> ` ;
161164 }
162165
163- private renderSkeleton ( ) {
164- return html `<div
165- class= "border rounded-md border-solid border-gray-200"
166- ?hidden= ${ ! this . loading }
167- >
168- <div class= "animate-pulse p-4" >
169- <div class= "h-4 my-1 w-20 bg-gray-200 rounded" > </ div>
170- </ div>
171- <div class= "py-2.5 px-3 flex gap-1 m-0 items-center" >
172- ${ repeat (
173- Array ( 7 ) ,
174- ( ) => html `
175- <div
176- role= "button"
177- class = "size-7 flex items- center justify- center cursor - pointer"
178- >
179- <div class= "size-5 animate-pulse bg-gray-200 rounded-md" > </ div>
180- </ div>
181- `
182- ) }
183- </ div>
184- </ div> ` ;
185- }
186-
187166 private renderActionItem ( item : ActionItem , editor ?: Editor ) {
188167 if ( item . type === 'separator' ) {
189168 return html `<li class= "flex items-center" aria-hidden = "true">
0 commit comments