@dxos/plugin-debug 0.10.0 → 0.11.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 +12 -325
- package/README.md +4 -14
- package/dist/lib/DebugPlugin.mjs +29 -0
- package/dist/lib/DebugPlugin.mjs.map +1 -0
- package/dist/lib/DebugPlugin.node.mjs +10 -0
- package/dist/lib/DebugPlugin.node.mjs.map +1 -0
- package/dist/lib/DebugPlugin.workerd.mjs +8 -0
- package/dist/lib/DebugPlugin.workerd.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +11 -0
- package/dist/lib/capabilities.mjs.map +1 -0
- package/dist/lib/chunk-DebugObjectPanel.mjs +58 -0
- package/dist/lib/chunk-DebugObjectPanel.mjs.map +1 -0
- package/dist/lib/chunk-DebugSettings.mjs +237 -0
- package/dist/lib/chunk-DebugSettings.mjs.map +1 -0
- package/dist/lib/chunk-DebugSpaceObjectsPanel.mjs +39 -0
- package/dist/lib/chunk-DebugSpaceObjectsPanel.mjs.map +1 -0
- package/dist/lib/chunk-DebugStatus.mjs +117 -0
- package/dist/lib/chunk-DebugStatus.mjs.map +1 -0
- package/dist/lib/chunk-LogStatus.mjs +44 -0
- package/dist/lib/chunk-LogStatus.mjs.map +1 -0
- package/dist/lib/chunk-SpaceGenerator.mjs +208 -0
- package/dist/lib/chunk-SpaceGenerator.mjs.map +1 -0
- package/dist/lib/chunk-StatsPanel.mjs +58 -0
- package/dist/lib/chunk-StatsPanel.mjs.map +1 -0
- package/dist/lib/chunk-Wireframe.mjs +60 -0
- package/dist/lib/chunk-Wireframe.mjs.map +1 -0
- package/dist/lib/chunk-app-graph-builder.mjs +76 -0
- package/dist/lib/chunk-app-graph-builder.mjs.map +1 -0
- package/dist/lib/chunk-log-recording.mjs +17 -0
- package/dist/lib/chunk-log-recording.mjs.map +1 -0
- package/dist/lib/chunk-meta.mjs +36 -0
- package/dist/lib/chunk-meta.mjs.map +1 -0
- package/dist/lib/chunk-react-surface.mjs +193 -0
- package/dist/lib/chunk-react-surface.mjs.map +1 -0
- package/dist/lib/chunk-settings.mjs +23 -0
- package/dist/lib/chunk-settings.mjs.map +1 -0
- package/dist/lib/chunk-stats-panel.mjs +56 -0
- package/dist/lib/chunk-stats-panel.mjs.map +1 -0
- package/dist/lib/chunk-types.mjs +60 -0
- package/dist/lib/chunk-types.mjs.map +1 -0
- package/dist/lib/components.mjs +763 -0
- package/dist/lib/components.mjs.map +1 -0
- package/dist/lib/containers.mjs +14 -0
- package/dist/lib/containers.mjs.map +1 -0
- package/dist/lib/index.mjs +3 -0
- package/dist/lib/meta.mjs +2 -0
- package/dist/lib/plugin.mjs +8 -0
- package/dist/lib/plugin.mjs.map +1 -0
- package/dist/lib/translations.mjs +38 -0
- package/dist/lib/translations.mjs.map +1 -0
- package/dist/lib/types.mjs +2 -0
- package/dist/types/src/DebugPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/DebugSurfaces.d.ts +25 -0
- package/dist/types/src/capabilities/DebugSurfaces.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -1
- package/dist/types/src/capabilities/index.d.ts +4 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/log-recording.d.ts +10 -0
- package/dist/types/src/capabilities/log-recording.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +1 -1
- package/dist/types/src/capabilities/stats-panel.d.ts +16 -0
- package/dist/types/src/capabilities/stats-panel.d.ts.map +1 -0
- package/dist/types/src/components/SchemaTable/SchemaTable.d.ts +4 -3
- package/dist/types/src/components/SchemaTable/SchemaTable.d.ts.map +1 -1
- package/dist/types/src/components/SpaceGenerator/ObjectGenerator.d.ts.map +1 -1
- package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts +4 -1
- package/dist/types/src/containers/DebugObjectPanel/DebugObjectPanel.d.ts.map +1 -1
- package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts +4 -1
- package/dist/types/src/containers/DebugSettings/DebugSettings.d.ts.map +1 -1
- package/dist/types/src/containers/DebugSettings/DebugSettings.stories.d.ts +30 -58
- package/dist/types/src/containers/DebugSettings/DebugSettings.stories.d.ts.map +1 -1
- package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts +4 -1
- package/dist/types/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.d.ts.map +1 -1
- package/dist/types/src/containers/DebugStatus/DebugStatus.d.ts +4 -1
- package/dist/types/src/containers/DebugStatus/DebugStatus.d.ts.map +1 -1
- package/dist/types/src/containers/LogStatus/LogStatus.d.ts +6 -0
- package/dist/types/src/containers/LogStatus/LogStatus.d.ts.map +1 -0
- package/dist/types/src/containers/LogStatus/index.d.ts +2 -0
- package/dist/types/src/containers/LogStatus/index.d.ts.map +1 -0
- package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts +1 -1
- package/dist/types/src/containers/SpaceGenerator/SpaceGenerator.d.ts.map +1 -1
- package/dist/types/src/containers/StatsPanel/StatsPanel.d.ts +6 -0
- package/dist/types/src/containers/StatsPanel/StatsPanel.d.ts.map +1 -0
- package/dist/types/src/containers/StatsPanel/index.d.ts +2 -0
- package/dist/types/src/containers/StatsPanel/index.d.ts.map +1 -0
- package/dist/types/src/containers/Wireframe/Wireframe.d.ts +4 -1
- package/dist/types/src/containers/Wireframe/Wireframe.d.ts.map +1 -1
- package/dist/types/src/containers/index.d.ts +4 -6
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +26 -57
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/DebugNodes.d.ts +7 -0
- package/dist/types/src/types/DebugNodes.d.ts.map +1 -0
- package/dist/types/src/types/DebugSurface.d.ts +8 -0
- package/dist/types/src/types/DebugSurface.d.ts.map +1 -0
- package/dist/types/src/types/debug.d.ts +3 -1
- package/dist/types/src/types/debug.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 +8 -13
- package/package.json +61 -63
- package/src/DebugPlugin.node.ts +1 -1
- package/src/DebugPlugin.tsx +10 -27
- package/src/DebugPlugin.workerd.ts +1 -1
- package/src/capabilities/DebugSurfaces.tsx +146 -0
- package/src/capabilities/app-graph-builder.ts +39 -373
- package/src/capabilities/index.ts +3 -2
- package/src/capabilities/log-recording.ts +20 -0
- package/src/capabilities/react-surface.ts +123 -0
- package/src/capabilities/stats-panel.ts +74 -0
- package/src/components/SchemaTable/SchemaTable.tsx +6 -5
- package/src/components/SpaceGenerator/ObjectGenerator.tsx +9 -3
- package/src/components/SpaceGenerator/presets.ts +2 -2
- package/src/components/index.ts +1 -1
- package/src/containers/DebugObjectPanel/DebugObjectPanel.tsx +20 -20
- package/src/containers/DebugSettings/DebugSettings.tsx +4 -3
- package/src/containers/DebugSpaceObjectsPanel/DebugSpaceObjectsPanel.tsx +4 -2
- package/src/containers/DebugStatus/DebugStatus.tsx +2 -0
- package/src/containers/LogStatus/LogStatus.tsx +51 -0
- package/src/containers/LogStatus/index.ts +5 -0
- package/src/containers/SpaceGenerator/SpaceGenerator.tsx +108 -10
- package/src/containers/StatsPanel/StatsPanel.tsx +74 -0
- package/src/containers/StatsPanel/index.ts +5 -0
- package/src/containers/Wireframe/Wireframe.tsx +2 -0
- package/src/containers/index.ts +9 -7
- package/src/index.ts +1 -1
- package/src/meta.ts +1 -1
- package/src/plugin.ts +1 -1
- package/src/translations.ts +8 -52
- package/src/types/DebugNodes.ts +18 -0
- package/src/types/DebugSurface.ts +16 -0
- package/src/types/debug.ts +3 -1
- package/src/types/index.ts +3 -3
- package/dist/lib/neutral/DebugGraph-G4FWS57E.mjs +0 -15
- package/dist/lib/neutral/DebugGraph-G4FWS57E.mjs.map +0 -7
- package/dist/lib/neutral/DebugObjectPanel-QSGQJ3LM.mjs +0 -61
- package/dist/lib/neutral/DebugObjectPanel-QSGQJ3LM.mjs.map +0 -7
- package/dist/lib/neutral/DebugPlugin.mjs +0 -59
- package/dist/lib/neutral/DebugPlugin.mjs.map +0 -7
- package/dist/lib/neutral/DebugPlugin.node.mjs +0 -18
- package/dist/lib/neutral/DebugPlugin.node.mjs.map +0 -7
- package/dist/lib/neutral/DebugPlugin.workerd.mjs +0 -12
- package/dist/lib/neutral/DebugPlugin.workerd.mjs.map +0 -7
- package/dist/lib/neutral/DebugSettings-Q3WUL6YQ.mjs +0 -229
- package/dist/lib/neutral/DebugSettings-Q3WUL6YQ.mjs.map +0 -7
- package/dist/lib/neutral/DebugSpaceObjectsPanel-AXFZWEIM.mjs +0 -36
- package/dist/lib/neutral/DebugSpaceObjectsPanel-AXFZWEIM.mjs.map +0 -7
- package/dist/lib/neutral/DebugStatus-H2BAHN26.mjs +0 -122
- package/dist/lib/neutral/DebugStatus-H2BAHN26.mjs.map +0 -7
- package/dist/lib/neutral/DevtoolsOverviewContainer-DWQHTK7D.mjs +0 -24
- package/dist/lib/neutral/DevtoolsOverviewContainer-DWQHTK7D.mjs.map +0 -7
- package/dist/lib/neutral/GithubPanel-4CSJRVKE.mjs +0 -177
- package/dist/lib/neutral/GithubPanel-4CSJRVKE.mjs.map +0 -7
- package/dist/lib/neutral/RegistryPanel-64GIYJHN.mjs +0 -161
- package/dist/lib/neutral/RegistryPanel-64GIYJHN.mjs.map +0 -7
- package/dist/lib/neutral/SpaceGenerator-Y35G6DRV.mjs +0 -146
- package/dist/lib/neutral/SpaceGenerator-Y35G6DRV.mjs.map +0 -7
- package/dist/lib/neutral/Wireframe-WD7S2AUU.mjs +0 -52
- package/dist/lib/neutral/Wireframe-WD7S2AUU.mjs.map +0 -7
- package/dist/lib/neutral/app-graph-builder-UKG4WVYK.mjs +0 -619
- package/dist/lib/neutral/app-graph-builder-UKG4WVYK.mjs.map +0 -7
- package/dist/lib/neutral/capabilities/index.mjs +0 -15
- package/dist/lib/neutral/capabilities/index.mjs.map +0 -7
- package/dist/lib/neutral/chunk-72QXLYMI.mjs +0 -118
- package/dist/lib/neutral/chunk-72QXLYMI.mjs.map +0 -7
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
- package/dist/lib/neutral/chunk-R5C4CKOF.mjs +0 -54
- package/dist/lib/neutral/chunk-R5C4CKOF.mjs.map +0 -7
- package/dist/lib/neutral/components/index.mjs +0 -961
- package/dist/lib/neutral/components/index.mjs.map +0 -7
- package/dist/lib/neutral/containers/index.mjs +0 -27
- package/dist/lib/neutral/containers/index.mjs.map +0 -7
- package/dist/lib/neutral/index.mjs +0 -20
- package/dist/lib/neutral/index.mjs.map +0 -7
- package/dist/lib/neutral/meta.json +0 -1
- package/dist/lib/neutral/meta.mjs +0 -8
- package/dist/lib/neutral/meta.mjs.map +0 -7
- package/dist/lib/neutral/plugin.mjs +0 -12
- package/dist/lib/neutral/plugin.mjs.map +0 -7
- package/dist/lib/neutral/react-context-UJURDOO6.mjs +0 -17
- package/dist/lib/neutral/react-context-UJURDOO6.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-URESE7J4.mjs +0 -484
- package/dist/lib/neutral/react-surface-URESE7J4.mjs.map +0 -7
- package/dist/lib/neutral/settings-5I2674B6.mjs +0 -28
- package/dist/lib/neutral/settings-5I2674B6.mjs.map +0 -7
- package/dist/lib/neutral/translations.mjs +0 -91
- package/dist/lib/neutral/translations.mjs.map +0 -7
- package/dist/lib/neutral/types/index.mjs +0 -16
- package/dist/lib/neutral/types/index.mjs.map +0 -7
- package/dist/types/src/DebugPlugin.test.d.ts +0 -2
- package/dist/types/src/DebugPlugin.test.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-context.d.ts +0 -5
- package/dist/types/src/capabilities/react-context.d.ts.map +0 -1
- package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts +0 -8
- package/dist/types/src/containers/DebugGraph/DebugGraph.d.ts.map +0 -1
- package/dist/types/src/containers/DebugGraph/index.d.ts +0 -2
- package/dist/types/src/containers/DebugGraph/index.d.ts.map +0 -1
- package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts +0 -3
- package/dist/types/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.d.ts.map +0 -1
- package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts +0 -2
- package/dist/types/src/containers/DevtoolsOverviewContainer/index.d.ts.map +0 -1
- package/dist/types/src/containers/GithubPanel/GithubComponent.d.ts +0 -15
- package/dist/types/src/containers/GithubPanel/GithubComponent.d.ts.map +0 -1
- package/dist/types/src/containers/GithubPanel/GithubComponent.stories.d.ts +0 -106
- package/dist/types/src/containers/GithubPanel/GithubComponent.stories.d.ts.map +0 -1
- package/dist/types/src/containers/GithubPanel/GithubPanel.d.ts +0 -3
- package/dist/types/src/containers/GithubPanel/GithubPanel.d.ts.map +0 -1
- package/dist/types/src/containers/GithubPanel/index.d.ts +0 -2
- package/dist/types/src/containers/GithubPanel/index.d.ts.map +0 -1
- package/dist/types/src/containers/RegistryPanel/RegistryPanel.d.ts +0 -3
- 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/dist/types/src/types/Devtools.d.ts +0 -57
- package/dist/types/src/types/Devtools.d.ts.map +0 -1
- package/dist/types/src/types/surface.d.ts +0 -4
- package/dist/types/src/types/surface.d.ts.map +0 -1
- package/src/DebugPlugin.test.ts +0 -29
- package/src/capabilities/react-context.tsx +0 -25
- package/src/capabilities/react-surface.tsx +0 -504
- package/src/containers/DebugGraph/DebugGraph.tsx +0 -14
- package/src/containers/DebugGraph/index.ts +0 -5
- package/src/containers/DevtoolsOverviewContainer/DevtoolsOverviewContainer.tsx +0 -27
- package/src/containers/DevtoolsOverviewContainer/index.ts +0 -5
- package/src/containers/GithubPanel/GithubComponent.stories.tsx +0 -38
- package/src/containers/GithubPanel/GithubComponent.tsx +0 -192
- package/src/containers/GithubPanel/GithubPanel.tsx +0 -17
- package/src/containers/GithubPanel/index.ts +0 -5
- package/src/containers/RegistryPanel/RegistryPanel.tsx +0 -150
- package/src/containers/RegistryPanel/index.ts +0 -5
- package/src/types/Devtools.ts +0 -73
- package/src/types/surface.ts +0 -10
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { sortKeys } from "@dxos/util";
|
|
2
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
+
import { meta } from "#meta";
|
|
4
|
+
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
5
|
+
import { IconButton, Input, Panel, ScrollArea, Toolbar, composable, composableProps, useAsyncEffect } from "@dxos/react-ui";
|
|
6
|
+
import { mx } from "@dxos/ui-theme";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { ComputeGraph } from "@dxos/conductor";
|
|
9
|
+
import { Filter, Obj, Type } from "@dxos/echo";
|
|
10
|
+
import { Markdown } from "@dxos/plugin-markdown";
|
|
11
|
+
import { Organization, Person, Task } from "@dxos/types";
|
|
12
|
+
import { Drawing } from "@dxos/plugin-illustrator";
|
|
13
|
+
import { Sheet } from "@dxos/plugin-sheet";
|
|
14
|
+
import { useOperationInvoker, useOptionalCapability } from "@dxos/app-framework/ui";
|
|
15
|
+
import { useProgress } from "@dxos/app-toolkit/ui";
|
|
16
|
+
import { useClient } from "@dxos/react-client";
|
|
17
|
+
import { SchemaTable, createGenerator, generator, staticGenerators } from "#components";
|
|
18
|
+
//#region src/containers/SpaceGenerator/SpaceGenerator.tsx
|
|
19
|
+
var staticTypes = [
|
|
20
|
+
Markdown.Document,
|
|
21
|
+
Drawing.Drawing,
|
|
22
|
+
Sheet.Sheet,
|
|
23
|
+
ComputeGraph
|
|
24
|
+
];
|
|
25
|
+
var recordTypes = [
|
|
26
|
+
Organization.Organization,
|
|
27
|
+
Person.Person,
|
|
28
|
+
Task.Task
|
|
29
|
+
];
|
|
30
|
+
var SpaceGenerator = composable(({ space, onCreateObjects, children, ...props }, forwardedRef) => {
|
|
31
|
+
const { invokePromise } = useOperationInvoker();
|
|
32
|
+
const client = useClient();
|
|
33
|
+
const [count, setCount] = useState(1);
|
|
34
|
+
const [info, setInfo] = useState({});
|
|
35
|
+
const presets = useMemo(() => generator(), []);
|
|
36
|
+
useAsyncEffect(async () => {
|
|
37
|
+
await client.addTypes([
|
|
38
|
+
...staticTypes,
|
|
39
|
+
...recordTypes,
|
|
40
|
+
...presets.schemas
|
|
41
|
+
]);
|
|
42
|
+
}, [client, presets]);
|
|
43
|
+
const typeMap = useMemo(() => {
|
|
44
|
+
const recordGenerators = new Map(recordTypes.map((type) => [Type.getTypename(type), createGenerator(client, invokePromise, type)]));
|
|
45
|
+
return new Map([
|
|
46
|
+
...staticGenerators,
|
|
47
|
+
...presets.items,
|
|
48
|
+
...recordGenerators
|
|
49
|
+
]);
|
|
50
|
+
}, [
|
|
51
|
+
client,
|
|
52
|
+
invokePromise,
|
|
53
|
+
presets
|
|
54
|
+
]);
|
|
55
|
+
const updateInfo = useCallback(async () => {
|
|
56
|
+
const allSchema = [...space.db.graph.registry.list().filter(Type.isType)];
|
|
57
|
+
const echoSchema = allSchema.filter((t) => Type.isTypeKind(t));
|
|
58
|
+
const staticSchema = allSchema.filter((t) => !Type.isTypeKind(t));
|
|
59
|
+
const objectMap = sortKeys((await space.db.query(Filter.everything()).run()).reduce((map, obj) => {
|
|
60
|
+
const type = Obj.getTypename(obj);
|
|
61
|
+
if (type) map[type] = (map[type] ?? 0) + 1;
|
|
62
|
+
return map;
|
|
63
|
+
}, {}));
|
|
64
|
+
setInfo({
|
|
65
|
+
schema: {
|
|
66
|
+
static: staticSchema.length,
|
|
67
|
+
mutable: echoSchema.length
|
|
68
|
+
},
|
|
69
|
+
objects: objectMap
|
|
70
|
+
});
|
|
71
|
+
}, [space]);
|
|
72
|
+
useAsyncEffect(updateInfo, [updateInfo]);
|
|
73
|
+
const handleCreateData = useCallback(async (typename) => {
|
|
74
|
+
const constructor = typeMap.get(typename);
|
|
75
|
+
if (constructor) {
|
|
76
|
+
await constructor(space, count, onCreateObjects);
|
|
77
|
+
await updateInfo();
|
|
78
|
+
}
|
|
79
|
+
}, [
|
|
80
|
+
typeMap,
|
|
81
|
+
count,
|
|
82
|
+
space,
|
|
83
|
+
onCreateObjects,
|
|
84
|
+
updateInfo
|
|
85
|
+
]);
|
|
86
|
+
return /* @__PURE__ */ jsxs(Panel.Root, {
|
|
87
|
+
...composableProps(props),
|
|
88
|
+
ref: forwardedRef,
|
|
89
|
+
children: [/* @__PURE__ */ jsx(Panel.Toolbar, { children: /* @__PURE__ */ jsxs(Toolbar.Root, {
|
|
90
|
+
classNames: "dx-document",
|
|
91
|
+
children: [
|
|
92
|
+
/* @__PURE__ */ jsx(IconButton, {
|
|
93
|
+
icon: "ph--arrow-clockwise--regular",
|
|
94
|
+
iconOnly: true,
|
|
95
|
+
label: "Refresh",
|
|
96
|
+
onClick: updateInfo
|
|
97
|
+
}),
|
|
98
|
+
/* @__PURE__ */ jsx(Toolbar.Separator, {}),
|
|
99
|
+
/* @__PURE__ */ jsx(Input.Root, { children: /* @__PURE__ */ jsx(Input.TextInput, {
|
|
100
|
+
type: "number",
|
|
101
|
+
placeholder: "Count",
|
|
102
|
+
classNames: "w-[4rem] text-right",
|
|
103
|
+
min: 1,
|
|
104
|
+
max: 100,
|
|
105
|
+
size: 8,
|
|
106
|
+
value: count,
|
|
107
|
+
onChange: (event) => setCount(parseInt(event.target.value))
|
|
108
|
+
}) })
|
|
109
|
+
]
|
|
110
|
+
}) }), /* @__PURE__ */ jsx(Panel.Content, {
|
|
111
|
+
asChild: true,
|
|
112
|
+
children: /* @__PURE__ */ jsx(ScrollArea.Root, {
|
|
113
|
+
thin: true,
|
|
114
|
+
orientation: "vertical",
|
|
115
|
+
children: /* @__PURE__ */ jsxs(ScrollArea.Viewport, {
|
|
116
|
+
classNames: "dx-document gap-4 divide-y divide-subdued-separator",
|
|
117
|
+
children: [
|
|
118
|
+
/* @__PURE__ */ jsx(SchemaTable, {
|
|
119
|
+
classNames: "py-1",
|
|
120
|
+
types: staticTypes,
|
|
121
|
+
objects: info.objects,
|
|
122
|
+
label: "Static Types",
|
|
123
|
+
onClick: handleCreateData
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ jsx(SchemaTable, {
|
|
126
|
+
classNames: "py-1",
|
|
127
|
+
types: recordTypes,
|
|
128
|
+
objects: info.objects,
|
|
129
|
+
label: "Record Types",
|
|
130
|
+
onClick: handleCreateData
|
|
131
|
+
}),
|
|
132
|
+
/* @__PURE__ */ jsx(SchemaTable, {
|
|
133
|
+
classNames: "py-1",
|
|
134
|
+
types: presets.types,
|
|
135
|
+
objects: info.objects,
|
|
136
|
+
label: "Presets",
|
|
137
|
+
onClick: handleCreateData
|
|
138
|
+
}),
|
|
139
|
+
/* @__PURE__ */ jsx(ProgressGenerator, { classNames: "py-1" })
|
|
140
|
+
]
|
|
141
|
+
})
|
|
142
|
+
})
|
|
143
|
+
})]
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
SpaceGenerator.displayName = "SpaceGenerator";
|
|
147
|
+
var TEST_PROGRESS_NAME = `${meta.profile.key}.test-progress`;
|
|
148
|
+
var ProgressGenerator = ({ classNames }) => {
|
|
149
|
+
const registry = useOptionalCapability(AppCapabilities.ProgressRegistry);
|
|
150
|
+
const running = useProgress(TEST_PROGRESS_NAME)?.status === "running";
|
|
151
|
+
const intervalRef = useRef(void 0);
|
|
152
|
+
const clearTimer = useCallback(() => {
|
|
153
|
+
if (intervalRef.current) {
|
|
154
|
+
clearInterval(intervalRef.current);
|
|
155
|
+
intervalRef.current = void 0;
|
|
156
|
+
}
|
|
157
|
+
}, []);
|
|
158
|
+
const handleStart = useCallback(() => {
|
|
159
|
+
if (!registry || running || intervalRef.current) return;
|
|
160
|
+
const steps = 10;
|
|
161
|
+
let current = 0;
|
|
162
|
+
const handle = registry.register(TEST_PROGRESS_NAME, {
|
|
163
|
+
label: "Test Progress",
|
|
164
|
+
total: steps,
|
|
165
|
+
onCancel: () => {
|
|
166
|
+
clearTimer();
|
|
167
|
+
handle.remove();
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
intervalRef.current = setInterval(() => {
|
|
171
|
+
current += 1;
|
|
172
|
+
handle.set(current);
|
|
173
|
+
if (current >= steps) {
|
|
174
|
+
clearTimer();
|
|
175
|
+
handle.done();
|
|
176
|
+
handle.remove();
|
|
177
|
+
}
|
|
178
|
+
}, 1e3);
|
|
179
|
+
}, [
|
|
180
|
+
registry,
|
|
181
|
+
running,
|
|
182
|
+
clearTimer
|
|
183
|
+
]);
|
|
184
|
+
useEffect(() => () => {
|
|
185
|
+
clearTimer();
|
|
186
|
+
registry?.cancel(TEST_PROGRESS_NAME);
|
|
187
|
+
}, [clearTimer, registry]);
|
|
188
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
189
|
+
className: mx("flex items-center gap-2 py-1", classNames),
|
|
190
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
191
|
+
className: "grow",
|
|
192
|
+
children: "Progress Monitor"
|
|
193
|
+
}), running ? /* @__PURE__ */ jsx(IconButton, {
|
|
194
|
+
icon: "ph--x--regular",
|
|
195
|
+
label: "Cancel test progress",
|
|
196
|
+
onClick: () => registry?.cancel(TEST_PROGRESS_NAME)
|
|
197
|
+
}) : /* @__PURE__ */ jsx(IconButton, {
|
|
198
|
+
icon: "ph--play--regular",
|
|
199
|
+
label: "Start test progress",
|
|
200
|
+
disabled: !registry,
|
|
201
|
+
onClick: handleStart
|
|
202
|
+
})]
|
|
203
|
+
});
|
|
204
|
+
};
|
|
205
|
+
//#endregion
|
|
206
|
+
export { SpaceGenerator as default };
|
|
207
|
+
|
|
208
|
+
//# sourceMappingURL=chunk-SpaceGenerator.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-SpaceGenerator.mjs","names":[],"sources":["../../src/containers/SpaceGenerator/SpaceGenerator.tsx"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n\nimport { useOperationInvoker, useOptionalCapability } from '@dxos/app-framework/ui';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { useProgress } from '@dxos/app-toolkit/ui';\nimport { ComputeGraph } from '@dxos/conductor';\nimport { Filter, Obj, Type } from '@dxos/echo';\nimport { Drawing } from '@dxos/plugin-illustrator';\nimport { Markdown } from '@dxos/plugin-markdown';\nimport { Sheet } from '@dxos/plugin-sheet';\nimport { useClient } from '@dxos/react-client';\nimport { type Space } from '@dxos/react-client/echo';\nimport { IconButton, Input, Panel, ScrollArea, ThemedClassName, Toolbar, useAsyncEffect } from '@dxos/react-ui';\nimport { composable, composableProps } from '@dxos/react-ui';\nimport { Organization, Person, Task } from '@dxos/types';\nimport { mx } from '@dxos/ui-theme';\nimport { sortKeys } from '@dxos/util';\n\nimport { type ObjectGenerator, SchemaTable, createGenerator, generator, staticGenerators } from '#components';\nimport { meta } from '#meta';\n\n// TODO(burdon): Make extensible.\nconst staticTypes = [Markdown.Document, Drawing.Drawing, Sheet.Sheet, ComputeGraph];\nconst recordTypes: Type.AnyObj[] = [Organization.Organization, Person.Person, Task.Task];\n\nexport type SpaceGeneratorProps = {\n space: Space;\n onCreateObjects?: (objects: Obj.Unknown[]) => void;\n};\n\nexport const SpaceGenerator = composable<HTMLDivElement, SpaceGeneratorProps>(\n ({ space, onCreateObjects, children, ...props }, forwardedRef) => {\n const { invokePromise } = useOperationInvoker();\n const client = useClient();\n const [count, setCount] = useState(1);\n const [info, setInfo] = useState<any>({});\n const presets = useMemo(() => generator(), []);\n\n // Register types.\n useAsyncEffect(async () => {\n await client.addTypes([...staticTypes, ...recordTypes, ...presets.schemas]);\n }, [client, presets]);\n\n // Create type generators.\n const typeMap = useMemo(() => {\n const recordGenerators = new Map<string, ObjectGenerator<any>>(\n recordTypes.map((type) => [Type.getTypename(type), createGenerator(client, invokePromise, type)]),\n );\n\n return new Map([...staticGenerators, ...presets.items, ...recordGenerators]);\n }, [client, invokePromise, presets]);\n\n // Query space to get info.\n const updateInfo = useCallback(async () => {\n const allSchema = [...space.db.graph.registry.list().filter(Type.isType)];\n const echoSchema = allSchema.filter((t) => Type.isTypeKind(t));\n const staticSchema = allSchema.filter((t) => !Type.isTypeKind(t));\n\n const objects = await space.db.query(Filter.everything()).run();\n const objectMap = sortKeys(\n objects.reduce<Record<string, number>>((map, obj) => {\n const type = Obj.getTypename(obj);\n if (type) {\n const count = map[type] ?? 0;\n map[type] = count + 1;\n }\n\n return map;\n }, {}),\n );\n\n setInfo({\n schema: {\n static: staticSchema.length,\n mutable: echoSchema.length,\n },\n objects: objectMap,\n });\n }, [space]);\n\n useAsyncEffect(updateInfo, [updateInfo]);\n\n const handleCreateData = useCallback(\n async (typename: string) => {\n const constructor = typeMap.get(typename);\n if (constructor) {\n // TODO(burdon): Input to specify number of objects.\n await constructor(space, count, onCreateObjects);\n await updateInfo();\n }\n },\n [typeMap, count, space, onCreateObjects, updateInfo],\n );\n\n return (\n <Panel.Root {...composableProps(props)} ref={forwardedRef}>\n <Panel.Toolbar>\n <Toolbar.Root classNames='dx-document'>\n <IconButton icon='ph--arrow-clockwise--regular' iconOnly label='Refresh' onClick={updateInfo} />\n <Toolbar.Separator />\n <Input.Root>\n <Input.TextInput\n type='number'\n placeholder='Count'\n classNames='w-[4rem] text-right'\n min={1}\n max={100}\n size={8}\n value={count}\n onChange={(event) => setCount(parseInt(event.target.value))}\n />\n </Input.Root>\n </Toolbar.Root>\n </Panel.Toolbar>\n <Panel.Content asChild>\n <ScrollArea.Root thin orientation='vertical'>\n <ScrollArea.Viewport classNames='dx-document gap-4 divide-y divide-subdued-separator'>\n <SchemaTable\n classNames='py-1'\n types={staticTypes}\n objects={info.objects}\n label='Static Types'\n onClick={handleCreateData}\n />\n <SchemaTable\n classNames='py-1'\n types={recordTypes}\n objects={info.objects}\n label='Record Types'\n onClick={handleCreateData}\n />\n <SchemaTable\n classNames='py-1'\n types={presets.types}\n objects={info.objects}\n label='Presets'\n onClick={handleCreateData}\n />\n <ProgressGenerator classNames='py-1' />\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n </Panel.Content>\n </Panel.Root>\n );\n },\n);\n\nSpaceGenerator.displayName = 'SpaceGenerator';\n\n// Stable key for the test progress monitor within the shared registry.\nconst TEST_PROGRESS_NAME = `${meta.profile.key}.test-progress`;\n\ntype ProgressGeneratorProps = ThemedClassName;\n\n// Drives a synthetic progress monitor (10s over 10 steps) so the R0 rail meter can be exercised.\nconst ProgressGenerator = ({ classNames }: ProgressGeneratorProps) => {\n const registry = useOptionalCapability(AppCapabilities.ProgressRegistry);\n const monitor = useProgress(TEST_PROGRESS_NAME);\n const running = monitor?.status === 'running';\n const intervalRef = useRef<ReturnType<typeof setInterval> | undefined>(undefined);\n\n const clearTimer = useCallback(() => {\n if (intervalRef.current) {\n clearInterval(intervalRef.current);\n intervalRef.current = undefined;\n }\n }, []);\n\n const handleStart = useCallback(() => {\n // Guard on the timer ref too: `running` (derived from the registry) can lag a fast second click.\n if (!registry || running || intervalRef.current) {\n return;\n }\n\n const steps = 10;\n let current = 0;\n const handle = registry.register(TEST_PROGRESS_NAME, {\n label: 'Test Progress',\n total: steps,\n // Invoked by the meter's cancel control (R0 rail) or the local button.\n onCancel: () => {\n clearTimer();\n handle.remove();\n },\n });\n\n intervalRef.current = setInterval(() => {\n current += 1;\n handle.set(current);\n if (current >= steps) {\n clearTimer();\n handle.done();\n handle.remove();\n }\n }, 1_000);\n }, [registry, running, clearTimer]);\n\n // Tear down the timer and the registry entry if unmounted mid-run.\n useEffect(\n () => () => {\n clearTimer();\n registry?.cancel(TEST_PROGRESS_NAME);\n },\n [clearTimer, registry],\n );\n\n return (\n <div className={mx('flex items-center gap-2 py-1', classNames)}>\n <span className='grow'>Progress Monitor</span>\n {running ? (\n <IconButton\n icon='ph--x--regular'\n label='Cancel test progress'\n onClick={() => registry?.cancel(TEST_PROGRESS_NAME)}\n />\n ) : (\n <IconButton icon='ph--play--regular' label='Start test progress' disabled={!registry} onClick={handleStart} />\n )}\n </div>\n );\n};\n"],"mappings":"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"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { Fragment } from "react";
|
|
2
|
+
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
3
|
+
import { ScrollArea } from "@dxos/react-ui";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { useOptionalCapability } from "@dxos/app-framework/ui";
|
|
6
|
+
import { Atom, useAtomValue } from "@effect-atom/atom-react";
|
|
7
|
+
//#region src/containers/StatsPanel/StatsPanel.tsx
|
|
8
|
+
var EMPTY = Atom.make({});
|
|
9
|
+
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
10
|
+
/** Renders a leaf value; numbers are monospace so columns of counts align. */
|
|
11
|
+
var formatValue = (value) => typeof value === "number" ? value.toLocaleString() : String(value);
|
|
12
|
+
/**
|
|
13
|
+
* Flattens a compartment into `key → value` rows, one level deep: nested objects (e.g. `coverage`)
|
|
14
|
+
* become dotted keys (`coverage.plain`) so everything renders in a single flat table.
|
|
15
|
+
*/
|
|
16
|
+
var flatten = (stats) => {
|
|
17
|
+
if (!isRecord(stats)) return [["value", stats]];
|
|
18
|
+
return Object.entries(stats).flatMap(([key, value]) => isRecord(value) ? Object.entries(value).map(([subKey, subValue]) => [`${key}.${subKey}`, subValue]) : [[key, value]]);
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Presentational panel for the {@link AppCapabilities.StatsPanel} store: renders every plugin
|
|
22
|
+
* compartment as a flat key × value table, live (re-renders on each write). Purely generic — it
|
|
23
|
+
* displays whatever each plugin stores, so it works for sync telemetry or any other stats.
|
|
24
|
+
*/
|
|
25
|
+
var StatsPanel = () => {
|
|
26
|
+
const stats = useAtomValue(useOptionalCapability(AppCapabilities.StatsPanel)?.statsAtom ?? EMPTY);
|
|
27
|
+
const compartments = Object.entries(stats);
|
|
28
|
+
if (compartments.length === 0) return /* @__PURE__ */ jsx("div", {
|
|
29
|
+
className: "p-2 text-sm text-description",
|
|
30
|
+
children: "No stats yet."
|
|
31
|
+
});
|
|
32
|
+
return /* @__PURE__ */ jsx(ScrollArea.Root, {
|
|
33
|
+
thin: true,
|
|
34
|
+
centered: true,
|
|
35
|
+
padding: true,
|
|
36
|
+
children: /* @__PURE__ */ jsx(ScrollArea.Viewport, { children: compartments.map(([pluginKey, value]) => /* @__PURE__ */ jsxs("section", {
|
|
37
|
+
className: "w-full",
|
|
38
|
+
children: [/* @__PURE__ */ jsx("h3", {
|
|
39
|
+
className: "text-start font-mono text-xs text-description pbe-1",
|
|
40
|
+
children: pluginKey
|
|
41
|
+
}), /* @__PURE__ */ jsx("dl", {
|
|
42
|
+
className: "grid grid-cols-[auto_minmax(0,1fr)] w-full",
|
|
43
|
+
children: flatten(value).map(([key, cell]) => /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx("dt", {
|
|
44
|
+
className: "border-be border-separator pbe-1 pbs-1 pie-2 text-description self-start",
|
|
45
|
+
children: key
|
|
46
|
+
}), /* @__PURE__ */ jsx("dd", {
|
|
47
|
+
className: "border-be border-separator pbe-1 pbs-1 truncate font-mono text-end",
|
|
48
|
+
children: formatValue(cell)
|
|
49
|
+
})] }, key))
|
|
50
|
+
})]
|
|
51
|
+
}, pluginKey)) })
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
StatsPanel.displayName = "StatsPanel";
|
|
55
|
+
//#endregion
|
|
56
|
+
export { StatsPanel };
|
|
57
|
+
|
|
58
|
+
//# sourceMappingURL=chunk-StatsPanel.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-StatsPanel.mjs","names":[],"sources":["../../src/containers/StatsPanel/StatsPanel.tsx"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Atom, useAtomValue } from '@effect-atom/atom-react';\nimport React, { Fragment } from 'react';\n\nimport { useOptionalCapability } from '@dxos/app-framework/ui';\nimport { AppCapabilities } from '@dxos/app-toolkit';\nimport { ScrollArea } from '@dxos/react-ui';\n\n// Fallback so the atom hook is called unconditionally when no store is contributed (host plugin not\n// loaded); the panel then renders its empty state.\nconst EMPTY = Atom.make<Record<string, unknown>>({});\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n typeof value === 'object' && value !== null && !Array.isArray(value);\n\n/** Renders a leaf value; numbers are monospace so columns of counts align. */\nconst formatValue = (value: unknown): string => (typeof value === 'number' ? value.toLocaleString() : String(value));\n\n/**\n * Flattens a compartment into `key → value` rows, one level deep: nested objects (e.g. `coverage`)\n * become dotted keys (`coverage.plain`) so everything renders in a single flat table.\n */\nconst flatten = (stats: unknown): [string, unknown][] => {\n if (!isRecord(stats)) {\n return [['value', stats]];\n }\n\n return Object.entries(stats).flatMap(([key, value]) =>\n isRecord(value)\n ? Object.entries(value).map(([subKey, subValue]): [string, unknown] => [`${key}.${subKey}`, subValue])\n : [[key, value] as [string, unknown]],\n );\n};\n\n/**\n * Presentational panel for the {@link AppCapabilities.StatsPanel} store: renders every plugin\n * compartment as a flat key × value table, live (re-renders on each write). Purely generic — it\n * displays whatever each plugin stores, so it works for sync telemetry or any other stats.\n */\nexport const StatsPanel = () => {\n const store = useOptionalCapability(AppCapabilities.StatsPanel);\n const stats = useAtomValue(store?.statsAtom ?? EMPTY);\n const compartments = Object.entries(stats);\n if (compartments.length === 0) {\n return <div className='p-2 text-sm text-description'>No stats yet.</div>;\n }\n\n return (\n <ScrollArea.Root thin centered padding>\n <ScrollArea.Viewport>\n {compartments.map(([pluginKey, value]) => (\n <section key={pluginKey} className='w-full'>\n <h3 className='text-start font-mono text-xs text-description pbe-1'>{pluginKey}</h3>\n <dl className='grid grid-cols-[auto_minmax(0,1fr)] w-full'>\n {flatten(value).map(([key, cell]) => (\n <Fragment key={key}>\n <dt className='border-be border-separator pbe-1 pbs-1 pie-2 text-description self-start'>{key}</dt>\n <dd className='border-be border-separator pbe-1 pbs-1 truncate font-mono text-end'>\n {formatValue(cell)}\n </dd>\n </Fragment>\n ))}\n </dl>\n </section>\n ))}\n </ScrollArea.Viewport>\n </ScrollArea.Root>\n );\n};\n\nStatsPanel.displayName = 'StatsPanel';\n"],"mappings":";;;;;;;AAaA,IAAM,QAAQ,KAAK,KAA8B,CAAC,CAAC;AAEnD,IAAM,YAAY,UAChB,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;;AAGrE,IAAM,eAAe,UAA4B,OAAO,UAAU,WAAW,MAAM,eAAe,IAAI,OAAO,KAAK;;;;;AAMlH,IAAM,WAAW,UAAwC;CACvD,IAAI,CAAC,SAAS,KAAK,GACjB,OAAO,CAAC,CAAC,SAAS,KAAK,CAAC;CAG1B,OAAO,OAAO,QAAQ,KAAK,CAAC,CAAC,SAAS,CAAC,KAAK,WAC1C,SAAS,KAAK,IACV,OAAO,QAAQ,KAAK,CAAC,CAAC,KAAK,CAAC,QAAQ,cAAiC,CAAC,GAAG,IAAI,GAAG,UAAU,QAAQ,CAAC,IACnG,CAAC,CAAC,KAAK,KAAK,CAAsB,CACxC;AACF;;;;;;AAOA,IAAa,mBAAmB;CAE9B,MAAM,QAAQ,aADA,sBAAsB,gBAAgB,UACzB,CAAA,EAAO,aAAa,KAAK;CACpD,MAAM,eAAe,OAAO,QAAQ,KAAK;CACzC,IAAI,aAAa,WAAW,GAC1B,OAAO,oBAAC,OAAD;EAAK,WAAU;YAA+B;CAAkB,CAAA;CAGzE,OACE,oBAAC,WAAW,MAAZ;EAAiB,MAAA;EAAK,UAAA;EAAS,SAAA;YAC7B,oBAAC,WAAW,UAAZ,EAAA,UACG,aAAa,KAAK,CAAC,WAAW,WAC7B,qBAAC,WAAD;GAAyB,WAAU;aAAnC,CACE,oBAAC,MAAD;IAAI,WAAU;cAAuD;GAAc,CAAA,GACnF,oBAAC,MAAD;IAAI,WAAU;cACX,QAAQ,KAAK,CAAC,CAAC,KAAK,CAAC,KAAK,UACzB,qBAAC,UAAD,EAAA,UAAA,CACE,oBAAC,MAAD;KAAI,WAAU;eAA4E;IAAQ,CAAA,GAClG,oBAAC,MAAD;KAAI,WAAU;eACX,YAAY,IAAI;IACf,CAAA,CACI,EAAA,GALK,GAKL,CACX;GACC,CAAA,CACG;KAZK,SAYL,CACV,EACkB,CAAA;CACN,CAAA;AAErB;AAEA,WAAW,cAAc"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import "react";
|
|
2
|
+
import { mx } from "@dxos/ui-theme";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { Obj } from "@dxos/echo";
|
|
5
|
+
import { JsonHighlighter } from "@dxos/react-ui-syntax-highlighter";
|
|
6
|
+
import { useResizeDetector } from "react-resize-detector";
|
|
7
|
+
import { useAttentionAttributes } from "@dxos/react-ui-attention";
|
|
8
|
+
//#region src/containers/Wireframe/Wireframe.tsx
|
|
9
|
+
var Wireframe = ({ classNames, label, object }) => {
|
|
10
|
+
const attentionAttrs = useAttentionAttributes(Obj.getURI(object));
|
|
11
|
+
const { width, height, ref } = useResizeDetector();
|
|
12
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
13
|
+
ref,
|
|
14
|
+
className: mx("relative grow min-h-96", classNames),
|
|
15
|
+
...attentionAttrs,
|
|
16
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
17
|
+
className: "absolute inset-2 flex flex-col gap-2 overflow-hidden font-mono",
|
|
18
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
19
|
+
className: "flex justify-between",
|
|
20
|
+
children: [/* @__PURE__ */ jsx("div", { children: label }), /* @__PURE__ */ jsx("div", { children: `[${width}x${height}]` })]
|
|
21
|
+
}), object && /* @__PURE__ */ jsx(JsonHighlighter, {
|
|
22
|
+
data: object,
|
|
23
|
+
classNames: "text-xs opacity-75 rounded-sm"
|
|
24
|
+
})]
|
|
25
|
+
}), /* @__PURE__ */ jsxs("svg", {
|
|
26
|
+
width,
|
|
27
|
+
height,
|
|
28
|
+
className: "bg-transparent *:text-subdued",
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsx("rect", {
|
|
31
|
+
x: 0,
|
|
32
|
+
y: 0,
|
|
33
|
+
width,
|
|
34
|
+
height,
|
|
35
|
+
strokeWidth: 1,
|
|
36
|
+
fill: "none"
|
|
37
|
+
}),
|
|
38
|
+
/* @__PURE__ */ jsx("line", {
|
|
39
|
+
x1: 0,
|
|
40
|
+
y1: 0,
|
|
41
|
+
x2: width,
|
|
42
|
+
y2: height,
|
|
43
|
+
strokeWidth: 1
|
|
44
|
+
}),
|
|
45
|
+
/* @__PURE__ */ jsx("line", {
|
|
46
|
+
x1: 0,
|
|
47
|
+
y1: height,
|
|
48
|
+
x2: width,
|
|
49
|
+
y2: 0,
|
|
50
|
+
strokeWidth: 1
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
Wireframe.displayName = "Wireframe";
|
|
57
|
+
//#endregion
|
|
58
|
+
export { Wireframe as default };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=chunk-Wireframe.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-Wireframe.mjs","names":[],"sources":["../../src/containers/Wireframe/Wireframe.tsx"],"sourcesContent":["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { Obj } from '@dxos/echo';\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport { useAttentionAttributes } from '@dxos/react-ui-attention';\nimport { JsonHighlighter } from '@dxos/react-ui-syntax-highlighter';\nimport { mx } from '@dxos/ui-theme';\n\n// TODO(burdon): Create generic container with wireframe mode.\nexport type WireframeProps = ThemedClassName<{\n object: Obj.Unknown;\n label?: string;\n}>;\n\n// TODO(burdon): Make focusable and attendable with input.\nexport const Wireframe = ({ classNames, label, object }: WireframeProps) => {\n const attentionAttrs = useAttentionAttributes(Obj.getURI(object));\n const { width, height, ref } = useResizeDetector();\n\n return (\n <div ref={ref} className={mx('relative grow min-h-96', classNames)} {...attentionAttrs}>\n <div className='absolute inset-2 flex flex-col gap-2 overflow-hidden font-mono'>\n <div className='flex justify-between'>\n <div>{label}</div>\n <div>{`[${width}x${height}]`}</div>\n </div>\n {object && <JsonHighlighter data={object} classNames='text-xs opacity-75 rounded-sm' />}\n </div>\n <svg width={width} height={height} className='bg-transparent *:text-subdued'>\n <rect x={0} y={0} width={width} height={height} strokeWidth={1} fill='none' />\n <line x1={0} y1={0} x2={width} y2={height} strokeWidth={1} />\n <line x1={0} y1={height} x2={width} y2={0} strokeWidth={1} />\n </svg>\n </div>\n );\n};\n\nWireframe.displayName = 'Wireframe';\n"],"mappings":";;;;;;;;AAoBA,IAAa,aAAa,EAAE,YAAY,OAAO,aAA6B;CAC1E,MAAM,iBAAiB,uBAAuB,IAAI,OAAO,MAAM,CAAC;CAChE,MAAM,EAAE,OAAO,QAAQ,QAAQ,kBAAkB;CAEjD,OACE,qBAAC,OAAD;EAAU;EAAK,WAAW,GAAG,0BAA0B,UAAU;EAAG,GAAI;YAAxE,CACE,qBAAC,OAAD;GAAK,WAAU;aAAf,CACE,qBAAC,OAAD;IAAK,WAAU;cAAf,CACE,oBAAC,OAAD,EAAA,UAAM,MAAW,CAAA,GACjB,oBAAC,OAAD,EAAA,UAAM,IAAI,MAAM,GAAG,OAAO,GAAQ,CAAA,CAC/B;OACJ,UAAU,oBAAC,iBAAD;IAAiB,MAAM;IAAQ,YAAW;GAAiC,CAAA,CACnF;MACL,qBAAC,OAAD;GAAY;GAAe;GAAQ,WAAU;aAA7C;IACE,oBAAC,QAAD;KAAM,GAAG;KAAG,GAAG;KAAU;KAAe;KAAQ,aAAa;KAAG,MAAK;IAAQ,CAAA;IAC7E,oBAAC,QAAD;KAAM,IAAI;KAAG,IAAI;KAAG,IAAI;KAAO,IAAI;KAAQ,aAAa;IAAI,CAAA;IAC5D,oBAAC,QAAD;KAAM,IAAI;KAAG,IAAI;KAAQ,IAAI;KAAO,IAAI;KAAG,aAAa;IAAI,CAAA;GACzD;IACF;;AAET;AAEA,UAAU,cAAc"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { Capability } from "@dxos/app-framework";
|
|
2
|
+
import { Position } from "@dxos/util";
|
|
3
|
+
import { meta } from "#meta";
|
|
4
|
+
import { AppCapabilities, AppNode, AppNodeMatcher, GraphPath } from "@dxos/app-toolkit";
|
|
5
|
+
import * as Effect from "effect/Effect";
|
|
6
|
+
import { GraphBuilder, Node, NodeMatcher } from "@dxos/plugin-graph";
|
|
7
|
+
import { DebugNodes } from "#types";
|
|
8
|
+
//#region src/capabilities/app-graph-builder.ts
|
|
9
|
+
var app_graph_builder_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
10
|
+
const extensions = yield* Effect.all([
|
|
11
|
+
GraphBuilder.createExtension({
|
|
12
|
+
id: "debug",
|
|
13
|
+
match: AppNodeMatcher.whenNavTreeGroup(GraphPath.GroupTypes.system),
|
|
14
|
+
connector: (space) => Effect.succeed([Node.make({
|
|
15
|
+
id: DebugNodes.nodeId(DebugNodes.id),
|
|
16
|
+
data: null,
|
|
17
|
+
type: DebugNodes.id,
|
|
18
|
+
properties: {
|
|
19
|
+
label: ["debug.label", { ns: meta.profile.key }],
|
|
20
|
+
icon: "ph--bug--regular",
|
|
21
|
+
position: Position.last
|
|
22
|
+
},
|
|
23
|
+
nodes: [Node.make({
|
|
24
|
+
id: DebugNodes.nodeId(DebugNodes.SpaceType),
|
|
25
|
+
type: DebugNodes.SpaceType,
|
|
26
|
+
data: {
|
|
27
|
+
space,
|
|
28
|
+
type: DebugNodes.SpaceType
|
|
29
|
+
},
|
|
30
|
+
properties: {
|
|
31
|
+
label: ["generate-objects.label", { ns: meta.profile.key }],
|
|
32
|
+
icon: "ph--dice-five--regular"
|
|
33
|
+
}
|
|
34
|
+
})]
|
|
35
|
+
})])
|
|
36
|
+
}),
|
|
37
|
+
GraphBuilder.createExtension({
|
|
38
|
+
id: "debugObject",
|
|
39
|
+
match: NodeMatcher.whenEchoObject,
|
|
40
|
+
connector: () => Effect.succeed([AppNode.makeCompanion({
|
|
41
|
+
variant: "debug",
|
|
42
|
+
label: ["debug.label", { ns: meta.profile.key }],
|
|
43
|
+
icon: "ph--bug--regular",
|
|
44
|
+
data: "debug",
|
|
45
|
+
position: Position.last
|
|
46
|
+
})])
|
|
47
|
+
}),
|
|
48
|
+
GraphBuilder.createExtension({
|
|
49
|
+
id: "spaceObjects",
|
|
50
|
+
match: NodeMatcher.whenRoot,
|
|
51
|
+
connector: () => Effect.succeed([AppNode.makeDeckCompanion({
|
|
52
|
+
id: "spaceObjects",
|
|
53
|
+
label: ["space-objects.label", { ns: meta.profile.key }],
|
|
54
|
+
icon: "ph--cube--regular",
|
|
55
|
+
data: "space-objects",
|
|
56
|
+
position: Position.last
|
|
57
|
+
})])
|
|
58
|
+
}),
|
|
59
|
+
GraphBuilder.createExtension({
|
|
60
|
+
id: "logs",
|
|
61
|
+
match: NodeMatcher.whenRoot,
|
|
62
|
+
connector: () => Effect.succeed([AppNode.makeDeckCompanion({
|
|
63
|
+
id: "logs",
|
|
64
|
+
label: ["logs.label", { ns: meta.profile.key }],
|
|
65
|
+
icon: "ph--list-magnifying-glass--regular",
|
|
66
|
+
data: "logs",
|
|
67
|
+
position: Position.last
|
|
68
|
+
})])
|
|
69
|
+
})
|
|
70
|
+
]);
|
|
71
|
+
return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);
|
|
72
|
+
}));
|
|
73
|
+
//#endregion
|
|
74
|
+
export { app_graph_builder_default as default };
|
|
75
|
+
|
|
76
|
+
//# sourceMappingURL=chunk-app-graph-builder.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-app-graph-builder.mjs","names":[],"sources":["../../src/capabilities/app-graph-builder.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities, AppNode, AppNodeMatcher, GraphPath } from '@dxos/app-toolkit';\nimport { GraphBuilder, Node, NodeMatcher } from '@dxos/plugin-graph';\nimport { type Space } from '@dxos/react-client/echo';\nimport { Position } from '@dxos/util';\n\nimport { meta } from '#meta';\nimport { DebugNodes } from '#types';\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n const extensions = yield* Effect.all([\n // Top-level Debug node (sibling of DevTools under SYSTEM); only present when a space is active.\n GraphBuilder.createExtension({\n id: 'debug',\n match: AppNodeMatcher.whenNavTreeGroup(GraphPath.GroupTypes.system),\n connector: (space: Space) =>\n Effect.succeed([\n Node.make({\n id: DebugNodes.nodeId(DebugNodes.id),\n data: null,\n type: DebugNodes.id,\n properties: {\n label: ['debug.label', { ns: meta.profile.key }],\n icon: 'ph--bug--regular',\n position: Position.last,\n },\n nodes: [\n Node.make({\n id: DebugNodes.nodeId(DebugNodes.SpaceType),\n type: DebugNodes.SpaceType,\n data: { space, type: DebugNodes.SpaceType },\n properties: {\n label: ['generate-objects.label', { ns: meta.profile.key }],\n icon: 'ph--dice-five--regular',\n },\n }),\n ],\n }),\n ]),\n }),\n\n // Debug object companion.\n GraphBuilder.createExtension({\n id: 'debugObject',\n match: NodeMatcher.whenEchoObject,\n connector: () =>\n Effect.succeed([\n AppNode.makeCompanion({\n variant: 'debug',\n label: ['debug.label', { ns: meta.profile.key }],\n icon: 'ph--bug--regular',\n data: 'debug',\n position: Position.last,\n }),\n ]),\n }),\n\n // Object explorer deck companion.\n GraphBuilder.createExtension({\n id: 'spaceObjects',\n match: NodeMatcher.whenRoot,\n connector: () =>\n Effect.succeed([\n AppNode.makeDeckCompanion({\n id: 'spaceObjects',\n label: ['space-objects.label', { ns: meta.profile.key }],\n icon: 'ph--cube--regular',\n data: 'space-objects' as const,\n position: Position.last,\n }),\n ]),\n }),\n\n // Log panel deck companion.\n GraphBuilder.createExtension({\n id: 'logs',\n match: NodeMatcher.whenRoot,\n connector: () =>\n Effect.succeed([\n AppNode.makeDeckCompanion({\n id: 'logs',\n label: ['logs.label', { ns: meta.profile.key }],\n icon: 'ph--list-magnifying-glass--regular',\n data: 'logs' as const,\n position: Position.last,\n }),\n ]),\n }),\n ]);\n\n return Capability.contributes(AppCapabilities.AppGraphBuilder, extensions);\n }),\n);\n"],"mappings":";;;;;;;;AAeA,IAAA,4BAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,MAAM,aAAa,OAAO,OAAO,IAAI;EAEnC,aAAa,gBAAgB;GAC3B,IAAI;GACJ,OAAO,eAAe,iBAAiB,UAAU,WAAW,MAAM;GAClE,YAAY,UACV,OAAO,QAAQ,CACb,KAAK,KAAK;IACR,IAAI,WAAW,OAAO,WAAW,EAAE;IACnC,MAAM;IACN,MAAM,WAAW;IACjB,YAAY;KACV,OAAO,CAAC,eAAe,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;KAC/C,MAAM;KACN,UAAU,SAAS;IACrB;IACA,OAAO,CACL,KAAK,KAAK;KACR,IAAI,WAAW,OAAO,WAAW,SAAS;KAC1C,MAAM,WAAW;KACjB,MAAM;MAAE;MAAO,MAAM,WAAW;KAAU;KAC1C,YAAY;MACV,OAAO,CAAC,0BAA0B,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;MAC1D,MAAM;KACR;IACF,CAAC,CACH;GACF,CAAC,CACH,CAAC;EACL,CAAC;EAGD,aAAa,gBAAgB;GAC3B,IAAI;GACJ,OAAO,YAAY;GACnB,iBACE,OAAO,QAAQ,CACb,QAAQ,cAAc;IACpB,SAAS;IACT,OAAO,CAAC,eAAe,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;IAC/C,MAAM;IACN,MAAM;IACN,UAAU,SAAS;GACrB,CAAC,CACH,CAAC;EACL,CAAC;EAGD,aAAa,gBAAgB;GAC3B,IAAI;GACJ,OAAO,YAAY;GACnB,iBACE,OAAO,QAAQ,CACb,QAAQ,kBAAkB;IACxB,IAAI;IACJ,OAAO,CAAC,uBAAuB,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;IACvD,MAAM;IACN,MAAM;IACN,UAAU,SAAS;GACrB,CAAC,CACH,CAAC;EACL,CAAC;EAGD,aAAa,gBAAgB;GAC3B,IAAI;GACJ,OAAO,YAAY;GACnB,iBACE,OAAO,QAAQ,CACb,QAAQ,kBAAkB;IACxB,IAAI;IACJ,OAAO,CAAC,cAAc,EAAE,IAAI,KAAK,QAAQ,IAAI,CAAC;IAC9C,MAAM;IACN,MAAM;IACN,UAAU,SAAS;GACrB,CAAC,CACH,CAAC;EACL,CAAC;CACH,CAAC;CAED,OAAO,WAAW,YAAY,gBAAgB,iBAAiB,UAAU;AAC3E,CAAC,CACH"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import { logBuffer } from "@dxos/react-ui-debug";
|
|
4
|
+
//#region src/capabilities/log-recording.ts
|
|
5
|
+
/**
|
|
6
|
+
* Start recording into the process-wide log buffer at startup, so the log companion shows what
|
|
7
|
+
* happened before it was opened. Recording deliberately does not follow the panel's mount: the
|
|
8
|
+
* entries worth reading are usually the ones from before you went looking.
|
|
9
|
+
*/
|
|
10
|
+
var log_recording_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
11
|
+
logBuffer.start();
|
|
12
|
+
return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => logBuffer.stop()));
|
|
13
|
+
}));
|
|
14
|
+
//#endregion
|
|
15
|
+
export { log_recording_default as default };
|
|
16
|
+
|
|
17
|
+
//# sourceMappingURL=chunk-log-recording.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-log-recording.mjs","names":[],"sources":["../../src/capabilities/log-recording.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { logBuffer } from '@dxos/react-ui-debug';\n\n/**\n * Start recording into the process-wide log buffer at startup, so the log companion shows what\n * happened before it was opened. Recording deliberately does not follow the panel's mount: the\n * entries worth reading are usually the ones from before you went looking.\n */\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n logBuffer.start();\n return Capability.contributes(Capabilities.Null, null, () => Effect.sync(() => logBuffer.stop()));\n }),\n);\n"],"mappings":";;;;;;;;;AAcA,IAAA,wBAAe,WAAW,WACxB,OAAO,WAAW,aAAa;CAC7B,UAAU,MAAM;CAChB,OAAO,WAAW,YAAY,aAAa,MAAM,YAAY,OAAO,WAAW,UAAU,KAAK,CAAC,CAAC;AAClG,CAAC,CACH"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Plugin } from "@dxos/app-framework";
|
|
2
|
+
import { Config2 } from "@dxos/app-framework/config";
|
|
3
|
+
import { trim } from "@dxos/util";
|
|
4
|
+
//#region dx.config.ts
|
|
5
|
+
var dx_config_default = Config2.make({ plugin: {
|
|
6
|
+
key: "org.dxos.plugin.debug",
|
|
7
|
+
name: "Debug",
|
|
8
|
+
author: "DXOS",
|
|
9
|
+
description: trim`
|
|
10
|
+
DebugPlugin bundles developer debugging utilities for DXOS Composer under a Debug node in the
|
|
11
|
+
SYSTEM navigation group (a sibling of the Devtools inspector).
|
|
12
|
+
|
|
13
|
+
Test-data generation is available via a SpaceGenerator article surface: developers can
|
|
14
|
+
create configurable batches of synthetic ECHO objects into any space collection, with a
|
|
15
|
+
status indicator showing when generation is running.
|
|
16
|
+
|
|
17
|
+
The plugin contributes a Debug companion tab to every ECHO object in the deck so developers
|
|
18
|
+
can inspect raw field values and DXNs inline, and a Space Objects companion panel that lists
|
|
19
|
+
all objects in the active space with live reactive updates.
|
|
20
|
+
|
|
21
|
+
Additional utilities include a wireframe overlay mode that draws labelled borders around
|
|
22
|
+
every article and section surface, a log-capture and download facility backed by an
|
|
23
|
+
IdbLogStore, and a transient-stats panel for live telemetry.
|
|
24
|
+
`,
|
|
25
|
+
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-debug",
|
|
26
|
+
icon: { key: "ph--bug--regular" },
|
|
27
|
+
spec: "PLUGIN.mdl",
|
|
28
|
+
tags: ["labs"]
|
|
29
|
+
} });
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/meta.ts
|
|
32
|
+
var meta = Plugin.getMetaFromConfig(dx_config_default);
|
|
33
|
+
//#endregion
|
|
34
|
+
export { meta as t };
|
|
35
|
+
|
|
36
|
+
//# sourceMappingURL=chunk-meta.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-meta.mjs","names":[],"sources":["../../dx.config.ts","../../src/meta.ts"],"sourcesContent":["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Config2 } from '@dxos/app-framework/config';\nimport { trim } from '@dxos/util';\n\nexport default Config2.make({\n plugin: {\n key: 'org.dxos.plugin.debug',\n name: 'Debug',\n author: 'DXOS',\n description: trim`\n DebugPlugin bundles developer debugging utilities for DXOS Composer under a Debug node in the\n SYSTEM navigation group (a sibling of the Devtools inspector).\n\n Test-data generation is available via a SpaceGenerator article surface: developers can\n create configurable batches of synthetic ECHO objects into any space collection, with a\n status indicator showing when generation is running.\n\n The plugin contributes a Debug companion tab to every ECHO object in the deck so developers\n can inspect raw field values and DXNs inline, and a Space Objects companion panel that lists\n all objects in the active space with live reactive updates.\n\n Additional utilities include a wireframe overlay mode that draws labelled borders around\n every article and section surface, a log-capture and download facility backed by an\n IdbLogStore, and a transient-stats panel for live telemetry.\n `,\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-debug',\n icon: { key: 'ph--bug--regular' },\n spec: 'PLUGIN.mdl',\n tags: ['labs'],\n },\n});\n","//\n// Copyright 2026 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport config from '../dx.config';\n\nexport const meta = Plugin.getMetaFromConfig(config);\n"],"mappings":";;;;AAOA,IAAA,oBAAe,QAAQ,KAAK,EAC1B,QAAQ;CACN,KAAK;CACL,MAAM;CACN,QAAQ;CACR,aAAa,IAAI;;;;;;;;;;;;;;;;CAgBjB,QAAQ;CACR,MAAM,EAAE,KAAK,mBAAmB;CAChC,MAAM;CACN,MAAM,CAAC,MAAM;AACf,EACF,CAAC;;;ACzBD,IAAa,OAAO,OAAO,kBAAkB,iBAAM"}
|