Various commenting improvements (#4938)
* fix: New threads attached to previous as replies * fix: Cannot use floating toolbar properly in comments * perf: Avoid re-writing history on click in editor * fix: Comment on text selection * fix: 'Copy link' on comments uses wrong hostname * Show comment buttons on input focus rather than non-empty input Increase maximum sidebar size * Allow opening comments from document menu * fix: Clicking comment menu should not focus thread
This commit is contained in:
@@ -1,10 +1,5 @@
|
||||
import { observer } from "mobx-react";
|
||||
import {
|
||||
EditIcon,
|
||||
PrintIcon,
|
||||
NewDocumentIcon,
|
||||
RestoreIcon,
|
||||
} from "outline-icons";
|
||||
import { EditIcon, NewDocumentIcon, RestoreIcon } from "outline-icons";
|
||||
import * as React from "react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { useHistory } from "react-router-dom";
|
||||
@@ -40,6 +35,8 @@ import {
|
||||
openDocumentInsights,
|
||||
publishDocument,
|
||||
unpublishDocument,
|
||||
printDocument,
|
||||
openDocumentComments,
|
||||
} from "~/actions/definitions/documents";
|
||||
import useActionContext from "~/hooks/useActionContext";
|
||||
import useCurrentTeam from "~/hooks/useCurrentTeam";
|
||||
@@ -125,11 +122,6 @@ function DocumentMenu({
|
||||
[showToast, t, document]
|
||||
);
|
||||
|
||||
const handlePrint = React.useCallback(() => {
|
||||
menu.hide();
|
||||
window.print();
|
||||
}, [menu]);
|
||||
|
||||
const collection = collections.get(document.collectionId);
|
||||
const can = usePolicy(document);
|
||||
const restoreItems = React.useMemo(
|
||||
@@ -291,16 +283,11 @@ function DocumentMenu({
|
||||
{
|
||||
type: "separator",
|
||||
},
|
||||
actionToMenuItem(downloadDocument, context),
|
||||
actionToMenuItem(openDocumentComments, context),
|
||||
actionToMenuItem(openDocumentHistory, context),
|
||||
actionToMenuItem(openDocumentInsights, context),
|
||||
{
|
||||
type: "button",
|
||||
title: t("Print"),
|
||||
onClick: handlePrint,
|
||||
visible: !!showDisplayOptions,
|
||||
icon: <PrintIcon />,
|
||||
},
|
||||
actionToMenuItem(downloadDocument, context),
|
||||
actionToMenuItem(printDocument, context),
|
||||
{
|
||||
type: "separator",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user