@liveblocks/react-tiptap 2.15.2 → 2.16.0-toolbars2
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 +67 -13
- package/dist/index.d.ts +67 -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 +326 -0
- package/dist/toolbar/FloatingToolbar.js.map +1 -0
- package/dist/toolbar/FloatingToolbar.mjs +323 -0
- package/dist/toolbar/FloatingToolbar.mjs.map +1 -0
- package/dist/toolbar/Toolbar.js +354 -0
- package/dist/toolbar/Toolbar.js.map +1 -0
- package/dist/toolbar/Toolbar.mjs +329 -0
- package/dist/toolbar/Toolbar.mjs.map +1 -0
- package/dist/toolbar/shared.js +39 -0
- package/dist/toolbar/shared.js.map +1 -0
- package/dist/toolbar/shared.mjs +36 -0
- package/dist/toolbar/shared.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
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.eq(b);\n}\n"],"names":[],"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,EAAA,IAAA,CAAK,aAAa,KAAM,CAAA,IAAA,EAAM,KAAM,CAAA,EAAA,EAAI,CAAC,KAAU,KAAA;AACjD,IAAI,IAAA,KAAA,CAAM,IAAK,CAAA,IAAA,KAAS,uBAAyB,EAAA;AAC/C,MAAA,MAAM,UAAU,KAAM,CAAA,KAAA,CAAA;AACtB,MAAI,IAAA,OAAA,CAAQ,EAAM,IAAA,OAAA,CAAQ,cAAgB,EAAA;AACxC,QAAA,MAAA,CAAO,IAAK,CAAA;AAAA,UACV,gBAAgB,OAAQ,CAAA,cAAA;AAAA,UACxB,QAAQ,OAAQ,CAAA,EAAA;AAAA,SACjB,CAAA,CAAA;AAAA,OACH;AAAA,KACF;AAAA,GACD,CAAA,CAAA;AACD,EAAO,OAAA,MAAA,CAAA;AACT,EAAA;AAGa,MAAA,WAAA,GAAc,CACzB,QAAA,EACA,QAGa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CAAA,CAAE,GAAG,CAAC,CAAA,CAAA;AACf;;;;"}
|
|
@@ -11,87 +11,87 @@ var yjs = require('yjs');
|
|
|
11
11
|
var classnames = require('../classnames.js');
|
|
12
12
|
|
|
13
13
|
const AUTHORS_TRUNCATE = 3;
|
|
14
|
-
const HistoryVersionPreview = react.forwardRef(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
)
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
onClick: restore,
|
|
75
|
-
disabled: !data,
|
|
76
|
-
variant: "primary",
|
|
77
|
-
size: "large",
|
|
78
|
-
className: "lb-history-version-preview-action",
|
|
79
|
-
children: [
|
|
80
|
-
/* @__PURE__ */ jsxRuntime.jsx(_private.RestoreIcon, {
|
|
81
|
-
className: "lb-button-icon"
|
|
82
|
-
}),
|
|
83
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", {
|
|
84
|
-
className: "lb-button-label",
|
|
85
|
-
children: $.HISTORY_VERSION_PREVIEW_RESTORE
|
|
14
|
+
const HistoryVersionPreview = react.forwardRef(
|
|
15
|
+
({ version, editor: parentEditor, onVersionRestore, className, ...props }, forwardedRef) => {
|
|
16
|
+
const $ = reactUi.useOverrides();
|
|
17
|
+
const { isLoading, data, error } = react$1.useHistoryVersionData(version.id);
|
|
18
|
+
const previewEditor = react$2.useEditor({
|
|
19
|
+
editable: false,
|
|
20
|
+
extensions: parentEditor.extensionManager.extensions.filter(
|
|
21
|
+
(e) => e.type !== "extension"
|
|
22
|
+
)
|
|
23
|
+
});
|
|
24
|
+
react.useEffect(() => {
|
|
25
|
+
if (data && previewEditor) {
|
|
26
|
+
const doc = new yjs.Doc();
|
|
27
|
+
yjs.applyUpdate(doc, data);
|
|
28
|
+
const root = doc.getXmlFragment("default");
|
|
29
|
+
const node = yProsemirror.yXmlFragmentToProseMirrorRootNode(
|
|
30
|
+
root,
|
|
31
|
+
parentEditor.schema
|
|
32
|
+
);
|
|
33
|
+
previewEditor.commands.setContent(node.toJSON());
|
|
34
|
+
}
|
|
35
|
+
}, [data, previewEditor, parentEditor]);
|
|
36
|
+
const restore = react.useCallback(() => {
|
|
37
|
+
parentEditor.commands.setContent(previewEditor?.getJSON() ?? "");
|
|
38
|
+
onVersionRestore?.(version);
|
|
39
|
+
}, [onVersionRestore, parentEditor, previewEditor, version]);
|
|
40
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
41
|
+
...props,
|
|
42
|
+
className: classnames.classNames(
|
|
43
|
+
"lb-root lb-history-version-preview lb-tiptap-version-preview",
|
|
44
|
+
className
|
|
45
|
+
),
|
|
46
|
+
ref: forwardedRef,
|
|
47
|
+
children: [
|
|
48
|
+
isLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
49
|
+
className: "lb-loading lb-history-version-preview-loading",
|
|
50
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(_private.SpinnerIcon, {})
|
|
51
|
+
}) : error ? /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
52
|
+
className: "lb-error lb-history-version-preview-error",
|
|
53
|
+
children: $.HISTORY_VERSION_PREVIEW_ERROR(error)
|
|
54
|
+
}) : /* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
55
|
+
className: "lb-history-version-preview-content lb-tiptap-editor-container lb-tiptap-version-preview-editor-container",
|
|
56
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(react$2.EditorContent, {
|
|
57
|
+
editor: previewEditor
|
|
58
|
+
})
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", {
|
|
61
|
+
className: "lb-history-version-preview-footer",
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", {
|
|
64
|
+
className: "lb-history-version-preview-authors",
|
|
65
|
+
children: $.HISTORY_VERSION_PREVIEW_AUTHORS_LIST(
|
|
66
|
+
/* @__PURE__ */ jsxRuntime.jsx(_private.List, {
|
|
67
|
+
values: version.authors.map((author) => /* @__PURE__ */ jsxRuntime.jsx(_private.User, {
|
|
68
|
+
userId: author.id,
|
|
69
|
+
replaceSelf: true
|
|
70
|
+
}, author.id)),
|
|
71
|
+
formatRemaining: $.LIST_REMAINING_USERS,
|
|
72
|
+
truncate: AUTHORS_TRUNCATE,
|
|
73
|
+
locale: $.locale
|
|
86
74
|
})
|
|
87
|
-
|
|
75
|
+
)
|
|
76
|
+
}),
|
|
77
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", {
|
|
78
|
+
className: "lb-history-version-preview-actions",
|
|
79
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(_private.Button, {
|
|
80
|
+
onClick: restore,
|
|
81
|
+
disabled: !data,
|
|
82
|
+
variant: "primary",
|
|
83
|
+
size: "large",
|
|
84
|
+
className: "lb-history-version-preview-action",
|
|
85
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(_private.RestoreIcon, {}),
|
|
86
|
+
children: $.HISTORY_VERSION_PREVIEW_RESTORE
|
|
87
|
+
})
|
|
88
88
|
})
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
89
|
+
]
|
|
90
|
+
})
|
|
91
|
+
]
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
);
|
|
95
95
|
|
|
96
96
|
exports.HistoryVersionPreview = HistoryVersionPreview;
|
|
97
97
|
//# sourceMappingURL=HistoryVersionPreview.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HistoryVersionPreview.js","sources":["../../src/version-history/HistoryVersionPreview.tsx"],"sourcesContent":["import type { HistoryVersion } from \"@liveblocks/core\";\nimport { useHistoryVersionData } from \"@liveblocks/react\";\nimport { useOverrides } from \"@liveblocks/react-ui\";\nimport {\n Button,\n List,\n RestoreIcon,\n SpinnerIcon,\n User,\n} from \"@liveblocks/react-ui/_private\";\nimport type { Content, Editor } from \"@tiptap/react\";\nimport { EditorContent, useEditor } from \"@tiptap/react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { forwardRef, useCallback, useEffect } from \"react\";\nimport { yXmlFragmentToProseMirrorRootNode } from \"y-prosemirror\";\nimport { applyUpdate, Doc } from \"yjs\";\n\nimport { classNames } from \"../classnames\";\n\nconst AUTHORS_TRUNCATE = 3;\n\nexport interface HistoryVersionPreviewProps\n extends ComponentPropsWithoutRef<\"div\"> {\n version: HistoryVersion;\n editor: Editor;\n onVersionRestore?: (version: HistoryVersion) => void;\n}\n\n/**\n * Displays a specific version of the current TipTap document.\n *\n * @example\n * <HistoryVersionPreview version={version} />\n */\nexport const HistoryVersionPreview = forwardRef<\n HTMLDivElement,\n HistoryVersionPreviewProps\n>(({ version, editor: parentEditor, onVersionRestore, className, ...props }
|
|
1
|
+
{"version":3,"file":"HistoryVersionPreview.js","sources":["../../src/version-history/HistoryVersionPreview.tsx"],"sourcesContent":["import type { HistoryVersion } from \"@liveblocks/core\";\nimport { useHistoryVersionData } from \"@liveblocks/react\";\nimport { useOverrides } from \"@liveblocks/react-ui\";\nimport {\n Button,\n List,\n RestoreIcon,\n SpinnerIcon,\n User,\n} from \"@liveblocks/react-ui/_private\";\nimport type { Content, Editor } from \"@tiptap/react\";\nimport { EditorContent, useEditor } from \"@tiptap/react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { forwardRef, useCallback, useEffect } from \"react\";\nimport { yXmlFragmentToProseMirrorRootNode } from \"y-prosemirror\";\nimport { applyUpdate, Doc } from \"yjs\";\n\nimport { classNames } from \"../classnames\";\n\nconst AUTHORS_TRUNCATE = 3;\n\nexport interface HistoryVersionPreviewProps\n extends ComponentPropsWithoutRef<\"div\"> {\n version: HistoryVersion;\n editor: Editor;\n onVersionRestore?: (version: HistoryVersion) => void;\n}\n\n/**\n * Displays a specific version of the current TipTap document.\n *\n * @example\n * <HistoryVersionPreview version={version} />\n */\nexport const HistoryVersionPreview = forwardRef<\n HTMLDivElement,\n HistoryVersionPreviewProps\n>(\n (\n { version, editor: parentEditor, onVersionRestore, className, ...props },\n forwardedRef\n ) => {\n const $ = useOverrides();\n const { isLoading, data, error } = useHistoryVersionData(version.id);\n\n const previewEditor = useEditor({\n // ignore extensions, only get marks/nodes\n editable: false,\n extensions: parentEditor.extensionManager.extensions.filter(\n (e) => e.type !== \"extension\"\n ),\n });\n useEffect(() => {\n if (data && previewEditor) {\n const doc = new Doc();\n applyUpdate(doc, data);\n const root = doc.getXmlFragment(\"default\"); // TODO: lookup field\n const node = yXmlFragmentToProseMirrorRootNode(\n root,\n parentEditor.schema\n );\n previewEditor.commands.setContent(node.toJSON() as Content);\n }\n }, [data, previewEditor, parentEditor]);\n const restore = useCallback(() => {\n parentEditor.commands.setContent(previewEditor?.getJSON() ?? \"\");\n onVersionRestore?.(version);\n }, [onVersionRestore, parentEditor, previewEditor, version]);\n\n return (\n <div\n {...props}\n className={classNames(\n \"lb-root lb-history-version-preview lb-tiptap-version-preview\",\n className\n )}\n ref={forwardedRef}\n >\n {isLoading ? (\n <div className=\"lb-loading lb-history-version-preview-loading\">\n <SpinnerIcon />\n </div>\n ) : error ? (\n <div className=\"lb-error lb-history-version-preview-error\">\n {$.HISTORY_VERSION_PREVIEW_ERROR(error)}\n </div>\n ) : (\n <div className=\"lb-history-version-preview-content lb-tiptap-editor-container lb-tiptap-version-preview-editor-container\">\n <EditorContent editor={previewEditor} />\n </div>\n )}\n <div className=\"lb-history-version-preview-footer\">\n <span className=\"lb-history-version-preview-authors\">\n {$.HISTORY_VERSION_PREVIEW_AUTHORS_LIST(\n <List\n values={version.authors.map((author) => (\n <User key={author.id} userId={author.id} replaceSelf />\n ))}\n formatRemaining={$.LIST_REMAINING_USERS}\n truncate={AUTHORS_TRUNCATE}\n locale={$.locale}\n />\n )}\n </span>\n <div className=\"lb-history-version-preview-actions\">\n <Button\n onClick={restore}\n disabled={!data}\n variant=\"primary\"\n size=\"large\"\n className=\"lb-history-version-preview-action\"\n icon={<RestoreIcon />}\n >\n {$.HISTORY_VERSION_PREVIEW_RESTORE}\n </Button>\n </div>\n </div>\n </div>\n );\n }\n);\n"],"names":["forwardRef","useOverrides","useHistoryVersionData","useEditor","useEffect","Doc","applyUpdate","yXmlFragmentToProseMirrorRootNode","useCallback","jsxs","classNames","jsx","SpinnerIcon","EditorContent","List","User","Button","RestoreIcon"],"mappings":";;;;;;;;;;;;AAmBA,MAAM,gBAAmB,GAAA,CAAA,CAAA;AAelB,MAAM,qBAAwB,GAAAA,gBAAA;AAAA,EAInC,CACE,EAAE,OAAS,EAAA,MAAA,EAAQ,cAAc,gBAAkB,EAAA,SAAA,EAAA,GAAc,KAAM,EAAA,EACvE,YACG,KAAA;AACH,IAAA,MAAM,IAAIC,oBAAa,EAAA,CAAA;AACvB,IAAA,MAAM,EAAE,SAAW,EAAA,IAAA,EAAM,OAAU,GAAAC,6BAAA,CAAsB,QAAQ,EAAE,CAAA,CAAA;AAEnE,IAAA,MAAM,gBAAgBC,iBAAU,CAAA;AAAA,MAE9B,QAA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,OAAA;AAAA,gBACL,SAAU,EAAA,mCAAA;AAAA,gBACV,IAAA,iCAAOC,oBAAY,EAAA,EAAA,CAAA;AAAA,gBAElB,QAAE,EAAA,CAAA,CAAA,+BAAA;AAAA,eACL,CAAA;AAAA,aACF,CAAA;AAAA,WAAA;AAAA,SACF,CAAA;AAAA,OAAA;AAAA,KACF,CAAA,CAAA;AAAA,GAEJ;AACF;;;;"}
|
|
@@ -9,87 +9,87 @@ import { Doc, applyUpdate } from 'yjs';
|
|
|
9
9
|
import { classNames } from '../classnames.mjs';
|
|
10
10
|
|
|
11
11
|
const AUTHORS_TRUNCATE = 3;
|
|
12
|
-
const HistoryVersionPreview = forwardRef(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
onClick: restore,
|
|
73
|
-
disabled: !data,
|
|
74
|
-
variant: "primary",
|
|
75
|
-
size: "large",
|
|
76
|
-
className: "lb-history-version-preview-action",
|
|
77
|
-
children: [
|
|
78
|
-
/* @__PURE__ */ jsx(RestoreIcon, {
|
|
79
|
-
className: "lb-button-icon"
|
|
80
|
-
}),
|
|
81
|
-
/* @__PURE__ */ jsx("span", {
|
|
82
|
-
className: "lb-button-label",
|
|
83
|
-
children: $.HISTORY_VERSION_PREVIEW_RESTORE
|
|
12
|
+
const HistoryVersionPreview = forwardRef(
|
|
13
|
+
({ version, editor: parentEditor, onVersionRestore, className, ...props }, forwardedRef) => {
|
|
14
|
+
const $ = useOverrides();
|
|
15
|
+
const { isLoading, data, error } = useHistoryVersionData(version.id);
|
|
16
|
+
const previewEditor = useEditor({
|
|
17
|
+
editable: false,
|
|
18
|
+
extensions: parentEditor.extensionManager.extensions.filter(
|
|
19
|
+
(e) => e.type !== "extension"
|
|
20
|
+
)
|
|
21
|
+
});
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (data && previewEditor) {
|
|
24
|
+
const doc = new Doc();
|
|
25
|
+
applyUpdate(doc, data);
|
|
26
|
+
const root = doc.getXmlFragment("default");
|
|
27
|
+
const node = yXmlFragmentToProseMirrorRootNode(
|
|
28
|
+
root,
|
|
29
|
+
parentEditor.schema
|
|
30
|
+
);
|
|
31
|
+
previewEditor.commands.setContent(node.toJSON());
|
|
32
|
+
}
|
|
33
|
+
}, [data, previewEditor, parentEditor]);
|
|
34
|
+
const restore = useCallback(() => {
|
|
35
|
+
parentEditor.commands.setContent(previewEditor?.getJSON() ?? "");
|
|
36
|
+
onVersionRestore?.(version);
|
|
37
|
+
}, [onVersionRestore, parentEditor, previewEditor, version]);
|
|
38
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
39
|
+
...props,
|
|
40
|
+
className: classNames(
|
|
41
|
+
"lb-root lb-history-version-preview lb-tiptap-version-preview",
|
|
42
|
+
className
|
|
43
|
+
),
|
|
44
|
+
ref: forwardedRef,
|
|
45
|
+
children: [
|
|
46
|
+
isLoading ? /* @__PURE__ */ jsx("div", {
|
|
47
|
+
className: "lb-loading lb-history-version-preview-loading",
|
|
48
|
+
children: /* @__PURE__ */ jsx(SpinnerIcon, {})
|
|
49
|
+
}) : error ? /* @__PURE__ */ jsx("div", {
|
|
50
|
+
className: "lb-error lb-history-version-preview-error",
|
|
51
|
+
children: $.HISTORY_VERSION_PREVIEW_ERROR(error)
|
|
52
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
53
|
+
className: "lb-history-version-preview-content lb-tiptap-editor-container lb-tiptap-version-preview-editor-container",
|
|
54
|
+
children: /* @__PURE__ */ jsx(EditorContent, {
|
|
55
|
+
editor: previewEditor
|
|
56
|
+
})
|
|
57
|
+
}),
|
|
58
|
+
/* @__PURE__ */ jsxs("div", {
|
|
59
|
+
className: "lb-history-version-preview-footer",
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ jsx("span", {
|
|
62
|
+
className: "lb-history-version-preview-authors",
|
|
63
|
+
children: $.HISTORY_VERSION_PREVIEW_AUTHORS_LIST(
|
|
64
|
+
/* @__PURE__ */ jsx(List, {
|
|
65
|
+
values: version.authors.map((author) => /* @__PURE__ */ jsx(User, {
|
|
66
|
+
userId: author.id,
|
|
67
|
+
replaceSelf: true
|
|
68
|
+
}, author.id)),
|
|
69
|
+
formatRemaining: $.LIST_REMAINING_USERS,
|
|
70
|
+
truncate: AUTHORS_TRUNCATE,
|
|
71
|
+
locale: $.locale
|
|
84
72
|
})
|
|
85
|
-
|
|
73
|
+
)
|
|
74
|
+
}),
|
|
75
|
+
/* @__PURE__ */ jsx("div", {
|
|
76
|
+
className: "lb-history-version-preview-actions",
|
|
77
|
+
children: /* @__PURE__ */ jsx(Button, {
|
|
78
|
+
onClick: restore,
|
|
79
|
+
disabled: !data,
|
|
80
|
+
variant: "primary",
|
|
81
|
+
size: "large",
|
|
82
|
+
className: "lb-history-version-preview-action",
|
|
83
|
+
icon: /* @__PURE__ */ jsx(RestoreIcon, {}),
|
|
84
|
+
children: $.HISTORY_VERSION_PREVIEW_RESTORE
|
|
85
|
+
})
|
|
86
86
|
})
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
87
|
+
]
|
|
88
|
+
})
|
|
89
|
+
]
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
);
|
|
93
93
|
|
|
94
94
|
export { HistoryVersionPreview };
|
|
95
95
|
//# sourceMappingURL=HistoryVersionPreview.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HistoryVersionPreview.mjs","sources":["../../src/version-history/HistoryVersionPreview.tsx"],"sourcesContent":["import type { HistoryVersion } from \"@liveblocks/core\";\nimport { useHistoryVersionData } from \"@liveblocks/react\";\nimport { useOverrides } from \"@liveblocks/react-ui\";\nimport {\n Button,\n List,\n RestoreIcon,\n SpinnerIcon,\n User,\n} from \"@liveblocks/react-ui/_private\";\nimport type { Content, Editor } from \"@tiptap/react\";\nimport { EditorContent, useEditor } from \"@tiptap/react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { forwardRef, useCallback, useEffect } from \"react\";\nimport { yXmlFragmentToProseMirrorRootNode } from \"y-prosemirror\";\nimport { applyUpdate, Doc } from \"yjs\";\n\nimport { classNames } from \"../classnames\";\n\nconst AUTHORS_TRUNCATE = 3;\n\nexport interface HistoryVersionPreviewProps\n extends ComponentPropsWithoutRef<\"div\"> {\n version: HistoryVersion;\n editor: Editor;\n onVersionRestore?: (version: HistoryVersion) => void;\n}\n\n/**\n * Displays a specific version of the current TipTap document.\n *\n * @example\n * <HistoryVersionPreview version={version} />\n */\nexport const HistoryVersionPreview = forwardRef<\n HTMLDivElement,\n HistoryVersionPreviewProps\n>(({ version, editor: parentEditor, onVersionRestore, className, ...props }
|
|
1
|
+
{"version":3,"file":"HistoryVersionPreview.mjs","sources":["../../src/version-history/HistoryVersionPreview.tsx"],"sourcesContent":["import type { HistoryVersion } from \"@liveblocks/core\";\nimport { useHistoryVersionData } from \"@liveblocks/react\";\nimport { useOverrides } from \"@liveblocks/react-ui\";\nimport {\n Button,\n List,\n RestoreIcon,\n SpinnerIcon,\n User,\n} from \"@liveblocks/react-ui/_private\";\nimport type { Content, Editor } from \"@tiptap/react\";\nimport { EditorContent, useEditor } from \"@tiptap/react\";\nimport type { ComponentPropsWithoutRef } from \"react\";\nimport { forwardRef, useCallback, useEffect } from \"react\";\nimport { yXmlFragmentToProseMirrorRootNode } from \"y-prosemirror\";\nimport { applyUpdate, Doc } from \"yjs\";\n\nimport { classNames } from \"../classnames\";\n\nconst AUTHORS_TRUNCATE = 3;\n\nexport interface HistoryVersionPreviewProps\n extends ComponentPropsWithoutRef<\"div\"> {\n version: HistoryVersion;\n editor: Editor;\n onVersionRestore?: (version: HistoryVersion) => void;\n}\n\n/**\n * Displays a specific version of the current TipTap document.\n *\n * @example\n * <HistoryVersionPreview version={version} />\n */\nexport const HistoryVersionPreview = forwardRef<\n HTMLDivElement,\n HistoryVersionPreviewProps\n>(\n (\n { version, editor: parentEditor, onVersionRestore, className, ...props },\n forwardedRef\n ) => {\n const $ = useOverrides();\n const { isLoading, data, error } = useHistoryVersionData(version.id);\n\n const previewEditor = useEditor({\n // ignore extensions, only get marks/nodes\n editable: false,\n extensions: parentEditor.extensionManager.extensions.filter(\n (e) => e.type !== \"extension\"\n ),\n });\n useEffect(() => {\n if (data && previewEditor) {\n const doc = new Doc();\n applyUpdate(doc, data);\n const root = doc.getXmlFragment(\"default\"); // TODO: lookup field\n const node = yXmlFragmentToProseMirrorRootNode(\n root,\n parentEditor.schema\n );\n previewEditor.commands.setContent(node.toJSON() as Content);\n }\n }, [data, previewEditor, parentEditor]);\n const restore = useCallback(() => {\n parentEditor.commands.setContent(previewEditor?.getJSON() ?? \"\");\n onVersionRestore?.(version);\n }, [onVersionRestore, parentEditor, previewEditor, version]);\n\n return (\n <div\n {...props}\n className={classNames(\n \"lb-root lb-history-version-preview lb-tiptap-version-preview\",\n className\n )}\n ref={forwardedRef}\n >\n {isLoading ? (\n <div className=\"lb-loading lb-history-version-preview-loading\">\n <SpinnerIcon />\n </div>\n ) : error ? (\n <div className=\"lb-error lb-history-version-preview-error\">\n {$.HISTORY_VERSION_PREVIEW_ERROR(error)}\n </div>\n ) : (\n <div className=\"lb-history-version-preview-content lb-tiptap-editor-container lb-tiptap-version-preview-editor-container\">\n <EditorContent editor={previewEditor} />\n </div>\n )}\n <div className=\"lb-history-version-preview-footer\">\n <span className=\"lb-history-version-preview-authors\">\n {$.HISTORY_VERSION_PREVIEW_AUTHORS_LIST(\n <List\n values={version.authors.map((author) => (\n <User key={author.id} userId={author.id} replaceSelf />\n ))}\n formatRemaining={$.LIST_REMAINING_USERS}\n truncate={AUTHORS_TRUNCATE}\n locale={$.locale}\n />\n )}\n </span>\n <div className=\"lb-history-version-preview-actions\">\n <Button\n onClick={restore}\n disabled={!data}\n variant=\"primary\"\n size=\"large\"\n className=\"lb-history-version-preview-action\"\n icon={<RestoreIcon />}\n >\n {$.HISTORY_VERSION_PREVIEW_RESTORE}\n </Button>\n </div>\n </div>\n </div>\n );\n }\n);\n"],"names":[],"mappings":";;;;;;;;;;AAmBA,MAAM,gBAAmB,GAAA,CAAA,CAAA;AAelB,MAAM,qBAAwB,GAAA,UAAA;AAAA,EAInC,CACE,EAAE,OAAS,EAAA,MAAA,EAAQ,cAAc,gBAAkB,EAAA,SAAA,EAAA,GAAc,KAAM,EAAA,EACvE,YACG,KAAA;AACH,IAAA,MAAM,IAAI,YAAa,EAAA,CAAA;AACvB,IAAA,MAAM,EAAE,SAAW,EAAA,IAAA,EAAM,OAAU,GAAA,qBAAA,CAAsB,QAAQ,EAAE,CAAA,CAAA;AAEnE,IAAA,MAAM,gBAAgB,SAAU,CAAA;AAAA,MAE9B,QAAU,EAAA,KAAA;AAAA,MACV,UAAA,EAAY,YAAa,CAAA,gBAAA,CAAiB,UAAW,CAAA,MAAA;AAAA,QACnD,CAAC,CAAM,KAAA,CAAA,CAAE,IAAS,KAAA,WAAA;AAAA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AAAA,SACF,CAAA;AAAA,OAAA;AAAA,KACF,CAAA,CAAA;AAAA,GAEJ;AACF;;;;"}
|
package/dist/version.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const PKG_NAME = "@liveblocks/react-tiptap";
|
|
4
|
-
const PKG_VERSION = typeof "2.
|
|
4
|
+
const PKG_VERSION = typeof "2.16.0-toolbars2" === "string" && "2.16.0-toolbars2";
|
|
5
5
|
const PKG_FORMAT = typeof "cjs" === "string" && "cjs";
|
|
6
6
|
|
|
7
7
|
exports.PKG_FORMAT = PKG_FORMAT;
|
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../src/version.ts"],"sourcesContent":["declare const __VERSION__: string;\ndeclare const ROLLUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react-tiptap\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof ROLLUP_FORMAT === \"string\" && ROLLUP_FORMAT;\n"],"names":[],"mappings":";;AAGO,MAAM,QAAW,GAAA,2BAAA;AACX,MAAA,WAAA,GAAc,OAAO,
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../src/version.ts"],"sourcesContent":["declare const __VERSION__: string;\ndeclare const ROLLUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react-tiptap\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof ROLLUP_FORMAT === \"string\" && ROLLUP_FORMAT;\n"],"names":[],"mappings":";;AAGO,MAAM,QAAW,GAAA,2BAAA;AACX,MAAA,WAAA,GAAc,OAAO,kBAAA,KAAgB,QAAY,IAAA,mBAAA;AACjD,MAAA,UAAA,GAAa,OAAO,KAAA,KAAkB,QAAY,IAAA;;;;;;"}
|
package/dist/version.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const PKG_NAME = "@liveblocks/react-tiptap";
|
|
2
|
-
const PKG_VERSION = typeof "2.
|
|
2
|
+
const PKG_VERSION = typeof "2.16.0-toolbars2" === "string" && "2.16.0-toolbars2";
|
|
3
3
|
const PKG_FORMAT = typeof "esm" === "string" && "esm";
|
|
4
4
|
|
|
5
5
|
export { PKG_FORMAT, PKG_NAME, PKG_VERSION };
|
package/dist/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../src/version.ts"],"sourcesContent":["declare const __VERSION__: string;\ndeclare const ROLLUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react-tiptap\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof ROLLUP_FORMAT === \"string\" && ROLLUP_FORMAT;\n"],"names":[],"mappings":"AAGO,MAAM,QAAW,GAAA,2BAAA;AACX,MAAA,WAAA,GAAc,OAAO,
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../src/version.ts"],"sourcesContent":["declare const __VERSION__: string;\ndeclare const ROLLUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react-tiptap\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof ROLLUP_FORMAT === \"string\" && ROLLUP_FORMAT;\n"],"names":[],"mappings":"AAGO,MAAM,QAAW,GAAA,2BAAA;AACX,MAAA,WAAA,GAAc,OAAO,kBAAA,KAAgB,QAAY,IAAA,mBAAA;AACjD,MAAA,UAAA,GAAa,OAAO,KAAA,KAAkB,QAAY,IAAA;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liveblocks/react-tiptap",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.0-toolbars2",
|
|
4
4
|
"description": "A tiptap react plugin to enable collaboration, comments, live cursors, and more.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -42,14 +42,17 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@floating-ui/react-dom": "^2.1.2",
|
|
45
|
-
"@liveblocks/client": "2.
|
|
46
|
-
"@liveblocks/core": "2.
|
|
47
|
-
"@liveblocks/react": "2.
|
|
48
|
-
"@liveblocks/react-ui": "2.
|
|
49
|
-
"@liveblocks/yjs": "2.
|
|
45
|
+
"@liveblocks/client": "2.16.0-toolbars2",
|
|
46
|
+
"@liveblocks/core": "2.16.0-toolbars2",
|
|
47
|
+
"@liveblocks/react": "2.16.0-toolbars2",
|
|
48
|
+
"@liveblocks/react-ui": "2.16.0-toolbars2",
|
|
49
|
+
"@liveblocks/yjs": "2.16.0-toolbars2",
|
|
50
|
+
"@radix-ui/react-select": "^2.1.2",
|
|
51
|
+
"@radix-ui/react-toggle": "^1.1.0",
|
|
50
52
|
"@tiptap/core": "^2.7.2",
|
|
51
53
|
"@tiptap/react": "^2.7.2",
|
|
52
54
|
"@tiptap/suggestion": "^2.7.2",
|
|
55
|
+
"cmdk": "^1.0.4",
|
|
53
56
|
"y-prosemirror": "^1.2.12",
|
|
54
57
|
"yjs": "^13.6.18"
|
|
55
58
|
},
|
|
@@ -69,7 +72,7 @@
|
|
|
69
72
|
"@testing-library/jest-dom": "^5.16.5",
|
|
70
73
|
"eslint-plugin-react": "^7.33.2",
|
|
71
74
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
72
|
-
"msw": "^
|
|
75
|
+
"msw": "^1.3.5",
|
|
73
76
|
"rollup": "3.28.0",
|
|
74
77
|
"stylelint": "^15.10.2",
|
|
75
78
|
"stylelint-config-standard": "^34.0.0",
|
|
@@ -82,7 +85,7 @@
|
|
|
82
85
|
},
|
|
83
86
|
"repository": {
|
|
84
87
|
"type": "git",
|
|
85
|
-
"url": "https://github.com/liveblocks/liveblocks.git",
|
|
88
|
+
"url": "git+https://github.com/liveblocks/liveblocks.git",
|
|
86
89
|
"directory": "packages/liveblocks-react-tiptap"
|
|
87
90
|
},
|
|
88
91
|
"homepage": "https://liveblocks.io",
|
package/src/styles/constants.css
CHANGED