rotion 1.3.0 → 1.5.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.
Files changed (33) hide show
  1. package/dist/exporter/blocks.js +7 -2
  2. package/dist/exporter/blocks.js.map +1 -1
  3. package/dist/exporter/files.d.ts +1 -0
  4. package/dist/exporter/files.js +25 -1
  5. package/dist/exporter/files.js.map +1 -1
  6. package/dist/exporter/types.d.ts +19 -15
  7. package/dist/ui/cjs/index.css +1 -1
  8. package/dist/ui/cjs/index.js +1 -1
  9. package/dist/ui/cjs/index.js.map +1 -1
  10. package/dist/ui/cjs/types/exporter/files.d.ts +1 -0
  11. package/dist/ui/cjs/types/exporter/types.d.ts +19 -15
  12. package/dist/ui/cjs/types/ui/components/Icon/Icon.d.ts +1 -1
  13. package/dist/ui/cjs/types/ui/components/Page/PdfBlock/Pdf.d.ts +25 -0
  14. package/dist/ui/cjs/types/ui/components/Page/VideoBlock/VideoBlock.types.d.ts +10 -1
  15. package/dist/ui/esm/index.css +1 -1
  16. package/dist/ui/esm/index.js +1 -1
  17. package/dist/ui/esm/index.js.map +1 -1
  18. package/dist/ui/esm/types/exporter/files.d.ts +1 -0
  19. package/dist/ui/esm/types/exporter/types.d.ts +19 -15
  20. package/dist/ui/esm/types/ui/components/Icon/Icon.d.ts +1 -1
  21. package/dist/ui/esm/types/ui/components/Page/PdfBlock/Pdf.d.ts +25 -0
  22. package/dist/ui/esm/types/ui/components/Page/VideoBlock/VideoBlock.types.d.ts +10 -1
  23. package/dist/ui/style-without-dark.css +1 -1
  24. package/dist/ui/types.d.ts +20 -16
  25. package/dist/ui/umd/index.css +1 -1
  26. package/dist/ui/umd/index.js +1 -1
  27. package/dist/ui/umd/index.js.map +1 -1
  28. package/dist/ui/umd/types/exporter/files.d.ts +1 -0
  29. package/dist/ui/umd/types/exporter/types.d.ts +19 -15
  30. package/dist/ui/umd/types/ui/components/Icon/Icon.d.ts +1 -1
  31. package/dist/ui/umd/types/ui/components/Page/PdfBlock/Pdf.d.ts +25 -0
  32. package/dist/ui/umd/types/ui/components/Page/VideoBlock/VideoBlock.types.d.ts +10 -1
  33. package/package.json +13 -17
@@ -28,3 +28,4 @@ export declare const getHtmlMeta: (reqUrl: string, httpFunc?: (reqUrl: string) =
28
28
  export declare const getVideoHtml: (block: VideoBlockObjectResponseEx) => Promise<string>;
29
29
  export declare const getEmbedHtml: (block: EmbedBlockObjectResponseEx) => Promise<string>;
30
30
  export declare const isEmpty: (obj: Object) => boolean;
31
+ export declare function getVideoType(uri: string): "video/mp4" | "video/webm" | "video/ogg" | "";
@@ -130,22 +130,26 @@ export type ImageBlockObjectResponseEx = ImageBlockObjectResponse & {
130
130
  src: string;
131
131
  };
132
132
  };
