@dxos/react-client 0.5.9-next.a50ff17 → 0.6.1-main.04e8aa0

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 (30) hide show
  1. package/dist/lib/browser/{chunk-RXX5XM6Z.mjs → chunk-SLS5XJ6E.mjs} +14 -4
  2. package/dist/lib/browser/{chunk-RXX5XM6Z.mjs.map → chunk-SLS5XJ6E.mjs.map} +3 -3
  3. package/dist/lib/browser/devtools/index.mjs +1 -1
  4. package/dist/lib/browser/echo/index.mjs +1 -1
  5. package/dist/lib/browser/halo/index.mjs +1 -1
  6. package/dist/lib/browser/index.mjs +3 -1
  7. package/dist/lib/browser/index.mjs.map +1 -1
  8. package/dist/lib/browser/mesh/index.mjs +1 -1
  9. package/dist/lib/browser/meta.json +1 -1
  10. package/dist/lib/browser/testing/index.mjs +8 -7
  11. package/dist/lib/browser/testing/index.mjs.map +3 -3
  12. package/dist/lib/node/{chunk-BZPBZFOR.cjs → chunk-FOUUBJ7W.cjs} +22 -11
  13. package/dist/lib/node/{chunk-BZPBZFOR.cjs.map → chunk-FOUUBJ7W.cjs.map} +3 -3
  14. package/dist/lib/node/devtools/index.cjs +2 -2
  15. package/dist/lib/node/echo/index.cjs +3 -3
  16. package/dist/lib/node/halo/index.cjs +5 -5
  17. package/dist/lib/node/index.cjs +13 -11
  18. package/dist/lib/node/index.cjs.map +1 -1
  19. package/dist/lib/node/mesh/index.cjs +2 -2
  20. package/dist/lib/node/meta.json +1 -1
  21. package/dist/lib/node/testing/index.cjs +9 -8
  22. package/dist/lib/node/testing/index.cjs.map +3 -3
  23. package/dist/types/src/client/useShell.d.ts +5 -1
  24. package/dist/types/src/client/useShell.d.ts.map +1 -1
  25. package/dist/types/src/testing/FullscreenDecorator.d.ts +6 -1
  26. package/dist/types/src/testing/FullscreenDecorator.d.ts.map +1 -1
  27. package/package.json +21 -19
  28. package/src/client/AgentHostingProvider.tsx +1 -1
  29. package/src/client/useShell.ts +13 -1
  30. package/src/testing/FullscreenDecorator.tsx +16 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-client",
3
- "version": "0.5.9-next.a50ff17",
3
+ "version": "0.6.1-main.04e8aa0",
4
4
  "description": "React client API",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -91,18 +91,18 @@
91
91
  }
92
92
  },
93
93
  "dependencies": {
94
- "@dxos/async": "0.5.9-next.a50ff17",
95
- "@dxos/codec-protobuf": "0.5.9-next.a50ff17",
96
- "@dxos/config": "0.5.9-next.a50ff17",
97
- "@dxos/debug": "0.5.9-next.a50ff17",
98
- "@dxos/client": "0.5.9-next.a50ff17",
99
- "@dxos/echo-signals": "0.5.9-next.a50ff17",
100
- "@dxos/echo-schema": "0.5.9-next.a50ff17",
101
- "@dxos/invariant": "0.5.9-next.a50ff17",
102
- "@dxos/log": "0.5.9-next.a50ff17",
103
- "@dxos/react-async": "0.5.9-next.a50ff17",
104
- "@dxos/node-std": "0.5.9-next.a50ff17",
105
- "@dxos/util": "0.5.9-next.a50ff17"
94
+ "@dxos/async": "0.6.1-main.04e8aa0",
95
+ "@dxos/codec-protobuf": "0.6.1-main.04e8aa0",
96
+ "@dxos/client": "0.6.1-main.04e8aa0",
97
+ "@dxos/debug": "0.6.1-main.04e8aa0",
98
+ "@dxos/echo-schema": "0.6.1-main.04e8aa0",
99
+ "@dxos/config": "0.6.1-main.04e8aa0",
100
+ "@dxos/invariant": "0.6.1-main.04e8aa0",
101
+ "@dxos/echo-signals": "0.6.1-main.04e8aa0",
102
+ "@dxos/node-std": "0.6.1-main.04e8aa0",
103
+ "@dxos/react-async": "0.6.1-main.04e8aa0",
104
+ "@dxos/log": "0.6.1-main.04e8aa0",
105
+ "@dxos/util": "0.6.1-main.04e8aa0"
106
106
  },
