@bpmn-io/properties-panel 3.41.0 → 3.41.2

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
@@ -1844,6 +1844,7 @@ function CheckboxGroup(props) {
1844
1844
  }
1845
1845
 
1846
1846
  const ExternalChange = state.Annotation.define();
1847
+ const parseJsonLinter = langJson.jsonParseLinter();
1847
1848
 
1848
1849
  /**
1849
1850
  * A CodeMirror based JSON editor for the properties panel.
@@ -1888,7 +1889,11 @@ function JsonEditor(props) {
1888
1889
  if (update.docChanged && !isExternal) {
1889
1890
  handleChange(update.state.doc.toString());
1890
1891
  }
1891
- }), langJson.json(), lint.linter(langJson.jsonParseLinter(), {
1892
+ }), langJson.json(), lint.linter(view => {
1893
+ const content = view.state.doc.toString();
1894
+ if (!content.trim()) return [];
1895
+ return parseJsonLinter(view);
1896
+ }, {
1892
1897
  delay: 300
1893
1898
  })]
1894
1899
  }),
@@ -1939,6 +1944,7 @@ function JsonEditor(props) {
1939
1944
  children: label
1940
1945
  })
1941
1946
  }), jsxRuntime.jsx("div", {
1947
+ class: classnames('bio-properties-panel-input', value && 'edited'),
1942
1948
  ref: containerRef
1943
1949
  })]
1944
1950
  });
@@ -2017,14 +2023,13 @@ function JsonEditorEntry(props) {
2017
2023
  * Check if the JSON editor entry has been edited.
2018
2024
  */
2019
2025
  function isEdited$8(node) {
2020
- const cmContent = node && node.querySelector('.cm-content');
2021
- return cmContent ? cmContent.textContent.trim().length > 0 : false;
2026
+ return node && node.classList.contains('edited');
2022
2027
  }
2023
2028
 
2024
2029
  // helpers /////////////////
2025
2030
 
2026
2031
  function validateJson(value) {
2027
- if (!value) return null;
2032
+ if (!value || !value.trim()) return null;
2028
2033
  try {
2029
2034
  return minDash.isObject(JSON.parse(value)) ? null : 'JSON contains errors';
2030
2035
  } catch (e) {