diff --git a/demo/chains-of-thought/index.html b/demo/chains-of-thought/index.html index acbba50..d8a691c 100644 --- a/demo/chains-of-thought/index.html +++ b/demo/chains-of-thought/index.html @@ -36,7 +36,7 @@ } } - folk-connection { + folk-arrow { display: block; position: absolute; inset: 0 0 0 0; diff --git a/demo/chains-of-thought/main.ts b/demo/chains-of-thought/main.ts index d435883..33b3ce4 100644 --- a/demo/chains-of-thought/main.ts +++ b/demo/chains-of-thought/main.ts @@ -1,5 +1,5 @@ import { FolkShape } from '../../src/folk-shape.ts'; -import { FolkConnection } from '../../src/folk-connection.ts'; +import { FolkArrow } from '../../src/folk-arrow.ts'; import { FileSaver } from '../src/file-system.ts'; declare global { @@ -37,8 +37,8 @@ class FolkThought extends HTMLElement { document .querySelectorAll( - `folk-connection[source="folk-shape[id='${this.#geometry.id}']"], - folk-connection[target="folk-shape[id='${this.#geometry.id}']"]` + `folk-arrow[source="folk-shape[id='${this.#geometry.id}']"], + folk-arrow[target="folk-shape[id='${this.#geometry.id}']"]` ) .forEach((el) => el.remove()); } @@ -47,7 +47,7 @@ class FolkThought extends HTMLElement { FolkShape.define(); FolkThought.define(); -FolkConnection.define(); +FolkArrow.define(); interface Thought { id: string; @@ -82,10 +82,7 @@ function renderThought({ id, x, y, text }: Thought) { } function renderConnection({ sourceId, targetId }: Connection) { - return html``; + return html``; } function renderChainOfThought({ thoughts, connections }: ChainOfThought) { @@ -100,7 +97,7 @@ function parseChainOfThought(): ChainOfThought { x: el.x, y: el.y, })), - connections: Array.from(document.querySelectorAll('folk-connection')).map((el) => ({ + connections: Array.from(document.querySelectorAll('folk-arrow')).map((el) => ({ sourceId: (el.sourceElement as FolkShape).id, targetId: (el.targetElement as FolkShape).id, })), diff --git a/demo/semantic-zoom-in-a-canvas.html b/demo/semantic-zoom-in-a-canvas.html index 7c8af3e..67b14c7 100644 --- a/demo/semantic-zoom-in-a-canvas.html +++ b/demo/semantic-zoom-in-a-canvas.html @@ -75,7 +75,7 @@ margin: 1rem; } - folk-connection { + folk-arrow { display: block; position: absolute; inset: 0 0 0 0; @@ -145,16 +145,16 @@

- - - + + + diff --git a/src/folk-connection.ts b/src/folk-connection.ts index f896cb4..19e8ef2 100644 --- a/src/folk-connection.ts +++ b/src/folk-connection.ts @@ -26,12 +26,12 @@ export type Arrow = [ declare global { interface HTMLElementTagNameMap { - 'folk-connection': FolkConnection; + 'folk-arrow': FolkArrow; } } -export class FolkConnection extends AbstractArrow { - static override tagName = 'folk-connection'; +export class FolkArrow extends AbstractArrow { + static override tagName = 'folk-arrow'; #options: StrokeOptions = { size: 7, diff --git a/src/standalone/folk-connection.ts b/src/standalone/folk-connection.ts index a9e50c0..7f6f932 100644 --- a/src/standalone/folk-connection.ts +++ b/src/standalone/folk-connection.ts @@ -1,3 +1,3 @@ -import { FolkConnection } from '../folk-connection'; +import { FolkArrow } from '../folk-arrow'; -FolkConnection.define(); +FolkArrow.define();