@codemirror/view 6.38.3 → 6.38.4

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.38.4 (2025-09-28)
2
+
3
+ ### Bug fixes
4
+
5
+ Work around a Chrome Android issue where the browser doesn't properly fire composition end events, leaving CodeMirror to believe the user was still composing.
6
+
1
7
  ## 6.38.3 (2025-09-22)
2
8
 
3
9
  ### Bug fixes
package/dist/index.cjs CHANGED
@@ -7313,6 +7313,10 @@ class EditContextManager {
7313
7313
  this.revertPending(view.state);
7314
7314
  this.setSelection(view.state);
7315
7315
  }
7316
+ // Work around missed compositionend events. See https://discuss.codemirror.net/t/a/9514
7317
+ if (change.from < change.to && !change.insert.length && view.inputState.composing >= 0 &&
7318
+ !/[\\p{Alphabetic}\\p{Number}_]/.test(context.text.slice(Math.max(0, e.updateRangeStart - 1), Math.min(context.text.length, e.updateRangeStart + 1))))
7319
+ this.handlers.compositionend(e);
7316
7320
  };
7317
7321
  this.handlers.characterboundsupdate = e => {
7318
7322
  let rects = [], prev = null;
@@ -7328,10 +7332,11 @@ class EditContextManager {
7328
7332
  let deco = [];
7329
7333
  for (let format of e.getTextFormats()) {
7330
7334
  let lineStyle = format.underlineStyle, thickness = format.underlineThickness;
7331
- if (lineStyle != "None" && thickness != "None") {
7335
+ if (!/none/i.test(lineStyle) && !/none/i.test(thickness)) {
7332
7336
  let from = this.toEditorPos(format.rangeStart), to = this.toEditorPos(format.rangeEnd);
7333
7337
  if (from < to) {
7334
- let style = `text-decoration: underline ${lineStyle == "Dashed" ? "dashed " : lineStyle == "Squiggle" ? "wavy " : ""}${thickness == "Thin" ? 1 : 2}px`;
7338
+ // These values changed from capitalized custom strings to lower-case CSS keywords in 2025
7339
+ let style = `text-decoration: underline ${/^[a-z]/.test(lineStyle) ? lineStyle + " " : lineStyle == "Dashed" ? "dashed " : lineStyle == "Squiggle" ? "wavy " : ""}${/thin/i.test(thickness) ? 1 : 2}px`;
7335
7340
  deco.push(Decoration.mark({ attributes: { style } }).range(from, to));
7336
7341
  }
7337
7342
  }
package/dist/index.js CHANGED
@@ -7308,6 +7308,10 @@ class EditContextManager {
7308
7308
  this.revertPending(view.state);
7309
7309
  this.setSelection(view.state);
7310
7310
  }
7311
+ // Work around missed compositionend events. See https://discuss.codemirror.net/t/a/9514
7312
+ if (change.from < change.to && !change.insert.length && view.inputState.composing >= 0 &&
7313
+ !/[\\p{Alphabetic}\\p{Number}_]/.test(context.text.slice(Math.max(0, e.updateRangeStart - 1), Math.min(context.text.length, e.updateRangeStart + 1))))
7314
+ this.handlers.compositionend(e);
7311
7315
  };
7312
7316
  this.handlers.characterboundsupdate = e => {
7313
7317
  let rects = [], prev = null;
@@ -7323,10 +7327,11 @@ class EditContextManager {
7323
7327
  let deco = [];
7324
7328
  for (let format of e.getTextFormats()) {
7325
7329
  let lineStyle = format.underlineStyle, thickness = format.underlineThickness;
7326
- if (lineStyle != "None" && thickness != "None") {
7330
+ if (!/none/i.test(lineStyle) && !/none/i.test(thickness)) {
7327
7331
  let from = this.toEditorPos(format.rangeStart), to = this.toEditorPos(format.rangeEnd);
7328
7332
  if (from < to) {
7329
- let style = `text-decoration: underline ${lineStyle == "Dashed" ? "dashed " : lineStyle == "Squiggle" ? "wavy " : ""}${thickness == "Thin" ? 1 : 2}px`;
7333
+ // These values changed from capitalized custom strings to lower-case CSS keywords in 2025
7334
+ let style = `text-decoration: underline ${/^[a-z]/.test(lineStyle) ? lineStyle + " " : lineStyle == "Dashed" ? "dashed " : lineStyle == "Squiggle" ? "wavy " : ""}${/thin/i.test(thickness) ? 1 : 2}px`;
7330
7335
  deco.push(Decoration.mark({ attributes: { style } }).range(from, to));
7331
7336
  }
7332
7337
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/view",
3
- "version": "6.38.3",
3
+ "version": "6.38.4",
4
4
  "description": "DOM view component for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",