@bpmn-io/form-js-editor 1.14.1-alpha.0 → 1.15.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.
package/dist/index.cjs CHANGED
@@ -5535,19 +5535,19 @@ const ErrorsContext = preact.createContext({
5535
5535
  errors: {}
5536
5536
  });
5537
5537
 
5538
- /**
5539
- * @typedef {Function} <propertiesPanel.showEntry> callback
5540
- *
5541
- * @example
5542
- *
5543
- * useEvent('propertiesPanel.showEntry', ({ focus = false, ...rest }) => {
5544
- * // ...
5545
- * });
5546
- *
5547
- * @param {Object} context
5548
- * @param {boolean} [context.focus]
5549
- *
5550
- * @returns void
5538
+ /**
5539
+ * @typedef {Function} <propertiesPanel.showEntry> callback
5540
+ *
5541
+ * @example
5542
+ *
5543
+ * useEvent('propertiesPanel.showEntry', ({ focus = false, ...rest }) => {
5544
+ * // ...
5545
+ * });
5546
+ *
5547
+ * @param {Object} context
5548
+ * @param {boolean} [context.focus]
5549
+ *
5550
+ * @returns void
5551
5551
  */
5552
5552
 
5553
5553
  const EventContext = preact.createContext({
@@ -5564,20 +5564,20 @@ const TooltipContext = preact.createContext({
5564
5564
  getTooltipForId: () => {}
5565
5565
  });
5566
5566
 
5567
- /**
5568
- * Accesses the global TooltipContext and returns a tooltip for a given id and element.
5569
- *
5570
- * @example
5571
- * ```jsx
5572
- * function TextField(props) {
5573
- * const tooltip = useTooltipContext('input1', element);
5574
- * }
5575
- * ```
5576
- *
5577
- * @param {string} id
5578
- * @param {object} element
5579
- *
5580
- * @returns {string}
5567
+ /**
5568
+ * Accesses the global TooltipContext and returns a tooltip for a given id and element.
5569
+ *
5570
+ * @example
5571
+ * ```jsx
5572
+ * function TextField(props) {
5573
+ * const tooltip = useTooltipContext('input1', element);
5574
+ * }
5575
+ * ```
5576
+ *
5577
+ * @param {string} id
5578
+ * @param {object} element
5579
+ *
5580
+ * @returns {string}
5581
5581
  */
5582
5582
  function useTooltipContext(id, element) {
5583
5583
  const {
@@ -5598,7 +5598,7 @@ function TooltipWrapper(props) {
5598
5598
  return jsxRuntime.jsx(Tooltip, {
5599
5599
  ...props,
5600
5600
  value: value,
5601
- forId: prefixId$9(forId)
5601
+ forId: `bio-properties-panel-${forId}`
5602
5602
  });
5603
5603
  }
5604
5604
  function Tooltip(props) {
@@ -5609,71 +5609,52 @@ function Tooltip(props) {
5609
5609
  direction = 'right',
5610
5610
  position
5611
5611
  } = props;
5612
- const [visible, setShow] = hooks.useState(false);
5613
- const [focusedViaKeyboard, setFocusedViaKeyboard] = hooks.useState(false);
5612
+ const [visible, setVisible] = hooks.useState(false);
5613
+
5614
+ // Tooltip will be shown after SHOW_DELAY ms from hovering over the source element.
5615
+ const SHOW_DELAY = 200;
5614
5616
  let timeout = null;
5615
5617
  const wrapperRef = hooks.useRef(null);
5616
5618
  const tooltipRef = hooks.useRef(null);
5617
- const showTooltip = async event => {
5618
- const show = () => setShow(true);
5619
- if (!visible && !timeout) {
5620
- if (event instanceof MouseEvent) {
5621
- timeout = setTimeout(show, 200);
5622
- } else {
5623
- show();
5624
- setFocusedViaKeyboard(true);
5625
- }
5619
+ const show = (_, delay) => {
5620
+ if (visible) return;
5621
+ if (delay) {
5622
+ timeout = setTimeout(() => {
5623
+ setVisible(true);
5624
+ }, SHOW_DELAY);
5625
+ } else {
5626
+ setVisible(true);
5626
5627
  }
5627
5628
  };
5628
- const hideTooltip = () => {
5629
- setShow(false);
5630
- setFocusedViaKeyboard(false);
5631
- };
5632
- const hideTooltipViaEscape = e => {
5633
- e.code === 'Escape' && hideTooltip();
5629
+ const hide = () => {
5630
+ clearTimeout(timeout);
5631
+ setVisible(false);
5634
5632
  };
5635
- const isTooltipHovered = ({
5636
- x,
5637
- y
5633
+ const handleMouseLeave = ({
5634
+ relatedTarget
5638
5635
  }) => {
5639
- const tooltip = tooltipRef.current;
5640
- const wrapper = wrapperRef.current;
5641
- return tooltip && (inBounds(x, y, wrapper.getBoundingClientRect()) || inBounds(x, y, tooltip.getBoundingClientRect()));
5636
+ // Don't hide the tooltip when moving mouse between the wrapper and the tooltip.
5637
+ if (relatedTarget === wrapperRef.current || relatedTarget === tooltipRef.current || relatedTarget?.parentElement === tooltipRef.current) {
5638
+ return;
5639
+ }
5640
+ hide();
5642
5641
  };
5643
- hooks.useEffect(() => {
5642
+ const handleFocusOut = e => {
5644
5643
  const {
5645
- current
5646
- } = wrapperRef;
5647
- if (!current) {
5644
+ target
5645
+ } = e;
5646
+
5647
+ // Don't hide the tooltip if the wrapper or the tooltip itself is clicked.
5648
+ const isHovered = target.matches(':hover') || tooltipRef.current?.matches(':hover');
5649
+ if (target === wrapperRef.current && isHovered) {
5650
+ e.stopPropagation();
5648
5651
  return;
5649
5652
  }
5650
- const hideHoveredTooltip = e => {
5651
- const isFocused = document.activeElement === wrapperRef.current || document.activeElement.closest('.bio-properties-panel-tooltip');
5652
- if (visible && !isTooltipHovered({
5653
- x: e.x,
5654
- y: e.y
5655
- }) && !(isFocused && focusedViaKeyboard)) {
5656
- hideTooltip();
5657
- }
5658
- };
5659
- const hideFocusedTooltip = e => {
5660
- const {
5661
- relatedTarget
5662
- } = e;
5663
- const isTooltipChild = el => !!el.closest('.bio-properties-panel-tooltip');
5664
- if (visible && !isHovered(wrapperRef.current) && relatedTarget && !isTooltipChild(relatedTarget)) {
5665
- hideTooltip();
5666
- }
5667
- };
5668
- document.addEventListener('wheel', hideHoveredTooltip);
5669
- document.addEventListener('focusout', hideFocusedTooltip);
5670
- document.addEventListener('mousemove', hideHoveredTooltip);
5671
- return () => {
5672
- document.removeEventListener('wheel', hideHoveredTooltip);
5673
- document.removeEventListener('mousemove', hideHoveredTooltip);
5674
- document.removeEventListener('focusout', hideFocusedTooltip);
5675
- };
5676
- }, [wrapperRef.current, visible, focusedViaKeyboard]);
5653
+ hide();
5654
+ };
5655
+ const hideTooltipViaEscape = e => {
5656
+ e.code === 'Escape' && hide();
5657
+ };
5677
5658
  const renderTooltip = () => {
5678
5659
  return jsxRuntime.jsxs("div", {
5679
5660
  class: `bio-properties-panel-tooltip ${direction}`,
@@ -5683,6 +5664,7 @@ function Tooltip(props) {
5683
5664
  style: position || getTooltipPosition(wrapperRef.current),
5684
5665
  ref: tooltipRef,
5685
5666
  onClick: e => e.stopPropagation(),
5667
+ onMouseLeave: handleMouseLeave,
5686
5668
  children: [jsxRuntime.jsx("div", {
5687
5669
  class: "bio-properties-panel-tooltip-content",
5688
5670
  children: value
@@ -5695,54 +5677,38 @@ function Tooltip(props) {
5695
5677
  class: "bio-properties-panel-tooltip-wrapper",
5696
5678
  tabIndex: "0",
5697
5679
  ref: wrapperRef,
5698
- onMouseEnter: showTooltip,
5699
- onMouseLeave: () => {
5700
- clearTimeout(timeout);
5701
- timeout = null;
5702
- },
5703
- onFocus: showTooltip,
5680
+ onMouseEnter: e => show(e, true),
5681
+ onMouseLeave: handleMouseLeave,
5682
+ onFocus: show,
5683
+ onBlur: handleFocusOut,
5704
5684
  onKeyDown: hideTooltipViaEscape,
5705
5685
  children: [props.children, visible ? parent ? React.createPortal(renderTooltip(), parent.current) : renderTooltip() : null]
5706
5686
  });
5707
5687
  }
5708
5688
 
5709
5689
  // helper
5710
- function inBounds(x, y, bounds) {
5711
- const {
5712
- top,
5713
- right,
5714
- bottom,
5715
- left
5716
- } = bounds;
5717
- return x >= left && x <= right && y >= top && y <= bottom;
5718
- }
5690
+
5719
5691
  function getTooltipPosition(refElement) {
5720
5692
  const refPosition = refElement.getBoundingClientRect();
5721
5693
  const right = `calc(100% - ${refPosition.x}px)`;
5722
5694
  const top = `${refPosition.top - 10}px`;
5723
5695
  return `right: ${right}; top: ${top};`;
5724
5696
  }
5725
- function isHovered(element) {
5726
- return element.matches(':hover');
5727
- }
5728
- function prefixId$9(id) {
5729
- return `bio-properties-panel-${id}`;
5730
- }
5731
5697
 
5732
- /**
5733
- * Accesses the global DescriptionContext and returns a description for a given id and element.
5734
- *
5735
- * @example
5736
- * ```jsx
5737
- * function TextField(props) {
5738
- * const description = useDescriptionContext('input1', element);
5739
- * }
5740
- * ```
5741
- *
5742
- * @param {string} id
5743
- * @param {object} element
5744
- *
5745
- * @returns {string}
5698
+ /**
5699
+ * Accesses the global DescriptionContext and returns a description for a given id and element.
5700
+ *
5701
+ * @example
5702
+ * ```jsx
5703
+ * function TextField(props) {
5704
+ * const description = useDescriptionContext('input1', element);
5705
+ * }
5706
+ * ```
5707
+ *
5708
+ * @param {string} id
5709
+ * @param {object} element
5710
+ *
5711
+ * @returns {string}
5746
5712
  */
5747
5713
  function useDescriptionContext(id, element) {
5748
5714
  const {
@@ -5763,11 +5729,11 @@ function useErrors() {
5763
5729
  return errors;
5764
5730
  }
5765
5731
 
5766
- /**
5767
- * Subscribe to an event immediately. Update subscription after inputs changed.
5768
- *
5769
- * @param {string} event
5770
- * @param {Function} callback
5732
+ /**
5733
+ * Subscribe to an event immediately. Update subscription after inputs changed.
5734
+ *
5735
+ * @param {string} event
5736
+ * @param {Function} callback
5771
5737
  */
5772
5738
  function useEvent(event, callback, eventBus) {
5773
5739
  const eventContext = hooks.useContext(EventContext);
@@ -5797,20 +5763,20 @@ function useEvent(event, callback, eventBus) {
5797
5763
  }, [callback, event, eventBus]);
5798
5764
  }
5799
5765
 
5800
- /**
5801
- * Creates a state that persists in the global LayoutContext.
5802
- *
5803
- * @example
5804
- * ```jsx
5805
- * function Group(props) {
5806
- * const [ open, setOpen ] = useLayoutState([ 'groups', 'foo', 'open' ], false);
5807
- * }
5808
- * ```
5809
- *
5810
- * @param {(string|number)[]} path
5811
- * @param {any} [defaultValue]
5812
- *
5813
- * @returns {[ any, Function ]}
5766
+ /**
5767
+ * Creates a state that persists in the global LayoutContext.
5768
+ *
5769
+ * @example
5770
+ * ```jsx
5771
+ * function Group(props) {
5772
+ * const [ open, setOpen ] = useLayoutState([ 'groups', 'foo', 'open' ], false);
5773
+ * }
5774
+ * ```
5775
+ *
5776
+ * @param {(string|number)[]} path
5777
+ * @param {any} [defaultValue]
5778
+ *
5779
+ * @returns {[ any, Function ]}
5814
5780
  */
5815
5781
  function useLayoutState(path, defaultValue) {
5816
5782
  const {
@@ -5824,11 +5790,11 @@ function useLayoutState(path, defaultValue) {
5824
5790
  return [layoutForKey, setState];
5825
5791
  }
5826
5792
 
5827
- /**
5828
- * @pinussilvestrus: we need to introduce our own hook to persist the previous
5829
- * state on updates.
5830
- *
5831
- * cf. https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
5793
+ /**
5794
+ * @pinussilvestrus: we need to introduce our own hook to persist the previous
5795
+ * state on updates.
5796
+ *
5797
+ * cf. https://reactjs.org/docs/hooks-faq.html#how-to-get-the-previous-props-or-state
5832
5798
  */
5833
5799
 
5834
5800
  function usePrevious(value) {
@@ -5839,12 +5805,12 @@ function usePrevious(value) {
5839
5805
  return ref.current;
5840
5806
  }
5841
5807
 
5842
- /**
5843
- * Subscribe to `propertiesPanel.showEntry`.
5844
- *
5845
- * @param {string} id
5846
- *
5847
- * @returns {import('preact').Ref}
5808
+ /**
5809
+ * Subscribe to `propertiesPanel.showEntry`.
5810
+ *
5811
+ * @param {string} id
5812
+ *
5813
+ * @returns {import('preact').Ref}
5848
5814
  */
5849
5815
  function useShowEntryEvent(id) {
5850
5816
  const {
@@ -5875,20 +5841,20 @@ function useShowEntryEvent(id) {
5875
5841
  return ref;
5876
5842
  }
5877
5843
 
5878
- /**
5879
- * @callback setSticky
5880
- * @param {boolean} value
5844
+ /**
5845
+ * @callback setSticky
5846
+ * @param {boolean} value
5881
5847
  */
5882
5848
 
5883
- /**
5884
- * Use IntersectionObserver to identify when DOM element is in sticky mode.
5885
- * If sticky is observered setSticky(true) will be called.
5886
- * If sticky mode is left, setSticky(false) will be called.
5887
- *
5888
- *
5889
- * @param {Object} ref
5890
- * @param {string} scrollContainerSelector
5891
- * @param {setSticky} setSticky
5849
+ /**
5850
+ * Use IntersectionObserver to identify when DOM element is in sticky mode.
5851
+ * If sticky is observered setSticky(true) will be called.
5852
+ * If sticky mode is left, setSticky(false) will be called.
5853
+ *
5854
+ *
5855
+ * @param {Object} ref
5856
+ * @param {string} scrollContainerSelector
5857
+ * @param {setSticky} setSticky
5892
5858
  */
5893
5859
  function useStickyIntersectionObserver(ref, scrollContainerSelector, setSticky) {
5894
5860
  const [scrollContainer, setScrollContainer] = hooks.useState(minDom.query(scrollContainerSelector));
@@ -5942,19 +5908,19 @@ function useStickyIntersectionObserver(ref, scrollContainerSelector, setSticky)
5942
5908
  }, [ref.current, scrollContainer, setSticky]);
5943
5909
  }
5944
5910
 
5945
- /**
5946
- * Creates a static function reference with changing body.
5947
- * This is necessary when external libraries require a callback function
5948
- * that has references to state variables.
5949
- *
5950
- * Usage:
5951
- * const callback = useStaticCallback((val) => {val === currentState});
5952
- *
5953
- * The `callback` reference is static and can be safely used in external
5954
- * libraries or as a prop that does not cause rerendering of children.
5955
- *
5956
- * @param {Function} callback function with changing reference
5957
- * @returns {Function} static function reference
5911
+ /**
5912
+ * Creates a static function reference with changing body.
5913
+ * This is necessary when external libraries require a callback function
5914
+ * that has references to state variables.
5915
+ *
5916
+ * Usage:
5917
+ * const callback = useStaticCallback((val) => {val === currentState});
5918
+ *
5919
+ * The `callback` reference is static and can be safely used in external
5920
+ * libraries or as a prop that does not cause rerendering of children.
5921
+ *
5922
+ * @param {Function} callback function with changing reference
5923
+ * @returns {Function} static function reference
5958
5924
  */
5959
5925
  function useStaticCallback(callback) {
5960
5926
  const callbackRef = hooks.useRef(callback);
@@ -6095,13 +6061,13 @@ function DataMarker(props) {
6095
6061
  return null;
6096
6062
  }
6097
6063
 
6098
- /**
6099
- * @typedef { {
6100
- * text: (element: object) => string,
6101
- * icon?: (element: Object) => import('preact').Component
6102
- * } } PlaceholderDefinition
6103
- *
6104
- * @param { PlaceholderDefinition } props
6064
+ /**
6065
+ * @typedef { {
6066
+ * text: (element: object) => string,
6067
+ * icon?: (element: Object) => import('preact').Component
6068
+ * } } PlaceholderDefinition
6069
+ *
6070
+ * @param { PlaceholderDefinition } props
6105
6071
  */
6106
6072
  function Placeholder(props) {
6107
6073
  const {
@@ -6138,9 +6104,9 @@ function Description$1(props) {
6138
6104
  }
6139
6105
  const noop$6 = () => {};
6140
6106
 
6141
- /**
6142
- * Buffer `.focus()` calls while the editor is not initialized.
6143
- * Set Focus inside when the editor is ready.
6107
+ /**
6108
+ * Buffer `.focus()` calls while the editor is not initialized.
6109
+ * Set Focus inside when the editor is ready.
6144
6110
  */
6145
6111
  const useBufferedFocus$1 = function (editor, ref) {
6146
6112
  const [buffer, setBuffer] = hooks.useState(undefined);
@@ -6240,9 +6206,9 @@ const CodeEditor$1 = React.forwardRef((props, ref) => {
6240
6206
  });
6241
6207
  const noop$5 = () => {};
6242
6208
 
6243
- /**
6244
- * Buffer `.focus()` calls while the editor is not initialized.
6245
- * Set Focus inside when the editor is ready.
6209
+ /**
6210
+ * Buffer `.focus()` calls while the editor is not initialized.
6211
+ * Set Focus inside when the editor is ready.
6246
6212
  */
6247
6213
  const useBufferedFocus = function (editor, ref) {
6248
6214
  const [buffer, setBuffer] = hooks.useState(undefined);
@@ -6291,10 +6257,10 @@ const CodeEditor = React.forwardRef((props, ref) => {
6291
6257
  hooks.useEffect(() => {
6292
6258
  let editor;
6293
6259
 
6294
- /* Trigger FEEL toggle when
6295
- *
6296
- * - `backspace` is pressed
6297
- * - AND the cursor is at the beginning of the input
6260
+ /* Trigger FEEL toggle when
6261
+ *
6262
+ * - `backspace` is pressed
6263
+ * - AND the cursor is at the beginning of the input
6298
6264
  */
6299
6265
  const onKeyDown = e => {
6300
6266
  if (e.key !== 'Backspace' || !editor) {
@@ -6383,10 +6349,10 @@ function FeelIndicator(props) {
6383
6349
  }
6384
6350
  const noop$4 = () => {};
6385
6351
 
6386
- /**
6387
- * @param {Object} props
6388
- * @param {Object} props.label
6389
- * @param {String} props.feel
6352
+ /**
6353
+ * @param {Object} props
6354
+ * @param {Object} props.label
6355
+ * @param {String} props.feel
6390
6356
  */
6391
6357
  function FeelIcon(props) {
6392
6358
  const {
@@ -6420,22 +6386,22 @@ const FeelPopupContext = preact.createContext({
6420
6386
  source: null
6421
6387
  });
6422
6388
 
6423
- /**
6424
- * Add a dragger that calls back the passed function with
6425
- * { event, delta } on drag.
6426
- *
6427
- * @example
6428
- *
6429
- * function dragMove(event, delta) {
6430
- * // we are dragging (!!)
6431
- * }
6432
- *
6433
- * domElement.addEventListener('dragstart', dragger(dragMove));
6434
- *
6435
- * @param {Function} fn
6436
- * @param {Element} [dragPreview]
6437
- *
6438
- * @return {Function} drag start callback function
6389
+ /**
6390
+ * Add a dragger that calls back the passed function with
6391
+ * { event, delta } on drag.
6392
+ *
6393
+ * @example
6394
+ *
6395
+ * function dragMove(event, delta) {
6396
+ * // we are dragging (!!)
6397
+ * }
6398
+ *
6399
+ * domElement.addEventListener('dragstart', dragger(dragMove));
6400
+ *
6401
+ * @param {Function} fn
6402
+ * @param {Element} [dragPreview]
6403
+ *
6404
+ * @return {Function} drag start callback function
6439
6405
  */
6440
6406
  function createDragger(fn, dragPreview) {
6441
6407
  let self;
@@ -6489,23 +6455,23 @@ function emptyCanvas() {
6489
6455
  }
6490
6456
  const noop$3 = () => {};
6491
6457
 
6492
- /**
6493
- * A generic popup component.
6494
- *
6495
- * @param {Object} props
6496
- * @param {HTMLElement} [props.container]
6497
- * @param {string} [props.className]
6498
- * @param {boolean} [props.delayInitialFocus]
6499
- * @param {{x: number, y: number}} [props.position]
6500
- * @param {number} [props.width]
6501
- * @param {number} [props.height]
6502
- * @param {Function} props.onClose
6503
- * @param {Function} [props.onPostActivate]
6504
- * @param {Function} [props.onPostDeactivate]
6505
- * @param {boolean} [props.returnFocus]
6506
- * @param {boolean} [props.closeOnEscape]
6507
- * @param {string} props.title
6508
- * @param {Ref} [ref]
6458
+ /**
6459
+ * A generic popup component.
6460
+ *
6461
+ * @param {Object} props
6462
+ * @param {HTMLElement} [props.container]
6463
+ * @param {string} [props.className]
6464
+ * @param {boolean} [props.delayInitialFocus]
6465
+ * @param {{x: number, y: number}} [props.position]
6466
+ * @param {number} [props.width]
6467
+ * @param {number} [props.height]
6468
+ * @param {Function} props.onClose
6469
+ * @param {Function} [props.onPostActivate]
6470
+ * @param {Function} [props.onPostDeactivate]
6471
+ * @param {boolean} [props.returnFocus]
6472
+ * @param {boolean} [props.closeOnEscape]
6473
+ * @param {string} props.title
6474
+ * @param {Ref} [ref]
6509
6475
  */
6510
6476
  function PopupComponent(props, globalRef) {
6511
6477
  const {
@@ -6723,12 +6689,12 @@ function getContainerNode(node) {
6723
6689
  const FEEL_POPUP_WIDTH = 700;
6724
6690
  const FEEL_POPUP_HEIGHT = 250;
6725
6691
 
6726
- /**
6727
- * FEEL popup component, built as a singleton. Emits lifecycle events as follows:
6728
- * - `feelPopup.open` - fired before the popup is mounted
6729
- * - `feelPopup.opened` - fired after the popup is mounted. Event context contains the DOM node of the popup
6730
- * - `feelPopup.close` - fired before the popup is unmounted. Event context contains the DOM node of the popup
6731
- * - `feelPopup.closed` - fired after the popup is unmounted
6692
+ /**
6693
+ * FEEL popup component, built as a singleton. Emits lifecycle events as follows:
6694
+ * - `feelPopup.open` - fired before the popup is mounted
6695
+ * - `feelPopup.opened` - fired after the popup is mounted. Event context contains the DOM node of the popup
6696
+ * - `feelPopup.close` - fired before the popup is unmounted. Event context contains the DOM node of the popup
6697
+ * - `feelPopup.closed` - fired after the popup is unmounted
6732
6698
  */
6733
6699
  function FEELPopupRoot(props) {
6734
6700
  const {
@@ -6955,11 +6921,11 @@ function autoCompletionOpen(element) {
6955
6921
  return element.closest('.cm-editor').querySelector('.cm-tooltip-autocomplete');
6956
6922
  }
6957
6923
 
6958
- /**
6959
- * This hook behaves like useEffect, but does not trigger on the first render.
6960
- *
6961
- * @param {Function} effect
6962
- * @param {Array} deps
6924
+ /**
6925
+ * This hook behaves like useEffect, but does not trigger on the first render.
6926
+ *
6927
+ * @param {Function} effect
6928
+ * @param {Array} deps
6963
6929
  */
6964
6930
  function useUpdateEffect(effect, deps) {
6965
6931
  const isMounted = hooks.useRef(false);
@@ -7036,19 +7002,19 @@ function ToggleSwitch(props) {
7036
7002
  });
7037
7003
  }
7038
7004
 
7039
- /**
7040
- * @param {Object} props
7041
- * @param {Object} props.element
7042
- * @param {String} props.id
7043
- * @param {String} props.description
7044
- * @param {String} props.label
7045
- * @param {String} props.switcherLabel
7046
- * @param {Boolean} props.inline
7047
- * @param {Function} props.getValue
7048
- * @param {Function} props.setValue
7049
- * @param {Function} props.onFocus
7050
- * @param {Function} props.onBlur
7051
- * @param {string|import('preact').Component} props.tooltip
7005
+ /**
7006
+ * @param {Object} props
7007
+ * @param {Object} props.element
7008
+ * @param {String} props.id
7009
+ * @param {String} props.description
7010
+ * @param {String} props.label
7011
+ * @param {String} props.switcherLabel
7012
+ * @param {Boolean} props.inline
7013
+ * @param {Function} props.getValue
7014
+ * @param {Function} props.setValue
7015
+ * @param {Function} props.onFocus
7016
+ * @param {Function} props.onBlur
7017
+ * @param {string|import('preact').Component} props.tooltip
7052
7018
  */
7053
7019
  function ToggleSwitchEntry(props) {
7054
7020
  const {
@@ -7155,22 +7121,22 @@ function NumberField(props) {
7155
7121
  });
7156
7122
  }
7157
7123
 
7158
- /**
7159
- * @param {Object} props
7160
- * @param {Boolean} props.debounce
7161
- * @param {String} props.description
7162
- * @param {Boolean} props.disabled
7163
- * @param {Object} props.element
7164
- * @param {Function} props.getValue
7165
- * @param {String} props.id
7166
- * @param {String} props.label
7167
- * @param {String} props.max
7168
- * @param {String} props.min
7169
- * @param {Function} props.setValue
7170
- * @param {Function} props.onFocus
7171
- * @param {Function} props.onBlur
7172
- * @param {String} props.step
7173
- * @param {Function} props.validate
7124
+ /**
7125
+ * @param {Object} props
7126
+ * @param {Boolean} props.debounce
7127
+ * @param {String} props.description
7128
+ * @param {Boolean} props.disabled
7129
+ * @param {Object} props.element
7130
+ * @param {Function} props.getValue
7131
+ * @param {String} props.id
7132
+ * @param {String} props.label
7133
+ * @param {String} props.max
7134
+ * @param {String} props.min
7135
+ * @param {Function} props.setValue
7136
+ * @param {Function} props.onFocus
7137
+ * @param {Function} props.onBlur
7138
+ * @param {String} props.step
7139
+ * @param {Function} props.validate
7174
7140
  */
7175
7141
  function NumberFieldEntry(props) {
7176
7142
  const {
@@ -7250,6 +7216,7 @@ function FeelTextfieldComponent(props) {
7250
7216
  label,
7251
7217
  hostLanguage,
7252
7218
  onInput,
7219
+ onBlur,
7253
7220
  onError,
7254
7221
  placeholder,
7255
7222
  feel,
@@ -7315,6 +7282,12 @@ function FeelTextfieldComponent(props) {
7315
7282
  setFocus(-1);
7316
7283
  }
7317
7284
  };
7285
+ const handleOnBlur = e => {
7286
+ if (onBlur) {
7287
+ onBlur(e);
7288
+ }
7289
+ setLocalValue(e.target.value.trim());
7290
+ };
7318
7291
  const handleLint = useStaticCallback((lint = []) => {
7319
7292
  const syntaxError = lint.some(report => report.type === 'Syntax Error');
7320
7293
  if (syntaxError) {
@@ -7436,6 +7409,7 @@ function FeelTextfieldComponent(props) {
7436
7409
  ...props,
7437
7410
  popupOpen: popuOpen,
7438
7411
  onInput: handleLocalInput,
7412
+ onBlur: handleOnBlur,
7439
7413
  contentAttributes: {
7440
7414
  'id': prefixId$5(id),
7441
7415
  'aria-label': label
@@ -7655,26 +7629,26 @@ React.forwardRef((props, ref) => {
7655
7629
  });
7656
7630
  });
7657
7631
 
7658
- /**
7659
- * @param {Object} props
7660
- * @param {Object} props.element
7661
- * @param {String} props.id
7662
- * @param {String} props.description
7663
- * @param {Boolean} props.debounce
7664
- * @param {Boolean} props.disabled
7665
- * @param {Boolean} props.feel
7666
- * @param {String} props.label
7667
- * @param {Function} props.getValue
7668
- * @param {Function} props.setValue
7669
- * @param {Function} props.tooltipContainer
7670
- * @param {Function} props.validate
7671
- * @param {Function} props.show
7672
- * @param {Function} props.example
7673
- * @param {Function} props.variables
7674
- * @param {Function} props.onFocus
7675
- * @param {Function} props.onBlur
7676
- * @param {string} [props.placeholder]
7677
- * @param {string|import('preact').Component} props.tooltip
7632
+ /**
7633
+ * @param {Object} props
7634
+ * @param {Object} props.element
7635
+ * @param {String} props.id
7636
+ * @param {String} props.description
7637
+ * @param {Boolean} props.debounce
7638
+ * @param {Boolean} props.disabled
7639
+ * @param {Boolean} props.feel
7640
+ * @param {String} props.label
7641
+ * @param {Function} props.getValue
7642
+ * @param {Function} props.setValue
7643
+ * @param {Function} props.tooltipContainer
7644
+ * @param {Function} props.validate
7645
+ * @param {Function} props.show
7646
+ * @param {Function} props.example
7647
+ * @param {Function} props.variables
7648
+ * @param {Function} props.onFocus
7649
+ * @param {Function} props.onBlur
7650
+ * @param {string} [props.placeholder]
7651
+ * @param {string|import('preact').Component} props.tooltip
7678
7652
  */
7679
7653
  function FeelEntry(props) {
7680
7654
  const {
@@ -7761,27 +7735,27 @@ function FeelEntry(props) {
7761
7735
  });
7762
7736
  }
7763
7737
 
7764
- /**
7765
- * @param {Object} props
7766
- * @param {Object} props.element
7767
- * @param {String} props.id
7768
- * @param {String} props.description
7769
- * @param {Boolean} props.debounce
7770
- * @param {Boolean} props.disabled
7771
- * @param {String} props.max
7772
- * @param {String} props.min
7773
- * @param {String} props.step
7774
- * @param {Boolean} props.feel
7775
- * @param {String} props.label
7776
- * @param {Function} props.getValue
7777
- * @param {Function} props.setValue
7778
- * @param {Function} props.tooltipContainer
7779
- * @param {Function} props.validate
7780
- * @param {Function} props.show
7781
- * @param {Function} props.example
7782
- * @param {Function} props.variables
7783
- * @param {Function} props.onFocus
7784
- * @param {Function} props.onBlur
7738
+ /**
7739
+ * @param {Object} props
7740
+ * @param {Object} props.element
7741
+ * @param {String} props.id
7742
+ * @param {String} props.description
7743
+ * @param {Boolean} props.debounce
7744
+ * @param {Boolean} props.disabled
7745
+ * @param {String} props.max
7746
+ * @param {String} props.min
7747
+ * @param {String} props.step
7748
+ * @param {Boolean} props.feel
7749
+ * @param {String} props.label
7750
+ * @param {Function} props.getValue
7751
+ * @param {Function} props.setValue
7752
+ * @param {Function} props.tooltipContainer
7753
+ * @param {Function} props.validate
7754
+ * @param {Function} props.show
7755
+ * @param {Function} props.example
7756
+ * @param {Function} props.variables
7757
+ * @param {Function} props.onFocus
7758
+ * @param {Function} props.onBlur
7785
7759
  */
7786
7760
  function FeelNumberEntry(props) {
7787
7761
  return jsxRuntime.jsx(FeelEntry, {
@@ -7791,24 +7765,24 @@ function FeelNumberEntry(props) {
7791
7765
  });
7792
7766
  }
7793
7767
 
7794
- /**
7795
- * @param {Object} props
7796
- * @param {Object} props.element
7797
- * @param {String} props.id
7798
- * @param {String} props.description
7799
- * @param {Boolean} props.debounce
7800
- * @param {Boolean} props.disabled
7801
- * @param {Boolean} props.feel
7802
- * @param {String} props.label
7803
- * @param {Function} props.getValue
7804
- * @param {Function} props.setValue
7805
- * @param {Function} props.tooltipContainer
7806
- * @param {Function} props.validate
7807
- * @param {Function} props.show
7808
- * @param {Function} props.example
7809
- * @param {Function} props.variables
7810
- * @param {Function} props.onFocus
7811
- * @param {Function} props.onBlur
7768
+ /**
7769
+ * @param {Object} props
7770
+ * @param {Object} props.element
7771
+ * @param {String} props.id
7772
+ * @param {String} props.description
7773
+ * @param {Boolean} props.debounce
7774
+ * @param {Boolean} props.disabled
7775
+ * @param {Boolean} props.feel
7776
+ * @param {String} props.label
7777
+ * @param {Function} props.getValue
7778
+ * @param {Function} props.setValue
7779
+ * @param {Function} props.tooltipContainer
7780
+ * @param {Function} props.validate
7781
+ * @param {Function} props.show
7782
+ * @param {Function} props.example
7783
+ * @param {Function} props.variables
7784
+ * @param {Function} props.onFocus
7785
+ * @param {Function} props.onBlur
7812
7786
  */
7813
7787
  function FeelToggleSwitchEntry(props) {
7814
7788
  return jsxRuntime.jsx(FeelEntry, {
@@ -7818,26 +7792,26 @@ function FeelToggleSwitchEntry(props) {
7818
7792
  });
7819
7793
  }
7820
7794
 
7821
- /**
7822
- * @param {Object} props
7823
- * @param {Object} props.element
7824
- * @param {String} props.id
7825
- * @param {String} props.description
7826
- * @param {String} props.hostLanguage
7827
- * @param {Boolean} props.singleLine
7828
- * @param {Boolean} props.debounce
7829
- * @param {Boolean} props.disabled
7830
- * @param {Boolean} props.feel
7831
- * @param {String} props.label
7832
- * @param {Function} props.getValue
7833
- * @param {Function} props.setValue
7834
- * @param {Function} props.tooltipContainer
7835
- * @param {Function} props.validate
7836
- * @param {Function} props.show
7837
- * @param {Function} props.example
7838
- * @param {Function} props.variables
7839
- * @param {Function} props.onFocus
7840
- * @param {Function} props.onBlur
7795
+ /**
7796
+ * @param {Object} props
7797
+ * @param {Object} props.element
7798
+ * @param {String} props.id
7799
+ * @param {String} props.description
7800
+ * @param {String} props.hostLanguage
7801
+ * @param {Boolean} props.singleLine
7802
+ * @param {Boolean} props.debounce
7803
+ * @param {Boolean} props.disabled
7804
+ * @param {Boolean} props.feel
7805
+ * @param {String} props.label
7806
+ * @param {Function} props.getValue
7807
+ * @param {Function} props.setValue
7808
+ * @param {Function} props.tooltipContainer
7809
+ * @param {Function} props.validate
7810
+ * @param {Function} props.show
7811
+ * @param {Function} props.example
7812
+ * @param {Function} props.variables
7813
+ * @param {Function} props.onFocus
7814
+ * @param {Function} props.onBlur
7841
7815
  */
7842
7816
  function FeelTemplatingEntry(props) {
7843
7817
  return jsxRuntime.jsx(FeelEntry, {
@@ -7905,85 +7879,85 @@ const DEFAULT_LAYOUT = {};
7905
7879
  const DEFAULT_DESCRIPTION = {};
7906
7880
  const DEFAULT_TOOLTIP = {};
7907
7881
 
7908
- /**
7909
- * @typedef { {
7910
- * component: import('preact').Component,
7911
- * id: String,
7912
- * isEdited?: Function
7913
- * } } EntryDefinition
7914
- *
7915
- * @typedef { {
7916
- * autoFocusEntry: String,
7917
- * autoOpen?: Boolean,
7918
- * entries: Array<EntryDefinition>,
7919
- * id: String,
7920
- * label: String,
7921
- * remove: (event: MouseEvent) => void
7922
- * } } ListItemDefinition
7923
- *
7924
- * @typedef { {
7925
- * add: (event: MouseEvent) => void,
7926
- * component: import('preact').Component,
7927
- * element: Object,
7928
- * id: String,
7929
- * items: Array<ListItemDefinition>,
7930
- * label: String,
7931
- * shouldOpen?: Boolean
7932
- * } } ListGroupDefinition
7933
- *
7934
- * @typedef { {
7935
- * component?: import('preact').Component,
7936
- * entries: Array<EntryDefinition>,
7937
- * id: String,
7938
- * label: String,
7939
- * shouldOpen?: Boolean
7940
- * } } GroupDefinition
7941
- *
7942
- * @typedef { {
7943
- * [id: String]: GetDescriptionFunction
7944
- * } } DescriptionConfig
7945
- *
7946
- * @typedef { {
7947
- * [id: String]: GetTooltipFunction
7948
- * } } TooltipConfig
7949
- *
7950
- * @callback { {
7951
- * @param {string} id
7952
- * @param {Object} element
7953
- * @returns {string}
7954
- * } } GetDescriptionFunction
7955
- *
7956
- * @callback { {
7957
- * @param {string} id
7958
- * @param {Object} element
7959
- * @returns {string}
7960
- * } } GetTooltipFunction
7961
- *
7962
- * @typedef { {
7963
- * getEmpty: (element: object) => import('./components/Placeholder').PlaceholderDefinition,
7964
- * getMultiple: (element: Object) => import('./components/Placeholder').PlaceholderDefinition
7965
- * } } PlaceholderProvider
7966
- *
7882
+ /**
7883
+ * @typedef { {
7884
+ * component: import('preact').Component,
7885
+ * id: String,
7886
+ * isEdited?: Function
7887
+ * } } EntryDefinition
7888
+ *
7889
+ * @typedef { {
7890
+ * autoFocusEntry: String,
7891
+ * autoOpen?: Boolean,
7892
+ * entries: Array<EntryDefinition>,
7893
+ * id: String,
7894
+ * label: String,
7895
+ * remove: (event: MouseEvent) => void
7896
+ * } } ListItemDefinition
7897
+ *
7898
+ * @typedef { {
7899
+ * add: (event: MouseEvent) => void,
7900
+ * component: import('preact').Component,
7901
+ * element: Object,
7902
+ * id: String,
7903
+ * items: Array<ListItemDefinition>,
7904
+ * label: String,
7905
+ * shouldOpen?: Boolean
7906
+ * } } ListGroupDefinition
7907
+ *
7908
+ * @typedef { {
7909
+ * component?: import('preact').Component,
7910
+ * entries: Array<EntryDefinition>,
7911
+ * id: String,
7912
+ * label: String,
7913
+ * shouldOpen?: Boolean
7914
+ * } } GroupDefinition
7915
+ *
7916
+ * @typedef { {
7917
+ * [id: String]: GetDescriptionFunction
7918
+ * } } DescriptionConfig
7919
+ *
7920
+ * @typedef { {
7921
+ * [id: String]: GetTooltipFunction
7922
+ * } } TooltipConfig
7923
+ *
7924
+ * @callback { {
7925
+ * @param {string} id
7926
+ * @param {Object} element
7927
+ * @returns {string}
7928
+ * } } GetDescriptionFunction
7929
+ *
7930
+ * @callback { {
7931
+ * @param {string} id
7932
+ * @param {Object} element
7933
+ * @returns {string}
7934
+ * } } GetTooltipFunction
7935
+ *
7936
+ * @typedef { {
7937
+ * getEmpty: (element: object) => import('./components/Placeholder').PlaceholderDefinition,
7938
+ * getMultiple: (element: Object) => import('./components/Placeholder').PlaceholderDefinition
7939
+ * } } PlaceholderProvider
7940
+ *
7967
7941
  */
7968
7942
 
7969
- /**
7970
- * A basic properties panel component. Describes *how* content will be rendered, accepts
7971
- * data from implementor to describe *what* will be rendered.
7972
- *
7973
- * @param {Object} props
7974
- * @param {Object|Array} props.element
7975
- * @param {import('./components/Header').HeaderProvider} props.headerProvider
7976
- * @param {PlaceholderProvider} [props.placeholderProvider]
7977
- * @param {Array<GroupDefinition|ListGroupDefinition>} props.groups
7978
- * @param {Object} [props.layoutConfig]
7979
- * @param {Function} [props.layoutChanged]
7980
- * @param {DescriptionConfig} [props.descriptionConfig]
7981
- * @param {Function} [props.descriptionLoaded]
7982
- * @param {TooltipConfig} [props.tooltipConfig]
7983
- * @param {Function} [props.tooltipLoaded]
7984
- * @param {HTMLElement} [props.feelPopupContainer]
7985
- * @param {Function} [props.getFeelPopupLinks]
7986
- * @param {Object} [props.eventBus]
7943
+ /**
7944
+ * A basic properties panel component. Describes *how* content will be rendered, accepts
7945
+ * data from implementor to describe *what* will be rendered.
7946
+ *
7947
+ * @param {Object} props
7948
+ * @param {Object|Array} props.element
7949
+ * @param {import('./components/Header').HeaderProvider} props.headerProvider
7950
+ * @param {PlaceholderProvider} [props.placeholderProvider]
7951
+ * @param {Array<GroupDefinition|ListGroupDefinition>} props.groups
7952
+ * @param {Object} [props.layoutConfig]
7953
+ * @param {Function} [props.layoutChanged]
7954
+ * @param {DescriptionConfig} [props.descriptionConfig]
7955
+ * @param {Function} [props.descriptionLoaded]
7956
+ * @param {TooltipConfig} [props.tooltipConfig]
7957
+ * @param {Function} [props.tooltipLoaded]
7958
+ * @param {HTMLElement} [props.feelPopupContainer]
7959
+ * @param {Function} [props.getFeelPopupLinks]
7960
+ * @param {Object} [props.eventBus]
7987
7961
  */
7988
7962
  function PropertiesPanel$1(props) {
7989
7963
  const {
@@ -8156,11 +8130,11 @@ function createTooltipContext(overrides = {}) {
8156
8130
 
8157
8131
  // hooks //////////////////
8158
8132
 
8159
- /**
8160
- * This hook behaves like useLayoutEffect, but does not trigger on the first render.
8161
- *
8162
- * @param {Function} effect
8163
- * @param {Array} deps
8133
+ /**
8134
+ * This hook behaves like useLayoutEffect, but does not trigger on the first render.
8135
+ *
8136
+ * @param {Function} effect
8137
+ * @param {Array} deps
8164
8138
  */
8165
8139
  function useUpdateLayoutEffect(effect, deps) {
8166
8140
  const isMounted = hooks.useRef(false);
@@ -8173,20 +8147,20 @@ function useUpdateLayoutEffect(effect, deps) {
8173
8147
  }, deps);
8174
8148
  }
8175
8149
 
8176
- /**
8177
- * @typedef { {
8178
- * [key: string]: string;
8179
- * } } TranslateReplacements
8150
+ /**
8151
+ * @typedef { {
8152
+ * [key: string]: string;
8153
+ * } } TranslateReplacements
8180
8154
  */
8181
8155
 
8182
- /**
8183
- * A simple translation stub to be used for multi-language support.
8184
- * Can be easily replaced with a more sophisticated solution.
8185
- *
8186
- * @param {string} template to interpolate
8187
- * @param {TranslateReplacements} [replacements] a map with substitutes
8188
- *
8189
- * @return {string} the translated string
8156
+ /**
8157
+ * A simple translation stub to be used for multi-language support.
8158
+ * Can be easily replaced with a more sophisticated solution.
8159
+ *
8160
+ * @param {string} template to interpolate
8161
+ * @param {TranslateReplacements} [replacements] a map with substitutes
8162
+ *
8163
+ * @return {string} the translated string
8190
8164
  */
8191
8165
  function translateFallback(template, replacements) {
8192
8166
  replacements = replacements || {};
@@ -8295,8 +8269,8 @@ function ListItem(props) {
8295
8269
  }
8296
8270
  const noop$1 = () => {};
8297
8271
 
8298
- /**
8299
- * @param {import('../PropertiesPanel').ListGroupDefinition} props
8272
+ /**
8273
+ * @param {import('../PropertiesPanel').ListGroupDefinition} props
8300
8274
  */
8301
8275
  function ListGroup(props) {
8302
8276
  const {
@@ -8487,18 +8461,18 @@ function Checkbox(props) {
8487
8461
  });
8488
8462
  }
8489
8463
 
8490
- /**
8491
- * @param {Object} props
8492
- * @param {Object} props.element
8493
- * @param {String} props.id
8494
- * @param {String} props.description
8495
- * @param {String} props.label
8496
- * @param {Function} props.getValue
8497
- * @param {Function} props.setValue
8498
- * @param {Function} props.onFocus
8499
- * @param {Function} props.onBlur
8500
- * @param {string|import('preact').Component} props.tooltip
8501
- * @param {boolean} [props.disabled]
8464
+ /**
8465
+ * @param {Object} props
8466
+ * @param {Object} props.element
8467
+ * @param {String} props.id
8468
+ * @param {String} props.description
8469
+ * @param {String} props.label
8470
+ * @param {Function} props.getValue
8471
+ * @param {Function} props.setValue
8472
+ * @param {Function} props.onFocus
8473
+ * @param {Function} props.onBlur
8474
+ * @param {string|import('preact').Component} props.tooltip
8475
+ * @param {boolean} [props.disabled]
8502
8476
  */
8503
8477
  function CheckboxEntry(props) {
8504
8478
  const {
@@ -8618,20 +8592,20 @@ function Select(props) {
8618
8592
  });
8619
8593
  }
8620
8594
 
8621
- /**
8622
- * @param {object} props
8623
- * @param {object} props.element
8624
- * @param {string} props.id
8625
- * @param {string} [props.description]
8626
- * @param {string} props.label
8627
- * @param {Function} props.getValue
8628
- * @param {Function} props.setValue
8629
- * @param {Function} props.onFocus
8630
- * @param {Function} props.onBlur
8631
- * @param {Function} props.getOptions
8632
- * @param {boolean} [props.disabled]
8633
- * @param {Function} [props.validate]
8634
- * @param {string|import('preact').Component} props.tooltip
8595
+ /**
8596
+ * @param {object} props
8597
+ * @param {object} props.element
8598
+ * @param {string} props.id
8599
+ * @param {string} [props.description]
8600
+ * @param {string} props.label
8601
+ * @param {Function} props.getValue
8602
+ * @param {Function} props.setValue
8603
+ * @param {Function} props.onFocus
8604
+ * @param {Function} props.onBlur
8605
+ * @param {Function} props.getOptions
8606
+ * @param {boolean} [props.disabled]
8607
+ * @param {Function} [props.validate]
8608
+ * @param {string|import('preact').Component} props.tooltip
8635
8609
  */
8636
8610
  function SelectEntry(props) {
8637
8611
  const {
@@ -8734,6 +8708,12 @@ function TextArea(props) {
8734
8708
  autoResize && resizeToContents(e.target);
8735
8709
  setLocalValue(e.target.value);
8736
8710
  };
8711
+ const handleOnBlur = e => {
8712
+ if (onBlur) {
8713
+ onBlur(e);
8714
+ }
8715
+ setLocalValue(e.target.value.trim());
8716
+ };
8737
8717
  hooks.useLayoutEffect(() => {
8738
8718
  autoResize && resizeToContents(ref.current);
8739
8719
  }, []);
@@ -8765,7 +8745,7 @@ function TextArea(props) {
8765
8745
  class: classnames('bio-properties-panel-input', monospace ? 'bio-properties-panel-input-monospace' : '', autoResize ? 'auto-resize' : ''),
8766
8746
  onInput: handleInput,
8767
8747
  onFocus: onFocus,
8768
- onBlur: onBlur,
8748
+ onBlur: handleOnBlur,
8769
8749
  placeholder: placeholder,
8770
8750
  rows: rows,
8771
8751
  value: localValue,
@@ -8883,6 +8863,12 @@ function Textfield(props) {
8883
8863
  const handleInputCallback = hooks.useMemo(() => {
8884
8864
  return debounce(target => onInput(target.value.length ? target.value : undefined));
8885
8865
  }, [onInput, debounce]);
8866
+ const handleOnBlur = e => {
8867
+ if (onBlur) {
8868
+ onBlur(e);
8869
+ }
8870
+ setLocalValue(e.target.value.trim());
8871
+ };
8886
8872
  const handleInput = e => {
8887
8873
  handleInputCallback(e.target);
8888
8874
  setLocalValue(e.target.value);
@@ -8915,27 +8901,27 @@ function Textfield(props) {
8915
8901
  class: "bio-properties-panel-input",
8916
8902
  onInput: handleInput,
8917
8903
  onFocus: onFocus,
8918
- onBlur: onBlur,
8904
+ onBlur: handleOnBlur,
8919
8905
  placeholder: placeholder,
8920
8906
  value: localValue
8921
8907
  })]
8922
8908
  });
8923
8909
  }
8924
8910
 
8925
- /**
8926
- * @param {Object} props
8927
- * @param {Object} props.element
8928
- * @param {String} props.id
8929
- * @param {String} props.description
8930
- * @param {Boolean} props.debounce
8931
- * @param {Boolean} props.disabled
8932
- * @param {String} props.label
8933
- * @param {Function} props.getValue
8934
- * @param {Function} props.setValue
8935
- * @param {Function} props.onFocus
8936
- * @param {Function} props.onBlur
8937
- * @param {string|import('preact').Component} props.tooltip
8938
- * @param {Function} props.validate
8911
+ /**
8912
+ * @param {Object} props
8913
+ * @param {Object} props.element
8914
+ * @param {String} props.id
8915
+ * @param {String} props.description
8916
+ * @param {Boolean} props.debounce
8917
+ * @param {Boolean} props.disabled
8918
+ * @param {String} props.label
8919
+ * @param {Function} props.getValue
8920
+ * @param {Function} props.setValue
8921
+ * @param {Function} props.onFocus
8922
+ * @param {Function} props.onBlur
8923
+ * @param {string|import('preact').Component} props.tooltip
8924
+ * @param {Function} props.validate
8939
8925
  */
8940
8926
  function TextfieldEntry(props) {
8941
8927
  const {
@@ -9010,20 +8996,20 @@ class FeelPopupModule {
9010
8996
  this._eventBus = eventBus;
9011
8997
  }
9012
8998
 
9013
- /**
9014
- * Check if the FEEL popup is open.
9015
- * @return {Boolean}
8999
+ /**
9000
+ * Check if the FEEL popup is open.
9001
+ * @return {Boolean}
9016
9002
  */
9017
9003
  isOpen() {
9018
9004
  return this._eventBus.fire('feelPopup._isOpen');
9019
9005
  }
9020
9006
 
9021
- /**
9022
- * Open the FEEL popup.
9023
- *
9024
- * @param {String} entryId
9025
- * @param {Object} popupConfig
9026
- * @param {HTMLElement} sourceElement
9007
+ /**
9008
+ * Open the FEEL popup.
9009
+ *
9010
+ * @param {String} entryId
9011
+ * @param {Object} popupConfig
9012
+ * @param {HTMLElement} sourceElement
9027
9013
  */
9028
9014
  open(entryId, popupConfig, sourceElement) {
9029
9015
  return this._eventBus.fire('feelPopup._open', {
@@ -9033,8 +9019,8 @@ class FeelPopupModule {
9033
9019
  });
9034
9020
  }
9035
9021
 
9036
- /**
9037
- * Close the FEEL popup.
9022
+ /**
9023
+ * Close the FEEL popup.
9038
9024
  */
9039
9025
  close() {
9040
9026
  return this._eventBus.fire('feelPopup._close');
@@ -10549,7 +10535,7 @@ function Height(props) {
10549
10535
  id,
10550
10536
  getValue,
10551
10537
  setValue,
10552
- validate: validate$a
10538
+ validate: validate$9
10553
10539
  });
10554
10540
  }
10555
10541
 
@@ -10559,7 +10545,7 @@ function Height(props) {
10559
10545
  * @param {number|void} value
10560
10546
  * @returns {string|null}
10561
10547
  */
10562
- const validate$a = value => {
10548
+ const validate$9 = value => {
10563
10549
  if (typeof value !== 'number') {
10564
10550
  return 'A number is required.';
10565
10551
  }
@@ -10623,7 +10609,7 @@ function Url(props) {
10623
10609
  setValue,
10624
10610
  singleLine: true,
10625
10611
  tooltip: getTooltip$1(),
10626
- validate: validate$9,
10612
+ validate: validate$8,
10627
10613
  variables
10628
10614
  });
10629
10615
  }
@@ -10651,7 +10637,7 @@ function getTooltip$1() {
10651
10637
  * @param {string|void} value
10652
10638
  * @returns {string|null}
10653
10639
  */
10654
- const validate$9 = value => {
10640
+ const validate$8 = value => {
10655
10641
  if (!value || value.startsWith('=')) {
10656
10642
  return;
10657
10643
  }
@@ -10742,7 +10728,7 @@ function Text(props) {
10742
10728
  };
10743
10729
  return FeelTemplatingEntry({
10744
10730
  debounce,
10745
- description: description$4,
10731
+ description: description$3,
10746
10732
  element: field,
10747
10733
  getValue,
10748
10734
  id,
@@ -10752,7 +10738,7 @@ function Text(props) {
10752
10738
  variables
10753
10739
  });
10754
10740
  }
10755
- const description$4 = jsxRuntime.jsxs(jsxRuntime.Fragment, {
10741
+ const description$3 = jsxRuntime.jsxs(jsxRuntime.Fragment, {
10756
10742
  children: ["Supports markdown and templating.", ' ', jsxRuntime.jsx("a", {
10757
10743
  href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-text/",
10758
10744
  target: "_blank",
@@ -10795,13 +10781,13 @@ function Content(props) {
10795
10781
  };
10796
10782
  return FeelTemplatingEntry({
10797
10783
  debounce,
10798
- description: description$3,
10784
+ description: description$2,
10799
10785
  element: field,
10800
10786
  getValue,
10801
10787
  id,
10802
10788
  label: 'Content',
10803
10789
  hostLanguage: 'html',
10804
- validate: validate$8,
10790
+ validate: validate$7,
10805
10791
  setValue,
10806
10792
  variables
10807
10793
  });
@@ -10809,7 +10795,7 @@ function Content(props) {
10809
10795
 
10810
10796
  // helpers //////////
10811
10797
 
10812
- const description$3 = jsxRuntime.jsxs(jsxRuntime.Fragment, {
10798
+ const description$2 = jsxRuntime.jsxs(jsxRuntime.Fragment, {
10813
10799
  children: ["Supports HTML, styling, and templating. Styles are automatically scoped to the HTML component.", ' ', jsxRuntime.jsx("a", {
10814
10800
  href: "https://docs.camunda.io/docs/components/modeler/forms/form-element-library/forms-element-library-html/",
10815
10801
  target: "_blank",
@@ -10822,7 +10808,7 @@ const description$3 = jsxRuntime.jsxs(jsxRuntime.Fragment, {
10822
10808
  * @param {string|void} value
10823
10809
  * @returns {string|null}
10824
10810
  */
10825
- const validate$8 = value => {
10811
+ const validate$7 = value => {
10826
10812
  // allow empty state
10827
10813
  if (typeof value !== 'string' || value === '') {
10828
10814
  return null;
@@ -11661,7 +11647,7 @@ function InputValuesKey(props) {
11661
11647
  id,
11662
11648
  label: 'Input values key',
11663
11649
  setValue,
11664
- validate: validate$7
11650
+ validate: validate$6
11665
11651
  });
11666
11652
  }
11667
11653
 
@@ -11671,7 +11657,7 @@ function InputValuesKey(props) {
11671
11657
  * @param {string|void} value
11672
11658
  * @returns {string|null}
11673
11659
  */
11674
- const validate$7 = value => {
11660
+ const validate$6 = value => {
11675
11661
  if (typeof value !== 'string' || value.length === 0) {
11676
11662
  return 'Must not be empty.';
11677
11663
  }
@@ -11697,7 +11683,14 @@ function StaticOptionsSourceEntry(props) {
11697
11683
  editField(field, formJsViewer.OPTIONS_SOURCES_PATHS[formJsViewer.OPTIONS_SOURCES.STATIC], arrayAdd(values, values.length, entry));
11698
11684
  };
11699
11685
  const removeEntry = entry => {
11700
- editField(field, formJsViewer.OPTIONS_SOURCES_PATHS[formJsViewer.OPTIONS_SOURCES.STATIC], minDash.without(values, entry));
11686
+ if (field.defaultValue === entry.value) {
11687
+ editField(field, {
11688
+ values: minDash.without(values, entry),
11689
+ defaultValue: undefined
11690
+ });
11691
+ } else {
11692
+ editField(field, formJsViewer.OPTIONS_SOURCES_PATHS[formJsViewer.OPTIONS_SOURCES.STATIC], minDash.without(values, entry));
11693
+ }
11701
11694
  };
11702
11695
  const validateFactory = (key, getValue) => {
11703
11696
  return value => {
@@ -12113,7 +12106,7 @@ function Source(props) {
12113
12106
  setValue,
12114
12107
  singleLine: true,
12115
12108
  variables,
12116
- validate: validate$6
12109
+ validate: validate$5
12117
12110
  });
12118
12111
  }
12119
12112
 
@@ -12123,7 +12116,7 @@ function Source(props) {
12123
12116
  * @param {string|void} value
12124
12117
  * @returns {string|null}
12125
12118
  */
12126
- const validate$6 = value => {
12119
+ const validate$5 = value => {
12127
12120
  if (!minDash.isString(value) || value.length === 0) {
12128
12121
  return 'Must not be empty.';
12129
12122
  }
@@ -12227,7 +12220,7 @@ function RowCount(props) {
12227
12220
  id,
12228
12221
  getValue,
12229
12222
  setValue,
12230
- validate: validate$5
12223
+ validate: validate$4
12231
12224
  });
12232
12225
  }
12233
12226
 
@@ -12237,7 +12230,7 @@ function RowCount(props) {
12237
12230
  * @param {string|void} value
12238
12231
  * @returns {string|null}
12239
12232
  */
12240
- const validate$5 = value => {
12233
+ const validate$4 = value => {
12241
12234
  if (minDash.isNil(value)) {
12242
12235
  return null;
12243
12236
  }
@@ -12411,7 +12404,7 @@ function ColumnsExpression(props) {
12411
12404
  setValue,
12412
12405
  singleLine: true,
12413
12406
  variables,
12414
- validate: validate$4
12407
+ validate: validate$3
12415
12408
  });
12416
12409
  }
12417
12410
 
@@ -12421,7 +12414,7 @@ function ColumnsExpression(props) {
12421
12414
  * @param {string|void} value
12422
12415
  * @returns {string|null}
12423
12416
  */
12424
- const validate$4 = value => {
12417
+ const validate$3 = value => {
12425
12418
  if (!minDash.isString(value) || value.length === 0 || value === '=') {
12426
12419
  return 'Must not be empty.';
12427
12420
  }
@@ -12519,7 +12512,7 @@ function Key(props) {
12519
12512
  id,
12520
12513
  label: 'Key',
12521
12514
  setValue,
12522
- validate: validate$3
12515
+ validate: validate$2
12523
12516
  });
12524
12517
  }
12525
12518
 
@@ -12529,7 +12522,7 @@ function Key(props) {
12529
12522
  * @param {string|void} value
12530
12523
  * @returns {string|null}
12531
12524
  */
12532
- function validate$3(value) {
12525
+ function validate$2(value) {
12533
12526
  if (!minDash.isString(value) || value.length === 0) {
12534
12527
  return 'Must not be empty.';
12535
12528
  }
@@ -12667,13 +12660,13 @@ function Accept(props) {
12667
12660
  singleLine: true,
12668
12661
  setValue,
12669
12662
  variables,
12670
- description: description$2
12663
+ description: description$1
12671
12664
  });
12672
12665
  }
12673
12666
 
12674
12667
  // helpers //////////
12675
12668
 
12676
- const description$2 = jsxRuntime.jsxs(jsxRuntime.Fragment, {
12669
+ const description$1 = jsxRuntime.jsxs(jsxRuntime.Fragment, {
12677
12670
  children: ["A comma-separated list of", ' ', jsxRuntime.jsx("a", {
12678
12671
  href: "https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#unique_file_type_specifiers",
12679
12672
  target: "_blank",
@@ -12794,85 +12787,6 @@ function DocumentsDataSource(props) {
12794
12787
  setValue,
12795
12788
  variables,
12796
12789
  tooltip,
12797
- validate: validate$2
12798
- });
12799
- }
12800
-
12801
- // helpers //////////
12802
-
12803
- /**
12804
- * @param {string|undefined} value
12805
- * @returns {string|null}
12806
- */
12807
- const validate$2 = value => {
12808
- if (typeof value !== 'string' || value.length === 0) {
12809
- return 'The document data source is required.';
12810
- }
12811
- };
12812
-
12813
- function EndpointKeyEntry(props) {
12814
- const {
12815
- editField,
12816
- field
12817
- } = props;
12818
- const entries = [];
12819
- entries.push({
12820
- id: 'endpointKey',
12821
- component: EndpointKey,
12822
- editField: editField,
12823
- field: field,
12824
- isEdited: isEdited$6,
12825
- isDefaultVisible: field => field.type === 'documentPreview'
12826
- });
12827
- return entries;
12828
- }
12829
- function EndpointKey(props) {
12830
- const {
12831
- editField,
12832
- field,
12833
- id
12834
- } = props;
12835
- const debounce = useService('debounce');
12836
- const variables = useVariables().map(name => ({
12837
- name
12838
- }));
12839
- const path = ['endpointKey'];
12840
- const getValue = () => {
12841
- return minDash.get(field, path, '');
12842
- };
12843
- const setValue = value => {
12844
- return editField(field, path, value);
12845
- };
12846
- const tooltip = jsxRuntime.jsxs("div", {
12847
- children: [jsxRuntime.jsx("p", {
12848
- children: "Enter a context key that generates a string with the API endpoint to download a document."
12849
- }), jsxRuntime.jsxs("p", {
12850
- children: ["The string must contain ", jsxRuntime.jsx("code", {
12851
- children: '{ documentId }'
12852
- }), ", which will be replaced with the document ID from the document\u2018s reference."]
12853
- }), jsxRuntime.jsx("p", {
12854
- children: "If you\u2018re using the Camunda Tasklist, this variable is automatically added to the context for you."
12855
- }), jsxRuntime.jsxs("p", {
12856
- children: ["For more details, see the", ' ', jsxRuntime.jsx("a", {
12857
- href: "https://docs.camunda.io/docs/next/components/modeler/forms/form-element-library/forms-element-library-document-preview/",
12858
- rel: "noopener noreferrer",
12859
- target: "_blank",
12860
- children: "Camunda documentation"
12861
- })]
12862
- })]
12863
- });
12864
- return FeelTemplatingEntry({
12865
- debounce,
12866
- element: field,
12867
- getValue,
12868
- id,
12869
- label: 'Document URL',
12870
- feel: 'required',
12871
- singleLine: true,
12872
- setValue,
12873
- variables,
12874
- description: description$1,
12875
- tooltip,
12876
12790
  validate: validate$1
12877
12791
  });
12878
12792
  }
@@ -12885,12 +12799,9 @@ function EndpointKey(props) {
12885
12799
  */
12886
12800
  const validate$1 = value => {
12887
12801
  if (typeof value !== 'string' || value.length === 0) {
12888
- return 'The document reference is required.';
12802
+ return 'The document data source is required.';
12889
12803
  }
12890
12804
  };
12891
- const description$1 = jsxRuntime.jsx(jsxRuntime.Fragment, {
12892
- children: "Define an API URL for downloading a document"
12893
- });
12894
12805
 
12895
12806
  function MaxHeightEntry(props) {
12896
12807
  const {
@@ -13672,21 +13583,6 @@ const TOOLTIP_TEXT = `"List of items" defines a constant, predefined set of form
13672
13583
  "Expression" defines options that are populated from a FEEL expression.
13673
13584
  `;
13674
13585
 
13675
- function DownloadSettings(field, editField) {
13676
- const entries = [...EndpointKeyEntry({
13677
- field,
13678
- editField
13679
- })];
13680
- if (!entries.length) {
13681
- return null;
13682
- }
13683
- return {
13684
- id: 'downloadSettings',
13685
- label: 'Download settings',
13686
- entries
13687
- };
13688
- }
13689
-
13690
13586
  class PropertiesProvider {
13691
13587
  constructor(propertiesPanel, injector) {
13692
13588
  this._injector = injector;
@@ -13722,7 +13618,7 @@ class PropertiesProvider {
13722
13618
  return groups;
13723
13619
  }
13724
13620
  const getService = (type, strict = true) => this._injector.get(type, strict);
13725
- groups = [...groups, GeneralGroup(field, editField, getService), DownloadSettings(field, editField), ...OptionsGroups(field, editField, getService), ...TableHeaderGroups(field, editField), SecurityAttributesGroup(field, editField), ConditionGroup(field, editField), LayoutGroup(field, editField), AppearanceGroup(field, editField), SerializationGroup(field, editField), ConstraintsGroup(field, editField), ValidationGroup(field, editField), CustomPropertiesGroup(field, editField)].filter(group => group != null);
13621
+ groups = [...groups, GeneralGroup(field, editField, getService), ...OptionsGroups(field, editField, getService), ...TableHeaderGroups(field, editField), SecurityAttributesGroup(field, editField), ConditionGroup(field, editField), LayoutGroup(field, editField), AppearanceGroup(field, editField), SerializationGroup(field, editField), ConstraintsGroup(field, editField), ValidationGroup(field, editField), CustomPropertiesGroup(field, editField)].filter(group => group != null);
13726
13622
  this._filterVisibleEntries(groups, field, getService);
13727
13623
 
13728
13624
  // contract: if a group has no entries or items, it should not be displayed at all