@dxos/plugin-devtools 0.12.0-next-73daef452f1464b62efdbca75fb0067c1066f264 → 0.13.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/PLUGIN.mdl +144 -57
- package/dist/lib/Devtools.mjs +9 -1
- package/dist/lib/Devtools.mjs.map +1 -1
- package/dist/lib/capabilities.browser.mjs +45 -0
- package/dist/lib/capabilities.browser.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +9 -7
- package/dist/lib/capabilities.mjs.map +1 -1
- package/dist/lib/capabilities.node.mjs +7 -3
- package/dist/lib/capabilities.node.mjs.map +1 -1
- package/dist/lib/capabilities.tauri.mjs +45 -0
- package/dist/lib/capabilities.tauri.mjs.map +1 -0
- package/dist/lib/capabilities.workerd.mjs +2 -2
- package/dist/lib/capabilities.workerd.mjs.map +1 -1
- package/dist/lib/{chunk-CliPanel.mjs → chunk-CliArticle.mjs} +28 -24
- package/dist/lib/chunk-CliArticle.mjs.map +1 -0
- package/dist/lib/chunk-DebugGraph.mjs +12 -8
- package/dist/lib/chunk-DebugGraph.mjs.map +1 -1
- package/dist/lib/chunk-DevtoolsCards.mjs +108 -0
- package/dist/lib/chunk-DevtoolsCards.mjs.map +1 -0
- package/dist/lib/chunk-DevtoolsOverviewContainer.mjs +59 -22
- package/dist/lib/chunk-DevtoolsOverviewContainer.mjs.map +1 -1
- package/dist/lib/chunk-GithubPanel.mjs +13 -10
- package/dist/lib/chunk-GithubPanel.mjs.map +1 -1
- package/dist/lib/chunk-PLUGIN.mjs +6 -0
- package/dist/lib/chunk-PLUGIN.mjs.map +1 -0
- package/dist/lib/{chunk-RegistryPanel.mjs → chunk-RegistryArticle.mjs} +26 -25
- package/dist/lib/chunk-RegistryArticle.mjs.map +1 -0
- package/dist/lib/chunk-ToolsExplorerContainer.mjs +7 -3
- package/dist/lib/chunk-ToolsExplorerContainer.mjs.map +1 -1
- package/dist/lib/chunk-app-graph-builder.mjs +323 -312
- package/dist/lib/chunk-app-graph-builder.mjs.map +1 -1
- package/dist/lib/chunk-react-context.mjs +1 -1
- package/dist/lib/chunk-react-context.mjs.map +1 -1
- package/dist/lib/chunk-react-surface.mjs +244 -88
- package/dist/lib/chunk-react-surface.mjs.map +1 -1
- package/dist/lib/containers.mjs +3 -3
- package/dist/lib/containers.mjs.map +1 -1
- package/dist/lib/index.mjs +0 -1
- package/dist/lib/meta.mjs +2 -2
- package/dist/lib/meta.mjs.map +1 -1
- package/dist/lib/translations.mjs +55 -49
- package/dist/lib/translations.mjs.map +1 -1
- package/dist/types/src/capabilities/DevtoolsCards.d.ts +28 -0
- package/dist/types/src/capabilities/DevtoolsCards.d.ts.map +1 -0
- package/dist/types/src/capabilities/DevtoolsSurfaces.d.ts +19 -6
- package/dist/types/src/capabilities/DevtoolsSurfaces.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +19 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.test.d.ts +2 -0
- package/dist/types/src/capabilities/app-graph-builder.test.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/browser.d.ts +8 -0
- package/dist/types/src/capabilities/gen/browser.d.ts.map +1 -0
- package/dist/types/src/capabilities/gen/tauri.d.ts +8 -0
- package/dist/types/src/capabilities/gen/tauri.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/containers/CliArticle/CliArticle.d.ts +8 -0
- package/dist/types/src/containers/CliArticle/CliArticle.d.ts.map +1 -0
- package/dist/types/src/containers/{CliPanel/CliPanel.stories.d.ts → CliArticle/CliArticle.stories.d.ts} +33 -5
- package/dist/types/src/containers/CliArticle/CliArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/CliArticle/index.d.ts +2 -0
- package/dist/types/src/containers/CliArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/{CliPanel → CliArticle}/useCliApp.d.ts +1 -1
- package/dist/types/src/containers/CliArticle/useCliApp.d.ts.map +1 -0
- package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts +2 -1
- package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts.map +1 -1
- package/dist/types/src/containers/DebugGraph/index.d.ts +1 -1
- package/dist/types/src/containers/DebugGraph/index.d.ts.map +1 -1
- package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts.map +1 -1
- package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts +1 -1
- package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts.map +1 -1
- package/dist/types/src/containers/GithubPanel/GithubComponent.d.ts.map +1 -1
- package/dist/types/src/containers/GithubPanel/GithubComponent.stories.d.ts +30 -2
- package/dist/types/src/containers/GithubPanel/GithubComponent.stories.d.ts.map +1 -1
- package/dist/types/src/containers/GithubPanel/index.d.ts +1 -1
- package/dist/types/src/containers/GithubPanel/index.d.ts.map +1 -1
- package/dist/types/src/containers/RegistryArticle/RegistryArticle.d.ts +8 -0
- package/dist/types/src/containers/RegistryArticle/RegistryArticle.d.ts.map +1 -0
- package/dist/types/src/containers/RegistryArticle/index.d.ts +2 -0
- package/dist/types/src/containers/RegistryArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/ToolsExplorerContainer/ToolsExplorerContainer.d.ts +3 -1
- package/dist/types/src/containers/ToolsExplorerContainer/ToolsExplorerContainer.d.ts.map +1 -1
- package/dist/types/src/containers/ToolsExplorerContainer/index.d.ts +1 -1
- package/dist/types/src/containers/ToolsExplorerContainer/index.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +2 -2
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +30 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Devtools.d.ts +6 -0
- package/dist/types/src/types/Devtools.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +2 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +2 -2
- package/package.json +43 -39
- package/src/capabilities/DevtoolsCards.tsx +140 -0
- package/src/capabilities/DevtoolsSurfaces.tsx +32 -38
- package/src/capabilities/app-graph-builder.test.ts +75 -0
- package/src/capabilities/app-graph-builder.ts +324 -313
- package/src/capabilities/gen/browser.ts +61 -0
- package/src/capabilities/gen/node.ts +4 -4
- package/src/capabilities/gen/tauri.ts +61 -0
- package/src/capabilities/gen/workerd.ts +2 -2
- package/src/capabilities/index.ts +7 -7
- package/src/capabilities/react-context.tsx +1 -1
- package/src/capabilities/react-surface.ts +222 -79
- package/src/containers/{CliPanel/CliPanel.stories.tsx → CliArticle/CliArticle.stories.tsx} +9 -10
- package/src/containers/{CliPanel/CliPanel.tsx → CliArticle/CliArticle.tsx} +7 -7
- package/src/containers/CliArticle/index.ts +5 -0
- package/src/containers/{CliPanel → CliArticle}/useCliApp.ts +17 -12
- package/src/containers/DebugGraph/DebugGraph.tsx +7 -6
- package/src/containers/DebugGraph/index.ts +1 -1
- package/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.tsx +72 -32
- package/src/containers/DevtoolsOverviewContainer/index.ts +1 -1
- package/src/containers/GithubPanel/GithubComponent.stories.tsx +2 -2
- package/src/containers/GithubPanel/GithubComponent.tsx +14 -11
- package/src/containers/GithubPanel/GithubPanel.tsx +2 -2
- package/src/containers/GithubPanel/index.ts +1 -1
- package/src/containers/{RegistryPanel/RegistryPanel.tsx → RegistryArticle/RegistryArticle.tsx} +11 -10
- package/src/containers/RegistryArticle/index.ts +5 -0
- package/src/containers/ToolsExplorerContainer/ToolsExplorerContainer.tsx +10 -3
- package/src/containers/ToolsExplorerContainer/index.ts +1 -1
- package/src/containers/index.ts +6 -6
- package/src/index.ts +1 -2
- package/src/meta.ts +1 -1
- package/src/plugin.test.ts +2 -2
- package/src/translations.ts +7 -3
- package/src/types/Devtools.ts +10 -0
- package/src/types/index.ts +2 -2
- package/dist/lib/chunk-CliPanel.mjs.map +0 -1
- package/dist/lib/chunk-RegistryPanel.mjs.map +0 -1
- package/dist/types/src/containers/CliPanel/CliPanel.d.ts +0 -6
- package/dist/types/src/containers/CliPanel/CliPanel.d.ts.map +0 -1
- package/dist/types/src/containers/CliPanel/CliPanel.stories.d.ts.map +0 -1
- package/dist/types/src/containers/CliPanel/index.d.ts +0 -2
- package/dist/types/src/containers/CliPanel/index.d.ts.map +0 -1
- package/dist/types/src/containers/CliPanel/useCliApp.d.ts.map +0 -1
- package/dist/types/src/containers/RegistryPanel/RegistryPanel.d.ts +0 -6
- package/dist/types/src/containers/RegistryPanel/RegistryPanel.d.ts.map +0 -1
- package/dist/types/src/containers/RegistryPanel/index.d.ts +0 -2
- package/dist/types/src/containers/RegistryPanel/index.d.ts.map +0 -1
- package/src/containers/CliPanel/index.ts +0 -5
- package/src/containers/RegistryPanel/index.ts +0 -5
package/src/types/Devtools.ts
CHANGED
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
|
|
5
5
|
// @import-as-namespace
|
|
6
6
|
|
|
7
|
+
import * as GraphPath from '@dxos/app-toolkit/GraphPath';
|
|
8
|
+
|
|
7
9
|
import { meta } from '#meta';
|
|
8
10
|
|
|
9
11
|
/**
|
|
@@ -15,6 +17,13 @@ export const nodeId = (fullId: string): string => fullId.split('.').at(-1) ?? ''
|
|
|
15
17
|
|
|
16
18
|
const devtoolsId = `${meta.profile.key}.devtools`;
|
|
17
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Qualified graph id of a devtools node: the tree under the debug category nests one node per dotted
|
|
22
|
+
* segment of the namespaced ID below the plugin key.
|
|
23
|
+
*/
|
|
24
|
+
export const getNodePath = (fullId: string): string =>
|
|
25
|
+
GraphPath.getSpacePath(GraphPath.GroupSegments.debug, ...fullId.slice(meta.profile.key.length + 1).split('.'));
|
|
26
|
+
|
|
18
27
|
export const id = devtoolsId;
|
|
19
28
|
export const AppGraph = `${devtoolsId}.appGraph`;
|
|
20
29
|
export const ToolsExplorer = `${devtoolsId}.toolsExplorer`;
|
|
@@ -43,6 +52,7 @@ export namespace Echo {
|
|
|
43
52
|
export const Space = `${Echo.id}.space`;
|
|
44
53
|
export const Feeds = `${Echo.id}.feeds`;
|
|
45
54
|
export const Objects = `${Echo.id}.objects`;
|
|
55
|
+
export const Queries = `${Echo.id}.queries`;
|
|
46
56
|
export const Schema = `${Echo.id}.schema`;
|
|
47
57
|
export const Registry = `${Echo.id}.registry`;
|
|
48
58
|
export const Automerge = `${Echo.id}.automerge`;
|
package/src/types/index.ts
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-CliPanel.mjs","names":[],"sources":["../../src/containers/CliPanel/useCliApp.ts","../../src/containers/CliPanel/CliPanel.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Layer from 'effect/Layer';\nimport * as Command from 'effect/unstable/cli/Command';\nimport * as Options from 'effect/unstable/cli/Flag';\nimport { useEffect, useMemo } from 'react';\n\nimport * as ActivationEvents from '@dxos/app-framework/ActivationEvents';\nimport * as Capabilities from '@dxos/app-framework/Capabilities';\nimport * as Capability from '@dxos/app-framework/Capability';\nimport * as Plugin from '@dxos/app-framework/Plugin';\nimport { useCapabilities, usePluginManager } from '@dxos/app-framework/ui';\nimport { CommandConfig, type CommandServices } from '@dxos/cli-util';\nimport { type Client, ClientService, ConfigService } from '@dxos/client';\nimport * as Operation from '@dxos/compute/Operation';\nimport { EffectEx } from '@dxos/effect';\n\nconst OPERATIONS_UNAVAILABLE = 'Operations are not available in the devtools terminal.';\n\n/**\n * Commands that create objects invoke operations, which this surface has no runtime for. Failing\n * with a stated reason beats the bare \"Service not found\" a missing layer would produce.\n */\nconst operationLayer = Layer.succeed(Operation.Service, {\n invoke: () => Effect.die(OPERATIONS_UNAVAILABLE),\n schedule: () => Effect.die(OPERATIONS_UNAVAILABLE),\n invokePromise: async () => ({ error: new Error(OPERATIONS_UNAVAILABLE) }),\n});\n\n/**\n * Builds the `dx` command tree and the services its handlers need.\n *\n * Mounting is the demand signal: command modules are gated on `CommandsRequested`, which nothing\n * else in the app fires, so a plugin's commands stay off the critical path until a terminal opens.\n * The capability is read through its atom, so commands appear as they activate and enabling or\n * disabling a plugin later rebuilds the tree rather than leaving the terminal on the set that\n * existed when it mounted.\n *\n * The root mirrors the binary's, minus the options that only mean something on a filesystem\n * (`--config`, `--profile`); everything else resolves the same way, including `--space-id`\n * defaulting to the first available space.\n *\n * Returns `undefined` until something contributes commands — there is no shell to offer yet.\n */\nexport const useCliApp = (client: Client) => {\n const manager = usePluginManager();\n const commands = useCapabilities(Capabilities.Command);\n const contributed = useCapabilities(Capabilities.Layer);\n\n useEffect(() => {\n EffectEx.runDetached(manager.activate(ActivationEvents.CommandsRequested));\n }, [manager]);\n\n return useMemo(() => {\n // Destructured rather than passed as an array so the non-empty shape `withSubcommands` requires\n // is carried by the type instead of asserted.\n const [first, ...rest] = commands;\n if (!first) {\n return undefined;\n }\n\n const command = Command.make('dx').pipe(\n // Shared so they parse anywhere in the line — a plain command config is only read when `dx`\n // itself is the leaf.\n Command.withSharedFlags({\n json: Options.boolean('json').pipe(Options.withDescription('JSON output.')),\n verbose: Options.boolean('verbose').pipe(Options.withAlias('v'), Options.withDescription('Verbose output.')),\n }),\n Command.withSubcommands([first, ...rest]),\n // After the subcommands so the config reaches them: `provide` wraps the handler it is applied\n // to, and `withSubcommands` replaces that handler with one that dispatches to the children.\n // The input widens to a union across the tree, hence the presence checks.\n Command.provide((input) =>\n Layer.succeed(CommandConfig, {\n json: 'json' in input ? input.json : false,\n verbose: 'verbose' in input ? input.verbose : false,\n profile: 'default',\n logLevel: 'info',\n }),\n ),\n );\n\n // Annotated so a service this host owes is a build error naming it, rather than a\n // \"Service not found\" the first time someone runs the command that needed it.\n const hostLayer: Layer.Layer<CommandServices, never, never> = Layer.mergeAll(\n ClientService.fromClient(client),\n ConfigService.fromConfig(client.config),\n Layer.succeed(Plugin.Service, manager),\n Layer.succeed(Capability.Service, manager.capabilities),\n operationLayer,\n );\n\n // Plugins carry anything further their own commands need. A contributed layer may fail to\n // build, and the shell runs on a fiber with nowhere to report that, so it dies here instead\n // of being smuggled into the terminal as an unhandled error channel.\n const layer = Layer.orDie(Layer.mergeAll(hostLayer, ...contributed));\n\n return { command, layer };\n }, [client, manager, commands, contributed]);\n};\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Placeholder } from '@dxos/devtools';\nimport { useClient } from '@dxos/react-client';\nimport { Panel } from '@dxos/react-ui';\nimport { Terminal } from '@dxos/react-ui-terminal';\n\nimport { useCliApp } from './useCliApp';\n\nconst BOLD = '\\x1b[1m';\nconst DIM = '\\x1b[2m';\nconst RESET = '\\x1b[0m';\n\nconst BANNER = `${BOLD}DXOS CLI${RESET}\\n${DIM}The dx commands, running against this client. Type \"help\" for the list.${RESET}`;\n\n/**\n * Runs the `dx` CLI against the client backing this app.\n *\n * The command tree is assembled from the commands the installed plugins contribute, and it and its\n * services are built once per client, so state the handlers hold survives between commands the way\n * it does in a long-lived shell.\n */\nexport const CliPanel = () => {\n const client = useClient();\n const cli = useCliApp(client);\n\n // No ScrollArea: xterm owns its own viewport and scrollback.\n return (\n <Panel.Root>\n <Panel.Content>\n {cli ? (\n <Terminal command={cli.command} layer={cli.layer} name='dx' banner={BANNER} />\n ) : (\n <Placeholder label='No commands' />\n )}\n </Panel.Content>\n </Panel.Root>\n );\n};\n\nCliPanel.displayName = 'CliPanel';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoBA,IAAM,yBAAyB;;;;;AAM/B,IAAM,iBAAiB,MAAM,QAAQ,UAAU,SAAS;CACtD,cAAc,OAAO,IAAI,sBAAsB;CAC/C,gBAAgB,OAAO,IAAI,sBAAsB;CACjD,eAAe,aAAa,EAAE,uBAAO,IAAI,MAAM,sBAAsB,EAAE;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K,UAAU,MAAM,IAAI,IAAI,yEAAyE;;;;;;;;AASxH,IAAa,iBAAiB;CAE5B,MAAM,MAAM,UADG,UACO,CAAM;CAG5B,OACE,oBAAC,MAAM,MAAP,EAAA,UACE,oBAAC,MAAM,SAAP,EAAA,UACG,MACC,oBAAC,UAAD;EAAU,SAAS,IAAI;EAAS,OAAO,IAAI;EAAO,MAAK;EAAK,QAAQ;CAAS,CAAA,IAE7E,oBAAC,aAAD,EAAa,OAAM,cAAe,CAAA,EAEvB,CAAA,EACL,CAAA;AAEhB;AAEA,SAAS,cAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-RegistryPanel.mjs","names":[],"sources":["../../src/containers/RegistryPanel/RegistryPanel.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport React, { useCallback, useEffect, useMemo, useState } from 'react';\n\nimport * as Operation from '@dxos/compute/Operation';\nimport { JsonView, Placeholder, Searchbar } from '@dxos/devtools';\nimport { Entity, Format, Obj, Type } from '@dxos/echo';\nimport { useClient } from '@dxos/react-client';\nimport { Panel, Toolbar } from '@dxos/react-ui';\nimport { DynamicTable, type TableFeatures } from '@dxos/react-ui-table';\nimport { mx } from '@dxos/ui-theme';\n\ntype RegistryRow = {\n id: string;\n kind: string;\n label: string;\n _entity: Entity.Unknown;\n};\n\nconst textFilter = (text?: string) => {\n if (!text) {\n return () => true;\n }\n\n const matcher = new RegExp(text, 'i');\n return (entity: Entity.Unknown) => {\n const typename = Entity.getTypename(entity) ?? '';\n const metaKey = Obj.isObject(entity) ? (Obj.getMeta(entity).key ?? '') : '';\n const uri = Type.isType(entity) ? (Type.getURI(entity)?.toString() ?? '') : '';\n const operationKey =\n Obj.isObject(entity) && Obj.instanceOf(Operation.PersistentOperation, entity)\n ? (Operation.getKey(entity) ?? '')\n : '';\n const name = Obj.isObject(entity) && Obj.instanceOf(Operation.PersistentOperation, entity) ? entity.name : '';\n return [typename, metaKey, uri, operationKey, name, getEntityId(entity)].some((value) => value.match(matcher));\n };\n};\n\nconst getEntityId = (entity: Entity.Unknown): string => {\n if (entity.id) {\n return entity.id;\n }\n if (Type.isType(entity)) {\n return Type.getURI(entity)?.toString() ?? Type.getTypename(entity) ?? 'unknown-type';\n }\n return Entity.getTypename(entity) ?? 'unknown';\n};\n\nconst getKind = (entity: Entity.Unknown): string => {\n if (Type.isType(entity)) {\n return 'type';\n }\n if (Obj.isObject(entity) && Obj.instanceOf(Operation.PersistentOperation, entity)) {\n return 'operation';\n }\n return 'other';\n};\n\nconst getLabel = (entity: Entity.Unknown): string => {\n if (Obj.isObject(entity) && Obj.instanceOf(Operation.PersistentOperation, entity)) {\n return entity.name || Operation.getKey(entity) || getEntityId(entity);\n }\n if (Type.isType(entity)) {\n return Type.getTypename(entity) ?? getEntityId(entity);\n }\n return getEntityId(entity);\n};\n\nconst toDetailJson = (entity: Entity.Unknown): object => {\n if (Type.isType(entity)) {\n return {\n id: getEntityId(entity),\n typename: Type.getTypename(entity),\n uri: Type.getURI(entity)?.toString(),\n version: Type.getVersion(entity),\n jsonSchema: entity.jsonSchema,\n };\n }\n if (Obj.isObject(entity)) {\n return Obj.toJSON(entity);\n }\n return { id: getEntityId(entity), typename: Entity.getTypename(entity) };\n};\n\nexport const RegistryPanel = () => {\n const client = useClient();\n const [entities, setEntities] = useState<Entity.Unknown[]>([]);\n const [filter, setFilter] = useState('');\n const [selected, setSelected] = useState<Entity.Unknown>();\n\n useEffect(() => {\n const registry = client.graph.registry;\n const refresh = () => setEntities([...registry.list()]);\n refresh();\n return registry.changed.on(refresh);\n }, [client]);\n\n const properties = useMemo(\n () => [\n { name: 'kind', format: Format.TypeFormat.String, size: 100 },\n { name: 'label', format: Format.TypeFormat.String },\n { name: 'id', format: Format.TypeFormat.String, size: 280 },\n ],\n [],\n );\n\n const rows = useMemo((): RegistryRow[] => {\n return entities\n .filter(textFilter(filter))\n .map((entity) => ({\n id: getEntityId(entity),\n kind: getKind(entity),\n label: getLabel(entity),\n _entity: entity,\n }))\n .toSorted((left, right) => left.label.localeCompare(right.label));\n }, [entities, filter]);\n\n const handleRowClicked = useCallback((row: RegistryRow | undefined) => {\n if (!row?._entity) {\n return;\n }\n setSelected(row._entity);\n }, []);\n\n const detailJson = useMemo(() => (selected ? toDetailJson(selected) : undefined), [selected]);\n\n const features: Partial<TableFeatures> = useMemo(() => ({ selection: { enabled: true, mode: 'single' } }), []);\n\n return (\n <Panel.Root>\n <Panel.Toolbar asChild>\n <Toolbar.Root>\n <Searchbar placeholder='Filter...' onChange={setFilter} />\n </Toolbar.Root>\n </Panel.Toolbar>\n <Panel.Content>\n <div className={mx('h-full grid grid-cols-[2fr_1fr] overflow-hidden')}>\n <div className={mx('flex flex-col min-h-0 overflow-hidden')}>\n <DynamicTable properties={properties} rows={rows} features={features} onRowClick={handleRowClicked} />\n </div>\n <div className={mx('min-h-0 h-full overflow-auto border-s border-separator text-sm')}>\n {detailJson ? <JsonView data={detailJson} /> : <Placeholder label='Details' />}\n </div>\n </div>\n </Panel.Content>\n </Panel.Root>\n );\n};\n\nRegistryPanel.displayName = 'RegistryPanel';\n"],"mappings":";;;;;;;;;;AAqBA,IAAM,cAAc,SAAkB;CACpC,IAAI,CAAC,MACH,aAAa;CAGf,MAAM,UAAU,IAAI,OAAO,MAAM,GAAG;CACpC,QAAQ,WAA2B;EASjC,OAAO;GARU,OAAO,YAAY,MAAM,KAAK;GAC/B,IAAI,SAAS,MAAM,IAAK,IAAI,QAAQ,MAAM,CAAC,CAAC,OAAO,KAAM;GAC7D,KAAK,OAAO,MAAM,IAAK,KAAK,OAAO,MAAM,CAAC,EAAE,SAAS,KAAK,KAAM;GAE1E,IAAI,SAAS,MAAM,KAAK,IAAI,WAAW,UAAU,qBAAqB,MAAM,IACvE,UAAU,OAAO,MAAM,KAAK,KAC7B;GACO,IAAI,SAAS,MAAM,KAAK,IAAI,WAAW,UAAU,qBAAqB,MAAM,IAAI,OAAO,OAAO;GACvD,YAAY,MAAM;EAAC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C,OAAD;EAAK,WAAW,GAAG,iDAAiD;EAApE,UAAA,CACE,oBAAC,OAAD;GAAK,WAAW,GAAG,uCAAuC;GACxD,UAAA,oBAAC,cAAD;IAA0B;IAAkB;IAAgB;IAAU,YAAY;GAAmB,CAAA;EAClG,CAAA,GACL,oBAAC,OAAD;GAAK,WAAW,GAAG,gEAAgE;GAChF,UAAA,aAAa,oBAAC,UAAD,EAAU,MAAM,WAAa,CAAA,IAAI,oBAAC,aAAD,EAAa,OAAM,UAAW,CAAA;EAC1E,CAAA,CACF;CACQ,CAAA,EAAA,CAAA,CACL,EAAA,CAAA;AAEhB;AAEA,cAAc,cAAc"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CliPanel.d.ts","sourceRoot":"","sources":["../../../../../src/containers/CliPanel/CliPanel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CliPanel.stories.d.ts","sourceRoot":"","sources":["../../../../../src/containers/CliPanel/CliPanel.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAcjE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,QAAA,MAAM,IAAI;;;;;;;YAqBM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGU,CAAC;eAEnB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC;;;GAGG;AACH,eAAO,MAAM,IAAI,EAAE,KAkBlB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/containers/CliPanel/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,QAAQ,IAAI,OAAO,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useCliApp.d.ts","sourceRoot":"","sources":["../../../../../src/containers/CliPanel/useCliApp.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,KAAK,OAAO,MAAM,6BAA6B,CAAC;AAUvD,OAAO,EAAE,KAAK,MAAM,EAAgC,MAAM,cAAc,CAAC;AAgBzE;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,SAAS,WAAY,MAAM;;;;;;;;;aAuDvC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RegistryPanel.d.ts","sourceRoot":"","sources":["../../../../../src/containers/RegistryPanel/RegistryPanel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAoD,MAAM,OAAO,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/containers/RegistryPanel/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,aAAa,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAC"}
|