@topwrite/reader 1.0.33-alpha.0 → 1.0.33-alpha.3
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/363-58daf3.js +2 -0
- package/dist/363-58daf3.js.map +1 -0
- package/dist/363.css +1 -0
- package/dist/378-c5be1d.js +9 -0
- package/dist/378-c5be1d.js.map +1 -0
- package/dist/index.js +20 -20
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
- package/types/components/article.d.ts +4 -4
- package/types/components/menu.d.ts +14 -0
- package/types/lib/use-window-scroll.d.ts +2 -0
- package/types/typings.d.ts +2 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topwrite/reader",
|
|
3
|
-
"version": "1.0.33-alpha.
|
|
3
|
+
"version": "1.0.33-alpha.3+9f60fb4",
|
|
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": "9f60fb40a8b256cf41a1e9ab4168a4958ce17f54"
|
|
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 {};
|
|
@@ -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];
|
|
@@ -22,6 +23,7 @@ declare module '@topwrite/common' {
|
|
|
22
23
|
'page:article:before': ComponentDescriptorType;
|
|
23
24
|
'page:article:after': ComponentDescriptorType;
|
|
24
25
|
'page:article:markdown': ComponentDescriptorType<ComponentProps<typeof Markdown>>;
|
|
26
|
+
'page:article:menu': ComponentDescriptorType<MenuItemProps>;
|
|
25
27
|
'page:asset': ComponentDescriptorType;
|
|
26
28
|
}
|
|
27
29
|
interface OptionsStateType {
|