@chayns-components/emoji-input 5.5.26 → 5.5.28

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 (2) hide show
  1. package/AGENTS.md +48 -4
  2. package/package.json +4 -4
package/AGENTS.md CHANGED
@@ -63,20 +63,50 @@ import { EmojiInput } from '@chayns-components/emoji-input';
63
63
 
64
64
  ### Props
65
65
 
66
- No prop documentation available.
66
+ | name | type | required | description |
67
+ | --- | --- | --- | --- |
68
+ | `accessToken` | `string \| undefined` | no | Access token of the logged-in user. Is needed to load and save the history of the emojis. |
69
+ | `container` | `Element \| undefined` | no | The DOM element that should receive the emoji picker popup portal. |
70
+ | `height` | `Height<string \| number> \| undefined` | no | Sets the height of the input field to a fixed value. If this value is not set, the component will use the needed height until the maximum height is reached. |
71
+ | `inputId` | `string \| undefined` | no | HTML id of the input element |
72
+ | `isDisabled` | `boolean \| undefined` | no | Disables the input so that it cannot be changed anymore |
73
+ | `maxHeight` | `MaxHeight<string \| number> \| undefined` | no | Sets the maximum height of the input field. |
74
+ | `onBlur` | `FocusEventHandler<HTMLDivElement> \| undefined` | no | Function that is executed when the input field loses focus. |
75
+ | `onCursorPositionChange` | `((position: number) => void) \| undefined` | no | Function to be executed when the cursor position is changed. |
76
+ | `onFocus` | `FocusEventHandler<HTMLDivElement> \| undefined` | no | Function that is executed when the input field gets the focus. |
77
+ | `onInput` | `((event: ChangeEvent<HTMLDivElement>, originalText: string) => void) \| undefined` | no | Function that is executed when the text of the input changes. In addition to the original<br />event, the original text is returned as second parameter, in which the internally used HTML<br />elements have been converted back to BB codes. |
78
+ | `onKeyDown` | `KeyboardEventHandler<HTMLDivElement> \| undefined` | no | Function that is executed when a key is pressed down. |
79
+ | `onPopupVisibilityChange` | `((isVisible: boolean) => void) \| undefined` | no | Function that is executed when the visibility of the popup changes. |
80
+ | `onPrefixElementRemove` | `(() => void) \| undefined` | no | Function to be executed if the prefixElement is removed. |
81
+ | `personId` | `string \| undefined` | no | Person id of the logged-in user. Is needed to load and save the history of the emojis. |
82
+ | `placeholder` | `string \| ReactElement<any, string \| JSXElementConstructor<any>> \| undefined` | no | Placeholder for the input field |
83
+ | `popupAlignment` | `PopupAlignment \| undefined` | no | Sets the alignment of the popup to a fixed value. If this value is not set, the component<br />calculates the best position on its own. Use the imported 'PopupAlignment' enum to set this<br />value. |
84
+ | `prefixElement` | `string \| undefined` | no | Element that is rendered before the input field but the placeholder is still visible. |
85
+ | `rightElement` | `ReactNode` | no | Element that is rendered inside the EmojiInput on the right side. |
86
+ | `shouldHidePlaceholderOnFocus` | `boolean \| undefined` | no | Whether the placeholder should be shown after the input has focus. |
87
+ | `shouldPreventEmojiPicker` | `boolean \| undefined` | no | Prevents the EmojiPickerPopup icon from being displayed |
88
+ | `shouldRevertAsciiSmileyConversionOnBackspace` | `boolean \| undefined` | no | Allows the most recently auto-converted ASCII smiley to be reverted with Backspace. |
89
+ | `value` | `string` | yes | The plain text value of the input field. Instead of HTML elements BB codes must be used at<br />this point. These are then converted by the input field into corresponding HTML elements. |
67
90
 
68
91
  ### Types
69
92
 
70
- No additional exported types documented.
93
+ - `PopupAlignment` -> `enum PopupAlignment {
94
+ TopLeft,
95
+ BottomLeft,
96
+ TopRight,
97
+ BottomRight,
98
+ }`
71
99
 
72
100
  ### Usage Notes
73
101
 
74
102
  - Import `EmojiInput` directly from `@chayns-components/emoji-input` instead of internal source paths.
75
103
  - Start with one of the documented Storybook examples and adapt the props incrementally for your use case.
104
+ - Pay special attention to required props: `value`.
76
105
 
77
106
  ### Anti Patterns
78
107
 
