chore: Move to prettier standard double quotes (#1309)
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
// @flow
|
||||
import styled from 'styled-components';
|
||||
import Flex from 'shared/components/Flex';
|
||||
import styled from "styled-components";
|
||||
import Flex from "shared/components/Flex";
|
||||
|
||||
const Container = styled(Flex)`
|
||||
position: relative;
|
||||
margin-top: ${props => (props.isShare ? '50px' : '0')};
|
||||
margin-top: ${props => (props.isShare ? "50px" : "0")};
|
||||
`;
|
||||
|
||||
export default Container;
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import { darken } from 'polished';
|
||||
import breakpoint from 'styled-components-breakpoint';
|
||||
import useWindowScrollPosition from '@rehooks/window-scroll-position';
|
||||
import HelpText from 'components/HelpText';
|
||||
import styled from 'styled-components';
|
||||
import * as React from "react";
|
||||
import { darken } from "polished";
|
||||
import breakpoint from "styled-components-breakpoint";
|
||||
import useWindowScrollPosition from "@rehooks/window-scroll-position";
|
||||
import HelpText from "components/HelpText";
|
||||
import styled from "styled-components";
|
||||
|
||||
const HEADING_OFFSET = 20;
|
||||
|
||||
@@ -72,7 +72,7 @@ export default function Contents({ headings }: Props) {
|
||||
);
|
||||
}
|
||||
|
||||
const Wrapper = styled('div')`
|
||||
const Wrapper = styled("div")`
|
||||
display: none;
|
||||
position: sticky;
|
||||
top: 80px;
|
||||
@@ -82,16 +82,16 @@ const Wrapper = styled('div')`
|
||||
margin-right: 2em;
|
||||
min-height: 40px;
|
||||
|
||||
${breakpoint('desktopLarge')`
|
||||
${breakpoint("desktopLarge")`
|
||||
margin-left: -16em;
|
||||
`};
|
||||
|
||||
${breakpoint('tablet')`
|
||||
${breakpoint("tablet")`
|
||||
display: block;
|
||||
`};
|
||||
`;
|
||||
|
||||
const Heading = styled('h3')`
|
||||
const Heading = styled("h3")`
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
text-transform: uppercase;
|
||||
@@ -107,16 +107,16 @@ const Empty = styled(HelpText)`
|
||||
font-size: 14px;
|
||||
`;
|
||||
|
||||
const ListItem = styled('li')`
|
||||
const ListItem = styled("li")`
|
||||
margin-left: ${props => (props.level - 1) * 10}px;
|
||||
margin-bottom: 8px;
|
||||
padding-right: 2em;
|
||||
line-height: 1.3;
|
||||
border-right: 3px solid
|
||||
${props => (props.active ? props.theme.textSecondary : 'transparent')};
|
||||
${props => (props.active ? props.theme.textSecondary : "transparent")};
|
||||
`;
|
||||
|
||||
const Link = styled('a')`
|
||||
const Link = styled("a")`
|
||||
color: ${props => props.theme.text};
|
||||
font-size: 14px;
|
||||
|
||||
@@ -125,7 +125,7 @@ const Link = styled('a')`
|
||||
}
|
||||
`;
|
||||
|
||||
const List = styled('ol')`
|
||||
const List = styled("ol")`
|
||||
min-width: 14em;
|
||||
width: 14em;
|
||||
padding: 0;
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import invariant from 'invariant';
|
||||
import { withRouter } from 'react-router-dom';
|
||||
import type { Location, RouterHistory } from 'react-router-dom';
|
||||
import { observable } from 'mobx';
|
||||
import { observer, inject } from 'mobx-react';
|
||||
import { matchDocumentEdit, updateDocumentUrl } from 'utils/routeHelpers';
|
||||
import DocumentComponent from './Document';
|
||||
import Revision from 'models/Revision';
|
||||
import Document from 'models/Document';
|
||||
import SocketPresence from './SocketPresence';
|
||||
import Loading from './Loading';
|
||||
import HideSidebar from './HideSidebar';
|
||||
import Error404 from 'scenes/Error404';
|
||||
import ErrorOffline from 'scenes/ErrorOffline';
|
||||
import DocumentsStore from 'stores/DocumentsStore';
|
||||
import PoliciesStore from 'stores/PoliciesStore';
|
||||
import RevisionsStore from 'stores/RevisionsStore';
|
||||
import UiStore from 'stores/UiStore';
|
||||
import { OfflineError } from 'utils/errors';
|
||||
import * as React from "react";
|
||||
import invariant from "invariant";
|
||||
import { withRouter } from "react-router-dom";
|
||||
import type { Location, RouterHistory } from "react-router-dom";
|
||||
import { observable } from "mobx";
|
||||
import { observer, inject } from "mobx-react";
|
||||
import { matchDocumentEdit, updateDocumentUrl } from "utils/routeHelpers";
|
||||
import DocumentComponent from "./Document";
|
||||
import Revision from "models/Revision";
|
||||
import Document from "models/Document";
|
||||
import SocketPresence from "./SocketPresence";
|
||||
import Loading from "./Loading";
|
||||
import HideSidebar from "./HideSidebar";
|
||||
import Error404 from "scenes/Error404";
|
||||
import ErrorOffline from "scenes/ErrorOffline";
|
||||
import DocumentsStore from "stores/DocumentsStore";
|
||||
import PoliciesStore from "stores/PoliciesStore";
|
||||
import RevisionsStore from "stores/RevisionsStore";
|
||||
import UiStore from "stores/UiStore";
|
||||
import { OfflineError } from "utils/errors";
|
||||
|
||||
type Props = {|
|
||||
match: Object,
|
||||
@@ -84,13 +84,13 @@ class DataLoader extends React.Component<Props> {
|
||||
|
||||
onCreateLink = async (title: string) => {
|
||||
const document = this.document;
|
||||
invariant(document, 'document must be loaded to create link');
|
||||
invariant(document, "document must be loaded to create link");
|
||||
|
||||
const newDocument = await this.props.documents.create({
|
||||
collectionId: document.collectionId,
|
||||
parentDocumentId: document.parentDocumentId,
|
||||
title,
|
||||
text: '',
|
||||
text: "",
|
||||
});
|
||||
|
||||
return newDocument.url;
|
||||
@@ -166,7 +166,7 @@ class DataLoader extends React.Component<Props> {
|
||||
}
|
||||
|
||||
const abilities = policies.abilities(document.id);
|
||||
const key = this.isEditing ? 'editing' : 'read-only';
|
||||
const key = this.isEditing ? "editing" : "read-only";
|
||||
|
||||
return (
|
||||
<SocketPresence documentId={document.id} isEditing={this.isEditing}>
|
||||
@@ -187,5 +187,5 @@ class DataLoader extends React.Component<Props> {
|
||||
}
|
||||
|
||||
export default withRouter(
|
||||
inject('ui', 'auth', 'documents', 'revisions', 'policies')(DataLoader)
|
||||
inject("ui", "auth", "documents", "revisions", "policies")(DataLoader)
|
||||
);
|
||||
|
||||
@@ -1,42 +1,42 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import { debounce } from 'lodash';
|
||||
import styled, { withTheme } from 'styled-components';
|
||||
import breakpoint from 'styled-components-breakpoint';
|
||||
import { observable } from 'mobx';
|
||||
import { observer, inject } from 'mobx-react';
|
||||
import { Prompt, Route, withRouter } from 'react-router-dom';
|
||||
import type { Location, RouterHistory } from 'react-router-dom';
|
||||
import keydown from 'react-keydown';
|
||||
import Flex from 'shared/components/Flex';
|
||||
import * as React from "react";
|
||||
import { debounce } from "lodash";
|
||||
import styled, { withTheme } from "styled-components";
|
||||
import breakpoint from "styled-components-breakpoint";
|
||||
import { observable } from "mobx";
|
||||
import { observer, inject } from "mobx-react";
|
||||
import { Prompt, Route, withRouter } from "react-router-dom";
|
||||
import type { Location, RouterHistory } from "react-router-dom";
|
||||
import keydown from "react-keydown";
|
||||
import Flex from "shared/components/Flex";
|
||||
import {
|
||||
collectionUrl,
|
||||
documentMoveUrl,
|
||||
documentHistoryUrl,
|
||||
documentEditUrl,
|
||||
documentUrl,
|
||||
} from 'utils/routeHelpers';
|
||||
import { emojiToUrl } from 'utils/emoji';
|
||||
} from "utils/routeHelpers";
|
||||
import { emojiToUrl } from "utils/emoji";
|
||||
|
||||
import Header from './Header';
|
||||
import DocumentMove from './DocumentMove';
|
||||
import KeyboardShortcutsButton from './KeyboardShortcutsButton';
|
||||
import References from './References';
|
||||
import Loading from './Loading';
|
||||
import Container from './Container';
|
||||
import Contents from './Contents';
|
||||
import MarkAsViewed from './MarkAsViewed';
|
||||
import ErrorBoundary from 'components/ErrorBoundary';
|
||||
import LoadingIndicator from 'components/LoadingIndicator';
|
||||
import PageTitle from 'components/PageTitle';
|
||||
import Branding from 'shared/components/Branding';
|
||||
import Notice from 'shared/components/Notice';
|
||||
import Time from 'shared/components/Time';
|
||||
import Header from "./Header";
|
||||
import DocumentMove from "./DocumentMove";
|
||||
import KeyboardShortcutsButton from "./KeyboardShortcutsButton";
|
||||
import References from "./References";
|
||||
import Loading from "./Loading";
|
||||
import Container from "./Container";
|
||||
import Contents from "./Contents";
|
||||
import MarkAsViewed from "./MarkAsViewed";
|
||||
import ErrorBoundary from "components/ErrorBoundary";
|
||||
import LoadingIndicator from "components/LoadingIndicator";
|
||||
import PageTitle from "components/PageTitle";
|
||||
import Branding from "shared/components/Branding";
|
||||
import Notice from "shared/components/Notice";
|
||||
import Time from "shared/components/Time";
|
||||
|
||||
import UiStore from 'stores/UiStore';
|
||||
import AuthStore from 'stores/AuthStore';
|
||||
import Document from 'models/Document';
|
||||
import Revision from 'models/Revision';
|
||||
import UiStore from "stores/UiStore";
|
||||
import AuthStore from "stores/AuthStore";
|
||||
import Document from "models/Document";
|
||||
import Revision from "models/Revision";
|
||||
|
||||
let EditorImport;
|
||||
const AUTOSAVE_DELAY = 3000;
|
||||
@@ -104,7 +104,7 @@ class DocumentScene extends React.Component<Props> {
|
||||
{
|
||||
timeout: 30 * 1000,
|
||||
action: {
|
||||
text: 'Reload',
|
||||
text: "Reload",
|
||||
onClick: () => {
|
||||
window.location.href = documentUrl(document);
|
||||
},
|
||||
@@ -123,7 +123,7 @@ class DocumentScene extends React.Component<Props> {
|
||||
window.document.body.style.background = this.props.theme.background;
|
||||
}
|
||||
|
||||
@keydown('m')
|
||||
@keydown("m")
|
||||
goToMove(ev) {
|
||||
if (!this.props.readOnly) return;
|
||||
|
||||
@@ -135,7 +135,7 @@ class DocumentScene extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
@keydown('e')
|
||||
@keydown("e")
|
||||
goToEdit(ev) {
|
||||
if (!this.props.readOnly) return;
|
||||
|
||||
@@ -147,7 +147,7 @@ class DocumentScene extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
@keydown('esc')
|
||||
@keydown("esc")
|
||||
goBack(ev) {
|
||||
if (this.props.readOnly) return;
|
||||
|
||||
@@ -155,7 +155,7 @@ class DocumentScene extends React.Component<Props> {
|
||||
this.props.history.goBack();
|
||||
}
|
||||
|
||||
@keydown('h')
|
||||
@keydown("h")
|
||||
goToHistory(ev) {
|
||||
if (!this.props.readOnly) return;
|
||||
|
||||
@@ -169,7 +169,7 @@ class DocumentScene extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
@keydown('meta+shift+p')
|
||||
@keydown("meta+shift+p")
|
||||
onPublish(ev) {
|
||||
ev.preventDefault();
|
||||
const { document } = this.props;
|
||||
@@ -177,7 +177,7 @@ class DocumentScene extends React.Component<Props> {
|
||||
this.onSave({ publish: true, done: true });
|
||||
}
|
||||
|
||||
@keydown('meta+ctrl+h')
|
||||
@keydown("meta+ctrl+h")
|
||||
onToggleTableOfContents(ev) {
|
||||
if (!this.props.readOnly) return;
|
||||
|
||||
@@ -195,7 +195,7 @@ class DocumentScene extends React.Component<Props> {
|
||||
if (this.editorComponent) return;
|
||||
|
||||
try {
|
||||
const EditorImport = await import('./Editor');
|
||||
const EditorImport = await import("./Editor");
|
||||
this.editorComponent = EditorImport.default;
|
||||
} catch (err) {
|
||||
console.error(err);
|
||||
@@ -227,7 +227,7 @@ class DocumentScene extends React.Component<Props> {
|
||||
const title = this.title;
|
||||
|
||||
// prevent save before anything has been written (single hash is empty doc)
|
||||
if (text.trim() === '' && title.trim === '') return;
|
||||
if (text.trim() === "" && title.trim === "") return;
|
||||
|
||||
// prevent autosave if nothing has changed
|
||||
if (
|
||||
@@ -278,7 +278,7 @@ class DocumentScene extends React.Component<Props> {
|
||||
const bodyChanged = editorText !== document.text.trim();
|
||||
|
||||
// a single hash is a doc with just an empty title
|
||||
this.isEmpty = (!editorText || editorText === '#') && !this.title;
|
||||
this.isEmpty = (!editorText || editorText === "#") && !this.title;
|
||||
this.isDirty = bodyChanged || titleChanged;
|
||||
};
|
||||
|
||||
@@ -351,7 +351,7 @@ class DocumentScene extends React.Component<Props> {
|
||||
)}
|
||||
/>
|
||||
<PageTitle
|
||||
title={document.title.replace(document.emoji, '') || 'Untitled'}
|
||||
title={document.title.replace(document.emoji, "") || "Untitled"}
|
||||
favicon={document.emoji ? emojiToUrl(document.emoji) : undefined}
|
||||
/>
|
||||
{(this.isUploading || this.isSaving) && <LoadingIndicator />}
|
||||
@@ -394,18 +394,18 @@ class DocumentScene extends React.Component<Props> {
|
||||
{document.archivedAt &&
|
||||
!document.deletedAt && (
|
||||
<Notice muted>
|
||||
Archived by {document.updatedBy.name}{' '}
|
||||
Archived by {document.updatedBy.name}{" "}
|
||||
<Time dateTime={document.archivedAt} /> ago
|
||||
</Notice>
|
||||
)}
|
||||
{document.deletedAt && (
|
||||
<Notice muted>
|
||||
Deleted by {document.updatedBy.name}{' '}
|
||||
Deleted by {document.updatedBy.name}{" "}
|
||||
<Time dateTime={document.deletedAt} /> ago
|
||||
{document.permanentlyDeletedAt && (
|
||||
<React.Fragment>
|
||||
<br />
|
||||
This document will be permanently deleted in{' '}
|
||||
This document will be permanently deleted in{" "}
|
||||
<Time dateTime={document.permanentlyDeletedAt} /> unless
|
||||
restored.
|
||||
</React.Fragment>
|
||||
@@ -427,7 +427,7 @@ class DocumentScene extends React.Component<Props> {
|
||||
}
|
||||
}}
|
||||
isDraft={document.isDraft}
|
||||
key={disableEmbeds ? 'embeds-disabled' : 'embeds-enabled'}
|
||||
key={disableEmbeds ? "embeds-disabled" : "embeds-enabled"}
|
||||
title={revision ? revision.title : this.title}
|
||||
document={document}
|
||||
value={readOnly ? value : undefined}
|
||||
@@ -470,7 +470,7 @@ const Background = styled(Container)`
|
||||
transition: ${props => props.theme.backgroundTransition};
|
||||
`;
|
||||
|
||||
const ReferencesWrapper = styled('div')`
|
||||
const ReferencesWrapper = styled("div")`
|
||||
margin-top: ${props => (props.isOnlyTitle ? -45 : 16)}px;
|
||||
|
||||
@media print {
|
||||
@@ -485,17 +485,17 @@ const MaxWidth = styled(Flex)`
|
||||
max-width: 100vw;
|
||||
width: 100%;
|
||||
|
||||
${breakpoint('tablet')`
|
||||
${breakpoint("tablet")`
|
||||
padding: 0 24px;
|
||||
margin: 4px auto 12px;
|
||||
max-width: calc(48px + ${props => (props.tocVisible ? '64em' : '46em')});
|
||||
max-width: calc(48px + ${props => (props.tocVisible ? "64em" : "46em")});
|
||||
`};
|
||||
|
||||
${breakpoint('desktopLarge')`
|
||||
${breakpoint("desktopLarge")`
|
||||
max-width: calc(48px + 46em);
|
||||
`};
|
||||
`;
|
||||
|
||||
export default withRouter(
|
||||
inject('ui', 'auth', 'policies', 'revisions')(withTheme(DocumentScene))
|
||||
inject("ui", "auth", "policies", "revisions")(withTheme(DocumentScene))
|
||||
);
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { inject } from 'mobx-react';
|
||||
import ViewsStore from 'stores/ViewsStore';
|
||||
import Document from 'models/Document';
|
||||
import PublishingInfo from 'components/PublishingInfo';
|
||||
import * as React from "react";
|
||||
import styled from "styled-components";
|
||||
import { inject } from "mobx-react";
|
||||
import ViewsStore from "stores/ViewsStore";
|
||||
import Document from "models/Document";
|
||||
import PublishingInfo from "components/PublishingInfo";
|
||||
|
||||
type Props = {|
|
||||
views: ViewsStore,
|
||||
@@ -19,8 +19,8 @@ function DocumentMeta({ views, isDraft, document }: Props) {
|
||||
<Meta document={document}>
|
||||
{totalViews && !isDraft ? (
|
||||
<React.Fragment>
|
||||
· Viewed{' '}
|
||||
{totalViews === 1 ? 'once' : `${totalViews} times`}
|
||||
· Viewed{" "}
|
||||
{totalViews === 1 ? "once" : `${totalViews} times`}
|
||||
</React.Fragment>
|
||||
) : null}
|
||||
</Meta>
|
||||
@@ -36,4 +36,4 @@ const Meta = styled(PublishingInfo)`
|
||||
}
|
||||
`;
|
||||
|
||||
export default inject('views')(DocumentMeta);
|
||||
export default inject("views")(DocumentMeta);
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { observable, computed } from 'mobx';
|
||||
import { observer, inject } from 'mobx-react';
|
||||
import { Search } from 'js-search';
|
||||
import { last } from 'lodash';
|
||||
import ArrowKeyNavigation from 'boundless-arrow-key-navigation';
|
||||
import styled from 'styled-components';
|
||||
import * as React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import { observable, computed } from "mobx";
|
||||
import { observer, inject } from "mobx-react";
|
||||
import { Search } from "js-search";
|
||||
import { last } from "lodash";
|
||||
import ArrowKeyNavigation from "boundless-arrow-key-navigation";
|
||||
import styled from "styled-components";
|
||||
|
||||
import Modal from 'components/Modal';
|
||||
import Input from 'components/Input';
|
||||
import Labeled from 'components/Labeled';
|
||||
import PathToDocument from 'components/PathToDocument';
|
||||
import Flex from 'shared/components/Flex';
|
||||
import Modal from "components/Modal";
|
||||
import Input from "components/Input";
|
||||
import Labeled from "components/Labeled";
|
||||
import PathToDocument from "components/PathToDocument";
|
||||
import Flex from "shared/components/Flex";
|
||||
|
||||
import Document from 'models/Document';
|
||||
import DocumentsStore from 'stores/DocumentsStore';
|
||||
import UiStore from 'stores/UiStore';
|
||||
import CollectionsStore, { type DocumentPath } from 'stores/CollectionsStore';
|
||||
import Document from "models/Document";
|
||||
import DocumentsStore from "stores/DocumentsStore";
|
||||
import UiStore from "stores/UiStore";
|
||||
import CollectionsStore, { type DocumentPath } from "stores/CollectionsStore";
|
||||
|
||||
const MAX_RESULTS = 8;
|
||||
|
||||
@@ -39,8 +39,8 @@ class DocumentMove extends React.Component<Props> {
|
||||
get searchIndex() {
|
||||
const { collections } = this.props;
|
||||
const paths = collections.pathsToDocuments;
|
||||
const index = new Search('id');
|
||||
index.addIndex('title');
|
||||
const index = new Search("id");
|
||||
index.addIndex("title");
|
||||
|
||||
// Build index
|
||||
const indexeableDocuments = [];
|
||||
@@ -90,7 +90,7 @@ class DocumentMove extends React.Component<Props> {
|
||||
};
|
||||
|
||||
handleSuccess = () => {
|
||||
this.props.ui.showToast('Document moved');
|
||||
this.props.ui.showToast("Document moved");
|
||||
this.props.onRequestClose();
|
||||
};
|
||||
|
||||
@@ -180,4 +180,4 @@ const StyledArrowKeyNavigation = styled(ArrowKeyNavigation)`
|
||||
flex: 1;
|
||||
`;
|
||||
|
||||
export default inject('documents', 'collections', 'ui')(DocumentMove);
|
||||
export default inject("documents", "collections", "ui")(DocumentMove);
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import styled from 'styled-components';
|
||||
import Textarea from 'react-autosize-textarea';
|
||||
import { observer } from 'mobx-react';
|
||||
import Editor from 'components/Editor';
|
||||
import ClickablePadding from 'components/ClickablePadding';
|
||||
import Flex from 'shared/components/Flex';
|
||||
import parseTitle from 'shared/utils/parseTitle';
|
||||
import Document from 'models/Document';
|
||||
import DocumentMeta from './DocumentMeta';
|
||||
import * as React from "react";
|
||||
import styled from "styled-components";
|
||||
import Textarea from "react-autosize-textarea";
|
||||
import { observer } from "mobx-react";
|
||||
import Editor from "components/Editor";
|
||||
import ClickablePadding from "components/ClickablePadding";
|
||||
import Flex from "shared/components/Flex";
|
||||
import parseTitle from "shared/utils/parseTitle";
|
||||
import Document from "models/Document";
|
||||
import DocumentMeta from "./DocumentMeta";
|
||||
|
||||
type Props = {
|
||||
onChangeTitle: (event: SyntheticInputEvent<>) => void,
|
||||
@@ -44,7 +44,7 @@ class DocumentEditor extends React.Component<Props> {
|
||||
};
|
||||
|
||||
handleTitleKeyDown = (event: SyntheticKeyboardEvent<>) => {
|
||||
if (event.key === 'Enter' || event.key === 'Tab') {
|
||||
if (event.key === "Enter" || event.key === "Tab") {
|
||||
event.preventDefault();
|
||||
this.focusAtStart();
|
||||
}
|
||||
@@ -62,8 +62,8 @@ class DocumentEditor extends React.Component<Props> {
|
||||
onChange={onChangeTitle}
|
||||
onKeyDown={this.handleTitleKeyDown}
|
||||
placeholder="Start with a title…"
|
||||
value={!title && readOnly ? 'Untitled' : title}
|
||||
style={startsWithEmojiAndSpace ? { marginLeft: '-1.2em' } : undefined}
|
||||
value={!title && readOnly ? "Untitled" : title}
|
||||
style={startsWithEmojiAndSpace ? { marginLeft: "-1.2em" } : undefined}
|
||||
readOnly={readOnly}
|
||||
autoFocus={!title}
|
||||
maxLength={100}
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import { throttle } from 'lodash';
|
||||
import { observable } from 'mobx';
|
||||
import { observer, inject } from 'mobx-react';
|
||||
import { Redirect } from 'react-router-dom';
|
||||
import styled from 'styled-components';
|
||||
import breakpoint from 'styled-components-breakpoint';
|
||||
import { TableOfContentsIcon, EditIcon, PlusIcon } from 'outline-icons';
|
||||
import { transparentize, darken } from 'polished';
|
||||
import Document from 'models/Document';
|
||||
import AuthStore from 'stores/AuthStore';
|
||||
import { documentEditUrl } from 'utils/routeHelpers';
|
||||
import { meta } from 'utils/keyboard';
|
||||
import * as React from "react";
|
||||
import { throttle } from "lodash";
|
||||
import { observable } from "mobx";
|
||||
import { observer, inject } from "mobx-react";
|
||||
import { Redirect } from "react-router-dom";
|
||||
import styled from "styled-components";
|
||||
import breakpoint from "styled-components-breakpoint";
|
||||
import { TableOfContentsIcon, EditIcon, PlusIcon } from "outline-icons";
|
||||
import { transparentize, darken } from "polished";
|
||||
import Document from "models/Document";
|
||||
import AuthStore from "stores/AuthStore";
|
||||
import { documentEditUrl } from "utils/routeHelpers";
|
||||
import { meta } from "utils/keyboard";
|
||||
|
||||
import Flex from 'shared/components/Flex';
|
||||
import Breadcrumb, { Slash } from 'shared/components/Breadcrumb';
|
||||
import DocumentMenu from 'menus/DocumentMenu';
|
||||
import NewChildDocumentMenu from 'menus/NewChildDocumentMenu';
|
||||
import DocumentShare from 'scenes/DocumentShare';
|
||||
import Button from 'components/Button';
|
||||
import Tooltip from 'components/Tooltip';
|
||||
import Modal from 'components/Modal';
|
||||
import Fade from 'components/Fade';
|
||||
import Badge from 'components/Badge';
|
||||
import Collaborators from 'components/Collaborators';
|
||||
import { Action, Separator } from 'components/Actions';
|
||||
import PoliciesStore from 'stores/PoliciesStore';
|
||||
import UiStore from 'stores/UiStore';
|
||||
import Flex from "shared/components/Flex";
|
||||
import Breadcrumb, { Slash } from "shared/components/Breadcrumb";
|
||||
import DocumentMenu from "menus/DocumentMenu";
|
||||
import NewChildDocumentMenu from "menus/NewChildDocumentMenu";
|
||||
import DocumentShare from "scenes/DocumentShare";
|
||||
import Button from "components/Button";
|
||||
import Tooltip from "components/Tooltip";
|
||||
import Modal from "components/Modal";
|
||||
import Fade from "components/Fade";
|
||||
import Badge from "components/Badge";
|
||||
import Collaborators from "components/Collaborators";
|
||||
import { Action, Separator } from "components/Actions";
|
||||
import PoliciesStore from "stores/PoliciesStore";
|
||||
import UiStore from "stores/UiStore";
|
||||
|
||||
type Props = {
|
||||
auth: AuthStore,
|
||||
@@ -55,11 +55,11 @@ class Header extends React.Component<Props> {
|
||||
@observable redirectTo: ?string;
|
||||
|
||||
componentDidMount() {
|
||||
window.addEventListener('scroll', this.handleScroll);
|
||||
window.addEventListener("scroll", this.handleScroll);
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener('scroll', this.handleScroll);
|
||||
window.removeEventListener("scroll", this.handleScroll);
|
||||
}
|
||||
|
||||
updateIsScrolled = () => {
|
||||
@@ -95,7 +95,7 @@ class Header extends React.Component<Props> {
|
||||
handleClickTitle = () => {
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: 'smooth',
|
||||
behavior: "smooth",
|
||||
});
|
||||
};
|
||||
|
||||
@@ -145,7 +145,7 @@ class Header extends React.Component<Props> {
|
||||
<React.Fragment>
|
||||
<Slash />
|
||||
<Tooltip
|
||||
tooltip={ui.tocVisible ? 'Hide contents' : 'Show contents'}
|
||||
tooltip={ui.tocVisible ? "Hide contents" : "Show contents"}
|
||||
shortcut={`ctrl+${meta}+h`}
|
||||
delay={250}
|
||||
placement="bottom"
|
||||
@@ -215,7 +215,7 @@ class Header extends React.Component<Props> {
|
||||
neutral={isDraft}
|
||||
small
|
||||
>
|
||||
{isDraft ? 'Save Draft' : 'Done Editing'}
|
||||
{isDraft ? "Save Draft" : "Done Editing"}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</Action>
|
||||
@@ -237,7 +237,7 @@ class Header extends React.Component<Props> {
|
||||
disabled={publishingIsDisabled}
|
||||
small
|
||||
>
|
||||
{isPublishing ? 'Publishing…' : 'Publish'}
|
||||
{isPublishing ? "Publishing…" : "Publish"}
|
||||
</Button>
|
||||
</Tooltip>
|
||||
</Action>
|
||||
@@ -307,7 +307,7 @@ const Status = styled.div`
|
||||
const BreadcrumbAndContents = styled(Flex)`
|
||||
display: none;
|
||||
|
||||
${breakpoint('tablet')`
|
||||
${breakpoint("tablet")`
|
||||
display: flex;
|
||||
width: 33.3%;
|
||||
`};
|
||||
@@ -318,7 +318,7 @@ const Wrapper = styled(Flex)`
|
||||
align-self: flex-end;
|
||||
height: 32px;
|
||||
|
||||
${breakpoint('tablet')`
|
||||
${breakpoint("tablet")`
|
||||
width: 33.3%;
|
||||
`};
|
||||
`;
|
||||
@@ -334,7 +334,7 @@ const Actions = styled(Flex)`
|
||||
${props =>
|
||||
props.isCompact
|
||||
? darken(0.05, props.theme.sidebarBackground)
|
||||
: 'transparent'};
|
||||
: "transparent"};
|
||||
padding: 12px;
|
||||
transition: all 100ms ease-out;
|
||||
transform: translate3d(0, 0, 0);
|
||||
@@ -344,8 +344,8 @@ const Actions = styled(Flex)`
|
||||
display: none;
|
||||
}
|
||||
|
||||
${breakpoint('tablet')`
|
||||
padding: ${props => (props.isCompact ? '12px' : `24px 24px 0`)};
|
||||
${breakpoint("tablet")`
|
||||
padding: ${props => (props.isCompact ? "12px" : `24px 24px 0`)};
|
||||
`};
|
||||
`;
|
||||
|
||||
@@ -361,10 +361,10 @@ const Title = styled.div`
|
||||
display: none;
|
||||
width: 0;
|
||||
|
||||
${breakpoint('tablet')`
|
||||
${breakpoint("tablet")`
|
||||
display: flex;
|
||||
flex-grow: 1;
|
||||
`};
|
||||
`;
|
||||
|
||||
export default inject('auth', 'ui', 'policies')(Header);
|
||||
export default inject("auth", "ui", "policies")(Header);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import UiStore from 'stores/UiStore';
|
||||
import * as React from "react";
|
||||
import UiStore from "stores/UiStore";
|
||||
|
||||
type Props = {
|
||||
ui: UiStore,
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import styled from 'styled-components';
|
||||
import breakpoint from 'styled-components-breakpoint';
|
||||
import { observable } from 'mobx';
|
||||
import { observer } from 'mobx-react';
|
||||
import { KeyboardIcon } from 'outline-icons';
|
||||
import Modal from 'components/Modal';
|
||||
import Tooltip from 'components/Tooltip';
|
||||
import NudeButton from 'components/NudeButton';
|
||||
import KeyboardShortcuts from 'scenes/KeyboardShortcuts';
|
||||
import * as React from "react";
|
||||
import styled from "styled-components";
|
||||
import breakpoint from "styled-components-breakpoint";
|
||||
import { observable } from "mobx";
|
||||
import { observer } from "mobx-react";
|
||||
import { KeyboardIcon } from "outline-icons";
|
||||
import Modal from "components/Modal";
|
||||
import Tooltip from "components/Tooltip";
|
||||
import NudeButton from "components/NudeButton";
|
||||
import KeyboardShortcuts from "scenes/KeyboardShortcuts";
|
||||
|
||||
type Props = {};
|
||||
|
||||
@@ -56,7 +56,7 @@ const Button = styled(NudeButton)`
|
||||
right: 0;
|
||||
margin: 24px;
|
||||
|
||||
${breakpoint('tablet')`
|
||||
${breakpoint("tablet")`
|
||||
display: block;
|
||||
`};
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import type { Location } from 'react-router-dom';
|
||||
import Container from './Container';
|
||||
import LoadingPlaceholder from 'components/LoadingPlaceholder';
|
||||
import CenteredContent from 'components/CenteredContent';
|
||||
import PageTitle from 'components/PageTitle';
|
||||
import * as React from "react";
|
||||
import type { Location } from "react-router-dom";
|
||||
import Container from "./Container";
|
||||
import LoadingPlaceholder from "components/LoadingPlaceholder";
|
||||
import CenteredContent from "components/CenteredContent";
|
||||
import PageTitle from "components/PageTitle";
|
||||
|
||||
type Props = {|
|
||||
location: Location,
|
||||
@@ -13,7 +13,7 @@ type Props = {|
|
||||
export default function Loading({ location }: Props) {
|
||||
return (
|
||||
<Container column auto>
|
||||
<PageTitle title={location.state ? location.state.title : 'Untitled'} />
|
||||
<PageTitle title={location.state ? location.state.title : "Untitled"} />
|
||||
<CenteredContent>
|
||||
<LoadingPlaceholder />
|
||||
</CenteredContent>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import Document from 'models/Document';
|
||||
import * as React from "react";
|
||||
import Document from "models/Document";
|
||||
|
||||
const MARK_AS_VIEWED_AFTER = 3 * 1000;
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import { observer } from 'mobx-react';
|
||||
import { Link } from 'react-router-dom';
|
||||
import styled from 'styled-components';
|
||||
import PublishingInfo from 'components/PublishingInfo';
|
||||
import Document from 'models/Document';
|
||||
import type { NavigationNode } from 'types';
|
||||
import * as React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { Link } from "react-router-dom";
|
||||
import styled from "styled-components";
|
||||
import PublishingInfo from "components/PublishingInfo";
|
||||
import Document from "models/Document";
|
||||
import type { NavigationNode } from "types";
|
||||
|
||||
type Props = {
|
||||
document: Document | NavigationNode,
|
||||
@@ -39,8 +39,8 @@ const Title = styled.h3`
|
||||
margin-top: 0;
|
||||
margin-bottom: 0.25em;
|
||||
white-space: nowrap;
|
||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
|
||||
Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
|
||||
Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
|
||||
`;
|
||||
|
||||
@observer
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import { observer, inject } from 'mobx-react';
|
||||
import { withRouter, type Location } from 'react-router-dom';
|
||||
import Fade from 'components/Fade';
|
||||
import Tabs from 'components/Tabs';
|
||||
import Tab from 'components/Tab';
|
||||
import DocumentsStore from 'stores/DocumentsStore';
|
||||
import CollectionsStore from 'stores/CollectionsStore';
|
||||
import Document from 'models/Document';
|
||||
import ReferenceListItem from './ReferenceListItem';
|
||||
import * as React from "react";
|
||||
import { observer, inject } from "mobx-react";
|
||||
import { withRouter, type Location } from "react-router-dom";
|
||||
import Fade from "components/Fade";
|
||||
import Tabs from "components/Tabs";
|
||||
import Tab from "components/Tab";
|
||||
import DocumentsStore from "stores/DocumentsStore";
|
||||
import CollectionsStore from "stores/CollectionsStore";
|
||||
import Document from "models/Document";
|
||||
import ReferenceListItem from "./ReferenceListItem";
|
||||
|
||||
type Props = {
|
||||
document: Document,
|
||||
@@ -34,7 +34,7 @@ class References extends React.Component<Props> {
|
||||
const showBacklinks = !!backlinks.length;
|
||||
const showChildren = !!children.length;
|
||||
const isBacklinksTab =
|
||||
this.props.location.hash === '#backlinks' || !showChildren;
|
||||
this.props.location.hash === "#backlinks" || !showChildren;
|
||||
|
||||
return (
|
||||
(showBacklinks || showChildren) && (
|
||||
@@ -80,4 +80,4 @@ class References extends React.Component<Props> {
|
||||
}
|
||||
}
|
||||
|
||||
export default withRouter(inject('documents', 'collections')(References));
|
||||
export default withRouter(inject("documents", "collections")(References));
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import { SocketContext } from 'components/SocketProvider';
|
||||
import { USER_PRESENCE_INTERVAL } from 'shared/constants';
|
||||
import * as React from "react";
|
||||
import { SocketContext } from "components/SocketProvider";
|
||||
import { USER_PRESENCE_INTERVAL } from "shared/constants";
|
||||
|
||||
type Props = {
|
||||
children?: React.Node,
|
||||
@@ -33,8 +33,8 @@ export default class SocketPresence extends React.Component<Props> {
|
||||
|
||||
componentWillUnmount() {
|
||||
if (this.context) {
|
||||
this.context.emit('leave', { documentId: this.props.documentId });
|
||||
this.context.off('authenticated', this.emitJoin);
|
||||
this.context.emit("leave", { documentId: this.props.documentId });
|
||||
this.context.off("authenticated", this.emitJoin);
|
||||
}
|
||||
|
||||
clearInterval(this.editingInterval);
|
||||
@@ -47,7 +47,7 @@ export default class SocketPresence extends React.Component<Props> {
|
||||
if (this.context.authenticated) {
|
||||
this.emitJoin();
|
||||
}
|
||||
this.context.on('authenticated', () => {
|
||||
this.context.on("authenticated", () => {
|
||||
this.emitJoin();
|
||||
});
|
||||
}
|
||||
@@ -56,7 +56,7 @@ export default class SocketPresence extends React.Component<Props> {
|
||||
emitJoin = () => {
|
||||
if (!this.context) return;
|
||||
|
||||
this.context.emit('join', {
|
||||
this.context.emit("join", {
|
||||
documentId: this.props.documentId,
|
||||
isEditing: this.props.isEditing,
|
||||
});
|
||||
@@ -65,7 +65,7 @@ export default class SocketPresence extends React.Component<Props> {
|
||||
emitPresence = () => {
|
||||
if (!this.context) return;
|
||||
|
||||
this.context.emit('presence', {
|
||||
this.context.emit("presence", {
|
||||
documentId: this.props.documentId,
|
||||
isEditing: this.props.isEditing,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user