@dxos/plugin-debug 0.6.13 → 0.6.14-main.2b6a0f3

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.
Files changed (62) hide show
  1. package/dist/lib/browser/{DebugGlobal-H56M2VL4.mjs → DebugGlobal-ZTCBF3XR.mjs} +5 -5
  2. package/dist/lib/browser/{DebugSpace-NHPMLATA.mjs → DebugSpace-2G2PBGCC.mjs} +16 -41
  3. package/dist/lib/browser/DebugSpace-2G2PBGCC.mjs.map +7 -0
  4. package/dist/lib/browser/chunk-2HTS7SNO.mjs +17 -0
  5. package/dist/lib/browser/chunk-2HTS7SNO.mjs.map +7 -0
  6. package/dist/lib/browser/{chunk-RYK3J66D.mjs → chunk-6Y463JSP.mjs} +3 -3
  7. package/dist/lib/browser/{chunk-ED5L5YYI.mjs → chunk-H3BJHVRD.mjs} +5 -8
  8. package/dist/lib/browser/chunk-H3BJHVRD.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +133 -106
  10. package/dist/lib/browser/index.mjs.map +4 -4
  11. package/dist/lib/browser/meta.json +1 -1
  12. package/dist/lib/browser/meta.mjs +1 -1
  13. package/dist/types/src/DebugPlugin.d.ts.map +1 -1
  14. package/dist/types/src/components/DebugObjectPanel.d.ts +7 -0
  15. package/dist/types/src/components/DebugObjectPanel.d.ts.map +1 -0
  16. package/dist/types/src/components/DebugPanel.d.ts +3 -3
  17. package/dist/types/src/components/DebugPanel.d.ts.map +1 -1
  18. package/dist/types/src/components/DebugSpace.stories.d.ts +3 -13
  19. package/dist/types/src/components/DebugSpace.stories.d.ts.map +1 -1
  20. package/dist/types/src/components/DebugStatus.d.ts.map +1 -1
  21. package/dist/types/src/components/ObjectCreator.d.ts +5 -5
  22. package/dist/types/src/components/ObjectCreator.d.ts.map +1 -1
  23. package/dist/types/src/components/ObjectCreator.stories.d.ts +3 -14
  24. package/dist/types/src/components/ObjectCreator.stories.d.ts.map +1 -1
  25. package/dist/types/src/components/SurfaceDebug.d.ts +9 -0
  26. package/dist/types/src/components/SurfaceDebug.d.ts.map +1 -0
  27. package/dist/types/src/components/Wireframe.d.ts +5 -4
  28. package/dist/types/src/components/Wireframe.d.ts.map +1 -1
  29. package/dist/types/src/components/index.d.ts +3 -4
  30. package/dist/types/src/components/index.d.ts.map +1 -1
  31. package/dist/types/src/meta.d.ts +4 -9
  32. package/dist/types/src/meta.d.ts.map +1 -1
  33. package/dist/types/src/scaffolding/generator.d.ts +1 -2
  34. package/dist/types/src/scaffolding/generator.d.ts.map +1 -1
  35. package/package.json +41 -43
  36. package/src/DebugPlugin.tsx +21 -15
  37. package/src/components/DebugObjectPanel.tsx +22 -0
  38. package/src/components/DebugPanel.tsx +4 -9
  39. package/src/components/DebugSpace.stories.tsx +6 -3
  40. package/src/components/DebugStatus.tsx +20 -13
  41. package/src/components/ObjectCreator.stories.tsx +13 -10
  42. package/src/components/ObjectCreator.tsx +12 -21
  43. package/src/components/SurfaceDebug.tsx +55 -0
  44. package/src/components/Wireframe.tsx +20 -11
  45. package/src/components/index.ts +4 -5
  46. package/src/meta.ts +15 -0
  47. package/src/scaffolding/generator.ts +4 -15
  48. package/dist/lib/browser/DebugSpace-NHPMLATA.mjs.map +0 -7
  49. package/dist/lib/browser/DevtoolsMain-RWT3FLJ6.mjs +0 -15
  50. package/dist/lib/browser/DevtoolsMain-RWT3FLJ6.mjs.map +0 -7
  51. package/dist/lib/browser/chunk-ED5L5YYI.mjs.map +0 -7
  52. package/dist/lib/browser/chunk-WEGYHXMB.mjs +0 -21
  53. package/dist/lib/browser/chunk-WEGYHXMB.mjs.map +0 -7
  54. package/dist/types/src/components/DevtoolsMain.d.ts +0 -4
  55. package/dist/types/src/components/DevtoolsMain.d.ts.map +0 -1
  56. package/dist/types/src/types.test.d.ts +0 -2
  57. package/dist/types/src/types.test.d.ts.map +0 -1
  58. package/src/components/DevtoolsMain.tsx +0 -15
  59. package/src/meta.tsx +0 -19
  60. package/src/types.test.ts +0 -13
  61. /package/dist/lib/browser/{DebugGlobal-H56M2VL4.mjs.map → DebugGlobal-ZTCBF3XR.mjs.map} +0 -0
  62. /package/dist/lib/browser/{chunk-RYK3J66D.mjs.map → chunk-6Y463JSP.mjs.map} +0 -0