107
107
  "devDependencies": {
108
108
  "@testing-library/dom": "^8.17.1",
@@ -112,17 +112,19 @@
112
112
  "@types/react-dom": "^18.0.6",
113
113
  "react": "^18.2.0",
114
114
  "react-dom": "^18.2.0",
115
- "@dxos/random": "0.5.9-next.a50ff17",
116
- "@dxos/react-ui": "0.5.9-next.a50ff17",
117
- "@dxos/react-ui-theme": "0.5.9-next.a50ff17",
118
- "@dxos/storybook-utils": "0.5.9-next.a50ff17"
115
+ "@dxos/random": "0.6.1-main.04e8aa0",
116
+ "@dxos/react-ui": "0.6.1-main.04e8aa0",
117
+ "@dxos/storybook-utils": "0.6.1-main.04e8aa0",
118
+ "@dxos/react-ui-theme": "0.6.1-main.04e8aa0"
119
119
  },
120
120
  "peerDependencies": {
121
121
  "react": "*",
122
- "react-dom": "*"
122
+ "react-dom": "*",
123
+ "@dxos/react-ui": "0.6.1-main.04e8aa0",
124
+ "@dxos/react-ui-theme": "0.6.1-main.04e8aa0"
123
125
  },
124
126
  "optionalDependencies": {
125
- "@dxos/random": "0.5.9-next.a50ff17"
127
+ "@dxos/random": "0.6.1-main.04e8aa0"
126
128
  },
127
129
  "publishConfig": {
128
130
  "access": "public"
@@ -44,7 +44,7 @@ const makeClient = ({ config, halo }: AgentHostingProviderProps) => {
44
44
  switch (agentHostingConfig.type) {
45
45
  case 'LOCAL_TESTING': {
46
46
  log('using FakeAgentHostingProvider');
47
- return new FakeAgentHostingProvider(config, halo);
47
+ return new FakeAgentHostingProvider();
48
48
  }
49
49
 
50
50
  case 'AGENTHOSTING_API': {
@@ -2,7 +2,9 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type Shell } from '@dxos/client/services';
5
+ import { useEffect, useState } from 'react';
6
+
7
+ import { type Shell, type ShellDisplay } from '@dxos/client/services';
6
8
 
7
9
  import { useClient } from './ClientContext';
8
10
 
@@ -13,3 +15,13 @@ export const useShell = (): Shell => {
13
15
  const client = useClient();
14
16
  return client.shell;
15
17
  };
18
+
19
+ /**
20
+ * Hook to access the shell’s display state.
21
+ */
22
+ export const useShellDisplay = (): ShellDisplay => {
23
+ const client = useClient();
24
+ const [display, setDisplay] = useState(client.shell.display);
25
+ useEffect(() => client.shell.onDisplayChange(setDisplay), [client]);
26
+ return display;
27
+ };
@@ -6,10 +6,23 @@ import type { DecoratorFunction } from '@storybook/csf';
6
6
  import type { ReactRenderer } from '@storybook/react';
7
7
  import React from 'react';
8
8
 
9
- export const FullscreenDecorator = (className?: string): DecoratorFunction<ReactRenderer> => {
9
+ import { type ClassNameValue, type Density, DensityProvider } from '@dxos/react-ui';
10
+ import { mx } from '@dxos/react-ui-theme';
11
+
12
+ export type RootDecoratorProps = {
13
+ classNames?: ClassNameValue;
14
+ density?: Density;
15
+ };
16
+
17
+ export const FullscreenDecorator = ({
18
+ classNames,
19
+ density = 'fine',
20
+ }: RootDecoratorProps = {}): DecoratorFunction<ReactRenderer> => {
10
21
  return (Story) => (
11
- <div className={['flex fixed inset-0 overflow-hidden', className].join(' ')}>
12
- <Story />
22
+ <div className={mx('fixed flex inset-0 overflow-hidden', classNames)}>
23
+ <DensityProvider density={density}>
24
+ <Story />
25
+ </DensityProvider>
13
26
  </div>
14
27
  );
15
28
  };