@liveblocks/react-tiptap 3.9.1 → 3.9.2-tiptap1

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 (82) hide show
  1. package/dist/LiveblocksExtension.cjs +7 -3
  2. package/dist/LiveblocksExtension.cjs.map +1 -1
  3. package/dist/LiveblocksExtension.js +7 -3
  4. package/dist/LiveblocksExtension.js.map +1 -1
  5. package/dist/ai/AiExtension.cjs +8 -0
  6. package/dist/ai/AiExtension.cjs.map +1 -1
  7. package/dist/ai/AiExtension.js +8 -0
  8. package/dist/ai/AiExtension.js.map +1 -1
  9. package/dist/ai/AiToolbar.cjs +256 -235
  10. package/dist/ai/AiToolbar.cjs.map +1 -1
  11. package/dist/ai/AiToolbar.js +256 -235
  12. package/dist/ai/AiToolbar.js.map +1 -1
  13. package/dist/comments/AnchoredThreads.cjs +63 -50
  14. package/dist/comments/AnchoredThreads.cjs.map +1 -1
  15. package/dist/comments/AnchoredThreads.js +63 -50
  16. package/dist/comments/AnchoredThreads.js.map +1 -1
  17. package/dist/comments/CommentsExtension.cjs +3 -0
  18. package/dist/comments/CommentsExtension.cjs.map +1 -1
  19. package/dist/comments/CommentsExtension.js +3 -0
  20. package/dist/comments/CommentsExtension.js.map +1 -1
  21. package/dist/comments/FloatingComposer.cjs +32 -22
  22. package/dist/comments/FloatingComposer.cjs.map +1 -1
  23. package/dist/comments/FloatingComposer.js +32 -22
  24. package/dist/comments/FloatingComposer.js.map +1 -1
  25. package/dist/comments/FloatingThreads.cjs +39 -33
  26. package/dist/comments/FloatingThreads.cjs.map +1 -1
  27. package/dist/comments/FloatingThreads.js +39 -33
  28. package/dist/comments/FloatingThreads.js.map +1 -1
  29. package/dist/context.cjs +1 -4
  30. package/dist/context.cjs.map +1 -1
  31. package/dist/context.js +1 -4
  32. package/dist/context.js.map +1 -1
  33. package/dist/index.d.cts +135 -4
  34. package/dist/index.d.ts +135 -4
  35. package/dist/mentions/GroupMentionNode.cjs +2 -0
  36. package/dist/mentions/GroupMentionNode.cjs.map +1 -1
  37. package/dist/mentions/GroupMentionNode.js +2 -0
  38. package/dist/mentions/GroupMentionNode.js.map +1 -1
  39. package/dist/mentions/Mention.cjs +35 -42
  40. package/dist/mentions/Mention.cjs.map +1 -1
  41. package/dist/mentions/Mention.js +34 -41
  42. package/dist/mentions/Mention.js.map +1 -1
  43. package/dist/mentions/MentionExtension.cjs +1 -0
  44. package/dist/mentions/MentionExtension.cjs.map +1 -1
  45. package/dist/mentions/MentionExtension.js +1 -0
  46. package/dist/mentions/MentionExtension.js.map +1 -1
  47. package/dist/mentions/MentionNode.cjs +2 -0
  48. package/dist/mentions/MentionNode.cjs.map +1 -1
  49. package/dist/mentions/MentionNode.js +2 -0
  50. package/dist/mentions/MentionNode.js.map +1 -1
  51. package/dist/mentions/MentionsList.cjs +66 -51
  52. package/dist/mentions/MentionsList.cjs.map +1 -1
  53. package/dist/mentions/MentionsList.js +66 -51
  54. package/dist/mentions/MentionsList.js.map +1 -1
  55. package/dist/toolbar/FloatingToolbar.cjs +43 -28
  56. package/dist/toolbar/FloatingToolbar.cjs.map +1 -1
  57. package/dist/toolbar/FloatingToolbar.js +43 -28
  58. package/dist/toolbar/FloatingToolbar.js.map +1 -1
  59. package/dist/toolbar/Toolbar.cjs +191 -153
  60. package/dist/toolbar/Toolbar.cjs.map +1 -1
  61. package/dist/toolbar/Toolbar.js +191 -153
  62. package/dist/toolbar/Toolbar.js.map +1 -1
  63. package/dist/toolbar/shared.cjs +12 -11
  64. package/dist/toolbar/shared.cjs.map +1 -1
  65. package/dist/toolbar/shared.js +12 -11
  66. package/dist/toolbar/shared.js.map +1 -1
  67. package/dist/types.cjs.map +1 -1
  68. package/dist/types.js.map +1 -1
  69. package/dist/utils.cjs.map +1 -1
  70. package/dist/utils.js.map +1 -1
  71. package/dist/version-history/HistoryVersionPreview.cjs +30 -42
  72. package/dist/version-history/HistoryVersionPreview.cjs.map +1 -1
  73. package/dist/version-history/HistoryVersionPreview.js +30 -42
  74. package/dist/version-history/HistoryVersionPreview.js.map +1 -1
  75. package/dist/version.cjs +1 -1
  76. package/dist/version.cjs.map +1 -1
  77. package/dist/version.js +1 -1
  78. package/dist/version.js.map +1 -1
  79. package/package.json +14 -14
  80. package/src/styles/index.css +3 -2
  81. package/styles.css +1 -1
  82. package/styles.css.map +1 -1
