@blocknote/core 0.53.0 → 0.54.0

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.
Files changed (197) hide show
  1. package/dist/BlockNoteExtension-BJCLnwrE.cjs +2 -0
  2. package/dist/BlockNoteExtension-BJCLnwrE.cjs.map +1 -0
  3. package/dist/BlockNoteExtension-CbvDA0F7.js +80 -0
  4. package/dist/BlockNoteExtension-CbvDA0F7.js.map +1 -0
  5. package/dist/{UserStore-QbbPFj0z.js → UserStore-C4TzkGEn.js} +3 -3
  6. package/dist/{UserStore-DCG6lsla.cjs.map → UserStore-C4TzkGEn.js.map} +1 -1
  7. package/dist/{UserStore-DCG6lsla.cjs → UserStore-mj3fXW4D.cjs} +2 -2
  8. package/dist/UserStore-mj3fXW4D.cjs.map +1 -0
  9. package/dist/blocknote.cjs +1 -1
  10. package/dist/blocknote.js +6 -6
  11. package/dist/{blocks-BEJW9OM_.js → blocks-CzQLehlc.js} +571 -568
  12. package/dist/blocks-CzQLehlc.js.map +1 -0
  13. package/dist/blocks-CzkqclGj.cjs +12 -0
  14. package/dist/blocks-CzkqclGj.cjs.map +1 -0
  15. package/dist/blocks.cjs +1 -1
  16. package/dist/blocks.js +2 -2
  17. package/dist/comments.cjs +1 -1
  18. package/dist/comments.cjs.map +1 -1
  19. package/dist/comments.js +7 -7
  20. package/dist/comments.js.map +1 -1
  21. package/dist/en-BuzSuuTq.cjs +2 -0
  22. package/dist/en-BuzSuuTq.cjs.map +1 -0
  23. package/dist/{en-CGKXfWma.js → en-uzHzj6eH.js} +10 -1
  24. package/dist/en-uzHzj6eH.js.map +1 -0
  25. package/dist/extensions-CSB9ZvuL.cjs +58 -0
  26. package/dist/extensions-CSB9ZvuL.cjs.map +1 -0
  27. package/dist/{extensions-BR5hkAio.js → extensions-DGuhtOgB.js} +662 -427
  28. package/dist/extensions-DGuhtOgB.js.map +1 -0
  29. package/dist/extensions.cjs +1 -1
  30. package/dist/extensions.js +4 -4
  31. package/dist/locales.cjs +1 -1
  32. package/dist/locales.cjs.map +1 -1
  33. package/dist/locales.js +199 -1
  34. package/dist/locales.js.map +1 -1
  35. package/dist/{src-BUXut68d.js → src-BkfZVfaO.js} +967 -899
  36. package/dist/src-BkfZVfaO.js.map +1 -0
  37. package/dist/src-DM3syMdf.cjs +23 -0
  38. package/dist/src-DM3syMdf.cjs.map +1 -0
  39. package/dist/style.css +1 -1
  40. package/dist/webpack-stats.json +1 -1
  41. package/dist/y.cjs +1 -1
  42. package/dist/y.cjs.map +1 -1
  43. package/dist/y.js +59 -56
  44. package/dist/y.js.map +1 -1
  45. package/dist/yjs.cjs +1 -1
  46. package/dist/yjs.cjs.map +1 -1
  47. package/dist/yjs.js +88 -76
  48. package/dist/yjs.js.map +1 -1
  49. package/package.json +17 -18
  50. package/src/api/blockManipulation/commands/updateBlock/__snapshots__/updateBlock.test.ts.snap +2505 -763
  51. package/src/api/blockManipulation/commands/updateBlock/updateBlock.test.ts +42 -0
  52. package/src/api/blockManipulation/commands/updateBlock/updateBlock.ts +16 -4
  53. package/src/api/exporters/markdown/htmlToMarkdown.ts +45 -10
  54. package/src/api/nodeConversions/blockToNode.ts +5 -1
  55. package/src/api/nodeConversions/nodeToBlock.ts +3 -0
  56. package/src/api/pmUtil.ts +16 -8
  57. package/src/blocks/Code/CodeBlockOptions.ts +83 -0
  58. package/src/blocks/Code/block.test.ts +1 -1
  59. package/src/blocks/Code/block.ts +29 -281
  60. package/src/blocks/Code/helpers/extensions/CodeKeyboardShortcutsExtension.ts +120 -0
  61. package/src/blocks/Code/helpers/parse/parsePreCode.ts +45 -0
  62. package/src/blocks/Code/helpers/render/createCodeBlock.ts +98 -0
  63. package/src/blocks/Code/helpers/toExternalHTML/createPreCode.ts +14 -0
  64. package/src/blocks/index.ts +3 -0
  65. package/src/comments/extension.ts +2 -4
  66. package/src/editor/Block.css +273 -2
  67. package/src/editor/BlockNoteEditor.ts +25 -4
  68. package/src/editor/BlockNoteExtension.ts +1 -1
  69. package/src/editor/managers/ExtensionManager/extensions.ts +6 -0
  70. package/src/exporter/ExportImage.ts +50 -0
  71. package/src/exporter/Exporter.test.ts +48 -0
  72. package/src/exporter/Exporter.ts +46 -12
  73. package/src/exporter/index.ts +1 -0
  74. package/src/exporter/mapping.ts +4 -1
  75. package/src/extensions/FormattingToolbar/FormattingToolbar.ts +10 -8
  76. package/src/extensions/InlineContentBoundaryEdit/InlineContentBoundaryEdit.ts +109 -0
  77. package/src/extensions/SourceBlockWithPreview/SourceBlockWithPreview.ts +192 -0
  78. package/src/extensions/SourceInlineContentWithPreview/SourceInlineContentWithPreview.ts +142 -0
  79. package/src/extensions/SyntaxHighlighting/SyntaxHighlighting.test.ts +120 -0
  80. package/src/extensions/SyntaxHighlighting/SyntaxHighlighting.ts +89 -0
  81. package/src/extensions/SyntaxHighlighting/inlineHighlight.test.ts +135 -0
  82. package/src/extensions/SyntaxHighlighting/shiki.ts +116 -0
  83. package/src/extensions/Versioning/inMemoryVersioning.ts +13 -3
  84. package/src/extensions/index.ts +4 -0
  85. package/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.test.ts +51 -2
  86. package/src/extensions/tiptap-extensions/KeyboardShortcuts/KeyboardShortcutsExtension.ts +22 -2
  87. package/src/i18n/locales/ar.ts +9 -0
  88. package/src/i18n/locales/de.ts +9 -0
  89. package/src/i18n/locales/en.ts +9 -0
  90. package/src/i18n/locales/es.ts +9 -0
  91. package/src/i18n/locales/fa.ts +9 -0
  92. package/src/i18n/locales/fr.ts +9 -0
  93. package/src/i18n/locales/he.ts +9 -0
  94. package/src/i18n/locales/hr.ts +9 -0
  95. package/src/i18n/locales/is.ts +9 -0
  96. package/src/i18n/locales/it.ts +9 -0
  97. package/src/i18n/locales/ja.ts +9 -0
  98. package/src/i18n/locales/ko.ts +9 -0
  99. package/src/i18n/locales/nl.ts +9 -0
  100. package/src/i18n/locales/no.ts +9 -0
  101. package/src/i18n/locales/pl.ts +9 -0
  102. package/src/i18n/locales/pt.ts +9 -0
  103. package/src/i18n/locales/ru.ts +9 -0
  104. package/src/i18n/locales/sk.ts +9 -0
  105. package/src/i18n/locales/uk.ts +9 -0
  106. package/src/i18n/locales/uz.ts +9 -0
  107. package/src/i18n/locales/vi.ts +9 -0
  108. package/src/i18n/locales/zh-tw.ts +9 -0
  109. package/src/i18n/locales/zh.ts +9 -0
  110. package/src/index.ts +5 -1
  111. package/src/schema/blocks/createSpec.ts +2 -3
  112. package/src/schema/blocks/types.ts +53 -3
  113. package/src/schema/contentTypePropagation.test.ts +1 -1
  114. package/src/schema/inlineContent/createSpec.test.ts +161 -0
  115. package/src/schema/inlineContent/createSpec.ts +171 -12
  116. package/src/schema/inlineContent/internal.ts +21 -2
  117. package/src/schema/inlineContent/types.ts +35 -5
  118. package/src/user/UserStore.ts +1 -1
  119. package/src/util/Store.test.ts +132 -0
  120. package/src/util/Store.ts +135 -0
  121. package/src/y/extensions/AttributionExtension.test.ts +10 -0
  122. package/src/y/extensions/Versioning.test.ts +20 -7
  123. package/src/yjs/comments/RESTYjsThreadStore.test.ts +85 -0
  124. package/src/yjs/comments/RESTYjsThreadStore.ts +7 -1
  125. package/src/yjs/extensions/ForkYDoc.test.ts +37 -0
  126. package/src/yjs/extensions/ForkYDoc.ts +26 -1
  127. package/src/yjs/extensions/RelativePositionMapping.ts +8 -2
  128. package/src/yjs/extensions/Versioning.test.ts +17 -5
  129. package/types/src/api/pmUtil.d.ts +7 -7
  130. package/types/src/blocks/Code/CodeBlockOptions.d.ts +61 -0
  131. package/types/src/blocks/Code/block.d.ts +3 -53
  132. package/types/src/blocks/Code/helpers/extensions/CodeKeyboardShortcutsExtension.d.ts +35 -0
  133. package/types/src/blocks/Code/helpers/parse/parsePreCode.d.ts +8 -0
  134. package/types/src/blocks/Code/helpers/render/createCodeBlock.d.ts +18 -0
  135. package/types/src/blocks/Code/helpers/toExternalHTML/createPreCode.d.ts +5 -0
  136. package/types/src/blocks/index.d.ts +3 -0
  137. package/types/src/comments/extension.d.ts +1 -15
  138. package/types/src/editor/BlockNoteEditor.d.ts +3 -3
  139. package/types/src/editor/BlockNoteExtension.d.ts +1 -1
  140. package/types/src/exporter/ExportImage.d.ts +36 -0
  141. package/types/src/exporter/Exporter.d.ts +21 -0
  142. package/types/src/exporter/Exporter.test.d.ts +1 -0
  143. package/types/src/exporter/index.d.ts +1 -0
  144. package/types/src/exporter/mapping.d.ts +1 -1
  145. package/types/src/extensions/FilePanel/FilePanel.d.ts +1 -1
  146. package/types/src/extensions/FormattingToolbar/FormattingToolbar.d.ts +1 -1
  147. package/types/src/extensions/InlineContentBoundaryEdit/InlineContentBoundaryEdit.d.ts +5 -0
  148. package/types/src/extensions/ShowSelection/ShowSelection.d.ts +1 -5
  149. package/types/src/extensions/SideMenu/SideMenu.d.ts +1 -1
  150. package/types/src/extensions/SourceBlockWithPreview/SourceBlockWithPreview.d.ts +45 -0
  151. package/types/src/extensions/SourceInlineContentWithPreview/SourceInlineContentWithPreview.d.ts +49 -0
  152. package/types/src/extensions/SuggestionMenu/SuggestionMenu.d.ts +1 -11
  153. package/types/src/extensions/SyntaxHighlighting/SyntaxHighlighting.d.ts +44 -0
  154. package/types/src/extensions/SyntaxHighlighting/SyntaxHighlighting.test.d.ts +1 -0
  155. package/types/src/extensions/SyntaxHighlighting/inlineHighlight.test.d.ts +1 -0
  156. package/types/src/extensions/SyntaxHighlighting/shiki.d.ts +13 -0
  157. package/types/src/extensions/TableHandles/TableHandles.d.ts +1 -1
  158. package/types/src/extensions/Versioning/Versioning.d.ts +1 -35
  159. package/types/src/extensions/index.d.ts +4 -0
  160. package/types/src/i18n/locales/en.d.ts +9 -0
  161. package/types/src/i18n/locales/fa.d.ts +9 -0
  162. package/types/src/i18n/locales/sk.d.ts +9 -0
  163. package/types/src/index.d.ts +2 -1
  164. package/types/src/schema/blocks/types.d.ts +36 -3
  165. package/types/src/schema/inlineContent/createSpec.d.ts +35 -3
  166. package/types/src/schema/inlineContent/createSpec.test.d.ts +1 -0
  167. package/types/src/schema/inlineContent/internal.d.ts +3 -2
  168. package/types/src/schema/inlineContent/types.d.ts +22 -3
  169. package/types/src/user/UserStore.d.ts +1 -1
  170. package/types/src/util/Store.d.ts +45 -0
  171. package/types/src/util/Store.test.d.ts +1 -0
  172. package/types/src/y/extensions/AttributionExtension.d.ts +1 -1
  173. package/types/src/y/extensions/DiffVersioningExtension.d.ts +1 -1
  174. package/types/src/y/extensions/ForkYDoc.d.ts +1 -5
  175. package/types/src/y/extensions/index.d.ts +2 -10
  176. package/types/src/yjs/comments/RESTYjsThreadStore.test.d.ts +1 -0
  177. package/types/src/yjs/extensions/ForkYDoc.d.ts +1 -5
  178. package/types/src/yjs/extensions/index.d.ts +1 -5
  179. package/dist/BlockNoteExtension-B_IEJHS8.js +0 -38
  180. package/dist/BlockNoteExtension-B_IEJHS8.js.map +0 -1
  181. package/dist/BlockNoteExtension-M0znTzxP.cjs +0 -2
  182. package/dist/BlockNoteExtension-M0znTzxP.cjs.map +0 -1
  183. package/dist/UserStore-QbbPFj0z.js.map +0 -1
  184. package/dist/blocks-BEJW9OM_.js.map +0 -1
  185. package/dist/blocks-BPmJglFo.cjs +0 -12
  186. package/dist/blocks-BPmJglFo.cjs.map +0 -1
  187. package/dist/en-C5Z4Ag9_.cjs +0 -2
  188. package/dist/en-C5Z4Ag9_.cjs.map +0 -1
  189. package/dist/en-CGKXfWma.js.map +0 -1
  190. package/dist/extensions-AitWbYdJ.cjs +0 -52
  191. package/dist/extensions-AitWbYdJ.cjs.map +0 -1
  192. package/dist/extensions-BR5hkAio.js.map +0 -1
  193. package/dist/src-BHPuOo7W.cjs +0 -21
  194. package/dist/src-BHPuOo7W.cjs.map +0 -1
  195. package/dist/src-BUXut68d.js.map +0 -1
  196. package/src/blocks/Code/shiki.ts +0 -73
  197. package/types/src/blocks/Code/shiki.d.ts +0 -4
