@dxos/plugin-debug 0.6.13 → 0.6.14-main.1366248

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 (71) hide show
  1. package/dist/lib/browser/{DebugGlobal-H56M2VL4.mjs → DebugGlobal-ZTCBF3XR.mjs} +5 -5
  2. package/dist/lib/browser/{DebugSpace-NHPMLATA.mjs → DebugSpace-22PW7RJM.mjs} +16 -41
  3. package/dist/lib/browser/DebugSpace-22PW7RJM.mjs.map +7 -0
  4. package/dist/lib/browser/chunk-CAENAAHY.mjs +18 -0
  5. package/dist/lib/browser/chunk-CAENAAHY.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-LZEK532R.mjs} +11 -4
  9. package/dist/lib/browser/chunk-LZEK532R.mjs.map +7 -0
  10. package/dist/lib/browser/index.mjs +264 -145
  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 +5 -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/translations.d.ts +1 -0
  38. package/dist/types/src/translations.d.ts.map +1 -1
  39. package/dist/types/src/types.d.ts +10 -6
  40. package/dist/types/src/types.d.ts.map +1 -1
  41. package/package.json +46 -47
  42. package/src/DebugPlugin.tsx +137 -47
  43. package/src/components/DebugObjectPanel.tsx +22 -0
  44. package/src/components/DebugPanel.tsx +4 -9
  45. package/src/components/DebugSettings.tsx +13 -13
  46. package/src/components/DebugSpace.stories.tsx +6 -3
  47. package/src/components/DebugStatus.tsx +20 -13
  48. package/src/components/ObjectCreator.stories.tsx +13 -10
  49. package/src/components/ObjectCreator.tsx +12 -21
  50. package/src/components/SurfaceDebug.tsx +55 -0
  51. package/src/components/Wireframe.tsx +20 -11
  52. package/src/components/index.ts +4 -5
  53. package/src/meta.ts +16 -0
  54. package/src/scaffolding/generator.ts +4 -15
  55. package/src/translations.ts +1 -0
  56. package/src/types.ts +13 -6
  57. package/dist/lib/browser/DebugSpace-NHPMLATA.mjs.map +0 -7
  58. package/dist/lib/browser/DevtoolsMain-RWT3FLJ6.mjs +0 -15
  59. package/dist/lib/browser/DevtoolsMain-RWT3FLJ6.mjs.map +0 -7
  60. package/dist/lib/browser/chunk-ED5L5YYI.mjs.map +0 -7
  61. package/dist/lib/browser/chunk-RYK3J66D.mjs.map +0 -7
  62. package/dist/lib/browser/chunk-WEGYHXMB.mjs +0 -21
  63. package/dist/lib/browser/chunk-WEGYHXMB.mjs.map +0 -7
  64. package/dist/types/src/components/DevtoolsMain.d.ts +0 -4
  65. package/dist/types/src/components/DevtoolsMain.d.ts.map +0 -1
  66. package/dist/types/src/types.test.d.ts +0 -2
  67. package/dist/types/src/types.test.d.ts.map +0 -1
  68. package/src/components/DevtoolsMain.tsx +0 -15
  69. package/src/meta.tsx +0 -19
  70. package/src/types.test.ts +0 -13
  71. /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,11 @@
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
+ icon: string;
7
+ source: string;
8
+ tags: string[];
13
9
  };
14
10
  export default _default;
15
11
  //# 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,wBAOuB"}
@@ -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"}
@@ -22,6 +22,7 @@ declare const _default: {
22
22
  'settings data store label': string;
23
23
  'settings storage adapter changed alert': string;
24
24
  'settings space fragmentation': string;
25
+ 'open debug panel label': string;
25
26
  };
26
27
  };
27
28
  }[];