@@ -33,9 +33,7 @@ const FLOATING_ELEMENT_COLLISION_PADDING = 10;
33
33
  function applyToolbarSlot(slot, props) {
34
34
  if (typeof slot === "function") {
35
35
  const Component = slot;
36
- return /* @__PURE__ */ jsxRuntime.jsx(Component, {
37
- ...props
38
- });
36
+ return /* @__PURE__ */ jsxRuntime.jsx(Component, { ...props });
39
37
  }
40
38
  return slot;
41
39
  }
@@ -54,10 +52,9 @@ const ToolbarButton = react.forwardRef(
54
52
  },
55
53
  [onKeyDown, closeFloatingToolbar]
56
54
  );
57
- return /* @__PURE__ */ jsxRuntime.jsx(_private.ShortcutTooltip, {
58
- content: name,
59
- shortcut,
60
- children: /* @__PURE__ */ jsxRuntime.jsx(_private.Button, {
55
+ return /* @__PURE__ */ jsxRuntime.jsx(_private.ShortcutTooltip, { content: name, shortcut, children: /* @__PURE__ */ jsxRuntime.jsx(
56
+ _private.Button,
57
+ {
61
58
  type: "button",
62
59
  variant: "toolbar",
63
60
  ref: forwardedRef,
@@ -67,20 +64,13 @@ const ToolbarButton = react.forwardRef(
67
64
  ...props,
68
65
  onKeyDown: handleKeyDown,
69
66
  children: !children && !icon ? name : children
70
- })
71
- });
67
+ }
68
+ ) });
72
69
  }
73
70
  );
74
71
  const ToolbarToggle = react.forwardRef(
75
72
  ({ active, ...props }, forwardedRef) => {
76
- return /* @__PURE__ */ jsxRuntime.jsx(TogglePrimitive__namespace.Root, {
77
- asChild: true,
78
- pressed: active,
79
- children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, {
80
- ref: forwardedRef,
81
- ...props
82
- })
83
- });
73
+ return /* @__PURE__ */ jsxRuntime.jsx(TogglePrimitive__namespace.Root, { asChild: true, pressed: active, children: /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, { ref: forwardedRef, ...props }) });
84
74
  }
85
75
  );
