@codemirror/view 0.19.18 → 0.19.19

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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 0.19.19 (2021-11-17)
2
+
3
+ ### Bug fixes
4
+
5
+ Fix a bug that caused the precedence of `editorAttributes` and `contentAttributes` to be inverted, making lower-precedence extensions override higher-precedence ones.
6
+
1
7
  ## 0.19.18 (2021-11-16)
2
8
 
3
9
  ### Bug fixes
package/dist/index.cjs CHANGED
@@ -1771,11 +1771,17 @@ class PluginInstance {
1771
1771
  }
1772
1772
  }
1773
1773
  PluginInstance.dummy = new PluginInstance(ViewPlugin.define(() => ({})));
1774
+ function combineFacetAttrs(values) {
1775
+ let result = {};
1776
+ for (let i = values.length - 1; i >= 0; i--)
1777
+ combineAttrs(values[i], result);
1778
+ return result;
1779
+ }
1774
1780
  const editorAttributes = state.Facet.define({
1775
- combine: values => values.reduce((a, b) => combineAttrs(b, a), {})
1781
+ combine: combineFacetAttrs
1776
1782
  });
1777
1783
  const contentAttributes = state.Facet.define({
1778
- combine: values => values.reduce((a, b) => combineAttrs(b, a), {})
1784
+ combine: combineFacetAttrs
1779
1785
  });
1780
1786
  // Provide decorations
1781
1787
  const decorations = state.Facet.define();
package/dist/index.js CHANGED
@@ -1767,11 +1767,17 @@ class PluginInstance {
1767
1767
  }
1768
1768
  }
1769
1769
  PluginInstance.dummy = /*@__PURE__*/new PluginInstance(/*@__PURE__*/ViewPlugin.define(() => ({})));
1770
+ function combineFacetAttrs(values) {
1771
+ let result = {};
1772
+ for (let i = values.length - 1; i >= 0; i--)
1773
+ combineAttrs(values[i], result);
1774
+ return result;
1775
+ }
1770
1776
  const editorAttributes = /*@__PURE__*/Facet.define({
1771
- combine: values => values.reduce((a, b) => combineAttrs(b, a), {})
1777
+ combine: combineFacetAttrs
1772
1778
  });
1773
1779
  const contentAttributes = /*@__PURE__*/Facet.define({
1774
- combine: values => values.reduce((a, b) => combineAttrs(b, a), {})
1780
+ combine: combineFacetAttrs
1775
1781
  });
1776
1782
  // Provide decorations
1777
1783
  const decorations = /*@__PURE__*/Facet.define();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/view",
3
- "version": "0.19.18",
3
+ "version": "0.19.19",
4
4
  "description": "DOM view component for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",