Skip to content

Commit

Permalink
add lit reactive element
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisShank committed Dec 4, 2024
1 parent c81eb7c commit a7421f9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"dependencies": {
"@babel/parser": "^7.26.2",
"@lit/reactive-element": "^2.0.4",
"leaflet": "^1.9.4",
"perfect-arrows": "^0.3.7",
"perfect-freehand": "^1.2.2"
Expand Down
4 changes: 3 additions & 1 deletion src/common/folk-element.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { ReactiveElement } from '@lit/reactive-element';

// will eventually extend Lit's ReactiveElement
export class FolkElement extends HTMLElement {
export class FolkElement extends ReactiveElement {
static tagName = '';

static define() {
Expand Down
2 changes: 1 addition & 1 deletion src/folk-base-connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function parseCSSSelector(selector: string): string[] {
}

export class FolkBaseConnection extends HTMLElement {
static tagName = 'folk-base-connection';
static tagName = '';

static define() {
if (customElements.get(this.tagName)) return;
Expand Down
8 changes: 1 addition & 7 deletions src/folk-base-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@ import { ClientRectObserverEntry, ClientRectObserverManager } from './common/cli

const clientRectObserver = new ClientRectObserverManager();

declare global {
interface HTMLElementTagNameMap {
'folk-base-set': FolkBaseSet;
}
}

const defaultRect = DOMRectReadOnly.fromRect();

export class FolkBaseSet extends HTMLElement {
static tagName = 'folk-base-set';
static tagName = '';

static define() {
if (customElements.get(this.tagName)) return;
Expand Down

0 comments on commit a7421f9

Please sign in to comment.