86
76
  function createDefaultBlockSelectorItems(editor) {
@@ -173,65 +163,62 @@ const ToolbarBlockSelector = react.forwardRef(({ items, onKeyDown, ...props }, f
173
163
  },
174
164
  [onKeyDown, closeFloatingToolbar]
175
165
  );
176
- return /* @__PURE__ */ jsxRuntime.jsxs(SelectPrimitive__namespace.Root, {
177
- value: activeItem?.name,
178
- onValueChange: handleItemChange,
179
- children: [
180
- /* @__PURE__ */ jsxRuntime.jsx(_private.ShortcutTooltip, {
181
- content: "Turn into\u2026",
182
- children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Trigger, {
183
- asChild: true,
184
- ...props,
185
- ref: forwardedRef,
186
- onKeyDown: handleKeyDown,
187
- disabled: resolvedItems.length === 0,
188
- children: /* @__PURE__ */ jsxRuntime.jsx(_private.SelectButton, {
189
- variant: "toolbar",
190
- children: activeItem?.name ?? "Turn into\u2026"
191
- })
192
- })
193
- }),
194
- /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, {
195
- children: /* @__PURE__ */ jsxRuntime.jsx(shared.FloatingToolbarExternal, {
196
- children: /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Content, {
166
+ return /* @__PURE__ */ jsxRuntime.jsxs(
167
+ SelectPrimitive__namespace.Root,
168
+ {
169
+ value: activeItem?.name,
170
+ onValueChange: handleItemChange,
171
+ children: [
172
+ /* @__PURE__ */ jsxRuntime.jsx(_private.ShortcutTooltip, { content: "Turn into\u2026", children: /* @__PURE__ */ jsxRuntime.jsx(
173
+ SelectPrimitive__namespace.Trigger,
174
+ {
175
+ asChild: true,
176
+ ...props,
177
+ ref: forwardedRef,
178
+ onKeyDown: handleKeyDown,
179
+ disabled: resolvedItems.length === 0,
180
+ children: /* @__PURE__ */ jsxRuntime.jsx(_private.SelectButton, { variant: "toolbar", children: activeItem?.name ?? "Turn into\u2026" })
181
+ }
182
+ ) }),
183
+ /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(shared.FloatingToolbarExternal, { children: /* @__PURE__ */ jsxRuntime.jsx(
184
+ SelectPrimitive__namespace.Content,
185
+ {
197
186
  position: "popper",
198
187
  sideOffset: BLOCK_SELECT_SIDE_OFFSET,
199
188
  collisionPadding: FLOATING_ELEMENT_COLLISION_PADDING,
200
189
  className: "lb-root lb-portal lb-elevation lb-dropdown lb-select-dropdown lb-tiptap-block-selector-dropdown",
201
- children: resolvedItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(SelectPrimitive__namespace.Item, {
202
- value: item.name,
203
- className: "lb-dropdown-item",
204
- "data-name": item.name,
205
- children: [
206
- item.icon ? /* @__PURE__ */ jsxRuntime.jsx("span", {
207
- className: "lb-dropdown-item-icon lb-icon-container",
208
- children: item.icon
209
- }) : null,
210
- /* @__PURE__ */ jsxRuntime.jsx("span", {
211
- className: "lb-dropdown-item-label",
212
- children: item.label ?? item.name
213
- }),
214
- item.name === activeItem?.name ? /* @__PURE__ */ jsxRuntime.jsx("span", {
215
- className: "lb-dropdown-item-accessory lb-icon-container",
216
- children: /* @__PURE__ */ jsxRuntime.jsx(_private.CheckIcon, {})
217
- }) : null
218
- ]
219
- }, item.name))
220
- })
221
- })
222
- })
223
- ]
224
- });
190
+ children: resolvedItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
191
+ SelectPrimitive__namespace.Item,
192
+ {
193
+ value: item.name,
194
+ className: "lb-dropdown-item",
195
+ "data-name": item.name,
196
+ children: [
197
+ item.icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lb-dropdown-item-icon lb-icon-container", children: item.icon }) : null,
198
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lb-dropdown-item-label", children: item.label ?? item.name }),
199
+ item.name === activeItem?.name ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "lb-dropdown-item-accessory lb-icon-container", children: /* @__PURE__ */ jsxRuntime.jsx(_private.CheckIcon, {}) }) : null
200
+ ]
201
+ },
202
+ item.name
203
+ ))
204
+ }
205
+ ) }) })
206
+ ]
207
+ }
208
+ );
225
209
  });
