@dxos/plugin-debug 0.6.11-staging.e6894a4 → 0.6.12-main.5cc132e
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/dist/lib/browser/{DebugGlobal-H37KGFEG.mjs → DebugGlobal-H56M2VL4.mjs} +5 -13
- package/dist/lib/browser/DebugGlobal-H56M2VL4.mjs.map +7 -0
- package/dist/lib/browser/{DebugSpace-KDKLS264.mjs → DebugSpace-NHPMLATA.mjs} +2 -2
- package/dist/lib/browser/{DebugSpace-KDKLS264.mjs.map → DebugSpace-NHPMLATA.mjs.map} +3 -3
- package/dist/lib/browser/index.mjs +4 -4
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/DebugPlugin.d.ts.map +1 -1
- package/dist/types/src/components/DebugGlobal.d.ts.map +1 -1
- package/dist/types/src/components/DebugSpace.d.ts.map +1 -1
- package/dist/types/src/components/DebugSpace.stories.d.ts.map +1 -1
- package/dist/types/src/components/Tree.d.ts +0 -2
- package/dist/types/src/components/Tree.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/package.json +40 -39
- package/src/DebugPlugin.tsx +3 -2
- package/src/components/DebugGlobal.tsx +3 -4
- package/src/components/DebugSpace.stories.tsx +2 -2
- package/src/components/DebugSpace.tsx +1 -1
- package/src/components/Tree.tsx +3 -13
- package/src/components/index.ts +0 -1
- package/dist/lib/browser/DebugGlobal-H37KGFEG.mjs.map +0 -7
- package/dist/lib/browser/DevtoolsMain-DTAWVF22.mjs +0 -16
- package/dist/lib/browser/DevtoolsMain-DTAWVF22.mjs.map +0 -7
- package/dist/types/src/components/DevtoolsMain.d.ts +0 -4
- package/dist/types/src/components/DevtoolsMain.d.ts.map +0 -1
- package/dist/types/src/types.test.d.ts +0 -2
- package/dist/types/src/types.test.d.ts.map +0 -1
- package/src/components/DevtoolsMain.tsx +0 -16
- package/src/types.test.ts +0 -13
|
@@ -6,14 +6,12 @@ import {
|
|
|
6
6
|
import { Gauge, Graph as GraphIcon, Gear, Toolbox, Warning } from "@phosphor-icons/react";
|
|
7
7
|
import React2, { useEffect, useState as useState2 } from "react";
|
|
8
8
|
import { useClient, useConfig } from "@dxos/react-client";
|
|
9
|
-
import { Button, ToggleGroup, ToggleGroupItem
|
|
9
|
+
import { Button, ToggleGroup, ToggleGroupItem } from "@dxos/react-ui";
|
|
10
10
|
import { getSize, mx as mx2 } from "@dxos/react-ui-theme";
|
|
11
11
|
|
|
12
12
|
// packages/plugins/experimental/plugin-debug/src/components/Tree.tsx
|
|
13
13
|
import React, { useState } from "react";
|
|
14
|
-
import SyntaxHighlighter from "react-syntax-highlighter";
|
|
15
|
-
import styleDark from "react-syntax-highlighter/dist/esm/styles/hljs/a11y-dark";
|
|
16
|
-
import styleLight from "react-syntax-highlighter/dist/esm/styles/hljs/a11y-light";
|
|
14
|
+
import { SyntaxHighlighter } from "@dxos/react-ui-syntax-highlighter";
|
|
17
15
|
import { mx } from "@dxos/react-ui-theme";
|
|
18
16
|
import { arrayToBuffer } from "@dxos/util";
|
|
19
17
|
var replacer = (key, value) => {
|
|
@@ -30,12 +28,9 @@ var replacer = (key, value) => {
|
|
|
30
28
|
}
|
|
31
29
|
return value;
|
|
32
30
|
};
|
|
33
|
-
var Json = ({ data
|
|
34
|
-
const style = theme === "dark" ? styleDark : styleLight;
|
|
31
|
+
var Json = ({ data }) => {
|
|
35
32
|
return /* @__PURE__ */ React.createElement(SyntaxHighlighter, {
|
|
36
|
-
language: "json"
|
|
37
|
-
style,
|
|
38
|
-
className: "w-full"
|
|
33
|
+
language: "json"
|
|
39
34
|
}, JSON.stringify(data, replacer, 2));
|
|
40
35
|
};
|
|
41
36
|
var Tree = ({ data }) => {
|
|
@@ -99,7 +94,6 @@ var Box = ({ children, className, ...props }) => {
|
|
|
99
94
|
|
|
100
95
|
// packages/plugins/experimental/plugin-debug/src/components/DebugGlobal.tsx
|
|
101
96
|
var DebugGlobal = ({ graph }) => {
|
|
102
|
-
const { themeMode } = useThemeContext();
|
|
103
97
|
const [view, setView] = useState2("graph");
|
|
104
98
|
const [data, setData] = useState2({});
|
|
105
99
|
const client = useClient();
|
|
@@ -165,10 +159,8 @@ var DebugGlobal = ({ graph }) => {
|
|
|
165
159
|
}, view === "graph" && /* @__PURE__ */ React2.createElement(Tree, {
|
|
166
160
|
data: graph.toJSON()
|
|
167
161
|
}), view === "config" && /* @__PURE__ */ React2.createElement(Json, {
|
|
168
|
-
theme: themeMode,
|
|
169
162
|
data: data.diagnostics?.config
|
|
170
163
|
}), view === "diagnostics" && /* @__PURE__ */ React2.createElement(Json, {
|
|
171
|
-
theme: themeMode,
|
|
172
164
|
data
|
|
173
165
|
}));
|
|
174
166
|
};
|
|
@@ -176,4 +168,4 @@ var DebugGlobal_default = DebugGlobal;
|
|
|
176
168
|
export {
|
|
177
169
|
DebugGlobal_default as default
|
|
178
170
|
};
|
|
179
|
-
//# sourceMappingURL=DebugGlobal-
|
|
171
|
+
//# sourceMappingURL=DebugGlobal-H56M2VL4.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/components/DebugGlobal.tsx", "../../../src/components/Tree.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Gauge, Graph as GraphIcon, Gear, Toolbox, Warning } from '@phosphor-icons/react';\nimport React, { type FC, useEffect, useState } from 'react';\n\nimport { type Graph } from '@dxos/plugin-graph';\nimport { useClient, useConfig } from '@dxos/react-client';\nimport { Button, ToggleGroup, ToggleGroupItem } from '@dxos/react-ui';\nimport { getSize, mx } from '@dxos/react-ui-theme';\n\nimport { DebugPanel } from './DebugPanel';\nimport { Json, Tree } from './Tree';\n\nconst DebugGlobal: FC<{ graph: Graph }> = ({ graph }) => {\n const [view, setView] = useState<'config' | 'diagnostics' | 'graph'>('graph');\n const [data, setData] = useState<any>({});\n const client = useClient();\n const config = useConfig();\n const handleRefresh = async () => {\n const data = await client.diagnostics({ truncate: true });\n setData(data);\n };\n useEffect(() => {\n void handleRefresh();\n }, []);\n\n const handleResetClient = async (force = false) => {\n if (!force && !window.confirm('Reset storage?')) {\n return;\n }\n\n // TODO(burdon): Throws exception.\n await client.reset();\n window.location.href = window.location.origin;\n };\n\n const handleOpenDevtools = () => {\n const vaultUrl = config.values?.runtime?.client?.remoteSource;\n if (vaultUrl) {\n window.open(`https://devtools.dev.dxos.org/?target=${vaultUrl}`);\n }\n };\n\n return (\n <DebugPanel\n menu={\n <>\n <ToggleGroup type='single' value={view}>\n <ToggleGroupItem value={'graph'} onClick={() => setView('graph')} title={'Plugin graph'}>\n <GraphIcon className={getSize(5)} />\n </ToggleGroupItem>\n <ToggleGroupItem value={'diagnostics'} onClick={() => setView('diagnostics')} title={'Diagnostics'}>\n <Gauge className={getSize(5)} />\n </ToggleGroupItem>\n <ToggleGroupItem value={'config'} onClick={() => setView('config')} title={'Config'}>\n <Gear className={getSize(5)} />\n </ToggleGroupItem>\n </ToggleGroup>\n\n <div className='grow' />\n <Button onClick={(event) => handleResetClient(event.shiftKey)} title='Reset client'>\n <Warning className={mx(getSize(5), 'text-red-700')} />\n </Button>\n <Button onClick={handleOpenDevtools} title='Open Devtools'>\n <Toolbox weight='duotone' className={mx(getSize(5), 'text-700')} />\n </Button>\n </>\n }\n >\n {view === 'graph' && <Tree data={graph.toJSON()} />}\n {view === 'config' && <Json data={data.diagnostics?.config} />}\n {view === 'diagnostics' && <Json data={data} />}\n </DebugPanel>\n );\n};\n\nexport default DebugGlobal;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC, type HTMLAttributes, useState } from 'react';\n\nimport { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';\nimport { mx } from '@dxos/react-ui-theme';\nimport { arrayToBuffer } from '@dxos/util';\n\n// TODO(burdon): Copied form devtools.\n\nexport const replacer = (key: any, value: any) => {\n if (typeof value === 'object') {\n if (value instanceof Uint8Array) {\n return arrayToBuffer(value).toString('hex');\n }\n\n if (value?.type === 'Buffer') {\n return Buffer.from(value.data).toString('hex');\n }\n\n if (key === 'downloaded') {\n return undefined;\n }\n }\n\n return value;\n};\n\nexport const Json: FC<{ data?: object }> = ({ data }) => {\n return <SyntaxHighlighter language='json'>{JSON.stringify(data, replacer, 2)}</SyntaxHighlighter>;\n};\n\nexport const Tree: FC<{ data?: object }> = ({ data }) => {\n return (\n <div className='flex overflow-auto ml-2 border-l-2 border-blue-500'>\n <Node data={data} root />\n </div>\n );\n};\n\nexport const Node: FC<{ data?: any; root?: boolean }> = ({ data, root }) => {\n if (typeof data !== 'object' || data === undefined || data === null) {\n return <Scalar value={data} />;\n }\n\n if (Array.isArray(data)) {\n return (\n <div className='flex flex-col space-y-2'>\n {data.map((value, index) => (\n <KeyValue key={index} label={String(index)} data={value} className='bg-teal-50' />\n ))}\n </div>\n );\n }\n\n return (\n <div className='flex flex-col space-y-2'>\n {Object.entries(data).map(([key, value]) => (\n <KeyValue key={key} label={key} data={value} className='bg-blue-50' />\n ))}\n </div>\n );\n};\n\nexport const KeyValue: FC<{ label: string; data?: any; className?: string }> = ({ label, data, className }) => {\n const [open, setOpen] = useState(true);\n if (data === undefined) {\n return null;\n }\n\n return (\n <div className='flex'>\n <Box\n className={mx('border-blue-200 text-sm select-none cursor-pointer', className)}\n onClick={() => setOpen((open) => !open)}\n >\n {label}\n </Box>\n {open && <Node data={data} />}\n </div>\n );\n};\n\nconst Scalar: FC<{ value: any }> = ({ value }) => {\n return (\n <Box className='bg-green-50 border-green-200 rounded-r text-sm font-thin'>\n {(value === undefined && 'undefined') ||\n (value === null && 'null') ||\n (typeof value === 'string' && value) ||\n JSON.stringify(value)}\n </Box>\n );\n};\n\nconst Box: FC<HTMLAttributes<HTMLDivElement>> = ({ children, className, ...props }) => {\n return (\n <div className={mx('flex px-2 border border-l-0 font-mono truncate', className)}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AAA;UAI7B,gBAAAX,OAAA,cAACc,OAAAA;MAAIJ,WAAU;QACf,gBAAAV,OAAA,cAACe,QAAAA;MAAOR,SAAS,CAACS,UAAU9B,kBAAkB8B,MAAMC,QAAQ;MAAGT,OAAM;OACnE,gBAAAR,OAAA,cAACkB,SAAAA;MAAQR,WAAWS,IAAGR,QAAQ,CAAA,GAAI,cAAA;SAErC,gBAAAX,OAAA,cAACe,QAAAA;MAAOR,SAASb;MAAoBc,OAAM;OACzC,gBAAAR,OAAA,cAACoB,SAAAA;MAAQC,QAAO;MAAUX,WAAWS,IAAGR,QAAQ,CAAA,GAAI,UAAA;;KAKzDtC,SAAS,WAAW,gBAAA2B,OAAA,cAACsB,MAAAA;IAAK9C,MAAMJ,MAAMmD,OAAM;MAC5ClD,SAAS,YAAY,gBAAA2B,OAAA,cAACwB,MAAAA;IAAKhD,MAAMA,KAAKO,aAAaH;MACnDP,SAAS,iBAAiB,gBAAA2B,OAAA,cAACwB,MAAAA;IAAKhD;;AAGvC;AAEA,IAAA,sBAAeL;",
|
|
6
|
+
"names": ["Gauge", "Graph", "GraphIcon", "Gear", "Toolbox", "Warning", "React", "useEffect", "useState", "useClient", "useConfig", "Button", "ToggleGroup", "ToggleGroupItem", "getSize", "mx", "React", "useState", "SyntaxHighlighter", "mx", "arrayToBuffer", "replacer", "key", "value", "Uint8Array", "arrayToBuffer", "toString", "type", "Buffer", "from", "data", "undefined", "Json", "SyntaxHighlighter", "language", "JSON", "stringify", "Tree", "div", "className", "Node", "root", "Scalar", "Array", "isArray", "map", "index", "KeyValue", "label", "String", "Object", "entries", "open", "setOpen", "useState", "Box", "mx", "onClick", "children", "props", "DebugGlobal", "graph", "view", "setView", "useState", "data", "setData", "client", "useClient", "config", "useConfig", "handleRefresh", "diagnostics", "truncate", "useEffect", "handleResetClient", "force", "window", "confirm", "reset", "location", "href", "origin", "handleOpenDevtools", "vaultUrl", "values", "runtime", "remoteSource", "open", "React", "DebugPanel", "menu", "ToggleGroup", "type", "value", "ToggleGroupItem", "onClick", "title", "GraphIcon", "className", "getSize", "Gauge", "Gear", "div", "Button", "event", "shiftKey", "Warning", "mx", "Toolbox", "weight", "Tree", "toJSON", "Json"]
|
|
7
|
+
}
|
|
@@ -12,10 +12,10 @@ import React2, { useContext, useMemo as useMemo2, useState as useState2 } from "
|
|
|
12
12
|
import { DocumentType as DocumentType2 } from "@dxos/plugin-markdown/types";
|
|
13
13
|
import { Invitation } from "@dxos/protocols/proto/dxos/client/services";
|
|
14
14
|
import { faker as faker2 } from "@dxos/random";
|
|
15
|
-
import { useAsyncEffect } from "@dxos/react-async";
|
|
16
15
|
import { useClient } from "@dxos/react-client";
|
|
17
16
|
import { Filter, useSpaceInvitation } from "@dxos/react-client/echo";
|
|
18
17
|
import { InvitationEncoder } from "@dxos/react-client/invitations";
|
|
18
|
+
import { useAsyncEffect } from "@dxos/react-hooks";
|
|
19
19
|
import { Button as Button2, Input, useFileDownload } from "@dxos/react-ui";
|
|
20
20
|
import { getSize, mx } from "@dxos/react-ui-theme";
|
|
21
21
|
import { safeParseInt } from "@dxos/util";
|
|
@@ -433,4 +433,4 @@ var DebugSpace_default = DebugSpace;
|
|
|
433
433
|
export {
|
|
434
434
|
DebugSpace_default as default
|
|
435
435
|
};
|
|
436
|
-
//# sourceMappingURL=DebugSpace-
|
|
436
|
+
//# sourceMappingURL=DebugSpace-NHPMLATA.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/components/DebugSpace.tsx", "../../../src/components/ObjectCreator.tsx", "../../../src/scaffolding/generator.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport {\n ArrowClockwise,\n DownloadSimple,\n Flag,\n FlagPennant,\n HandPalm,\n Play,\n PlusMinus,\n Timer,\n UserCirclePlus,\n} from '@phosphor-icons/react';\nimport React, { type FC, useContext, useMemo, useState } from 'react';\n\nimport { type ReactiveObject } from '@dxos/echo-schema';\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\nimport { faker } from '@dxos/random';\nimport { useAsyncEffect } from '@dxos/react-async';\nimport { useClient } from '@dxos/react-client';\nimport { Filter, type Space, useSpaceInvitation } from '@dxos/react-client/echo';\nimport { InvitationEncoder } from '@dxos/react-client/invitations';\nimport { Button, Input, useFileDownload } from '@dxos/react-ui';\nimport { getSize, mx } from '@dxos/react-ui-theme';\nimport { safeParseInt } from '@dxos/util';\n\nimport { DebugPanel } from './DebugPanel';\nimport { ObjectCreator } from './ObjectCreator';\nimport { createSpaceObjectGenerator } from '../scaffolding';\nimport { DebugContext } from '../types';\n\nconst DEFAULT_COUNT = 100;\nconst DEFAULT_PERIOD = 500;\nconst DEFAULT_JITTER = 50;\n\n// TODO(burdon): Factor out.\nconst useRefresh = (): [any, () => void] => {\n const [update, setUpdate] = useState({});\n return [update, () => setUpdate({})];\n};\n\nconst DebugSpace: FC<{\n space: Space;\n onAddObjects?: (objects: ReactiveObject<any>[]) => void;\n}> = ({ space, onAddObjects }) => {\n const { connect } = useSpaceInvitation(space?.key);\n const client = useClient();\n const [data, setData] = useState<any>({});\n\n const [update, handleUpdate] = useRefresh();\n useAsyncEffect(\n async (isMounted) => {\n const data = await client.diagnostics({ truncate: true });\n if (isMounted()) {\n setData(\n data?.diagnostics?.spaces?.find(({ key }: any) => {\n return space.key.toHex().startsWith(key);\n }),\n );\n }\n },\n [space, update],\n );\n\n const download = useFileDownload();\n const handleCopy = async () => {\n download(\n new Blob([JSON.stringify(data, undefined, 2)], { type: 'text/plain' }),\n `${new Date().toISOString().replace(/\\W/g, '-')}.json`,\n );\n };\n\n const [mutationCount, setMutationCount] = useState(String(DEFAULT_COUNT));\n const [mutationInterval, setMutationInterval] = useState(String(DEFAULT_PERIOD));\n const [mutationJitter, setMutationJitter] = useState(String(DEFAULT_JITTER));\n\n const generator = useMemo(() => createSpaceObjectGenerator(space), [space]);\n\n // TODO(burdon): Note: this is shared across all spaces!\n const { running, start, stop } = useContext(DebugContext);\n const handleToggleRunning = () => {\n if (running) {\n stop();\n handleUpdate();\n } else {\n start(\n async () => {\n const { objects } = await space.db.query(Filter.schema(DocumentType)).run();\n if (objects.length) {\n const object = faker.helpers.arrayElement(objects);\n await generator.mutateObject(object, { count: 10, mutationSize: 10, maxContentLength: 1000 });\n }\n },\n {\n count: safeParseInt(mutationCount) ?? 0,\n interval: safeParseInt(mutationInterval) ?? 0,\n jitter: safeParseInt(mutationJitter) ?? 0,\n },\n );\n }\n };\n\n const handleCreateInvitation = () => {\n const invitation = space.share({\n type: Invitation.Type.INTERACTIVE,\n authMethod: Invitation.AuthMethod.NONE,\n multiUse: true,\n });\n\n // TODO(burdon): Refactor.\n // TODO(burdon): Unsubscribe?\n connect(invitation);\n const code = InvitationEncoder.encode(invitation.get());\n new URL(window.origin).searchParams.set('spaceInvitationCode', code);\n const url = `${window.origin}?spaceInvitationCode=${code}`;\n void navigator.clipboard.writeText(url);\n };\n\n const handleCreateEpoch = async () => {\n await space.internal.createEpoch();\n handleUpdate();\n };\n\n return (\n <DebugPanel\n menu={\n <>\n <div className='relative' title='mutation count'>\n <Input.Root>\n <Input.TextInput\n autoComplete='off'\n size={5}\n classNames='w-[100px] text-right pie-[22px]'\n placeholder='Count'\n value={mutationCount}\n onChange={({ target: { value } }) => setMutationCount(value)}\n />\n </Input.Root>\n <Flag className={mx('absolute inline-end-1 block-start-1 mt-[6px]', getSize(3))} />\n </div>\n <div className='relative' title='mutation period'>\n <Input.Root>\n <Input.TextInput\n autoComplete='off'\n size={5}\n classNames='w-[100px] text-right pie-[22px]'\n placeholder='Interval'\n value={mutationInterval}\n onChange={({ target: { value } }) => setMutationInterval(value)}\n />\n </Input.Root>\n <Timer className={mx('absolute inline-end-1 block-start-1 mt-[6px]', getSize(3))} />\n </div>\n <div className='relative' title='mutation jitter'>\n <Input.Root>\n <Input.TextInput\n autoComplete='off'\n size={5}\n classNames='w-[100px] text-right pie-[22px]'\n placeholder='Jitter'\n value={mutationJitter}\n onChange={({ target: { value } }) => setMutationJitter(value)}\n />\n </Input.Root>\n <PlusMinus className={mx('absolute inline-end-1 block-start-1 mt-[6px]', getSize(3))} />\n </div>\n <Button onClick={handleToggleRunning}>\n {running ? <HandPalm className={getSize(5)} /> : <Play className={getSize(5)} />}\n </Button>\n <Button onClick={handleUpdate}>\n <ArrowClockwise className={getSize(5)} />\n </Button>\n <Button onClick={handleCopy}>\n <DownloadSimple className={getSize(5)} />\n </Button>\n\n <div className='grow' />\n <Button onClick={handleCreateEpoch} title='Create epoch'>\n <FlagPennant className={mx(getSize(5))} />\n </Button>\n <Button onClick={handleCreateInvitation} title='Create Space invitation'>\n <UserCirclePlus className={mx(getSize(5), 'text-blue-500')} />\n </Button>\n </>\n }\n >\n <ObjectCreator space={space} onAddObjects={onAddObjects} />\n </DebugPanel>\n );\n};\n\nexport default DebugSpace;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC, useMemo, useState } from 'react';\n\nimport { type EchoReactiveObject, type ReactiveObject } from '@dxos/echo-schema';\nimport { type Space } from '@dxos/react-client/echo';\nimport { Button, DensityProvider } from '@dxos/react-ui';\nimport { createColumnBuilder, type TableColumnDef, Table } from '@dxos/react-ui-table';\n\nimport { SchemasNames, createSpaceObjectGenerator } from '../scaffolding';\n\nexport type CreateObjectsParams = {\n enabled: boolean;\n schema: SchemasNames;\n objectsCount: number;\n mutationsCount: number;\n maxContentLength: number;\n mutationSize: number;\n};\n\nconst CREATE_OBJECTS_IN_ONE_CHUNK = 10;\n\nexport const ObjectCreator: FC<{\n space: Space;\n onAddObjects?: (objects: ReactiveObject<any>[]) => void;\n}> = ({ space, onAddObjects }) => {\n const generator = useMemo(() => createSpaceObjectGenerator(space), [space]);\n\n const [objectsToCreate, setObjectsToCreate] = useState<CreateObjectsParams[]>([\n {\n enabled: true,\n schema: SchemasNames.document,\n objectsCount: 10,\n mutationsCount: 10,\n mutationSize: 10,\n maxContentLength: 1000,\n },\n {\n enabled: true,\n schema: SchemasNames.diagram,\n objectsCount: 10,\n mutationsCount: 10,\n mutationSize: 10,\n maxContentLength: 1000,\n },\n {\n enabled: true,\n schema: SchemasNames.sheet,\n objectsCount: 10,\n mutationsCount: 10,\n mutationSize: 10,\n maxContentLength: 1000,\n },\n ]);\n\n const handleCreate = async () => {\n for (const params of objectsToCreate) {\n if (!params.enabled) {\n continue;\n }\n let objectsCreated = 0;\n while (objectsCreated < params.objectsCount) {\n const objects = (await generator.createObjects({\n [params.schema]: Math.min(CREATE_OBJECTS_IN_ONE_CHUNK, params.objectsCount - objectsCreated),\n })) as EchoReactiveObject<any>[];\n\n await generator.mutateObjects(objects, {\n count: params.mutationsCount,\n mutationSize: params.mutationSize,\n maxContentLength: params.maxContentLength,\n });\n objectsCreated += objects.length;\n onAddObjects?.(objects);\n }\n }\n await space.db.flush();\n };\n const handleChangeOnRow = (row: CreateObjectsParams, key: string, value: any) => {\n const newObjects = [...objectsToCreate];\n Object.assign(newObjects.find((object) => object.schema === row.schema)!, { [key]: value });\n setObjectsToCreate(newObjects);\n };\n\n const { helper, builder } = createColumnBuilder<CreateObjectsParams>();\n const columns: TableColumnDef<CreateObjectsParams>[] = [\n helper.accessor('enabled', builder.switch({ label: 'Enabled', onUpdate: handleChangeOnRow })),\n helper.accessor('schema', builder.string({ classNames: 'font-mono', label: 'Schema' })),\n helper.accessor('objectsCount', builder.number({ label: 'Objects', onUpdate: handleChangeOnRow })),\n helper.accessor('mutationsCount', builder.number({ label: 'Mutations', onUpdate: handleChangeOnRow })),\n helper.accessor('mutationSize', builder.number({ label: 'Mut. Size', onUpdate: handleChangeOnRow })),\n helper.accessor('maxContentLength', builder.number({ label: 'Length', onUpdate: handleChangeOnRow })),\n ];\n\n return (\n <>\n <DensityProvider density={'fine'}>\n <Table.Root>\n <Table.Viewport>\n <Table.Main<CreateObjectsParams> columns={columns} data={objectsToCreate} />\n </Table.Viewport>\n </Table.Root>\n </DensityProvider>\n <Button onClick={handleCreate}>Create</Button>\n </>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport {\n createShapeId,\n defaultBindingUtils,\n defaultShapeUtils,\n defaultTools,\n Editor,\n type TLParentId,\n} from '@tldraw/tldraw';\n\nimport { sleep } from '@dxos/async';\nimport { next as A } from '@dxos/automerge/automerge';\nimport {\n SpaceObjectGenerator,\n type TestGeneratorMap,\n type TestMutationsMap,\n type TestSchemaMap,\n} from '@dxos/echo-generator';\nimport { create } from '@dxos/echo-schema';\nimport { log } from '@dxos/log';\nimport { DocumentType, TextType } from '@dxos/plugin-markdown/types';\nimport { createTestSheet } from '@dxos/plugin-sheet/testing';\nimport { SheetType } from '@dxos/plugin-sheet/types';\nimport { TLDrawStoreAdapter } from '@dxos/plugin-sketch';\nimport { CanvasType, DiagramType, TLDRAW_SCHEMA } from '@dxos/plugin-sketch/types';\nimport { faker } from '@dxos/random';\nimport { createDocAccessor, type Space } from '@dxos/react-client/echo';\n\n// TODO(wittjosiah): Remove? Just use typenames.\nexport enum SchemasNames {\n document = 'dxos.org/type/Document',\n diagram = 'dxos.org/type/Diagram',\n sheet = 'dxos.org/type/SheetType',\n}\n\nexport const SchemasMap: TestSchemaMap<SchemasNames> = {\n [SchemasNames.document]: DocumentType,\n [SchemasNames.diagram]: DiagramType,\n [SchemasNames.sheet]: SheetType,\n};\n\nexport const ObjectGenerators: TestGeneratorMap<SchemasNames> = {\n [SchemasNames.document]: () => {\n const name = faker.lorem.sentence({ min: 2, max: 3 });\n return { name, content: create(TextType, { content: '' }), threads: [] };\n },\n\n [SchemasNames.diagram]: () => {\n const name = faker.lorem.sentence({ min: 2, max: 3 });\n return {\n name,\n canvas: create(CanvasType, { schema: TLDRAW_SCHEMA, content: {} }),\n };\n },\n\n [SchemasNames.sheet]: () => {\n const name = faker.lorem.sentence({ min: 2, max: 3 });\n return createTestSheet({ name });\n },\n};\n\nexport const MutationsGenerators: TestMutationsMap<SchemasNames> = {\n [SchemasNames.document]: async (object, params) => {\n const accessor = createDocAccessor<DocumentType>(object.content, ['content']);\n\n for (let i = 0; i < params.count; i++) {\n const length = object.content?.content?.length ?? 0;\n accessor.handle.change((doc) => {\n A.splice(\n doc,\n accessor.path.slice(),\n 0,\n params.maxContentLength >= length ? 0 : params.mutationSize,\n faker.string.hexadecimal({ length: params.mutationSize - 1 }) + ' ',\n );\n });\n\n // Release the event loop.\n if (i % 100 === 0 || i === params.count - 1) {\n log.info('Mutation:', { mutationIdx: i });\n await sleep(1);\n }\n }\n },\n\n [SchemasNames.diagram]: async (object, params) => {\n const store = new TLDrawStoreAdapter();\n await store.open(createDocAccessor<CanvasType>(object.canvas, ['content']));\n const app = new Editor({\n store: store.store!,\n shapeUtils: defaultShapeUtils,\n bindingUtils: defaultBindingUtils,\n tools: defaultTools,\n getContainer: () => document.getElementsByTagName('body')[0],\n });\n\n //\n // Draw spiral.\n //\n const r = 100;\n const a = 0.05;\n const cx = 200;\n const cy = 200;\n\n for (let i = 0; i < params.count; i++) {\n const t = i;\n const t1 = i + 1;\n const x = cx + a * t * r * Math.cos(t);\n const y = cy + a * t * r * Math.sin(t);\n const x1 = cx + a * t1 * r * Math.cos(t1);\n const y1 = cy + a * t1 * r * Math.sin(t1);\n\n app.createShape({\n id: createShapeId(),\n isLocked: false,\n meta: {},\n opacity: 1,\n parentId: 'page:page' as TLParentId,\n props: {\n arrowheadEnd: 'none',\n arrowheadStart: 'none',\n bend: 0,\n color: 'black',\n dash: 'draw',\n start: { x, y },\n end: { x: x1, y: y1 },\n fill: 'none',\n font: 'draw',\n labelColor: 'black',\n labelPosition: 0.5,\n scale: 1,\n size: 'm',\n },\n rotation: 0,\n type: 'arrow',\n typeName: 'shape',\n x: 0,\n y: 0,\n });\n\n // Release the event loop.\n if (i % 100 === 0) {\n await sleep(1);\n }\n }\n },\n\n [SchemasNames.sheet]: async (object, params) => {\n // TODO: Implement.\n },\n};\n\nexport const createSpaceObjectGenerator = (space: Space) =>\n new SpaceObjectGenerator(space, SchemasMap, ObjectGenerators, MutationsGenerators);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;AAIA,SACEA,gBACAC,gBACAC,MACAC,aACAC,UACAC,MACAC,WACAC,OACAC,sBACK;AACP,OAAOC,UAAkBC,YAAYC,WAAAA,UAASC,YAAAA,iBAAgB;AAG9D,SAASC,gBAAAA,qBAAoB;AAC7B,SAASC,kBAAkB;AAC3B,SAASC,SAAAA,cAAa;AACtB,SAASC,
|
|
6
|
-
"names": ["ArrowClockwise", "DownloadSimple", "Flag", "FlagPennant", "HandPalm", "Play", "PlusMinus", "Timer", "UserCirclePlus", "React", "useContext", "useMemo", "useState", "DocumentType", "Invitation", "faker", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport {\n ArrowClockwise,\n DownloadSimple,\n Flag,\n FlagPennant,\n HandPalm,\n Play,\n PlusMinus,\n Timer,\n UserCirclePlus,\n} from '@phosphor-icons/react';\nimport React, { type FC, useContext, useMemo, useState } from 'react';\n\nimport { type ReactiveObject } from '@dxos/echo-schema';\nimport { DocumentType } from '@dxos/plugin-markdown/types';\nimport { Invitation } from '@dxos/protocols/proto/dxos/client/services';\nimport { faker } from '@dxos/random';\nimport { useClient } from '@dxos/react-client';\nimport { Filter, type Space, useSpaceInvitation } from '@dxos/react-client/echo';\nimport { InvitationEncoder } from '@dxos/react-client/invitations';\nimport { useAsyncEffect } from '@dxos/react-hooks';\nimport { Button, Input, useFileDownload } from '@dxos/react-ui';\nimport { getSize, mx } from '@dxos/react-ui-theme';\nimport { safeParseInt } from '@dxos/util';\n\nimport { DebugPanel } from './DebugPanel';\nimport { ObjectCreator } from './ObjectCreator';\nimport { createSpaceObjectGenerator } from '../scaffolding';\nimport { DebugContext } from '../types';\n\nconst DEFAULT_COUNT = 100;\nconst DEFAULT_PERIOD = 500;\nconst DEFAULT_JITTER = 50;\n\n// TODO(burdon): Factor out.\nconst useRefresh = (): [any, () => void] => {\n const [update, setUpdate] = useState({});\n return [update, () => setUpdate({})];\n};\n\nconst DebugSpace: FC<{\n space: Space;\n onAddObjects?: (objects: ReactiveObject<any>[]) => void;\n}> = ({ space, onAddObjects }) => {\n const { connect } = useSpaceInvitation(space?.key);\n const client = useClient();\n const [data, setData] = useState<any>({});\n\n const [update, handleUpdate] = useRefresh();\n useAsyncEffect(\n async (isMounted) => {\n const data = await client.diagnostics({ truncate: true });\n if (isMounted()) {\n setData(\n data?.diagnostics?.spaces?.find(({ key }: any) => {\n return space.key.toHex().startsWith(key);\n }),\n );\n }\n },\n [space, update],\n );\n\n const download = useFileDownload();\n const handleCopy = async () => {\n download(\n new Blob([JSON.stringify(data, undefined, 2)], { type: 'text/plain' }),\n `${new Date().toISOString().replace(/\\W/g, '-')}.json`,\n );\n };\n\n const [mutationCount, setMutationCount] = useState(String(DEFAULT_COUNT));\n const [mutationInterval, setMutationInterval] = useState(String(DEFAULT_PERIOD));\n const [mutationJitter, setMutationJitter] = useState(String(DEFAULT_JITTER));\n\n const generator = useMemo(() => createSpaceObjectGenerator(space), [space]);\n\n // TODO(burdon): Note: this is shared across all spaces!\n const { running, start, stop } = useContext(DebugContext);\n const handleToggleRunning = () => {\n if (running) {\n stop();\n handleUpdate();\n } else {\n start(\n async () => {\n const { objects } = await space.db.query(Filter.schema(DocumentType)).run();\n if (objects.length) {\n const object = faker.helpers.arrayElement(objects);\n await generator.mutateObject(object, { count: 10, mutationSize: 10, maxContentLength: 1000 });\n }\n },\n {\n count: safeParseInt(mutationCount) ?? 0,\n interval: safeParseInt(mutationInterval) ?? 0,\n jitter: safeParseInt(mutationJitter) ?? 0,\n },\n );\n }\n };\n\n const handleCreateInvitation = () => {\n const invitation = space.share({\n type: Invitation.Type.INTERACTIVE,\n authMethod: Invitation.AuthMethod.NONE,\n multiUse: true,\n });\n\n // TODO(burdon): Refactor.\n // TODO(burdon): Unsubscribe?\n connect(invitation);\n const code = InvitationEncoder.encode(invitation.get());\n new URL(window.origin).searchParams.set('spaceInvitationCode', code);\n const url = `${window.origin}?spaceInvitationCode=${code}`;\n void navigator.clipboard.writeText(url);\n };\n\n const handleCreateEpoch = async () => {\n await space.internal.createEpoch();\n handleUpdate();\n };\n\n return (\n <DebugPanel\n menu={\n <>\n <div className='relative' title='mutation count'>\n <Input.Root>\n <Input.TextInput\n autoComplete='off'\n size={5}\n classNames='w-[100px] text-right pie-[22px]'\n placeholder='Count'\n value={mutationCount}\n onChange={({ target: { value } }) => setMutationCount(value)}\n />\n </Input.Root>\n <Flag className={mx('absolute inline-end-1 block-start-1 mt-[6px]', getSize(3))} />\n </div>\n <div className='relative' title='mutation period'>\n <Input.Root>\n <Input.TextInput\n autoComplete='off'\n size={5}\n classNames='w-[100px] text-right pie-[22px]'\n placeholder='Interval'\n value={mutationInterval}\n onChange={({ target: { value } }) => setMutationInterval(value)}\n />\n </Input.Root>\n <Timer className={mx('absolute inline-end-1 block-start-1 mt-[6px]', getSize(3))} />\n </div>\n <div className='relative' title='mutation jitter'>\n <Input.Root>\n <Input.TextInput\n autoComplete='off'\n size={5}\n classNames='w-[100px] text-right pie-[22px]'\n placeholder='Jitter'\n value={mutationJitter}\n onChange={({ target: { value } }) => setMutationJitter(value)}\n />\n </Input.Root>\n <PlusMinus className={mx('absolute inline-end-1 block-start-1 mt-[6px]', getSize(3))} />\n </div>\n <Button onClick={handleToggleRunning}>\n {running ? <HandPalm className={getSize(5)} /> : <Play className={getSize(5)} />}\n </Button>\n <Button onClick={handleUpdate}>\n <ArrowClockwise className={getSize(5)} />\n </Button>\n <Button onClick={handleCopy}>\n <DownloadSimple className={getSize(5)} />\n </Button>\n\n <div className='grow' />\n <Button onClick={handleCreateEpoch} title='Create epoch'>\n <FlagPennant className={mx(getSize(5))} />\n </Button>\n <Button onClick={handleCreateInvitation} title='Create Space invitation'>\n <UserCirclePlus className={mx(getSize(5), 'text-blue-500')} />\n </Button>\n </>\n }\n >\n <ObjectCreator space={space} onAddObjects={onAddObjects} />\n </DebugPanel>\n );\n};\n\nexport default DebugSpace;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC, useMemo, useState } from 'react';\n\nimport { type EchoReactiveObject, type ReactiveObject } from '@dxos/echo-schema';\nimport { type Space } from '@dxos/react-client/echo';\nimport { Button, DensityProvider } from '@dxos/react-ui';\nimport { createColumnBuilder, type TableColumnDef, Table } from '@dxos/react-ui-table';\n\nimport { SchemasNames, createSpaceObjectGenerator } from '../scaffolding';\n\nexport type CreateObjectsParams = {\n enabled: boolean;\n schema: SchemasNames;\n objectsCount: number;\n mutationsCount: number;\n maxContentLength: number;\n mutationSize: number;\n};\n\nconst CREATE_OBJECTS_IN_ONE_CHUNK = 10;\n\nexport const ObjectCreator: FC<{\n space: Space;\n onAddObjects?: (objects: ReactiveObject<any>[]) => void;\n}> = ({ space, onAddObjects }) => {\n const generator = useMemo(() => createSpaceObjectGenerator(space), [space]);\n\n const [objectsToCreate, setObjectsToCreate] = useState<CreateObjectsParams[]>([\n {\n enabled: true,\n schema: SchemasNames.document,\n objectsCount: 10,\n mutationsCount: 10,\n mutationSize: 10,\n maxContentLength: 1000,\n },\n {\n enabled: true,\n schema: SchemasNames.diagram,\n objectsCount: 10,\n mutationsCount: 10,\n mutationSize: 10,\n maxContentLength: 1000,\n },\n {\n enabled: true,\n schema: SchemasNames.sheet,\n objectsCount: 10,\n mutationsCount: 10,\n mutationSize: 10,\n maxContentLength: 1000,\n },\n ]);\n\n const handleCreate = async () => {\n for (const params of objectsToCreate) {\n if (!params.enabled) {\n continue;\n }\n let objectsCreated = 0;\n while (objectsCreated < params.objectsCount) {\n const objects = (await generator.createObjects({\n [params.schema]: Math.min(CREATE_OBJECTS_IN_ONE_CHUNK, params.objectsCount - objectsCreated),\n })) as EchoReactiveObject<any>[];\n\n await generator.mutateObjects(objects, {\n count: params.mutationsCount,\n mutationSize: params.mutationSize,\n maxContentLength: params.maxContentLength,\n });\n objectsCreated += objects.length;\n onAddObjects?.(objects);\n }\n }\n await space.db.flush();\n };\n const handleChangeOnRow = (row: CreateObjectsParams, key: string, value: any) => {\n const newObjects = [...objectsToCreate];\n Object.assign(newObjects.find((object) => object.schema === row.schema)!, { [key]: value });\n setObjectsToCreate(newObjects);\n };\n\n const { helper, builder } = createColumnBuilder<CreateObjectsParams>();\n const columns: TableColumnDef<CreateObjectsParams>[] = [\n helper.accessor('enabled', builder.switch({ label: 'Enabled', onUpdate: handleChangeOnRow })),\n helper.accessor('schema', builder.string({ classNames: 'font-mono', label: 'Schema' })),\n helper.accessor('objectsCount', builder.number({ label: 'Objects', onUpdate: handleChangeOnRow })),\n helper.accessor('mutationsCount', builder.number({ label: 'Mutations', onUpdate: handleChangeOnRow })),\n helper.accessor('mutationSize', builder.number({ label: 'Mut. Size', onUpdate: handleChangeOnRow })),\n helper.accessor('maxContentLength', builder.number({ label: 'Length', onUpdate: handleChangeOnRow })),\n ];\n\n return (\n <>\n <DensityProvider density={'fine'}>\n <Table.Root>\n <Table.Viewport>\n <Table.Main<CreateObjectsParams> columns={columns} data={objectsToCreate} />\n </Table.Viewport>\n </Table.Root>\n </DensityProvider>\n <Button onClick={handleCreate}>Create</Button>\n </>\n );\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport {\n createShapeId,\n defaultBindingUtils,\n defaultShapeUtils,\n defaultTools,\n Editor,\n type TLParentId,\n} from '@tldraw/tldraw';\n\nimport { sleep } from '@dxos/async';\nimport { next as A } from '@dxos/automerge/automerge';\nimport {\n SpaceObjectGenerator,\n type TestGeneratorMap,\n type TestMutationsMap,\n type TestSchemaMap,\n} from '@dxos/echo-generator';\nimport { create } from '@dxos/echo-schema';\nimport { log } from '@dxos/log';\nimport { DocumentType, TextType } from '@dxos/plugin-markdown/types';\nimport { createTestSheet } from '@dxos/plugin-sheet/testing';\nimport { SheetType } from '@dxos/plugin-sheet/types';\nimport { TLDrawStoreAdapter } from '@dxos/plugin-sketch';\nimport { CanvasType, DiagramType, TLDRAW_SCHEMA } from '@dxos/plugin-sketch/types';\nimport { faker } from '@dxos/random';\nimport { createDocAccessor, type Space } from '@dxos/react-client/echo';\n\n// TODO(wittjosiah): Remove? Just use typenames.\nexport enum SchemasNames {\n document = 'dxos.org/type/Document',\n diagram = 'dxos.org/type/Diagram',\n sheet = 'dxos.org/type/SheetType',\n}\n\nexport const SchemasMap: TestSchemaMap<SchemasNames> = {\n [SchemasNames.document]: DocumentType,\n [SchemasNames.diagram]: DiagramType,\n [SchemasNames.sheet]: SheetType,\n};\n\nexport const ObjectGenerators: TestGeneratorMap<SchemasNames> = {\n [SchemasNames.document]: () => {\n const name = faker.lorem.sentence({ min: 2, max: 3 });\n return { name, content: create(TextType, { content: '' }), threads: [] };\n },\n\n [SchemasNames.diagram]: () => {\n const name = faker.lorem.sentence({ min: 2, max: 3 });\n return {\n name,\n canvas: create(CanvasType, { schema: TLDRAW_SCHEMA, content: {} }),\n };\n },\n\n [SchemasNames.sheet]: () => {\n const name = faker.lorem.sentence({ min: 2, max: 3 });\n return createTestSheet({ name });\n },\n};\n\nexport const MutationsGenerators: TestMutationsMap<SchemasNames> = {\n [SchemasNames.document]: async (object, params) => {\n const accessor = createDocAccessor<DocumentType>(object.content, ['content']);\n\n for (let i = 0; i < params.count; i++) {\n const length = object.content?.content?.length ?? 0;\n accessor.handle.change((doc) => {\n A.splice(\n doc,\n accessor.path.slice(),\n 0,\n params.maxContentLength >= length ? 0 : params.mutationSize,\n faker.string.hexadecimal({ length: params.mutationSize - 1 }) + ' ',\n );\n });\n\n // Release the event loop.\n if (i % 100 === 0 || i === params.count - 1) {\n log.info('Mutation:', { mutationIdx: i });\n await sleep(1);\n }\n }\n },\n\n [SchemasNames.diagram]: async (object, params) => {\n const store = new TLDrawStoreAdapter();\n await store.open(createDocAccessor<CanvasType>(object.canvas, ['content']));\n const app = new Editor({\n store: store.store!,\n shapeUtils: defaultShapeUtils,\n bindingUtils: defaultBindingUtils,\n tools: defaultTools,\n getContainer: () => document.getElementsByTagName('body')[0],\n });\n\n //\n // Draw spiral.\n //\n const r = 100;\n const a = 0.05;\n const cx = 200;\n const cy = 200;\n\n for (let i = 0; i < params.count; i++) {\n const t = i;\n const t1 = i + 1;\n const x = cx + a * t * r * Math.cos(t);\n const y = cy + a * t * r * Math.sin(t);\n const x1 = cx + a * t1 * r * Math.cos(t1);\n const y1 = cy + a * t1 * r * Math.sin(t1);\n\n app.createShape({\n id: createShapeId(),\n isLocked: false,\n meta: {},\n opacity: 1,\n parentId: 'page:page' as TLParentId,\n props: {\n arrowheadEnd: 'none',\n arrowheadStart: 'none',\n bend: 0,\n color: 'black',\n dash: 'draw',\n start: { x, y },\n end: { x: x1, y: y1 },\n fill: 'none',\n font: 'draw',\n labelColor: 'black',\n labelPosition: 0.5,\n scale: 1,\n size: 'm',\n },\n rotation: 0,\n type: 'arrow',\n typeName: 'shape',\n x: 0,\n y: 0,\n });\n\n // Release the event loop.\n if (i % 100 === 0) {\n await sleep(1);\n }\n }\n },\n\n [SchemasNames.sheet]: async (object, params) => {\n // TODO: Implement.\n },\n};\n\nexport const createSpaceObjectGenerator = (space: Space) =>\n new SpaceObjectGenerator(space, SchemasMap, ObjectGenerators, MutationsGenerators);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAIA,SACEA,gBACAC,gBACAC,MACAC,aACAC,UACAC,MACAC,WACAC,OACAC,sBACK;AACP,OAAOC,UAAkBC,YAAYC,WAAAA,UAASC,YAAAA,iBAAgB;AAG9D,SAASC,gBAAAA,qBAAoB;AAC7B,SAASC,kBAAkB;AAC3B,SAASC,SAAAA,cAAa;AACtB,SAASC,iBAAiB;AAC1B,SAASC,QAAoBC,0BAA0B;AACvD,SAASC,yBAAyB;AAClC,SAASC,sBAAsB;AAC/B,SAASC,UAAAA,SAAQC,OAAOC,uBAAuB;AAC/C,SAASC,SAASC,UAAU;AAC5B,SAASC,oBAAoB;;;ACvB7B,OAAOC,SAAkBC,SAASC,gBAAgB;AAIlD,SAASC,QAAQC,uBAAuB;AACxC,SAASC,qBAA0CC,aAAa;;;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A,cAACM,MAAME,WAAS;MACdC,cAAa;MACbC,MAAM;MACNC,YAAW;MACXC,aAAY;MACZC,OAAOrE;MACPsE,UAAU,CAAC,EAAEC,QAAQ,EAAEF,MAAK,EAAE,MAAOpE,kBAAkBoE,KAAAA;SAG3D,gBAAAb,OAAA,cAACoB,WAAAA;MAAUhB,WAAWa,GAAG,gDAAgDC,QAAQ,CAAA,CAAA;SAEnF,gBAAAlB,OAAA,cAACqB,SAAAA;MAAOC,SAASpE;OACdL,UAAU,gBAAAmD,OAAA,cAACuB,UAAAA;MAASnB,WAAWc,QAAQ,CAAA;SAAS,gBAAAlB,OAAA,cAACwB,MAAAA;MAAKpB,WAAWc,QAAQ,CAAA;SAE5E,gBAAAlB,OAAA,cAACqB,SAAAA;MAAOC,SAASvG;OACf,gBAAAiF,OAAA,cAACyB,gBAAAA;MAAerB,WAAWc,QAAQ,CAAA;SAErC,gBAAAlB,OAAA,cAACqB,SAAAA;MAAOC,SAAS5F;OACf,gBAAAsE,OAAA,cAAC0B,gBAAAA;MAAetB,WAAWc,QAAQ,CAAA;SAGrC,gBAAAlB,OAAA,cAACG,OAAAA;MAAIC,WAAU;QACf,gBAAAJ,OAAA,cAACqB,SAAAA;MAAOC,SAASzB;MAAmBQ,OAAM;OACxC,gBAAAL,OAAA,cAAC2B,aAAAA;MAAYvB,WAAWa,GAAGC,QAAQ,CAAA,CAAA;SAErC,gBAAAlB,OAAA,cAACqB,SAAAA;MAAOC,SAAShD;MAAwB+B,OAAM;OAC7C,gBAAAL,OAAA,cAAC4B,gBAAAA;MAAexB,WAAWa,GAAGC,QAAQ,CAAA,GAAI,eAAA;;KAKhD,gBAAAlB,OAAA,cAAC6B,eAAAA;IAAcvH;IAAcC;;AAGnC;AAEA,IAAA,qBAAeF;",
|
|
6
|
+
"names": ["ArrowClockwise", "DownloadSimple", "Flag", "FlagPennant", "HandPalm", "Play", "PlusMinus", "Timer", "UserCirclePlus", "React", "useContext", "useMemo", "useState", "DocumentType", "Invitation", "faker", "useClient", "Filter", "useSpaceInvitation", "InvitationEncoder", "useAsyncEffect", "Button", "Input", "useFileDownload", "getSize", "mx", "safeParseInt", "React", "useMemo", "useState", "Button", "DensityProvider", "createColumnBuilder", "Table", "createShapeId", "defaultBindingUtils", "defaultShapeUtils", "defaultTools", "Editor", "sleep", "next", "A", "SpaceObjectGenerator", "create", "log", "DocumentType", "TextType", "createTestSheet", "SheetType", "TLDrawStoreAdapter", "CanvasType", "DiagramType", "TLDRAW_SCHEMA", "faker", "createDocAccessor", "SchemasNames", "SchemasMap", "ObjectGenerators", "name", "lorem", "sentence", "min", "max", "content", "threads", "canvas", "schema", "MutationsGenerators", "object", "params", "accessor", "i", "count", "length", "handle", "change", "doc", "splice", "path", "slice", "maxContentLength", "mutationSize", "string", "hexadecimal", "info", "mutationIdx", "store", "open", "app", "shapeUtils", "bindingUtils", "tools", "getContainer", "document", "getElementsByTagName", "r", "a", "cx", "cy", "t", "t1", "x", "Math", "cos", "y", "sin", "x1", "y1", "createShape", "id", "isLocked", "meta", "opacity", "parentId", "props", "arrowheadEnd", "arrowheadStart", "bend", "color", "dash", "start", "end", "fill", "font", "labelColor", "labelPosition", "scale", "size", "rotation", "type", "typeName", "createSpaceObjectGenerator", "space", "CREATE_OBJECTS_IN_ONE_CHUNK", "ObjectCreator", "space", "onAddObjects", "generator", "useMemo", "createSpaceObjectGenerator", "objectsToCreate", "setObjectsToCreate", "useState", "enabled", "schema", "SchemasNames", "document", "objectsCount", "mutationsCount", "mutationSize", "maxContentLength", "diagram", "sheet", "handleCreate", "params", "objectsCreated", "objects", "createObjects", "Math", "min", "mutateObjects", "count", "length", "db", "flush", "handleChangeOnRow", "row", "key", "value", "newObjects", "Object", "assign", "find", "object", "helper", "builder", "createColumnBuilder", "columns", "accessor", "switch", "label", "onUpdate", "string", "classNames", "number", "DensityProvider", "density", "Table", "Root", "Viewport", "Main", "data", "Button", "onClick", "DEFAULT_COUNT", "DEFAULT_PERIOD", "DEFAULT_JITTER", "useRefresh", "update", "setUpdate", "useState", "DebugSpace", "space", "onAddObjects", "connect", "useSpaceInvitation", "key", "client", "useClient", "data", "setData", "handleUpdate", "useAsyncEffect", "isMounted", "diagnostics", "truncate", "spaces", "find", "toHex", "startsWith", "download", "useFileDownload", "handleCopy", "Blob", "JSON", "stringify", "undefined", "type", "Date", "toISOString", "replace", "mutationCount", "setMutationCount", "String", "mutationInterval", "setMutationInterval", "mutationJitter", "setMutationJitter", "generator", "useMemo", "createSpaceObjectGenerator", "running", "start", "stop", "useContext", "DebugContext", "handleToggleRunning", "objects", "db", "query", "Filter", "schema", "DocumentType", "run", "length", "object", "faker", "helpers", "arrayElement", "mutateObject", "count", "mutationSize", "maxContentLength", "safeParseInt", "interval", "jitter", "handleCreateInvitation", "invitation", "share", "Invitation", "Type", "INTERACTIVE", "authMethod", "AuthMethod", "NONE", "multiUse", "code", "InvitationEncoder", "encode", "get", "URL", "window", "origin", "searchParams", "set", "url", "navigator", "clipboard", "writeText", "handleCreateEpoch", "internal", "createEpoch", "React", "DebugPanel", "menu", "div", "className", "title", "Input", "Root", "TextInput", "autoComplete", "size", "classNames", "placeholder", "value", "onChange", "target", "Flag", "mx", "getSize", "Timer", "PlusMinus", "Button", "onClick", "HandPalm", "Play", "ArrowClockwise", "DownloadSimple", "FlagPennant", "UserCirclePlus", "ObjectCreator"]
|
|
7
7
|
}
|
|
@@ -12,6 +12,7 @@ import { Bug, Hammer } from "@phosphor-icons/react";
|
|
|
12
12
|
import React5, { useEffect as useEffect3, useState as useState3 } from "react";
|
|
13
13
|
import { getPlugin, parseGraphPlugin as parseGraphPlugin2, parseIntentPlugin, resolvePlugin } from "@dxos/app-framework";
|
|
14
14
|
import { Timer } from "@dxos/async";
|
|
15
|
+
import { Devtools } from "@dxos/devtools";
|
|
15
16
|
import { LocalStorageStore } from "@dxos/local-storage";
|
|
16
17
|
import { createExtension, Graph } from "@dxos/plugin-graph";
|
|
17
18
|
import { SpaceAction } from "@dxos/plugin-space";
|
|
@@ -362,9 +363,8 @@ var Wireframe = ({ label, data, className }) => {
|
|
|
362
363
|
};
|
|
363
364
|
|
|
364
365
|
// packages/plugins/experimental/plugin-debug/src/components/index.ts
|
|
365
|
-
var DebugGlobal = React4.lazy(() => import("./DebugGlobal-
|
|
366
|
-
var DebugSpace = React4.lazy(() => import("./DebugSpace-
|
|
367
|
-
var DevtoolsMain = React4.lazy(() => import("./DevtoolsMain-DTAWVF22.mjs"));
|
|
366
|
+
var DebugGlobal = React4.lazy(() => import("./DebugGlobal-H56M2VL4.mjs"));
|
|
367
|
+
var DebugSpace = React4.lazy(() => import("./DebugSpace-NHPMLATA.mjs"));
|
|
368
368
|
|
|
369
369
|
// packages/plugins/experimental/plugin-debug/src/translations.ts
|
|
370
370
|
var translations_default = [
|
|
@@ -579,7 +579,7 @@ var DebugPlugin = () => {
|
|
|
579
579
|
let component;
|
|
580
580
|
if (role === "main" || role === "article") {
|
|
581
581
|
if (primary === "devtools" && settings.values.devtools) {
|
|
582
|
-
component = /* @__PURE__ */ React5.createElement(
|
|
582
|
+
component = /* @__PURE__ */ React5.createElement(Devtools, null);
|
|
583
583
|
} else if (!primary || typeof primary !== "object" || !settings.values.debug) {
|
|
584
584
|
component = null;
|
|
585
585
|
} else if ("space" in primary && isSpace(primary.space)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/DebugPlugin.tsx", "../../../src/components/index.ts", "../../../src/components/DebugSettings.tsx", "../../../src/components/DebugStatus.tsx", "../../../src/components/Wireframe.tsx", "../../../src/translations.ts", "../../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Bug, Hammer, type IconProps } from '@phosphor-icons/react';\nimport React, { type ReactNode, useEffect, useState } from 'react';\n\nimport {\n getPlugin,\n parseGraphPlugin,\n parseIntentPlugin,\n resolvePlugin,\n type IntentPluginProvides,\n type Plugin,\n type PluginDefinition,\n} from '@dxos/app-framework';\nimport { Timer } from '@dxos/async';\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { type ClientPluginProvides } from '@dxos/plugin-client';\nimport { createExtension, Graph, type Node } from '@dxos/plugin-graph';\nimport { SpaceAction } from '@dxos/plugin-space';\nimport { CollectionType } from '@dxos/plugin-space/types';\nimport { type Client } from '@dxos/react-client';\nimport { type Space, SpaceState, isSpace } from '@dxos/react-client/echo';\nimport { Main } from '@dxos/react-ui';\nimport {\n baseSurface,\n topbarBlockPaddingStart,\n fixedInsetFlexLayout,\n bottombarBlockPaddingEnd,\n} from '@dxos/react-ui-theme';\n\nimport { DebugGlobal, DebugSettings, DebugSpace, DebugStatus, DevtoolsMain, Wireframe } from './components';\nimport meta, { DEBUG_PLUGIN } from './meta';\nimport translations from './translations';\nimport { DebugContext, type DebugSettingsProps, type DebugPluginProvides, DebugAction } from './types';\n\nexport const SETTINGS_KEY = DEBUG_PLUGIN + '/settings';\n\nexport const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {\n const settings = new LocalStorageStore<DebugSettingsProps>(DEBUG_PLUGIN, { debug: true, devtools: true });\n let intentPlugin: Plugin<IntentPluginProvides>;\n\n return {\n meta,\n ready: async (plugins) => {\n intentPlugin = resolvePlugin(plugins, parseIntentPlugin)!;\n settings\n .prop({ key: 'debug', type: LocalStorageStore.bool({ allowUndefined: true }) })\n .prop({ key: 'devtools', type: LocalStorageStore.bool({ allowUndefined: true }) })\n .prop({ key: 'wireframe', type: LocalStorageStore.bool({ allowUndefined: true }) });\n\n // TODO(burdon): Remove hacky dependency on global variable.\n // Used to test how composer handles breaking protocol changes.\n const composer = (window as any).composer;\n composer.changeStorageVersionInMetadata = async (version: number) => {\n const { changeStorageVersionInMetadata } = await import('@dxos/echo-pipeline/testing');\n const { createStorageObjects } = await import('@dxos/client-services');\n const client: Client = (window as any).dxos.client;\n const config = client.config;\n await client.destroy();\n const { storage } = createStorageObjects(config.values?.runtime?.client?.storage ?? {});\n await changeStorageVersionInMetadata(storage, version);\n location.pathname = '/';\n };\n },\n unload: async () => {\n settings.close();\n },\n provides: {\n settings: settings.values,\n translations,\n context: ({ children }) => {\n const [timer, setTimer] = useState<Timer>();\n useEffect(() => timer?.state.on((value) => !value && setTimer(undefined)), [timer]);\n useEffect(() => {\n timer?.stop();\n }, []);\n\n return (\n <DebugContext.Provider\n value={{\n running: !!timer,\n start: (cb, options) => {\n timer?.stop();\n setTimer(new Timer(cb).start(options));\n },\n stop: () => timer?.stop(),\n }}\n >\n {children}\n </DebugContext.Provider>\n );\n },\n graph: {\n builder: (plugins) => {\n const graphPlugin = resolvePlugin(plugins, parseGraphPlugin);\n\n // TODO(burdon): Combine nodes into single subtree.\n\n return [\n // Devtools node.\n createExtension({\n id: 'dxos.org/plugin/debug/devtools',\n filter: (node): node is Node<null> => !!settings.values.devtools && node.id === 'root',\n connector: () => [\n {\n // TODO(zan): Removed `/` because it breaks deck layout reload. Fix?\n id: 'dxos.org.plugin.debug.devtools',\n data: 'devtools',\n type: 'dxos.org/plugin/debug/devtools',\n properties: {\n label: ['devtools label', { ns: DEBUG_PLUGIN }],\n icon: (props: IconProps) => <Hammer {...props} />,\n iconSymbol: 'ph--hammer--regular',\n },\n },\n ],\n }),\n\n // Debug node.\n createExtension({\n id: 'dxos.org/plugin/debug/debug',\n filter: (node): node is Node<null> => !!settings.values.debug && node.id === 'root',\n connector: () => [\n {\n id: 'dxos.org/plugin/debug/debug',\n type: 'dxos.org/plugin/debug/debug',\n data: { graph: graphPlugin?.provides.graph },\n properties: {\n label: ['debug label', { ns: DEBUG_PLUGIN }],\n icon: (props: IconProps) => <Bug {...props} />,\n iconSymbol: 'ph--bug--regular',\n },\n },\n ],\n }),\n\n // Space debug nodes.\n createExtension({\n id: 'dxos.org/plugin/debug/spaces',\n filter: (node): node is Node<Space> => !!settings.values.debug && isSpace(node.data),\n connector: ({ node }) => {\n const space = node.data;\n return [\n {\n id: `${space.id}-debug`,\n type: 'dxos.org/plugin/debug/space',\n data: { space },\n properties: {\n label: ['debug label', { ns: DEBUG_PLUGIN }],\n icon: (props: IconProps) => <Bug {...props} />,\n iconSymbol: 'ph--bug--regular',\n },\n },\n ];\n },\n }),\n ];\n },\n },\n intent: {\n resolver: async (intent, plugins) => {\n switch (intent.action) {\n case DebugAction.OPEN_DEVTOOLS: {\n const clientPlugin = getPlugin<ClientPluginProvides>(plugins, 'dxos.org/plugin/client');\n const client = clientPlugin.provides.client;\n const vaultUrl = client.config.values?.runtime?.client?.remoteSource ?? 'https://halo.dxos.org';\n\n // Check if we're serving devtools locally on the usual port.\n let devtoolsUrl = 'http://localhost:5174';\n try {\n // TODO(burdon): Test header to see if this is actually devtools.\n await fetch(devtoolsUrl);\n } catch {\n // Match devtools to running app.\n const isDev = window.location.href.includes('.dev.') || window.location.href.includes('localhost');\n devtoolsUrl = `https://devtools${isDev ? '.dev.' : '.'}dxos.org`;\n }\n\n window.open(`${devtoolsUrl}?target=${vaultUrl}`, '_blank');\n return { data: true };\n }\n }\n },\n },\n surface: {\n component: ({ name, data, role }) => {\n switch (role) {\n case 'settings':\n return data.plugin === meta.id ? <DebugSettings settings={settings.values} /> : null;\n case 'status':\n return <DebugStatus />;\n }\n\n const primary = data.active ?? data.object;\n let component: ReactNode;\n if (role === 'main' || role === 'article') {\n if (primary === 'devtools' && settings.values.devtools) {\n component = <DevtoolsMain />;\n } else if (!primary || typeof primary !== 'object' || !settings.values.debug) {\n component = null;\n } else if ('space' in primary && isSpace(primary.space)) {\n component = (\n <DebugSpace\n space={primary.space}\n onAddObjects={(objects) => {\n if (!isSpace(primary.space)) {\n return;\n }\n\n const collection =\n primary.space.state.get() === SpaceState.SPACE_READY &&\n primary.space.properties[CollectionType.typename];\n if (!(collection instanceof CollectionType)) {\n return;\n }\n\n void intentPlugin?.provides.intent.dispatch(\n objects.map((object) => ({\n action: SpaceAction.ADD_OBJECT,\n data: { target: collection, object },\n })),\n );\n }}\n />\n );\n } else if ('graph' in primary && primary.graph instanceof Graph) {\n component = <DebugGlobal graph={primary.graph} />;\n } else {\n component = null;\n }\n }\n\n if (!component) {\n if (settings.values.wireframe) {\n if (role === 'main' || role === 'article' || role === 'section') {\n const primary = data.active ?? data.object;\n if (!(primary instanceof CollectionType)) {\n return <Wireframe label={role} data={data} className='row-span-2 overflow-hidden' />;\n }\n }\n }\n\n return null;\n }\n\n switch (role) {\n case 'article':\n return (\n <div role='none' className='row-span-2 rounded-t-md overflow-x-auto'>\n {component}\n </div>\n );\n case 'main':\n return (\n <Main.Content\n classNames={[baseSurface, fixedInsetFlexLayout, topbarBlockPaddingStart, bottombarBlockPaddingEnd]}\n >\n {component}\n </Main.Content>\n );\n }\n\n return null;\n },\n },\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\n// Lazily load components for content surfaces.\nexport const DebugGlobal = React.lazy(() => import('./DebugGlobal'));\nexport const DebugSpace = React.lazy(() => import('./DebugSpace'));\nexport const DevtoolsMain = React.lazy(() => import('./DevtoolsMain'));\n\nexport * from './DebugSettings';\nexport * from './DebugStatus';\nexport * from './Wireframe';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Gift, DownloadSimple, FirstAidKit } from '@phosphor-icons/react';\nimport React, { useEffect, useState } from 'react';\n\nimport { parseFileManagerPlugin, useResolvePlugin } from '@dxos/app-framework';\nimport { type ConfigProto, defs, SaveConfig, Storage } from '@dxos/config';\nimport { log } from '@dxos/log';\nimport { SettingsValue } from '@dxos/plugin-settings';\nimport { useClient } from '@dxos/react-client';\nimport { useTranslation, Button, Toast, Input, useFileDownload, Select } from '@dxos/react-ui';\nimport { getSize, mx } from '@dxos/react-ui-theme';\nimport { setDeep } from '@dxos/util';\n\nimport { DEBUG_PLUGIN } from '../meta';\nimport { type DebugSettingsProps } from '../types';\n\ntype Toast = {\n title: string;\n description?: string;\n};\n\nconst StorageAdapters = {\n opfs: defs.Runtime.Client.Storage.StorageDriver.WEBFS,\n idb: defs.Runtime.Client.Storage.StorageDriver.IDB,\n} as const;\n\nexport const DebugSettings = ({ settings }: { settings: DebugSettingsProps }) => {\n const { t } = useTranslation(DEBUG_PLUGIN);\n const [toast, setToast] = useState<Toast>();\n const client = useClient();\n const download = useFileDownload();\n // TODO(mykola): Get updates from other places that change Config.\n const [storageConfig, setStorageConfig] = useState<ConfigProto>({});\n const fileManagerPlugin = useResolvePlugin(parseFileManagerPlugin);\n\n useEffect(() => {\n void Storage().then((config) => setStorageConfig(config));\n }, []);\n\n const handleToast = (toast: Toast) => {\n setToast(toast);\n const t = setTimeout(() => setToast(undefined), 5_000);\n return () => clearTimeout(t);\n };\n\n const handleDownload = async () => {\n const data = await client.diagnostics();\n const file = new Blob([JSON.stringify(data, undefined, 2)], { type: 'text/plain' });\n const fileName = `composer-${new Date().toISOString().replace(/\\W/g, '-')}.json`;\n download(file, fileName);\n\n if (fileManagerPlugin?.provides.file.upload) {\n const info = await fileManagerPlugin.provides.file.upload(new File([file], fileName), client.spaces.default);\n if (!info) {\n log.error('diagnostics failed to upload to IPFS');\n return;\n }\n handleToast({ title: t('settings uploaded'), description: t('settings uploaded to clipboard') });\n\n // TODO(nf): move to IpfsPlugin?\n const url = client.config.values.runtime!.services!.ipfs!.gateway + '/' + info.cid;\n void navigator.clipboard.writeText(url);\n handleToast({ title: t('settings uploaded'), description: t('settings uploaded to clipboard') });\n log.info('diagnostics', { url });\n }\n };\n\n const handleRepair = async () => {\n try {\n const info = await client.repair();\n setStorageConfig(await Storage());\n handleToast({ title: t('settings repair success'), description: JSON.stringify(info, undefined, 2) });\n } catch (err: any) {\n handleToast({ title: t('settings repair failed'), description: err.message });\n }\n };\n\n return (\n <>\n <SettingsValue label={t('settings show debug panel')}>\n <Input.Switch checked={settings.debug} onCheckedChange={(checked) => (settings.debug = !!checked)} />\n </SettingsValue>\n <SettingsValue label={t('settings show devtools panel')}>\n <Input.Switch checked={settings.devtools} onCheckedChange={(checked) => (settings.devtools = !!checked)} />\n </SettingsValue>\n <SettingsValue label={t('settings wireframe')}>\n <Input.Switch checked={settings.wireframe} onCheckedChange={(checked) => (settings.wireframe = !!checked)} />\n </SettingsValue>\n <SettingsValue label={t('settings download diagnostics')}>\n <Button onClick={handleDownload}>\n <DownloadSimple className={getSize(5)} />\n </Button>\n </SettingsValue>\n <SettingsValue label={t('settings repair')}>\n <Button onClick={handleRepair}>\n <FirstAidKit className={getSize(5)} />\n </Button>\n </SettingsValue>\n\n {/* TODO(burdon): Move to layout? */}\n {toast && (\n <Toast.Root>\n <Toast.Body>\n <Toast.Title>\n <Gift className={mx(getSize(5), 'inline mr-1')} weight='duotone' />\n <span>{toast.title}</span>\n </Toast.Title>\n {toast.description && <Toast.Description>{toast.description}</Toast.Description>}\n </Toast.Body>\n </Toast.Root>\n )}\n\n <SettingsValue label={t('settings choose storage adaptor')}>\n <Select.Root\n value={\n Object.entries(StorageAdapters).find(\n ([name, value]) => value === storageConfig?.runtime?.client?.storage?.dataStore,\n )?.[0]\n }\n onValueChange={(value) => {\n if (confirm(t('settings storage adapter changed alert'))) {\n updateConfig(\n storageConfig,\n setStorageConfig,\n ['runtime', 'client', 'storage', 'dataStore'],\n StorageAdapters[value as keyof typeof StorageAdapters],\n );\n }\n }}\n >\n <Select.TriggerButton placeholder={t('settings data store label')} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {Object.keys(StorageAdapters).map((key) => (\n <Select.Option key={key} value={key}>\n {t(`settings storage adaptor ${key} label`)}\n </Select.Option>\n ))}\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n </SettingsValue>\n </>\n );\n};\n\nconst updateConfig = (config: ConfigProto, setConfig: (newConfig: ConfigProto) => void, path: string[], value: any) => {\n const storageConfigCopy = JSON.parse(JSON.stringify(config ?? {}));\n setDeep(storageConfigCopy, path, value);\n setConfig(storageConfigCopy);\n queueMicrotask(async () => {\n await SaveConfig(storageConfigCopy);\n });\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ChartBar, Circle, Lightning, LightningSlash } from '@phosphor-icons/react';\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { firstIdInPart, parseGraphPlugin, parseNavigationPlugin, useResolvePlugin } from '@dxos/app-framework';\nimport { TimeoutError } from '@dxos/async';\nimport { StatsPanel, useStats } from '@dxos/devtools';\nimport { log } from '@dxos/log';\nimport { getActiveSpace } from '@dxos/plugin-space';\nimport { StatusBar } from '@dxos/plugin-status-bar';\nimport { ConnectionState } from '@dxos/protocols/proto/dxos/client/services';\nimport { useNetworkStatus } from '@dxos/react-client/mesh';\nimport { getSize, mx } from '@dxos/react-ui-theme';\n\nconst styles = {\n success: 'text-sky-300 dark:text-green-700',\n warning: 'text-orange-300 dark:text-orange-600',\n error: 'text-red-300 dark:text-red-600',\n};\n\n// TODO(burdon): Move out of debug plugin.\n// TODO(burdon): Make pluggable (move indicators to relevant plugins).\n// TODO(burdon): Vault heartbeat indicator (global scope)?\n\n/**\n * Ensure light doesn't flicker immediately after start.\n */\n// TODO(burdon): Move to @dxos/async (debounce?)\nconst _timer = (cb: (err?: Error) => void, options?: { min?: number; max?: number }) => {\n const min = options?.min ?? 500;\n let start: number;\n let pending: NodeJS.Timeout;\n let timeout: NodeJS.Timeout;\n return {\n start: () => {\n start = Date.now();\n clearTimeout(pending);\n if (options?.max) {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n cb(new TimeoutError(options.max));\n }, options.max);\n }\n },\n stop: () => {\n clearTimeout(timeout);\n const delta = Date.now() - start;\n if (delta < min) {\n pending = setTimeout(() => {\n cb();\n }, min - delta);\n }\n },\n };\n};\n\n/**\n * Global error handler.\n */\n// TODO(burdon): Integrate with Sentry?\nconst ErrorIndicator = () => {\n const [, forceUpdate] = useState({});\n const errorRef = useRef<Error>();\n useEffect(() => {\n const errorListener = (event: any) => {\n const error: Error = event.error ?? event.reason;\n // event.preventDefault();\n if (errorRef.current !== error) {\n // eslint-disable-next-line no-console\n log.error('onError', { event });\n errorRef.current = error;\n forceUpdate({});\n }\n };\n\n // TODO(burdon): Register globally?\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event\n window.addEventListener('error', errorListener);\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/unhandledrejection_event\n window.addEventListener('unhandledrejection', errorListener);\n\n return () => {\n window.removeEventListener('error', errorListener);\n window.removeEventListener('unhandledrejection', errorListener);\n };\n }, []);\n\n const handleReset = () => {\n errorRef.current = undefined;\n forceUpdate({});\n };\n\n if (errorRef.current) {\n return (\n <StatusBar.Button title={errorRef.current.message} onClick={handleReset}>\n <Circle weight='fill' className={mx(styles.error, getSize(3))} />\n </StatusBar.Button>\n );\n } else {\n return (\n <StatusBar.Item title='No errors.'>\n <Circle weight='fill' className={getSize(3)} />\n </StatusBar.Item>\n );\n }\n};\n\n/**\n * Swarm connection handler.\n */\nconst SwarmIndicator = () => {\n const [state, setState] = useState(0);\n const { swarm } = useNetworkStatus();\n useEffect(() => {\n setState(swarm === ConnectionState.ONLINE ? 0 : 1);\n }, [swarm]);\n\n if (state === 0) {\n return (\n <StatusBar.Item title='Connected to swarm.'>\n <Lightning className={getSize(4)} />\n </StatusBar.Item>\n );\n } else {\n return (\n <StatusBar.Item title='Disconnected from swarm.'>\n <LightningSlash className={mx(styles.warning, getSize(4))} />\n </StatusBar.Item>\n );\n }\n};\n\n/**\n * Space saving indicator.\n */\nconst SavingIndicator = () => {\n const [state, _setState] = useState(0);\n const navigationPlugin = useResolvePlugin(parseNavigationPlugin);\n const graphPlugin = useResolvePlugin(parseGraphPlugin);\n const location = navigationPlugin?.provides.location;\n const graph = graphPlugin?.provides.graph;\n const _space = location && graph ? getActiveSpace(graph, firstIdInPart(location.active, 'main')) : undefined;\n // TODO(dmaretskyi): Fix this when we have save status for automerge.\n // useEffect(() => {\n // if (!space) {\n // return;\n // }\n // const { start, stop } = timer(() => setState(0), { min: 250 });\n // return space.db.pendingBatch.on(({ duration, error }) => {\n // if (error) {\n // setState(2);\n // stop();\n // } else if (duration === undefined) {\n // setState(1);\n // start();\n // } else {\n // stop();\n // }\n // });\n // }, [space]);\n\n switch (state) {\n case 2:\n return (\n <StatusBar.Item title='Edit not saved.'>\n <Circle weight='fill' className={mx(styles.warning, getSize(3))} />\n </StatusBar.Item>\n );\n case 1:\n return (\n <StatusBar.Item title='Saving...'>\n <Circle weight='fill' className={mx(styles.success, getSize(3))} />\n </StatusBar.Item>\n );\n case 0:\n default:\n return (\n <StatusBar.Item title='Modified indicator.'>\n <Circle weight='fill' className={getSize(3)} />\n </StatusBar.Item>\n );\n }\n};\n\nconst PerformanceIndicator = () => {\n const [visible, setVisible] = useState(false);\n const [stats, refreshStats] = useStats();\n\n return (\n <>\n <StatusBar.Button onClick={() => setVisible((visible) => !visible)} title='Performance panels'>\n <ChartBar />\n </StatusBar.Button>\n {visible && (\n <div className='z-20 absolute bottom-[24px] w-[450px] border-l border-y border-separator'>\n <StatsPanel stats={stats} onRefresh={refreshStats} />\n </div>\n )}\n </>\n );\n};\n\nconst indicators = [PerformanceIndicator, SavingIndicator, ErrorIndicator, SwarmIndicator];\n\nexport const DebugStatus = () => {\n return (\n <>\n {indicators.map((Indicator) => (\n <Indicator key={Indicator.name} />\n ))}\n </>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { createAttendableAttributes } from '@dxos/react-ui-attention';\nimport { mx } from '@dxos/react-ui-theme';\n\n// TODO(burdon): Make focusable and attendable with input.\nexport const Wireframe = ({ label, data, className }: { label?: string; data?: any; className?: string }) => {\n const attendableAttrs = createAttendableAttributes(data);\n const { width, height, ref } = useResizeDetector();\n return (\n <div ref={ref} className={mx('relative grow min-bs-96', className)} {...attendableAttrs}>\n <div className='absolute inset-2 flex flex-col overflow-hidden font-mono'>\n <div className='flex justify-between'>\n <div>{label}</div>\n <div>{`[${width}x${height}]`}</div>\n </div>\n <div className='flex grow overflow-auto'>\n {data && (\n <pre className='text-neutral-500 text-sm whitespace-pre-line'>{JSON.stringify(data, undefined, 1)}</pre>\n )}\n </div>\n </div>\n <svg width={width} height={height} className='bg-transparent [&>*]:stroke-neutral-500'>\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", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { DEBUG_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [DEBUG_PLUGIN]: {\n 'plugin name': 'Debug',\n 'mutation count': 'Number of mutations',\n 'mutation period': 'Mutation period',\n 'open devtools label': 'Open DevTools',\n 'devtools label': 'DevTools',\n 'debug label': 'Debug',\n 'settings show debug panel': 'Show Debug panel.',\n 'settings show devtools panel': 'Show DevTools panel.',\n 'settings wireframe': 'Show wireframes.',\n 'settings repair': 'Run repair tool.',\n 'settings download diagnostics': 'Download diagnostics.',\n 'settings uploaded': 'Uploaded to IPFS',\n 'settings uploaded to clipboard': 'URL copied to clipboard.',\n 'settings repair success': 'Repair succeeded',\n 'settings repair failed': 'Repair failed',\n 'settings choose storage adaptor': 'Storage adaptor (worker reload required).',\n 'settings storage adaptor idb label': 'IndexedDB',\n 'settings storage adaptor opfs label': 'OPFS',\n 'settings data store label': 'Data Store',\n 'settings storage adapter changed alert':\n 'Warning: Swapping the storage adapter will make your data unavailable.',\n 'settings space fragmentation': 'Enable AM space fragmentation',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { DebugPlugin } from './DebugPlugin';\n\nexport * from './DebugPlugin';\n\nexport default DebugPlugin;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIA,SAASA,KAAKC,cAA8B;AAC5C,OAAOC,UAAyBC,aAAAA,YAAWC,YAAAA,iBAAgB;AAE3D,SACEC,WACAC,oBAAAA,mBACAC,mBACAC,qBAIK;AACP,SAASC,aAAa;AACtB,SAASC,yBAAyB;AAElC,SAASC,iBAAiB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I,EAAEF,oBAAmBW,iBAAiB;AACxC,yBAAO,gBAAA7D,OAAA,cAACuE,WAAAA;oBAAUpD,OAAO2B;oBAAM7B;oBAAYuD,WAAU;;gBACvD;cACF;YACF;AAEA,mBAAO;UACT;AAEA,kBAAQ1B,MAAAA;YACN,KAAK;AACH,qBACE,gBAAA9C,OAAA,cAACyE,OAAAA;gBAAI3B,MAAK;gBAAO0B,WAAU;iBACxB5B,SAAAA;YAGP,KAAK;AACH,qBACE,gBAAA5C,OAAA,cAAC0E,KAAKC,SAAO;gBACXC,YAAY;kBAACC;kBAAaC;kBAAsBC;kBAAyBC;;iBAExEpC,SAAAA;UAGT;AAEA,iBAAO;QACT;MACF;IACF;EACF;AACF;;;AMrQA,IAAA,cAAeqC;",
|
|
6
|
-
"names": ["Bug", "Hammer", "React", "useEffect", "useState", "getPlugin", "parseGraphPlugin", "parseIntentPlugin", "resolvePlugin", "Timer", "LocalStorageStore", "createExtension", "Graph", "SpaceAction", "CollectionType", "SpaceState", "isSpace", "Main", "baseSurface", "topbarBlockPaddingStart", "fixedInsetFlexLayout", "bottombarBlockPaddingEnd", "React", "Gift", "DownloadSimple", "FirstAidKit", "React", "useEffect", "useState", "parseFileManagerPlugin", "useResolvePlugin", "defs", "SaveConfig", "Storage", "log", "SettingsValue", "useClient", "useTranslation", "Button", "Toast", "Input", "useFileDownload", "Select", "getSize", "mx", "setDeep", "StorageAdapters", "opfs", "defs", "Runtime", "Client", "Storage", "StorageDriver", "WEBFS", "idb", "IDB", "DebugSettings", "settings", "t", "useTranslation", "DEBUG_PLUGIN", "toast", "setToast", "useState", "client", "useClient", "download", "useFileDownload", "storageConfig", "setStorageConfig", "fileManagerPlugin", "useResolvePlugin", "parseFileManagerPlugin", "useEffect", "then", "config", "handleToast", "setTimeout", "undefined", "clearTimeout", "handleDownload", "data", "diagnostics", "file", "Blob", "JSON", "stringify", "type", "fileName", "Date", "toISOString", "replace", "provides", "upload", "info", "File", "spaces", "default", "log", "error", "title", "description", "url", "values", "runtime", "services", "ipfs", "gateway", "cid", "navigator", "clipboard", "writeText", "handleRepair", "repair", "err", "message", "SettingsValue", "label", "Input", "Switch", "checked", "debug", "onCheckedChange", "devtools", "wireframe", "Button", "onClick", "DownloadSimple", "className", "getSize", "FirstAidKit", "Toast", "Root", "Body", "Title", "Gift", "mx", "weight", "span", "Description", "Select", "value", "Object", "entries", "find", "name", "storage", "dataStore", "onValueChange", "confirm", "updateConfig", "TriggerButton", "placeholder", "Portal", "Content", "Viewport", "keys", "map", "key", "Option", "setConfig", "path", "storageConfigCopy", "parse", "setDeep", "queueMicrotask", "SaveConfig", "ChartBar", "Circle", "Lightning", "LightningSlash", "React", "useEffect", "useRef", "useState", "firstIdInPart", "parseGraphPlugin", "parseNavigationPlugin", "useResolvePlugin", "TimeoutError", "StatsPanel", "useStats", "log", "getActiveSpace", "StatusBar", "ConnectionState", "useNetworkStatus", "getSize", "mx", "styles", "success", "warning", "error", "ErrorIndicator", "forceUpdate", "useState", "errorRef", "useRef", "useEffect", "errorListener", "event", "error", "reason", "current", "log", "window", "addEventListener", "removeEventListener", "handleReset", "undefined", "React", "StatusBar", "Button", "title", "message", "onClick", "Circle", "weight", "className", "mx", "styles", "getSize", "Item", "SwarmIndicator", "state", "setState", "swarm", "useNetworkStatus", "ConnectionState", "ONLINE", "Lightning", "LightningSlash", "warning", "SavingIndicator", "_setState", "navigationPlugin", "useResolvePlugin", "parseNavigationPlugin", "graphPlugin", "parseGraphPlugin", "location", "provides", "graph", "_space", "getActiveSpace", "firstIdInPart", "active", "success", "PerformanceIndicator", "visible", "setVisible", "stats", "refreshStats", "useStats", "ChartBar", "div", "StatsPanel", "onRefresh", "indicators", "DebugStatus", "map", "Indicator", "key", "name", "React", "useResizeDetector", "createAttendableAttributes", "mx", "Wireframe", "label", "data", "className", "attendableAttrs", "createAttendableAttributes", "width", "height", "ref", "useResizeDetector", "React", "div", "mx", "pre", "JSON", "stringify", "undefined", "svg", "rect", "x", "y", "strokeWidth", "fill", "line", "x1", "y1", "x2", "y2", "DebugGlobal", "React", "lazy", "DebugSpace", "
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Bug, Hammer, type IconProps } from '@phosphor-icons/react';\nimport React, { type ReactNode, useEffect, useState } from 'react';\n\nimport {\n getPlugin,\n parseGraphPlugin,\n parseIntentPlugin,\n resolvePlugin,\n type IntentPluginProvides,\n type Plugin,\n type PluginDefinition,\n} from '@dxos/app-framework';\nimport { Timer } from '@dxos/async';\nimport { Devtools } from '@dxos/devtools';\nimport { LocalStorageStore } from '@dxos/local-storage';\nimport { type ClientPluginProvides } from '@dxos/plugin-client';\nimport { createExtension, Graph, type Node } from '@dxos/plugin-graph';\nimport { SpaceAction } from '@dxos/plugin-space';\nimport { CollectionType } from '@dxos/plugin-space/types';\nimport { type Client } from '@dxos/react-client';\nimport { type Space, SpaceState, isSpace } from '@dxos/react-client/echo';\nimport { Main } from '@dxos/react-ui';\nimport {\n baseSurface,\n topbarBlockPaddingStart,\n fixedInsetFlexLayout,\n bottombarBlockPaddingEnd,\n} from '@dxos/react-ui-theme';\n\nimport { DebugGlobal, DebugSettings, DebugSpace, DebugStatus, Wireframe } from './components';\nimport meta, { DEBUG_PLUGIN } from './meta';\nimport translations from './translations';\nimport { DebugContext, type DebugSettingsProps, type DebugPluginProvides, DebugAction } from './types';\n\nexport const SETTINGS_KEY = DEBUG_PLUGIN + '/settings';\n\nexport const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {\n const settings = new LocalStorageStore<DebugSettingsProps>(DEBUG_PLUGIN, { debug: true, devtools: true });\n let intentPlugin: Plugin<IntentPluginProvides>;\n\n return {\n meta,\n ready: async (plugins) => {\n intentPlugin = resolvePlugin(plugins, parseIntentPlugin)!;\n settings\n .prop({ key: 'debug', type: LocalStorageStore.bool({ allowUndefined: true }) })\n .prop({ key: 'devtools', type: LocalStorageStore.bool({ allowUndefined: true }) })\n .prop({ key: 'wireframe', type: LocalStorageStore.bool({ allowUndefined: true }) });\n\n // TODO(burdon): Remove hacky dependency on global variable.\n // Used to test how composer handles breaking protocol changes.\n const composer = (window as any).composer;\n composer.changeStorageVersionInMetadata = async (version: number) => {\n const { changeStorageVersionInMetadata } = await import('@dxos/echo-pipeline/testing');\n const { createStorageObjects } = await import('@dxos/client-services');\n const client: Client = (window as any).dxos.client;\n const config = client.config;\n await client.destroy();\n const { storage } = createStorageObjects(config.values?.runtime?.client?.storage ?? {});\n await changeStorageVersionInMetadata(storage, version);\n location.pathname = '/';\n };\n },\n unload: async () => {\n settings.close();\n },\n provides: {\n settings: settings.values,\n translations,\n context: ({ children }) => {\n const [timer, setTimer] = useState<Timer>();\n useEffect(() => timer?.state.on((value) => !value && setTimer(undefined)), [timer]);\n useEffect(() => {\n timer?.stop();\n }, []);\n\n return (\n <DebugContext.Provider\n value={{\n running: !!timer,\n start: (cb, options) => {\n timer?.stop();\n setTimer(new Timer(cb).start(options));\n },\n stop: () => timer?.stop(),\n }}\n >\n {children}\n </DebugContext.Provider>\n );\n },\n graph: {\n builder: (plugins) => {\n const graphPlugin = resolvePlugin(plugins, parseGraphPlugin);\n\n // TODO(burdon): Combine nodes into single subtree.\n\n return [\n // Devtools node.\n createExtension({\n id: 'dxos.org/plugin/debug/devtools',\n filter: (node): node is Node<null> => !!settings.values.devtools && node.id === 'root',\n connector: () => [\n {\n // TODO(zan): Removed `/` because it breaks deck layout reload. Fix?\n id: 'dxos.org.plugin.debug.devtools',\n data: 'devtools',\n type: 'dxos.org/plugin/debug/devtools',\n properties: {\n label: ['devtools label', { ns: DEBUG_PLUGIN }],\n icon: (props: IconProps) => <Hammer {...props} />,\n iconSymbol: 'ph--hammer--regular',\n },\n },\n ],\n }),\n\n // Debug node.\n createExtension({\n id: 'dxos.org/plugin/debug/debug',\n filter: (node): node is Node<null> => !!settings.values.debug && node.id === 'root',\n connector: () => [\n {\n id: 'dxos.org/plugin/debug/debug',\n type: 'dxos.org/plugin/debug/debug',\n data: { graph: graphPlugin?.provides.graph },\n properties: {\n label: ['debug label', { ns: DEBUG_PLUGIN }],\n icon: (props: IconProps) => <Bug {...props} />,\n iconSymbol: 'ph--bug--regular',\n },\n },\n ],\n }),\n\n // Space debug nodes.\n createExtension({\n id: 'dxos.org/plugin/debug/spaces',\n filter: (node): node is Node<Space> => !!settings.values.debug && isSpace(node.data),\n connector: ({ node }) => {\n const space = node.data;\n return [\n {\n id: `${space.id}-debug`,\n type: 'dxos.org/plugin/debug/space',\n data: { space },\n properties: {\n label: ['debug label', { ns: DEBUG_PLUGIN }],\n icon: (props: IconProps) => <Bug {...props} />,\n iconSymbol: 'ph--bug--regular',\n },\n },\n ];\n },\n }),\n ];\n },\n },\n intent: {\n resolver: async (intent, plugins) => {\n switch (intent.action) {\n case DebugAction.OPEN_DEVTOOLS: {\n const clientPlugin = getPlugin<ClientPluginProvides>(plugins, 'dxos.org/plugin/client');\n const client = clientPlugin.provides.client;\n const vaultUrl = client.config.values?.runtime?.client?.remoteSource ?? 'https://halo.dxos.org';\n\n // Check if we're serving devtools locally on the usual port.\n let devtoolsUrl = 'http://localhost:5174';\n try {\n // TODO(burdon): Test header to see if this is actually devtools.\n await fetch(devtoolsUrl);\n } catch {\n // Match devtools to running app.\n const isDev = window.location.href.includes('.dev.') || window.location.href.includes('localhost');\n devtoolsUrl = `https://devtools${isDev ? '.dev.' : '.'}dxos.org`;\n }\n\n window.open(`${devtoolsUrl}?target=${vaultUrl}`, '_blank');\n return { data: true };\n }\n }\n },\n },\n surface: {\n component: ({ name, data, role }) => {\n switch (role) {\n case 'settings':\n return data.plugin === meta.id ? <DebugSettings settings={settings.values} /> : null;\n case 'status':\n return <DebugStatus />;\n }\n\n const primary = data.active ?? data.object;\n let component: ReactNode;\n if (role === 'main' || role === 'article') {\n if (primary === 'devtools' && settings.values.devtools) {\n component = <Devtools />;\n } else if (!primary || typeof primary !== 'object' || !settings.values.debug) {\n component = null;\n } else if ('space' in primary && isSpace(primary.space)) {\n component = (\n <DebugSpace\n space={primary.space}\n onAddObjects={(objects) => {\n if (!isSpace(primary.space)) {\n return;\n }\n\n const collection =\n primary.space.state.get() === SpaceState.SPACE_READY &&\n primary.space.properties[CollectionType.typename];\n if (!(collection instanceof CollectionType)) {\n return;\n }\n\n void intentPlugin?.provides.intent.dispatch(\n objects.map((object) => ({\n action: SpaceAction.ADD_OBJECT,\n data: { target: collection, object },\n })),\n );\n }}\n />\n );\n } else if ('graph' in primary && primary.graph instanceof Graph) {\n component = <DebugGlobal graph={primary.graph} />;\n } else {\n component = null;\n }\n }\n\n if (!component) {\n if (settings.values.wireframe) {\n if (role === 'main' || role === 'article' || role === 'section') {\n const primary = data.active ?? data.object;\n if (!(primary instanceof CollectionType)) {\n return <Wireframe label={role} data={data} className='row-span-2 overflow-hidden' />;\n }\n }\n }\n\n return null;\n }\n\n switch (role) {\n case 'article':\n return (\n <div role='none' className='row-span-2 rounded-t-md overflow-x-auto'>\n {component}\n </div>\n );\n case 'main':\n return (\n <Main.Content\n classNames={[baseSurface, fixedInsetFlexLayout, topbarBlockPaddingStart, bottombarBlockPaddingEnd]}\n >\n {component}\n </Main.Content>\n );\n }\n\n return null;\n },\n },\n },\n };\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\n// Lazily load components for content surfaces.\nexport const DebugGlobal = React.lazy(() => import('./DebugGlobal'));\nexport const DebugSpace = React.lazy(() => import('./DebugSpace'));\n\nexport * from './DebugSettings';\nexport * from './DebugStatus';\nexport * from './Wireframe';\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { Gift, DownloadSimple, FirstAidKit } from '@phosphor-icons/react';\nimport React, { useEffect, useState } from 'react';\n\nimport { parseFileManagerPlugin, useResolvePlugin } from '@dxos/app-framework';\nimport { type ConfigProto, defs, SaveConfig, Storage } from '@dxos/config';\nimport { log } from '@dxos/log';\nimport { SettingsValue } from '@dxos/plugin-settings';\nimport { useClient } from '@dxos/react-client';\nimport { useTranslation, Button, Toast, Input, useFileDownload, Select } from '@dxos/react-ui';\nimport { getSize, mx } from '@dxos/react-ui-theme';\nimport { setDeep } from '@dxos/util';\n\nimport { DEBUG_PLUGIN } from '../meta';\nimport { type DebugSettingsProps } from '../types';\n\ntype Toast = {\n title: string;\n description?: string;\n};\n\nconst StorageAdapters = {\n opfs: defs.Runtime.Client.Storage.StorageDriver.WEBFS,\n idb: defs.Runtime.Client.Storage.StorageDriver.IDB,\n} as const;\n\nexport const DebugSettings = ({ settings }: { settings: DebugSettingsProps }) => {\n const { t } = useTranslation(DEBUG_PLUGIN);\n const [toast, setToast] = useState<Toast>();\n const client = useClient();\n const download = useFileDownload();\n // TODO(mykola): Get updates from other places that change Config.\n const [storageConfig, setStorageConfig] = useState<ConfigProto>({});\n const fileManagerPlugin = useResolvePlugin(parseFileManagerPlugin);\n\n useEffect(() => {\n void Storage().then((config) => setStorageConfig(config));\n }, []);\n\n const handleToast = (toast: Toast) => {\n setToast(toast);\n const t = setTimeout(() => setToast(undefined), 5_000);\n return () => clearTimeout(t);\n };\n\n const handleDownload = async () => {\n const data = await client.diagnostics();\n const file = new Blob([JSON.stringify(data, undefined, 2)], { type: 'text/plain' });\n const fileName = `composer-${new Date().toISOString().replace(/\\W/g, '-')}.json`;\n download(file, fileName);\n\n if (fileManagerPlugin?.provides.file.upload) {\n const info = await fileManagerPlugin.provides.file.upload(new File([file], fileName), client.spaces.default);\n if (!info) {\n log.error('diagnostics failed to upload to IPFS');\n return;\n }\n handleToast({ title: t('settings uploaded'), description: t('settings uploaded to clipboard') });\n\n // TODO(nf): move to IpfsPlugin?\n const url = client.config.values.runtime!.services!.ipfs!.gateway + '/' + info.cid;\n void navigator.clipboard.writeText(url);\n handleToast({ title: t('settings uploaded'), description: t('settings uploaded to clipboard') });\n log.info('diagnostics', { url });\n }\n };\n\n const handleRepair = async () => {\n try {\n const info = await client.repair();\n setStorageConfig(await Storage());\n handleToast({ title: t('settings repair success'), description: JSON.stringify(info, undefined, 2) });\n } catch (err: any) {\n handleToast({ title: t('settings repair failed'), description: err.message });\n }\n };\n\n return (\n <>\n <SettingsValue label={t('settings show debug panel')}>\n <Input.Switch checked={settings.debug} onCheckedChange={(checked) => (settings.debug = !!checked)} />\n </SettingsValue>\n <SettingsValue label={t('settings show devtools panel')}>\n <Input.Switch checked={settings.devtools} onCheckedChange={(checked) => (settings.devtools = !!checked)} />\n </SettingsValue>\n <SettingsValue label={t('settings wireframe')}>\n <Input.Switch checked={settings.wireframe} onCheckedChange={(checked) => (settings.wireframe = !!checked)} />\n </SettingsValue>\n <SettingsValue label={t('settings download diagnostics')}>\n <Button onClick={handleDownload}>\n <DownloadSimple className={getSize(5)} />\n </Button>\n </SettingsValue>\n <SettingsValue label={t('settings repair')}>\n <Button onClick={handleRepair}>\n <FirstAidKit className={getSize(5)} />\n </Button>\n </SettingsValue>\n\n {/* TODO(burdon): Move to layout? */}\n {toast && (\n <Toast.Root>\n <Toast.Body>\n <Toast.Title>\n <Gift className={mx(getSize(5), 'inline mr-1')} weight='duotone' />\n <span>{toast.title}</span>\n </Toast.Title>\n {toast.description && <Toast.Description>{toast.description}</Toast.Description>}\n </Toast.Body>\n </Toast.Root>\n )}\n\n <SettingsValue label={t('settings choose storage adaptor')}>\n <Select.Root\n value={\n Object.entries(StorageAdapters).find(\n ([name, value]) => value === storageConfig?.runtime?.client?.storage?.dataStore,\n )?.[0]\n }\n onValueChange={(value) => {\n if (confirm(t('settings storage adapter changed alert'))) {\n updateConfig(\n storageConfig,\n setStorageConfig,\n ['runtime', 'client', 'storage', 'dataStore'],\n StorageAdapters[value as keyof typeof StorageAdapters],\n );\n }\n }}\n >\n <Select.TriggerButton placeholder={t('settings data store label')} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {Object.keys(StorageAdapters).map((key) => (\n <Select.Option key={key} value={key}>\n {t(`settings storage adaptor ${key} label`)}\n </Select.Option>\n ))}\n </Select.Viewport>\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n </SettingsValue>\n </>\n );\n};\n\nconst updateConfig = (config: ConfigProto, setConfig: (newConfig: ConfigProto) => void, path: string[], value: any) => {\n const storageConfigCopy = JSON.parse(JSON.stringify(config ?? {}));\n setDeep(storageConfigCopy, path, value);\n setConfig(storageConfigCopy);\n queueMicrotask(async () => {\n await SaveConfig(storageConfigCopy);\n });\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { ChartBar, Circle, Lightning, LightningSlash } from '@phosphor-icons/react';\nimport React, { useEffect, useRef, useState } from 'react';\n\nimport { firstIdInPart, parseGraphPlugin, parseNavigationPlugin, useResolvePlugin } from '@dxos/app-framework';\nimport { TimeoutError } from '@dxos/async';\nimport { StatsPanel, useStats } from '@dxos/devtools';\nimport { log } from '@dxos/log';\nimport { getActiveSpace } from '@dxos/plugin-space';\nimport { StatusBar } from '@dxos/plugin-status-bar';\nimport { ConnectionState } from '@dxos/protocols/proto/dxos/client/services';\nimport { useNetworkStatus } from '@dxos/react-client/mesh';\nimport { getSize, mx } from '@dxos/react-ui-theme';\n\nconst styles = {\n success: 'text-sky-300 dark:text-green-700',\n warning: 'text-orange-300 dark:text-orange-600',\n error: 'text-red-300 dark:text-red-600',\n};\n\n// TODO(burdon): Move out of debug plugin.\n// TODO(burdon): Make pluggable (move indicators to relevant plugins).\n// TODO(burdon): Vault heartbeat indicator (global scope)?\n\n/**\n * Ensure light doesn't flicker immediately after start.\n */\n// TODO(burdon): Move to @dxos/async (debounce?)\nconst _timer = (cb: (err?: Error) => void, options?: { min?: number; max?: number }) => {\n const min = options?.min ?? 500;\n let start: number;\n let pending: NodeJS.Timeout;\n let timeout: NodeJS.Timeout;\n return {\n start: () => {\n start = Date.now();\n clearTimeout(pending);\n if (options?.max) {\n clearTimeout(timeout);\n timeout = setTimeout(() => {\n cb(new TimeoutError(options.max));\n }, options.max);\n }\n },\n stop: () => {\n clearTimeout(timeout);\n const delta = Date.now() - start;\n if (delta < min) {\n pending = setTimeout(() => {\n cb();\n }, min - delta);\n }\n },\n };\n};\n\n/**\n * Global error handler.\n */\n// TODO(burdon): Integrate with Sentry?\nconst ErrorIndicator = () => {\n const [, forceUpdate] = useState({});\n const errorRef = useRef<Error>();\n useEffect(() => {\n const errorListener = (event: any) => {\n const error: Error = event.error ?? event.reason;\n // event.preventDefault();\n if (errorRef.current !== error) {\n // eslint-disable-next-line no-console\n log.error('onError', { event });\n errorRef.current = error;\n forceUpdate({});\n }\n };\n\n // TODO(burdon): Register globally?\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/error_event\n window.addEventListener('error', errorListener);\n\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/unhandledrejection_event\n window.addEventListener('unhandledrejection', errorListener);\n\n return () => {\n window.removeEventListener('error', errorListener);\n window.removeEventListener('unhandledrejection', errorListener);\n };\n }, []);\n\n const handleReset = () => {\n errorRef.current = undefined;\n forceUpdate({});\n };\n\n if (errorRef.current) {\n return (\n <StatusBar.Button title={errorRef.current.message} onClick={handleReset}>\n <Circle weight='fill' className={mx(styles.error, getSize(3))} />\n </StatusBar.Button>\n );\n } else {\n return (\n <StatusBar.Item title='No errors.'>\n <Circle weight='fill' className={getSize(3)} />\n </StatusBar.Item>\n );\n }\n};\n\n/**\n * Swarm connection handler.\n */\nconst SwarmIndicator = () => {\n const [state, setState] = useState(0);\n const { swarm } = useNetworkStatus();\n useEffect(() => {\n setState(swarm === ConnectionState.ONLINE ? 0 : 1);\n }, [swarm]);\n\n if (state === 0) {\n return (\n <StatusBar.Item title='Connected to swarm.'>\n <Lightning className={getSize(4)} />\n </StatusBar.Item>\n );\n } else {\n return (\n <StatusBar.Item title='Disconnected from swarm.'>\n <LightningSlash className={mx(styles.warning, getSize(4))} />\n </StatusBar.Item>\n );\n }\n};\n\n/**\n * Space saving indicator.\n */\nconst SavingIndicator = () => {\n const [state, _setState] = useState(0);\n const navigationPlugin = useResolvePlugin(parseNavigationPlugin);\n const graphPlugin = useResolvePlugin(parseGraphPlugin);\n const location = navigationPlugin?.provides.location;\n const graph = graphPlugin?.provides.graph;\n const _space = location && graph ? getActiveSpace(graph, firstIdInPart(location.active, 'main')) : undefined;\n // TODO(dmaretskyi): Fix this when we have save status for automerge.\n // useEffect(() => {\n // if (!space) {\n // return;\n // }\n // const { start, stop } = timer(() => setState(0), { min: 250 });\n // return space.db.pendingBatch.on(({ duration, error }) => {\n // if (error) {\n // setState(2);\n // stop();\n // } else if (duration === undefined) {\n // setState(1);\n // start();\n // } else {\n // stop();\n // }\n // });\n // }, [space]);\n\n switch (state) {\n case 2:\n return (\n <StatusBar.Item title='Edit not saved.'>\n <Circle weight='fill' className={mx(styles.warning, getSize(3))} />\n </StatusBar.Item>\n );\n case 1:\n return (\n <StatusBar.Item title='Saving...'>\n <Circle weight='fill' className={mx(styles.success, getSize(3))} />\n </StatusBar.Item>\n );\n case 0:\n default:\n return (\n <StatusBar.Item title='Modified indicator.'>\n <Circle weight='fill' className={getSize(3)} />\n </StatusBar.Item>\n );\n }\n};\n\nconst PerformanceIndicator = () => {\n const [visible, setVisible] = useState(false);\n const [stats, refreshStats] = useStats();\n\n return (\n <>\n <StatusBar.Button onClick={() => setVisible((visible) => !visible)} title='Performance panels'>\n <ChartBar />\n </StatusBar.Button>\n {visible && (\n <div className='z-20 absolute bottom-[24px] w-[450px] border-l border-y border-separator'>\n <StatsPanel stats={stats} onRefresh={refreshStats} />\n </div>\n )}\n </>\n );\n};\n\nconst indicators = [PerformanceIndicator, SavingIndicator, ErrorIndicator, SwarmIndicator];\n\nexport const DebugStatus = () => {\n return (\n <>\n {indicators.map((Indicator) => (\n <Indicator key={Indicator.name} />\n ))}\n </>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\nimport { useResizeDetector } from 'react-resize-detector';\n\nimport { createAttendableAttributes } from '@dxos/react-ui-attention';\nimport { mx } from '@dxos/react-ui-theme';\n\n// TODO(burdon): Make focusable and attendable with input.\nexport const Wireframe = ({ label, data, className }: { label?: string; data?: any; className?: string }) => {\n const attendableAttrs = createAttendableAttributes(data);\n const { width, height, ref } = useResizeDetector();\n return (\n <div ref={ref} className={mx('relative grow min-bs-96', className)} {...attendableAttrs}>\n <div className='absolute inset-2 flex flex-col overflow-hidden font-mono'>\n <div className='flex justify-between'>\n <div>{label}</div>\n <div>{`[${width}x${height}]`}</div>\n </div>\n <div className='flex grow overflow-auto'>\n {data && (\n <pre className='text-neutral-500 text-sm whitespace-pre-line'>{JSON.stringify(data, undefined, 1)}</pre>\n )}\n </div>\n </div>\n <svg width={width} height={height} className='bg-transparent [&>*]:stroke-neutral-500'>\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", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { DEBUG_PLUGIN } from './meta';\n\nexport default [\n {\n 'en-US': {\n [DEBUG_PLUGIN]: {\n 'plugin name': 'Debug',\n 'mutation count': 'Number of mutations',\n 'mutation period': 'Mutation period',\n 'open devtools label': 'Open DevTools',\n 'devtools label': 'DevTools',\n 'debug label': 'Debug',\n 'settings show debug panel': 'Show Debug panel.',\n 'settings show devtools panel': 'Show DevTools panel.',\n 'settings wireframe': 'Show wireframes.',\n 'settings repair': 'Run repair tool.',\n 'settings download diagnostics': 'Download diagnostics.',\n 'settings uploaded': 'Uploaded to IPFS',\n 'settings uploaded to clipboard': 'URL copied to clipboard.',\n 'settings repair success': 'Repair succeeded',\n 'settings repair failed': 'Repair failed',\n 'settings choose storage adaptor': 'Storage adaptor (worker reload required).',\n 'settings storage adaptor idb label': 'IndexedDB',\n 'settings storage adaptor opfs label': 'OPFS',\n 'settings data store label': 'Data Store',\n 'settings storage adapter changed alert':\n 'Warning: Swapping the storage adapter will make your data unavailable.',\n 'settings space fragmentation': 'Enable AM space fragmentation',\n },\n },\n },\n];\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { DebugPlugin } from './DebugPlugin';\n\nexport * from './DebugP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,OAAO;AACLoC,0BAAY;YACd;UACF;AAEA,cAAI,CAACA,WAAW;AACd,gBAAIxF,SAASyB,OAAOyF,WAAW;AAC7B,kBAAIxB,SAAS,UAAUA,SAAS,aAAaA,SAAS,WAAW;AAC/D,sBAAMI,WAAUjC,KAAKkC,UAAUlC,KAAKmC;AACpC,oBAAI,EAAEF,oBAAmBW,iBAAiB;AACxC,yBAAO,gBAAA7D,OAAA,cAACuE,WAAAA;oBAAUpD,OAAO2B;oBAAM7B;oBAAYuD,WAAU;;gBACvD;cACF;YACF;AAEA,mBAAO;UACT;AAEA,kBAAQ1B,MAAAA;YACN,KAAK;AACH,qBACE,gBAAA9C,OAAA,cAACyE,OAAAA;gBAAI3B,MAAK;gBAAO0B,WAAU;iBACxB5B,SAAAA;YAGP,KAAK;AACH,qBACE,gBAAA5C,OAAA,cAAC0E,KAAKC,SAAO;gBACXC,YAAY;kBAACC;kBAAaC;kBAAsBC;kBAAyBC;;iBAExEpC,SAAAA;UAGT;AAEA,iBAAO;QACT;MACF;IACF;EACF;AACF;;;AMtQA,IAAA,cAAeqC;",
|
|
6
|
+
"names": ["Bug", "Hammer", "React", "useEffect", "useState", "getPlugin", "parseGraphPlugin", "parseIntentPlugin", "resolvePlugin", "Timer", "Devtools", "LocalStorageStore", "createExtension", "Graph", "SpaceAction", "CollectionType", "SpaceState", "isSpace", "Main", "baseSurface", "topbarBlockPaddingStart", "fixedInsetFlexLayout", "bottombarBlockPaddingEnd", "React", "Gift", "DownloadSimple", "FirstAidKit", "React", "useEffect", "useState", "parseFileManagerPlugin", "useResolvePlugin", "defs", "SaveConfig", "Storage", "log", "SettingsValue", "useClient", "useTranslation", "Button", "Toast", "Input", "useFileDownload", "Select", "getSize", "mx", "setDeep", "StorageAdapters", "opfs", "defs", "Runtime", "Client", "Storage", "StorageDriver", "WEBFS", "idb", "IDB", "DebugSettings", "settings", "t", "useTranslation", "DEBUG_PLUGIN", "toast", "setToast", "useState", "client", "useClient", "download", "useFileDownload", "storageConfig", "setStorageConfig", "fileManagerPlugin", "useResolvePlugin", "parseFileManagerPlugin", "useEffect", "then", "config", "handleToast", "setTimeout", "undefined", "clearTimeout", "handleDownload", "data", "diagnostics", "file", "Blob", "JSON", "stringify", "type", "fileName", "Date", "toISOString", "replace", "provides", "upload", "info", "File", "spaces", "default", "log", "error", "title", "description", "url", "values", "runtime", "services", "ipfs", "gateway", "cid", "navigator", "clipboard", "writeText", "handleRepair", "repair", "err", "message", "SettingsValue", "label", "Input", "Switch", "checked", "debug", "onCheckedChange", "devtools", "wireframe", "Button", "onClick", "DownloadSimple", "className", "getSize", "FirstAidKit", "Toast", "Root", "Body", "Title", "Gift", "mx", "weight", "span", "Description", "Select", "value", "Object", "entries", "find", "name", "storage", "dataStore", "onValueChange", "confirm", "updateConfig", "TriggerButton", "placeholder", "Portal", "Content", "Viewport", "keys", "map", "key", "Option", "setConfig", "path", "storageConfigCopy", "parse", "setDeep", "queueMicrotask", "SaveConfig", "ChartBar", "Circle", "Lightning", "LightningSlash", "React", "useEffect", "useRef", "useState", "firstIdInPart", "parseGraphPlugin", "parseNavigationPlugin", "useResolvePlugin", "TimeoutError", "StatsPanel", "useStats", "log", "getActiveSpace", "StatusBar", "ConnectionState", "useNetworkStatus", "getSize", "mx", "styles", "success", "warning", "error", "ErrorIndicator", "forceUpdate", "useState", "errorRef", "useRef", "useEffect", "errorListener", "event", "error", "reason", "current", "log", "window", "addEventListener", "removeEventListener", "handleReset", "undefined", "React", "StatusBar", "Button", "title", "message", "onClick", "Circle", "weight", "className", "mx", "styles", "getSize", "Item", "SwarmIndicator", "state", "setState", "swarm", "useNetworkStatus", "ConnectionState", "ONLINE", "Lightning", "LightningSlash", "warning", "SavingIndicator", "_setState", "navigationPlugin", "useResolvePlugin", "parseNavigationPlugin", "graphPlugin", "parseGraphPlugin", "location", "provides", "graph", "_space", "getActiveSpace", "firstIdInPart", "active", "success", "PerformanceIndicator", "visible", "setVisible", "stats", "refreshStats", "useStats", "ChartBar", "div", "StatsPanel", "onRefresh", "indicators", "DebugStatus", "map", "Indicator", "key", "name", "React", "useResizeDetector", "createAttendableAttributes", "mx", "Wireframe", "label", "data", "className", "attendableAttrs", "createAttendableAttributes", "width", "height", "ref", "useResizeDetector", "React", "div", "mx", "pre", "JSON", "stringify", "undefined", "svg", "rect", "x", "y", "strokeWidth", "fill", "line", "x1", "y1", "x2", "y2", "DebugGlobal", "React", "lazy", "DebugSpace", "DEBUG_PLUGIN", "SETTINGS_KEY", "DEBUG_PLUGIN", "DebugPlugin", "settings", "LocalStorageStore", "debug", "devtools", "intentPlugin", "meta", "ready", "plugins", "resolvePlugin", "parseIntentPlugin", "prop", "key", "type", "bool", "allowUndefined", "composer", "window", "changeStorageVersionInMetadata", "version", "createStorageObjects", "client", "dxos", "config", "destroy", "storage", "values", "runtime", "location", "pathname", "unload", "close", "provides", "translations", "context", "children", "timer", "setTimer", "useState", "useEffect", "state", "on", "value", "undefined", "stop", "React", "DebugContext", "Provider", "running", "start", "cb", "options", "Timer", "graph", "builder", "graphPlugin", "parseGraphPlugin", "createExtension", "id", "filter", "node", "connector", "data", "properties", "label", "ns", "icon", "props", "Hammer", "iconSymbol", "Bug", "isSpace", "space", "intent", "resolver", "action", "DebugAction", "OPEN_DEVTOOLS", "clientPlugin", "getPlugin", "vaultUrl", "remoteSource", "devtoolsUrl", "fetch", "isDev", "href", "includes", "open", "surface", "component", "name", "role", "plugin", "DebugSettings", "DebugStatus", "primary", "active", "object", "Devtools", "DebugSpace", "onAddObjects", "objects", "collection", "get", "SpaceState", "SPACE_READY", "CollectionType", "typename", "dispatch", "map", "SpaceAction", "ADD_OBJECT", "target", "Graph", "DebugGlobal", "wireframe", "Wireframe", "className", "div", "Main", "Content", "classNames", "baseSurface", "fixedInsetFlexLayout", "topbarBlockPaddingStart", "bottombarBlockPaddingEnd", "DebugPlugin"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/plugins/experimental/plugin-debug/src/meta.tsx":{"bytes":1940,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/components/DebugSettings.tsx":{"bytes":22433,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/config","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-debug/src/meta.tsx","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/components/DebugStatus.tsx":{"bytes":22833,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/devtools","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-status-bar","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/react-client/mesh","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/components/Wireframe.tsx":{"bytes":5718,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/components/DebugPanel.tsx":{"bytes":4021,"imports":[{"path":"date-fns","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/components/Tree.tsx":{"bytes":11366,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react-syntax-highlighter","kind":"import-statement","external":true},{"path":"react-syntax-highlighter/dist/esm/styles/hljs/a11y-dark","kind":"import-statement","external":true},{"path":"react-syntax-highlighter/dist/esm/styles/hljs/a11y-light","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/components/DebugGlobal.tsx":{"bytes":10971,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-debug/src/components/DebugPanel.tsx","kind":"import-statement","original":"./DebugPanel"},{"path":"packages/plugins/experimental/plugin-debug/src/components/Tree.tsx","kind":"import-statement","original":"./Tree"}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/scaffolding/generator.ts":{"bytes":17434,"imports":[{"path":"@tldraw/tldraw","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"@dxos/echo-generator","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-sheet/testing","kind":"import-statement","external":true},{"path":"@dxos/plugin-sheet/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-sketch","kind":"import-statement","external":true},{"path":"@dxos/plugin-sketch/types","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/scaffolding/index.ts":{"bytes":527,"imports":[{"path":"packages/plugins/experimental/plugin-debug/src/scaffolding/generator.ts","kind":"import-statement","original":"./generator"}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/components/ObjectCreator.tsx":{"bytes":12877,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-table","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-debug/src/scaffolding/index.ts","kind":"import-statement","original":"../scaffolding"}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/types.ts":{"bytes":2694,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-debug/src/meta.tsx","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/components/DebugSpace.tsx":{"bytes":24398,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/invitations","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-debug/src/components/DebugPanel.tsx","kind":"import-statement","original":"./DebugPanel"},{"path":"packages/plugins/experimental/plugin-debug/src/components/ObjectCreator.tsx","kind":"import-statement","original":"./ObjectCreator"},{"path":"packages/plugins/experimental/plugin-debug/src/scaffolding/index.ts","kind":"import-statement","original":"../scaffolding"},{"path":"packages/plugins/experimental/plugin-debug/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/components/DevtoolsMain.tsx":{"bytes":1618,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/devtools","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/components/index.ts":{"bytes":1773,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-debug/src/components/DebugSettings.tsx","kind":"import-statement","original":"./DebugSettings"},{"path":"packages/plugins/experimental/plugin-debug/src/components/DebugStatus.tsx","kind":"import-statement","original":"./DebugStatus"},{"path":"packages/plugins/experimental/plugin-debug/src/components/Wireframe.tsx","kind":"import-statement","original":"./Wireframe"},{"path":"packages/plugins/experimental/plugin-debug/src/components/DebugGlobal.tsx","kind":"dynamic-import","original":"./DebugGlobal"},{"path":"packages/plugins/experimental/plugin-debug/src/components/DebugSpace.tsx","kind":"dynamic-import","original":"./DebugSpace"},{"path":"packages/plugins/experimental/plugin-debug/src/components/DevtoolsMain.tsx","kind":"dynamic-import","original":"./DevtoolsMain"}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/translations.ts":{"bytes":4357,"imports":[{"path":"packages/plugins/experimental/plugin-debug/src/meta.tsx","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/DebugPlugin.tsx":{"bytes":38007,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-debug/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-debug/src/meta.tsx","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-debug/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-debug/src/types.ts","kind":"import-statement","original":"./types"},{"path":"@dxos/echo-pipeline/testing","kind":"dynamic-import","external":true},{"path":"@dxos/client-services","kind":"dynamic-import","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/index.ts":{"bytes":782,"imports":[{"path":"packages/plugins/experimental/plugin-debug/src/DebugPlugin.tsx","kind":"import-statement","original":"./DebugPlugin"},{"path":"packages/plugins/experimental/plugin-debug/src/DebugPlugin.tsx","kind":"import-statement","original":"./DebugPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-debug/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":45563},"packages/plugins/experimental/plugin-debug/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-RYK3J66D.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-WEGYHXMB.mjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/config","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/devtools","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-status-bar","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/react-client/mesh","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/DebugGlobal-H37KGFEG.mjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/DebugSpace-KDKLS264.mjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/DevtoolsMain-DTAWVF22.mjs","kind":"dynamic-import"},{"path":"@dxos/echo-pipeline/testing","kind":"dynamic-import","external":true},{"path":"@dxos/client-services","kind":"dynamic-import","external":true}],"exports":["DebugPlugin","SETTINGS_KEY","default"],"entryPoint":"packages/plugins/experimental/plugin-debug/src/index.ts","inputs":{"packages/plugins/experimental/plugin-debug/src/DebugPlugin.tsx":{"bytesInOutput":9898},"packages/plugins/experimental/plugin-debug/src/components/index.ts":{"bytesInOutput":253},"packages/plugins/experimental/plugin-debug/src/components/DebugSettings.tsx":{"bytesInOutput":6234},"packages/plugins/experimental/plugin-debug/src/components/DebugStatus.tsx":{"bytesInOutput":5261},"packages/plugins/experimental/plugin-debug/src/components/Wireframe.tsx":{"bytesInOutput":1638},"packages/plugins/experimental/plugin-debug/src/translations.ts":{"bytesInOutput":1297},"packages/plugins/experimental/plugin-debug/src/index.ts":{"bytesInOutput":31}},"bytes":25493},"packages/plugins/experimental/plugin-debug/dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-debug/dist/lib/browser/meta.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-WEGYHXMB.mjs","kind":"import-statement"}],"exports":["DEBUG_PLUGIN","default"],"entryPoint":"packages/plugins/experimental/plugin-debug/src/meta.tsx","inputs":{},"bytes":159},"packages/plugins/experimental/plugin-debug/dist/lib/browser/DebugGlobal-H37KGFEG.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":11590},"packages/plugins/experimental/plugin-debug/dist/lib/browser/DebugGlobal-H37KGFEG.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-ED5L5YYI.mjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-syntax-highlighter","kind":"import-statement","external":true},{"path":"react-syntax-highlighter/dist/esm/styles/hljs/a11y-dark","kind":"import-statement","external":true},{"path":"react-syntax-highlighter/dist/esm/styles/hljs/a11y-light","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-debug/src/components/DebugGlobal.tsx","inputs":{"packages/plugins/experimental/plugin-debug/src/components/DebugGlobal.tsx":{"bytesInOutput":3098},"packages/plugins/experimental/plugin-debug/src/components/Tree.tsx":{"bytesInOutput":2947}},"bytes":6420},"packages/plugins/experimental/plugin-debug/dist/lib/browser/DebugSpace-KDKLS264.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":28112},"packages/plugins/experimental/plugin-debug/dist/lib/browser/DebugSpace-KDKLS264.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-RYK3J66D.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-WEGYHXMB.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-ED5L5YYI.mjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/react-async","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/invitations","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-table","kind":"import-statement","external":true},{"path":"@tldraw/tldraw","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"@dxos/echo-generator","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-sheet/testing","kind":"import-statement","external":true},{"path":"@dxos/plugin-sheet/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-sketch","kind":"import-statement","external":true},{"path":"@dxos/plugin-sketch/types","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-debug/src/components/DebugSpace.tsx","inputs":{"packages/plugins/experimental/plugin-debug/src/components/DebugSpace.tsx":{"bytesInOutput":6626},"packages/plugins/experimental/plugin-debug/src/components/ObjectCreator.tsx":{"bytesInOutput":3134},"packages/plugins/experimental/plugin-debug/src/scaffolding/generator.ts":{"bytesInOutput":4483},"packages/plugins/experimental/plugin-debug/src/scaffolding/index.ts":{"bytesInOutput":0}},"bytes":14865},"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-RYK3J66D.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1538},"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-RYK3J66D.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-WEGYHXMB.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true}],"exports":["DebugAction","DebugContext"],"inputs":{"packages/plugins/experimental/plugin-debug/src/types.ts":{"bytesInOutput":364}},"bytes":566},"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-WEGYHXMB.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":949},"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-WEGYHXMB.mjs":{"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["DEBUG_PLUGIN","meta_default"],"inputs":{"packages/plugins/experimental/plugin-debug/src/meta.tsx":{"bytesInOutput":423}},"bytes":570},"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-ED5L5YYI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2147},"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-ED5L5YYI.mjs":{"imports":[{"path":"date-fns","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["DebugPanel"],"inputs":{"packages/plugins/experimental/plugin-debug/src/components/DebugPanel.tsx":{"bytesInOutput":1063}},"bytes":1209},"packages/plugins/experimental/plugin-debug/dist/lib/browser/DevtoolsMain-DTAWVF22.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":793},"packages/plugins/experimental/plugin-debug/dist/lib/browser/DevtoolsMain-DTAWVF22.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/devtools","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-debug/src/components/DevtoolsMain.tsx","inputs":{"packages/plugins/experimental/plugin-debug/src/components/DevtoolsMain.tsx":{"bytesInOutput":333}},"bytes":508}}}
|
|
1
|
+
{"inputs":{"packages/plugins/experimental/plugin-debug/src/meta.tsx":{"bytes":1940,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/components/DebugSettings.tsx":{"bytes":22433,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/config","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-debug/src/meta.tsx","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/components/DebugStatus.tsx":{"bytes":22833,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/devtools","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-status-bar","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/react-client/mesh","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/components/Wireframe.tsx":{"bytes":5718,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/components/DebugPanel.tsx":{"bytes":4021,"imports":[{"path":"date-fns","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/components/Tree.tsx":{"bytes":10132,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/components/DebugGlobal.tsx":{"bytes":10577,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-debug/src/components/DebugPanel.tsx","kind":"import-statement","original":"./DebugPanel"},{"path":"packages/plugins/experimental/plugin-debug/src/components/Tree.tsx","kind":"import-statement","original":"./Tree"}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/scaffolding/generator.ts":{"bytes":17434,"imports":[{"path":"@tldraw/tldraw","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"@dxos/echo-generator","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-sheet/testing","kind":"import-statement","external":true},{"path":"@dxos/plugin-sheet/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-sketch","kind":"import-statement","external":true},{"path":"@dxos/plugin-sketch/types","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/scaffolding/index.ts":{"bytes":527,"imports":[{"path":"packages/plugins/experimental/plugin-debug/src/scaffolding/generator.ts","kind":"import-statement","original":"./generator"}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/components/ObjectCreator.tsx":{"bytes":12877,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-table","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-debug/src/scaffolding/index.ts","kind":"import-statement","original":"../scaffolding"}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/types.ts":{"bytes":2694,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-debug/src/meta.tsx","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/components/DebugSpace.tsx":{"bytes":24398,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/invitations","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-debug/src/components/DebugPanel.tsx","kind":"import-statement","original":"./DebugPanel"},{"path":"packages/plugins/experimental/plugin-debug/src/components/ObjectCreator.tsx","kind":"import-statement","original":"./ObjectCreator"},{"path":"packages/plugins/experimental/plugin-debug/src/scaffolding/index.ts","kind":"import-statement","original":"../scaffolding"},{"path":"packages/plugins/experimental/plugin-debug/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/components/index.ts":{"bytes":1503,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-debug/src/components/DebugSettings.tsx","kind":"import-statement","original":"./DebugSettings"},{"path":"packages/plugins/experimental/plugin-debug/src/components/DebugStatus.tsx","kind":"import-statement","original":"./DebugStatus"},{"path":"packages/plugins/experimental/plugin-debug/src/components/Wireframe.tsx","kind":"import-statement","original":"./Wireframe"},{"path":"packages/plugins/experimental/plugin-debug/src/components/DebugGlobal.tsx","kind":"dynamic-import","original":"./DebugGlobal"},{"path":"packages/plugins/experimental/plugin-debug/src/components/DebugSpace.tsx","kind":"dynamic-import","original":"./DebugSpace"}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/translations.ts":{"bytes":4357,"imports":[{"path":"packages/plugins/experimental/plugin-debug/src/meta.tsx","kind":"import-statement","original":"./meta"}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/DebugPlugin.tsx":{"bytes":38088,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/devtools","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-debug/src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"packages/plugins/experimental/plugin-debug/src/meta.tsx","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/experimental/plugin-debug/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/experimental/plugin-debug/src/types.ts","kind":"import-statement","original":"./types"},{"path":"@dxos/echo-pipeline/testing","kind":"dynamic-import","external":true},{"path":"@dxos/client-services","kind":"dynamic-import","external":true}],"format":"esm"},"packages/plugins/experimental/plugin-debug/src/index.ts":{"bytes":782,"imports":[{"path":"packages/plugins/experimental/plugin-debug/src/DebugPlugin.tsx","kind":"import-statement","original":"./DebugPlugin"},{"path":"packages/plugins/experimental/plugin-debug/src/DebugPlugin.tsx","kind":"import-statement","original":"./DebugPlugin"}],"format":"esm"}},"outputs":{"packages/plugins/experimental/plugin-debug/dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":45477},"packages/plugins/experimental/plugin-debug/dist/lib/browser/index.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-RYK3J66D.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-WEGYHXMB.mjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/devtools","kind":"import-statement","external":true},{"path":"@dxos/local-storage","kind":"import-statement","external":true},{"path":"@dxos/plugin-graph","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/config","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-settings","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/devtools","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-status-bar","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/react-client/mesh","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/react-ui-attention","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/DebugGlobal-H56M2VL4.mjs","kind":"dynamic-import"},{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/DebugSpace-NHPMLATA.mjs","kind":"dynamic-import"},{"path":"@dxos/echo-pipeline/testing","kind":"dynamic-import","external":true},{"path":"@dxos/client-services","kind":"dynamic-import","external":true}],"exports":["DebugPlugin","SETTINGS_KEY","default"],"entryPoint":"packages/plugins/experimental/plugin-debug/src/index.ts","inputs":{"packages/plugins/experimental/plugin-debug/src/DebugPlugin.tsx":{"bytesInOutput":9937},"packages/plugins/experimental/plugin-debug/src/components/index.ts":{"bytesInOutput":176},"packages/plugins/experimental/plugin-debug/src/components/DebugSettings.tsx":{"bytesInOutput":6234},"packages/plugins/experimental/plugin-debug/src/components/DebugStatus.tsx":{"bytesInOutput":5261},"packages/plugins/experimental/plugin-debug/src/components/Wireframe.tsx":{"bytesInOutput":1638},"packages/plugins/experimental/plugin-debug/src/translations.ts":{"bytesInOutput":1297},"packages/plugins/experimental/plugin-debug/src/index.ts":{"bytesInOutput":31}},"bytes":25455},"packages/plugins/experimental/plugin-debug/dist/lib/browser/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/experimental/plugin-debug/dist/lib/browser/meta.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-WEGYHXMB.mjs","kind":"import-statement"}],"exports":["DEBUG_PLUGIN","default"],"entryPoint":"packages/plugins/experimental/plugin-debug/src/meta.tsx","inputs":{},"bytes":159},"packages/plugins/experimental/plugin-debug/dist/lib/browser/DebugGlobal-H56M2VL4.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":10741},"packages/plugins/experimental/plugin-debug/dist/lib/browser/DebugGlobal-H56M2VL4.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-ED5L5YYI.mjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-syntax-highlighter","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-debug/src/components/DebugGlobal.tsx","inputs":{"packages/plugins/experimental/plugin-debug/src/components/DebugGlobal.tsx":{"bytesInOutput":2994},"packages/plugins/experimental/plugin-debug/src/components/Tree.tsx":{"bytesInOutput":2694}},"bytes":6063},"packages/plugins/experimental/plugin-debug/dist/lib/browser/DebugSpace-NHPMLATA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":28112},"packages/plugins/experimental/plugin-debug/dist/lib/browser/DebugSpace-NHPMLATA.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-RYK3J66D.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-WEGYHXMB.mjs","kind":"import-statement"},{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-ED5L5YYI.mjs","kind":"import-statement"},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/protocols/proto/dxos/client/services","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-client/invitations","kind":"import-statement","external":true},{"path":"@dxos/react-hooks","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-table","kind":"import-statement","external":true},{"path":"@tldraw/tldraw","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/automerge/automerge","kind":"import-statement","external":true},{"path":"@dxos/echo-generator","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/plugin-markdown/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-sheet/testing","kind":"import-statement","external":true},{"path":"@dxos/plugin-sheet/types","kind":"import-statement","external":true},{"path":"@dxos/plugin-sketch","kind":"import-statement","external":true},{"path":"@dxos/plugin-sketch/types","kind":"import-statement","external":true},{"path":"@dxos/random","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/experimental/plugin-debug/src/components/DebugSpace.tsx","inputs":{"packages/plugins/experimental/plugin-debug/src/components/DebugSpace.tsx":{"bytesInOutput":6626},"packages/plugins/experimental/plugin-debug/src/components/ObjectCreator.tsx":{"bytesInOutput":3134},"packages/plugins/experimental/plugin-debug/src/scaffolding/generator.ts":{"bytesInOutput":4483},"packages/plugins/experimental/plugin-debug/src/scaffolding/index.ts":{"bytesInOutput":0}},"bytes":14865},"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-RYK3J66D.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1538},"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-RYK3J66D.mjs":{"imports":[{"path":"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-WEGYHXMB.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true}],"exports":["DebugAction","DebugContext"],"inputs":{"packages/plugins/experimental/plugin-debug/src/types.ts":{"bytesInOutput":364}},"bytes":566},"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-WEGYHXMB.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":949},"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-WEGYHXMB.mjs":{"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["DEBUG_PLUGIN","meta_default"],"inputs":{"packages/plugins/experimental/plugin-debug/src/meta.tsx":{"bytesInOutput":423}},"bytes":570},"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-ED5L5YYI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2147},"packages/plugins/experimental/plugin-debug/dist/lib/browser/chunk-ED5L5YYI.mjs":{"imports":[{"path":"date-fns","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true}],"exports":["DebugPanel"],"inputs":{"packages/plugins/experimental/plugin-debug/src/components/DebugPanel.tsx":{"bytesInOutput":1063}},"bytes":1209}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebugPlugin.d.ts","sourceRoot":"","sources":["../../../src/DebugPlugin.tsx"],"names":[],"mappings":"AAOA,OAAO,EAOL,KAAK,gBAAgB,EACtB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"DebugPlugin.d.ts","sourceRoot":"","sources":["../../../src/DebugPlugin.tsx"],"names":[],"mappings":"AAOA,OAAO,EAOL,KAAK,gBAAgB,EACtB,MAAM,qBAAqB,CAAC;AAqB7B,OAAO,EAAyC,KAAK,mBAAmB,EAAe,MAAM,SAAS,CAAC;AAEvG,eAAO,MAAM,YAAY,QAA6B,CAAC;AAEvD,eAAO,MAAM,WAAW,QAAO,gBAAgB,CAAC,mBAAmB,CAsOlE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebugGlobal.d.ts","sourceRoot":"","sources":["../../../../src/components/DebugGlobal.tsx"],"names":[],"mappings":"AAKA,OAAc,EAAE,KAAK,EAAE,EAAuB,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAQhD,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"DebugGlobal.d.ts","sourceRoot":"","sources":["../../../../src/components/DebugGlobal.tsx"],"names":[],"mappings":"AAKA,OAAc,EAAE,KAAK,EAAE,EAAuB,MAAM,OAAO,CAAC;AAE5D,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAQhD,QAAA,MAAM,WAAW,EAAE,EAAE,CAAC;IAAE,KAAK,EAAE,KAAK,CAAA;CAAE,CA6DrC,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebugSpace.d.ts","sourceRoot":"","sources":["../../../../src/components/DebugSpace.tsx"],"names":[],"mappings":"AAeA,OAAc,EAAE,KAAK,EAAE,EAAiC,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"DebugSpace.d.ts","sourceRoot":"","sources":["../../../../src/components/DebugSpace.tsx"],"names":[],"mappings":"AAeA,OAAc,EAAE,KAAK,EAAE,EAAiC,MAAM,OAAO,CAAC;AAEtE,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAKxD,OAAO,EAAU,KAAK,KAAK,EAAsB,MAAM,yBAAyB,CAAC;AAsBjF,QAAA,MAAM,UAAU,EAAE,EAAE,CAAC;IACnB,KAAK,EAAE,KAAK,CAAC;IACb,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,CAAC,GAAG,CAAC,EAAE,KAAK,IAAI,CAAC;CACzD,CAiJA,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DebugSpace.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/DebugSpace.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,
|
|
1
|
+
{"version":3,"file":"DebugSpace.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/DebugSpace.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAAoB,MAAM,OAAO,CAAC;;;;;;;;;;;;AAwBzC,wBAOE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { type FC } from 'react';
|
|
2
|
-
import { type ThemeMode } from '@dxos/react-ui';
|
|
3
2
|
export declare const replacer: (key: any, value: any) => any;
|
|
4
3
|
export declare const Json: FC<{
|
|
5
4
|
data?: object;
|
|
6
|
-
theme: ThemeMode;
|
|
7
5
|
}>;
|
|
8
6
|
export declare const Tree: FC<{
|
|
9
7
|
data?: object;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tree.d.ts","sourceRoot":"","sources":["../../../../src/components/Tree.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,EAAE,EAAiC,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Tree.d.ts","sourceRoot":"","sources":["../../../../src/components/Tree.tsx"],"names":[],"mappings":"AAIA,OAAc,EAAE,KAAK,EAAE,EAAiC,MAAM,OAAO,CAAC;AAQtE,eAAO,MAAM,QAAQ,QAAS,GAAG,SAAS,GAAG,QAgB5C,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAEtC,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAMtC,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,EAAE,CAAC;IAAE,IAAI,CAAC,EAAE,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,OAAO,CAAA;CAAE,CAsBnD,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,EAAE,CAAC;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,GAAG,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAiB1E,CAAC"}
|
|
@@ -6,7 +6,6 @@ export declare const DebugSpace: React.LazyExoticComponent<React.FC<{
|
|
|
6
6
|
space: import("packages/sdk/client-protocol/dist/types/src").Space;
|
|
7
7
|
onAddObjects?: (objects: import("packages/core/echo/echo-schema/dist/types/src").ReactiveObject<any>[]) => void;
|
|
8
8
|
}>>;
|
|
9
|
-
export declare const DevtoolsMain: React.LazyExoticComponent<() => React.JSX.Element>;
|
|
10
9
|
export * from './DebugSettings';
|
|
11
10
|
export * from './DebugStatus';
|
|
12
11
|
export * from './Wireframe';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,WAAW;;GAA4C,CAAC;AACrE,eAAO,MAAM,UAAU;;;GAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,eAAO,MAAM,WAAW;;GAA4C,CAAC;AACrE,eAAO,MAAM,UAAU;;;GAA2C,CAAC;AAEnE,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-debug",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.12-main.5cc132e",
|
|
4
4
|
"description": "DXOS Surface plugin for testing.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -36,57 +36,58 @@
|
|
|
36
36
|
"react-json-tree": "^0.18.0",
|
|
37
37
|
"react-resize-detector": "^11.0.1",
|
|
38
38
|
"react-syntax-highlighter": "^15.5.0",
|
|
39
|
-
"@dxos/app-framework": "0.6.
|
|
40
|
-
"@dxos/
|
|
41
|
-
"@dxos/
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/echo-generator": "0.6.
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/echo-pipeline": "0.6.
|
|
47
|
-
"@dxos/echo-schema": "0.6.
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/plugin-
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/plugin-
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/plugin-settings": "0.6.
|
|
56
|
-
"@dxos/plugin-
|
|
57
|
-
"@dxos/plugin-
|
|
58
|
-
"@dxos/plugin-
|
|
59
|
-
"@dxos/plugin-status-bar": "0.6.
|
|
60
|
-
"@dxos/plugin-
|
|
61
|
-
"@dxos/random": "0.6.
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/react-
|
|
65
|
-
"@dxos/react-
|
|
66
|
-
"@dxos/react-ui-
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/react-ui-
|
|
39
|
+
"@dxos/app-framework": "0.6.12-main.5cc132e",
|
|
40
|
+
"@dxos/async": "0.6.12-main.5cc132e",
|
|
41
|
+
"@dxos/automerge": "0.6.12-main.5cc132e",
|
|
42
|
+
"@dxos/client-services": "0.6.12-main.5cc132e",
|
|
43
|
+
"@dxos/config": "0.6.12-main.5cc132e",
|
|
44
|
+
"@dxos/echo-generator": "0.6.12-main.5cc132e",
|
|
45
|
+
"@dxos/devtools": "0.6.12-main.5cc132e",
|
|
46
|
+
"@dxos/echo-pipeline": "0.6.12-main.5cc132e",
|
|
47
|
+
"@dxos/echo-schema": "0.6.12-main.5cc132e",
|
|
48
|
+
"@dxos/invariant": "0.6.12-main.5cc132e",
|
|
49
|
+
"@dxos/keys": "0.6.12-main.5cc132e",
|
|
50
|
+
"@dxos/local-storage": "0.6.12-main.5cc132e",
|
|
51
|
+
"@dxos/plugin-client": "0.6.12-main.5cc132e",
|
|
52
|
+
"@dxos/log": "0.6.12-main.5cc132e",
|
|
53
|
+
"@dxos/plugin-graph": "0.6.12-main.5cc132e",
|
|
54
|
+
"@dxos/plugin-markdown": "0.6.12-main.5cc132e",
|
|
55
|
+
"@dxos/plugin-settings": "0.6.12-main.5cc132e",
|
|
56
|
+
"@dxos/plugin-sketch": "0.6.12-main.5cc132e",
|
|
57
|
+
"@dxos/plugin-sheet": "0.6.12-main.5cc132e",
|
|
58
|
+
"@dxos/plugin-theme": "0.6.12-main.5cc132e",
|
|
59
|
+
"@dxos/plugin-status-bar": "0.6.12-main.5cc132e",
|
|
60
|
+
"@dxos/plugin-table": "0.6.12-main.5cc132e",
|
|
61
|
+
"@dxos/random": "0.6.12-main.5cc132e",
|
|
62
|
+
"@dxos/protocols": "0.6.12-main.5cc132e",
|
|
63
|
+
"@dxos/plugin-space": "0.6.12-main.5cc132e",
|
|
64
|
+
"@dxos/react-client": "0.6.12-main.5cc132e",
|
|
65
|
+
"@dxos/react-hooks": "0.6.12-main.5cc132e",
|
|
66
|
+
"@dxos/react-ui-attention": "0.6.12-main.5cc132e",
|
|
67
|
+
"@dxos/react-ui-syntax-highlighter": "0.6.12-main.5cc132e",
|
|
68
|
+
"@dxos/react-ui-table": "0.6.12-main.5cc132e",
|
|
69
|
+
"@dxos/util": "0.6.12-main.5cc132e"
|
|
69
70
|
},
|
|
70
71
|
"devDependencies": {
|
|
71
72
|
"@phosphor-icons/react": "^2.1.5",
|
|
72
73
|
"@types/lodash.get": "^4.4.7",
|
|
73
74
|
"@types/react": "~18.2.0",
|
|
74
75
|
"@types/react-dom": "~18.2.0",
|
|
75
|
-
"@types/react-syntax-highlighter": "^15.5.
|
|
76
|
+
"@types/react-syntax-highlighter": "^15.5.13",
|
|
76
77
|
"react": "~18.2.0",
|
|
77
78
|
"react-dom": "~18.2.0",
|
|
78
|
-
"vite": "
|
|
79
|
-
"@dxos/random": "0.6.
|
|
80
|
-
"@dxos/react-ui
|
|
81
|
-
"@dxos/storybook-utils": "0.6.
|
|
82
|
-
"@dxos/react-ui": "0.6.
|
|
79
|
+
"vite": "5.4.7",
|
|
80
|
+
"@dxos/random": "0.6.12-main.5cc132e",
|
|
81
|
+
"@dxos/react-ui": "0.6.12-main.5cc132e",
|
|
82
|
+
"@dxos/storybook-utils": "0.6.12-main.5cc132e",
|
|
83
|
+
"@dxos/react-ui-theme": "0.6.12-main.5cc132e"
|
|
83
84
|
},
|
|
84
85
|
"peerDependencies": {
|
|
85
86
|
"@phosphor-icons/react": "^2.1.5",
|
|
86
87
|
"react": "^18.0.0",
|
|
87
88
|
"react-dom": "^18.0.0",
|
|
88
|
-
"@dxos/react-ui
|
|
89
|
-
"@dxos/react-ui": "0.6.
|
|
89
|
+
"@dxos/react-ui": "0.6.12-main.5cc132e",
|
|
90
|
+
"@dxos/react-ui-theme": "0.6.12-main.5cc132e"
|
|
90
91
|
},
|
|
91
92
|
"publishConfig": {
|
|
92
93
|
"access": "public"
|
package/src/DebugPlugin.tsx
CHANGED
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
type PluginDefinition,
|
|
16
16
|
} from '@dxos/app-framework';
|
|
17
17
|
import { Timer } from '@dxos/async';
|
|
18
|
+
import { Devtools } from '@dxos/devtools';
|
|
18
19
|
import { LocalStorageStore } from '@dxos/local-storage';
|
|
19
20
|
import { type ClientPluginProvides } from '@dxos/plugin-client';
|
|
20
21
|
import { createExtension, Graph, type Node } from '@dxos/plugin-graph';
|
|
@@ -30,7 +31,7 @@ import {
|
|
|
30
31
|
bottombarBlockPaddingEnd,
|
|
31
32
|
} from '@dxos/react-ui-theme';
|
|
32
33
|
|
|
33
|
-
import { DebugGlobal, DebugSettings, DebugSpace, DebugStatus,
|
|
34
|
+
import { DebugGlobal, DebugSettings, DebugSpace, DebugStatus, Wireframe } from './components';
|
|
34
35
|
import meta, { DEBUG_PLUGIN } from './meta';
|
|
35
36
|
import translations from './translations';
|
|
36
37
|
import { DebugContext, type DebugSettingsProps, type DebugPluginProvides, DebugAction } from './types';
|
|
@@ -197,7 +198,7 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
|
|
|
197
198
|
let component: ReactNode;
|
|
198
199
|
if (role === 'main' || role === 'article') {
|
|
199
200
|
if (primary === 'devtools' && settings.values.devtools) {
|
|
200
|
-
component = <
|
|
201
|
+
component = <Devtools />;
|
|
201
202
|
} else if (!primary || typeof primary !== 'object' || !settings.values.debug) {
|
|
202
203
|
component = null;
|
|
203
204
|
} else if ('space' in primary && isSpace(primary.space)) {
|
|
@@ -7,14 +7,13 @@ import React, { type FC, useEffect, useState } from 'react';
|
|
|
7
7
|
|
|
8
8
|
import { type Graph } from '@dxos/plugin-graph';
|
|
9
9
|
import { useClient, useConfig } from '@dxos/react-client';
|
|
10
|
-
import { Button, ToggleGroup, ToggleGroupItem
|
|
10
|
+
import { Button, ToggleGroup, ToggleGroupItem } from '@dxos/react-ui';
|
|
11
11
|
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
12
12
|
|
|
13
13
|
import { DebugPanel } from './DebugPanel';
|
|
14
14
|
import { Json, Tree } from './Tree';
|
|
15
15
|
|
|
16
16
|
const DebugGlobal: FC<{ graph: Graph }> = ({ graph }) => {
|
|
17
|
-
const { themeMode } = useThemeContext();
|
|
18
17
|
const [view, setView] = useState<'config' | 'diagnostics' | 'graph'>('graph');
|
|
19
18
|
const [data, setData] = useState<any>({});
|
|
20
19
|
const client = useClient();
|
|
@@ -71,8 +70,8 @@ const DebugGlobal: FC<{ graph: Graph }> = ({ graph }) => {
|
|
|
71
70
|
}
|
|
72
71
|
>
|
|
73
72
|
{view === 'graph' && <Tree data={graph.toJSON()} />}
|
|
74
|
-
{view === 'config' && <Json
|
|
75
|
-
{view === 'diagnostics' && <Json
|
|
73
|
+
{view === 'config' && <Json data={data.diagnostics?.config} />}
|
|
74
|
+
{view === 'diagnostics' && <Json data={data} />}
|
|
76
75
|
</DebugPanel>
|
|
77
76
|
);
|
|
78
77
|
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import React, {
|
|
7
|
+
import React, { useEffect } from 'react';
|
|
8
8
|
|
|
9
9
|
import { createSpaceObjectGenerator } from '@dxos/echo-generator';
|
|
10
10
|
import { useSpaces } from '@dxos/react-client/echo';
|
|
@@ -12,7 +12,7 @@ import { ClientRepeater } from '@dxos/react-client/testing';
|
|
|
12
12
|
|
|
13
13
|
import DebugSpace from './DebugSpace';
|
|
14
14
|
|
|
15
|
-
const Story
|
|
15
|
+
const Story = () => {
|
|
16
16
|
const [space] = useSpaces();
|
|
17
17
|
useEffect(() => {
|
|
18
18
|
if (space) {
|
|
@@ -19,10 +19,10 @@ import { type ReactiveObject } from '@dxos/echo-schema';
|
|
|
19
19
|
import { DocumentType } from '@dxos/plugin-markdown/types';
|
|
20
20
|
import { Invitation } from '@dxos/protocols/proto/dxos/client/services';
|
|
21
21
|
import { faker } from '@dxos/random';
|
|
22
|
-
import { useAsyncEffect } from '@dxos/react-async';
|
|
23
22
|
import { useClient } from '@dxos/react-client';
|
|
24
23
|
import { Filter, type Space, useSpaceInvitation } from '@dxos/react-client/echo';
|
|
25
24
|
import { InvitationEncoder } from '@dxos/react-client/invitations';
|
|
25
|
+
import { useAsyncEffect } from '@dxos/react-hooks';
|
|
26
26
|
import { Button, Input, useFileDownload } from '@dxos/react-ui';
|
|
27
27
|
import { getSize, mx } from '@dxos/react-ui-theme';
|
|
28
28
|
import { safeParseInt } from '@dxos/util';
|
package/src/components/Tree.tsx
CHANGED
|
@@ -3,13 +3,8 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import React, { type FC, type HTMLAttributes, useState } from 'react';
|
|
6
|
-
import SyntaxHighlighter from 'react-syntax-highlighter';
|
|
7
|
-
// eslint-disable-next-line no-restricted-imports
|
|
8
|
-
import styleDark from 'react-syntax-highlighter/dist/esm/styles/hljs/a11y-dark';
|
|
9
|
-
// eslint-disable-next-line no-restricted-imports
|
|
10
|
-
import styleLight from 'react-syntax-highlighter/dist/esm/styles/hljs/a11y-light';
|
|
11
6
|
|
|
12
|
-
import {
|
|
7
|
+
import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
13
8
|
import { mx } from '@dxos/react-ui-theme';
|
|
14
9
|
import { arrayToBuffer } from '@dxos/util';
|
|
15
10
|
|
|
@@ -33,13 +28,8 @@ export const replacer = (key: any, value: any) => {
|
|
|
33
28
|
return value;
|
|
34
29
|
};
|
|
35
30
|
|
|
36
|
-
export const Json: FC<{ data?: object
|
|
37
|
-
|
|
38
|
-
return (
|
|
39
|
-
<SyntaxHighlighter language='json' style={style} className='w-full'>
|
|
40
|
-
{JSON.stringify(data, replacer, 2)}
|
|
41
|
-
</SyntaxHighlighter>
|
|
42
|
-
);
|
|
31
|
+
export const Json: FC<{ data?: object }> = ({ data }) => {
|
|
32
|
+
return <SyntaxHighlighter language='json'>{JSON.stringify(data, replacer, 2)}</SyntaxHighlighter>;
|
|
43
33
|
};
|
|
44
34
|
|
|
45
35
|
export const Tree: FC<{ data?: object }> = ({ data }) => {
|
package/src/components/index.ts
CHANGED
|
@@ -7,7 +7,6 @@ import React from 'react';
|
|
|
7
7
|
// Lazily load components for content surfaces.
|
|
8
8
|
export const DebugGlobal = React.lazy(() => import('./DebugGlobal'));
|
|
9
9
|
export const DebugSpace = React.lazy(() => import('./DebugSpace'));
|
|
10
|
-
export const DevtoolsMain = React.lazy(() => import('./DevtoolsMain'));
|
|
11
10
|
|
|
12
11
|
export * from './DebugSettings';
|
|
13
12
|
export * from './DebugStatus';
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/DebugGlobal.tsx", "../../../src/components/Tree.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Gauge, Graph as GraphIcon, Gear, Toolbox, Warning } from '@phosphor-icons/react';\nimport React, { type FC, useEffect, useState } from 'react';\n\nimport { type Graph } from '@dxos/plugin-graph';\nimport { useClient, useConfig } from '@dxos/react-client';\nimport { Button, ToggleGroup, ToggleGroupItem, useThemeContext } from '@dxos/react-ui';\nimport { getSize, mx } from '@dxos/react-ui-theme';\n\nimport { DebugPanel } from './DebugPanel';\nimport { Json, Tree } from './Tree';\n\nconst DebugGlobal: FC<{ graph: Graph }> = ({ graph }) => {\n const { themeMode } = useThemeContext();\n const [view, setView] = useState<'config' | 'diagnostics' | 'graph'>('graph');\n const [data, setData] = useState<any>({});\n const client = useClient();\n const config = useConfig();\n const handleRefresh = async () => {\n const data = await client.diagnostics({ truncate: true });\n setData(data);\n };\n useEffect(() => {\n void handleRefresh();\n }, []);\n\n const handleResetClient = async (force = false) => {\n if (!force && !window.confirm('Reset storage?')) {\n return;\n }\n\n // TODO(burdon): Throws exception.\n await client.reset();\n window.location.href = window.location.origin;\n };\n\n const handleOpenDevtools = () => {\n const vaultUrl = config.values?.runtime?.client?.remoteSource;\n if (vaultUrl) {\n window.open(`https://devtools.dev.dxos.org/?target=${vaultUrl}`);\n }\n };\n\n return (\n <DebugPanel\n menu={\n <>\n <ToggleGroup type='single' value={view}>\n <ToggleGroupItem value={'graph'} onClick={() => setView('graph')} title={'Plugin graph'}>\n <GraphIcon className={getSize(5)} />\n </ToggleGroupItem>\n <ToggleGroupItem value={'diagnostics'} onClick={() => setView('diagnostics')} title={'Diagnostics'}>\n <Gauge className={getSize(5)} />\n </ToggleGroupItem>\n <ToggleGroupItem value={'config'} onClick={() => setView('config')} title={'Config'}>\n <Gear className={getSize(5)} />\n </ToggleGroupItem>\n </ToggleGroup>\n\n <div className='grow' />\n <Button onClick={(event) => handleResetClient(event.shiftKey)} title='Reset client'>\n <Warning className={mx(getSize(5), 'text-red-700')} />\n </Button>\n <Button onClick={handleOpenDevtools} title='Open Devtools'>\n <Toolbox weight='duotone' className={mx(getSize(5), 'text-700')} />\n </Button>\n </>\n }\n >\n {view === 'graph' && <Tree data={graph.toJSON()} />}\n {view === 'config' && <Json theme={themeMode} data={data.diagnostics?.config} />}\n {view === 'diagnostics' && <Json theme={themeMode} data={data} />}\n </DebugPanel>\n );\n};\n\nexport default DebugGlobal;\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport React, { type FC, type HTMLAttributes, useState } from 'react';\nimport SyntaxHighlighter from 'react-syntax-highlighter';\n// eslint-disable-next-line no-restricted-imports\nimport styleDark from 'react-syntax-highlighter/dist/esm/styles/hljs/a11y-dark';\n// eslint-disable-next-line no-restricted-imports\nimport styleLight from 'react-syntax-highlighter/dist/esm/styles/hljs/a11y-light';\n\nimport { type ThemeMode } from '@dxos/react-ui';\nimport { mx } from '@dxos/react-ui-theme';\nimport { arrayToBuffer } from '@dxos/util';\n\n// TODO(burdon): Copied form devtools.\n\nexport const replacer = (key: any, value: any) => {\n if (typeof value === 'object') {\n if (value instanceof Uint8Array) {\n return arrayToBuffer(value).toString('hex');\n }\n\n if (value?.type === 'Buffer') {\n return Buffer.from(value.data).toString('hex');\n }\n\n if (key === 'downloaded') {\n return undefined;\n }\n }\n\n return value;\n};\n\nexport const Json: FC<{ data?: object; theme: ThemeMode }> = ({ data, theme }) => {\n const style = theme === 'dark' ? styleDark : styleLight;\n return (\n <SyntaxHighlighter language='json' style={style} className='w-full'>\n {JSON.stringify(data, replacer, 2)}\n </SyntaxHighlighter>\n );\n};\n\nexport const Tree: FC<{ data?: object }> = ({ data }) => {\n return (\n <div className='flex overflow-auto ml-2 border-l-2 border-blue-500'>\n <Node data={data} root />\n </div>\n );\n};\n\nexport const Node: FC<{ data?: any; root?: boolean }> = ({ data, root }) => {\n if (typeof data !== 'object' || data === undefined || data === null) {\n return <Scalar value={data} />;\n }\n\n if (Array.isArray(data)) {\n return (\n <div className='flex flex-col space-y-2'>\n {data.map((value, index) => (\n <KeyValue key={index} label={String(index)} data={value} className='bg-teal-50' />\n ))}\n </div>\n );\n }\n\n return (\n <div className='flex flex-col space-y-2'>\n {Object.entries(data).map(([key, value]) => (\n <KeyValue key={key} label={key} data={value} className='bg-blue-50' />\n ))}\n </div>\n );\n};\n\nexport const KeyValue: FC<{ label: string; data?: any; className?: string }> = ({ label, data, className }) => {\n const [open, setOpen] = useState(true);\n if (data === undefined) {\n return null;\n }\n\n return (\n <div className='flex'>\n <Box\n className={mx('border-blue-200 text-sm select-none cursor-pointer', className)}\n onClick={() => setOpen((open) => !open)}\n >\n {label}\n </Box>\n {open && <Node data={data} />}\n </div>\n );\n};\n\nconst Scalar: FC<{ value: any }> = ({ value }) => {\n return (\n <Box className='bg-green-50 border-green-200 rounded-r text-sm font-thin'>\n {(value === undefined && 'undefined') ||\n (value === null && 'null') ||\n (typeof value === 'string' && value) ||\n JSON.stringify(value)}\n </Box>\n );\n};\n\nconst Box: FC<HTMLAttributes<HTMLDivElement>> = ({ children, className, ...props }) => {\n return (\n <div className={mx('flex px-2 border border-l-0 font-mono truncate', className)} {...props}>\n {children}\n </div>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,SAASA,OAAOC,SAASC,WAAWC,MAAMC,SAASC,eAAe;AAClE,OAAOC,UAAkBC,WAAWC,YAAAA,iBAAgB;AAGpD,SAASC,WAAWC,iBAAiB;AACrC,SAASC,QAAQC,aAAaC,iBAAiBC,uBAAuB;AACtE,SAASC,SAASC,MAAAA,WAAU;;;ACN5B,OAAOC,SAAuCC,gBAAgB;AAC9D,OAAOC,uBAAuB;AAE9B,OAAOC,eAAe;AAEtB,OAAOC,gBAAgB;AAGvB,SAASC,UAAU;AACnB,SAASC,qBAAqB;AAIvB,IAAMC,WAAW,CAACC,KAAUC,UAAAA;AACjC,MAAI,OAAOA,UAAU,UAAU;AAC7B,QAAIA,iBAAiBC,YAAY;AAC/B,aAAOC,cAAcF,KAAAA,EAAOG,SAAS,KAAA;IACvC;AAEA,QAAIH,OAAOI,SAAS,UAAU;AAC5B,aAAOC,OAAOC,KAAKN,MAAMO,IAAI,EAAEJ,SAAS,KAAA;IAC1C;AAEA,QAAIJ,QAAQ,cAAc;AACxB,aAAOS;IACT;EACF;AAEA,SAAOR;AACT;AAEO,IAAMS,OAAgD,CAAC,EAAEF,MAAMG,MAAK,MAAE;AAC3E,QAAMC,QAAQD,UAAU,SAASE,YAAYC;AAC7C,SACE,sBAAA,cAACC,mBAAAA;IAAkBC,UAAS;IAAOJ;IAAcK,WAAU;KACxDC,KAAKC,UAAUX,MAAMT,UAAU,CAAA,CAAA;AAGtC;AAEO,IAAMqB,OAA8B,CAAC,EAAEZ,KAAI,MAAE;AAClD,SACE,sBAAA,cAACa,OAAAA;IAAIJ,WAAU;KACb,sBAAA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BAAAR,OAAA,cAACS,WAAAA;MAAUC,WAAWC,QAAQ,CAAA;SAEhC,gBAAAX,OAAA,cAACM,iBAAAA;MAAgBD,OAAO;MAAeE,SAAS,MAAMjC,QAAQ,aAAA;MAAgBkC,OAAO;OACnF,gBAAAR,OAAA,cAACY,OAAAA;MAAMF,WAAWC,QAAQ,CAAA;SAE5B,gBAAAX,OAAA,cAACM,iBAAAA;MAAgBD,OAAO;MAAUE,SAAS,MAAMjC,QAAQ,QAAA;MAAWkC,OAAO;OACzE,gBAAAR,OAAA,cAACa,MAAAA;MAAKH,WAAWC,QAAQ,CAAA;UAI7B,gBAAAX,OAAA,cAACc,OAAAA;MAAIJ,WAAU;QACf,gBAAAV,OAAA,cAACe,QAAAA;MAAOR,SAAS,CAACS,UAAU9B,kBAAkB8B,MAAMC,QAAQ;MAAGT,OAAM;OACnE,gBAAAR,OAAA,cAACkB,SAAAA;MAAQR,WAAWS,IAAGR,QAAQ,CAAA,GAAI,cAAA;SAErC,gBAAAX,OAAA,cAACe,QAAAA;MAAOR,SAASb;MAAoBc,OAAM;OACzC,gBAAAR,OAAA,cAACoB,SAAAA;MAAQC,QAAO;MAAUX,WAAWS,IAAGR,QAAQ,CAAA,GAAI,UAAA;;KAKzDtC,SAAS,WAAW,gBAAA2B,OAAA,cAACsB,MAAAA;IAAK9C,MAAMN,MAAMqD,OAAM;MAC5ClD,SAAS,YAAY,gBAAA2B,OAAA,cAACwB,MAAAA;IAAKC,OAAOtD;IAAWK,MAAMA,KAAKO,aAAaH;MACrEP,SAAS,iBAAiB,gBAAA2B,OAAA,cAACwB,MAAAA;IAAKC,OAAOtD;IAAWK;;AAGzD;AAEA,IAAA,sBAAeP;",
|
|
6
|
-
"names": ["Gauge", "Graph", "GraphIcon", "Gear", "Toolbox", "Warning", "React", "useEffect", "useState", "useClient", "useConfig", "Button", "ToggleGroup", "ToggleGroupItem", "useThemeContext", "getSize", "mx", "React", "useState", "SyntaxHighlighter", "styleDark", "styleLight", "mx", "arrayToBuffer", "replacer", "key", "value", "Uint8Array", "arrayToBuffer", "toString", "type", "Buffer", "from", "data", "undefined", "Json", "theme", "style", "styleDark", "styleLight", "SyntaxHighlighter", "language", "className", "JSON", "stringify", "Tree", "div", "Node", "root", "Scalar", "Array", "isArray", "map", "index", "KeyValue", "label", "String", "Object", "entries", "open", "setOpen", "useState", "Box", "mx", "onClick", "children", "props", "DebugGlobal", "graph", "themeMode", "useThemeContext", "view", "setView", "useState", "data", "setData", "client", "useClient", "config", "useConfig", "handleRefresh", "diagnostics", "truncate", "useEffect", "handleResetClient", "force", "window", "confirm", "reset", "location", "href", "origin", "handleOpenDevtools", "vaultUrl", "values", "runtime", "remoteSource", "open", "React", "DebugPanel", "menu", "ToggleGroup", "type", "value", "ToggleGroupItem", "onClick", "title", "GraphIcon", "className", "getSize", "Gauge", "Gear", "div", "Button", "event", "shiftKey", "Warning", "mx", "Toolbox", "weight", "Tree", "toJSON", "Json", "theme"]
|
|
7
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
// packages/plugins/experimental/plugin-debug/src/components/DevtoolsMain.tsx
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { Devtools } from "@dxos/devtools";
|
|
4
|
-
import { useClient } from "@dxos/react-client";
|
|
5
|
-
var DevtoolsMain = () => {
|
|
6
|
-
const client = useClient();
|
|
7
|
-
return /* @__PURE__ */ React.createElement(Devtools, {
|
|
8
|
-
client,
|
|
9
|
-
services: client.services.services
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
var DevtoolsMain_default = DevtoolsMain;
|
|
13
|
-
export {
|
|
14
|
-
DevtoolsMain_default as default
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=DevtoolsMain-DTAWVF22.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/components/DevtoolsMain.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport React from 'react';\n\nimport { Devtools } from '@dxos/devtools';\nimport { useClient, type ClientServices } from '@dxos/react-client';\n\nconst DevtoolsMain = () => {\n const client = useClient();\n\n return <Devtools client={client} services={client.services.services as ClientServices} />;\n};\n\nexport default DevtoolsMain;\n"],
|
|
5
|
-
"mappings": ";AAIA,OAAOA,WAAW;AAElB,SAASC,gBAAgB;AACzB,SAASC,iBAAsC;AAE/C,IAAMC,eAAe,MAAA;AACnB,QAAMC,SAASC,UAAAA;AAEf,SAAO,sBAAA,cAACC,UAAAA;IAASF;IAAgBG,UAAUH,OAAOG,SAASA;;AAC7D;AAEA,IAAA,uBAAeJ;",
|
|
6
|
-
"names": ["React", "Devtools", "useClient", "DevtoolsMain", "client", "useClient", "Devtools", "services"]
|
|
7
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DevtoolsMain.d.ts","sourceRoot":"","sources":["../../../../src/components/DevtoolsMain.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,QAAA,MAAM,YAAY,yBAIjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.test.d.ts","sourceRoot":"","sources":["../../../src/types.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Devtools } from '@dxos/devtools';
|
|
8
|
-
import { useClient, type ClientServices } from '@dxos/react-client';
|
|
9
|
-
|
|
10
|
-
const DevtoolsMain = () => {
|
|
11
|
-
const client = useClient();
|
|
12
|
-
|
|
13
|
-
return <Devtools client={client} services={client.services.services as ClientServices} />;
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
export default DevtoolsMain;
|