@solid-devtools/debugger
Advanced tools
| import { ToDyscriminatedUnion } from '@solid-devtools/shared/utils'; | ||
| import { KbdKey } from '@solid-primitives/keyboard'; | ||
| import * as solid_js_store_types_store from 'solid-js/store/types/store'; | ||
| import * as solid_js_store from 'solid-js/store'; | ||
| import * as solid_js_types_reactive_signal from 'solid-js/types/reactive/signal'; | ||
| import * as _solid_primitives_event_bus from '@solid-primitives/event-bus'; | ||
| import * as solid_js from 'solid-js'; | ||
| /** | ||
| * Main modules and views of the devtools. Used for "routing". | ||
| */ | ||
| declare enum DevtoolsMainView { | ||
| Structure = "structure" | ||
| } | ||
| declare const DEFAULT_MAIN_VIEW = DevtoolsMainView.Structure; | ||
| declare enum DebuggerModule { | ||
| Locator = "locator", | ||
| Structure = "structure", | ||
| Dgraph = "dgraph" | ||
| } | ||
| declare enum TreeWalkerMode { | ||
| Owners = "owners", | ||
| Components = "components", | ||
| DOM = "dom" | ||
| } | ||
| declare const DEFAULT_WALKER_MODE = TreeWalkerMode.Owners; | ||
| declare enum NodeType { | ||
| Root = "root", | ||
| Component = "component", | ||
| Element = "element", | ||
| Effect = "effect", | ||
| Render = "render", | ||
| Memo = "memo", | ||
| Computation = "computation", | ||
| Refresh = "refresh", | ||
| Context = "context", | ||
| Signal = "signal", | ||
| Store = "store" | ||
| } | ||
| declare const NODE_TYPE_NAMES: Readonly<Record<NodeType, string>>; | ||
| declare enum ValueItemType { | ||
| Signal = "signal", | ||
| Prop = "prop", | ||
| Value = "value" | ||
| } | ||
| declare namespace SerializedDGraph { | ||
| type Node = { | ||
| name: string; | ||
| depth: number; | ||
| type: Exclude<NodeType, NodeType.Root | NodeType.Component>; | ||
| sources: readonly NodeID[] | undefined; | ||
| observers: readonly NodeID[] | undefined; | ||
| graph: NodeID | undefined; | ||
| }; | ||
| type Graph = Record<NodeID, Node>; | ||
| } | ||
| type DGraphUpdate = SerializedDGraph.Graph | null; | ||
| type StructureUpdates = { | ||
| /** Partial means that the updates are based on the previous structure state */ | ||
| partial: boolean; | ||
| /** Removed roots */ | ||
| removed: NodeID[]; | ||
| /** Record: `rootId` -- Record of updated nodes by `nodeId` */ | ||
| updated: Partial<Record<NodeID, Partial<Record<NodeID, Mapped.Owner>>>>; | ||
| }; | ||
| type StoreNodeProperty = `${NodeID}:${string}`; | ||
| type ToggleInspectedValueData = { | ||
| id: ValueItemID; | ||
| selected: boolean; | ||
| }; | ||
| declare const INFINITY = "Infinity"; | ||
| declare const NEGATIVE_INFINITY = "NegativeInfinity"; | ||
| declare const NAN = "NaN"; | ||
| declare const UNDEFINED = "undefined"; | ||
| declare enum ValueType { | ||
| Number = "number", | ||
| Boolean = "boolean", | ||
| String = "string", | ||
| Null = "null", | ||
| Symbol = "symbol", | ||
| Array = "array", | ||
| Object = "object", | ||
| Function = "function", | ||
| Getter = "getter", | ||
| Element = "element", | ||
| Instance = "instance", | ||
| Store = "store", | ||
| Unknown = "unknown" | ||
| } | ||
| type EncodedValueDataMap = { | ||
| [ValueType.Null]: null | typeof UNDEFINED; | ||
| [ValueType.Array]: number | number[]; | ||
| [ValueType.Object]: number | { | ||
| [key: string]: number; | ||
| }; | ||
| [ValueType.Number]: number | typeof INFINITY | typeof NEGATIVE_INFINITY | typeof NAN; | ||
| [ValueType.Boolean]: boolean; | ||
| [ValueType.String]: string; | ||
| [ValueType.Symbol]: string; | ||
| [ValueType.Function]: string; | ||
| [ValueType.Getter]: string; | ||
| [ValueType.Element]: `${NodeID}:${string}`; | ||
| [ValueType.Instance]: string; | ||
| [ValueType.Store]: `${NodeID}:${number}`; | ||
| [ValueType.Unknown]: never; | ||
| }; | ||
| type EncodedValueMap = { | ||
| [T in ValueType]: [type: T, data: EncodedValueDataMap[T]]; | ||
| }; | ||
| type EncodedValue<T extends ValueType = ValueType> = EncodedValueMap[T]; | ||
| declare enum PropGetterState { | ||
| /** getter is being observed, so it's value is up-to-date */ | ||
| Live = "live", | ||
| /** getter is not observed, so it's value may be outdated */ | ||
| Stale = "stale" | ||
| } | ||
| type InspectorUpdateMap = { | ||
| /** the value of a valueItem was updated */ | ||
| value: [id: ValueItemID, value: EncodedValue[]]; | ||
| /** a valueItem was expanded or collapsed, sends it's appropriable value */ | ||
| inspectToggle: [id: ValueItemID, value: EncodedValue[]]; | ||
| /** update to a store-node */ | ||
| store: [store: StoreNodeProperty, value: EncodedValue[] | null | number]; | ||
| /** List of new keys — all of the values are getters, so they won't change */ | ||
| propKeys: { | ||
| added: string[]; | ||
| removed: string[]; | ||
| }; | ||
| /** state of getter props (STALE | LIVE) */ | ||
| propState: { | ||
| [key in string]: PropGetterState; | ||
| }; | ||
| }; | ||
| type InspectorUpdate = { | ||
| [T in keyof InspectorUpdateMap]: [type: T, data: InspectorUpdateMap[T]]; | ||
| }[keyof InspectorUpdateMap]; | ||
| type LocationAttr = `${string}:${number}:${number}`; | ||
| type LocatorComponent = { | ||
| id: NodeID; | ||
| name: string; | ||
| element: HTMLElement; | ||
| location?: LocationAttr | undefined; | ||
| }; | ||
| type TargetIDE = 'vscode' | 'webstorm' | 'atom' | 'vscode-insiders'; | ||
| type SourceLocation = { | ||
| filePath: string; | ||
| line: number; | ||
| column: number; | ||
| }; | ||
| type SourceCodeData = SourceLocation & { | ||
| projectPath: string; | ||
| element: HTMLElement | string; | ||
| }; | ||
| type TargetURLFunction = (data: SourceCodeData) => string | void; | ||
| type NodeID = `#${string}`; | ||
| type ValueItemID = `${ValueItemType.Signal}:${NodeID}` | `${ValueItemType.Prop}:${string}` | ValueItemType.Value; | ||
| declare const getValueItemId: <T extends ValueItemType>(type: T, id: T extends ValueItemType.Value ? undefined : string) => ValueItemID; | ||
| type ValueUpdateListener = (newValue: unknown, oldValue: unknown) => void; | ||
| declare namespace Core { | ||
| type Owner = solid_js_types_reactive_signal.Owner; | ||
| type SignalState = solid_js_types_reactive_signal.SignalState<unknown>; | ||
| type Computation = solid_js_types_reactive_signal.Computation<unknown>; | ||
| type Memo = solid_js_types_reactive_signal.Memo<unknown>; | ||
| type RootFunction<T> = solid_js_types_reactive_signal.RootFunction<T>; | ||
| type EffectFunction = solid_js_types_reactive_signal.EffectFunction<unknown>; | ||
| type Component = solid_js_types_reactive_signal.DevComponent<{ | ||
| [key: string]: unknown; | ||
| }>; | ||
| namespace Store { | ||
| type StoreNode = solid_js_store.StoreNode; | ||
| type NotWrappable = solid_js_store_types_store.NotWrappable; | ||
| type OnStoreNodeUpdate = solid_js_store_types_store.OnStoreNodeUpdate; | ||
| } | ||
| } | ||
| declare module 'solid-js/types/reactive/signal' { | ||
| interface SignalState<T> { | ||
| sdtName?: string; | ||
| } | ||
| interface Owner { | ||
| sdtName?: string; | ||
| sdtType?: NodeType; | ||
| sdtSubRoots?: Solid.Root[] | null; | ||
| } | ||
| interface Computation<Init, Next> { | ||
| sdtType?: NodeType; | ||
| onValueUpdate?: Record<symbol, ValueUpdateListener>; | ||
| } | ||
| } | ||
| declare namespace Solid { | ||
| interface SignalState { | ||
| graph?: Owner; | ||
| value: unknown; | ||
| observers?: Computation[] | null; | ||
| onValueUpdate?: Record<symbol, ValueUpdateListener>; | ||
| } | ||
| interface Signal extends Core.SignalState, SignalState { | ||
| graph?: Owner; | ||
| value: unknown; | ||
| observers: Computation[] | null; | ||
| } | ||
| type OnStoreNodeUpdate = Core.Store.OnStoreNodeUpdate & { | ||
| storePath: readonly (string | number)[]; | ||
| storeSymbol: symbol; | ||
| }; | ||
| interface Store { | ||
| value: Core.Store.StoreNode; | ||
| } | ||
| interface Root extends Core.Owner { | ||
| owned: Computation[] | null; | ||
| owner: Owner | null; | ||
| sourceMap?: Record<string, Signal | Store>; | ||
| isDisposed?: boolean; | ||
| sdtAttached?: Owner; | ||
| isInternal?: true; | ||
| value?: undefined; | ||
| sources?: undefined; | ||
| fn?: undefined; | ||
| state?: undefined; | ||
| sourceSlots?: undefined; | ||
| updatedAt?: undefined; | ||
| pure?: undefined; | ||
| } | ||
| interface Computation extends Core.Computation { | ||
| name: string; | ||
| value: unknown; | ||
| owned: Computation[] | null; | ||
| owner: Owner | null; | ||
| sourceMap?: Record<string, Signal>; | ||
| sources: Signal[] | null; | ||
| } | ||
| interface Memo extends Signal, Computation { | ||
| name: string; | ||
| } | ||
| interface Component extends Memo { | ||
| props: Record<string, unknown>; | ||
| componentName: string; | ||
| location?: LocationAttr; | ||
| } | ||
| type Owner = Computation | Root; | ||
| } | ||
| declare namespace Mapped { | ||
| interface Owner { | ||
| id: NodeID; | ||
| type: Exclude<NodeType, NodeType.Refresh | NodeType.Signal | NodeType.Store>; | ||
| children: Owner[]; | ||
| name?: string; | ||
| hmr?: true; | ||
| frozen?: true; | ||
| } | ||
| interface Signal { | ||
| type: NodeType.Signal | NodeType.Memo | NodeType.Store; | ||
| name: string; | ||
| id: NodeID; | ||
| value: EncodedValue[]; | ||
| } | ||
| type Props = { | ||
| proxy: boolean; | ||
| record: { | ||
| [key: string]: { | ||
| getter: false | PropGetterState; | ||
| value: EncodedValue[] | null; | ||
| }; | ||
| }; | ||
| }; | ||
| interface OwnerDetails { | ||
| id: NodeID; | ||
| name: string; | ||
| type: NodeType; | ||
| props?: Props; | ||
| signals: Signal[]; | ||
| /** for computations */ | ||
| value?: EncodedValue[]; | ||
| location?: LocationAttr; | ||
| } | ||
| } | ||
| type LocatorOptions = { | ||
| /** Choose in which IDE the component source code should be revealed. */ | ||
| targetIDE?: false | TargetIDE | TargetURLFunction; | ||
| /** | ||
| * Holding which key should enable the locator overlay? | ||
| * @default 'Alt' | ||
| */ | ||
| key?: false | KbdKey; | ||
| }; | ||
| type HighlightElementPayload = ToDyscriminatedUnion<{ | ||
| node: { | ||
| id: NodeID; | ||
| }; | ||
| element: { | ||
| id: NodeID; | ||
| }; | ||
| }> | null; | ||
| type ClickMiddleware = (event: MouseEvent | CustomEvent, component: LocatorComponent, data: SourceCodeData | undefined) => void; | ||
| declare const WINDOW_PROJECTPATH_PROPERTY = "$sdt_projectPath"; | ||
| declare const LOCATION_ATTRIBUTE_NAME = "data-source-loc"; | ||
| declare const MARK_COMPONENT = "markComponentLoc"; | ||
| declare const USE_LOCATOR = "useLocator"; | ||
| declare namespace Debugger { | ||
| type OutputChannels = { | ||
| ResetPanel: void; | ||
| InspectedNodeDetails: Mapped.OwnerDetails | null; | ||
| StructureUpdates: StructureUpdates; | ||
| NodeUpdates: NodeID[]; | ||
| InspectorUpdate: InspectorUpdate[]; | ||
| LocatorModeChange: boolean; | ||
| HoveredComponent: { | ||
| nodeId: NodeID; | ||
| state: boolean; | ||
| }; | ||
| InspectedComponent: NodeID; | ||
| DgraphUpdate: DGraphUpdate; | ||
| }; | ||
| type InputChannels = { | ||
| ForceUpdate: void; | ||
| InspectNode: { | ||
| ownerId: NodeID | null; | ||
| signalId: NodeID | null; | ||
| } | null; | ||
| InspectValue: ToggleInspectedValueData; | ||
| HighlightElementChange: HighlightElementPayload; | ||
| OpenLocation: void; | ||
| TreeViewModeChange: TreeWalkerMode; | ||
| ViewChange: DevtoolsMainView; | ||
| ToggleModule: { | ||
| module: DebuggerModule; | ||
| enabled: boolean; | ||
| }; | ||
| }; | ||
| } | ||
| declare const useDebugger: () => { | ||
| enabled: solid_js.Accessor<boolean>; | ||
| toggleEnabled: (enabled: boolean) => undefined; | ||
| on: _solid_primitives_event_bus.EmitterOn<Debugger.OutputChannels>; | ||
| listen: _solid_primitives_event_bus.EmitterListen<Debugger.OutputChannels>; | ||
| emit: <K extends keyof Debugger.InputChannels>(event: K, ..._: void extends Debugger.InputChannels[K] ? [payload?: Debugger.InputChannels[K] | undefined] : [payload: Debugger.InputChannels[K]]) => void; | ||
| }; | ||
| declare const useLocator: (options: LocatorOptions) => void; | ||
| export { getValueItemId as A, Mapped as B, Core as C, DGraphUpdate as D, EncodedValueMap as E, Debugger as F, HighlightElementPayload as H, INFINITY as I, LocationAttr as L, MARK_COMPONENT as M, NodeType as N, PropGetterState as P, Solid as S, ToggleInspectedValueData as T, UNDEFINED as U, ValueUpdateListener as V, WINDOW_PROJECTPATH_PROPERTY as W, useLocator as a, SerializedDGraph as b, StructureUpdates as c, NEGATIVE_INFINITY as d, NAN as e, ValueType as f, EncodedValue as g, InspectorUpdateMap as h, InspectorUpdate as i, LocatorOptions as j, ClickMiddleware as k, LOCATION_ATTRIBUTE_NAME as l, USE_LOCATOR as m, LocatorComponent as n, TargetIDE as o, TargetURLFunction as p, DevtoolsMainView as q, DEFAULT_MAIN_VIEW as r, DebuggerModule as s, TreeWalkerMode as t, useDebugger as u, DEFAULT_WALKER_MODE as v, NODE_TYPE_NAMES as w, ValueItemType as x, NodeID as y, ValueItemID as z }; |
+3
-3
| import { createRoot, ParentComponent } from 'solid-js'; | ||
| import { L as LocationAttr, C as Core, S as Solid, V as ValueUpdateListener, N as NodeType } from './types-3bc0ada4.js'; | ||
| export { k as ClickMiddleware, r as DEFAULT_MAIN_VIEW, v as DEFAULT_WALKER_MODE, D as DGraphUpdate, s as DebuggerModule, q as DevtoolsMainView, g as EncodedValue, E as EncodedValueMap, H as HighlightElementPayload, I as INFINITY, i as InspectorUpdate, h as InspectorUpdateMap, l as LOCATION_ATTRIBUTE_NAME, n as LocatorComponent, j as LocatorOptions, M as MARK_COMPONENT, B as Mapped, e as NAN, d as NEGATIVE_INFINITY, w as NODE_TYPE_NAMES, y as NodeID, P as PropGetterState, b as SerializedDGraph, c as StructureUpdates, o as TargetIDE, p as TargetURLFunction, T as ToggleInspectedValueData, t as TreeWalkerMode, U as UNDEFINED, m as USE_LOCATOR, z as ValueItemID, x as ValueItemType, f as ValueType, W as WINDOW_PROJECTPATH_PROPERTY, A as getValueItemId, u as useDebugger, a as useLocator } from './types-3bc0ada4.js'; | ||
| import { L as LocationAttr, C as Core, S as Solid, V as ValueUpdateListener, N as NodeType } from './index-e0669c89.js'; | ||
| export { k as ClickMiddleware, r as DEFAULT_MAIN_VIEW, v as DEFAULT_WALKER_MODE, D as DGraphUpdate, s as DebuggerModule, q as DevtoolsMainView, g as EncodedValue, E as EncodedValueMap, H as HighlightElementPayload, I as INFINITY, i as InspectorUpdate, h as InspectorUpdateMap, l as LOCATION_ATTRIBUTE_NAME, n as LocatorComponent, j as LocatorOptions, M as MARK_COMPONENT, B as Mapped, e as NAN, d as NEGATIVE_INFINITY, w as NODE_TYPE_NAMES, y as NodeID, P as PropGetterState, b as SerializedDGraph, c as StructureUpdates, o as TargetIDE, p as TargetURLFunction, T as ToggleInspectedValueData, t as TreeWalkerMode, U as UNDEFINED, m as USE_LOCATOR, z as ValueItemID, x as ValueItemType, f as ValueType, W as WINDOW_PROJECTPATH_PROPERTY, A as getValueItemId, u as useDebugger, a as useLocator } from './index-e0669c89.js'; | ||
| import '@solid-devtools/shared/utils'; | ||
| import '@solid-primitives/keyboard'; | ||
| import '@solid-primitives/event-bus'; | ||
| import 'solid-js/store/types/store'; | ||
| import 'solid-js/store'; | ||
| import 'solid-js/types/reactive/signal'; | ||
| import '@solid-primitives/event-bus'; | ||
@@ -11,0 +11,0 @@ declare function markComponentLoc(location: LocationAttr): void; |
+16
-14
@@ -7,7 +7,6 @@ import { LOCATION_ATTRIBUTE_NAME, WINDOW_PROJECTPATH_PROPERTY, DEFAULT_WALKER_MODE, UNDEFINED, INFINITY, NEGATIVE_INFINITY, NAN } from './chunk-F3ZS5ORU.js'; | ||
| import { DEV as DEV$1, unwrap } from 'solid-js/store'; | ||
| import { defer, makeHoverElementListener, untrackedCallback } from '@solid-devtools/shared/primitives'; | ||
| import { createGlobalEmitter, createEventBus } from '@solid-primitives/event-bus'; | ||
| import { makeHoverElementListener, untrackedCallback } from '@solid-devtools/shared/primitives'; | ||
| import { makeEventListener } from '@solid-primitives/event-listener'; | ||
| import { createKeyHold } from '@solid-primitives/keyboard'; | ||
| import { createStaticStore, tryOnCleanup as tryOnCleanup$1 } from '@solid-primitives/utils'; | ||
| import { createStaticStore, defer, tryOnCleanup as tryOnCleanup$1 } from '@solid-primitives/utils'; | ||
| import { createComponent, Portal, mergeProps, insert, effect, className, template } from 'solid-js/web'; | ||
@@ -17,2 +16,3 @@ import { createElementBounds } from '@solid-primitives/bounds'; | ||
| import { isWindows } from '@solid-primitives/platform'; | ||
| import { createGlobalEmitter, createEventBus } from '@solid-primitives/event-bus'; | ||
@@ -676,3 +676,2 @@ var STORE_DEV = DEV$1; | ||
| }, 1e3); | ||
| const debuggerHoveredComponentBus = createEventBus(); | ||
| createEffect((prev) => { | ||
@@ -684,6 +683,6 @@ const target = hoverTarget(); | ||
| if (prev) | ||
| debuggerHoveredComponentBus.emit({ nodeId: prev, state: false }); | ||
| props.emit("HoveredComponent", { nodeId: prev, state: false }); | ||
| if (comp) { | ||
| const { id } = comp; | ||
| debuggerHoveredComponentBus.emit({ nodeId: id, state: true }); | ||
| props.emit("HoveredComponent", { nodeId: id, state: true }); | ||
| return id; | ||
@@ -757,3 +756,2 @@ } | ||
| setDevtoolsHighlightTarget: (target) => void setDevtoolsTarget(target), | ||
| onDebuggerHoveredComponentChange: debuggerHoveredComponentBus.listen, | ||
| openElementSourceCode | ||
@@ -948,3 +946,3 @@ }; | ||
| clearListeners = null; | ||
| props.emitDependencyGraph(null); | ||
| props.emit("DgraphUpdate", null); | ||
| return; | ||
@@ -954,3 +952,3 @@ } | ||
| clearListeners = dgraph.clearListeners; | ||
| props.emitDependencyGraph(dgraph.graph); | ||
| props.emit("DgraphUpdate", dgraph.graph); | ||
| } | ||
@@ -1415,3 +1413,3 @@ const triggerInspect = throttle(inspectDGraph, 200); | ||
| } | ||
| batchedUpdates.length && props.hub.output.emit("InspectorUpdate", batchedUpdates); | ||
| batchedUpdates.length && props.emit("InspectorUpdate", batchedUpdates); | ||
| }); | ||
@@ -1446,2 +1444,4 @@ const flushPropsCheck = throttle(flush, 200); | ||
| }, | ||
| // since the updates are emitten on timeout, we need to make sure that | ||
| // switching off the debugger or unselecting the owner will clear the updates | ||
| clearUpdates() { | ||
@@ -1467,3 +1467,3 @@ valueUpdates.clear(); | ||
| }) : null; | ||
| props.hub.output.emit("InspectedNodeDetails", result ? result.details : null); | ||
| props.emit("InspectedNodeDetails", result ? result.details : null); | ||
| if (result) | ||
@@ -1834,3 +1834,3 @@ valueMap = result.valueMap; | ||
| const inspector = createInspector({ | ||
| hub, | ||
| emit: hub.output.emit, | ||
| enabled: debuggerEnabled, | ||
@@ -1840,9 +1840,10 @@ listenToInspectedNodeChange: inspectedStateBus.listen | ||
| createDependencyGraph({ | ||
| emit: hub.output.emit, | ||
| enabled: dgraphEnabled, | ||
| listenToInspectedStateChange: inspectedStateBus.listen, | ||
| listenToViewChange: viewChange.listen, | ||
| emitDependencyGraph: (graph) => hub.output.emit("DgraphUpdate", graph), | ||
| onNodeUpdate: pushNodeUpdate | ||
| }); | ||
| const locator = createLocator({ | ||
| emit: hub.output.emit, | ||
| listenToDebuggerEenable: debuggerEnabledBus.listen, | ||
@@ -1862,2 +1863,4 @@ locatorEnabled, | ||
| locator.addClickInterceptor((e, component) => { | ||
| if (!modules.debugger) | ||
| return; | ||
| e.preventDefault(); | ||
@@ -1868,3 +1871,2 @@ e.stopPropagation(); | ||
| }); | ||
| locator.onDebuggerHoveredComponentChange((data) => hub.output.emit("HoveredComponent", data)); | ||
| hub.input.listen((e) => { | ||
@@ -1871,0 +1873,0 @@ switch (e.name) { |
+3
-3
@@ -1,8 +0,8 @@ | ||
| export { k as ClickMiddleware, C as Core, r as DEFAULT_MAIN_VIEW, v as DEFAULT_WALKER_MODE, D as DGraphUpdate, F as Debugger, s as DebuggerModule, q as DevtoolsMainView, g as EncodedValue, E as EncodedValueMap, H as HighlightElementPayload, I as INFINITY, i as InspectorUpdate, h as InspectorUpdateMap, l as LOCATION_ATTRIBUTE_NAME, L as LocationAttr, n as LocatorComponent, j as LocatorOptions, M as MARK_COMPONENT, B as Mapped, e as NAN, d as NEGATIVE_INFINITY, w as NODE_TYPE_NAMES, y as NodeID, N as NodeType, P as PropGetterState, b as SerializedDGraph, S as Solid, c as StructureUpdates, o as TargetIDE, p as TargetURLFunction, T as ToggleInspectedValueData, t as TreeWalkerMode, U as UNDEFINED, m as USE_LOCATOR, z as ValueItemID, x as ValueItemType, f as ValueType, V as ValueUpdateListener, W as WINDOW_PROJECTPATH_PROPERTY, A as getValueItemId } from './types-3bc0ada4.js'; | ||
| export { k as ClickMiddleware, C as Core, r as DEFAULT_MAIN_VIEW, v as DEFAULT_WALKER_MODE, D as DGraphUpdate, F as Debugger, s as DebuggerModule, q as DevtoolsMainView, g as EncodedValue, E as EncodedValueMap, H as HighlightElementPayload, I as INFINITY, i as InspectorUpdate, h as InspectorUpdateMap, l as LOCATION_ATTRIBUTE_NAME, L as LocationAttr, n as LocatorComponent, j as LocatorOptions, M as MARK_COMPONENT, B as Mapped, e as NAN, d as NEGATIVE_INFINITY, w as NODE_TYPE_NAMES, y as NodeID, N as NodeType, P as PropGetterState, b as SerializedDGraph, S as Solid, c as StructureUpdates, o as TargetIDE, p as TargetURLFunction, T as ToggleInspectedValueData, t as TreeWalkerMode, U as UNDEFINED, m as USE_LOCATOR, z as ValueItemID, x as ValueItemType, f as ValueType, V as ValueUpdateListener, W as WINDOW_PROJECTPATH_PROPERTY, A as getValueItemId } from './index-e0669c89.js'; | ||
| import '@solid-devtools/shared/utils'; | ||
| import '@solid-primitives/keyboard'; | ||
| import '@solid-primitives/event-bus'; | ||
| import 'solid-js'; | ||
| import 'solid-js/store/types/store'; | ||
| import 'solid-js/store'; | ||
| import 'solid-js/types/reactive/signal'; | ||
| import '@solid-primitives/event-bus'; | ||
| import 'solid-js'; |
+9
-9
| { | ||
| "name": "@solid-devtools/debugger", | ||
| "version": "0.20.0", | ||
| "version": "0.20.1", | ||
| "description": "Debugger of the Solid's reactivity graph — a cornerstone of all solid-devtools.", | ||
@@ -105,11 +105,11 @@ "license": "MIT", | ||
| "@solid-devtools/shared": "^0.11.0", | ||
| "@solid-primitives/bounds": "^0.0.105", | ||
| "@solid-primitives/cursor": "^0.0.103", | ||
| "@solid-primitives/bounds": "^0.0.107", | ||
| "@solid-primitives/cursor": "^0.0.105", | ||
| "@solid-primitives/event-bus": "^1.0.0", | ||
| "@solid-primitives/event-listener": "^2.2.3", | ||
| "@solid-primitives/keyboard": "^1.0.3", | ||
| "@solid-primitives/platform": "^0.0.102", | ||
| "@solid-primitives/scheduled": "^1.2.0", | ||
| "@solid-primitives/event-listener": "^2.2.6", | ||
| "@solid-primitives/keyboard": "^1.0.7", | ||
| "@solid-primitives/platform": "^0.0.103", | ||
| "@solid-primitives/scheduled": "^1.2.1", | ||
| "@solid-primitives/utils": "^5.1.0", | ||
| "type-fest": "^3.5.1" | ||
| "type-fest": "^3.5.7" | ||
| }, | ||
@@ -119,3 +119,3 @@ "peerDependencies": { | ||
| }, | ||
| "packageManager": "pnpm@7.20.0", | ||
| "packageManager": "pnpm@7.22.0", | ||
| "scripts": { | ||
@@ -122,0 +122,0 @@ "dev": "tsup --watch", |
| import { ToDyscriminatedUnion } from '@solid-devtools/shared/utils'; | ||
| import { KbdKey } from '@solid-primitives/keyboard'; | ||
| import * as _solid_primitives_event_bus from '@solid-primitives/event-bus'; | ||
| import * as solid_js from 'solid-js'; | ||
| import * as solid_js_store_types_store from 'solid-js/store/types/store'; | ||
| import * as solid_js_store from 'solid-js/store'; | ||
| import * as solid_js_types_reactive_signal from 'solid-js/types/reactive/signal'; | ||
| type LocationAttr = `${string}:${number}:${number}`; | ||
| type LocatorComponent = { | ||
| id: NodeID; | ||
| name: string; | ||
| element: HTMLElement; | ||
| location?: LocationAttr | undefined; | ||
| }; | ||
| type TargetIDE = 'vscode' | 'webstorm' | 'atom' | 'vscode-insiders'; | ||
| type SourceLocation = { | ||
| filePath: string; | ||
| line: number; | ||
| column: number; | ||
| }; | ||
| type SourceCodeData = SourceLocation & { | ||
| projectPath: string; | ||
| element: HTMLElement | string; | ||
| }; | ||
| type TargetURLFunction = (data: SourceCodeData) => string | void; | ||
| type LocatorOptions = { | ||
| /** Choose in which IDE the component source code should be revealed. */ | ||
| targetIDE?: false | TargetIDE | TargetURLFunction; | ||
| /** | ||
| * Holding which key should enable the locator overlay? | ||
| * @default 'Alt' | ||
| */ | ||
| key?: false | KbdKey; | ||
| }; | ||
| type HighlightElementPayload = ToDyscriminatedUnion<{ | ||
| node: { | ||
| id: NodeID; | ||
| }; | ||
| element: { | ||
| id: NodeID; | ||
| }; | ||
| }> | null; | ||
| type ClickMiddleware = (event: MouseEvent | CustomEvent, component: LocatorComponent, data: SourceCodeData | undefined) => void; | ||
| declare const WINDOW_PROJECTPATH_PROPERTY = "$sdt_projectPath"; | ||
| declare const LOCATION_ATTRIBUTE_NAME = "data-source-loc"; | ||
| declare const MARK_COMPONENT = "markComponentLoc"; | ||
| declare const USE_LOCATOR = "useLocator"; | ||
| type ToggleInspectedValueData = { | ||
| id: ValueItemID; | ||
| selected: boolean; | ||
| }; | ||
| /** | ||
| * Main modules and views of the devtools. Used for "routing". | ||
| */ | ||
| declare enum DevtoolsMainView { | ||
| Structure = "structure" | ||
| } | ||
| declare const DEFAULT_MAIN_VIEW = DevtoolsMainView.Structure; | ||
| declare enum DebuggerModule { | ||
| Locator = "locator", | ||
| Structure = "structure", | ||
| Dgraph = "dgraph" | ||
| } | ||
| declare enum TreeWalkerMode { | ||
| Owners = "owners", | ||
| Components = "components", | ||
| DOM = "dom" | ||
| } | ||
| declare const DEFAULT_WALKER_MODE = TreeWalkerMode.Owners; | ||
| declare enum NodeType { | ||
| Root = "root", | ||
| Component = "component", | ||
| Element = "element", | ||
| Effect = "effect", | ||
| Render = "render", | ||
| Memo = "memo", | ||
| Computation = "computation", | ||
| Refresh = "refresh", | ||
| Context = "context", | ||
| Signal = "signal", | ||
| Store = "store" | ||
| } | ||
| declare const NODE_TYPE_NAMES: Readonly<Record<NodeType, string>>; | ||
| declare enum ValueItemType { | ||
| Signal = "signal", | ||
| Prop = "prop", | ||
| Value = "value" | ||
| } | ||
| type StructureUpdates = { | ||
| /** Partial means that the updates are based on the previous structure state */ | ||
| partial: boolean; | ||
| /** Removed roots */ | ||
| removed: NodeID[]; | ||
| /** Record: `rootId` -- Record of updated nodes by `nodeId` */ | ||
| updated: Partial<Record<NodeID, Partial<Record<NodeID, Mapped.Owner>>>>; | ||
| }; | ||
| declare namespace Debugger { | ||
| type OutputChannels = { | ||
| ResetPanel: void; | ||
| InspectedNodeDetails: Mapped.OwnerDetails | null; | ||
| StructureUpdates: StructureUpdates; | ||
| NodeUpdates: NodeID[]; | ||
| InspectorUpdate: InspectorUpdate[]; | ||
| LocatorModeChange: boolean; | ||
| HoveredComponent: { | ||
| nodeId: NodeID; | ||
| state: boolean; | ||
| }; | ||
| InspectedComponent: NodeID; | ||
| DgraphUpdate: DGraphUpdate; | ||
| }; | ||
| type InputChannels = { | ||
| ForceUpdate: void; | ||
| InspectNode: { | ||
| ownerId: NodeID | null; | ||
| signalId: NodeID | null; | ||
| } | null; | ||
| InspectValue: ToggleInspectedValueData; | ||
| HighlightElementChange: HighlightElementPayload; | ||
| OpenLocation: void; | ||
| TreeViewModeChange: TreeWalkerMode; | ||
| ViewChange: DevtoolsMainView; | ||
| ToggleModule: { | ||
| module: DebuggerModule; | ||
| enabled: boolean; | ||
| }; | ||
| }; | ||
| } | ||
| declare const useDebugger: () => { | ||
| enabled: solid_js.Accessor<boolean>; | ||
| toggleEnabled: (enabled: boolean) => undefined; | ||
| on: _solid_primitives_event_bus.EmitterOn<Debugger.OutputChannels>; | ||
| listen: _solid_primitives_event_bus.EmitterListen<Debugger.OutputChannels>; | ||
| emit: <K extends keyof Debugger.InputChannels>(event: K, ..._: void extends Debugger.InputChannels[K] ? [payload?: Debugger.InputChannels[K] | undefined] : [payload: Debugger.InputChannels[K]]) => void; | ||
| }; | ||
| declare const useLocator: (options: LocatorOptions) => void; | ||
| declare namespace SerializedDGraph { | ||
| type Node = { | ||
| name: string; | ||
| depth: number; | ||
| type: Exclude<NodeType, NodeType.Root | NodeType.Component>; | ||
| sources: readonly NodeID[] | undefined; | ||
| observers: readonly NodeID[] | undefined; | ||
| graph: NodeID | undefined; | ||
| }; | ||
| type Graph = Record<NodeID, Node>; | ||
| } | ||
| type DGraphUpdate = SerializedDGraph.Graph | null; | ||
| type StoreNodeProperty = `${NodeID}:${string}`; | ||
| declare const INFINITY = "Infinity"; | ||
| declare const NEGATIVE_INFINITY = "NegativeInfinity"; | ||
| declare const NAN = "NaN"; | ||
| declare const UNDEFINED = "undefined"; | ||
| declare enum ValueType { | ||
| Number = "number", | ||
| Boolean = "boolean", | ||
| String = "string", | ||
| Null = "null", | ||
| Symbol = "symbol", | ||
| Array = "array", | ||
| Object = "object", | ||
| Function = "function", | ||
| Getter = "getter", | ||
| Element = "element", | ||
| Instance = "instance", | ||
| Store = "store", | ||
| Unknown = "unknown" | ||
| } | ||
| type EncodedValueDataMap = { | ||
| [ValueType.Null]: null | typeof UNDEFINED; | ||
| [ValueType.Array]: number | number[]; | ||
| [ValueType.Object]: number | { | ||
| [key: string]: number; | ||
| }; | ||
| [ValueType.Number]: number | typeof INFINITY | typeof NEGATIVE_INFINITY | typeof NAN; | ||
| [ValueType.Boolean]: boolean; | ||
| [ValueType.String]: string; | ||
| [ValueType.Symbol]: string; | ||
| [ValueType.Function]: string; | ||
| [ValueType.Getter]: string; | ||
| [ValueType.Element]: `${NodeID}:${string}`; | ||
| [ValueType.Instance]: string; | ||
| [ValueType.Store]: `${NodeID}:${number}`; | ||
| [ValueType.Unknown]: never; | ||
| }; | ||
| type EncodedValueMap = { | ||
| [T in ValueType]: [type: T, data: EncodedValueDataMap[T]]; | ||
| }; | ||
| type EncodedValue<T extends ValueType = ValueType> = EncodedValueMap[T]; | ||
| declare enum PropGetterState { | ||
| /** getter is being observed, so it's value is up-to-date */ | ||
| Live = "live", | ||
| /** getter is not observed, so it's value may be outdated */ | ||
| Stale = "stale" | ||
| } | ||
| type InspectorUpdateMap = { | ||
| /** the value of a valueItem was updated */ | ||
| value: [id: ValueItemID, value: EncodedValue[]]; | ||
| /** a valueItem was expanded or collapsed, sends it's appropriable value */ | ||
| inspectToggle: [id: ValueItemID, value: EncodedValue[]]; | ||
| /** update to a store-node */ | ||
| store: [store: StoreNodeProperty, value: EncodedValue[] | null | number]; | ||
| /** List of new keys — all of the values are getters, so they won't change */ | ||
| propKeys: { | ||
| added: string[]; | ||
| removed: string[]; | ||
| }; | ||
| /** state of getter props (STALE | LIVE) */ | ||
| propState: { | ||
| [key in string]: PropGetterState; | ||
| }; | ||
| }; | ||
| type InspectorUpdate = { | ||
| [T in keyof InspectorUpdateMap]: [type: T, data: InspectorUpdateMap[T]]; | ||
| }[keyof InspectorUpdateMap]; | ||
| type NodeID = `#${string}`; | ||
| type ValueItemID = `${ValueItemType.Signal}:${NodeID}` | `${ValueItemType.Prop}:${string}` | ValueItemType.Value; | ||
| declare const getValueItemId: <T extends ValueItemType>(type: T, id: T extends ValueItemType.Value ? undefined : string) => ValueItemID; | ||
| type ValueUpdateListener = (newValue: unknown, oldValue: unknown) => void; | ||
| declare namespace Core { | ||
| type Owner = solid_js_types_reactive_signal.Owner; | ||
| type SignalState = solid_js_types_reactive_signal.SignalState<unknown>; | ||
| type Computation = solid_js_types_reactive_signal.Computation<unknown>; | ||
| type Memo = solid_js_types_reactive_signal.Memo<unknown>; | ||
| type RootFunction<T> = solid_js_types_reactive_signal.RootFunction<T>; | ||
| type EffectFunction = solid_js_types_reactive_signal.EffectFunction<unknown>; | ||
| type Component = solid_js_types_reactive_signal.DevComponent<{ | ||
| [key: string]: unknown; | ||
| }>; | ||
| namespace Store { | ||
| type StoreNode = solid_js_store.StoreNode; | ||
| type NotWrappable = solid_js_store_types_store.NotWrappable; | ||
| type OnStoreNodeUpdate = solid_js_store_types_store.OnStoreNodeUpdate; | ||
| } | ||
| } | ||
| declare module 'solid-js/types/reactive/signal' { | ||
| interface SignalState<T> { | ||
| sdtName?: string; | ||
| } | ||
| interface Owner { | ||
| sdtName?: string; | ||
| sdtType?: NodeType; | ||
| sdtSubRoots?: Solid.Root[] | null; | ||
| } | ||
| interface Computation<Init, Next> { | ||
| sdtType?: NodeType; | ||
| onValueUpdate?: Record<symbol, ValueUpdateListener>; | ||
| } | ||
| } | ||
| declare namespace Solid { | ||
| interface SignalState { | ||
| graph?: Owner; | ||
| value: unknown; | ||
| observers?: Computation[] | null; | ||
| onValueUpdate?: Record<symbol, ValueUpdateListener>; | ||
| } | ||
| interface Signal extends Core.SignalState, SignalState { | ||
| graph?: Owner; | ||
| value: unknown; | ||
| observers: Computation[] | null; | ||
| } | ||
| type OnStoreNodeUpdate = Core.Store.OnStoreNodeUpdate & { | ||
| storePath: readonly (string | number)[]; | ||
| storeSymbol: symbol; | ||
| }; | ||
| interface Store { | ||
| value: Core.Store.StoreNode; | ||
| } | ||
| interface Root extends Core.Owner { | ||
| owned: Computation[] | null; | ||
| owner: Owner | null; | ||
| sourceMap?: Record<string, Signal | Store>; | ||
| isDisposed?: boolean; | ||
| sdtAttached?: Owner; | ||
| isInternal?: true; | ||
| value?: undefined; | ||
| sources?: undefined; | ||
| fn?: undefined; | ||
| state?: undefined; | ||
| sourceSlots?: undefined; | ||
| updatedAt?: undefined; | ||
| pure?: undefined; | ||
| } | ||
| interface Computation extends Core.Computation { | ||
| name: string; | ||
| value: unknown; | ||
| owned: Computation[] | null; | ||
| owner: Owner | null; | ||
| sourceMap?: Record<string, Signal>; | ||
| sources: Signal[] | null; | ||
| } | ||
| interface Memo extends Signal, Computation { | ||
| name: string; | ||
| } | ||
| interface Component extends Memo { | ||
| props: Record<string, unknown>; | ||
| componentName: string; | ||
| location?: LocationAttr; | ||
| } | ||
| type Owner = Computation | Root; | ||
| } | ||
| declare namespace Mapped { | ||
| interface Owner { | ||
| id: NodeID; | ||
| type: Exclude<NodeType, NodeType.Refresh | NodeType.Signal | NodeType.Store>; | ||
| children: Owner[]; | ||
| name?: string; | ||
| hmr?: true; | ||
| frozen?: true; | ||
| } | ||
| interface Signal { | ||
| type: NodeType.Signal | NodeType.Memo | NodeType.Store; | ||
| name: string; | ||
| id: NodeID; | ||
| value: EncodedValue[]; | ||
| } | ||
| type Props = { | ||
| proxy: boolean; | ||
| record: { | ||
| [key: string]: { | ||
| getter: false | PropGetterState; | ||
| value: EncodedValue[] | null; | ||
| }; | ||
| }; | ||
| }; | ||
| interface OwnerDetails { | ||
| id: NodeID; | ||
| name: string; | ||
| type: NodeType; | ||
| props?: Props; | ||
| signals: Signal[]; | ||
| /** for computations */ | ||
| value?: EncodedValue[]; | ||
| location?: LocationAttr; | ||
| } | ||
| } | ||
| export { getValueItemId as A, Mapped as B, Core as C, DGraphUpdate as D, EncodedValueMap as E, Debugger as F, HighlightElementPayload as H, INFINITY as I, LocationAttr as L, MARK_COMPONENT as M, NodeType as N, PropGetterState as P, Solid as S, ToggleInspectedValueData as T, UNDEFINED as U, ValueUpdateListener as V, WINDOW_PROJECTPATH_PROPERTY as W, useLocator as a, SerializedDGraph as b, StructureUpdates as c, NEGATIVE_INFINITY as d, NAN as e, ValueType as f, EncodedValue as g, InspectorUpdateMap as h, InspectorUpdate as i, LocatorOptions as j, ClickMiddleware as k, LOCATION_ATTRIBUTE_NAME as l, USE_LOCATOR as m, LocatorComponent as n, TargetIDE as o, TargetURLFunction as p, DevtoolsMainView as q, DEFAULT_MAIN_VIEW as r, DebuggerModule as s, TreeWalkerMode as t, useDebugger as u, DEFAULT_WALKER_MODE as v, NODE_TYPE_NAMES as w, ValueItemType as x, NodeID as y, ValueItemID as z }; |
Sorry, the diff of this file is too big to display
4759
0.08%172142
-0.07%+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
Updated