package/dist/y.js CHANGED
@@ -1,8 +1,8 @@
1
- import { Mt as e, O as t, bn as n } from "./blocks-BEJW9OM_.js";
2
- import { i as r, n as i, t as a } from "./BlockNoteExtension-B_IEJHS8.js";
3
- import { _ as o, h as s, v as c, y as l } from "./src-BUXut68d.js";
4
- import { a as u, i as d, o as f } from "./extensions-BR5hkAio.js";
5
- import { n as p } from "./UserStore-QbbPFj0z.js";
1
+ import { It as e, O as t, wn as n } from "./blocks-CzQLehlc.js";
2
+ import { a as r, n as i, t as a } from "./BlockNoteExtension-CbvDA0F7.js";
3
+ import { _ as o, b as s, x as c, y as l } from "./src-BkfZVfaO.js";
4
+ import { a as u, i as d, o as f } from "./extensions-DGuhtOgB.js";
5
+ import { n as p } from "./UserStore-C4TzkGEn.js";
6
6
  import { t as m } from "./ThreadStore-et9wB5Xt.js";
7
7
  import { Mark as h, getChangedRanges as g, getMarkRange as _, posToDOMRect as ee } from "@tiptap/core";
8
8
  import { uint32 as te, uuidv4 as v } from "lib0/random";
