@chayns-components/emoji-input 5.5.29 → 5.5.31-alpha.0

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 (28) hide show
  1. package/AGENTS.md +6 -1
  2. package/lib/cjs/components/emoji-input/EmojiInput.js +28 -10
  3. package/lib/cjs/components/emoji-input/EmojiInput.js.map +1 -1
  4. package/lib/cjs/components/emoji-input/EmojiInput.styles.js +1 -0
  5. package/lib/cjs/components/emoji-input/EmojiInput.styles.js.map +1 -1
  6. package/lib/cjs/components/emoji-picker/EmojiPicker.js.map +1 -1
  7. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js +3 -3
  8. package/lib/cjs/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js.map +1 -1
  9. package/lib/cjs/components/emoji-picker-popup/EmojiPickerPopup.js +45 -5
  10. package/lib/cjs/components/emoji-picker-popup/EmojiPickerPopup.js.map +1 -1
  11. package/lib/cjs/components/emoji-picker-popup/EmojiPickerPopup.styles.js +14 -0
  12. package/lib/cjs/components/emoji-picker-popup/EmojiPickerPopup.styles.js.map +1 -1
  13. package/lib/esm/components/emoji-input/EmojiInput.js +20 -3
  14. package/lib/esm/components/emoji-input/EmojiInput.js.map +1 -1
  15. package/lib/esm/components/emoji-input/EmojiInput.styles.js +1 -0
  16. package/lib/esm/components/emoji-input/EmojiInput.styles.js.map +1 -1
  17. package/lib/esm/components/emoji-picker/EmojiPicker.js.map +1 -1
  18. package/lib/esm/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js +3 -3
  19. package/lib/esm/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.js.map +1 -1
  20. package/lib/esm/components/emoji-picker-popup/EmojiPickerPopup.js +45 -6
  21. package/lib/esm/components/emoji-picker-popup/EmojiPickerPopup.js.map +1 -1
  22. package/lib/esm/components/emoji-picker-popup/EmojiPickerPopup.styles.js +14 -0
  23. package/lib/esm/components/emoji-picker-popup/EmojiPickerPopup.styles.js.map +1 -1
  24. package/lib/types/components/emoji-input/EmojiInput.d.ts +9 -0
  25. package/lib/types/components/emoji-picker/EmojiPicker.d.ts +1 -1
  26. package/lib/types/components/emoji-picker/emoji-picker-emojis/EmojiPickerEmojis.d.ts +1 -1
  27. package/lib/types/components/emoji-picker-popup/EmojiPickerPopup.d.ts +12 -0
  28. package/package.json +4 -4
