Merge branch 'main' into hmacr/issue-7929

This commit is contained in:
hmacr committed 2024-11-29 14:49:31 +05:30
commit a1981fb4d5
124 files changed
+2720 -1736

No files matched your search

+8 -6
View File
@@ -4,12 +4,6 @@ defaults: &defaults
working_directory: ~/outline
docker:
- image: cimg/node:20.10
- image: cimg/redis:5.0
- image: cimg/postgres:14.2
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: circle_test
resource_class: large
environment:
NODE_ENV: test
@@ -78,6 +72,14 @@ jobs:
test-server:
<<: *defaults
parallelism: 3
docker:
- image: cimg/node:20.10
- image: cimg/redis:5.0
- image: cimg/postgres:14.2
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: circle_test
steps:
- checkout
- restore_cache:
+25 -6
View File
@@ -131,11 +131,30 @@ export const createDocumentFromTemplate = createAction({
section: DocumentSection,
icon: <NewDocumentIcon />,
keywords: "create",
visible: ({ currentTeamId, activeDocumentId, stores }) =>
!!currentTeamId &&
!!activeDocumentId &&
!!stores.documents.get(activeDocumentId)?.template &&
stores.policies.abilities(currentTeamId).createDocument,
visible: ({
currentTeamId,
activeCollectionId,
activeDocumentId,
stores,
}) => {
const document = activeDocumentId
? stores.documents.get(activeDocumentId)
: undefined;
if (
!currentTeamId ||
!document?.isTemplate ||
!!document?.isDraft ||
!!document?.isDeleted
) {
return false;
}
if (activeCollectionId) {
return stores.policies.abilities(activeCollectionId).createDocument;
}
return stores.policies.abilities(currentTeamId).createDocument;
},
perform: ({ activeCollectionId, activeDocumentId, sidebarContext }) =>
history.push(
newDocumentPath(activeCollectionId, { templateId: activeDocumentId }),
@@ -1035,7 +1054,7 @@ export const openDocumentComments = createAction({
return;
}
stores.ui.toggleComments(activeDocumentId);
stores.ui.toggleComments();
},
});
-1
View File
@@ -31,7 +31,6 @@ const Actions = styled(Flex)`
left: 0;
border-radius: 3px;
background: ${s("background")};
transition: ${s("backgroundTransition")};
padding: 12px;
backdrop-filter: blur(20px);
+2 -1
View File
@@ -5,6 +5,7 @@ import { Redirect } from "react-router-dom";
import useCurrentUser from "~/hooks/useCurrentUser";
import useStores from "~/hooks/useStores";
import { changeLanguage } from "~/utils/language";
import { logoutPath } from "~/utils/routeHelpers";
import LoadingIndicator from "./LoadingIndicator";
type Props = {
@@ -32,7 +33,7 @@ const Authenticated = ({ children }: Props) => {
}
void auth.logout(true);
return <Redirect to="/" />;
return <Redirect to={logoutPath()} />;
};
export default observer(Authenticated);
+1 -1
View File
@@ -94,7 +94,7 @@ const AuthenticatedLayout: React.FC = ({ children }: Props) => {
!showHistory &&
can.comment &&
ui.activeDocumentId &&
ui.commentsExpanded.includes(ui.activeDocumentId) &&
ui.commentsExpanded &&
team.getPreference(TeamPreference.Commenting);
const sidebarRight = (
-1
View File
@@ -201,7 +201,6 @@ const Input = styled.div`
margin: -8px;
padding: 8px;
border-radius: 8px;
transition: ${s("backgroundTransition")};
&:after {
content: "";
@@ -2,7 +2,11 @@ import { NewDocumentIcon, ShapesIcon } from "outline-icons";
import * as React from "react";
import Icon from "~/components/Icon";
import { createAction } from "~/actions";
import { DocumentSection } from "~/actions/sections";
import {
ActiveCollectionSection,
DocumentSection,
TeamSection,
} from "~/actions/sections";
import useStores from "~/hooks/useStores";
import history from "~/utils/history";
import { newDocumentPath } from "~/utils/routeHelpers";
@@ -11,26 +15,42 @@ const useTemplatesAction = () => {
const { documents } = useStores();
React.useEffect(() => {
void documents.fetchTemplates();
void documents.fetchAllTemplates();
}, [documents]);
const actions = React.useMemo(
() =>
documents.templatesAlphabetical.map((item) =>
documents.templatesAlphabetical.map((template) =>
createAction({
name: item.titleWithDefault,
name: template.titleWithDefault,
analyticsName: "New document",
section: DocumentSection,
icon: item.icon ? (
<Icon value={item.icon} color={item.color ?? undefined} />
section: template.isWorkspaceTemplate
? TeamSection
: ActiveCollectionSection,
icon: template.icon ? (
<Icon value={template.icon} color={template.color ?? undefined} />
) : (
<NewDocumentIcon />
),
keywords: "create",
visible: ({ currentTeamId, activeCollectionId, stores }) => {
if (activeCollectionId) {
return (
stores.policies.abilities(activeCollectionId).createDocument &&
(template.collectionId === activeCollectionId ||
template.isWorkspaceTemplate)
);
}
return (
!!currentTeamId &&
stores.policies.abilities(currentTeamId).createDocument &&
template.isWorkspaceTemplate
);
},
perform: ({ activeCollectionId, sidebarContext }) =>
history.push(
newDocumentPath(item.collectionId ?? activeCollectionId, {
templateId: item.id,
newDocumentPath(template.collectionId ?? activeCollectionId, {
templateId: template.id,
}),
{
sidebarContext,
@@ -49,9 +69,15 @@ const useTemplatesAction = () => {
placeholder: ({ t }) => t("Choose a template"),
section: DocumentSection,
icon: <ShapesIcon />,
visible: ({ currentTeamId, stores }) =>
!!currentTeamId &&
stores.policies.abilities(currentTeamId).createDocument,
visible: ({ currentTeamId, activeCollectionId, stores }) => {
if (activeCollectionId) {
return stores.policies.abilities(activeCollectionId).createDocument;
}
return (
!!currentTeamId &&
stores.policies.abilities(currentTeamId).createDocument
);
},
children: () => actions,
}),
[actions]
-1
View File
@@ -182,7 +182,6 @@ function placeCaret(element: HTMLElement, atStart: boolean) {
const Content = styled.span`
background: ${s("background")};
transition: ${s("backgroundTransition")};
color: ${s("text")};
-webkit-text-fill-color: ${s("text")};
outline: none;
-16
View File
@@ -262,22 +262,6 @@ export const Position = styled.div`
transition-property: outline-width;
transition-duration: 0;
outline: none;
&:after {
content: "";
position: absolute;
top: 1px;
left: 1px;
right: 1px;
bottom: 1px;
pointer-events: none;
border-radius: 4px;
outline-color: ${s("accent")};
outline-width: initial;
outline-offset: -1px;
outline-style: solid;
}
}
/*
+3 -2
View File
@@ -39,6 +39,7 @@ function DocumentCard(props: Props) {
const { collections } = useStores();
const theme = useTheme();
const { document, pin, canUpdatePin, isDraggable } = props;
const pinnedToHome = React.useRef(!pin?.collectionId).current;
const collection = document.collectionId
? collections.get(document.collectionId)
: undefined;
@@ -122,13 +123,13 @@ function DocumentCard(props: Props) {
<Squircle
color={
collection?.color ??
(!pin?.collectionId ? theme.slateLight : theme.slateDark)
(pinnedToHome ? theme.slateLight : theme.slateDark)
}
>
{collection?.icon &&
collection?.icon !== "letter" &&
collection?.icon !== "collection" &&
!pin?.collectionId ? (
pinnedToHome ? (
<CollectionIcon collection={collection} color="white" />
) : (
<DocumentIcon color="white" />
+1 -1
View File
@@ -229,7 +229,7 @@ const SearchInput = styled(Input)`
${Outline} {
border: none;
border-radius: 0;
border-bottom: 1px solid ${s("inputBorder")};
border-bottom: 1px solid rgb(34 40 52);
background: ${s("menuBackground")};
}
-1
View File
@@ -94,7 +94,6 @@ const Scene = styled.div`
align-items: flex-start;
width: 350px;
background: ${s("background")};
transition: ${s("backgroundTransition")};
border-radius: 8px;
outline: none;
opacity: 0;
-1
View File
@@ -130,7 +130,6 @@ const Wrapper = styled(Flex)<WrapperProps>`
`};
padding: 12px;
transition: all 100ms ease-out;
transform: translate3d(0, 0, 0);
min-height: ${HEADER_HEIGHT}px;
justify-content: flex-start;
+4 -2
View File
@@ -47,14 +47,16 @@ export default function LanguagePrompt() {
<br />
<Link
onClick={async () => {
ui.setLanguagePromptDismissed();
ui.set({ languagePromptDismissed: true });
await user.save({ language });
}}
>
{t("Change Language")}
</Link>{" "}
&middot;{" "}
<Link onClick={ui.setLanguagePromptDismissed}>{t("Dismiss")}</Link>
<Link onClick={() => ui.set({ languagePromptDismissed: true })}>
{t("Dismiss")}
</Link>
</span>
</Flex>
</Wrapper>
-1
View File
@@ -76,7 +76,6 @@ const Layout = React.forwardRef(function Layout_(
const Container = styled(Flex)`
background: ${s("background")};
transition: ${s("backgroundTransition")};
position: relative;
width: 100%;
min-height: 100%;
-2
View File
@@ -174,7 +174,6 @@ const Fullscreen = styled.div<FullscreenProps>`
justify-content: center;
align-items: flex-start;
background: ${s("background")};
transition: ${s("backgroundTransition")};
outline: none;
${breakpoint("tablet")`
@@ -265,7 +264,6 @@ const Small = styled.div`
justify-content: center;
align-items: flex-start;
background: ${s("modalBackground")};
transition: ${s("backgroundTransition")};
box-shadow: ${s("modalShadow")};
border-radius: 8px;
outline: none;
-1
View File
@@ -144,7 +144,6 @@ const EmojiButton = styled(NudeButton)<{
height: 28px;
padding: 6px;
border-radius: 12px;
transition: ${s("backgroundTransition")};
background: ${s("backgroundTertiary")};
pointer-events: ${({ disabled }) => disabled && "none"};
+16 -13
View File
@@ -2,7 +2,6 @@ import { ReactionIcon } from "outline-icons";
import React from "react";
import { useTranslation } from "react-i18next";
import { PopoverDisclosure, usePopoverState } from "reakit";
import styled from "styled-components";
import EventBoundary from "@shared/components/EventBoundary";
import Flex from "~/components/Flex";
import NudeButton from "~/components/NudeButton";
@@ -11,6 +10,7 @@ import Popover from "~/components/Popover";
import useMobile from "~/hooks/useMobile";
import useOnClickOutside from "~/hooks/useOnClickOutside";
import useWindowSize from "~/hooks/useWindowSize";
import Tooltip from "../Tooltip";
const EmojiPanel = React.lazy(
() => import("~/components/IconPicker/components/EmojiPanel")
@@ -98,15 +98,22 @@ const ReactionPicker: React.FC<Props> = ({
<>
<PopoverDisclosure {...popover}>
{(props) => (
<PopoverButton
{...props}
aria-label={t("Reaction picker")}
className={className}
onClick={handlePopoverButtonClick}
size={size}
<Tooltip
content={t("Add reaction")}
placement="top"
delay={500}
hideOnClick
>
<ReactionIcon size={22} />
</PopoverButton>
<NudeButton
{...props}
aria-label={t("Reaction picker")}
className={className}
onClick={handlePopoverButtonClick}
size={size}
>
<ReactionIcon size={22} />
</NudeButton>
</Tooltip>
)}
</PopoverDisclosure>
<Popover
@@ -151,8 +158,4 @@ const Placeholder = React.memo(
);
Placeholder.displayName = "ReactionPickerPlaceholder";
const PopoverButton = styled(NudeButton)`
border-radius: 50%;
`;
export default ReactionPicker;
+2 -2
View File
@@ -32,13 +32,13 @@ function Right({ children, border, className }: Props) {
Math.min(window.innerWidth - event.pageX, maxWidth),
minWidth
);
ui.setRightSidebarWidth(width);
ui.set({ sidebarRightWidth: width });
},
[minWidth, maxWidth, ui]
);
const handleReset = React.useCallback(() => {
ui.setRightSidebarWidth(theme.sidebarRightWidth);
ui.set({ sidebarRightWidth: theme.sidebarRightWidth });
}, [ui, theme.sidebarRightWidth]);
const handleStopDrag = React.useCallback(() => {
+14 -16
View File
@@ -46,7 +46,6 @@ const Sidebar = React.forwardRef<HTMLDivElement, Props>(function _Sidebar(
const maxWidth = theme.sidebarMaxWidth;
const minWidth = theme.sidebarMinWidth + 16; // padding
const setWidth = ui.setSidebarWidth;
const [offset, setOffset] = React.useState(0);
const [isHovering, setHovering] = React.useState(false);
const [isAnimating, setAnimating] = React.useState(false);
@@ -62,13 +61,13 @@ const Sidebar = React.forwardRef<HTMLDivElement, Props>(function _Sidebar(
const width = Math.min(event.pageX - offset, maxWidth);
const isSmallerThanCollapsePoint = width < minWidth / 2;
if (isSmallerThanCollapsePoint) {
setWidth(theme.sidebarCollapsedWidth);
} else {
setWidth(width);
}
ui.set({
sidebarWidth: isSmallerThanCollapsePoint
? theme.sidebarCollapsedWidth
: width,
});
},
[theme, offset, minWidth, maxWidth, setWidth]
[ui, theme, offset, minWidth, maxWidth]
);
const handleStopDrag = React.useCallback(() => {
@@ -86,13 +85,13 @@ const Sidebar = React.forwardRef<HTMLDivElement, Props>(function _Sidebar(
setCollapsing(true);
ui.collapseSidebar();
} else {
setWidth(minWidth);
ui.set({ sidebarWidth: minWidth });
setAnimating(true);
}
} else {
setWidth(width);
ui.set({ sidebarWidth: width });
}
}, [ui, isSmallerThanMinimum, minWidth, width, setWidth]);
}, [ui, isSmallerThanMinimum, minWidth, width]);
const handleBlur = React.useCallback(() => {
setHovering(false);
@@ -149,11 +148,11 @@ const Sidebar = React.forwardRef<HTMLDivElement, Props>(function _Sidebar(
React.useEffect(() => {
if (isCollapsing) {
setTimeout(() => {
setWidth(minWidth);
ui.set({ sidebarWidth: minWidth });
setCollapsing(false);
}, ANIMATION_MS);
}
}, [setWidth, minWidth, isCollapsing]);
}, [ui, minWidth, isCollapsing]);
React.useEffect(() => {
if (isResizing) {
@@ -174,7 +173,7 @@ const Sidebar = React.forwardRef<HTMLDivElement, Props>(function _Sidebar(
}, [isResizing, handleDrag, handleBlur, handleStopDrag]);
const handleReset = React.useCallback(() => {
ui.setSidebarWidth(theme.sidebarWidth);
ui.set({ sidebarWidth: theme.sidebarWidth });
}, [ui, theme.sidebarWidth]);
React.useEffect(() => {
@@ -299,9 +298,8 @@ const Container = styled(Flex)<ContainerProps>`
width: 100%;
background: ${s("sidebarBackground")};
transition: box-shadow 150ms ease-in-out, transform 150ms ease-out,
${s("backgroundTransition")}
${(props: ContainerProps) =>
props.$isAnimating ? `,width ${ANIMATION_MS}ms ease-out` : ""};
${(props: ContainerProps) =>
props.$isAnimating ? `,width ${ANIMATION_MS}ms ease-out` : ""};
transform: translateX(
${(props) => (props.$mobileSidebarVisible ? 0 : "-100%")}
);
@@ -112,8 +112,9 @@ const NavLink = ({
!rest.target &&
!event.altKey &&
!event.metaKey &&
!event.ctrlKey,
[rest.target]
!event.ctrlKey &&
!isActive,
[rest.target, isActive]
);
const navigateTo = React.useCallback(() => {
@@ -153,14 +154,13 @@ const NavLink = ({
<Link
key={isActive ? "active" : "inactive"}
ref={linkRef}
// onMouseDown={handleClick}
onClick={handleClick}
onKeyDown={(event) => {
if (["Enter", " "].includes(event.key)) {
navigateTo();
event.currentTarget?.blur();
}
}}
onClick={handleClick}
aria-current={(isActive && ariaCurrent) || undefined}
className={className}
style={style}
@@ -105,7 +105,6 @@ const Button = styled(Flex)<{
&:hover,
&[aria-expanded="true"] {
color: ${s("sidebarText")};
transition: background 100ms ease-in-out;
background: ${s("sidebarActiveBackground")};
}
@@ -78,7 +78,6 @@ function SidebarLink(
const activeStyle = React.useMemo(
() => ({
fontWeight: 600,
color: theme.text,
background: theme.sidebarActiveBackground,
...style,
@@ -202,10 +201,10 @@ const Link = styled(NavLink)<{
display: flex;
position: relative;
text-overflow: ellipsis;
font-weight: 475;
padding: 6px 16px;
border-radius: 4px;
min-height: 32px;
transition: background 50ms, color 50ms;
user-select: none;
background: ${(props) =>
props.$isActiveDrop ? props.theme.slateDark : "inherit"};
-1
View File
@@ -31,7 +31,6 @@ const Background = styled.div<{ sticky?: boolean }>`
margin: 0 -8px;
padding: 0 8px;
background: ${s("background")};
transition: ${s("backgroundTransition")};
z-index: 1;
`;
+2 -3
View File
@@ -253,6 +253,7 @@ const SortWrapper = styled(Flex)<{ $sortable: boolean }>`
white-space: nowrap;
margin: 0 -4px;
padding: 0 4px;
cursor: ${(props) => (props.$sortable ? `var(--pointer)` : "")};
&:hover {
background: ${(props) =>
@@ -309,15 +310,13 @@ const Row = styled.tr`
const Head = styled.th`
text-align: left;
padding: 6px 6px 0;
padding: 6px 6px 2px;
border-bottom: 1px solid ${s("divider")};
background: ${s("background")};
transition: ${s("backgroundTransition")};
font-size: 14px;
color: ${s("textSecondary")};
font-weight: 500;
z-index: 1;
cursor: var(--pointer) !important;
:first-child {
padding-left: 0;
-1
View File
@@ -45,7 +45,6 @@ const Sticky = styled.div`
margin: 0 -8px;
padding: 0 8px;
background: ${s("background")};
transition: ${s("backgroundTransition")};
z-index: 1;
`;
-42
View File
@@ -1,42 +0,0 @@
import * as React from "react";
import styled from "styled-components";
import { s } from "@shared/styles";
type Props = {
/** The size to render the indicator, defaults to 24px */
size?: number;
};
/**
* A component to show an animated typing indicator.
*/
export default function Typing({ size = 24 }: Props) {
return (
<Wrapper height={size} width={size}>
<Circle cx={size / 4} cy={size / 2} r="2" />
<Circle cx={size / 2} cy={size / 2} r="2" />
<Circle cx={size / 1.33333} cy={size / 2} r="2" />
</Wrapper>
);
}
const Wrapper = styled.svg`
fill: ${s("textTertiary")};
@keyframes blink {
50% {
fill: transparent;
}
}
`;
const Circle = styled.circle`
animation: 1s blink infinite;
&:nth-child(2) {
animation-delay: 250ms;
}
&:nth-child(3) {
animation-delay: 500ms;
}
`;
-7
View File
@@ -529,13 +529,6 @@ class WebsocketProvider extends React.Component<Props> {
stars.remove(event.modelId);
});
this.socket.on(
"user.typing",
(event: { userId: string; documentId: string; commentId: string }) => {
comments.setTyping(event);
}
);
this.socket.on("collections.add_user", async (event: Membership) => {
memberships.add(event);
await collections.fetch(event.collectionId, {
+6 -4
View File
@@ -131,13 +131,15 @@ function usePosition({
// Images need their own positioning to get the toolbar in the center
if (isImageSelection) {
const element = view.nodeDOM(selection.from) as HTMLElement;
const element = view.nodeDOM(selection.from);
// Images are wrapped which impacts positioning - need to get the element
// specifically tagged as the handle
const imageElement = element.getElementsByClassName(
EditorStyleHelper.imageHandle
)[0];
const imageElement = element
? (element as HTMLElement).getElementsByClassName(
EditorStyleHelper.imageHandle
)[0]
: undefined;
if (imageElement) {
const { left, top, width } = imageElement.getBoundingClientRect();
+25 -6
View File
@@ -92,6 +92,10 @@ export default class FindAndReplaceExtension extends Extension {
public replace(replace: string): Command {
return (state, dispatch) => {
// Redo the search to ensure we have the latest results, the document may
// have changed underneath us since the last search.
this.search(state.doc);
const result = this.results[this.currentResultIndex];
if (!result) {
@@ -106,7 +110,12 @@ export default class FindAndReplaceExtension extends Extension {
}
public replaceAll(replace: string): Command {
return ({ tr }, dispatch) => {
return (state, dispatch) => {
// Redo the search to ensure we have the latest results, the document may
// have changed underneath us since the last search.
this.search(state.doc);
const tr = state.tr;
let offset: number | undefined;
if (!this.results.length) {
@@ -248,15 +257,25 @@ export default class FindAndReplaceExtension extends Extension {
let m;
const search = this.findRegExp;
while ((m = search.exec(deburr(text)))) {
// We construct a string with the text stripped of diacritics plus the original text for
// search allowing to search for diacritics-insensitive matches easily.
while ((m = search.exec(deburr(text) + text))) {
if (m[0] === "") {
break;
}
this.results.push({
from: pos + m.index,
to: pos + m.index + m[0].length,
});
// Reconstruct the correct match position
const i = m.index >= text.length ? m.index - text.length : m.index;
const from = pos + i;
const to = from + m[0].length;
// Check if already exists in results, possible due to duplicated
// search string on L257
if (this.results.some((r) => r.from === from && r.to === to)) {
continue;
}
this.results.push({ from, to });
}
} catch (e) {
// Invalid RegExp
+7 -6
View File
@@ -1,5 +1,4 @@
import isEqual from "lodash/isEqual";
import { keymap } from "prosemirror-keymap";
import {
ySyncPlugin,
yCursorPlugin,
@@ -104,11 +103,13 @@ export default class Multiplayer extends Extension {
selectionBuilder,
}),
yUndoPlugin(),
keymap({
"Mod-z": undo,
"Mod-y": redo,
"Mod-Shift-z": redo,
}),
];
}
commands() {
return {
undo: () => undo,
redo: () => redo,
};
}
}
-15
View File
@@ -4,7 +4,6 @@ import { darken, transparentize } from "polished";
import { baseKeymap } from "prosemirror-commands";
import { dropCursor } from "prosemirror-dropcursor";
import { gapCursor } from "prosemirror-gapcursor";
import { redo, undo } from "prosemirror-history";
import { inputRules, InputRule } from "prosemirror-inputrules";
import { keymap } from "prosemirror-keymap";
import { MarkdownParser } from "prosemirror-markdown";
@@ -608,20 +607,6 @@ export class Editor extends React.PureComponent<
this.props
);
/**
* Undo the last change in the editor.
*
* @returns True if the undo was successful
*/
public undo = () => undo(this.view.state, this.view.dispatch, this.view);
/**
* Redo the last change in the editor.
*
* @returns True if the change was successful
*/
public redo = () => redo(this.view.state, this.view.dispatch, this.view);
/**
* Returns true if the trimmed content of the editor is an empty string.
*
+1 -1
View File
@@ -31,7 +31,7 @@ export default function useAutoRefresh() {
return;
}
if (isReloaded) {
Logger.error("lifecycle", new Error("Attempted to reload twice"));
Logger.warn("Attempted to reload twice");
return;
}
+5 -4
View File
@@ -6,10 +6,7 @@ export default function useComponentSize(
width: number;
height: number;
} {
const [size, setSize] = useState({
width: ref.current?.clientWidth || 0,
height: ref.current?.clientHeight || 0,
});
const [size, setSize] = useState({ width: 0, height: 0 });
useLayoutEffect(() => {
const sizeObserver = new ResizeObserver((entries) => {
@@ -24,6 +21,10 @@ export default function useComponentSize(
});
if (ref.current) {
setSize({
width: ref.current?.clientWidth,
height: ref.current?.clientHeight,
});
sizeObserver.observe(ref.current);
}
-24
View File
@@ -1,8 +1,6 @@
import { subSeconds } from "date-fns";
import invariant from "invariant";
import uniq from "lodash/uniq";
import { action, computed, observable } from "mobx";
import { now } from "mobx-utils";
import { Pagination } from "@shared/constants";
import type { ProsemirrorData, ReactionSummary } from "@shared/types";
import User from "~/models/User";
@@ -15,17 +13,6 @@ import Relation from "./decorators/Relation";
class Comment extends Model {
static modelName = "Comment";
/**
* Map to keep track of which users are currently typing a reply in this
* comments thread.
*/
@observable
typingUsers: Map<string, Date> = new Map();
@Field
@observable
id: string;
/**
* The Prosemirror data representing the comment content
*/
@@ -107,17 +94,6 @@ class Comment extends Model {
*/
private reactedUsersLoading = false;
/**
* An array of users that are currently typing a reply in this comments thread.
*/
@computed
public get currentlyTypingUsers(): User[] {
return Array.from(this.typingUsers.entries())
.filter(([, lastReceivedDate]) => lastReceivedDate > subSeconds(now(), 3))
.map(([userId]) => this.store.rootStore.users.get(userId))
.filter(Boolean) as User[];
}
/**
* Whether the comment is resolved
*/
+2 -5
View File
@@ -65,10 +65,6 @@ export default class Document extends ArchivableModel {
store: DocumentsStore;
@Field
@observable
id: string;
@observable.shallow
data: ProsemirrorData;
@@ -254,7 +250,8 @@ export default class Document extends ArchivableModel {
@computed
get path(): string {
const prefix = this.template ? settingsPath("templates") : "/doc";
const prefix =
this.template && !this.isDeleted ? settingsPath("templates") : "/doc";
if (!this.title) {
return `${prefix}/untitled-${this.urlId}`;
-4
View File
@@ -6,10 +6,6 @@ import Field from "./decorators/Field";
class Group extends Model {
static modelName = "Group";
@Field
@observable
id: string;
@Field
@observable
name: string;
-4
View File
@@ -18,10 +18,6 @@ import Relation from "./decorators/Relation";
class Notification extends Model {
static modelName = "Notification";
@Field
@observable
id: string;
/**
* The date the notification was marked as read.
*/
-4
View File
@@ -8,10 +8,6 @@ import Field from "./decorators/Field";
class Team extends Model {
static modelName = "Team";
@Field
@observable
id: string;
@Field
@observable
name: string;
-4
View File
@@ -22,10 +22,6 @@ import Field from "./decorators/Field";
class User extends ParanoidModel {
static modelName = "User";
@Field
@observable
id: string;
@Field
@observable
avatarUrl: string;
-4
View File
@@ -5,10 +5,6 @@ import Field from "./decorators/Field";
class WebhookSubscription extends Model {
static modelName = "WebhookSubscription";
@Field
@observable
id: string;
@Field
@observable
name: string;
@@ -49,8 +49,6 @@ type Props = {
highlightedText?: string;
/** The text direction of the editor */
dir?: "rtl" | "ltr";
/** Callback when the user is typing in the editor */
onTyping?: () => void;
/** Callback when the editor is focused */
onFocus?: () => void;
/** Callback when the editor is blurred */
@@ -63,7 +61,6 @@ function CommentForm({
draft,
onSubmit,
onSaveDraft,
onTyping,
onFocus,
onBlur,
autoFocus,
@@ -182,7 +179,6 @@ function CommentForm({
) => {
const text = value(true, true);
onSaveDraft(text ? value(false, true) : undefined);
onTyping?.();
};
const handleSave = () => {
@@ -1,5 +1,5 @@
import throttle from "lodash/throttle";
import { observer } from "mobx-react";
import { darken } from "polished";
import * as React from "react";
import { useTranslation } from "react-i18next";
import { useHistory, useLocation } from "react-router-dom";
@@ -10,14 +10,11 @@ import { s } from "@shared/styles";
import { ProsemirrorData } from "@shared/types";
import Comment from "~/models/Comment";
import Document from "~/models/Document";
import { Avatar } from "~/components/Avatar";
import { Avatar, AvatarSize } from "~/components/Avatar";
import { useDocumentContext } from "~/components/DocumentContext";
import Facepile from "~/components/Facepile";
import Fade from "~/components/Fade";
import Flex from "~/components/Flex";
import { ResizingHeightContainer } from "~/components/ResizingHeightContainer";
import Typing from "~/components/Typing";
import { WebsocketContext } from "~/components/WebsocketProvider";
import useCurrentUser from "~/hooks/useCurrentUser";
import useOnClickOutside from "~/hooks/useOnClickOutside";
import usePersistedState from "~/hooks/usePersistedState";
import usePolicy from "~/hooks/usePolicy";
@@ -40,28 +37,12 @@ type Props = {
enableScroll: () => void;
/** Disable scroll for the comments container */
disableScroll: () => void;
/** Number of replies before collapsing */
collapseThreshold?: number;
/** Number of replies to display when collapsed */
collapseNumDisplayed?: number;
};
function useTypingIndicator({
document,
comment,
}: Pick<Props, "document" | "comment">): [undefined, () => void] {
const socket = React.useContext(WebsocketContext);
const setIsTyping = React.useMemo(
() =>
throttle(() => {
socket?.emit("typing", {
documentId: document.id,
commentId: comment.id,
});
}, 500),
[socket, document.id, comment.id]
);
return [undefined, setIsTyping];
}
function CommentThread({
comment: thread,
document,
@@ -69,21 +50,19 @@ function CommentThread({
focused,
enableScroll,
disableScroll,
collapseThreshold = 5,
collapseNumDisplayed = 3,
}: Props) {
const [focusedOnMount] = React.useState(focused);
const { editor } = useDocumentContext();
const { comments } = useStores();
const topRef = React.useRef<HTMLDivElement>(null);
const replyRef = React.useRef<HTMLDivElement>(null);
const user = useCurrentUser();
const { t } = useTranslation();
const history = useHistory();
const location = useLocation();
const [autoFocus, setAutoFocus] = React.useState(thread.isNew);
const [, setIsTyping] = useTypingIndicator({
document,
comment: thread,
});
const can = usePolicy(document);
const [draft, onSaveDraft] = usePersistedState<ProsemirrorData | undefined>(
@@ -102,6 +81,17 @@ function CommentThread({
.inThread(thread.id)
.filter((comment) => !comment.isNew);
const [collapse, setCollapse] = React.useState(() => {
const numReplies = commentsInThread.length - 1;
if (numReplies >= collapseThreshold) {
return {
begin: 1,
final: commentsInThread.length - collapseNumDisplayed - 1,
};
}
return null;
});
useOnClickOutside(topRef, (event) => {
if (
focused &&
@@ -135,6 +125,36 @@ function CommentThread({
});
};
const handleClickExpand = (ev: React.SyntheticEvent) => {
ev.stopPropagation();
setCollapse(null);
};
const renderShowMore = (collapse: { begin: number; final: number }) => {
const count = collapse.final - collapse.begin + 1;
const createdBy = commentsInThread
.slice(collapse.begin, collapse.final + 1)
.map((c) => c.createdBy);
const users = Array.from(new Set(createdBy));
const limit = 3;
const overflow = users.length - limit;
return (
<ShowMore onClick={handleClickExpand} key="show-more">
{t("Show {{ count }} reply", { count })}
<Facepile
users={users}
limit={limit}
overflow={overflow}
size={AvatarSize.Medium}
renderAvatar={(item) => (
<Avatar size={AvatarSize.Medium} model={item} />
)}
/>
</ShowMore>
);
};
React.useEffect(() => {
if (!focused && autoFocus) {
setAutoFocus(false);
@@ -198,8 +218,17 @@ function CommentThread({
onClick={handleClickThread}
>
{commentsInThread.map((comment, index) => {
if (collapse !== null) {
if (index === collapse.begin) {
return renderShowMore(collapse);
} else if (index > collapse.begin && index <= collapse.final) {
return null;
}
}
const firstOfAuthor =
index === 0 ||
(collapse && index === collapse.final + 1) ||
comment.createdById !== commentsInThread[index - 1].createdById;
const lastOfAuthor =
index === commentsInThread.length - 1 ||
@@ -225,15 +254,6 @@ function CommentThread({
);
})}
{thread.currentlyTypingUsers
.filter((typing) => typing.id !== user.id)
.map((typing) => (
<Flex gap={8} key={typing.id}>
<Avatar model={typing} size={24} />
<Typing />
</Flex>
))}
<ResizingHeightContainer hideOverflow={false} ref={replyRef}>
{(focused || draft || commentsInThread.length === 0) && canReply && (
<Fade timing={100}>
@@ -243,7 +263,6 @@ function CommentThread({
draft={draft}
documentId={document.id}
thread={thread}
onTyping={setIsTyping}
standalone={commentsInThread.length === 0}
dir={document.dir}
autoFocus={autoFocus}
@@ -282,6 +301,29 @@ const Reply = styled.button`
`}
`;
const ShowMore = styled.div<{ $dir?: "rtl" | "ltr" }>`
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1px;
margin-left: ${(props) => (props.$dir === "rtl" ? 0 : 32)}px;
margin-right: ${(props) => (props.$dir !== "rtl" ? 0 : 32)}px;
padding: 8px 12px;
color: ${s("textTertiary")};
background: ${(props) => darken(0.015, props.theme.backgroundSecondary)};
cursor: var(--pointer);
font-size: 13px;
&: ${hover} {
color: ${s("textSecondary")};
background: ${s("backgroundTertiary")};
}
* {
border-color: ${(props) => darken(0.015, props.theme.backgroundSecondary)};
}
`;
const Thread = styled.div<{
$focused: boolean;
$recessed: boolean;
@@ -1,6 +1,7 @@
import { differenceInMilliseconds } from "date-fns";
import { action } from "mobx";
import { observer } from "mobx-react";
import { DoneIcon } from "outline-icons";
import { darken } from "polished";
import * as React from "react";
import { useTranslation } from "react-i18next";
@@ -16,10 +17,14 @@ import Comment from "~/models/Comment";
import { Avatar } from "~/components/Avatar";
import ButtonSmall from "~/components/ButtonSmall";
import Flex from "~/components/Flex";
import NudeButton from "~/components/NudeButton";
import ReactionList from "~/components/Reactions/ReactionList";
import ReactionPicker from "~/components/Reactions/ReactionPicker";
import Text from "~/components/Text";
import Time from "~/components/Time";
import Tooltip from "~/components/Tooltip";
import { resolveCommentFactory } from "~/actions/definitions/comments";
import useActionContext from "~/hooks/useActionContext";
import useBoolean from "~/hooks/useBoolean";
import useCurrentUser from "~/hooks/useCurrentUser";
import CommentMenu from "~/menus/CommentMenu";
@@ -242,11 +247,13 @@ function CommentThreadItem({
onRemoveReaction={handleRemoveReaction}
picker={
!comment.isResolved ? (
<StyledReactionPicker
<Action
as={ReactionPicker}
onSelect={handleAddReaction}
onOpen={disableScroll}
onClose={enableScroll}
size={28}
rounded
/>
) : undefined
}
@@ -257,14 +264,20 @@ function CommentThreadItem({
<EventBoundary>
{!isEditing && (
<Actions gap={4} dir={dir}>
{firstOfThread && (
<ResolveButton onUpdate={handleUpdate} comment={comment} />
)}
{!comment.isResolved && (
<StyledReactionPicker
<Action
as={ReactionPicker}
onSelect={handleAddReaction}
onOpen={disableScroll}
onClose={enableScroll}
rounded
/>
)}
<StyledMenu
<Action
as={CommentMenu}
comment={comment}
onEdit={setEditing}
onDelete={handleDelete}
@@ -278,6 +291,38 @@ function CommentThreadItem({
);
}
const ResolveButton = ({
comment,
onUpdate,
}: {
comment: Comment;
onUpdate: (attrs: { resolved: boolean }) => void;
}) => {
const context = useActionContext();
const { t } = useTranslation();
return (
<Tooltip
content={t("Mark as resolved")}
placement="top"
delay={500}
hideOnClick
>
<Action
as={NudeButton}
context={context}
action={resolveCommentFactory({
comment,
onResolve: () => onUpdate({ resolved: true }),
})}
rounded
>
<DoneIcon size={22} outline />
</Action>
</Tooltip>
);
};
const StyledCommentEditor = styled(CommentEditor)`
${(props) =>
!props.readOnly &&
@@ -308,25 +353,13 @@ const Body = styled.form`
border-radius: 2px;
`;
const StyledMenu = styled(CommentMenu)`
color: ${s("textSecondary")};
svg {
fill: currentColor;
opacity: 0.5;
}
&: ${hover}, &[aria-expanded= "true"] {
background: ${s("backgroundQuaternary")};
svg {
opacity: 0.75;
}
}
`;
const StyledReactionPicker = styled(ReactionPicker)`
const Action = styled.span<{ rounded?: boolean }>`
color: ${s("textSecondary")};
${(props) =>
props.rounded &&
css`
border-radius: 50%;
`}
svg {
fill: currentColor;
@@ -352,7 +385,7 @@ const Actions = styled(Flex)<{ dir?: "rtl" | "ltr" }>`
background: ${s("backgroundSecondary")};
padding-left: 4px;
&:has(${StyledReactionPicker}[aria-expanded="true"], ${StyledMenu}[aria-expanded="true"]) {
&:has(${Action}[aria-expanded="true"]) {
opacity: 1;
}
`;
@@ -386,7 +419,7 @@ export const Bubble = styled(Flex)<{
min-width: 2em;
margin-bottom: 1px;
padding: 8px 12px;
transition: color 100ms ease-out, ${s("backgroundTransition")};
transition: color 100ms ease-out, background 100ms ease-out;
${({ $lastOfThread, $canReply }) =>
$lastOfThread &&
+2 -2
View File
@@ -44,7 +44,7 @@ function Comments() {
const isAtBottom = React.useRef(true);
const [showJumpToRecentBtn, setShowJumpToRecentBtn] = React.useState(false);
useKeyDown("Escape", () => document && ui.collapseComments(document?.id));
useKeyDown("Escape", () => document && ui.set({ commentsExpanded: false }));
const [draft, onSaveDraft] = usePersistedState<ProsemirrorData | undefined>(
`draft-${document?.id}-new`,
@@ -126,7 +126,7 @@ function Comments() {
<CommentSortMenu />
</Flex>
}
onClose={() => ui.collapseComments(document?.id)}
onClose={() => ui.set({ commentsExpanded: false })}
scrollable={false}
>
<Scrollable
@@ -87,7 +87,6 @@ const StickyWrapper = styled.div`
border-radius: 8px;
background: ${s("background")};
transition: ${s("backgroundTransition")};
@supports (backdrop-filter: blur(20px)) {
backdrop-filter: blur(20px);
+9 -6
View File
@@ -215,13 +215,15 @@ class DocumentScene extends React.Component<Props> {
onUndoRedo = (event: KeyboardEvent) => {
if (isModKey(event)) {
event.preventDefault();
if (event.shiftKey) {
if (this.editor.current?.redo()) {
event.preventDefault();
if (!this.props.readOnly) {
this.editor.current?.commands.redo();
}
} else {
if (this.editor.current?.undo()) {
event.preventDefault();
if (!this.props.readOnly) {
this.editor.current?.commands.undo();
}
}
}
@@ -413,7 +415,8 @@ class DocumentScene extends React.Component<Props> {
(team && team.documentEmbeds === false) || document.embedsDisabled;
const showContents =
ui.tocVisible === true || (isShare && ui.tocVisible !== false);
(ui.tocVisible === true && !document.isTemplate) ||
(isShare && ui.tocVisible !== false);
const tocPos =
tocPosition ??
((team?.getPreference(TeamPreference.TocPosition) as TOCPosition) ||
@@ -568,6 +571,7 @@ class DocumentScene extends React.Component<Props> {
)}
{!isShare && !revision && (
<>
<p>test</p>
<MarkAsViewed document={document} />
<ReferencesWrapper>
<References document={document} />
@@ -698,7 +702,6 @@ const Footer = styled.div`
const Background = styled(Container)`
position: relative;
background: ${s("background")};
transition: ${s("backgroundTransition")};
`;
const ReferencesWrapper = styled.div`
@@ -50,7 +50,7 @@ function TitleDocumentMeta({ to, document, revision, ...rest }: Props) {
pathname: documentPath(document),
state: location.state,
}}
onClick={() => ui.toggleComments(document.id)}
onClick={() => ui.toggleComments()}
>
<CommentIcon size={18} />
{commentsCount
+15 -2
View File
@@ -27,6 +27,7 @@ import useCurrentTeam from "~/hooks/useCurrentTeam";
import useCurrentUser from "~/hooks/useCurrentUser";
import useFocusedComment from "~/hooks/useFocusedComment";
import usePolicy from "~/hooks/usePolicy";
import useQuery from "~/hooks/useQuery";
import useStores from "~/hooks/useStores";
import {
documentHistoryPath,
@@ -82,6 +83,7 @@ function DocumentEditor(props: Props, ref: React.RefObject<any>) {
const team = useCurrentTeam({ rejectOnEmpty: false });
const history = useHistory();
const location = useLocation();
const params = useQuery();
const {
document,
onChangeTitle,
@@ -104,9 +106,20 @@ function DocumentEditor(props: Props, ref: React.RefObject<any>) {
React.useEffect(() => {
if (focusedComment) {
ui.expandComments(document.id);
const viewingResolved = params.get("resolved") === "";
if (
(focusedComment.isResolved && !viewingResolved) ||
(!focusedComment.isResolved && viewingResolved)
) {
history.replace({
search: focusedComment.isResolved ? "resolved=" : "",
pathname: location.pathname,
state: { commentId: focusedComment.id },
});
}
ui.set({ commentsExpanded: true });
}
}, [focusedComment, ui, document.id]);
}, [focusedComment, ui, document.id, history, location, params]);
// Save document when blurring title, but delay so that if clicking on a
// button this is allowed to execute first.
+13 -4
View File
@@ -103,6 +103,10 @@ function DocumentHeader({
});
}, [onSave]);
const handleToggle = React.useCallback(() => {
ui.set({ tocVisible: !ui.tocVisible });
}, [ui]);
const context = useActionContext({
activeDocumentId: document?.id,
});
@@ -113,7 +117,8 @@ function DocumentHeader({
const canToggleEmbeds = team?.documentEmbeds;
const isShare = !!shareId;
const showContents =
ui.tocVisible === true || (isShare && ui.tocVisible !== false);
(ui.tocVisible === true && !document.isTemplate) ||
(isShare && ui.tocVisible !== false);
const toc = (
<Tooltip
@@ -129,7 +134,7 @@ function DocumentHeader({
placement="bottom"
>
<Button
onClick={showContents ? ui.hideTableOfContents : ui.showTableOfContents}
onClick={handleToggle}
icon={<TableOfContentsIcon />}
borderOnHover
neutral
@@ -180,7 +185,7 @@ function DocumentHeader({
useKeyDown(
(event) => event.ctrlKey && event.altKey && event.key === "˙",
ui.tocVisible ? ui.hideTableOfContents : ui.showTableOfContents,
handleToggle,
{
allowInInput: true,
}
@@ -232,7 +237,11 @@ function DocumentHeader({
<TableOfContentsMenu />
) : (
<DocumentBreadcrumb document={document}>
{toc} <Star document={document} color={theme.textSecondary} />
{document.isTemplate ? null : (
<>
{toc} <Star document={document} color={theme.textSecondary} />
</>
)}
</DocumentBreadcrumb>
)
}
@@ -273,6 +273,7 @@ function MultiplayerEditor({ onSynced, ...props }: Props, ref: any) {
<>
{showCache && (
<Editor
editorStyle={props.editorStyle}
embedsDisabled={props.embedsDisabled}
defaultValue={props.defaultValue}
extensions={props.extensions}
@@ -290,8 +291,8 @@ function MultiplayerEditor({ onSynced, ...props }: Props, ref: any) {
style={
showCache
? {
height: 0,
opacity: 0,
pointerEvents: "none",
}
: undefined
}
@@ -36,11 +36,13 @@ function References({ document }: Props) {
: [];
const showBacklinks = !!backlinks.length;
const showChildDocuments = !!children.length;
const shouldFade = React.useRef(!showBacklinks && !showChildDocuments);
const isBacklinksTab = location.hash === "#backlinks" || !showChildDocuments;
const height = Math.max(backlinks.length, children.length) * 40;
const Component = shouldFade.current ? Fade : React.Fragment;
return showBacklinks || showChildDocuments ? (
<Fade>
<Component>
<Tabs>
{showChildDocuments && (
<Tab
@@ -103,7 +105,7 @@ function References({ document }: Props) {
</List>
)}
</Content>
</Fade>
</Component>
) : null;
}
+12
View File
@@ -28,12 +28,24 @@ function DocumentMove({ document }: Props) {
);
const items = React.useMemo(() => {
// Recursively filter out the document itself and its existing parent doc, if any.
const filterSourceDocument = (node: NavigationNode): NavigationNode => ({
...node,
children: node.children
?.filter(
(c) => c.id !== document.id && c.id !== document.parentDocumentId
)
.map(filterSourceDocument),
});
// Filter out the document itself and its existing parent doc, if any.
const nodes = flatten(collectionTrees.map(flattenTree))
.filter(
(node) =>
node.id !== document.id && node.id !== document.parentDocumentId
)
.map(filterSourceDocument)
// Filter out collections that we don't have permission to create documents in.
.filter((node) =>
node.collectionId
? policies.get(node.collectionId)?.abilities.createDocument
-1
View File
@@ -118,7 +118,6 @@ function Home() {
const Documents = styled.div`
position: relative;
background: ${s("background")};
transition: ${s("backgroundTransition")};
`;
export default observer(Home);
+1 -1
View File
@@ -127,7 +127,7 @@ function Invite({ onSubmit }: Props) {
<Trans>{{ collectionCount }} collections</Trans>
</strong>
</Tooltip>
.
.{" "}
</span>
) : undefined;
+2 -1
View File
@@ -231,7 +231,8 @@ function Login({ children }: Props) {
config.providers.length === 1 &&
config.providers[0].id === "oidc" &&
!env.OIDC_DISABLE_REDIRECT &&
!query.get("notice")
!query.get("notice") &&
!query.get("logout")
) {
window.location.href = getRedirectUrl(config.providers[0].authUrl);
return null;
+2 -1
View File
@@ -2,6 +2,7 @@ import * as React from "react";
import { Redirect } from "react-router-dom";
import env from "~/env";
import useStores from "~/hooks/useStores";
import { logoutPath } from "~/utils/routeHelpers";
const Logout = () => {
const { auth } = useStores();
@@ -17,7 +18,7 @@ const Logout = () => {
if (env.OIDC_LOGOUT_URI) {
return null; // user will be redirected to logout URI after logout
}
return <Redirect to="/" />;
return <Redirect to={logoutPath()} />;
};
export default Logout;
@@ -59,7 +59,6 @@ const StyledInput = styled.input`
outline: none;
border: 0;
background: ${s("sidebarBackground")};
transition: ${s("backgroundTransition")};
border-radius: 4px;
color: ${s("text")};
+2 -3
View File
@@ -220,9 +220,6 @@ function Security() {
</SettingRow>
)}
{!data.inviteRequired && (
<DomainManagement onSuccess={showSuccessMessage} />
)}
{!data.inviteRequired && (
<SettingRow
label={t("Default role")}
@@ -252,6 +249,8 @@ function Security() {
</SettingRow>
)}
<DomainManagement onSuccess={showSuccessMessage} />
<h2>{t("Behavior")}</h2>
<SettingRow
label={t("Public document sharing")}
@@ -12,7 +12,6 @@ export const ActionRow = styled.div`
margin: 0 -50vw;
background: ${s("background")};
transition: ${s("backgroundTransition")};
@supports (backdrop-filter: blur(20px)) {
backdrop-filter: blur(20px);
@@ -5,7 +5,6 @@ import { Trans, useTranslation } from "react-i18next";
import { toast } from "sonner";
import styled from "styled-components";
import Button from "~/components/Button";
import Fade from "~/components/Fade";
import Flex from "~/components/Flex";
import Input from "~/components/Input";
import NudeButton from "~/components/NudeButton";
@@ -110,29 +109,25 @@ function DomainManagement({ onSuccess }: Props) {
<Flex justify="space-between" gap={4} style={{ flexWrap: "wrap" }}>
{!allowedDomains.length ||
allowedDomains[allowedDomains.length - 1] !== "" ? (
<Fade>
<Button type="button" onClick={handleAddDomain} neutral>
{allowedDomains.length ? (
<Trans>Add another</Trans>
) : (
<Trans>Add a domain</Trans>
)}
</Button>
</Fade>
<Button type="button" onClick={handleAddDomain} neutral>
{allowedDomains.length ? (
<Trans>Add another</Trans>
) : (
<Trans>Add a domain</Trans>
)}
</Button>
) : (
<span />
)}
{showSaveChanges && (
<Fade>
<Button
type="button"
onClick={handleSaveDomains}
disabled={team.isSaving}
>
<Trans>Save changes</Trans>
</Button>
</Fade>
<Button
type="button"
onClick={handleSaveDomains}
disabled={team.isSaving}
>
<Trans>Save changes</Trans>
</Button>
)}
</Flex>
</SettingRow>
@@ -52,7 +52,7 @@ function PeopleTable({ canManage, ...rest }: Props) {
),
},
{
id: "isAdmin",
id: "role",
Header: t("Role"),
accessor: "rank",
Cell: observer(({ row }: { row: { original: User } }) => (
+9 -20
View File
@@ -7,31 +7,19 @@ import { CustomTheme } from "@shared/types";
import Storage from "@shared/utils/Storage";
import { getCookieDomain, parseDomain } from "@shared/utils/domains";
import RootStore from "~/stores/RootStore";
import Policy from "~/models/Policy";
import Team from "~/models/Team";
import User from "~/models/User";
import env from "~/env";
import { setPostLoginPath } from "~/hooks/useLastVisitedPath";
import { PartialExcept } from "~/types";
import { client } from "~/utils/ApiClient";
import Desktop from "~/utils/Desktop";
import Logger from "~/utils/Logger";
import isCloudHosted from "~/utils/isCloudHosted";
import Store from "./base/Store";
type PersistedData = {
user?: PartialExcept<User, "id">;
team?: PartialExcept<Team, "id">;
collaborationToken?: string;
availableTeams?: {
id: string;
name: string;
avatarUrl: string;
url: string;
isSignedIn: boolean;
}[];
policies?: Policy[];
};
type PersistedData = Pick<
AuthStore,
"user" | "team" | "collaborationToken" | "availableTeams" | "policies"
>;
type Provider = {
id: string;
@@ -165,9 +153,10 @@ export default class AuthStore extends Store<Team> {
/** The current team's policies */
@computed
get policies() {
return this.currentTeamId
? [this.rootStore.policies.get(this.currentTeamId)]
: [];
const policy = this.currentTeamId
? this.rootStore.policies.get(this.currentTeamId)
: undefined;
return policy ? [policy] : [];
}
/** Whether the user is signed in */
@@ -177,7 +166,7 @@ export default class AuthStore extends Store<Team> {
}
@computed
get asJson() {
get asJson(): PersistedData {
return {
user: this.user,
team: this.team,
-14
View File
@@ -150,20 +150,6 @@ export default class CommentsStore extends Store<Comment> {
return this.data.get(res.data.id) as Comment;
};
@action
setTyping({
commentId,
userId,
}: {
commentId: string;
userId: string;
}): void {
const comment = this.get(commentId);
if (comment) {
comment.typingUsers.set(userId, new Date());
}
}
@computed
get orderedData(): Comment[] {
return orderBy(Array.from(this.data.values()), "createdAt", "asc");
+4
View File
@@ -368,6 +368,10 @@ export default class DocumentsStore extends Store<Document> {
fetchTemplates = async (options?: PaginationParams): Promise<Document[]> =>
this.fetchNamedPage("list", { ...options, template: true });
@action
fetchAllTemplates = async (options?: PaginationParams): Promise<Document[]> =>
this.fetchAll({ ...options, template: true });
@action
fetchAlphabetical = async (options?: PaginationParams): Promise<Document[]> =>
this.fetchNamedPage("list", {
+28 -61
View File
@@ -1,4 +1,4 @@
import { action, autorun, computed, observable } from "mobx";
import { action, computed, observable } from "mobx";
import { flushSync } from "react-dom";
import { light as defaultTheme } from "@shared/styles/theme";
import Storage from "@shared/utils/Storage";
@@ -23,15 +23,16 @@ export enum SystemTheme {
Dark = "dark",
}
type PersistedData = {
languagePromptDismissed: boolean | undefined;
theme: Theme;
sidebarCollapsed: boolean;
sidebarWidth: number;
sidebarRightWidth: number;
tocVisible: boolean | undefined;
commentsExpanded: string[];
};
type PersistedData = Pick<
UiStore,
| "languagePromptDismissed"
| "commentsExpanded"
| "theme"
| "sidebarWidth"
| "sidebarRightWidth"
| "sidebarCollapsed"
| "tocVisible"
>;
class UiStore {
// has the user seen the prompt to change the UI language and actioned it
@@ -74,7 +75,7 @@ class UiStore {
sidebarCollapsed = false;
@observable
commentsExpanded: string[] = [];
commentsExpanded = false;
@observable
sidebarIsResizing = false;
@@ -98,7 +99,7 @@ class UiStore {
this.sidebarRightWidth =
data.sidebarRightWidth || defaultTheme.sidebarRightWidth;
this.tocVisible = data.tocVisible;
this.commentsExpanded = data.commentsExpanded || [];
this.commentsExpanded = !!data.commentsExpanded;
this.theme = data.theme || Theme.System;
// system theme listeners
@@ -134,10 +135,6 @@ class UiStore {
this.tocVisible = newData.tocVisible;
}
});
autorun(() => {
Storage.set(UI_STORE, this.asJson);
});
}
@action
@@ -145,14 +142,9 @@ class UiStore {
startViewTransition(() => {
flushSync(() => {
this.theme = theme;
this.persist();
});
});
Storage.set("theme", this.theme);
};
@action
setLanguagePromptDismissed = () => {
this.languagePromptDismissed = true;
};
@action
@@ -205,64 +197,35 @@ class UiStore {
this.activeCollectionId = undefined;
};
@action
setSidebarWidth = (width: number): void => {
this.sidebarWidth = width;
};
@action
setRightSidebarWidth = (width: number): void => {
this.sidebarRightWidth = width;
};
@action
collapseSidebar = () => {
this.sidebarCollapsed = true;
this.set({ sidebarCollapsed: true });
};
@action
expandSidebar = () => {
sidebarHidden = false;
this.sidebarCollapsed = false;
this.set({ sidebarCollapsed: false });
};
@action
collapseComments = (documentId: string) => {
this.commentsExpanded = this.commentsExpanded.filter(
(id) => id !== documentId
);
};
@action
expandComments = (documentId: string) => {
if (!this.commentsExpanded.includes(documentId)) {
this.commentsExpanded.push(documentId);
set = (data: Partial<PersistedData>) => {
for (const key in data) {
// @ts-expect-error doesn't understand PersistedData is subset of keys
this[key] = data[key];
}
this.persist();
};
@action
toggleComments = (documentId: string) => {
if (this.commentsExpanded.includes(documentId)) {
this.collapseComments(documentId);
} else {
this.expandComments(documentId);
}
toggleComments = () => {
this.set({ commentsExpanded: !this.commentsExpanded });
};
@action
toggleCollapsedSidebar = () => {
sidebarHidden = false;
this.sidebarCollapsed = !this.sidebarCollapsed;
};
@action
showTableOfContents = () => {
this.tocVisible = true;
};
@action
hideTableOfContents = () => {
this.tocVisible = false;
this.set({ sidebarCollapsed: !this.sidebarCollapsed });
};
@action
@@ -324,6 +287,10 @@ class UiStore {
theme: this.theme,
};
}
private persist = () => {
Storage.set(UI_STORE, this.asJson);
};
}
export default UiStore;
-1
View File
@@ -124,7 +124,6 @@ declare module "styled-components" {
backgroundSecondary: string;
backgroundTertiary: string;
backgroundQuaternary: string;
backgroundTransition: string;
accent: string;
accentText: string;
link: string;
+7
View File
@@ -8,6 +8,13 @@ export function homePath(): string {
return env.ROOT_SHARE_ID ? "/" : "/home";
}
export function logoutPath() {
return {
pathname: "/",
search: "logout=true",
};
}
export function draftsPath(): string {
return "/drafts";
}
+13 -12
View File
@@ -48,11 +48,11 @@
"> 0.25%, not dead"
],
"dependencies": {
"@aws-sdk/client-s3": "3.616.0",
"@aws-sdk/lib-storage": "3.616.0",
"@aws-sdk/s3-presigned-post": "3.616.0",
"@aws-sdk/s3-request-presigner": "3.616.0",
"@aws-sdk/signature-v4-crt": "^3.616.0",
"@aws-sdk/client-s3": "3.693.0",
"@aws-sdk/lib-storage": "3.693.0",
"@aws-sdk/s3-presigned-post": "3.693.0",
"@aws-sdk/s3-request-presigner": "3.693.0",
"@aws-sdk/signature-v4-crt": "^3.693.0",
"@babel/core": "^7.24.7",
"@babel/plugin-proposal-decorators": "^7.24.7",
"@babel/plugin-transform-class-properties": "^7.24.7",
@@ -79,11 +79,11 @@
"@hocuspocus/server": "1.1.2",
"@joplin/turndown-plugin-gfm": "^1.0.49",
"@juggle/resize-observer": "^3.4.0",
"@octokit/auth-app": "^6.1.2",
"@octokit/auth-app": "^6.1.3",
"@outlinewiki/koa-passport": "^4.2.1",
"@outlinewiki/passport-azure-ad-oauth2": "^0.1.0",
"@renderlesskit/react": "^0.11.0",
"@sentry/node": "^7.117.0",
"@sentry/node": "^7.119.0",
"@sentry/react": "^7.119.0",
"@tippyjs/react": "^4.2.6",
"@types/form-data": "^2.5.0",
@@ -150,7 +150,7 @@
"markdown-it": "^13.0.2",
"markdown-it-container": "^3.0.0",
"markdown-it-emoji": "^2.0.0",
"mermaid": "9.3.0",
"mermaid": "11.4.0",
"mime-types": "^2.1.35",
"mobx": "^4.15.4",
"mobx-react": "^6.3.1",
@@ -208,6 +208,7 @@
"react-waypoint": "^10.3.0",
"react-window": "^1.8.10",
"reakit": "^1.3.11",
"redlock": "^5.0.0-beta.2",
"reflect-metadata": "^0.2.2",
"refractor": "^3.6.0",
"request-filtering-agent": "^1.1.2",
@@ -239,7 +240,7 @@
"utility-types": "^3.10.0",
"uuid": "^8.3.2",
"validator": "13.12.0",
"vite": "^5.4.10",
"vite": "^5.4.11",
"vite-plugin-pwa": "^0.20.3",
"winston": "^3.13.0",
"ws": "^7.5.10",
@@ -254,7 +255,7 @@
"@babel/cli": "^7.25.9",
"@babel/preset-typescript": "^7.24.1",
"@faker-js/faker": "^8.4.1",
"@relative-ci/agent": "^4.2.12",
"@relative-ci/agent": "^4.2.13",
"@testing-library/react": "^12.0.0",
"@types/addressparser": "^1.0.3",
"@types/body-scroll-lock": "^3.1.2",
@@ -285,7 +286,6 @@
"@types/markdown-it": "^14.1.2",
"@types/markdown-it-container": "^2.0.9",
"@types/markdown-it-emoji": "^2.0.4",
"@types/mermaid": "^9.2.0",
"@types/mime-types": "^2.1.4",
"@types/natural-sort": "^0.0.24",
"@types/node": "20.14.2",
@@ -306,7 +306,7 @@
"@types/react-table": "^7.7.18",
"@types/react-virtualized-auto-sizer": "^1.0.4",
"@types/react-window": "^1.8.8",
"@types/readable-stream": "^4.0.15",
"@types/readable-stream": "^4.0.18",
"@types/redis-info": "^3.0.3",
"@types/refractor": "^3.4.1",
"@types/resolve-path": "^1.4.2",
@@ -360,6 +360,7 @@
"yarn-deduplicate": "^6.0.2"
},
"resolutions": {
"prosemirror-transform": "1.10.0",
"body-scroll-lock": "^4.0.0-beta.0",
"d3": "^7.0.0",
"debug": "4.3.4",
+16 -13
View File
@@ -1,10 +1,9 @@
import { Event } from "@server/models";
import { buildDocument, buildUser } from "@server/test/factories";
import { withAPIContext } from "@server/test/support";
import pinCreator from "./pinCreator";
describe("pinCreator", () => {
const ip = "127.0.0.1";
it("should create pin to home", async () => {
const user = await buildUser();
const document = await buildDocument({
@@ -12,11 +11,13 @@ describe("pinCreator", () => {
teamId: user.teamId,
});
const pin = await pinCreator({
documentId: document.id,
user,
ip,
});
const pin = await withAPIContext(user, (ctx) =>
pinCreator({
ctx,
user,
documentId: document.id,
})
);
const event = await Event.findLatest({
teamId: user.teamId,
@@ -36,12 +37,14 @@ describe("pinCreator", () => {
teamId: user.teamId,
});
const pin = await pinCreator({
documentId: document.id,
collectionId: document.collectionId,
user,
ip,
});
const pin = await withAPIContext(user, (ctx) =>
pinCreator({
ctx,
user,
documentId: document.id,
collectionId: document.collectionId,
})
);
const event = await Event.findLatest({
teamId: user.teamId,
+12 -37
View File
@@ -2,10 +2,12 @@ import fractionalIndex from "fractional-index";
import { Sequelize, Op, WhereOptions } from "sequelize";
import { PinValidation } from "@shared/validations";
import { ValidationError } from "@server/errors";
import { Pin, User, Event } from "@server/models";
import { sequelize } from "@server/storage/database";
import { Pin, User } from "@server/models";
import { APIContext } from "@server/types";
type Props = {
/** The request context */
ctx: APIContext;
/** The user creating the pin */
user: User;
/** The document to pin */
@@ -14,8 +16,6 @@ type Props = {
collectionId?: string | null;
/** The index to pin the document at. If no index is provided then it will be pinned to the end of the collection */
index?: string;
/** The IP address of the user creating the pin */
ip: string;
};
/**
@@ -26,10 +26,10 @@ type Props = {
* @returns Pin The pin that was created
*/
export default async function pinCreator({
ctx,
user,
documentId,
collectionId,
ip,
...rest
}: Props): Promise<Pin> {
let { index } = rest;
@@ -62,38 +62,13 @@ export default async function pinCreator({
index = fractionalIndex(pins.length ? pins[0].index : null, null);
}
const transaction = await sequelize.transaction();
let pin;
try {
pin = await Pin.create(
{
createdById: user.id,
teamId: user.teamId,
collectionId,
documentId,
index,
},
{ transaction }
);
await Event.create(
{
name: "pins.create",
modelId: pin.id,
teamId: user.teamId,
actorId: user.id,
documentId,
collectionId,
ip,
},
{ transaction }
);
await transaction.commit();
} catch (err) {
await transaction.rollback();
throw err;
}
const pin = await Pin.createWithCtx(ctx, {
createdById: user.id,
teamId: user.teamId,
collectionId,
documentId,
index,
});
return pin;
}
+2
View File
@@ -13,6 +13,8 @@ type Props = {
};
/**
* @deprecated use pin.destroyWithCtx instead. This will be removed once document routes migrate to auto event insertion using APIContext.
*
* This command destroys a document pin. This just removes the pin itself and
* does not touch the document
*
-53
View File
@@ -1,53 +0,0 @@
import { Event, Pin, User } from "@server/models";
import { sequelize } from "@server/storage/database";
type Props = {
/** The user updating the pin */
user: User;
/** The existing pin */
pin: Pin;
/** The index to pin the document at */
index: string;
/** The IP address of the user creating the pin */
ip: string;
};
/**
* This command updates a "pinned" document. A pin can only be moved to a new
* index (reordered) once created.
*
* @param Props The properties of the pin to update
* @returns Pin The updated pin
*/
export default async function pinUpdater({
user,
pin,
index,
ip,
}: Props): Promise<Pin> {
const transaction = await sequelize.transaction();
try {
pin.index = index;
await pin.save({ transaction });
await Event.create(
{
name: "pins.update",
modelId: pin.id,
teamId: user.teamId,
actorId: user.id,
documentId: pin.documentId,
collectionId: pin.collectionId,
ip,
},
{ transaction }
);
await transaction.commit();
} catch (err) {
await transaction.rollback();
throw err;
}
return pin;
}
+9
View File
@@ -51,6 +51,15 @@ export default abstract class BaseEmail<
* @returns A promise that resolves once the email is placed on the task queue
*/
public schedule(options?: Bull.JobOptions) {
// No-op to schedule emails if SMTP is not configured
if (!env.SMTP_FROM_EMAIL) {
Logger.info(
"email",
`Email ${this.constructor.name} not sent due to missing SMTP configuration`
);
return;
}
const templateName = this.constructor.name;
Metrics.increment("email.scheduled", {
@@ -7,6 +7,7 @@ import HTMLHelper from "@server/models/helpers/HTMLHelper";
import NotificationSettingsHelper from "@server/models/helpers/NotificationSettingsHelper";
import SubscriptionHelper from "@server/models/helpers/SubscriptionHelper";
import { can } from "@server/policies";
import { CacheHelper } from "@server/utils/CacheHelper";
import BaseEmail, { EmailMessageCategory, EmailProps } from "./BaseEmail";
import Body from "./components/Body";
import Button from "./components/Button";
@@ -68,21 +69,28 @@ export default class DocumentPublishedOrUpdatedEmail extends BaseEmail<
let body;
if (revisionId && team?.getPreference(TeamPreference.PreviewsInEmails)) {
// generate the diff html for the email
const revision = await Revision.findByPk(revisionId);
body = await CacheHelper.getDataOrSet<string>(
`diff:${revisionId}`,
async () => {
// generate the diff html for the email
const revision = await Revision.findByPk(revisionId);
if (revision) {
const before = await revision.before();
const content = await DocumentHelper.toEmailDiff(before, revision, {
includeTitle: false,
centered: false,
signedUrls: 4 * Day.seconds,
baseUrl: props.teamUrl,
});
if (revision) {
const before = await revision.before();
const content = await DocumentHelper.toEmailDiff(before, revision, {
includeTitle: false,
centered: false,
signedUrls: 4 * Day.seconds,
baseUrl: props.teamUrl,
});
// inline all css so that it works in as many email providers as possible.
body = content ? await HTMLHelper.inlineCSS(content) : undefined;
}
// inline all css so that it works in as many email providers as possible.
return content ? await HTMLHelper.inlineCSS(content) : undefined;
}
return;
},
30
);
}
return {
@@ -0,0 +1,21 @@
"use strict";
/** @type {import('sequelize-cli').Migration} */
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.sequelize.transaction(async transaction => {
await queryInterface.addColumn("teams", "approximateTotalAttachmentsSize", {
type: Sequelize.BIGINT,
defaultValue: 0,
}, { transaction });
await queryInterface.addIndex("attachments", ["createdAt"], { transaction });
});
},
async down(queryInterface, Sequelize) {
await queryInterface.sequelize.transaction(async transaction => {
await queryInterface.removeIndex("attachments", ["createdAt"], { transaction });
await queryInterface.removeColumn("teams", "approximateTotalAttachmentsSize", { transaction });
});
},
};
+2
View File
@@ -20,6 +20,8 @@ class Pin extends IdModel<
InferAttributes<Pin>,
Partial<InferCreationAttributes<Pin>>
> {
static eventNamespace = "pins";
@Length({
max: 256,
msg: `index must be 256 characters or less`,
+6
View File
@@ -25,6 +25,7 @@ import {
AfterUpdate,
BeforeUpdate,
BeforeCreate,
IsNumeric,
} from "sequelize-typescript";
import { TeamPreferenceDefaults } from "@shared/constants";
import { TeamPreference, TeamPreferences, UserRole } from "@shared/types";
@@ -151,6 +152,11 @@ class Team extends ParanoidModel<
@Column(DataType.STRING)
defaultUserRole: UserRole;
/** Approximate size in bytes of all attachments in the team. */
@IsNumeric
@Column(DataType.BIGINT)
approximateTotalAttachmentsSize: number;
@AllowNull
@Column(DataType.JSONB)
preferences: TeamPreferences | null;
+1 -1
View File
@@ -558,7 +558,7 @@ export class ProsemirrorHelper {
// Inject Mermaid script
if (mermaidElements.length) {
element.innerHTML = `
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@9/dist/mermaid.esm.min.mjs';
import mermaid from 'https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs';
mermaid.initialize({
startOnLoad: true,
fontFamily: "inherit",
@@ -852,6 +852,8 @@ export default class WebsocketsProcessor {
channels.push(
...this.getCollectionEventChannels(event, document.collection)
);
} else if (document.isWorkspaceTemplate) {
channels.push(`team-${document.teamId}`);
} else {
channels.push(`collection-${document.collectionId}`);
}
@@ -0,0 +1,31 @@
import { Attachment, Team } from "@server/models";
import BaseTask, { TaskPriority } from "./BaseTask";
type Props = {
/** The teamId to operate on */
teamId: string;
};
/**
* A task that updates the team stats.
*/
export default class UpdateTeamAttachmentsSizeTask extends BaseTask<Props> {
public async perform({ teamId }: Props) {
const sizeInBytes = await Attachment.getTotalSizeForTeam(teamId);
if (!sizeInBytes) {
return;
}
await Team.update(
{ approximateTotalAttachmentsSize: sizeInBytes },
{ where: { id: teamId } }
);
}
public get options() {
return {
attempts: 1,
priority: TaskPriority.Background,
};
}
}
@@ -0,0 +1,53 @@
import { subDays } from "date-fns";
import { Op } from "sequelize";
import Logger from "@server/logging/Logger";
import { Attachment } from "@server/models";
import { sequelize } from "@server/storage/database";
import BaseTask, { TaskPriority, TaskSchedule } from "./BaseTask";
import UpdateTeamAttachmentsSizeTask from "./UpdateTeamAttachmentsSizeTask";
type Props = {
limit: number;
};
export default class UpdateTeamsAttachmentsSizeTask extends BaseTask<Props> {
static cron = TaskSchedule.Daily;
public async perform({ limit }: Props) {
Logger.info(
"task",
`Recalculating attachment sizes for upto ${limit} teams…`
);
// Find unique attachment teamIds created in the last day, update only
// those teams' approximate attachment sizes
await Attachment.findAllInBatches<Attachment>(
{
attributes: [
[sequelize.fn("DISTINCT", sequelize.col("teamId")), "teamId"],
],
where: {
createdAt: {
[Op.gt]: subDays(new Date(), 1),
},
},
batchLimit: 100,
raw: true,
},
async (rows) => {
const teamIds = rows.map((row) => row.teamId);
for (const teamId of teamIds) {
await UpdateTeamAttachmentsSizeTask.schedule({ teamId });
}
}
);
}
public get options() {
return {
attempts: 1,
priority: TaskPriority.Background,
};
}
}
@@ -3036,6 +3036,92 @@ describe("#documents.restore", () => {
expect(body.data.collectionId).toEqual(anotherCollection.id);
});
it("should allow restore of collection templates", async () => {
const team = await buildTeam();
const user = await buildUser({ teamId: team.id });
const collection = await buildCollection({
userId: user.id,
teamId: team.id,
});
const template = await buildDocument({
template: true,
userId: user.id,
collectionId: collection.id,
teamId: team.id,
});
await template.delete(user);
const res = await server.post("/api/documents.restore", {
body: {
token: user.getJwtToken(),
id: template.id,
},
});
const body = await res.json();
expect(res.status).toEqual(200);
expect(body.data.deletedAt).toEqual(null);
expect(body.data.collectionId).toEqual(collection.id);
});
it("should allow restore of templates from a deleted collection", async () => {
const team = await buildTeam();
const user = await buildUser({ teamId: team.id });
const collection = await buildCollection({
userId: user.id,
teamId: team.id,
});
const anotherCollection = await buildCollection({
userId: user.id,
teamId: team.id,
});
const template = await buildDocument({
template: true,
userId: user.id,
collectionId: collection.id,
teamId: team.id,
});
await template.delete(user);
await collection.destroy({ hooks: false });
const res = await server.post("/api/documents.restore", {
body: {
token: user.getJwtToken(),
id: template.id,
collectionId: anotherCollection.id,
},
});
const body = await res.json();
expect(res.status).toEqual(200);
expect(body.data.deletedAt).toEqual(null);
expect(body.data.collectionId).toEqual(anotherCollection.id);
});
it("should allow restore of workspace templates", async () => {
const team = await buildTeam();
const user = await buildUser({ teamId: team.id });
const template = await buildDocument({
template: true,
userId: user.id,
teamId: team.id,
collectionId: null,
});
await template.delete(user);
const res = await server.post("/api/documents.restore", {
body: {
token: user.getJwtToken(),
id: template.id,
},
});
const body = await res.json();
expect(res.status).toEqual(200);
expect(body.data.deletedAt).toEqual(null);
expect(body.data.collectionId).toEqual(null);
});
it("should not allow restore of documents to a deleted collection", async () => {
const team = await buildTeam();
const user = await buildUser({ teamId: team.id });
+16 -3
View File
@@ -828,13 +828,14 @@ router.post(
}).findByPk(destCollectionId)
: undefined;
if (!destCollection?.isActive) {
// In case of workspace templates, both source and destination collections are undefined.
if (!document.isWorkspaceTemplate && !destCollection?.isActive) {
throw ValidationError(
"Unable to restore, the collection may have been deleted or archived"
);
}
// Skip this for drafts of a deleted collection as they won't have sourceCollectionId
// Skip this for workspace templates and drafts of a deleted collection as they won't have sourceCollectionId.
if (sourceCollectionId && sourceCollectionId !== destCollectionId) {
authorize(user, "updateDocument", srcCollection);
await srcCollection?.removeDocumentInStructure(document, {
@@ -843,7 +844,19 @@ router.post(
});
}
if (document.deletedAt) {
if (document.deletedAt && document.isWorkspaceTemplate) {
authorize(user, "restore", document);
await document.restore({ transaction });
await Event.createFromContext(ctx, {
name: "documents.restore",
documentId: document.id,
collectionId: document.collectionId,
data: {
title: document.title,
},
});
} else if (document.deletedAt) {
authorize(user, "restore", document);
authorize(user, "updateDocument", destCollection);
+25 -14
View File
@@ -1,9 +1,8 @@
import Router from "koa-router";
import { Sequelize, Op } from "sequelize";
import { Sequelize, Op, Transaction } from "sequelize";
import pinCreator from "@server/commands/pinCreator";
import pinDestroyer from "@server/commands/pinDestroyer";
import pinUpdater from "@server/commands/pinUpdater";
import auth from "@server/middlewares/authentication";
import { transaction } from "@server/middlewares/transaction";
import validate from "@server/middlewares/validate";
import { Collection, Document, Pin } from "@server/models";
import { authorize } from "@server/policies";
@@ -22,18 +21,21 @@ router.post(
"pins.create",
auth(),
validate(T.PinsCreateSchema),
transaction(),
async (ctx: APIContext<T.PinsCreateReq>) => {
const { documentId, collectionId, index } = ctx.input.body;
const { user } = ctx.state.auth;
const { transaction } = ctx.state;
const document = await Document.findByPk(documentId, {
userId: user.id,
transaction,
});
authorize(user, "read", document);
if (collectionId) {
const collection = await Collection.scope({
method: ["withMembership", user.id],
}).findByPk(collectionId);
}).findByPk(collectionId, { transaction });
authorize(user, "update", collection);
authorize(user, "pin", document);
} else {
@@ -41,10 +43,10 @@ router.post(
}
const pin = await pinCreator({
ctx,
user,
documentId,
collectionId,
ip: ctx.request.ip,
index,
});
@@ -108,13 +110,20 @@ router.post(
"pins.update",
auth(),
validate(T.PinsUpdateSchema),
transaction(),
async (ctx: APIContext<T.PinsUpdateReq>) => {
const { id, index } = ctx.input.body;
const { user } = ctx.state.auth;
let pin = await Pin.findByPk(id, { rejectOnEmpty: true });
const { transaction } = ctx.state;
const pin = await Pin.findByPk(id, {
transaction,
lock: Transaction.LOCK.UPDATE,
rejectOnEmpty: true,
});
const document = await Document.findByPk(pin.documentId, {
userId: user.id,
transaction,
});
if (pin.collectionId) {
@@ -123,12 +132,7 @@ router.post(
authorize(user, "update", pin);
}
pin = await pinUpdater({
user,
pin,
ip: ctx.request.ip,
index,
});
await pin.updateWithCtx(ctx, { index });
ctx.body = {
data: presentPin(pin),
@@ -141,14 +145,21 @@ router.post(
"pins.delete",
auth(),
validate(T.PinsDeleteSchema),
transaction(),
async (ctx: APIContext<T.PinsDeleteReq>) => {
const { id } = ctx.input.body;
const { transaction } = ctx.state;
const { user } = ctx.state.auth;
const pin = await Pin.findByPk(id, { rejectOnEmpty: true });
const pin = await Pin.findByPk(id, {
transaction,
lock: Transaction.LOCK.UPDATE,
rejectOnEmpty: true,
});
const document = await Document.findByPk(pin.documentId, {
userId: user.id,
transaction,
});
if (pin.collectionId) {
@@ -157,7 +168,7 @@ router.post(
authorize(user, "delete", pin);
}
await pinDestroyer({ user, pin, ip: ctx.request.ip });
await pin.destroyWithCtx(ctx);
ctx.body = {
success: true,
+1 -2
View File
@@ -145,14 +145,13 @@ export default class S3Storage extends BaseStorage {
const params = {
Bucket: this.getBucket(),
Key: key,
Expires: expiresIn,
};
if (isDocker) {
return `${this.getPublicEndpoint()}/${key}`;
} else {
const command = new GetObjectCommand(params);
const url = await getSignedUrl(this.client, command);
const url = await getSignedUrl(this.client, command, { expiresIn });
if (env.AWS_S3_ACCELERATE_URL) {
return url.replace(
+49
View File
@@ -1,6 +1,7 @@
import { Day } from "@shared/utils/time";
import Logger from "@server/logging/Logger";
import Redis from "@server/storage/redis";
import { MutexLock } from "./MutexLock";
/**
* A Helper class for server-side cache management
@@ -9,6 +10,54 @@ export class CacheHelper {
// Default expiry time for cache data in seconds
private static defaultDataExpiry = Day.seconds;
/**
* Given a key this method will attempt to get the data from cache store first
* If data is not found, it will call the callback to get the data and save it in cache
* using a distributed lock to prevent multiple writes.
*
* @param key Cache key
* @param callback Callback to get the data if not found in cache
* @param expiry Cache data expiry in seconds
*/
public static async getDataOrSet<T>(
key: string,
callback: () => Promise<T | undefined>,
expiry?: number
): Promise<T | undefined> {
let cache = await this.getData<T>(key);
if (cache) {
return cache;
}
// Nothing in the cache, acquire a lock to prevent multiple writes
let lock;
const lockKey = `lock:${key}`;
try {
try {
lock = await MutexLock.lock.acquire(
[lockKey],
MutexLock.defaultLockTimeout
);
} catch (err) {
Logger.error(`Could not acquire lock for ${key}`, err);
}
cache = await this.getData<T>(key);
if (cache) {
return cache;
}
// Get the data from the callback and save it in cache
const value = await callback();
if (value) {
await this.setData<T>(key, value, expiry);
}
return value;
} finally {
await lock?.release();
}
}
/**
* Given a key, gets the data from cache store
*
+22
View File
@@ -0,0 +1,22 @@
import Redlock from "redlock";
import Redis from "@server/storage/redis";
export class MutexLock {
// Default expiry time for acquiring lock in milliseconds
public static defaultLockTimeout = 4000;
/**
* Returns the redlock instance
*/
public static get lock(): Redlock {
this.redlock ??= new Redlock([Redis.defaultClient], {
retryJitter: 10,
retryCount: 20,
retryDelay: 200,
});
return this.redlock;
}
private static redlock: Redlock;
}
+2 -1
View File
@@ -7,7 +7,7 @@ import { getCookieDomain } from "@shared/utils/domains";
import env from "@server/env";
import Logger from "@server/logging/Logger";
import { Event, Collection, View } from "@server/models";
import { AuthenticationResult } from "@server/types";
import { AuthenticationResult, AuthenticationType } from "@server/types";
/**
* Parse and return the details from the "sessions" cookie in the request, if
@@ -68,6 +68,7 @@ export async function signIn(
actorId: user.id,
userId: user.id,
teamId: team.id,
authType: AuthenticationType.APP,
data: {
name: user.name,
service,
+11 -9
View File
@@ -701,7 +701,10 @@ img.ProseMirror-separator {
}
.heading-name:first-child,
.heading-name:first-child + .ProseMirror-yjs-cursor {
// Edge case where multiplayer cursor is between start of cell and heading
.heading-name:first-child + .ProseMirror-yjs-cursor,
// Edge case where table grips are between start of cell and heading
.heading-name:first-child + [role=button] + [role=button] {
& + h1,
& + h2,
& + h3,
@@ -1065,11 +1068,11 @@ a:hover {
ul,
ol {
margin: 0 0.1em 0 -26px;
margin: 0 0.1em 0 ${props.staticHTML ? "0" : "-26px"};
padding: 0 0 0 48px;
&:dir(rtl) {
margin: 0 -26px 0 0.1em;
margin: 0 ${props.staticHTML ? "0" : "-26px"} 0 0.1em;
padding: 0 48px 0 0;
}
}
@@ -1300,20 +1303,19 @@ mark {
// Hide code without display none so toolbar can still be positioned against it
&:not(.code-active) {
height: ${props.staticHTML ? "auto" : "0"};
height: ${props.staticHTML || props.readOnly ? "auto" : "0"};
margin: -0.75em 0;
overflow: hidden;
// Allows the margin to collapse correctly by moving div out of the flow
position: ${props.staticHTML ? "relative" : "absolute"};
position: ${props.staticHTML || props.readOnly ? "relative" : "absolute"};
}
}
/* Hide code without display none so toolbar can still be positioned against it */
.ProseMirror[contenteditable="false"] .code-block[data-language=mermaidjs] {
height: ${props.staticHTML ? "auto" : "0"};
margin: -0.5em 0;
overflow: hidden;
height: 0;
overflow: hidden;
margin: -0.5em 0 0 0;
}
.code-block.with-line-numbers {
+13 -5
View File
@@ -1,17 +1,25 @@
import { history, undo, redo } from "prosemirror-history";
import { undoInputRule } from "prosemirror-inputrules";
import Extension from "../lib/Extension";
import { Command } from "prosemirror-state";
import Extension, { CommandFactory } from "../lib/Extension";
export default class History extends Extension {
get name() {
return "history";
}
keys() {
commands(): Record<string, CommandFactory> {
return {
"Mod-z": undo,
"Mod-y": redo,
"Shift-Mod-z": redo,
undo: () => undo,
redo: () => redo,
};
}
keys(): Record<string, Command | CommandFactory> {
return {
"Mod-z": () => this.editor.commands.undo(),
"Mod-y": () => this.editor.commands.redo(),
"Shift-Mod-z": () => this.editor.commands.redo(),
Backspace: undoInputRule,
};
}
+28 -13
View File
@@ -1,6 +1,7 @@
import debounce from "lodash/debounce";
import last from "lodash/last";
import sortBy from "lodash/sortBy";
import type MermaidUnsafe from "mermaid";
import { Node } from "prosemirror-model";
import {
Plugin,
@@ -36,7 +37,7 @@ class Cache {
private static data: Map<string, string> = new Map();
}
let mermaid: typeof import("mermaid")["default"];
let mermaid: typeof MermaidUnsafe;
type RendererFunc = (
block: { node: Node; pos: number },
@@ -72,8 +73,16 @@ class MermaidRenderer {
return;
}
// Create a temporary element that will render the diagram off-screen. This is necessary
// as Mermaid will error if the element is not visible, such as if the heading is collapsed
const renderElement = document.createElement("div");
renderElement.style.position = "absolute";
renderElement.style.left = "-9999px";
renderElement.style.top = "-9999px";
document.body.appendChild(renderElement);
try {
mermaid = mermaid ?? (await import("mermaid")).default;
mermaid ??= (await import("mermaid")).default;
mermaid.initialize({
startOnLoad: true,
// TODO: Make dynamic based on the width of the editor or remove in
@@ -84,20 +93,24 @@ class MermaidRenderer {
theme: isDark ? "dark" : "default",
darkMode: isDark,
});
mermaid.render(
const { svg, bindFunctions } = await mermaid.render(
`mermaid-diagram-${this.diagramId}`,
text,
(svgCode, bindFunctions) => {
this.currentTextContent = text;
if (text) {
Cache.set(cacheKey, svgCode);
}
element.classList.remove("parse-error", "empty");
element.innerHTML = svgCode;
bindFunctions?.(element);
},
element
// If the element is not visible we use an off-screen element to render the diagram
element.offsetParent === null ? renderElement : element
);
this.currentTextContent = text;
// Cache the rendered SVG so we won't need to calculate it again in the same session
if (text) {
Cache.set(cacheKey, svg);
}
element.classList.remove("parse-error", "empty");
element.innerHTML = svg;
// Allow the user to interact with the diagram
bindFunctions?.(element);
} catch (error) {
const isEmpty = block.node.textContent.trim().length === 0;
@@ -108,6 +121,8 @@ class MermaidRenderer {
element.innerText = error;
element.classList.add("parse-error");
}
} finally {
renderElement.remove();
}
};
+2 -4
View File
@@ -5,9 +5,7 @@ import { Command, Plugin } from "prosemirror-state";
import { Primitive } from "utility-types";
import type { Editor } from "../../../app/editor";
export type CommandFactory = (
attrs?: Record<string, Primitive>
) => Command | void;
export type CommandFactory = (attrs?: Record<string, Primitive>) => Command;
export type WidgetProps = { rtl: boolean; readOnly: boolean | undefined };
@@ -73,7 +71,7 @@ export default class Extension {
keys(_options: {
type?: NodeType | MarkType;
schema: Schema;
}): Record<string, Command> {
}): Record<string, Command | CommandFactory> {
return {};
}
+7 -7
View File
@@ -251,13 +251,13 @@ export default class ExtensionManager {
};
const handle = (_name: string, _value: CommandFactory) => {
if (Array.isArray(_value)) {
commands[_name] = (attrs: Record<string, Primitive>) =>
_value.forEach((callback) => apply(callback, attrs));
} else if (typeof _value === "function") {
commands[_name] = ((attrs: Record<string, Primitive>) =>
apply(_value, attrs)) as CommandFactory;
}
const values: CommandFactory[] = Array.isArray(_value)
? _value
: [_value];
// @ts-expect-error FIXME
commands[_name] = (attrs: Record<string, Primitive>) =>
values.forEach((callback) => apply(callback, attrs));
};
if (typeof value === "object") {
+11 -1
View File
@@ -94,6 +94,9 @@
"Insights": "Přehledy",
"Disable viewer insights": "Vypnout analytika nahlížení",
"Enable viewer insights": "Zapnout analytika nahlížení",
"Leave document": "Leave document",
"You have left the shared document": "You have left the shared document",
"Could not leave document": "Could not leave document",
"Home": "Domovská stránka",
"Drafts": "Koncepty",
"Trash": "Koš",
@@ -305,6 +308,7 @@
"{{ firstUsername }} and {{ secondUsername }} reacted with {{ emoji }}": "{{ firstUsername }} and {{ secondUsername }} reacted with {{ emoji }}",
"{{ firstUsername }} and {{ count }} others reacted with {{ emoji }}": "{{ firstUsername }} and {{ count }} other reacted with {{ emoji }}",
"{{ firstUsername }} and {{ count }} others reacted with {{ emoji }}_plural": "{{ firstUsername }} and {{ count }} others reacted with {{ emoji }}",
"Add reaction": "Add reaction",
"Reaction picker": "Reaction picker",
"Could not load reactions": "Could not load reactions",
"Reaction": "Reaction",
@@ -350,6 +354,8 @@
"Anyone with the link can access because the parent document, <2>{{documentTitle}}</2>, is shared": "Kdokoli s odkazem má přístup, protože dokument dědí oprávnění po nadřazeném dokumentu <2>{{documentTitle}}</2>",
"Allow anyone with the link to access": "Povolit přístup komukoliv s odkazem",
"Publish to internet": "Zveřejnit na internetu",
"Search engine indexing": "Search engine indexing",
"Disable this setting to discourage search engines from indexing the page": "Disable this setting to discourage search engines from indexing the page",
"Nested documents are not shared on the web. Toggle sharing to enable access, this will be the default behavior in the future": "Vložené dokumenty nejsou sdíleny na webu. Změnit sdílení pro povolení přístupu (toto bude v budoucnu výchozí chování)",
"{{ userName }} was added to the document": "{{ userName }} was added to the document",
"{{ count }} people added to the document": "{{ count }} people added to the document",
@@ -596,6 +602,8 @@
"Most recent": "Most recent",
"Order in doc": "Order in doc",
"Resolved": "Resolved",
"Show {{ count }} reply": "Show {{ count }} reply",
"Show {{ count }} reply_plural": "Show {{ count }} replies",
"Error updating comment": "Chyba při aktualizaci komentáře",
"Document restored": "Dokument obnoven",
"Images are still uploading.\nAre you sure you want to discard them?": "Obrázky se stále nahrávají.\nOpravdu je chcete zahodit?",
@@ -785,7 +793,7 @@
"This workspace has been suspended. Please contact support to restore access.": "Tento pracovní prostor byl pozastaven. Prosím kontaktujte podporu pro obnovení přístupu.",
"Authentication failed – this login method was disabled by a team admin.": "Ověření se nezdařilo – tento způsob přihlášení byl zakázán správcem týmu.",
"The workspace you are trying to join requires an invite before you can create an account.<1></1>Please request an invite from your workspace admin and try again.": "Pracovní prostor, ke kterému se pokoušíte připojit, vyžaduje před vytvořením účtu pozvánku.<1></1> Požádejte správce pracovního prostoru o pozvánku a zkuste to znovu.",
"Sorry, your domain is not allowed. Please try again with an allowed workspace domain.": "Litujeme, vaše doména není povolena. Zkuste to znovu s povolenou doménou pracovního prostoru.",
"Sorry, an unknown error occurred.": "Sorry, an unknown error occurred.",
"Login": "Přihlášení",
"Error": "Chyba",
"Failed to load configuration.": "Nepodařilo se načíst konfiguraci.",
@@ -961,6 +969,8 @@
"When enabled, documents have a separate editing mode. When disabled, documents are always editable when you have permission.": "Pokud je povoleno, dokumenty mají samostatný režim úprav. Pokud je zakázáno, dokumenty jsou vždy upravitelné, pokud máte oprávnění.",
"Remember previous location": "Zapamatovat předchozí umístění",
"Automatically return to the document you were last viewing when the app is re-opened.": "Automaticky se vracet k dokumentu, který jste si naposledy prohlédli před ukončením aplikace.",
"Smart text replacements": "Smart text replacements",
"Auto-format text by replacing shortcuts with symbols, dashes, smart quotes, and other typographical elements.": "Auto-format text by replacing shortcuts with symbols, dashes, smart quotes, and other typographical elements.",
"You may delete your account at any time, note that this is unrecoverable": "Účet můžete kdykoliv odstranit, tento krok je neobnovitelný",
"Profile saved": "Profil uložen",
"Profile picture updated": "Profilový obrázek byl úspěšně aktualizován",
+11 -1
View File
@@ -94,6 +94,9 @@
"Insights": "Indsigt",
"Disable viewer insights": "Aktiver seerindsigter",
"Enable viewer insights": "Aktiver seerindsigter",
"Leave document": "Leave document",
"You have left the shared document": "You have left the shared document",
"Could not leave document": "Could not leave document",
"Home": "Hjem",
"Drafts": "Udkast",
"Trash": "Affald",
@@ -305,6 +308,7 @@
"{{ firstUsername }} and {{ secondUsername }} reacted with {{ emoji }}": "{{ firstUsername }} and {{ secondUsername }} reacted with {{ emoji }}",
"{{ firstUsername }} and {{ count }} others reacted with {{ emoji }}": "{{ firstUsername }} and {{ count }} other reacted with {{ emoji }}",
"{{ firstUsername }} and {{ count }} others reacted with {{ emoji }}_plural": "{{ firstUsername }} and {{ count }} others reacted with {{ emoji }}",
"Add reaction": "Add reaction",
"Reaction picker": "Reaction picker",
"Could not load reactions": "Could not load reactions",
"Reaction": "Reaction",
@@ -350,6 +354,8 @@
"Anyone with the link can access because the parent document, <2>{{documentTitle}}</2>, is shared": "Anyone with the link can access because the parent document, <2>{{documentTitle}}</2>, is shared",
"Allow anyone with the link to access": "Allow anyone with the link to access",
"Publish to internet": "Publish to internet",
"Search engine indexing": "Search engine indexing",
"Disable this setting to discourage search engines from indexing the page": "Disable this setting to discourage search engines from indexing the page",
"Nested documents are not shared on the web. Toggle sharing to enable access, this will be the default behavior in the future": "Nested documents are not shared on the web. Toggle sharing to enable access, this will be the default behavior in the future",
"{{ userName }} was added to the document": "{{ userName }} was added to the document",
"{{ count }} people added to the document": "{{ count }} people added to the document",
@@ -596,6 +602,8 @@
"Most recent": "Most recent",
"Order in doc": "Order in doc",
"Resolved": "Resolved",
"Show {{ count }} reply": "Show {{ count }} reply",
"Show {{ count }} reply_plural": "Show {{ count }} replies",
"Error updating comment": "Error updating comment",
"Document restored": "Document restored",
"Images are still uploading.\nAre you sure you want to discard them?": "Images are still uploading.\nAre you sure you want to discard them?",
@@ -785,7 +793,7 @@
"This workspace has been suspended. Please contact support to restore access.": "This workspace has been suspended. Please contact support to restore access.",
"Authentication failed – this login method was disabled by a team admin.": "Authentication failed – this login method was disabled by a team admin.",
"The workspace you are trying to join requires an invite before you can create an account.<1></1>Please request an invite from your workspace admin and try again.": "The workspace you are trying to join requires an invite before you can create an account.<1></1>Please request an invite from your workspace admin and try again.",
"Sorry, your domain is not allowed. Please try again with an allowed workspace domain.": "Sorry, your domain is not allowed. Please try again with an allowed workspace domain.",
"Sorry, an unknown error occurred.": "Sorry, an unknown error occurred.",
"Login": "Login",
"Error": "Error",
"Failed to load configuration.": "Failed to load configuration.",
@@ -961,6 +969,8 @@
"When enabled, documents have a separate editing mode. When disabled, documents are always editable when you have permission.": "When enabled, documents have a separate editing mode. When disabled, documents are always editable when you have permission.",
"Remember previous location": "Remember previous location",
"Automatically return to the document you were last viewing when the app is re-opened.": "Automatically return to the document you were last viewing when the app is re-opened.",
"Smart text replacements": "Smart text replacements",
"Auto-format text by replacing shortcuts with symbols, dashes, smart quotes, and other typographical elements.": "Auto-format text by replacing shortcuts with symbols, dashes, smart quotes, and other typographical elements.",
"You may delete your account at any time, note that this is unrecoverable": "You may delete your account at any time, note that this is unrecoverable",
"Profile saved": "Profile saved",
"Profile picture updated": "Profile picture updated",
+11 -1
View File
@@ -94,6 +94,9 @@
"Insights": "Statistiken",
"Disable viewer insights": "Leser Statistiken deaktivieren",
"Enable viewer insights": "Leser Statistiken aktivieren",
"Leave document": "Leave document",
"You have left the shared document": "You have left the shared document",
"Could not leave document": "Could not leave document",
"Home": "Startseite",
"Drafts": "Entwürfe",
"Trash": "Papierkorb",
@@ -305,6 +308,7 @@
"{{ firstUsername }} and {{ secondUsername }} reacted with {{ emoji }}": "{{ firstUsername }} and {{ secondUsername }} reacted with {{ emoji }}",
"{{ firstUsername }} and {{ count }} others reacted with {{ emoji }}": "{{ firstUsername }} and {{ count }} other reacted with {{ emoji }}",
"{{ firstUsername }} and {{ count }} others reacted with {{ emoji }}_plural": "{{ firstUsername }} and {{ count }} others reacted with {{ emoji }}",
"Add reaction": "Add reaction",
"Reaction picker": "Reaction picker",
"Could not load reactions": "Could not load reactions",
"Reaction": "Reaction",
@@ -350,6 +354,8 @@
"Anyone with the link can access because the parent document, <2>{{documentTitle}}</2>, is shared": "Jeder mit diesem Link kann darauf zugreifen, da das übergeordnete Dokument, <2>{{documentTitle}}</2>, geteilt wird",
"Allow anyone with the link to access": "Jedem mit dem Link Zugriff erlauben",
"Publish to internet": "Im Internet veröffentlichen",
"Search engine indexing": "Search engine indexing",
"Disable this setting to discourage search engines from indexing the page": "Disable this setting to discourage search engines from indexing the page",
"Nested documents are not shared on the web. Toggle sharing to enable access, this will be the default behavior in the future": "Verschachtelte Dokumente werden nicht im Web geteilt. Schalten Sie die Freigabe um, um den Zugriff zu ermöglichen, dies wird das Standardverhalten in Zukunft sein",
"{{ userName }} was added to the document": "{{ userName }} was added to the document",
"{{ count }} people added to the document": "{{ count }} people added to the document",
@@ -596,6 +602,8 @@
"Most recent": "Most recent",
"Order in doc": "Order in doc",
"Resolved": "Resolved",
"Show {{ count }} reply": "Show {{ count }} reply",
"Show {{ count }} reply_plural": "Show {{ count }} replies",
"Error updating comment": "Fehler beim Aktualisieren des Kommentars",
"Document restored": "Dokument wiederhergestellt",
"Images are still uploading.\nAre you sure you want to discard them?": "Bilder werden noch hochgeladen.\nMöchtest du sie wirklich verwerfen?",
@@ -785,7 +793,7 @@
"This workspace has been suspended. Please contact support to restore access.": "Dieser Arbeitsbereich wurde gesperrt. Bitte kontaktiere den Support, um den Zugang wiederherzustellen.",
"Authentication failed – this login method was disabled by a team admin.": "Authentifizierung fehlgeschlagen – diese Login-Methode wurde von deinem Team-Administrator deaktiviert.",
"The workspace you are trying to join requires an invite before you can create an account.<1></1>Please request an invite from your workspace admin and try again.": "Der Arbeitsbereich, dem du beitreten möchtest, benötigt eine Einladung, bevor du ein Konto erstellen kannst. <1></1>Bitte fordere eine Einladung von deinem Arbeitsbereich-Administrator an und versuche es erneut.",
"Sorry, your domain is not allowed. Please try again with an allowed workspace domain.": "Entschuldige, deine Domain ist nicht erlaubt. Bitte versuche es erneut mit einer zulässigen Arbeitsbereichs-Domain.",
"Sorry, an unknown error occurred.": "Sorry, an unknown error occurred.",
"Login": "Anmelden",
"Error": "Fehler",
"Failed to load configuration.": "Fehler beim Laden der Konfiguration.",
@@ -961,6 +969,8 @@
"When enabled, documents have a separate editing mode. When disabled, documents are always editable when you have permission.": "Wenn diese Option aktiviert ist, haben Dokumente einen separaten Bearbeitungsmodus. Wenn sie deaktiviert ist, können Dokumente immer bearbeitet werden, wenn du die Berechtigungen dazu hast.",
"Remember previous location": "Vorherige Position der Oberfläche merken",
"Automatically return to the document you were last viewing when the app is re-opened.": "Automatisch zum zuletzt angezeigten Dokument zurückkehren, wenn die App wieder geöffnet wird.",
"Smart text replacements": "Smart text replacements",
"Auto-format text by replacing shortcuts with symbols, dashes, smart quotes, and other typographical elements.": "Auto-format text by replacing shortcuts with symbols, dashes, smart quotes, and other typographical elements.",
"You may delete your account at any time, note that this is unrecoverable": "Sie können Ihren Account jederzeit löschen, beachten Sie, dass dies nicht wiederhergestellt werden kann",
"Profile saved": "Profil gespeichert",
"Profile picture updated": "Profilbild wurde aktualisiert",
@@ -308,6 +308,7 @@
"{{ firstUsername }} and {{ secondUsername }} reacted with {{ emoji }}": "{{ firstUsername }} and {{ secondUsername }} reacted with {{ emoji }}",
"{{ firstUsername }} and {{ count }} others reacted with {{ emoji }}": "{{ firstUsername }} and {{ count }} other reacted with {{ emoji }}",
"{{ firstUsername }} and {{ count }} others reacted with {{ emoji }}_plural": "{{ firstUsername }} and {{ count }} others reacted with {{ emoji }}",
"Add reaction": "Add reaction",
"Reaction picker": "Reaction picker",
"Could not load reactions": "Could not load reactions",
"Reaction": "Reaction",
@@ -601,6 +602,8 @@
"Most recent": "Most recent",
"Order in doc": "Order in doc",
"Resolved": "Resolved",
"Show {{ count }} reply": "Show {{ count }} reply",
"Show {{ count }} reply_plural": "Show {{ count }} replies",
"Error updating comment": "Error updating comment",
"Document restored": "Document restored",
"Images are still uploading.\nAre you sure you want to discard them?": "Images are still uploading.\nAre you sure you want to discard them?",
+68 -58
View File
@@ -12,12 +12,12 @@
"Star": "Marcar como favorito",
"Unstar": "Eliminar de favoritos",
"Archive": "Archivar",
"Archive collection": "Archive collection",
"Collection archived": "Collection archived",
"Archive collection": "Archivar colección",
"Collection archived": "Colección archivada",
"Archiving": "Archivando",
"Archiving this collection will also archive all documents within it. Documents from the collection will no longer be visible in search results.": "Archiving this collection will also archive all documents within it. Documents from the collection will no longer be visible in search results.",
"Archiving this collection will also archive all documents within it. Documents from the collection will no longer be visible in search results.": "Archivar esta colección también archivará todos los documentos dentro de ella. Los documentos de la colección dejarán de ser visibles en los resultados de búsqueda.",
"Restore": "Restaurar",
"Collection restored": "Collection restored",
"Collection restored": "Colección restaurada",
"Delete": "Eliminar",
"Delete collection": "Eliminar colección",
"New template": "Nueva plantilla",
@@ -25,8 +25,8 @@
"Mark as resolved": "Marcar como resuelto",
"Thread resolved": "Hilo resuelto",
"Mark as unresolved": "Marcar como no resuelto",
"View reactions": "View reactions",
"Reactions": "Reactions",
"View reactions": "Ver reacciones",
"Reactions": "Reacciones",
"Copy ID": "Copiar ID",
"Clear IndexedDB cache": "Borrar caché de IndexedDB",
"IndexedDB cache cleared": "Caché de IndexedDB borrado",
@@ -94,6 +94,9 @@
"Insights": "Estadísticas",
"Disable viewer insights": "Deshabilitar estadísticas",
"Enable viewer insights": "Habilitar estadísticas",
"Leave document": "Abandonar documento",
"You have left the shared document": "Has abandonado el documento compartido",
"Could not leave document": "No se pudo abandonar el documento",
"Home": "Inicio",
"Drafts": "Borradores",
"Trash": "Papelera",
@@ -125,9 +128,9 @@
"Select a workspace": "Seleccionar un espacio de trabajo",
"New workspace": "Nuevo espacio de trabajo",
"Create a workspace": "Crear un espacio de trabajo",
"Login to workspace": "Iniciar sesión en el área de trabajo",
"Login to workspace": "Iniciar sesión al espacio de trabajo",
"Invite people": "Invitar personas",
"Invite to workspace": "Invitar a área de trabajo",
"Invite to workspace": "Invitar al espacio de trabajo",
"Promote to {{ role }}": "Promocionar a {{ role }}",
"Demote to {{ role }}": "Degradar a {{ role }}",
"Update role": "Actualizar rol",
@@ -170,7 +173,7 @@
"Are you sure you want to permanently delete this entire comment thread?": "¿Estás seguro de que quieres eliminar permanentemente todo este hilo de comentarios?",
"Are you sure you want to permanently delete this comment?": "¿Estás seguro de que quieres eliminar este comentario permanentemente?",
"Confirm": "Confirmar",
"manage access": "manage access",
"manage access": "administrar acceso",
"view and edit access": "acceso de lectura y edición",
"view only access": "acceso de solo lectura",
"no access": "sin acceso",
@@ -241,7 +244,7 @@
"{{userName}} restored": "{{userName}} ha restaurado",
"{{userName}} deleted": "{{userName}} ha eliminado",
"{{userName}} added {{addedUserName}}": "{{userName}} añadió {{addedUserName}}",
"{{userName}} removed {{removedUserName}}": "{{userName}} eliminó {{removedUserName}}",
"{{userName}} removed {{removedUserName}}": "{{userName}} eliminó a {{removedUserName}}",
"{{userName}} moved from trash": "{{userName}} ha movido de la papelera",
"{{userName}} published": "{{userName}} ha publicado",
"{{userName}} unpublished": "{{userName}} ha despublicado",
@@ -265,15 +268,15 @@
"{{authorName}} created <3></3>": "{{authorName}} ha creado <3></3>",
"{{authorName}} opened <3></3>": "{{authorName}} abrió <3></3>",
"Search emoji": "Buscar emoji",
"Search icons": "Buscar iconos",
"Search icons": "Buscar íconos",
"Choose default skin tone": "Elige un tono de piel predeterminado",
"Show menu": "Mostrar menú",
"Icon Picker": "Selector de icono",
"Icons": "Iconos",
"Icon Picker": "Selector de ícono",
"Icons": "Íconos",
"Emojis": "Emojis",
"Remove": "Eliminar",
"All": "Todos",
"Frequently Used": "Usados con frecuencia",
"Frequently Used": "Usado Frecuentemente",
"Search Results": "Resultados de Búsqueda",
"Smileys & People": "Smileys y Personas",
"Animals & Nature": "Animales y Naturaleza",
@@ -301,18 +304,19 @@
"Mark all as read": "Marcar todas como leídas",
"You're all caught up": "Estás al día",
"Documents": "Documentos",
"{{ username }} reacted with {{ emoji }}": "{{ username }} reacted with {{ emoji }}",
"{{ username }} reacted with {{ emoji }}": "{{ username }} reaccionó con {{ emoji }}",
"{{ firstUsername }} and {{ secondUsername }} reacted with {{ emoji }}": "{{ firstUsername }} and {{ secondUsername }} reacted with {{ emoji }}",
"{{ firstUsername }} and {{ count }} others reacted with {{ emoji }}": "{{ firstUsername }} and {{ count }} other reacted with {{ emoji }}",
"{{ firstUsername }} and {{ count }} others reacted with {{ emoji }}_plural": "{{ firstUsername }} and {{ count }} others reacted with {{ emoji }}",
"Reaction picker": "Reaction picker",
"Could not load reactions": "Could not load reactions",
"Reaction": "Reaction",
"Add reaction": "Add reaction",
"Reaction picker": "Selector de reacción",
"Could not load reactions": "No se pudo cargar las reacciones",
"Reaction": "Reacción",
"Results": "Resultados",
"No results for {{query}}": "Sin resultados para {{query}}",
"Manage": "Administrar",
"All members": "Todos los miembros",
"Everyone in the workspace": "Todos en el área de trabajo",
"Everyone in the workspace": "Todos en el espacio de trabajo",
"Invite": "Invitar",
"{{ userName }} was added to the collection": "{{ userName }} fue agregado a la colección",
"{{ count }} people added to the collection": "{{ count }} persona añadida a la colección",
@@ -323,14 +327,14 @@
"Add or invite": "Añadir o invitar",
"Viewer": "Lector",
"Editor": "Editor",
"Suggestions for invitation": "Sugerencias para la invitación",
"Suggestions for invitation": "Sugerencias para invitar",
"No matches": "No hay coincidencias",
"Can view": "Puede visualizar",
"Everyone in the collection": "Todos en la colección",
"You have full access": "Tienes acceso total",
"Created the document": "Documento creado",
"Other people": "Otras personas",
"Other workspace members may have access": "Otros miembros del área de trabajo pueden tener acceso",
"Other workspace members may have access": "Otros miembros del espacio de trabajo pueden tener acceso",
"This document may be shared with more workspace members through a parent document or collection you do not have access to": "Este documento puede ser compartido con más miembros del área de trabajo a través de un documento padre o colección a la que no tienes acceso",
"Access inherited from collection": "Acceso heredado de la colección",
"{{ userName }} was removed from the document": "{{ userName }} fue quitado del documento",
@@ -350,6 +354,8 @@
"Anyone with the link can access because the parent document, <2>{{documentTitle}}</2>, is shared": "Cualquiera con el enlace puede acceder porque el documento padre, <2>{{documentTitle}}</2>, es compartido",
"Allow anyone with the link to access": "Permitir acceso a cualquiera con el enlace",
"Publish to internet": "Publicar en Internet",
"Search engine indexing": "Indexación del motor de búsqueda",
"Disable this setting to discourage search engines from indexing the page": "Disable this setting to discourage search engines from indexing the page",
"Nested documents are not shared on the web. Toggle sharing to enable access, this will be the default behavior in the future": "Los documentos anidados no son compartidos en la web. Cambia las reglas de compartir para habilitar el acceso, este será el comportamiento predeterminado en el futuro",
"{{ userName }} was added to the document": "{{ userName }} ha sido añadido al documento",
"{{ count }} people added to the document": "{{ count }} persona ha sido añadida al documento",
@@ -357,8 +363,8 @@
"{{ count }} groups added to the document": "{{ count }} grupo invitado al documento",
"{{ count }} groups added to the document_plural": "{{ count }} grupos invitados al documento",
"Logo": "Logo",
"Archived collections": "Archived collections",
"Change permissions?": "Change permissions?",
"Archived collections": "Colecciones archivadas",
"Change permissions?": "¿Cambiar permisos?",
"New doc": "Nuevo doc",
"You can't reorder documents in an alphabetically sorted collection": "No puedes reordenar documentos en una colección ordenada alfabéticamente",
"Empty": "Vacío",
@@ -414,7 +420,7 @@
"Align center": "Centrar",
"Align left": "Alinear a la izquierda",
"Align right": "Alinear a la derecha",
"Default width": "Ancho por Defecto",
"Default width": "Ancho predeterminado",
"Full width": "Ancho total",
"Bulleted list": "Lista con viñetas",
"Todo list": "Lista de tareas",
@@ -425,7 +431,7 @@
"Create link": "Nuevo enlace",
"Sorry, an error occurred creating the link": "Lo sentimos, se ha producido un error al crear el enlace",
"Create a new doc": "Crea un nuevo documento",
"Create a new child doc": "Crea un nuevo documento hijo",
"Create a new child doc": "Crear un nuevo documento hijo",
"Delete table": "Eliminar tabla",
"Delete file": "Eliminar el archivo",
"Download file": "Descargar el archivo",
@@ -466,11 +472,11 @@
"Strikethrough": "Tachado",
"Bold": "Negrita",
"Subheading": "Sub-encabezado",
"Sort ascending": "Orden ascendente",
"Sort descending": "Orden descendiente",
"Sort ascending": "Ordenar ascendentemente",
"Sort descending": "Ordenar descendientemente",
"Table": "Tabla",
"Export as CSV": "Export as CSV",
"Toggle header": "Conmutar cabecera",
"Export as CSV": "Exportar como CSV",
"Toggle header": "Mostrar/Ocultar cabecera",
"Math inline (LaTeX)": "Fórmula matemática en línea (LaTeX)",
"Math block (LaTeX)": "Bloque de matemáticas (LaTeX)",
"Tip": "Sugerencia",
@@ -507,11 +513,11 @@
"Export collection": "Exportar colección",
"Rename": "Renombrar",
"Sort in sidebar": "Ordenar en barra lateral",
"A-Z sort": "A-Z sort",
"Z-A sort": "Z-A sort",
"A-Z sort": "Ordenado A-Z",
"Z-A sort": "Ordenado Z-A",
"Manual sort": "Orden manual",
"Comment options": "Opciones de los comentarios",
"Show document menu": "Mostrar menú de documento",
"Show document menu": "Mostrar menú del documento",
"{{ documentName }} restored": "{{ documentName }} restaurado",
"Document options": "Opciones del documento",
"Choose a collection": "Elige una colección",
@@ -554,14 +560,14 @@
"Choose a date": "Elige una fecha",
"API key created. Please copy the value now as it will not be shown again.": "API key created. Please copy the value now as it will not be shown again.",
"Name your key something that will help you to remember it's use in the future, for example \"local development\" or \"continuous integration\".": "Dale a tu token un nombre que te permita recordar su uso en el futuro, por ejemplo \"desarrollo local\", \"producción\" o \"integración continua\".",
"Expiration": "Caducidad",
"Never expires": "Nunca caduca",
"Expiration": "Expiración",
"Never expires": "Nunca expira",
"7 days": "7 días",
"30 days": "30 días",
"60 days": "60 días",
"90 days": "90 días",
"Custom": "Personalizado",
"No expiration": "Sin caducidad",
"No expiration": "Sin expiración",
"The document archive is empty at the moment.": "El archivo está vacío en este momento.",
"Collection menu": "Menú de la colección",
"Drop documents to import": "Arrastra los documentos para importar",
@@ -591,11 +597,13 @@
"Upload image": "Subir una imagen",
"No resolved comments": "No hay comentarios resueltos",
"No comments yet": "Aún no hay comentarios",
"New comments": "New comments",
"Sort comments": "Sort comments",
"Most recent": "Most recent",
"New comments": "Nuevos comentarios",
"Sort comments": "Ordenar comentarios",
"Most recent": "Más reciente",
"Order in doc": "Order in doc",
"Resolved": "Resolved",
"Resolved": "Resuelto",
"Show {{ count }} reply": "Mostrar {{ count }} respuesta",
"Show {{ count }} reply_plural": "Mostrar {{ count }} respuestas",
"Error updating comment": "Error actualizando el comentario",
"Document restored": "Documento restaurado",
"Images are still uploading.\nAre you sure you want to discard them?": "Las imágenes aún se están cargando.\n¿Estás seguro de que quieres descartarlas?",
@@ -714,7 +722,7 @@
"Can manage all workspace settings": "Puede administrar todos los ajustes del área de trabajo",
"Can create, edit, and delete documents": "Puede crear, editar y eliminar documentos",
"Can view and comment": "Puede ver y comentar",
"Invite people to join your workspace. They can sign in with {{signinMethods}} or use their email address.": "Invita personas a unirse a tu área de trabajo. Pueden iniciar sesión con {{signinMethods}} o usar su dirección de correo electrónico.",
"Invite people to join your workspace. They can sign in with {{signinMethods}} or use their email address.": "Invita personas a unirse a tu espacio de trabajo. Pueden iniciar sesión con {{signinMethods}} o utilizar su dirección de correo electrónico.",
"Invite members to join your workspace. They will need to sign in with {{signinMethods}}.": "Invita a miembros del equipo o invitados a unirse a tu espacio de trabajo. Ellos deberán iniciar sesión con {{signinMethods}}.",
"As an admin you can also <2>enable email sign-in</2>.": "Como administrador, también puedes <2>habilitar el inicio de sesión por correo electrónico</2>.",
"Invite as": "Invitar como",
@@ -754,7 +762,7 @@
"Move list item down": "Mover elemento de la lista abajo",
"Tables": "Tablas",
"Insert row": "Insertar fila",
"Next cell": "Siguiente celda",
"Next cell": "Celda siguiente",
"Previous cell": "Celda anterior",
"Space": "Espacio",
"Numbered list": "Lista numerada",
@@ -785,7 +793,7 @@
"This workspace has been suspended. Please contact support to restore access.": "Este espacio de trabajo ha sido suspendido. Ponte en contacto con soporte para restaurar el acceso.",
"Authentication failed – this login method was disabled by a team admin.": "Autenticación fallida – este método de acceso fue deshabilitado por un administrador del equipo.",
"The workspace you are trying to join requires an invite before you can create an account.<1></1>Please request an invite from your workspace admin and try again.": "El espacio de trabajo al que estás intentando unirte requiere una invitación antes de que puedas crear una cuenta.<1></1>Por favor, solicita una invitación del administrador de tu espacio de trabajo e inténtalo de nuevo.",
"Sorry, your domain is not allowed. Please try again with an allowed workspace domain.": "Lo sentimos, tu dominio no está permitido. Por favor, inténtelo de nuevo con un dominio permitido en el espacio de trabajo.",
"Sorry, an unknown error occurred.": "Sorry, an unknown error occurred.",
"Login": "Iniciar sesión",
"Error": "Error",
"Failed to load configuration.": "No se pudo cargar la configuración.",
@@ -961,6 +969,8 @@
"When enabled, documents have a separate editing mode. When disabled, documents are always editable when you have permission.": "Cuando está activada, los documentos tienen un modo de edición separada. Cuando está desactivada, los documentos son siempre editables si tienes permiso de edición.",
"Remember previous location": "Recordar ubicación anterior",
"Automatically return to the document you were last viewing when the app is re-opened.": "Volver automáticamente al documento que estabas viendo cuando la aplicación se vuelva a abrir.",
"Smart text replacements": "Sustituciones inteligentes de texto",
"Auto-format text by replacing shortcuts with symbols, dashes, smart quotes, and other typographical elements.": "Auto-format text by replacing shortcuts with symbols, dashes, smart quotes, and other typographical elements.",
"You may delete your account at any time, note that this is unrecoverable": "Puedes eliminar tu cuenta en cualquier momento, ten en cuenta que esta es una operación irreversible",
"Profile saved": "Perfil guardado",
"Profile picture updated": "Foto de perfil guardada",
@@ -1025,11 +1035,11 @@
"This month": "Este mes",
"Last month": "El mes pasado",
"This year": "Este año",
"Expired yesterday": "Caducó ayer",
"Expired {{ date }}": "Caducó {{ date }}",
"Expires today": "Caduca hoy",
"Expires tomorrow": "Caduca mañana",
"Expires {{ date }}": "Caduca el {{ date }}",
"Expired yesterday": "Expiró ayer",
"Expired {{ date }}": "Expiró el {{ date }}",
"Expires today": "Expira hoy",
"Expires tomorrow": "Expira mañana",
"Expires {{ date }}": "Expira el {{ date }}",
"Connect": "Conectar",
"Whoops, you need to accept the permissions in GitHub to connect {{appName}} to your workspace. Try again?": "Ups, necesitas aceptar los permisos en GitHub para conectar {{appName}} a tu área de trabajo. ¿Intentar de nuevo?",
"Something went wrong while authenticating your request. Please try logging in again.": "Ocurrió un error autenticando tu solicitud. Por favor, intenta iniciar sesión de nuevo.",
@@ -1037,15 +1047,15 @@
"Enable previews of GitHub issues and pull requests in documents by connecting a GitHub organization or specific repositories to {appName}.": "Habilitar vistas previas de incidencias de GitHub y pull requests en documentos conectando una organización de GitHub o repositorios específicos a {appName}.",
"Enabled by {{integrationCreatedBy}}": "Habilitado por {{integrationCreatedBy}}",
"Disconnecting will prevent previewing GitHub links from this organization in documents. Are you sure?": "Desconectar impedirá previsualizar los enlaces de GitHub de esta organización en documentos. ¿Estás seguro?",
"The GitHub integration is currently disabled. Please set the associated environment variables and restart the server to enable the integration.": "La integración de GitHub está actualmente desactivada. Configura las variables de entorno asociadas y reinicia el servidor para habilitar la integración.",
"The GitHub integration is currently disabled. Please set the associated environment variables and restart the server to enable the integration.": "La integración de GitHub está desactivada. Configura las variables de entorno asociadas y reinicia el servidor para habilitar la integración.",
"Google Analytics": "Google Analytics",
"Add a Google Analytics 4 measurement ID to send document views and analytics from the workspace to your own Google Analytics account.": "Añade un ID de seguimiento de Google Analytics 4 para enviar vistas y análisis de documentos desde el espacio de trabajo a tu propia cuenta de Google Analytics.",
"Measurement ID": "ID de seguimiento",
"Create a \"Web\" stream in your Google Analytics admin dashboard and copy the measurement ID from the generated code snippet to install.": "Crea un flujo \"Web\" en tu panel de administración de Google Analytics y copia el ID de seguimiento del fragmento de código generado para instalar.",
"Configure a Matomo installation to send views and analytics from the workspace to your own Matomo instance.": "Configura una instalación de Matomo para enviar vistas y análisis desde el espacio de trabajo a tu propia instancia de Matomo.",
"Configure a Matomo installation to send views and analytics from the workspace to your own Matomo instance.": "Configura una instalación de Matomo para enviar vistas y analíticas desde el espacio de trabajo a tu propia instancia de Matomo.",
"Instance URL": "URL de la instancia",
"The URL of your Matomo instance. If you are using Matomo Cloud it will end in matomo.cloud/": "La URL de tu instancia Matomo. Si estás usando Matomo Cloud terminará en matomo.cloud/",
"Site ID": "Identificador del sitio",
"The URL of your Matomo instance. If you are using Matomo Cloud it will end in matomo.cloud/": "La URL de tu instancia Matomo. Si estás usando Matomo Cloud, esta terminará en matomo.cloud/",
"Site ID": "ID del sitio",
"An ID that uniquely identifies the website in your Matomo instance.": "Un ID que identifica de forma única el sitio web en tu instancia de Matomo.",
"Add to Slack": "Añadir a Slack",
"document published": "documento publicado",
@@ -1057,11 +1067,11 @@
"Personal account": "Cuenta personal",
"Link your {{appName}} account to Slack to enable searching and previewing the documents you have access to, directly within chat.": "Vincula tu cuenta {{appName}} a Slack para permitir buscar y previsualizar los documentos a los que tienes acceso, directamente dentro del chat.",
"Disconnecting your personal account will prevent searching for documents from Slack. Are you sure?": "Desconectar tu cuenta personal impedirá la búsqueda de documentos desde Slack. ¿Estás seguro?",
"Slash command": "Comando de barra",
"Get rich previews of {{ appName }} links shared in Slack and use the <em>{{ command }}</em> slash command to search for documents without leaving your chat.": "Obtén vistas previas enriquecidas de los enlaces de {{ appName }} compartidos en Slack y usa el comando <em>{{ command }}</em> para buscar documentos sin salir de tu chat.",
"This will remove the Outline slash command from your Slack workspace. Are you sure?": "Esto eliminará el comando de barra de Outline de tu espacio de trabajo Slack. ¿Estás seguro?",
"Slash command": "Comando de barra inclinada",
"Get rich previews of {{ appName }} links shared in Slack and use the <em>{{ command }}</em> slash command to search for documents without leaving your chat.": "Obtén vistas previas enriquecidas de los enlaces de {{ appName }} compartidos en Slack y usa el comando de barra inclinada <em>{{ command }}</em> para buscar documentos sin salir de tu chat.",
"This will remove the Outline slash command from your Slack workspace. Are you sure?": "Esto eliminará el comando de barra inclinada de Outline de tu espacio de trabajo de Slack. ¿Estás seguro?",
"Connect {{appName}} collections to Slack channels. Messages will be automatically posted to Slack when documents are published or updated.": "Conecta las colecciones de {{appName}} a canales de Slack. Se publicarán mensajes automáticamente en Slack cuando los documentos se publiquen o actualicen.",
"Comment by {{ author }} on \"{{ title }}\"": "Comentario de {{ author }} sobre \"{{ title }}\"",
"Comment by {{ author }} on \"{{ title }}\"": "Comentario de {{ author }} en \"{{ title }}\"",
"How to use {{ command }}": "Cómo utilizar {{ command }}",
"To search your workspace use {{ command }}. \nType {{ command2 }} help to display this help text.": "Para buscar en tu espacio de trabajo usa {{ command }}. \nEscribe {{ command2 }} help para mostrar este texto de ayuda.",
"Post to Channel": "Publicar en Canal",
@@ -1070,10 +1080,10 @@
"It looks like you haven’t linked your {{ appName }} account to Slack yet": "Parece que aún no has vinculado tu cuenta {{ appName }} a Slack",
"Link your account": "Vincula tu cuenta",
"Link your account in {{ appName }} settings to search from Slack": "Vincula tu cuenta en la configuración de {{ appName }} para buscar desde Slack",
"Configure a Umami installation to send views and analytics from the workspace to your own Umami instance.": "Configura una instalación de Umami para enviar vistas y análisis desde el espacio de trabajo a tu propia instancia de Umami.",
"The URL of your Umami instance. If you are using Umami Cloud it will begin with {{ url }}": "La URL de tu instancia Umami. Si estás usando Umami Cloud terminará en {{ url }}",
"Configure a Umami installation to send views and analytics from the workspace to your own Umami instance.": "Configura una instalación de Umami para enviar vistas y analíticas desde el espacio de trabajo a tu propia instancia de Umami.",
"The URL of your Umami instance. If you are using Umami Cloud it will begin with {{ url }}": "La URL de tu instancia Umami. Si estás usando Umami Cloud, esta empezará con {{ url }}",
"Script name": "Nombre del script",
"The name of the script file that Umami uses to track analytics.": "El nombre del archivo de script que Umami utiliza para el seguimiento de analíticas",
"The name of the script file that Umami uses to track analytics.": "El nombre del archivo script que Umami utiliza para el seguimiento de analíticas.",
"An ID that uniquely identifies the website in your Umami instance.": "Un ID que identifica de forma única el sitio web en tu instancia de Umami.",
"Are you sure you want to delete the {{ name }} webhook?": "¿Estás seguro de que quieres eliminar el webhook {{ name }}?",
"Webhook updated": "Webhook actualizado",
+18 -8
View File
@@ -1,11 +1,11 @@
{
"New API key": "New API key",
"New API key": "کلید API جدید",
"Open collection": "باز کردن مجموعه",
"New collection": "مجموعه جدید",
"Create a collection": "ایجاد مجموعه",
"Edit": "ویرایش",
"Edit collection": "ویرایش مجموعه",
"Permissions": "دسترسی‌ها",
"Permissions": "دسترسی ها",
"Collection permissions": "دسترسی‌های مجموعه",
"Share this collection": "Share this collection",
"Search in collection": "جستجو در مجموعه",
@@ -22,7 +22,7 @@
"Delete collection": "حذف مجموعه",
"New template": "قالب جدید",
"Delete comment": "Delete comment",
"Mark as resolved": "Mark as resolved",
"Mark as resolved": "",
"Thread resolved": "Thread resolved",
"Mark as unresolved": "Mark as unresolved",
"View reactions": "View reactions",
@@ -81,19 +81,22 @@
"Move": "انتقال",
"Move to collection": "Move to collection",
"Move {{ documentType }}": "انتقال {{ documentType }}",
"Are you sure you want to archive this document?": "Are you sure you want to archive this document?",
"Are you sure you want to archive this document?": "آیا اطمینان دارید که میخواهید این سند را بایگانی کنید ؟",
"Document archived": "سند آرشیو شد",
"Archiving this document will remove it from the collection and search results.": "Archiving this document will remove it from the collection and search results.",
"Archiving this document will remove it from the collection and search results.": "بایگانی کردن این سند به حذف آن نتایج جستجو و مجموعه های خواهد انجامید.",
"Delete {{ documentName }}": "حذف {{ documentName }}",
"Permanently delete": "حذف برای همیشه",
"Permanently delete {{ documentName }}": "حذف همیشگی {{ documentName }}",
"Empty trash": "خالی کردن زباله دان",
"Permanently delete documents in trash": "Permanently delete documents in trash",
"Permanently delete documents in trash": "",
"Comments": "نظرات",
"History": "تاریخچه",
"Insights": "بینش ها",
"Disable viewer insights": "Disable viewer insights",
"Enable viewer insights": "Enable viewer insights",
"Leave document": "Leave document",
"You have left the shared document": "You have left the shared document",
"Could not leave document": "Could not leave document",
"Home": "خانه",
"Drafts": "پیش‌نویس‌ها",
"Trash": "زباله‌دان",
@@ -125,7 +128,7 @@
"Select a workspace": "انتخاب فضای کاری",
"New workspace": "فضای کار جدید",
"Create a workspace": "فضای کاری ایجاد کنید",
"Login to workspace": "Login to workspace",
"Login to workspace": "وارد شدن به workspace",
"Invite people": "دعوت از افراد",
"Invite to workspace": "Invite to workspace",
"Promote to {{ role }}": "Promote to {{ role }}",
@@ -305,6 +308,7 @@
"{{ firstUsername }} and {{ secondUsername }} reacted with {{ emoji }}": "{{ firstUsername }} and {{ secondUsername }} reacted with {{ emoji }}",
"{{ firstUsername }} and {{ count }} others reacted with {{ emoji }}": "{{ firstUsername }} and {{ count }} other reacted with {{ emoji }}",
"{{ firstUsername }} and {{ count }} others reacted with {{ emoji }}_plural": "{{ firstUsername }} and {{ count }} others reacted with {{ emoji }}",
"Add reaction": "Add reaction",
"Reaction picker": "Reaction picker",
"Could not load reactions": "Could not load reactions",
"Reaction": "Reaction",
@@ -350,6 +354,8 @@
"Anyone with the link can access because the parent document, <2>{{documentTitle}}</2>, is shared": "Anyone with the link can access because the parent document, <2>{{documentTitle}}</2>, is shared",
"Allow anyone with the link to access": "Allow anyone with the link to access",
"Publish to internet": "انتشار روی اینترنت",
"Search engine indexing": "Search engine indexing",
"Disable this setting to discourage search engines from indexing the page": "Disable this setting to discourage search engines from indexing the page",
"Nested documents are not shared on the web. Toggle sharing to enable access, this will be the default behavior in the future": "Nested documents are not shared on the web. Toggle sharing to enable access, this will be the default behavior in the future",
"{{ userName }} was added to the document": "{{ userName }} was added to the document",
"{{ count }} people added to the document": "{{ count }} people added to the document",
@@ -596,6 +602,8 @@
"Most recent": "Most recent",
"Order in doc": "Order in doc",
"Resolved": "Resolved",
"Show {{ count }} reply": "Show {{ count }} reply",
"Show {{ count }} reply_plural": "Show {{ count }} replies",
"Error updating comment": "Error updating comment",
"Document restored": "سند بازیابی شد",
"Images are still uploading.\nAre you sure you want to discard them?": "تصاویر هنوز در حال بارگذاری هستند.\nآیا مطمئن هستید که می خواهید آنها را نادیده بگیرید؟",
@@ -785,7 +793,7 @@
"This workspace has been suspended. Please contact support to restore access.": "This workspace has been suspended. Please contact support to restore access.",
"Authentication failed – this login method was disabled by a team admin.": "Authentication failed – this login method was disabled by a team admin.",
"The workspace you are trying to join requires an invite before you can create an account.<1></1>Please request an invite from your workspace admin and try again.": "The workspace you are trying to join requires an invite before you can create an account.<1></1>Please request an invite from your workspace admin and try again.",
"Sorry, your domain is not allowed. Please try again with an allowed workspace domain.": "Sorry, your domain is not allowed. Please try again with an allowed workspace domain.",
"Sorry, an unknown error occurred.": "Sorry, an unknown error occurred.",
"Login": "ورود",
"Error": "Error",
"Failed to load configuration.": "پیکربندی بارگیری نشد.",
@@ -961,6 +969,8 @@
"When enabled, documents have a separate editing mode. When disabled, documents are always editable when you have permission.": "When enabled, documents have a separate editing mode. When disabled, documents are always editable when you have permission.",
"Remember previous location": "Remember previous location",
"Automatically return to the document you were last viewing when the app is re-opened.": "Automatically return to the document you were last viewing when the app is re-opened.",
"Smart text replacements": "Smart text replacements",
"Auto-format text by replacing shortcuts with symbols, dashes, smart quotes, and other typographical elements.": "Auto-format text by replacing shortcuts with symbols, dashes, smart quotes, and other typographical elements.",
"You may delete your account at any time, note that this is unrecoverable": "همیشه می‌توانید حساب‌تان را حذف کنید، ولی توجه داشته باشید که این عملیات قابل بازگشت نیست",
"Profile saved": "پروفایل ذخیره شد",
"Profile picture updated": "تصویر پروفایل به‌روز شد",
Loaded 100 of 124 files, more files were not shown because too many files have changed in this diff. Show more