226
210
  const ToolbarSeparator = react.forwardRef(
227
211
  ({ className, ...props }, forwardedRef) => {
228
- return /* @__PURE__ */ jsxRuntime.jsx("div", {
229
- ref: forwardedRef,
230
- role: "separator",
231
- "aria-orientation": "vertical",
232
- className: _private.cn("lb-tiptap-toolbar-separator", className),
233
- ...props
234
- });
212
+ return /* @__PURE__ */ jsxRuntime.jsx(
213
+ "div",
214
+ {
215
+ ref: forwardedRef,
216
+ role: "separator",
217
+ "aria-orientation": "vertical",
218
+ className: _private.cn("lb-tiptap-toolbar-separator", className),
219
+ ...props
220
+ }
221
+ );
235
222
  }
236
223
  );
237
224
  function ToolbarSectionHistory() {
@@ -239,24 +226,28 @@ function ToolbarSectionHistory() {
239
226
  "SectionHistory",
240
227
  "Toolbar or FloatingToolbar"
241
228
  );
242
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
243
- children: [
244
- /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, {
229
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
230
+ /* @__PURE__ */ jsxRuntime.jsx(
231
+ ToolbarButton,
232
+ {
245
233
  name: "Undo",
246
234
  icon: /* @__PURE__ */ jsxRuntime.jsx(_private.UndoIcon, {}),
247
235
  shortcut: "Mod-Z",
248
236
  onClick: () => editor.chain().focus().undo().run(),
249
237
  disabled: !editor.can().chain().focus().undo().run()
250
- }),
251
- /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, {
238
+ }
239
+ ),
240
+ /* @__PURE__ */ jsxRuntime.jsx(
241
+ ToolbarButton,
242
+ {
252
243
  name: "Redo",
253
244
  icon: /* @__PURE__ */ jsxRuntime.jsx(_private.RedoIcon, {}),
254
245
  shortcut: "Mod-Shift-Z",
255
246
  onClick: () => editor.chain().focus().redo().run(),
256
247
  disabled: !editor.can().chain().focus().redo().run()
257
- })
258
- ]
259
- });
248
+ }
249
+ )
250
+ ] });
260
251
  }
