@bpmn-io/properties-panel 3.15.0 → 3.17.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.
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * Theming
3
3
  */
4
- .bio-properties-panel {
4
+ .bio-properties-panel,
5
+ .djs-parent {
5
6
  --color-grey-225-10-15: hsl(225, 10%, 15%);
6
7
  --color-grey-225-10-35: hsl(225, 10%, 35%);
7
8
  --color-grey-225-10-55: hsl(225, 10%, 55%);
@@ -26,11 +27,13 @@
26
27
  --color-red-360-100-45: hsl(360, 100%, 45%);
27
28
  --color-red-360-100-92: hsl(360, 100%, 92%);
28
29
  --color-red-360-100-97: hsl(360, 100%, 97%);
29
-
30
30
  --color-white: white;
31
31
  --color-black: black;
32
32
  --color-transparent: transparent;
33
33
 
34
+ }
35
+
36
+ .bio-properties-panel {
34
37
  --text-base-color: var(--color-grey-225-10-15);
35
38
  --text-error-color: var(--color-red-360-100-45);
36
39
  --link-color: var(--color-blue-205-100-50);
@@ -118,12 +121,6 @@
118
121
 
119
122
  --feelers-select-color: var(--color-blue-205-100-85);
120
123
 
121
- --tooltip-underline-color: var(--color-blue-219-99-53);
122
- --tooltip-background-color: var(--color-grey-0-0-22);
123
- --tooltip-link: var(--color-blue-218-100-74);
124
- --tooltip-code-background-color: var(--color-grey-225-10-97);
125
- --tooltip-code-border-color: var(--color-grey-225-10-85);
126
-
127
124
  --text-size-base: 14px;
128
125
  --text-size-small: 13px;
129
126
  --text-size-smallest: 12px;
@@ -1116,7 +1113,7 @@ textarea.bio-properties-panel-input {
1116
1113
  }
1117
1114
 
1118
1115
  .bio-properties-panel-feel-editor-container .bio-properties-panel-input {
1119
- resize: vertical;
1116
+ resize: none;
1120
1117
  overflow: hidden;
1121
1118
  overflow-y: auto;
1122
1119
  }
@@ -1149,19 +1146,35 @@ textarea.bio-properties-panel-input {
1149
1146
  text-decoration-style: dotted;
1150
1147
  text-underline-offset: 2px;
1151
1148
  font: inherit;
1149
+ display: flex;
1150
+ justify-content: center;
1151
+ width: fit-content;
1152
1152
  }
1153
1153
 
1154
1154
  .bio-properties-panel-tooltip {
1155
+ --tooltip-underline-color: var(--color-blue-219-99-53);
1156
+ --tooltip-background-color: var(--color-grey-0-0-22);
1157
+ --tooltip-link: var(--color-blue-218-100-74);
1158
+ --tooltip-code-background-color: var(--color-grey-225-10-97);
1159
+ --tooltip-code-border-color: var(--color-grey-225-10-85);
1160
+
1155
1161
  display: flex;
1156
1162
  color: var(--color-white, white);
1157
1163
  position: fixed;
1158
1164
  z-index: 1000;
1159
- padding-right: 6px;
1160
1165
  max-width: 300px;
1161
1166
  font-size: var(--text-size-small);
1162
1167
  font-family: var(--font-family);
1163
1168
  }
1164
1169
 
1170
+ .bio-properties-panel-tooltip.right {
1171
+ padding-right: 6px;
1172
+ }
1173
+
1174
+ .bio-properties-panel-tooltip.top {
1175
+ flex-direction: column;
1176
+ }
1177
+
1165
1178
  .bio-properties-panel-tooltip-content {
1166
1179
  background-color: var(--tooltip-background-color);
1167
1180
  padding: 16px;
@@ -1207,6 +1220,12 @@ textarea.bio-properties-panel-input {
1207
1220
  margin-top: 16px;
1208
1221
  }
1209
1222
 
1223
+ .bio-properties-panel-tooltip.top .bio-properties-panel-tooltip-arrow {
1224
+ margin-top: -3px;
1225
+ margin-left: calc(50% - 2.5px);
1226
+ transform: rotate(90deg);
1227
+ }
1228
+
1210
1229
  .bio-properties-panel-feelers-editor-container .bio-properties-panel-feelers-editor__open-popup-placeholder,
1211
1230
  .bio-properties-panel-feel-editor-container .bio-properties-panel-feel-editor__open-popup-placeholder {
1212
1231
  display: none;
@@ -1277,6 +1296,8 @@ textarea.bio-properties-panel-input {
1277
1296
 
1278
1297
  .bio-properties-panel-popup .bio-properties-panel-popup__body:not(:first-child) {
1279
1298
  padding-top: 0;
1299
+ padding-left: 0;
1300
+ padding-right: 0;
1280
1301
  }
1281
1302
 
1282
1303
  .bio-properties-panel-popup .bio-properties-panel-popup__header {
@@ -1361,6 +1382,10 @@ textarea.bio-properties-panel-input {
1361
1382
  min-width: 100%;
1362
1383
  }
1363
1384
 
1385
+ .bio-properties-panel-feel-popup .bio-properties-panel-feel-editor-container .cm-scroller {
1386
+ overflow: auto !important;
1387
+ }
1388
+
1364
1389
  .bio-properties-panel-feel-popup .bio-properties-panel-feelers-editor-container {
1365
1390
  width: 100%;
1366
1391
  display: flex;
@@ -1378,7 +1403,6 @@ textarea.bio-properties-panel-input {
1378
1403
  width: 100%;
1379
1404
  resize: none;
1380
1405
  padding: 0;
1381
- margin-left: -12px;
1382
1406
  overflow: hidden;
1383
1407
  overflow-y: auto
1384
1408
  }
@@ -1390,9 +1414,12 @@ textarea.bio-properties-panel-input {
1390
1414
  .bio-properties-panel-feelers-editor-container .bio-properties-panel-open-feel-popup,
1391
1415
  .bio-properties-panel-feel-container .bio-properties-panel-open-feel-popup {
1392
1416
  position: absolute;
1393
- display: none;
1417
+ top: 0;
1394
1418
  right: 0;
1395
- bottom: -1px;
1419
+ line-height: 1;
1420
+ padding: 2px 4px;
1421
+ margin: 3px;
1422
+ display: none;
1396
1423
  background: none;
1397
1424
  border: none;
1398
1425
  color: var(--feel-open-popup-color);
package/dist/index.esm.js CHANGED
@@ -7,7 +7,7 @@ import classnames from 'classnames';
7
7
  import { query, domify } from 'min-dom';
8
8
  import { FeelersEditor } from 'feelers';
9
9
  import FeelEditor from '@bpmn-io/feel-editor';
10
- import { lineNumbers } from '@codemirror/view';
10
+ import { lineNumbers, EditorView } from '@codemirror/view';
11
11
  import * as focusTrap from 'focus-trap';
12
12
 
13
13
  var ArrowIcon = function ArrowIcon(props) {
@@ -284,7 +284,9 @@ function Tooltip(props) {
284
284
  const {
285
285
  forId,
286
286
  value,
287
- parent
287
+ parent,
288
+ direction = 'right',
289
+ position
288
290
  } = props;
289
291
  const [visible, setShow] = useState(false);
290
292
  const [focusedViaKeyboard, setFocusedViaKeyboard] = useState(false);
@@ -353,11 +355,11 @@ function Tooltip(props) {
353
355
  }, [wrapperRef.current, visible, focusedViaKeyboard]);
354
356
  const renderTooltip = () => {
355
357
  return jsxs("div", {
356
- class: "bio-properties-panel-tooltip",
358
+ class: `bio-properties-panel-tooltip ${direction}`,
357
359
  role: "tooltip",
358
360
  id: "bio-properties-panel-tooltip",
359
361
  "aria-labelledby": forId,
360
- style: getTooltipPosition(wrapperRef.current),
362
+ style: position || getTooltipPosition(wrapperRef.current),
361
363
  ref: tooltipRef,
362
364
  onClick: e => e.stopPropagation(),
363
365
  children: [jsx("div", {
@@ -1010,7 +1012,7 @@ const CodeEditor = forwardRef((props, ref) => {
1010
1012
  tooltipContainer: tooltipContainer,
1011
1013
  value: localValue,
1012
1014
  variables: variables,
1013
- extensions: [...(enableGutters ? [lineNumbers()] : [])]
1015
+ extensions: [...(enableGutters ? [lineNumbers()] : []), EditorView.lineWrapping]
1014
1016
  });
1015
1017
  setEditor(editor);
1016
1018
  return () => {
@@ -1268,6 +1270,7 @@ function PopupComponent(props, globalRef) {
1268
1270
  }
1269
1271
  return () => focusTrapRef.current && focusTrapRef.current.deactivate();
1270
1272
  }, [popupRef]);
1273
+ useEvent('propertiesPanel.detach', onClose);
1271
1274
  return createPortal(jsx("div", {
1272
1275
  "aria-label": title,
1273
1276
  tabIndex: -1,
@@ -1447,7 +1450,13 @@ function FEELPopupRoot(props) {
1447
1450
  setSourceElement(_sourceElement);
1448
1451
  emit('open');
1449
1452
  };
1450
- const handleClose = () => {
1453
+ const handleClose = (event = {}) => {
1454
+ const {
1455
+ id
1456
+ } = event;
1457
+ if (id && id !== source) {
1458
+ return;
1459
+ }
1451
1460
  setOpen(false);
1452
1461
  setSource(null);
1453
1462
  };
@@ -1616,7 +1625,7 @@ function FeelPopupComponent(props) {
1616
1625
  }), jsx(Popup.Footer, {
1617
1626
  children: jsx("button", {
1618
1627
  type: "button",
1619
- onClick: onClose,
1628
+ onClick: () => onClose(),
1620
1629
  title: "Close pop-up editor",
1621
1630
  class: "bio-properties-panel-feel-popup__close-btn",
1622
1631
  children: "Close"
@@ -1878,7 +1887,7 @@ function NumberFieldEntry(props) {
1878
1887
  const newValidationError = validate(value) || null;
1879
1888
  setLocalError(newValidationError);
1880
1889
  }
1881
- }, [value]);
1890
+ }, [value, validate]);
1882
1891
  const onInput = newValue => {
1883
1892
  let newValidationError = null;
1884
1893
  if (isFunction(validate)) {
@@ -1924,7 +1933,7 @@ function prefixId$6(id) {
1924
1933
  }
1925
1934
 
1926
1935
  const noop$2 = () => {};
1927
- function FeelTextfield(props) {
1936
+ function FeelTextfieldComponent(props) {
1928
1937
  const {
1929
1938
  debounce,
1930
1939
  id,
@@ -2126,6 +2135,7 @@ function FeelTextfield(props) {
2126
2135
  })]
2127
2136
  });
2128
2137
  }
2138
+ const FeelTextfield = withAutoClosePopup(FeelTextfieldComponent);
2129
2139
  const OptionalFeelInput = forwardRef((props, ref) => {
2130
2140
  const {
2131
2141
  id,
@@ -2378,7 +2388,7 @@ function FeelEntry(props) {
2378
2388
  const newValidationError = validate(value) || null;
2379
2389
  setValidationError(newValidationError);
2380
2390
  }
2381
- }, [value]);
2391
+ }, [value, validate]);
2382
2392
  const onInput = useStaticCallback(newValue => {
2383
2393
  let newValidationError = null;
2384
2394
  if (isFunction(validate)) {
@@ -2604,6 +2614,27 @@ function getPopupTitle(element, label) {
2604
2614
  }
2605
2615
  return `${popupTitle}${label}`;
2606
2616
  }
2617
+ function withAutoClosePopup(Component) {
2618
+ return function (props) {
2619
+ const {
2620
+ id
2621
+ } = props;
2622
+ const {
2623
+ close
2624
+ } = useContext(FeelPopupContext);
2625
+ const closePopup = useStaticCallback(close);
2626
+ useEffect(() => {
2627
+ return () => {
2628
+ closePopup({
2629
+ id
2630
+ });
2631
+ };
2632
+ }, []);
2633
+ return jsx(Component, {
2634
+ ...props
2635
+ });
2636
+ };
2637
+ }
2607
2638
 
2608
2639
  const DEFAULT_LAYOUT = {};
2609
2640
  const DEFAULT_DESCRIPTION = {};
@@ -3444,7 +3475,7 @@ function TemplatingEntry(props) {
3444
3475
  const newValidationError = validate(value) || null;
3445
3476
  setValidationError(newValidationError);
3446
3477
  }
3447
- }, [value]);
3478
+ }, [value, validate]);
3448
3479
  const onInput = useStaticCallback(newValue => {
3449
3480
  let newValidationError = null;
3450
3481
  if (isFunction(validate)) {
@@ -3866,7 +3897,7 @@ function SelectEntry(props) {
3866
3897
  const newValidationError = validate(value) || null;
3867
3898
  setLocalError(newValidationError);
3868
3899
  }
3869
- }, [value]);
3900
+ }, [value, validate]);
3870
3901
  const onChange = newValue => {
3871
3902
  let newValidationError = null;
3872
3903
  if (isFunction(validate)) {
@@ -4075,7 +4106,7 @@ function TextAreaEntry(props) {
4075
4106
  const newValidationError = validate(value) || null;
4076
4107
  setLocalError(newValidationError);
4077
4108
  }
4078
- }, [value]);
4109
+ }, [value, validate]);
4079
4110
  const onInput = newValue => {
4080
4111
  let newValidationError = null;
4081
4112
  if (isFunction(validate)) {
@@ -4215,7 +4246,7 @@ function TextfieldEntry(props) {
4215
4246
  const newValidationError = validate(value) || null;
4216
4247
  setLocalError(newValidationError);
4217
4248
  }
4218
- }, [value]);
4249
+ }, [value, validate]);
4219
4250
  const onInput = newValue => {
4220
4251
  let newValidationError = null;
4221
4252
  if (isFunction(validate)) {
@@ -4317,5 +4348,5 @@ var index = {
4317
4348
  feelPopup: ['type', FeelPopupModule]
4318
4349
  };
4319
4350
 
4320
- export { ArrowIcon, CheckboxEntry, 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, 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 };
4351
+ export { ArrowIcon, CheckboxEntry, 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 };
4321
4352
  //# sourceMappingURL=index.esm.js.map