@dxos/shell 0.4.6 → 0.4.7-main.0a4f1cd

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/bundle/shell.mjs +63680 -21117
  2. package/dist/bundle/shell.mjs.map +1 -1
  3. package/dist/bundle/shell.umd.js +793 -78
  4. package/dist/bundle/shell.umd.js.map +1 -1
  5. package/dist/bundle/style.css +1 -1
  6. package/dist/lib/browser/meta.json +1 -1
  7. package/dist/lib/browser/react.mjs +769 -591
  8. package/dist/lib/browser/react.mjs.map +4 -4
  9. package/dist/types/src/components/EmojiPicker.d.ts +11 -0
  10. package/dist/types/src/components/EmojiPicker.d.ts.map +1 -0
  11. package/dist/types/src/components/EmojiPicker.js +79 -0
  12. package/dist/types/src/components/EmojiPicker.js.map +1 -0
  13. package/dist/types/src/components/HuePicker.d.ts +11 -0
  14. package/dist/types/src/components/HuePicker.d.ts.map +1 -0
  15. package/dist/types/src/components/HuePicker.js +56 -0
  16. package/dist/types/src/components/HuePicker.js.map +1 -0
  17. package/dist/types/src/components/IdentityList/DeviceList.d.ts.map +1 -1
  18. package/dist/types/src/components/IdentityList/DeviceList.js +1 -1
  19. package/dist/types/src/components/IdentityList/DeviceList.js.map +1 -1
  20. package/dist/types/src/components/IdentityList/IdentityListItem.d.ts.map +1 -1
  21. package/dist/types/src/components/IdentityList/IdentityListItem.js +5 -5
  22. package/dist/types/src/components/IdentityList/IdentityListItem.js.map +1 -1
  23. package/dist/types/src/components/InvitationList/InvitationListItem.d.ts.map +1 -1
  24. package/dist/types/src/components/InvitationList/InvitationListItem.js +2 -2
  25. package/dist/types/src/components/InvitationList/InvitationListItem.js.map +1 -1
  26. package/dist/types/src/components/SpaceListItem.d.ts.map +1 -1
  27. package/dist/types/src/components/SpaceListItem.js +2 -3
  28. package/dist/types/src/components/SpaceListItem.js.map +1 -1
  29. package/dist/types/src/components/index.d.ts +2 -0
  30. package/dist/types/src/components/index.d.ts.map +1 -1
  31. package/dist/types/src/components/index.js +2 -0
  32. package/dist/types/src/components/index.js.map +1 -1
  33. package/dist/types/src/panels/IdentityPanel/IdentityPanel.d.ts.map +1 -1
  34. package/dist/types/src/panels/IdentityPanel/IdentityPanel.js +6 -5
  35. package/dist/types/src/panels/IdentityPanel/IdentityPanel.js.map +1 -1
  36. package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.d.ts.map +1 -1
  37. package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js +16 -3
  38. package/dist/types/src/panels/IdentityPanel/IdentityPanel.stories.js.map +1 -1
  39. package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.d.ts.map +1 -1
  40. package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js +12 -3
  41. package/dist/types/src/panels/IdentityPanel/steps/ProfileForm.js.map +1 -1
  42. package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.d.ts.map +1 -1
  43. package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.js +8 -7
  44. package/dist/types/src/panels/JoinPanel/steps/IdentityAdded.js.map +1 -1
  45. package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.js +2 -2
  46. package/dist/types/src/panels/JoinPanel/steps/InvitationAuthenticator.js.map +1 -1
  47. package/dist/types/src/steps/InvitationManager.d.ts.map +1 -1
  48. package/dist/types/src/steps/InvitationManager.js +5 -4
  49. package/dist/types/src/steps/InvitationManager.js.map +1 -1
  50. package/dist/types/src/translations/locales/en-US.d.ts +21 -0
  51. package/dist/types/src/translations/locales/en-US.d.ts.map +1 -1
  52. package/dist/types/src/translations/locales/en-US.js +21 -0
  53. package/dist/types/src/translations/locales/en-US.js.map +1 -1
  54. package/dist/types/src/util/index.d.ts +0 -1
  55. package/dist/types/src/util/index.d.ts.map +1 -1
  56. package/dist/types/src/util/index.js +0 -1
  57. package/dist/types/src/util/index.js.map +1 -1
  58. package/package.json +22 -21
  59. package/src/components/EmojiPicker.tsx +82 -0
  60. package/src/components/HuePicker.tsx +87 -0
  61. package/src/components/IdentityList/DeviceList.tsx +1 -0
  62. package/src/components/IdentityList/IdentityListItem.tsx +9 -5
  63. package/src/components/InvitationList/InvitationListItem.tsx +2 -2
  64. package/src/components/SpaceListItem.tsx +4 -5
  65. package/src/components/index.ts +2 -0
  66. package/src/panels/IdentityPanel/IdentityPanel.stories.tsx +17 -4
  67. package/src/panels/IdentityPanel/IdentityPanel.tsx +5 -4
  68. package/src/panels/IdentityPanel/steps/ProfileForm.tsx +29 -7
  69. package/src/panels/JoinPanel/steps/IdentityAdded.tsx +7 -7
  70. package/src/panels/JoinPanel/steps/InvitationAuthenticator.tsx +2 -2
  71. package/src/steps/InvitationManager.tsx +4 -3
  72. package/src/translations/locales/en-US.ts +21 -0
  73. package/src/util/index.ts +0 -1
  74. package/dist/types/src/util/toEmoji.d.ts +0 -2
  75. package/dist/types/src/util/toEmoji.d.ts.map +0 -1
  76. package/dist/types/src/util/toEmoji.js +0 -26
  77. package/dist/types/src/util/toEmoji.js.map +0 -1
  78. package/src/util/toEmoji.ts +0 -22
