@dxos/react-ui 0.1.31 → 0.1.32-next.86f5578
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 +1018 -870
- 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/JoinDialog/JoinDialog.stories.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/JoinDialog/JoinDialog.stories.tsx +4 -2
- package/src/composites/Shell/Shell.stories.tsx +1 -1
- package/src/composites/Shell/Shell.tsx +1 -1
- package/src/panels/JoinPanel/JoinHeading.tsx +42 -40
- package/src/panels/JoinPanel/JoinPanel.tsx +140 -218
- 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 +37 -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
8
|
import { DensityProvider, useId } 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,211 @@ 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 availableIdentities = identity ? [identity] : [];
|
|
34
|
+
const titleId = useId('joinPanel__title');
|
|
40
35
|
|
|
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;
|
|
36
|
+
const [joinState, joinSend, joinService] = useJoinMachine(client, {
|
|
37
|
+
context: {
|
|
38
|
+
mode,
|
|
39
|
+
identity,
|
|
40
|
+
...(initialInvitationCode && {
|
|
41
|
+
[mode === 'halo-only' ? 'halo' : 'space']: { unredeemedCode: initialInvitationCode }
|
|
42
|
+
})
|
|
124
43
|
}
|
|
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
44
|
});
|
|
141
45
|
|
|
142
|
-
if (identity !== prevIdentity) {
|
|
143
|
-
setPrevIdentity(identity);
|
|
144
|
-
identity && !prevIdentity && dispatch({ type: 'added identity', identity });
|
|
145
|
-
}
|
|
146
|
-
|
|
147
46
|
useEffect(() => {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
47
|
+
const subscription = joinService.subscribe((state) => {
|
|
48
|
+
log('[state]', state);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
return subscription.unsubscribe;
|
|
52
|
+
}, [joinService]);
|
|
152
53
|
|
|
153
54
|
useEffect(() => {
|
|
154
55
|
// TODO(thure): Validate if this is sufficiently synchronous for iOS to move focus. It might not be!
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
? `${joinState.activeView}; ${joinState.spaceViewState}`
|
|
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}"]`);
|
|
56
|
+
const stateStack = joinState.configuration[0].id.split('.');
|
|
57
|
+
const innermostState = stateStack[stateStack.length - 1];
|
|
58
|
+
const autoFocusValue = innermostState === 'finishingJoining' ? 'successSpaceInvitation' : innermostState;
|
|
59
|
+
const $nextAutofocus: HTMLElement | null = document.querySelector(`[data-autofocus~="${autoFocusValue}"]`);
|
|
165
60
|
if ($nextAutofocus) {
|
|
166
61
|
$nextAutofocus.focus();
|
|
167
62
|
}
|
|
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]);
|
|
63
|
+
}, [joinState.value]);
|
|
191
64
|
|
|
192
65
|
return (
|
|
193
66
|
<DensityProvider density='fine'>
|
|
194
|
-
<JoinHeading
|
|
195
|
-
{...{ mode, titleId, invitation: joinState.spaceInvitation, onExit, exitActionParent, preventExit }}
|
|
196
|
-
/>
|
|
67
|
+
<JoinHeading {...{ mode, titleId, joinState, onExit, exitActionParent, preventExit }} />
|
|
197
68
|
<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
|
-
/>
|
|
69
|
+
<div role='none' className='flex is-[1200%]' aria-live='polite'>
|
|
202
70
|
<AdditionMethodSelector
|
|
203
71
|
{...{
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
active: joinState.
|
|
72
|
+
joinState,
|
|
73
|
+
joinSend,
|
|
74
|
+
active: joinState.matches({ choosingIdentity: 'choosingAuthMethod' })
|
|
207
75
|
}}
|
|
208
76
|
/>
|
|
209
77
|
<IdentityInput
|
|
210
78
|
{...{
|
|
211
|
-
|
|
212
|
-
|
|
79
|
+
joinState,
|
|
80
|
+
joinSend,
|
|
81
|
+
active: joinState.matches({ choosingIdentity: 'creatingIdentity' }),
|
|
213
82
|
method: 'create identity'
|
|
214
83
|
}}
|
|
215
84
|
/>
|
|
216
85
|
<IdentityInput
|
|
217
86
|
{...{
|
|
218
|
-
|
|
219
|
-
|
|
87
|
+
joinState,
|
|
88
|
+
joinSend,
|
|
89
|
+
active: joinState.matches({ choosingIdentity: 'recoveringIdentity' }),
|
|
220
90
|
method: 'recover identity'
|
|
221
91
|
}}
|
|
222
92
|
/>
|
|
223
93
|
<InvitationInput
|
|
224
94
|
{...{
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
active:
|
|
228
|
-
|
|
229
|
-
|
|
95
|
+
joinState,
|
|
96
|
+
joinSend,
|
|
97
|
+
active: joinState.matches({
|
|
98
|
+
choosingIdentity: { acceptingHaloInvitation: 'inputtingHaloInvitationCode' }
|
|
99
|
+
}),
|
|
100
|
+
Domain: 'Halo'
|
|
230
101
|
}}
|
|
231
102
|
/>
|
|
232
103
|
<InvitationRescuer
|
|
233
104
|
{...{
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
active:
|
|
237
|
-
|
|
238
|
-
|
|
105
|
+
joinState,
|
|
106
|
+
joinSend,
|
|
107
|
+
active: [
|
|
108
|
+
{
|
|
109
|
+
choosingIdentity: {
|
|
110
|
+
acceptingHaloInvitation: { acceptingRedeemedHaloInvitation: 'connectingHaloInvitation' }
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
choosingIdentity: {
|
|
115
|
+
acceptingHaloInvitation: { acceptingRedeemedHaloInvitation: 'failingHaloInvitation' }
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
].some(joinState.matches),
|
|
119
|
+
Domain: 'Halo'
|
|
239
120
|
}}
|
|
240
121
|
/>
|
|
241
122
|
<InvitationAuthenticator
|
|
242
123
|
{...{
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
active:
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
124
|
+
joinState,
|
|
125
|
+
joinSend,
|
|
126
|
+
active: [
|
|
127
|
+
{
|
|
128
|
+
choosingIdentity: {
|
|
129
|
+
acceptingHaloInvitation: { acceptingRedeemedHaloInvitation: 'inputtingHaloVerificationCode' }
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
choosingIdentity: {
|
|
134
|
+
acceptingHaloInvitation: { acceptingRedeemedHaloInvitation: 'authenticatingHaloVerificationCode' }
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
choosingIdentity: {
|
|
139
|
+
acceptingHaloInvitation: {
|
|
140
|
+
acceptingRedeemedHaloInvitation: 'authenticationFailingHaloVerificationCode'
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
].some(joinState.matches),
|
|
145
|
+
Domain: 'Halo',
|
|
146
|
+
...(joinState.matches({
|
|
147
|
+
acceptingHaloInvitation: {
|
|
148
|
+
acceptingRedeemedHaloInvitation: 'authenticationFailingHaloVerificationCode'
|
|
149
|
+
}
|
|
150
|
+
}) && { failed: true })
|
|
250
151
|
}}
|
|
251
152
|
/>
|
|
252
153
|
<InvitationAccepted
|
|
253
154
|
{...{
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
active:
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
155
|
+
joinState,
|
|
156
|
+
joinSend,
|
|
157
|
+
active: [
|
|
158
|
+
{
|
|
159
|
+
choosingIdentity: {
|
|
160
|
+
acceptingHaloInvitation: { acceptingRedeemedHaloInvitation: 'successHaloInvitation' }
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
'finishingJoiningHalo'
|
|
164
|
+
].some(joinState.matches),
|
|
165
|
+
Domain: 'Halo',
|
|
260
166
|
doneActionParent,
|
|
261
167
|
onDone
|
|
262
168
|
}}
|
|
263
169
|
/>
|
|
264
170
|
<IdentityAdded
|
|
265
171
|
{...{
|
|
172
|
+
joinState,
|
|
173
|
+
joinSend,
|
|
266
174
|
mode,
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
175
|
+
active: joinState.matches({
|
|
176
|
+
choosingIdentity: 'confirmingAddedIdentity'
|
|
177
|
+
}),
|
|
270
178
|
doneActionParent,
|
|
271
179
|
onDone
|
|
272
180
|
}}
|
|
273
181
|
/>
|
|
274
182
|
<InvitationInput
|
|
275
183
|
{...{
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
184
|
+
joinState,
|
|
185
|
+
joinSend,
|
|
186
|
+
active: joinState.matches({
|
|
187
|
+
acceptingSpaceInvitation: 'inputtingSpaceInvitationCode'
|
|
188
|
+
}),
|
|
189
|
+
Domain: 'Space'
|
|
282
190
|
}}
|
|
283
191
|
/>
|
|
284
192
|
<InvitationRescuer
|
|
285
193
|
{...{
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
194
|
+
joinState,
|
|
195
|
+
joinSend,
|
|
196
|
+
active: [
|
|
197
|
+
{
|
|
198
|
+
acceptingSpaceInvitation: { acceptingRedeemedSpaceInvitation: 'connectingSpaceInvitation' }
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
acceptingSpaceInvitation: { acceptingRedeemedSpaceInvitation: 'failingSpaceInvitation' }
|
|
202
|
+
}
|
|
203
|
+
].some(joinState.matches),
|
|
204
|
+
Domain: 'Space'
|
|
293
205
|
}}
|
|
294
206
|
/>
|
|
295
207
|
<InvitationAuthenticator
|
|
296
208
|
{...{
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
209
|
+
joinState,
|
|
210
|
+
joinSend,
|
|
211
|
+
active: [
|
|
212
|
+
{
|
|
213
|
+
acceptingSpaceInvitation: { acceptingRedeemedSpaceInvitation: 'inputtingSpaceVerificationCode' }
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
acceptingSpaceInvitation: { acceptingRedeemedSpaceInvitation: 'authenticatingSpaceVerificationCode' }
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
acceptingSpaceInvitation: {
|
|
220
|
+
acceptingRedeemedSpaceInvitation: 'authenticationFailingSpaceVerificationCode'
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
].some(joinState.matches),
|
|
224
|
+
Domain: 'Space',
|
|
225
|
+
...(joinState.matches({
|
|
226
|
+
acceptingSpaceInvitation: {
|
|
227
|
+
acceptingRedeemedSpaceInvitation: 'authenticationFailingSpaceVerificationCode'
|
|
228
|
+
}
|
|
229
|
+
}) && { failed: true })
|
|
305
230
|
}}
|
|
306
231
|
/>
|
|
307
232
|
<InvitationAccepted
|
|
308
233
|
{...{
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
joinState.activeView === 'space invitation acceptor' &&
|
|
314
|
-
joinState.spaceViewState === 'invitation accepted',
|
|
315
|
-
invitationType: 'space',
|
|
234
|
+
joinState,
|
|
235
|
+
joinSend,
|
|
236
|
+
active: joinState.matches('finishingJoiningSpace'),
|
|
237
|
+
Domain: 'Space',
|
|
316
238
|
doneActionParent,
|
|
317
239
|
onDone
|
|
318
240
|
}}
|
|
@@ -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'
|