@codemirror/state 6.7.0 → 6.7.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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## 6.7.1 (2026-07-05)
2
+
3
+ ### Bug fixes
4
+
5
+ Make sure facet providers, precedence extensions, and compartment instances have the `extension` field the `Extension` type claims they have.
6
+
1
7
  ## 6.7.0 (2026-06-23)
2
8
 
3
9
  ### New features
package/dist/index.cjs CHANGED
@@ -1671,6 +1671,7 @@ class FacetProvider {
1671
1671
  }
1672
1672
  };
1673
1673
  }
1674
+ get extension() { return this; }
1674
1675
  }
1675
1676
  function compareArray(a, b, compare) {
1676
1677
  if (a.length != b.length)
@@ -1868,6 +1869,7 @@ class PrecExtension {
1868
1869
  this.inner = inner;
1869
1870
  this.prec = prec;
1870
1871
  }
1872
+ get extension() { return this; }
1871
1873
  }
1872
1874
  /**
1873
1875
  Extension compartments can be used to make a configuration
@@ -1902,6 +1904,7 @@ class CompartmentInstance {
1902
1904
  this.compartment = compartment;
1903
1905
  this.inner = inner;
1904
1906
  }
1907
+ get extension() { return this; }
1905
1908
  }
1906
1909
  class Configuration {
1907
1910
  constructor(base, compartments, dynamicSlots, address, staticValues, facets) {
@@ -2011,6 +2014,8 @@ function flatten(extension, compartments, newCompartments) {
2011
2014
  else {
2012
2015
  let content = ext.extension;
2013
2016
  if (!content)
2017
+ throw new Error(`Unrecognized extension value in extension set (${ext}).`);
2018
+ if (content == ext)
2014
2019
  throw new Error(`Unrecognized extension value in extension set (${ext}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);
2015
2020
  inner(content, prec);
2016
2021
  }
package/dist/index.js CHANGED
@@ -1668,6 +1668,7 @@ class FacetProvider {
1668
1668
  }
1669
1669
  };
1670
1670
  }
1671
+ get extension() { return this; }
1671
1672
  }
1672
1673
  function compareArray(a, b, compare) {
1673
1674
  if (a.length != b.length)
@@ -1865,6 +1866,7 @@ class PrecExtension {
1865
1866
  this.inner = inner;
1866
1867
  this.prec = prec;
1867
1868
  }
1869
+ get extension() { return this; }
1868
1870
  }
1869
1871
  /**
1870
1872
  Extension compartments can be used to make a configuration
@@ -1899,6 +1901,7 @@ class CompartmentInstance {
1899
1901
  this.compartment = compartment;
1900
1902
  this.inner = inner;
1901
1903
  }
1904
+ get extension() { return this; }
1902
1905
  }
1903
1906
  class Configuration {
1904
1907
  constructor(base, compartments, dynamicSlots, address, staticValues, facets) {
@@ -2008,6 +2011,8 @@ function flatten(extension, compartments, newCompartments) {
2008
2011
  else {
2009
2012
  let content = ext.extension;
2010
2013
  if (!content)
2014
+ throw new Error(`Unrecognized extension value in extension set (${ext}).`);
2015
+ if (content == ext)
2011
2016
  throw new Error(`Unrecognized extension value in extension set (${ext}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);
2012
2017
  inner(content, prec);
2013
2018
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/state",
3
- "version": "6.7.0",
3
+ "version": "6.7.1",
4
4
  "description": "Editor state data structures for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",