@@ -1 +1 @@
1
- {"version":3,"file":"EmojiPickerPopup.js","names":["AreaProvider","Icon","Popup","React","useCallback","useEffect","useRef","EmojiPicker","StyledEmojiPickerPopup","EmojiPickerPopup","accessToken","container","onPopupVisibilityChange","onSelect","personId","popupRef","handleKeyPress","event","key","shiftKey","current","hide","document","addEventListener","removeEventListener","createElement","ref","onHide","undefined","onShow","content","shouldChangeColor","className","icons","size","displayName"],"sources":["../../../../src/components/emoji-picker-popup/EmojiPickerPopup.tsx"],"sourcesContent":["import { AreaProvider, Icon, Popup, PopupAlignment, type PopupRef } from '@chayns-components/core';\nimport React, { FC, useCallback, useEffect, useRef } from 'react';\nimport EmojiPicker from '../emoji-picker/EmojiPicker';\nimport { StyledEmojiPickerPopup } from './EmojiPickerPopup.styles';\n\nexport type EmojiPickerPopupProps = {\n /**\n * Access token of the logged-in user. Is needed to load and save the history of the emojis.\n */\n accessToken?: string;\n /**\n * The DOM element that should receive the popup portal.\n */\n container?: Element;\n /**\n * Function that is executed when the visibility of the popup changes.\n * @param {boolean} isVisible - Whether the popup is visible or not\n */\n onPopupVisibilityChange?: (isVisible: boolean) => void;\n /**\n * Person id of the logged-in user. Is needed to load and save the history of the emojis.\n */\n personId?: string;\n /**\n * Function executed when an emoji is selected in the popup\n * @param {string} emoji - Emoji that was selected\n */\n onSelect: (emoji: string) => void;\n};\n\nconst EmojiPickerPopup: FC<EmojiPickerPopupProps> = ({\n accessToken,\n container,\n onPopupVisibilityChange,\n onSelect,\n personId,\n}) => {\n const popupRef = useRef<PopupRef>(null);\n\n const handleKeyPress = useCallback((event: KeyboardEvent) => {\n if (event.key === 'Escape' && !event.shiftKey) {\n popupRef.current?.hide();\n }\n }, []);\n\n useEffect(() => {\n document.addEventListener('keydown', handleKeyPress);\n\n return () => {\n document.removeEventListener('keydown', handleKeyPress);\n };\n }, [handleKeyPress]);\n\n return (\n <StyledEmojiPickerPopup>\n <Popup\n container={container}\n ref={popupRef}\n onHide={() =>\n typeof onPopupVisibilityChange === 'function'\n ? onPopupVisibilityChange(false)\n : undefined\n }\n onShow={() =>\n typeof onPopupVisibilityChange === 'function'\n ? onPopupVisibilityChange(true)\n : undefined\n }\n content={\n <AreaProvider shouldChangeColor={false}>\n <EmojiPicker\n accessToken={accessToken}\n onSelect={onSelect}\n personId={personId}\n />\n </AreaProvider>\n }\n >\n <Icon className=\"prevent-lose-focus\" icons={['far fa-smile']} size={18} />\n </Popup>\n </StyledEmojiPickerPopup>\n );\n};\n\nEmojiPickerPopup.displayName = 'EmojiPickerPopup';\n\nexport default EmojiPickerPopup;\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,IAAI,EAAEC,KAAK,QAAuC,yBAAyB;AAClG,OAAOC,KAAK,IAAQC,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACjE,OAAOC,WAAW,MAAM,6BAA6B;AACrD,SAASC,sBAAsB,QAAQ,2BAA2B;AA2BlE,MAAMC,gBAA2C,GAAGA,CAAC;EACjDC,WAAW;EACXC,SAAS;EACTC,uBAAuB;EACvBC,QAAQ;EACRC;AACJ,CAAC,KAAK;EACF,MAAMC,QAAQ,GAAGT,MAAM,CAAW,IAAI,CAAC;EAEvC,MAAMU,cAAc,GAAGZ,WAAW,CAAEa,KAAoB,IAAK;IACzD,IAAIA,KAAK,CAACC,GAAG,KAAK,QAAQ,IAAI,CAACD,KAAK,CAACE,QAAQ,EAAE;MAC3CJ,QAAQ,CAACK,OAAO,EAAEC,IAAI,CAAC,CAAC;IAC5B;EACJ,CAAC,EAAE,EAAE,CAAC;EAENhB,SAAS,CAAC,MAAM;IACZiB,QAAQ,CAACC,gBAAgB,CAAC,SAAS,EAAEP,cAAc,CAAC;IAEpD,OAAO,MAAM;MACTM,QAAQ,CAACE,mBAAmB,CAAC,SAAS,EAAER,cAAc,CAAC;IAC3D,CAAC;EACL,CAAC,EAAE,CAACA,cAAc,CAAC,CAAC;EAEpB,oBACIb,KAAA,CAAAsB,aAAA,CAACjB,sBAAsB,qBACnBL,KAAA,CAAAsB,aAAA,CAACvB,KAAK;IACFS,SAAS,EAAEA,SAAU;IACrBe,GAAG,EAAEX,QAAS;IACdY,MAAM,EAAEA,CAAA,KACJ,OAAOf,uBAAuB,KAAK,UAAU,GACvCA,uBAAuB,CAAC,KAAK,CAAC,GAC9BgB,SACT;IACDC,MAAM,EAAEA,CAAA,KACJ,OAAOjB,uBAAuB,KAAK,UAAU,GACvCA,uBAAuB,CAAC,IAAI,CAAC,GAC7BgB,SACT;IACDE,OAAO,eACH3B,KAAA,CAAAsB,aAAA,CAACzB,YAAY;MAAC+B,iBAAiB,EAAE;IAAM,gBACnC5B,KAAA,CAAAsB,aAAA,CAAClB,WAAW;MACRG,WAAW,EAAEA,WAAY;MACzBG,QAAQ,EAAEA,QAAS;MACnBC,QAAQ,EAAEA;IAAS,CACtB,CACS;EACjB,gBAEDX,KAAA,CAAAsB,aAAA,CAACxB,IAAI;IAAC+B,SAAS,EAAC,oBAAoB;IAACC,KAAK,EAAE,CAAC,cAAc,CAAE;IAACC,IAAI,EAAE;EAAG,CAAE,CACtE,CACa,CAAC;AAEjC,CAAC;AAEDzB,gBAAgB,CAAC0B,WAAW,GAAG,kBAAkB;AAEjD,eAAe1B,gBAAgB","ignoreList":[]}
1
+ {"version":3,"file":"EmojiPickerPopup.js","names":["AreaProvider","Icon","Popup","useFocusRingPortal","useKeyboardFocusHighlighting","React","useCallback","useEffect","useRef","EmojiPicker","StyledEmojiPickerPopup","EmojiPickerPopup","accessToken","container","isDisabled","onPopupVisibilityChange","onSelect","onSelectWithKeyboard","personId","shouldEnableKeyboardHighlighting","popupRef","triggerRef","shouldShowKeyboardHighlighting","isEnabled","shape","padding","handleKeyPress","event","key","shiftKey","current","hide","handleTriggerKeyDown","preventDefault","show","handleSelect","emoji","shouldRestoreInputFocus","document","addEventListener","removeEventListener","createElement","ref","onHide","undefined","onShow","content","shouldChangeColor","className","disabled","onClick","stopPropagation","onKeyDown","tabIndex","type","icons","size","displayName"],"sources":["../../../../src/components/emoji-picker-popup/EmojiPickerPopup.tsx"],"sourcesContent":["import {\n AreaProvider,\n Icon,\n Popup,\n PopupAlignment,\n useFocusRingPortal,\n useKeyboardFocusHighlighting,\n type PopupRef,\n} from '@chayns-components/core';\nimport React, { FC, KeyboardEventHandler, useCallback, useEffect, useRef } from 'react';\nimport EmojiPicker from '../emoji-picker/EmojiPicker';\nimport { StyledEmojiPickerPopup } from './EmojiPickerPopup.styles';\n\nexport type EmojiPickerPopupProps = {\n /**\n * Access token of the logged-in user. Is needed to load and save the history of the emojis.\n */\n accessToken?: string;\n /**\n * The DOM element that should receive the popup portal.\n */\n container?: Element;\n /**\n * Whether the picker trigger is disabled.\n */\n isDisabled?: boolean;\n /**\n * Function that is executed when the visibility of the popup changes.\n * @param {boolean} isVisible - Whether the popup is visible or not\n */\n onPopupVisibilityChange?: (isVisible: boolean) => void;\n /**\n * Person id of the logged-in user. Is needed to load and save the history of the emojis.\n */\n personId?: string;\n /**\n * Function executed when an emoji is selected in the popup\n * @param {string} emoji - Emoji that was selected\n */\n onSelect: (emoji: string) => void;\n /**\n * Enables keyboard-only focus highlighting for the picker trigger.\n */\n shouldEnableKeyboardHighlighting?: boolean;\n /**\n * Receives focus after an emoji is selected with the keyboard.\n */\n onSelectWithKeyboard?: (emoji: string) => void;\n};\n\nconst EmojiPickerPopup: FC<EmojiPickerPopupProps> = ({\n accessToken,\n container,\n isDisabled,\n onPopupVisibilityChange,\n onSelect,\n onSelectWithKeyboard,\n personId,\n shouldEnableKeyboardHighlighting,\n}) => {\n const popupRef = useRef<PopupRef>(null);\n const triggerRef = useRef<HTMLButtonElement>(null);\n const shouldShowKeyboardHighlighting = useKeyboardFocusHighlighting(\n isDisabled ? false : shouldEnableKeyboardHighlighting,\n );\n\n useFocusRingPortal(triggerRef, {\n isEnabled: shouldShowKeyboardHighlighting,\n shape: 'circle',\n padding: 4,\n });\n\n const handleKeyPress = useCallback((event: KeyboardEvent) => {\n if (event.key === 'Escape' && !event.shiftKey) {\n popupRef.current?.hide();\n }\n }, []);\n\n const handleTriggerKeyDown = useCallback<KeyboardEventHandler<HTMLButtonElement>>(\n (event) => {\n if (isDisabled) {\n return;\n }\n\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault();\n popupRef.current?.show();\n }\n },\n [isDisabled],\n );\n\n const handleSelect = useCallback(\n (emoji: string, shouldRestoreInputFocus?: boolean) => {\n onSelect(emoji);\n\n if (shouldRestoreInputFocus) {\n onSelectWithKeyboard?.(emoji);\n }\n },\n [onSelect, onSelectWithKeyboard],\n );\n\n useEffect(() => {\n document.addEventListener('keydown', handleKeyPress);\n\n return () => {\n document.removeEventListener('keydown', handleKeyPress);\n };\n }, [handleKeyPress]);\n\n return (\n <StyledEmojiPickerPopup aria-hidden={isDisabled}>\n <Popup\n container={container}\n ref={popupRef}\n onHide={() =>\n typeof onPopupVisibilityChange === 'function'\n ? onPopupVisibilityChange(false)\n : undefined\n }\n onShow={() =>\n typeof onPopupVisibilityChange === 'function'\n ? onPopupVisibilityChange(true)\n : undefined\n }\n content={\n <AreaProvider shouldChangeColor={false}>\n <EmojiPicker\n accessToken={accessToken}\n onSelect={handleSelect}\n personId={personId}\n />\n </AreaProvider>\n }\n >\n <button\n aria-label=\"Open emoji picker\"\n className=\"prevent-lose-focus\"\n disabled={isDisabled}\n onClick={(event) => {\n if (isDisabled) {\n event.stopPropagation();\n }\n }}\n onKeyDown={handleTriggerKeyDown}\n ref={triggerRef}\n tabIndex={isDisabled ? -1 : 0}\n type=\"button\"\n >\n <Icon icons={['far fa-smile']} size={18} />\n </button>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,mBAAmB;IAC9BO,SAAS,EAAC,oBAAoB;IAC9BC,QAAQ,EAAEnC,UAAW;IACrBoC,OAAO,EAAGvB,KAAK,IAAK;MAChB,IAAIb,UAAU,EAAE;QACZa,KAAK,CAACwB,eAAe,CAAC,CAAC;MAC3B;IACJ,CAAE;IACFC,SAAS,EAAEpB,oBAAqB;IAChCU,GAAG,EAAErB,UAAW;IAChBgC,QAAQ,EAAEvC,UAAU,GAAG,CAAC,CAAC,GAAG,CAAE;IAC9BwC,IAAI,EAAC;EAAQ,gBAEbjD,KAAA,CAAAoC,aAAA,CAACxC,IAAI;IAACsD,KAAK,EAAE,CAAC,cAAc,CAAE;IAACC,IAAI,EAAE;EAAG,CAAE,CACtC,CACL,CACa,CAAC;AAEjC,CAAC;AAED7C,gBAAgB,CAAC8C,WAAW,GAAG,kBAAkB;AAEjD,eAAe9C,gBAAgB","ignoreList":[]}
@@ -4,5 +4,19 @@ export const StyledEmojiPickerPopup = styled.div`
4
4
  display: flex;
5
5
  height: ${() => getComputedStyle(document.body).getPropertyValue('line-height')};
6
6
  position: relative;
7
+
8
+ button {
9
+ background: none;
10
+ border: 0;
11
+ color: inherit;
12
+ cursor: pointer;
13
+ font: inherit;
14
+ padding: 0;
15
+
16
+ &:disabled {
17
+ cursor: default;
18
+ opacity: 0.5;
19
+ }
20
+ }
7
21
  `;
8
22
  //# sourceMappingURL=EmojiPickerPopup.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EmojiPickerPopup.styles.js","names":["styled","StyledEmojiPickerPopup","div","getComputedStyle","document","body","getPropertyValue"],"sources":["../../../../src/components/emoji-picker-popup/EmojiPickerPopup.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledEmojiPickerPopup = styled.div`\n align-items: center;\n display: flex;\n height: ${() => getComputedStyle(document.body).getPropertyValue('line-height')};\n position: relative;\n`;\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAEtC,OAAO,MAAMC,sBAAsB,GAAGD,MAAM,CAACE,GAAG;AAChD;AACA;AACA,cAAc,MAAMC,gBAAgB,CAACC,QAAQ,CAACC,IAAI,CAAC,CAACC,gBAAgB,CAAC,aAAa,CAAC;AACnF;AACA,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"EmojiPickerPopup.styles.js","names":["styled","StyledEmojiPickerPopup","div","getComputedStyle","document","body","getPropertyValue"],"sources":["../../../../src/components/emoji-picker-popup/EmojiPickerPopup.styles.ts"],"sourcesContent":["import styled from 'styled-components';\n\nexport const StyledEmojiPickerPopup = styled.div`\n align-items: center;\n display: flex;\n height: ${() => getComputedStyle(document.body).getPropertyValue('line-height')};\n position: relative;\n\n button {\n background: none;\n border: 0;\n color: inherit;\n cursor: pointer;\n font: inherit;\n padding: 0;\n\n &:disabled {\n cursor: default;\n opacity: 0.5;\n }\n }\n`;\n"],"mappings":"AAAA,OAAOA,MAAM,MAAM,mBAAmB;AAEtC,OAAO,MAAMC,sBAAsB,GAAGD,MAAM,CAACE,GAAG;AAChD;AACA;AACA,cAAc,MAAMC,gBAAgB,CAACC,QAAQ,CAACC,IAAI,CAAC,CAACC,gBAAgB,CAAC,aAAa,CAAC;AACnF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC","ignoreList":[]}
@@ -91,6 +91,15 @@ export type EmojiInputProps = {
91
91
  * Prevents the EmojiPickerPopup icon from being displayed
92
92
  */
93
93
  shouldPreventEmojiPicker?: boolean;
94
+ /**
95
+ * Enables keyboard-only focus highlighting.
96
+ */
97
+ shouldEnableKeyboardHighlighting?: boolean;
98
+ /**
99
+ * Disables keyboard-only focus highlighting for the editor while preserving it for child controls.
100
+ * @optional
101
+ */
102
+ shouldDisableEditorKeyboardHighlighting?: boolean;
94
103
  /**
95
104
  * The plain text value of the input field. Instead of HTML elements BB codes must be used at
96
105
  * this point. These are then converted by the input field into corresponding HTML elements.
@@ -8,7 +8,7 @@ export type EmojiPickerProps = {
8
8
  * Function executed when an emoji is selected in the popup
9
9
  * @param {string} emoji - Emoji that was selected
10
10
  */
11
- onSelect: (emoji: string) => void;
11
+ onSelect: (emoji: string, shouldRestoreInputFocus?: boolean) => void;
12
12
  /**
13
13
  * Person id of the logged-in user. Is needed to load and save the history of the emojis.
14
14
  */
@@ -2,7 +2,7 @@ import { FC } from 'react';
2
2
  import type { Category } from '../../../types/category';
3
3
  export type EmojiPickerEmojisProps = {
4
4
  accessToken?: string;
5
- onSelect: (emoji: string) => void;
5
+ onSelect: (emoji: string, shouldRestoreInputFocus?: boolean) => void;
6
6
  personId?: string;
7
7
  searchString: string;
8
8
  selectedCategory: Category;
@@ -8,6 +8,10 @@ export type EmojiPickerPopupProps = {
8
8
  * The DOM element that should receive the popup portal.
9
9
  */
10
10
  container?: Element;
11
+ /**
12
+ * Whether the picker trigger is disabled.
13
+ */
14
+ isDisabled?: boolean;
11
15
  /**
12
16
  * Function that is executed when the visibility of the popup changes.
13
17
  * @param {boolean} isVisible - Whether the popup is visible or not
@@ -22,6 +26,14 @@ export type EmojiPickerPopupProps = {
22
26
  * @param {string} emoji - Emoji that was selected
23
27
  */
24
28
  onSelect: (emoji: string) => void;
29
+ /**
30
+ * Enables keyboard-only focus highlighting for the picker trigger.
31
+ */
32
+ shouldEnableKeyboardHighlighting?: boolean;
33
+ /**
34
+ * Receives focus after an emoji is selected with the keyboard.
35
+ */
36
+ onSelectWithKeyboard?: (emoji: string) => void;
25
37
  };
26
38
  declare const EmojiPickerPopup: FC<EmojiPickerPopupProps>;
27
39
  export default EmojiPickerPopup;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chayns-components/emoji-input",
3
- "version": "5.5.29",
3
+ "version": "5.5.31-alpha.0",
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.29",
79
- "@chayns-components/textstring": "^5.5.28",
78
+ "@chayns-components/core": "^5.5.31-alpha.0",
79
+ "@chayns-components/textstring": "^5.5.31-alpha.0",
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": "f8e901fa5342d0b0b294c12955bc68dddb31bcb8"
94
+ "gitHead": "7619ce466c615fadd5eb31f93c24a252683aff0e"
95
95
  }