@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.
- package/dist/lib/browser/index.mjs +1035 -876
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/types/src/components/IdentityList/SpaceMemberListContainer.d.ts.map +1 -1
- package/dist/types/src/composites/DevicesDialog/DevicesDialog.d.ts.map +1 -1
- package/dist/types/src/composites/JoinDialog/JoinDialog.d.ts.map +1 -1
- package/dist/types/src/composites/JoinDialog/JoinDialog.stories.d.ts.map +1 -1
- package/dist/types/src/composites/SpaceDialog/SpaceDialog.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinHeading.d.ts +2 -2
- package/dist/types/src/panels/JoinPanel/JoinHeading.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/joinMachine.d.ts +64 -0
- package/dist/types/src/panels/JoinPanel/joinMachine.d.ts.map +1 -0
- package/dist/types/src/panels/JoinPanel/view-states/AdditionMethodSelector.d.ts +2 -5
- package/dist/types/src/panels/JoinPanel/view-states/AdditionMethodSelector.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/view-states/InvitationAccepted.d.ts +1 -1
- package/dist/types/src/panels/JoinPanel/view-states/InvitationAccepted.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/view-states/InvitationAuthenticator.d.ts +2 -2
- package/dist/types/src/panels/JoinPanel/view-states/InvitationAuthenticator.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/view-states/InvitationInput.d.ts +2 -2
- package/dist/types/src/panels/JoinPanel/view-states/InvitationInput.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/view-states/InvitationRescuer.d.ts +2 -2
- package/dist/types/src/panels/JoinPanel/view-states/InvitationRescuer.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/view-states/ViewState.d.ts +4 -6
- package/dist/types/src/panels/JoinPanel/view-states/ViewState.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/view-states/index.d.ts +0 -1
- package/dist/types/src/panels/JoinPanel/view-states/index.d.ts.map +1 -1
- package/dist/types/src/playwright/invitations-manager.d.ts.map +1 -1
- package/dist/types/src/translations/locales/en-US.d.ts +3 -1
- package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/toEmoji.d.ts +2 -0
- package/dist/types/src/util/toEmoji.d.ts.map +1 -0
- package/package.json +18 -14
- package/src/components/IdentityList/SpaceMemberListContainer.tsx +6 -2
- package/src/components/InvitationList/InvitationList.stories.tsx +1 -1
- package/src/composites/DevicesDialog/DevicesDialog.tsx +3 -2
- package/src/composites/JoinDialog/JoinDialog.stories.tsx +4 -2
- package/src/composites/JoinDialog/JoinDialog.tsx +4 -2
- package/src/composites/Shell/Shell.stories.tsx +1 -1
- package/src/composites/Shell/Shell.tsx +1 -1
- package/src/composites/SpaceDialog/SpaceDialog.tsx +3 -2
- package/src/panels/IdentityPanel/IdentityPanel.tsx +4 -2
- package/src/panels/JoinPanel/JoinHeading.tsx +42 -40
- package/src/panels/JoinPanel/JoinPanel.tsx +143 -220
- package/src/panels/JoinPanel/JoinPanelProps.ts +1 -1
- package/src/panels/JoinPanel/joinMachine.ts +418 -0
- package/src/panels/JoinPanel/view-states/AdditionMethodSelector.tsx +9 -21
- package/src/panels/JoinPanel/view-states/IdentityAdded.tsx +6 -6
- package/src/panels/JoinPanel/view-states/IdentityInput.tsx +4 -4
- package/src/panels/JoinPanel/view-states/InvitationAccepted.tsx +22 -18
- package/src/panels/JoinPanel/view-states/InvitationAuthenticator.tsx +38 -28
- package/src/panels/JoinPanel/view-states/InvitationInput.tsx +21 -21
- package/src/panels/JoinPanel/view-states/InvitationRescuer.tsx +58 -41
- package/src/panels/JoinPanel/view-states/ViewState.tsx +11 -62
- package/src/panels/JoinPanel/view-states/index.ts +0 -1
- package/src/playwright/invitations-manager.ts +6 -2
- package/src/playwright/invitations.spec.ts +14 -5
- package/src/stories/Invitations.stories.tsx +2 -2
- package/src/translations/locales/en-US.ts +6 -4
- package/src/util/index.ts +1 -0
- package/src/util/toEmoji.ts +22 -0
- package/dist/types/src/panels/JoinPanel/view-states/IdentitySelector.d.ts +0 -7
- package/dist/types/src/panels/JoinPanel/view-states/IdentitySelector.d.ts.map +0 -1
- package/src/panels/JoinPanel/view-states/IdentitySelector.tsx +0 -100
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
//
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
|
-
import React, { useEffect
|
|
4
|
+
import React, { useEffect } from 'react';
|
|
5
5
|
|
|
6
|
-
import { InvitationEncoder } from '@dxos/client';
|
|
7
6
|
import { log } from '@dxos/log';
|
|
8
7
|
import { useClient, useIdentity } from '@dxos/react-client';
|
|
9
|
-
import { DensityProvider, useId } from '@dxos/react-components';
|
|
8
|
+
import { DensityProvider, useId, useThemeContext } from '@dxos/react-components';
|
|
10
9
|
|
|
11
10
|
import { JoinHeading } from './JoinHeading';
|
|
12
|
-
import {
|
|
11
|
+
import { JoinPanelProps } from './JoinPanelProps';
|
|
12
|
+
import { useJoinMachine } from './joinMachine';
|
|
13
13
|
import {
|
|
14
14
|
AdditionMethodSelector,
|
|
15
|
-
IdentitySelector,
|
|
16
15
|
IdentityInput,
|
|
17
16
|
IdentityAdded,
|
|
18
17
|
InvitationAuthenticator,
|
|
@@ -22,9 +21,8 @@ import {
|
|
|
22
21
|
} from './view-states';
|
|
23
22
|
|
|
24
23
|
export const JoinPanel = ({
|
|
25
|
-
mode,
|
|
24
|
+
mode = 'default',
|
|
26
25
|
initialInvitationCode,
|
|
27
|
-
titleId: propsTitleId,
|
|
28
26
|
exitActionParent,
|
|
29
27
|
onExit,
|
|
30
28
|
doneActionParent,
|
|
@@ -32,287 +30,212 @@ export const JoinPanel = ({
|
|
|
32
30
|
preventExit
|
|
33
31
|
}: JoinPanelProps) => {
|
|
34
32
|
const client = useClient();
|
|
35
|
-
const internalTitleId = useId('joinPanel__title');
|
|
36
|
-
const titleId = propsTitleId ?? internalTitleId;
|
|
37
33
|
const identity = useIdentity();
|
|
38
|
-
const
|
|
39
|
-
const
|
|
34
|
+
const titleId = useId('joinPanel__title');
|
|
35
|
+
const { hasIosKeyboard } = useThemeContext();
|
|
40
36
|
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
case 'add identity':
|
|
49
|
-
nextState.activeView = 'addition method selector';
|
|
50
|
-
break;
|
|
51
|
-
case 'select addition method':
|
|
52
|
-
if (action.method === 'accept device invitation') {
|
|
53
|
-
nextState.activeView = 'halo invitation acceptor';
|
|
54
|
-
if (state.unredeemedHaloInvitationCode) {
|
|
55
|
-
nextState.haloInvitation = client.halo.acceptInvitation(
|
|
56
|
-
InvitationEncoder.decode(state.unredeemedHaloInvitationCode)
|
|
57
|
-
);
|
|
58
|
-
nextState.unredeemedHaloInvitationCode = undefined;
|
|
59
|
-
nextState.haloViewState = 'invitation authenticator';
|
|
60
|
-
} else {
|
|
61
|
-
nextState.haloViewState = 'invitation input';
|
|
62
|
-
}
|
|
63
|
-
} else {
|
|
64
|
-
nextState.activeView = 'identity input';
|
|
65
|
-
nextState.additionMethod = action.method;
|
|
66
|
-
}
|
|
67
|
-
break;
|
|
68
|
-
case 'select identity':
|
|
69
|
-
nextState.selectedIdentity = action.identity;
|
|
70
|
-
nextState.activeView = 'space invitation acceptor';
|
|
71
|
-
if (state.unredeemedSpaceInvitationCode) {
|
|
72
|
-
nextState.spaceInvitation = client.echo.acceptInvitation(
|
|
73
|
-
InvitationEncoder.decode(state.unredeemedSpaceInvitationCode)
|
|
74
|
-
);
|
|
75
|
-
nextState.unredeemedSpaceInvitationCode = undefined;
|
|
76
|
-
nextState.spaceViewState = 'invitation authenticator';
|
|
77
|
-
} else {
|
|
78
|
-
nextState.spaceViewState = 'invitation input';
|
|
79
|
-
}
|
|
80
|
-
break;
|
|
81
|
-
case 'deselect identity':
|
|
82
|
-
nextState.selectedIdentity = undefined;
|
|
83
|
-
nextState.activeView = 'identity selector';
|
|
84
|
-
break;
|
|
85
|
-
case 'cancel invitation':
|
|
86
|
-
if (action.from === 'space' && state.spaceInvitation?.invitation) {
|
|
87
|
-
void state.spaceInvitation?.cancel();
|
|
88
|
-
}
|
|
89
|
-
if (action.from === 'halo' && state.haloInvitation?.invitation) {
|
|
90
|
-
void state.haloInvitation?.cancel();
|
|
91
|
-
}
|
|
92
|
-
break;
|
|
93
|
-
case 'authenticating invitation':
|
|
94
|
-
nextState[action.from === 'halo' ? 'haloInvitationAnnotation' : 'spaceInvitationAnnotation'] = 'authenticating';
|
|
95
|
-
break;
|
|
96
|
-
case 'connecting invitation':
|
|
97
|
-
nextState[action.from === 'halo' ? 'haloInvitation' : 'spaceInvitation'] = action.invitation;
|
|
98
|
-
// eslint-disable-next-line no-fallthrough
|
|
99
|
-
case 'cancelled invitation':
|
|
100
|
-
case 'fail invitation':
|
|
101
|
-
case 'timeout invitation':
|
|
102
|
-
nextState[action.from === 'halo' ? 'haloViewState' : 'spaceViewState'] = 'invitation rescuer';
|
|
103
|
-
break;
|
|
104
|
-
case 'connect invitation':
|
|
105
|
-
case 'authenticate invitation':
|
|
106
|
-
if (action.from === 'halo' && state.haloInvitationAnnotation === 'authenticating') {
|
|
107
|
-
nextState.haloInvitationAnnotation = 'authentication failed';
|
|
108
|
-
}
|
|
109
|
-
if (action.from === 'space' && state.spaceInvitationAnnotation === 'authenticating') {
|
|
110
|
-
nextState.spaceInvitationAnnotation = 'authentication failed';
|
|
111
|
-
}
|
|
112
|
-
nextState[action.from === 'halo' ? 'haloViewState' : 'spaceViewState'] = 'invitation authenticator';
|
|
113
|
-
break;
|
|
114
|
-
case 'accepted invitation':
|
|
115
|
-
nextState[action.from === 'halo' ? 'haloViewState' : 'spaceViewState'] = 'invitation accepted';
|
|
116
|
-
break;
|
|
117
|
-
case 'reset invitation':
|
|
118
|
-
nextState[action.from === 'halo' ? 'haloInvitation' : 'spaceInvitation'] = undefined;
|
|
119
|
-
nextState[action.from === 'halo' ? 'haloInvitationAnnotation' : 'spaceInvitationAnnotation'] = undefined;
|
|
120
|
-
nextState[action.from === 'halo' ? 'unredeemedHaloInvitationCode' : 'unredeemedSpaceInvitationCode'] =
|
|
121
|
-
undefined;
|
|
122
|
-
nextState[action.from === 'halo' ? 'haloViewState' : 'spaceViewState'] = 'invitation input';
|
|
123
|
-
break;
|
|
37
|
+
const [joinState, joinSend, joinService] = useJoinMachine(client, {
|
|
38
|
+
context: {
|
|
39
|
+
mode,
|
|
40
|
+
identity,
|
|
41
|
+
...(initialInvitationCode && {
|
|
42
|
+
[mode === 'halo-only' ? 'halo' : 'space']: { unredeemedCode: initialInvitationCode }
|
|
43
|
+
})
|
|
124
44
|
}
|
|
125
|
-
log('[join panel reducer]', { action, nextState });
|
|
126
|
-
return nextState;
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
const unredeemedHaloInvitationCode = mode === 'halo-only' ? initialInvitationCode : undefined;
|
|
130
|
-
const [joinState, dispatch] = useReducer(reducer, {
|
|
131
|
-
unredeemedHaloInvitationCode,
|
|
132
|
-
unredeemedSpaceInvitationCode: mode === 'halo-only' ? undefined : initialInvitationCode,
|
|
133
|
-
spaceInvitation: undefined,
|
|
134
|
-
haloInvitation: undefined,
|
|
135
|
-
activeView: availableIdentities.length > 0 ? 'identity selector' : 'addition method selector',
|
|
136
|
-
selectedIdentity: undefined,
|
|
137
|
-
additionMethod: undefined,
|
|
138
|
-
spaceViewState: 'invitation input',
|
|
139
|
-
haloViewState: 'invitation input'
|
|
140
45
|
});
|
|
141
46
|
|
|
142
|
-
if (identity !== prevIdentity) {
|
|
143
|
-
setPrevIdentity(identity);
|
|
144
|
-
identity && !prevIdentity && dispatch({ type: 'added identity', identity });
|
|
145
|
-
}
|
|
146
|
-
|
|
147
47
|
useEffect(() => {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
48
|
+
const subscription = joinService.subscribe((state) => {
|
|
49
|
+
log('[state]', state);
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return subscription.unsubscribe;
|
|
53
|
+
}, [joinService]);
|
|
152
54
|
|
|
153
55
|
useEffect(() => {
|
|
154
56
|
// TODO(thure): Validate if this is sufficiently synchronous for iOS to move focus. It might not be!
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
: joinState.activeView === 'halo invitation acceptor'
|
|
161
|
-
? `${joinState.activeView}; ${joinState.haloViewState}`
|
|
162
|
-
: joinState.activeView;
|
|
163
|
-
log('[autofocus value]', { attrValue });
|
|
164
|
-
const $nextAutofocus: HTMLElement | null = document.querySelector(`[data-autofocus="${attrValue}"]`);
|
|
165
|
-
if ($nextAutofocus) {
|
|
57
|
+
const stateStack = joinState.configuration[0].id.split('.');
|
|
58
|
+
const innermostState = stateStack[stateStack.length - 1];
|
|
59
|
+
const autoFocusValue = innermostState === 'finishingJoining' ? 'successSpaceInvitation' : innermostState;
|
|
60
|
+
const $nextAutofocus: HTMLElement | null = document.querySelector(`[data-autofocus~="${autoFocusValue}"]`);
|
|
61
|
+
if ($nextAutofocus && !(hasIosKeyboard && $nextAutofocus.hasAttribute('data-prevent-ios-autofocus'))) {
|
|
166
62
|
$nextAutofocus.focus();
|
|
167
63
|
}
|
|
168
|
-
}, [joinState.
|
|
169
|
-
|
|
170
|
-
useEffect(() => {
|
|
171
|
-
return joinState.spaceInvitation?.subscribe({
|
|
172
|
-
onAuthenticating: () => dispatch({ type: 'authenticate invitation', from: 'space' }),
|
|
173
|
-
onCancelled: () => dispatch({ type: 'cancelled invitation', from: 'space' }),
|
|
174
|
-
onConnected: () => dispatch({ type: 'connect invitation', from: 'space' }),
|
|
175
|
-
onError: () => dispatch({ type: 'fail invitation', from: 'space' }),
|
|
176
|
-
onSuccess: () => dispatch({ type: 'accepted invitation', from: 'space' }),
|
|
177
|
-
onTimeout: () => dispatch({ type: 'timeout invitation', from: 'space' })
|
|
178
|
-
});
|
|
179
|
-
}, [joinState.spaceInvitation]);
|
|
180
|
-
|
|
181
|
-
useEffect(() => {
|
|
182
|
-
return joinState.haloInvitation?.subscribe({
|
|
183
|
-
onAuthenticating: () => dispatch({ type: 'authenticate invitation', from: 'halo' }),
|
|
184
|
-
onCancelled: () => dispatch({ type: 'cancelled invitation', from: 'halo' }),
|
|
185
|
-
onConnected: () => dispatch({ type: 'connect invitation', from: 'halo' }),
|
|
186
|
-
onError: () => dispatch({ type: 'fail invitation', from: 'halo' }),
|
|
187
|
-
onSuccess: () => dispatch({ type: 'accepted invitation', from: 'halo' }),
|
|
188
|
-
onTimeout: () => dispatch({ type: 'timeout invitation', from: 'halo' })
|
|
189
|
-
});
|
|
190
|
-
}, [joinState.haloInvitation]);
|
|
64
|
+
}, [joinState.value, hasIosKeyboard]);
|
|
191
65
|
|
|
192
66
|
return (
|
|
193
67
|
<DensityProvider density='fine'>
|
|
194
|
-
<JoinHeading
|
|
195
|
-
{...{ mode, titleId, invitation: joinState.spaceInvitation, onExit, exitActionParent, preventExit }}
|
|
196
|
-
/>
|
|
68
|
+
<JoinHeading {...{ mode, titleId, joinState, onExit, exitActionParent, preventExit }} />
|
|
197
69
|
<div role='none' className='is-full overflow-hidden'>
|
|
198
|
-
<div role='none' className='flex is-[
|
|
199
|
-
<IdentitySelector
|
|
200
|
-
{...{ dispatch, availableIdentities, active: joinState.activeView === 'identity selector' }}
|
|
201
|
-
/>
|
|
70
|
+
<div role='none' className='flex is-[1200%]' aria-live='polite'>
|
|
202
71
|
<AdditionMethodSelector
|
|
203
72
|
{...{
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
active: joinState.
|
|
73
|
+
joinState,
|
|
74
|
+
joinSend,
|
|
75
|
+
active: joinState.matches({ choosingIdentity: 'choosingAuthMethod' })
|
|
207
76
|
}}
|
|
208
77
|
/>
|
|
209
78
|
<IdentityInput
|
|
210
79
|
{...{
|
|
211
|
-
|
|
212
|
-
|
|
80
|
+
joinState,
|
|
81
|
+
joinSend,
|
|
82
|
+
active: joinState.matches({ choosingIdentity: 'creatingIdentity' }),
|
|
213
83
|
method: 'create identity'
|
|
214
84
|
}}
|
|
215
85
|
/>
|
|
216
86
|
<IdentityInput
|
|
217
87
|
{...{
|
|
218
|
-
|
|
219
|
-
|
|
88
|
+
joinState,
|
|
89
|
+
joinSend,
|
|
90
|
+
active: joinState.matches({ choosingIdentity: 'recoveringIdentity' }),
|
|
220
91
|
method: 'recover identity'
|
|
221
92
|
}}
|
|
222
93
|
/>
|
|
223
94
|
<InvitationInput
|
|
224
95
|
{...{
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
active:
|
|
228
|
-
|
|
229
|
-
|
|
96
|
+
joinState,
|
|
97
|
+
joinSend,
|
|
98
|
+
active: joinState.matches({
|
|
99
|
+
choosingIdentity: { acceptingHaloInvitation: 'inputtingHaloInvitationCode' }
|
|
100
|
+
}),
|
|
101
|
+
Domain: 'Halo'
|
|
230
102
|
}}
|
|
231
103
|
/>
|
|
232
104
|
<InvitationRescuer
|
|
233
105
|
{...{
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
active:
|
|
237
|
-
|
|
238
|
-
|
|
106
|
+
joinState,
|
|
107
|
+
joinSend,
|
|
108
|
+
active: [
|
|
109
|
+
{
|
|
110
|
+
choosingIdentity: {
|
|
111
|
+
acceptingHaloInvitation: { acceptingRedeemedHaloInvitation: 'connectingHaloInvitation' }
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
choosingIdentity: {
|
|
116
|
+
acceptingHaloInvitation: { acceptingRedeemedHaloInvitation: 'failingHaloInvitation' }
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
].some(joinState.matches),
|
|
120
|
+
Domain: 'Halo'
|
|
239
121
|
}}
|
|
240
122
|
/>
|
|
241
123
|
<InvitationAuthenticator
|
|
242
124
|
{...{
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
active:
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
125
|
+
joinState,
|
|
126
|
+
joinSend,
|
|
127
|
+
active: [
|
|
128
|
+
{
|
|
129
|
+
choosingIdentity: {
|
|
130
|
+
acceptingHaloInvitation: { acceptingRedeemedHaloInvitation: 'inputtingHaloVerificationCode' }
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
choosingIdentity: {
|
|
135
|
+
acceptingHaloInvitation: { acceptingRedeemedHaloInvitation: 'authenticatingHaloVerificationCode' }
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
choosingIdentity: {
|
|
140
|
+
acceptingHaloInvitation: {
|
|
141
|
+
acceptingRedeemedHaloInvitation: 'authenticationFailingHaloVerificationCode'
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
].some(joinState.matches),
|
|
146
|
+
Domain: 'Halo',
|
|
147
|
+
...(joinState.matches({
|
|
148
|
+
acceptingHaloInvitation: {
|
|
149
|
+
acceptingRedeemedHaloInvitation: 'authenticationFailingHaloVerificationCode'
|
|
150
|
+
}
|
|
151
|
+
}) && { failed: true })
|
|
250
152
|
}}
|
|
251
153
|
/>
|
|
252
154
|
<InvitationAccepted
|
|
253
155
|
{...{
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
active:
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
156
|
+
joinState,
|
|
157
|
+
joinSend,
|
|
158
|
+
active: [
|
|
159
|
+
{
|
|
160
|
+
choosingIdentity: {
|
|
161
|
+
acceptingHaloInvitation: { acceptingRedeemedHaloInvitation: 'successHaloInvitation' }
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
'finishingJoiningHalo'
|
|
165
|
+
].some(joinState.matches),
|
|
166
|
+
Domain: 'Halo',
|
|
260
167
|
doneActionParent,
|
|
261
168
|
onDone
|
|
262
169
|
}}
|
|
263
170
|
/>
|
|
264
171
|
<IdentityAdded
|
|
265
172
|
{...{
|
|
173
|
+
joinState,
|
|
174
|
+
joinSend,
|
|
266
175
|
mode,
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
176
|
+
active: joinState.matches({
|
|
177
|
+
choosingIdentity: 'confirmingAddedIdentity'
|
|
178
|
+
}),
|
|
270
179
|
doneActionParent,
|
|
271
180
|
onDone
|
|
272
181
|
}}
|
|
273
182
|
/>
|
|
274
183
|
<InvitationInput
|
|
275
184
|
{...{
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
185
|
+
joinState,
|
|
186
|
+
joinSend,
|
|
187
|
+
active: joinState.matches({
|
|
188
|
+
acceptingSpaceInvitation: 'inputtingSpaceInvitationCode'
|
|
189
|
+
}),
|
|
190
|
+
Domain: 'Space'
|
|
282
191
|
}}
|
|
283
192
|
/>
|
|
284
193
|
<InvitationRescuer
|
|
285
194
|
{...{
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
195
|
+
joinState,
|
|
196
|
+
joinSend,
|
|
197
|
+
active: [
|
|
198
|
+
{
|
|
199
|
+
acceptingSpaceInvitation: { acceptingRedeemedSpaceInvitation: 'connectingSpaceInvitation' }
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
acceptingSpaceInvitation: { acceptingRedeemedSpaceInvitation: 'failingSpaceInvitation' }
|
|
203
|
+
}
|
|
204
|
+
].some(joinState.matches),
|
|
205
|
+
Domain: 'Space'
|
|
293
206
|
}}
|
|
294
207
|
/>
|
|
295
208
|
<InvitationAuthenticator
|
|
296
209
|
{...{
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
210
|
+
joinState,
|
|
211
|
+
joinSend,
|
|
212
|
+
active: [
|
|
213
|
+
{
|
|
214
|
+
acceptingSpaceInvitation: { acceptingRedeemedSpaceInvitation: 'inputtingSpaceVerificationCode' }
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
acceptingSpaceInvitation: { acceptingRedeemedSpaceInvitation: 'authenticatingSpaceVerificationCode' }
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
acceptingSpaceInvitation: {
|
|
221
|
+
acceptingRedeemedSpaceInvitation: 'authenticationFailingSpaceVerificationCode'
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
].some(joinState.matches),
|
|
225
|
+
Domain: 'Space',
|
|
226
|
+
...(joinState.matches({
|
|
227
|
+
acceptingSpaceInvitation: {
|
|
228
|
+
acceptingRedeemedSpaceInvitation: 'authenticationFailingSpaceVerificationCode'
|
|
229
|
+
}
|
|
230
|
+
}) && { failed: true })
|
|
305
231
|
}}
|
|
306
232
|
/>
|
|
307
233
|
<InvitationAccepted
|
|
308
234
|
{...{
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
joinState.activeView === 'space invitation acceptor' &&
|
|
314
|
-
joinState.spaceViewState === 'invitation accepted',
|
|
315
|
-
invitationType: 'space',
|
|
235
|
+
joinState,
|
|
236
|
+
joinSend,
|
|
237
|
+
active: joinState.matches('finishingJoiningSpace'),
|
|
238
|
+
Domain: 'Space',
|
|
316
239
|
doneActionParent,
|
|
317
240
|
onDone
|
|
318
241
|
}}
|
|
@@ -59,7 +59,7 @@ export interface AdditionMethodAction {
|
|
|
59
59
|
|
|
60
60
|
export type JoinAction = IdentityAction | EmptyJoinAction | AdditionMethodAction | InvitationAction;
|
|
61
61
|
|
|
62
|
-
export type
|
|
62
|
+
export type JoinSend = Dispatch<JoinAction>;
|
|
63
63
|
|
|
64
64
|
export type InvitationView =
|
|
65
65
|
| 'invitation input'
|