@dxos/shell 0.3.11-main.e716c43 → 0.3.11-main.ec7a2b3
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/bundle/shell.mjs +36585 -0
- package/dist/bundle/shell.mjs.map +1 -0
- package/dist/bundle/shell.umd.js +210 -0
- package/dist/bundle/shell.umd.js.map +1 -0
- package/dist/bundle/style.css +1 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react.mjs +717 -416
- package/dist/lib/browser/react.mjs.map +4 -4
- package/dist/types/src/components/IdentityList/DeviceList.d.ts.map +1 -1
- package/dist/types/src/components/IdentityList/DeviceList.js +5 -3
- package/dist/types/src/components/IdentityList/DeviceList.js.map +1 -1
- package/dist/types/src/components/Panel/Action.js +1 -1
- package/dist/types/src/components/Panel/Action.js.map +1 -1
- package/dist/types/src/composites/Shell/Shell.d.ts.map +1 -1
- package/dist/types/src/composites/Shell/Shell.js +15 -5
- package/dist/types/src/composites/Shell/Shell.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +19 -6
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.d.ts +6 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js +26 -3
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts +10 -7
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.d.ts +1 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.js +12 -3
- package/dist/types/src/panels/IdentityPanel/identityMachine.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/AgentPanel.d.ts +19 -0
- package/dist/types/src/panels/IdentityPanel/steps/AgentPanel.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/AgentPanel.js +122 -0
- package/dist/types/src/panels/IdentityPanel/steps/AgentPanel.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/DeviceManager.d.ts +10 -0
- package/dist/types/src/panels/IdentityPanel/steps/DeviceManager.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/DeviceManager.js +23 -0
- package/dist/types/src/panels/IdentityPanel/steps/DeviceManager.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js +9 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.d.ts +0 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js +2 -3
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.d.ts +16 -0
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.d.ts.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.js +40 -0
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/steps/index.d.ts +3 -0
- package/dist/types/src/panels/IdentityPanel/steps/index.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/index.js +3 -0
- package/dist/types/src/panels/IdentityPanel/steps/index.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.js +4 -3
- package/dist/types/src/panels/JoinPanel/JoinPanel.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/joinMachine.js +1 -1
- package/dist/types/src/panels/JoinPanel/joinMachine.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.d.ts.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.js +5 -3
- package/dist/types/src/panels/SpacePanel/SpacePanel.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.d.ts.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.js +2 -2
- package/dist/types/src/panels/SpacePanel/SpacePanel.stories.js.map +1 -1
- package/dist/types/src/panels/SpacePanel/SpacePanelProps.d.ts +1 -0
- package/dist/types/src/panels/SpacePanel/SpacePanelProps.d.ts.map +1 -1
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.d.ts +1 -0
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.d.ts.map +1 -1
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js +3 -1
- package/dist/types/src/panels/SpacePanel/steps/SpaceManager.js.map +1 -1
- package/dist/types/src/translations/locales/en-US.d.ts +6 -0
- package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
- package/dist/types/src/translations/locales/en-US.js +7 -1
- package/dist/types/src/translations/locales/en-US.js.map +1 -1
- package/package.json +18 -17
- package/src/components/IdentityList/DeviceList.tsx +7 -5
- package/src/components/Panel/Action.tsx +1 -1
- package/src/composites/Shell/Shell.tsx +16 -3
- package/src/panels/IdentityPanel/IdentityPanel.stories.tsx +44 -2
- package/src/panels/IdentityPanel/IdentityPanel.tsx +30 -7
- package/src/panels/IdentityPanel/IdentityPanelProps.ts +16 -7
- package/src/panels/IdentityPanel/identityMachine.ts +13 -4
- package/src/panels/IdentityPanel/steps/AgentPanel.tsx +165 -0
- package/src/panels/IdentityPanel/steps/DeviceManager.tsx +41 -0
- package/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx +12 -7
- package/src/panels/IdentityPanel/steps/ProfileForm.tsx +1 -1
- package/src/panels/IdentityPanel/steps/SignOutChooser.tsx +82 -0
- package/src/panels/IdentityPanel/steps/index.ts +3 -0
- package/src/panels/JoinPanel/JoinPanel.tsx +2 -2
- package/src/panels/JoinPanel/joinMachine.ts +1 -1
- package/src/panels/SpacePanel/SpacePanel.stories.tsx +2 -1
- package/src/panels/SpacePanel/SpacePanel.tsx +4 -1
- package/src/panels/SpacePanel/SpacePanelProps.ts +1 -0
- package/src/panels/SpacePanel/steps/SpaceManager.tsx +4 -1
- package/src/translations/locales/en-US.ts +7 -1
|
@@ -37,7 +37,7 @@ const react_ui_theme_1 = require("@dxos/react-ui-theme");
|
|
|
37
37
|
const components_1 = require("../../../components");
|
|
38
38
|
const activeActionKey = 'dxos:react-shell/space-manager/active-action';
|
|
39
39
|
const SpaceManager = (props) => {
|
|
40
|
-
const { space } = props;
|
|
40
|
+
const { space, target } = props;
|
|
41
41
|
const { t } = (0, react_ui_1.useTranslation)('os');
|
|
42
42
|
const config = (0, react_client_1.useConfig)();
|
|
43
43
|
const invitations = (0, echo_1.useSpaceInvitations)(space === null || space === void 0 ? void 0 : space.key);
|
|
@@ -57,6 +57,7 @@ const SpaceManager = (props) => {
|
|
|
57
57
|
const invitation = (_a = space.share) === null || _a === void 0 ? void 0 : _a.call(space, {
|
|
58
58
|
type: invitations_1.Invitation.Type.INTERACTIVE,
|
|
59
59
|
authMethod: invitations_1.Invitation.AuthMethod.SHARED_SECRET,
|
|
60
|
+
target,
|
|
60
61
|
});
|
|
61
62
|
if (invitation && ((_d = (_c = (_b = config.values.runtime) === null || _b === void 0 ? void 0 : _b.app) === null || _c === void 0 ? void 0 : _c.env) === null || _d === void 0 ? void 0 : _d.DX_ENVIRONMENT) !== 'production') {
|
|
62
63
|
invitation.subscribe(onInvitationEvent);
|
|
@@ -72,6 +73,7 @@ const SpaceManager = (props) => {
|
|
|
72
73
|
const invitation = (_a = space.share) === null || _a === void 0 ? void 0 : _a.call(space, {
|
|
73
74
|
type: invitations_1.Invitation.Type.MULTIUSE,
|
|
74
75
|
authMethod: invitations_1.Invitation.AuthMethod.NONE,
|
|
76
|
+
target,
|
|
75
77
|
});
|
|
76
78
|
if (invitation && ((_d = (_c = (_b = config.values.runtime) === null || _b === void 0 ? void 0 : _b.app) === null || _c === void 0 ? void 0 : _c.env) === null || _d === void 0 ? void 0 : _d.DX_ENVIRONMENT) !== 'production') {
|
|
77
79
|
invitation.subscribe(onInvitationEvent);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SpaceManager.js","sourceRoot":"","sources":["../../../../../../src/panels/SpacePanel/steps/SpaceManager.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,iDAA0E;AAC1E,+CAAyF;AAEzF,qDAA+C;AAC/C,kDAA8D;AAC9D,gEAAqH;AACrH,6CAA4D;AAC5D,yDAA2D;AAE3D,oDAQ6B;
|
|
1
|
+
{"version":3,"file":"SpaceManager.js","sourceRoot":"","sources":["../../../../../../src/panels/SpacePanel/steps/SpaceManager.tsx"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;AAEF,iDAA0E;AAC1E,+CAAyF;AAEzF,qDAA+C;AAC/C,kDAA8D;AAC9D,gEAAqH;AACrH,6CAA4D;AAC5D,yDAA2D;AAE3D,oDAQ6B;AAY7B,MAAM,eAAe,GAAG,8CAA8C,CAAC;AAIhE,MAAM,YAAY,GAAG,CAAC,KAAwB,EAAE,EAAE;IACvD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAChC,MAAM,EAAE,CAAC,EAAE,GAAG,IAAA,yBAAc,EAAC,IAAI,CAAC,CAAC;IACnC,MAAM,MAAM,GAAG,IAAA,wBAAS,GAAE,CAAC;IAE3B,MAAM,WAAW,GAAG,IAAA,0BAAmB,EAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,GAAG,CAAC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AAC,2BAA2B,CAAC,CAAM,CAClG,CACJ;gBACD,8BAAC,wBAAwB,IAAC,QAAQ,EAAE,KAAK,CAAC,GAAG,EAAE,WAAW,SAAG,CACzC;YACtB,8BAAC,qBAAU,CAAC,SAAS,IAAC,WAAW,EAAC,UAAU;gBAC1C,8BAAC,qBAAU,CAAC,KAAK,OAAG,CACC,CACP;QAClB,8BAAC,oBAAO;YACN,8BAAC,6BAAgB,IACf,QAAQ,EAAE,CAAC,MAAM,EACjB,OAAO,EAAE,aAAa,EACtB,YAAY,EAAE,YAAY,EAC1B,oBAAoB,EAAE,eAAmD,iBAC7D,gCAAgC,GAC5C,CACM,CACT,CACJ,CAAC;AACJ,CAAC,CAAC;AAtEW,QAAA,gBAAgB,oBAsE3B"}
|
|
@@ -65,6 +65,7 @@ export declare const os: {
|
|
|
65
65
|
'selecting identity heading': string;
|
|
66
66
|
'devices heading': string;
|
|
67
67
|
'identity heading': string;
|
|
68
|
+
'choose add device label': string;
|
|
68
69
|
'choose devices label': string;
|
|
69
70
|
'choose profile label': string;
|
|
70
71
|
'choose sign out label': string;
|
|
@@ -93,5 +94,10 @@ export declare const os: {
|
|
|
93
94
|
'reset identity input label': string;
|
|
94
95
|
'failed to reset identity message': string;
|
|
95
96
|
'confirmation value': string;
|
|
97
|
+
'sign out chooser title': string;
|
|
98
|
+
'sign out chooser message': string;
|
|
99
|
+
'join new identity label': string;
|
|
100
|
+
'reset device label': string;
|
|
101
|
+
'reset device confirm message': string;
|
|
96
102
|
};
|
|
97
103
|
//# 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
|
|
1
|
+
{"version":3,"file":"en-US.d.ts","sourceRoot":"","sources":["../../../../../src/translations/locales/en-US.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsGd,CAAC"}
|
|
@@ -71,7 +71,8 @@ exports.os = {
|
|
|
71
71
|
'selecting identity heading': 'Selecting identity',
|
|
72
72
|
'devices heading': 'Devices',
|
|
73
73
|
'identity heading': 'Profile settings',
|
|
74
|
-
'choose
|
|
74
|
+
'choose add device label': 'Add device',
|
|
75
|
+
'choose devices label': 'Manage devices',
|
|
75
76
|
'choose profile label': 'Edit profile',
|
|
76
77
|
'choose sign out label': 'Sign out',
|
|
77
78
|
'empty space members message': 'There is nobody in this space yet.',
|
|
@@ -99,5 +100,10 @@ exports.os = {
|
|
|
99
100
|
'reset identity input label': 'This will clear this device and all associated data. Type {{confirmationValue}} and confirm to continue.',
|
|
100
101
|
'failed to reset identity message': 'Failed to reset identity.',
|
|
101
102
|
'confirmation value': 'CONFIRM',
|
|
103
|
+
'sign out chooser title': 'DANGER ZONE',
|
|
104
|
+
'sign out chooser message': 'Proceeding with either action below will erase all data on this device.',
|
|
105
|
+
'join new identity label': 'Join a new identity',
|
|
106
|
+
'reset device label': 'Reset device',
|
|
107
|
+
'reset device confirm message': 'Are you sure you want to reset your device? All data will be lost.',
|
|
102
108
|
};
|
|
103
109
|
//# sourceMappingURL=en-US.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en-US.js","sourceRoot":"","sources":["../../../../../src/translations/locales/en-US.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;AAEW,QAAA,EAAE,GAAG;IAChB,sBAAsB,EAAE,iBAAiB;IACzC,8BAA8B,EAAE,SAAS;IACzC,eAAe,EAAE,cAAc;IAC/B,4BAA4B,EAAE,UAAU;IACxC,oCAAoC,EAAE,QAAQ;IAC9C,wBAAwB,EAAE,cAAc;IACxC,uBAAuB,EAAE,eAAe;IACxC,oBAAoB,EAAE,w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,cAAc;IACtC,uBAAuB,EAAE,UAAU;IACnC,6BAA6B,EAAE,oCAAoC;IACnE,+BAA+B,EAAE,yBAAyB;IAC1D,oBAAoB,EAAE,YAAY;IAClC,yBAAyB,EAAE,aAAa;IACxC,gCAAgC,EAAE,4BAA4B;IAC9D,+BAA+B,EAAE,qBAAqB;IACtD,qBAAqB,EAAE,SAAS;IAChC,2BAA2B,EAAE,SAAS;IACtC,qBAAqB,EAAE,kBAAkB;IACzC,mBAAmB,EAAE,sDAAsD;IAC3E,0BAA0B,EAAE,cAAc;IAC1C,gCAAgC,EAAE,sBAAsB;IACxD,kBAAkB,EAAE,YAAY;IAChC,wBAAwB,EAAE,yBAAyB;IACnD,qBAAqB,EAAE,YAAY;IACnC,4BAA4B,EAAE,8BAA8B;IAC5D,mBAAmB,EAAE,aAAa;IAClC,yBAAyB,EAAE,gCAAgC;IAC3D,sBAAsB,EAAE,cAAc;IACtC,6BAA6B,EAAE,gCAAgC;IAC/D,sBAAsB,EAAE,kCAAkC;IAC1D,eAAe,EAAE,SAAS;IAC1B,4BAA4B,EAC1B,0GAA0G;IAC5G,kCAAkC,EAAE,2BAA2B;IAC/D,oBAAoB,EAAE,SAAS;IAC/B,wBAAwB,EAAE,aAAa;IACvC,0BAA0B,EAAE,yEAAyE;IACrG,yBAAyB,EAAE,qBAAqB;IAChD,oBAAoB,EAAE,cAAc;IACpC,8BAA8B,EAAE,oEAAoE;CACrG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/shell",
|
|
3
|
-
"version": "0.3.11-main.
|
|
3
|
+
"version": "0.3.11-main.ec7a2b3",
|
|
4
4
|
"description": "DXOS’s OS experiences",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -39,18 +39,19 @@
|
|
|
39
39
|
"react-qr-rounded": "^1.0.0",
|
|
40
40
|
"url-join": "^5.0.0",
|
|
41
41
|
"xstate": "^4.37.0",
|
|
42
|
-
"@dxos/
|
|
43
|
-
"@dxos/
|
|
44
|
-
"@dxos/
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/display-name": "0.3.11-main.
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/react-
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/react-ui-theme": "0.3.11-main.
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
42
|
+
"@dxos/async": "0.3.11-main.ec7a2b3",
|
|
43
|
+
"@dxos/client-protocol": "0.3.11-main.ec7a2b3",
|
|
44
|
+
"@dxos/client-services": "0.3.11-main.ec7a2b3",
|
|
45
|
+
"@dxos/debug": "0.3.11-main.ec7a2b3",
|
|
46
|
+
"@dxos/display-name": "0.3.11-main.ec7a2b3",
|
|
47
|
+
"@dxos/invariant": "0.3.11-main.ec7a2b3",
|
|
48
|
+
"@dxos/log": "0.3.11-main.ec7a2b3",
|
|
49
|
+
"@dxos/react-client": "0.3.11-main.ec7a2b3",
|
|
50
|
+
"@dxos/react-ui": "0.3.11-main.ec7a2b3",
|
|
51
|
+
"@dxos/react-ui-theme": "0.3.11-main.ec7a2b3",
|
|
52
|
+
"@dxos/react-ui-types": "0.3.11-main.ec7a2b3",
|
|
53
|
+
"@dxos/util": "0.3.11-main.ec7a2b3",
|
|
54
|
+
"@dxos/rpc-tunnel": "0.3.11-main.ec7a2b3"
|
|
54
55
|
},
|
|
55
56
|
"devDependencies": {
|
|
56
57
|
"@faker-js/faker": "^8.0.2",
|
|
@@ -63,10 +64,10 @@
|
|
|
63
64
|
"react-dom": "^18.2.0",
|
|
64
65
|
"vite": "^4.3.9",
|
|
65
66
|
"vite-plugin-turbosnap": "^1.0.2",
|
|
66
|
-
"@dxos/config": "0.3.11-main.
|
|
67
|
-
"@dxos/react-async": "0.3.11-main.
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
67
|
+
"@dxos/config": "0.3.11-main.ec7a2b3",
|
|
68
|
+
"@dxos/react-async": "0.3.11-main.ec7a2b3",
|
|
69
|
+
"@dxos/react-ui-theme": "0.3.11-main.ec7a2b3",
|
|
70
|
+
"@dxos/storybook-utils": "0.3.11-main.ec7a2b3"
|
|
70
71
|
},
|
|
71
72
|
"peerDependencies": {
|
|
72
73
|
"@phosphor-icons/react": "^2.0.5",
|
|
@@ -22,11 +22,13 @@ export const DeviceList = ({ devices, onSelect }: DeviceListProps) => {
|
|
|
22
22
|
{devices.map((device) => {
|
|
23
23
|
const identity = {
|
|
24
24
|
identityKey: device.deviceKey,
|
|
25
|
-
profile:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
25
|
+
profile: device.profile
|
|
26
|
+
? {
|
|
27
|
+
displayName: `${device.profile?.platform} (${device.profile?.platformVersion}) on ${
|
|
28
|
+
device.profile?.os
|
|
29
|
+
} (${device.profile?.osVersion}) ${device.profile?.architecture ?? 'Unknown'}-bit`,
|
|
30
|
+
}
|
|
31
|
+
: undefined,
|
|
30
32
|
};
|
|
31
33
|
return (
|
|
32
34
|
<IdentityListItem
|
|
@@ -132,7 +132,7 @@ export const Action = forwardRef<HTMLButtonElement, LargeButtonProps>((props, fo
|
|
|
132
132
|
return (
|
|
133
133
|
<Button
|
|
134
134
|
{...rest}
|
|
135
|
-
classNames={[isFull && 'is-full', 'bs-11 flex gap-2 mbs-2',
|
|
135
|
+
classNames={[isFull && 'is-full', 'bs-11 flex gap-2 mbs-2', ...buttonColorFragment(props), classNames]}
|
|
136
136
|
ref={forwardedRef}
|
|
137
137
|
variant={variant}
|
|
138
138
|
>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import React, { useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { log } from '@dxos/log';
|
|
8
|
-
import { type LayoutRequest, ShellDisplay, ShellLayout, type ShellRuntime } from '@dxos/react-client';
|
|
8
|
+
import { type LayoutRequest, ShellDisplay, ShellLayout, type ShellRuntime, useClient } from '@dxos/react-client';
|
|
9
9
|
import { useSpace } from '@dxos/react-client/echo';
|
|
10
10
|
|
|
11
11
|
import { IdentityDialog } from '../IdentityDialog';
|
|
@@ -13,12 +13,14 @@ import { JoinDialog } from '../JoinDialog';
|
|
|
13
13
|
import { SpaceDialog } from '../SpaceDialog';
|
|
14
14
|
|
|
15
15
|
export const Shell = ({ runtime, origin }: { runtime: ShellRuntime; origin: string }) => {
|
|
16
|
-
const [{ layout, invitationCode, spaceKey }, setLayout] = useState<LayoutRequest>({
|
|
16
|
+
const [{ layout, invitationCode, spaceKey, target }, setLayout] = useState<LayoutRequest>({
|
|
17
17
|
layout: runtime.layout,
|
|
18
18
|
invitationCode: runtime.invitationCode,
|
|
19
19
|
spaceKey: runtime.spaceKey,
|
|
20
|
+
target: runtime.target,
|
|
20
21
|
});
|
|
21
22
|
|
|
23
|
+
const client = useClient();
|
|
22
24
|
const space = useSpace(spaceKey);
|
|
23
25
|
|
|
24
26
|
useEffect(() => {
|
|
@@ -58,6 +60,11 @@ export const Shell = ({ runtime, origin }: { runtime: ShellRuntime; origin: stri
|
|
|
58
60
|
return (
|
|
59
61
|
<IdentityDialog
|
|
60
62
|
createInvitationUrl={(invitationCode) => `${origin}?deviceInvitationCode=${invitationCode}`}
|
|
63
|
+
onResetDevice={async () => {
|
|
64
|
+
await client.reset();
|
|
65
|
+
await runtime.setAppContext({ display: ShellDisplay.NONE, reload: true });
|
|
66
|
+
}}
|
|
67
|
+
onJoinNewIdentity={() => runtime.setLayout({ layout: ShellLayout.INITIALIZE_IDENTITY })}
|
|
61
68
|
onDone={async () => {
|
|
62
69
|
await runtime.setAppContext({ display: ShellDisplay.NONE });
|
|
63
70
|
runtime.setLayout({ layout: ShellLayout.DEFAULT });
|
|
@@ -69,6 +76,7 @@ export const Shell = ({ runtime, origin }: { runtime: ShellRuntime; origin: stri
|
|
|
69
76
|
return space ? (
|
|
70
77
|
<SpaceDialog
|
|
71
78
|
space={space}
|
|
79
|
+
target={target}
|
|
72
80
|
createInvitationUrl={(invitationCode) => `${origin}?spaceInvitationCode=${invitationCode}`}
|
|
73
81
|
onDone={async () => {
|
|
74
82
|
await runtime.setAppContext({ display: ShellDisplay.NONE });
|
|
@@ -82,7 +90,12 @@ export const Shell = ({ runtime, origin }: { runtime: ShellRuntime; origin: stri
|
|
|
82
90
|
<JoinDialog
|
|
83
91
|
initialInvitationCode={invitationCode}
|
|
84
92
|
onDone={async (result) => {
|
|
85
|
-
|
|
93
|
+
const target = result?.target ?? undefined;
|
|
94
|
+
await runtime.setAppContext({
|
|
95
|
+
display: ShellDisplay.NONE,
|
|
96
|
+
spaceKey: result?.spaceKey ?? undefined,
|
|
97
|
+
target,
|
|
98
|
+
});
|
|
86
99
|
runtime.setLayout({ layout: ShellLayout.DEFAULT });
|
|
87
100
|
}}
|
|
88
101
|
onExit={async () => {
|
|
@@ -8,6 +8,7 @@ import { faker } from '@faker-js/faker';
|
|
|
8
8
|
import React from 'react';
|
|
9
9
|
|
|
10
10
|
import { PublicKey } from '@dxos/react-client';
|
|
11
|
+
import { DeviceKind } from '@dxos/react-client/halo';
|
|
11
12
|
import { Invitation } from '@dxos/react-client/invitations';
|
|
12
13
|
import { withTheme } from '@dxos/storybook-utils';
|
|
13
14
|
|
|
@@ -16,6 +17,7 @@ import type { IdentityPanelImplProps } from './IdentityPanelProps';
|
|
|
16
17
|
import { IdentityActionChooserImpl } from './steps';
|
|
17
18
|
import { StorybookDialog } from '../../components/StorybookDialog';
|
|
18
19
|
import { InvitationManager, type InvitationManagerProps } from '../../steps';
|
|
20
|
+
import { osTranslations } from '../../translations';
|
|
19
21
|
|
|
20
22
|
faker.seed(1234);
|
|
21
23
|
|
|
@@ -30,12 +32,13 @@ const noOpProps: IdentityPanelImplProps = {
|
|
|
30
32
|
displayName: faker.person.firstName(),
|
|
31
33
|
},
|
|
32
34
|
},
|
|
35
|
+
devices: [],
|
|
33
36
|
};
|
|
34
37
|
|
|
35
38
|
export default {
|
|
36
|
-
title: '
|
|
39
|
+
title: 'react-shell/IdentityPanel',
|
|
37
40
|
decorators: [withTheme],
|
|
38
|
-
parameters: { chromatic: { disableSnapshot: false } },
|
|
41
|
+
parameters: { translations: [osTranslations], chromatic: { disableSnapshot: false } },
|
|
39
42
|
};
|
|
40
43
|
|
|
41
44
|
export const IdentityActionChooser = () => {
|
|
@@ -50,6 +53,45 @@ export const IdentityActionChooser = () => {
|
|
|
50
53
|
);
|
|
51
54
|
};
|
|
52
55
|
|
|
56
|
+
export const UpdateProfileForm = () => {
|
|
57
|
+
return (
|
|
58
|
+
<StorybookDialog inOverlayLayout>
|
|
59
|
+
<IdentityPanelImpl
|
|
60
|
+
{...noOpProps}
|
|
61
|
+
activeView='update profile form'
|
|
62
|
+
IdentityActionChooser={IdentityActionChooserImpl}
|
|
63
|
+
/>
|
|
64
|
+
</StorybookDialog>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const DeviceManager = () => {
|
|
69
|
+
return (
|
|
70
|
+
<StorybookDialog inOverlayLayout>
|
|
71
|
+
<IdentityPanelImpl
|
|
72
|
+
{...{
|
|
73
|
+
...noOpProps,
|
|
74
|
+
devices: [
|
|
75
|
+
{ deviceKey: PublicKey.random(), kind: DeviceKind.CURRENT },
|
|
76
|
+
{ deviceKey: PublicKey.random(), kind: DeviceKind.TRUSTED },
|
|
77
|
+
{ deviceKey: PublicKey.random(), kind: DeviceKind.TRUSTED },
|
|
78
|
+
],
|
|
79
|
+
}}
|
|
80
|
+
activeView='device manager'
|
|
81
|
+
IdentityActionChooser={IdentityActionChooserImpl}
|
|
82
|
+
/>
|
|
83
|
+
</StorybookDialog>
|
|
84
|
+
);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
export const DeviceManagerEmpty = () => {
|
|
88
|
+
return (
|
|
89
|
+
<StorybookDialog inOverlayLayout>
|
|
90
|
+
<IdentityPanelImpl {...noOpProps} activeView='device manager' IdentityActionChooser={IdentityActionChooserImpl} />
|
|
91
|
+
</StorybookDialog>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
|
|
53
95
|
const DeviceInvitationManagerWithState = (extraProps: InvitationManagerProps) => (
|
|
54
96
|
<StorybookDialog inOverlayLayout>
|
|
55
97
|
<IdentityPanelImpl
|
|
@@ -6,7 +6,7 @@ import React, { useEffect, useMemo } from 'react';
|
|
|
6
6
|
import { generateName } from '@dxos/display-name';
|
|
7
7
|
import { log } from '@dxos/log';
|
|
8
8
|
import { useClient } from '@dxos/react-client';
|
|
9
|
-
import { type Identity, useIdentity } from '@dxos/react-client/halo';
|
|
9
|
+
import { type Identity, useIdentity, useDevices } from '@dxos/react-client/halo';
|
|
10
10
|
import { useInvitationStatus } from '@dxos/react-client/invitations';
|
|
11
11
|
import type { CancellableInvitationObservable } from '@dxos/react-client/invitations';
|
|
12
12
|
import { Avatar, DensityProvider, useId, useJdenticonHref, useTranslation } from '@dxos/react-ui';
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
type IdentityPanelProps,
|
|
18
18
|
} from './IdentityPanelProps';
|
|
19
19
|
import { useIdentityMachine } from './identityMachine';
|
|
20
|
-
import { IdentityActionChooser, ProfileForm } from './steps';
|
|
20
|
+
import { AgentForm, DeviceManager, IdentityActionChooser, ProfileForm, SignOutChooser } from './steps';
|
|
21
21
|
import { Viewport, Heading, CloseButton } from '../../components';
|
|
22
22
|
import { InvitationManager } from '../../steps';
|
|
23
23
|
|
|
@@ -45,6 +45,8 @@ export const IdentityPanelImpl = (props: IdentityPanelImplProps) => {
|
|
|
45
45
|
titleId,
|
|
46
46
|
activeView,
|
|
47
47
|
onUpdateProfile,
|
|
48
|
+
onResetDevice,
|
|
49
|
+
onJoinNewIdentity,
|
|
48
50
|
IdentityActionChooser: IdentityActionChooserComponent = IdentityActionChooser,
|
|
49
51
|
InvitationManager: InvitationManagerComponent = InvitationManager,
|
|
50
52
|
onDone,
|
|
@@ -53,13 +55,15 @@ export const IdentityPanelImpl = (props: IdentityPanelImplProps) => {
|
|
|
53
55
|
const { t } = useTranslation('os');
|
|
54
56
|
const title = useMemo(() => {
|
|
55
57
|
switch (activeView) {
|
|
56
|
-
case '
|
|
58
|
+
case 'agent manager':
|
|
59
|
+
return 'Manage Agent';
|
|
57
60
|
case 'device invitation manager':
|
|
58
|
-
return t('choose
|
|
61
|
+
return t('choose add device label');
|
|
59
62
|
default:
|
|
60
63
|
return t('identity heading');
|
|
61
64
|
}
|
|
62
65
|
}, [activeView, t]);
|
|
66
|
+
|
|
63
67
|
return (
|
|
64
68
|
<DensityProvider density='fine'>
|
|
65
69
|
<IdentityHeading {...{ identity, titleId, title, onDone }} />
|
|
@@ -75,6 +79,9 @@ export const IdentityPanelImpl = (props: IdentityPanelImplProps) => {
|
|
|
75
79
|
invitationUrl={rest.createInvitationUrl(rest.invitationCode!)}
|
|
76
80
|
/>
|
|
77
81
|
</Viewport.View>
|
|
82
|
+
<Viewport.View id='device manager' classNames={viewStyles}>
|
|
83
|
+
<DeviceManager active={activeView === 'device manager'} {...rest} />
|
|
84
|
+
</Viewport.View>
|
|
78
85
|
<Viewport.View classNames={viewStyles} id='update profile form'>
|
|
79
86
|
<ProfileForm
|
|
80
87
|
send={rest.send}
|
|
@@ -83,7 +90,17 @@ export const IdentityPanelImpl = (props: IdentityPanelImplProps) => {
|
|
|
83
90
|
onUpdateProfile={onUpdateProfile}
|
|
84
91
|
/>
|
|
85
92
|
</Viewport.View>
|
|
86
|
-
|
|
93
|
+
<Viewport.View classNames={viewStyles} id='signing out'>
|
|
94
|
+
<SignOutChooser
|
|
95
|
+
send={rest.send}
|
|
96
|
+
active={activeView === 'signing out'}
|
|
97
|
+
onResetDevice={onResetDevice}
|
|
98
|
+
onJoinNewIdentity={onJoinNewIdentity}
|
|
99
|
+
/>
|
|
100
|
+
</Viewport.View>
|
|
101
|
+
<Viewport.View classNames={viewStyles} id='agent manager'>
|
|
102
|
+
<AgentForm send={rest.send} active={activeView === 'agent manager'} identity={identity} />
|
|
103
|
+
</Viewport.View>
|
|
87
104
|
</Viewport.Views>
|
|
88
105
|
</Viewport.Root>
|
|
89
106
|
</DensityProvider>
|
|
@@ -105,6 +122,7 @@ export const IdentityPanel = ({
|
|
|
105
122
|
}: IdentityPanelProps) => {
|
|
106
123
|
const titleId = useId('identityPanel__heading', propsTitleId);
|
|
107
124
|
const client = useClient();
|
|
125
|
+
const devices = useDevices();
|
|
108
126
|
const identity = useIdentity();
|
|
109
127
|
if (!identity) {
|
|
110
128
|
console.error('IdentityPanel rendered with no active identity.');
|
|
@@ -126,10 +144,14 @@ export const IdentityPanel = ({
|
|
|
126
144
|
return 'identity action chooser';
|
|
127
145
|
case identityState.matches('managingDeviceInvitation'):
|
|
128
146
|
return 'device invitation manager';
|
|
147
|
+
case identityState.matches('managingDevices'):
|
|
148
|
+
return 'device manager';
|
|
129
149
|
case [{ managingProfile: 'idle' }, { managingProfile: 'pending' }].some(identityState.matches):
|
|
130
150
|
return 'update profile form';
|
|
131
|
-
|
|
132
|
-
|
|
151
|
+
case identityState.matches('signingOut'):
|
|
152
|
+
return 'signing out';
|
|
153
|
+
case [{ managingAgent: 'idle' }, { managingAgent: 'pending' }].some(identityState.matches):
|
|
154
|
+
return 'agent manager';
|
|
133
155
|
default:
|
|
134
156
|
return 'identity action chooser';
|
|
135
157
|
}
|
|
@@ -143,6 +165,7 @@ export const IdentityPanel = ({
|
|
|
143
165
|
const implProps = {
|
|
144
166
|
...props,
|
|
145
167
|
identity,
|
|
168
|
+
devices,
|
|
146
169
|
activeView,
|
|
147
170
|
send: identitySend,
|
|
148
171
|
titleId,
|
|
@@ -2,20 +2,29 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import type { cloneElement } from 'react';
|
|
6
|
+
import type { Event, SingleOrArray } from 'xstate';
|
|
7
7
|
|
|
8
|
-
import type { Identity } from '@dxos/react-client/halo';
|
|
9
|
-
import {
|
|
8
|
+
import type { Device, Identity } from '@dxos/react-client/halo';
|
|
9
|
+
import type { InvitationStatus } from '@dxos/react-client/invitations';
|
|
10
10
|
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import type { IdentityEvent } from './identityMachine';
|
|
12
|
+
import type { InvitationManagerProps } from '../../steps';
|
|
13
13
|
|
|
14
14
|
export type IdentityPanelImplProps = {
|
|
15
15
|
titleId: string;
|
|
16
|
-
activeView:
|
|
16
|
+
activeView:
|
|
17
|
+
| 'device manager'
|
|
18
|
+
| 'agent manager'
|
|
19
|
+
| 'update profile form'
|
|
20
|
+
| 'device invitation manager'
|
|
21
|
+
| 'identity action chooser'
|
|
22
|
+
| 'signing out';
|
|
17
23
|
identity: Identity;
|
|
24
|
+
devices: Device[];
|
|
18
25
|
onUpdateProfile?: (profile: NonNullable<Identity['profile']>) => Promise<void>;
|
|
26
|
+
onResetDevice?: () => Promise<void>;
|
|
27
|
+
onJoinNewIdentity?: () => void;
|
|
19
28
|
createInvitationUrl: (invitationCode: string) => string;
|
|
20
29
|
send?: (event: SingleOrArray<Event<IdentityEvent>>) => void;
|
|
21
30
|
onDone?: () => void;
|
|
@@ -19,7 +19,7 @@ type IdentityMachineContext = {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
type IdentityChooseActionEvent = {
|
|
22
|
-
type: 'chooseDevices' | 'chooseProfile' |
|
|
22
|
+
type: 'chooseDevices' | 'chooseAgent' | 'chooseProfile' | 'chooseSignOut' | 'sigingOut' | 'unchooseAction';
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
type IdentitySelectDeviceInvitationEvent = {
|
|
@@ -58,6 +58,14 @@ const identityMachine = createMachine<IdentityMachineContext, IdentityEvent>(
|
|
|
58
58
|
states: {
|
|
59
59
|
choosingAction: {},
|
|
60
60
|
managingDeviceInvitation: {},
|
|
61
|
+
managingAgent: {
|
|
62
|
+
initial: 'idle',
|
|
63
|
+
states: {
|
|
64
|
+
idle: {},
|
|
65
|
+
pending: {},
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
managingDevices: {},
|
|
61
69
|
managingProfile: {
|
|
62
70
|
initial: 'idle',
|
|
63
71
|
states: {
|
|
@@ -69,15 +77,16 @@ const identityMachine = createMachine<IdentityMachineContext, IdentityEvent>(
|
|
|
69
77
|
updateProfile: { target: '.pending', actions: 'log' },
|
|
70
78
|
},
|
|
71
79
|
},
|
|
72
|
-
|
|
80
|
+
signingOut: {},
|
|
73
81
|
},
|
|
74
82
|
on: {
|
|
75
83
|
unchooseAction: { target: '.choosingAction', actions: ['unsetInvitation', 'log'] },
|
|
76
|
-
chooseDevices: { target: '.managingDeviceInvitation', actions: ['unsetInvitation', 'log'] },
|
|
77
84
|
deselectInvitation: { target: '.choosingAction', actions: ['unsetInvitation', 'log'] },
|
|
78
85
|
selectInvitation: { target: '.managingDeviceInvitation', actions: ['setInvitation', 'log'] },
|
|
86
|
+
chooseDevices: { target: '.managingDevices', actions: 'log' },
|
|
79
87
|
chooseProfile: { target: '.managingProfile', actions: 'log' },
|
|
80
|
-
|
|
88
|
+
chooseSignOut: { target: '.signingOut', actions: 'log' },
|
|
89
|
+
chooseAgent: { target: '.managingAgent', actions: 'log' },
|
|
81
90
|
},
|
|
82
91
|
},
|
|
83
92
|
{
|