@dxos/react-ui 0.1.31 → 0.1.32-next.77d513e

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 (70) hide show
  1. package/dist/lib/browser/index.mjs +1035 -876
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/types/src/components/IdentityList/SpaceMemberListContainer.d.ts.map +1 -1
  5. package/dist/types/src/composites/DevicesDialog/DevicesDialog.d.ts.map +1 -1
  6. package/dist/types/src/composites/JoinDialog/JoinDialog.d.ts.map +1 -1
  7. package/dist/types/src/composites/JoinDialog/JoinDialog.stories.d.ts.map +1 -1
  8. package/dist/types/src/composites/SpaceDialog/SpaceDialog.d.ts.map +1 -1
  9. package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts.map +1 -1
  10. package/dist/types/src/panels/JoinPanel/JoinHeading.d.ts +2 -2
  11. package/dist/types/src/panels/JoinPanel/JoinHeading.d.ts.map +1 -1
  12. package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts +1 -1
  13. package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts.map +1 -1
  14. package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts +1 -1
  15. package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts.map +1 -1
  16. package/dist/types/src/panels/JoinPanel/joinMachine.d.ts +64 -0
  17. package/dist/types/src/panels/JoinPanel/joinMachine.d.ts.map +1 -0
  18. package/dist/types/src/panels/JoinPanel/view-states/AdditionMethodSelector.d.ts +2 -5
  19. package/dist/types/src/panels/JoinPanel/view-states/AdditionMethodSelector.d.ts.map +1 -1
  20. package/dist/types/src/panels/JoinPanel/view-states/InvitationAccepted.d.ts +1 -1
  21. package/dist/types/src/panels/JoinPanel/view-states/InvitationAccepted.d.ts.map +1 -1
  22. package/dist/types/src/panels/JoinPanel/view-states/InvitationAuthenticator.d.ts +2 -2
  23. package/dist/types/src/panels/JoinPanel/view-states/InvitationAuthenticator.d.ts.map +1 -1
  24. package/dist/types/src/panels/JoinPanel/view-states/InvitationInput.d.ts +2 -2
  25. package/dist/types/src/panels/JoinPanel/view-states/InvitationInput.d.ts.map +1 -1
  26. package/dist/types/src/panels/JoinPanel/view-states/InvitationRescuer.d.ts +2 -2
  27. package/dist/types/src/panels/JoinPanel/view-states/InvitationRescuer.d.ts.map +1 -1
  28. package/dist/types/src/panels/JoinPanel/view-states/ViewState.d.ts +4 -6
  29. package/dist/types/src/panels/JoinPanel/view-states/ViewState.d.ts.map +1 -1
  30. package/dist/types/src/panels/JoinPanel/view-states/index.d.ts +0 -1
  31. package/dist/types/src/panels/JoinPanel/view-states/index.d.ts.map +1 -1
  32. package/dist/types/src/playwright/invitations-manager.d.ts.map +1 -1
  33. package/dist/types/src/translations/locales/en-US.d.ts +3 -1
  34. package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
  35. package/dist/types/src/util/index.d.ts +1 -0
  36. package/dist/types/src/util/index.d.ts.map +1 -1
  37. package/dist/types/src/util/toEmoji.d.ts +2 -0
  38. package/dist/types/src/util/toEmoji.d.ts.map +1 -0
  39. package/package.json +18 -14
  40. package/src/components/IdentityList/SpaceMemberListContainer.tsx +6 -2
  41. package/src/components/InvitationList/InvitationList.stories.tsx +1 -1
  42. package/src/composites/DevicesDialog/DevicesDialog.tsx +3 -2
  43. package/src/composites/JoinDialog/JoinDialog.stories.tsx +4 -2
  44. package/src/composites/JoinDialog/JoinDialog.tsx +4 -2
  45. package/src/composites/Shell/Shell.stories.tsx +1 -1
  46. package/src/composites/Shell/Shell.tsx +1 -1
  47. package/src/composites/SpaceDialog/SpaceDialog.tsx +3 -2
  48. package/src/panels/IdentityPanel/IdentityPanel.tsx +4 -2
  49. package/src/panels/JoinPanel/JoinHeading.tsx +42 -40
  50. package/src/panels/JoinPanel/JoinPanel.tsx +143 -220
  51. package/src/panels/JoinPanel/JoinPanelProps.ts +1 -1
  52. package/src/panels/JoinPanel/joinMachine.ts +418 -0
  53. package/src/panels/JoinPanel/view-states/AdditionMethodSelector.tsx +9 -21
  54. package/src/panels/JoinPanel/view-states/IdentityAdded.tsx +6 -6
  55. package/src/panels/JoinPanel/view-states/IdentityInput.tsx +4 -4
  56. package/src/panels/JoinPanel/view-states/InvitationAccepted.tsx +22 -18
  57. package/src/panels/JoinPanel/view-states/InvitationAuthenticator.tsx +38 -28
  58. package/src/panels/JoinPanel/view-states/InvitationInput.tsx +21 -21
  59. package/src/panels/JoinPanel/view-states/InvitationRescuer.tsx +58 -41
  60. package/src/panels/JoinPanel/view-states/ViewState.tsx +11 -62
  61. package/src/panels/JoinPanel/view-states/index.ts +0 -1
  62. package/src/playwright/invitations-manager.ts +6 -2
  63. package/src/playwright/invitations.spec.ts +14 -5
  64. package/src/stories/Invitations.stories.tsx +2 -2
  65. package/src/translations/locales/en-US.ts +6 -4
  66. package/src/util/index.ts +1 -0
  67. package/src/util/toEmoji.ts +22 -0
  68. package/dist/types/src/panels/JoinPanel/view-states/IdentitySelector.d.ts +0 -7
  69. package/dist/types/src/panels/JoinPanel/view-states/IdentitySelector.d.ts.map +0 -1
  70. package/src/panels/JoinPanel/view-states/IdentitySelector.tsx +0 -100
