braid-text 0.5.13 → 0.5.14

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.
@@ -148,12 +148,11 @@ function text_prepare_put(patches, client_state) {
148
148
  // ── UI helpers ─────────────────────────────────────────────────────────
149
149
 
150
150
  function set_acked_state(textarea, on = true) {
151
- if (on)
152
- textarea.style.caretColor = textarea.old_caretColor
153
- else {
154
- textarea.old_caretColor = textarea.style.caretColor
155
- textarea.style.caretColor = 'red'
156
- }
151
+ // Save the normal caret color, if we haven't already
152
+ textarea.saved_caret_color ??= textarea.style.caretColor || ''
153
+
154
+ // Now update it
155
+ textarea.style.caretColor = on ? textarea.saved_caret_color : 'red'
157
156
  }
158
157
 
159
158
  function set_error_state(textarea, on = true) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "braid-text",
3
- "version": "0.5.13",
3
+ "version": "0.5.14",
4
4
  "description": "Library for collaborative text over http using braid.",
5
5
  "author": "Braid Working Group",
6
6
  "repository": "braid-org/braid-text",