261
252
  function ToolbarSectionInline() {
262
253
  const editor = context.useCurrentEditor(
@@ -268,50 +259,63 @@ function ToolbarSectionInline() {
268
259
  const supportsUnderline = "toggleUnderline" in editor.commands;
269
260
  const supportsStrike = "toggleStrike" in editor.commands;
270
261
  const supportsCode = "toggleCode" in editor.commands;
271
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
272
- children: [
273
- supportsBold && /* @__PURE__ */ jsxRuntime.jsx(ToolbarToggle, {
262
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
263
+ supportsBold && /* @__PURE__ */ jsxRuntime.jsx(
264
+ ToolbarToggle,
265
+ {
274
266
  name: "Bold",
275
267
  icon: /* @__PURE__ */ jsxRuntime.jsx(_private.BoldIcon, {}),
276
268
  shortcut: "Mod-B",
277
269
  onClick: () => editor.chain().focus().toggleBold().run(),
278
270
  disabled: !editor.can().chain().focus().toggleBold().run(),
279
271
  active: editor.isActive("bold")
280
- }),
281
- supportsItalic && /* @__PURE__ */ jsxRuntime.jsx(ToolbarToggle, {
272
+ }
273
+ ),
274
+ supportsItalic && /* @__PURE__ */ jsxRuntime.jsx(
275
+ ToolbarToggle,
276
+ {
282
277
  name: "Italic",
283
278
  icon: /* @__PURE__ */ jsxRuntime.jsx(_private.ItalicIcon, {}),
284
279
  shortcut: "Mod-I",
285
280
  onClick: () => editor.chain().focus().toggleItalic().run(),
286
281
  disabled: !editor.can().chain().focus().toggleItalic().run(),
287
282
  active: editor.isActive("italic")
288
- }),
289
- supportsUnderline && /* @__PURE__ */ jsxRuntime.jsx(ToolbarToggle, {
283
+ }
284
+ ),
285
+ supportsUnderline && /* @__PURE__ */ jsxRuntime.jsx(
286
+ ToolbarToggle,
287
+ {
290
288
  name: "Underline",
291
289
  icon: /* @__PURE__ */ jsxRuntime.jsx(_private.UnderlineIcon, {}),
292
290
  shortcut: "Mod-U",
293
291
  onClick: () => editor.chain().focus().toggleUnderline().run(),
294
292
  disabled: !editor.can().chain().focus().toggleUnderline().run(),
295
293
  active: editor.isActive("underline")
296
- }),
297
- supportsStrike && /* @__PURE__ */ jsxRuntime.jsx(ToolbarToggle, {
294
+ }
295
+ ),
296
+ supportsStrike && /* @__PURE__ */ jsxRuntime.jsx(
297
+ ToolbarToggle,
298
+ {
298
299
  name: "Strikethrough",
299
300
  icon: /* @__PURE__ */ jsxRuntime.jsx(_private.StrikethroughIcon, {}),
300
301
  shortcut: "Mod-U",
301
302
  onClick: () => editor.chain().focus().toggleStrike().run(),
302
303
  disabled: !editor.can().chain().focus().toggleStrike().run(),
303
304
  active: editor.isActive("strike")
304
- }),
305
- supportsCode && /* @__PURE__ */ jsxRuntime.jsx(ToolbarToggle, {
305
+ }
306
+ ),
307
+ supportsCode && /* @__PURE__ */ jsxRuntime.jsx(
308
+ ToolbarToggle,
309
+ {
306
310
  name: "Inline code",
307
311
  icon: /* @__PURE__ */ jsxRuntime.jsx(_private.CodeIcon, {}),
308
312
  shortcut: "Mod-E",
309
313
  onClick: () => editor.chain().focus().toggleCode().run(),
310
314
  disabled: !editor.can().chain().focus().toggleCode().run(),
311
315
  active: editor.isActive("code")
312
- })
313
- ]
314
- });
316
+ }
317
+ )
318
+ ] });
315
319
  }
316
320
  function ToolbarSectionCollaboration() {
317
321
  const editor = context.useCurrentEditor(
@@ -319,64 +323,61 @@ function ToolbarSectionCollaboration() {
319
323
  "Toolbar or FloatingToolbar"
320
324
  );
321
325
  const supportsThread = "addPendingComment" in editor.commands;
322
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
323
- children: supportsThread && /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, {
326
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: supportsThread && /* @__PURE__ */ jsxRuntime.jsx(
327
+ ToolbarButton,
328
+ {
324
329
  name: "Add a comment",
325
330
  icon: /* @__PURE__ */ jsxRuntime.jsx(_private.CommentIcon, {}),
326
331
  onClick: () => editor.chain().focus().addPendingComment().run(),
327
332
  children: "Comment"
328
- })
329
- });
333
+ }
334
+ ) });
330
335
  }
