@solid-devtools/debugger
Advanced tools
| // src/inspector/types.ts | ||
| var INFINITY = "Infinity"; | ||
| var NEGATIVE_INFINITY = "NegativeInfinity"; | ||
| var NAN = "NaN"; | ||
| var UNDEFINED = "undefined"; | ||
| var ValueType = /* @__PURE__ */ ((ValueType2) => { | ||
| ValueType2["Number"] = "number"; | ||
| ValueType2["Boolean"] = "boolean"; | ||
| ValueType2["String"] = "string"; | ||
| ValueType2["Null"] = "null"; | ||
| ValueType2["Symbol"] = "symbol"; | ||
| ValueType2["Array"] = "array"; | ||
| ValueType2["Object"] = "object"; | ||
| ValueType2["Function"] = "function"; | ||
| ValueType2["Getter"] = "getter"; | ||
| ValueType2["Element"] = "element"; | ||
| ValueType2["Instance"] = "instance"; | ||
| ValueType2["Store"] = "store"; | ||
| ValueType2["Unknown"] = "unknown"; | ||
| return ValueType2; | ||
| })(ValueType || {}); | ||
| var PropGetterState = /* @__PURE__ */ ((PropGetterState2) => { | ||
| PropGetterState2["Live"] = "live"; | ||
| PropGetterState2["Stale"] = "stale"; | ||
| return PropGetterState2; | ||
| })(PropGetterState || {}); | ||
| // src/locator/types.ts | ||
| var WINDOW_PROJECTPATH_PROPERTY = "$sdt_projectPath"; | ||
| var LOCATION_ATTRIBUTE_NAME = "data-source-loc"; | ||
| // src/main/constants.ts | ||
| var DevtoolsMainView = /* @__PURE__ */ ((DevtoolsMainView2) => { | ||
| DevtoolsMainView2["Structure"] = "structure"; | ||
| return DevtoolsMainView2; | ||
| })(DevtoolsMainView || {}); | ||
| var DEFAULT_MAIN_VIEW = "structure" /* Structure */; | ||
| var DebuggerModule = /* @__PURE__ */ ((DebuggerModule2) => { | ||
| DebuggerModule2["Locator"] = "locator"; | ||
| DebuggerModule2["Structure"] = "structure"; | ||
| DebuggerModule2["Dgraph"] = "dgraph"; | ||
| return DebuggerModule2; | ||
| })(DebuggerModule || {}); | ||
| var TreeWalkerMode = /* @__PURE__ */ ((TreeWalkerMode2) => { | ||
| TreeWalkerMode2["Owners"] = "owners"; | ||
| TreeWalkerMode2["Components"] = "components"; | ||
| TreeWalkerMode2["DOM"] = "dom"; | ||
| return TreeWalkerMode2; | ||
| })(TreeWalkerMode || {}); | ||
| var DEFAULT_WALKER_MODE = "components" /* Components */; | ||
| var NodeType = /* @__PURE__ */ ((NodeType2) => { | ||
| NodeType2["Root"] = "root"; | ||
| NodeType2["Component"] = "component"; | ||
| NodeType2["Element"] = "element"; | ||
| NodeType2["Effect"] = "effect"; | ||
| NodeType2["Render"] = "render"; | ||
| NodeType2["Memo"] = "memo"; | ||
| NodeType2["Computation"] = "computation"; | ||
| NodeType2["Refresh"] = "refresh"; | ||
| NodeType2["Context"] = "context"; | ||
| NodeType2["CatchError"] = "catchError"; | ||
| NodeType2["Signal"] = "signal"; | ||
| NodeType2["Store"] = "store"; | ||
| return NodeType2; | ||
| })(NodeType || {}); | ||
| var NODE_TYPE_NAMES = { | ||
| ["root" /* Root */]: "Root", | ||
| ["component" /* Component */]: "Component", | ||
| ["element" /* Element */]: "Element", | ||
| ["effect" /* Effect */]: "Effect", | ||
| ["render" /* Render */]: "Render Effect", | ||
| ["memo" /* Memo */]: "Memo", | ||
| ["computation" /* Computation */]: "Computation", | ||
| ["refresh" /* Refresh */]: "Refresh", | ||
| ["context" /* Context */]: "Context", | ||
| ["catchError" /* CatchError */]: "CatchError", | ||
| ["signal" /* Signal */]: "Signal", | ||
| ["store" /* Store */]: "Store" | ||
| }; | ||
| var ValueItemType = /* @__PURE__ */ ((ValueItemType2) => { | ||
| ValueItemType2["Signal"] = "signal"; | ||
| ValueItemType2["Prop"] = "prop"; | ||
| ValueItemType2["Value"] = "value"; | ||
| return ValueItemType2; | ||
| })(ValueItemType || {}); | ||
| var UNKNOWN = "unknown"; | ||
| // src/main/types.ts | ||
| var DevEventType = /* @__PURE__ */ ((DevEventType2) => { | ||
| DevEventType2["RootCreated"] = "RootCreated"; | ||
| return DevEventType2; | ||
| })(DevEventType || {}); | ||
| var getValueItemId = (type, id) => { | ||
| if (type === "value" /* Value */) return "value" /* Value */; | ||
| return `${type}:${id}`; | ||
| }; | ||
| export { DEFAULT_MAIN_VIEW, DEFAULT_WALKER_MODE, DebuggerModule, DevEventType, DevtoolsMainView, INFINITY, LOCATION_ATTRIBUTE_NAME, NAN, NEGATIVE_INFINITY, NODE_TYPE_NAMES, NodeType, PropGetterState, TreeWalkerMode, UNDEFINED, UNKNOWN, ValueItemType, ValueType, WINDOW_PROJECTPATH_PROPERTY, getValueItemId }; |
| import * as _solid_primitives_event_bus from '@solid-primitives/event-bus'; | ||
| import * as solid_js from 'solid-js'; | ||
| import { DEV, getOwner, getListener, onCleanup, $PROXY, untrack } from 'solid-js'; | ||
| import { ToDyscriminatedUnion } from '@solid-devtools/shared/utils'; | ||
| import { KbdKey } from '@solid-primitives/keyboard'; | ||
| import * as solid_js_store_types_store_d_ts from 'solid-js/store/types/store.d.ts'; | ||
| import * as solid_js_store from 'solid-js/store'; | ||
| import { DEV as DEV$1, unwrap } from 'solid-js/store'; | ||
| import * as solid_js_types_reactive_signal_d_ts from 'solid-js/types/reactive/signal.d.ts'; | ||
| import * as WebAPI from 'solid-js/web'; | ||
| /** | ||
| * 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.Components; | ||
| declare enum NodeType { | ||
| Root = "root", | ||
| Component = "component", | ||
| Element = "element", | ||
| Effect = "effect", | ||
| Render = "render", | ||
| Memo = "memo", | ||
| Computation = "computation", | ||
| Refresh = "refresh", | ||
| Context = "context", | ||
| CatchError = "catchError", | ||
| Signal = "signal", | ||
| Store = "store" | ||
| } | ||
| declare const NODE_TYPE_NAMES: Readonly<Record<NodeType, string>>; | ||
| declare enum ValueItemType { | ||
| Signal = "signal", | ||
| Prop = "prop", | ||
| Value = "value" | ||
| } | ||
| declare const UNKNOWN = "unknown"; | ||
| 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]; | ||
| declare const enum DevEventType { | ||
| RootCreated = "RootCreated" | ||
| } | ||
| type DevEventDataMap = { | ||
| [DevEventType.RootCreated]: Solid.Owner; | ||
| }; | ||
| type StoredDevEvent = { | ||
| [K in keyof DevEventDataMap]: { | ||
| timestamp: number; | ||
| type: K; | ||
| data: DevEventDataMap[K]; | ||
| }; | ||
| }[keyof DevEventDataMap]; | ||
| declare global { | ||
| /** Solid DEV APIs exposed to the debugger by the setup script */ | ||
| var SolidDevtools$$: { | ||
| readonly Solid: typeof solid_js; | ||
| readonly Store: typeof solid_js_store; | ||
| readonly Web: typeof WebAPI; | ||
| readonly DEV: NonNullable<typeof DEV>; | ||
| readonly getOwner: typeof getOwner; | ||
| readonly createRoot: typeof solid_js.createRoot; | ||
| readonly getListener: typeof getListener; | ||
| readonly onCleanup: typeof onCleanup; | ||
| readonly $PROXY: typeof $PROXY; | ||
| readonly untrack: typeof untrack; | ||
| readonly STORE_DEV: NonNullable<typeof DEV$1>; | ||
| readonly unwrap: typeof unwrap; | ||
| readonly getDevEvents: () => StoredDevEvent[]; | ||
| readonly locatorOptions: LocatorOptions | null; | ||
| readonly versions: { | ||
| readonly client: string | null; | ||
| readonly solid: string | null; | ||
| readonly expectedSolid: string | null; | ||
| }; | ||
| readonly getOwnerLocation: (owner: Solid.Owner) => string | null; | ||
| } | undefined; | ||
| } | ||
| 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 : NodeID | string) => ValueItemID; | ||
| type ValueUpdateListener = (newValue: unknown, oldValue: unknown) => void; | ||
| declare namespace Solid { | ||
| type OwnerBase = solid_js.Owner; | ||
| type SourceMapValue = solid_js_types_reactive_signal_d_ts.SourceMapValue; | ||
| type Signal = solid_js_types_reactive_signal_d_ts.SignalState<unknown>; | ||
| type Computation = solid_js_types_reactive_signal_d_ts.Computation<unknown>; | ||
| type Memo = solid_js_types_reactive_signal_d_ts.Memo<unknown>; | ||
| type RootFunction<T> = solid_js_types_reactive_signal_d_ts.RootFunction<T>; | ||
| type EffectFunction = solid_js_types_reactive_signal_d_ts.EffectFunction<unknown>; | ||
| type Component = solid_js_types_reactive_signal_d_ts.DevComponent<{ | ||
| [key: string]: unknown; | ||
| }>; | ||
| type CatchError = Omit<Computation, 'fn'> & { | ||
| fn: undefined; | ||
| }; | ||
| type Root = OwnerBase & { | ||
| attachedTo?: Owner; | ||
| isDisposed?: true; | ||
| isInternal?: true; | ||
| context: null; | ||
| fn?: never; | ||
| state?: never; | ||
| updatedAt?: never; | ||
| sources?: never; | ||
| sourceSlots?: never; | ||
| value?: never; | ||
| pure?: never; | ||
| }; | ||
| type Owner = Root | Computation | CatchError; | ||
| type StoreNode = solid_js_store.StoreNode; | ||
| type NotWrappable = solid_js_store.NotWrappable; | ||
| type OnStoreNodeUpdate = solid_js_store_types_store_d_ts.OnStoreNodeUpdate; | ||
| type Store = SourceMapValue & { | ||
| value: StoreNode; | ||
| }; | ||
| } | ||
| declare module 'solid-js/types/reactive/signal.d.ts' { | ||
| interface Owner { | ||
| sdtType?: NodeType; | ||
| sdtSubRoots?: Solid.Owner[] | null; | ||
| } | ||
| } | ||
| type OnStoreNodeUpdate = Solid.OnStoreNodeUpdate & { | ||
| storePath: readonly (string | number)[]; | ||
| storeSymbol: symbol; | ||
| }; | ||
| 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?: SourceLocation; | ||
| } | ||
| } | ||
| type LocationAttr = `${string}:${number}:${number}`; | ||
| type LocatorComponent = { | ||
| id: NodeID; | ||
| name: string | undefined; | ||
| element: HTMLElement; | ||
| location?: LocationAttr | undefined; | ||
| }; | ||
| type TargetIDE = 'vscode' | 'webstorm' | 'atom' | 'vscode-insiders'; | ||
| type SourceLocation = { | ||
| file: string; | ||
| line: number; | ||
| column: number; | ||
| }; | ||
| type SourceCodeData = SourceLocation & { | ||
| projectPath: string; | ||
| element: HTMLElement | string | undefined; | ||
| }; | ||
| 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; | ||
| declare const WINDOW_PROJECTPATH_PROPERTY = "$sdt_projectPath"; | ||
| declare const LOCATION_ATTRIBUTE_NAME = "data-source-loc"; | ||
| declare namespace Debugger { | ||
| type InspectedState = { | ||
| readonly ownerId: NodeID | null; | ||
| readonly signalId: NodeID | null; | ||
| /** closest note to inspected signal/owner on the owner structure */ | ||
| readonly treeWalkerOwnerId: NodeID | null; | ||
| }; | ||
| type OutputChannels = { | ||
| DebuggerEnabled: boolean; | ||
| ResetPanel: void; | ||
| InspectedState: InspectedState; | ||
| InspectedNodeDetails: Mapped.OwnerDetails; | ||
| StructureUpdates: StructureUpdates; | ||
| NodeUpdates: NodeID[]; | ||
| InspectorUpdate: InspectorUpdate[]; | ||
| LocatorModeChange: boolean; | ||
| HoveredComponent: { | ||
| nodeId: NodeID; | ||
| state: boolean; | ||
| }; | ||
| InspectedComponent: NodeID; | ||
| DgraphUpdate: DGraphUpdate; | ||
| }; | ||
| type InputChannels = { | ||
| ResetState: 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: () => { | ||
| meta: { | ||
| versions: { | ||
| readonly client: string | null; | ||
| readonly solid: string | null; | ||
| readonly expectedSolid: string | null; | ||
| }; | ||
| }; | ||
| 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 { DevEventType as A, type DevEventDataMap as B, type NodeID as C, type DGraphUpdate as D, type EncodedValueMap as E, type ValueItemID as F, getValueItemId as G, type HighlightElementPayload as H, INFINITY as I, type LocatorOptions as L, Mapped as M, NodeType as N, type OnStoreNodeUpdate as O, PropGetterState as P, Solid as S, type ToggleInspectedValueData as T, UNDEFINED as U, type ValueUpdateListener as V, WINDOW_PROJECTPATH_PROPERTY as W, type StoredDevEvent as a, useLocator as b, SerializedDGraph as c, Debugger as d, type StructureUpdates as e, NEGATIVE_INFINITY as f, NAN as g, ValueType as h, type EncodedValue as i, type InspectorUpdateMap as j, type InspectorUpdate as k, LOCATION_ATTRIBUTE_NAME as l, type LocationAttr as m, type LocatorComponent as n, type SourceLocation as o, type TargetIDE as p, type TargetURLFunction as q, DevtoolsMainView as r, DEFAULT_MAIN_VIEW as s, DebuggerModule as t, useDebugger as u, TreeWalkerMode as v, DEFAULT_WALKER_MODE as w, NODE_TYPE_NAMES as x, ValueItemType as y, UNKNOWN as z }; |
+9
-27
@@ -1,6 +0,4 @@ | ||
| import { S as Solid, V as ValueUpdateListener, D as DevEventType, L as LocatorOptions, N as NodeType } from './index-9809b963.js'; | ||
| export { u as useDebugger, a as useLocator } from './index-9809b963.js'; | ||
| import { S as Solid, V as ValueUpdateListener, a as StoredDevEvent, L as LocatorOptions, N as NodeType } from './index-D-hZXIXj.js'; | ||
| export { u as useDebugger, b as useLocator } from './index-D-hZXIXj.js'; | ||
| import * as solid_js from 'solid-js'; | ||
| import * as solid_js_store_types_store from 'solid-js/store/types/store'; | ||
| import * as solid_js_types_reactive_signal_d_ts from 'solid-js/types/reactive/signal.d.ts'; | ||
| import * as WebAPI from 'solid-js/web'; | ||
@@ -12,2 +10,3 @@ import * as solid_js_store from 'solid-js/store'; | ||
| import 'solid-js/store/types/store.d.ts'; | ||
| import 'solid-js/types/reactive/signal.d.ts'; | ||
@@ -49,10 +48,3 @@ /** | ||
| readonly Web: typeof WebAPI; | ||
| readonly DEV: { | ||
| readonly hooks: { | ||
| afterUpdate: (() => void) | null; | ||
| afterCreateOwner: ((owner: solid_js.Owner) => void) | null; | ||
| }; | ||
| readonly writeSignal: typeof solid_js_types_reactive_signal_d_ts.writeSignal; | ||
| readonly registerGraph: typeof solid_js_types_reactive_signal_d_ts.registerGraph; | ||
| }; | ||
| readonly DEV: NonNullable<typeof solid_js.DEV>; | ||
| readonly getOwner: typeof solid_js.getOwner; | ||
@@ -64,15 +56,5 @@ readonly createRoot: typeof solid_js.createRoot; | ||
| readonly untrack: typeof solid_js.untrack; | ||
| readonly STORE_DEV: { | ||
| readonly $NODE: typeof solid_js_store_types_store.$NODE; | ||
| readonly isWrappable: typeof solid_js_store_types_store.isWrappable; | ||
| readonly hooks: { | ||
| onStoreNodeUpdate: solid_js_store_types_store.OnStoreNodeUpdate | null; | ||
| }; | ||
| }; | ||
| readonly STORE_DEV: NonNullable<typeof solid_js_store.DEV>; | ||
| readonly unwrap: typeof solid_js_store.unwrap; | ||
| readonly getDevEvents: () => { | ||
| timestamp: number; | ||
| type: DevEventType.RootCreated; | ||
| data: Solid.Owner; | ||
| }[]; | ||
| readonly getDevEvents: () => StoredDevEvent[]; | ||
| readonly locatorOptions: LocatorOptions | null; | ||
@@ -111,7 +93,7 @@ readonly versions: { | ||
| declare const isSolidOwner: (o: Readonly<Solid.Owner | Solid.Store | Solid.Signal>) => o is Solid.Owner; | ||
| declare const isSolidComputation: (o: Readonly<Solid.Owner>) => o is solid_js_types_reactive_signal_d_ts.Computation<unknown, unknown>; | ||
| declare const isSolidComputation: (o: Readonly<Solid.Owner>) => o is Solid.Computation; | ||
| declare const isSolidRoot: (o: Readonly<Solid.Owner>) => o is Solid.Root; | ||
| declare const isSolidMemo: (o: Readonly<Solid.Owner>) => o is solid_js_types_reactive_signal_d_ts.Memo<unknown, unknown>; | ||
| declare const isSolidMemo: (o: Readonly<Solid.Owner>) => o is Solid.Memo; | ||
| declare const isSolidStore: (o: Solid.Owner | Solid.SourceMapValue | Solid.Store) => o is Solid.Store; | ||
| declare const isSolidSignal: (o: Solid.SourceMapValue) => o is solid_js_types_reactive_signal_d_ts.SignalState<unknown>; | ||
| declare const isSolidSignal: (o: Solid.SourceMapValue) => o is Solid.Signal; | ||
| declare function getNodeType(o: Readonly<Solid.Signal | Solid.Owner | Solid.Store>): NodeType; | ||
@@ -118,0 +100,0 @@ declare const getOwnerType: (o: Readonly<Solid.Owner>) => NodeType; |
+176
-298
@@ -1,2 +0,2 @@ | ||
| import { DEFAULT_WALKER_MODE, LOCATION_ATTRIBUTE_NAME, WINDOW_PROJECTPATH_PROPERTY, UNDEFINED, INFINITY, NEGATIVE_INFINITY, NAN } from './chunks/chunk-S74N7CWV.js'; | ||
| import { DEFAULT_WALKER_MODE, LOCATION_ATTRIBUTE_NAME, WINDOW_PROJECTPATH_PROPERTY, UNDEFINED, INFINITY, NEGATIVE_INFINITY, NAN } from './chunks/chunk-FONACNEO.js'; | ||
| import { createGlobalEmitter, createEventBus } from '@solid-primitives/event-bus'; | ||
@@ -71,4 +71,3 @@ import { createStaticStore } from '@solid-primitives/static-store'; | ||
| function getNodeType(o) { | ||
| if (isSolidOwner(o)) | ||
| return getOwnerType(o); | ||
| if (isSolidOwner(o)) return getOwnerType(o); | ||
| return isSolidStore(o) ? "store" /* Store */ : "signal" /* Signal */; | ||
@@ -78,14 +77,11 @@ } | ||
| var getOwnerType = (o) => { | ||
| if (typeof o.sdtType !== "undefined") | ||
| return o.sdtType; | ||
| if (typeof o.sdtType !== "undefined") return o.sdtType; | ||
| if (!isSolidComputation(o)) { | ||
| if ("sources" in o) | ||
| return "catchError" /* CatchError */; | ||
| if ("sources" in o) return "catchError" /* CatchError */; | ||
| return "root" /* Root */; | ||
| } | ||
| if (isSolidComponent(o)) | ||
| return "component" /* Component */; | ||
| if (isSolidComponent(o)) return "component" /* Component */; | ||
| if ("comparator" in o) { | ||
| if ( | ||
| // eslint-disable-next-line @typescript-eslint/ban-types | ||
| // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type | ||
| o.owner?.component?.name.startsWith( | ||
@@ -100,4 +96,3 @@ SOLID_REFRESH_PREFIX | ||
| if (!o.pure) { | ||
| if (o.user === true) | ||
| return "effect" /* Effect */; | ||
| if (o.user === true) return "effect" /* Effect */; | ||
| if (o.context !== null && (!o.owner || o.owner.context !== o.context)) | ||
@@ -110,12 +105,9 @@ return "context" /* Context */; | ||
| var getNodeName = (o) => { | ||
| if (!o.name) | ||
| return; | ||
| if (!o.name) return; | ||
| let name = o.name; | ||
| if (name.startsWith(SOLID_REFRESH_PREFIX)) | ||
| name = name.slice(SOLID_REFRESH_PREFIX.length); | ||
| if (name.startsWith(SOLID_REFRESH_PREFIX)) name = name.slice(SOLID_REFRESH_PREFIX.length); | ||
| return trimString(name, 20); | ||
| }; | ||
| function markOwnerType(o) { | ||
| if (o.sdtType !== void 0) | ||
| return o.sdtType; | ||
| if (o.sdtType !== void 0) return o.sdtType; | ||
| return o.sdtType = getOwnerType(o); | ||
@@ -136,4 +128,3 @@ } | ||
| const resolved = getResolvedElements(value); | ||
| if (Array.isArray(resolved)) | ||
| return resolved.length ? resolved : null; | ||
| if (Array.isArray(resolved)) return resolved.length ? resolved : null; | ||
| return resolved ? [resolved] : null; | ||
@@ -157,4 +148,3 @@ } | ||
| do { | ||
| if (predicate(owner)) | ||
| return owner; | ||
| if (predicate(owner)) return owner; | ||
| owner = owner.owner; | ||
@@ -165,4 +155,3 @@ } while (owner.owner); | ||
| function onOwnerCleanup(owner, fn, prepend = false, symbol) { | ||
| if (owner.cleanups === null) | ||
| owner.cleanups = [fn]; | ||
| if (owner.cleanups === null) owner.cleanups = [fn]; | ||
| else { | ||
@@ -178,6 +167,4 @@ if (symbol) { | ||
| } | ||
| if (prepend) | ||
| owner.cleanups.unshift(fn); | ||
| else | ||
| owner.cleanups.push(fn); | ||
| if (prepend) owner.cleanups.unshift(fn); | ||
| else owner.cleanups.push(fn); | ||
| } | ||
@@ -187,4 +174,3 @@ return () => owner.cleanups?.splice(owner.cleanups.indexOf(fn), 1); | ||
| function onParentCleanup(owner, fn, prepend = false, symbol) { | ||
| if (owner.owner) | ||
| return onOwnerCleanup(owner.owner, fn, prepend, symbol); | ||
| if (owner.owner) return onOwnerCleanup(owner.owner, fn, prepend, symbol); | ||
| return () => { | ||
@@ -194,4 +180,3 @@ }; | ||
| function onOwnerDispose(owner, fn, prepend = false, symbol) { | ||
| if (isSolidRoot(owner)) | ||
| return onOwnerCleanup(owner, fn, prepend, symbol); | ||
| if (isSolidRoot(owner)) return onOwnerCleanup(owner, fn, prepend, symbol); | ||
| return onParentCleanup(owner, fn, prepend, symbol); | ||
@@ -217,8 +202,6 @@ } | ||
| const component = ComponentMap.get(nodeID); | ||
| if (!component) | ||
| return; | ||
| if (!component) return; | ||
| component.cleanup(); | ||
| ComponentMap.delete(nodeID); | ||
| for (const element of component.elementNodes) | ||
| ElementNodeMap.delete(element); | ||
| for (const element of component.elementNodes) ElementNodeMap.delete(element); | ||
| } | ||
@@ -229,4 +212,3 @@ function registerComponent(data) { | ||
| const component = ComponentMap.get(componentId); | ||
| if (!component) | ||
| return; | ||
| if (!component) return; | ||
| component.elementNodes.add(elementId); | ||
@@ -236,4 +218,3 @@ ElementNodeMap.set(elementId, { el: element, component }); | ||
| const { owner, id, name, elements: elementsList } = data; | ||
| if (!elementsList) | ||
| return cleanupComponent(id); | ||
| if (!elementsList) return cleanupComponent(id); | ||
| const set = new Set(elementsList); | ||
@@ -257,4 +238,3 @@ const existing = ComponentMap.get(id); | ||
| function clearComponentRegistry() { | ||
| for (const component of ComponentMap.values()) | ||
| component.cleanup(); | ||
| for (const component of ComponentMap.values()) component.cleanup(); | ||
| ComponentMap.clear(); | ||
@@ -265,4 +245,3 @@ ElementNodeMap.clear(); | ||
| const component = ComponentMap.get(id); | ||
| if (component) | ||
| return { name: component.name, elements: [...component.elements], id }; | ||
| if (component) return { name: component.name, elements: [...component.elements], id }; | ||
| const elData = ElementNodeMap.get(id); | ||
@@ -276,4 +255,3 @@ return elData ? { name: elData.component.name, id: elData.component.id, elements: [elData.el] } : null; | ||
| for (const component of ComponentMap.values()) { | ||
| if (component.elements.has(currEl)) | ||
| including.set(component.owner, component); | ||
| if (component.elements.has(currEl)) including.set(component.owner, component); | ||
| } | ||
@@ -284,9 +262,7 @@ currEl = including.size === 0 ? currEl.parentElement : null; | ||
| for (const owner of including.keys()) { | ||
| if (!including.has(owner)) | ||
| continue; | ||
| if (!including.has(owner)) continue; | ||
| let currOwner = owner.owner; | ||
| while (currOwner) { | ||
| const deleted = including.delete(currOwner); | ||
| if (deleted) | ||
| break; | ||
| if (deleted) break; | ||
| currOwner = currOwner.owner; | ||
@@ -296,6 +272,8 @@ } | ||
| } | ||
| if (including.size === 0) | ||
| return null; | ||
| const { name, id } = including.values().next().value; | ||
| return { name, id }; | ||
| if (including.size === 0) return null; | ||
| const value = including.values().next().value; | ||
| if (value && value.name) { | ||
| return { name: value.name, id: value.id }; | ||
| } | ||
| return null; | ||
| } | ||
@@ -324,4 +302,3 @@ | ||
| const wasTarcked = RootMap.delete(rootId); | ||
| if (wasTarcked) | ||
| OnRootRemoved?.(rootId); | ||
| if (wasTarcked) OnRootRemoved?.(rootId); | ||
| } | ||
@@ -333,15 +310,10 @@ function changeRootAttachment(root, newParent) { | ||
| topRoot = getTopRoot(root.attachedTo); | ||
| if (topRoot) | ||
| OnOwnerNeedsUpdate?.(root.attachedTo, getSdtId(topRoot, "owner" /* Owner */)); | ||
| if (topRoot) OnOwnerNeedsUpdate?.(root.attachedTo, getSdtId(topRoot, "owner" /* Owner */)); | ||
| } | ||
| if (newParent) { | ||
| root.attachedTo = newParent; | ||
| if (newParent.sdtSubRoots) | ||
| newParent.sdtSubRoots.push(root); | ||
| else | ||
| newParent.sdtSubRoots = [root]; | ||
| if (topRoot === void 0) | ||
| topRoot = getTopRoot(newParent); | ||
| if (topRoot) | ||
| OnOwnerNeedsUpdate?.(newParent, getSdtId(topRoot, "owner" /* Owner */)); | ||
| if (newParent.sdtSubRoots) newParent.sdtSubRoots.push(root); | ||
| else newParent.sdtSubRoots = [root]; | ||
| if (topRoot === void 0) topRoot = getTopRoot(newParent); | ||
| if (topRoot) OnOwnerNeedsUpdate?.(newParent, getSdtId(topRoot, "owner" /* Owner */)); | ||
| } else { | ||
@@ -353,4 +325,3 @@ delete root.attachedTo; | ||
| function attachDebugger(owner = solid_api_default.getOwner()) { | ||
| if (InternalRootCount) | ||
| return; | ||
| if (InternalRootCount) return; | ||
| if (!owner) | ||
@@ -362,4 +333,3 @@ return warn("reatachOwner helper should be called synchronously in a reactive owner."); | ||
| if (isSolidRoot(owner)) { | ||
| if (owner.isInternal || owner.isDisposed) | ||
| return; | ||
| if (owner.isInternal || owner.isDisposed) return; | ||
| if (RootMap.has(getSdtId(owner, "owner" /* Owner */))) { | ||
@@ -383,4 +353,3 @@ isFirstTopLevel = false; | ||
| let parent = findClosestAliveParent(root); | ||
| if (!parent.owner) | ||
| return warn("Parent owner is missing."); | ||
| if (!parent.owner) return warn("Parent owner is missing."); | ||
| changeRootAttachment(root, parent.owner); | ||
@@ -418,4 +387,3 @@ const onParentCleanup2 = () => { | ||
| do { | ||
| if (isSolidRoot(owner) && !owner.isInternal && !owner.isDisposed) | ||
| root = owner; | ||
| if (isSolidRoot(owner) && !owner.isInternal && !owner.isDisposed) root = owner; | ||
| owner = owner.owner; | ||
@@ -432,10 +400,7 @@ } while (owner); | ||
| if (isSolidRoot(current)) { | ||
| if (current.isDisposed) | ||
| disposed = current; | ||
| else | ||
| closestAliveRoot = current; | ||
| if (current.isDisposed) disposed = current; | ||
| else closestAliveRoot = current; | ||
| } | ||
| } | ||
| if (!closestAliveRoot) | ||
| return { owner: null, root: null }; | ||
| if (!closestAliveRoot) return { owner: null, root: null }; | ||
| return { owner: (disposed ?? owner).owner, root: closestAliveRoot }; | ||
@@ -446,7 +411,3 @@ } | ||
| for (const e of solid_api_default.getDevEvents()) { | ||
| switch (e.type) { | ||
| case "RootCreated" /* RootCreated */: | ||
| attachDebugger(e.data); | ||
| break; | ||
| } | ||
| attachDebugger(e.data); | ||
| } | ||
@@ -480,9 +441,7 @@ solid_api_default.DEV.hooks.afterCreateOwner = function(owner) { | ||
| let map = ComputationUpdateListeners.get(owner); | ||
| if (!map) | ||
| ComputationUpdateListeners.set(owner, map = {}); | ||
| if (!map) ComputationUpdateListeners.set(owner, map = {}); | ||
| map[symbol] = onRun; | ||
| interceptComputationRerun(owner, (fn) => { | ||
| fn(); | ||
| for (const sym of Object.getOwnPropertySymbols(map)) | ||
| map[sym](); | ||
| for (const sym of Object.getOwnPropertySymbols(map)) map[sym](); | ||
| }); | ||
@@ -492,4 +451,3 @@ } | ||
| const map = ComputationUpdateListeners.get(owner); | ||
| if (map) | ||
| delete map[symbol]; | ||
| if (map) delete map[symbol]; | ||
| } | ||
@@ -505,4 +463,3 @@ var SignalUpdateListeners = /* @__PURE__ */ new WeakMap(); | ||
| set: (newValue) => { | ||
| for (const fn of map.values()) | ||
| fn(newValue, value); | ||
| for (const fn of map.values()) fn(newValue, value); | ||
| value = newValue; | ||
@@ -530,12 +487,8 @@ } | ||
| function observeNodeUpdate(node, handler) { | ||
| if (isSolidOwner(node)) | ||
| observeComputationUpdate(node, handler, $DGRAPH); | ||
| else | ||
| observeValueUpdate(node, handler, $DGRAPH); | ||
| if (isSolidOwner(node)) observeComputationUpdate(node, handler, $DGRAPH); | ||
| else observeValueUpdate(node, handler, $DGRAPH); | ||
| } | ||
| function unobserveNodeUpdate(node) { | ||
| if (isSolidOwner(node)) | ||
| removeComputationUpdateObserver(node, $DGRAPH); | ||
| else | ||
| removeValueUpdateObserver(node, $DGRAPH); | ||
| if (isSolidOwner(node)) removeComputationUpdateObserver(node, $DGRAPH); | ||
| else removeValueUpdateObserver(node, $DGRAPH); | ||
| } | ||
@@ -545,4 +498,3 @@ function addNodeToGraph(node) { | ||
| const id = getSdtId(node, isOwner ? "owner" /* Owner */ : "signal" /* Signal */); | ||
| if (Graph[id]) | ||
| return; | ||
| if (Graph[id]) return; | ||
| const onNodeUpdate = OnNodeUpdate; | ||
@@ -566,7 +518,5 @@ observeNodeUpdate(node, () => onNodeUpdate(id)); | ||
| const isOwner = isSolidOwner(source); | ||
| if (isOwner && getOwnerType(source) === "refresh" /* Refresh */) | ||
| continue; | ||
| if (isOwner && getOwnerType(source) === "refresh" /* Refresh */) continue; | ||
| n++; | ||
| if (VisitedSources.has(source)) | ||
| continue; | ||
| if (VisitedSources.has(source)) continue; | ||
| VisitedSources.add(source); | ||
@@ -596,11 +546,7 @@ if (isOwner && visitSources(source) === 0) { | ||
| const id = getSdtId(node, isSolidOwner(node) ? "owner" /* Owner */ : "signal" /* Signal */); | ||
| if (id in DepthMap) | ||
| return DepthMap[id]; | ||
| if (id in DepthMap) return DepthMap[id]; | ||
| let owner; | ||
| if (!("owned" in node)) | ||
| owner = node.graph; | ||
| else if (!("fn" in node) && !node.owner) | ||
| return 0; | ||
| else | ||
| owner = node.owner; | ||
| if (!("owned" in node)) owner = node.graph; | ||
| else if (!("fn" in node) && !node.owner) return 0; | ||
| else owner = node.owner; | ||
| return DepthMap[id] = owner ? lookupDepth(owner) + 1 : 0; | ||
@@ -631,4 +577,3 @@ } | ||
| queueMicrotask(() => { | ||
| if (!props.enabled()) | ||
| return; | ||
| if (!props.enabled()) return; | ||
| props.onNodeUpdate(id); | ||
@@ -690,3 +635,3 @@ triggerInspect(); | ||
| get children() { | ||
| const _el$ = _tmpl$(); | ||
| var _el$ = _tmpl$(); | ||
| insert(_el$, () => selected().map(useElementOverlay)); | ||
@@ -711,7 +656,7 @@ return _el$; | ||
| return [(() => { | ||
| const _el$2 = _tmpl$2(); | ||
| var _el$2 = _tmpl$2(); | ||
| insert(_el$2, styles); | ||
| return _el$2; | ||
| })(), (() => { | ||
| const _el$3 = _tmpl$4(); _el$3.firstChild; | ||
| var _el$3 = _tmpl$4(); _el$3.firstChild; | ||
| insert(_el$3, createComponent(Show, { | ||
@@ -722,3 +667,3 @@ get when() { | ||
| get children() { | ||
| const _el$5 = _tmpl$3(), _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$9 = _el$8.firstChild, _el$10 = _el$9.nextSibling, _el$11 = _el$8.nextSibling, _el$12 = _el$11.firstChild; | ||
| var _el$5 = _tmpl$3(), _el$6 = _el$5.firstChild, _el$7 = _el$6.firstChild, _el$8 = _el$7.nextSibling, _el$9 = _el$8.firstChild, _el$10 = _el$9.nextSibling, _el$11 = _el$8.nextSibling, _el$12 = _el$11.firstChild; | ||
| insert(_el$8, name, _el$9); | ||
@@ -733,11 +678,11 @@ insert(_el$10, tag); | ||
| effect((_p$) => { | ||
| const _v$ = transform(), _v$2 = width() + "px", _v$3 = height() + "px"; | ||
| _v$ !== _p$._v$ && ((_p$._v$ = _v$) != null ? _el$3.style.setProperty("transform", _v$) : _el$3.style.removeProperty("transform")); | ||
| _v$2 !== _p$._v$2 && ((_p$._v$2 = _v$2) != null ? _el$3.style.setProperty("width", _v$2) : _el$3.style.removeProperty("width")); | ||
| _v$3 !== _p$._v$3 && ((_p$._v$3 = _v$3) != null ? _el$3.style.setProperty("height", _v$3) : _el$3.style.removeProperty("height")); | ||
| var _v$ = transform(), _v$2 = width() + "px", _v$3 = height() + "px"; | ||
| _v$ !== _p$.e && ((_p$.e = _v$) != null ? _el$3.style.setProperty("transform", _v$) : _el$3.style.removeProperty("transform")); | ||
| _v$2 !== _p$.t && ((_p$.t = _v$2) != null ? _el$3.style.setProperty("width", _v$2) : _el$3.style.removeProperty("width")); | ||
| _v$3 !== _p$.a && ((_p$.a = _v$3) != null ? _el$3.style.setProperty("height", _v$3) : _el$3.style.removeProperty("height")); | ||
| return _p$; | ||
| }, { | ||
| _v$: void 0, | ||
| _v$2: void 0, | ||
| _v$3: void 0 | ||
| e: void 0, | ||
| t: void 0, | ||
| a: void 0 | ||
| }); | ||
@@ -819,4 +764,3 @@ return _el$3; | ||
| const attr = element.getAttribute(LOCATION_ATTRIBUTE_NAME); | ||
| if (!attr || !LOC_ATTR_REGEX.test(attr)) | ||
| return; | ||
| if (!attr || !LOC_ATTR_REGEX.test(attr)) return; | ||
| return attr; | ||
@@ -831,4 +775,3 @@ } | ||
| function getTargetURL(target, data) { | ||
| if (typeof target === "function") | ||
| return target(data); | ||
| if (typeof target === "function") return target(data); | ||
| return targetIDEMap[target](data); | ||
@@ -839,13 +782,11 @@ } | ||
| const projectPath = getProjectPath(); | ||
| if (!projectPath) | ||
| return; | ||
| if (!projectPath) return; | ||
| const parsed = parseLocationString(location); | ||
| if (!parsed) | ||
| return; | ||
| if (!parsed) return; | ||
| return { ...parsed, projectPath, element }; | ||
| } | ||
| function parseLocationString(location) { | ||
| let [filePath, line, column] = location.split(":"); | ||
| if (filePath && line && column && typeof filePath === "string" && !isNaN(line = Number(line)) && !isNaN(column = Number(column))) { | ||
| return { file: filePath, line, column }; | ||
| let [file, line, column] = location.split(":"); | ||
| if (file && line && column && typeof file === "string" && !isNaN(line = +line) && !isNaN(column = +column)) { | ||
| return { file, line, column }; | ||
| } | ||
@@ -855,4 +796,3 @@ } | ||
| const url = getTargetURL(target, data); | ||
| if (typeof url === "string") | ||
| window.open(url, "_blank"); | ||
| if (typeof url === "string") window.open(url, "_blank"); | ||
| } | ||
@@ -868,8 +808,6 @@ | ||
| const calcHighlightedComponents = (target) => { | ||
| if (!target) | ||
| return []; | ||
| if (!target) return []; | ||
| if ("type" in target && target.type === "element") { | ||
| const element = getObjectById(target.id, "element" /* Element */); | ||
| if (!(element instanceof HTMLElement)) | ||
| return []; | ||
| if (!(element instanceof HTMLElement)) return []; | ||
| target = element; | ||
@@ -879,4 +817,3 @@ } | ||
| const comp2 = findComponent(target); | ||
| if (!comp2) | ||
| return []; | ||
| if (!comp2) return []; | ||
| return [ | ||
@@ -892,4 +829,3 @@ { | ||
| const comp = getComponent(target.id); | ||
| if (!comp) | ||
| return []; | ||
| if (!comp) return []; | ||
| return comp.elements.map((element) => ({ | ||
@@ -913,4 +849,3 @@ element, | ||
| const comp = target && findComponent(target); | ||
| if (prev) | ||
| props.emit("HoveredComponent", { nodeId: prev, state: false }); | ||
| if (prev) props.emit("HoveredComponent", { nodeId: prev, state: false }); | ||
| if (comp) { | ||
@@ -924,4 +859,3 @@ const { id } = comp; | ||
| createEffect(() => { | ||
| if (!props.locatorEnabled()) | ||
| return; | ||
| if (!props.locatorEnabled()) return; | ||
| makeHoverElementListener((el) => setHoverTarget(el)); | ||
@@ -934,12 +868,9 @@ onCleanup(() => setHoverTarget(null)); | ||
| const { target } = e; | ||
| if (!(target instanceof HTMLElement)) | ||
| return; | ||
| if (!(target instanceof HTMLElement)) return; | ||
| const highlighted = highlightedComponents(); | ||
| const comp = highlighted.find(({ element }) => target.contains(element)) ?? highlighted[0]; | ||
| if (!comp) | ||
| return; | ||
| if (!comp) return; | ||
| const sourceCodeData = comp.location && getSourceCodeData(comp.location, comp.element); | ||
| props.onComponentClick(comp.id, () => { | ||
| if (!targetIDE || !sourceCodeData) | ||
| return; | ||
| if (!targetIDE || !sourceCodeData) return; | ||
| e.preventDefault(); | ||
@@ -957,7 +888,5 @@ e.stopPropagation(); | ||
| runWithOwner(owner, () => { | ||
| if (locatorUsed) | ||
| return warn("useLocator can be called only once."); | ||
| if (locatorUsed) return warn("useLocator can be called only once."); | ||
| locatorUsed = true; | ||
| if (options.targetIDE) | ||
| targetIDE = options.targetIDE; | ||
| if (options.targetIDE) targetIDE = options.targetIDE; | ||
| if (options.key !== false) { | ||
@@ -978,7 +907,5 @@ const isHoldingKey = createKeyHold(options.key ?? "Alt", { preventDefault: true }); | ||
| openElementSourceCode(location, element) { | ||
| if (!targetIDE) | ||
| return warn("Please set `targetIDE` it in useLocator options."); | ||
| if (!targetIDE) return warn("Please set `targetIDE` it in useLocator options."); | ||
| const projectPath = getProjectPath(); | ||
| if (!projectPath) | ||
| return warn("projectPath is not set."); | ||
| if (!projectPath) return warn("projectPath is not set."); | ||
| openSourceCode(targetIDE, { | ||
@@ -992,4 +919,2 @@ ...location, | ||
| } | ||
| // src/inspector/serialize.ts | ||
| var Deep; | ||
@@ -1004,8 +929,5 @@ var List; | ||
| case "number": | ||
| if (value === Infinity) | ||
| return ["number" /* Number */, INFINITY]; | ||
| if (value === -Infinity) | ||
| return ["number" /* Number */, NEGATIVE_INFINITY]; | ||
| if (isNaN(value)) | ||
| return ["number" /* Number */, NAN]; | ||
| if (value === Infinity) return ["number" /* Number */, INFINITY]; | ||
| if (value === -Infinity) return ["number" /* Number */, NEGATIVE_INFINITY]; | ||
| if (isNaN(value)) return ["number" /* Number */, NAN]; | ||
| return ["number" /* Number */, value]; | ||
@@ -1022,3 +944,4 @@ case "boolean": | ||
| return ["null" /* Null */, null]; | ||
| default: | ||
| case "bigint": | ||
| case "undefined": | ||
| return ["null" /* Null */, UNDEFINED]; | ||
@@ -1029,8 +952,6 @@ } | ||
| const ignoreNextStore = IgnoreNextSeen; | ||
| if (ignoreNextStore) | ||
| IgnoreNextSeen = false; | ||
| if (ignoreNextStore) IgnoreNextSeen = false; | ||
| else { | ||
| const seen = Seen.get(value); | ||
| if (seen !== void 0) | ||
| return seen; | ||
| if (seen !== void 0) return seen; | ||
| } | ||
@@ -1053,4 +974,3 @@ if (!value || typeof value !== "object") { | ||
| const node = solid_api_default.unwrap(value); | ||
| if (node !== value) | ||
| Seen.set(node, index); | ||
| if (node !== value) Seen.set(node, index); | ||
| const id = getSdtId(node, "store-node" /* StoreNode */); | ||
@@ -1110,4 +1030,3 @@ !InStore && HandleStore && HandleStore(node, id); | ||
| unsubscribe() { | ||
| for (const unsub of this.trackedStores) | ||
| unsub(); | ||
| for (const unsub of this.trackedStores) unsub(); | ||
| this.trackedStores = []; | ||
@@ -1124,4 +1043,3 @@ } | ||
| this.selected = selected; | ||
| if (!selected) | ||
| this.unsubscribe(); | ||
| if (!selected) this.unsubscribe(); | ||
| } | ||
@@ -1138,4 +1056,3 @@ }; | ||
| reset() { | ||
| for (const signal of Object.values(this.record)) | ||
| signal.reset(); | ||
| for (const signal of Object.values(this.record)) signal.reset(); | ||
| } | ||
@@ -1178,4 +1095,3 @@ }; | ||
| ++o.n === 1 && self.onPropStateChange?.(key, "live" /* Live */); | ||
| if (value !== o.v) | ||
| self.onValueUpdate?.(id); | ||
| if (value !== o.v) self.onValueUpdate?.(id); | ||
| return o.v = value; | ||
@@ -1193,4 +1109,3 @@ }, | ||
| for (const key of oldKeys) { | ||
| if (added.has(key)) | ||
| added.delete(key); | ||
| if (added.has(key)) added.delete(key); | ||
| else { | ||
@@ -1201,4 +1116,3 @@ changed = true; | ||
| } | ||
| if (!changed && !added.size) | ||
| return null; | ||
| if (!changed && !added.size) return null; | ||
| return { added: Array.from(added), removed }; | ||
@@ -1218,4 +1132,3 @@ }; | ||
| if (owner.owned) { | ||
| for (const node of owner.owned) | ||
| removeValueUpdateObserver(node, $INSPECTOR); | ||
| for (const node of owner.owned) removeValueUpdateObserver(node, $INSPECTOR); | ||
| } | ||
@@ -1235,8 +1148,6 @@ } | ||
| const type = isMemo ? "memo" /* Memo */ : isSolidStore(node) ? "store" /* Store */ : isSolidSignal(node) ? "signal" /* Signal */ : null; | ||
| if (!type) | ||
| return null; | ||
| if (!type) return null; | ||
| const { value } = node, id = getSdtId(node, typeToObjectTypeMap[type]); | ||
| ValueMap.add(`${"signal" /* Signal */}:${id}`, () => node.value); | ||
| if (type !== "store" /* Store */) | ||
| observeValueUpdate(node, (v) => handler(id, v), $INSPECTOR); | ||
| if (type !== "store" /* Store */) observeValueUpdate(node, (v) => handler(id, v), $INSPECTOR); | ||
| return { | ||
@@ -1255,4 +1166,3 @@ type, | ||
| let propsKeys = Object.keys(props); | ||
| for (const key of propsKeys) | ||
| record[key] = { getter: "stale" /* Stale */, value: null }; | ||
| for (const key of propsKeys) record[key] = { getter: "stale" /* Stale */, value: null }; | ||
| checkProxyProps = () => { | ||
@@ -1264,4 +1174,3 @@ const _oldKeys = propsKeys; | ||
| let observed = PropsMap.get(props); | ||
| if (!observed) | ||
| PropsMap.set(props, observed = new ObservedProps(props)); | ||
| if (!observed) PropsMap.set(props, observed = new ObservedProps(props)); | ||
| observed.observe(OnPropStateChange, OnValueUpdate); | ||
@@ -1340,4 +1249,3 @@ for (const [key, desc] of Object.entries(Object.getOwnPropertyDescriptors(props))) { | ||
| for (const node of owned) { | ||
| if (!isSolidMemo(node)) | ||
| continue; | ||
| if (!isSolidMemo(node)) continue; | ||
| const mapped = mapSourceValue(node, onSignalUpdate, true); | ||
@@ -1360,9 +1268,8 @@ mapped && details.signals.push(mapped); | ||
| var Nodes = /* @__PURE__ */ new WeakMap(); | ||
| var OnNodeUpdate3 = null; | ||
| var OnNodeUpdate2 = null; | ||
| function setOnStoreNodeUpdate(fn) { | ||
| OnNodeUpdate3 = fn; | ||
| OnNodeUpdate2 = fn; | ||
| } | ||
| solid_api_default.STORE_DEV.hooks.onStoreNodeUpdate = (node, property, value, prev) => solid_api_default.untrack(() => { | ||
| if (!OnNodeUpdate3 || !Nodes.has(node) || typeof property === "symbol") | ||
| return; | ||
| if (!OnNodeUpdate2 || !Nodes.has(node) || typeof property === "symbol") return; | ||
| property = property.toString(); | ||
@@ -1374,9 +1281,9 @@ const storeProperty = `${getSdtId( | ||
| if (property === "length" && typeof value === "number" && Array.isArray(node)) { | ||
| return OnNodeUpdate3(storeProperty, value); | ||
| return OnNodeUpdate2(storeProperty, value); | ||
| } | ||
| isWrappable(prev) && untrackStore(prev, storeProperty); | ||
| if (value === void 0) { | ||
| OnNodeUpdate3(storeProperty, void 0); | ||
| OnNodeUpdate2(storeProperty, void 0); | ||
| } else { | ||
| OnNodeUpdate3(storeProperty, { value }); | ||
| OnNodeUpdate2(storeProperty, { value }); | ||
| isWrappable(value) && trackStore(value, storeProperty); | ||
@@ -1395,4 +1302,3 @@ } | ||
| const data = Nodes.get(node); | ||
| if (data) | ||
| data.add(parent); | ||
| if (data) data.add(parent); | ||
| else { | ||
@@ -1421,4 +1327,3 @@ Nodes.set(node, /* @__PURE__ */ new Set([parent])); | ||
| const { value, get } = Object.getOwnPropertyDescriptor(node, key); | ||
| if (!get && isWrappable(value)) | ||
| fn(key, value); | ||
| if (!get && isWrappable(value)) fn(key, value); | ||
| } | ||
@@ -1444,4 +1349,3 @@ } | ||
| const node = valueMap.get(id); | ||
| if (!node || !node.getValue) | ||
| continue; | ||
| if (!node || !node.getValue) continue; | ||
| const selected = node.isSelected(); | ||
@@ -1470,4 +1374,3 @@ const encoded = encodeValue( | ||
| const keys = checkProxyProps(); | ||
| if (keys) | ||
| batchedUpdates.push(["propKeys", keys]); | ||
| if (keys) batchedUpdates.push(["propKeys", keys]); | ||
| checkProps = false; | ||
@@ -1493,8 +1396,5 @@ } | ||
| const current = valueUpdates.get(id); | ||
| if (current === selected || current === null) | ||
| return; | ||
| else if (current === !selected) | ||
| valueUpdates.delete(id); | ||
| else | ||
| valueUpdates.set(id, selected); | ||
| if (current === selected || current === null) return; | ||
| else if (current === !selected) valueUpdates.delete(id); | ||
| else valueUpdates.set(id, selected); | ||
| flush(); | ||
@@ -1523,4 +1423,3 @@ }, | ||
| createEffect(() => { | ||
| if (!props.enabled()) | ||
| return; | ||
| if (!props.enabled()) return; | ||
| const id = props.inspectedOwnerId(); | ||
@@ -1552,4 +1451,3 @@ queueMicrotask(() => { | ||
| createEffect(() => { | ||
| if (!props.enabled()) | ||
| return; | ||
| if (!props.enabled()) return; | ||
| onCleanup(addSolidUpdateListener(() => checkProxyProps && triggerPropsCheck())); | ||
@@ -1561,4 +1459,3 @@ }); | ||
| const node = valueMap.get(id); | ||
| if (!node) | ||
| return warn("Could not find value node:", id); | ||
| if (!node) return warn("Could not find value node:", id); | ||
| node.setSelected(selected); | ||
@@ -1596,9 +1493,7 @@ pushInspectToggle(id, selected); | ||
| const rawChildren = owner.owned ? owner.owned.slice() : []; | ||
| if (owner.sdtSubRoots) | ||
| rawChildren.push.apply(rawChildren, owner.sdtSubRoots); | ||
| if (owner.sdtSubRoots) rawChildren.push.apply(rawChildren, owner.sdtSubRoots); | ||
| if (Mode === "owners" /* Owners */) { | ||
| for (const child of rawChildren) { | ||
| const mappedChild = mapOwner(child, mappedOwner); | ||
| if (mappedChild) | ||
| children.push(mappedChild); | ||
| if (mappedChild) children.push(mappedChild); | ||
| } | ||
@@ -1610,7 +1505,5 @@ } else { | ||
| const mappedChild = mapOwner(child, mappedOwner); | ||
| if (mappedChild) | ||
| children.push(mappedChild); | ||
| if (mappedChild) children.push(mappedChild); | ||
| } else { | ||
| if (isObservableComputation(child)) | ||
| observeComputation(child, owner); | ||
| if (isObservableComputation(child)) observeComputation(child, owner); | ||
| children.push.apply(children, mapChildren(child, mappedOwner)); | ||
@@ -1626,42 +1519,38 @@ } | ||
| const r = []; | ||
| els: | ||
| for (const el of els) { | ||
| if (!(el instanceof HTMLElement)) | ||
| continue; | ||
| if (parentChildren) { | ||
| const toCheck = [parentChildren]; | ||
| let index = 0; | ||
| let elNodes = toCheck[index++]; | ||
| while (elNodes) { | ||
| for (let i = 0; i < elNodes.length; i++) { | ||
| const elNode = elNodes[i]; | ||
| const elNodeData = ElementsMap.get(elNode); | ||
| if (elNodeData && elNodeData.el === el) { | ||
| if (AddedToParentElements) { | ||
| elNodes.splice(i, 1); | ||
| } else { | ||
| elNodes[i] = MappedOwnerNode; | ||
| AddedToParentElements = true; | ||
| } | ||
| r.push(elNode); | ||
| elNodeData.component = MappedOwnerNode; | ||
| continue els; | ||
| els: for (const el of els) { | ||
| if (!(el instanceof HTMLElement)) continue; | ||
| if (parentChildren) { | ||
| const toCheck = [parentChildren]; | ||
| let index = 0; | ||
| let elNodes = toCheck[index++]; | ||
| while (elNodes) { | ||
| for (let i = 0; i < elNodes.length; i++) { | ||
| const elNode = elNodes[i]; | ||
| const elNodeData = ElementsMap.get(elNode); | ||
| if (elNodeData && elNodeData.el === el) { | ||
| if (AddedToParentElements) { | ||
| elNodes.splice(i, 1); | ||
| } else { | ||
| elNodes[i] = MappedOwnerNode; | ||
| AddedToParentElements = true; | ||
| } | ||
| if (elNode.children.length) | ||
| toCheck.push(elNode.children); | ||
| r.push(elNode); | ||
| elNodeData.component = MappedOwnerNode; | ||
| continue els; | ||
| } | ||
| elNodes = toCheck[index++]; | ||
| if (elNode.children.length) toCheck.push(elNode.children); | ||
| } | ||
| elNodes = toCheck[index++]; | ||
| } | ||
| const mappedEl = { | ||
| id: getSdtId(el, "element" /* Element */), | ||
| type: "element" /* Element */, | ||
| name: el.localName, | ||
| children: [] | ||
| }; | ||
| r.push(mappedEl); | ||
| ElementsMap.set(mappedEl, { el, component: MappedOwnerNode }); | ||
| if (el.children.length) | ||
| mappedEl.children = mapElements(el.children, parentChildren); | ||
| } | ||
| const mappedEl = { | ||
| id: getSdtId(el, "element" /* Element */), | ||
| type: "element" /* Element */, | ||
| name: el.localName, | ||
| children: [] | ||
| }; | ||
| r.push(mappedEl); | ||
| ElementsMap.set(mappedEl, { el, component: MappedOwnerNode }); | ||
| if (el.children.length) mappedEl.children = mapElements(el.children, parentChildren); | ||
| } | ||
| return r; | ||
@@ -1693,4 +1582,3 @@ } | ||
| observeComputation(owner, owner); | ||
| if (!owner.sources || owner.sources.length === 0) | ||
| mapped.frozen = true; | ||
| if (!owner.sources || owner.sources.length === 0) mapped.frozen = true; | ||
| } | ||
@@ -1739,16 +1627,12 @@ const children = []; | ||
| do { | ||
| if (isDisposed(current)) | ||
| closest = current.owner; | ||
| if (isDisposed(current)) closest = current.owner; | ||
| current = current.owner; | ||
| } while (current); | ||
| owner = closest ?? owner; | ||
| if (mode === "owners" /* Owners */) | ||
| return owner; | ||
| if (mode === "owners" /* Owners */) return owner; | ||
| let root = null; | ||
| do { | ||
| const type = markOwnerType(owner); | ||
| if (type === "component" /* Component */ || type === "context" /* Context */) | ||
| return owner; | ||
| if (type === "root" /* Root */) | ||
| root = owner; | ||
| if (type === "component" /* Component */ || type === "context" /* Context */) return owner; | ||
| if (type === "root" /* Root */) root = owner; | ||
| owner = owner.owner; | ||
@@ -1766,4 +1650,3 @@ } while (owner); | ||
| queueMicrotask(() => { | ||
| if (!props.enabled()) | ||
| return; | ||
| if (!props.enabled()) return; | ||
| changedStructure && updateOwner(owner, rootId); | ||
@@ -1791,6 +1674,4 @@ props.onNodeUpdate(ownerId); | ||
| const map = updated[rootId]; | ||
| if (map) | ||
| map[tree.id] = tree; | ||
| else | ||
| updated[rootId] = { [tree.id]: tree }; | ||
| if (map) map[tree.id] = tree; | ||
| else updated[rootId] = { [tree.id]: tree }; | ||
| } | ||
@@ -1911,6 +1792,4 @@ props.onStructureUpdate({ partial, updated, removed: [...removedRoots] }); | ||
| let { ownerId, signalId } = data ?? { ownerId: null, signalId: null }; | ||
| if (ownerId && !getObjectById(ownerId, "owner" /* Owner */)) | ||
| ownerId = null; | ||
| if (signalId && !getObjectById(signalId, "signal" /* Signal */)) | ||
| signalId = null; | ||
| if (ownerId && !getObjectById(ownerId, "owner" /* Owner */)) ownerId = null; | ||
| if (signalId && !getObjectById(signalId, "signal" /* Signal */)) signalId = null; | ||
| setInspectedState({ | ||
@@ -1924,4 +1803,3 @@ ownerId, | ||
| defer(debuggerEnabled, (enabled) => { | ||
| if (!enabled) | ||
| resetInspectedNode(); | ||
| if (!enabled) resetInspectedNode(); | ||
| }) | ||
@@ -1928,0 +1806,0 @@ ); |
+1
-2
@@ -73,4 +73,3 @@ import { error } from '@solid-devtools/shared/utils'; | ||
| DEV.hooks.afterCreateOwner = function(owner) { | ||
| if (!DevEvents) | ||
| return; | ||
| if (!DevEvents) return; | ||
| DevEvents.push({ | ||
@@ -77,0 +76,0 @@ timestamp: Date.now(), |
+1
-1
@@ -1,2 +0,2 @@ | ||
| export { s as DEFAULT_MAIN_VIEW, w as DEFAULT_WALKER_MODE, b as DGraphUpdate, d as Debugger, t as DebuggerModule, A as DevEventDataMap, D as DevEventType, r as DevtoolsMainView, i as EncodedValue, E as EncodedValueMap, H as HighlightElementPayload, I as INFINITY, k as InspectorUpdate, j as InspectorUpdateMap, l as LOCATION_ATTRIBUTE_NAME, m as LocationAttr, n as LocatorComponent, L as LocatorOptions, M as Mapped, g as NAN, f as NEGATIVE_INFINITY, x as NODE_TYPE_NAMES, C as NodeID, N as NodeType, O as OnStoreNodeUpdate, P as PropGetterState, c as SerializedDGraph, S as Solid, o as SourceLocation, B as StoredDevEvent, e as StructureUpdates, p as TargetIDE, q as TargetURLFunction, T as ToggleInspectedValueData, v as TreeWalkerMode, U as UNDEFINED, z as UNKNOWN, F as ValueItemID, y as ValueItemType, h as ValueType, V as ValueUpdateListener, W as WINDOW_PROJECTPATH_PROPERTY, G as getValueItemId } from './index-9809b963.js'; | ||
| export { s as DEFAULT_MAIN_VIEW, w as DEFAULT_WALKER_MODE, D as DGraphUpdate, d as Debugger, t as DebuggerModule, B as DevEventDataMap, A as DevEventType, r as DevtoolsMainView, i as EncodedValue, E as EncodedValueMap, H as HighlightElementPayload, I as INFINITY, k as InspectorUpdate, j as InspectorUpdateMap, l as LOCATION_ATTRIBUTE_NAME, m as LocationAttr, n as LocatorComponent, L as LocatorOptions, M as Mapped, g as NAN, f as NEGATIVE_INFINITY, x as NODE_TYPE_NAMES, C as NodeID, N as NodeType, O as OnStoreNodeUpdate, P as PropGetterState, c as SerializedDGraph, S as Solid, o as SourceLocation, a as StoredDevEvent, e as StructureUpdates, p as TargetIDE, q as TargetURLFunction, T as ToggleInspectedValueData, v as TreeWalkerMode, U as UNDEFINED, z as UNKNOWN, F as ValueItemID, y as ValueItemType, h as ValueType, V as ValueUpdateListener, W as WINDOW_PROJECTPATH_PROPERTY, G as getValueItemId } from './index-D-hZXIXj.js'; | ||
| import '@solid-primitives/event-bus'; | ||
@@ -3,0 +3,0 @@ import 'solid-js'; |
+1
-1
@@ -1,1 +0,1 @@ | ||
| export { DEFAULT_MAIN_VIEW, DEFAULT_WALKER_MODE, DebuggerModule, DevEventType, DevtoolsMainView, INFINITY, LOCATION_ATTRIBUTE_NAME, NAN, NEGATIVE_INFINITY, NODE_TYPE_NAMES, NodeType, PropGetterState, TreeWalkerMode, UNDEFINED, UNKNOWN, ValueItemType, ValueType, WINDOW_PROJECTPATH_PROPERTY, getValueItemId } from './chunks/chunk-S74N7CWV.js'; | ||
| export { DEFAULT_MAIN_VIEW, DEFAULT_WALKER_MODE, DebuggerModule, DevEventType, DevtoolsMainView, INFINITY, LOCATION_ATTRIBUTE_NAME, NAN, NEGATIVE_INFINITY, NODE_TYPE_NAMES, NodeType, PropGetterState, TreeWalkerMode, UNDEFINED, UNKNOWN, ValueItemType, ValueType, WINDOW_PROJECTPATH_PROPERTY, getValueItemId } from './chunks/chunk-FONACNEO.js'; |
+15
-16
| { | ||
| "name": "@solid-devtools/debugger", | ||
| "version": "0.23.4", | ||
| "version": "0.24.0", | ||
| "description": "Debugger of the Solid's reactivity graph — a cornerstone of all solid-devtools.", | ||
@@ -68,22 +68,21 @@ "license": "MIT", | ||
| "dependencies": { | ||
| "@nothing-but/utils": "~0.12.0", | ||
| "@solid-primitives/bounds": "^0.0.118", | ||
| "@solid-primitives/cursor": "^0.0.112", | ||
| "@solid-primitives/event-bus": "^1.0.8", | ||
| "@solid-primitives/event-listener": "^2.3.0", | ||
| "@solid-primitives/keyboard": "^1.2.5", | ||
| "@solid-primitives/platform": "^0.1.0", | ||
| "@solid-primitives/rootless": "^1.4.2", | ||
| "@solid-primitives/scheduled": "^1.4.1", | ||
| "@solid-primitives/static-store": "^0.0.5", | ||
| "@solid-primitives/utils": "^6.2.1", | ||
| "@solid-devtools/shared": "^0.13.2" | ||
| "@nothing-but/utils": "~0.17.0", | ||
| "@solid-primitives/bounds": "^0.0.122", | ||
| "@solid-primitives/cursor": "^0.0.115", | ||
| "@solid-primitives/event-bus": "^1.0.11", | ||
| "@solid-primitives/event-listener": "^2.3.3", | ||
| "@solid-primitives/keyboard": "^1.2.8", | ||
| "@solid-primitives/platform": "^0.1.2", | ||
| "@solid-primitives/rootless": "^1.4.5", | ||
| "@solid-primitives/scheduled": "^1.4.4", | ||
| "@solid-primitives/static-store": "^0.0.8", | ||
| "@solid-primitives/utils": "^6.2.3", | ||
| "@solid-devtools/shared": "^0.14.0" | ||
| }, | ||
| "peerDependencies": { | ||
| "solid-js": "^1.8.0" | ||
| "solid-js": "^1.9.0" | ||
| }, | ||
| "devDependencies": { | ||
| "solid-js": "^1.8.5" | ||
| "solid-js": "^1.9.3" | ||
| }, | ||
| "packageManager": "pnpm@8.14.0", | ||
| "keywords": [ | ||
@@ -90,0 +89,0 @@ "solid", |
| // src/main/constants.ts | ||
| var DevtoolsMainView = /* @__PURE__ */ ((DevtoolsMainView2) => { | ||
| DevtoolsMainView2["Structure"] = "structure"; | ||
| return DevtoolsMainView2; | ||
| })(DevtoolsMainView || {}); | ||
| var DEFAULT_MAIN_VIEW = "structure" /* Structure */; | ||
| var DebuggerModule = /* @__PURE__ */ ((DebuggerModule2) => { | ||
| DebuggerModule2["Locator"] = "locator"; | ||
| DebuggerModule2["Structure"] = "structure"; | ||
| DebuggerModule2["Dgraph"] = "dgraph"; | ||
| return DebuggerModule2; | ||
| })(DebuggerModule || {}); | ||
| var TreeWalkerMode = /* @__PURE__ */ ((TreeWalkerMode2) => { | ||
| TreeWalkerMode2["Owners"] = "owners"; | ||
| TreeWalkerMode2["Components"] = "components"; | ||
| TreeWalkerMode2["DOM"] = "dom"; | ||
| return TreeWalkerMode2; | ||
| })(TreeWalkerMode || {}); | ||
| var DEFAULT_WALKER_MODE = "components" /* Components */; | ||
| var NodeType = /* @__PURE__ */ ((NodeType2) => { | ||
| NodeType2["Root"] = "root"; | ||
| NodeType2["Component"] = "component"; | ||
| NodeType2["Element"] = "element"; | ||
| NodeType2["Effect"] = "effect"; | ||
| NodeType2["Render"] = "render"; | ||
| NodeType2["Memo"] = "memo"; | ||
| NodeType2["Computation"] = "computation"; | ||
| NodeType2["Refresh"] = "refresh"; | ||
| NodeType2["Context"] = "context"; | ||
| NodeType2["CatchError"] = "catchError"; | ||
| NodeType2["Signal"] = "signal"; | ||
| NodeType2["Store"] = "store"; | ||
| return NodeType2; | ||
| })(NodeType || {}); | ||
| var NODE_TYPE_NAMES = { | ||
| ["root" /* Root */]: "Root", | ||
| ["component" /* Component */]: "Component", | ||
| ["element" /* Element */]: "Element", | ||
| ["effect" /* Effect */]: "Effect", | ||
| ["render" /* Render */]: "Render Effect", | ||
| ["memo" /* Memo */]: "Memo", | ||
| ["computation" /* Computation */]: "Computation", | ||
| ["refresh" /* Refresh */]: "Refresh", | ||
| ["context" /* Context */]: "Context", | ||
| ["catchError" /* CatchError */]: "CatchError", | ||
| ["signal" /* Signal */]: "Signal", | ||
| ["store" /* Store */]: "Store" | ||
| }; | ||
| var ValueItemType = /* @__PURE__ */ ((ValueItemType2) => { | ||
| ValueItemType2["Signal"] = "signal"; | ||
| ValueItemType2["Prop"] = "prop"; | ||
| ValueItemType2["Value"] = "value"; | ||
| return ValueItemType2; | ||
| })(ValueItemType || {}); | ||
| var UNKNOWN = "unknown"; | ||
| // src/inspector/types.ts | ||
| var INFINITY = "Infinity"; | ||
| var NEGATIVE_INFINITY = "NegativeInfinity"; | ||
| var NAN = "NaN"; | ||
| var UNDEFINED = "undefined"; | ||
| var ValueType = /* @__PURE__ */ ((ValueType2) => { | ||
| ValueType2["Number"] = "number"; | ||
| ValueType2["Boolean"] = "boolean"; | ||
| ValueType2["String"] = "string"; | ||
| ValueType2["Null"] = "null"; | ||
| ValueType2["Symbol"] = "symbol"; | ||
| ValueType2["Array"] = "array"; | ||
| ValueType2["Object"] = "object"; | ||
| ValueType2["Function"] = "function"; | ||
| ValueType2["Getter"] = "getter"; | ||
| ValueType2["Element"] = "element"; | ||
| ValueType2["Instance"] = "instance"; | ||
| ValueType2["Store"] = "store"; | ||
| ValueType2[ValueType2["Unknown"] = UNKNOWN] = "Unknown"; | ||
| return ValueType2; | ||
| })(ValueType || {}); | ||
| var PropGetterState = /* @__PURE__ */ ((PropGetterState2) => { | ||
| PropGetterState2["Live"] = "live"; | ||
| PropGetterState2["Stale"] = "stale"; | ||
| return PropGetterState2; | ||
| })(PropGetterState || {}); | ||
| // src/locator/types.ts | ||
| var WINDOW_PROJECTPATH_PROPERTY = "$sdt_projectPath"; | ||
| var LOCATION_ATTRIBUTE_NAME = "data-source-loc"; | ||
| // src/main/types.ts | ||
| var DevEventType = /* @__PURE__ */ ((DevEventType2) => { | ||
| DevEventType2["RootCreated"] = "RootCreated"; | ||
| return DevEventType2; | ||
| })(DevEventType || {}); | ||
| var getValueItemId = (type, id) => { | ||
| if (type === "value" /* Value */) | ||
| return "value" /* Value */; | ||
| return `${type}:${id}`; | ||
| }; | ||
| export { DEFAULT_MAIN_VIEW, DEFAULT_WALKER_MODE, DebuggerModule, DevEventType, DevtoolsMainView, INFINITY, LOCATION_ATTRIBUTE_NAME, NAN, NEGATIVE_INFINITY, NODE_TYPE_NAMES, NodeType, PropGetterState, TreeWalkerMode, UNDEFINED, UNKNOWN, ValueItemType, ValueType, WINDOW_PROJECTPATH_PROPERTY, getValueItemId }; |
| import * as _solid_primitives_event_bus from '@solid-primitives/event-bus'; | ||
| import * as solid_js from 'solid-js'; | ||
| import { DEV, getOwner, getListener, onCleanup, $PROXY, untrack } from 'solid-js'; | ||
| import { ToDyscriminatedUnion } from '@solid-devtools/shared/utils'; | ||
| import { KbdKey } from '@solid-primitives/keyboard'; | ||
| import * as solid_js_store_types_store_d_ts from 'solid-js/store/types/store.d.ts'; | ||
| import * as solid_js_store from 'solid-js/store'; | ||
| import { DEV as DEV$1, unwrap } from 'solid-js/store'; | ||
| import * as solid_js_types_reactive_signal_d_ts from 'solid-js/types/reactive/signal.d.ts'; | ||
| import * as WebAPI from 'solid-js/web'; | ||
| /** | ||
| * 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.Components; | ||
| declare enum NodeType { | ||
| Root = "root", | ||
| Component = "component", | ||
| Element = "element", | ||
| Effect = "effect", | ||
| Render = "render", | ||
| Memo = "memo", | ||
| Computation = "computation", | ||
| Refresh = "refresh", | ||
| Context = "context", | ||
| CatchError = "catchError", | ||
| Signal = "signal", | ||
| Store = "store" | ||
| } | ||
| declare const NODE_TYPE_NAMES: Readonly<Record<NodeType, string>>; | ||
| declare enum ValueItemType { | ||
| Signal = "signal", | ||
| Prop = "prop", | ||
| Value = "value" | ||
| } | ||
| declare const UNKNOWN = "unknown"; | ||
| 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]; | ||
| declare const enum DevEventType { | ||
| RootCreated = "RootCreated" | ||
| } | ||
| type DevEventDataMap = { | ||
| [DevEventType.RootCreated]: Solid.Owner; | ||
| }; | ||
| type StoredDevEvent = { | ||
| [K in keyof DevEventDataMap]: { | ||
| timestamp: number; | ||
| type: K; | ||
| data: DevEventDataMap[K]; | ||
| }; | ||
| }[keyof DevEventDataMap]; | ||
| declare global { | ||
| /** Solid DEV APIs exposed to the debugger by the setup script */ | ||
| var SolidDevtools$$: { | ||
| readonly Solid: typeof solid_js; | ||
| readonly Store: typeof solid_js_store; | ||
| readonly Web: typeof WebAPI; | ||
| readonly DEV: NonNullable<typeof DEV>; | ||
| readonly getOwner: typeof getOwner; | ||
| readonly createRoot: typeof solid_js.createRoot; | ||
| readonly getListener: typeof getListener; | ||
| readonly onCleanup: typeof onCleanup; | ||
| readonly $PROXY: typeof $PROXY; | ||
| readonly untrack: typeof untrack; | ||
| readonly STORE_DEV: NonNullable<typeof DEV$1>; | ||
| readonly unwrap: typeof unwrap; | ||
| readonly getDevEvents: () => StoredDevEvent[]; | ||
| readonly locatorOptions: LocatorOptions | null; | ||
| readonly versions: { | ||
| readonly client: string | null; | ||
| readonly solid: string | null; | ||
| readonly expectedSolid: string | null; | ||
| }; | ||
| readonly getOwnerLocation: (owner: Solid.Owner) => string | null; | ||
| } | undefined; | ||
| } | ||
| 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 Solid { | ||
| type OwnerBase = solid_js.Owner; | ||
| type SourceMapValue = solid_js_types_reactive_signal_d_ts.SourceMapValue; | ||
| type Signal = solid_js_types_reactive_signal_d_ts.SignalState<unknown>; | ||
| type Computation = solid_js_types_reactive_signal_d_ts.Computation<unknown>; | ||
| type Memo = solid_js_types_reactive_signal_d_ts.Memo<unknown>; | ||
| type RootFunction<T> = solid_js_types_reactive_signal_d_ts.RootFunction<T>; | ||
| type EffectFunction = solid_js_types_reactive_signal_d_ts.EffectFunction<unknown>; | ||
| type Component = solid_js_types_reactive_signal_d_ts.DevComponent<{ | ||
| [key: string]: unknown; | ||
| }>; | ||
| type CatchError = Omit<Computation, 'fn'> & { | ||
| fn: undefined; | ||
| }; | ||
| type Root = OwnerBase & { | ||
| attachedTo?: Owner; | ||
| isDisposed?: true; | ||
| isInternal?: true; | ||
| context: null; | ||
| fn?: never; | ||
| state?: never; | ||
| updatedAt?: never; | ||
| sources?: never; | ||
| sourceSlots?: never; | ||
| value?: never; | ||
| pure?: never; | ||
| }; | ||
| type Owner = Root | Computation | CatchError; | ||
| type StoreNode = solid_js_store.StoreNode; | ||
| type NotWrappable = solid_js_store.NotWrappable; | ||
| type OnStoreNodeUpdate = solid_js_store_types_store_d_ts.OnStoreNodeUpdate; | ||
| type Store = SourceMapValue & { | ||
| value: StoreNode; | ||
| }; | ||
| } | ||
| declare module 'solid-js/types/reactive/signal.d.ts' { | ||
| interface Owner { | ||
| sdtType?: NodeType; | ||
| sdtSubRoots?: Solid.Owner[] | null; | ||
| } | ||
| } | ||
| type OnStoreNodeUpdate = Solid.OnStoreNodeUpdate & { | ||
| storePath: readonly (string | number)[]; | ||
| storeSymbol: symbol; | ||
| }; | ||
| 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?: SourceLocation; | ||
| } | ||
| } | ||
| type LocationAttr = `${string}:${number}:${number}`; | ||
| type LocatorComponent = { | ||
| id: NodeID; | ||
| name: string | undefined; | ||
| element: HTMLElement; | ||
| location?: LocationAttr | undefined; | ||
| }; | ||
| type TargetIDE = 'vscode' | 'webstorm' | 'atom' | 'vscode-insiders'; | ||
| type SourceLocation = { | ||
| file: string; | ||
| line: number; | ||
| column: number; | ||
| }; | ||
| type SourceCodeData = SourceLocation & { | ||
| projectPath: string; | ||
| element: HTMLElement | string | undefined; | ||
| }; | ||
| 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; | ||
| declare const WINDOW_PROJECTPATH_PROPERTY = "$sdt_projectPath"; | ||
| declare const LOCATION_ATTRIBUTE_NAME = "data-source-loc"; | ||
| declare namespace Debugger { | ||
| type InspectedState = { | ||
| readonly ownerId: NodeID | null; | ||
| readonly signalId: NodeID | null; | ||
| /** closest note to inspected signal/owner on the owner structure */ | ||
| readonly treeWalkerOwnerId: NodeID | null; | ||
| }; | ||
| type OutputChannels = { | ||
| DebuggerEnabled: boolean; | ||
| ResetPanel: void; | ||
| InspectedState: InspectedState; | ||
| InspectedNodeDetails: Mapped.OwnerDetails; | ||
| StructureUpdates: StructureUpdates; | ||
| NodeUpdates: NodeID[]; | ||
| InspectorUpdate: InspectorUpdate[]; | ||
| LocatorModeChange: boolean; | ||
| HoveredComponent: { | ||
| nodeId: NodeID; | ||
| state: boolean; | ||
| }; | ||
| InspectedComponent: NodeID; | ||
| DgraphUpdate: DGraphUpdate; | ||
| }; | ||
| type InputChannels = { | ||
| ResetState: 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: () => { | ||
| meta: { | ||
| versions: { | ||
| readonly client: string | null; | ||
| readonly solid: string | null; | ||
| readonly expectedSolid: string | null; | ||
| }; | ||
| }; | ||
| 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 { DevEventDataMap as A, StoredDevEvent as B, NodeID as C, DevEventType as D, EncodedValueMap as E, ValueItemID as F, getValueItemId as G, HighlightElementPayload as H, INFINITY as I, LocatorOptions as L, Mapped as M, NodeType as N, OnStoreNodeUpdate as O, PropGetterState as P, Solid as S, ToggleInspectedValueData as T, UNDEFINED as U, ValueUpdateListener as V, WINDOW_PROJECTPATH_PROPERTY as W, useLocator as a, DGraphUpdate as b, SerializedDGraph as c, Debugger as d, StructureUpdates as e, NEGATIVE_INFINITY as f, NAN as g, ValueType as h, EncodedValue as i, InspectorUpdateMap as j, InspectorUpdate as k, LOCATION_ATTRIBUTE_NAME as l, LocationAttr as m, LocatorComponent as n, SourceLocation as o, TargetIDE as p, TargetURLFunction as q, DevtoolsMainView as r, DEFAULT_MAIN_VIEW as s, DebuggerModule as t, useDebugger as u, TreeWalkerMode as v, DEFAULT_WALKER_MODE as w, NODE_TYPE_NAMES as x, ValueItemType as y, UNKNOWN as z }; |
Sorry, the diff of this file is too big to display
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
3
-25%197542
-1.17%5590
-4.96%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated