@liveblocks/react-tiptap 2.15.2 → 2.16.0-toolbars1
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/dist/LiveblocksExtension.js.map +1 -1
- package/dist/LiveblocksExtension.mjs.map +1 -1
- package/dist/comments/CommentsExtension.js +6 -2
- package/dist/comments/CommentsExtension.js.map +1 -1
- package/dist/comments/CommentsExtension.mjs +7 -3
- package/dist/comments/CommentsExtension.mjs.map +1 -1
- package/dist/comments/FloatingComposer.js +27 -30
- package/dist/comments/FloatingComposer.js.map +1 -1
- package/dist/comments/FloatingComposer.mjs +29 -32
- package/dist/comments/FloatingComposer.mjs.map +1 -1
- package/dist/context.js +24 -0
- package/dist/context.js.map +1 -0
- package/dist/context.mjs +21 -0
- package/dist/context.mjs.map +1 -0
- package/dist/index.d.mts +65 -13
- package/dist/index.d.ts +65 -13
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -0
- package/dist/index.mjs.map +1 -1
- package/dist/toolbar/FloatingToolbar.js +301 -0
- package/dist/toolbar/FloatingToolbar.js.map +1 -0
- package/dist/toolbar/FloatingToolbar.mjs +298 -0
- package/dist/toolbar/FloatingToolbar.mjs.map +1 -0
- package/dist/toolbar/FloatingToolbarContext.js +8 -0
- package/dist/toolbar/FloatingToolbarContext.js.map +1 -0
- package/dist/toolbar/FloatingToolbarContext.mjs +6 -0
- package/dist/toolbar/FloatingToolbarContext.mjs.map +1 -0
- package/dist/toolbar/Toolbar.js +352 -0
- package/dist/toolbar/Toolbar.js.map +1 -0
- package/dist/toolbar/Toolbar.mjs +327 -0
- package/dist/toolbar/Toolbar.mjs.map +1 -0
- package/dist/types.js +7 -3
- package/dist/types.js.map +1 -1
- package/dist/types.mjs +6 -3
- package/dist/types.mjs.map +1 -1
- package/dist/utils.js +17 -0
- package/dist/utils.js.map +1 -1
- package/dist/utils.mjs +16 -1
- package/dist/utils.mjs.map +1 -1
- package/dist/version-history/HistoryVersionPreview.js +79 -79
- package/dist/version-history/HistoryVersionPreview.js.map +1 -1
- package/dist/version-history/HistoryVersionPreview.mjs +79 -79
- package/dist/version-history/HistoryVersionPreview.mjs.map +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/package.json +11 -8
- package/src/styles/constants.css +2 -1
- package/src/styles/index.css +58 -6
- package/src/styles/utils.css +11 -0
- package/styles.css +1 -1
- package/styles.css.map +1 -1
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
2
|
+
import { ShortcutTooltip, Button, ChevronDownIcon, CheckIcon, UndoIcon, RedoIcon, BoldIcon, ItalicIcon, UnderlineIcon, StrikethroughIcon, CodeIcon, CommentIcon, TooltipProvider } from '@liveblocks/react-ui/_private';
|
|
3
|
+
import * as SelectPrimitive from '@radix-ui/react-select';
|
|
4
|
+
import * as TogglePrimitive from '@radix-ui/react-toggle';
|
|
5
|
+
import { forwardRef, useContext, useMemo } from 'react';
|
|
6
|
+
import { classNames } from '../classnames.mjs';
|
|
7
|
+
import { useCurrentEditor, EditorProvider } from '../context.mjs';
|
|
8
|
+
import { FloatingToolbarContext } from './FloatingToolbarContext.mjs';
|
|
9
|
+
|
|
10
|
+
const BLOCK_SELECT_SIDE_OFFSET = 10;
|
|
11
|
+
const FLOATING_ELEMENT_COLLISION_PADDING = 10;
|
|
12
|
+
function applyToolbarSlot(slot, props) {
|
|
13
|
+
if (typeof slot === "function") {
|
|
14
|
+
const Component = slot;
|
|
15
|
+
return /* @__PURE__ */ jsx(Component, {
|
|
16
|
+
...props
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
return slot;
|
|
20
|
+
}
|
|
21
|
+
const ToolbarButton = forwardRef(
|
|
22
|
+
({ icon, children, name, shortcut, ...props }, forwardedRef) => {
|
|
23
|
+
return /* @__PURE__ */ jsx(ShortcutTooltip, {
|
|
24
|
+
content: name,
|
|
25
|
+
shortcut,
|
|
26
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
27
|
+
type: "button",
|
|
28
|
+
variant: "toolbar",
|
|
29
|
+
ref: forwardedRef,
|
|
30
|
+
icon,
|
|
31
|
+
...props,
|
|
32
|
+
children
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
const ToolbarToggle = forwardRef(
|
|
38
|
+
({ active, ...props }, forwardedRef) => {
|
|
39
|
+
return /* @__PURE__ */ jsx(TogglePrimitive.Root, {
|
|
40
|
+
asChild: true,
|
|
41
|
+
pressed: active,
|
|
42
|
+
children: /* @__PURE__ */ jsx(ToolbarButton, {
|
|
43
|
+
ref: forwardedRef,
|
|
44
|
+
...props
|
|
45
|
+
})
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
);
|
|
49
|
+
function createDefaultBlockSelectorItems(editor) {
|
|
50
|
+
const items = [
|
|
51
|
+
"toggleHeading" in editor.commands ? {
|
|
52
|
+
name: "Heading 1",
|
|
53
|
+
isActive: (editor2) => editor2.isActive("heading", { level: 1 }),
|
|
54
|
+
setActive: (editor2) => editor2.chain().focus().clearNodes().toggleHeading({ level: 1 }).run()
|
|
55
|
+
} : null,
|
|
56
|
+
"toggleHeading" in editor.commands ? {
|
|
57
|
+
name: "Heading 2",
|
|
58
|
+
isActive: (editor2) => editor2.isActive("heading", { level: 2 }),
|
|
59
|
+
setActive: (editor2) => editor2.chain().focus().clearNodes().toggleHeading({ level: 2 }).run()
|
|
60
|
+
} : null,
|
|
61
|
+
"toggleHeading" in editor.commands ? {
|
|
62
|
+
name: "Heading 3",
|
|
63
|
+
isActive: (editor2) => editor2.isActive("heading", { level: 3 }),
|
|
64
|
+
setActive: (editor2) => editor2.chain().focus().clearNodes().toggleHeading({ level: 3 }).run()
|
|
65
|
+
} : null,
|
|
66
|
+
"toggleBulletList" in editor.commands ? {
|
|
67
|
+
name: "Bullet list",
|
|
68
|
+
isActive: (editor2) => editor2.isActive("bulletList"),
|
|
69
|
+
setActive: (editor2) => editor2.chain().focus().clearNodes().toggleBulletList().run()
|
|
70
|
+
} : null,
|
|
71
|
+
"toggleOrderedList" in editor.commands ? {
|
|
72
|
+
name: "Numbered list",
|
|
73
|
+
isActive: (editor2) => editor2.isActive("orderedList"),
|
|
74
|
+
setActive: (editor2) => editor2.chain().focus().clearNodes().toggleOrderedList().run()
|
|
75
|
+
} : null,
|
|
76
|
+
"toggleBlockquote" in editor.commands ? {
|
|
77
|
+
name: "Blockquote",
|
|
78
|
+
isActive: (editor2) => editor2.isActive("blockquote"),
|
|
79
|
+
setActive: (editor2) => editor2.chain().focus().clearNodes().toggleBlockquote().run()
|
|
80
|
+
} : null
|
|
81
|
+
];
|
|
82
|
+
return items.filter(Boolean);
|
|
83
|
+
}
|
|
84
|
+
const blockSelectorTextItem = {
|
|
85
|
+
name: "Text",
|
|
86
|
+
isActive: () => false,
|
|
87
|
+
setActive: (editor) => editor.chain().focus().clearNodes().run()
|
|
88
|
+
};
|
|
89
|
+
const ToolbarBlockSelector = forwardRef(({ items, ...props }, forwardedRef) => {
|
|
90
|
+
const floatingToolbarContext = useContext(FloatingToolbarContext);
|
|
91
|
+
const editor = useCurrentEditor(
|
|
92
|
+
"BlockSelector",
|
|
93
|
+
"Toolbar or FloatingToolbar"
|
|
94
|
+
);
|
|
95
|
+
const resolvedItems = useMemo(() => {
|
|
96
|
+
const resolvedItems2 = items ?? createDefaultBlockSelectorItems(editor);
|
|
97
|
+
return [blockSelectorTextItem, ...resolvedItems2];
|
|
98
|
+
}, [editor, items]);
|
|
99
|
+
const activeItem = resolvedItems.find((item) => item.isActive(editor)) ?? blockSelectorTextItem;
|
|
100
|
+
const handleItemChange = (name) => {
|
|
101
|
+
const item = resolvedItems.find((item2) => item2.name === name);
|
|
102
|
+
if (item) {
|
|
103
|
+
item.setActive(editor);
|
|
104
|
+
floatingToolbarContext?.close();
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
return /* @__PURE__ */ jsxs(SelectPrimitive.Root, {
|
|
108
|
+
value: activeItem.name,
|
|
109
|
+
onValueChange: handleItemChange,
|
|
110
|
+
children: [
|
|
111
|
+
/* @__PURE__ */ jsx(ShortcutTooltip, {
|
|
112
|
+
content: "Turn into\u2026",
|
|
113
|
+
children: /* @__PURE__ */ jsx(SelectPrimitive.Trigger, {
|
|
114
|
+
asChild: true,
|
|
115
|
+
...props,
|
|
116
|
+
ref: forwardedRef,
|
|
117
|
+
children: /* @__PURE__ */ jsxs(Button, {
|
|
118
|
+
type: "button",
|
|
119
|
+
variant: "toolbar",
|
|
120
|
+
children: [
|
|
121
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Value, {
|
|
122
|
+
children: activeItem.name
|
|
123
|
+
}),
|
|
124
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Icon, {
|
|
125
|
+
className: "lb-dropdown-chevron",
|
|
126
|
+
children: /* @__PURE__ */ jsx(ChevronDownIcon, {})
|
|
127
|
+
})
|
|
128
|
+
]
|
|
129
|
+
})
|
|
130
|
+
})
|
|
131
|
+
}),
|
|
132
|
+
/* @__PURE__ */ jsx(SelectPrimitive.Portal, {
|
|
133
|
+
children: /* @__PURE__ */ jsx(SelectPrimitive.Content, {
|
|
134
|
+
position: "popper",
|
|
135
|
+
sideOffset: BLOCK_SELECT_SIDE_OFFSET,
|
|
136
|
+
collisionPadding: FLOATING_ELEMENT_COLLISION_PADDING,
|
|
137
|
+
className: "lb-root lb-portal lb-elevation lb-dropdown",
|
|
138
|
+
children: resolvedItems.map((item) => /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
|
|
139
|
+
value: item.name,
|
|
140
|
+
className: "lb-dropdown-item",
|
|
141
|
+
children: [
|
|
142
|
+
/* @__PURE__ */ jsx("span", {
|
|
143
|
+
className: "lb-dropdown-item-label",
|
|
144
|
+
children: /* @__PURE__ */ jsx(SelectPrimitive.ItemText, {
|
|
145
|
+
children: item.name
|
|
146
|
+
})
|
|
147
|
+
}),
|
|
148
|
+
item.name === activeItem.name ? /* @__PURE__ */ jsx("span", {
|
|
149
|
+
className: "lb-dropdown-item-accessory lb-icon-container",
|
|
150
|
+
children: /* @__PURE__ */ jsx(CheckIcon, {})
|
|
151
|
+
}) : null
|
|
152
|
+
]
|
|
153
|
+
}, item.name))
|
|
154
|
+
})
|
|
155
|
+
})
|
|
156
|
+
]
|
|
157
|
+
});
|
|
158
|
+
});
|
|
159
|
+
const ToolbarSeparator = forwardRef(
|
|
160
|
+
({ className, ...props }, forwardedRef) => {
|
|
161
|
+
return /* @__PURE__ */ jsx("div", {
|
|
162
|
+
ref: forwardedRef,
|
|
163
|
+
role: "separator",
|
|
164
|
+
"aria-orientation": "vertical",
|
|
165
|
+
className: classNames("lb-tiptap-toolbar-separator", className),
|
|
166
|
+
...props
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
);
|
|
170
|
+
function ToolbarSectionHistory() {
|
|
171
|
+
const editor = useCurrentEditor(
|
|
172
|
+
"SectionHistory",
|
|
173
|
+
"Toolbar or FloatingToolbar"
|
|
174
|
+
);
|
|
175
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
176
|
+
children: [
|
|
177
|
+
/* @__PURE__ */ jsx(ToolbarButton, {
|
|
178
|
+
name: "Undo",
|
|
179
|
+
icon: /* @__PURE__ */ jsx(UndoIcon, {}),
|
|
180
|
+
shortcut: "Mod-Z",
|
|
181
|
+
onClick: () => editor.chain().focus().undo().run(),
|
|
182
|
+
disabled: !editor.can().chain().focus().undo().run()
|
|
183
|
+
}),
|
|
184
|
+
/* @__PURE__ */ jsx(ToolbarButton, {
|
|
185
|
+
name: "Redo",
|
|
186
|
+
icon: /* @__PURE__ */ jsx(RedoIcon, {}),
|
|
187
|
+
shortcut: "Mod-Shift-Z",
|
|
188
|
+
onClick: () => editor.chain().focus().redo().run(),
|
|
189
|
+
disabled: !editor.can().chain().focus().redo().run()
|
|
190
|
+
})
|
|
191
|
+
]
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
function ToolbarSectionInline() {
|
|
195
|
+
const editor = useCurrentEditor(
|
|
196
|
+
"SectionInline",
|
|
197
|
+
"Toolbar or FloatingToolbar"
|
|
198
|
+
);
|
|
199
|
+
const supportsBold = "toggleBold" in editor.commands;
|
|
200
|
+
const supportsItalic = "toggleItalic" in editor.commands;
|
|
201
|
+
const supportsUnderline = "toggleUnderline" in editor.commands;
|
|
202
|
+
const supportsStrike = "toggleStrike" in editor.commands;
|
|
203
|
+
const supportsCode = "toggleCode" in editor.commands;
|
|
204
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
205
|
+
children: [
|
|
206
|
+
supportsBold && /* @__PURE__ */ jsx(ToolbarToggle, {
|
|
207
|
+
name: "Bold",
|
|
208
|
+
icon: /* @__PURE__ */ jsx(BoldIcon, {}),
|
|
209
|
+
shortcut: "Mod-B",
|
|
210
|
+
onClick: () => editor.chain().focus().toggleBold().run(),
|
|
211
|
+
disabled: !editor.can().chain().focus().toggleBold().run(),
|
|
212
|
+
active: editor.isActive("bold")
|
|
213
|
+
}),
|
|
214
|
+
supportsItalic && /* @__PURE__ */ jsx(ToolbarToggle, {
|
|
215
|
+
name: "Italic",
|
|
216
|
+
icon: /* @__PURE__ */ jsx(ItalicIcon, {}),
|
|
217
|
+
shortcut: "Mod-I",
|
|
218
|
+
onClick: () => editor.chain().focus().toggleItalic().run(),
|
|
219
|
+
disabled: !editor.can().chain().focus().toggleItalic().run(),
|
|
220
|
+
active: editor.isActive("italic")
|
|
221
|
+
}),
|
|
222
|
+
supportsUnderline && /* @__PURE__ */ jsx(ToolbarToggle, {
|
|
223
|
+
name: "Underline",
|
|
224
|
+
icon: /* @__PURE__ */ jsx(UnderlineIcon, {}),
|
|
225
|
+
shortcut: "Mod-U",
|
|
226
|
+
onClick: () => editor.chain().focus().toggleUnderline().run(),
|
|
227
|
+
disabled: !editor.can().chain().focus().toggleUnderline().run(),
|
|
228
|
+
active: editor.isActive("underline")
|
|
229
|
+
}),
|
|
230
|
+
supportsStrike && /* @__PURE__ */ jsx(ToolbarToggle, {
|
|
231
|
+
name: "Strikethrough",
|
|
232
|
+
icon: /* @__PURE__ */ jsx(StrikethroughIcon, {}),
|
|
233
|
+
shortcut: "Mod-U",
|
|
234
|
+
onClick: () => editor.chain().focus().toggleStrike().run(),
|
|
235
|
+
disabled: !editor.can().chain().focus().toggleStrike().run(),
|
|
236
|
+
active: editor.isActive("strike")
|
|
237
|
+
}),
|
|
238
|
+
supportsCode && /* @__PURE__ */ jsx(ToolbarToggle, {
|
|
239
|
+
name: "Inline code",
|
|
240
|
+
icon: /* @__PURE__ */ jsx(CodeIcon, {}),
|
|
241
|
+
shortcut: "Mod-E",
|
|
242
|
+
onClick: () => editor.chain().focus().toggleCode().run(),
|
|
243
|
+
disabled: !editor.can().chain().focus().toggleCode().run(),
|
|
244
|
+
active: editor.isActive("code")
|
|
245
|
+
})
|
|
246
|
+
]
|
|
247
|
+
});
|
|
248
|
+
}
|
|
249
|
+
function ToolbarSectionCollaboration() {
|
|
250
|
+
const editor = useCurrentEditor(
|
|
251
|
+
"SectionCollaboration",
|
|
252
|
+
"Toolbar or FloatingToolbar"
|
|
253
|
+
);
|
|
254
|
+
const supportsThread = "addPendingComment" in editor.commands;
|
|
255
|
+
return /* @__PURE__ */ jsx(Fragment, {
|
|
256
|
+
children: supportsThread && /* @__PURE__ */ jsx(ToolbarButton, {
|
|
257
|
+
name: "Add a comment",
|
|
258
|
+
icon: /* @__PURE__ */ jsx(CommentIcon, {}),
|
|
259
|
+
onClick: () => editor.chain().focus().addPendingComment().run(),
|
|
260
|
+
children: "Comment"
|
|
261
|
+
})
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
function DefaultToolbarContent({ editor }) {
|
|
265
|
+
const supportsThread = "addPendingComment" in editor.commands;
|
|
266
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
267
|
+
children: [
|
|
268
|
+
/* @__PURE__ */ jsx(ToolbarSectionHistory, {}),
|
|
269
|
+
/* @__PURE__ */ jsx(ToolbarSeparator, {}),
|
|
270
|
+
/* @__PURE__ */ jsx(ToolbarBlockSelector, {}),
|
|
271
|
+
/* @__PURE__ */ jsx(ToolbarSectionInline, {}),
|
|
272
|
+
supportsThread ? /* @__PURE__ */ jsxs(Fragment, {
|
|
273
|
+
children: [
|
|
274
|
+
/* @__PURE__ */ jsx(ToolbarSeparator, {}),
|
|
275
|
+
/* @__PURE__ */ jsx(ToolbarSectionCollaboration, {})
|
|
276
|
+
]
|
|
277
|
+
}) : null
|
|
278
|
+
]
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
const Toolbar = Object.assign(
|
|
282
|
+
forwardRef(
|
|
283
|
+
({
|
|
284
|
+
before,
|
|
285
|
+
after,
|
|
286
|
+
children = DefaultToolbarContent,
|
|
287
|
+
editor,
|
|
288
|
+
className,
|
|
289
|
+
...props
|
|
290
|
+
}, forwardedRef) => {
|
|
291
|
+
if (!editor) {
|
|
292
|
+
return null;
|
|
293
|
+
}
|
|
294
|
+
const slotProps = { editor };
|
|
295
|
+
return /* @__PURE__ */ jsx(TooltipProvider, {
|
|
296
|
+
children: /* @__PURE__ */ jsx(EditorProvider, {
|
|
297
|
+
editor,
|
|
298
|
+
children: /* @__PURE__ */ jsxs("div", {
|
|
299
|
+
ref: forwardedRef,
|
|
300
|
+
role: "toolbar",
|
|
301
|
+
"aria-label": "Toolbar",
|
|
302
|
+
"aria-orientation": "horizontal",
|
|
303
|
+
className: classNames("lb-root lb-tiptap-toolbar", className),
|
|
304
|
+
...props,
|
|
305
|
+
children: [
|
|
306
|
+
applyToolbarSlot(before, slotProps),
|
|
307
|
+
applyToolbarSlot(children, slotProps),
|
|
308
|
+
applyToolbarSlot(after, slotProps)
|
|
309
|
+
]
|
|
310
|
+
})
|
|
311
|
+
})
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
),
|
|
315
|
+
{
|
|
316
|
+
Button: ToolbarButton,
|
|
317
|
+
Toggle: ToolbarToggle,
|
|
318
|
+
Separator: ToolbarSeparator,
|
|
319
|
+
SectionHistory: ToolbarSectionHistory,
|
|
320
|
+
SectionInline: ToolbarSectionInline,
|
|
321
|
+
SectionCollaboration: ToolbarSectionCollaboration,
|
|
322
|
+
BlockSelector: ToolbarBlockSelector
|
|
323
|
+
}
|
|
324
|
+
);
|
|
325
|
+
|
|
326
|
+
export { BLOCK_SELECT_SIDE_OFFSET, FLOATING_ELEMENT_COLLISION_PADDING, Toolbar, applyToolbarSlot };
|
|
327
|
+
//# sourceMappingURL=Toolbar.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Toolbar.mjs","sources":["../../src/toolbar/Toolbar.tsx"],"sourcesContent":["import {\n BoldIcon,\n Button,\n CheckIcon,\n ChevronDownIcon,\n CodeIcon,\n CommentIcon,\n ItalicIcon,\n RedoIcon,\n ShortcutTooltip,\n StrikethroughIcon,\n TooltipProvider,\n UnderlineIcon,\n UndoIcon,\n} from \"@liveblocks/react-ui/_private\";\nimport * as SelectPrimitive from \"@radix-ui/react-select\";\nimport * as TogglePrimitive from \"@radix-ui/react-toggle\";\nimport type { Editor } from \"@tiptap/react\";\nimport type { ComponentProps, ComponentType, ReactNode } from \"react\";\nimport { forwardRef, useContext, useMemo } from \"react\";\n\nimport { classNames } from \"../classnames\";\nimport { EditorProvider, useCurrentEditor } from \"../context\";\nimport type { ExtendedChainedCommands } from \"../types\";\nimport { FloatingToolbarContext } from \"./FloatingToolbarContext\";\n\nexport const BLOCK_SELECT_SIDE_OFFSET = 10;\nexport const FLOATING_ELEMENT_COLLISION_PADDING = 10;\n\nexport interface ToolbarSlotProps {\n editor: Editor;\n}\n\nexport type ToolbarSlot = ReactNode | ComponentType<ToolbarSlotProps>;\n\nexport interface ToolbarProps extends Omit<ComponentProps<\"div\">, \"children\"> {\n editor: Editor | null;\n children?: ToolbarSlot;\n before?: ToolbarSlot;\n after?: ToolbarSlot;\n}\n\ninterface ToolbarButtonProps extends ComponentProps<\"button\"> {\n icon?: ReactNode;\n name: string;\n shortcut?: string;\n}\n\ninterface ToolbarToggleProps extends ToolbarButtonProps {\n active: boolean;\n}\n\ninterface ToolbarBlockSelectorItem {\n name: string;\n isActive: (editor: Editor) => boolean;\n setActive: (editor: Editor) => void;\n}\n\ninterface ToolbarBlockSelectorProps extends ComponentProps<\"button\"> {\n items?: ToolbarBlockSelectorItem[];\n}\n\ntype ToolbarSeparatorProps = ComponentProps<\"div\">;\n\nexport function applyToolbarSlot(\n slot: ToolbarSlot,\n props: ToolbarSlotProps\n): ReactNode {\n if (typeof slot === \"function\") {\n const Component = slot;\n\n return <Component {...props} />;\n }\n\n return slot;\n}\n\nconst ToolbarButton = forwardRef<HTMLButtonElement, ToolbarButtonProps>(\n ({ icon, children, name, shortcut, ...props }, forwardedRef) => {\n return (\n <ShortcutTooltip content={name} shortcut={shortcut}>\n <Button\n type=\"button\"\n variant=\"toolbar\"\n ref={forwardedRef}\n icon={icon}\n {...props}\n >\n {children}\n </Button>\n </ShortcutTooltip>\n );\n }\n);\n\nconst ToolbarToggle = forwardRef<HTMLButtonElement, ToolbarToggleProps>(\n ({ active, ...props }, forwardedRef) => {\n return (\n <TogglePrimitive.Root asChild pressed={active}>\n <ToolbarButton ref={forwardedRef} {...props} />\n </TogglePrimitive.Root>\n );\n }\n);\n\nfunction createDefaultBlockSelectorItems(\n editor: Editor\n): ToolbarBlockSelectorItem[] {\n const items: (ToolbarBlockSelectorItem | null)[] = [\n \"toggleHeading\" in editor.commands\n ? {\n name: \"Heading 1\",\n isActive: (editor) => editor.isActive(\"heading\", { level: 1 }),\n setActive: (editor) =>\n (\n editor.chain().focus().clearNodes() as ExtendedChainedCommands<\n \"toggleHeading\",\n [{ level: number }]\n >\n )\n .toggleHeading({ level: 1 })\n .run(),\n }\n : null,\n \"toggleHeading\" in editor.commands\n ? {\n name: \"Heading 2\",\n isActive: (editor) => editor.isActive(\"heading\", { level: 2 }),\n setActive: (editor) =>\n (\n editor.chain().focus().clearNodes() as ExtendedChainedCommands<\n \"toggleHeading\",\n [{ level: number }]\n >\n )\n .toggleHeading({ level: 2 })\n .run(),\n }\n : null,\n \"toggleHeading\" in editor.commands\n ? {\n name: \"Heading 3\",\n isActive: (editor) => editor.isActive(\"heading\", { level: 3 }),\n setActive: (editor) =>\n (\n editor.chain().focus().clearNodes() as ExtendedChainedCommands<\n \"toggleHeading\",\n [{ level: number }]\n >\n )\n .toggleHeading({ level: 3 })\n .run(),\n }\n : null,\n \"toggleBulletList\" in editor.commands\n ? {\n name: \"Bullet list\",\n isActive: (editor) => editor.isActive(\"bulletList\"),\n setActive: (editor) =>\n (\n editor\n .chain()\n .focus()\n .clearNodes() as ExtendedChainedCommands<\"toggleBulletList\">\n )\n .toggleBulletList()\n .run(),\n }\n : null,\n \"toggleOrderedList\" in editor.commands\n ? {\n name: \"Numbered list\",\n\n isActive: (editor) => editor.isActive(\"orderedList\"),\n setActive: (editor) =>\n (\n editor\n .chain()\n .focus()\n .clearNodes() as ExtendedChainedCommands<\"toggleOrderedList\">\n )\n .toggleOrderedList()\n .run(),\n }\n : null,\n \"toggleBlockquote\" in editor.commands\n ? {\n name: \"Blockquote\",\n isActive: (editor) => editor.isActive(\"blockquote\"),\n setActive: (editor) =>\n (\n editor\n .chain()\n .focus()\n .clearNodes() as ExtendedChainedCommands<\"toggleBlockquote\">\n )\n .toggleBlockquote()\n .run(),\n }\n : null,\n ];\n\n return items.filter(Boolean) as ToolbarBlockSelectorItem[];\n}\n\nconst blockSelectorTextItem: ToolbarBlockSelectorItem = {\n name: \"Text\",\n isActive: () => false,\n setActive: (editor) => editor.chain().focus().clearNodes().run(),\n};\n\nconst ToolbarBlockSelector = forwardRef<\n HTMLButtonElement,\n ToolbarBlockSelectorProps\n>(({ items, ...props }, forwardedRef) => {\n const floatingToolbarContext = useContext(FloatingToolbarContext);\n const editor = useCurrentEditor(\n \"BlockSelector\",\n \"Toolbar or FloatingToolbar\"\n );\n const resolvedItems = useMemo(() => {\n const resolvedItems = items ?? createDefaultBlockSelectorItems(editor);\n\n return [blockSelectorTextItem, ...resolvedItems];\n }, [editor, items]);\n const activeItem =\n resolvedItems.find((item) => item.isActive(editor)) ??\n blockSelectorTextItem;\n\n const handleItemChange = (name: string) => {\n const item = resolvedItems.find((item) => item.name === name);\n\n if (item) {\n item.setActive(editor);\n\n // If present in a floating toolbar, close it on change\n floatingToolbarContext?.close();\n }\n };\n\n return (\n <SelectPrimitive.Root\n value={activeItem.name}\n onValueChange={handleItemChange}\n >\n <ShortcutTooltip content=\"Turn into…\">\n <SelectPrimitive.Trigger asChild {...props} ref={forwardedRef}>\n <Button type=\"button\" variant=\"toolbar\">\n <SelectPrimitive.Value>{activeItem.name}</SelectPrimitive.Value>\n <SelectPrimitive.Icon className=\"lb-dropdown-chevron\">\n <ChevronDownIcon />\n </SelectPrimitive.Icon>\n </Button>\n </SelectPrimitive.Trigger>\n </ShortcutTooltip>\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n position=\"popper\"\n sideOffset={BLOCK_SELECT_SIDE_OFFSET}\n collisionPadding={FLOATING_ELEMENT_COLLISION_PADDING}\n className=\"lb-root lb-portal lb-elevation lb-dropdown\"\n >\n {resolvedItems.map((item) => (\n <SelectPrimitive.Item\n key={item.name}\n value={item.name}\n className=\"lb-dropdown-item\"\n >\n <span className=\"lb-dropdown-item-label\">\n <SelectPrimitive.ItemText>{item.name}</SelectPrimitive.ItemText>\n </span>\n {item.name === activeItem.name ? (\n <span className=\"lb-dropdown-item-accessory lb-icon-container\">\n <CheckIcon />\n </span>\n ) : null}\n </SelectPrimitive.Item>\n ))}\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n </SelectPrimitive.Root>\n );\n});\n\nconst ToolbarSeparator = forwardRef<HTMLDivElement, ToolbarSeparatorProps>(\n ({ className, ...props }, forwardedRef) => {\n return (\n <div\n ref={forwardedRef}\n role=\"separator\"\n aria-orientation=\"vertical\"\n className={classNames(\"lb-tiptap-toolbar-separator\", className)}\n {...props}\n />\n );\n }\n);\n\nfunction ToolbarSectionHistory() {\n const editor = useCurrentEditor(\n \"SectionHistory\",\n \"Toolbar or FloatingToolbar\"\n );\n\n return (\n <>\n <ToolbarButton\n name=\"Undo\"\n icon={<UndoIcon />}\n shortcut=\"Mod-Z\"\n onClick={() => editor.chain().focus().undo().run()}\n disabled={!editor.can().chain().focus().undo().run()}\n />\n <ToolbarButton\n name=\"Redo\"\n icon={<RedoIcon />}\n shortcut=\"Mod-Shift-Z\"\n onClick={() => editor.chain().focus().redo().run()}\n disabled={!editor.can().chain().focus().redo().run()}\n />\n </>\n );\n}\n\nfunction ToolbarSectionInline() {\n const editor = useCurrentEditor(\n \"SectionInline\",\n \"Toolbar or FloatingToolbar\"\n );\n const supportsBold = \"toggleBold\" in editor.commands;\n const supportsItalic = \"toggleItalic\" in editor.commands;\n const supportsUnderline = \"toggleUnderline\" in editor.commands;\n const supportsStrike = \"toggleStrike\" in editor.commands;\n const supportsCode = \"toggleCode\" in editor.commands;\n\n return (\n <>\n {supportsBold && (\n <ToolbarToggle\n name=\"Bold\"\n icon={<BoldIcon />}\n shortcut=\"Mod-B\"\n onClick={() =>\n (editor.chain().focus() as ExtendedChainedCommands<\"toggleBold\">)\n .toggleBold()\n .run()\n }\n disabled={\n !(\n editor\n .can()\n .chain()\n .focus() as ExtendedChainedCommands<\"toggleBold\">\n )\n .toggleBold()\n .run()\n }\n active={editor.isActive(\"bold\")}\n />\n )}\n {supportsItalic && (\n <ToolbarToggle\n name=\"Italic\"\n icon={<ItalicIcon />}\n shortcut=\"Mod-I\"\n onClick={() =>\n (editor.chain().focus() as ExtendedChainedCommands<\"toggleItalic\">)\n .toggleItalic()\n .run()\n }\n disabled={\n !(\n editor\n .can()\n .chain()\n .focus() as ExtendedChainedCommands<\"toggleItalic\">\n )\n .toggleItalic()\n .run()\n }\n active={editor.isActive(\"italic\")}\n />\n )}\n {supportsUnderline && (\n <ToolbarToggle\n name=\"Underline\"\n icon={<UnderlineIcon />}\n shortcut=\"Mod-U\"\n onClick={() =>\n (\n editor\n .chain()\n .focus() as ExtendedChainedCommands<\"toggleUnderline\">\n )\n .toggleUnderline()\n .run()\n }\n disabled={\n !(\n editor\n .can()\n .chain()\n .focus() as ExtendedChainedCommands<\"toggleUnderline\">\n )\n .toggleUnderline()\n .run()\n }\n active={editor.isActive(\"underline\")}\n />\n )}\n {supportsStrike && (\n <ToolbarToggle\n name=\"Strikethrough\"\n icon={<StrikethroughIcon />}\n shortcut=\"Mod-U\"\n onClick={() =>\n (editor.chain().focus() as ExtendedChainedCommands<\"toggleStrike\">)\n .toggleStrike()\n .run()\n }\n disabled={\n !(\n editor\n .can()\n .chain()\n .focus() as ExtendedChainedCommands<\"toggleStrike\">\n )\n .toggleStrike()\n .run()\n }\n active={editor.isActive(\"strike\")}\n />\n )}\n {supportsCode && (\n <ToolbarToggle\n name=\"Inline code\"\n icon={<CodeIcon />}\n shortcut=\"Mod-E\"\n onClick={() =>\n (editor.chain().focus() as ExtendedChainedCommands<\"toggleCode\">)\n .toggleCode()\n .run()\n }\n disabled={\n !(\n editor\n .can()\n .chain()\n .focus() as ExtendedChainedCommands<\"toggleCode\">\n )\n .toggleCode()\n .run()\n }\n active={editor.isActive(\"code\")}\n />\n )}\n </>\n );\n}\n\nfunction ToolbarSectionCollaboration() {\n const editor = useCurrentEditor(\n \"SectionCollaboration\",\n \"Toolbar or FloatingToolbar\"\n );\n const supportsThread = \"addPendingComment\" in editor.commands;\n\n return (\n <>\n {supportsThread && (\n <ToolbarButton\n name=\"Add a comment\"\n icon={<CommentIcon />}\n onClick={() =>\n (\n editor\n .chain()\n .focus() as ExtendedChainedCommands<\"addPendingComment\">\n )\n .addPendingComment()\n .run()\n }\n >\n Comment\n </ToolbarButton>\n )}\n </>\n );\n}\n\nfunction DefaultToolbarContent({ editor }: ToolbarSlotProps) {\n const supportsThread = \"addPendingComment\" in editor.commands;\n\n return (\n <>\n <ToolbarSectionHistory />\n <ToolbarSeparator />\n <ToolbarBlockSelector />\n <ToolbarSectionInline />\n {supportsThread ? (\n <>\n <ToolbarSeparator />\n <ToolbarSectionCollaboration />\n </>\n ) : null}\n </>\n );\n}\n\nexport const Toolbar = Object.assign(\n forwardRef<HTMLDivElement, ToolbarProps>(\n (\n {\n before,\n after,\n children = DefaultToolbarContent,\n editor,\n className,\n ...props\n },\n forwardedRef\n ) => {\n if (!editor) {\n return null;\n }\n\n const slotProps: ToolbarSlotProps = { editor };\n\n return (\n <TooltipProvider>\n <EditorProvider editor={editor}>\n <div\n ref={forwardedRef}\n role=\"toolbar\"\n aria-label=\"Toolbar\"\n aria-orientation=\"horizontal\"\n className={classNames(\"lb-root lb-tiptap-toolbar\", className)}\n {...props}\n >\n {applyToolbarSlot(before, slotProps)}\n {applyToolbarSlot(children, slotProps)}\n {applyToolbarSlot(after, slotProps)}\n </div>\n </EditorProvider>\n </TooltipProvider>\n );\n }\n ),\n {\n Button: ToolbarButton,\n Toggle: ToolbarToggle,\n Separator: ToolbarSeparator,\n SectionHistory: ToolbarSectionHistory,\n SectionInline: ToolbarSectionInline,\n SectionCollaboration: ToolbarSectionCollaboration,\n BlockSelector: ToolbarBlockSelector,\n }\n);\n"],"names":["editor","resolvedItems","item"],"mappings":";;;;;;;;;AA0BO,MAAM,wBAA2B,GAAA,GAAA;AACjC,MAAM,kCAAqC,GAAA,GAAA;AAqClC,SAAA,gBAAA,CACd,MACA,KACW,EAAA;AACX,EAAI,IAAA,OAAO,SAAS,UAAY,EAAA;AAC9B,IAAA,MAAM,SAAY,GAAA,IAAA,CAAA;AAElB,IAAA,uBAAQ,GAAA,CAAA,SAAA,EAAA;AAAA,MAAW,GAAG,KAAA;AAAA,KAAO,CAAA,CAAA;AAAA,GAC/B;AAEA,EAAO,OAAA,IAAA,CAAA;AACT,CAAA;AAEA,MAAM,aAAgB,GAAA,UAAA;AAAA,EACpB,CAAC,EAAE,IAAM,EAAA,QAAA,E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EAAA,2BAAA;AAAA,IACtB,aAAe,EAAA,oBAAA;AAAA,GACjB;AACF;;;;"}
|
package/dist/types.js
CHANGED
|
@@ -10,24 +10,28 @@ const LIVEBLOCKS_MENTION_NOTIFIER_KEY = new state.PluginKey(
|
|
|
10
10
|
"lb-plugin-mention-notify"
|
|
11
11
|
);
|
|
12
12
|
const LIVEBLOCKS_MENTION_TYPE = "liveblocksMention";
|
|
13
|
-
const
|
|
14
|
-
"lb-active-selection-plugin"
|
|
13
|
+
const THREADS_ACTIVE_SELECTION_PLUGIN = new state.PluginKey(
|
|
14
|
+
"lb-threads-active-selection-plugin"
|
|
15
15
|
);
|
|
16
16
|
const THREADS_PLUGIN_KEY = new state.PluginKey(
|
|
17
17
|
"lb-threads-plugin"
|
|
18
18
|
);
|
|
19
|
+
const AI_TOOLBAR_SELECTION_PLUGIN = new state.PluginKey(
|
|
20
|
+
"lb-ai-toolbar-selection-plugin"
|
|
21
|
+
);
|
|
19
22
|
const LIVEBLOCKS_COMMENT_MARK_TYPE = "liveblocksCommentMark";
|
|
20
23
|
var ThreadPluginActions = /* @__PURE__ */ ((ThreadPluginActions2) => {
|
|
21
24
|
ThreadPluginActions2["SET_SELECTED_THREAD_ID"] = "SET_SELECTED_THREAD_ID";
|
|
22
25
|
return ThreadPluginActions2;
|
|
23
26
|
})(ThreadPluginActions || {});
|
|
24
27
|
|
|
25
|
-
exports.
|
|
28
|
+
exports.AI_TOOLBAR_SELECTION_PLUGIN = AI_TOOLBAR_SELECTION_PLUGIN;
|
|
26
29
|
exports.LIVEBLOCKS_COMMENT_MARK_TYPE = LIVEBLOCKS_COMMENT_MARK_TYPE;
|
|
27
30
|
exports.LIVEBLOCKS_MENTION_KEY = LIVEBLOCKS_MENTION_KEY;
|
|
28
31
|
exports.LIVEBLOCKS_MENTION_NOTIFIER_KEY = LIVEBLOCKS_MENTION_NOTIFIER_KEY;
|
|
29
32
|
exports.LIVEBLOCKS_MENTION_PASTE_KEY = LIVEBLOCKS_MENTION_PASTE_KEY;
|
|
30
33
|
exports.LIVEBLOCKS_MENTION_TYPE = LIVEBLOCKS_MENTION_TYPE;
|
|
34
|
+
exports.THREADS_ACTIVE_SELECTION_PLUGIN = THREADS_ACTIVE_SELECTION_PLUGIN;
|
|
31
35
|
exports.THREADS_PLUGIN_KEY = THREADS_PLUGIN_KEY;
|
|
32
36
|
exports.ThreadPluginActions = ThreadPluginActions;
|
|
33
37
|
//# sourceMappingURL=types.js.map
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import type { TextSelection } from \"@tiptap/pm/state\";\nimport { PluginKey } from \"@tiptap/pm/state\";\nimport type { DecorationSet } from \"@tiptap/pm/view\";\n\nexport const LIVEBLOCKS_MENTION_KEY = new PluginKey(\"lb-plugin-mention\");\nexport const LIVEBLOCKS_MENTION_PASTE_KEY = new PluginKey(\n \"lb-plugin-mention-paste\"\n);\nexport const LIVEBLOCKS_MENTION_NOTIFIER_KEY = new PluginKey(\n \"lb-plugin-mention-notify\"\n);\nexport const LIVEBLOCKS_MENTION_TYPE = \"liveblocksMention\";\n\nexport const
|
|
1
|
+
{"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import type { TextSelection } from \"@tiptap/pm/state\";\nimport { PluginKey } from \"@tiptap/pm/state\";\nimport type { DecorationSet } from \"@tiptap/pm/view\";\nimport type { ChainedCommands, SingleCommands } from \"@tiptap/react\";\n\nexport const LIVEBLOCKS_MENTION_KEY = new PluginKey(\"lb-plugin-mention\");\nexport const LIVEBLOCKS_MENTION_PASTE_KEY = new PluginKey(\n \"lb-plugin-mention-paste\"\n);\nexport const LIVEBLOCKS_MENTION_NOTIFIER_KEY = new PluginKey(\n \"lb-plugin-mention-notify\"\n);\nexport const LIVEBLOCKS_MENTION_TYPE = \"liveblocksMention\";\n\nexport const THREADS_ACTIVE_SELECTION_PLUGIN = new PluginKey(\n \"lb-threads-active-selection-plugin\"\n);\nexport const THREADS_PLUGIN_KEY = new PluginKey<ThreadPluginState>(\n \"lb-threads-plugin\"\n);\nexport const AI_TOOLBAR_SELECTION_PLUGIN = new PluginKey(\n \"lb-ai-toolbar-selection-plugin\"\n);\n\nexport const LIVEBLOCKS_COMMENT_MARK_TYPE = \"liveblocksCommentMark\";\n\nexport type CommentsExtensionStorage = {\n pendingCommentSelection: TextSelection | null;\n};\n\nexport const enum ThreadPluginActions {\n SET_SELECTED_THREAD_ID = \"SET_SELECTED_THREAD_ID\",\n}\n\nexport type LiveblocksExtensionStorage = CommentsExtensionStorage;\n\nexport type ThreadPluginState = {\n threadPositions: Map<string, { from: number; to: number }>;\n selectedThreadId: string | null;\n selectedThreadPos: number | null;\n decorations: DecorationSet;\n};\n\nexport type FloatingPosition = \"top\" | \"bottom\";\n\nexport type ExtendedCommands<\n T extends string,\n A extends any[] = [],\n> = SingleCommands & Record<T, (...args: A) => boolean>;\n\nexport type ExtendedChainedCommands<\n T extends string,\n A extends any[] = [],\n> = ChainedCommands & Record<T, (...args: A) => ChainedCommands>;\n\nexport type CommentsCommands<ReturnType> = {\n /**\n * Add a comment\n */\n addComment: (id: string) => ReturnType;\n selectThread: (id: string | null) => ReturnType;\n addPendingComment: () => ReturnType;\n /** @internal */\n closePendingComment: () => ReturnType;\n};\n"],"names":["PluginKey","ThreadPluginActions"],"mappings":";;;;AAKa,MAAA,sBAAA,GAAyB,IAAIA,eAAA,CAAU,mBAAmB,EAAA;AAChE,MAAM,+BAA+B,IAAIA,eAAA;AAAA,EAC9C,yBAAA;AACF,EAAA;AACO,MAAM,kCAAkC,IAAIA,eAAA;AAAA,EACjD,0BAAA;AACF,EAAA;AACO,MAAM,uBAA0B,GAAA,oBAAA;AAEhC,MAAM,kCAAkC,IAAIA,eAAA;AAAA,EACjD,oCAAA;AACF,EAAA;AACO,MAAM,qBAAqB,IAAIA,eAAA;AAAA,EACpC,mBAAA;AACF,EAAA;AACO,MAAM,8BAA8B,IAAIA,eAAA;AAAA,EAC7C,gCAAA;AACF,EAAA;AAEO,MAAM,4BAA+B,GAAA,wBAAA;AAM1B,IAAA,mBAAA,qBAAAC,oBAAX,KAAA;AACL,EAAAA,qBAAA,wBAAyB,CAAA,GAAA,wBAAA,CAAA;AADT,EAAAA,OAAAA,oBAAAA,CAAAA;AAAA,CAAA,EAAA,mBAAA,IAAA,EAAA;;;;;;;;;;;;"}
|
package/dist/types.mjs
CHANGED
|
@@ -8,17 +8,20 @@ const LIVEBLOCKS_MENTION_NOTIFIER_KEY = new PluginKey(
|
|
|
8
8
|
"lb-plugin-mention-notify"
|
|
9
9
|
);
|
|
10
10
|
const LIVEBLOCKS_MENTION_TYPE = "liveblocksMention";
|
|
11
|
-
const
|
|
12
|
-
"lb-active-selection-plugin"
|
|
11
|
+
const THREADS_ACTIVE_SELECTION_PLUGIN = new PluginKey(
|
|
12
|
+
"lb-threads-active-selection-plugin"
|
|
13
13
|
);
|
|
14
14
|
const THREADS_PLUGIN_KEY = new PluginKey(
|
|
15
15
|
"lb-threads-plugin"
|
|
16
16
|
);
|
|
17
|
+
const AI_TOOLBAR_SELECTION_PLUGIN = new PluginKey(
|
|
18
|
+
"lb-ai-toolbar-selection-plugin"
|
|
19
|
+
);
|
|
17
20
|
const LIVEBLOCKS_COMMENT_MARK_TYPE = "liveblocksCommentMark";
|
|
18
21
|
var ThreadPluginActions = /* @__PURE__ */ ((ThreadPluginActions2) => {
|
|
19
22
|
ThreadPluginActions2["SET_SELECTED_THREAD_ID"] = "SET_SELECTED_THREAD_ID";
|
|
20
23
|
return ThreadPluginActions2;
|
|
21
24
|
})(ThreadPluginActions || {});
|
|
22
25
|
|
|
23
|
-
export {
|
|
26
|
+
export { AI_TOOLBAR_SELECTION_PLUGIN, LIVEBLOCKS_COMMENT_MARK_TYPE, LIVEBLOCKS_MENTION_KEY, LIVEBLOCKS_MENTION_NOTIFIER_KEY, LIVEBLOCKS_MENTION_PASTE_KEY, LIVEBLOCKS_MENTION_TYPE, THREADS_ACTIVE_SELECTION_PLUGIN, THREADS_PLUGIN_KEY, ThreadPluginActions };
|
|
24
27
|
//# sourceMappingURL=types.mjs.map
|
package/dist/types.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.mjs","sources":["../src/types.ts"],"sourcesContent":["import type { TextSelection } from \"@tiptap/pm/state\";\nimport { PluginKey } from \"@tiptap/pm/state\";\nimport type { DecorationSet } from \"@tiptap/pm/view\";\n\nexport const LIVEBLOCKS_MENTION_KEY = new PluginKey(\"lb-plugin-mention\");\nexport const LIVEBLOCKS_MENTION_PASTE_KEY = new PluginKey(\n \"lb-plugin-mention-paste\"\n);\nexport const LIVEBLOCKS_MENTION_NOTIFIER_KEY = new PluginKey(\n \"lb-plugin-mention-notify\"\n);\nexport const LIVEBLOCKS_MENTION_TYPE = \"liveblocksMention\";\n\nexport const
|
|
1
|
+
{"version":3,"file":"types.mjs","sources":["../src/types.ts"],"sourcesContent":["import type { TextSelection } from \"@tiptap/pm/state\";\nimport { PluginKey } from \"@tiptap/pm/state\";\nimport type { DecorationSet } from \"@tiptap/pm/view\";\nimport type { ChainedCommands, SingleCommands } from \"@tiptap/react\";\n\nexport const LIVEBLOCKS_MENTION_KEY = new PluginKey(\"lb-plugin-mention\");\nexport const LIVEBLOCKS_MENTION_PASTE_KEY = new PluginKey(\n \"lb-plugin-mention-paste\"\n);\nexport const LIVEBLOCKS_MENTION_NOTIFIER_KEY = new PluginKey(\n \"lb-plugin-mention-notify\"\n);\nexport const LIVEBLOCKS_MENTION_TYPE = \"liveblocksMention\";\n\nexport const THREADS_ACTIVE_SELECTION_PLUGIN = new PluginKey(\n \"lb-threads-active-selection-plugin\"\n);\nexport const THREADS_PLUGIN_KEY = new PluginKey<ThreadPluginState>(\n \"lb-threads-plugin\"\n);\nexport const AI_TOOLBAR_SELECTION_PLUGIN = new PluginKey(\n \"lb-ai-toolbar-selection-plugin\"\n);\n\nexport const LIVEBLOCKS_COMMENT_MARK_TYPE = \"liveblocksCommentMark\";\n\nexport type CommentsExtensionStorage = {\n pendingCommentSelection: TextSelection | null;\n};\n\nexport const enum ThreadPluginActions {\n SET_SELECTED_THREAD_ID = \"SET_SELECTED_THREAD_ID\",\n}\n\nexport type LiveblocksExtensionStorage = CommentsExtensionStorage;\n\nexport type ThreadPluginState = {\n threadPositions: Map<string, { from: number; to: number }>;\n selectedThreadId: string | null;\n selectedThreadPos: number | null;\n decorations: DecorationSet;\n};\n\nexport type FloatingPosition = \"top\" | \"bottom\";\n\nexport type ExtendedCommands<\n T extends string,\n A extends any[] = [],\n> = SingleCommands & Record<T, (...args: A) => boolean>;\n\nexport type ExtendedChainedCommands<\n T extends string,\n A extends any[] = [],\n> = ChainedCommands & Record<T, (...args: A) => ChainedCommands>;\n\nexport type CommentsCommands<ReturnType> = {\n /**\n * Add a comment\n */\n addComment: (id: string) => ReturnType;\n selectThread: (id: string | null) => ReturnType;\n addPendingComment: () => ReturnType;\n /** @internal */\n closePendingComment: () => ReturnType;\n};\n"],"names":["ThreadPluginActions"],"mappings":";;AAKa,MAAA,sBAAA,GAAyB,IAAI,SAAA,CAAU,mBAAmB,EAAA;AAChE,MAAM,+BAA+B,IAAI,SAAA;AAAA,EAC9C,yBAAA;AACF,EAAA;AACO,MAAM,kCAAkC,IAAI,SAAA;AAAA,EACjD,0BAAA;AACF,EAAA;AACO,MAAM,uBAA0B,GAAA,oBAAA;AAEhC,MAAM,kCAAkC,IAAI,SAAA;AAAA,EACjD,oCAAA;AACF,EAAA;AACO,MAAM,qBAAqB,IAAI,SAAA;AAAA,EACpC,mBAAA;AACF,EAAA;AACO,MAAM,8BAA8B,IAAI,SAAA;AAAA,EAC7C,gCAAA;AACF,EAAA;AAEO,MAAM,4BAA+B,GAAA,wBAAA;AAM1B,IAAA,mBAAA,qBAAAA,oBAAX,KAAA;AACL,EAAAA,qBAAA,wBAAyB,CAAA,GAAA,wBAAA,CAAA;AADT,EAAAA,OAAAA,oBAAAA,CAAAA;AAAA,CAAA,EAAA,mBAAA,IAAA,EAAA;;;;"}
|
package/dist/utils.js
CHANGED
|
@@ -40,7 +40,24 @@ const mapFragment = (fragment, callback) => {
|
|
|
40
40
|
});
|
|
41
41
|
return model.Fragment.from(content);
|
|
42
42
|
};
|
|
43
|
+
function getDomRangeFromTextSelection(selection, editor) {
|
|
44
|
+
const { from, to } = selection;
|
|
45
|
+
const fromPos = editor.view.domAtPos(from);
|
|
46
|
+
const endPos = editor.view.domAtPos(to);
|
|
47
|
+
const domRange = document.createRange();
|
|
48
|
+
domRange.setStart(fromPos.node, fromPos.offset);
|
|
49
|
+
domRange.setEnd(endPos.node, endPos.offset);
|
|
50
|
+
return domRange;
|
|
51
|
+
}
|
|
52
|
+
function compareTextSelections(a, b) {
|
|
53
|
+
if (!a || !b) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
return a.eq(b);
|
|
57
|
+
}
|
|
43
58
|
|
|
59
|
+
exports.compareTextSelections = compareTextSelections;
|
|
60
|
+
exports.getDomRangeFromTextSelection = getDomRangeFromTextSelection;
|
|
44
61
|
exports.getMentionsFromNode = getMentionsFromNode;
|
|
45
62
|
exports.getRectFromCoords = getRectFromCoords;
|
|
46
63
|
exports.mapFragment = mapFragment;
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["import type { ClientRectObject } from \"@floating-ui/react-dom\";\nimport type { Range } from \"@tiptap/core\";\nimport type { Node as ProseMirrorNode } from \"@tiptap/pm/model\";\nimport { Fragment } from \"@tiptap/pm/model\";\n\nimport { LIVEBLOCKS_MENTION_TYPE } from \"./types\";\n\nexport const getRectFromCoords = (coords: {\n top: number;\n left: number;\n right: number;\n bottom: number;\n}): ClientRectObject => {\n return {\n ...coords,\n x: coords.left,\n y: coords.top,\n width: coords.right - coords.left,\n height: coords.bottom - coords.top,\n };\n};\n\nexport const getMentionsFromNode = (\n node: ProseMirrorNode,\n range: Range\n): { notificationId: string; userId: string }[] => {\n const result: { notificationId: string; userId: string }[] = [];\n node.nodesBetween(range.from, range.to, (child) => {\n if (child.type.name === LIVEBLOCKS_MENTION_TYPE) {\n const mention = child.attrs as { id?: string; notificationId?: string };\n if (mention.id && mention.notificationId) {\n result.push({\n notificationId: mention.notificationId,\n userId: mention.id,\n });\n }\n }\n });\n return result;\n};\n\n// How to modify data in transformPasted, inspired by: https://discuss.prosemirror.net/t/modify-specific-node-on-copy-and-paste-in-clipboard/4901/4\nexport const mapFragment = (\n fragment: Fragment,\n callback: (\n node: ProseMirrorNode\n ) => ProseMirrorNode | ProseMirrorNode[] | Fragment | null\n): Fragment => {\n const content: ProseMirrorNode[] = [];\n fragment.forEach((node) => {\n if (node.content.childCount > 0) {\n content.push(\n node.type.create(node.attrs, mapFragment(node.content, callback))\n );\n return;\n }\n content.push(callback(node) as ProseMirrorNode);\n });\n\n return Fragment.from(content);\n};\n"],"names":["LIVEBLOCKS_MENTION_TYPE","Fragment"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../src/utils.ts"],"sourcesContent":["import type { ClientRectObject } from \"@floating-ui/react-dom\";\nimport type { Editor, Range } from \"@tiptap/core\";\nimport type { Node as ProseMirrorNode } from \"@tiptap/pm/model\";\nimport { Fragment } from \"@tiptap/pm/model\";\nimport type { TextSelection } from \"@tiptap/pm/state\";\n\nimport { LIVEBLOCKS_MENTION_TYPE } from \"./types\";\n\nexport const getRectFromCoords = (coords: {\n top: number;\n left: number;\n right: number;\n bottom: number;\n}): ClientRectObject => {\n return {\n ...coords,\n x: coords.left,\n y: coords.top,\n width: coords.right - coords.left,\n height: coords.bottom - coords.top,\n };\n};\n\nexport const getMentionsFromNode = (\n node: ProseMirrorNode,\n range: Range\n): { notificationId: string; userId: string }[] => {\n const result: { notificationId: string; userId: string }[] = [];\n node.nodesBetween(range.from, range.to, (child) => {\n if (child.type.name === LIVEBLOCKS_MENTION_TYPE) {\n const mention = child.attrs as { id?: string; notificationId?: string };\n if (mention.id && mention.notificationId) {\n result.push({\n notificationId: mention.notificationId,\n userId: mention.id,\n });\n }\n }\n });\n return result;\n};\n\n// How to modify data in transformPasted, inspired by: https://discuss.prosemirror.net/t/modify-specific-node-on-copy-and-paste-in-clipboard/4901/4\nexport const mapFragment = (\n fragment: Fragment,\n callback: (\n node: ProseMirrorNode\n ) => ProseMirrorNode | ProseMirrorNode[] | Fragment | null\n): Fragment => {\n const content: ProseMirrorNode[] = [];\n fragment.forEach((node) => {\n if (node.content.childCount > 0) {\n content.push(\n node.type.create(node.attrs, mapFragment(node.content, callback))\n );\n return;\n }\n content.push(callback(node) as ProseMirrorNode);\n });\n\n return Fragment.from(content);\n};\n\nexport function getDomRangeFromTextSelection(\n selection: TextSelection,\n editor: Editor\n) {\n const { from, to } = selection;\n const fromPos = editor.view.domAtPos(from);\n const endPos = editor.view.domAtPos(to);\n\n const domRange = document.createRange();\n domRange.setStart(fromPos.node, fromPos.offset);\n domRange.setEnd(endPos.node, endPos.offset);\n\n return domRange;\n}\n\nexport function compareTextSelections(\n a: TextSelection | null | undefined,\n b: TextSelection | null | undefined\n) {\n if (!a || !b) {\n return false;\n }\n\n return a.eq(b);\n}\n"],"names":["LIVEBLOCKS_MENTION_TYPE","Fragment"],"mappings":";;;;;AAQa,MAAA,iBAAA,GAAoB,CAAC,MAKV,KAAA;AACtB,EAAO,OAAA;AAAA,IACL,GAAG,MAAA;AAAA,IACH,GAAG,MAAO,CAAA,IAAA;AAAA,IACV,GAAG,MAAO,CAAA,GAAA;AAAA,IACV,KAAA,EAAO,MAAO,CAAA,KAAA,GAAQ,MAAO,CAAA,IAAA;AAAA,IAC7B,MAAA,EAAQ,MAAO,CAAA,MAAA,GAAS,MAAO,CAAA,GAAA;AAAA,GACjC,CAAA;AACF,EAAA;AAEa,MAAA,mBAAA,GAAsB,CACjC,IAAA,EACA,KACiD,KAAA;AACjD,EAAA,MAAM,SAAuD,EAAC,CAAA;AAC9D,EA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,CAAS,IAAI,CAAA,CAAA;AACzC,EAAA,MAAM,MAAS,GAAA,MAAA,CAAO,IAAK,CAAA,QAAA,CAAS,EAAE,CAAA,CAAA;AAEtC,EAAM,MAAA,QAAA,GAAW,SAAS,WAAY,EAAA,CAAA;AACtC,EAAA,QAAA,CAAS,QAAS,CAAA,OAAA,CAAQ,IAAM,EAAA,OAAA,CAAQ,MAAM,CAAA,CAAA;AAC9C,EAAA,QAAA,CAAS,MAAO,CAAA,MAAA,CAAO,IAAM,EAAA,MAAA,CAAO,MAAM,CAAA,CAAA;AAE1C,EAAO,OAAA,QAAA,CAAA;AACT,CAAA;AAEgB,SAAA,qBAAA,CACd,GACA,CACA,EAAA;AACA,EAAI,IAAA,CAAC,CAAK,IAAA,CAAC,CAAG,EAAA;AACZ,IAAO,OAAA,KAAA,CAAA;AAAA,GACT;AAEA,EAAO,OAAA,CAAA,CAAE,GAAG,CAAC,CAAA,CAAA;AACf;;;;;;;;"}
|
package/dist/utils.mjs
CHANGED
|
@@ -38,6 +38,21 @@ const mapFragment = (fragment, callback) => {
|
|
|
38
38
|
});
|
|
39
39
|
return Fragment.from(content);
|
|
40
40
|
};
|
|
41
|
+
function getDomRangeFromTextSelection(selection, editor) {
|
|
42
|
+
const { from, to } = selection;
|
|
43
|
+
const fromPos = editor.view.domAtPos(from);
|
|
44
|
+
const endPos = editor.view.domAtPos(to);
|
|
45
|
+
const domRange = document.createRange();
|
|
46
|
+
domRange.setStart(fromPos.node, fromPos.offset);
|
|
47
|
+
domRange.setEnd(endPos.node, endPos.offset);
|
|
48
|
+
return domRange;
|
|
49
|
+
}
|
|
50
|
+
function compareTextSelections(a, b) {
|
|
51
|
+
if (!a || !b) {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
return a.eq(b);
|
|
55
|
+
}
|
|
41
56
|
|
|
42
|
-
export { getMentionsFromNode, getRectFromCoords, mapFragment };
|
|
57
|
+
export { compareTextSelections, getDomRangeFromTextSelection, getMentionsFromNode, getRectFromCoords, mapFragment };
|
|
43
58
|
//# sourceMappingURL=utils.mjs.map
|
package/dist/utils.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.mjs","sources":["../src/utils.ts"],"sourcesContent":["import type { ClientRectObject } from \"@floating-ui/react-dom\";\nimport type { Range } from \"@tiptap/core\";\nimport type { Node as ProseMirrorNode } from \"@tiptap/pm/model\";\nimport { Fragment } from \"@tiptap/pm/model\";\n\nimport { LIVEBLOCKS_MENTION_TYPE } from \"./types\";\n\nexport const getRectFromCoords = (coords: {\n top: number;\n left: number;\n right: number;\n bottom: number;\n}): ClientRectObject => {\n return {\n ...coords,\n x: coords.left,\n y: coords.top,\n width: coords.right - coords.left,\n height: coords.bottom - coords.top,\n };\n};\n\nexport const getMentionsFromNode = (\n node: ProseMirrorNode,\n range: Range\n): { notificationId: string; userId: string }[] => {\n const result: { notificationId: string; userId: string }[] = [];\n node.nodesBetween(range.from, range.to, (child) => {\n if (child.type.name === LIVEBLOCKS_MENTION_TYPE) {\n const mention = child.attrs as { id?: string; notificationId?: string };\n if (mention.id && mention.notificationId) {\n result.push({\n notificationId: mention.notificationId,\n userId: mention.id,\n });\n }\n }\n });\n return result;\n};\n\n// How to modify data in transformPasted, inspired by: https://discuss.prosemirror.net/t/modify-specific-node-on-copy-and-paste-in-clipboard/4901/4\nexport const mapFragment = (\n fragment: Fragment,\n callback: (\n node: ProseMirrorNode\n ) => ProseMirrorNode | ProseMirrorNode[] | Fragment | null\n): Fragment => {\n const content: ProseMirrorNode[] = [];\n fragment.forEach((node) => {\n if (node.content.childCount > 0) {\n content.push(\n node.type.create(node.attrs, mapFragment(node.content, callback))\n );\n return;\n }\n content.push(callback(node) as ProseMirrorNode);\n });\n\n return Fragment.from(content);\n};\n"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"utils.mjs","sources":["../src/utils.ts"],"sourcesContent":["import type { ClientRectObject } from \"@floating-ui/react-dom\";\nimport type { Editor, Range } from \"@tiptap/core\";\nimport type { Node as ProseMirrorNode } from \"@tiptap/pm/model\";\nimport { Fragment } from \"@tiptap/pm/model\";\nimport type { TextSelection } from \"@tiptap/pm/state\";\n\nimport { LIVEBLOCKS_MENTION_TYPE } from \"./types\";\n\nexport const getRectFromCoords = (coords: {\n top: number;\n left: number;\n right: number;\n bottom: number;\n}): ClientRectObject => {\n return {\n ...coords,\n x: coords.left,\n y: coords.top,\n width: coords.right - coords.left,\n height: coords.bottom - coords.top,\n };\n};\n\nexport const getMentionsFromNode = (\n node: ProseMirrorNode,\n range: Range\n): { notificationId: string; userId: string }[] => {\n const result: { notificationId: string; userId: string }[] = [];\n node.nodesBetween(range.from, range.to, (child) => {\n if (child.type.name === LIVEBLOCKS_MENTION_TYPE) {\n const mention = child.attrs as { id?: string; notificationId?: string };\n if (mention.id && mention.notificationId) {\n result.push({\n notificationId: mention.notificationId,\n userId: mention.id,\n });\n }\n }\n });\n return result;\n};\n\n// How to modify data in transformPasted, inspired by: https://discuss.prosemirror.net/t/modify-specific-node-on-copy-and-paste-in-clipboard/4901/4\nexport const mapFragment = (\n fragment: Fragment,\n callback: (\n node: ProseMirrorNode\n ) => ProseMirrorNode | ProseMirrorNode[] | Fragment | null\n): Fragment => {\n const content: ProseMirrorNode[] = [];\n fragment.forEach((node) => {\n if (node.content.childCount > 0) {\n content.push(\n node.type.create(node.attrs, mapFragment(node.content, callback))\n );\n return;\n }\n content.push(callback(node) as ProseMirrorNode);\n });\n\n return Fragment.from(content);\n};\n\nexport function getDomRangeFromTextSelection(\n selection: TextSelection,\n editor: Editor\n) {\n const { from, to } = selection;\n const fromPos = editor.view.domAtPos(from);\n const endPos = editor.view.domAtPos(to);\n\n const domRange = document.createRange();\n domRange.setStart(fromPos.node, fromPos.offset);\n domRange.setEnd(endPos.node, endPos.offset);\n\n return domRange;\n}\n\nexport function compareTextSelections(\n a: TextSelection | null | undefined,\n b: TextSelection | null | undefined\n) {\n if (!a || !b) {\n return false;\n }\n\n return a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