@topwrite/reader 1.0.32 → 1.0.33-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/107-aac715.js +2 -0
- package/dist/107-aac715.js.map +1 -0
- package/dist/index.css +1 -0
- package/dist/index.js +31 -24
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/types/components/article.d.ts +4 -4
- package/types/components/html/heading.d.ts +6 -6
- package/types/components/menu.d.ts +14 -0
- package/types/components/powered-by.d.ts +1 -1
- package/types/lib/use-in-preview.d.ts +0 -3
- package/types/lib/use-window-scroll.d.ts +2 -0
- package/types/typings.d.ts +9 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topwrite/reader",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.33-alpha.2+aa8d086",
|
|
4
4
|
"author": "yunwuxin <tzzhangyajun@qq.com> (https://github.com/yunwuxin)",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"path-browserify": "^1.0.1",
|
|
35
35
|
"process": "^0.11.10",
|
|
36
36
|
"query-string": "^7.1.1",
|
|
37
|
+
"rc-tooltip": "^5.1.1",
|
|
37
38
|
"rimraf": "^3.0.2",
|
|
38
39
|
"stream-browserify": "^3.0.0",
|
|
39
40
|
"typescript": "^4.3.5",
|
|
@@ -52,5 +53,5 @@
|
|
|
52
53
|
"optional": true
|
|
53
54
|
}
|
|
54
55
|
},
|
|
55
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "aa8d0868c1359c05d7ab5af02d79946d3fb1011c"
|
|
56
57
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import Markdown from './markdown';
|
|
2
|
-
import { ComponentProps
|
|
3
|
-
interface ArticleProps extends Omit<ComponentProps<typeof Markdown>, 'children'> {
|
|
2
|
+
import { ComponentProps } from 'react';
|
|
3
|
+
interface ArticleProps extends Omit<ComponentProps<typeof Markdown>, 'children' | 'as'> {
|
|
4
4
|
className?: string;
|
|
5
|
-
|
|
5
|
+
menu?: boolean;
|
|
6
6
|
}
|
|
7
|
-
export default function Article({ className, header, footer,
|
|
7
|
+
export default function Article({ className, header, footer, menu, ...props }: ArticleProps): JSX.Element;
|
|
8
8
|
export {};
|
|
@@ -6,7 +6,7 @@ export default function Heading({ depth, id, children, ...props }: HeadingHTMLAt
|
|
|
6
6
|
suppressHydrationWarning?: boolean | undefined;
|
|
7
7
|
accessKey?: string | undefined;
|
|
8
8
|
className?: string | undefined;
|
|
9
|
-
contentEditable?: (boolean | "true" | "false") |
|
|
9
|
+
contentEditable?: "inherit" | (boolean | "true" | "false") | undefined;
|
|
10
10
|
contextMenu?: string | undefined;
|
|
11
11
|
dir?: string | undefined;
|
|
12
12
|
draggable?: (boolean | "true" | "false") | undefined;
|
|
@@ -18,7 +18,7 @@ export default function Heading({ depth, id, children, ...props }: HeadingHTMLAt
|
|
|
18
18
|
style?: import("react").CSSProperties | undefined;
|
|
19
19
|
tabIndex?: number | undefined;
|
|
20
20
|
title?: string | undefined;
|
|
21
|
-
translate?: "
|
|
21
|
+
translate?: "no" | "yes" | undefined;
|
|
22
22
|
radioGroup?: string | undefined;
|
|
23
23
|
role?: import("react").AriaRole | undefined;
|
|
24
24
|
about?: string | undefined;
|
|
@@ -41,7 +41,7 @@ export default function Heading({ depth, id, children, ...props }: HeadingHTMLAt
|
|
|
41
41
|
results?: number | undefined;
|
|
42
42
|
security?: string | undefined;
|
|
43
43
|
unselectable?: "on" | "off" | undefined;
|
|
44
|
-
inputMode?: "search" | "text" | "
|
|
44
|
+
inputMode?: "search" | "text" | "email" | "tel" | "url" | "none" | "numeric" | "decimal" | undefined;
|
|
45
45
|
is?: string | undefined;
|
|
46
46
|
'aria-activedescendant'?: string | undefined;
|
|
47
47
|
'aria-atomic'?: (boolean | "true" | "false") | undefined;
|
|
@@ -52,16 +52,16 @@ export default function Heading({ depth, id, children, ...props }: HeadingHTMLAt
|
|
|
52
52
|
'aria-colindex'?: number | undefined;
|
|
53
53
|
'aria-colspan'?: number | undefined;
|
|
54
54
|
'aria-controls'?: string | undefined;
|
|
55
|
-
'aria-current'?: boolean | "page" | "time" | "
|
|
55
|
+
'aria-current'?: boolean | "page" | "time" | "date" | "true" | "false" | "step" | "location" | undefined;
|
|
56
56
|
'aria-describedby'?: string | undefined;
|
|
57
57
|
'aria-details'?: string | undefined;
|
|
58
58
|
'aria-disabled'?: (boolean | "true" | "false") | undefined;
|
|
59
|
-
'aria-dropeffect'?: "link" | "
|
|
59
|
+
'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
|
|
60
60
|
'aria-errormessage'?: string | undefined;
|
|
61
61
|
'aria-expanded'?: (boolean | "true" | "false") | undefined;
|
|
62
62
|
'aria-flowto'?: string | undefined;
|
|
63
63
|
'aria-grabbed'?: (boolean | "true" | "false") | undefined;
|
|
64
|
-
'aria-haspopup'?: boolean | "dialog" | "menu" | "
|
|
64
|
+
'aria-haspopup'?: boolean | "dialog" | "menu" | "grid" | "listbox" | "tree" | "true" | "false" | undefined;
|
|
65
65
|
'aria-hidden'?: (boolean | "true" | "false") | undefined;
|
|
66
66
|
'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
|
|
67
67
|
'aria-keyshortcuts'?: string | undefined;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import Tooltip from 'rc-tooltip';
|
|
3
|
+
import 'rc-tooltip/assets/bootstrap.css';
|
|
4
|
+
declare type TooltipProps = ComponentProps<typeof Tooltip>;
|
|
5
|
+
export interface MenuItemProps {
|
|
6
|
+
tooltip?: TooltipProps['overlay'] | TooltipProps;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
}
|
|
10
|
+
interface MenuProps {
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export default function Menu({ className }: MenuProps): JSX.Element | null;
|
|
14
|
+
export {};
|
package/types/typings.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { Actions, AnyAction, ComponentDescriptorType, States } from '@topwrite/c
|
|
|
2
2
|
import * as models from './models';
|
|
3
3
|
import { ComponentProps } from 'react';
|
|
4
4
|
import Markdown from './components/markdown';
|
|
5
|
+
import { MenuItemProps } from './components/menu';
|
|
5
6
|
declare type Models = typeof models;
|
|
6
7
|
declare module '@topwrite/common' {
|
|
7
8
|
function useSelector<T extends keyof Models>(model: T): States<T, Models>[T];
|
|
@@ -10,11 +11,19 @@ declare module '@topwrite/common' {
|
|
|
10
11
|
interface Model {
|
|
11
12
|
getState<T extends keyof Models>(model: T): Generator<AnyAction, States<T, Models>[T]>;
|
|
12
13
|
}
|
|
14
|
+
interface OptionsStateType {
|
|
15
|
+
preview: boolean;
|
|
16
|
+
poweredBy: false | {
|
|
17
|
+
name: string;
|
|
18
|
+
link: string;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
13
21
|
interface ComponentsMap {
|
|
14
22
|
'page': ComponentDescriptorType;
|
|
15
23
|
'page:article:before': ComponentDescriptorType;
|
|
16
24
|
'page:article:after': ComponentDescriptorType;
|
|
17
25
|
'page:article:markdown': ComponentDescriptorType<ComponentProps<typeof Markdown>>;
|
|
26
|
+
'page:article:menu': ComponentDescriptorType<MenuItemProps>;
|
|
18
27
|
'page:asset': ComponentDescriptorType;
|
|
19
28
|
}
|
|
20
29
|
interface OptionsStateType {
|