rotion 1.4.0 → 1.5.1

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 (36) 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 +47 -29
  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/Page/EmbedBlock/EmbedBlock.types.d.ts +10 -1
  13. package/dist/ui/cjs/types/ui/components/Page/VideoBlock/VideoBlock.types.d.ts +7 -1
  14. package/dist/ui/cjs/types/ui/components/RichText/Caption.d.ts +4 -0
  15. package/dist/ui/cjs/types/ui/components/RichText/RichText.types.d.ts +4 -0
  16. package/dist/ui/esm/index.css +1 -1
  17. package/dist/ui/esm/index.js +1 -1
  18. package/dist/ui/esm/index.js.map +1 -1
  19. package/dist/ui/esm/types/exporter/files.d.ts +1 -0
  20. package/dist/ui/esm/types/exporter/types.d.ts +19 -15
  21. package/dist/ui/esm/types/ui/components/Page/EmbedBlock/EmbedBlock.types.d.ts +10 -1
  22. package/dist/ui/esm/types/ui/components/Page/VideoBlock/VideoBlock.types.d.ts +7 -1
  23. package/dist/ui/esm/types/ui/components/RichText/Caption.d.ts +4 -0
  24. package/dist/ui/esm/types/ui/components/RichText/RichText.types.d.ts +4 -0
  25. package/dist/ui/style-without-dark.css +1 -1
  26. package/dist/ui/types.d.ts +19 -15
  27. package/dist/ui/umd/index.css +1 -1
  28. package/dist/ui/umd/index.js +1 -1
  29. package/dist/ui/umd/index.js.map +1 -1
  30. package/dist/ui/umd/types/exporter/files.d.ts +1 -0
  31. package/dist/ui/umd/types/exporter/types.d.ts +19 -15
  32. package/dist/ui/umd/types/ui/components/Page/EmbedBlock/EmbedBlock.types.d.ts +10 -1
  33. package/dist/ui/umd/types/ui/components/Page/VideoBlock/VideoBlock.types.d.ts +7 -1
  34. package/dist/ui/umd/types/ui/components/RichText/Caption.d.ts +4 -0
  35. package/dist/ui/umd/types/ui/components/RichText/RichText.types.d.ts +4 -0
  36. package/package.json +12 -12
@@ -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,4 +1,13 @@
1
- import type { EmbedBlockObjectResponseEx } from '../../../../exporter';
1
+ import type { EmbedBlockObjectResponseEx, RichTextItemResponse } from '../../../../exporter';
2
2
  export interface EmbedBlockProps {
3
3
  block: EmbedBlockObjectResponseEx;
4
4
  }
5
+ export interface EmbedProps {
6
+ type: 'speakerdeck' | 'applemusic' | 'googlemap';
7
+ html: string;
8
+ caption: RichTextItemResponse[];
9
+ }
10
+ export interface OembedProps {
11
+ html: string;
12
+ caption: RichTextItemResponse[];
13
+ }
@@ -1,4 +1,10 @@
1
- import type { VideoBlockObjectResponseEx } from '../../../../exporter';
1
+ import type { VideoBlockObjectResponseEx, VideoFile, VideoExternal } 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
+ }
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { CaptionProps } from './RichText.types';
3
+ declare const Caption: ({ type, caption }: CaptionProps) => React.JSX.Element;
4
+ export default Caption;
@@ -5,3 +5,7 @@ export interface RichTextProps {
5
5
  key?: string;
6
6
  children?: ReactNode;
7
7
  }
8
+ export interface CaptionProps {
9
+ type: 'embed' | 'video';
10
+ caption: RichTextItemResponse[];
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rotion",
3
- "version": "1.4.0",
3
+ "version": "1.5.1",
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.",
@@ -77,16 +77,16 @@
77
77
  "@rollup/plugin-node-resolve": "^15.2.3",
78
78
  "@rollup/plugin-terser": "^0.4.4",
79
79
  "@rollup/plugin-typescript": "^11.1.5",
80
- "@storybook/addon-essentials": "^8.1.6",
81
- "@storybook/addon-interactions": "^8.1.6",
82
- "@storybook/addon-links": "^8.1.6",
83
- "@storybook/addon-mdx-gfm": "^8.1.6",
84
- "@storybook/addon-onboarding": "^8.1.6",
85
- "@storybook/blocks": "^8.1.6",
86
- "@storybook/react": "^8.1.6",
87
- "@storybook/react-vite": "^8.1.6",
88
- "@storybook/test": "^8.1.6",
89
- "@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",
90
90
  "@tsconfig/node-lts-strictest-esm": "^18.12.1",
91
91
  "@types/imagemin": "^8.0.5",
92
92
  "@types/imagemin-webp": "^7.0.3",
@@ -113,7 +113,7 @@
113
113
  "rollup-plugin-dts": "^6.1.0",
114
114
  "rollup-plugin-peer-deps-external": "^2.2.4",
115
115
  "rollup-plugin-postcss": "^4.0.2",
116
- "storybook": "^8.1.6",
116
+ "storybook": "^8.1.9",
117
117
  "storybook-dark-mode": "^4.0.1",
118
118
  "testdouble": "^3.20.1",
119
119
  "tslib": "^2.6.2",