@planningcenter/emoji-keyboard 0.0.0 → 3.38.0-rc.6

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 (72) hide show
  1. package/LICENSE +21 -0
  2. package/package.json +35 -6
  3. package/src/EmojiKeyboard.tsx +15 -0
  4. package/src/EmojiPicker.tsx +85 -0
  5. package/src/assets/emojis.json +13782 -0
  6. package/src/assets/funnel/funnel.png +0 -0
  7. package/src/assets/funnel/index.tsx +11 -0
  8. package/src/assets/icons/PngIcon.tsx +12 -0
  9. package/src/assets/icons/backspace.png +0 -0
  10. package/src/assets/icons/ban.png +0 -0
  11. package/src/assets/icons/clock.png +0 -0
  12. package/src/assets/icons/close.png +0 -0
  13. package/src/assets/icons/flag.png +0 -0
  14. package/src/assets/icons/football.png +0 -0
  15. package/src/assets/icons/lightbulb.png +0 -0
  16. package/src/assets/icons/pizza.png +0 -0
  17. package/src/assets/icons/plane.png +0 -0
  18. package/src/assets/icons/questionMark.png +0 -0
  19. package/src/assets/icons/search.png +0 -0
  20. package/src/assets/icons/smile.png +0 -0
  21. package/src/assets/icons/trees.png +0 -0
  22. package/src/assets/icons/users.png +0 -0
  23. package/src/components/Categories.tsx +169 -0
  24. package/src/components/CategoryItem.tsx +45 -0
  25. package/src/components/ConditionalContainer.tsx +24 -0
  26. package/src/components/DeleteButton.tsx +66 -0
  27. package/src/components/EmojiCategory.tsx +229 -0
  28. package/src/components/EmojiStaticKeyboard.tsx +217 -0
  29. package/src/components/Icon.tsx +52 -0
  30. package/src/components/Knob.tsx +96 -0
  31. package/src/components/ModalWithBackdrop.tsx +83 -0
  32. package/src/components/SearchBar.tsx +108 -0
  33. package/src/components/SingleEmoji.tsx +65 -0
  34. package/src/components/SingleSkinTone.tsx +31 -0
  35. package/src/components/SkinTones.tsx +111 -0
  36. package/src/contexts/KeyboardContext.ts +227 -0
  37. package/src/contexts/KeyboardProvider.tsx +230 -0
  38. package/src/hooks/useKeyboard.ts +32 -0
  39. package/src/hooks/useRecentPicksPersistence.ts +34 -0
  40. package/src/hooks/useTimeout.ts +17 -0
  41. package/src/index.tsx +32 -0
  42. package/src/store/reducers/RecentEmojiReducer.ts +38 -0
  43. package/src/store/reducers/index.ts +11 -0
  44. package/src/store/useKeyboardStore.ts +31 -0
  45. package/src/translation/cs.ts +16 -0
  46. package/src/translation/de.ts +16 -0
  47. package/src/translation/en.ts +16 -0
  48. package/src/translation/es.ts +16 -0
  49. package/src/translation/fr.ts +16 -0
  50. package/src/translation/id.ts +16 -0
  51. package/src/translation/it.ts +16 -0
  52. package/src/translation/ja.ts +16 -0
  53. package/src/translation/ko.ts +16 -0
  54. package/src/translation/no.ts +16 -0
  55. package/src/translation/np.ts +16 -0
  56. package/src/translation/pl.ts +16 -0
  57. package/src/translation/pt.ts +16 -0
  58. package/src/translation/ro.ts +16 -0
  59. package/src/translation/ru.ts +16 -0
  60. package/src/translation/se.ts +17 -0
  61. package/src/translation/tr.ts +16 -0
  62. package/src/translation/ua.ts +16 -0
  63. package/src/translation/vi.ts +16 -0
  64. package/src/types.ts +75 -0
  65. package/src/utils/deepMerge.ts +24 -0
  66. package/src/utils/delay.ts +1 -0
  67. package/src/utils/disallowedSelectedEmojiStyles.ts +22 -0
  68. package/src/utils/exhaustiveTypeCheck.ts +6 -0
  69. package/src/utils/getCategoryIndex.ts +5 -0
  70. package/src/utils/getHeight.ts +2 -0
  71. package/src/utils/parseEmoji.ts +9 -0
  72. package/src/utils/skinToneSelectorUtils.ts +107 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2020 The Widlarz Group sp. z o.o. https://thewidlarzgroup.com/
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/package.json CHANGED
@@ -1,11 +1,40 @@
1
1
  {
2
2
  "name": "@planningcenter/emoji-keyboard",
3
- "version": "0.0.0",
4
- "main": "index.js",
3
+ "version": "3.38.0-rc.6",
4
+ "description": "Vendored fork of rn-emoji-keyboard (MIT, The Widlarz Group) for Planning Center Chat",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/planningcenter/chat-mobile.git",
9
+ "directory": "packages/emoji-keyboard"
10
+ },
11
+ "main": "./src/index.tsx",
12
+ "react-native": "./src/index.tsx",
13
+ "types": "./src/index.tsx",
14
+ "files": [
15
+ "src"
16
+ ],
5
17
  "scripts": {
6
- "test": "echo \"Error: no test specified\" && exit 1"
18
+ "lint": "expo-module lint",
19
+ "test": "expo-module test --passWithNoTests",
20
+ "typecheck": "tsc --noEmit"
21
+ },
22
+ "peerDependencies": {
23
+ "react": "^18.0.0 || ^19.0.0",
24
+ "react-native": "*"
25
+ },
26
+ "devDependencies": {
27
+ "@react-native/eslint-config": "~0.83.0",
28
+ "@types/jest": "^29.5.14",
29
+ "@typescript-eslint/parser": "^8.36.0",
30
+ "eslint": "8.57.1",
31
+ "eslint-plugin-react-compiler": "^19.1.0-rc.2",
32
+ "expo-module-scripts": "^55.0.0",
33
+ "jest": "^29.7.0",
34
+ "prettier": "^3.4.2",
35
+ "react": "19.2.0",
36
+ "react-native": "0.83.6",
37
+ "typescript": "~5.9.2"
7
38
  },
