@topwrite/reader 1.0.33-alpha.1 → 1.0.33-alpha.4
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/{267-58e681.js → 267-b5c5b0.js} +1 -1
- package/dist/363-7802c0.js +2 -0
- package/dist/363-7802c0.js.map +1 -0
- package/dist/{index.css → 363.css} +0 -0
- package/dist/378-c5be1d.js +9 -0
- package/dist/378-c5be1d.js.map +1 -0
- package/dist/{7-774184.js → 7-7d6f45.js} +1 -1
- package/dist/index.js +24 -31
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/types/components/article.d.ts +1 -2
- package/types/components/menu.d.ts +10 -3
- package/types/typings.d.ts +3 -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.4+f6042a4",
|
|
4
4
|
"author": "yunwuxin <tzzhangyajun@qq.com> (https://github.com/yunwuxin)",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -14,11 +14,11 @@
|
|
|
14
14
|
"build": "webpack --progress",
|
|
15
15
|
"build:dev": "yarn run build --env dev",
|
|
16
16
|
"serve": "webpack serve --env dev",
|
|
17
|
-
"extract": "formatjs extract src/**/*.ts
|
|
17
|
+
"extract": "formatjs extract src/**/*.{ts,tsx} --out-file src/lang/zh-CN.json --ignore src/global.d.ts --id-interpolation-pattern [sha512:contenthash:base64:6] --format simple",
|
|
18
18
|
"prepack": "yarn run build"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@topwrite/common": "^1.0.
|
|
21
|
+
"@topwrite/common": "^1.0.29",
|
|
22
22
|
"@types/lodash": "^4.14.168",
|
|
23
23
|
"@types/node": "^16.4.13",
|
|
24
24
|
"@types/react": "^17.0.4",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@babel/runtime": "^7.11.2",
|
|
31
|
-
"@formatjs/cli": "^
|
|
31
|
+
"@formatjs/cli": "^5.0.2",
|
|
32
32
|
"@topthink/webpack-config-plugin": "^1.0.0",
|
|
33
33
|
"crypto-browserify": "^3.12.0",
|
|
34
34
|
"path-browserify": "^1.0.1",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"optional": true
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "f6042a477678301ba49d1b422e0ff915ea9c907f"
|
|
57
57
|
}
|
|
@@ -2,7 +2,6 @@ import Markdown from './markdown';
|
|
|
2
2
|
import { ComponentProps } from 'react';
|
|
3
3
|
interface ArticleProps extends Omit<ComponentProps<typeof Markdown>, 'children' | 'as'> {
|
|
4
4
|
className?: string;
|
|
5
|
-
menu?: boolean;
|
|
6
5
|
}
|
|
7
|
-
export default function Article({ className, header, footer,
|
|
6
|
+
export default function Article({ className, header, footer, ...props }: ArticleProps): JSX.Element;
|
|
8
7
|
export {};
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
import { ComponentProps, ReactNode } from 'react';
|
|
2
|
+
import Tooltip from 'rc-tooltip';
|
|
2
3
|
import 'rc-tooltip/assets/bootstrap.css';
|
|
3
|
-
|
|
4
|
+
declare type TooltipProps = ComponentProps<typeof Tooltip>;
|
|
5
|
+
export interface MenuItemProps {
|
|
6
|
+
tooltip?: TooltipProps['overlay'] | TooltipProps;
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export interface MenuProps {
|
|
4
11
|
className?: string;
|
|
5
12
|
}
|
|
6
|
-
export default function Menu({ className }: MenuProps): JSX.Element;
|
|
13
|
+
export default function Menu({ className }: MenuProps): JSX.Element | null;
|
|
7
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, MenuProps } 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];
|
|
@@ -19,6 +20,8 @@ declare module '@topwrite/common' {
|
|
|
19
20
|
}
|
|
20
21
|
interface ComponentsMap {
|
|
21
22
|
'page': ComponentDescriptorType;
|
|
23
|
+
'page:menu': ComponentDescriptorType<MenuProps>;
|
|
24
|
+
'page:menu:item': ComponentDescriptorType<MenuItemProps>;
|
|
22
25
|
'page:article:before': ComponentDescriptorType;
|
|
23
26
|
'page:article:after': ComponentDescriptorType;
|
|
24
27
|
'page:article:markdown': ComponentDescriptorType<ComponentProps<typeof Markdown>>;
|