@danxbot/ui 13.2.0 → 13.3.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/dist/index.js +8373 -8170
- package/dist/index.js.map +1 -1
- package/dist/types/components/focus-web/FocusWeb.d.ts +3 -0
- package/dist/types/components/focus-web/index.d.ts +4 -0
- package/dist/types/components/focus-web/layout.d.ts +28 -0
- package/dist/types/components/focus-web/types.d.ts +66 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { FocusWeb } from "./FocusWeb";
|
|
2
|
+
export { CENTER_POSITION, PARENT_POSITION, WIDE_RING_THRESHOLD, layoutRing } from "./layout";
|
|
3
|
+
export type { PlacedRingNode } from "./layout";
|
|
4
|
+
export type { FocusNodeRenderContext, FocusNodeRenderer, FocusNodeRole, FocusWebNode, FocusWebProps, } from "./types";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** Ids at or below this count get ONE ring; more get two concentric ones. */
|
|
2
|
+
export declare const WIDE_RING_THRESHOLD = 10;
|
|
3
|
+
/** Fixed corner slot for the "up" affordance — matches the legacy page's own
|
|
4
|
+
placement (`left: 7%, top: 10%`), never part of the ring itself. */
|
|
5
|
+
export declare const PARENT_POSITION: {
|
|
6
|
+
leftPct: number;
|
|
7
|
+
topPct: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const CENTER_POSITION: {
|
|
10
|
+
leftPct: number;
|
|
11
|
+
topPct: number;
|
|
12
|
+
};
|
|
13
|
+
export interface PlacedRingNode {
|
|
14
|
+
id: string;
|
|
15
|
+
leftPct: number;
|
|
16
|
+
topPct: number;
|
|
17
|
+
/** Which concentric ring this sits on. `0` (outer) for every node while the
|
|
18
|
+
ring is at or below `WIDE_RING_THRESHOLD`. */
|
|
19
|
+
tier: 0 | 1;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Places `ids` (already in the caller's desired order — see `types.ts`'s
|
|
23
|
+
* module doc) around one or two concentric rings. Pure and total: an empty
|
|
24
|
+
* array places nothing, and the result is always the same length as `ids`,
|
|
25
|
+
* in the SAME order, so a caller can zip it back against its own node array
|
|
26
|
+
* by index without a lookup.
|
|
27
|
+
*/
|
|
28
|
+
export declare function layoutRing(ids: readonly string[], threshold?: number): PlacedRingNode[];
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import type { CanvasNode } from "../node-canvas/types";
|
|
3
|
+
/**
|
|
4
|
+
* One node FocusWeb draws — the centre, a ring member, or the "up" parent.
|
|
5
|
+
* Same `Extra`-carrying shape as `CanvasNode` everywhere else in this library
|
|
6
|
+
* (`node-canvas/types.ts`'s own module doc explains why): a consumer's own
|
|
7
|
+
* fields (an icon name, a type, a colour) come back untouched through
|
|
8
|
+
* `renderNode`, and the library assigns no meaning to any of them.
|
|
9
|
+
*/
|
|
10
|
+
export type FocusWebNode<Extra = unknown> = CanvasNode<Extra>;
|
|
11
|
+
/** Which of the three roles a rendered node is playing this frame. */
|
|
12
|
+
export type FocusNodeRole = "center" | "ring" | "parent";
|
|
13
|
+
/**
|
|
14
|
+
* What `renderNode` is told about the node it is drawing — structural facts
|
|
15
|
+
* about the node's place in THIS frame's layout, mirroring
|
|
16
|
+
* `ExplorerNodeRenderContext` / `NodeRenderContext` elsewhere in the library.
|
|
17
|
+
*/
|
|
18
|
+
export interface FocusNodeRenderContext {
|
|
19
|
+
role: FocusNodeRole;
|
|
20
|
+
/** 0-based position in `ring`, in the order the caller supplied. `null` for `center`/`parent`. */
|
|
21
|
+
index: number | null;
|
|
22
|
+
/** Which of the (possibly two) concentric rings this ring node sits on — see `layoutRing`. `null` off the ring. */
|
|
23
|
+
tier: 0 | 1 | null;
|
|
24
|
+
/** This ring node currently carries the roving tab stop. Always `false` for `center`/`parent` (neither is ring-navigable). */
|
|
25
|
+
isTabStop: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* The viewport is narrow enough (< 640px) that FocusWeb has switched to its
|
|
28
|
+
* own compact layout (a taller plane, giving a wide two-tier ring more
|
|
29
|
+
* vertical room to spread into — PLN-12 architecture §4 "works at 375px").
|
|
30
|
+
* `renderNode` gets this so a custom body can shrink its own icon/label
|
|
31
|
+
* the same way `DefaultFocusNodeBody` shrinks itself — a body that ignores
|
|
32
|
+
* it still renders correctly, just at its normal size in less headroom.
|
|
33
|
+
*/
|
|
34
|
+
compact: boolean;
|
|
35
|
+
}
|
|
36
|
+
export type FocusNodeRenderer<Extra = unknown> = (node: FocusWebNode<Extra>, context: FocusNodeRenderContext) => ReactNode;
|
|
37
|
+
export interface FocusWebProps<Extra = unknown> {
|
|
38
|
+
/** The node currently centred. Controlled — FocusWeb never picks its own centre. */
|
|
39
|
+
center: FocusWebNode<Extra>;
|
|
40
|
+
/**
|
|
41
|
+
* The centre's one-hop neighbours, already in the exact order to draw.
|
|
42
|
+
* FocusWeb does not sort, dedupe or reorder this — see the module doc.
|
|
43
|
+
*/
|
|
44
|
+
ring: readonly FocusWebNode<Extra>[];
|
|
45
|
+
/** The "up" affordance's target. `null`/`undefined` at the root — no parent, no up button. */
|
|
46
|
+
parent?: FocusWebNode<Extra> | null;
|
|
47
|
+
/**
|
|
48
|
+
* Fired when a ring node is activated (click, or Enter/Space while it
|
|
49
|
+
* carries the roving tab stop). FocusWeb does not recentre itself — the
|
|
50
|
+
* caller responds by changing `center`/`ring`/`parent`, which is what makes
|
|
51
|
+
* the position change and glide.
|
|
52
|
+
*/
|
|
53
|
+
onSelect: (id: string) => void;
|
|
54
|
+
/**
|
|
55
|
+
* Fired when the "up" affordance is activated. Ignored (and the button
|
|
56
|
+
* inert to the keyboard shortcut) while `parent` is absent — see
|
|
57
|
+
* `FocusWebProps.parent`.
|
|
58
|
+
*/
|
|
59
|
+
onUp?: () => void;
|
|
60
|
+
/** Custom node body. Omit for a plain label pill — the same "falls back to
|
|
61
|
+
label" rule as `CanvasNode.label` everywhere else in this library. */
|
|
62
|
+
renderNode?: FocusNodeRenderer<Extra>;
|
|
63
|
+
/** Accessible name for the whole widget (an `aria-label`, `role="group"`). */
|
|
64
|
+
label: string;
|
|
65
|
+
className?: string;
|
|
66
|
+
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -131,6 +131,7 @@ export { confidenceLevel, CONFIDENCE_LEVEL_LABELS, type ConfidenceLevel } from "
|
|
|
131
131
|
export { createSimStore, resetSimStores, useSimSettings, setSimSettings, getNetworkSpeed, getDataSource, simulateLatency, SimNetworkError, type SimStore, type SimStoreOptions, type SimSettings, type NetworkSpeed, type DataSource, type SimNamespace, } from "./lib/sim";
|
|
132
132
|
export { NodeCanvas, LAYOUT_DEFAULTS, edgePath, layoutGraph, neighbourhood, type NodeCanvasProps, type CanvasCycleScope, type CanvasEdge, type CanvasGraph, type CanvasGroup, type CanvasLayout, type CanvasNode, type CanvasOrientation, type CanvasPlacedEdge, type CanvasScope, type LayoutOptions, type NodeRenderContext, type NodeRenderer, type PlacedNode, } from "./components/node-canvas";
|
|
133
133
|
export { GraphExplorer, frameBoxFor, layoutExplorerTree, neighbourhoodTree, CAMERA_DEFAULTS, centerOn, clampScale, fitBox, fitBoxWithFloor, toContentPoint, toScreenPoint, unionBox, zoomAtPoint, type GraphExplorerProps, type Box, type CameraState, type FitOptions, type FitWithFloorOptions, type FitWithFloorResult, type FrameOverflow, type Point, type ScaleBounds, type Size, type CrossLink, type ExplorerLayout, type ExplorerNodeRenderContext, type ExplorerNodeRenderer, type ExplorerTree, type GraphExplorerVariant, type TreeNode as ExplorerTreeNode, } from "./components/graph-explorer";
|
|
134
|
+
export { FocusWeb, CENTER_POSITION, PARENT_POSITION, WIDE_RING_THRESHOLD, layoutRing, type FocusNodeRenderContext, type FocusNodeRenderer, type FocusNodeRole, type FocusWebNode, type FocusWebProps, type PlacedRingNode, } from "./components/focus-web";
|
|
134
135
|
export { SequenceDiagram, type SequenceDiagramProps, type SequenceStep, } from "./components/SequenceDiagram";
|
|
135
136
|
export { defineRecordType, resetRecordTypes, useRecord, useRecords, useStaleness, write, writeAll, peekRecord, readState, readStaleness, subscribeToKey, subscribeToStaleness, retainKeys, sweepRecords, setRecordStoreTenant, getRecordStoreTenant, flushRecordNotifications, resetRecordStore, recordStoreStats, UNKNOWN_STATE, normalizeTypeName, normalizeTimestamp, recordKey, isRecordRef, type RecordRef, type ReadOptions, type RecordPayload, type RecordState, type RecordTypeOptions, type RecordTypeToken, type StalenessEntry, type WriteAllResult, type WriteOptions, type WriteResult, type WriteSource, type WriteVerdict, } from "./lib/records";
|
|
136
137
|
export { RealtimeProvider, useRealtime, useRealtimeEpoch, useRealtimeHealth, useRealtimeRegistry, SubscriptionRegistry, normalizeScope, scopeKey, subscriptionKey, readRealtimeEpoch, subscribeToRealtimeEpoch, subscribeToRealtimeEvents, resetRealtimeSignals, type RealtimeChannel, type RealtimeConnectionState, type RealtimeDiagnostic, type RealtimeEvent, type RealtimeHealth, type RealtimeProviderProps, type RealtimeScope, type RealtimeScopeInput, type RealtimeStatus, type RealtimeTransport, type RegistryOptions, type SubscriptionHealth, type SubscriptionLease, type SubscriptionRequest, } from "./lib/realtime";
|