@bpmn-io/properties-panel 3.10.1 → 3.12.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.js CHANGED
@@ -139,6 +139,29 @@ FeelIcon$1.defaultProps = {
139
139
  fill: "none",
140
140
  xmlns: "http://www.w3.org/2000/svg"
141
141
  };
142
+ var HelpIcon = function HelpIcon(props) {
143
+ return jsxRuntime.jsxs("svg", {
144
+ ...props,
145
+ children: [jsxRuntime.jsx("path", {
146
+ d: "M16 2a14 14 0 1 0 14 14A14 14 0 0 0 16 2Zm0 26a12 12 0 1 1 12-12 12 12 0 0 1-12 12Z"
147
+ }), jsxRuntime.jsx("circle", {
148
+ cx: "16",
149
+ cy: "23.5",
150
+ r: "1.5"
151
+ }), jsxRuntime.jsx("path", {
152
+ d: "M17 8h-1.5a4.49 4.49 0 0 0-4.5 4.5v.5h2v-.5a2.5 2.5 0 0 1 2.5-2.5H17a2.5 2.5 0 0 1 0 5h-2v4.5h2V17a4.5 4.5 0 0 0 0-9Z"
153
+ }), jsxRuntime.jsx("path", {
154
+ style: {
155
+ fill: "none"
156
+ },
157
+ d: "M0 0h32v32H0z"
158
+ })]
159
+ });
160
+ };
161
+ HelpIcon.defaultProps = {
162
+ xmlns: "http://www.w3.org/2000/svg",
163
+ viewBox: "0 0 32 32"
164
+ };
142
165
 