133
- export type VideoBlockObjectResponseEx = VideoBlockObjectResponse & {
134
- video: {
135
- type: 'external';
136
- external: {
137
- url: TextRequest;
138
- };
139
- caption: Array<RichTextItemResponse>;
140
- html: string;
141
- } | {
142
- type: 'file';
143
- file: {
144
- url: string;
145
- expiry_time: string;
146
- };
147
- caption: Array<RichTextItemResponse>;
133
+ export type VideoExternal = {
134
+ type: 'external';
135
+ external: {
136
+ url: TextRequest;
137
+ };
138
+ caption: Array<RichTextItemResponse>;
139
+ html: string;
140
+ };
141
+ export type VideoFile = {
142
+ type: 'file';
143
+ file: {
144
+ url: string;
145
+ expiry_time: string;
148
146
  };
147
+ caption: Array<RichTextItemResponse>;
148
+ src: string;
149
+ videoType: 'video/mp4' | 'video/webm' | 'video/ogg' | 'video/ogv' | '';
150
+ };
151
+ export type VideoBlockObjectResponseEx = VideoBlockObjectResponse & {
152
+ video: VideoExternal | VideoFile;
149
153
  };
150
154
  export type EmbedBlockObjectResponseEx = EmbedBlockObjectResponse & {
151
155
  embed: {
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import './Icon.css';
3
3
  export interface IconProps {
4
- name: 'figma' | 'slack' | 'github' | 'file' | 'link' | 'codemerge' | 'circlecheck' | 'circledot';
4
+ name: 'figma' | 'slack' | 'github' | 'file' | 'link' | 'codemerge' | 'circlecheck' | 'circledot' | 'downloadfile';
5
5
  width?: string;
6
6
  height?: string;
7
7
  className?: string;
@@ -0,0 +1,25 @@
1
+ /// <reference types="react" />
2
+ import { PDFDocumentProxy, PDFPageProxy } from 'pdfjs-dist';
3
+ type HookProps = {
4
+ canvasRef: React.RefObject<HTMLCanvasElement | null>;
5
+ file: string;
6
+ onDocumentLoadSuccess?: (document: PDFDocumentProxy) => void;
7
+ onDocumentLoadFail?: () => void;
8
+ onPageLoadSuccess?: (page: PDFPageProxy) => void;
9
+ onPageLoadFail?: () => void;
10
+ onPageRenderSuccess?: (page: PDFPageProxy) => void;
11
+ onPageRenderFail?: () => void;
12
+ scale?: number;
13
+ rotate?: number;
14
+ page?: number;
15
+ cMapUrl?: string;
16
+ cMapPacked?: boolean;
17
+ workerSrc?: string;
18
+ withCredentials?: boolean;
19
+ };
20
+ type HookReturnValues = {
21
+ pdfDocument: PDFDocumentProxy | undefined;
22
+ pdfPage: PDFPageProxy | undefined;
23
+ };
24
+ export declare const usePdf: ({ canvasRef, file, onDocumentLoadSuccess, onDocumentLoadFail, onPageLoadSuccess, onPageLoadFail, onPageRenderSuccess, onPageRenderFail, scale, rotate, page, cMapUrl, cMapPacked, workerSrc, withCredentials, }: HookProps) => HookReturnValues;
25
+ export {};
@@ -1,4 +1,13 @@
1
- import type { VideoBlockObjectResponseEx } from '../../../../exporter';
1
+ import type { VideoBlockObjectResponseEx, VideoFile, VideoExternal, RichTextItemResponse } from '../../../../exporter';
2
2
  export interface VideoBlockProps {
3
3
  block: VideoBlockObjectResponseEx;
4
4
  }
5
+ export interface VideoFileProps {
6
+ video: VideoFile;
7
+ }
8
+ export interface VideoExternalProps {
9
+ video: VideoExternal;
10
+ }
11
+ export interface CaptionProps {
12
+ caption: RichTextItemResponse[];
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rotion",
3
- "version": "1.3.0",
3
+ "version": "1.5.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.",
@@ -65,6 +65,7 @@
65
65
  "file-type": "^19.0.0",
66
66
  "katex": "^0.16.9",
67
67
  "mermaid": "^10.6.1",
68
+ "pdfjs-dist": "^4.2.67",
68
69
  "prismjs": "^1.25.0",
69
70
  "replace-ext": "^2.0.0",
70
71
  "sharp": "^0.33.3"
@@ -76,16 +77,16 @@
76
77
  "@rollup/plugin-node-resolve": "^15.2.3",
77
78
  "@rollup/plugin-terser": "^0.4.4",
78
79
  "@rollup/plugin-typescript": "^11.1.5",
79
- "@storybook/addon-essentials": "^8.1.6",
80
- "@storybook/addon-interactions": "^8.1.6",
81
- "@storybook/addon-links": "^8.1.6",
82
- "@storybook/addon-mdx-gfm": "^8.1.6",
83
- "@storybook/addon-onboarding": "^8.1.6",
84
- "@storybook/blocks": "^8.1.6",
85
- "@storybook/react": "^8.1.6",
86
- "@storybook/react-vite": "^8.1.6",
87
- "@storybook/test": "^8.1.6",
88
- "@storybook/theming": "^8.1.6",
80
+ "@storybook/addon-essentials": "^8.1.9",
81
+ "@storybook/addon-interactions": "^8.1.9",
82
+ "@storybook/addon-links": "^8.1.9",
83
+ "@storybook/addon-mdx-gfm": "^8.1.9",
84
+ "@storybook/addon-onboarding": "^8.1.9",
85
+ "@storybook/blocks": "^8.1.9",
86
+ "@storybook/react": "^8.1.9",
87
+ "@storybook/react-vite": "^8.1.9",
88
+ "@storybook/test": "^8.1.9",
89
+ "@storybook/theming": "^8.1.9",
89
90
  "@tsconfig/node-lts-strictest-esm": "^18.12.1",
90
91
  "@types/imagemin": "^8.0.5",
91
92
  "@types/imagemin-webp": "^7.0.3",
@@ -112,7 +113,7 @@
112
113
  "rollup-plugin-dts": "^6.1.0",
113
114
  "rollup-plugin-peer-deps-external": "^2.2.4",
114
115
  "rollup-plugin-postcss": "^4.0.2",
115
- "storybook": "^8.1.6",
116
+ "storybook": "^8.1.9",
116
117
  "storybook-dark-mode": "^4.0.1",
117
118
  "testdouble": "^3.20.1",
118
119
  "tslib": "^2.6.2",
@@ -120,10 +121,5 @@
120
121
  "typescript": "^5.3.3",
121
122
  "uvu": "^0.5.6"
122
123
  },
123
- "overrides": {
124
- "got": "11.8.5",
125
- "http-cache-semantics": "4.1.1",
126
- "semver-regex": "3.1.4"
127
- },
128
124
  "extends": "@tsconfig/node-lts-strictest-esm"
129
125
  }