frst-components 0.22.17 → 0.22.18
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/index.js
CHANGED
|
@@ -3584,12 +3584,14 @@ const useInputHook = ({ limit, placeholder, onSendMentions, onContentFormat, onC
|
|
|
3584
3584
|
console.log(`placeholder segundo if divInputRef.current.childNodes.length >= 1 resultado = ${divInputRef.current.childNodes.length >= 1}`);
|
|
3585
3585
|
if ((divInputRef.current.childNodes.length === 0 && !focus)) {
|
|
3586
3586
|
console.log(`placeholder vou incluir o placeholder`);
|
|
3587
|
+
debugger;
|
|
3587
3588
|
// create a textnode with the placeholder
|
|
3588
3589
|
divInputRef.current.innerText = placeholder;
|
|
3589
3590
|
setPlaceholder(true);
|
|
3590
3591
|
}
|
|
3591
3592
|
else if (!focus && divInputRef.current.childNodes.length >= 1) {
|
|
3592
|
-
|
|
3593
|
+
debugger;
|
|
3594
|
+
console.log(`placeholder vou incluir 2 o placeholder`);
|
|
3593
3595
|
// loop over all child element and check if they are empty
|
|
3594
3596
|
let isEmpty = true;
|
|
3595
3597
|
divInputRef.current.childNodes.forEach((child) => {
|
|
@@ -3612,6 +3614,7 @@ const useInputHook = ({ limit, placeholder, onSendMentions, onContentFormat, onC
|
|
|
3612
3614
|
}
|
|
3613
3615
|
else if (divInputRef.current.innerText === placeholder) {
|
|
3614
3616
|
console.log(`placeholder terceiro divInputRef.current.innerText === placeholder resultado = ${divInputRef.current.innerText === placeholder}`);
|
|
3617
|
+
debugger;
|
|
3615
3618
|
// create a paragraph node
|
|
3616
3619
|
divInputRef.current.innerHTML = '';
|
|
3617
3620
|
// clear complete the div
|
|
@@ -3893,7 +3896,7 @@ const Mentions = (mention) => {
|
|
|
3893
3896
|
|
|
3894
3897
|
function InputComment$1({ placeholder, onChange, limit, users, showCharacterCounter, styles, onSendMentions, onContentFormat, onContentUnformat, disabled, className, value, replyMentionedUser, group_uuid, limitMessageExceeded }) {
|
|
3895
3898
|
const { handleInput, isPlaceholder, focus, divInputRef, handleMentionUser, mentionTopPosition, setShowMention, showMention, textLength, styleLimitExceeded } = useInputHook({ limit, placeholder, onContentFormat, onContentUnformat, onSendMentions, onChange, value, replyMentionedUser });
|
|
3896
|
-
return (jsxRuntime.jsx(styled.ThemeProvider, { theme: FRSTTheme, children: jsxRuntime.jsxs("div", { style: { minHeight: '48px', ...styles }, tabIndex: 0, children: [jsxRuntime.jsxs(InputWrapper$2, { focus: focus, tabIndex: 1, isPlaceholder: isPlaceholder, isInputLimit: styleLimitExceeded, children: [jsxRuntime.jsx(InputText$4, { tabIndex: 2, contentEditable: true, ref: divInputRef, onKeyUpCapture: (event) => {
|
|
3899
|
+
return (jsxRuntime.jsx(styled.ThemeProvider, { theme: FRSTTheme, children: jsxRuntime.jsxs("div", { style: { minHeight: '48px', ...styles }, tabIndex: 0, contentEditable: false, children: [jsxRuntime.jsxs(InputWrapper$2, { focus: focus, tabIndex: 1, isPlaceholder: isPlaceholder, isInputLimit: styleLimitExceeded, contentEditable: false, children: [jsxRuntime.jsx(InputText$4, { tabIndex: 2, contentEditable: true, ref: divInputRef, onKeyUpCapture: (event) => {
|
|
3897
3900
|
handleInput(event);
|
|
3898
3901
|
}, "data-text": "enter", isPlaceholder: isPlaceholder, suppressContentEditableWarning: true, children: jsxRuntime.jsx("p", { children: jsxRuntime.jsx("br", {}) }) }), showMention && users && users.length > 0 && jsxRuntime.jsx(Mentions, { users: users, top: mentionTopPosition, onSelect: (user) => {
|
|
3899
3902
|
setShowMention(false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useInputHook.d.ts","sourceRoot":"","sources":["../../../../src/components/input-comment/useInputHook.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAC;AAE3D,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,UAAU,UAAU;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAA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