8
- "author": "",
9
- "license": "ISC",
10
- "description": ""
39
+ "gitHead": "7a5b64cf63feef2926593df186709fd6d429e0d0"
11
40
  }
@@ -0,0 +1,15 @@
1
+ import * as React from 'react'
2
+ import { EmojiStaticKeyboard } from './components/EmojiStaticKeyboard'
3
+ import type { KeyboardProps } from './contexts/KeyboardContext'
4
+ import { KeyboardProvider } from './contexts/KeyboardProvider'
5
+
6
+ type EmojiKeyboardProps = Omit<Partial<KeyboardProps>, 'open' | 'onClose'> &
7
+ Pick<KeyboardProps, 'onEmojiSelected'>
8
+
9
+ export const EmojiKeyboard = (props: EmojiKeyboardProps) => {
10
+ return (
11
+ <KeyboardProvider {...props} open={true} onClose={() => {}}>
12
+ <EmojiStaticKeyboard />
13
+ </KeyboardProvider>
14
+ )
15
+ }
@@ -0,0 +1,85 @@
1
+ import * as React from 'react'
2
+ import { Animated, useWindowDimensions } from 'react-native'
3
+ import { EmojiStaticKeyboard } from './components/EmojiStaticKeyboard'
4
+ import { Knob } from './components/Knob'
5
+ import { ModalWithBackdrop } from './components/ModalWithBackdrop'
6
+ import type { KeyboardProps } from './contexts/KeyboardContext'
7
+ import { defaultKeyboardContext } from './contexts/KeyboardContext'
8
+ import { KeyboardProvider } from './contexts/KeyboardProvider'
9
+ import { useKeyboard } from './hooks/useKeyboard'
10
+ import type { EmojiType } from './types'
11
+ import { getHeight } from './utils/getHeight'
12
+
13
+ export const EmojiPicker = ({
14
+ onEmojiSelected,
15
+ onRequestClose,
16
+ open,
17
+ onClose,
18
+ expandable = defaultKeyboardContext.expandable,
19
+ defaultHeight = defaultKeyboardContext.defaultHeight,
20
+ allowMultipleSelections = false,
21
+ ...props
22
+ }: KeyboardProps) => {
23
+ const { height: screenHeight } = useWindowDimensions()
24
+ const offsetY = React.useRef(new Animated.Value(0)).current
25
+ const height = React.useRef(new Animated.Value(getHeight(defaultHeight, screenHeight))).current
26
+ const additionalHeight = React.useRef(new Animated.Value(0)).current
27
+ const { keyboardVisible, keyboardHeight } = useKeyboard(open)
28
+ const [isExpanded, setIsExpanded] = React.useState(false)
29
+
30
+ React.useEffect(() => {
31
+ const shouldExpandHeight = keyboardVisible && !isExpanded
32
+ const newAdditionalHeightValue = shouldExpandHeight ? keyboardHeight : 0
33
+ Animated.timing(additionalHeight, {
34
+ toValue: newAdditionalHeightValue,
35
+ useNativeDriver: false,
36
+ duration: 200,
37
+ }).start()
38
+ }, [additionalHeight, isExpanded, keyboardHeight, keyboardVisible])
39
+
40
+ const close = () => {
41
+ height.setValue(getHeight(defaultHeight, screenHeight))
42
+ offsetY.setValue(0)
43
+ onClose()
44
+ }
45
+
46
+ return (
47
+ <KeyboardProvider
48
+ onEmojiSelected={(emoji: EmojiType) => {
49
+ onEmojiSelected(emoji)
50
+ !allowMultipleSelections && close()
51
+ }}
52
+ open={open}
53
+ onClose={close}
54
+ expandable={expandable}
55
+ defaultHeight={defaultHeight}
56
+ {...props}
57
+ >
58
+ <ModalWithBackdrop
59
+ isOpen={open}
60
+ backdropPress={close}
61
+ onRequestClose={onRequestClose || close}
62
+ >
63
+ <>
64
+ {expandable && (
65
+ <Knob
66
+ height={height}
67
+ offsetY={offsetY}
68
+ onClose={onClose}
69
+ setIsExpanded={setIsExpanded}
70
+ />
71
+ )}
72
+ <Animated.View
73
+ style={[
74
+ {
75
+ height: Animated.add(Animated.subtract(height, offsetY), additionalHeight),
76
+ },
77
+ ]}
78
+ >
79
+ <EmojiStaticKeyboard />
80
+ </Animated.View>
81
+ </>
82
+ </ModalWithBackdrop>
83
+ </KeyboardProvider>
84
+ )
85
+ }