@harmonics/lattice-ui 0.6.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/README.md +43 -6
- package/dist/board.js +204 -204
- package/dist/define.js +1 -1
- package/dist/elements-Bk_vtqsk.js +1423 -0
- package/dist/index.js +2 -2
- package/dist/types/elements/icon.d.ts +1 -1
- package/dist/types/elements/index.d.ts +1 -1
- package/dist/types/elements/shape.d.ts +35 -3
- package/dist/types/elements/solid.d.ts +5 -1
- package/dist/{woods-FI5aDpfQ.js → woods-C8W11GkD.js} +96 -144
- package/package.json +1 -1
- package/react.d.ts +5 -0
- package/dist/elements-GhyUSrb9.js +0 -1099
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { i as e, r as t } from "./woods-
|
|
2
|
-
import { _ as n, a as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y, y as b } from "./elements-
|
|
1
|
+
import { i as e, r as t } from "./woods-C8W11GkD.js";
|
|
2
|
+
import { _ as n, a as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v, v as y, y as b } from "./elements-Bk_vtqsk.js";
|
|
3
3
|
export { b as FACES, c as FACE_TAG, f as HexSky, a as ICON_NAMES, o as ICON_TAG, s as LatticeFace, m as LatticeIcon, i as LatticeShape, n as MOODS, t as SHAPE_NAMES, u as SHAPE_TAG, r as SHEARS_TAG, h as SKY_TAG, p as ShearsPadElement, e as TONES, l as defineHexSky, _ as defineLatticeElements, y as defineLatticeFace, d as defineLatticeIcon, v as defineLatticeShape, g as defineShearsPad };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { LatticeElement } from "./host";
|
|
2
2
|
export declare const ICON_TAG = "lattice-icon";
|
|
3
|
-
export declare const ICON_NAMES: readonly ["shears", "done"];
|
|
3
|
+
export declare const ICON_NAMES: readonly ["shears", "done", "note", "turn", "glue", "apart", "bin", "name", "split", "search"];
|
|
4
4
|
export type IconName = (typeof ICON_NAMES)[number];
|
|
5
5
|
export declare class LatticeIcon extends LatticeElement {
|
|
6
6
|
static readonly observedAttributes: string[];
|
|
@@ -7,7 +7,7 @@ export { FACES } from "../faceLattice";
|
|
|
7
7
|
export type { Part } from "../hexes";
|
|
8
8
|
export { FACE_TAG, MOODS } from "./face";
|
|
9
9
|
export { ICON_NAMES, ICON_TAG, type IconName } from "./icon";
|
|
10
|
-
export { SHAPE_TAG } from "./shape";
|
|
10
|
+
export { type LatticeShapeEventMap, type PressDetail, SHAPE_TAG } from "./shape";
|
|
11
11
|
export { SHAPE_NAMES, type ShapeName, TONES } from "./shapes";
|
|
12
12
|
export { SHEARS_TAG, type StrokePoint } from "./shears";
|
|
13
13
|
export { SKY_TAG } from "./sky";
|
|
@@ -1,7 +1,22 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type Part } from "../hexes";
|
|
2
2
|
import { LatticeElement } from "./host";
|
|
3
3
|
import { type ShapeName } from "./shapes";
|
|
4
4
|
export declare const SHAPE_TAG = "lattice-shape";
|
|
5
|
+
/** What a press says: which shape, and its parts. */
|
|
6
|
+
export interface PressDetail {
|
|
7
|
+
shape: ShapeName;
|
|
8
|
+
parts: Part[];
|
|
9
|
+
}
|
|
10
|
+
/** The shape's own events, for `addEventListener`. */
|
|
11
|
+
export interface LatticeShapeEventMap extends HTMLElementEventMap {
|
|
12
|
+
press: CustomEvent<PressDetail>;
|
|
13
|
+
}
|
|
14
|
+
export interface LatticeShape {
|
|
15
|
+
addEventListener<K extends keyof LatticeShapeEventMap>(type: K, listener: (this: LatticeShape, event: LatticeShapeEventMap[K]) => unknown, options?: boolean | AddEventListenerOptions): void;
|
|
16
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
17
|
+
removeEventListener<K extends keyof LatticeShapeEventMap>(type: K, listener: (this: LatticeShape, event: LatticeShapeEventMap[K]) => unknown, options?: boolean | EventListenerOptions): void;
|
|
18
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
19
|
+
}
|
|
5
20
|
export declare class LatticeShape extends LatticeElement {
|
|
6
21
|
static readonly observedAttributes: string[];
|
|
7
22
|
private readonly shapeSignal;
|
|
@@ -10,6 +25,10 @@ export declare class LatticeShape extends LatticeElement {
|
|
|
10
25
|
private readonly liftSignal;
|
|
11
26
|
private readonly scaleSignal;
|
|
12
27
|
private readonly labelSignal;
|
|
28
|
+
private readonly pressableSignal;
|
|
29
|
+
/** Unset until the page makes it a toggle: only then does it say `aria-pressed`. */
|
|
30
|
+
private readonly pressedSignal;
|
|
31
|
+
private readonly disabledSignal;
|
|
13
32
|
get shape(): ShapeName;
|
|
14
33
|
set shape(name: string);
|
|
15
34
|
private made;
|
|
@@ -24,10 +43,23 @@ export declare class LatticeShape extends LatticeElement {
|
|
|
24
43
|
set scale(scale: number | string);
|
|
25
44
|
get label(): string;
|
|
26
45
|
set label(label: string);
|
|
46
|
+
/** A button shaped like itself. Kept as the attribute too, which its look is styled by. */
|
|
47
|
+
get pressable(): boolean;
|
|
48
|
+
set pressable(pressable: boolean | string | null);
|
|
49
|
+
/** Pressed, as a toggle; false when the page has not made it one. */
|
|
50
|
+
get pressed(): boolean;
|
|
51
|
+
set pressed(pressed: boolean | string | null | undefined);
|
|
52
|
+
get disabled(): boolean;
|
|
53
|
+
set disabled(disabled: boolean | string | null);
|
|
27
54
|
attributeChangedCallback(name: string, _: string | null, value: string | null): void;
|
|
55
|
+
/**
|
|
56
|
+
* As a button: its role, its place in the tab order (unless the page gave it one), its name and
|
|
57
|
+
* states, on the element itself, where a screen reader and the Tab key find them.
|
|
58
|
+
*/
|
|
59
|
+
private beAButton;
|
|
28
60
|
}
|
|
29
61
|
/**
|
|
30
|
-
* Register `<lattice-shape>` once, or as `name` (a tag of your own, when another library holds
|
|
31
|
-
* one); a second call, or a call on a server, does nothing.
|
|
62
|
+
* Register `<lattice-shape>` once, or as `name` (a tag of your own, when another library holds
|
|
63
|
+
* this one); a second call, or a call on a server, does nothing.
|
|
32
64
|
*/
|
|
33
65
|
export declare const defineLatticeShape: (name?: string) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { BoardChangeDetail, BoardPiece, LatticeBoard } from "./board-entry";
|
|
2
|
-
import type { HexSky, IconName, LatticeFace, LatticeIcon, LatticeShape, Part, ShapeName, ShearsPadElement, StrokeDetail, StrokeEndDetail } from "./index";
|
|
2
|
+
import type { HexSky, IconName, LatticeFace, LatticeIcon, LatticeShape, Part, PressDetail, ShapeName, ShearsPadElement, StrokeDetail, StrokeEndDetail } from "./index";
|
|
3
3
|
declare module "solid-js" {
|
|
4
4
|
namespace JSX {
|
|
5
5
|
interface IntrinsicElements {
|
|
@@ -26,6 +26,9 @@ declare module "solid-js" {
|
|
|
26
26
|
lift?: number | string;
|
|
27
27
|
scale?: number | string;
|
|
28
28
|
label?: string;
|
|
29
|
+
pressable?: boolean;
|
|
30
|
+
pressed?: boolean;
|
|
31
|
+
disabled?: boolean;
|
|
29
32
|
};
|
|
30
33
|
"shears-pad": JSX.HTMLAttributes<ShearsPadElement> & {
|
|
31
34
|
disabled?: boolean;
|
|
@@ -50,6 +53,7 @@ declare module "solid-js" {
|
|
|
50
53
|
catch: CustomEvent<{
|
|
51
54
|
id: string;
|
|
52
55
|
}>;
|
|
56
|
+
press: CustomEvent<PressDetail>;
|
|
53
57
|
stroke: CustomEvent<StrokeDetail>;
|
|
54
58
|
strokeend: CustomEvent<StrokeEndDetail>;
|
|
55
59
|
}
|