@@ -13,19 +13,19 @@ import * as w from "@y/y";
13
13
  import { decodeAny as T, encodeAny as E } from "lib0/buffer";
14
14
  //#region src/y/extensions/YAttributionMarks.ts
15
15
  var D = (e, t) => e === void 0 ? void 0 : typeof e == "string" ? e : e[t], O = (e, t) => ({ mark: n, inline: r }) => {
16
- let i = t?.editor, a = e === "insert" ? "ins" : e === "delete" ? "del" : r ? "span" : "div", s = document.createElement(a);
17
- Object.assign(s.dataset, {
16
+ let i = t?.editor, a = e === "insert" ? "ins" : e === "delete" ? "del" : r ? "span" : "div", o = document.createElement(a);
17
+ Object.assign(o.dataset, {
18
18
  userIds: JSON.stringify(n.attrs.userIds),
19
19
  inline: String(r)
20
- }), e === "modification" && (s.dataset.type = "modification", s.dataset.format = JSON.stringify(n.attrs.format));
20
+ }), e === "modification" && (o.dataset.type = "modification", o.dataset.format = JSON.stringify(n.attrs.format));
21
21
  let u = D(t?.getAttributionMarkClassName?.({
22
22
  contentType: r ? "inline-content" : "block",
23
23
  modificationType: e === "modification" ? "format" : e
24
- }), "content"), d = (n.attrs.userIds ?? [])[0], f = d ? o(d) : c[0];
25
- if (u) s.style.cssText = "display: contents";
24
+ }), "content"), d = (n.attrs.userIds ?? [])[0], f = d ? l(d) : s[0];
25
+ if (u) o.style.cssText = "display: contents";
26
26
  else {
27
- let e = d ? `var(${l(d).light}, ${f.light})` : f.light, t = d ? `var(${l(d).dark}, ${f.dark})` : f.dark;
28
- s.style.cssText = `display: contents; --user-color-light: ${e}; --user-color-dark: ${t}`;
27
+ let e = d ? `var(${c(d).light}, ${f.light})` : f.light, t = d ? `var(${c(d).dark}, ${f.dark})` : f.dark;
28
+ o.style.cssText = `display: contents; --user-color-light: ${e}; --user-color-dark: ${t}`;
29
29
  }
