@bpmn-io/properties-panel 3.19.0 → 3.20.1

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
@@ -173,6 +173,21 @@ PopupIcon.defaultProps = {
173
173
  height: "16",
174
174
  viewBox: "0 0 32 32"
175
175
  };
176
+ var CloseIcon = function CloseIcon(props) {
177
+ return jsxRuntime.jsx("svg", {
178
+ ...props,
179
+ children: jsxRuntime.jsx("path", {
180
+ fillRule: "evenodd",
181
+ d: "m12 4.7-.7-.7L8 7.3 4.7 4l-.7.7L7.3 8 4 11.3l.7.7L8 8.7l3.3 3.3.7-.7L8.7 8 12 4.7Z",
182
+ fill: "currentColor"
183
+ })
184
+ });
185
+ };
186
+ CloseIcon.defaultProps = {
187
+ xmlns: "http://www.w3.org/2000/svg",
188
+ width: "16",
189
+ height: "16"
190
+ };
176
191
 
177
192
  function Header(props) {
178
193
  const {
@@ -917,7 +932,8 @@ const CodeEditor$1 = compat.forwardRef((props, ref) => {
917
932
  tooltipContainer,
918
933
  enableGutters,
919
934
  hostLanguage,
920
- singleLine
935
+ singleLine,
936
+ lineWrap: true
921
937
  });
922
938
  setEditor(editor);
923
939
  return () => {
@@ -954,7 +970,7 @@ const CodeEditor$1 = compat.forwardRef((props, ref) => {
954
970
  title: "Open pop-up editor",
955
971
  class: "bio-properties-panel-open-feel-popup",
956
972
  onClick: () => onPopupOpen('feelers'),
957
- children: jsxRuntime.jsx(ExternalLinkIcon, {})
973
+ children: jsxRuntime.jsx(PopupIcon, {})
958
974
  })]
959
975
  });
960
976
  });
@@ -995,6 +1011,7 @@ const CodeEditor = compat.forwardRef((props, ref) => {
995
1011
  onFeelToggle = noop$5,
996
1012
  onLint = noop$5,
997
1013
  onPopupOpen = noop$5,
1014
+ placeholder,
998
1015
  popupOpen,
999
1016
  disabled,
1000
1017
  tooltipContainer,
@@ -1031,6 +1048,7 @@ const CodeEditor = compat.forwardRef((props, ref) => {
1031
1048
  onChange: handleInput,
1032
1049
  onKeyDown: onKeyDown,
1033
1050
  onLint: onLint,
1051
+ placeholder: placeholder,
1034
1052
  tooltipContainer: tooltipContainer,
1035
1053
  value: localValue,
1036
1054
  variables: variables,
@@ -1060,6 +1078,12 @@ const CodeEditor = compat.forwardRef((props, ref) => {
1060
1078
  }
1061
1079
  editor.setVariables(variables);
1062
1080
  }, [variables]);
1081
+ hooks.useEffect(() => {
1082
+ if (!editor) {
1083
+ return;
1084
+ }
1085
+ editor.setPlaceholder(placeholder);
1086
+ }, [placeholder]);
1063
1087
  const handleClick = () => {
1064
1088
  ref.current.focus();
1065
1089
  };
@@ -1316,6 +1340,9 @@ function Title(props) {
1316
1340
  draggable,
1317
1341
  emit = () => {},
1318
1342
  title,
1343
+ showCloseButton = false,
1344
+ closeButtonTooltip = 'Close popup',
1345
+ onClose,
1319
1346
  ...rest
1320
1347
  } = props;
1321
1348
 
@@ -1386,7 +1413,12 @@ function Title(props) {
1386
1413
  }), jsxRuntime.jsx("div", {
1387
1414
  class: "bio-properties-panel-popup__title",
1388
1415
  children: title
1389
- }), children]
1416
+ }), children, showCloseButton && jsxRuntime.jsx("button", {
1417
+ title: closeButtonTooltip,
1418
+ class: "bio-properties-panel-popup__close",
1419
+ onClick: onClose,
1420
+ children: jsxRuntime.jsx(CloseIcon, {})
1421
+ })]
1390
1422
  });
