@loom-js/devtools 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +77 -2
- package/dist/frontend.css +2 -0
- package/dist/frontend.js +215 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.mjs +24 -0
- package/dist/index.mjs.map +7 -0
- package/dist/types/backend/console-api.d.ts +6 -0
- package/dist/types/backend/console-api.d.ts.map +1 -0
- package/dist/types/backend/formatters.d.ts +14 -0
- package/dist/types/backend/formatters.d.ts.map +1 -0
- package/dist/types/backend/hosts.d.ts +10 -0
- package/dist/types/backend/hosts.d.ts.map +1 -0
- package/dist/types/backend/ids.d.ts +11 -0
- package/dist/types/backend/ids.d.ts.map +1 -0
- package/dist/types/backend/index.d.ts +15 -0
- package/dist/types/backend/index.d.ts.map +1 -0
- package/dist/types/backend/inspect.d.ts +25 -0
- package/dist/types/backend/inspect.d.ts.map +1 -0
- package/dist/types/backend/page-layer.d.ts +15 -0
- package/dist/types/backend/page-layer.d.ts.map +1 -0
- package/dist/types/backend/perf.d.ts +6 -0
- package/dist/types/backend/perf.d.ts.map +1 -0
- package/dist/types/frontend/client.d.ts +16 -0
- package/dist/types/frontend/client.d.ts.map +1 -0
- package/dist/types/frontend/derive.d.ts +28 -0
- package/dist/types/frontend/derive.d.ts.map +1 -0
- package/dist/types/frontend/index.d.ts +3 -0
- package/dist/types/frontend/index.d.ts.map +1 -0
- package/dist/types/frontend/state.d.ts +171 -0
- package/dist/types/frontend/state.d.ts.map +1 -0
- package/dist/types/frontend/views/activity-item.d.ts +12 -0
- package/dist/types/frontend/views/activity-item.d.ts.map +1 -0
- package/dist/types/frontend/views/header.d.ts +5 -0
- package/dist/types/frontend/views/header.d.ts.map +1 -0
- package/dist/types/frontend/views/hud.d.ts +5 -0
- package/dist/types/frontend/views/hud.d.ts.map +1 -0
- package/dist/types/frontend/views/panes.d.ts +11 -0
- package/dist/types/frontend/views/panes.d.ts.map +1 -0
- package/dist/types/frontend/views/value-view.d.ts +20 -0
- package/dist/types/frontend/views/value-view.d.ts.map +1 -0
- package/dist/types/frontend-source.d.ts +3 -0
- package/dist/types/frontend-source.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/protocol/encode.d.ts +29 -0
- package/dist/types/protocol/encode.d.ts.map +1 -0
- package/dist/types/protocol/transport.d.ts +28 -0
- package/dist/types/protocol/transport.d.ts.map +1 -0
- package/dist/types/protocol/types.d.ts +187 -0
- package/dist/types/protocol/types.d.ts.map +1 -0
- package/package.json +56 -3
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/backend/index.ts", "../src/protocol/encode.ts", "../src/protocol/types.ts", "../src/protocol/transport.ts", "../src/backend/console-api.ts", "../src/backend/formatters.ts", "../src/frontend-source.ts", "../src/backend/hosts.ts", "../src/backend/ids.ts", "../src/backend/inspect.ts", "../src/backend/page-layer.ts", "../src/backend/perf.ts"],
|
|
4
|
+
"sourcesContent": ["// The in-page backend: answers frontend requests against the live app and\n// pushes frame-batched events for the topics a frontend subscribed to.\n// Core's devtools hook is installed only while a push topic is subscribed.\nimport {\n type ComponentContextPartial,\n type DevtoolsBackend,\n type DevtoolsHook,\n type InspectableActivity,\n inspectContext,\n isInspectableActivity,\n kindOf,\n nodeNameOf,\n setDevtoolsHook,\n takeBufferedEvents\n} from '@loom-js/core/devtools';\n\nimport { MISSING, resolvePath } from '../protocol/encode';\nimport { createTransport, envelope } from '../protocol/transport';\nimport {\n type Envelope,\n type ErrorCode,\n type Events,\n type EventType,\n PROTOCOL_VERSION,\n type PathKey,\n type Placement,\n type Requests,\n type RequestType,\n type Topic\n} from '../protocol/types';\nimport { installConsoleApi } from './console-api';\nimport { installFormatters } from './formatters';\nimport { createHosts } from './hosts';\nimport { createIdRegistry } from './ids';\nimport { createInspector, isJsonValue } from './inspect';\nimport { createPageLayer } from './page-layer';\nimport { createPerfTracks } from './perf';\n\nconst FEATURES: Topic[] = ['activities', 'flash', 'perf', 'renders', 'tree'];\nconst FLUSH_FALLBACK_MS = 100;\n\nclass RequestError extends Error {\n constructor(\n readonly code: ErrorCode,\n message: string\n ) {\n super(message);\n }\n}\n\ntype Handlers = {\n [Type in Exclude<RequestType, 'hello'>]: (\n payload: Requests[Type][0]\n ) => Requests[Type][1];\n};\n\nconst randomSession = () =>\n globalThis.crypto?.randomUUID?.() ?? `${Date.now()}-${Math.random()}`;\n\nexport interface BackendOptions {\n // Accepts windows beyond the backend's own dock and popup as peers.\n acceptPeer?(source: Window): boolean;\n}\n\n/**\n * Starts a backend in a page: the protocol endpoint, the page layer and the\n * console formatters.\n * @param view The inspected page's window.\n * @param options Extra peer acceptance (test harnesses).\n * @returns The running backend.\n */\nexport const createBackend = (\n view: Window & typeof globalThis,\n { acceptPeer }: BackendOptions = {}\n): DevtoolsBackend => {\n const session = randomSession();\n const ids = createIdRegistry();\n const inspector = createInspector(ids);\n const layer = createPageLayer(view.document, nodeNameOf);\n const hosts = createHosts(view);\n const transport = createTransport(view);\n const perf = createPerfTracks();\n const removeFormatters = installFormatters(view);\n const removeConsoleApi = installConsoleApi(view);\n // Windows that completed `hello`.\n const peers = new Set<Window>();\n const topics = new Set<Topic>();\n const watched = new Map<InspectableActivity, () => void>();\n const changed = new Set<ComponentContextPartial>();\n const renders: { ctx: ComponentContextPartial; ms: number }[] = [];\n const activityChanges = new Set<InspectableActivity>();\n let frameRequested = false;\n let selectedId: number | undefined;\n\n const emit = <Type extends EventType>(type: Type, payload: Events[Type]) =>\n peers.forEach((peer) =>\n transport.post(\n peer,\n envelope({ kind: 'event', payload, session, type })\n )\n );\n\n const contextOf = (id: number) => {\n const ctx = ids.objectOf<ComponentContextPartial>(id);\n\n if (!ctx || isInspectableActivity(ctx) || !kindOf(ctx)) {\n throw new RequestError('unknown-id', `no instance has id ${id}`);\n }\n\n return ctx;\n };\n const activityOf = (id: number) => {\n const activity = ids.objectOf(id);\n\n if (!isInspectableActivity(activity)) {\n throw new RequestError('unknown-id', `no activity has id ${id}`);\n }\n\n return activity;\n };\n const encodeAt = (root: unknown, path: PathKey[]) => {\n const value = resolvePath(root, path);\n\n if (value === MISSING) {\n throw new RequestError(\n 'unknown-id',\n `nothing at ${path.join('.')}`\n );\n }\n\n return { value: inspector.encode(value) };\n };\n\n const watchActivity = (activity: InspectableActivity) => {\n if (watched.has(activity)) {\n return;\n }\n\n let initial = true;\n\n watched.set(\n activity,\n activity.watch(() => {\n if (initial) {\n initial = false;\n return;\n }\n\n activityChanges.add(activity);\n topics.has('perf') &&\n perf.commit(inspector.activityRecord(activity).name);\n requestFrame();\n })\n );\n };\n const unwatchAll = () => {\n watched.forEach((unwatch) => unwatch());\n watched.clear();\n };\n const watchListed = () =>\n inspector\n .listActivities()\n .forEach(({ id }) => watchActivity(activityOf(id)));\n\n const flush = () => {\n frameRequested = false;\n\n if (changed.size) {\n emit('tree.changed', {\n ids: Array.from(changed, (ctx) => ids.idOf(ctx))\n });\n changed.clear();\n topics.has('activities') && watchListed();\n }\n\n if (renders.length) {\n emit('renders', {\n entries: renders.map(({ ctx, ms }) => ({\n causeId: ctx.activity ? ids.idOf(ctx.activity) : undefined,\n id: ids.idOf(ctx),\n ms\n }))\n });\n topics.has('flash') &&\n renders.forEach(({ ctx }) => layer.flash(ctx));\n renders.length = 0;\n }\n\n activityChanges.forEach((activity) => {\n const { id, pending, value } = inspector.activityRecord(activity);\n\n emit('activity.changed', { id, pending, value });\n });\n activityChanges.clear();\n };\n // Batches per animation frame; the timer covers pages whose frames are\n // paused (a background tab behind a focused popup).\n const requestFrame = () => {\n if (!frameRequested) {\n frameRequested = true;\n\n const flushOnce = () => frameRequested && flush();\n\n view.requestAnimationFrame(flushOnce);\n view.setTimeout(flushOnce, FLUSH_FALLBACK_MS);\n }\n };\n\n const hook: DevtoolsHook = {\n activityCreated(activity) {\n inspector.noteCreated(activity);\n topics.has('activities') && watchActivity(activity);\n },\n rendered(ctx, ms) {\n topics.has('tree') && changed.add(ctx);\n (topics.has('renders') || topics.has('flash')) &&\n renders.push({ ctx, ms });\n topics.has('perf') && perf.render(nodeNameOf(ctx), ms);\n requestFrame();\n }\n };\n\n const setTopics = (next: Topic[]) => {\n topics.clear();\n next.forEach((topic) => FEATURES.includes(topic) && topics.add(topic));\n setDevtoolsHook(topics.size ? hook : null);\n topics.has('activities') ? watchListed() : unwatchAll();\n };\n\n const select = (ctx: ComponentContextPartial | undefined) => {\n selectedId = ctx && ids.idOf(ctx);\n layer.select(ctx);\n selectedId !== undefined && emit('selected', { id: selectedId });\n };\n\n const handlers: Handlers = {\n 'activity.inspect': ({ id, path = [] }) =>\n encodeAt(activityOf(id).value(), path),\n 'activity.list': () => ({ activities: inspector.listActivities() }),\n 'activity.reset': ({ id }) => {\n activityOf(id).reset();\n return {};\n },\n 'activity.update': ({ id, input }) => {\n const activity = activityOf(id);\n\n if (!isJsonValue(input)) {\n throw new RequestError(\n 'invalid-value',\n 'the input is not JSON'\n );\n }\n\n if (!isJsonValue(activity.value())) {\n throw new RequestError(\n 'not-editable',\n 'the value is not JSON-representable'\n );\n }\n\n activity.update(input);\n return {};\n },\n close: () => {\n hosts.close();\n return {};\n },\n highlight: ({ id }) => {\n layer.hover(id === null ? undefined : contextOf(id));\n return {};\n },\n log: ({ id }) => {\n const object = ids.objectOf(id);\n const logged = isInspectableActivity(object)\n ? object\n : inspectContext(contextOf(id));\n\n (view as unknown as { $loom: unknown }).$loom = logged;\n view.console.log('[loom] $loom =', logged);\n return {};\n },\n 'node.inspect': ({ id, path }) => {\n const ctx = contextOf(id);\n\n if (!path?.length) {\n return inspector.nodeDetails(ctx);\n }\n\n const [section, ...rest] = path;\n\n return encodeAt(\n section === 'owned' ? (ctx.owned?.values ?? []) : ctx.props,\n rest\n );\n },\n open: ({ placement }) => {\n hosts.open(placement);\n return {};\n },\n pick: ({ on }) => {\n on\n ? layer.startPicking({\n hover: () => undefined,\n pick: (ctx) => {\n ctx && select(ctx);\n emit('pick.ended', undefined);\n }\n })\n : layer.stopPicking();\n return {};\n },\n reveal: ({ id }) => {\n const { root } = contextOf(id);\n const node = Array.isArray(root) ? root[0] : root;\n\n (node?.nodeType === 1\n ? (node as Element)\n : node?.parentElement\n )?.scrollIntoView({\n block: 'center'\n });\n return {};\n },\n select: ({ id }) => {\n const ctx = id === null ? undefined : contextOf(id);\n\n selectedId = ctx ? id! : undefined;\n layer.select(ctx);\n return {};\n },\n subscribe: ({ topics: next }) => {\n setTopics(next);\n return {};\n },\n 'tree.get': () => inspector.tree()\n };\n\n const respond = (request: Envelope, source: Window) => {\n const reply = (fields: Pick<Envelope, 'error' | 'payload'>) =>\n transport.post(\n source,\n envelope({\n ...fields,\n id: request.id,\n kind: 'response',\n session,\n type: request.type\n })\n );\n\n try {\n if (request.protocol !== PROTOCOL_VERSION) {\n throw new RequestError(\n 'protocol-mismatch',\n `this page speaks devtools protocol ${PROTOCOL_VERSION}, not ${request.protocol}`\n );\n }\n\n if (request.type === 'hello') {\n peers.add(source);\n return reply({\n payload: {\n features: FEATURES,\n placement: hosts.placementOf(source),\n selectedId,\n session\n }\n });\n }\n\n if (!peers.has(source)) {\n throw new RequestError('not-connected', 'say hello first');\n }\n\n const handler = handlers[request.type as keyof Handlers] as\n ((payload: unknown) => unknown) | undefined;\n\n if (!handler) {\n throw new RequestError(\n 'unknown-type',\n `unknown request ${request.type}`\n );\n }\n\n reply({ payload: handler(request.payload) });\n } catch (error) {\n reply({\n error:\n error instanceof RequestError\n ? { code: error.code, message: error.message }\n : { code: 'unknown-type', message: String(error) }\n });\n }\n };\n\n const isPeer = (source: Window) =>\n hosts.isPeer(source) || !!acceptPeer?.(source);\n const stopListening = transport.listen(isPeer, (message, source) => {\n message.kind === 'request' && respond(message, source);\n });\n const sayGoodbye = () => emit('goodbye', undefined);\n\n view.addEventListener('pagehide', sayGoodbye);\n // Events buffered while devtools loaded: activities created during boot.\n takeBufferedEvents({\n activityCreated: hook.activityCreated,\n rendered: () => undefined\n });\n\n return {\n deactivate() {\n sayGoodbye();\n view.removeEventListener('pagehide', sayGoodbye);\n setDevtoolsHook(null);\n unwatchAll();\n stopListening();\n layer.destroy();\n hosts.close();\n removeFormatters();\n removeConsoleApi();\n peers.clear();\n },\n open(placement: Placement) {\n hosts.open(placement);\n },\n select\n };\n};\n\n/** Starts the backend in the current page \u2014 what core's switch calls. */\nexport const activate = (): DevtoolsBackend => createBackend(window);\n", "import type { Encoded, PathKey } from './types';\n\n/** How deep an encode inlines before leaving parts to path expansion. */\nexport const INLINE_DEPTH = 2;\n/** How many entries a collection inlines. */\nexport const ENTRY_CAP = 100;\n/** How long a string inlines before truncating. */\nexport const STRING_CAP = 500;\n\n// Recognizes values with a framework meaning (activities, DOM nodes,\n// component values) before the generic encoding applies.\nexport type DescribeSpecial = (value: unknown) => Encoded | undefined;\n\nconst encodeNumber = (value: number): Encoded => ({\n t: 'num',\n v: Number.isNaN(value)\n ? 'NaN'\n : value === Infinity\n ? 'Infinity'\n : value === -Infinity\n ? '-Infinity'\n : Object.is(value, -0)\n ? '-0'\n : value\n});\n\nconst constructorName = (value: object) => {\n const prototype = Object.getPrototypeOf(value);\n\n return prototype && prototype !== Object.prototype\n ? (prototype.constructor?.name as string | undefined)\n : undefined;\n};\n\n/**\n * Encodes a live value as a tagged, JSON-safe descriptor: inlined `depth`\n * levels deep, collections capped at `ENTRY_CAP` entries, strings at\n * `STRING_CAP` characters. Cycles and unreadable values become markers.\n * @param value The live value.\n * @param describeSpecial Recognizes framework values first.\n * @param depth Levels left to inline.\n * @param ancestors The objects on the current path (cycle detection).\n */\nexport const encodeValue = (\n value: unknown,\n describeSpecial: DescribeSpecial,\n depth = INLINE_DEPTH,\n ancestors: WeakSet<object> = new WeakSet()\n): Encoded => {\n try {\n const special = describeSpecial(value);\n\n if (special) {\n return special;\n }\n\n switch (typeof value) {\n case 'undefined':\n return { t: 'undefined' };\n case 'boolean':\n return { t: 'bool', v: value };\n case 'number':\n return encodeNumber(value);\n case 'bigint':\n return { t: 'bigint', v: String(value) };\n case 'symbol':\n return { t: 'symbol', v: value.description ?? '' };\n case 'string':\n return value.length > STRING_CAP\n ? {\n length: value.length,\n t: 'str',\n v: value.slice(0, STRING_CAP)\n }\n : { t: 'str', v: value };\n case 'function':\n return { name: value.name || 'anonymous', t: 'fn' };\n }\n\n if (value === null) {\n return { t: 'null' };\n }\n\n const object = value as object;\n\n if (ancestors.has(object)) {\n return { t: 'circular' };\n }\n\n if (object instanceof Date) {\n return { t: 'date', v: object.toISOString() };\n }\n\n if (object instanceof Error) {\n return { message: object.message, name: object.name, t: 'error' };\n }\n\n if (typeof (object as PromiseLike<unknown>).then === 'function') {\n return { t: 'promise' };\n }\n\n const nested = (child: unknown) =>\n encodeValue(child, describeSpecial, depth - 1, ancestors);\n // A throwing getter marks only its own entry.\n const nestedRead = (read: () => unknown): Encoded => {\n let child: unknown;\n\n try {\n child = read();\n } catch {\n return { t: 'unserializable' };\n }\n\n return nested(child);\n };\n const inline = depth > 0;\n\n ancestors.add(object);\n\n try {\n if (Array.isArray(object)) {\n return {\n items: inline\n ? object.slice(0, ENTRY_CAP).map(nested)\n : undefined,\n length: object.length,\n t: 'array'\n };\n }\n\n if (object instanceof Map || object instanceof Set) {\n const entries = Array.from(\n object instanceof Map ? object.entries() : object.values()\n ).slice(0, ENTRY_CAP);\n\n return {\n entries: inline\n ? entries.map((entry): [Encoded, Encoded] =>\n object instanceof Map\n ? [\n nested(\n (entry as [unknown, unknown])[0]\n ),\n nested((entry as [unknown, unknown])[1])\n ]\n : [{ t: 'undefined' }, nested(entry)]\n )\n : undefined,\n size: object.size,\n t: object instanceof Map ? 'map' : 'set'\n };\n }\n\n const keys = Object.keys(object);\n\n return {\n ctor: constructorName(object),\n entries: inline\n ? keys\n .slice(0, ENTRY_CAP)\n .map((key): [string, Encoded] => [\n key,\n nestedRead(\n () => (object as Record<string, unknown>)[key]\n )\n ])\n : undefined,\n size: keys.length,\n t: 'object'\n };\n } finally {\n ancestors.delete(object);\n }\n } catch {\n return { t: 'unserializable' };\n }\n};\n\n/** Marks a path that leads nowhere in the live value. */\nexport const MISSING = Symbol('loom-devtools.missing');\n\n/**\n * Follows a path of keys/indices into a live value: object keys, array\n * indices, and entry indices for maps (the value) and sets.\n * @param value The live root value.\n * @param path The keys to follow.\n * @returns The value at the path, or `MISSING`.\n */\nexport const resolvePath = (\n value: unknown,\n path: PathKey[]\n): unknown | typeof MISSING =>\n path.reduce<unknown>((current, key) => {\n if (\n current === MISSING ||\n current === null ||\n typeof current !== 'object'\n ) {\n return MISSING;\n }\n\n if (current instanceof Map || current instanceof Set) {\n const entry = Array.from(current.values())[Number(key)];\n\n return entry === undefined && Number(key) >= current.size\n ? MISSING\n : entry;\n }\n\n return key in current\n ? (current as Record<PathKey, unknown>)[key]\n : MISSING;\n }, value);\n", "// The devtools protocol: every message between the in-page backend and a\n// frontend (docked frame or popup window). JSON-safe throughout, so a relay\n// (e.g. a future browser extension) can carry it unchanged.\n\nexport const PROTOCOL_SOURCE = 'loom-devtools';\nexport const PROTOCOL_VERSION = 1;\n\nexport type MessageKind = 'event' | 'request' | 'response';\n\nexport type ErrorCode =\n | 'invalid-value'\n | 'not-connected'\n | 'not-editable'\n | 'protocol-mismatch'\n | 'unknown-id'\n | 'unknown-type';\n\nexport interface ProtocolError {\n code: ErrorCode;\n message: string;\n}\n\nexport interface Envelope<Payload = unknown> {\n error?: ProtocolError;\n id?: number;\n kind: MessageKind;\n payload?: Payload;\n protocol: number;\n session: string;\n source: typeof PROTOCOL_SOURCE;\n type: string;\n}\n\n/** An inspected value as a tagged descriptor (see `encodeValue`). */\nexport type Encoded =\n | { t: 'circular' | 'null' | 'promise' | 'undefined' | 'unserializable' }\n | { t: 'bool'; v: boolean }\n | { t: 'num'; v: number | '-0' | '-Infinity' | 'Infinity' | 'NaN' }\n | { length?: number; t: 'str'; v: string }\n | { t: 'bigint' | 'date' | 'symbol'; v: string }\n | { name: string; t: 'fn' }\n | { message: string; name: string; t: 'error' }\n | { items?: Encoded[]; length: number; t: 'array' }\n | {\n ctor?: string;\n entries?: [string, Encoded][];\n size: number;\n t: 'object';\n }\n | { entries?: [Encoded, Encoded][]; size: number; t: 'map' | 'set' }\n | { id?: number; t: 'node'; tag: string }\n | { id: number; name: string; t: 'activity' }\n | { name: string; t: 'component' };\n\n/** A key into an inspected value: an object key or a collection index. */\nexport type PathKey = number | string;\n\nexport type NodeKind = 'component' | 'effect';\n\nexport interface TreeNode {\n childIds: number[];\n id: number;\n key?: number | string;\n kind: NodeKind;\n name: string;\n parentId?: number;\n}\n\nexport interface ActivityRef {\n id: number;\n name: string;\n}\n\nexport interface ActivityRecord extends ActivityRef {\n editable: boolean;\n pending: boolean;\n subscriberIds: number[];\n value: Encoded;\n}\n\nexport interface NodeDetails {\n activities: ActivityRecord[];\n kind: NodeKind;\n lifeCycle: string | null;\n name: string;\n owned: Encoded;\n props: Encoded;\n refs: number;\n}\n\nexport type Topic = 'activities' | 'flash' | 'perf' | 'renders' | 'tree';\n\nexport type Placement = 'dock' | 'popup';\n\nexport interface HelloResponse {\n features: Topic[];\n placement: Placement | 'unknown';\n selectedId?: number;\n session: string;\n}\n\n/** Request payloads and their response payloads, by request type. */\nexport interface Requests {\n 'activity.inspect': [{ id: number; path?: PathKey[] }, { value: Encoded }];\n 'activity.list': [undefined, { activities: ActivityRecord[] }];\n 'activity.reset': [{ id: number }, {}];\n 'activity.update': [{ id: number; input: unknown }, {}];\n close: [undefined, {}];\n hello: [{ protocol: number }, HelloResponse];\n highlight: [{ id: number | null }, {}];\n log: [{ id: number }, {}];\n 'node.inspect': [\n { id: number; path?: PathKey[] },\n NodeDetails | { value: Encoded }\n ];\n open: [{ placement: Placement }, {}];\n pick: [{ on: boolean }, {}];\n reveal: [{ id: number }, {}];\n select: [{ id: number | null }, {}];\n subscribe: [{ topics: Topic[] }, {}];\n 'tree.get': [undefined, { nodes: TreeNode[]; rootIds: number[] }];\n}\n\nexport type RequestType = keyof Requests;\n\n/** Event payloads, by event type. */\nexport interface Events {\n 'activity.changed': { id: number; pending: boolean; value: Encoded };\n goodbye: undefined;\n 'pick.ended': undefined;\n renders: { entries: { causeId?: number; id: number; ms: number }[] };\n selected: { id: number };\n 'tree.changed': { ids: number[] };\n}\n\nexport type EventType = keyof Events;\n", "import {\n Envelope,\n PROTOCOL_SOURCE,\n PROTOCOL_VERSION,\n type MessageKind,\n type ProtocolError\n} from './types';\n\n/** Whether a value is a devtools protocol envelope. */\nexport const isEnvelope = (data: unknown): data is Envelope =>\n typeof data === 'object' &&\n data !== null &&\n (data as Envelope).source === PROTOCOL_SOURCE &&\n typeof (data as Envelope).type === 'string';\n\n/**\n * Builds one envelope.\n * @param fields The message's kind, type, session and optional parts.\n */\nexport const envelope = <Payload>(fields: {\n error?: ProtocolError;\n id?: number;\n kind: MessageKind;\n payload?: Payload;\n session: string;\n type: string;\n}): Envelope<Payload> => ({\n ...fields,\n protocol: PROTOCOL_VERSION,\n source: PROTOCOL_SOURCE\n});\n\nexport interface Transport {\n post(target: Window, message: Envelope): void;\n // Calls `onMessage` for envelopes from same-origin windows `isPeer`\n // accepts; returns the unsubscriber.\n listen(\n isPeer: (source: Window) => boolean,\n onMessage: (message: Envelope, source: Window) => void\n ): () => void;\n}\n\n/**\n * The `postMessage` transport for one window: posts with this window's\n * origin as the target, and accepts only same-origin envelopes from peers.\n * Uses `self.origin`, which an `about:srcdoc` / `about:blank` document\n * inherits \u2014 its `location.origin` reads `\"null\"`.\n * @param self The window the transport runs in.\n */\nexport const createTransport = (self: Window): Transport => ({\n listen(isPeer, onMessage) {\n const receive = ({ data, origin, source }: MessageEvent) => {\n source &&\n origin === self.origin &&\n isEnvelope(data) &&\n isPeer(source as Window) &&\n onMessage(data, source as Window);\n };\n\n self.addEventListener('message', receive);\n\n return () => self.removeEventListener('message', receive);\n },\n post(target, message) {\n target.postMessage(message, self.origin);\n }\n});\n", "// The `loom` console API \u2014 `tree()`, `inspect(node)`, `activities()` \u2014 lives\n// on the page's `loom` global while devtools runs, so core ships none of it.\nimport {\n inspectActivities,\n inspectNode,\n inspectTree\n} from '@loom-js/core/devtools';\n\nconst CONSOLE_API = {\n activities: inspectActivities,\n inspect: inspectNode,\n tree: inspectTree\n};\n\ntype ConsoleHost = { loom?: Record<string, unknown> };\n\n/**\n * Adds the console API to a window's `loom` global; returns the removal.\n * @param view The page window.\n */\nexport const installConsoleApi = (view: Window) => {\n const loom = (view as unknown as ConsoleHost).loom;\n\n loom && Object.assign(loom, CONSOLE_API);\n\n return () => {\n loom && Object.keys(CONSOLE_API).forEach((key) => delete loom[key]);\n };\n};\n", "// Custom console formatters (`window.devtoolsFormatters`, honored by\n// Chromium and Firefox consoles once \"custom formatters\" is enabled): loom\n// console-API records and activities log as their names, expandable to\n// their parts. Consoles without the setting show plain objects.\nimport {\n type ActivityRecord,\n type InspectRecord,\n describeActivity,\n isInspectRecord,\n isInspectableActivity\n} from '@loom-js/core/devtools';\n\ntype JsonML = [string, Record<string, unknown>, ...unknown[]];\n\ninterface Formatter {\n body(value: unknown): JsonML | null;\n hasBody(value: unknown): boolean;\n header(value: unknown): JsonML | null;\n}\n\nconst NAME_STYLE = 'color:#6d28d9;font-weight:600';\nconst KEY_STYLE = 'color:#0e7490';\nconst MUTED_STYLE = 'color:#6b7280';\n\n// A nested object reference the console renders with its own expander.\nconst objectRef = (object: unknown): JsonML => ['object', { object }];\n\nconst row = (label: string, value: unknown): JsonML => [\n 'li',\n {},\n ['span', { style: KEY_STYLE }, `${label}: `],\n objectRef(value)\n];\n\nconst recordHeader = ({ key, kind, name }: InspectRecord): JsonML => [\n 'span',\n {},\n [\n 'span',\n { style: NAME_STYLE },\n kind === 'effect' ? `${name} effect` : name\n ],\n ...(key !== undefined\n ? [['span', { style: KEY_STYLE }, ` key=${String(key)}`]]\n : [])\n];\n\nconst activityHeader = (\n name: string,\n value: unknown,\n pending: boolean\n): JsonML => [\n 'span',\n {},\n ['span', { style: NAME_STYLE }, name],\n ['span', { style: MUTED_STYLE }, pending ? ' (pending) = ' : ' = '],\n objectRef(value)\n];\n\nconst isActivityRecord = (value: unknown): value is ActivityRecord =>\n typeof value === 'object' &&\n value !== null &&\n isInspectableActivity((value as ActivityRecord).activity) &&\n 'name' in value;\n\nexport const loomFormatter: Formatter = {\n body(value) {\n if (isInspectRecord(value)) {\n return [\n 'ol',\n { style: 'list-style:none;margin:0;padding-left:12px' },\n ...(value.props ? [row('props', value.props)] : []),\n ...(value.activities.length\n ? [row('activities', value.activities)]\n : []),\n ...(value.parent ? [row('parent', value.parent)] : []),\n ...(value.children.length\n ? [row('children', value.children)]\n : []),\n row('node', value.node)\n ];\n }\n\n const activity = isActivityRecord(value) ? value.activity : value;\n\n return isInspectableActivity(activity)\n ? [\n 'ol',\n { style: 'list-style:none;margin:0;padding-left:12px' },\n row('value', activity.value()),\n row('handle', { ...activity })\n ]\n : null;\n },\n hasBody: (value) =>\n isInspectRecord(value) ||\n isActivityRecord(value) ||\n isInspectableActivity(value),\n header(value) {\n if (isInspectRecord(value)) {\n return recordHeader(value);\n }\n\n if (isActivityRecord(value)) {\n return activityHeader(value.name, value.value, value.pending);\n }\n\n if (isInspectableActivity(value)) {\n const { name, pending, value: current } = describeActivity(value);\n\n return activityHeader(name, current, pending);\n }\n\n return null;\n }\n};\n\ntype FormatterHost = { devtoolsFormatters?: Formatter[] };\n\n/**\n * Registers the loom formatter on a window; returns the unregister.\n * @param view The page window.\n */\nexport const installFormatters = (view: Window) => {\n const host = view as unknown as FormatterHost;\n const formatters = (host.devtoolsFormatters ??= []);\n\n formatters.push(loomFormatter);\n\n return () => {\n const index = formatters.indexOf(loomFormatter);\n\n index >= 0 && formatters.splice(index, 1);\n };\n};\n", "// The prebuilt HUD, inlined at build time (`scripts/build.mjs`): its script\n// bundles its own core, pink components and app; its style carries pink's\n// stylesheet and the HUD's own rules.\ndeclare const __LOOM_DEVTOOLS_FRONTEND_SCRIPT__: string;\ndeclare const __LOOM_DEVTOOLS_FRONTEND_STYLE__: string;\n\n/** The complete HUD document, for a frame's `srcdoc` or a popup. */\nexport const frontendDocument = () => `<!doctype html>\n<html lang=\"en\" class=\"theme-dark\">\n<head>\n<meta charset=\"utf-8\" />\n<title>loom devtools</title>\n<style>${__LOOM_DEVTOOLS_FRONTEND_STYLE__}</style>\n</head>\n<body>\n<div id=\"loom-devtools-hud\"></div>\n<script type=\"module\">${__LOOM_DEVTOOLS_FRONTEND_SCRIPT__}</script>\n</body>\n</html>`;\n", "// Where the HUD runs: a docked frame in the page or a popup window. Both\n// load the prebuilt frontend document, so the HUD never shares the page's\n// core instance, styles or component tree.\nimport { frontendDocument } from '../frontend-source';\nimport type { Placement } from '../protocol/types';\n\nconst POPUP_NAME = 'loom-devtools';\nexport const HUD_ROOT_ID = 'loom-devtools-hud';\n\nconst DOCK_STYLE = {\n background: '#19191c',\n border: '0',\n borderTop: '2px solid #6d28d9',\n bottom: '0',\n height: '40vh',\n left: '0',\n position: 'fixed',\n width: '100%',\n zIndex: '2147483645'\n};\n\nexport const createHosts = (view: Window) => {\n const doc = view.document;\n let dock: HTMLIFrameElement | undefined;\n let popup: Window | null = null;\n\n const closeDock = () => {\n dock?.remove();\n dock = undefined;\n };\n const openDock = () => {\n if (dock) {\n return;\n }\n\n dock = doc.createElement('iframe');\n dock.title = 'loom devtools';\n dock.srcdoc = frontendDocument();\n Object.assign(dock.style, DOCK_STYLE);\n doc.documentElement.append(dock);\n };\n // Reading another origin's document throws; such a window is never ours.\n const isSameOrigin = (opened: Window) => {\n try {\n return !!opened.document;\n } catch {\n return false;\n }\n };\n // Why the popup did not open, or `undefined` when it did.\n const openPopup = () => {\n const opened = view.open('', POPUP_NAME, 'popup,width=960,height=640');\n\n if (!opened) {\n return 'the browser blocked the popup';\n }\n\n if (!isSameOrigin(opened)) {\n return 'could not open the popup: a window from another origin holds its name';\n }\n\n popup = opened;\n closeDock();\n\n // A popup that survived a page reload already runs the frontend.\n if (!opened.document.getElementById(HUD_ROOT_ID)) {\n opened.document.open();\n opened.document.write(frontendDocument());\n opened.document.close();\n }\n\n opened.focus();\n\n return undefined;\n };\n\n return {\n close() {\n closeDock();\n popup?.close();\n popup = null;\n },\n // A window the backend talks to: its dock frame, its popup, or a\n // popup a previous load of this page opened.\n isPeer(source: Window) {\n try {\n return (\n source === dock?.contentWindow ||\n source === popup ||\n source.opener === view\n );\n } catch {\n return false;\n }\n },\n open(placement: Placement): Placement {\n if (placement === 'popup') {\n const failure = openPopup();\n\n if (!failure) {\n return 'popup';\n }\n\n console.info(\n `[loom] devtools: ${failure} \u2014 opened the dock instead; use its pop-out button.`\n );\n }\n\n openDock();\n\n return 'dock';\n },\n placementOf(source: Window): Placement | 'unknown' {\n return source === dock?.contentWindow\n ? 'dock'\n : source === popup || source.opener === view\n ? 'popup'\n : 'unknown';\n }\n };\n};\n\nexport type Hosts = ReturnType<typeof createHosts>;\n", "/**\n * Session-scoped numeric ids for live objects (contexts, activities):\n * assigned on first sight, stable for the object's lifetime, never reused,\n * and never keeping the object alive.\n */\nexport const createIdRegistry = () => {\n const ids = new WeakMap<object, number>();\n const objects = new Map<number, WeakRef<object>>();\n let lastId = 0;\n\n return {\n idOf(object: object) {\n let id = ids.get(object);\n\n if (id === undefined) {\n id = ++lastId;\n ids.set(object, id);\n objects.set(id, new WeakRef(object));\n }\n\n return id;\n },\n // The object behind an id, or `undefined` when unknown or collected.\n objectOf<T extends object>(id: number) {\n const object = objects.get(id)?.deref();\n\n object || objects.delete(id);\n\n return object as T | undefined;\n }\n };\n};\n\nexport type IdRegistry = ReturnType<typeof createIdRegistry>;\n", "// Reads the live app through core's introspection surface and describes it\n// in protocol terms: tree nodes, node details, activity records, encoded\n// values.\nimport {\n type ComponentContextPartial,\n type InspectableActivity,\n activitiesOf,\n childContextsOf,\n describeActivity,\n displayNameOf,\n findOwnerContext,\n getAppRoots,\n isInspectableActivity,\n kindOf,\n nodeNameOf\n} from '@loom-js/core/devtools';\n\nimport { type DescribeSpecial, encodeValue } from '../protocol/encode';\nimport type {\n ActivityRecord,\n Encoded,\n NodeDetails,\n TreeNode\n} from '../protocol/types';\nimport type { IdRegistry } from './ids';\n\ntype ContextFunctionValue = {\n (ctx?: ComponentContextPartial, dryRun?: boolean): ComponentContextPartial;\n contextFunctionKind?: 'activity' | 'component';\n};\n\n/**\n * Whether a value survives a JSON round trip unchanged \u2014 what activity\n * editing accepts and offers.\n * @param value Any value.\n */\nexport const isJsonValue = (value: unknown): boolean => {\n if (\n value === null ||\n typeof value === 'string' ||\n typeof value === 'boolean'\n ) {\n return true;\n }\n\n if (typeof value === 'number') {\n return Number.isFinite(value) && !Object.is(value, -0);\n }\n\n if (Array.isArray(value)) {\n return value.every(isJsonValue);\n }\n\n if (typeof value === 'object') {\n const prototype = Object.getPrototypeOf(value);\n\n return (\n (prototype === Object.prototype || prototype === null) &&\n Object.values(value).every(isJsonValue)\n );\n }\n\n return false;\n};\n\nexport const createInspector = (ids: IdRegistry) => {\n // Activities reported at creation \u2014 reachable even when no rendered\n // tree holds them.\n const createdActivities = new Set<WeakRef<InspectableActivity>>();\n const describeSpecial: DescribeSpecial = (value) => {\n if (isInspectableActivity(value)) {\n return {\n id: ids.idOf(value),\n name: describeActivity(value).name,\n t: 'activity'\n };\n }\n\n if (typeof Node !== 'undefined' && value instanceof Node) {\n const owner = findOwnerContext(value);\n const ownsRoot =\n owner &&\n (Array.isArray(owner.root)\n ? owner.root[0] === value\n : owner.root === value);\n\n return {\n id: ownsRoot ? ids.idOf(owner) : undefined,\n t: 'node',\n tag: value.nodeName.toLowerCase()\n };\n }\n\n const kind =\n typeof value === 'function' &&\n (value as ContextFunctionValue).contextFunctionKind;\n\n if (kind === 'component') {\n // A dry run returns a throwaway snapshot \u2014 it never renders.\n return {\n name: displayNameOf((value as ContextFunctionValue)({}, true)),\n t: 'component'\n };\n }\n\n return kind === 'activity'\n ? { name: 'activity effect', t: 'fn' }\n : undefined;\n };\n const encode = (value: unknown): Encoded =>\n encodeValue(value, describeSpecial);\n\n const walk = (visit: (ctx: ComponentContextPartial) => void) => {\n const step = (ctx: ComponentContextPartial) => {\n visit(ctx);\n childContextsOf(ctx).forEach(step);\n };\n\n getAppRoots()\n .filter((ctx) => kindOf(ctx))\n .forEach(step);\n };\n\n const activityRecord = (\n activity: InspectableActivity,\n subscriberIds: number[] = []\n ): ActivityRecord => {\n const { name, pending, value } = describeActivity(activity);\n\n return {\n editable: isJsonValue(value),\n id: ids.idOf(activity),\n name,\n pending,\n subscriberIds,\n value: encode(value)\n };\n };\n\n return {\n activityRecord,\n describeSpecial,\n encode,\n noteCreated(activity: InspectableActivity) {\n createdActivities.add(new WeakRef(activity));\n },\n // Every activity the tree uses or that was reported at creation,\n // with the ids of the component instances using it.\n listActivities(): ActivityRecord[] {\n const subscribers = new Map<InspectableActivity, number[]>();\n\n walk((ctx) =>\n (kindOf(ctx) === 'component' ? activitiesOf(ctx) : []).forEach(\n (activity) => {\n const nodeIds = subscribers.get(activity) ?? [];\n\n nodeIds.push(ids.idOf(ctx));\n subscribers.set(activity, nodeIds);\n }\n )\n );\n createdActivities.forEach((ref) => {\n const activity = ref.deref();\n\n activity\n ? subscribers.has(activity) || subscribers.set(activity, [])\n : createdActivities.delete(ref);\n });\n\n return Array.from(subscribers, ([activity, nodeIds]) =>\n activityRecord(activity, nodeIds)\n );\n },\n nodeDetails(ctx: ComponentContextPartial): NodeDetails {\n const kind = kindOf(ctx)!;\n\n return {\n activities: activitiesOf(ctx).map((activity) =>\n activityRecord(activity)\n ),\n kind,\n lifeCycle: ctx.lifeCycleState?.value ?? null,\n name: nodeNameOf(ctx),\n owned: encode(ctx.owned?.values ?? []),\n props: encode(kind === 'component' ? ctx.props : undefined),\n refs: ctx.refs?.size ?? 0\n };\n },\n tree() {\n const nodes: TreeNode[] = [];\n const rootIds: number[] = [];\n const toNode = (\n ctx: ComponentContextPartial,\n parentId?: number\n ) => {\n const id = ids.idOf(ctx);\n const children = childContextsOf(ctx);\n const node: TreeNode = {\n childIds: children.map((child) => ids.idOf(child)),\n id,\n kind: kindOf(ctx)!,\n name: nodeNameOf(ctx),\n parentId\n };\n\n ctx.key !== undefined && (node.key = ctx.key);\n nodes.push(node);\n children.forEach((child) => toNode(child, id));\n };\n\n getAppRoots()\n .filter((ctx) => kindOf(ctx))\n .forEach((ctx) => {\n rootIds.push(ids.idOf(ctx));\n toNode(ctx);\n });\n\n return { nodes, rootIds };\n },\n walk\n };\n};\n\nexport type Inspector = ReturnType<typeof createInspector>;\n", "// The backend's drawing surface in the inspected page: hover and selection\n// outlines, render flashes and the element picker. Plain DOM in a closed\n// shadow root outside every app root, so the tree walk never sees it and\n// app styles never reach it.\nimport {\n type ComponentContextPartial,\n findOwnerContext\n} from '@loom-js/core/devtools';\n\nconst LAYER_STYLE = `\n:host { all: initial; }\n.box {\n position: fixed;\n pointer-events: none;\n box-sizing: border-box;\n z-index: 2147483646;\n}\n.hover { background: rgb(109 40 217 / 0.15); outline: 1px solid rgb(109 40 217 / 0.9); }\n.selected { outline: 2px solid rgb(109 40 217); }\n.flash { outline: 2px solid rgb(14 116 144); animation: fade 600ms ease-out forwards; }\n.label {\n position: fixed;\n pointer-events: none;\n z-index: 2147483647;\n font: 600 11px/1.6 ui-monospace, monospace;\n color: #fff;\n background: rgb(109 40 217);\n padding: 0 4px;\n border-radius: 2px;\n}\n@keyframes fade { to { opacity: 0; } }\n`;\n\n// The page-space rectangle around a context's rendered nodes.\nconst boundsOf = (ctx: ComponentContextPartial): DOMRect | undefined => {\n const roots = Array.isArray(ctx.root)\n ? ctx.root\n : ctx.root\n ? [ctx.root]\n : [];\n const rects = roots\n .flatMap((node) => {\n if (node.nodeType === 1) {\n return [(node as Element).getBoundingClientRect()];\n }\n\n const range = node.ownerDocument!.createRange();\n\n range.selectNode(node);\n\n return [range.getBoundingClientRect()];\n })\n .filter(({ height, width }) => width || height);\n\n if (!rects.length) {\n return undefined;\n }\n\n const left = Math.min(...rects.map((rect) => rect.left));\n const top = Math.min(...rects.map((rect) => rect.top));\n const right = Math.max(...rects.map((rect) => rect.right));\n const bottom = Math.max(...rects.map((rect) => rect.bottom));\n\n return new DOMRect(left, top, right - left, bottom - top);\n};\n\nexport interface PickerCallbacks {\n // The owner under the pointer changed.\n hover(ctx: ComponentContextPartial | undefined): void;\n // The user clicked an owner (or pressed Escape, with `undefined`).\n pick(ctx: ComponentContextPartial | undefined): void;\n}\n\nexport const createPageLayer = (\n doc: Document,\n nameOf: (ctx: ComponentContextPartial) => string\n) => {\n const host = doc.createElement('loom-devtools-layer');\n const shadow = host.attachShadow({ mode: 'closed' });\n const style = doc.createElement('style');\n let hoverBox: HTMLElement | undefined;\n let selectedBox: HTMLElement | undefined;\n let label: HTMLElement | undefined;\n let selected: ComponentContextPartial | undefined;\n let stopPicking: (() => void) | undefined;\n\n style.textContent = LAYER_STYLE;\n shadow.append(style);\n doc.documentElement.append(host);\n\n const place = (box: HTMLElement, rect: DOMRect) => {\n Object.assign(box.style, {\n height: `${rect.height}px`,\n left: `${rect.left}px`,\n top: `${rect.top}px`,\n width: `${rect.width}px`\n });\n };\n const drawBox = (\n existing: HTMLElement | undefined,\n className: string,\n ctx: ComponentContextPartial | undefined\n ) => {\n const rect = ctx && boundsOf(ctx);\n\n if (!rect) {\n existing?.remove();\n return undefined;\n }\n\n const box = existing ?? doc.createElement('div');\n\n box.className = `box ${className}`;\n place(box, rect);\n box.isConnected || shadow.append(box);\n\n return box;\n };\n const showHover = (ctx: ComponentContextPartial | undefined) => {\n hoverBox = drawBox(hoverBox, 'hover', ctx);\n\n const rect = ctx && hoverBox && boundsOf(ctx);\n\n if (!ctx || !rect) {\n label?.remove();\n label = undefined;\n return;\n }\n\n label ??= doc.createElement('div');\n label.className = 'label';\n label.textContent = nameOf(ctx);\n Object.assign(label.style, {\n left: `${rect.left}px`,\n top: `${Math.max(rect.top - 18, 0)}px`\n });\n label.isConnected || shadow.append(label);\n };\n // Keeps the selection outline on its instance through scrolls/resizes.\n const redrawSelection = () => {\n selectedBox = drawBox(selectedBox, 'selected', selected);\n };\n const view = doc.defaultView!;\n\n view.addEventListener('scroll', redrawSelection, true);\n view.addEventListener('resize', redrawSelection);\n\n return {\n destroy() {\n stopPicking?.();\n view.removeEventListener('scroll', redrawSelection, true);\n view.removeEventListener('resize', redrawSelection);\n host.remove();\n },\n flash(ctx: ComponentContextPartial) {\n const box = drawBox(undefined, 'flash', ctx);\n\n box?.addEventListener('animationend', () => box.remove(), {\n once: true\n });\n },\n hover: showHover,\n select(ctx: ComponentContextPartial | undefined) {\n selected = ctx;\n redrawSelection();\n },\n // Outlines the owner under the pointer; a click selects it and never\n // reaches the app. Escape cancels.\n startPicking({ hover, pick }: PickerCallbacks) {\n stopPicking?.();\n\n const ownerAt = (event: Event) => {\n const target = event.composedPath()[0];\n\n return target instanceof Node\n ? findOwnerContext(target)\n : undefined;\n };\n const swallow = (event: Event) => {\n event.preventDefault();\n event.stopImmediatePropagation();\n };\n const onMove = (event: Event) => {\n const ctx = ownerAt(event);\n\n showHover(ctx);\n hover(ctx);\n };\n const onClick = (event: Event) => {\n swallow(event);\n finish(ownerAt(event));\n };\n const onKey = (event: KeyboardEvent) => {\n event.key === 'Escape' && (swallow(event), finish(undefined));\n };\n const swallowed = [\n 'pointerdown',\n 'mousedown',\n 'pointerup',\n 'mouseup'\n ];\n const finish = (ctx: ComponentContextPartial | undefined) => {\n stopPicking?.();\n pick(ctx);\n };\n\n view.addEventListener('pointermove', onMove, true);\n view.addEventListener('click', onClick, true);\n view.addEventListener('keydown', onKey, true);\n swallowed.forEach((type) =>\n view.addEventListener(type, swallow, true)\n );\n stopPicking = () => {\n stopPicking = undefined;\n view.removeEventListener('pointermove', onMove, true);\n view.removeEventListener('click', onClick, true);\n view.removeEventListener('keydown', onKey, true);\n swallowed.forEach((type) =>\n view.removeEventListener(type, swallow, true)\n );\n showHover(undefined);\n };\n },\n stopPicking() {\n stopPicking?.();\n }\n };\n};\n\nexport type PageLayer = ReturnType<typeof createPageLayer>;\n", "// Chrome's Performance-panel extensibility API: `performance.measure` with\n// `detail.devtools` lands an entry on a custom track. Other browsers record\n// a plain user-timing measure. Entries are cleared right after recording \u2014\n// the trace already holds them, and the timeline buffer must not grow.\nconst TRACK_GROUP = 'loom';\n\nconst measure = (\n perf: Performance,\n name: string,\n start: number,\n end: number,\n track: string,\n color: string,\n tooltipText: string\n) => {\n try {\n perf.measure(name, {\n detail: {\n devtools: {\n color,\n dataType: 'track-entry',\n tooltipText,\n track,\n trackGroup: TRACK_GROUP\n }\n },\n end,\n start\n });\n perf.clearMeasures(name);\n } catch {\n // A measure is diagnostic only \u2014 never let it break a render.\n }\n};\n\nexport const createPerfTracks = (\n perf: Performance = globalThis.performance\n) => ({\n // An instance render that took `ms`, ending now.\n render(name: string, ms: number) {\n const end = perf.now();\n\n measure(\n perf,\n name,\n end - ms,\n end,\n 'Renders',\n 'primary',\n `${name} rendered in ${ms.toFixed(2)}ms`\n );\n },\n // An activity commit, as an instant on its own track.\n commit(name: string) {\n const at = perf.now();\n\n measure(\n perf,\n `${name} commit`,\n at,\n at + 0.01,\n 'Activities',\n 'secondary',\n `${name} committed`\n );\n }\n});\n\nexport type PerfTracks = ReturnType<typeof createPerfTracks>;\n"],
|
|
5
|
+
"mappings": "AAGA,OAKI,kBAAAA,GACA,yBAAAC,EACA,UAAAC,GACA,cAAAC,GACA,mBAAAC,GACA,sBAAAC,OACG,yBCDP,IAAMC,GAAgBC,IAA4B,CAC9C,EAAG,MACH,EAAG,OAAO,MAAMA,CAAK,EACf,MACAA,IAAU,IACR,WACAA,IAAU,KACR,YACA,OAAO,GAAGA,EAAO,EAAE,EACjB,KACAA,CAChB,GAEMC,GAAmBD,GAAkB,CACvC,IAAME,EAAY,OAAO,eAAeF,CAAK,EAE7C,OAAOE,GAAaA,IAAc,OAAO,UAClCA,EAAU,aAAa,KACxB,MACV,EAWaC,EAAc,CACvBH,EACAI,EACAC,EAAQ,EACRC,EAA6B,IAAI,UACvB,CACV,GAAI,CACA,IAAMC,EA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AAQ,IAAI,EACnC,EAGJE,EAAM,CAAE,QAASE,EAAQJ,EAAQ,OAAO,CAAE,CAAC,CAC/C,OAASK,EAAO,CACZH,EAAM,CACF,MACIG,aAAiBpF,EACX,CAAE,KAAMoF,EAAM,KAAM,QAASA,EAAM,OAAQ,EAC3C,CAAE,KAAM,eAAgB,QAAS,OAAOA,CAAK,CAAE,CAC7D,CAAC,CACL,CACJ,EAEMC,GAAUL,GACZjE,EAAM,OAAOiE,CAAM,GAAK,CAAC,CAAC1E,IAAa0E,CAAM,EAC3CM,GAAgBrE,EAAU,OAAOoE,GAAQ,CAACnF,EAAS8E,IAAW,CAChE9E,EAAQ,OAAS,WAAa4E,GAAQ5E,EAAS8E,CAAM,CACzD,CAAC,EACKO,EAAa,IAAMtD,EAAK,UAAW,MAAS,EAElD,OAAA5B,EAAK,iBAAiB,WAAYkF,CAAU,EAE5CC,GAAmB,CACf,gBAAiB3B,EAAK,gBACtB,SAAU,IAAG,EACjB,CAAC,EAEM,CACH,YAAa,CACT0B,EAAW,EACXlF,EAAK,oBAAoB,WAAYkF,CAAU,EAC/CtB,GAAgB,IAAI,EACpBX,EAAW,EACXgC,GAAc,EACd1E,EAAM,QAAQ,EACdG,EAAM,MAAM,EACZM,EAAiB,EACjBE,EAAiB,EACjBE,EAAM,MAAM,CAChB,EACA,KAAKkD,EAAsB,CACvB5D,EAAM,KAAK4D,CAAS,CACxB,EACA,OAAAT,CACJ,CACJ,EAGauB,GAAW,IAAuBrF,GAAc,MAAM",
|
|
6
|
+
"names": ["inspectContext", "isInspectableActivity", "kindOf", "nodeNameOf", "setDevtoolsHook", "takeBufferedEvents", "encodeNumber", "value", "constructorName", "prototype", "encodeValue", "describeSpecial", "depth", "ancestors", "special", "object", "nested", "child", "nestedRead", "read", "inline", "entries", "entry", "keys", "key", "MISSING", "resolvePath", "path", "current", "PROTOCOL_SOURCE", "isEnvelope", "data", "PROTOCOL_SOURCE", "envelope", "fields", "createTransport", "self", "isPeer", "onMessage", "receive", "origin", "source", "target", "message", "inspectActivities", "inspectNode", "inspectTree", "CONSOLE_API", "installConsoleApi", "view", "loom", "key", "describeActivity", "isInspectRecord", "isInspectableActivity", "NAME_STYLE", "KEY_STYLE", "MUTED_STYLE", "objectRef", "object", "row", "label", "value", "recordHeader", "key", "kind", "name", "activityHeader", "pending", "isActivityRecord", "loomFormatter", "activity", "current", "installFormatters", "view", "host", "formatters", "index", "frontendDocument", "POPUP_NAME", "HUD_ROOT_ID", "DOCK_STYLE", "createHosts", "view", "doc", "dock", "popup", "closeDock", "openDock", "frontendDocument", "isSameOrigin", "opened", "openPopup", "source", "placement", "failure", "createIdRegistry", "ids", "objects", "lastId", "object", "id", "activitiesOf", "childContextsOf", "describeActivity", "displayNameOf", "findOwnerContext", "getAppRoots", "isInspectableActivity", "kindOf", "nodeNameOf", "isJsonValue", "value", "prototype", "createInspector", "ids", "createdActivities", "describeSpecial", "isInspectableActivity", "describeActivity", "owner", "findOwnerContext", "kind", "displayNameOf", "encode", "encodeValue", "walk", "visit", "step", "ctx", "childContextsOf", "getAppRoots", "kindOf", "activityRecord", "activity", "subscriberIds", "name", "pending", "subscribers", "activitiesOf", "nodeIds", "ref", "nodeNameOf", "nodes", "rootIds", "toNode", "parentId", "id", "children", "node", "child", "findOwnerContext", "LAYER_STYLE", "boundsOf", "ctx", "rects", "node", "range", "height", "width", "left", "rect", "top", "right", "bottom", "createPageLayer", "doc", "nameOf", "host", "shadow", "style", "hoverBox", "selectedBox", "label", "selected", "stopPicking", "place", "box", "drawBox", "existing", "className", "showHover", "redrawSelection", "view", "hover", "pick", "ownerAt", "event", "target", "swallow", "onMove", "onClick", "finish", "onKey", "swallowed", "type", "TRACK_GROUP", "measure", "perf", "name", "start", "end", "track", "color", "tooltipText", "createPerfTracks", "ms", "at", "FEATURES", "FLUSH_FALLBACK_MS", "RequestError", "code", "message", "randomSession", "createBackend", "view", "acceptPeer", "session", "ids", "createIdRegistry", "inspector", "createInspector", "layer", "createPageLayer", "nodeNameOf", "hosts", "createHosts", "transport", "createTransport", "perf", "createPerfTracks", "removeFormatters", "installFormatters", "removeConsoleApi", "installConsoleApi", "peers", "topics", "watched", "changed", "renders", "activityChanges", "frameRequested", "selectedId", "emit", "type", "payload", "peer", "envelope", "contextOf", "id", "ctx", "isInspectableActivity", "kindOf", "activityOf", "activity", "encodeAt", "root", "path", "value", "resolvePath", "MISSING", "watchActivity", "initial", "requestFrame", "unwatchAll", "unwatch", "watchListed", "flush", "ms", "pending", "flushOnce", "hook", "setTopics", "next", "topic", "setDevtoolsHook", "select", "handlers", "input", "isJsonValue", "object", "logged", "inspectContext", "section", "rest", "placement", "on", "node", "respond", "request", "source", "reply", "fields", "handler", "error", "isPeer", "stopListening", "sayGoodbye", "takeBufferedEvents", "activate"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"console-api.d.ts","sourceRoot":"","sources":["../../../src/backend/console-api.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,eAAO,MAAM,iBAAiB,SAAU,MAAM,eAQ7C,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type JsonML = [string, Record<string, unknown>, ...unknown[]];
|
|
2
|
+
interface Formatter {
|
|
3
|
+
body(value: unknown): JsonML | null;
|
|
4
|
+
hasBody(value: unknown): boolean;
|
|
5
|
+
header(value: unknown): JsonML | null;
|
|
6
|
+
}
|
|
7
|
+
export declare const loomFormatter: Formatter;
|
|
8
|
+
/**
|
|
9
|
+
* Registers the loom formatter on a window; returns the unregister.
|
|
10
|
+
* @param view The page window.
|
|
11
|
+
*/
|
|
12
|
+
export declare const installFormatters: (view: Window) => () => void;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=formatters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatters.d.ts","sourceRoot":"","sources":["../../../src/backend/formatters.ts"],"names":[],"mappings":"AAYA,KAAK,MAAM,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;AAE9D,UAAU,SAAS;IACf,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC;IACpC,OAAO,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC;IACjC,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC;CACzC;AA+CD,eAAO,MAAM,aAAa,EAAE,SAkD3B,CAAC;AAIF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,SAAU,MAAM,eAW7C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Placement } from '../protocol/types';
|
|
2
|
+
export declare const HUD_ROOT_ID = "loom-devtools-hud";
|
|
3
|
+
export declare const createHosts: (view: Window) => {
|
|
4
|
+
close(): void;
|
|
5
|
+
isPeer(source: Window): boolean;
|
|
6
|
+
open(placement: Placement): Placement;
|
|
7
|
+
placementOf(source: Window): Placement | 'unknown';
|
|
8
|
+
};
|
|
9
|
+
export type Hosts = ReturnType<typeof createHosts>;
|
|
10
|
+
//# sourceMappingURL=hosts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hosts.d.ts","sourceRoot":"","sources":["../../../src/backend/hosts.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGnD,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAc/C,eAAO,MAAM,WAAW,SAAU,MAAM;IAwDhC,KAAK;IAOL,MAAM,SAAS,MAAM;IAWrB,IAAI,YAAY,SAAS,GAAG,SAAS;IAiBrC,WAAW,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS;CAQzD,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Session-scoped numeric ids for live objects (contexts, activities):
|
|
3
|
+
* assigned on first sight, stable for the object's lifetime, never reused,
|
|
4
|
+
* and never keeping the object alive.
|
|
5
|
+
*/
|
|
6
|
+
export declare const createIdRegistry: () => {
|
|
7
|
+
idOf(object: object): number;
|
|
8
|
+
objectOf<T extends object>(id: number): T | undefined;
|
|
9
|
+
};
|
|
10
|
+
export type IdRegistry = ReturnType<typeof createIdRegistry>;
|
|
11
|
+
//# sourceMappingURL=ids.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ids.d.ts","sourceRoot":"","sources":["../../../src/backend/ids.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;IAMrB,IAAI,SAAS,MAAM;IAYnB,QAAQ,CAAC,CAAC,SAAS,MAAM,MAAM,MAAM,GAKhB,CAAC,GAAG,SAAS;CAGzC,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type DevtoolsBackend } from '@loom-js/core/devtools';
|
|
2
|
+
export interface BackendOptions {
|
|
3
|
+
acceptPeer?(source: Window): boolean;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Starts a backend in a page: the protocol endpoint, the page layer and the
|
|
7
|
+
* console formatters.
|
|
8
|
+
* @param view The inspected page's window.
|
|
9
|
+
* @param options Extra peer acceptance (test harnesses).
|
|
10
|
+
* @returns The running backend.
|
|
11
|
+
*/
|
|
12
|
+
export declare const createBackend: (view: Window & typeof globalThis, { acceptPeer }?: BackendOptions) => DevtoolsBackend;
|
|
13
|
+
/** Starts the backend in the current page — what core's switch calls. */
|
|
14
|
+
export declare const activate: () => DevtoolsBackend;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/backend/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAEH,KAAK,eAAe,EASvB,MAAM,wBAAwB,CAAC;AA6ChC,MAAM,WAAW,cAAc;IAE3B,UAAU,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC;CACxC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,SAChB,MAAM,GAAG,OAAO,UAAU,mBAChB,cAAc,KAC/B,eAiWF,CAAC;AAEF,yEAAyE;AACzE,eAAO,MAAM,QAAQ,QAAO,eAAwC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ComponentContextPartial, type InspectableActivity } from '@loom-js/core/devtools';
|
|
2
|
+
import { type DescribeSpecial } from '../protocol/encode';
|
|
3
|
+
import type { ActivityRecord, Encoded, NodeDetails, TreeNode } from '../protocol/types';
|
|
4
|
+
import type { IdRegistry } from './ids';
|
|
5
|
+
/**
|
|
6
|
+
* Whether a value survives a JSON round trip unchanged — what activity
|
|
7
|
+
* editing accepts and offers.
|
|
8
|
+
* @param value Any value.
|
|
9
|
+
*/
|
|
10
|
+
export declare const isJsonValue: (value: unknown) => boolean;
|
|
11
|
+
export declare const createInspector: (ids: IdRegistry) => {
|
|
12
|
+
activityRecord: (activity: InspectableActivity, subscriberIds?: number[]) => ActivityRecord;
|
|
13
|
+
describeSpecial: DescribeSpecial;
|
|
14
|
+
encode: (value: unknown) => Encoded;
|
|
15
|
+
noteCreated(activity: InspectableActivity): void;
|
|
16
|
+
listActivities(): ActivityRecord[];
|
|
17
|
+
nodeDetails(ctx: ComponentContextPartial): NodeDetails;
|
|
18
|
+
tree(): {
|
|
19
|
+
nodes: TreeNode[];
|
|
20
|
+
rootIds: number[];
|
|
21
|
+
};
|
|
22
|
+
walk: (visit: (ctx: ComponentContextPartial) => void) => void;
|
|
23
|
+
};
|
|
24
|
+
export type Inspector = ReturnType<typeof createInspector>;
|
|
25
|
+
//# sourceMappingURL=inspect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inspect.d.ts","sourceRoot":"","sources":["../../../src/backend/inspect.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EAU3B,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,KAAK,eAAe,EAAe,MAAM,oBAAoB,CAAC;AACvE,OAAO,KAAK,EACR,cAAc,EACd,OAAO,EACP,WAAW,EACX,QAAQ,EACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAOxC;;;;GAIG;AACH,eAAO,MAAM,WAAW,UAAW,OAAO,KAAG,OA2B5C,CAAC;AAEF,eAAO,MAAM,eAAe,QAAS,UAAU;+BA2D7B,mBAAmB,kBACd,MAAM,EAAE,KACxB,cAAc;;oBAjBM,OAAO,KAAG,OAAO;0BAkCd,mBAAmB;sBAKvB,cAAc,EAAE;qBAyBjB,uBAAuB,GAAG,WAAW;;;;;kBA7DrC,CAAC,GAAG,EAAE,uBAAuB,KAAK,IAAI;CA6G9D,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ComponentContextPartial } from '@loom-js/core/devtools';
|
|
2
|
+
export interface PickerCallbacks {
|
|
3
|
+
hover(ctx: ComponentContextPartial | undefined): void;
|
|
4
|
+
pick(ctx: ComponentContextPartial | undefined): void;
|
|
5
|
+
}
|
|
6
|
+
export declare const createPageLayer: (doc: Document, nameOf: (ctx: ComponentContextPartial) => string) => {
|
|
7
|
+
destroy(): void;
|
|
8
|
+
flash(ctx: ComponentContextPartial): void;
|
|
9
|
+
hover: (ctx: ComponentContextPartial | undefined) => void;
|
|
10
|
+
select(ctx: ComponentContextPartial | undefined): void;
|
|
11
|
+
startPicking({ hover, pick }: PickerCallbacks): void;
|
|
12
|
+
stopPicking(): void;
|
|
13
|
+
};
|
|
14
|
+
export type PageLayer = ReturnType<typeof createPageLayer>;
|
|
15
|
+
//# sourceMappingURL=page-layer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-layer.d.ts","sourceRoot":"","sources":["../../../src/backend/page-layer.ts"],"names":[],"mappings":"AAIA,OAAO,EACH,KAAK,uBAAuB,EAE/B,MAAM,wBAAwB,CAAC;AA2DhC,MAAM,WAAW,eAAe;IAE5B,KAAK,CAAC,GAAG,EAAE,uBAAuB,GAAG,SAAS,GAAG,IAAI,CAAC;IAEtD,IAAI,CAAC,GAAG,EAAE,uBAAuB,GAAG,SAAS,GAAG,IAAI,CAAC;CACxD;AAED,eAAO,MAAM,eAAe,QACnB,QAAQ,UACL,CAAC,GAAG,EAAE,uBAAuB,KAAK,MAAM;IAyE5C,OAAO;IAMP,KAAK,MAAM,uBAAuB;IAOlC,KAAK,QA3Ce,uBAAuB,GAAG,SAAS;IA4CvD,MAAM,MAAM,uBAAuB,GAAG,SAAS;IAM/C,YAAY,kBAAkB,eAAe;IAuD7C,WAAW;CAIlB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../../../src/backend/perf.ts"],"names":[],"mappings":"AAmCA,eAAO,MAAM,gBAAgB,UACnB,WAAW;IAGjB,MAAM,OAAO,MAAM,MAAM,MAAM;IAc/B,MAAM,OAAO,MAAM;CAarB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type Events, type EventType, type HelloResponse, type ProtocolError, type Requests, type RequestType } from '../protocol/types';
|
|
2
|
+
export declare class ClientError extends Error {
|
|
3
|
+
readonly error: ProtocolError;
|
|
4
|
+
constructor(error: ProtocolError);
|
|
5
|
+
}
|
|
6
|
+
type Listener<Type extends EventType> = (payload: Events[Type]) => void;
|
|
7
|
+
export declare const createClient: (view: Window, peer: Window) => {
|
|
8
|
+
connect: () => void;
|
|
9
|
+
on<Type extends EventType>(type: Type, listener: Listener<Type>): void;
|
|
10
|
+
onConnected(listener: (hello: HelloResponse) => void): void;
|
|
11
|
+
onDisconnected(listener: (error?: ProtocolError) => void): void;
|
|
12
|
+
request: <Type extends RequestType>(type: Type, payload?: Requests[Type][0]) => Promise<Requests[Type][1]>;
|
|
13
|
+
};
|
|
14
|
+
export type Client = ReturnType<typeof createClient>;
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/frontend/client.ts"],"names":[],"mappings":"AAIA,OAAO,EAEH,KAAK,MAAM,EACX,KAAK,SAAS,EACd,KAAK,aAAa,EAElB,KAAK,aAAa,EAClB,KAAK,QAAQ,EACb,KAAK,WAAW,EACnB,MAAM,mBAAmB,CAAC;AAI3B,qBAAa,WAAY,SAAQ,KAAK;IACtB,QAAQ,CAAC,KAAK,EAAE,aAAa;IAAzC,YAAqB,KAAK,EAAE,aAAa,EAExC;CACJ;AAED,KAAK,QAAQ,CAAC,IAAI,SAAS,SAAS,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC;AAExE,eAAO,MAAM,YAAY,SAAU,MAAM,QAAQ,MAAM;;OA8H5C,IAAI,SAAS,SAAS,QAAQ,IAAI,YAAY,QAAQ,CAAC,IAAI,CAAC;0BAMzC,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI;6BAG3B,CAAC,KAAK,CAAC,EAAE,aAAa,KAAK,IAAI;cAjE3C,IAAI,SAAS,WAAW,QAC/B,IAAI,YACA,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;CAoElC,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
interface Watchable<V> {
|
|
2
|
+
value(): V;
|
|
3
|
+
watch(action: (valueProp: {
|
|
4
|
+
value: V;
|
|
5
|
+
}) => unknown): () => void;
|
|
6
|
+
}
|
|
7
|
+
type Values<Sources extends Watchable<any>[]> = {
|
|
8
|
+
[Index in keyof Sources]: Sources[Index] extends Watchable<infer V> ? V : never;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* An activity computed from several others, recomputed whenever any of them
|
|
12
|
+
* updates — so one effect can render from all of them.
|
|
13
|
+
* @param sources The activities to read.
|
|
14
|
+
* @param compute Builds the derived value from their current values.
|
|
15
|
+
*/
|
|
16
|
+
export declare const derive: <Sources extends Watchable<any>[], Result>(sources: [...Sources], compute: (...values: Values<Sources>) => Result) => {
|
|
17
|
+
bind(select?: ((bindValue: Result) => import("@loom-js/core").TemplateTagValue) | undefined): import("@loom-js/core").AttrBinding<Result>;
|
|
18
|
+
effect(action: import("@loom-js/core").ActivityEffectAction<Result>): ((ctx?: Partial<import("@loom-js/core").ComponentContext<{}>>) => Partial<import("@loom-js/core").ComponentContext<{}>>) & {
|
|
19
|
+
contextFunctionKind: "activity";
|
|
20
|
+
};
|
|
21
|
+
initialValue: Result;
|
|
22
|
+
reset: () => void;
|
|
23
|
+
update(valueInput: Result, forceUpdate?: boolean): void;
|
|
24
|
+
value: () => Result;
|
|
25
|
+
watch(action: (valueProp: import("@loom-js/core").ValueProp<Result>) => any): import("@loom-js/core").Unsubscriber;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
28
|
+
//# sourceMappingURL=derive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derive.d.ts","sourceRoot":"","sources":["../../../src/frontend/derive.ts"],"names":[],"mappings":"AAEA,UAAU,SAAS,CAAC,CAAC;IACjB,KAAK,IAAI,CAAC,CAAC;IACX,KAAK,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE;QAAE,KAAK,EAAE,CAAC,CAAA;KAAE,KAAK,OAAO,GAAG,MAAM,IAAI,CAAC;CACnE;AAED,KAAK,MAAM,CAAC,OAAO,SAAS,SAAS,CAAC,GAAG,CAAC,EAAE,IAAI;KAC3C,KAAK,IAAI,MAAM,OAAO,GAAG,OAAO,CAAC,KAAK,CAAC,SAAS,SAAS,CAAC,MAAM,CAAC,CAAC,GAC7D,CAAC,GACD,KAAK;CACd,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,MAAM,GAAI,OAAO,SAAS,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,MAAM,WAClD,CAAC,GAAG,OAAO,CAAC,WACZ,CAAC,GAAG,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,KAAK,MAAM;;;;;;;;;;CAYlD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/frontend/index.ts"],"names":[],"mappings":"AAGA,OAAO,wBAAwB,CAAC;AAIhC,OAAO,cAAc,CAAC"}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import type { ActivityRecord, Encoded, NodeDetails, PathKey, Placement, TreeNode } from '../protocol/types';
|
|
2
|
+
import type { Client } from './client';
|
|
3
|
+
export type Tab = 'activities' | 'components';
|
|
4
|
+
export interface Connection {
|
|
5
|
+
message?: string;
|
|
6
|
+
placement: Placement | 'unknown';
|
|
7
|
+
status: 'connected' | 'connecting' | 'refused';
|
|
8
|
+
}
|
|
9
|
+
export interface TreeState {
|
|
10
|
+
nodes: Map<number, TreeNode>;
|
|
11
|
+
rootIds: number[];
|
|
12
|
+
}
|
|
13
|
+
export interface Toggles {
|
|
14
|
+
flash: boolean;
|
|
15
|
+
perf: boolean;
|
|
16
|
+
picking: boolean;
|
|
17
|
+
}
|
|
18
|
+
export type Expansions = Map<string, Encoded>;
|
|
19
|
+
export declare const pathString: (path: PathKey[]) => string;
|
|
20
|
+
export declare const createHudState: (client: Client) => {
|
|
21
|
+
activities: {
|
|
22
|
+
bind(select?: ((bindValue: ActivityRecord[]) => import("@loom-js/core").TemplateTagValue) | undefined): import("@loom-js/core").AttrBinding<ActivityRecord[]>;
|
|
23
|
+
effect(action: import("@loom-js/core").ActivityEffectAction<ActivityRecord[]>): ((ctx?: Partial<import("@loom-js/core").ComponentContext<{}>>) => Partial<import("@loom-js/core").ComponentContext<{}>>) & {
|
|
24
|
+
contextFunctionKind: "activity";
|
|
25
|
+
};
|
|
26
|
+
initialValue: ActivityRecord[];
|
|
27
|
+
reset: () => void;
|
|
28
|
+
update(valueInput: ActivityRecord[], forceUpdate?: boolean): void;
|
|
29
|
+
value: () => ActivityRecord[];
|
|
30
|
+
watch(action: (valueProp: import("@loom-js/core").ValueProp<ActivityRecord[]>) => any): import("@loom-js/core").Unsubscriber;
|
|
31
|
+
};
|
|
32
|
+
collapsed: {
|
|
33
|
+
bind(select?: ((bindValue: Set<number>) => import("@loom-js/core").TemplateTagValue) | undefined): import("@loom-js/core").AttrBinding<Set<number>>;
|
|
34
|
+
effect(action: import("@loom-js/core").ActivityEffectAction<Set<number>>): ((ctx?: Partial<import("@loom-js/core").ComponentContext<{}>>) => Partial<import("@loom-js/core").ComponentContext<{}>>) & {
|
|
35
|
+
contextFunctionKind: "activity";
|
|
36
|
+
};
|
|
37
|
+
initialValue: Set<number>;
|
|
38
|
+
reset: () => void;
|
|
39
|
+
update(valueInput: Set<number>, forceUpdate?: boolean): void;
|
|
40
|
+
value: () => Set<number>;
|
|
41
|
+
watch(action: (valueProp: import("@loom-js/core").ValueProp<Set<number>>) => any): import("@loom-js/core").Unsubscriber;
|
|
42
|
+
};
|
|
43
|
+
connection: {
|
|
44
|
+
bind(select?: ((bindValue: Connection) => import("@loom-js/core").TemplateTagValue) | undefined): import("@loom-js/core").AttrBinding<Connection>;
|
|
45
|
+
effect(action: import("@loom-js/core").ActivityEffectAction<Connection>): ((ctx?: Partial<import("@loom-js/core").ComponentContext<{}>>) => Partial<import("@loom-js/core").ComponentContext<{}>>) & {
|
|
46
|
+
contextFunctionKind: "activity";
|
|
47
|
+
};
|
|
48
|
+
initialValue: Connection;
|
|
49
|
+
reset: () => void;
|
|
50
|
+
update(valueInput: Connection, forceUpdate?: boolean): void;
|
|
51
|
+
value: () => Connection;
|
|
52
|
+
watch(action: (valueProp: import("@loom-js/core").ValueProp<Connection>) => any): import("@loom-js/core").Unsubscriber;
|
|
53
|
+
};
|
|
54
|
+
details: {
|
|
55
|
+
bind(select?: ((bindValue: NodeDetails | undefined) => import("@loom-js/core").TemplateTagValue) | undefined): import("@loom-js/core").AttrBinding<NodeDetails | undefined>;
|
|
56
|
+
effect(action: import("@loom-js/core").ActivityEffectAction<NodeDetails | undefined>): ((ctx?: Partial<import("@loom-js/core").ComponentContext<{}>>) => Partial<import("@loom-js/core").ComponentContext<{}>>) & {
|
|
57
|
+
contextFunctionKind: "activity";
|
|
58
|
+
};
|
|
59
|
+
initialValue: NodeDetails | undefined;
|
|
60
|
+
reset: () => void;
|
|
61
|
+
update(valueInput: NodeDetails | undefined, forceUpdate?: boolean): void;
|
|
62
|
+
value: () => NodeDetails | undefined;
|
|
63
|
+
watch(action: (valueProp: import("@loom-js/core").ValueProp<NodeDetails | undefined>) => any): import("@loom-js/core").Unsubscriber;
|
|
64
|
+
};
|
|
65
|
+
expansions: {
|
|
66
|
+
bind(select?: ((bindValue: Expansions) => import("@loom-js/core").TemplateTagValue) | undefined): import("@loom-js/core").AttrBinding<Expansions>;
|
|
67
|
+
effect(action: import("@loom-js/core").ActivityEffectAction<Expansions>): ((ctx?: Partial<import("@loom-js/core").ComponentContext<{}>>) => Partial<import("@loom-js/core").ComponentContext<{}>>) & {
|
|
68
|
+
contextFunctionKind: "activity";
|
|
69
|
+
};
|
|
70
|
+
initialValue: Expansions;
|
|
71
|
+
reset: () => void;
|
|
72
|
+
update(valueInput: Expansions, forceUpdate?: boolean): void;
|
|
73
|
+
value: () => Expansions;
|
|
74
|
+
watch(action: (valueProp: import("@loom-js/core").ValueProp<Expansions>) => any): import("@loom-js/core").Unsubscriber;
|
|
75
|
+
};
|
|
76
|
+
notice: {
|
|
77
|
+
bind(select?: ((bindValue: string) => import("@loom-js/core").TemplateTagValue) | undefined): import("@loom-js/core").AttrBinding<string>;
|
|
78
|
+
effect(action: import("@loom-js/core").ActivityEffectAction<string>): ((ctx?: Partial<import("@loom-js/core").ComponentContext<{}>>) => Partial<import("@loom-js/core").ComponentContext<{}>>) & {
|
|
79
|
+
contextFunctionKind: "activity";
|
|
80
|
+
};
|
|
81
|
+
initialValue: string;
|
|
82
|
+
reset: () => void;
|
|
83
|
+
update(valueInput: string, forceUpdate?: boolean): void;
|
|
84
|
+
value: () => string;
|
|
85
|
+
watch(action: (valueProp: import("@loom-js/core").ValueProp<string>) => any): import("@loom-js/core").Unsubscriber;
|
|
86
|
+
};
|
|
87
|
+
openPaths: {
|
|
88
|
+
bind(select?: ((bindValue: Set<string>) => import("@loom-js/core").TemplateTagValue) | undefined): import("@loom-js/core").AttrBinding<Set<string>>;
|
|
89
|
+
effect(action: import("@loom-js/core").ActivityEffectAction<Set<string>>): ((ctx?: Partial<import("@loom-js/core").ComponentContext<{}>>) => Partial<import("@loom-js/core").ComponentContext<{}>>) & {
|
|
90
|
+
contextFunctionKind: "activity";
|
|
91
|
+
};
|
|
92
|
+
initialValue: Set<string>;
|
|
93
|
+
reset: () => void;
|
|
94
|
+
update(valueInput: Set<string>, forceUpdate?: boolean): void;
|
|
95
|
+
value: () => Set<string>;
|
|
96
|
+
watch(action: (valueProp: import("@loom-js/core").ValueProp<Set<string>>) => any): import("@loom-js/core").Unsubscriber;
|
|
97
|
+
};
|
|
98
|
+
renderCounts: {
|
|
99
|
+
bind(select?: ((bindValue: Map<number, number>) => import("@loom-js/core").TemplateTagValue) | undefined): import("@loom-js/core").AttrBinding<Map<number, number>>;
|
|
100
|
+
effect(action: import("@loom-js/core").ActivityEffectAction<Map<number, number>>): ((ctx?: Partial<import("@loom-js/core").ComponentContext<{}>>) => Partial<import("@loom-js/core").ComponentContext<{}>>) & {
|
|
101
|
+
contextFunctionKind: "activity";
|
|
102
|
+
};
|
|
103
|
+
initialValue: Map<number, number>;
|
|
104
|
+
reset: () => void;
|
|
105
|
+
update(valueInput: Map<number, number>, forceUpdate?: boolean): void;
|
|
106
|
+
value: () => Map<number, number>;
|
|
107
|
+
watch(action: (valueProp: import("@loom-js/core").ValueProp<Map<number, number>>) => any): import("@loom-js/core").Unsubscriber;
|
|
108
|
+
};
|
|
109
|
+
selectedId: {
|
|
110
|
+
bind(select?: ((bindValue: number | undefined) => import("@loom-js/core").TemplateTagValue) | undefined): import("@loom-js/core").AttrBinding<number | undefined>;
|
|
111
|
+
effect(action: import("@loom-js/core").ActivityEffectAction<number | undefined>): ((ctx?: Partial<import("@loom-js/core").ComponentContext<{}>>) => Partial<import("@loom-js/core").ComponentContext<{}>>) & {
|
|
112
|
+
contextFunctionKind: "activity";
|
|
113
|
+
};
|
|
114
|
+
initialValue: number | undefined;
|
|
115
|
+
reset: () => void;
|
|
116
|
+
update(valueInput: number | undefined, forceUpdate?: boolean): void;
|
|
117
|
+
value: () => number | undefined;
|
|
118
|
+
watch(action: (valueProp: import("@loom-js/core").ValueProp<number | undefined>) => any): import("@loom-js/core").Unsubscriber;
|
|
119
|
+
};
|
|
120
|
+
tab: {
|
|
121
|
+
bind(select?: ((bindValue: Tab) => import("@loom-js/core").TemplateTagValue) | undefined): import("@loom-js/core").AttrBinding<Tab>;
|
|
122
|
+
effect(action: import("@loom-js/core").ActivityEffectAction<Tab>): ((ctx?: Partial<import("@loom-js/core").ComponentContext<{}>>) => Partial<import("@loom-js/core").ComponentContext<{}>>) & {
|
|
123
|
+
contextFunctionKind: "activity";
|
|
124
|
+
};
|
|
125
|
+
initialValue: Tab;
|
|
126
|
+
reset: () => void;
|
|
127
|
+
update(valueInput: Tab, forceUpdate?: boolean): void;
|
|
128
|
+
value: () => Tab;
|
|
129
|
+
watch(action: (valueProp: import("@loom-js/core").ValueProp<Tab>) => any): import("@loom-js/core").Unsubscriber;
|
|
130
|
+
};
|
|
131
|
+
toggles: {
|
|
132
|
+
bind(select?: ((bindValue: Toggles) => import("@loom-js/core").TemplateTagValue) | undefined): import("@loom-js/core").AttrBinding<Toggles>;
|
|
133
|
+
effect(action: import("@loom-js/core").ActivityEffectAction<Toggles>): ((ctx?: Partial<import("@loom-js/core").ComponentContext<{}>>) => Partial<import("@loom-js/core").ComponentContext<{}>>) & {
|
|
134
|
+
contextFunctionKind: "activity";
|
|
135
|
+
};
|
|
136
|
+
initialValue: Toggles;
|
|
137
|
+
reset: () => void;
|
|
138
|
+
update(valueInput: Toggles, forceUpdate?: boolean): void;
|
|
139
|
+
value: () => Toggles;
|
|
140
|
+
watch(action: (valueProp: import("@loom-js/core").ValueProp<Toggles>) => any): import("@loom-js/core").Unsubscriber;
|
|
141
|
+
};
|
|
142
|
+
tree: {
|
|
143
|
+
bind(select?: ((bindValue: TreeState) => import("@loom-js/core").TemplateTagValue) | undefined): import("@loom-js/core").AttrBinding<TreeState>;
|
|
144
|
+
effect(action: import("@loom-js/core").ActivityEffectAction<TreeState>): ((ctx?: Partial<import("@loom-js/core").ComponentContext<{}>>) => Partial<import("@loom-js/core").ComponentContext<{}>>) & {
|
|
145
|
+
contextFunctionKind: "activity";
|
|
146
|
+
};
|
|
147
|
+
initialValue: TreeState;
|
|
148
|
+
reset: () => void;
|
|
149
|
+
update(valueInput: TreeState, forceUpdate?: boolean): void;
|
|
150
|
+
value: () => TreeState;
|
|
151
|
+
watch(action: (valueProp: import("@loom-js/core").ValueProp<TreeState>) => any): import("@loom-js/core").Unsubscriber;
|
|
152
|
+
};
|
|
153
|
+
actions: {
|
|
154
|
+
close: () => Promise<void | {}>;
|
|
155
|
+
editActivity: (id: number, text: string) => Promise<void>;
|
|
156
|
+
expand: (path: PathKey[]) => Promise<void>;
|
|
157
|
+
highlight: (id: number | null) => Promise<void | {}>;
|
|
158
|
+
log: (id: number) => Promise<void | {}>;
|
|
159
|
+
popOut: () => Promise<void | {}>;
|
|
160
|
+
dock: () => Promise<void | {}>;
|
|
161
|
+
resetActivity: (id: number) => Promise<void | {}>;
|
|
162
|
+
reveal: (id: number) => Promise<void | {}>;
|
|
163
|
+
select: (id: number | undefined) => void;
|
|
164
|
+
setTab: (next: Tab) => void;
|
|
165
|
+
setToggle: (name: keyof Toggles, on: boolean) => Promise<void>;
|
|
166
|
+
togglePath: (path: PathKey[]) => void;
|
|
167
|
+
toggleCollapsed: (id: number) => void;
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
export type HudState = ReturnType<typeof createHudState>;
|
|
171
|
+
//# sourceMappingURL=state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"state.d.ts","sourceRoot":"","sources":["../../../src/frontend/state.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACR,cAAc,EACd,OAAO,EACP,WAAW,EACX,OAAO,EACP,SAAS,EAET,QAAQ,EACX,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAEvC,MAAM,MAAM,GAAG,GAAG,YAAY,GAAG,YAAY,CAAC;AAE9C,MAAM,WAAW,UAAU;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,SAAS,GAAG,SAAS,CAAC;IACjC,MAAM,EAAE,WAAW,GAAG,YAAY,GAAG,SAAS,CAAC;CAClD;AAED,MAAM,WAAW,SAAS;IACtB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7B,OAAO,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,OAAO;IACpB,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,OAAO,CAAC;CACpB;AAGD,MAAM,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE9C,eAAO,MAAM,UAAU,SAAU,OAAO,EAAE,WAA+B,CAAC;AAE1E,eAAO,MAAM,cAAc,WAAY,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2BAqKR,MAAM,QAAQ,MAAM;uBAiBxB,OAAO,EAAE;wBAoBd,MAAM,GAAG,IAAI;kBAEnB,MAAM;;;4BAKI,MAAM;qBAEb,MAAM;qBAnJP,MAAM,GAAG,SAAS;uBAsJf,GAAG;0BA5EK,MAAM,OAAO,MAAM,OAAO;2BA8E9B,OAAO,EAAE;8BAON,MAAM;;CAQvC,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ActivityRecord, Encoded } from '../../protocol/types';
|
|
2
|
+
import type { HudState } from '../state';
|
|
3
|
+
import { type ValueContext } from './value-view';
|
|
4
|
+
/** The value's JSON text for the edit field, or '' when it can't be shown. */
|
|
5
|
+
export declare const jsonTextOf: (value: Encoded) => string;
|
|
6
|
+
export interface ActivityItemProps {
|
|
7
|
+
actions: HudState['actions'];
|
|
8
|
+
record: ActivityRecord;
|
|
9
|
+
valueContext: ValueContext;
|
|
10
|
+
}
|
|
11
|
+
export declare const ActivityItem: (props: import("@loom-js/core").ComponentInputProps<ActivityItemProps>) => import("@loom-js/core").ContextFunction;
|
|
12
|
+
//# sourceMappingURL=activity-item.d.ts.map
|