@bpmn-io/properties-panel 2.2.1 → 3.0.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.
Files changed (113) hide show
  1. package/dist/index.esm.js +12 -64
  2. package/dist/index.esm.js.map +1 -1
  3. package/dist/index.js +12 -64
  4. package/dist/index.js.map +1 -1
  5. package/package.json +7 -7
  6. package/preact/README.md +56 -51
  7. package/preact/compat/client.js +19 -0
  8. package/preact/compat/client.mjs +22 -0
  9. package/preact/compat/dist/compat.js +1 -1
  10. package/preact/compat/dist/compat.js.map +1 -1
  11. package/preact/compat/dist/compat.mjs +1 -1
  12. package/preact/compat/dist/compat.module.js +1 -1
  13. package/preact/compat/dist/compat.module.js.map +1 -1
  14. package/preact/compat/dist/compat.umd.js +1 -1
  15. package/preact/compat/dist/compat.umd.js.map +1 -1
  16. package/preact/compat/jsx-dev-runtime.js +2 -0
  17. package/preact/compat/jsx-dev-runtime.mjs +2 -0
  18. package/preact/compat/jsx-runtime.js +2 -0
  19. package/preact/compat/jsx-runtime.mjs +2 -0
  20. package/preact/compat/package.json +31 -0
  21. package/preact/compat/scheduler.js +15 -0
  22. package/preact/compat/{src/scheduler.js → scheduler.mjs} +8 -9
  23. package/preact/compat/server.browser.js +4 -0
  24. package/preact/compat/src/PureComponent.js +1 -1
  25. package/preact/compat/src/forwardRef.js +2 -9
  26. package/preact/compat/src/index.d.ts +58 -4
  27. package/preact/compat/src/index.js +73 -2
  28. package/preact/compat/src/portals.js +4 -2
  29. package/preact/compat/src/render.js +133 -76
  30. package/preact/compat/src/suspense-list.d.ts +2 -2
  31. package/preact/compat/src/suspense-list.js +14 -13
  32. package/preact/compat/src/suspense.d.ts +4 -4
  33. package/preact/compat/src/suspense.js +6 -6
  34. package/preact/compat/src/util.js +10 -0
  35. package/preact/debug/dist/debug.js +1 -1
  36. package/preact/debug/dist/debug.js.map +1 -1
  37. package/preact/debug/dist/debug.mjs +1 -1
  38. package/preact/debug/dist/debug.module.js +1 -1
  39. package/preact/debug/dist/debug.module.js.map +1 -1
  40. package/preact/debug/dist/debug.umd.js +1 -1
  41. package/preact/debug/dist/debug.umd.js.map +1 -1
  42. package/preact/debug/package.json +9 -0
  43. package/preact/debug/src/check-props.js +3 -3
  44. package/preact/debug/src/debug.js +38 -17
  45. package/preact/debug/src/index.d.ts +4 -0
  46. package/preact/debug/src/util.js +4 -0
  47. package/preact/devtools/dist/devtools.js +1 -1
  48. package/preact/devtools/dist/devtools.js.map +1 -1
  49. package/preact/devtools/dist/devtools.mjs +1 -1
  50. package/preact/devtools/dist/devtools.module.js +1 -1
  51. package/preact/devtools/dist/devtools.module.js.map +1 -1
  52. package/preact/devtools/dist/devtools.umd.js +1 -1
  53. package/preact/devtools/dist/devtools.umd.js.map +1 -1
  54. package/preact/devtools/package.json +23 -14
  55. package/preact/devtools/src/devtools.js +1 -1
  56. package/preact/dist/preact.js +1 -1
  57. package/preact/dist/preact.js.map +1 -1
  58. package/preact/dist/preact.min.js +1 -1
  59. package/preact/dist/preact.min.js.map +1 -1
  60. package/preact/dist/preact.min.module.js +2 -0
  61. package/preact/dist/preact.min.module.js.map +1 -0
  62. package/preact/dist/preact.min.umd.js +2 -0
  63. package/preact/dist/preact.min.umd.js.map +1 -0
  64. package/preact/dist/preact.mjs +1 -1
  65. package/preact/dist/preact.module.js +1 -1
  66. package/preact/dist/preact.module.js.map +1 -1
  67. package/preact/dist/preact.umd.js +1 -1
  68. package/preact/dist/preact.umd.js.map +1 -1
  69. package/preact/hooks/dist/hooks.js +1 -1
  70. package/preact/hooks/dist/hooks.js.map +1 -1
  71. package/preact/hooks/dist/hooks.mjs +1 -1
  72. package/preact/hooks/dist/hooks.module.js +1 -1
  73. package/preact/hooks/dist/hooks.module.js.map +1 -1
  74. package/preact/hooks/dist/hooks.umd.js +1 -1
  75. package/preact/hooks/dist/hooks.umd.js.map +1 -1
  76. package/preact/hooks/package.json +9 -0
  77. package/preact/hooks/src/index.d.ts +26 -14
  78. package/preact/hooks/src/index.js +169 -44
  79. package/preact/hooks/src/internal.d.ts +12 -2
  80. package/preact/jsx-runtime/dist/jsxRuntime.js +1 -1
  81. package/preact/jsx-runtime/dist/jsxRuntime.js.map +1 -1
  82. package/preact/jsx-runtime/dist/jsxRuntime.mjs +1 -1
  83. package/preact/jsx-runtime/dist/jsxRuntime.module.js +1 -1
  84. package/preact/jsx-runtime/dist/jsxRuntime.module.js.map +1 -1
  85. package/preact/jsx-runtime/dist/jsxRuntime.umd.js +1 -1
  86. package/preact/jsx-runtime/dist/jsxRuntime.umd.js.map +1 -1
  87. package/preact/jsx-runtime/package.json +26 -17
  88. package/preact/jsx-runtime/src/index.js +19 -13
  89. package/preact/package.json +315 -262
  90. package/preact/src/clone-element.js +16 -10
  91. package/preact/src/component.js +33 -23
  92. package/preact/src/constants.js +2 -1
  93. package/preact/src/create-context.js +8 -3
  94. package/preact/src/create-element.js +9 -11
  95. package/preact/src/diff/catch-error.js +4 -2
  96. package/preact/src/diff/children.js +41 -32
  97. package/preact/src/diff/index.js +81 -34
  98. package/preact/src/diff/props.js +15 -14
  99. package/preact/src/index.d.ts +369 -301
  100. package/preact/src/internal.d.ts +11 -2
  101. package/preact/src/jsx.d.ts +1862 -626
  102. package/preact/src/options.js +1 -2
  103. package/preact/src/render.js +5 -6
  104. package/preact/src/util.js +6 -0
  105. package/preact/test-utils/dist/testUtils.js +1 -1
  106. package/preact/test-utils/dist/testUtils.js.map +1 -1
  107. package/preact/test-utils/dist/testUtils.mjs +1 -1
  108. package/preact/test-utils/dist/testUtils.module.js +1 -1
  109. package/preact/test-utils/dist/testUtils.module.js.map +1 -1
  110. package/preact/test-utils/dist/testUtils.umd.js +1 -1
  111. package/preact/test-utils/dist/testUtils.umd.js.map +1 -1
  112. package/preact/test-utils/package.json +9 -0
  113. package/preact/test-utils/src/index.js +2 -1
