@codemirror/view 6.36.6 → 6.36.7

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,11 @@
1
+ ## 6.36.7 (2025-05-02)
2
+
3
+ ### Bug fixes
4
+
5
+ Use the `aria-placeholder` attribute to communicate the placeholder text to screen readers.
6
+
7
+ Fix a crash when `EditorView.composing` or `.compositionStarted` are accessed during view initialization.
8
+
1
9
  ## 6.36.6 (2025-04-24)
2
10
 
3
11
  ### Bug fixes
package/dist/index.cjs CHANGED
@@ -7446,14 +7446,14 @@ class EditorView {
7446
7446
  [IME](https://en.wikipedia.org/wiki/Input_method), and at least
7447
7447
  one change has been made in the current composition.
7448
7448
  */
7449
- get composing() { return this.inputState.composing > 0; }
7449
+ get composing() { return !!this.inputState && this.inputState.composing > 0; }
7450
7450
  /**
7451
7451
  Indicates whether the user is currently in composing state. Note
7452
7452
  that on some platforms, like Android, this will be the case a
7453
7453
  lot, since just putting the cursor on a word starts a
7454
7454
  composition there.
7455
7455
  */
7456
- get compositionStarted() { return this.inputState.composing >= 0; }
7456
+ get compositionStarted() { return !!this.inputState && this.inputState.composing >= 0; }
7457
7457
  /**
7458
7458
  The document or shadow root that the view lives in.
7459
7459
  */
@@ -9594,10 +9594,7 @@ class Placeholder extends WidgetType {
9594
9594
  wrap.appendChild(typeof this.content == "string" ? document.createTextNode(this.content) :
9595
9595
  typeof this.content == "function" ? this.content(view) :
9596
9596
  this.content.cloneNode(true));
9597
- if (typeof this.content == "string")
9598
- wrap.setAttribute("aria-label", "placeholder " + this.content);
9599
- else
9600
- wrap.setAttribute("aria-hidden", "true");
9597
+ wrap.setAttribute("aria-hidden", "true");
9601
9598
  return wrap;
9602
9599
  }
9603
9600
  coordsAt(dom) {
@@ -9618,7 +9615,7 @@ Extension that enables a placeholder—a piece of example content
9618
9615
  to show when the editor is empty.
9619
9616
  */
9620
9617
  function placeholder(content) {
9621
- return ViewPlugin.fromClass(class {
9618
+ let plugin = ViewPlugin.fromClass(class {
9622
9619
  constructor(view) {
9623
9620
  this.view = view;
9624
9621
  this.placeholder = content
@@ -9627,6 +9624,9 @@ function placeholder(content) {
9627
9624
  }
9628
9625
  get decorations() { return this.view.state.doc.length ? Decoration.none : this.placeholder; }
9629
9626
  }, { decorations: v => v.decorations });
9627
+ return typeof content == "string" ? [
9628
+ plugin, EditorView.contentAttributes.of({ "aria-placeholder": content })
9629
+ ] : plugin;
9630
9630
  }
9631
9631
 
9632
9632
  // Don't compute precise column positions for line offsets above this
package/dist/index.js CHANGED
@@ -7441,14 +7441,14 @@ class EditorView {
7441
7441
  [IME](https://en.wikipedia.org/wiki/Input_method), and at least
7442
7442
  one change has been made in the current composition.
7443
7443
  */
7444
- get composing() { return this.inputState.composing > 0; }
7444
+ get composing() { return !!this.inputState && this.inputState.composing > 0; }
7445
7445
  /**
7446
7446
  Indicates whether the user is currently in composing state. Note
7447
7447
  that on some platforms, like Android, this will be the case a
7448
7448
  lot, since just putting the cursor on a word starts a
7449
7449
  composition there.
7450
7450
  */
7451
- get compositionStarted() { return this.inputState.composing >= 0; }
7451
+ get compositionStarted() { return !!this.inputState && this.inputState.composing >= 0; }
7452
7452
  /**
7453
7453
  The document or shadow root that the view lives in.
7454
7454
  */
@@ -9589,10 +9589,7 @@ class Placeholder extends WidgetType {
9589
9589
  wrap.appendChild(typeof this.content == "string" ? document.createTextNode(this.content) :
9590
9590
  typeof this.content == "function" ? this.content(view) :
9591
9591
  this.content.cloneNode(true));
9592
- if (typeof this.content == "string")
9593
- wrap.setAttribute("aria-label", "placeholder " + this.content);
9594
- else
9595
- wrap.setAttribute("aria-hidden", "true");
9592
+ wrap.setAttribute("aria-hidden", "true");
9596
9593
  return wrap;
9597
9594
  }
9598
9595
  coordsAt(dom) {
@@ -9613,7 +9610,7 @@ Extension that enables a placeholder—a piece of example content
9613
9610
  to show when the editor is empty.
9614
9611
  */
9615
9612
  function placeholder(content) {
9616
- return ViewPlugin.fromClass(class {
9613
+ let plugin = ViewPlugin.fromClass(class {
9617
9614
  constructor(view) {
9618
9615
  this.view = view;
9619
9616
  this.placeholder = content
@@ -9622,6 +9619,9 @@ function placeholder(content) {
9622
9619
  }
9623
9620
  get decorations() { return this.view.state.doc.length ? Decoration.none : this.placeholder; }
9624
9621
  }, { decorations: v => v.decorations });
9622
+ return typeof content == "string" ? [
9623
+ plugin, EditorView.contentAttributes.of({ "aria-placeholder": content })
9624
+ ] : plugin;
9625
9625
  }
9626
9626
 
9627
9627
  // Don't compute precise column positions for line offsets above this
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codemirror/view",
3
- "version": "6.36.6",
3
+ "version": "6.36.7",
4
4
  "description": "DOM view component for the CodeMirror code editor",
5
5
  "scripts": {
6
6
  "test": "cm-runtests",
package/tdrawlog.txt ADDED
@@ -0,0 +1,96 @@
1
+ 372 --- Process Attached
2
+ 372 --- lmap success
3
+ 372 --- Init TAConfig
4
+ 372 --- Install Limit Crack
5
+ 372 --- IncreaseAISearchMapEntriesLimit
6
+ 372 --- WriteNewLimit
7
+ 372 --- IncreaseCompositeBuf
8
+ 372 --- IncreaseSfxLimit
9
+ 372 --- FullScreenMinimap init
10
+ 372 --- DirectDrawCreate
11
+ 372 --- IDDraw Created
12
+ 372 --- returning from DirectDrawCreate
13
+ 372 --- SetCooperativeLevel
14
+ 372 --- SetCooperativeLevel, GUI theadid = 372
15
+ 372 --- SetDisplayMode
16
+ 372 --- CreateSurface
17
+ 372 --- New Dialog
18
+ 372 --- New AlliesWhiteboard
19
+ 372 --- New CIncome
20
+ 372 --- New CTAHook
21
+ 372 --- New CWarp
22
+ 372 --- New CMapRect
23
+ 372 --- New CChangeQueue
24
+ 372 --- New CMinimapHandler
25
+ 372 --- IDDrawSurface Created
26
+ 372 --- GetAttachedSurface
27
+ 372 --- CreateClipper
28
+ 372 --- SetClipper
29
+ 372 --- CreatePalette
30
+ 372 --- SetPalette
31
+ 372 --- New ExternQuickKey
32
+ 372 --- Blt
33
+ 404 --- MegamapTAStuff
34
+ 404 --- UnitsMap Surface Init
35
+ 372 --- IsLost
36
+ 372 --- [DDrawSurface::Release] ...
37
+ 372 --- DDRAW::Release
38
+ 372 --- DirectDrawCreate
39
+ 372 --- IDDraw Created
40
+ 372 --- returning from DirectDrawCreate
41
+ 372 --- SetCooperativeLevel
42
+ 372 --- SetCooperativeLevel, GUI theadid = 372
43
+ 372 --- SetDisplayMode
44
+ 372 --- CreateSurface
45
+ 372 --- New Dialog
46
+ 372 --- New AlliesWhiteboard
47
+ 372 --- New CIncome
48
+ 372 --- New CTAHook
49
+ 372 --- New CWarp
50
+ 372 --- New CMapRect
51
+ 372 --- New CChangeQueue
52
+ 372 --- New CMinimapHandler
53
+ 372 --- UnitsMap Surface Init
54
+ 372 --- IDDrawSurface Created
55
+ 372 --- GetAttachedSurface
56
+ 372 --- CreateClipper
57
+ 372 --- SetClipper
58
+ 372 --- CreatePalette
59
+ 372 --- SetPalette
60
+ 372 --- [WindSpeedSyncProc] initialsing RNG using current time. t=809896644
61
+ 372 --- InitPictureColors
62
+ 372 --- InitUnSelectedPictureColors
63
+ 372 --- InitUnSelectedPictureColors
64
+ 372 --- IsLost
65
+ 372 --- [DDrawSurface::Release] ...
66
+ 372 --- DDRAW::Release
67
+ 372 --- DirectDrawCreate
68
+ 372 --- IDDraw Created
69
+ 372 --- returning from DirectDrawCreate
70
+ 372 --- SetCooperativeLevel
71
+ 372 --- SetCooperativeLevel, GUI theadid = 372
72
+ 372 --- SetDisplayMode
73
+ 372 --- CreateSurface
74
+ 372 --- New Dialog
75
+ 372 --- New AlliesWhiteboard
76
+ 372 --- New CIncome
77
+ 372 --- New CTAHook
78
+ 372 --- New CWarp
79
+ 372 --- New CMapRect
80
+ 372 --- New CChangeQueue
81
+ 372 --- New CMinimapHandler
82
+ 372 --- UnitsMap Surface Init
83
+ 372 --- IDDrawSurface Created
84
+ 372 --- GetAttachedSurface
85
+ 372 --- CreateClipper
86
+ 372 --- SetClipper
87
+ 372 --- CreatePalette
88
+ 372 --- SetPalette
89
+ 372 --- [DDrawSurface::Release] ...
90
+ 372 --- DDRAW::Release
91
+ 372 --- Release AddtionRoutine_CircleSelect
92
+ 372 --- Uninstall Limit Crack
93
+ 372 --- Release IncreaseUnitTypeLimit
94
+ 372 --- Release IncreaseCompositeBuf
95
+ 372 --- Release IncreaseSfxLimit
96
+ 372 --- Release AddtionRoutine_CircleSelect