renames
This commit is contained in:
parent
8e1a8a7691
commit
c81eb7c2f1
|
|
@ -1,5 +1,5 @@
|
||||||
import { getBoxToBoxArrow } from 'perfect-arrows';
|
import { getBoxToBoxArrow } from 'perfect-arrows';
|
||||||
import { FolkConnection } from './folk-connection.ts';
|
import { FolkBaseConnection } from './folk-base-connection.ts';
|
||||||
import { getSvgPathFromStroke, pointsOnBezierCurves } from './common/utils.ts';
|
import { getSvgPathFromStroke, pointsOnBezierCurves } from './common/utils.ts';
|
||||||
import { getStroke, StrokeOptions } from 'perfect-freehand';
|
import { getStroke, StrokeOptions } from 'perfect-freehand';
|
||||||
|
|
||||||
|
|
@ -30,7 +30,7 @@ declare global {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FolkArrow extends FolkConnection {
|
export class FolkArrow extends FolkBaseConnection {
|
||||||
static override tagName = 'folk-arrow';
|
static override tagName = 'folk-arrow';
|
||||||
|
|
||||||
#options: StrokeOptions = {
|
#options: StrokeOptions = {
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ function parseCSSSelector(selector: string): string[] {
|
||||||
return selector.split('>>>').map((s) => s.trim());
|
return selector.split('>>>').map((s) => s.trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FolkConnection extends HTMLElement {
|
export class FolkBaseConnection extends HTMLElement {
|
||||||
static tagName = 'folk-connection';
|
static tagName = 'folk-base-connection';
|
||||||
|
|
||||||
static define() {
|
static define() {
|
||||||
if (customElements.get(this.tagName)) return;
|
if (customElements.get(this.tagName)) return;
|
||||||
|
|
@ -4,14 +4,14 @@ const clientRectObserver = new ClientRectObserverManager();
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface HTMLElementTagNameMap {
|
interface HTMLElementTagNameMap {
|
||||||
'folk-set': FolkSet;
|
'folk-base-set': FolkBaseSet;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultRect = DOMRectReadOnly.fromRect();
|
const defaultRect = DOMRectReadOnly.fromRect();
|
||||||
|
|
||||||
export class FolkSet extends HTMLElement {
|
export class FolkBaseSet extends HTMLElement {
|
||||||
static tagName = 'folk-set';
|
static tagName = 'folk-base-set';
|
||||||
|
|
||||||
static define() {
|
static define() {
|
||||||
if (customElements.get(this.tagName)) return;
|
if (customElements.get(this.tagName)) return;
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
import { FolkSet } from './folk-set';
|
import { FolkBaseSet } from './folk-base-set';
|
||||||
import { verticesToPolygon } from './common/utils';
|
import { verticesToPolygon } from './common/utils';
|
||||||
import type { Point } from './common/types';
|
import type { Point } from './common/types';
|
||||||
declare global {
|
declare global {
|
||||||
|
|
@ -7,7 +7,7 @@ declare global {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FolkHull extends FolkSet {
|
export class FolkHull extends FolkBaseSet {
|
||||||
static tagName = 'folk-hull';
|
static tagName = 'folk-hull';
|
||||||
|
|
||||||
#hull: Point[] = [];
|
#hull: Point[] = [];
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
import { Vector } from './common/Vector.ts';
|
import { Vector } from './common/Vector.ts';
|
||||||
import type { Point, RotatedDOMRect } from './common/types.ts';
|
import type { Point, RotatedDOMRect } from './common/types.ts';
|
||||||
import { FolkConnection } from './folk-connection.ts';
|
import { FolkBaseConnection } from './folk-base-connection.ts';
|
||||||
|
|
||||||
const lerp = (first: number, second: number, percentage: number) => first + (second - first) * percentage;
|
const lerp = (first: number, second: number, percentage: number) => first + (second - first) * percentage;
|
||||||
|
|
||||||
|
|
@ -25,7 +25,7 @@ declare global {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export class FolkRope extends FolkConnection {
|
export class FolkRope extends FolkBaseConnection {
|
||||||
static override tagName = 'folk-rope';
|
static override tagName = 'folk-rope';
|
||||||
|
|
||||||
#svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
#svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
import { FolkConnection } from './folk-connection.js';
|
import { FolkBaseConnection } from './folk-base-connection.js';
|
||||||
import { verticesToPolygon } from './common/utils.js';
|
import { verticesToPolygon } from './common/utils.js';
|
||||||
import type { Point } from './common/types.js';
|
import type { Point } from './common/types.js';
|
||||||
export class FolkXanadu extends FolkConnection {
|
export class FolkXanadu extends FolkBaseConnection {
|
||||||
static tagName = 'folk-xanadu';
|
static tagName = 'folk-xanadu';
|
||||||
|
|
||||||
render(sourceRect: DOMRectReadOnly, targetRect: DOMRectReadOnly): void {
|
render(sourceRect: DOMRectReadOnly, targetRect: DOMRectReadOnly): void {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue