@dxos/plugin-debug 0.6.13 → 0.6.14-main.69511f5

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 (68) hide show
  1. package/dist/lib/browser/{DebugGlobal-H56M2VL4.mjs → DebugGlobal-ZTCBF3XR.mjs} +5 -5
  2. package/dist/lib/browser/{DebugSpace-NHPMLATA.mjs → DebugSpace-I6BNZKI2.mjs} +16 -41
  3. package/dist/lib/browser/DebugSpace-I6BNZKI2.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-ED5L5YYI.mjs → chunk-H3BJHVRD.mjs} +5 -8
  7. package/dist/lib/browser/chunk-H3BJHVRD.mjs.map +7 -0
  8. package/dist/lib/browser/{chunk-RYK3J66D.mjs → chunk-NHHLZV45.mjs} +11 -4
  9. package/dist/lib/browser/chunk-NHHLZV45.mjs.map +7 -0
  10. package/dist/lib/browser/index.mjs +248 -144
  11. package/dist/lib/browser/index.mjs.map +4 -4
  12. package/dist/lib/browser/meta.json +1 -1
  13. package/dist/lib/browser/meta.mjs +1 -1
  14. package/dist/types/src/DebugPlugin.d.ts +1 -3
  15. package/dist/types/src/DebugPlugin.d.ts.map +1 -1
  16. package/dist/types/src/components/DebugObjectPanel.d.ts +7 -0
  17. package/dist/types/src/components/DebugObjectPanel.d.ts.map +1 -0
  18. package/dist/types/src/components/DebugPanel.d.ts +3 -3
  19. package/dist/types/src/components/DebugPanel.d.ts.map +1 -1
  20. package/dist/types/src/components/DebugSpace.stories.d.ts +3 -13
  21. package/dist/types/src/components/DebugSpace.stories.d.ts.map +1 -1
  22. package/dist/types/src/components/DebugStatus.d.ts.map +1 -1
  23. package/dist/types/src/components/ObjectCreator.d.ts +5 -5
  24. package/dist/types/src/components/ObjectCreator.d.ts.map +1 -1
  25. package/dist/types/src/components/ObjectCreator.stories.d.ts +3 -14
  26. package/dist/types/src/components/ObjectCreator.stories.d.ts.map +1 -1
  27. package/dist/types/src/components/SurfaceDebug.d.ts +9 -0
  28. package/dist/types/src/components/SurfaceDebug.d.ts.map +1 -0
  29. package/dist/types/src/components/Wireframe.d.ts +5 -4
  30. package/dist/types/src/components/Wireframe.d.ts.map +1 -1
  31. package/dist/types/src/components/index.d.ts +3 -4
  32. package/dist/types/src/components/index.d.ts.map +1 -1
  33. package/dist/types/src/meta.d.ts +4 -9
  34. package/dist/types/src/meta.d.ts.map +1 -1
  35. package/dist/types/src/scaffolding/generator.d.ts +1 -2
  36. package/dist/types/src/scaffolding/generator.d.ts.map +1 -1
  37. package/dist/types/src/types.d.ts +8 -5
  38. package/dist/types/src/types.d.ts.map +1 -1
  39. package/package.json +45 -47
  40. package/src/DebugPlugin.tsx +134 -47
  41. package/src/components/DebugObjectPanel.tsx +22 -0
  42. package/src/components/DebugPanel.tsx +4 -9
  43. package/src/components/DebugSettings.tsx +13 -13
  44. package/src/components/DebugSpace.stories.tsx +6 -3
  45. package/src/components/DebugStatus.tsx +20 -13
  46. package/src/components/ObjectCreator.stories.tsx +13 -10
  47. package/src/components/ObjectCreator.tsx +12 -21
  48. package/src/components/SurfaceDebug.tsx +55 -0
  49. package/src/components/Wireframe.tsx +20 -11
  50. package/src/components/index.ts +4 -5
  51. package/src/meta.ts +15 -0
  52. package/src/scaffolding/generator.ts +4 -15
  53. package/src/types.ts +10 -5
  54. package/dist/lib/browser/DebugSpace-NHPMLATA.mjs.map +0 -7
  55. package/dist/lib/browser/DevtoolsMain-RWT3FLJ6.mjs +0 -15
  56. package/dist/lib/browser/DevtoolsMain-RWT3FLJ6.mjs.map +0 -7
  57. package/dist/lib/browser/chunk-ED5L5YYI.mjs.map +0 -7
  58. package/dist/lib/browser/chunk-RYK3J66D.mjs.map +0 -7
  59. package/dist/lib/browser/chunk-WEGYHXMB.mjs +0 -21
  60. package/dist/lib/browser/chunk-WEGYHXMB.mjs.map +0 -7
  61. package/dist/types/src/components/DevtoolsMain.d.ts +0 -4
  62. package/dist/types/src/components/DevtoolsMain.d.ts.map +0 -1
  63. package/dist/types/src/types.test.d.ts +0 -2
  64. package/dist/types/src/types.test.d.ts.map +0 -1
  65. package/src/components/DevtoolsMain.tsx +0 -15
  66. package/src/meta.tsx +0 -19
  67. package/src/types.test.ts +0 -13
  68. /package/dist/lib/browser/{DebugGlobal-H56M2VL4.mjs.map → DebugGlobal-ZTCBF3XR.mjs.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectCreator.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/ObjectCreator.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,KAA6B,MAAM,OAAO,CAAC;AAGlD,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,yBAAyB,CAAC;;;;;;;;;;;;AAyBzE,wBAOE;AAEF,eAAO,MAAM,OAAO,IAAK,CAAC"}
1
+ {"version":3,"file":"ObjectCreator.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/ObjectCreator.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,MAAM,kBAAkB,CAAC;AA6B7C,eAAO,MAAM,OAAO,IAAK,CAAC;AAE1B,QAAA,MAAM,IAAI,EAAE,IAOX,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { type ThemedClassName } from '@dxos/react-ui';
3
+ export type SurfaceDebugProps = ThemedClassName<{}>;
4
+ /**
5
+ * Show surface info.
6
+ * NOTE: Remove from @dxos/app-framework if removing this.
7
+ */
8
+ export declare const SurfaceDebug: ({ classNames }: SurfaceDebugProps) => React.JSX.Element;
9
+ //# sourceMappingURL=SurfaceDebug.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SurfaceDebug.d.ts","sourceRoot":"","sources":["../../../../src/components/SurfaceDebug.tsx"],"names":[],"mappings":"AAIA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAGjD,OAAO,EAAgB,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAKpE,MAAM,MAAM,iBAAiB,GAAG,eAAe,CAAC,EAAE,CAAC,CAAC;AAEpD;;;GAGG;AACH,eAAO,MAAM,YAAY,mBAAoB,iBAAiB,sBAoC7D,CAAC"}
@@ -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"}
@@ -1,6 +1,7 @@
1
1
  import { type Context } from 'react';
2
2
  import type { GraphBuilderProvides, IntentResolverProvides, SettingsProvides, SurfaceProvides, TranslationsProvides } from '@dxos/app-framework';
3
3
  import type { TimerCallback, TimerOptions } from '@dxos/async';
4
+ import { S } from '@dxos/echo-schema';
4
5
  export declare enum DebugAction {
5
6
  OPEN_DEVTOOLS = "dxos.org/plugin/debug/action/open-devtools"
6
7
  }
@@ -10,10 +11,12 @@ export type DebugContextType = {
10
11
  stop: () => void;
11
12
  };
12
13
  export declare const DebugContext: Context<DebugContextType>;
13
- export type DebugSettingsProps = {
14
- devtools?: boolean;
15
- debug?: boolean;
16
- wireframe?: boolean;
17
- };
14
+ export declare const DebugSettingsSchema: S.mutable<S.Struct<{
15
+ devtools: S.optional<typeof S.Boolean>;
16
+ debug: S.optional<typeof S.Boolean>;
17
+ wireframe: S.optional<typeof S.Boolean>;
18
+ }>>;
19
+ export interface DebugSettingsProps extends S.Schema.Type<typeof DebugSettingsSchema> {
20
+ }
18
21
  export type DebugPluginProvides = SurfaceProvides & IntentResolverProvides & GraphBuilderProvides & SettingsProvides<DebugSettingsProps> & TranslationsProvides;
19
22
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,OAAO,CAAC;AAEpD,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAK/D,oBAAY,WAAW;IACrB,aAAa,+CAAkC;CAChD;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,CAAC,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IAC1D,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,gBAAgB,CAIjD,CAAC;AAEH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAC/C,sBAAsB,GACtB,oBAAoB,GACpB,gBAAgB,CAAC,kBAAkB,CAAC,GACpC,oBAAoB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,OAAO,EAAiB,MAAM,OAAO,CAAC;AAEpD,OAAO,KAAK,EACV,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,mBAAmB,CAAC;AAKtC,oBAAY,WAAW;IACrB,aAAa,+CAAkC;CAChD;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,CAAC,EAAE,EAAE,aAAa,EAAE,OAAO,EAAE,YAAY,KAAK,IAAI,CAAC;IAC1D,IAAI,EAAE,MAAM,IAAI,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,OAAO,CAAC,gBAAgB,CAIjD,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;GAM/B,CAAC;AAEF,MAAM,WAAW,kBAAmB,SAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,mBAAmB,CAAC;CAAG;AAExF,MAAM,MAAM,mBAAmB,GAAG,eAAe,GAC/C,sBAAsB,GACtB,oBAAoB,GACpB,gBAAgB,CAAC,kBAAkB,CAAC,GACpC,oBAAoB,CAAC"}
package/package.json CHANGED
@@ -1,19 +1,20 @@
1
1
  {
2
2
  "name": "@dxos/plugin-debug",
3
- "version": "0.6.13",
3
+ "version": "0.6.14-main.69511f5",
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": true,
9
10
  "exports": {
10
11
  ".": {
11
- "browser": "./dist/lib/browser/index.mjs",
12
- "types": "./dist/types/src/index.d.ts"
12
+ "types": "./dist/types/src/index.d.ts",
13
+ "browser": "./dist/lib/browser/index.mjs"
13
14
  },
14
15
  "./meta": {
15
- "browser": "./dist/lib/browser/meta.mjs",
16
- "types": "./dist/types/src/meta.d.ts"
16
+ "types": "./dist/types/src/meta.d.ts",
17
+ "browser": "./dist/lib/browser/meta.mjs"
17
18
  }
18
19
  },
19
20
  "types": "dist/types/src/index.d.ts",
@@ -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/app-framework": "0.6.14-main.69511f5",
40
+ "@dxos/automerge": "0.6.14-main.69511f5",
41
+ "@dxos/client-services": "0.6.14-main.69511f5",
42
+ "@dxos/async": "0.6.14-main.69511f5",
43
+ "@dxos/config": "0.6.14-main.69511f5",
44
+ "@dxos/devtools": "0.6.14-main.69511f5",
45
+ "@dxos/echo-generator": "0.6.14-main.69511f5",
46
+ "@dxos/echo-pipeline": "0.6.14-main.69511f5",
47
+ "@dxos/echo-schema": "0.6.14-main.69511f5",
48
+ "@dxos/invariant": "0.6.14-main.69511f5",
49
+ "@dxos/log": "0.6.14-main.69511f5",
50
+ "@dxos/keys": "0.6.14-main.69511f5",
51
+ "@dxos/local-storage": "0.6.14-main.69511f5",
52
+ "@dxos/plugin-graph": "0.6.14-main.69511f5",
53
+ "@dxos/plugin-client": "0.6.14-main.69511f5",
54
+ "@dxos/plugin-markdown": "0.6.14-main.69511f5",
55
+ "@dxos/plugin-status-bar": "0.6.14-main.69511f5",
56
+ "@dxos/plugin-sketch": "0.6.14-main.69511f5",
57
+ "@dxos/plugin-space": "0.6.14-main.69511f5",
58
+ "@dxos/protocols": "0.6.14-main.69511f5",
59
+ "@dxos/plugin-table": "0.6.14-main.69511f5",
60
+ "@dxos/plugin-theme": "0.6.14-main.69511f5",
61
+ "@dxos/random": "0.6.14-main.69511f5",
62
+ "@dxos/react-client": "0.6.14-main.69511f5",
63
+ "@dxos/react-hooks": "0.6.14-main.69511f5",
64
+ "@dxos/react-ui-attention": "0.6.14-main.69511f5",
65
+ "@dxos/react-ui-data": "0.6.14-main.69511f5",
66
+ "@dxos/react-ui-syntax-highlighter": "0.6.14-main.69511f5",
67
+ "@dxos/react-ui-table": "0.6.14-main.69511f5",
68
+ "@dxos/util": "0.6.14-main.69511f5"
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": "0.6.14-main.69511f5",
79
+ "@dxos/react-ui-theme": "0.6.14-main.69511f5",
80
+ "@dxos/storybook-utils": "0.6.14-main.69511f5"
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/react-ui": "0.6.14-main.69511f5",
87
+ "@dxos/random": "0.6.14-main.69511f5",
88
+ "@dxos/react-ui-theme": "0.6.14-main.69511f5"
91
89
  },
92
90
  "publishConfig": {
93
91
  "access": "public"
@@ -2,53 +2,59 @@
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 {
9
- getPlugin,
8
+ definePlugin,
10
9
  parseGraphPlugin,
11
10
  parseIntentPlugin,
11
+ parseMetadataResolverPlugin,
12
+ parseSettingsPlugin,
12
13
  resolvePlugin,
13
- type IntentPluginProvides,
14
- type Plugin,
15
- type PluginDefinition,
16
14
  } from '@dxos/app-framework';
17
15
  import { Timer } from '@dxos/async';
18
- import { LocalStorageStore } from '@dxos/local-storage';
19
- import { type ClientPluginProvides } from '@dxos/plugin-client';
20
- import { createExtension, Graph, type Node } from '@dxos/plugin-graph';
16
+ import { Devtools } from '@dxos/devtools';
17
+ import { invariant } from '@dxos/invariant';
18
+ import { type ClientPluginProvides, parseClientPlugin } from '@dxos/plugin-client';
19
+ import { createExtension, Graph, type Node, toSignal } from '@dxos/plugin-graph';
21
20
  import { SpaceAction } from '@dxos/plugin-space';
22
21
  import { CollectionType } from '@dxos/plugin-space/types';
23
22
  import { type Client } from '@dxos/react-client';
24
- import { type Space, SpaceState, isSpace } from '@dxos/react-client/echo';
23
+ import { create, getTypename, isEchoObject, isSpace, parseId, type Space, SpaceState } from '@dxos/react-client/echo';
25
24
  import { Main } from '@dxos/react-ui';
26
25
  import {
27
26
  baseSurface,
28
- topbarBlockPaddingStart,
29
- fixedInsetFlexLayout,
30
27
  bottombarBlockPaddingEnd,
28
+ fixedInsetFlexLayout,
29
+ topbarBlockPaddingStart,
31
30
  } from '@dxos/react-ui-theme';
32
31
 
33
- import { DebugGlobal, DebugSettings, DebugSpace, DebugStatus, DevtoolsMain, Wireframe } from './components';
32
+ import { DebugGlobal, DebugObjectPanel, DebugSettings, DebugSpace, DebugStatus, Wireframe } from './components';
34
33
  import meta, { DEBUG_PLUGIN } from './meta';
35
34
  import translations from './translations';
36
- import { DebugContext, type DebugSettingsProps, type DebugPluginProvides, DebugAction } from './types';
37
-
38
- export const SETTINGS_KEY = DEBUG_PLUGIN + '/settings';
35
+ import {
36
+ DebugAction,
37
+ DebugContext,
38
+ type DebugPluginProvides,
39
+ type DebugSettingsProps,
40
+ DebugSettingsSchema,
41
+ } from './types';
39
42
 
40
- export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
41
- const settings = new LocalStorageStore<DebugSettingsProps>(DEBUG_PLUGIN, { debug: true, devtools: true });
42
- let intentPlugin: Plugin<IntentPluginProvides>;
43
+ export const DebugPlugin = definePlugin<DebugPluginProvides>((context) => {
44
+ const settings = create<DebugSettingsProps>({
45
+ debug: true,
46
+ devtools: true,
47
+ });
43
48
 
44
49
  return {
45
50
  meta,
46
51
  ready: async (plugins) => {
47
- intentPlugin = resolvePlugin(plugins, parseIntentPlugin)!;
48
- settings
49
- .prop({ key: 'debug', type: LocalStorageStore.bool({ allowUndefined: true }) })
50
- .prop({ key: 'devtools', type: LocalStorageStore.bool({ allowUndefined: true }) })
51
- .prop({ key: 'wireframe', type: LocalStorageStore.bool({ allowUndefined: true }) });
52
+ context.init(plugins);
53
+ context.resolvePlugin(parseSettingsPlugin).provides.settingsStore.createStore({
54
+ schema: DebugSettingsSchema,
55
+ prefix: DEBUG_PLUGIN,
56
+ value: settings,
57
+ });
52
58
 
53
59
  // TODO(burdon): Remove hacky dependency on global variable.
54
60
  // Used to test how composer handles breaking protocol changes.
@@ -65,10 +71,10 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
65
71
  };
66
72
  },
67
73
  unload: async () => {
68
- settings.close();
74
+ context.dispose();
69
75
  },
70
76
  provides: {
71
- settings: settings.values,
77
+ settings,
72
78
  translations,
73
79
  context: ({ children }) => {
74
80
  const [timer, setTimer] = useState<Timer>();
@@ -94,15 +100,19 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
94
100
  },
95
101
  graph: {
96
102
  builder: (plugins) => {
103
+ const clientPlugin = resolvePlugin(plugins, parseClientPlugin);
104
+ const metadataPlugin = resolvePlugin(plugins, parseMetadataResolverPlugin);
97
105
  const graphPlugin = resolvePlugin(plugins, parseGraphPlugin);
98
-
99
- // TODO(burdon): Combine nodes into single subtree.
106
+ const resolve = metadataPlugin?.provides.metadata.resolver;
107
+ const client = clientPlugin?.provides.client;
108
+ invariant(resolve);
109
+ invariant(client);
100
110
 
101
111
  return [
102
112
  // Devtools node.
103
113
  createExtension({
104
114
  id: 'dxos.org/plugin/debug/devtools',
105
- filter: (node): node is Node<null> => !!settings.values.devtools && node.id === 'root',
115
+ filter: (node): node is Node<null> => !!settings.devtools && node.id === 'root',
106
116
  connector: () => [
107
117
  {
108
118
  // TODO(zan): Removed `/` because it breaks deck layout reload. Fix?
@@ -111,8 +121,7 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
111
121
  type: 'dxos.org/plugin/debug/devtools',
112
122
  properties: {
113
123
  label: ['devtools label', { ns: DEBUG_PLUGIN }],
114
- icon: (props: IconProps) => <Hammer {...props} />,
115
- iconSymbol: 'ph--hammer--regular',
124
+ icon: 'ph--hammer--regular',
116
125
  },
117
126
  },
118
127
  ],
@@ -121,7 +130,7 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
121
130
  // Debug node.
122
131
  createExtension({
123
132
  id: 'dxos.org/plugin/debug/debug',
124
- filter: (node): node is Node<null> => !!settings.values.debug && node.id === 'root',
133
+ filter: (node): node is Node<null> => !!settings.debug && node.id === 'root',
125
134
  connector: () => [
126
135
  {
127
136
  id: 'dxos.org/plugin/debug/debug',
@@ -129,8 +138,7 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
129
138
  data: { graph: graphPlugin?.provides.graph },
130
139
  properties: {
131
140
  label: ['debug label', { ns: DEBUG_PLUGIN }],
132
- icon: (props: IconProps) => <Bug {...props} />,
133
- iconSymbol: 'ph--bug--regular',
141
+ icon: 'ph--bug--regular',
134
142
  },
135
143
  },
136
144
  ],
@@ -139,23 +147,93 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
139
147
  // Space debug nodes.
140
148
  createExtension({
141
149
  id: 'dxos.org/plugin/debug/spaces',
142
- filter: (node): node is Node<Space> => !!settings.values.debug && isSpace(node.data),
150
+ filter: (node): node is Node<Space> => !!settings.debug && isSpace(node.data),
143
151
  connector: ({ node }) => {
144
152
  const space = node.data;
145
153
  return [
146
154
  {
147
- id: `${space.id}-debug`,
155
+ id: `${space.id}-debug`, // TODO(burdon): Change to slashes consistently.
148
156
  type: 'dxos.org/plugin/debug/space',
149
157
  data: { space },
150
158
  properties: {
151
159
  label: ['debug label', { ns: DEBUG_PLUGIN }],
152
- icon: (props: IconProps) => <Bug {...props} />,
153
- iconSymbol: 'ph--bug--regular',
160
+ icon: 'ph--bug--regular',
154
161
  },
155
162
  },
156
163
  ];
157
164
  },
158
165
  }),
166
+
167
+ // Create nodes for debug sidebar.
168
+ createExtension({
169
+ id: `${DEBUG_PLUGIN}/debug-for-subject`,
170
+ resolver: ({ id }) => {
171
+ // TODO(Zan): Find util (or make one).
172
+ if (!id.endsWith('~debug')) {
173
+ return;
174
+ }
175
+
176
+ const type = 'orphan-settings-for-subject';
177
+ const icon = 'ph--bug--regular';
178
+
179
+ const [subjectId] = id.split('~');
180
+ const { spaceId, objectId } = parseId(subjectId);
181
+ const space = client.spaces.get().find((space) => space.id === spaceId);
182
+ if (!objectId) {
183
+ // TODO(burdon): Ref SPACE_PLUGIN ns.
184
+ const label = space
185
+ ? space.properties.name || ['unnamed space label', { ns: DEBUG_PLUGIN }]
186
+ : ['unnamed object settings label', { ns: DEBUG_PLUGIN }];
187
+
188
+ // TODO(wittjosiah): Support comments for arbitrary subjects.
189
+ // This is to ensure that the comments panel is not stuck on an old object.
190
+ return {
191
+ id,
192
+ type,
193
+ data: null,
194
+ properties: {
195
+ icon,
196
+ label,
197
+ showResolvedThreads: false,
198
+ object: null,
199
+ space,
200
+ },
201
+ };
202
+ }
203
+
204
+ const object = toSignal(
205
+ (onChange) => {
206
+ const timeout = setTimeout(async () => {
207
+ await space?.db.loadObjectById(objectId);
208
+ onChange();
209
+ });
210
+
211
+ return () => clearTimeout(timeout);
212
+ },
213
+ () => space?.db.getObjectById(objectId),
214
+ subjectId,
215
+ );
216
+ if (!object || !subjectId) {
217
+ return;
218
+ }
219
+
220
+ const meta = resolve(getTypename(object) ?? '');
221
+ const label = meta.label?.(object) ||
222
+ object.name ||
223
+ meta.placeholder || ['unnamed object settings label', { ns: DEBUG_PLUGIN }];
224
+
225
+ return {
226
+ id,
227
+ type,
228
+ data: null,
229
+ properties: {
230
+ icon,
231
+ label,
232
+ object,
233
+ },
234
+ };
235
+ },
236
+ }),
159
237
  ];
160
238
  },
161
239
  },
@@ -163,7 +241,7 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
163
241
  resolver: async (intent, plugins) => {
164
242
  switch (intent.action) {
165
243
  case DebugAction.OPEN_DEVTOOLS: {
166
- const clientPlugin = getPlugin<ClientPluginProvides>(plugins, 'dxos.org/plugin/client');
244
+ const clientPlugin = context.getPlugin<ClientPluginProvides>('dxos.org/plugin/client');
167
245
  const client = clientPlugin.provides.client;
168
246
  const vaultUrl = client.config.values?.runtime?.client?.remoteSource ?? 'https://halo.dxos.org';
169
247
 
@@ -188,17 +266,19 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
188
266
  component: ({ name, data, role }) => {
189
267
  switch (role) {
190
268
  case 'settings':
191
- return data.plugin === meta.id ? <DebugSettings settings={settings.values} /> : null;
269
+ return data.plugin === meta.id ? <DebugSettings settings={settings} /> : null;
192
270
  case 'status':
193
271
  return <DebugStatus />;
272
+ case 'complementary--debug':
273
+ return isEchoObject(data.subject) ? <DebugObjectPanel object={data.subject} /> : null;
194
274
  }
195
275
 
196
276
  const primary = data.active ?? data.object;
197
277
  let component: ReactNode;
198
278
  if (role === 'main' || role === 'article') {
199
- if (primary === 'devtools' && settings.values.devtools) {
200
- component = <DevtoolsMain />;
201
- } else if (!primary || typeof primary !== 'object' || !settings.values.debug) {
279
+ if (primary === 'devtools' && settings.devtools) {
280
+ component = <Devtools />;
281
+ } else if (!primary || typeof primary !== 'object' || !settings.debug) {
202
282
  component = null;
203
283
  } else if ('space' in primary && isSpace(primary.space)) {
204
284
  component = (
@@ -216,7 +296,7 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
216
296
  return;
217
297
  }
218
298
 
219
- void intentPlugin?.provides.intent.dispatch(
299
+ void context.resolvePlugin(parseIntentPlugin).provides.intent.dispatch(
220
300
  objects.map((object) => ({
221
301
  action: SpaceAction.ADD_OBJECT,
222
302
  data: { target: collection, object },
@@ -233,11 +313,18 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
233
313
  }
234
314
 
235
315
  if (!component) {
236
- if (settings.values.wireframe) {
316
+ if (settings.wireframe) {
237
317
  if (role === 'main' || role === 'article' || role === 'section') {
238
318
  const primary = data.active ?? data.object;
239
- if (!(primary instanceof CollectionType)) {
240
- return <Wireframe label={role} data={data} className='row-span-2 overflow-hidden' />;
319
+ const isCollection = primary instanceof CollectionType;
320
+ // TODO(burdon): Move into Container abstraction.
321
+ if (!isCollection) {
322
+ return {
323
+ node: (
324
+ <Wireframe label={`${role}:${name}`} object={primary} classNames='row-span-2 overflow-hidden' />
325
+ ),
326
+ disposition: 'hoist',
327
+ };
241
328
  }
242
329
  }
243
330
  }
@@ -267,4 +354,4 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
267
354
  },
268
355
  },
269
356
  };
270
- };
357
+ });
@@ -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>