331
336
  function ToolbarSectionAi() {
332
337
  const editor = context.useCurrentEditor("SectionAi", "Toolbar or FloatingToolbar");
333
338
  const supportsAi = "askAi" in editor.commands;
334
339
  const aiName = editor.storage.liveblocksAi?.name;
335
- return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {
336
- children: supportsAi && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
337
- children: [
338
- /* @__PURE__ */ jsxRuntime.jsxs(ToolbarButton, {
339
- name: `Ask ${aiName} anything\u2026`,
340
- icon: /* @__PURE__ */ jsxRuntime.jsx(_private.SparklesIcon, {}),
341
- onClick: () => editor.chain().focus().askAi(),
342
- children: [
343
- "Ask ",
344
- aiName
345
- ]
346
- }),
347
- /* @__PURE__ */ jsxRuntime.jsx(ToolbarButton, {
348
- name: "Explain",
349
- icon: /* @__PURE__ */ jsxRuntime.jsx(_private.QuestionMarkIcon, {}),
350
- onClick: () => editor.chain().focus().askAi("Explain what the text is about"),
351
- children: "Explain"
352
- })
353
- ]
354
- })
355
- });
340
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: supportsAi && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
341
+ /* @__PURE__ */ jsxRuntime.jsxs(
342
+ ToolbarButton,
343
+ {
344
+ name: `Ask ${aiName} anything\u2026`,
345
+ icon: /* @__PURE__ */ jsxRuntime.jsx(_private.SparklesIcon, {}),
346
+ onClick: () => editor.chain().focus().askAi(),
347
+ children: [
348
+ "Ask ",
349
+ aiName
350
+ ]
351
+ }
352
+ ),
353
+ /* @__PURE__ */ jsxRuntime.jsx(
354
+ ToolbarButton,
355
+ {
356
+ name: "Explain",
357
+ icon: /* @__PURE__ */ jsxRuntime.jsx(_private.QuestionMarkIcon, {}),
358
+ onClick: () => editor.chain().focus().askAi("Explain what the text is about"),
359
+ children: "Explain"
360
+ }
361
+ )
362
+ ] }) });
356
363
  }
357
364
  function DefaultToolbarContent({ editor }) {
358
365
  const supportsThread = "addPendingComment" in editor.commands;
359
366
  const supportsAi = "askAi" in editor.commands;
360
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
361
- children: [
362
- /* @__PURE__ */ jsxRuntime.jsx(ToolbarSectionHistory, {}),
367
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
368
+ /* @__PURE__ */ jsxRuntime.jsx(ToolbarSectionHistory, {}),
369
+ /* @__PURE__ */ jsxRuntime.jsx(ToolbarSeparator, {}),
370
+ supportsAi ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
371
+ /* @__PURE__ */ jsxRuntime.jsx(ToolbarSectionAi, {}),
372
+ /* @__PURE__ */ jsxRuntime.jsx(ToolbarSeparator, {})
373
+ ] }) : null,
374
+ /* @__PURE__ */ jsxRuntime.jsx(ToolbarBlockSelector, {}),
375
+ /* @__PURE__ */ jsxRuntime.jsx(ToolbarSectionInline, {}),
376
+ supportsThread ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
363
377
  /* @__PURE__ */ jsxRuntime.jsx(ToolbarSeparator, {}),
364
- supportsAi ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
365
- children: [
366
- /* @__PURE__ */ jsxRuntime.jsx(ToolbarSectionAi, {}),
367
- /* @__PURE__ */ jsxRuntime.jsx(ToolbarSeparator, {})
368
- ]
369
- }) : null,
370
- /* @__PURE__ */ jsxRuntime.jsx(ToolbarBlockSelector, {}),
371
- /* @__PURE__ */ jsxRuntime.jsx(ToolbarSectionInline, {}),
372
- supportsThread ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
373
- children: [
374
- /* @__PURE__ */ jsxRuntime.jsx(ToolbarSeparator, {}),
375
- /* @__PURE__ */ jsxRuntime.jsx(ToolbarSectionCollaboration, {})
376
- ]
377
- }) : null
378
- ]
379
- });
378
+ /* @__PURE__ */ jsxRuntime.jsx(ToolbarSectionCollaboration, {})
379
+ ] }) : null
380
+ ] });
380
381
  }
