@topwrite/reader 1.0.22-alpha.2 → 1.0.22-alpha.5
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/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/types/components/asset.d.ts +7 -0
- package/types/components/html/attachment.d.ts +1 -1
- package/types/components/html/audio.d.ts +1 -1
- package/types/components/html/img.d.ts +1 -1
- package/types/components/html/video.d.ts +1 -1
- package/types/index.d.ts +1 -0
- package/types/models/index.d.ts +0 -1
- package/types/models/page.d.ts +14 -13
- package/types/typings.d.ts +3 -9
- package/types/lib/use-lfs.d.ts +0 -1
- package/types/models/file.d.ts +0 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@topwrite/reader",
|
|
3
|
-
"version": "1.0.22-alpha.
|
|
3
|
+
"version": "1.0.22-alpha.5+4a05bec",
|
|
4
4
|
"author": "yunwuxin <tzzhangyajun@qq.com> (https://github.com/yunwuxin)",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"types": "types/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"prepack": "yarn run build"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@topwrite/common": "^1.0.
|
|
21
|
+
"@topwrite/common": "^1.0.19",
|
|
22
22
|
"@types/lodash": "^4.14.168",
|
|
23
23
|
"@types/node": "^16.4.13",
|
|
24
24
|
"@types/react": "^17.0.4",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"optional": true
|
|
54
54
|
}
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "4a05bece01806308d32923b91e2e5b654d9411f8"
|
|
57
57
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { AttachmentHTMLAttributes } from 'react';
|
|
2
|
-
export default function Attachment(
|
|
2
|
+
export default function Attachment(props: AttachmentHTMLAttributes<HTMLAttachmentElement>): JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { AudioHTMLAttributes } from 'react';
|
|
2
|
-
export default function Audio(
|
|
2
|
+
export default function Audio(props: AudioHTMLAttributes<HTMLAudioElement>): JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { ImgHTMLAttributes } from 'react';
|
|
2
|
-
export default function Img(
|
|
2
|
+
export default function Img(props: ImgHTMLAttributes<HTMLImageElement>): JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { VideoHTMLAttributes } from 'react';
|
|
2
|
-
export default function Video(
|
|
2
|
+
export default function Video(props: VideoHTMLAttributes<HTMLVideoElement>): JSX.Element;
|
package/types/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from '@topwrite/common';
|
|
|
4
4
|
export { default as bootstrap } from './lib/bootstrap';
|
|
5
5
|
export { history } from './lib/history';
|
|
6
6
|
export { default as useTitle } from './lib/use-title';
|
|
7
|
+
export { default as useFile } from './lib/use-file';
|
|
7
8
|
export { default as useArticle, usePrevArticle, useNextArticle } from './lib/use-article';
|
|
8
9
|
export { default as useWindowSize, windowSizes } from './lib/use-window-size';
|
|
9
10
|
export { default as useLockBodyScroll } from './lib/use-lock-body-scroll';
|
package/types/models/index.d.ts
CHANGED
package/types/models/page.d.ts
CHANGED
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { ActionsType, Model, RequestConfig, RequestInstance } from '@topwrite/common';
|
|
1
|
+
import { ActionsType, File, Model, RequestConfig, RequestInstance } from '@topwrite/common';
|
|
2
2
|
interface PageState {
|
|
3
3
|
loading: boolean;
|
|
4
4
|
error?: Error;
|
|
5
|
-
options: RequestConfig;
|
|
6
5
|
request: RequestInstance;
|
|
6
|
+
config: RequestConfig;
|
|
7
|
+
file: File;
|
|
8
|
+
lfs?: {
|
|
9
|
+
url: string;
|
|
10
|
+
files: {
|
|
11
|
+
[index: string]: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
7
14
|
}
|
|
15
|
+
declare type Interceptors = RequestInstance['interceptors'];
|
|
8
16
|
declare class Page extends Model<PageState> {
|
|
9
17
|
initialState: {
|
|
10
18
|
loading: boolean;
|
|
11
|
-
options: {};
|
|
12
19
|
request: import("axios").AxiosInstance;
|
|
20
|
+
config: {};
|
|
13
21
|
};
|
|
14
22
|
subscription({ fetch }: ActionsType<Page>): void;
|
|
15
|
-
fetch(pathname: string): AsyncGenerator<import("redux").AnyAction
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}>;
|
|
19
|
-
intercept(interceptor: (interceptors: RequestInstance['interceptors']) => void): Generator<Generator<import("redux").AnyAction, PageState, unknown>, void, {
|
|
20
|
-
request: any;
|
|
21
|
-
}>;
|
|
22
|
-
setOptions(config: RequestConfig): Generator<import("redux").AnyAction | Generator<import("redux").AnyAction, PageState, unknown>, void, {
|
|
23
|
-
options: any;
|
|
24
|
-
}>;
|
|
23
|
+
fetch(pathname: string): AsyncGenerator<import("redux").AnyAction, void, unknown>;
|
|
24
|
+
intercept(handler: (interceptors: Interceptors) => void): Generator<import("redux").AnyAction, void, unknown>;
|
|
25
|
+
updateConfig(updater: (config: RequestConfig) => void): Generator<import("redux").AnyAction, void, unknown>;
|
|
25
26
|
}
|
|
26
27
|
export declare const page: Page;
|
|
27
28
|
export {};
|
package/types/typings.d.ts
CHANGED
|
@@ -10,17 +10,11 @@ declare module '@topwrite/common' {
|
|
|
10
10
|
}
|
|
11
11
|
interface ComponentsMap {
|
|
12
12
|
app: ComponentDescriptorType;
|
|
13
|
-
'article:before': ComponentDescriptorType;
|
|
14
|
-
'article:after': ComponentDescriptorType;
|
|
13
|
+
'page:article:before': ComponentDescriptorType;
|
|
14
|
+
'page:article:after': ComponentDescriptorType;
|
|
15
|
+
'page:asset': ComponentDescriptorType;
|
|
15
16
|
}
|
|
16
17
|
interface OptionsStateType {
|
|
17
|
-
lfs?: {
|
|
18
|
-
url: string;
|
|
19
|
-
files: {
|
|
20
|
-
[index: string]: string;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
search: string;
|
|
24
18
|
}
|
|
25
19
|
}
|
|
26
20
|
export {};
|
package/types/lib/use-lfs.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function useLfs(src?: string): string | undefined;
|
package/types/models/file.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ActionsType, Model, File as FileType } from '@topwrite/common';
|
|
2
|
-
declare class File extends Model<FileType> {
|
|
3
|
-
onAction(action: any, type: any, { update }: ActionsType<File>): (...args: any[]) => Generator<any, void, unknown>;
|
|
4
|
-
update(article: FileType): Generator<import("redux").AnyAction, void, unknown>;
|
|
5
|
-
}
|
|
6
|
-
export declare const file: File;
|
|
7
|
-
export {};
|