pixel-react 1.14.51 → 1.14.52
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/lib/components/CreateVariable/CreateVariableSlider.js +15 -7
- package/lib/components/CreateVariable/CreateVariableSlider.js.map +1 -1
- package/lib/components/MenuOption/MenuOption.js +7 -2
- package/lib/components/MenuOption/MenuOption.js.map +1 -1
- package/lib/components/NLPInput/NlpInput.js +2 -2
- package/lib/components/NLPInput/NlpInput.js.map +1 -1
- package/lib/components/NLPInput/components/ChipsFolder/ChipsAccordion.js +2 -2
- package/lib/components/NLPInput/components/ChipsFolder/ChipsAccordion.js.map +1 -1
- package/lib/components/TextEditor/TextEditor.js +38 -35
- package/lib/components/TextEditor/TextEditor.js.map +1 -1
- package/lib/index.cjs +61 -45
- package/lib/index.cjs.map +1 -1
- package/lib/styles.css +1 -1
- package/lib/styles.css.map +1 -1
- package/package.json +1 -1
package/lib/index.cjs
CHANGED
@@ -6874,7 +6874,7 @@ const Option$1 = ({
|
|
6874
6874
|
children: option.label
|
6875
6875
|
})]
|
6876
6876
|
});
|
6877
|
-
const calculatePosition = (menuPosition, dropdownPlacement, optionCardHeight, optionCardWidth) => {
|
6877
|
+
const calculatePosition = (menuPosition, dropdownPlacement, optionCardHeight, optionCardWidth, isAddResourceButton) => {
|
6878
6878
|
const {
|
6879
6879
|
top,
|
6880
6880
|
left,
|
@@ -6896,6 +6896,11 @@ const calculatePosition = (menuPosition, dropdownPlacement, optionCardHeight, op
|
|
6896
6896
|
break;
|
6897
6897
|
case 'down':
|
6898
6898
|
newTop = availableSpace.bottom > optionCardHeight + gap ? top + height + gap : top - optionCardHeight - gap;
|
6899
|
+
if (isAddResourceButton) {
|
6900
|
+
if (!(availableSpace?.bottom > optionCardHeight + gap)) {
|
6901
|
+
newLeft = left + 50;
|
6902
|
+
}
|
6903
|
+
}
|
6899
6904
|
break;
|
6900
6905
|
case 'left':
|
6901
6906
|
newLeft = availableSpace.left > width + gap ? left - width - gap : left + width + gap;
|
@@ -6946,7 +6951,7 @@ const OptionCard = ({
|
|
6946
6951
|
setOptionCardWidth(optionCardRef.current.offsetWidth);
|
6947
6952
|
}
|
6948
6953
|
}, [options]);
|
6949
|
-
const style = calculatePosition(menuPosition, dropdownPlacement, optionCardHeight, optionCardWidth);
|
6954
|
+
const style = calculatePosition(menuPosition, dropdownPlacement, optionCardHeight, optionCardWidth, isAddResourceButton);
|
6950
6955
|
return /*#__PURE__*/ReactDOM.createPortal(jsxRuntime.jsx("div", {
|
6951
6956
|
className: classNames('ff-option-card', {
|
6952
6957
|
'ff-option-card--primary': variant === 'primary'
|
@@ -34929,7 +34934,7 @@ const ChipsAccordion = /*#__PURE__*/React.forwardRef(({
|
|
34929
34934
|
React.useEffect(() => {
|
34930
34935
|
checkOverflow();
|
34931
34936
|
}, [filterData]);
|
34932
|
-
React.
|
34937
|
+
React.useLayoutEffect(() => {
|
34933
34938
|
const handleUpdate = () => {
|
34934
34939
|
if (!inputRef?.current) return;
|
34935
34940
|
const {
|
@@ -35231,7 +35236,7 @@ const NlpInput = ({
|
|
35231
35236
|
document.body.style.paddingRight = isEnabled ? '' : `${bodyScrollWidth}px`;
|
35232
35237
|
document.body.style.overflow = isEnabled ? '' : 'hidden';
|
35233
35238
|
};
|
35234
|
-
React.
|
35239
|
+
React.useLayoutEffect(() => {
|
35235
35240
|
if (disabled) return;
|
35236
35241
|
if (showOptions) {
|
35237
35242
|
onSelectToggleScroll(!showOptions);
|
@@ -48700,15 +48705,18 @@ const CreateVariableSlider = ({
|
|
48700
48705
|
const [helperText, setHelperText] = React.useState('');
|
48701
48706
|
const [hashInputValue, setHashInputValue] = React.useState();
|
48702
48707
|
const [isSubmitting, setIsSubmitting] = React.useState(false);
|
48708
|
+
const [hasChanges, setHasChanges] = React.useState(false);
|
48703
48709
|
const [initialValues, setInitialValues] = React.useState({
|
48704
48710
|
name: '',
|
48705
|
-
value: ''
|
48711
|
+
value: '',
|
48712
|
+
isChecked: false
|
48706
48713
|
});
|
48707
48714
|
React.useEffect(() => {
|
48708
48715
|
if (isOpen && mode === 'edit') {
|
48709
48716
|
setInitialValues({
|
48710
48717
|
name: variableName,
|
48711
|
-
value: variableValue
|
48718
|
+
value: variableValue,
|
48719
|
+
isChecked: hideValue
|
48712
48720
|
});
|
48713
48721
|
}
|
48714
48722
|
}, []);
|
@@ -48749,10 +48757,15 @@ const CreateVariableSlider = ({
|
|
48749
48757
|
const isValid = isNonEmpty && matchesPattern && noWhitespaceEdges && lengthValid;
|
48750
48758
|
return isValid;
|
48751
48759
|
}
|
48752
|
-
|
48753
|
-
if (mode !== 'edit') return
|
48754
|
-
|
48755
|
-
|
48760
|
+
React.useEffect(() => {
|
48761
|
+
if (mode !== 'edit') return;
|
48762
|
+
const {
|
48763
|
+
name,
|
48764
|
+
value,
|
48765
|
+
isChecked
|
48766
|
+
} = initialValues;
|
48767
|
+
setHasChanges(variableName !== name || variableValue !== value || hideValue !== isChecked);
|
48768
|
+
}, [mode, variableName, variableValue, hideValue, initialValues]);
|
48756
48769
|
const FooterContent = () => {
|
48757
48770
|
return jsxRuntime.jsxs("div", {
|
48758
48771
|
className: "ff-create-slider-footer",
|
@@ -115001,15 +115014,44 @@ const TextEditor = ({
|
|
115001
115014
|
return jsxRuntime.jsxs("div", {
|
115002
115015
|
className: "ff-textEditor-container",
|
115003
115016
|
children: [jsxRuntime.jsxs("div", {
|
115004
|
-
className: "ff-
|
115005
|
-
children: [
|
115006
|
-
className: "
|
115007
|
-
children:
|
115008
|
-
|
115009
|
-
|
115010
|
-
|
115011
|
-
|
115012
|
-
|
115017
|
+
className: "ff-title-button",
|
115018
|
+
children: [jsxRuntime.jsxs("div", {
|
115019
|
+
className: "ff-textEditor-label-asterisk-container",
|
115020
|
+
children: [required && jsxRuntime.jsx(Typography, {
|
115021
|
+
className: "required-asterisk",
|
115022
|
+
children: "* "
|
115023
|
+
}), label && jsxRuntime.jsx(Typography, {
|
115024
|
+
lineHeight: "10px",
|
115025
|
+
fontWeight: "medium",
|
115026
|
+
fontSize: "12px",
|
115027
|
+
children: label
|
115028
|
+
})]
|
115029
|
+
}), editableTextEditor && isEditing && jsxRuntime.jsxs("div", {
|
115030
|
+
ref: buttonsRef,
|
115031
|
+
className: "ff-textEditor-buttons",
|
115032
|
+
children: [jsxRuntime.jsx(Tooltip, {
|
115033
|
+
title: "Update",
|
115034
|
+
placement: "bottom",
|
115035
|
+
children: jsxRuntime.jsx(Icon, {
|
115036
|
+
name: "update_icon",
|
115037
|
+
color: "var(--label-edit-confirm-icon)",
|
115038
|
+
height: 20,
|
115039
|
+
width: 20,
|
115040
|
+
hoverEffect: true,
|
115041
|
+
onClick: handleSubmit
|
115042
|
+
})
|
115043
|
+
}), jsxRuntime.jsx(Tooltip, {
|
115044
|
+
title: "Cancel",
|
115045
|
+
placement: "bottom",
|
115046
|
+
children: jsxRuntime.jsx(Icon, {
|
115047
|
+
name: "close",
|
115048
|
+
color: "var(--label-edit-cancel-icon)",
|
115049
|
+
height: 20,
|
115050
|
+
width: 20,
|
115051
|
+
onClick: handleCancel,
|
115052
|
+
hoverEffect: true
|
115053
|
+
})
|
115054
|
+
})]
|
115013
115055
|
})]
|
115014
115056
|
}), jsxRuntime.jsx("div", {
|
115015
115057
|
ref: editorRef,
|
@@ -115043,32 +115085,6 @@ const TextEditor = ({
|
|
115043
115085
|
}
|
115044
115086
|
}
|
115045
115087
|
})
|
115046
|
-
}), editableTextEditor && isEditing && jsxRuntime.jsxs("div", {
|
115047
|
-
ref: buttonsRef,
|
115048
|
-
className: "ff-textEditor-buttons",
|
115049
|
-
children: [jsxRuntime.jsx(Tooltip, {
|
115050
|
-
title: "Update",
|
115051
|
-
placement: "bottom",
|
115052
|
-
children: jsxRuntime.jsx(Icon, {
|
115053
|
-
name: "update_icon",
|
115054
|
-
color: "var(--label-edit-confirm-icon)",
|
115055
|
-
height: 20,
|
115056
|
-
width: 20,
|
115057
|
-
hoverEffect: true,
|
115058
|
-
onClick: handleSubmit
|
115059
|
-
})
|
115060
|
-
}), jsxRuntime.jsx(Tooltip, {
|
115061
|
-
title: "Cancel",
|
115062
|
-
placement: "bottom",
|
115063
|
-
children: jsxRuntime.jsx(Icon, {
|
115064
|
-
name: "close",
|
115065
|
-
color: "var(--label-edit-cancel-icon)",
|
115066
|
-
height: 20,
|
115067
|
-
width: 20,
|
115068
|
-
onClick: handleCancel,
|
115069
|
-
hoverEffect: true
|
115070
|
-
})
|
115071
|
-
})]
|
115072
115088
|
}), required && errorMsg || helperText && error ? jsxRuntime.jsx(Typography, {
|
115073
115089
|
fontSize: 10,
|
115074
115090
|
className: 'ff-textEditor-error-msg',
|