import * as Utils from '../services/Utils.js'; // import '../services/js' /** * NoteItem - Leaf component for a single note row. * * Dispatches: * note-open — bubbled, detail: { noteId } * note-more-actions — bubbled, detail: { noteId } */ export class NoteItem extends HTMLElement { static get observedAttributes() { return ['note-id', 'title', 'preview', 'date']; } connectedCallback() { this._render(); } attributeChangedCallback() { this._render(); } _render() { const noteId = this.getAttribute('note-id') || ''; const title = this.getAttribute('title') || 'Untitled'; const preview = this.getAttribute('preview') || ''; const date = this.getAttribute('date') || ''; this.innerHTML = ''; this.className = 'note-item'; this.dataset.noteId = noteId; const contentWrapper = document.createElement('div'); contentWrapper.className = 'note-item-content'; contentWrapper.innerHTML = `