@@ -1,7 +1,8 @@
1
1
  import React from 'react';
2
- export declare const Wireframe: ({ label, data, className }: {
2
+ import { type ThemedClassName } from '@dxos/react-ui';
3
+ export type WireframeProps = ThemedClassName<{
3
4
  label?: string;
4
- data?: any;
5
- className?: string;
6
- }) => React.JSX.Element;
5
+ object?: any;
6
+ }>;
7
+ export declare const Wireframe: ({ classNames, label, object }: WireframeProps) => React.JSX.Element;
7
8
  //# sourceMappingURL=Wireframe.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Wireframe.d.ts","sourceRoot":"","sources":["../../../../src/components/Wireframe.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAO1B,eAAO,MAAM,SAAS,+BAAgC;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,GAAG,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,sBAuBvG,CAAC"}
1
+ {"version":3,"file":"Wireframe.d.ts","sourceRoot":"","sources":["../../../../src/components/Wireframe.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAMtD,MAAM,MAAM,cAAc,GAAG,eAAe,CAAC;IAC3C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,GAAG,CAAC;CACd,CAAC,CAAC;AAGH,eAAO,MAAM,SAAS,kCAAmC,cAAc,sBAuBtE,CAAC"}
@@ -1,12 +1,11 @@
1
- import React from 'react';
2
- export declare const DebugGlobal: React.LazyExoticComponent<React.FC<{
1
+ export declare const DebugGlobal: import("react").LazyExoticComponent<import("react").FC<{
3
2
  graph: import("packages/sdk/app-graph/dist/types/src").Graph;
4
3
  }>>;
5
- export declare const DebugSpace: React.LazyExoticComponent<React.FC<{
4
+ export declare const DebugSpace: import("react").LazyExoticComponent<import("react").FC<{
6
5
  space: import("packages/sdk/client-protocol/dist/types/src").Space;
7
6
  onAddObjects?: (objects: import("packages/core/echo/echo-schema/dist/types/src").ReactiveObject<any>[]) => void;
8
7
  }>>;
9
- export declare const DevtoolsMain: React.LazyExoticComponent<() => React.JSX.Element>;
8
+ export * from './DebugObjectPanel';
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;AACnE,eAAO,MAAM,YAAY,oDAA6C,CAAC;AAEvE,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW;;GAAsC,CAAC;AAC/D,eAAO,MAAM,UAAU;;;GAAqC,CAAC;AAE7D,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC"}
@@ -1,15 +1,10 @@
1
- import { type IconProps } from '@phosphor-icons/react';
2
- import React from 'react';
3
1
  export declare const DEBUG_PLUGIN = "dxos.org/plugin/debug";
4
2
  declare const _default: {
5
3
  id: string;
6
- shortId?: string;
7
- name?: string;
8
- description?: string;
9
- homePage?: string;
10
- tags?: string[];
11
- iconComponent?: React.FC<IconProps>;
12
- iconSymbol?: string;
4
+ name: string;
5
+ description: string;
6
+ tags: string[];
7
+ icon: string;
13
8
  };
14
9
  export default _default;
15
10
  //# sourceMappingURL=meta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAO,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,YAAY,0BAA0B,CAAC;;;;;;;;;;;AAEpD,wBAOG"}
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,0BAA0B,CAAC;;;;;;;;AAEpD,wBAMuB"}
@@ -2,8 +2,7 @@ import { SpaceObjectGenerator, type TestGeneratorMap, type TestMutationsMap, typ
2
2
  import { type Space } from '@dxos/react-client/echo';
3
3
  export declare enum SchemasNames {
4
4
  document = "dxos.org/type/Document",
5
- diagram = "dxos.org/type/Diagram",
6
- sheet = "dxos.org/type/SheetType"
5
+ diagram = "dxos.org/type/Diagram"
7
6
  }
8
7
  export declare const SchemasMap: TestSchemaMap<SchemasNames>;
9
8
  export declare const ObjectGenerators: TestGeneratorMap<SchemasNames>;
@@ -1 +1 @@
1
- {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../src/scaffolding/generator.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAS9B,OAAO,EAAqB,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAGxE,oBAAY,YAAY;IACtB,QAAQ,2BAA2B;IACnC,OAAO,0BAA0B;IACjC,KAAK,4BAA4B;CAClC;AAED,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,YAAY,CAIlD,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,gBAAgB,CAAC,YAAY,CAkB3D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,gBAAgB,CAAC,YAAY,CAyF9D,CAAC;AAEF,eAAO,MAAM,0BAA0B,UAAW,KAAK,uCAC6B,CAAC"}
1
+ {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../src/scaffolding/generator.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,oBAAoB,EACpB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAO9B,OAAO,EAAqB,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAKxE,oBAAY,YAAY;IACtB,QAAQ,2BAA2B;IACnC,OAAO,0BAA0B;CAClC;AAED,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,YAAY,CAGlD,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,gBAAgB,CAAC,YAAY,CAa3D,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,gBAAgB,CAAC,YAAY,CAqF9D,CAAC;AAEF,eAAO,MAAM,0BAA0B,UAAW,KAAK,uCAC6B,CAAC"}
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@dxos/plugin-debug",
3
- "version": "0.6.13",
3
+ "version": "0.6.14-main.2b6a0f3",
4
4
  "description": "DXOS Surface plugin for testing.",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
7
7
  "license": "MIT",
8
8
  "author": "DXOS.org",
9
+ "sideEffects": false,
9
10
  "exports": {
10
11
  ".": {
11
12
  "browser": "./dist/lib/browser/index.mjs",
@@ -35,59 +36,56 @@
35
36
  "lodash.get": "^4.4.2",
36
37
  "react-json-tree": "^0.18.0",
37
38
  "react-resize-detector": "^11.0.1",
38
- "react-syntax-highlighter": "^15.5.0",
39
- "@dxos/app-framework": "0.6.13",
40
- "@dxos/async": "0.6.13",
41
- "@dxos/client-services": "0.6.13",
42
- "@dxos/config": "0.6.13",
43
- "@dxos/automerge": "0.6.13",
44
- "@dxos/devtools": "0.6.13",
45
- "@dxos/echo-generator": "0.6.13",
46
- "@dxos/echo-pipeline": "0.6.13",
47
- "@dxos/invariant": "0.6.13",
48
- "@dxos/echo-schema": "0.6.13",
49
- "@dxos/keys": "0.6.13",
50
- "@dxos/local-storage": "0.6.13",
51
- "@dxos/plugin-client": "0.6.13",
52
- "@dxos/plugin-graph": "0.6.13",
53
- "@dxos/log": "0.6.13",
54
- "@dxos/plugin-markdown": "0.6.13",
55
- "@dxos/plugin-settings": "0.6.13",
56
- "@dxos/plugin-sheet": "0.6.13",
57
- "@dxos/plugin-sketch": "0.6.13",
58
- "@dxos/plugin-status-bar": "0.6.13",
59
- "@dxos/plugin-space": "0.6.13",
60
- "@dxos/plugin-table": "0.6.13",
61
- "@dxos/protocols": "0.6.13",
62
- "@dxos/random": "0.6.13",
63
- "@dxos/react-client": "0.6.13",
64
- "@dxos/react-hooks": "0.6.13",
65
- "@dxos/react-ui-attention": "0.6.13",
66
- "@dxos/react-ui-syntax-highlighter": "0.6.13",
67
- "@dxos/react-ui-table": "0.6.13",
68
- "@dxos/plugin-theme": "0.6.13",
69
- "@dxos/util": "0.6.13"
39
+ "@dxos/async": "0.6.14-main.2b6a0f3",
40
+ "@dxos/app-framework": "0.6.14-main.2b6a0f3",
41
+ "@dxos/client-services": "0.6.14-main.2b6a0f3",
42
+ "@dxos/automerge": "0.6.14-main.2b6a0f3",
43
+ "@dxos/config": "0.6.14-main.2b6a0f3",
44
+ "@dxos/devtools": "0.6.14-main.2b6a0f3",
45
+ "@dxos/echo-generator": "0.6.14-main.2b6a0f3",
46
+ "@dxos/invariant": "0.6.14-main.2b6a0f3",
47
+ "@dxos/echo-schema": "0.6.14-main.2b6a0f3",
48
+ "@dxos/echo-pipeline": "0.6.14-main.2b6a0f3",
49
+ "@dxos/keys": "0.6.14-main.2b6a0f3",
50
+ "@dxos/local-storage": "0.6.14-main.2b6a0f3",
51
+ "@dxos/plugin-client": "0.6.14-main.2b6a0f3",
52
+ "@dxos/log": "0.6.14-main.2b6a0f3",
53
+ "@dxos/plugin-graph": "0.6.14-main.2b6a0f3",
54
+ "@dxos/plugin-markdown": "0.6.14-main.2b6a0f3",
55
+ "@dxos/plugin-settings": "0.6.14-main.2b6a0f3",
56
+ "@dxos/plugin-sketch": "0.6.14-main.2b6a0f3",
57
+ "@dxos/plugin-status-bar": "0.6.14-main.2b6a0f3",
58
+ "@dxos/plugin-space": "0.6.14-main.2b6a0f3",
59
+ "@dxos/plugin-table": "0.6.14-main.2b6a0f3",
60
+ "@dxos/plugin-theme": "0.6.14-main.2b6a0f3",
61
+ "@dxos/random": "0.6.14-main.2b6a0f3",
62
+ "@dxos/protocols": "0.6.14-main.2b6a0f3",
63
+ "@dxos/react-client": "0.6.14-main.2b6a0f3",
64
+ "@dxos/react-hooks": "0.6.14-main.2b6a0f3",
65
+ "@dxos/react-ui-attention": "0.6.14-main.2b6a0f3",
66
+ "@dxos/react-ui-table": "0.6.14-main.2b6a0f3",
67
+ "@dxos/react-ui-syntax-highlighter": "0.6.14-main.2b6a0f3",
68
+ "@dxos/util": "0.6.14-main.2b6a0f3"
70
69
  },
71
70
  "devDependencies": {
72
71
  "@phosphor-icons/react": "^2.1.5",
73
72
  "@types/lodash.get": "^4.4.7",
74
73
  "@types/react": "~18.2.0",
75
74
  "@types/react-dom": "~18.2.0",
76
- "@types/react-syntax-highlighter": "^15.5.13",
77
75
  "react": "~18.2.0",
78
76
  "react-dom": "~18.2.0",
79
- "vite": "^5.3.4",
80
- "@dxos/random": "0.6.13",
81
- "@dxos/react-ui": "0.6.13",
82
- "@dxos/react-ui-theme": "0.6.13",
83
- "@dxos/storybook-utils": "0.6.13"
77
+ "vite": "5.4.7",
78
+ "@dxos/react-ui-theme": "0.6.14-main.2b6a0f3",
79
+ "@dxos/react-ui": "0.6.14-main.2b6a0f3",
80
+ "@dxos/storybook-utils": "0.6.14-main.2b6a0f3"
84
81
  },
85
82
  "peerDependencies": {
86
83
  "@phosphor-icons/react": "^2.1.5",
87
- "react": "^18.0.0",
88
- "react-dom": "^18.0.0",
89
- "@dxos/react-ui": "0.6.13",
90
- "@dxos/react-ui-theme": "0.6.13"
84
+ "react": "~18.2.0",
85
+ "react-dom": "~18.2.0",
86
+ "@dxos/random": "0.6.14-main.2b6a0f3",
87
+ "@dxos/react-ui": "0.6.14-main.2b6a0f3",
88
+ "@dxos/react-ui-theme": "0.6.14-main.2b6a0f3"
91
89
  },
92
90
  "publishConfig": {
93
91
  "access": "public"
@@ -2,7 +2,6 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { Bug, Hammer, type IconProps } from '@phosphor-icons/react';
6
5
  import React, { type ReactNode, useEffect, useState } from 'react';
7
6
 
8
7
  import {
@@ -15,22 +14,23 @@ import {
15
14
  type PluginDefinition,
16
15
  } from '@dxos/app-framework';
17
16
  import { Timer } from '@dxos/async';
17
+ import { Devtools } from '@dxos/devtools';
18
18
  import { LocalStorageStore } from '@dxos/local-storage';
19
19
  import { type ClientPluginProvides } from '@dxos/plugin-client';
20
20
  import { createExtension, Graph, type Node } from '@dxos/plugin-graph';
21
21
  import { SpaceAction } from '@dxos/plugin-space';
22
22
  import { CollectionType } from '@dxos/plugin-space/types';
23
23
  import { type Client } from '@dxos/react-client';
24
- import { type Space, SpaceState, isSpace } from '@dxos/react-client/echo';
24
+ import { type Space, SpaceState, isEchoObject, isSpace } from '@dxos/react-client/echo';
25
25
  import { Main } from '@dxos/react-ui';
26
26
  import {
27
27
  baseSurface,
28
- topbarBlockPaddingStart,
29
- fixedInsetFlexLayout,
30
28
  bottombarBlockPaddingEnd,
29
+ fixedInsetFlexLayout,
30
+ topbarBlockPaddingStart,
31
31
  } from '@dxos/react-ui-theme';
32
32
 
33
- import { DebugGlobal, DebugSettings, DebugSpace, DebugStatus, DevtoolsMain, Wireframe } from './components';
33
+ import { DebugGlobal, DebugSettings, DebugSpace, DebugObjectPanel, DebugStatus, Wireframe } from './components';
34
34
  import meta, { DEBUG_PLUGIN } from './meta';
35
35
  import translations from './translations';
36
36
  import { DebugContext, type DebugSettingsProps, type DebugPluginProvides, DebugAction } from './types';
@@ -111,8 +111,7 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
111
111
  type: 'dxos.org/plugin/debug/devtools',
112
112
  properties: {
113
113
  label: ['devtools label', { ns: DEBUG_PLUGIN }],
114
- icon: (props: IconProps) => <Hammer {...props} />,
115
- iconSymbol: 'ph--hammer--regular',
114
+ icon: 'ph--hammer--regular',
116
115
  },
117
116
  },
118
117
  ],
@@ -129,8 +128,7 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
129
128
  data: { graph: graphPlugin?.provides.graph },
130
129
  properties: {
131
130
  label: ['debug label', { ns: DEBUG_PLUGIN }],
132
- icon: (props: IconProps) => <Bug {...props} />,
133
- iconSymbol: 'ph--bug--regular',
131
+ icon: 'ph--bug--regular',
134
132
  },
135
133
  },
136
134
  ],
@@ -144,13 +142,12 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
144
142
  const space = node.data;
145
143
  return [
146
144
  {
147
- id: `${space.id}-debug`,
145
+ id: `${space.id}-debug`, // TODO(burdon): Change to slashes consistently.
148
146
  type: 'dxos.org/plugin/debug/space',
149
147
  data: { space },
150
148
  properties: {
151
149
  label: ['debug label', { ns: DEBUG_PLUGIN }],
152
- icon: (props: IconProps) => <Bug {...props} />,
153
- iconSymbol: 'ph--bug--regular',
150
+ icon: 'ph--bug--regular',
154
151
  },
155
152
  },
156
153
  ];
@@ -191,13 +188,15 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
191
188
  return data.plugin === meta.id ? <DebugSettings settings={settings.values} /> : null;
192
189
  case 'status':
193
190
  return <DebugStatus />;
191
+ case 'complementary--debug':
192
+ return isEchoObject(data.subject) ? <DebugObjectPanel object={data.subject} /> : null;
194
193
  }
195
194
 
196
195
  const primary = data.active ?? data.object;
197
196
  let component: ReactNode;
198
197
  if (role === 'main' || role === 'article') {
199
198
  if (primary === 'devtools' && settings.values.devtools) {
200
- component = <DevtoolsMain />;
199
+ component = <Devtools />;
201
200
  } else if (!primary || typeof primary !== 'object' || !settings.values.debug) {
202
201
  component = null;
203
202
  } else if ('space' in primary && isSpace(primary.space)) {
@@ -236,8 +235,15 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
236
235
  if (settings.values.wireframe) {
237
236
  if (role === 'main' || role === 'article' || role === 'section') {
238
237
  const primary = data.active ?? data.object;
239
- if (!(primary instanceof CollectionType)) {
240
- return <Wireframe label={role} data={data} className='row-span-2 overflow-hidden' />;
238
+ const isCollection = primary instanceof CollectionType;
239
+ // TODO(burdon): Move into Container abstraction.
240
+ if (!isCollection) {
241
+ return {
242
+ disposition: 'hoist',
243
+ node: (
244
+ <Wireframe label={`${role}:${name}`} object={primary} classNames='row-span-2 overflow-hidden' />
245
+ ),
246
+ };
241
247
  }
242
248
  }
243
249
  }
@@ -0,0 +1,22 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { type EchoReactiveObject } from '@dxos/client/echo';
8
+ import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
9
+
10
+ export type DebugObjectPanelProps = {
11
+ object: EchoReactiveObject<any>;
12
+ };
13
+
14
+ export const DebugObjectPanel = ({ object }: DebugObjectPanelProps) => {
15
+ return (
16
+ <div role='form' className='flex flex-col'>
17
+ <SyntaxHighlighter classNames='flex text-xs' language='json'>
18
+ {JSON.stringify(object, null, 2)}
19
+ </SyntaxHighlighter>
20
+ </div>
21
+ );
22
+ };
@@ -3,29 +3,24 @@
3
3
  //
4
4
 
5
5
  import { formatDistance } from 'date-fns';
6
- import React, { type FC, type PropsWithChildren, type ReactNode } from 'react';
6
+ import React, { type PropsWithChildren, type ReactNode } from 'react';
7
7
 
8
8
  import { useConfig } from '@dxos/react-client';
9
- import { DensityProvider } from '@dxos/react-ui';
10
9
 
11
- export const DebugPanel: FC<PropsWithChildren<{ menu: ReactNode }>> = ({ menu, children }) => {
10
+ export const DebugPanel = ({ menu, children }: PropsWithChildren<{ menu: ReactNode }>) => {
12
11
  const config = useConfig();
13
12
  return (
14
13
  <>
15
- <div className='flex shrink-0 p-2 space-x-2'>
16
- <DensityProvider density='fine'>{menu}</DensityProvider>
17
- </div>
14
+ <div className='flex shrink-0 p-2 space-x-2'>{menu}</div>
18
15
  <div className='flex flex-col grow px-2 overflow-hidden'>
19
16
  <div className='flex flex-col grow overflow-auto'>{children}</div>
20
-
21
17
  {config.values?.runtime?.app?.build?.timestamp && (
22
18
  <div className='p-2 text-sm font-mono'>
23
- {config.values?.runtime?.app?.build?.version} (
19
+ {config.values?.runtime?.app?.build?.version}
24
20
  {formatDistance(new Date(config.values?.runtime?.app?.build?.timestamp), new Date(), {
25
21
  addSuffix: true,
26
22
  includeSeconds: true,
27
23
  })}
28
- )
29
24
  </div>
30
25
  )}
31
26
  </div>
@@ -4,6 +4,7 @@
4
4
 
5
5
  import '@dxos-theme';
6
6
 
7
+ import { type Meta } from '@storybook/react';
7
8
  import React, { useEffect } from 'react';
8
9
 
9
10
  import { createSpaceObjectGenerator } from '@dxos/echo-generator';
@@ -28,8 +29,10 @@ const Story = () => {
28
29
  return <DebugSpace space={space} />;
29
30
  };
30
31
 
31
- export default {
32
- title: 'plugin-debug/DebugSpace',
32
+ export const Default = {};
33
+
34
+ const meta: Meta = {
35
+ title: 'plugins/plugin-debug/DebugSpace',
33
36
  component: DebugSpace,
34
37
  render: () => <ClientRepeater component={Story} createSpace />,
35
38
  parameters: {
@@ -37,4 +40,4 @@ export default {
37
40
  },
38
41
  };
39
42
 
40
- export const Default = {};
43
+ export default meta;
@@ -2,7 +2,6 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { ChartBar, Circle, Lightning, LightningSlash } from '@phosphor-icons/react';
6
5
  import React, { useEffect, useRef, useState } from 'react';
7
6
 
8
7
  import { firstIdInPart, parseGraphPlugin, parseNavigationPlugin, useResolvePlugin } from '@dxos/app-framework';
@@ -13,7 +12,8 @@ import { getActiveSpace } from '@dxos/plugin-space';
13
12
  import { StatusBar } from '@dxos/plugin-status-bar';
14
13
  import { ConnectionState } from '@dxos/protocols/proto/dxos/client/services';
15
14
  import { useNetworkStatus } from '@dxos/react-client/mesh';
16
- import { getSize, mx } from '@dxos/react-ui-theme';
15
+ import { Icon } from '@dxos/react-ui';
16
+ import { mx } from '@dxos/react-ui-theme';
17
17
 
18
18
  const styles = {
19
19
  success: 'text-sky-300 dark:text-green-700',
@@ -97,13 +97,13 @@ const ErrorIndicator = () => {
97
97
  if (errorRef.current) {
98
98
  return (
99
99
  <StatusBar.Button title={errorRef.current.message} onClick={handleReset}>
100
- <Circle weight='fill' className={mx(styles.error, getSize(3))} />
100
+ <Icon icon='ph--warning-circle--duotone' size={4} classNames={styles.error} />
101
101
  </StatusBar.Button>
102
102
  );
103
103
  } else {
104
104
  return (
105
105
  <StatusBar.Item title='No errors.'>
106
- <Circle weight='fill' className={getSize(3)} />
106
+ <Icon icon='ph--check--regular' size={4} />
107
107
  </StatusBar.Item>
108
108
  );
109
109
  }
@@ -122,21 +122,22 @@ const SwarmIndicator = () => {
122
122
  if (state === 0) {
123
123
  return (
124
124
  <StatusBar.Item title='Connected to swarm.'>
125
- <Lightning className={getSize(4)} />
125
+ <Icon icon='ph--lightning--regular' size={4} />
126
126
  </StatusBar.Item>
127
127
  );
128
128
  } else {
129
129
  return (
130
130
  <StatusBar.Item title='Disconnected from swarm.'>
131
- <LightningSlash className={mx(styles.warning, getSize(4))} />
131
+ <Icon icon='ph--lightning-slash--regular' size={4} classNames={styles.warning} />
132
132
  </StatusBar.Item>
133
133
  );
134
134
  }
135
135
  };
136
136
 
137
137
  /**
138
- * Space saving indicator.
138
+ * Data saving indicator.
139
139
  */
140
+ // TODO(burdon): Merge with SaveStatus.
140
141
  const SavingIndicator = () => {
141
142
  const [state, _setState] = useState(0);
142
143
  const navigationPlugin = useResolvePlugin(parseNavigationPlugin);
@@ -167,20 +168,20 @@ const SavingIndicator = () => {
167
168
  case 2:
168
169
  return (
169
170
  <StatusBar.Item title='Edit not saved.'>
170
- <Circle weight='fill' className={mx(styles.warning, getSize(3))} />
171
+ <Icon icon='ph--circle--duotone' size={4} classNames={styles.warning} />
171
172
  </StatusBar.Item>
172
173
  );
173
174
  case 1:
174
175
  return (
175
176
  <StatusBar.Item title='Saving...'>
176
- <Circle weight='fill' className={mx(styles.success, getSize(3))} />
177
+ <Icon icon='ph--circle--duotone' size={4} classNames={styles.success} />
177
178
  </StatusBar.Item>
178
179
  );
179
180
  case 0:
180
181
  default:
181
182
  return (
182
183
  <StatusBar.Item title='Modified indicator.'>
183
- <Circle weight='fill' className={getSize(3)} />
184
+ <Icon icon='ph--circle--duotone' size={4} />
184
185
  </StatusBar.Item>
185
186
  );
186
187
  }
@@ -193,10 +194,16 @@ const PerformanceIndicator = () => {
193
194
  return (
194
195
  <>
195
196
  <StatusBar.Button onClick={() => setVisible((visible) => !visible)} title='Performance panels'>
196
- <ChartBar />
197
+ <Icon icon='ph--chart-bar--regular' size={4} />
197
198
  </StatusBar.Button>
198
199
  {visible && (
199
- <div className='z-20 absolute bottom-[24px] w-[450px] border-l border-y border-separator'>
200
+ <div
201
+ className={mx(
202
+ 'z-20 absolute bottom-[--statusbar-size] right-2 w-[450px] max-h-[600px]',
203
+ 'overflow-x-hidden overflow-y-auto scrollbar-thin',
204
+ 'border-x border-y border-separator',
205
+ )}
206
+ >
200
207
  <StatsPanel stats={stats} onRefresh={refreshStats} />
201
208
  </div>
202
209
  )}
@@ -204,7 +211,7 @@ const PerformanceIndicator = () => {
204
211
  );
205
212
  };
206
213
 
207
- const indicators = [PerformanceIndicator, SavingIndicator, ErrorIndicator, SwarmIndicator];
214
+ const indicators = [SavingIndicator, SwarmIndicator, PerformanceIndicator, ErrorIndicator];
208
215
 
209
216
  export const DebugStatus = () => {
210
217
  return (
@@ -4,15 +4,16 @@
4
4
 
5
5
  import '@dxos-theme';
6
6
 
7
- import React, { type FC, useEffect } from 'react';
7
+ import { type Meta } from '@storybook/react';
8
+ import React, { useEffect } from 'react';
8
9
 
9
10
  import { createSpaceObjectGenerator } from '@dxos/echo-generator';
10
11
  import { type ReactiveObject, useSpaces } from '@dxos/react-client/echo';
11
12
  import { ClientRepeater } from '@dxos/react-client/testing';
12
13
 
13
- import { ObjectCreator } from './ObjectCreator';
14
+ import { ObjectCreator, type ObjectCreatorProps } from './ObjectCreator';
14
15
 
15
- const Story: FC = () => {
16
+ const Story = () => {
16
17
  const [space] = useSpaces();
17
18
  useEffect(() => {
18
19
  if (space) {
@@ -21,19 +22,21 @@ const Story: FC = () => {
21
22
  }
22
23
  }, [space]);
23
24
 
24
- const handleCreate = (objects: ReactiveObject<any>[]) => {
25
- console.log('Created:', objects);
26
- };
27
-
28
25
  if (!space) {
29
26
  return null;
30
27
  }
31
28
 
29
+ const handleCreate: ObjectCreatorProps['onAddObjects'] = (objects: ReactiveObject<any>[]) => {
30
+ console.log('Created:', objects);
31
+ };
32
+
32
33
  return <ObjectCreator space={space} onAddObjects={handleCreate} />;
33
34
  };
34
35
 
35
- export default {
36
- title: 'plugin-debug/SchemaList',
36
+ export const Default = {};
37
+
38
+ const meta: Meta = {
39
+ title: 'plugins/plugin-debug/SchemaList',
37
40
  component: ObjectCreator,
38
41
  render: () => <ClientRepeater component={Story} createSpace />,
39
42
  parameters: {
@@ -41,4 +44,4 @@ export default {
41
44
  },
42
45
  };
43
46
 
44
- export const Default = {};
47
+ export default meta;
@@ -2,11 +2,10 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import React, { type FC, useMemo, useState } from 'react';
5
+ import React, { useMemo, useState } from 'react';
6
6
 
7
- import { type EchoReactiveObject, type ReactiveObject } from '@dxos/echo-schema';
8
- import { type Space } from '@dxos/react-client/echo';
9
- import { Button, DensityProvider } from '@dxos/react-ui';
7
+ import { type EchoReactiveObject, type ReactiveObject, type Space } from '@dxos/react-client/echo';
8
+ import { Button } from '@dxos/react-ui';
10
9
  import { createColumnBuilder, type TableColumnDef, Table } from '@dxos/react-ui-table';
11
10
 
12
11
  import { SchemasNames, createSpaceObjectGenerator } from '../scaffolding';
@@ -22,10 +21,12 @@ export type CreateObjectsParams = {
22
21
 
23
22
  const CREATE_OBJECTS_IN_ONE_CHUNK = 10;
24
23
 
25
- export const ObjectCreator: FC<{
24
+ export type ObjectCreatorProps = {
26
25
  space: Space;
27
26
  onAddObjects?: (objects: ReactiveObject<any>[]) => void;
28
- }> = ({ space, onAddObjects }) => {
27
+ };
28
+
29
+ export const ObjectCreator = ({ space, onAddObjects }: ObjectCreatorProps) => {
29
30
  const generator = useMemo(() => createSpaceObjectGenerator(space), [space]);
30
31
 
31
32
  const [objectsToCreate, setObjectsToCreate] = useState<CreateObjectsParams[]>([
@@ -45,14 +46,6 @@ export const ObjectCreator: FC<{
45
46
  mutationSize: 10,
46
47
  maxContentLength: 1000,
47
48
  },
48
- {
49
- enabled: true,
50
- schema: SchemasNames.sheet,
51
- objectsCount: 10,
52
- mutationsCount: 10,
53
- mutationSize: 10,
54
- maxContentLength: 1000,
55
- },
56
49
  ]);
57
50
 
58
51
  const handleCreate = async () => {
@@ -95,13 +88,11 @@ export const ObjectCreator: FC<{
95
88
 
96
89
  return (
97
90
  <>
98
- <DensityProvider density={'fine'}>
99
- <Table.Root>
100
- <Table.Viewport>
101
- <Table.Main<CreateObjectsParams> columns={columns} data={objectsToCreate} />
102
- </Table.Viewport>
103
- </Table.Root>
104
- </DensityProvider>
91
+ <Table.Root>
92
+ <Table.Viewport>
93
+ <Table.Main<CreateObjectsParams> columns={columns} data={objectsToCreate} />
94
+ </Table.Viewport>
95
+ </Table.Root>
105
96
  <Button onClick={handleCreate}>Create</Button>
106
97
  </>
107
98
  );