@dxos/shell 0.4.10-main.c32f430 → 0.4.10-main.ccba876
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/index-DY0hiAob.mjs +94 -0
- package/dist/bundle/index-DY0hiAob.mjs.map +1 -0
- package/dist/bundle/index-_bedgWKd.mjs +96604 -0
- package/dist/bundle/index-_bedgWKd.mjs.map +1 -0
- package/dist/bundle/shell.mjs +10 -81037
- package/dist/bundle/shell.mjs.map +1 -1
- package/dist/bundle/shell.umd.js +156 -88
- package/dist/bundle/shell.umd.js.map +1 -1
- package/dist/bundle/style.css +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react.mjs +1162 -1039
- package/dist/lib/browser/react.mjs.map +4 -4
- package/dist/lib/browser/testing/index.mjs +8 -8
- package/dist/lib/browser/testing/index.mjs.map +3 -3
- package/dist/types/src/components/AgentConfig.d.ts +3 -0
- package/dist/types/src/components/AgentConfig.d.ts.map +1 -0
- package/dist/types/src/components/AgentConfig.js +37 -0
- package/dist/types/src/components/AgentConfig.js.map +1 -0
- package/dist/types/src/components/DeviceList/DeviceList.d.ts +3 -0
- package/dist/types/src/components/DeviceList/DeviceList.d.ts.map +1 -0
- package/dist/types/src/components/DeviceList/DeviceList.js +29 -0
- package/dist/types/src/components/DeviceList/DeviceList.js.map +1 -0
- package/dist/types/src/components/DeviceList/DeviceListItem.d.ts +6 -0
- package/dist/types/src/components/DeviceList/DeviceListItem.d.ts.map +1 -0
- package/dist/types/src/components/DeviceList/DeviceListItem.js +72 -0
- package/dist/types/src/components/DeviceList/DeviceListItem.js.map +1 -0
- package/dist/types/src/components/DeviceList/DeviceListProps.d.ts +27 -0
- package/dist/types/src/components/DeviceList/DeviceListProps.d.ts.map +1 -0
- package/dist/types/src/components/DeviceList/DeviceListProps.js +6 -0
- package/dist/types/src/components/DeviceList/DeviceListProps.js.map +1 -0
- package/dist/types/src/components/DeviceList/index.d.ts +3 -0
- package/dist/types/src/components/DeviceList/index.d.ts.map +1 -0
- package/dist/types/src/components/DeviceList/index.js +22 -0
- package/dist/types/src/components/DeviceList/index.js.map +1 -0
- package/dist/types/src/components/EmojiPicker.d.ts +9 -2
- package/dist/types/src/components/EmojiPicker.d.ts.map +1 -1
- package/dist/types/src/components/EmojiPicker.js +57 -3
- package/dist/types/src/components/EmojiPicker.js.map +1 -1
- package/dist/types/src/components/HuePicker.d.ts +9 -2
- package/dist/types/src/components/HuePicker.d.ts.map +1 -1
- package/dist/types/src/components/HuePicker.js +75 -6
- package/dist/types/src/components/HuePicker.js.map +1 -1
- package/dist/types/src/components/IdentityList/index.d.ts +0 -1
- package/dist/types/src/components/IdentityList/index.d.ts.map +1 -1
- package/dist/types/src/components/IdentityList/index.js +0 -1
- package/dist/types/src/components/IdentityList/index.js.map +1 -1
- package/dist/types/src/components/InvitationList/InvitationListItem.js +5 -5
- package/dist/types/src/components/InvitationList/InvitationListItem.js.map +1 -1
- package/dist/types/src/components/Panel/Action.d.ts +2 -2
- package/dist/types/src/components/Viewport/Viewport.d.ts +1 -1
- package/dist/types/src/components/index.d.ts +2 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/index.js +2 -0
- package/dist/types/src/components/index.js.map +1 -1
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.js +1 -1
- package/dist/types/src/composites/IdentityDialog/IdentityDialog.js.map +1 -1
- package/dist/types/src/composites/Shell/Shell.d.ts.map +1 -1
- package/dist/types/src/composites/Shell/Shell.js +14 -6
- package/dist/types/src/composites/Shell/Shell.js.map +1 -1
- package/dist/types/src/composites/StatusDialog/StatusDialog.d.ts +2 -0
- package/dist/types/src/composites/StatusDialog/StatusDialog.d.ts.map +1 -0
- package/dist/types/src/composites/StatusDialog/StatusDialog.js +22 -0
- package/dist/types/src/composites/StatusDialog/StatusDialog.js.map +1 -0
- package/dist/types/src/composites/StatusDialog/index.d.ts +2 -0
- package/dist/types/src/composites/StatusDialog/index.d.ts.map +1 -0
- package/dist/types/src/composites/StatusDialog/index.js +21 -0
- package/dist/types/src/composites/StatusDialog/index.js.map +1 -0
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +89 -42
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.d.ts +0 -3
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js +1 -43
- package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts +11 -12
- package/dist/types/src/panels/IdentityPanel/IdentityPanelProps.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.d.ts +3 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/identityMachine.js +13 -24
- package/dist/types/src/panels/IdentityPanel/identityMachine.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts +4 -4
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js +9 -39
- package/dist/types/src/panels/IdentityPanel/steps/IdentityActionChooser.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.d.ts +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js +2 -2
- package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/index.d.ts +0 -3
- package/dist/types/src/panels/IdentityPanel/steps/index.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/steps/index.js +0 -3
- package/dist/types/src/panels/IdentityPanel/steps/index.js.map +1 -1
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.d.ts.map +1 -1
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js +5 -1
- package/dist/types/src/panels/IdentityPanel/useAgentHandlers.js.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/JoinPanel.js +11 -5
- package/dist/types/src/panels/JoinPanel/JoinPanel.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.d.ts +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.js +2 -1
- package/dist/types/src/panels/JoinPanel/JoinPanel.stories.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts +8 -5
- package/dist/types/src/panels/JoinPanel/JoinPanelProps.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/joinMachine.d.ts +3 -2
- package/dist/types/src/panels/JoinPanel/joinMachine.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/joinMachine.js +7 -0
- package/dist/types/src/panels/JoinPanel/joinMachine.js.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/index.d.ts +0 -1
- package/dist/types/src/panels/JoinPanel/steps/index.d.ts.map +1 -1
- package/dist/types/src/panels/JoinPanel/steps/index.js +0 -1
- package/dist/types/src/panels/JoinPanel/steps/index.js.map +1 -1
- 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/panels/StatusPanel/StatusPanel.d.ts +4 -0
- package/dist/types/src/panels/StatusPanel/StatusPanel.d.ts.map +1 -0
- package/dist/types/src/panels/StatusPanel/StatusPanel.js +19 -0
- package/dist/types/src/panels/StatusPanel/StatusPanel.js.map +1 -0
- package/dist/types/src/panels/StatusPanel/index.d.ts +2 -0
- package/dist/types/src/panels/StatusPanel/index.d.ts.map +1 -0
- package/dist/types/src/panels/StatusPanel/index.js +21 -0
- package/dist/types/src/panels/StatusPanel/index.js.map +1 -0
- package/dist/types/src/panels/index.d.ts +1 -0
- package/dist/types/src/panels/index.d.ts.map +1 -1
- package/dist/types/src/panels/index.js +1 -0
- package/dist/types/src/panels/index.js.map +1 -1
- package/dist/types/src/steps/ConfirmReset.d.ts +16 -0
- package/dist/types/src/steps/ConfirmReset.d.ts.map +1 -0
- package/dist/types/src/steps/ConfirmReset.js +71 -0
- package/dist/types/src/steps/ConfirmReset.js.map +1 -0
- package/dist/types/src/steps/InvitationManager.d.ts +1 -1
- package/dist/types/src/steps/InvitationManager.d.ts.map +1 -1
- package/dist/types/src/steps/InvitationManager.js +3 -4
- package/dist/types/src/steps/InvitationManager.js.map +1 -1
- package/dist/types/src/steps/StepProps.d.ts +4 -1
- package/dist/types/src/steps/StepProps.d.ts.map +1 -1
- package/dist/types/src/steps/index.d.ts +1 -0
- package/dist/types/src/steps/index.d.ts.map +1 -1
- package/dist/types/src/steps/index.js +1 -0
- package/dist/types/src/steps/index.js.map +1 -1
- package/dist/types/src/testing/shell-manager.d.ts.map +1 -1
- package/dist/types/src/testing/shell-manager.js +8 -8
- package/dist/types/src/testing/shell-manager.js.map +1 -1
- package/dist/types/src/translations/locales/en-US.d.ts +16 -3
- package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
- package/dist/types/src/translations/locales/en-US.js +20 -7
- package/dist/types/src/translations/locales/en-US.js.map +1 -1
- package/dist/types/src/types/index.js +1 -0
- package/dist/types/src/types/index.js.map +1 -1
- package/package.json +21 -20
- package/src/components/AgentConfig.tsx +66 -0
- package/src/components/DeviceList/DeviceList.tsx +54 -0
- package/src/components/DeviceList/DeviceListItem.tsx +120 -0
- package/src/components/DeviceList/DeviceListProps.ts +33 -0
- package/src/components/DeviceList/index.ts +6 -0
- package/src/components/EmojiPicker.tsx +101 -4
- package/src/components/HuePicker.tsx +99 -5
- package/src/components/IdentityList/index.ts +0 -1
- package/src/components/InvitationList/InvitationListItem.tsx +5 -5
- package/src/components/index.ts +2 -0
- package/src/composites/IdentityDialog/IdentityDialog.tsx +1 -1
- package/src/composites/Shell/Shell.tsx +17 -5
- package/src/composites/StatusDialog/StatusDialog.tsx +24 -0
- package/src/composites/StatusDialog/index.ts +5 -0
- package/src/panels/IdentityPanel/IdentityPanel.stories.tsx +0 -63
- package/src/panels/IdentityPanel/IdentityPanel.tsx +149 -43
- package/src/panels/IdentityPanel/IdentityPanelProps.ts +15 -15
- package/src/panels/IdentityPanel/identityMachine.ts +17 -25
- package/src/panels/IdentityPanel/steps/IdentityActionChooser.tsx +23 -67
- package/src/panels/IdentityPanel/steps/ProfileForm.tsx +12 -4
- package/src/panels/IdentityPanel/steps/index.ts +0 -3
- package/src/panels/IdentityPanel/useAgentHandlers.ts +5 -1
- package/src/panels/JoinPanel/JoinPanel.stories.tsx +3 -2
- package/src/panels/JoinPanel/JoinPanel.tsx +21 -9
- package/src/panels/JoinPanel/JoinPanelProps.ts +9 -5
- package/src/panels/JoinPanel/joinMachine.ts +12 -2
- package/src/panels/JoinPanel/steps/index.ts +0 -1
- package/src/panels/SpacePanel/steps/SpaceManager.tsx +3 -1
- package/src/panels/StatusPanel/StatusPanel.tsx +19 -0
- package/src/panels/StatusPanel/index.ts +5 -0
- package/src/panels/index.ts +1 -0
- package/src/steps/ConfirmReset.tsx +112 -0
- package/src/steps/InvitationManager.tsx +4 -4
- package/src/steps/StepProps.ts +2 -1
- package/src/steps/index.ts +1 -0
- package/src/testing/shell-manager.ts +8 -8
- package/src/translations/locales/en-US.ts +22 -7
- package/src/types/index.ts +2 -0
- package/dist/types/src/components/IdentityList/DeviceList.d.ts +0 -7
- package/dist/types/src/components/IdentityList/DeviceList.d.ts.map +0 -1
- package/dist/types/src/components/IdentityList/DeviceList.js +0 -34
- package/dist/types/src/components/IdentityList/DeviceList.js.map +0 -1
- package/dist/types/src/panels/IdentityPanel/steps/AgentForm.d.ts +0 -3
- package/dist/types/src/panels/IdentityPanel/steps/AgentForm.d.ts.map +0 -1
- package/dist/types/src/panels/IdentityPanel/steps/AgentForm.js +0 -26
- package/dist/types/src/panels/IdentityPanel/steps/AgentForm.js.map +0 -1
- package/dist/types/src/panels/IdentityPanel/steps/DeviceManager.d.ts +0 -10
- package/dist/types/src/panels/IdentityPanel/steps/DeviceManager.d.ts.map +0 -1
- package/dist/types/src/panels/IdentityPanel/steps/DeviceManager.js +0 -23
- package/dist/types/src/panels/IdentityPanel/steps/DeviceManager.js.map +0 -1
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.d.ts +0 -16
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.d.ts.map +0 -1
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.js +0 -40
- package/dist/types/src/panels/IdentityPanel/steps/SignOutChooser.js.map +0 -1
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.d.ts +0 -15
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.d.ts.map +0 -1
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.js +0 -67
- package/dist/types/src/panels/JoinPanel/steps/ResetIdentity.js.map +0 -1
- package/src/components/IdentityList/DeviceList.tsx +0 -49
- package/src/panels/IdentityPanel/steps/AgentForm.tsx +0 -61
- package/src/panels/IdentityPanel/steps/DeviceManager.tsx +0 -41
- package/src/panels/IdentityPanel/steps/SignOutChooser.tsx +0 -77
- package/src/panels/JoinPanel/steps/ResetIdentity.tsx +0 -92
|
@@ -47,8 +47,6 @@ exports.os = {
|
|
|
47
47
|
'connected status label': 'Enter confirmation PIN',
|
|
48
48
|
'authenticating status label': 'Enter confirmation PIN',
|
|
49
49
|
'success status label': 'Success',
|
|
50
|
-
'connect label': 'Connect',
|
|
51
|
-
'reconnect label': 'Reconnect',
|
|
52
50
|
'cancel label': 'Cancel',
|
|
53
51
|
'done label': 'Done',
|
|
54
52
|
'reset label': 'Start over',
|
|
@@ -75,7 +73,8 @@ exports.os = {
|
|
|
75
73
|
'choose add device label': 'Add device',
|
|
76
74
|
'choose devices label': 'Manage devices',
|
|
77
75
|
'choose profile label': 'Edit profile',
|
|
78
|
-
'choose sign out label': '
|
|
76
|
+
'choose sign out label': 'Reset storage',
|
|
77
|
+
'choose join new identity label': 'Join existing device',
|
|
79
78
|
'empty space members message': 'There is nobody in this space yet.',
|
|
80
79
|
'back to all invitations label': 'Back to all invitations',
|
|
81
80
|
'invitation heading': 'Invitation',
|
|
@@ -99,18 +98,20 @@ exports.os = {
|
|
|
99
98
|
'invite options label': 'Change the active invite option.',
|
|
100
99
|
'reset in progress label': 'Resetting...',
|
|
101
100
|
'confirm label': 'Confirm',
|
|
102
|
-
'reset
|
|
101
|
+
'reset storage input label': 'This will clear this device and all associated data. Type {{confirmationValue}} and confirm to continue.',
|
|
102
|
+
'join new identity input label': 'In order to join an existing device, storage on this device must be cleared first. Type {{confirmationValue}} to continue.',
|
|
103
103
|
'failed to reset identity message': 'Failed to reset identity.',
|
|
104
104
|
'confirmation value': 'CONFIRM',
|
|
105
|
-
'sign out chooser title': '
|
|
106
|
-
'sign out chooser message': 'Proceeding with
|
|
105
|
+
'sign out chooser title': 'Danger zone',
|
|
106
|
+
'sign out chooser message': 'Proceeding with the action below will erase all data on this device.',
|
|
107
107
|
'join new identity label': 'Join a new identity',
|
|
108
|
-
'reset device label': 'Reset
|
|
108
|
+
'reset device label': 'Reset storage',
|
|
109
109
|
'reset device confirm message': 'Are you sure you want to reset your device? All data will be lost.',
|
|
110
110
|
'emoji and color label': 'Emoji and color',
|
|
111
111
|
'clear label': 'Use default',
|
|
112
112
|
'select emoji label': 'Choose an emoji to use in your avatar',
|
|
113
113
|
'select hue label': 'Choose a hue to use in your avatar',
|
|
114
|
+
'resetting message': 'One moment while things are reset…',
|
|
114
115
|
'red label': 'Red',
|
|
115
116
|
'orange label': 'Orange',
|
|
116
117
|
'amber label': 'Amber',
|
|
@@ -128,5 +129,17 @@ exports.os = {
|
|
|
128
129
|
'fuchsia label': 'Fuchsia',
|
|
129
130
|
'pink label': 'Pink',
|
|
130
131
|
'rose label': 'Rose',
|
|
132
|
+
'current device tag label': 'This device',
|
|
133
|
+
'device name placeholder': '{{platform}} on {{os}}',
|
|
134
|
+
'more options label': 'More options',
|
|
135
|
+
'disconnect label': 'Currently online. Click to go offline.',
|
|
136
|
+
'connect label': 'Currently offline. Click to go online.',
|
|
137
|
+
'edit device label': 'Edit device name & avatar',
|
|
138
|
+
'agent heading': 'Agent',
|
|
139
|
+
'agent message title': 'About creating an agent',
|
|
140
|
+
'agent message body': 'Creating an agent helps keep your devices and peers in-sync. An agent is like any other device, but since it’s always online your changes will sync even when all your physical devices are asleep.',
|
|
141
|
+
'create agent label': 'Start an agent',
|
|
142
|
+
'destroy agent label': 'Shut down agent',
|
|
143
|
+
'agent device label': 'Your agent',
|
|
131
144
|
};
|
|
132
145
|
//# 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,oBAAoB,EAAE,QAAQ;IAC9B,4BAA4B,EAAE,iBAAiB;IAC/C,wBAAwB,EAAE,cAAc;IACxC,uBAAuB,EAAE,eAAe;IACxC,oBAAoB,EAAE,wBAAwB;IAC9C,cAAc,EAAE,4BAA4B;IAC5C,YAAY,EAAE,MAAM;IACpB,yBAA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,EAAE,2BAA2B;IAC/D,oBAAoB,EAAE,SAAS;IAC/B,wBAAwB,EAAE,aAAa;IACvC,0BAA0B,EAAE,sEAAsE;IAClG,yBAAyB,EAAE,qBAAqB;IAChD,oBAAoB,EAAE,eAAe;IACrC,8BAA8B,EAAE,oEAAoE;IACpG,uBAAuB,EAAE,iBAAiB;IAC1C,aAAa,EAAE,aAAa;IAC5B,oBAAoB,EAAE,uCAAuC;IAC7D,kBAAkB,EAAE,oCAAoC;IACxD,mBAAmB,EAAE,oCAAoC;IACzD,WAAW,EAAE,KAAK;IAClB,cAAc,EAAE,QAAQ;IACxB,aAAa,EAAE,OAAO;IACtB,cAAc,EAAE,QAAQ;IACxB,YAAY,EAAE,MAAM;IACpB,aAAa,EAAE,OAAO;IACtB,eAAe,EAAE,SAAS;IAC1B,YAAY,EAAE,MAAM;IACpB,YAAY,EAAE,MAAM;IACpB,WAAW,EAAE,KAAK;IAClB,YAAY,EAAE,MAAM;IACpB,cAAc,EAAE,QAAQ;IACxB,cAAc,EAAE,QAAQ;IACxB,cAAc,EAAE,QAAQ;IACxB,eAAe,EAAE,SAAS;IAC1B,YAAY,EAAE,MAAM;IACpB,YAAY,EAAE,MAAM;IACpB,0BAA0B,EAAE,aAAa;IACzC,yBAAyB,EAAE,wBAAwB;IACnD,oBAAoB,EAAE,cAAc;IACpC,kBAAkB,EAAE,wCAAwC;IAC5D,eAAe,EAAE,wCAAwC;IACzD,mBAAmB,EAAE,2BAA2B;IAChD,eAAe,EAAE,OAAO;IACxB,qBAAqB,EAAE,yBAAyB;IAChD,oBAAoB,EAClB,qMAAqM;IACvM,oBAAoB,EAAE,gBAAgB;IACtC,qBAAqB,EAAE,iBAAiB;IACxC,oBAAoB,EAAE,YAAY;CACnC,CAAC"}
|
|
@@ -19,4 +19,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
__exportStar(require("./FailReason"), exports);
|
|
21
21
|
__exportStar(require("./IInvitation"), exports);
|
|
22
|
+
// This comment is here to bust NX cache. Remove it after the code changes.
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;AAEF,+CAA6B;AAC7B,gDAA8B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;;;;;;;;;;;AAEF,+CAA6B;AAC7B,gDAA8B;AAE9B,2EAA2E"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/shell",
|
|
3
|
-
"version": "0.4.10-main.
|
|
3
|
+
"version": "0.4.10-main.ccba876",
|
|
4
4
|
"description": "DXOS’s OS experiences",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -42,19 +42,19 @@
|
|
|
42
42
|
"react-qr-rounded": "^1.0.0",
|
|
43
43
|
"url-join": "^5.0.0",
|
|
44
44
|
"xstate": "^4.37.0",
|
|
45
|
-
"@dxos/
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/client-services": "0.4.10-main.
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/react-ui
|
|
54
|
-
"@dxos/react-ui": "0.4.10-main.
|
|
55
|
-
"@dxos/react-ui-
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
45
|
+
"@dxos/client-protocol": "0.4.10-main.ccba876",
|
|
46
|
+
"@dxos/async": "0.4.10-main.ccba876",
|
|
47
|
+
"@dxos/client-services": "0.4.10-main.ccba876",
|
|
48
|
+
"@dxos/debug": "0.4.10-main.ccba876",
|
|
49
|
+
"@dxos/invariant": "0.4.10-main.ccba876",
|
|
50
|
+
"@dxos/display-name": "0.4.10-main.ccba876",
|
|
51
|
+
"@dxos/react-client": "0.4.10-main.ccba876",
|
|
52
|
+
"@dxos/log": "0.4.10-main.ccba876",
|
|
53
|
+
"@dxos/react-ui": "0.4.10-main.ccba876",
|
|
54
|
+
"@dxos/react-ui-types": "0.4.10-main.ccba876",
|
|
55
|
+
"@dxos/react-ui-theme": "0.4.10-main.ccba876",
|
|
56
|
+
"@dxos/rpc-tunnel": "0.4.10-main.ccba876",
|
|
57
|
+
"@dxos/util": "0.4.10-main.ccba876"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@phosphor-icons/react": "^2.0.5",
|
|
@@ -63,13 +63,14 @@
|
|
|
63
63
|
"@vitejs/plugin-react": "^4.2.1",
|
|
64
64
|
"react": "^18.2.0",
|
|
65
65
|
"react-dom": "^18.2.0",
|
|
66
|
-
"vite": "^5.1.
|
|
66
|
+
"vite": "^5.1.7",
|
|
67
67
|
"vite-plugin-turbosnap": "^1.0.2",
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/react-async": "0.4.10-main.
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/storybook-utils": "0.4.10-main.
|
|
68
|
+
"@dxos/config": "0.4.10-main.ccba876",
|
|
69
|
+
"@dxos/protocols": "0.4.10-main.ccba876",
|
|
70
|
+
"@dxos/react-async": "0.4.10-main.ccba876",
|
|
71
|
+
"@dxos/random": "0.4.10-main.ccba876",
|
|
72
|
+
"@dxos/storybook-utils": "0.4.10-main.ccba876",
|
|
73
|
+
"@dxos/react-ui-theme": "0.4.10-main.ccba876"
|
|
73
74
|
},
|
|
74
75
|
"peerDependencies": {
|
|
75
76
|
"@phosphor-icons/react": "^2.0.5",
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Database, Plus, Power } from '@phosphor-icons/react';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { Avatar, Button, Tooltip, useTranslation } from '@dxos/react-ui';
|
|
9
|
+
import { descriptionText, getSize, mx } from '@dxos/react-ui-theme';
|
|
10
|
+
|
|
11
|
+
import { type AgentFormProps } from './DeviceList';
|
|
12
|
+
|
|
13
|
+
export const AgentConfig = ({ agentActive, agentStatus, onAgentDestroy, onAgentCreate }: AgentFormProps) => {
|
|
14
|
+
const { t } = useTranslation('os');
|
|
15
|
+
return (
|
|
16
|
+
<>
|
|
17
|
+
<h2 className={mx(descriptionText, 'text-center mbs-4')}>{t('agent heading')}</h2>
|
|
18
|
+
{agentActive ? (
|
|
19
|
+
<div role='group' className='flex gap-2 items-center'>
|
|
20
|
+
<Avatar.Root status={agentStatus ? 'active' : 'inactive'} variant='square'>
|
|
21
|
+
<Avatar.Frame classNames='place-self-center'>
|
|
22
|
+
<Database weight='duotone' width={24} height={24} x={8} y={8} />
|
|
23
|
+
</Avatar.Frame>
|
|
24
|
+
<Avatar.Label classNames='flex-1 text-sm truncate'>{t('agent device label')}</Avatar.Label>
|
|
25
|
+
</Avatar.Root>
|
|
26
|
+
<Tooltip.Root>
|
|
27
|
+
<Tooltip.Trigger asChild>
|
|
28
|
+
<Button
|
|
29
|
+
variant='ghost'
|
|
30
|
+
classNames='pli-0 is-[--rail-action] bs-[--rail-action]'
|
|
31
|
+
data-testid='agent.destroy'
|
|
32
|
+
onClick={onAgentDestroy}
|
|
33
|
+
>
|
|
34
|
+
<span className='sr-only'>{t('destroy agent label')}</span>
|
|
35
|
+
<Power className={getSize(5)} />
|
|
36
|
+
</Button>
|
|
37
|
+
</Tooltip.Trigger>
|
|
38
|
+
<Tooltip.Portal>
|
|
39
|
+
<Tooltip.Content side='bottom' classNames='z-50'>
|
|
40
|
+
{t('destroy agent label')}
|
|
41
|
+
</Tooltip.Content>
|
|
42
|
+
</Tooltip.Portal>
|
|
43
|
+
</Tooltip.Root>
|
|
44
|
+
</div>
|
|
45
|
+
) : (
|
|
46
|
+
<>
|
|
47
|
+
<Button
|
|
48
|
+
variant='ghost'
|
|
49
|
+
classNames='mlb-2 is-full justify-start gap-2 !pis-0 !pie-3'
|
|
50
|
+
data-testid='devices-panel.create-agent'
|
|
51
|
+
onClick={onAgentCreate}
|
|
52
|
+
aria-describedby='devices-panel.create-agent.description'
|
|
53
|
+
>
|
|
54
|
+
<div role='img' className={mx(getSize(8), 'm-1 rounded-sm surface-input grid place-items-center')}>
|
|
55
|
+
<Plus weight='light' className={getSize(6)} />
|
|
56
|
+
</div>
|
|
57
|
+
<span className='grow font-medium text-start'>{t('create agent label')}</span>
|
|
58
|
+
</Button>
|
|
59
|
+
<p id='devices-panel.create-agent.description' className={descriptionText}>
|
|
60
|
+
{t('agent message body')}
|
|
61
|
+
</p>
|
|
62
|
+
</>
|
|
63
|
+
)}
|
|
64
|
+
</>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { CaretRight, Plus } from '@phosphor-icons/react';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
import { type Device } from '@dxos/react-client/halo';
|
|
9
|
+
import { Button, List, useTranslation } from '@dxos/react-ui';
|
|
10
|
+
import { descriptionText, getSize, mx } from '@dxos/react-ui-theme';
|
|
11
|
+
|
|
12
|
+
import { DeviceListItem } from './DeviceListItem';
|
|
13
|
+
import { type DeviceListProps } from './DeviceListProps';
|
|
14
|
+
|
|
15
|
+
export const DeviceList = ({
|
|
16
|
+
devices,
|
|
17
|
+
onClickAdd,
|
|
18
|
+
onClickEdit,
|
|
19
|
+
onClickReset,
|
|
20
|
+
onClickJoinExisting,
|
|
21
|
+
}: DeviceListProps) => {
|
|
22
|
+
const { t } = useTranslation('os');
|
|
23
|
+
return (
|
|
24
|
+
<>
|
|
25
|
+
<h2 className={mx(descriptionText, 'text-center mbs-4')}>{t('devices heading')}</h2>
|
|
26
|
+
{devices.length > 0 && (
|
|
27
|
+
<List>
|
|
28
|
+
{devices.map((device: Device) => {
|
|
29
|
+
return (
|
|
30
|
+
<DeviceListItem
|
|
31
|
+
key={device.deviceKey.toHex()}
|
|
32
|
+
device={device}
|
|
33
|
+
onClickEdit={() => onClickEdit?.(device)}
|
|
34
|
+
{...{ onClickReset, onClickJoinExisting }}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
})}
|
|
38
|
+
</List>
|
|
39
|
+
)}
|
|
40
|
+
<Button
|
|
41
|
+
variant='ghost'
|
|
42
|
+
classNames='justify-start gap-2 !pis-0 !pie-3'
|
|
43
|
+
data-testid='devices-panel.create-invitation'
|
|
44
|
+
onClick={onClickAdd}
|
|
45
|
+
>
|
|
46
|
+
<div role='img' className={mx(getSize(8), 'm-1 rounded-sm surface-input grid place-items-center')}>
|
|
47
|
+
<Plus weight='light' className={getSize(6)} />
|
|
48
|
+
</div>
|
|
49
|
+
<span className='grow font-medium text-start'>{t('choose add device label')}</span>
|
|
50
|
+
<CaretRight weight='bold' className={getSize(4)} />
|
|
51
|
+
</Button>
|
|
52
|
+
</>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Compass,
|
|
7
|
+
Desktop,
|
|
8
|
+
DeviceMobile,
|
|
9
|
+
Devices,
|
|
10
|
+
DotsThree,
|
|
11
|
+
type IconProps,
|
|
12
|
+
Intersect,
|
|
13
|
+
Power,
|
|
14
|
+
Robot,
|
|
15
|
+
} from '@phosphor-icons/react';
|
|
16
|
+
import React, { type ComponentPropsWithoutRef, forwardRef } from 'react';
|
|
17
|
+
|
|
18
|
+
import { generateName } from '@dxos/display-name';
|
|
19
|
+
import { Device, DeviceType, DeviceKind } from '@dxos/react-client/halo';
|
|
20
|
+
import {
|
|
21
|
+
ListItem,
|
|
22
|
+
Avatar,
|
|
23
|
+
useId,
|
|
24
|
+
type ThemedClassName,
|
|
25
|
+
Tag,
|
|
26
|
+
useTranslation,
|
|
27
|
+
DropdownMenu,
|
|
28
|
+
Button,
|
|
29
|
+
} from '@dxos/react-ui';
|
|
30
|
+
import { getSize } from '@dxos/react-ui-theme';
|
|
31
|
+
import { keyToFallback } from '@dxos/util';
|
|
32
|
+
|
|
33
|
+
import { type DeviceListItemProps } from './DeviceListProps';
|
|
34
|
+
|
|
35
|
+
const iconProps: IconProps = {
|
|
36
|
+
weight: 'duotone',
|
|
37
|
+
width: 24,
|
|
38
|
+
height: 24,
|
|
39
|
+
x: 8,
|
|
40
|
+
y: 8,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const DeviceListItem = forwardRef<
|
|
44
|
+
HTMLLIElement,
|
|
45
|
+
ThemedClassName<ComponentPropsWithoutRef<'li'>> & DeviceListItemProps
|
|
46
|
+
>(({ device, onClickAdd, onClickEdit, onClickReset, onClickJoinExisting, classNames, ...props }, forwardedRef) => {
|
|
47
|
+
const { t } = useTranslation('os');
|
|
48
|
+
const fallbackValue = keyToFallback(device.deviceKey);
|
|
49
|
+
const labelId = useId('identityListItem__label');
|
|
50
|
+
const displayName = device.profile
|
|
51
|
+
? t('device name placeholder', { os: device.profile.os, platform: device.profile.platform })
|
|
52
|
+
: generateName(device.deviceKey.toHex());
|
|
53
|
+
const isCurrent = device.kind === DeviceKind.CURRENT;
|
|
54
|
+
return (
|
|
55
|
+
<ListItem.Root
|
|
56
|
+
{...props}
|
|
57
|
+
classNames={['flex gap-2 items-center mlb-2', classNames]}
|
|
58
|
+
data-testid={`device-list-item${isCurrent ? '-current' : ''}`}
|
|
59
|
+
labelId={labelId}
|
|
60
|
+
ref={forwardedRef}
|
|
61
|
+
>
|
|
62
|
+
<Avatar.Root
|
|
63
|
+
status={device.presence === Device.PresenceState.ONLINE ? 'active' : 'inactive'}
|
|
64
|
+
labelId={labelId}
|
|
65
|
+
hue={fallbackValue.hue}
|
|
66
|
+
variant='square'
|
|
67
|
+
>
|
|
68
|
+
<Avatar.Frame classNames='place-self-center'>
|
|
69
|
+
{device.profile?.type ? (
|
|
70
|
+
device.profile.type === DeviceType.BROWSER ? (
|
|
71
|
+
<Compass {...iconProps} />
|
|
72
|
+
) : device.profile.type === DeviceType.NATIVE ? (
|
|
73
|
+
<Desktop {...iconProps} />
|
|
74
|
+
) : [DeviceType.AGENT, DeviceType.AGENT_MANAGED].includes(device.profile.type) ? (
|
|
75
|
+
<Robot {...iconProps} />
|
|
76
|
+
) : device.profile.type === DeviceType.MOBILE ? (
|
|
77
|
+
<DeviceMobile {...iconProps} />
|
|
78
|
+
) : (
|
|
79
|
+
<Devices {...iconProps} />
|
|
80
|
+
)
|
|
81
|
+
) : (
|
|
82
|
+
<Avatar.Fallback text={fallbackValue.emoji} />
|
|
83
|
+
)}
|
|
84
|
+
</Avatar.Frame>
|
|
85
|
+
{isCurrent && <Tag color='primary'>{t('current device tag label')}</Tag>}
|
|
86
|
+
<Avatar.Label classNames='flex-1 text-sm truncate'>{displayName}</Avatar.Label>
|
|
87
|
+
{device.kind === DeviceKind.CURRENT && (
|
|
88
|
+
<DropdownMenu.Root>
|
|
89
|
+
<DropdownMenu.Trigger asChild>
|
|
90
|
+
<Button
|
|
91
|
+
variant='ghost'
|
|
92
|
+
classNames='pli-0 is-[--rail-action] bs-[--rail-action]'
|
|
93
|
+
data-testid={`device-list-item${isCurrent ? '-current' : ''}.options`}
|
|
94
|
+
>
|
|
95
|
+
<span className='sr-only'>{t('more options label')}</span>
|
|
96
|
+
<DotsThree className={getSize(5)} />
|
|
97
|
+
</Button>
|
|
98
|
+
</DropdownMenu.Trigger>
|
|
99
|
+
<DropdownMenu.Content>
|
|
100
|
+
<DropdownMenu.Viewport>
|
|
101
|
+
{/* <DropdownMenu.Item disabled onClick={onClickEdit}> */}
|
|
102
|
+
{/* <PencilSimpleLine className={getSize(5)} /> */}
|
|
103
|
+
{/* {t('edit device label')} */}
|
|
104
|
+
{/* </DropdownMenu.Item> */}
|
|
105
|
+
<DropdownMenu.Item data-testid='device-list-item-current.join-existing' onClick={onClickJoinExisting}>
|
|
106
|
+
<Intersect className={getSize(5)} />
|
|
107
|
+
{t('choose join new identity label')}
|
|
108
|
+
</DropdownMenu.Item>
|
|
109
|
+
<DropdownMenu.Item data-testid='device-list-item-current.reset' onClick={onClickReset}>
|
|
110
|
+
<Power className={getSize(5)} />
|
|
111
|
+
{t('reset device label')}
|
|
112
|
+
</DropdownMenu.Item>
|
|
113
|
+
</DropdownMenu.Viewport>
|
|
114
|
+
</DropdownMenu.Content>
|
|
115
|
+
</DropdownMenu.Root>
|
|
116
|
+
)}
|
|
117
|
+
</Avatar.Root>
|
|
118
|
+
</ListItem.Root>
|
|
119
|
+
);
|
|
120
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type SpaceMember } from '@dxos/react-client/echo';
|
|
6
|
+
import { type Device } from '@dxos/react-client/halo';
|
|
7
|
+
|
|
8
|
+
export type DeviceListProps = {
|
|
9
|
+
devices: Device[];
|
|
10
|
+
onClickAdd?: () => void;
|
|
11
|
+
onClickEdit?: (device: Device) => void;
|
|
12
|
+
onClickReset?: () => void;
|
|
13
|
+
onClickJoinExisting?: () => void;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type AgentFormProps = {
|
|
17
|
+
onAgentCreate?: () => Promise<void>;
|
|
18
|
+
onAgentDestroy?: () => Promise<void>;
|
|
19
|
+
agentStatus?: string;
|
|
20
|
+
agentActive?: boolean;
|
|
21
|
+
agentProviderDisabled?: boolean;
|
|
22
|
+
validationMessage?: string;
|
|
23
|
+
agentHostingEnabled?: boolean;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type DeviceListItemProps = {
|
|
27
|
+
device: Device;
|
|
28
|
+
presence?: SpaceMember['presence'];
|
|
29
|
+
onClickAdd?: () => void;
|
|
30
|
+
onClickEdit?: () => void;
|
|
31
|
+
onClickReset?: () => void;
|
|
32
|
+
onClickJoinExisting?: () => void;
|
|
33
|
+
};
|
|
@@ -3,11 +3,20 @@
|
|
|
3
3
|
//
|
|
4
4
|
import emojiData from '@emoji-mart/data';
|
|
5
5
|
import EmojiMart from '@emoji-mart/react';
|
|
6
|
-
import { ArrowCounterClockwise, CaretDown } from '@phosphor-icons/react';
|
|
6
|
+
import { ArrowCounterClockwise, CaretDown, ImageSquare } from '@phosphor-icons/react';
|
|
7
7
|
import { useControllableState } from '@radix-ui/react-use-controllable-state';
|
|
8
|
-
import React, { type Dispatch, type SetStateAction, useState } from 'react';
|
|
8
|
+
import React, { type Dispatch, type SetStateAction, useRef, useState } from 'react';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
Button,
|
|
12
|
+
Popover,
|
|
13
|
+
useTranslation,
|
|
14
|
+
Tooltip,
|
|
15
|
+
type ButtonProps,
|
|
16
|
+
Toolbar,
|
|
17
|
+
useMediaQuery,
|
|
18
|
+
type ThemedClassName,
|
|
19
|
+
} from '@dxos/react-ui';
|
|
11
20
|
import { getSize } from '@dxos/react-ui-theme';
|
|
12
21
|
|
|
13
22
|
export type EmojiPickerProps = {
|
|
@@ -18,7 +27,95 @@ export type EmojiPickerProps = {
|
|
|
18
27
|
onClickClear?: ButtonProps['onClick'];
|
|
19
28
|
};
|
|
20
29
|
|
|
21
|
-
|
|
30
|
+
/**
|
|
31
|
+
* A toolbar button for picking an emoji. Use only in `role=toolbar` elements. Unable to unset the value.
|
|
32
|
+
*/
|
|
33
|
+
export const EmojiPickerToolbarButton = ({
|
|
34
|
+
disabled,
|
|
35
|
+
defaultEmoji,
|
|
36
|
+
emoji,
|
|
37
|
+
onChangeEmoji,
|
|
38
|
+
classNames,
|
|
39
|
+
}: ThemedClassName<Omit<EmojiPickerProps, 'onClickClear'>>) => {
|
|
40
|
+
const { t } = useTranslation('os');
|
|
41
|
+
|
|
42
|
+
const [_emojiValue, setEmojiValue] = useControllableState<string>({
|
|
43
|
+
prop: emoji,
|
|
44
|
+
onChange: onChangeEmoji,
|
|
45
|
+
defaultProp: defaultEmoji,
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
const [emojiPickerOpen, setEmojiPickerOpen] = useState<boolean>(false);
|
|
49
|
+
|
|
50
|
+
const suppressNextTooltip = useRef<boolean>(false);
|
|
51
|
+
const [triggerTooltipOpen, setTriggerTooltipOpen] = useState(false);
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<Tooltip.Root
|
|
55
|
+
open={triggerTooltipOpen}
|
|
56
|
+
onOpenChange={(nextOpen) => {
|
|
57
|
+
if (suppressNextTooltip.current) {
|
|
58
|
+
setTriggerTooltipOpen(false);
|
|
59
|
+
suppressNextTooltip.current = false;
|
|
60
|
+
} else {
|
|
61
|
+
setTriggerTooltipOpen(nextOpen);
|
|
62
|
+
}
|
|
63
|
+
}}
|
|
64
|
+
>
|
|
65
|
+
<Popover.Root
|
|
66
|
+
open={emojiPickerOpen}
|
|
67
|
+
onOpenChange={(nextOpen) => {
|
|
68
|
+
setEmojiPickerOpen(nextOpen);
|
|
69
|
+
suppressNextTooltip.current = true;
|
|
70
|
+
}}
|
|
71
|
+
>
|
|
72
|
+
<Tooltip.Trigger asChild>
|
|
73
|
+
<Popover.Trigger asChild>
|
|
74
|
+
<Toolbar.Button classNames={['gap-2 text-2xl plb-1', classNames]} disabled={disabled}>
|
|
75
|
+
<span className='sr-only'>{t('select emoji label')}</span>
|
|
76
|
+
<ImageSquare className={getSize(5)} />
|
|
77
|
+
</Toolbar.Button>
|
|
78
|
+
</Popover.Trigger>
|
|
79
|
+
</Tooltip.Trigger>
|
|
80
|
+
<Tooltip.Portal>
|
|
81
|
+
<Tooltip.Content side='bottom' classNames='z-50'>
|
|
82
|
+
{t('select emoji label')}
|
|
83
|
+
<Tooltip.Arrow />
|
|
84
|
+
</Tooltip.Content>
|
|
85
|
+
</Tooltip.Portal>
|
|
86
|
+
<Popover.Content
|
|
87
|
+
side='bottom'
|
|
88
|
+
onKeyDownCapture={(event) => {
|
|
89
|
+
if (event.key === 'Escape') {
|
|
90
|
+
event.stopPropagation();
|
|
91
|
+
setEmojiPickerOpen(false);
|
|
92
|
+
suppressNextTooltip.current = true;
|
|
93
|
+
}
|
|
94
|
+
}}
|
|
95
|
+
>
|
|
96
|
+
<EmojiMart
|
|
97
|
+
data={emojiData}
|
|
98
|
+
onEmojiSelect={({ native }: { native?: string }) => {
|
|
99
|
+
if (native) {
|
|
100
|
+
setEmojiValue(native);
|
|
101
|
+
setEmojiPickerOpen(false);
|
|
102
|
+
}
|
|
103
|
+
}}
|
|
104
|
+
autoFocus={true}
|
|
105
|
+
maxFrequentRows={0}
|
|
106
|
+
noCountryFlags={true}
|
|
107
|
+
/>
|
|
108
|
+
<Popover.Arrow />
|
|
109
|
+
</Popover.Content>
|
|
110
|
+
</Popover.Root>
|
|
111
|
+
</Tooltip.Root>
|
|
112
|
+
);
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* A button for picking an emoji alongside a button for unsetting it.
|
|
117
|
+
*/
|
|
118
|
+
export const EmojiPickerBlock = ({ disabled, defaultEmoji, emoji, onChangeEmoji, onClickClear }: EmojiPickerProps) => {
|
|
22
119
|
const { t } = useTranslation('os');
|
|
23
120
|
const [isMd] = useMediaQuery('md', { ssr: false });
|
|
24
121
|
|