30
30
  let p = document.createElement("span");
31
31
  if (r) p.className = u ?? (e === "delete" ? "bn-suggestion-mark bn-suggestion-mark--delete" : "bn-suggestion-mark");
@@ -33,8 +33,8 @@ var D = (e, t) => e === void 0 ? void 0 : typeof e == "string" ? e : e[t], O = (
33
33
  let e = i?.dictionary.suggestion_changes.deleted;
34
34
  e && p.style.setProperty("--deleted-label", JSON.stringify(e));
35
35
  }
36
- return s.appendChild(p), {
37
- dom: s,
36
+ return o.appendChild(p), {
37
+ dom: o,
38
38
  contentDOM: p
39
39
  };
40
40
  }, k = h.create({
@@ -141,19 +141,19 @@ var D = (e, t) => e === void 0 ? void 0 : typeof e == "string" ? e : e[t], O = (
141
141
  }
142
142
  })],
143
143
  mount({ dom: e, root: i, signal: a }) {
144
- let o = () => {
144
+ let s = () => {
145
145
  for (let [n, r] of t.store.state) {
146
- let { light: t, dark: i } = l(n);
146
+ let { light: t, dark: i } = c(n);
147
147
  r.color && r.colorLight ? (e.style.setProperty(t, r.colorLight), e.style.setProperty(i, r.color)) : (e.style.removeProperty(t), e.style.removeProperty(i));
148
148
  }
149
- }, c, u = (e) => N(e).map((e) => t.getUser(e)?.username ?? e), d = (e) => {
149
+ }, l, u = (e) => N(e).map((e) => t.getUser(e)?.username ?? e), d = (e) => {
150
150
  let t = N(e.dataset.userIds);
151
151
  return t.length === 0 ? "" : `${P(e.dataset.format).join(",")}:${t.join(",")}`;
152
152
  }, f = (e) => {
153
153
  let r = e.dataset.format !== void 0, i = r ? "format" : e.tagName === "INS" ? "insert" : "delete", a = e.dataset.inline === "false" ? "block" : "inline-content";
154
154
  return {
155
155
  anchor: e,
156
- color: s(t, N(e.dataset.userIds)).dark,
156
+ color: o(t, N(e.dataset.userIds)).dark,
157
157
  modificationType: i,
158
158
  contentType: a,
159
159
  users: u(e.dataset.userIds),
@@ -164,7 +164,7 @@ var D = (e, t) => e === void 0 ? void 0 : typeof e == "string" ? e : e[t], O = (
164
164
  }), "tooltip")
165
165
  };
166
166
  }, p = () => {
167
- c && (c = void 0, r.setState(void 0));
167
+ l && (l = void 0, r.setState(void 0));
168
168
  }, m = (e) => {
169
169
  for (; e;) {
170
170
  let t = e.closest(M);
@@ -174,28 +174,28 @@ var D = (e, t) => e === void 0 ? void 0 : typeof e == "string" ? e : e[t], O = (
174
174
  }
175
175
  };
176
176
  i.addEventListener("mouseover", (e) => {
177
- let n = m(e.target instanceof Element ? e.target : null);
178
- if (!n) {
177
+ let n = e.target instanceof Element ? e.target : null, i = m(n);
178
+ if (!i) {
179
179
  p();
180
180
  return;
181
181
  }
182
- let i = d(n), a = n, o = n.parentElement;
183
- for (; o;) {
184
- let e = o.closest(M);
182
+ let a = d(i), o = i, s = i.parentElement;
183
+ for (; s;) {
184
+ let e = s.closest(M);
185
185
  if (!e) break;
186
186
  let t = d(e);
187
- if (t === i) a = e;
187
+ if (t === a) o = e;
188
188
  else if (t) break;
189
- o = e.parentElement;
189
+ s = e.parentElement;
190
190
  }
191
- if (c === a) return;
192
- c = a, r.setState(f(a));
193
- let s = N(a.dataset.userIds);
194
- s.length > 0 && t.loadUsers(s).then(() => {
195
- c === a && r.setState(f(a));
191
+ if (l === o) return;
192
+ l = o, r.setState(f(o));
193
+ let c = N(o.dataset.userIds);
194
+ c.length > 0 && t.loadUsers(c).then(() => {
195
+ l === o && r.setState(f(o));
196
196
  });
197
- }, { signal: a }), a.addEventListener("abort", p), o();
198
- let h = t.store.subscribe(o);
197
+ }, { signal: a }), a.addEventListener("abort", p), s();
198
+ let h = t.store.subscribe(s);
199
199
  a.addEventListener("abort", h);
200
200
  },
201
201
  blockNoteExtensions: [j({ getAttributionMarkClassName: e?.getAttributionMarkClassName })]
@@ -282,12 +282,13 @@ var V = (e, t) => {
282
282
  let n = () => {
283
283
  t.exec(y({ ytype: e.fragment }));
284
284
  };
285
- if (e.provider && "synced" in e.provider && typeof e.provider.synced == "boolean") if (e.provider.synced) n();
286
- else if ("on" in e.provider && typeof e.provider.on == "function") e.provider.on("synced", (e) => {
287
- e && n();
288
- });
289
- else throw Error("YSyncExtension: provider must have a 'synced' boolean or an 'on' method to listen for 'sync'");
290
- else n();
285
+ if (e.provider && "synced" in e.provider && typeof e.provider.synced == "boolean") {
286
+ if (e.provider.synced) n();
287
+ else if ("on" in e.provider && typeof e.provider.on == "function") e.provider.on("synced", (e) => {
288
+ e && n();
289
+ });
290
+ else throw Error("YSyncExtension: provider must have a 'synced' boolean or an 'on' method to listen for 'sync'");
291
+ } else n();
291
292
  },
292
293
  prosemirrorPlugins: [he({
293
294
  suggestionDoc: e.suggestionDoc,
@@ -305,7 +306,8 @@ function W(e, t) {
305
306
  let r = Array.from(n.share.keys()).find((t) => n.share.get(t) === e);
306
307
  if (r == null) throw Error("type does not exist in other ydoc");
307
308
  return t.get(r, e.constructor);
308
- } else {
309
+ }
310
+ {
309
311
  let n = e._item, r = t.store.clients.get(n.id.client) ?? [], i = r[w.findIndexSS(r, n.id.clock)];
310
312
  if (!i) throw Error("type does not exist in other ydoc");
311
313
  let a = i.content;
@@ -314,7 +316,8 @@ function W(e, t) {
314
316
  }
315
317
  }
316
318
  function Se(e, t) {
317
- return n(e.pmSchema.nodeFromJSON(t));
319
+ let r = e.pmSchema.nodeFromJSON(t);
320
+ return n(r);
318
321
  }
319
322
  function G(t, n) {
320
323
  let r = n.map((n) => e(n, t.pmSchema));
@@ -339,8 +342,8 @@ function q(e, t) {
339
342
  return C.diff(n.done(), r.done(), { compare: V });
340
343
  }
341
344
  function J({ tr: e, fragment: t, renderer: n }) {
342
- let r = se(t.toDeltaDeep({ renderer: n }), H), i = x(e.doc, void 0, !0);
343
- return le(e, C.diff(i.done(), r.done(), { compare: V }), void 0, void 0);
345
+ let r = se(t.toDeltaDeep({ renderer: n }), H), i = x(e.doc, void 0, !0), a = C.diff(i.done(), r.done(), { compare: V });
346
+ return le(e, a, void 0, void 0);
344
347
  }
345
348
  //#endregion
346
349
  //#region src/y/extensions/Suggestions.ts
@@ -410,11 +413,11 @@ var Ee = a(({ editor: e, options: t }) => {
410
413
  getSuggestionAtSelection: o,
411
414
  getSuggestionAtCoords: (t) => e.transact(() => {
412
415
  let n = e.prosemirrorView.posAtCoords(t);
413
- if (!(n === null || n?.inside === -1)) return a(n.pos, "y-attributed-insert") || a(n.pos, "y-attributed-delete") || a(n.pos, "y-attributed-format");
416
+ if (n !== null && n?.inside !== -1) return a(n.pos, "y-attributed-insert") || a(n.pos, "y-attributed-delete") || a(n.pos, "y-attributed-format");
414
417
  }),
415
418
  checkUnresolvedSuggestions: () => {
416
419
  let t = !1;
417
- return e.prosemirrorState.doc.descendants((e) => t ? !1 : (t = e.marks.findIndex((e) => e.type.name === "y-attributed-insert" || e.type.name === "y-attributed-delete" || e.type.name === "y-attributed-format") !== -1, !0)), t;
420
+ return e.prosemirrorState.doc.descendants((e) => !t && (t = e.marks.findIndex((e) => e.type.name === "y-attributed-insert" || e.type.name === "y-attributed-delete" || e.type.name === "y-attributed-format") !== -1, !0)), t;
418
421
  }
419
422
  };
420
423
  });
@@ -932,12 +935,12 @@ function Ye(e) {
932
935
  by: a?.id
933
936
  };
934
937
  }, _ = async (e) => {
935
- let t = await $(`${c}?${new URLSearchParams({
938
+ let t = new URLSearchParams({
936
939
  ydoc: "true",
937
940
  to: String(e)
938
- })}`, i), n = T(new Uint8Array(t));
939
- if (!n.nextDoc) throw Error(`YHub returned no document state at timestamp ${e}.`);
940
- return w.convertUpdateFormatV1ToV2(n.nextDoc);
941
+ }), n = await $(`${c}?${t}`, i), r = T(new Uint8Array(n));
942
+ if (!r.nextDoc) throw Error(`YHub returned no document state at timestamp ${e}.`);
943
+ return w.convertUpdateFormatV1ToV2(r.nextDoc);
941
944
  };
942
945
  return {
943
946
  list: async () => {
@@ -947,25 +950,25 @@ function Ye(e) {
947
950
  customAttributions: "true"
948
951
  });
949
952
  c.set("groupMaxGap", String(t)), o !== void 0 && c.set("group", String(o)), n !== void 0 && c.set("groupMaxDuration", String(n)), r !== void 0 && c.set("mergeUsers", String(r));
950
- let l = await $(`${s}?${c}`, i), u = f(T(new Uint8Array(l)).map((e, t) => Je(e, t)).filter((e) => e !== void 0).map((e) => {
953
+ let l = await $(`${s}?${c}`, i), u = T(new Uint8Array(l)), d = f(u.map((e, t) => Je(e, t)).filter((e) => e !== void 0).map((e) => {
951
954
  let t = e.name, n = (typeof e.id == "string" ? p()?.getAttr(e.id) : void 0) ?? t;
952
955
  return {
953
956
  ...e,
954
957
  name: n
955
958
  };
956
- })), d = await m();
957
- return d ? [d, ...u] : u;
959
+ })), h = await m();
960
+ return h ? [h, ...d] : d;
958
961
  },
959
962
  create: g,
960
963
  getContent: async (e) => _(e.createdAt),
961
964
  getAttributions: async (e, t) => {
962
- let n = e.createdAt, r = t === void 0 ? 0 : t.createdAt, a = await $(`${c}?${new URLSearchParams({
965
+ let n = e.createdAt, r = t === void 0 ? 0 : t.createdAt, a = new URLSearchParams({
963
966
  from: String(r),
964
967
  to: String(n),
965
968
  attributions: "true"
966
- })}`, i), o = T(new Uint8Array(a));
967
- if (!o.attributions) throw Error(`YHub returned no attributions for snapshot ${String(e.id)}.`);
968
- return w.decodeContentMap(o.attributions);
969
+ }), o = await $(`${c}?${a}`, i), s = T(new Uint8Array(o));
970
+ if (!s.attributions) throw Error(`YHub returned no attributions for snapshot ${String(e.id)}.`);
971
+ return w.decodeContentMap(s.attributions);
969
972
  },
970
973
  restore: async (e, t) => {
971
974
  let n = t.createdAt, r = await _(n);