@topwrite/reader 1.0.33-alpha.1 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@topwrite/reader",
3
- "version": "1.0.33-alpha.1+8b627da",
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",
@@ -18,7 +18,7 @@
18
18
  "prepack": "yarn run build"
19
19
  },
20
20
  "dependencies": {
21
- "@topwrite/common": "^1.0.30-alpha.1+8b627da",
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",
@@ -53,5 +53,5 @@
53
53
  "optional": true
54
54
  }
55
55
  },
56
- "gitHead": "8b627da233ebf2eac043bb87de8fab2282b54bf6"
56
+ "gitHead": "aa8d0868c1359c05d7ab5af02d79946d3fb1011c"
57
57
  }
@@ -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") | "inherit" | undefined;
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?: "yes" | "no" | undefined;
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" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
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" | "true" | "false" | "step" | "location" | "date" | undefined;
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" | "copy" | "none" | "execute" | "move" | "popup" | undefined;
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" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
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;
@@ -1,7 +1,14 @@
1
- /// <reference types="react" />
1
+ import { ComponentProps, ReactNode } from 'react';
2
+ import Tooltip from 'rc-tooltip';
2
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
+ }
3
10
  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 {};
@@ -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 {