package/dist/index.js CHANGED
@@ -1729,11 +1729,9 @@ function NumberFieldEntry(props) {
1729
1729
  onBlur,
1730
1730
  validate
1731
1731
  } = props;
1732
- const [cachedInvalidValue, setCachedInvalidValue] = hooks.useState(null);
1733
1732
  const globalError = useError(id);
1734
1733
  const [localError, setLocalError] = hooks.useState(null);
1735
1734
  let value = getValue(element);
1736
- const previousValue = usePrevious(value);
1737
1735
  hooks.useEffect(() => {
1738
1736
  if (minDash.isFunction(validate)) {
1739
1737
  const newValidationError = validate(value) || null;
@@ -1745,16 +1743,9 @@ function NumberFieldEntry(props) {
1745
1743
  if (minDash.isFunction(validate)) {
1746
1744
  newValidationError = validate(newValue) || null;
1747
1745
  }
1748
- if (newValidationError) {
1749
- setCachedInvalidValue(newValue);
1750
- } else {
1751
- setValue(newValue);
1752
- }
1746
+ setValue(newValue, newValidationError);
1753
1747
  setLocalError(newValidationError);
1754
1748
  };
1755
- if (previousValue === value && localError) {
1756
- value = cachedInvalidValue;
1757
- }
1758
1749
  const error = globalError || localError;
1759
1750
  return jsxRuntime.jsxs("div", {
1760
1751
  class: classnames__default["default"]('bio-properties-panel-entry', error ? 'has-error' : ''),
@@ -2202,11 +2193,9 @@ function FeelEntry(props) {
2202
2193
  onFocus,
2203
2194
  onBlur
2204
2195
  } = props;
2205
- const [cachedInvalidValue, setCachedInvalidValue] = hooks.useState(null);
2206
2196
  const [validationError, setValidationError] = hooks.useState(null);
2207
2197
  const [localError, setLocalError] = hooks.useState(null);
2208
2198
  let value = getValue(element);
2209
- const previousValue = usePrevious(value);
2210
2199
  hooks.useEffect(() => {
2211
2200
  if (minDash.isFunction(validate)) {
2212
2201
  const newValidationError = validate(value) || null;
@@ -2218,22 +2207,16 @@ function FeelEntry(props) {
2218
2207
  if (minDash.isFunction(validate)) {
2219
2208
  newValidationError = validate(newValue) || null;
2220
2209
  }
2221
- if (newValidationError) {
2222
- setCachedInvalidValue(newValue);
2223
- } else {
2224
- // don't create multiple commandStack entries for the same value
2225
- if (newValue !== value) {
2226
- setValue(newValue);
2227
- }
2210
+
2211
+ // don't create multiple commandStack entries for the same value
2212
+ if (newValue !== value) {
2213
+ setValue(newValue, newValidationError);
2228
2214
  }
2229
2215
  setValidationError(newValidationError);
2230
2216
  });
2231
2217
  const onError = hooks.useCallback(err => {
2232
2218
  setLocalError(err);
2233
2219
  }, []);
2234
- if (previousValue === value && validationError) {
2235
- value = cachedInvalidValue;
2236
- }
2237
2220
  const temporaryError = useError(id);
2238
2221
  const error = localError || temporaryError || validationError;
2239
2222
  return jsxRuntime.jsxs("div", {
@@ -2455,11 +2438,9 @@ function TemplatingEntry(props) {
2455
2438
  validate,
2456
2439
  show = noop
2457
2440
  } = props;
2458
- const [cachedInvalidValue, setCachedInvalidValue] = hooks.useState(null);
2459
2441
  const [validationError, setValidationError] = hooks.useState(null);
2460
2442
  const [localError, setLocalError] = hooks.useState(null);
2461
2443
  let value = getValue(element);
2462
- const previousValue = usePrevious(value);
2463
2444
  hooks.useEffect(() => {
2464
2445
  if (minDash.isFunction(validate)) {
2465
2446
  const newValidationError = validate(value) || null;
@@ -2471,22 +2452,16 @@ function TemplatingEntry(props) {
2471
2452
  if (minDash.isFunction(validate)) {
2472
2453
  newValidationError = validate(newValue) || null;
2473
2454
  }
2474
- if (newValidationError) {
2475
- setCachedInvalidValue(newValue);
2476
- } else {
2477
- // don't create multiple commandStack entries for the same value
2478
- if (newValue !== value) {
2479
- setValue(newValue);
2480
- }
2455
+
2456
+ // don't create multiple commandStack entries for the same value
2457
+ if (newValue !== value) {
2458
+ setValue(newValue, newValidationError);
2481
2459
  }
2482
2460
  setValidationError(newValidationError);
2483
2461
  });
2484
2462
  const onError = hooks.useCallback(err => {
2485
2463
  setLocalError(err);
2486
2464
  }, []);
2487
- if (previousValue === value && validationError) {
2488
- value = cachedInvalidValue;
2489
- }
2490
2465
  const temporaryError = useError(id);
2491
2466
  const error = localError || temporaryError || validationError;
2492
2467
  return jsxRuntime.jsxs("div", {
@@ -2875,11 +2850,9 @@ function SelectEntry(props) {
2875
2850
  validate
2876
2851
  } = props;
2877
2852
  const options = getOptions(element);
2878
- const [cachedInvalidValue, setCachedInvalidValue] = hooks.useState(null);
2879
2853
  const globalError = useError(id);
2880
2854
  const [localError, setLocalError] = hooks.useState(null);
2881
2855
  let value = getValue(element);
2882
- const previousValue = usePrevious(value);
2883
2856
  hooks.useEffect(() => {
2884
2857
  if (minDash.isFunction(validate)) {
2885
2858
  const newValidationError = validate(value) || null;
@@ -2891,16 +2864,9 @@ function SelectEntry(props) {
2891
2864
  if (minDash.isFunction(validate)) {
2892
2865
  newValidationError = validate(newValue) || null;
2893
2866
  }
2894
- if (newValidationError) {
2895
- setCachedInvalidValue(newValue);
2896
- } else {
2897
- setValue(newValue);
2898
- }
2867
+ setValue(newValue, newValidationError);
2899
2868
  setLocalError(newValidationError);
2900
2869
  };
2901
- if (previousValue === value && localError) {
2902
- value = cachedInvalidValue;
2903
- }
2904
2870
  const error = globalError || localError;
2905
2871
  return jsxRuntime.jsxs("div", {
2906
2872
  class: classnames__default["default"]('bio-properties-panel-entry', error ? 'has-error' : ''),
@@ -3088,11 +3054,9 @@ function TextAreaEntry(props) {
3088
3054
  onBlur,
3089
3055
  autoResize
3090
3056
  } = props;
3091
- const [cachedInvalidValue, setCachedInvalidValue] = hooks.useState(null);
3092
3057
  const globalError = useError(id);
3093
3058
  const [localError, setLocalError] = hooks.useState(null);
3094
3059
  let value = getValue(element);
3095
- const previousValue = usePrevious(value);
3096
3060
  hooks.useEffect(() => {
3097
3061
  if (minDash.isFunction(validate)) {
3098
3062
  const newValidationError = validate(value) || null;
@@ -3104,16 +3068,9 @@ function TextAreaEntry(props) {
3104
3068
  if (minDash.isFunction(validate)) {
3105
3069
  newValidationError = validate(newValue) || null;
3106
3070
  }
3107
- if (newValidationError) {
3108
- setCachedInvalidValue(newValue);
3109
- } else {
3110
- setValue(newValue);
3111
- }
3071
+ setValue(newValue, newValidationError);
3112
3072
  setLocalError(newValidationError);
3113
3073
  };
3114
- if (previousValue === value && localError) {
3115
- value = cachedInvalidValue;
3116
- }
3117
3074
  const error = globalError || localError;
3118
3075
  return jsxRuntime.jsxs("div", {
3119
3076
  class: classnames__default["default"]('bio-properties-panel-entry', error ? 'has-error' : ''),
@@ -3229,11 +3186,9 @@ function TextfieldEntry(props) {
3229
3186
  onFocus,
3230
3187
  onBlur
3231
3188
  } = props;
3232
- const [cachedInvalidValue, setCachedInvalidValue] = hooks.useState(null);
3233
3189
  const globalError = useError(id);
3234
3190
  const [localError, setLocalError] = hooks.useState(null);
3235
3191
  let value = getValue(element);
3236
- const previousValue = usePrevious(value);
3237
3192
  hooks.useEffect(() => {
3238
3193
  if (minDash.isFunction(validate)) {
3239
3194
  const newValidationError = validate(value) || null;
@@ -3245,16 +3200,9 @@ function TextfieldEntry(props) {
3245
3200
  if (minDash.isFunction(validate)) {
3246
3201
  newValidationError = validate(newValue) || null;
3247
3202
  }
3248
- if (newValidationError) {
3249
- setCachedInvalidValue(newValue);
3250
- } else {
3251
- setValue(newValue);
3252
- }
3203
+ setValue(newValue, newValidationError);
3253
3204
  setLocalError(newValidationError);
3254
3205
  };
3255
- if (previousValue === value && localError) {
3256
- value = cachedInvalidValue;
3257
- }
3258
3206
  const error = globalError || localError;
3259
3207
  return jsxRuntime.jsxs("div", {
3260
3208
  class: classnames__default["default"]('bio-properties-panel-entry', error ? 'has-error' : ''),