@mcurcio/patchbay 0.9.0 → 0.10.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/README.md +11 -2
- package/dist/composites.css +1 -1
- package/dist/composites.js +399 -254
- package/dist/composites.js.map +1 -1
- package/dist/graph.css +1 -1
- package/dist/graph.js +575 -273
- package/dist/graph.js.map +1 -1
- package/dist/hooks.js.map +1 -1
- package/dist/primitives.css +1 -1
- package/dist/primitives.js +123 -113
- package/dist/primitives.js.map +1 -1
- package/dist/shell.css +1 -1
- package/dist/shell.js +89 -71
- package/dist/shell.js.map +1 -1
- package/dist/types/composites/banner/Banner.d.ts +2 -2
- package/dist/types/composites/change-list/ChangeList.d.ts +44 -0
- package/dist/types/composites/change-list/index.d.ts +2 -0
- package/dist/types/composites/diagnostic-list/DiagnosticList.d.ts +23 -0
- package/dist/types/composites/diagnostic-list/index.d.ts +2 -0
- package/dist/types/composites/index.d.ts +2 -0
- package/dist/types/composites/status-words/StatusWords.d.ts +1 -1
- package/dist/types/graph/canvas-tools/CanvasTools.d.ts +7 -2
- package/dist/types/graph/connect-hints/connectTargets.d.ts +22 -0
- package/dist/types/graph/connect-hints/index.d.ts +3 -1
- package/dist/types/graph/connect-hints/useConnectHints.d.ts +9 -0
- package/dist/types/graph/connect-status/ConnectStatus.d.ts +30 -0
- package/dist/types/graph/connect-status/index.d.ts +2 -0
- package/dist/types/graph/context-at/index.d.ts +2 -0
- package/dist/types/graph/context-at/useContextAt.d.ts +43 -0
- package/dist/types/graph/empty-canvas-hint/EmptyCanvasHint.d.ts +33 -0
- package/dist/types/graph/empty-canvas-hint/index.d.ts +2 -0
- package/dist/types/graph/ghost-node/GhostNode.d.ts +32 -0
- package/dist/types/graph/ghost-node/index.d.ts +2 -0
- package/dist/types/graph/ghost-wire/GhostWire.d.ts +1 -1
- package/dist/types/graph/index.d.ts +4 -0
- package/dist/types/graph/meter/Meter.d.ts +8 -1
- package/dist/types/graph/meter/index.d.ts +1 -1
- package/dist/types/graph/wire/Wire.d.ts +4 -4
- package/dist/types/hooks/use-toasts/toastQueue.d.ts +1 -1
- package/dist/types/primitives/glyph/Glyph.d.ts +14 -0
- package/dist/types/primitives/glyph/index.d.ts +2 -0
- package/dist/types/primitives/icon-button/index.d.ts +1 -0
- package/dist/types/primitives/index.d.ts +1 -0
- package/dist/types/primitives/key-value/KeyValue.d.ts +3 -3
- package/dist/types/primitives/spinner/Spinner.d.ts +1 -1
- package/package.json +1 -1
- /package/dist/types/primitives/{dialog → icon-button}/CloseGlyph.d.ts +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type PanelPosition } from "@xyflow/react";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import { type Platform } from "../../hooks";
|
|
4
|
+
import "./EmptyCanvasHint.css";
|
|
5
|
+
/** The hint's own words, each replaceable. */
|
|
6
|
+
export interface EmptyCanvasHintLabels {
|
|
7
|
+
/**
|
|
8
|
+
* The add gestures: "Double-click to add a node" with a pointer, "Double-tap to add a node" on a touch screen, then
|
|
9
|
+
* ", or press A" with the app's add key as people read it.
|
|
10
|
+
*/
|
|
11
|
+
add: (gesture: "pointer" | "touch", keys: string | undefined) => string;
|
|
12
|
+
}
|
|
13
|
+
export declare const defaultEmptyCanvasHintLabels: EmptyCanvasHintLabels;
|
|
14
|
+
export type EmptyCanvasHintProps = {
|
|
15
|
+
/** The app's own words above the gestures ("This graph has no nodes yet"); none by default. */
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
/** Whether the graph is empty; without it, while React Flow holds no nodes. An app drawing a ghost node passes it. */
|
|
18
|
+
empty?: boolean;
|
|
19
|
+
/** Whether adding is on, so the gestures are said (`useAddAt`'s `enabled`); true by default. */
|
|
20
|
+
add?: boolean;
|
|
21
|
+
/** The app's add key (a key string, `"A"`), drawn through `keyLabel` after the gestures; the hint binds nothing. */
|
|
22
|
+
keys?: string;
|
|
23
|
+
/** The platform the key is written for; the browser's by default. */
|
|
24
|
+
platform?: Platform;
|
|
25
|
+
/** Where it sits on the canvas, React Flow's `PanelPosition`: "top-center" by default. */
|
|
26
|
+
position?: PanelPosition | (string & {});
|
|
27
|
+
/** Words to replace; the rest keep their defaults. */
|
|
28
|
+
labels?: Partial<EmptyCanvasHintLabels>;
|
|
29
|
+
/** Added to the panel's own `pb-empty-canvas` class. */
|
|
30
|
+
className?: string;
|
|
31
|
+
};
|
|
32
|
+
/** Says, on an empty canvas, what to do; draws nothing once the graph has a node. */
|
|
33
|
+
export declare function EmptyCanvasHint({ children, empty, add, keys, platform, position, labels, className, }: EmptyCanvasHintProps): import("react").JSX.Element | null;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Node, NodeProps } from "@xyflow/react";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import { type NodePorts } from "../node-box";
|
|
4
|
+
import "./GhostNode.css";
|
|
5
|
+
/** A ghost node's look, as React Flow's node `data`: the words and the shape of the node being added. */
|
|
6
|
+
export type GhostNodeData = {
|
|
7
|
+
/** The node's name, as it will be (`type 2`); one line, cut with an ellipsis. */
|
|
8
|
+
title: ReactNode;
|
|
9
|
+
/** The second header line in the muted colour (its type). */
|
|
10
|
+
subtitle?: ReactNode;
|
|
11
|
+
/** One row under the header ("Adding"); none by default. */
|
|
12
|
+
line?: ReactNode;
|
|
13
|
+
/** The input ports the node will have, so the ghost takes its room; none by default. */
|
|
14
|
+
inputs?: number;
|
|
15
|
+
/** The output ports the node will have; none by default. */
|
|
16
|
+
outputs?: number;
|
|
17
|
+
/** How its ports will be laid out; stacked by default. */
|
|
18
|
+
ports?: NodePorts;
|
|
19
|
+
/** Whether it will have a footer; no by default. */
|
|
20
|
+
footer?: boolean;
|
|
21
|
+
/** Its width in px; `NODE_WIDTH` by default. */
|
|
22
|
+
width?: number;
|
|
23
|
+
};
|
|
24
|
+
/** A node drawn by `GhostNode`: register it as `nodeTypes={{ ghost: GhostNode }}`. */
|
|
25
|
+
export type GhostNodeNode = Node<GhostNodeData, "ghost">;
|
|
26
|
+
/** The ghost's size in px: `nodeBoxSize` of the node it stands for, its `line` counting as the node's line row. */
|
|
27
|
+
export declare function ghostNodeSize(data: GhostNodeData): {
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
};
|
|
31
|
+
/** Draws an add's node at its point while the request is on its way. */
|
|
32
|
+
export declare function GhostNode({ data }: NodeProps<GhostNodeNode>): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Edge, type EdgeProps } from "@xyflow/react";
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
3
|
import "./GhostWire.css";
|
|
4
|
-
/** `pending` (the default) or `refused`; any other string is drawn
|
|
4
|
+
/** `pending` (the default) or `refused`; any other string is drawn in the muted stroke, dashed and dimmed. */
|
|
5
5
|
export type GhostWireTone = "pending" | "refused" | (string & {});
|
|
6
6
|
/** A ghost wire's look, as React Flow's edge `data`. */
|
|
7
7
|
export type GhostWireData = {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
export * from "./add-at";
|
|
2
2
|
export * from "./canvas-tools";
|
|
3
3
|
export * from "./connect-hints";
|
|
4
|
+
export * from "./connect-status";
|
|
5
|
+
export * from "./context-at";
|
|
6
|
+
export * from "./empty-canvas-hint";
|
|
4
7
|
export * from "./follow-fit";
|
|
8
|
+
export * from "./ghost-node";
|
|
5
9
|
export * from "./ghost-wire";
|
|
6
10
|
export * from "./meter";
|
|
7
11
|
export * from "./node-box";
|
|
@@ -29,7 +29,7 @@ export type MeterProps = Omit<ComponentPropsWithoutRef<"div">, "children" | "tit
|
|
|
29
29
|
clipAt?: number;
|
|
30
30
|
/** How long the lamp stays lit after the last such peak, in ms. 2000 by default. */
|
|
31
31
|
clipHoldMs?: number;
|
|
32
|
-
/** The accessible name ("
|
|
32
|
+
/** The accessible name: what the meter measures ("Left output"). Without it, `labels.name`; the numbers are never announced. */
|
|
33
33
|
label?: string;
|
|
34
34
|
/** Words to replace; the rest keep their defaults. */
|
|
35
35
|
labels?: Partial<MeterLabels>;
|
|
@@ -51,10 +51,17 @@ export declare const meterTitleEveryMs = 250;
|
|
|
51
51
|
export declare function toDb(linear: number): number;
|
|
52
52
|
/** Where a level in dBFS sits on a bar from `floor` (0) to 0 dBFS (1), clamped. */
|
|
53
53
|
export declare function meterFraction(db: number, floor: number): number;
|
|
54
|
+
/**
|
|
55
|
+
* A level in dBFS as the tooltip writes it: one decimal ("-12.0"), and "−∞" for silence. An app writing a meter's
|
|
56
|
+
* numbers in words (the inspector) uses it, with `toDb`, so they read as the tooltip's.
|
|
57
|
+
*/
|
|
58
|
+
export declare function formatMeterDb(db: number): string;
|
|
54
59
|
/** The English tooltip: "peak -12.0 dB, rms -18.3 dB", with −∞ for silence. */
|
|
55
60
|
export declare const defaultMeterTitle: MeterTitle;
|
|
56
61
|
/** The meter's own words, each replaceable. */
|
|
57
62
|
export interface MeterLabels {
|
|
63
|
+
/** The accessible name when the app gives no `label`: "Level". */
|
|
64
|
+
name: string;
|
|
58
65
|
/** Writes the tooltip from the level: `defaultMeterTitle`, "peak -12.0 dB, rms -18.3 dB". */
|
|
59
66
|
title: MeterTitle;
|
|
60
67
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { defaultMeterLabels, defaultMeterScale, defaultMeterTitle, Meter, meterFraction, meterTitleEveryMs, toDb, } from "./Meter";
|
|
1
|
+
export { defaultMeterLabels, defaultMeterScale, defaultMeterTitle, formatMeterDb, Meter, meterFraction, meterTitleEveryMs, toDb, } from "./Meter";
|
|
2
2
|
export type { MeterHandle, MeterLabels, MeterOrientation, MeterProps, MeterTitle } from "./Meter";
|
|
@@ -2,15 +2,15 @@ import { type Edge, type EdgeProps } from "@xyflow/react";
|
|
|
2
2
|
import { type ReactNode } from "react";
|
|
3
3
|
import type { PillTone } from "../../primitives";
|
|
4
4
|
import "./Wire.css";
|
|
5
|
-
/** Pill's tones, the changes
|
|
6
|
-
export type WireTone = PillTone | "added" | "removed" | "
|
|
5
|
+
/** Pill's tones, the changes and `refused`; any other string is drawn in the muted stroke. */
|
|
6
|
+
export type WireTone = PillTone | "added" | "removed" | "renamed" | "changed" | "refused" | (string & {});
|
|
7
7
|
/** A wire's look, as React Flow's edge `data`. */
|
|
8
8
|
export type WireData = {
|
|
9
|
-
/** The stroke's tone; none,
|
|
9
|
+
/** The stroke's tone; none is React Flow's edge stroke, and one it does not know the muted one. */
|
|
10
10
|
tone?: WireTone;
|
|
11
11
|
/** The signal's level, 0 to 1 (clamped; not a number is 0): thickness and brightness. None is the plain wire. */
|
|
12
12
|
emphasis?: number;
|
|
13
|
-
/** Dashes
|
|
13
|
+
/** Dashes. A change tone is always dashed, whatever this says. */
|
|
14
14
|
dashed?: boolean;
|
|
15
15
|
/** Dots moving along the wire toward the input; not drawn under reduced motion. */
|
|
16
16
|
flow?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
/** The tones a toast is drawn in; any other string is drawn neutrally. An `err` toast is an alert, the rest status. */
|
|
3
|
-
export type ToastTone = "ok" | "warn" | "err" | "quiet" | "off" | (string & {});
|
|
3
|
+
export type ToastTone = "ok" | "warn" | "err" | "quiet" | "off" | "accent" | "muted" | (string & {});
|
|
4
4
|
/** A button on a toast that acts on its news. Pressing it runs `run`, then dismisses the toast. */
|
|
5
5
|
export type ToastAction = {
|
|
6
6
|
/** The button's words. */
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentPropsWithRef, ReactNode } from "react";
|
|
2
|
+
import "./Glyph.css";
|
|
3
|
+
/** The glyph's box, in px: its width, its height and its viewBox's size. */
|
|
4
|
+
export declare const GLYPH_BOX = 16;
|
|
5
|
+
/** The part of the box a glyph's lines are drawn in, in px, centred: from 2 to 14 in the viewBox. */
|
|
6
|
+
export declare const GLYPH_DRAWN = 12;
|
|
7
|
+
/** The stroke every glyph is drawn at, in the box's units. */
|
|
8
|
+
export declare const GLYPH_STROKE = 1.75;
|
|
9
|
+
export type GlyphProps = Omit<ComponentPropsWithRef<"svg">, "viewBox" | "width" | "height"> & {
|
|
10
|
+
/** The glyph's shapes (paths, circles) in a 16 by 16 viewBox, within 2 to 14; stroked unless a shape says otherwise. */
|
|
11
|
+
children: ReactNode;
|
|
12
|
+
};
|
|
13
|
+
/** Draws a glyph on the one grid: a 16 px SVG box, stroked at 1.75 with round caps in the current colour. */
|
|
14
|
+
export declare function Glyph({ children, className, ...rest }: GlyphProps): import("react").JSX.Element;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
2
|
import "./KeyValue.css";
|
|
3
|
-
/** The tones a value draws in; any other string
|
|
4
|
-
export type KeyValueTone = "ok" | "warn" | "err" | "quiet" | "off" | (string & {});
|
|
3
|
+
/** The tones a value draws in; any other string draws it muted. */
|
|
4
|
+
export type KeyValueTone = "ok" | "warn" | "err" | "quiet" | "off" | "accent" | "muted" | (string & {});
|
|
5
5
|
export type KeyValueRow = {
|
|
6
6
|
/** The fact's name. */
|
|
7
7
|
key: string;
|
|
8
8
|
/** Its value. */
|
|
9
9
|
value: ReactNode;
|
|
10
|
-
/** Colours the value: a fact that is wrong or worth a look. */
|
|
10
|
+
/** Colours the value and adds a dot before it: a fact that is wrong or worth a look. */
|
|
11
11
|
tone?: KeyValueTone;
|
|
12
12
|
/** Shown on hover over the key: what the fact means. */
|
|
13
13
|
title?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
2
2
|
import "./Spinner.css";
|
|
3
3
|
export type SpinnerProps = Omit<ComponentPropsWithRef<"span">, "children"> & {
|
|
4
4
|
/** What is being waited for, read by screen readers; without it the spinner is hidden from them. */
|
package/package.json
CHANGED
|
File without changes
|