381
382
  const Toolbar = Object.assign(
382
383
  react.forwardRef(
@@ -392,34 +393,71 @@ const Toolbar = Object.assign(
392
393
  return null;
393
394
  }
394
395
  const slotProps = { editor };
395
- return /* @__PURE__ */ jsxRuntime.jsx(_private.TooltipProvider, {
396
- children: /* @__PURE__ */ jsxRuntime.jsx(context.EditorProvider, {
397
- editor,
398
- children: /* @__PURE__ */ jsxRuntime.jsxs("div", {
399
- ref: forwardedRef,
400
- role: "toolbar",
401
- "aria-label": "Toolbar",
402
- "aria-orientation": "horizontal",
403
- className: _private.cn("lb-root lb-tiptap-toolbar", className),
404
- ...props,
405
- children: [
406
- applyToolbarSlot(before, slotProps),
407
- applyToolbarSlot(children, slotProps),
408
- applyToolbarSlot(after, slotProps)
409
- ]
410
- })
411
- })
412
- });
396
+ return /* @__PURE__ */ jsxRuntime.jsx(_private.TooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(context.EditorProvider, { editor, children: /* @__PURE__ */ jsxRuntime.jsxs(
397
+ "div",
398
+ {
399
+ ref: forwardedRef,
400
+ role: "toolbar",
401
+ "aria-label": "Toolbar",
402
+ "aria-orientation": "horizontal",
403
+ className: _private.cn("lb-root lb-tiptap-toolbar", className),
404
+ ...props,
405
+ children: [
406
+ applyToolbarSlot(before, slotProps),
407
+ applyToolbarSlot(children, slotProps),
408
+ applyToolbarSlot(after, slotProps)
409
+ ]
410
+ }
411
+ ) }) });
413
412
  }
414
413
  ),
415
414
  {
415
+ /**
416
+ * A button for triggering actions.
417
+ *
418
+ * @example
419
+ * <Toolbar.Button name="Comment" shortcut="Mod-Shift-E" onClick={() => { ... }} />
420
+ *
421
+ * @example
422
+ * <Toolbar.Button name="Mention someone" icon={<Icon.Mention />} onClick={() => { ... }} />
423
+ */
416
424
  Button: ToolbarButton,
425
+ /**
426
+ * A toggle button for values that can be active or inactive.
427
+ *
428
+ * @example
429
+ * <Toolbar.Toggle name="Bold" active={isBold} />
430
+ *
431
+ * @example
432
+ * <Toolbar.Toggle name="Italic" icon={<Icon.Italic />} shortcut="Mod-I" active={isItalic} onClick={() => { ... }} />
433
+ */
417
434
  Toggle: ToolbarToggle,
435
+ /**
436
+ * A dropdown selector to switch between different block types.
437
+ *
438
+ * @example
439
+ * <Toolbar.BlockSelector />
440
+ */
418
441
  BlockSelector: ToolbarBlockSelector,
442
+ /**
443
+ * A visual (and accessible) separator to separate sections in a toolbar.
444
+ */
419
445
  Separator: ToolbarSeparator,
446
+ /**
447
+ * A section containing history actions. (e.g. undo, redo)
448
+ */
420
449
  SectionHistory: ToolbarSectionHistory,
450
+ /**
451
+ * A section containing inline formatting actions. (e.g. bold, italic, underline, ...)
452
+ */
421
453
  SectionInline: ToolbarSectionInline,
454
+ /**
455
+ * A section containing collaborative actions. (e.g. adding a comment)
456
+ */
422
457
  SectionCollaboration: ToolbarSectionCollaboration,
458
+ /**
459
+ * A section containing AI actions. (e.g. opening the AI toolbar)
460
+ */
423
461
  SectionAi: ToolbarSectionAi
424
462
  }
425
463
  );