@hlang-org/editor-ui 0.2.2 → 0.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/lib/index.d.mts +33 -10
- package/lib/index.d.ts +33 -10
- package/lib/index.js +21 -8
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +21 -8
- package/lib/index.mjs.map +1 -1
- package/package.json +12 -11
package/lib/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NodeKind, EditorNode, PortDescriptor, EditorCore, NodeId, Diagnostic, ParamValue, NodeDescriptor, ParamBag, Endpoint, IConnectionValidator, Point, IExecutionHandle } from '@hlang-org/editor-core';
|
|
2
|
-
import { CSSProperties, ReactNode, ReactElement,
|
|
3
|
-
import { NodeProps, EdgeProps, NodeTypes, EdgeTypes,
|
|
2
|
+
import { CSSProperties, ReactNode, ReactElement, RefObject } from 'react';
|
|
3
|
+
import { NodeProps, EdgeProps, NodeTypes, EdgeTypes, OnConnectStartParams } from '@xyflow/react';
|
|
4
4
|
import { HlangRFNode, HlangRFEdge } from '@hlang-org/editor-react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -11,7 +11,7 @@ import { HlangRFNode, HlangRFEdge } from '@hlang-org/editor-react';
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
/** The full set of token custom-property names (without the leading `--`). */
|
|
14
|
-
declare const TOKEN_NAMES: readonly ["hl-void", "hl-void-2", "hl-surface", "hl-surface-2", "hl-line", "hl-line-strong", "hl-silver", "hl-silver-hi", "hl-silver-lo", "hl-spark", "hl-r", "hl-t", "hl-w", "hl-error", "hl-ink", "hl-ink-2", "hl-ink-3", "hl-font-ui", "hl-font-mono", "hl-r-sm", "hl-r-md", "hl-r-lg", "hl-r-pill", "hl-shadow-node", "hl-shadow-glass", "hl-glow-silver", "hl-ease"];
|
|
14
|
+
declare const TOKEN_NAMES: readonly ["hl-void", "hl-void-2", "hl-surface", "hl-surface-2", "hl-line", "hl-line-strong", "hl-silver", "hl-silver-hi", "hl-silver-lo", "hl-glass", "hl-glass-2", "hl-glass-blur", "hl-glass-sat", "hl-glass-edge", "hl-glass-edge-hi", "hl-spark", "hl-r", "hl-t", "hl-w", "hl-error", "hl-warning", "hl-ink", "hl-ink-2", "hl-ink-3", "hl-font-ui", "hl-font-mono", "hl-r-sm", "hl-r-md", "hl-r-lg", "hl-r-pill", "hl-shadow-node", "hl-shadow-glass", "hl-glow-silver", "hl-ease", "hl-activity", "hl-cost"];
|
|
15
15
|
/** A token name (without `--`), e.g. `'hl-silver'`. */
|
|
16
16
|
type TokenName = (typeof TOKEN_NAMES)[number];
|
|
17
17
|
/** `var(--<name>)` reference string for a token. */
|
|
@@ -623,7 +623,7 @@ interface ConnectableResult {
|
|
|
623
623
|
* the candidate node does not exist yet — legality here is purely a property of
|
|
624
624
|
* the two ports.
|
|
625
625
|
*/
|
|
626
|
-
declare function connectableCandidates(query: string, descriptors: readonly NodeDescriptor[], pending: PendingConnection, validator: IConnectionValidator): readonly ConnectableResult[];
|
|
626
|
+
declare function connectableCandidates(query: string, descriptors: readonly NodeDescriptor[], pending: PendingConnection, validator: Pick<IConnectionValidator, 'canLink'>): readonly ConnectableResult[];
|
|
627
627
|
|
|
628
628
|
/**
|
|
629
629
|
* `useNodeSearch` — palette state + commit logic for creating nodes by search.
|
|
@@ -715,12 +715,28 @@ interface NodeSearchTriggerOptions {
|
|
|
715
715
|
/** Monotonic clock in ms. Defaults to `performance.now`. */
|
|
716
716
|
readonly now?: () => number;
|
|
717
717
|
}
|
|
718
|
-
/**
|
|
718
|
+
/** Where a pointer is, as mouse events (DOM and React) report it. */
|
|
719
|
+
interface PointerPosition {
|
|
720
|
+
readonly clientX: number;
|
|
721
|
+
readonly clientY: number;
|
|
722
|
+
}
|
|
723
|
+
/** Where touches ended, as touch events report it. */
|
|
724
|
+
interface TouchPositions {
|
|
725
|
+
readonly changedTouches: ArrayLike<PointerPosition>;
|
|
726
|
+
}
|
|
727
|
+
/** How a connection drag ended: on a node, or (`toNode: null`) in empty space. */
|
|
728
|
+
interface ConnectionEnd {
|
|
729
|
+
readonly toNode: object | null;
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* Handlers to spread onto the `<ReactFlow>` element. Each declares only what it
|
|
733
|
+
* reads, so React Flow's full events and states fit them.
|
|
734
|
+
*/
|
|
719
735
|
interface NodeSearchTriggers {
|
|
720
|
-
readonly onConnectStart:
|
|
721
|
-
readonly onConnectEnd:
|
|
736
|
+
readonly onConnectStart: (event: unknown, params: OnConnectStartParams) => void;
|
|
737
|
+
readonly onConnectEnd: (event: PointerPosition | TouchPositions, connectionState: ConnectionEnd) => void;
|
|
722
738
|
/** Attach to `<ReactFlow onPaneClick>`; a rapid second click opens the palette. */
|
|
723
|
-
onPaneClick(event:
|
|
739
|
+
readonly onPaneClick: (event: PointerPosition) => void;
|
|
724
740
|
}
|
|
725
741
|
declare function useNodeSearchTriggers(core: EditorCore, search: NodeSearchController, options?: NodeSearchTriggerOptions): NodeSearchTriggers;
|
|
726
742
|
|
|
@@ -877,7 +893,8 @@ declare function useToast(): ToastApi;
|
|
|
877
893
|
* so only the components whose state actually flips re-render.
|
|
878
894
|
* - Edge "flowing" state is computed from an injected edge index, not by
|
|
879
895
|
* reaching into another layer's model at paint time.
|
|
880
|
-
* - A single rAF loop advances decay and notifies only changed ids
|
|
896
|
+
* - A single rAF loop advances decay and notifies only changed ids, once per
|
|
897
|
+
* frame however many signals arrived in it.
|
|
881
898
|
*/
|
|
882
899
|
/** Live state of a node during execution. */
|
|
883
900
|
type NodeLiveState = 'idle' | 'active' | 'error';
|
|
@@ -931,6 +948,12 @@ declare class LiveSignalStore {
|
|
|
931
948
|
/** Whether an edge is currently flowing. */
|
|
932
949
|
isEdgeFlowing(edgeId: string): boolean;
|
|
933
950
|
private subscribe;
|
|
951
|
+
/**
|
|
952
|
+
* Arms the frame loop if it is not running. Signals only record state; the
|
|
953
|
+
* next frame notifies, so a burst of signals costs one pass over the
|
|
954
|
+
* subscribers per frame, not one per signal, and every change shows within a
|
|
955
|
+
* frame.
|
|
956
|
+
*/
|
|
934
957
|
private ensureLoop;
|
|
935
958
|
private stopLoop;
|
|
936
959
|
/**
|
|
@@ -981,4 +1004,4 @@ declare function useNodeLiveState(nodeId: string): NodeLiveState;
|
|
|
981
1004
|
declare function useEdgeFlowing(edgeId: string): boolean;
|
|
982
1005
|
|
|
983
1006
|
export { AssetGrid, AssetNodeChrome, CanvasChrome, CanvasDock, Cheatsheet, DiagnosticBadge, EditorShell, EditorUIThemeProvider, EmptyState, FlowEdge, HlangNode, InspectorPanel, KIND_ROLE, KIND_TOKEN, LiveSignalProvider, LiveSignalStore, NodeBodySlot, NodeChrome, NodeContextMenu, NodeInteractionProvider, NodeSearch, OutlineTree, ParamForm, PillNodeChrome, PortRow, PositionPanel, PreviewPanel, RailTabs, RunButton, SignalBar, TOKEN_NAMES, ToastProvider, ToolCluster, Toolbar, ToolbarGhostButton, ToolbarStat, UndoRedo, connectableCandidates, createHlangFlowTypes, createTheme, deriveParamSchema, descriptorCandidates, fuzzyRank, fuzzyScore, isEditableTarget, searchNodes, tokenVar, useEdgeFlowing, useEditorHotkeys, useLiveSignalStore, useLiveSignals, useNodeContextMenu, useNodeInteraction, useNodeLiveState, useNodeParams, useNodeSearch, useNodeSearchTriggers, useToast };
|
|
984
|
-
export type { AssetGridProps, AssetItem, AssetNodeChromeProps, CanvasChromeProps, CanvasDockProps, CanvasMode, CheatsheetProps, ConnectableResult, ContextMenuItem, DiagnosticBadgeProps, EdgeIndexEntry, EditorHotkeysOptions, EditorShellProps, EditorUIThemeProviderProps, EmptyStateProps, FuzzyCandidate, FuzzyMatch, FuzzyResult, HlangFlowTypes, InspectorPanelProps, LiveSignalProviderProps, LiveSignalStoreDeps, NodeBodySlotProps, NodeCandidate, NodeChromeProps, NodeContextMenuController, NodeContextMenuProps, NodeContextMenuState, NodeInteraction, NodeInteractionProviderProps, NodeLiveState, NodeParamsHandle, NodeSearchController, NodeSearchProps, NodeSearchResult, NodeSearchResultView, NodeSearchState, NodeSearchTriggerOptions, NodeSearchTriggers, OutlineTreeProps, ParamField, ParamFieldBase, ParamFormProps, PendingConnection, PillNodeChromeProps, PortRowProps, PositionPanelProps, PreviewPanelProps, RailTab, RailTabsProps, RunButtonProps, ShortcutGroup, ShortcutRow, ThemeOverride, ToastApi, ToastProviderProps, TokenName, ToolClusterProps, ToolItem, ToolbarProps, UndoRedoProps };
|
|
1007
|
+
export type { AssetGridProps, AssetItem, AssetNodeChromeProps, CanvasChromeProps, CanvasDockProps, CanvasMode, CheatsheetProps, ConnectableResult, ConnectionEnd, ContextMenuItem, DiagnosticBadgeProps, EdgeIndexEntry, EditorHotkeysOptions, EditorShellProps, EditorUIThemeProviderProps, EmptyStateProps, FuzzyCandidate, FuzzyMatch, FuzzyResult, HlangFlowTypes, InspectorPanelProps, LiveSignalProviderProps, LiveSignalStoreDeps, NodeBodySlotProps, NodeCandidate, NodeChromeProps, NodeContextMenuController, NodeContextMenuProps, NodeContextMenuState, NodeInteraction, NodeInteractionProviderProps, NodeLiveState, NodeParamsHandle, NodeSearchController, NodeSearchProps, NodeSearchResult, NodeSearchResultView, NodeSearchState, NodeSearchTriggerOptions, NodeSearchTriggers, OutlineTreeProps, ParamField, ParamFieldBase, ParamFormProps, PendingConnection, PillNodeChromeProps, PointerPosition, PortRowProps, PositionPanelProps, PreviewPanelProps, RailTab, RailTabsProps, RunButtonProps, ShortcutGroup, ShortcutRow, ThemeOverride, ToastApi, ToastProviderProps, TokenName, ToolClusterProps, ToolItem, ToolbarProps, TouchPositions, UndoRedoProps };
|
package/lib/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NodeKind, EditorNode, PortDescriptor, EditorCore, NodeId, Diagnostic, ParamValue, NodeDescriptor, ParamBag, Endpoint, IConnectionValidator, Point, IExecutionHandle } from '@hlang-org/editor-core';
|
|
2
|
-
import { CSSProperties, ReactNode, ReactElement,
|
|
3
|
-
import { NodeProps, EdgeProps, NodeTypes, EdgeTypes,
|
|
2
|
+
import { CSSProperties, ReactNode, ReactElement, RefObject } from 'react';
|
|
3
|
+
import { NodeProps, EdgeProps, NodeTypes, EdgeTypes, OnConnectStartParams } from '@xyflow/react';
|
|
4
4
|
import { HlangRFNode, HlangRFEdge } from '@hlang-org/editor-react';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -11,7 +11,7 @@ import { HlangRFNode, HlangRFEdge } from '@hlang-org/editor-react';
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
/** The full set of token custom-property names (without the leading `--`). */
|
|
14
|
-
declare const TOKEN_NAMES: readonly ["hl-void", "hl-void-2", "hl-surface", "hl-surface-2", "hl-line", "hl-line-strong", "hl-silver", "hl-silver-hi", "hl-silver-lo", "hl-spark", "hl-r", "hl-t", "hl-w", "hl-error", "hl-ink", "hl-ink-2", "hl-ink-3", "hl-font-ui", "hl-font-mono", "hl-r-sm", "hl-r-md", "hl-r-lg", "hl-r-pill", "hl-shadow-node", "hl-shadow-glass", "hl-glow-silver", "hl-ease"];
|
|
14
|
+
declare const TOKEN_NAMES: readonly ["hl-void", "hl-void-2", "hl-surface", "hl-surface-2", "hl-line", "hl-line-strong", "hl-silver", "hl-silver-hi", "hl-silver-lo", "hl-glass", "hl-glass-2", "hl-glass-blur", "hl-glass-sat", "hl-glass-edge", "hl-glass-edge-hi", "hl-spark", "hl-r", "hl-t", "hl-w", "hl-error", "hl-warning", "hl-ink", "hl-ink-2", "hl-ink-3", "hl-font-ui", "hl-font-mono", "hl-r-sm", "hl-r-md", "hl-r-lg", "hl-r-pill", "hl-shadow-node", "hl-shadow-glass", "hl-glow-silver", "hl-ease", "hl-activity", "hl-cost"];
|
|
15
15
|
/** A token name (without `--`), e.g. `'hl-silver'`. */
|
|
16
16
|
type TokenName = (typeof TOKEN_NAMES)[number];
|
|
17
17
|
/** `var(--<name>)` reference string for a token. */
|
|
@@ -623,7 +623,7 @@ interface ConnectableResult {
|
|
|
623
623
|
* the candidate node does not exist yet — legality here is purely a property of
|
|
624
624
|
* the two ports.
|
|
625
625
|
*/
|
|
626
|
-
declare function connectableCandidates(query: string, descriptors: readonly NodeDescriptor[], pending: PendingConnection, validator: IConnectionValidator): readonly ConnectableResult[];
|
|
626
|
+
declare function connectableCandidates(query: string, descriptors: readonly NodeDescriptor[], pending: PendingConnection, validator: Pick<IConnectionValidator, 'canLink'>): readonly ConnectableResult[];
|
|
627
627
|
|
|
628
628
|
/**
|
|
629
629
|
* `useNodeSearch` — palette state + commit logic for creating nodes by search.
|
|
@@ -715,12 +715,28 @@ interface NodeSearchTriggerOptions {
|
|
|
715
715
|
/** Monotonic clock in ms. Defaults to `performance.now`. */
|
|
716
716
|
readonly now?: () => number;
|
|
717
717
|
}
|
|
718
|
-
/**
|
|
718
|
+
/** Where a pointer is, as mouse events (DOM and React) report it. */
|
|
719
|
+
interface PointerPosition {
|
|
720
|
+
readonly clientX: number;
|
|
721
|
+
readonly clientY: number;
|
|
722
|
+
}
|
|
723
|
+
/** Where touches ended, as touch events report it. */
|
|
724
|
+
interface TouchPositions {
|
|
725
|
+
readonly changedTouches: ArrayLike<PointerPosition>;
|
|
726
|
+
}
|
|
727
|
+
/** How a connection drag ended: on a node, or (`toNode: null`) in empty space. */
|
|
728
|
+
interface ConnectionEnd {
|
|
729
|
+
readonly toNode: object | null;
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* Handlers to spread onto the `<ReactFlow>` element. Each declares only what it
|
|
733
|
+
* reads, so React Flow's full events and states fit them.
|
|
734
|
+
*/
|
|
719
735
|
interface NodeSearchTriggers {
|
|
720
|
-
readonly onConnectStart:
|
|
721
|
-
readonly onConnectEnd:
|
|
736
|
+
readonly onConnectStart: (event: unknown, params: OnConnectStartParams) => void;
|
|
737
|
+
readonly onConnectEnd: (event: PointerPosition | TouchPositions, connectionState: ConnectionEnd) => void;
|
|
722
738
|
/** Attach to `<ReactFlow onPaneClick>`; a rapid second click opens the palette. */
|
|
723
|
-
onPaneClick(event:
|
|
739
|
+
readonly onPaneClick: (event: PointerPosition) => void;
|
|
724
740
|
}
|
|
725
741
|
declare function useNodeSearchTriggers(core: EditorCore, search: NodeSearchController, options?: NodeSearchTriggerOptions): NodeSearchTriggers;
|
|
726
742
|
|
|
@@ -877,7 +893,8 @@ declare function useToast(): ToastApi;
|
|
|
877
893
|
* so only the components whose state actually flips re-render.
|
|
878
894
|
* - Edge "flowing" state is computed from an injected edge index, not by
|
|
879
895
|
* reaching into another layer's model at paint time.
|
|
880
|
-
* - A single rAF loop advances decay and notifies only changed ids
|
|
896
|
+
* - A single rAF loop advances decay and notifies only changed ids, once per
|
|
897
|
+
* frame however many signals arrived in it.
|
|
881
898
|
*/
|
|
882
899
|
/** Live state of a node during execution. */
|
|
883
900
|
type NodeLiveState = 'idle' | 'active' | 'error';
|
|
@@ -931,6 +948,12 @@ declare class LiveSignalStore {
|
|
|
931
948
|
/** Whether an edge is currently flowing. */
|
|
932
949
|
isEdgeFlowing(edgeId: string): boolean;
|
|
933
950
|
private subscribe;
|
|
951
|
+
/**
|
|
952
|
+
* Arms the frame loop if it is not running. Signals only record state; the
|
|
953
|
+
* next frame notifies, so a burst of signals costs one pass over the
|
|
954
|
+
* subscribers per frame, not one per signal, and every change shows within a
|
|
955
|
+
* frame.
|
|
956
|
+
*/
|
|
934
957
|
private ensureLoop;
|
|
935
958
|
private stopLoop;
|
|
936
959
|
/**
|
|
@@ -981,4 +1004,4 @@ declare function useNodeLiveState(nodeId: string): NodeLiveState;
|
|
|
981
1004
|
declare function useEdgeFlowing(edgeId: string): boolean;
|
|
982
1005
|
|
|
983
1006
|
export { AssetGrid, AssetNodeChrome, CanvasChrome, CanvasDock, Cheatsheet, DiagnosticBadge, EditorShell, EditorUIThemeProvider, EmptyState, FlowEdge, HlangNode, InspectorPanel, KIND_ROLE, KIND_TOKEN, LiveSignalProvider, LiveSignalStore, NodeBodySlot, NodeChrome, NodeContextMenu, NodeInteractionProvider, NodeSearch, OutlineTree, ParamForm, PillNodeChrome, PortRow, PositionPanel, PreviewPanel, RailTabs, RunButton, SignalBar, TOKEN_NAMES, ToastProvider, ToolCluster, Toolbar, ToolbarGhostButton, ToolbarStat, UndoRedo, connectableCandidates, createHlangFlowTypes, createTheme, deriveParamSchema, descriptorCandidates, fuzzyRank, fuzzyScore, isEditableTarget, searchNodes, tokenVar, useEdgeFlowing, useEditorHotkeys, useLiveSignalStore, useLiveSignals, useNodeContextMenu, useNodeInteraction, useNodeLiveState, useNodeParams, useNodeSearch, useNodeSearchTriggers, useToast };
|
|
984
|
-
export type { AssetGridProps, AssetItem, AssetNodeChromeProps, CanvasChromeProps, CanvasDockProps, CanvasMode, CheatsheetProps, ConnectableResult, ContextMenuItem, DiagnosticBadgeProps, EdgeIndexEntry, EditorHotkeysOptions, EditorShellProps, EditorUIThemeProviderProps, EmptyStateProps, FuzzyCandidate, FuzzyMatch, FuzzyResult, HlangFlowTypes, InspectorPanelProps, LiveSignalProviderProps, LiveSignalStoreDeps, NodeBodySlotProps, NodeCandidate, NodeChromeProps, NodeContextMenuController, NodeContextMenuProps, NodeContextMenuState, NodeInteraction, NodeInteractionProviderProps, NodeLiveState, NodeParamsHandle, NodeSearchController, NodeSearchProps, NodeSearchResult, NodeSearchResultView, NodeSearchState, NodeSearchTriggerOptions, NodeSearchTriggers, OutlineTreeProps, ParamField, ParamFieldBase, ParamFormProps, PendingConnection, PillNodeChromeProps, PortRowProps, PositionPanelProps, PreviewPanelProps, RailTab, RailTabsProps, RunButtonProps, ShortcutGroup, ShortcutRow, ThemeOverride, ToastApi, ToastProviderProps, TokenName, ToolClusterProps, ToolItem, ToolbarProps, UndoRedoProps };
|
|
1007
|
+
export type { AssetGridProps, AssetItem, AssetNodeChromeProps, CanvasChromeProps, CanvasDockProps, CanvasMode, CheatsheetProps, ConnectableResult, ConnectionEnd, ContextMenuItem, DiagnosticBadgeProps, EdgeIndexEntry, EditorHotkeysOptions, EditorShellProps, EditorUIThemeProviderProps, EmptyStateProps, FuzzyCandidate, FuzzyMatch, FuzzyResult, HlangFlowTypes, InspectorPanelProps, LiveSignalProviderProps, LiveSignalStoreDeps, NodeBodySlotProps, NodeCandidate, NodeChromeProps, NodeContextMenuController, NodeContextMenuProps, NodeContextMenuState, NodeInteraction, NodeInteractionProviderProps, NodeLiveState, NodeParamsHandle, NodeSearchController, NodeSearchProps, NodeSearchResult, NodeSearchResultView, NodeSearchState, NodeSearchTriggerOptions, NodeSearchTriggers, OutlineTreeProps, ParamField, ParamFieldBase, ParamFormProps, PendingConnection, PillNodeChromeProps, PointerPosition, PortRowProps, PositionPanelProps, PreviewPanelProps, RailTab, RailTabsProps, RunButtonProps, ShortcutGroup, ShortcutRow, ThemeOverride, ToastApi, ToastProviderProps, TokenName, ToolClusterProps, ToolItem, ToolbarProps, TouchPositions, UndoRedoProps };
|
package/lib/index.js
CHANGED
|
@@ -92,11 +92,18 @@ var TOKEN_NAMES = [
|
|
|
92
92
|
"hl-silver",
|
|
93
93
|
"hl-silver-hi",
|
|
94
94
|
"hl-silver-lo",
|
|
95
|
+
"hl-glass",
|
|
96
|
+
"hl-glass-2",
|
|
97
|
+
"hl-glass-blur",
|
|
98
|
+
"hl-glass-sat",
|
|
99
|
+
"hl-glass-edge",
|
|
100
|
+
"hl-glass-edge-hi",
|
|
95
101
|
"hl-spark",
|
|
96
102
|
"hl-r",
|
|
97
103
|
"hl-t",
|
|
98
104
|
"hl-w",
|
|
99
105
|
"hl-error",
|
|
106
|
+
"hl-warning",
|
|
100
107
|
"hl-ink",
|
|
101
108
|
"hl-ink-2",
|
|
102
109
|
"hl-ink-3",
|
|
@@ -109,7 +116,9 @@ var TOKEN_NAMES = [
|
|
|
109
116
|
"hl-shadow-node",
|
|
110
117
|
"hl-shadow-glass",
|
|
111
118
|
"hl-glow-silver",
|
|
112
|
-
"hl-ease"
|
|
119
|
+
"hl-ease",
|
|
120
|
+
"hl-activity",
|
|
121
|
+
"hl-cost"
|
|
113
122
|
];
|
|
114
123
|
function tokenVar(name) {
|
|
115
124
|
return `var(--${name})`;
|
|
@@ -300,9 +309,14 @@ var LiveSignalStore = class {
|
|
|
300
309
|
}
|
|
301
310
|
};
|
|
302
311
|
}
|
|
312
|
+
/**
|
|
313
|
+
* Arms the frame loop if it is not running. Signals only record state; the
|
|
314
|
+
* next frame notifies, so a burst of signals costs one pass over the
|
|
315
|
+
* subscribers per frame, not one per signal, and every change shows within a
|
|
316
|
+
* frame.
|
|
317
|
+
*/
|
|
303
318
|
ensureLoop() {
|
|
304
319
|
if (this.running) {
|
|
305
|
-
this.flushNotifications();
|
|
306
320
|
return;
|
|
307
321
|
}
|
|
308
322
|
this.running = true;
|
|
@@ -690,10 +704,8 @@ function HlangNode({ data, selected }) {
|
|
|
690
704
|
var import_react5 = require("@xyflow/react");
|
|
691
705
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
692
706
|
function useSourceRole(sourceId) {
|
|
693
|
-
var _a, _b;
|
|
694
707
|
const node = (0, import_react5.useInternalNode)(sourceId);
|
|
695
|
-
const
|
|
696
|
-
const role = (_b = editorNode == null ? void 0 : editorNode.params) == null ? void 0 : _b.role;
|
|
708
|
+
const role = node == null ? void 0 : node.data.editorNode.params.role;
|
|
697
709
|
return typeof role === "string" && role.length > 0 ? role : void 0;
|
|
698
710
|
}
|
|
699
711
|
function FlowEdge(props) {
|
|
@@ -1330,7 +1342,8 @@ function OutlineTree({ core, onFocus }) {
|
|
|
1330
1342
|
const active = selection.isSelected(node.id);
|
|
1331
1343
|
const isHidden = viewState.isHidden(node.id);
|
|
1332
1344
|
const isLocked = viewState.isLocked(node.id);
|
|
1333
|
-
const
|
|
1345
|
+
const { imageUrl } = node.params;
|
|
1346
|
+
const thumbnail = typeof imageUrl === "string" && imageUrl.length > 0 ? imageUrl : void 0;
|
|
1334
1347
|
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(
|
|
1335
1348
|
"div",
|
|
1336
1349
|
{
|
|
@@ -1342,11 +1355,11 @@ function OutlineTree({ core, onFocus }) {
|
|
|
1342
1355
|
{
|
|
1343
1356
|
className: `hl-outline-icon hl-kind-${node.kind.toLowerCase()}`,
|
|
1344
1357
|
"aria-hidden": true,
|
|
1345
|
-
children:
|
|
1358
|
+
children: thumbnail !== void 0 ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
|
|
1346
1359
|
"img",
|
|
1347
1360
|
{
|
|
1348
1361
|
className: "hl-outline-thumb",
|
|
1349
|
-
src:
|
|
1362
|
+
src: thumbnail,
|
|
1350
1363
|
alt: ""
|
|
1351
1364
|
}
|
|
1352
1365
|
) : /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(NodeIcon, { code: node.code, kind: node.kind, size: 13 })
|