@topwrite/reader 1.0.22-alpha.8 → 1.0.22-alpha.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topwrite/reader",
3
- "version": "1.0.22-alpha.8+8c86309",
3
+ "version": "1.0.22-alpha.9+5280e3b",
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.19",
21
+ "@topwrite/common": "^1.0.20-alpha.9+5280e3b",
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": "8c863093008b8007510d4b08e3bfd3601c0d381d"
56
+ "gitHead": "5280e3b2d81c352487ea460886db0b2bd00140e6"
57
57
  }
@@ -0,0 +1 @@
1
+ export default function Breadcrumb(): JSX.Element;
@@ -1,4 +1,4 @@
1
- import { ComponentType, ReactElement, ReactNode } from 'react';
1
+ import { ComponentType, FC, ReactElement, ReactNode } from 'react';
2
2
  import { SummaryArticle, SummaryPart } from '@topwrite/common';
3
3
  interface ItemProps {
4
4
  item: SummaryArticle;
@@ -15,12 +15,19 @@ interface ItemsProps {
15
15
  part?: SummaryPart;
16
16
  children: ReactNode;
17
17
  }
18
- export interface CatalogProps {
19
- PartComponent: ComponentType<PartProps>;
20
- ItemComponent: ComponentType<ItemProps>;
21
- ItemsComponent?: ComponentType<ItemsProps>;
18
+ interface DeprecatedCatalogProps {
22
19
  renderPart?: (props: PartProps) => ReactElement<any, any> | null;
23
20
  renderItem?: (props: ItemProps) => ReactElement<any, any> | null;
24
21
  }
25
- export default function Catalog({ ...props }: CatalogProps): JSX.Element;
22
+ export interface CatalogProps {
23
+ partComponent: ComponentType<PartProps>;
24
+ itemComponent: ComponentType<ItemProps>;
25
+ itemsComponent?: ComponentType<ItemsProps>;
26
+ }
27
+ export declare const CatalogItems: FC<{
28
+ items: SummaryArticle[];
29
+ part?: SummaryPart;
30
+ itemsComponent?: ComponentType<ItemsProps>;
31
+ } & Pick<CatalogProps, 'itemComponent'>>;
32
+ export default function Catalog({ ...props }: CatalogProps & DeprecatedCatalogProps): JSX.Element;
26
33
  export {};
package/types/index.d.ts CHANGED
@@ -13,9 +13,9 @@ export { default as Logo } from './components/logo';
13
13
  export { default as Link } from './components/link';
14
14
  export { default as Anchor } from './components/anchor';
15
15
  export { default as Article } from './components/article';
16
- export { default as Catalog } from './components/catalog';
17
- export type { CatalogProps } from './components/catalog';
16
+ export { default as Catalog, type CatalogProps, CatalogItems } from './components/catalog';
18
17
  export { default as Markdown } from './components/markdown';
18
+ export { default as Breadcrumb } from './components/breadcrumb';
19
19
  export { default as ToFirstArticle } from './components/to-first-article';
20
20
  export { Helmet } from 'react-helmet-async';
21
21
  export type { SearchHandler, SearchResult } from './models/search';
@@ -4,3 +4,4 @@ export declare const ArticleContext: import("react").Context<SummaryArticle | un
4
4
  export default function useArticle(): SummaryArticle | undefined;
5
5
  export declare function useNextArticle(): SummaryArticle | undefined;
6
6
  export declare function usePrevArticle(): SummaryArticle | undefined;
7
+ export declare function usePart(article: SummaryArticle): void;