@@ -1 +1 @@
1
- {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBA6BE"}
1
+ {"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,wBA8BE"}
@@ -1,6 +1,8 @@
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';
5
+ import { type PanelProvides } from '@dxos/plugin-deck/types';
4
6
  export declare enum DebugAction {
5
7
  OPEN_DEVTOOLS = "dxos.org/plugin/debug/action/open-devtools"
6
8
  }
@@ -10,10 +12,12 @@ export type DebugContextType = {
10
12
  stop: () => void;
11
13
  };
12
14
  export declare const DebugContext: Context<DebugContextType>;
13
- export type DebugSettingsProps = {
14
- devtools?: boolean;
15
- debug?: boolean;
16
- wireframe?: boolean;
17
- };
18
- export type DebugPluginProvides = SurfaceProvides & IntentResolverProvides & GraphBuilderProvides & SettingsProvides<DebugSettingsProps> & TranslationsProvides;
15
+ export declare const DebugSettingsSchema: S.mutable<S.Struct<{
16
+ devtools: S.optional<typeof S.Boolean>;
17
+ debug: S.optional<typeof S.Boolean>;
18
+ wireframe: S.optional<typeof S.Boolean>;
19
+ }>>;
20
+ export interface DebugSettingsProps extends S.Schema.Type<typeof DebugSettingsSchema> {
21
+ }
22
+ export type DebugPluginProvides = SurfaceProvides & IntentResolverProvides & GraphBuilderProvides & SettingsProvides<DebugSettingsProps> & TranslationsProvides & PanelProvides;
19
23
  //# 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;AACtC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAK7D,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,GACpB,aAAa,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.1366248",
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,57 @@
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.1366248",
40
+ "@dxos/async": "0.6.14-main.1366248",
41
+ "@dxos/automerge": "0.6.14-main.1366248",
42
+ "@dxos/client-services": "0.6.14-main.1366248",
43
+ "@dxos/config": "0.6.14-main.1366248",
44
+ "@dxos/echo-generator": "0.6.14-main.1366248",
45
+ "@dxos/echo-pipeline": "0.6.14-main.1366248",
46
+ "@dxos/echo-schema": "0.6.14-main.1366248",
47
+ "@dxos/invariant": "0.6.14-main.1366248",
48
+ "@dxos/devtools": "0.6.14-main.1366248",
49
+ "@dxos/local-storage": "0.6.14-main.1366248",
50
+ "@dxos/keys": "0.6.14-main.1366248",
51
+ "@dxos/log": "0.6.14-main.1366248",
52
+ "@dxos/plugin-deck": "0.6.14-main.1366248",
53
+ "@dxos/plugin-client": "0.6.14-main.1366248",
54
+ "@dxos/plugin-graph": "0.6.14-main.1366248",
55
+ "@dxos/plugin-markdown": "0.6.14-main.1366248",
56
+ "@dxos/plugin-sketch": "0.6.14-main.1366248",
57
+ "@dxos/plugin-space": "0.6.14-main.1366248",
58
+ "@dxos/plugin-table": "0.6.14-main.1366248",
59
+ "@dxos/plugin-theme": "0.6.14-main.1366248",
60
+ "@dxos/plugin-status-bar": "0.6.14-main.1366248",
61
+ "@dxos/protocols": "0.6.14-main.1366248",
62
+ "@dxos/react-client": "0.6.14-main.1366248",
63
+ "@dxos/random": "0.6.14-main.1366248",
64
+ "@dxos/react-hooks": "0.6.14-main.1366248",
65
+ "@dxos/react-ui-attention": "0.6.14-main.1366248",
66
+ "@dxos/react-ui-data": "0.6.14-main.1366248",
67
+ "@dxos/react-ui-syntax-highlighter": "0.6.14-main.1366248",
68
+ "@dxos/util": "0.6.14-main.1366248",
69
+ "@dxos/react-ui-table": "0.6.14-main.1366248"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@phosphor-icons/react": "^2.1.5",
73
73
  "@types/lodash.get": "^4.4.7",
74
74
  "@types/react": "~18.2.0",
75
75
  "@types/react-dom": "~18.2.0",
76
- "@types/react-syntax-highlighter": "^15.5.13",
77
76
  "react": "~18.2.0",
78
77
  "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"
78
+ "vite": "5.4.7",
79
+ "@dxos/react-ui": "0.6.14-main.1366248",
80
+ "@dxos/storybook-utils": "0.6.14-main.1366248",
81
+ "@dxos/react-ui-theme": "0.6.14-main.1366248"
84
82
  },
85
83
  "peerDependencies": {
86
84
  "@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"
85
+ "react": "~18.2.0",
86
+ "react-dom": "~18.2.0",
87
+ "@dxos/random": "0.6.14-main.1366248",
88
+ "@dxos/react-ui": "0.6.14-main.1366248",
89
+ "@dxos/react-ui-theme": "0.6.14-main.1366248"
91
90
  },
