rotion 1.9.0 → 1.11.0

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.
@@ -1,4 +1,4 @@
1
- import type { VideoBlockObjectResponseEx, EmbedBlockObjectResponseEx } from './types.js';
1
+ import type { VideoBlockObjectResponseEx, EmbedBlockObjectResponseEx, HtmlMetadata, ImagePathWithSize } from './types.js';
2
2
  export declare const findLocationUrl: (rawHeaders: string[]) => string;
3
3
  export declare function getHTTP(reqUrl: string): Promise<string>;
4
4
  export declare function getJson<T>(reqUrl: string): Promise<T>;
@@ -12,19 +12,14 @@ export declare function saveFile(fileUrl: string, prefix: string): Promise<{
12
12
  src: string;
13
13
  size: number;
14
14
  }>;
15
- export declare const saveImage: (imageUrl: string, prefix: string) => Promise<string>;
15
+ export declare const saveImage: (imageUrl: string, prefix: string) => Promise<ImagePathWithSize>;
16
16
  export declare const findHtmlByRegexp: (regexps: RegExp[], html: string) => string | null;
17
17
  export declare const titleRegexps: RegExp[];
18
18
  export declare const descRegexps: RegExp[];
19
19
  export declare const imageRegexps: RegExp[];
20
20
  export declare const iconRegexps: RegExp[];
21
21
  export declare const findImage: (html: string) => string | null;
22
- export declare const getHtmlMeta: (reqUrl: string, httpFunc?: (reqUrl: string) => Promise<string>) => Promise<{
23
- title: string;
24
- desc: string;
25
- image: string;
26
- icon: string;
27
- }>;
22
+ export declare const getHtmlMeta: (reqUrl: string, httpFunc?: (reqUrl: string) => Promise<string>) => Promise<HtmlMetadata>;
28
23
  export declare const getVideoHtml: (block: VideoBlockObjectResponseEx) => Promise<string>;
29
24
  export declare function getSlideshareOembedUrl(reqUrl: string, httpFunc?: (reqUrl: string) => Promise<string>): Promise<string>;
30
25
  export declare const getEmbedHtml: (block: EmbedBlockObjectResponseEx) => Promise<string>;
@@ -81,12 +81,7 @@ export type BookmarkBlockObjectResponseEx = BookmarkBlockObjectResponse & {
81
81
  bookmark: {
82
82
  url: string;
83
83
  caption: Array<RichTextItemResponse>;
84
- site: {
85
- title: string;
86
- desc: string;
87
- image: string;
88
- icon: string;
89
- };
84
+ site: HtmlMetadata;
90
85
  };
91
86
  };
92
87
  export type CalloutBlockObjectResponseEx = CalloutBlockObjectResponse & {
@@ -121,6 +116,8 @@ export type ImageBlockObjectResponseEx = ImageBlockObjectResponse & {
121
116
  };
122
117
  caption: Array<RichTextItemResponse>;
123
118
  src: string;
119
+ width?: number;
120
+ height?: number;
124
121
  } | {
125
122
  type: 'file';
126
123
  file: {
@@ -129,6 +126,8 @@ export type ImageBlockObjectResponseEx = ImageBlockObjectResponse & {
129
126
  };
130
127
  caption: Array<RichTextItemResponse>;
131
128
  src: string;
129
+ width?: number;
130
+ height?: number;
132
131
  };
133
132
  };
134
133
  export type VideoExternal = {
@@ -736,3 +735,14 @@ export type LastEditedTimeDatabasePropertyConfigResponse = {
736
735
  last_edited_time: EmptyObject;
737
736
  id: string;
738
737
  };
738
+ export type ImagePathWithSize = {
739
+ path: string;
740
+ width?: number;
741
+ height?: number;
742
+ };
743
+ export type HtmlMetadata = {
744
+ title: string;
745
+ desc: string;
746
+ image: string;
747
+ icon: string;
748
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rotion",
3
- "version": "1.9.0",
3
+ "version": "1.11.0",
4
4
  "license": "MIT",
5
5
  "repository": "linyows/rotion",
6
6
  "description": "This is react components that uses the notion API to display the notion's database and page.",
@@ -62,7 +62,6 @@
62
62
  "@notionhq/client": "^2.2.14",
63
63
  "cdate": "^0.0.7",
64
64
  "cdate-relative": "^0.1.0",
65
- "file-type": "^20.1.0",
66
65
  "katex": "^0.16.9",
67
66
  "mermaid": "^11.4.1",
68
67
  "pdfjs-dist": "^4.10.38",