@bpmn-io/properties-panel 3.22.2 → 3.22.3
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.esm.js +23 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -691,6 +691,24 @@ function useStaticCallback(callback) {
|
|
|
691
691
|
return useCallback((...args) => callbackRef.current(...args), []);
|
|
692
692
|
}
|
|
693
693
|
|
|
694
|
+
function useElementVisible(element) {
|
|
695
|
+
const [visible, setVisible] = useState(!!element && !!element.clientHeight);
|
|
696
|
+
useLayoutEffect(() => {
|
|
697
|
+
if (!element) return;
|
|
698
|
+
const resizeObserver = new ResizeObserver(([entry]) => {
|
|
699
|
+
requestAnimationFrame(() => {
|
|
700
|
+
const newVisible = !!entry.contentRect.height;
|
|
701
|
+
if (newVisible !== visible) {
|
|
702
|
+
setVisible(newVisible);
|
|
703
|
+
}
|
|
704
|
+
});
|
|
705
|
+
});
|
|
706
|
+
resizeObserver.observe(element);
|
|
707
|
+
return () => resizeObserver.disconnect();
|
|
708
|
+
}, [element, visible]);
|
|
709
|
+
return visible;
|
|
710
|
+
}
|
|
711
|
+
|
|
694
712
|
function Group(props) {
|
|
695
713
|
const {
|
|
696
714
|
element,
|
|
@@ -3971,6 +3989,7 @@ function TextArea(props) {
|
|
|
3971
3989
|
} = props;
|
|
3972
3990
|
const [localValue, setLocalValue] = useState(value);
|
|
3973
3991
|
const ref = useShowEntryEvent(id);
|
|
3992
|
+
const visible = useElementVisible(ref.current);
|
|
3974
3993
|
const handleInputCallback = useMemo(() => {
|
|
3975
3994
|
return debounce(target => onInput(target.value.length ? target.value : undefined));
|
|
3976
3995
|
}, [onInput, debounce]);
|
|
@@ -3982,6 +4001,9 @@ function TextArea(props) {
|
|
|
3982
4001
|
useLayoutEffect(() => {
|
|
3983
4002
|
autoResize && resizeToContents(ref.current);
|
|
3984
4003
|
}, []);
|
|
4004
|
+
useLayoutEffect(() => {
|
|
4005
|
+
visible && autoResize && resizeToContents(ref.current);
|
|
4006
|
+
}, [visible]);
|
|
3985
4007
|
useEffect(() => {
|
|
3986
4008
|
if (value === localValue) {
|
|
3987
4009
|
return;
|
|
@@ -4307,5 +4329,5 @@ var index = {
|
|
|
4307
4329
|
feelPopup: ['type', FeelPopupModule]
|
|
4308
4330
|
};
|
|
4309
4331
|
|
|
4310
|
-
export { ArrowIcon, CheckboxEntry, CloseIcon, CollapsibleEntry, CreateIcon, index$1 as DebounceInputModule, DeleteIcon, DescriptionContext, Description as DescriptionEntry, DragIcon, DropdownButton, ErrorsContext, EventContext, ExternalLinkIcon, FeelCheckboxEntry, FeelEntry, FeelIcon$1 as FeelIcon, FeelNumberEntry, index as FeelPopupModule, FeelTemplatingEntry, FeelTextAreaEntry, FeelToggleSwitchEntry, Group, Header, HeaderButton, HelpIcon, LayoutContext, List as ListEntry, ListGroup, ListItem, NumberFieldEntry, Placeholder, Popup, PopupIcon, PropertiesPanel, LayoutContext as PropertiesPanelContext, SelectEntry, Simple as SimpleEntry, TemplatingEntry, TextAreaEntry, TextfieldEntry as TextFieldEntry, ToggleSwitchEntry, TooltipContext, TooltipWrapper as TooltipEntry, isEdited$5 as isCheckboxEntryEdited, isEdited$6 as isFeelEntryEdited, isEdited$7 as isNumberFieldEntryEdited, isEdited$3 as isSelectEntryEdited, isEdited$2 as isSimpleEntryEdited, isEdited$4 as isTemplatingEntryEdited, isEdited$1 as isTextAreaEntryEdited, isEdited as isTextFieldEntryEdited, isEdited$8 as isToggleSwitchEntryEdited, useDescriptionContext, useError, useErrors, useEvent, useKeyFactory, useLayoutState, usePrevious, useShowEntryEvent, useStaticCallback, useStickyIntersectionObserver, useTooltipContext };
|
|
4332
|
+
export { ArrowIcon, CheckboxEntry, CloseIcon, CollapsibleEntry, CreateIcon, index$1 as DebounceInputModule, DeleteIcon, DescriptionContext, Description as DescriptionEntry, DragIcon, DropdownButton, ErrorsContext, EventContext, ExternalLinkIcon, FeelCheckboxEntry, FeelEntry, FeelIcon$1 as FeelIcon, FeelNumberEntry, index as FeelPopupModule, FeelTemplatingEntry, FeelTextAreaEntry, FeelToggleSwitchEntry, Group, Header, HeaderButton, HelpIcon, LayoutContext, List as ListEntry, ListGroup, ListItem, NumberFieldEntry, Placeholder, Popup, PopupIcon, PropertiesPanel, LayoutContext as PropertiesPanelContext, SelectEntry, Simple as SimpleEntry, TemplatingEntry, TextAreaEntry, TextfieldEntry as TextFieldEntry, ToggleSwitchEntry, TooltipContext, TooltipWrapper as TooltipEntry, isEdited$5 as isCheckboxEntryEdited, isEdited$6 as isFeelEntryEdited, isEdited$7 as isNumberFieldEntryEdited, isEdited$3 as isSelectEntryEdited, isEdited$2 as isSimpleEntryEdited, isEdited$4 as isTemplatingEntryEdited, isEdited$1 as isTextAreaEntryEdited, isEdited as isTextFieldEntryEdited, isEdited$8 as isToggleSwitchEntryEdited, useDescriptionContext, useElementVisible, useError, useErrors, useEvent, useKeyFactory, useLayoutState, usePrevious, useShowEntryEvent, useStaticCallback, useStickyIntersectionObserver, useTooltipContext };
|
|
4311
4333
|
//# sourceMappingURL=index.esm.js.map
|