92
91
  "publishConfig": {
93
92
  "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,11 +71,14 @@ 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,
79
+ complementary: {
80
+ panels: [{ id: 'debug', label: ['open debug panel label', { ns: DEBUG_PLUGIN }], icon: 'ph--bug--regular' }],
81
+ },
73
82
  context: ({ children }) => {
74
83
  const [timer, setTimer] = useState<Timer>();
75
84
  useEffect(() => timer?.state.on((value) => !value && setTimer(undefined)), [timer]);
@@ -94,15 +103,19 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
94
103
  },
95
104
  graph: {
96
105
  builder: (plugins) => {
106
+ const clientPlugin = resolvePlugin(plugins, parseClientPlugin);
107
+ const metadataPlugin = resolvePlugin(plugins, parseMetadataResolverPlugin);
97
108
  const graphPlugin = resolvePlugin(plugins, parseGraphPlugin);
98
-
99
- // TODO(burdon): Combine nodes into single subtree.
109
+ const resolve = metadataPlugin?.provides.metadata.resolver;
110
+ const client = clientPlugin?.provides.client;
111
+ invariant(resolve);
112
+ invariant(client);
100
113
 
101
114
  return [
102
115
  // Devtools node.
103
116
  createExtension({
104
117
  id: 'dxos.org/plugin/debug/devtools',
105
- filter: (node): node is Node<null> => !!settings.values.devtools && node.id === 'root',
118
+ filter: (node): node is Node<null> => !!settings.devtools && node.id === 'root',
106
119
  connector: () => [
107
120
  {
108
121
  // TODO(zan): Removed `/` because it breaks deck layout reload. Fix?
@@ -111,8 +124,7 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
111
124
  type: 'dxos.org/plugin/debug/devtools',
112
125
  properties: {
113
126
  label: ['devtools label', { ns: DEBUG_PLUGIN }],
114
- icon: (props: IconProps) => <Hammer {...props} />,
115
- iconSymbol: 'ph--hammer--regular',
127
+ icon: 'ph--hammer--regular',
116
128
  },
117
129
  },
118
130
  ],
@@ -121,7 +133,7 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
121
133
  // Debug node.
122
134
  createExtension({
123
135
  id: 'dxos.org/plugin/debug/debug',
124
- filter: (node): node is Node<null> => !!settings.values.debug && node.id === 'root',
136
+ filter: (node): node is Node<null> => !!settings.debug && node.id === 'root',
125
137
  connector: () => [
126
138
  {
127
139
  id: 'dxos.org/plugin/debug/debug',
@@ -129,8 +141,7 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
129
141
  data: { graph: graphPlugin?.provides.graph },
130
142
  properties: {
131
143
  label: ['debug label', { ns: DEBUG_PLUGIN }],
132
- icon: (props: IconProps) => <Bug {...props} />,
133
- iconSymbol: 'ph--bug--regular',
144
+ icon: 'ph--bug--regular',
134
145
  },
135
146
  },
136
147
  ],
@@ -139,23 +150,93 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
139
150
  // Space debug nodes.
140
151
  createExtension({
141
152
  id: 'dxos.org/plugin/debug/spaces',
142
- filter: (node): node is Node<Space> => !!settings.values.debug && isSpace(node.data),
153
+ filter: (node): node is Node<Space> => !!settings.debug && isSpace(node.data),
143
154
  connector: ({ node }) => {
144
155
  const space = node.data;
145
156
  return [
146
157
  {
147
- id: `${space.id}-debug`,
158
+ id: `${space.id}-debug`, // TODO(burdon): Change to slashes consistently.
148
159
  type: 'dxos.org/plugin/debug/space',
149
160
  data: { space },
150
161
  properties: {
151
162
  label: ['debug label', { ns: DEBUG_PLUGIN }],
152
- icon: (props: IconProps) => <Bug {...props} />,
153
- iconSymbol: 'ph--bug--regular',
163
+ icon: 'ph--bug--regular',
154
164
  },
155
165
  },
156
166
  ];
157
167
  },
158
168
  }),
169
+
170
+ // Create nodes for debug sidebar.
171
+ createExtension({
172
+ id: `${DEBUG_PLUGIN}/debug-for-subject`,
173
+ resolver: ({ id }) => {
174
+ // TODO(Zan): Find util (or make one).
175
+ if (!id.endsWith('~debug')) {
176
+ return;
177
+ }
178
+
179
+ const type = 'orphan-settings-for-subject';
180
+ const icon = 'ph--bug--regular';
181
+
182
+ const [subjectId] = id.split('~');
183
+ const { spaceId, objectId } = parseId(subjectId);
184
+ const space = client.spaces.get().find((space) => space.id === spaceId);
185
+ if (!objectId) {
186
+ // TODO(burdon): Ref SPACE_PLUGIN ns.
187
+ const label = space
188
+ ? space.properties.name || ['unnamed space label', { ns: DEBUG_PLUGIN }]
189
+ : ['unnamed object settings label', { ns: DEBUG_PLUGIN }];
190
+
191
+ // TODO(wittjosiah): Support comments for arbitrary subjects.
192
+ // This is to ensure that the comments panel is not stuck on an old object.
193
+ return {
194
+ id,
195
+ type,
196
+ data: null,
197
+ properties: {
198
+ icon,
199
+ label,
200
+ showResolvedThreads: false,
201
+ object: null,
202
+ space,
203
+ },
204
+ };
205
+ }
206
+
207
+ const object = toSignal(
208
+ (onChange) => {
209
+ const timeout = setTimeout(async () => {
210
+ await space?.db.loadObjectById(objectId);
211
+ onChange();
212
+ });
213
+
214
+ return () => clearTimeout(timeout);
215
+ },
216
+ () => space?.db.getObjectById(objectId),
217
+ subjectId,
218
+ );
219
+ if (!object || !subjectId) {
220
+ return;
221
+ }
222
+
223
+ const meta = resolve(getTypename(object) ?? '');
224
+ const label = meta.label?.(object) ||
225
+ object.name ||
226
+ meta.placeholder || ['unnamed object settings label', { ns: DEBUG_PLUGIN }];
227
+
228
+ return {
229
+ id,
230
+ type,
231
+ data: null,
232
+ properties: {
233
+ icon,
234
+ label,
235
+ object,
236
+ },
237
+ };
238
+ },
239
+ }),
159
240
  ];
160
241
  },
161
242
  },
@@ -163,7 +244,7 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
163
244
  resolver: async (intent, plugins) => {
164
245
  switch (intent.action) {
165
246
  case DebugAction.OPEN_DEVTOOLS: {
166
- const clientPlugin = getPlugin<ClientPluginProvides>(plugins, 'dxos.org/plugin/client');
247
+ const clientPlugin = context.getPlugin<ClientPluginProvides>('dxos.org/plugin/client');
167
248
  const client = clientPlugin.provides.client;
168
249
  const vaultUrl = client.config.values?.runtime?.client?.remoteSource ?? 'https://halo.dxos.org';
169
250
 
@@ -188,17 +269,19 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
188
269
  component: ({ name, data, role }) => {
189
270
  switch (role) {
190
271
  case 'settings':
191
- return data.plugin === meta.id ? <DebugSettings settings={settings.values} /> : null;
272
+ return data.plugin === meta.id ? <DebugSettings settings={settings} /> : null;
192
273
  case 'status':
193
274
  return <DebugStatus />;
275
+ case 'complementary--debug':
276
+ return isEchoObject(data.subject) ? <DebugObjectPanel object={data.subject} /> : null;
194
277
  }
195
278
 
196
279
  const primary = data.active ?? data.object;
197
280
  let component: ReactNode;
198
281
  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) {
282
+ if (primary === 'devtools' && settings.devtools) {
283
+ component = <Devtools />;
284
+ } else if (!primary || typeof primary !== 'object' || !settings.debug) {
202
285
  component = null;
203
286
  } else if ('space' in primary && isSpace(primary.space)) {
204
287
  component = (
@@ -216,7 +299,7 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
216
299
  return;
217
300
  }
218
301
 
219
- void intentPlugin?.provides.intent.dispatch(
302
+ void context.resolvePlugin(parseIntentPlugin).provides.intent.dispatch(
220
303
  objects.map((object) => ({
221
304
  action: SpaceAction.ADD_OBJECT,
222
305
  data: { target: collection, object },
@@ -233,11 +316,18 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
233
316
  }
234
317
 
235
318
  if (!component) {
236
- if (settings.values.wireframe) {
319
+ if (settings.wireframe) {
237
320
  if (role === 'main' || role === 'article' || role === 'section') {
238
321
  const primary = data.active ?? data.object;
239
- if (!(primary instanceof CollectionType)) {
240
- return <Wireframe label={role} data={data} className='row-span-2 overflow-hidden' />;
322
+ const isCollection = primary instanceof CollectionType;
323
+ // TODO(burdon): Move into Container abstraction.
324
+ if (!isCollection) {
325
+ return {
326
+ node: (
327
+ <Wireframe label={`${role}:${name}`} object={primary} classNames='row-span-2 overflow-hidden' />
328
+ ),
329
+ disposition: 'hoist',
330
+ };
241
331
  }
242
332
  }
243
333
  }
@@ -267,4 +357,4 @@ export const DebugPlugin = (): PluginDefinition<DebugPluginProvides> => {
267
357
  },
268
358
  },
269
359
  };
270
- };
360
+ });
@@ -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
+ };