1391
1423
  }
1392
1424
  function Body(props) {
@@ -1604,6 +1636,9 @@ function FeelPopupComponent(props) {
1604
1636
  children: [jsxRuntime.jsxs(Popup.Title, {
1605
1637
  title: title,
1606
1638
  emit: emit,
1639
+ showCloseButton: true,
1640
+ closeButtonTooltip: "Save and close",
1641
+ onClose: onClose,
1607
1642
  draggable: true,
1608
1643
  children: [type === 'feel' && jsxRuntime.jsxs("a", {
1609
1644
  href: "https://docs.camunda.io/docs/components/modeler/feel/what-is-feel/",
@@ -1645,14 +1680,6 @@ function FeelPopupComponent(props) {
1645
1680
  tooltipContainer: tooltipContainer
1646
1681
  })]
1647
1682
  })
1648
- }), jsxRuntime.jsx(Popup.Footer, {
1649
- children: jsxRuntime.jsx("button", {
1650
- type: "button",
1651
- onClick: () => onClose(),
1652
- title: "Close pop-up editor",
1653
- class: "bio-properties-panel-feel-popup__close-btn",
1654
- children: "Close"
1655
- })
1656
1683
  })]
1657
1684
  });
1658
1685
  }
@@ -1965,6 +1992,7 @@ function FeelTextfieldComponent(props) {
1965
1992
  hostLanguage,
1966
1993
  onInput,
1967
1994
  onError,
1995
+ placeholder,
1968
1996
  feel,
1969
1997
  value = '',
1970
1998
  disabled = false,
@@ -2139,6 +2167,7 @@ function FeelTextfieldComponent(props) {
2139
2167
  },
2140
2168
  onLint: handleLint,
2141
2169
  onPopupOpen: handlePopupOpen,
2170
+ placeholder: placeholder,
2142
2171
  value: feelOnlyValue,
2143
2172
  variables: variables,
2144
2173
  ref: editorRef,
@@ -2167,7 +2196,8 @@ const OptionalFeelInput = compat.forwardRef((props, ref) => {
2167
2196
  onInput,
2168
2197
  value,
2169
2198
  onFocus,
2170
- onBlur
2199
+ onBlur,
2200
+ placeholder
2171
2201
  } = props;
2172
2202
  const inputRef = hooks.useRef();
2173
2203
 
@@ -2200,6 +2230,7 @@ const OptionalFeelInput = compat.forwardRef((props, ref) => {
2200
2230
  onInput: e => onInput(e.target.value),
2201
2231
  onFocus: onFocus,
2202
2232
  onBlur: onBlur,
2233
+ placeholder: placeholder,
2203
2234
  value: value || ''
2204
2235
  });
2205
2236
  });