@@ -1 +1 @@
1
- {"version":3,"file":"InvitationRescuer.d.ts","sourceRoot":"","sources":["../../../../../../src/panels/JoinPanel/view-states/InvitationRescuer.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAa,cAAc,EAAE,MAAM,aAAa,CAAC;AAExD,MAAM,WAAW,wBAAyB,SAAQ,cAAc;IAC9D,cAAc,EAAE,OAAO,GAAG,MAAM,CAAC;CAClC;AA4DD,eAAO,MAAM,iBAAiB,0CAA2C,wBAAwB,gBAsBhG,CAAC"}
1
+ {"version":3,"file":"InvitationRescuer.d.ts","sourceRoot":"","sources":["../../../../../../src/panels/JoinPanel/view-states/InvitationRescuer.tsx"],"names":[],"mappings":"AAWA,OAAO,EAA+B,cAAc,EAAE,MAAM,aAAa,CAAC;AAE1E,MAAM,WAAW,wBAAyB,SAAQ,cAAc;IAC9D,MAAM,EAAE,OAAO,GAAG,MAAM,CAAC;CAC1B;AAwED,eAAO,MAAM,iBAAiB,kCAAmC,wBAAwB,gBA2BxF,CAAC"}
@@ -1,12 +1,10 @@
1
1
  import { ComponentProps, ComponentPropsWithoutRef } from 'react';
2
- import type { AuthenticatingInvitationObservable, Identity } from '@dxos/client';
3
- import { JoinDispatch } from '../JoinPanelProps';
2
+ import { JoinSend, JoinState } from '../joinMachine';
4
3
  export interface ViewStateProps extends ComponentProps<'div'> {
5
4
  active: boolean;
6
- dispatch: JoinDispatch;
7
- selectedIdentity?: true | Identity;
8
- activeInvitation?: true | AuthenticatingInvitationObservable;
5
+ joinSend: JoinSend;
6
+ joinState?: JoinState;
9
7
  }
10
8
  export declare const ViewStateHeading: ({ children, className, ...props }: ComponentPropsWithoutRef<'h2'>) => JSX.Element;
11
- export declare const ViewState: ({ active, children, className, dispatch, selectedIdentity, activeInvitation, ...props }: ViewStateProps) => JSX.Element;
9
+ export declare const ViewState: ({ active, children, className, joinSend, joinState, ...props }: ViewStateProps) => JSX.Element;
12
10
  //# sourceMappingURL=ViewState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ViewState.d.ts","sourceRoot":"","sources":["../../../../../../src/panels/JoinPanel/view-states/ViewState.tsx"],"names":[],"mappings":"AAKA,OAAc,EAAE,cAAc,EAAE,wBAAwB,EAAsB,MAAM,OAAO,CAAC;AAE5F,OAAO,KAAK,EAAE,kCAAkC,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAOjF,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC3D,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,YAAY,CAAC;IACvB,gBAAgB,CAAC,EAAE,IAAI,GAAG,QAAQ,CAAC;IACnC,gBAAgB,CAAC,EAAE,IAAI,GAAG,kCAAkC,CAAC;CAC9D;AAID,eAAO,MAAM,gBAAgB,sCAAuC,yBAAyB,IAAI,CAAC,gBAMjG,CAAC;AA2GF,eAAO,MAAM,SAAS,4FAQnB,cAAc,gBAyDhB,CAAC"}
1
+ {"version":3,"file":"ViewState.d.ts","sourceRoot":"","sources":["../../../../../../src/panels/JoinPanel/view-states/ViewState.tsx"],"names":[],"mappings":"AAKA,OAAc,EAAE,cAAc,EAAE,wBAAwB,EAAsB,MAAM,OAAO,CAAC;AAS5F,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAErD,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,KAAK,CAAC;IAC3D,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAID,eAAO,MAAM,gBAAgB,sCAAuC,yBAAyB,IAAI,CAAC,gBAMjG,CAAC;AA4GF,eAAO,MAAM,SAAS,mEAAoE,cAAc,gBAcvG,CAAC"}
@@ -1,6 +1,5 @@
1
1
  export * from './AdditionMethodSelector';
2
2
  export * from './IdentityAdded';
3
- export * from './IdentitySelector';
4
3
  export * from './IdentityInput';
5
4
  export * from './InvitationAccepted';
6
5
  export * from './InvitationInput';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/panels/JoinPanel/view-states/index.ts"],"names":[],"mappings":"AAIA,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/panels/JoinPanel/view-states/index.ts"],"names":[],"mappings":"AAIA,cAAc,0BAA0B,C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C,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,OAAO;IASzD,OAAO,CAAC,KAAK;YAIC,iBAAiB;CAUhC"}
@@ -4,7 +4,7 @@ export declare const os: {
4
4
  'sidebar label': string;
5
5
  'copy invitation code label': string;
6
6
  'open share panel label': string;
7
- 'joining heading': string;
7
+ 'joining space heading': string;
8
8
  'join space heading': string;
9
9
  'halo heading': string;
10
10
  'exit label': string;
@@ -59,5 +59,7 @@ export declare const os: {
59
59
  'toggle sidebar label': string;
60
60
  'open sidebar label': string;
61
61
  'close sidebar label': string;
62
+ 'welcome message': string;
63
+ 'selecting identity heading': string;
62
64
  };
63
65
  //# sourceMappingURL=en-US.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"en-US.d.ts","sourceRoot":"","sources":["../../../../../src/translations/locales/en-US.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6Dd,CAAC"}
1
+ {"version":3,"file":"en-US.d.ts","sourceRoot":"","sources":["../../../../../src/translations/locales/en-US.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+Dd,CAAC"}
@@ -1,2 +1,3 @@
1
1
  export * from './invitationStatusValue';
2
+ export * from './toEmoji';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,yBAAyB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,yBAAyB,CAAC;AACxC,cAAc,WAAW,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const toEmoji: (keyAsHex: string) => string;
2
+ //# sourceMappingURL=toEmoji.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toEmoji.d.ts","sourceRoot":"","sources":["../../../../src/util/toEmoji.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,OAAO,aAAc,MAAM,WAAiD,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/react-ui",
3
- "version": "0.1.31",
3
+ "version": "0.1.32-next.77d513e",
4
4
  "description": "A React component library for DXOS’s OS experiences",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -19,32 +19,36 @@
19
19
  "@radix-ui/react-dialog": "^1.0.3",
20
20
  "@radix-ui/react-radio-group": "^1.1.2",
21
21
  "@react-hook/async": "^3.1.1",
22
+ "@xstate/react": "^3.2.1",
22
23
  "debug": "^4.3.3",
24
+ "lodash.toarray": "^4.4.0",
23
25
  "qrcode.react": "^3.1.0",
24
26
  "url-join": "^5.0.0",
25
- "@dxos/client": "0.1.31",
26
- "@dxos/config": "0.1.31",
27
- "@dxos/debug": "0.1.31",
28
- "@dxos/keys": "0.1.31",
29
- "@dxos/protocols": "0.1.31",
30
- "@dxos/react-client": "0.1.31",
31
- "@dxos/react-components": "0.1.31",
32
- "@dxos/util": "0.1.31"
27
+ "xstate": "^4.37.0",
28
+ "@dxos/client": "0.1.32-next.77d513e",
29
+ "@dxos/config": "0.1.32-next.77d513e",
30
+ "@dxos/debug": "0.1.32-next.77d513e",
31
+ "@dxos/keys": "0.1.32-next.77d513e",
32
+ "@dxos/protocols": "0.1.32-next.77d513e",
33
+ "@dxos/react-client": "0.1.32-next.77d513e",
34
+ "@dxos/react-components": "0.1.32-next.77d513e",
35
+ "@dxos/util": "0.1.32-next.77d513e"
33
36
  },
34
37
  "devDependencies": {
35
38
  "@faker-js/faker": "^7.6.0",
36
39
  "@phosphor-icons/react": "^2.0.5",
37
40
  "@types/debug": "^4.1.7",
41
+ "@types/lodash.toarray": "^4.4.7",
38
42
  "@types/react": "^18.0.21",
39
43
  "@types/react-dom": "^18.0.6",
40
44
  "@vitejs/plugin-react": "^3.0.1",
41
45
  "react": "^18.2.0",
42
46
  "react-dom": "^18.2.0",
43
- "vite": "4.0.4",
44
- "@dxos/async": "0.1.31",
45
- "@dxos/client-services": "0.1.31",
46
- "@dxos/log": "0.1.31",
47
- "@dxos/react-async": "0.1.31"
47
+ "vite": "^4.2.0",
48
+ "@dxos/async": "0.1.32-next.77d513e",
49
+ "@dxos/client-services": "0.1.32-next.77d513e",
50
+ "@dxos/log": "0.1.32-next.77d513e",
51
+ "@dxos/react-async": "0.1.32-next.77d513e"
48
52
  },
49
53
  "peerDependencies": {
50
54
  "@phosphor-icons/react": "^2.0.5",
@@ -20,8 +20,12 @@ export const SpaceMemberListContainer = ({ spaceKey, includeSelf, onSelect }: Sp
20
20
  const members = useMemo(
21
21
  () =>
22
22
  includeSelf
23
- ? allUnsortedMembers.sort((a) => (a.identity.identityKey.equals(client.halo.identity!.identityKey) ? -1 : 1))
24
- : allUnsortedMembers.filter((member) => !member.identity.identityKey.equals(client.halo.identity!.identityKey)),
23
+ ? allUnsortedMembers.sort((a) =>
24
+ a.identity.identityKey.equals(client.halo.identity.get()!.identityKey) ? -1 : 1
25
+ )
26
+ : allUnsortedMembers.filter(
27
+ (member) => !member.identity.identityKey.equals(client.halo.identity.get()!.identityKey)
28
+ ),
25
29
  [allUnsortedMembers]
26
30
  );
27
31
  return <SpaceMemberList members={members} onSelect={onSelect} />;
@@ -37,7 +37,7 @@ export const Default = {
37
37
 
38
38
  await clients[0].halo.createIdentity({ displayName: 'Os Mutantes' });
39
39
 
40
- const space = await clients[0].echo.createSpace();
40
+ const space = await clients[0].createSpace();
41
41
  log.info('[space created]', space);
42
42
  space.properties.name = 'Q3 2022 Planning';
43
43
  log.info('[space title set]', space?.properties.name);
@@ -5,7 +5,7 @@
5
5
  import { Close } from '@radix-ui/react-dialog';
6
6
  import React from 'react';
7
7
 
8
- import { ThemeContext, useId } from '@dxos/react-components';
8
+ import { ThemeContext, useId, useThemeContext } from '@dxos/react-components';
9
9
 
10
10
  import { PanelDialog, PanelDialogProps } from '../../layouts';
11
11
  import { DevicesPanel, DevicesPanelProps } from '../../panels';
@@ -16,6 +16,7 @@ export interface DevicesDialogProps
16
16
 
17
17
  export const DevicesDialog = ({ slots, ...devicesDialogProps }: DevicesDialogProps) => {
18
18
  const titleId = useId('spaceDialog__title');
19
+ const themeContextValue = useThemeContext();
19
20
 
20
21
  return (
21
22
  <PanelDialog
@@ -24,7 +25,7 @@ export const DevicesDialog = ({ slots, ...devicesDialogProps }: DevicesDialogPro
24
25
  titleId
25
26
  }}
26
27
  >
27
- <ThemeContext.Provider value={{ themeVariant: 'os' }}>
28
+ <ThemeContext.Provider value={{ ...themeContextValue, themeVariant: 'os' }}>
28
29
  <DevicesPanel
29
30
  {...{
30
31
  ...devicesDialogProps,
@@ -35,6 +35,9 @@ const JoinClientDecorator = (Story: StoryFn, { args }: StoryContext) => {
35
35
  log.info('[next invitation code]', { nextInvitationCode });
36
36
  setInvitationCode(nextInvitationCode);
37
37
  }
38
+ if (invitation.authenticationCode) {
39
+ log.info('[verification code]', invitation.authenticationCode);
40
+ }
38
41
  }, []);
39
42
 
40
43
  useAsyncEffect(async () => {
@@ -43,12 +46,11 @@ const JoinClientDecorator = (Story: StoryFn, { args }: StoryContext) => {
43
46
 
44
47
  await clients[0].halo.createIdentity({ displayName: 'Os Mutantes' });
45
48
 
46
- const space = await clients[0].echo.createSpace();
49
+ const space = await clients[0].createSpace();
47
50
  log.info('[space created]', space);
48
51
  space.properties.name = 'Q3 2022 Planning';
49
52
 
50
53
  const invitation = space.createInvitation({ type: Invitation.Type.INTERACTIVE });
51
- log.info('[invitation created]', invitation);
52
54
 
53
55
  invitation.subscribe({
54
56
  onAuthenticating: onInvitationEvent,
@@ -5,7 +5,7 @@
5
5
  import { Action, Cancel } from '@radix-ui/react-alert-dialog';
6
6
  import React from 'react';
7
7
 
8
- import { ThemeContext, useId } from '@dxos/react-components';
8
+ import { ThemeContext, useId, useThemeContext } from '@dxos/react-components';
9
9
 
10
10
  import { PanelAlertDialog, PanelAlertDialogProps } from '../../layouts';
11
11
  import { JoinPanel, JoinPanelProps } from '../../panels';
@@ -16,9 +16,11 @@ export interface JoinDialogProps
16
16
 
17
17
  export const JoinDialog = ({ slots, ...joinPanelProps }: JoinDialogProps) => {
18
18
  const titleId = useId('joinDialog__title');
19
+ const themeContextValue = useThemeContext();
20
+
19
21
  return (
20
22
  <PanelAlertDialog {...{ slots, titleId }}>
21
- <ThemeContext.Provider value={{ themeVariant: 'os' }}>
23
+ <ThemeContext.Provider value={{ ...themeContextValue, themeVariant: 'os' }}>
22
24
  <JoinPanel
23
25
  {...{
24
26
  ...joinPanelProps,
@@ -45,7 +45,7 @@ const ShellControls = () => {
45
45
  <TooltipRoot>
46
46
  <TooltipContent>Create Space</TooltipContent>
47
47
  <TooltipTrigger asChild>
48
- <Button onClick={() => client.echo.createSpace({ name: faker.animal.bird() })}>
48
+ <Button onClick={() => client.createSpace({ name: faker.animal.bird() })}>
49
49
  <PlusCircle weight='fill' className={getSize(6)} />
50
50
  </Button>
51
51
  </TooltipTrigger>
@@ -49,7 +49,7 @@ export const Shell = ({ runtime, origin }: { runtime: ShellRuntime; origin: stri
49
49
  initialInvitationCode={invitationCode}
50
50
  onDone={async () => {
51
51
  // TODO(wittjosiah): Is this app-specific?
52
- spaces.length > 0 || (await client.echo.createSpace());
52
+ spaces.length > 0 || (await client.createSpace());
53
53
  await runtime.setAppContext({ display: ShellDisplay.NONE });
54
54
  runtime.setLayout(ShellLayout.DEFAULT);
55
55
  }}
@@ -5,7 +5,7 @@
5
5
  import { Close } from '@radix-ui/react-dialog';
6
6
  import React from 'react';
7
7
 
8
- import { ThemeContext, useId } from '@dxos/react-components';
8
+ import { ThemeContext, useId, useThemeContext } from '@dxos/react-components';
9
9
 
10
10
  import { PanelDialog, PanelDialogProps } from '../../layouts';
11
11
  import { SpacePanel, SpacePanelProps } from '../../panels';
@@ -16,6 +16,7 @@ export interface SpaceDialogProps
16
16
 
17
17
  export const SpaceDialog = ({ slots, ...spacePanelProps }: SpaceDialogProps) => {
18
18
  const titleId = useId('spaceDialog__title');
19
+ const themeContextValue = useThemeContext();
19
20
 
20
21
  return (
21
22
  <PanelDialog
@@ -24,7 +25,7 @@ export const SpaceDialog = ({ slots, ...spacePanelProps }: SpaceDialogProps) =>
24
25
  titleId
25
26
  }}
26
27
  >
27
- <ThemeContext.Provider value={{ themeVariant: 'os' }}>
28
+ <ThemeContext.Provider value={{ ...themeContextValue, themeVariant: 'os' }}>
28
29
  <SpacePanel
29
30
  {...{
30
31
  ...spacePanelProps,
@@ -5,7 +5,7 @@ import React from 'react';
5
5
 
6
6
  import type { Identity } from '@dxos/client';
7
7
  import { useClient } from '@dxos/react-client';
8
- import { Avatar, Button, DensityProvider, ThemeContext, useTranslation } from '@dxos/react-components';
8
+ import { Avatar, Button, DensityProvider, ThemeContext, useThemeContext, useTranslation } from '@dxos/react-components';
9
9
 
10
10
  export const IdentityPanel = ({
11
11
  identity,
@@ -16,13 +16,15 @@ export const IdentityPanel = ({
16
16
  }) => {
17
17
  const { t } = useTranslation('os');
18
18
  const client = useClient();
19
+ const themeContextValue = useThemeContext();
20
+
19
21
  const defaultManageProfile = () => {
20
22
  const remoteSource = new URL(client?.config.get('runtime.client.remoteSource') || 'https://halo.dxos.org');
21
23
  const tab = window.open(remoteSource.origin, '_blank');
22
24
  tab?.focus();
23
25
  };
24
26
  return (
25
- <ThemeContext.Provider value={{ themeVariant: 'os' }}>
27
+ <ThemeContext.Provider value={{ ...themeContextValue, themeVariant: 'os' }}>
26
28
  <DensityProvider density='fine'>
27
29
  <div className='flex flex-col gap-2 justify-center items-center'>
28
30
  <Avatar
@@ -1,20 +1,21 @@
1
1
  //
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
- import { ProhibitInset } from '@phosphor-icons/react';
4
+ import { X } from '@phosphor-icons/react';
5
5
  import React, { cloneElement, ForwardedRef, forwardRef } from 'react';
6
6
 
7
- import { AuthenticatingInvitationObservable } from '@dxos/client';
8
7
  import { useSpace } from '@dxos/react-client';
9
- import { Avatar, Button, getSize, Heading, mx, Trans, useId, useTranslation } from '@dxos/react-components';
8
+ import { Button, defaultDescription, getSize, Heading, mx, useId, useTranslation } from '@dxos/react-components';
10
9
 
11
- import { subduedSurface } from '../../styles';
10
+ import { defaultSurface } from '../../styles';
11
+ import { toEmoji } from '../../util';
12
12
  import { JoinPanelMode } from './JoinPanelProps';
13
+ import { JoinState } from './joinMachine';
13
14
 
14
15
  export interface JoinSpaceHeadingProps {
15
16
  mode?: JoinPanelMode;
16
17
  titleId: string;
17
- invitation?: AuthenticatingInvitationObservable;
18
+ joinState?: JoinState;
18
19
  onExit?: () => void;
19
20
  exitActionParent?: Parameters<typeof cloneElement>[0];
20
21
  preventExit?: boolean;
@@ -23,56 +24,57 @@ export interface JoinSpaceHeadingProps {
23
24
  // TODO(wittjosiah): Accesses the space properties directly which will trigger ECHO warnings without observer.
24
25
  export const JoinHeading = forwardRef(
25
26
  (
26
- { mode, titleId, invitation, onExit, exitActionParent, preventExit }: JoinSpaceHeadingProps,
27
+ { mode, titleId, joinState, onExit, exitActionParent, preventExit }: JoinSpaceHeadingProps,
27
28
  ref: ForwardedRef<HTMLDivElement>
28
29
  ) => {
29
30
  const { t } = useTranslation('os');
30
31
 
31
- const space = useSpace(invitation?.invitation?.spaceKey);
32
- const name = mode === 'halo-only' ? '(Unknown identity)' : space?.properties.name ?? '(Space name not available)';
32
+ const space = useSpace(joinState?.context.space.invitation?.spaceKey);
33
+ const name = space?.properties.name;
33
34
  const nameId = useId(mode === 'halo-only' ? 'identityDisplayName' : 'spaceDisplayName');
34
35
 
35
- const invitationKey =
36
- mode === 'halo-only'
37
- ? invitation?.invitation?.identityKey?.toHex()
38
- : invitation?.invitation?.identityKey?.toHex();
36
+ const invitationKey = joinState?.context[mode === 'halo-only' ? 'halo' : 'space'].invitation?.invitationId;
37
+ const invitationEmoji = invitationKey && toEmoji(invitationKey);
39
38
 
40
39
  const exitButton = (
41
- <Button variant='ghost' {...(onExit && { onClick: onExit })} className='grow-0 shrink-0' data-testid='join-exit'>
42
- <ProhibitInset className={getSize(5)} />
40
+ <Button
41
+ variant='ghost'
42
+ {...(onExit && { onClick: onExit })}
43
+ className={mx(defaultDescription, 'plb-0 pli-2 absolute block-start-1.5 inline-end-2 z-[1]')}
44
+ data-testid='join-exit'
45
+ >
46
+ <X weight='bold' className={getSize(4)} />
43
47
  <span className='sr-only'>{t('exit label')}</span>
44
48
  </Button>
45
49
  );
46
50
 
47
51
  return (
48
- <div role='none' className={mx(subduedSurface, 'p-2 rounded-bs-md')} ref={ref}>
49
- <div role='group' className='flex items-center gap-2'>
50
- {invitationKey ? (
51
- <Avatar fallbackValue={invitationKey} labelId={nameId} />
52
- ) : (
53
- <span role='none' className={mx(getSize(10), 'bg-neutral-300 dark:bg-neutral-700 rounded-full')} />
52
+ <div role='none' className={mx(defaultSurface, 'pbs-3 pbe-1 rounded-bs-md relative')} ref={ref}>
53
+ {!preventExit &&
54
+ mode !== 'halo-only' &&
55
+ (exitActionParent ? cloneElement(exitActionParent, {}, exitButton) : exitButton)}
56
+ <Heading
57
+ level={1}
58
+ className={mx(
59
+ defaultDescription,
60
+ 'font-body font-system-normal text-center text-sm grow pbe-2',
61
+ mode === 'halo-only' && (preventExit ? 'sr-only' : 'opacity-0')
54
62
  )}
55
- <Heading level={1} className='font-body font-normal text-base grow' id={titleId}>
56
- {invitation ? (
57
- <Trans
58
- {...{
59
- defaults: t('joining heading'),
60
- components: {
61
- small: <span className='block leading-none mbe-1 font-system-medium text-sm' />,
62
- large: <span className='block leading-none' id={nameId} />
63
- },
64
- values: { name }
65
- }}
66
- />
67
- ) : (
68
- <span className='block leading-none font-system-medium text-sm'>
69
- {mode === 'halo-only' ? t('halo heading') : t('join space heading')}
70
- </span>
63
+ id={titleId}
64
+ >
65
+ {t(mode === 'halo-only' ? 'selecting identity heading' : 'joining space heading')}
66
+ </Heading>
67
+ <div role='group' className='flex items-center justify-center gap-2'>
68
+ <span
69
+ role='none'
70
+ className={mx(
71
+ getSize(12),
72
+ 'bg-neutral-300 dark:bg-neutral-700 rounded-full text-center text-4xl leading-[3rem]'
71
73
  )}
72
- </Heading>
73
- {!preventExit &&
74
- mode !== 'halo-only' &&
75
- (exitActionParent ? cloneElement(exitActionParent, {}, exitButton) : exitButton)}
74
+ >
75
+ {invitationEmoji}
76
+ </span>
77
+ {name && <p id={nameId}>{name}</p>}
76
78
  </div>
77
79
  </div>
78
80
  );