79
108
  - Avoid imports from internal paths such as `@chayns-components/emoji-input/src/...`; always use the public package export.
109
+ - Avoid incomplete prop objects; follow the documented prop types and required fields.
80
110
  ## EmojiPicker
81
111
 
82
112
  `EmojiPicker` is exported by `@chayns-components/emoji-input` and should be imported from the public package entry point.
@@ -97,7 +127,11 @@ import { EmojiPicker } from '@chayns-components/emoji-input';
97
127
 
98
128
  ### Props
99
129
 
100
- No prop documentation available.
130
+ | name | type | required | description |
131
+ | --- | --- | --- | --- |
132
+ | `accessToken` | `string \| undefined` | no | Access token of the logged-in user. Is needed to load and save the history of the emojis. |
133
+ | `onSelect` | `(emoji: string) => void` | yes | Function executed when an emoji is selected in the popup |
134
+ | `personId` | `string \| undefined` | no | Person id of the logged-in user. Is needed to load and save the history of the emojis. |
101
135
 
102
136
  ### Types
103
137
 
@@ -107,10 +141,12 @@ No additional exported types documented.
107
141
 
108
142
  - Import `EmojiPicker` directly from `@chayns-components/emoji-input` instead of internal source paths.
109
143
  - Start with one of the documented Storybook examples and adapt the props incrementally for your use case.
144
+ - Pay special attention to required props: `onSelect`.
110
145
 
111
146
  ### Anti Patterns
112
147
 
113
148
  - Avoid imports from internal paths such as `@chayns-components/emoji-input/src/...`; always use the public package export.
149
+ - Avoid incomplete prop objects; follow the documented prop types and required fields.
114
150
  ## EmojiPickerPopup
115
151
 
116
152
  `EmojiPickerPopup` is exported by `@chayns-components/emoji-input` and should be imported from the public package entry point.
@@ -131,7 +167,13 @@ import { EmojiPickerPopup } from '@chayns-components/emoji-input';
131
167
 
132
168
  ### Props
133
169
 
134
- No prop documentation available.
170
+ | name | type | required | description |
171
+ | --- | --- | --- | --- |
172
+ | `accessToken` | `string \| undefined` | no | Access token of the logged-in user. Is needed to load and save the history of the emojis. |
173
+ | `container` | `Element \| undefined` | no | The DOM element that should receive the popup portal. |
174
+ | `onPopupVisibilityChange` | `((isVisible: boolean) => void) \| undefined` | no | Function that is executed when the visibility of the popup changes. |
175
+ | `onSelect` | `(emoji: string) => void` | yes | Function executed when an emoji is selected in the popup |
176
+ | `personId` | `string \| undefined` | no | Person id of the logged-in user. Is needed to load and save the history of the emojis. |
135
177
 
136
178
  ### Types
137
179
 
@@ -141,7 +183,9 @@ No additional exported types documented.
141
183
 
142
184
  - Import `EmojiPickerPopup` directly from `@chayns-components/emoji-input` instead of internal source paths.
143
185
  - Start with one of the documented Storybook examples and adapt the props incrementally for your use case.
186
+ - Pay special attention to required props: `onSelect`.
144
187
 
145
188
  ### Anti Patterns
146
189
 
147
190
  - Avoid imports from internal paths such as `@chayns-components/emoji-input/src/...`; always use the public package export.
191
+ - Avoid incomplete prop objects; follow the documented prop types and required fields.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chayns-components/emoji-input",
3
- "version": "5.5.26",
3
+ "version": "5.5.28",
4
4
  "description": "Input field that supports HTML elements and emojis",
5
5
  "sideEffects": false,
6
6
  "browserslist": [
@@ -75,8 +75,8 @@
75
75
  "vitest": "^1.6.1"
76
76
  },
77
77
  "dependencies": {
78
- "@chayns-components/core": "^5.5.26",
79
- "@chayns-components/textstring": "^5.5.24",
78
+ "@chayns-components/core": "^5.5.28",
79
+ "@chayns-components/textstring": "^5.5.28",
80
80
  "emojilib": "^3.0.12",
81
81
  "react-compiler-runtime": "^1.0.0",
82
82
  "unicode-emoji-json": "^0.9.0"
@@ -91,5 +91,5 @@
91
91
  "publishConfig": {
92
92
  "access": "public"
93
93
  },
94
- "gitHead": "92d9195193d59f3180f001b3545b34167476d6a7"
94
+ "gitHead": "20b5354c0ee43c56e9919589f6b3bad7cf6b14bb"
95
95
  }