143
166
  function Header(props) {
144
167
  const {
@@ -730,6 +753,7 @@ function Group(props) {
730
753
  edited: edited,
731
754
  hasErrors: hasErrors
732
755
  }), jsxRuntime.jsx("button", {
756
+ type: "button",
733
757
  title: "Toggle section",
734
758
  class: "bio-properties-panel-group-header-button bio-properties-panel-arrow",
735
759
  children: jsxRuntime.jsx(ArrowIcon, {
@@ -912,6 +936,7 @@ const CodeEditor$1 = compat.forwardRef((props, ref) => {
912
936
  ref: inputRef,
913
937
  onClick: handleClick
914
938
  }), jsxRuntime.jsx("button", {
939
+ type: "button",
915
940
  title: "Open pop-up editor",
916
941
  class: "bio-properties-panel-open-feel-popup",
917
942
  onClick: () => onPopupOpen('feelers'),
@@ -1033,6 +1058,7 @@ const CodeEditor = compat.forwardRef((props, ref) => {
1033
1058
  ref: inputRef,
1034
1059
  onClick: handleClick
1035
1060
  }), jsxRuntime.jsx("button", {
1061
+ type: "button",
1036
1062
  title: "Open pop-up editor",
1037
1063
  class: "bio-properties-panel-open-feel-popup",
1038
1064
  onClick: () => onPopupOpen(),
@@ -1079,6 +1105,7 @@ function FeelIcon(props) {
1079
1105
  }
1080
1106
  };
1081
1107
  return jsxRuntime.jsx("button", {
1108
+ type: "button",
1082
1109
  class: classnames__default["default"]('bio-properties-panel-feel-icon', active ? 'active' : null, feel === 'required' ? 'required' : 'optional'),
1083
1110
  onClick: handleClick,
1084
1111
  disabled: feel === 'required' || disabled,
@@ -1528,6 +1555,12 @@ function FeelPopupComponent(props) {
1528
1555
  domNode: popupRef.current
1529
1556
  });
1530
1557
  }, []);
1558
+ hooks.useEffect(() => {
1559
+ // Set focus on editor when popup is opened
1560
+ if (editorRef.current) {
1561
+ editorRef.current.focus();
1562
+ }
1563
+ }, [editorRef]);
1531
1564
  return jsxRuntime.jsxs(Popup, {
1532
1565
  container: container,
1533
1566
  className: "bio-properties-panel-feel-popup",
@@ -1545,10 +1578,21 @@ function FeelPopupComponent(props) {
1545
1578
  height: FEEL_POPUP_HEIGHT,
1546
1579
  width: FEEL_POPUP_WIDTH,
1547
1580
  ref: popupRef,
1548
- children: [jsxRuntime.jsx(Popup.Title, {
1581
+ children: [jsxRuntime.jsxs(Popup.Title, {
1549
1582
  title: title,
1550
1583
  emit: emit,
1551
- draggable: true
1584
+ draggable: true,
1585
+ children: [type === 'feel' && jsxRuntime.jsxs("a", {
1586
+ href: "https://docs.camunda.io/docs/components/modeler/feel/what-is-feel/",
1587
+ target: "_blank",
1588
+ class: "bio-properties-panel-feel-popup__title-link",
1589
+ children: ["Learn FEEL expressions", jsxRuntime.jsx(HelpIcon, {})]
1590
+ }), type === 'feelers' && jsxRuntime.jsxs("a", {
1591
+ href: "https://docs.camunda.io/docs/components/modeler/forms/configuration/forms-config-templating-syntax/",
1592
+ target: "_blank",
1593
+ class: "bio-properties-panel-feel-popup__title-link",
1594
+ children: ["Learn templating", jsxRuntime.jsx(HelpIcon, {})]
1595
+ })]
1552
1596
  }), jsxRuntime.jsx(Popup.Body, {
1553
1597
  children: jsxRuntime.jsxs("div", {
1554
1598
  onKeyDownCapture: onKeyDownCapture,
@@ -1580,6 +1624,7 @@ function FeelPopupComponent(props) {
1580
1624
  })
1581
1625
  }), jsxRuntime.jsx(Popup.Footer, {
1582
1626
  children: jsxRuntime.jsx("button", {
1627
+ type: "button",
1583
1628
  onClick: onClose,
1584
1629
  title: "Close pop-up editor",
1585
1630
  class: "bio-properties-panel-feel-popup__close-btn",
@@ -2893,6 +2938,7 @@ function MenuItem({
2893
2938
  }
2894
2939
  if (item.action) {
2895
2940
  return jsxRuntime.jsx("button", {
2941
+ type: "button",
2896
2942
  class: "bio-properties-panel-dropdown-button__menu-item bio-properties-panel-dropdown-button__menu-item--actionable",
2897
2943
  onClick: event => onClick(event, item.action),
2898
2944
  children: item.entry
@@ -2937,6 +2983,7 @@ function HeaderButton(props) {
2937
2983
  ...otherProps
2938
2984
  } = props;
2939
2985
  return jsxRuntime.jsx("button", {
2986
+ type: "button",
2940
2987
  ...otherProps,
2941
2988
  onClick: onClick,
2942
2989
  class: classnames__default["default"]('bio-properties-panel-group-header-button', classname),
@@ -2981,12 +3028,14 @@ function CollapsibleEntry(props) {
2981
3028
  class: classnames__default["default"]('bio-properties-panel-collapsible-entry-header-title', !label && 'empty'),
2982
3029
  children: label || placeholderLabel
2983
3030
  }), jsxRuntime.jsx("button", {
3031
+ type: "button",
2984
3032
  title: "Toggle list item",
2985
3033
  class: "bio-properties-panel-arrow bio-properties-panel-collapsible-entry-arrow",
2986
3034
  children: jsxRuntime.jsx(ArrowIcon, {
2987
3035
  class: open ? 'bio-properties-panel-arrow-down' : 'bio-properties-panel-arrow-right'
2988
3036
  })
2989
3037
  }), remove ? jsxRuntime.jsx("button", {
3038
+ type: "button",
2990
3039
  title: "Delete item",
2991
3040
  class: "bio-properties-panel-remove-entry",
2992
3041
  onClick: remove,
@@ -3190,6 +3239,7 @@ function ListGroup(props) {
3190
3239
  }), jsxRuntime.jsxs("div", {
3191
3240
  class: "bio-properties-panel-group-header-buttons",
3192
3241
  children: [add ? jsxRuntime.jsxs("button", {
3242
+ type: "button",
3193
3243
  title: "Create new list item",
3194
3244
  class: "bio-properties-panel-group-header-button bio-properties-panel-add-entry",
3195
3245
  onClick: handleAddClick,
@@ -3202,6 +3252,7 @@ function ListGroup(props) {
3202
3252
  class: classnames__default["default"]('bio-properties-panel-list-badge', hasError ? 'bio-properties-panel-list-badge--error' : ''),
3203
3253
  children: items.length
3204
3254
  }) : null, hasItems ? jsxRuntime.jsx("button", {
3255
+ type: "button",
3205
3256
  title: "Toggle section",
3206
3257
  class: "bio-properties-panel-group-header-button bio-properties-panel-arrow",
3207
3258
  children: jsxRuntime.jsx(ArrowIcon, {
@@ -3584,6 +3635,7 @@ function List(props) {
3584
3635
  }), jsxRuntime.jsxs("div", {
3585
3636
  class: "bio-properties-panel-list-entry-header-buttons",
3586
3637
  children: [jsxRuntime.jsxs("button", {
3638
+ type: "button",
3587
3639
  title: "Create new list item",
3588
3640
  onClick: addItem,
3589
3641
  class: "bio-properties-panel-add-entry",
@@ -3596,6 +3648,7 @@ function List(props) {
3596
3648
  class: "bio-properties-panel-list-badge",
3597
3649
  children: items.length
3598
3650
  }), hasItems && jsxRuntime.jsx("button", {
3651
+ type: "button",
3599
3652
  title: "Toggle list item",
3600
3653
  class: "bio-properties-panel-arrow",
3601
3654
  children: jsxRuntime.jsx(ArrowIcon, {
@@ -4307,6 +4360,7 @@ exports.FeelToggleSwitchEntry = FeelToggleSwitchEntry;
4307
4360
  exports.Group = Group;
4308
4361
  exports.Header = Header;
4309
4362
  exports.HeaderButton = HeaderButton;
4363
+ exports.HelpIcon = HelpIcon;
4310
4364
  exports.LayoutContext = LayoutContext;
4311
4365
  exports.ListEntry = List;
4312
4366
  exports.ListGroup = ListGroup;