Merge pull request #24 from fantasticit/feat/format

This commit is contained in:
fantasticit 2022-04-01 12:14:12 +08:00 committed by GitHub
commit 5fe787d371
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
27 changed files with 33 additions and 30 deletions

View File

@ -1,7 +1,7 @@
import type { IComment } from '@think/domains'; import type { IComment } from '@think/domains';
import { useState } from 'react'; import { useState } from 'react';
import useSWR from 'swr'; import useSWR from 'swr';
import { HttpClient } from 'services/HttpClient'; import { HttpClient } from 'services/http-client';
export type CreateCommentDto = Pick<IComment, 'parentCommentId' | 'html' | 'replyUserId'>; export type CreateCommentDto = Pick<IComment, 'parentCommentId' | 'html' | 'replyUserId'>;

View File

@ -2,7 +2,7 @@ import type { IUser, IDocument, IWiki } from '@think/domains';
import useSWR from 'swr'; import useSWR from 'swr';
import { useState, useCallback, useEffect } from 'react'; import { useState, useCallback, useEffect } from 'react';
import { useAsyncLoading } from 'hooks/use-async-loading'; import { useAsyncLoading } from 'hooks/use-async-loading';
import { HttpClient } from 'services/HttpClient'; import { HttpClient } from 'services/http-client';
import { getPublicDocumentDetail } from 'services/document'; import { getPublicDocumentDetail } from 'services/document';
interface IAuthority { interface IAuthority {

View File

@ -1,7 +1,7 @@
import type { IMessage } from '@think/domains'; import type { IMessage } from '@think/domains';
import { useState } from 'react'; import { useState } from 'react';
import useSWR from 'swr'; import useSWR from 'swr';
import { HttpClient } from 'services/HttpClient'; import { HttpClient } from 'services/http-client';
/** /**
* *

View File

@ -1,7 +1,7 @@
import type { ITemplate } from '@think/domains'; import type { ITemplate } from '@think/domains';
import { useState } from 'react'; import { useState } from 'react';
import useSWR from 'swr'; import useSWR from 'swr';
import { HttpClient } from 'services/HttpClient'; import { HttpClient } from 'services/http-client';
export const usePublicTemplates = () => { export const usePublicTemplates = () => {
const [page, setPage] = useState(1); const [page, setPage] = useState(1);

View File

@ -2,7 +2,7 @@ import type { IUser, ILoginUser } from '@think/domains';
import useSWR from 'swr'; import useSWR from 'swr';
import { useCallback, useEffect } from 'react'; import { useCallback, useEffect } from 'react';
import Router, { useRouter } from 'next/router'; import Router, { useRouter } from 'next/router';
import { HttpClient } from 'services/HttpClient'; import { HttpClient } from 'services/http-client';
import { getStorage, setStorage } from 'helpers/storage'; import { getStorage, setStorage } from 'helpers/storage';
export const useUser = () => { export const useUser = () => {

View File

@ -1,7 +1,7 @@
import { CollectType, IDocument, IUser, IWiki, IWikiUser } from '@think/domains'; import { CollectType, IDocument, IUser, IWiki, IWikiUser } from '@think/domains';
import useSWR from 'swr'; import useSWR from 'swr';
import { useState } from 'react'; import { useState } from 'react';
import { HttpClient } from 'services/HttpClient'; import { HttpClient } from 'services/http-client';
export type ICreateWiki = Pick<IWiki, 'name' | 'description'>; export type ICreateWiki = Pick<IWiki, 'name' | 'description'>;
export type IUpdateWiki = Partial<IWiki>; export type IUpdateWiki = Partial<IWiki>;

View File

@ -1,5 +1,5 @@
import { IDocument, IUser, IWiki } from '@think/domains'; import { IDocument, IUser, IWiki } from '@think/domains';
import { HttpClient } from './HttpClient'; import { HttpClient } from './http-client';
/** /**
* *

View File

@ -1,4 +1,4 @@
import { HttpClient } from './HttpClient'; import { HttpClient } from './http-client';
const ONE_MB = 1 * 1024 * 1024; const ONE_MB = 1 * 1024 * 1024;

View File

@ -1,5 +1,5 @@
import type { IUser } from '@think/domains'; import type { IUser } from '@think/domains';
import { HttpClient } from './HttpClient'; import { HttpClient } from './http-client';
export const register = (data: Partial<IUser>): Promise<IUser> => { export const register = (data: Partial<IUser>): Promise<IUser> => {
return HttpClient.post('/user/register', data); return HttpClient.post('/user/register', data);

View File

@ -6,10 +6,4 @@ export class Blockquote extends Node {
matching() { matching() {
return this.DOMNode.nodeName === 'BLOCKQUOTE'; return this.DOMNode.nodeName === 'BLOCKQUOTE';
} }
// data() {
// return {
// type: 'blockquote',
// };
// }
} }

View File

@ -0,0 +1,9 @@
import { Node } from './node';
export class Blockquote extends Node {
type = 'blockquote';
matching() {
return this.DOMNode.nodeName === 'BLOCKQUOTE';
}
}

View File

@ -3,17 +3,17 @@ import { Iframe } from './nodes/iframe';
import { Attachment } from './nodes/attachment'; import { Attachment } from './nodes/attachment';
import { Banner } from './nodes/banner'; import { Banner } from './nodes/banner';
import { Status } from './nodes/status'; import { Status } from './nodes/status';
import { DocumentReference } from './nodes/documentReference'; import { DocumentReference } from './nodes/document-reference';
import { DocumentChildren } from './nodes/documentChildren'; import { DocumentChildren } from './nodes/document-children';
import { Mind } from './nodes/mind'; import { Mind } from './nodes/mind';
// 通用 // 通用
import { CodeBlock } from './nodes/codeBlock'; import { CodeBlock } from './nodes/code-block';
import { CodeBlockWrapper } from './nodes/codeBlockWrapper'; import { CodeBlockWrapper } from './nodes/code-block-wrapper';
import { HardBreak } from './nodes/hardBreak'; import { HardBreak } from './nodes/hard-break';
import { Heading } from './nodes/heading'; import { Heading } from './nodes/heading';
import { Image } from './nodes/image'; import { Image } from './nodes/image';
import { HorizontalRule } from './nodes/horizontalRule'; import { HorizontalRule } from './nodes/horizontal-rule';
import { Blockquote } from './nodes/blockQuote'; import { Blockquote } from './nodes/blockquote';
// 文本 // 文本
import { Title } from './nodes/title'; import { Title } from './nodes/title';
import { Katex } from './nodes/katex'; import { Katex } from './nodes/katex';
@ -21,15 +21,15 @@ import { Paragraph } from './nodes/paragraph';
import { Text } from './nodes/text'; import { Text } from './nodes/text';
// 表格 // 表格
import { Table } from './nodes/table'; import { Table } from './nodes/table';
import { TableHeader } from './nodes/tableHeader'; import { TableHeader } from './nodes/table-header';
import { TableRow } from './nodes/tableRow'; import { TableRow } from './nodes/table-row';
import { TableCell } from './nodes/tableCell'; import { TableCell } from './nodes/table-cell';
// 列表 // 列表
import { TaskList } from './nodes/taskList'; import { TaskList } from './nodes/task-list';
import { TaskListItem } from './nodes/taskListItem'; import { TaskListItem } from './nodes/task-list-item';
import { ListItem } from './nodes/listItem'; import { ListItem } from './nodes/list-item';
import { OrderedList } from './nodes/orderedList'; import { OrderedList } from './nodes/ordered-list';
import { BulletList } from './nodes/bulletList'; import { BulletList } from './nodes/bullet-list';
// marks // marks
import { Bold } from './marks/bold'; import { Bold } from './marks/bold';