@@ -9,7 +9,8 @@ import { useClient } from '@dxos/react-client';
9
9
  import { type Identity, useIdentity, useDevices, useHaloInvitations } 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
- import { Avatar, DensityProvider, useId, useJdenticonHref, useTranslation } from '@dxos/react-ui';
12
+ import { Avatar, DensityProvider, useId, useTranslation } from '@dxos/react-ui';
13
+ import { keyToFallback } from '@dxos/util';
13
14
 
14
15
  import {
15
16
  type IdentityPanelHeadingProps,
@@ -25,12 +26,12 @@ import { InvitationManager } from '../../steps';
25
26
  const viewStyles = 'pbs-1 pbe-3 pli-3';
26
27
 
27
28
  const IdentityHeading = ({ titleId, title, identity, onDone }: IdentityPanelHeadingProps) => {
28
- const fallbackHref = useJdenticonHref(identity.identityKey.toHex(), 12);
29
+ const fallbackValue = keyToFallback(identity.identityKey);
29
30
  return (
30
31
  <Heading titleId={titleId} title={title} corner={<CloseButton onDone={onDone} />}>
31
- <Avatar.Root size={12} variant='circle' status='active'>
32
+ <Avatar.Root size={12} variant='circle' status='active' hue={identity.profile?.data?.hue || fallbackValue.hue}>
32
33
  <Avatar.Frame classNames='block mbs-4 mbe-2 mli-auto chromatic-ignore'>
33
- <Avatar.Fallback href={fallbackHref} />
34
+ <Avatar.Fallback text={identity.profile?.data?.emoji || fallbackValue.emoji} />
34
35
  </Avatar.Frame>
35
36
  <Avatar.Label classNames='block text-center font-light text-xl' data-testid='identityHeading.displayName'>
36
37
  {identity.profile?.displayName ?? generateName(identity.identityKey.toHex())}
@@ -8,8 +8,9 @@ import { type Event, type SingleOrArray } from 'xstate';
8
8
  import { log } from '@dxos/log';
9
9
  import { type Identity } from '@dxos/react-client/halo';
10
10
  import { useTranslation } from '@dxos/react-ui';
11
+ import { hexToEmoji, hexToHue } from '@dxos/util';
11
12
 
12
- import { Action, Actions, StepHeading, Input, useClipboardContext } from '../../../components';
13
+ import { Action, Actions, StepHeading, Input, useClipboardContext, EmojiPicker, HuePicker } from '../../../components';
13
14
  import { type IdentityPanelStepProps } from '../IdentityPanelProps';
14
15
  import { type IdentityEvent } from '../identityMachine';
15
16
 
@@ -36,13 +37,20 @@ export const ProfileForm = (props: ProfileFormProps) => {
36
37
  return <ProfileFormImpl {...props} onUpdateProfile={handleUpdateProfile} validationMessage={validationMessage} />;
37
38
  };
38
39
 
40
+ const getHueValue = (identity?: Identity) =>
41
+ identity?.profile?.data?.hue || hexToHue(identity?.identityKey.toHex() ?? '0');
42
+ const getEmojiValue = (identity?: Identity) =>
43
+ identity?.profile?.data?.emoji || hexToEmoji(identity?.identityKey.toHex() ?? '0');
44
+
39
45
  // TODO(zhenyasav): impl shouldn't need send()
40
46
  const ProfileFormImpl = (props: ProfileFormImplProps) => {
41
47
  const { active, identity, send, onUpdateProfile, validationMessage } = props;
42
48
  const profile = identity?.profile;
43
49
  const disabled = !active;
44
50
  const { t } = useTranslation('os');
45
- const [inputValue, setInputValue] = useState(profile?.displayName ?? '');
51
+ const [displayName, setDisplayName] = useState(profile?.displayName ?? '');
52
+ const [hue, setHue] = useState<string>(getHueValue(identity));
53
+ const [emoji, setEmoji] = useState<string>(getEmojiValue(identity));
46
54
  const { textValue, setTextValue } = useClipboardContext();
47
55
  const identityHex = identity?.identityKey.toHex();
48
56
  const copied = textValue === identityHex;
@@ -51,14 +59,28 @@ const ProfileFormImpl = (props: ProfileFormImplProps) => {
51
59
  <div role='none' className='grow flex flex-col justify-center'>
52
60
  <Input
53
61
  {...{ validationMessage }}
54
- label={<StepHeading>{t('display name input label')}</StepHeading>}
62
+ label={<StepHeading className='m-0'>{t('display name input label')}</StepHeading>}
55
63
  disabled={disabled}
56
64
  data-testid='display-name-input'
57
65
  placeholder={t('display name input placeholder')}
58
- value={inputValue}
59
- onChange={({ target: { value } }) => setInputValue(value)}
60
- onKeyDown={({ key }) => key === 'Enter' && onUpdateProfile?.({ displayName: inputValue })}
66
+ value={displayName}
67
+ onChange={({ target: { value } }) => setDisplayName(value)}
61
68
  />
69
+ <StepHeading className='mbe-2'>{t('emoji and color label')}</StepHeading>
70
+ <div role='none' className='grid grid-cols-[1fr_min-content] gap-y-2'>
71
+ <EmojiPicker
72
+ emoji={emoji}
73
+ onChangeEmoji={setEmoji}
74
+ disabled={disabled}
75
+ onClickClear={() => setEmoji(getEmojiValue(identity))}
76
+ />
77
+ <HuePicker
78
+ hue={hue}
79
+ onChangeHue={setHue}
80
+ disabled={disabled}
81
+ onClickClear={() => setHue(getHueValue(identity))}
82
+ />
83
+ </div>
62
84
  </div>
63
85
  <Actions>
64
86
  <Action
@@ -84,7 +106,7 @@ const ProfileFormImpl = (props: ProfileFormImplProps) => {
84
106
  <Action
85
107
  variant='primary'
86
108
  disabled={disabled}
87
- onClick={() => onUpdateProfile?.({ displayName: inputValue })}
109
+ onClick={() => onUpdateProfile?.({ displayName, data: { emoji, hue } })}
88
110
  data-testid='update-profile-form-continue'
89
111
  >
90
112
  {t('done label')}
@@ -6,8 +6,9 @@ import React, { cloneElement } from 'react';
6
6
 
7
7
  import { generateName } from '@dxos/display-name';
8
8
  import type { Identity } from '@dxos/react-client/halo';
9
- import { Avatar, useId, useJdenticonHref, useTranslation } from '@dxos/react-ui';
9
+ import { Avatar, useId, useTranslation } from '@dxos/react-ui';
10
10
  import { mx } from '@dxos/react-ui-theme';
11
+ import { hexToFallback } from '@dxos/util';
11
12
 
12
13
  import { Action, Actions, StepHeading } from '../../../components';
13
14
  import { type JoinPanelMode, type JoinStepProps } from '../JoinPanelProps';
@@ -22,11 +23,10 @@ export const IdentityAdded = (props: IdentityAddedProps) => {
22
23
  const disabled = !active;
23
24
  const { t } = useTranslation('os');
24
25
 
25
- const fallbackValue = addedIdentity?.identityKey.toHex();
26
+ const addedIdentityHex = addedIdentity?.identityKey.toHex() ?? '0';
27
+ const fallbackValue = hexToFallback(addedIdentityHex);
26
28
  const labelId = useId('identityListItem__label');
27
- const jdenticon = useJdenticonHref(fallbackValue ?? '', 12);
28
- const displayName =
29
- addedIdentity?.profile?.displayName ?? (addedIdentity && generateName(addedIdentity?.identityKey.toHex()));
29
+ const displayName = addedIdentity?.profile?.displayName ?? (addedIdentity && generateName(addedIdentityHex));
30
30
 
31
31
  const doneAction = (
32
32
  <Action
@@ -43,9 +43,9 @@ export const IdentityAdded = (props: IdentityAddedProps) => {
43
43
  <>
44
44
  <StepHeading>{t('identity added label')}</StepHeading>
45
45
  <div role='none' className='grow flex flex-col items-center justify-center text-center gap-2'>
46
- <Avatar.Root status='active' labelId={labelId}>
46
+ <Avatar.Root status='active' labelId={labelId} hue={addedIdentity?.profile?.data?.hue || fallbackValue.hue}>
47
47
  <Avatar.Frame>
48
- <Avatar.Fallback href={jdenticon} />
48
+ <Avatar.Fallback text={addedIdentity?.profile?.data?.emoji || fallbackValue.emoji} />
49
49
  </Avatar.Frame>
50
50
  <Avatar.Label classNames={mx('text-lg truncate', !addedIdentity?.profile?.displayName && 'font-mono')}>
51
51
  {displayName}
@@ -5,9 +5,9 @@
5
5
  import React, { type ChangeEvent, useState } from 'react';
6
6
 
7
7
  import { Input, useTranslation } from '@dxos/react-ui';
8
+ import { hexToEmoji } from '@dxos/util';
8
9
 
9
10
  import { Actions, Action, Emoji, StepHeading } from '../../../components';
10
- import { toEmoji } from '../../../util';
11
11
  import { type JoinStepProps } from '../JoinPanelProps';
12
12
 
13
13
  const pinLength = 6;
@@ -45,7 +45,7 @@ export const InvitationAuthenticator = ({
45
45
  return (
46
46
  <>
47
47
  <div role='none' className='grow flex flex-col justify-center'>
48
- {invitationId && <Emoji text={toEmoji(invitationId)} />}
48
+ {invitationId && <Emoji text={hexToEmoji(invitationId)} />}
49
49
  <Input.Root
50
50
  {...(failed && {
51
51
  validationValence: 'error',
@@ -9,6 +9,7 @@ import { QR } from 'react-qr-rounded';
9
9
  import { type InvitationStatus, Invitation } from '@dxos/react-client/invitations';
10
10
  import { useId, useTranslation } from '@dxos/react-ui';
11
11
  import { descriptionText, getSize, mx } from '@dxos/react-ui-theme';
12
+ import { hexToEmoji } from '@dxos/util';
12
13
 
13
14
  import { type StepProps } from './StepProps';
14
15
  import {
@@ -22,7 +23,7 @@ import {
22
23
  CopyButton,
23
24
  Centered,
24
25
  } from '../components';
25
- import { invitationStatusValue, toEmoji } from '../util';
26
+ import { invitationStatusValue } from '../util';
26
27
 
27
28
  export type InvitationManagerProps = StepProps &
28
29
  Partial<InvitationStatus> & {
@@ -44,13 +45,13 @@ export const InvitationManager = ({
44
45
  status,
45
46
  type,
46
47
  authCode,
47
- id,
48
+ id = '0',
48
49
  }: InvitationManagerProps) => {
49
50
  const { t } = useTranslation('os');
50
51
  const qrLabel = useId('invitation-manager__qr-code');
51
52
  const statusValue = type === Invitation.Type.MULTIUSE ? 0 : invitationStatusValue.get(status!) ?? 0;
52
53
  const showAuthCode = statusValue === 3;
53
- const emoji = toEmoji(id ?? '');
54
+ const emoji = hexToEmoji(id);
54
55
  const activeView = useMemo(() => {
55
56
  switch (true) {
56
57
  case statusValue === 5:
@@ -106,4 +106,25 @@ export const os = {
106
106
  'join new identity label': 'Join a new identity',
107
107
  'reset device label': 'Reset device',
108
108
  'reset device confirm message': 'Are you sure you want to reset your device? All data will be lost.',
109
+ 'emoji and color label': 'Emoji and color',
110
+ 'clear label': 'Use default',
111
+ 'select emoji label': 'Choose an emoji to use in your avatar',
112
+ 'select hue label': 'Choose a hue to use in your avatar',
113
+ 'red label': 'Red',
114
+ 'orange label': 'Orange',
115
+ 'amber label': 'Amber',
116
+ 'yellow label': 'Yellow',
117
+ 'lime label': 'Lime',
118
+ 'green label': 'Green',
119
+ 'emerald label': 'Emerald',
120
+ 'teal label': 'Teal',
121
+ 'cyan label': 'Cyan',
122
+ 'sky label': 'Sky',
123
+ 'blue label': 'Blue',
124
+ 'indigo label': 'Indigo',
125
+ 'violet label': 'Violet',
126
+ 'purple label': 'Purple',
127
+ 'fuchsia label': 'Fuchsia',
128
+ 'pink label': 'Pink',
129
+ 'rose label': 'Rose',
109
130
  };
package/src/util/index.ts CHANGED
@@ -3,4 +3,3 @@
3
3
  //
4
4
 
5
5
  export * from './invitationStatusValue';
6
- export * from './toEmoji';
@@ -1,2 +0,0 @@
1
- export declare const toEmoji: (keyAsHex: string) => string;
2
- //# sourceMappingURL=toEmoji.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toEmoji.d.ts","sourceRoot":"","sources":["../../../../src/util/toEmoji.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,OAAO,aAAc,MAAM,WAAiD,CAAC"}
@@ -1,26 +0,0 @@
1
- "use strict";
2
- //
3
- // Copyright 2023 DXOS.org
4
- //
5
- var __importDefault = (this && this.__importDefault) || function (mod) {
6
- return (mod && mod.__esModule) ? mod : { "default": mod };
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.toEmoji = void 0;
10
- const lodash_toarray_1 = __importDefault(require("lodash.toarray"));
11
- const emoji = (0, lodash_toarray_1.default)(
12
- // When changing this set, please check the result in a console or e.g. RunKit (https://runkit.com/thure/642214441dd6ae000855a8de)
13
- // Emoji sometimes use a combination of code points, and some code points aren't visible on their own, so by adding or deleting you may unintentionally create non-visible items.
14
- // This set was chosen from the characters in Unicode Emoji v15.0 based on the following criteria:
15
- // – not people or isolated anthropomorphic faces
16
- // – not flags
17
- // – more concrete than abstract
18
- // – less culturally specific
19
- // – less easily confused with another emoji in the set
20
- // – requires less special knowledge to identify
21
- // – less likely to evoke negative feelings (no meat, no drugs, no weapons, etc)
22
- // – less common as a signifier in UX
23
- '👹👻👽🤖🎃🦾🦿🦷👣👁️🧶👑🐒🦆🦉🐴🦄🐝🦋🐞🪲🐢🦎🦕🦑🦀🐠🐬🐋🦭🐅🐆🦓🦍🦧🐘🐫🦒🦘🦬🐖🐏🦌🐕🐈🐓🦚🦜🦢🦩🦦🐁🐿️🌵🌲🌳🪵🌱🍁🪺🍄🐚🪸🪨🌾🌷🌻☀️🌙🪐⭐️⚡️☄️🔥🌈☁️💧⛱️🌊🍎🍋🍉🍇🫐🍈🍒🍑🥭🍍🥥🥝🥑🌶️🌽🥕🍬🥜🫖☕️🍵🧊🧂🏔️⚓️🛟🏝️🛶🚀🛰️⛲️🏰🚲⛺️🎙️🧲⚙️🔩🔮🔭🔬🧬🌡️🧺🛎️🔑🪑🧸🎈🎀🎊♻️🎵');
24
- const toEmoji = (keyAsHex) => emoji[parseInt(keyAsHex, 16) % emoji.length];
25
- exports.toEmoji = toEmoji;
26
- //# sourceMappingURL=toEmoji.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"toEmoji.js","sourceRoot":"","sources":["../../../../src/util/toEmoji.ts"],"names":[],"mappings":";AAAA,EAAE;AACF,0BAA0B;AAC1B,EAAE;;;;;;AAEF,oEAAqC;AAErC,MAAM,KAAK,GAAG,IAAA,wBAAO;AACnB,kIAAkI;AAClI,iLAAiL;AACjL,kGAAkG;AAClG,iDAAiD;AACjD,cAAc;AACd,gCAAgC;AAChC,6BAA6B;AAC7B,uDAAuD;AACvD,gDAAgD;AAChD,gFAAgF;AAChF,qCAAqC;AACrC,mRAAmR,CACpR,CAAC;AAEK,MAAM,OAAO,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC;AAA7E,QAAA,OAAO,WAAsE"}
@@ -1,22 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import toArray from 'lodash.toarray';
6
-
7
- const emoji = toArray(
8
- // When changing this set, please check the result in a console or e.g. RunKit (https://runkit.com/thure/642214441dd6ae000855a8de)
9
- // Emoji sometimes use a combination of code points, and some code points aren't visible on their own, so by adding or deleting you may unintentionally create non-visible items.
10
- // This set was chosen from the characters in Unicode Emoji v15.0 based on the following criteria:
11
- // – not people or isolated anthropomorphic faces
12
- // – not flags
13
- // – more concrete than abstract
14
- // – less culturally specific
15
- // – less easily confused with another emoji in the set
16
- // – requires less special knowledge to identify
17
- // – less likely to evoke negative feelings (no meat, no drugs, no weapons, etc)
18
- // – less common as a signifier in UX
19
- '👹👻👽🤖🎃🦾🦿🦷👣👁️🧶👑🐒🦆🦉🐴🦄🐝🦋🐞🪲🐢🦎🦕🦑🦀🐠🐬🐋🦭🐅🐆🦓🦍🦧🐘🐫🦒🦘🦬🐖🐏🦌🐕🐈🐓🦚🦜🦢🦩🦦🐁🐿️🌵🌲🌳🪵🌱🍁🪺🍄🐚🪸🪨🌾🌷🌻☀️🌙🪐⭐️⚡️☄️🔥🌈☁️💧⛱️🌊🍎🍋🍉🍇🫐🍈🍒🍑🥭🍍🥥🥝🥑🌶️🌽🥕🍬🥜🫖☕️🍵🧊🧂🏔️⚓️🛟🏝️🛶🚀🛰️⛲️🏰🚲⛺️🎙️🧲⚙️🔩🔮🔭🔬🧬🌡️🧺🛎️🔑🪑🧸🎈🎀🎊♻️🎵',
20
- );
21
-
22
- export const toEmoji = (keyAsHex: string) => emoji[parseInt(keyAsHex, 16) % emoji.length];