frst-components 0.21.81 → 0.21.83

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
@@ -3228,7 +3228,7 @@ const InputText$4 = styled__default["default"].div `
3228
3228
  background-color: inherit;
3229
3229
 
3230
3230
  padding: 0;
3231
- margin: 10px 4px 40px 15px;
3231
+ margin: ${({ isPlaceholder }) => isPlaceholder ? '10px 4px 10px 15px' : '10px 4px 40px 15px'};
3232
3232
  border: none;
3233
3233
  `;
3234
3234
  styled__default["default"].div `
@@ -3449,7 +3449,6 @@ const useInputHook = ({ limit, placeholder, onSendMentions, onContentFormat, onC
3449
3449
  const clearDivContent = () => {
3450
3450
  if (!divInputRef.current)
3451
3451
  return;
3452
- setPlaceholder(false);
3453
3452
  if ((divInputRef.current.childNodes.length === 0 && !focus)) {
3454
3453
  // create a textnode with the placeholder
3455
3454
  divInputRef.current.innerText = placeholder;
@@ -3459,8 +3458,9 @@ const useInputHook = ({ limit, placeholder, onSendMentions, onContentFormat, onC
3459
3458
  // loop over all child element and check if they are empty
3460
3459
  let isEmpty = true;
3461
3460
  divInputRef.current.childNodes.forEach((child) => {
3462
- if (child.textContent !== '') {
3461
+ if (child.textContent !== '' && child.textContent != placeholder) {
3463
3462
  isEmpty = false;
3463
+ setPlaceholder(false);
3464
3464
  }
3465
3465
  });
3466
3466
  // if they are empty show the placeholder
@@ -3477,6 +3477,7 @@ const useInputHook = ({ limit, placeholder, onSendMentions, onContentFormat, onC
3477
3477
  p.appendChild(br);
3478
3478
  divInputRef.current.innerHTML = '';
3479
3479
  divInputRef.current.appendChild(p);
3480
+ setPlaceholder(false);
3480
3481
  }
3481
3482
  };
3482
3483
  React.useEffect(() => {
@@ -3505,6 +3506,7 @@ const useInputHook = ({ limit, placeholder, onSendMentions, onContentFormat, onC
3505
3506
  if ((!value || value.length <= 0) && !focus && !replyMentionedUser) {
3506
3507
  divInputRef.current.innerText = placeholder;
3507
3508
  setPlaceholder(true);
3509
+ resizeDiv();
3508
3510
  }
3509
3511
  }, [value]);
3510
3512
  React.useEffect(() => {
@@ -3707,8 +3709,10 @@ function InputComment$1({ placeholder, onChange, limit, users, showCharacterCoun
3707
3709
  }, "data-text": "enter", isPlaceholder: isPlaceholder, suppressContentEditableWarning: true, children: jsxRuntime.jsx("p", { children: jsxRuntime.jsx("br", {}) }) }), showMentions && jsxRuntime.jsx(Mentions, { users: users, top: mentionTopPosition, onSelect: (user) => {
3708
3710
  setShowMention(false);
3709
3711
  handleMentionUser(user);
3710
- } })] }), jsxRuntime.jsx(HelperContainer, { children: showCharacterCounter &&
3711
- jsxRuntime.jsxs(HelperText$2, { isInputLimit: styleLimitExceeded, children: [textLength, "/", limit] }) }), styleLimitExceeded && (jsxRuntime.jsxs(LimitCharsContainer, { children: [jsxRuntime.jsx(TagAlert, {}), jsxRuntime.jsx(LimitCharsExceededMessage, { children: limitMessageExceeded })] }))] }) }));
3712
+ } })] }), jsxRuntime.jsx(HelperContainer, { children: !isPlaceholder ?
3713
+ jsxRuntime.jsxs(HelperText$2, { isInputLimit: styleLimitExceeded, children: [textLength, "/", limit] })
3714
+ :
3715
+ jsxRuntime.jsx(jsxRuntime.Fragment, {}) }), styleLimitExceeded && (jsxRuntime.jsxs(LimitCharsContainer, { children: [jsxRuntime.jsx(TagAlert, {}), jsxRuntime.jsx(LimitCharsExceededMessage, { children: limitMessageExceeded })] }))] }) }));
3712
3716
  }
3713
3717
 
3714
3718
  const HeaderWrapper$1 = styled__default["default"].div `
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/input-comment/index.tsx"],"names":[],"mappings":";AACA,OAAO,yBAAyB,CAAA;AAGhC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAOvC,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,oBAAoB,EAAE,EAAE,aAAa,eAwD9P"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/input-comment/index.tsx"],"names":[],"mappings":";AACA,OAAO,yBAAyB,CAAA;AAGhC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAOvC,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,iBAAiB,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,kBAAkB,EAAE,UAAU,EAAE,oBAAoB,EAAE,EAAE,aAAa,eA0D9P"}
@@ -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,CAAA;IACnB,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IAC5C,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kBAAkB,CAAC,EAAE,IAAI,CAAA;CAC5B;AAED,eAAO,MAAM,YAAY,oHAAqH,UAAU;yBA2HxH,mBAAmB;;;;;;;;;;8BA/Ed,IAAI;;;;CAgPxC,CAAA"}
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,CAAA;IACnB,cAAc,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,IAAI,CAAA;IAC5C,eAAe,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,iBAAiB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;IAC5C,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAA;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kBAAkB,CAAC,EAAE,IAAI,CAAA;CAC5B;AAED,eAAO,MAAM,YAAY,oHAAqH,UAAU;yBA2HxH,mBAAmB;;;;;;;;;;8BA/Ed,IAAI;;;;CAiPxC,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "frst-components",
3
3
  "homepage": "http://FRST-Falconi.github.io/storybook.frstfalconi.com",
4
- "version": "0.21.81",
4
+ "version": "0.21.83",
5
5
  "private": false,
6
6
  "main": "./dist/index.js",
7
7
  "types": "./dist/index.d.ts",