diff --git a/packages/search-widget/src/search-form.ts b/packages/search-widget/src/search-form.ts index b92a4ec..695ec62 100644 --- a/packages/search-widget/src/search-form.ts +++ b/packages/search-widget/src/search-form.ts @@ -8,13 +8,12 @@ import resetStyles from '@unocss/reset/tailwind.css?inline'; import { type DebouncedFunction, debounce } from 'es-toolkit'; import { uniqBy } from 'es-toolkit/compat'; import { css, html, LitElement, unsafeCSS } from 'lit'; -import { customElement, property, state } from 'lit/decorators.js'; +import { property, state } from 'lit/decorators.js'; import { createRef, type Ref, ref } from 'lit/directives/ref.js'; import { unsafeHTML } from 'lit/directives/unsafe-html.js'; import { HISTORY_KEY, MAX_HISTORY_ITEMS } from './constants'; import baseStyles from './styles/base'; -@customElement('search-form') export class SearchForm extends LitElement { @property({ type: String }) baseUrl = ''; @@ -341,6 +340,9 @@ export class SearchForm extends LitElement { ]; } +customElements.get('search-form') || + customElements.define('search-form', SearchForm); + declare global { interface HTMLElementTagNameMap { 'search-form': SearchForm; diff --git a/packages/search-widget/src/search-modal.ts b/packages/search-widget/src/search-modal.ts index b06d9ce..f716d8e 100644 --- a/packages/search-widget/src/search-modal.ts +++ b/packages/search-widget/src/search-modal.ts @@ -1,13 +1,12 @@ import resetStyles from '@unocss/reset/tailwind.css?inline'; import { css, html, LitElement, type PropertyValues, unsafeCSS } from 'lit'; -import { customElement, property } from 'lit/decorators.js'; +import { property } from 'lit/decorators.js'; import { styleMap } from 'lit/directives/style-map.js'; import { OverlayScrollbars } from 'overlayscrollbars'; import overlayscrollbarsStyles from 'overlayscrollbars/styles/overlayscrollbars.css?inline'; import './search-form'; import baseStyles from './styles/base'; -@customElement('search-modal') export class SearchModal extends LitElement { @property({ type: Boolean, @@ -179,6 +178,9 @@ export class SearchModal extends LitElement { ]; } +customElements.get('search-modal') || + customElements.define('search-modal', SearchModal); + declare global { interface HTMLElementTagNameMap { 'search-modal': SearchModal;