@@ -2257,7 +2288,8 @@ const OptionalFeelTextArea = compat.forwardRef((props, ref) => {
2257
2288
  onInput,
2258
2289
  value,
2259
2290
  onFocus,
2260
- onBlur
2291
+ onBlur,
2292
+ placeholder
2261
2293
  } = props;
2262
2294
  const inputRef = hooks.useRef();
2263
2295
 
@@ -2285,6 +2317,7 @@ const OptionalFeelTextArea = compat.forwardRef((props, ref) => {
2285
2317
  onInput: e => onInput(e.target.value),
2286
2318
  onFocus: onFocus,
2287
2319
  onBlur: onBlur,
2320
+ placeholder: placeholder,
2288
2321
  value: value || '',
2289
2322
  "data-gramm": "false"
2290
2323
  });
@@ -2380,6 +2413,7 @@ const OptionalFeelCheckbox = compat.forwardRef((props, ref) => {
2380
2413
  * @param {Function} props.variables
2381
2414
  * @param {Function} props.onFocus
2382
2415
  * @param {Function} props.onBlur
2416
+ * @param {string} [props.placeholder]
2383
2417
  * @param {string|import('preact').Component} props.tooltip
2384
2418
  */
2385
2419
  function FeelEntry(props) {
@@ -2402,6 +2436,7 @@ function FeelEntry(props) {
2402
2436
  variables,
2403
2437
  onFocus,
2404
2438
  onBlur,
2439
+ placeholder,
2405
2440
  tooltip
2406
2441
  } = props;
2407
2442
  const [validationError, setValidationError] = hooks.useState(null);
@@ -2445,6 +2480,7 @@ function FeelEntry(props) {
2445
2480
  onError: onError,
2446
2481
  onFocus: onFocus,
2447
2482
  onBlur: onBlur,
2483
+ placeholder: placeholder,
2448
2484
  example: example,
2449
2485
  hostLanguage: hostLanguage,
2450
2486
  singleLine: singleLine,
@@ -2513,6 +2549,7 @@ function FeelNumberEntry(props) {
2513
2549
  * @param {Function} props.variables
2514
2550
  * @param {Function} props.onFocus
2515
2551
  * @param {Function} props.onBlur
2552
+ * @param {string} [props.placeholder]
2516
2553
  */
2517
2554
  function FeelTextAreaEntry(props) {
2518
2555
  return jsxRuntime.jsx(FeelEntry, {
@@ -3947,6 +3984,7 @@ function TextArea(props) {
3947
3984
  onFocus,
3948
3985
  onBlur,
3949
3986
  autoResize,
3987
+ placeholder,
3950
3988
  rows = autoResize ? 1 : 2,
3951
3989
  tooltip
3952
3990
  } = props;
@@ -3989,6 +4027,7 @@ function TextArea(props) {
3989
4027
  onInput: handleInput,
3990
4028
  onFocus: onFocus,
3991
4029
  onBlur: onBlur,
4030
+ placeholder: placeholder,
3992
4031
  rows: rows,
3993
4032
  value: localValue,
3994
4033
  disabled: disabled,
@@ -4028,6 +4067,7 @@ function TextAreaEntry(props) {
4028
4067
  validate,
4029
4068
  onFocus,
4030
4069
  onBlur,
4070
+ placeholder,
4031
4071
  autoResize,
4032
4072
  tooltip
4033
4073
  } = props;
@@ -4063,6 +4103,7 @@ function TextAreaEntry(props) {
4063
4103
  debounce: debounce,
4064
4104
  monospace: monospace,
4065
4105
  disabled: disabled,
4106
+ placeholder: placeholder,
4066
4107
  autoResize: autoResize,
4067
4108
  tooltip: tooltip,
4068
4109
  element: element
@@ -4095,6 +4136,7 @@ function Textfield(props) {
4095
4136
  onInput,
4096
4137
  onFocus,
4097
4138
  onBlur,
4139
+ placeholder,
4098
4140
  value = '',
4099
4141
  tooltip
4100
4142
  } = props;
@@ -4136,6 +4178,7 @@ function Textfield(props) {
4136
4178
  onInput: handleInput,
4137
4179
  onFocus: onFocus,
4138
4180
  onBlur: onBlur,
4181
+ placeholder: placeholder,
4139
4182
  value: localValue
4140
4183
  })]
4141
4184
  });
@@ -4169,6 +4212,7 @@ function TextfieldEntry(props) {
4169
4212
  validate,
4170
4213
  onFocus,
4171
4214
  onBlur,
4215
+ placeholder,
4172
4216
  tooltip
4173
4217
  } = props;
4174
4218
  const globalError = useError(id);
@@ -4200,6 +4244,7 @@ function TextfieldEntry(props) {
4200
4244
  onInput: onInput,
4201
4245
  onFocus: onFocus,
4202
4246
  onBlur: onBlur,
4247
+ placeholder: placeholder,
4203
4248
  value: value,
4204
4249
  tooltip: tooltip,
4205
4250
  element: element
@@ -4283,6 +4328,7 @@ var index = {
4283
4328
 
4284
4329
  exports.ArrowIcon = ArrowIcon;
4285
4330
  exports.CheckboxEntry = CheckboxEntry;
4331
+ exports.CloseIcon = CloseIcon;
4286
4332
  exports.CollapsibleEntry = CollapsibleEntry;
4287
4333
  exports.CreateIcon = CreateIcon;
4288
4334
  exports.DebounceInputModule = index$1;