@texonom/nreact 1.1.1 → 1.1.3
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/build/.tsbuildinfo +1 -1
- package/build/block.d.ts +20 -20
- package/build/chunk-N3C4YBY7.js +1378 -0
- package/build/components/asset-wrapper.d.ts +6 -6
- package/build/components/asset.d.ts +7 -7
- package/build/components/audio.d.ts +6 -6
- package/build/components/checkbox.d.ts +5 -5
- package/build/components/eoi.d.ts +7 -7
- package/build/components/file.d.ts +6 -6
- package/build/components/google-drive.d.ts +6 -6
- package/build/components/graceful-image.d.ts +3 -3
- package/build/components/header.d.ts +15 -15
- package/build/components/lazy-image.d.ts +13 -13
- package/build/components/lite-youtube-embed.d.ts +13 -13
- package/build/components/page-aside.d.ts +11 -11
- package/build/components/page-icon.d.ts +16 -16
- package/build/components/page-title.d.ts +12 -12
- package/build/components/search-dialog.d.ts +25 -25
- package/build/components/sync-pointer-block.d.ts +6 -6
- package/build/components/text.d.ts +17 -17
- package/build/context.d.ts +62 -61
- package/build/context.d.ts.map +1 -1
- package/build/dev/chunk-XOMF4TSV.js +1379 -0
- package/build/dev/chunk-XOMF4TSV.js.map +1 -0
- package/build/dev/index.js +697 -3
- package/build/dev/index.js.map +1 -1
- package/build/dev/third-party/code.js +1 -1
- package/build/dev/third-party/collection.js +1 -1
- package/build/dev/third-party/collection.js.map +1 -1
- package/build/dev/third-party/equation.js +1 -1
- package/build/icons/check.d.ts +3 -3
- package/build/icons/chevron-down-icon.d.ts +2 -2
- package/build/icons/clear-icon.d.ts +2 -2
- package/build/icons/collection-view-board.d.ts +3 -3
- package/build/icons/collection-view-calendar.d.ts +3 -3
- package/build/icons/collection-view-gallery.d.ts +3 -3
- package/build/icons/collection-view-icon.d.ts +8 -8
- package/build/icons/collection-view-list.d.ts +3 -3
- package/build/icons/collection-view-table.d.ts +3 -3
- package/build/icons/copy.d.ts +3 -3
- package/build/icons/default-page-icon.d.ts +2 -2
- package/build/icons/empty-icon.d.ts +2 -2
- package/build/icons/file-icon.d.ts +2 -2
- package/build/icons/link-icon.d.ts +2 -2
- package/build/icons/loading-icon.d.ts +2 -2
- package/build/icons/property-icon.d.ts +8 -8
- package/build/icons/search-icon.d.ts +2 -2
- package/build/icons/type-checkbox.d.ts +3 -3
- package/build/icons/type-date.d.ts +3 -3
- package/build/icons/type-email.d.ts +3 -3
- package/build/icons/type-file.d.ts +3 -3
- package/build/icons/type-formula.d.ts +3 -3
- package/build/icons/type-github.d.ts +3 -3
- package/build/icons/type-multi-select.d.ts +3 -3
- package/build/icons/type-number.d.ts +3 -3
- package/build/icons/type-person-2.d.ts +3 -3
- package/build/icons/type-person.d.ts +3 -3
- package/build/icons/type-phone-number.d.ts +3 -3
- package/build/icons/type-relation.d.ts +3 -3
- package/build/icons/type-select.d.ts +3 -3
- package/build/icons/type-text.d.ts +3 -3
- package/build/icons/type-timestamp.d.ts +3 -3
- package/build/icons/type-title.d.ts +3 -3
- package/build/icons/type-url.d.ts +3 -3
- package/build/index.d.ts +7 -7
- package/build/index.js +697 -3
- package/build/map-image-url.d.ts +2 -2
- package/build/map-page-url.d.ts +1 -1
- package/build/next.d.ts +3 -3
- package/build/renderer.d.ts +49 -49
- package/build/third-party/code.d.ts +16 -16
- package/build/third-party/code.js +1 -1
- package/build/third-party/collection-card.d.ts +3 -3
- package/build/third-party/collection-column-title.d.ts +5 -5
- package/build/third-party/collection-group.d.ts +3 -3
- package/build/third-party/collection-row.d.ts +7 -7
- package/build/third-party/collection-utils.d.ts +1 -1
- package/build/third-party/collection-view-board.d.ts +3 -3
- package/build/third-party/collection-view-gallery.d.ts +3 -3
- package/build/third-party/collection-view-list.d.ts +3 -3
- package/build/third-party/collection-view-table.d.ts +3 -3
- package/build/third-party/collection-view.d.ts +4 -4
- package/build/third-party/collection.d.ts +10 -10
- package/build/third-party/collection.js +1 -1
- package/build/third-party/equation.d.ts +8 -8
- package/build/third-party/equation.js +1 -1
- package/build/third-party/eval-formula.d.ts +20 -20
- package/build/third-party/modal.d.ts +2 -2
- package/build/third-party/pdf.d.ts +4 -4
- package/build/third-party/property.d.ts +21 -21
- package/build/types.d.ts +71 -71
- package/build/utils.d.ts +9 -9
- package/package.json +9 -9
- package/readme.md +3 -3
- package/build/chunk-RGP7M4NM.js +0 -2064
- package/build/dev/chunk-HLFRY3QP.js +0 -2065
- package/build/dev/chunk-HLFRY3QP.js.map +0 -1
package/build/map-image-url.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { Block } from '@texonom/ntypes';
|
|
2
|
-
export declare const defaultMapImageUrl: (url: string, block: Block) => string | null;
|
|
1
|
+
import { Block } from '@texonom/ntypes';
|
|
2
|
+
export declare const defaultMapImageUrl: (url: string, block: Block) => string | null;
|
|
3
3
|
//# sourceMappingURL=map-image-url.d.ts.map
|
package/build/map-page-url.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const defaultMapPageUrl: (rootPageId?: string) => (pageId: string) => string;
|
|
1
|
+
export declare const defaultMapPageUrl: (rootPageId?: string) => (pageId: string) => string;
|
|
2
2
|
//# sourceMappingURL=map-page-url.d.ts.map
|
package/build/next.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export declare const wrapNextImage: (NextImage: any) => React.FC<any>;
|
|
3
|
-
export declare const wrapNextLink: (NextLink: any) => React.FC<any>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const wrapNextImage: (NextImage: any) => React.FC<any>;
|
|
3
|
+
export declare const wrapNextLink: (NextLink: any) => React.FC<any>;
|
|
4
4
|
//# sourceMappingURL=next.d.ts.map
|
package/build/renderer.d.ts
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { ExtendedRecordMap } from '@texonom/ntypes';
|
|
3
|
-
import { MapImageUrlFn, MapPageUrlFn, NotionComponents, SearchNotionFn } from './types';
|
|
4
|
-
export declare const NotionRenderer: React.FC<{
|
|
5
|
-
recordMap: ExtendedRecordMap;
|
|
6
|
-
components?: Partial<NotionComponents>;
|
|
7
|
-
mapPageUrl?: MapPageUrlFn;
|
|
8
|
-
mapImageUrl?: MapImageUrlFn;
|
|
9
|
-
searchNotion?: SearchNotionFn;
|
|
10
|
-
isShowingSearch?: boolean;
|
|
11
|
-
onHideSearch?: () => void;
|
|
12
|
-
rootPageId?: string;
|
|
13
|
-
rootDomain?: string;
|
|
14
|
-
fullPage?: boolean;
|
|
15
|
-
darkMode?: boolean;
|
|
16
|
-
previewImages?: boolean;
|
|
17
|
-
forceCustomImages?: boolean;
|
|
18
|
-
showCollectionViewDropdown?: boolean;
|
|
19
|
-
linkTableTitleProperties?: boolean;
|
|
20
|
-
isLinkCollectionToUrlProperty?: boolean;
|
|
21
|
-
isImageZoomable?: boolean;
|
|
22
|
-
showTableOfContents?: boolean;
|
|
23
|
-
minTableOfContentsItems?: number;
|
|
24
|
-
defaultPageIcon?: string;
|
|
25
|
-
defaultPageCover?: string;
|
|
26
|
-
defaultPageCoverPosition?: number;
|
|
27
|
-
className?: string;
|
|
28
|
-
bodyClassName?: string;
|
|
29
|
-
header?: React.ReactNode;
|
|
30
|
-
footer?: React.ReactNode;
|
|
31
|
-
pageHeader?: React.ReactNode;
|
|
32
|
-
pageFooter?: React.ReactNode;
|
|
33
|
-
pageTitle?: React.ReactNode;
|
|
34
|
-
pageAside?: React.ReactNode;
|
|
35
|
-
pageCover?: React.ReactNode;
|
|
36
|
-
blockId?: string;
|
|
37
|
-
hideBlockId?: boolean;
|
|
38
|
-
disableHeader?: boolean;
|
|
39
|
-
}>;
|
|
40
|
-
export declare const NotionBlockRenderer: React.FC<{
|
|
41
|
-
className?: string;
|
|
42
|
-
bodyClassName?: string;
|
|
43
|
-
header?: React.ReactNode;
|
|
44
|
-
footer?: React.ReactNode;
|
|
45
|
-
disableHeader?: boolean;
|
|
46
|
-
blockId?: string;
|
|
47
|
-
hideBlockId?: boolean;
|
|
48
|
-
level?: number;
|
|
49
|
-
}>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ExtendedRecordMap } from '@texonom/ntypes';
|
|
3
|
+
import { MapImageUrlFn, MapPageUrlFn, NotionComponents, SearchNotionFn } from './types';
|
|
4
|
+
export declare const NotionRenderer: React.FC<{
|
|
5
|
+
recordMap: ExtendedRecordMap;
|
|
6
|
+
components?: Partial<NotionComponents>;
|
|
7
|
+
mapPageUrl?: MapPageUrlFn;
|
|
8
|
+
mapImageUrl?: MapImageUrlFn;
|
|
9
|
+
searchNotion?: SearchNotionFn;
|
|
10
|
+
isShowingSearch?: boolean;
|
|
11
|
+
onHideSearch?: () => void;
|
|
12
|
+
rootPageId?: string;
|
|
13
|
+
rootDomain?: string;
|
|
14
|
+
fullPage?: boolean;
|
|
15
|
+
darkMode?: boolean;
|
|
16
|
+
previewImages?: boolean;
|
|
17
|
+
forceCustomImages?: boolean;
|
|
18
|
+
showCollectionViewDropdown?: boolean;
|
|
19
|
+
linkTableTitleProperties?: boolean;
|
|
20
|
+
isLinkCollectionToUrlProperty?: boolean;
|
|
21
|
+
isImageZoomable?: boolean;
|
|
22
|
+
showTableOfContents?: boolean;
|
|
23
|
+
minTableOfContentsItems?: number;
|
|
24
|
+
defaultPageIcon?: string;
|
|
25
|
+
defaultPageCover?: string;
|
|
26
|
+
defaultPageCoverPosition?: number;
|
|
27
|
+
className?: string;
|
|
28
|
+
bodyClassName?: string;
|
|
29
|
+
header?: React.ReactNode;
|
|
30
|
+
footer?: React.ReactNode;
|
|
31
|
+
pageHeader?: React.ReactNode;
|
|
32
|
+
pageFooter?: React.ReactNode;
|
|
33
|
+
pageTitle?: React.ReactNode;
|
|
34
|
+
pageAside?: React.ReactNode;
|
|
35
|
+
pageCover?: React.ReactNode;
|
|
36
|
+
blockId?: string;
|
|
37
|
+
hideBlockId?: boolean;
|
|
38
|
+
disableHeader?: boolean;
|
|
39
|
+
}>;
|
|
40
|
+
export declare const NotionBlockRenderer: React.FC<{
|
|
41
|
+
className?: string;
|
|
42
|
+
bodyClassName?: string;
|
|
43
|
+
header?: React.ReactNode;
|
|
44
|
+
footer?: React.ReactNode;
|
|
45
|
+
disableHeader?: boolean;
|
|
46
|
+
blockId?: string;
|
|
47
|
+
hideBlockId?: boolean;
|
|
48
|
+
level?: number;
|
|
49
|
+
}>;
|
|
50
50
|
//# sourceMappingURL=renderer.d.ts.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CodeBlock } from '@texonom/ntypes';
|
|
3
|
-
import 'prismjs/components/prism-clike.min.js';
|
|
4
|
-
import 'prismjs/components/prism-css-extras.min.js';
|
|
5
|
-
import 'prismjs/components/prism-css.min.js';
|
|
6
|
-
import 'prismjs/components/prism-javascript.min.js';
|
|
7
|
-
import 'prismjs/components/prism-js-extras.min.js';
|
|
8
|
-
import 'prismjs/components/prism-json.min.js';
|
|
9
|
-
import 'prismjs/components/prism-jsx.min.js';
|
|
10
|
-
import 'prismjs/components/prism-tsx.min.js';
|
|
11
|
-
import 'prismjs/components/prism-typescript.min.js';
|
|
12
|
-
export declare const Code: React.FC<{
|
|
13
|
-
block: CodeBlock;
|
|
14
|
-
defaultLanguage?: string;
|
|
15
|
-
className?: string;
|
|
16
|
-
}>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CodeBlock } from '@texonom/ntypes';
|
|
3
|
+
import 'prismjs/components/prism-clike.min.js';
|
|
4
|
+
import 'prismjs/components/prism-css-extras.min.js';
|
|
5
|
+
import 'prismjs/components/prism-css.min.js';
|
|
6
|
+
import 'prismjs/components/prism-javascript.min.js';
|
|
7
|
+
import 'prismjs/components/prism-js-extras.min.js';
|
|
8
|
+
import 'prismjs/components/prism-json.min.js';
|
|
9
|
+
import 'prismjs/components/prism-jsx.min.js';
|
|
10
|
+
import 'prismjs/components/prism-tsx.min.js';
|
|
11
|
+
import 'prismjs/components/prism-typescript.min.js';
|
|
12
|
+
export declare const Code: React.FC<{
|
|
13
|
+
block: CodeBlock;
|
|
14
|
+
defaultLanguage?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
}>;
|
|
17
17
|
//# sourceMappingURL=code.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CollectionCardProps } from '../types';
|
|
3
|
-
export declare const CollectionCard: React.FC<CollectionCardProps>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CollectionCardProps } from '../types';
|
|
3
|
+
export declare const CollectionCard: React.FC<CollectionCardProps>;
|
|
4
4
|
//# sourceMappingURL=collection-card.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CollectionPropertySchema } from '@texonom/ntypes';
|
|
3
|
-
export declare const CollectionColumnTitle: React.FC<{
|
|
4
|
-
schema: CollectionPropertySchema;
|
|
5
|
-
}>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CollectionPropertySchema } from '@texonom/ntypes';
|
|
3
|
+
export declare const CollectionColumnTitle: React.FC<{
|
|
4
|
+
schema: CollectionPropertySchema;
|
|
5
|
+
}>;
|
|
6
6
|
//# sourceMappingURL=collection-column-title.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CollectionGroupProps } from '../types';
|
|
3
|
-
export declare const CollectionGroup: React.FC<CollectionGroupProps>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CollectionGroupProps } from '../types';
|
|
3
|
+
export declare const CollectionGroup: React.FC<CollectionGroupProps>;
|
|
4
4
|
//# sourceMappingURL=collection-group.d.ts.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { PageBlock } from '@texonom/ntypes';
|
|
3
|
-
export declare const CollectionRow: React.FC<{
|
|
4
|
-
block: PageBlock;
|
|
5
|
-
pageHeader?: boolean;
|
|
6
|
-
className?: string;
|
|
7
|
-
}>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { PageBlock } from '@texonom/ntypes';
|
|
3
|
+
export declare const CollectionRow: React.FC<{
|
|
4
|
+
block: PageBlock;
|
|
5
|
+
pageHeader?: boolean;
|
|
6
|
+
className?: string;
|
|
7
|
+
}>;
|
|
8
8
|
//# sourceMappingURL=collection-row.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function getCollectionGroups(collection: any, collectionView: any, collectionData: any, ...rest: any[]): any;
|
|
1
|
+
export declare function getCollectionGroups(collection: any, collectionView: any, collectionData: any, ...rest: any[]): any;
|
|
2
2
|
//# sourceMappingURL=collection-utils.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CollectionViewProps } from '../types';
|
|
3
|
-
export declare const CollectionViewBoard: React.FC<CollectionViewProps>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CollectionViewProps } from '../types';
|
|
3
|
+
export declare const CollectionViewBoard: React.FC<CollectionViewProps>;
|
|
4
4
|
//# sourceMappingURL=collection-view-board.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CollectionViewProps } from '../types';
|
|
3
|
-
export declare const CollectionViewGallery: React.FC<CollectionViewProps>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CollectionViewProps } from '../types';
|
|
3
|
+
export declare const CollectionViewGallery: React.FC<CollectionViewProps>;
|
|
4
4
|
//# sourceMappingURL=collection-view-gallery.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CollectionViewProps } from '../types';
|
|
3
|
-
export declare const CollectionViewList: React.FC<CollectionViewProps>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CollectionViewProps } from '../types';
|
|
3
|
+
export declare const CollectionViewList: React.FC<CollectionViewProps>;
|
|
4
4
|
//# sourceMappingURL=collection-view-list.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CollectionViewProps } from '../types';
|
|
3
|
-
export declare const CollectionViewTable: React.FC<CollectionViewProps>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CollectionViewProps } from '../types';
|
|
3
|
+
export declare const CollectionViewTable: React.FC<CollectionViewProps>;
|
|
4
4
|
//# sourceMappingURL=collection-view-table.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CollectionViewProps } from '../types';
|
|
3
|
-
export declare const CollectionViewImpl: React.FC<CollectionViewProps>;
|
|
4
|
-
export declare const CollectionView: React.NamedExoticComponent<CollectionViewProps>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { CollectionViewProps } from '../types';
|
|
3
|
+
export declare const CollectionViewImpl: React.FC<CollectionViewProps>;
|
|
4
|
+
export declare const CollectionView: React.NamedExoticComponent<CollectionViewProps>;
|
|
5
5
|
//# sourceMappingURL=collection-view.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as types from '@texonom/ntypes';
|
|
3
|
-
import { NotionContext } from '../context';
|
|
4
|
-
import { PropertyImplMemo } from './property';
|
|
5
|
-
export declare const Collection: React.FC<{
|
|
6
|
-
block: types.CollectionViewBlock | types.CollectionViewPageBlock | types.PageBlock;
|
|
7
|
-
className?: string;
|
|
8
|
-
ctx: NotionContext;
|
|
9
|
-
}>;
|
|
10
|
-
export { PropertyImplMemo as Property };
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as types from '@texonom/ntypes';
|
|
3
|
+
import { NotionContext } from '../context';
|
|
4
|
+
import { PropertyImplMemo } from './property';
|
|
5
|
+
export declare const Collection: React.FC<{
|
|
6
|
+
block: types.CollectionViewBlock | types.CollectionViewPageBlock | types.PageBlock;
|
|
7
|
+
className?: string;
|
|
8
|
+
ctx: NotionContext;
|
|
9
|
+
}>;
|
|
10
|
+
export { PropertyImplMemo as Property };
|
|
11
11
|
//# sourceMappingURL=collection.d.ts.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { EquationBlock } from '@texonom/ntypes';
|
|
3
|
-
export declare const Equation: React.FC<{
|
|
4
|
-
block: EquationBlock;
|
|
5
|
-
math?: string;
|
|
6
|
-
inline?: boolean;
|
|
7
|
-
className?: string;
|
|
8
|
-
}>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { EquationBlock } from '@texonom/ntypes';
|
|
3
|
+
export declare const Equation: React.FC<{
|
|
4
|
+
block: EquationBlock;
|
|
5
|
+
math?: string;
|
|
6
|
+
inline?: boolean;
|
|
7
|
+
className?: string;
|
|
8
|
+
}>;
|
|
9
9
|
//# sourceMappingURL=equation.d.ts.map
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import * as types from '@texonom/ntypes';
|
|
2
|
-
export interface EvalFormulaContext {
|
|
3
|
-
properties: types.PropertyMap;
|
|
4
|
-
schema: types.CollectionPropertySchemaMap;
|
|
5
|
-
endDate?: boolean;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* Evaluates a Notion formula expression to a result value.
|
|
9
|
-
*
|
|
10
|
-
* All built-in functions and operators are supported.
|
|
11
|
-
*
|
|
12
|
-
* NOTE: this needs a lot more testing, especially around covering all the different
|
|
13
|
-
* function types and coercing different property values correctly.
|
|
14
|
-
*
|
|
15
|
-
* It does work for many of our test cases, however.
|
|
16
|
-
*
|
|
17
|
-
* @param formula - Formula to evaluate.
|
|
18
|
-
* @param context - Collection context containing property schema and values.
|
|
19
|
-
*/
|
|
20
|
-
export declare function evalFormula(formula: types.Formula, context: EvalFormulaContext): types.FormulaResult;
|
|
1
|
+
import * as types from '@texonom/ntypes';
|
|
2
|
+
export interface EvalFormulaContext {
|
|
3
|
+
properties: types.PropertyMap;
|
|
4
|
+
schema: types.CollectionPropertySchemaMap;
|
|
5
|
+
endDate?: boolean;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Evaluates a Notion formula expression to a result value.
|
|
9
|
+
*
|
|
10
|
+
* All built-in functions and operators are supported.
|
|
11
|
+
*
|
|
12
|
+
* NOTE: this needs a lot more testing, especially around covering all the different
|
|
13
|
+
* function types and coercing different property values correctly.
|
|
14
|
+
*
|
|
15
|
+
* It does work for many of our test cases, however.
|
|
16
|
+
*
|
|
17
|
+
* @param formula - Formula to evaluate.
|
|
18
|
+
* @param context - Collection context containing property schema and values.
|
|
19
|
+
*/
|
|
20
|
+
export declare function evalFormula(formula: types.Formula, context: EvalFormulaContext): types.FormulaResult;
|
|
21
21
|
//# sourceMappingURL=eval-formula.d.ts.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import Modal from 'react-modal';
|
|
2
|
-
export { Modal };
|
|
1
|
+
import Modal from 'react-modal';
|
|
2
|
+
export { Modal };
|
|
3
3
|
//# sourceMappingURL=modal.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export declare const Pdf: React.FC<{
|
|
3
|
-
file: string;
|
|
4
|
-
}>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const Pdf: React.FC<{
|
|
3
|
+
file: string;
|
|
4
|
+
}>;
|
|
5
5
|
//# sourceMappingURL=pdf.d.ts.map
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as types from '@texonom/ntypes';
|
|
3
|
-
export interface IPropertyProps {
|
|
4
|
-
propertyId?: string;
|
|
5
|
-
schema?: types.CollectionPropertySchema;
|
|
6
|
-
data?: types.Decoration[];
|
|
7
|
-
block?: types.Block;
|
|
8
|
-
collection?: types.Collection;
|
|
9
|
-
inline?: boolean;
|
|
10
|
-
linkToTitlePage?: boolean;
|
|
11
|
-
pageHeader?: boolean;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Renders a single value of structured Notion data according to its schema.
|
|
15
|
-
*
|
|
16
|
-
* This corresponds to rendering the content of a single cell in a table.
|
|
17
|
-
* Property rendering is re-used across all the different types of collection views.
|
|
18
|
-
*/
|
|
19
|
-
export declare const Property: React.FC<IPropertyProps>;
|
|
20
|
-
export declare const PropertyImpl: React.FC<IPropertyProps>;
|
|
21
|
-
export declare const PropertyImplMemo: React.NamedExoticComponent<IPropertyProps>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as types from '@texonom/ntypes';
|
|
3
|
+
export interface IPropertyProps {
|
|
4
|
+
propertyId?: string;
|
|
5
|
+
schema?: types.CollectionPropertySchema;
|
|
6
|
+
data?: types.Decoration[];
|
|
7
|
+
block?: types.Block;
|
|
8
|
+
collection?: types.Collection;
|
|
9
|
+
inline?: boolean;
|
|
10
|
+
linkToTitlePage?: boolean;
|
|
11
|
+
pageHeader?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Renders a single value of structured Notion data according to its schema.
|
|
15
|
+
*
|
|
16
|
+
* This corresponds to rendering the content of a single cell in a table.
|
|
17
|
+
* Property rendering is re-used across all the different types of collection views.
|
|
18
|
+
*/
|
|
19
|
+
export declare const Property: React.FC<IPropertyProps>;
|
|
20
|
+
export declare const PropertyImpl: React.FC<IPropertyProps>;
|
|
21
|
+
export declare const PropertyImplMemo: React.NamedExoticComponent<IPropertyProps>;
|
|
22
22
|
//# sourceMappingURL=property.d.ts.map
|
package/build/types.d.ts
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import * as types from '@texonom/ntypes';
|
|
3
|
-
export type MapPageUrlFn = (pageId: string, recordMap?: types.ExtendedRecordMap | undefined) => string;
|
|
4
|
-
export type MapImageUrlFn = (url: string, block: types.Block) => string;
|
|
5
|
-
export type SearchNotionFn = (params: types.SearchParams) => Promise<types.SearchResults>;
|
|
6
|
-
export type ComponentOverrideFn = (props: any, defaultValueFn: () => React.ReactNode) => any;
|
|
7
|
-
export interface NotionComponents {
|
|
8
|
-
Image: any;
|
|
9
|
-
Link: any;
|
|
10
|
-
PageLink: any;
|
|
11
|
-
Checkbox: React.FC<{
|
|
12
|
-
isChecked: boolean;
|
|
13
|
-
blockId: string;
|
|
14
|
-
}>;
|
|
15
|
-
Code: any;
|
|
16
|
-
Equation: any;
|
|
17
|
-
Callout?: any;
|
|
18
|
-
Collection: any;
|
|
19
|
-
Property?: any;
|
|
20
|
-
propertyTextValue: ComponentOverrideFn;
|
|
21
|
-
propertySelectValue: ComponentOverrideFn;
|
|
22
|
-
propertyRelationValue: ComponentOverrideFn;
|
|
23
|
-
propertyFormulaValue: ComponentOverrideFn;
|
|
24
|
-
propertyTitleValue: ComponentOverrideFn;
|
|
25
|
-
propertyPersonValue: ComponentOverrideFn;
|
|
26
|
-
propertyFileValue: ComponentOverrideFn;
|
|
27
|
-
propertyCheckboxValue: ComponentOverrideFn;
|
|
28
|
-
propertyUrlValue: ComponentOverrideFn;
|
|
29
|
-
propertyEmailValue: ComponentOverrideFn;
|
|
30
|
-
propertyPhoneNumberValue: ComponentOverrideFn;
|
|
31
|
-
propertyNumberValue: ComponentOverrideFn;
|
|
32
|
-
propertyLastEditedTimeValue: ComponentOverrideFn;
|
|
33
|
-
propertyCreatedTimeValue: ComponentOverrideFn;
|
|
34
|
-
propertyDateValue: ComponentOverrideFn;
|
|
35
|
-
Pdf: any;
|
|
36
|
-
Tweet: any;
|
|
37
|
-
Modal: any;
|
|
38
|
-
Embed: any;
|
|
39
|
-
Header: any;
|
|
40
|
-
nextImage?: any;
|
|
41
|
-
nextLink?: any;
|
|
42
|
-
}
|
|
43
|
-
export interface CollectionViewProps {
|
|
44
|
-
collection: types.Collection;
|
|
45
|
-
collectionView: types.CollectionView;
|
|
46
|
-
collectionData: types.CollectionQueryResult;
|
|
47
|
-
padding?: number;
|
|
48
|
-
width?: number;
|
|
49
|
-
}
|
|
50
|
-
export interface CollectionCardProps {
|
|
51
|
-
collection: types.Collection;
|
|
52
|
-
block: types.PageBlock;
|
|
53
|
-
cover: types.CollectionCardCover;
|
|
54
|
-
coverSize: types.CollectionCardCoverSize;
|
|
55
|
-
coverAspect: types.CollectionCardCoverAspect;
|
|
56
|
-
properties?: Array<{
|
|
57
|
-
property: types.PropertyID;
|
|
58
|
-
visible: boolean;
|
|
59
|
-
}>;
|
|
60
|
-
className?: string;
|
|
61
|
-
}
|
|
62
|
-
export interface CollectionGroupProps {
|
|
63
|
-
collection: types.Collection;
|
|
64
|
-
collectionViewComponent: React.ElementType;
|
|
65
|
-
collectionGroup: any;
|
|
66
|
-
hidden: boolean;
|
|
67
|
-
schema: any;
|
|
68
|
-
value: any;
|
|
69
|
-
summaryProps: any;
|
|
70
|
-
detailsProps: any;
|
|
71
|
-
}
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as types from '@texonom/ntypes';
|
|
3
|
+
export type MapPageUrlFn = (pageId: string, recordMap?: types.ExtendedRecordMap | undefined) => string;
|
|
4
|
+
export type MapImageUrlFn = (url: string, block: types.Block) => string;
|
|
5
|
+
export type SearchNotionFn = (params: types.SearchParams) => Promise<types.SearchResults>;
|
|
6
|
+
export type ComponentOverrideFn = (props: any, defaultValueFn: () => React.ReactNode) => any;
|
|
7
|
+
export interface NotionComponents {
|
|
8
|
+
Image: any;
|
|
9
|
+
Link: any;
|
|
10
|
+
PageLink: any;
|
|
11
|
+
Checkbox: React.FC<{
|
|
12
|
+
isChecked: boolean;
|
|
13
|
+
blockId: string;
|
|
14
|
+
}>;
|
|
15
|
+
Code: any;
|
|
16
|
+
Equation: any;
|
|
17
|
+
Callout?: any;
|
|
18
|
+
Collection: any;
|
|
19
|
+
Property?: any;
|
|
20
|
+
propertyTextValue: ComponentOverrideFn;
|
|
21
|
+
propertySelectValue: ComponentOverrideFn;
|
|
22
|
+
propertyRelationValue: ComponentOverrideFn;
|
|
23
|
+
propertyFormulaValue: ComponentOverrideFn;
|
|
24
|
+
propertyTitleValue: ComponentOverrideFn;
|
|
25
|
+
propertyPersonValue: ComponentOverrideFn;
|
|
26
|
+
propertyFileValue: ComponentOverrideFn;
|
|
27
|
+
propertyCheckboxValue: ComponentOverrideFn;
|
|
28
|
+
propertyUrlValue: ComponentOverrideFn;
|
|
29
|
+
propertyEmailValue: ComponentOverrideFn;
|
|
30
|
+
propertyPhoneNumberValue: ComponentOverrideFn;
|
|
31
|
+
propertyNumberValue: ComponentOverrideFn;
|
|
32
|
+
propertyLastEditedTimeValue: ComponentOverrideFn;
|
|
33
|
+
propertyCreatedTimeValue: ComponentOverrideFn;
|
|
34
|
+
propertyDateValue: ComponentOverrideFn;
|
|
35
|
+
Pdf: any;
|
|
36
|
+
Tweet: any;
|
|
37
|
+
Modal: any;
|
|
38
|
+
Embed: any;
|
|
39
|
+
Header: any;
|
|
40
|
+
nextImage?: any;
|
|
41
|
+
nextLink?: any;
|
|
42
|
+
}
|
|
43
|
+
export interface CollectionViewProps {
|
|
44
|
+
collection: types.Collection;
|
|
45
|
+
collectionView: types.CollectionView;
|
|
46
|
+
collectionData: types.CollectionQueryResult;
|
|
47
|
+
padding?: number;
|
|
48
|
+
width?: number;
|
|
49
|
+
}
|
|
50
|
+
export interface CollectionCardProps {
|
|
51
|
+
collection: types.Collection;
|
|
52
|
+
block: types.PageBlock;
|
|
53
|
+
cover: types.CollectionCardCover;
|
|
54
|
+
coverSize: types.CollectionCardCoverSize;
|
|
55
|
+
coverAspect: types.CollectionCardCoverAspect;
|
|
56
|
+
properties?: Array<{
|
|
57
|
+
property: types.PropertyID;
|
|
58
|
+
visible: boolean;
|
|
59
|
+
}>;
|
|
60
|
+
className?: string;
|
|
61
|
+
}
|
|
62
|
+
export interface CollectionGroupProps {
|
|
63
|
+
collection: types.Collection;
|
|
64
|
+
collectionViewComponent: React.ElementType;
|
|
65
|
+
collectionGroup: any;
|
|
66
|
+
hidden: boolean;
|
|
67
|
+
schema: any;
|
|
68
|
+
value: any;
|
|
69
|
+
summaryProps: any;
|
|
70
|
+
detailsProps: any;
|
|
71
|
+
}
|
|
72
72
|
//# sourceMappingURL=types.d.ts.map
|
package/build/utils.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { BlockMap } from '@texonom/ntypes';
|
|
2
|
-
export { isUrl, formatDate, formatNotionDateTime } from '@texonom/nutils';
|
|
3
|
-
export * from './map-image-url';
|
|
4
|
-
export * from './map-page-url';
|
|
5
|
-
export declare const cs: (...classes: Array<string | undefined | false>) => string;
|
|
6
|
-
export declare const getListNumber: (blockId: string, blockMap: BlockMap) => number;
|
|
7
|
-
export declare const getHashFragmentValue: (url: string) => string;
|
|
8
|
-
export declare const isBrowser: boolean;
|
|
9
|
-
export declare const getYoutubeId: (url: string) => string | null;
|
|
1
|
+
import { BlockMap } from '@texonom/ntypes';
|
|
2
|
+
export { isUrl, formatDate, formatNotionDateTime } from '@texonom/nutils';
|
|
3
|
+
export * from './map-image-url';
|
|
4
|
+
export * from './map-page-url';
|
|
5
|
+
export declare const cs: (...classes: Array<string | undefined | false>) => string;
|
|
6
|
+
export declare const getListNumber: (blockId: string, blockMap: BlockMap) => number;
|
|
7
|
+
export declare const getHashFragmentValue: (url: string) => string;
|
|
8
|
+
export declare const isBrowser: boolean;
|
|
9
|
+
export declare const getYoutubeId: (url: string) => string | null;
|
|
10
10
|
//# sourceMappingURL=utils.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@texonom/nreact",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Fast and accurate React renderer for Notion.",
|
|
6
|
-
"repository": "texonom/notion",
|
|
6
|
+
"repository": "texonom/notion-node",
|
|
7
7
|
"author": "Alan Jo <sungle3737@gmail.com>",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"main": "./build/index.js",
|
|
@@ -23,24 +23,24 @@
|
|
|
23
23
|
"katex": "^0.16.7",
|
|
24
24
|
"prismjs": "^1.29.0",
|
|
25
25
|
"react-fast-compare": "^3.2.1",
|
|
26
|
-
"react-hotkeys-hook": "^
|
|
26
|
+
"react-hotkeys-hook": "^4.4.0",
|
|
27
27
|
"react-image": "^4.1.0",
|
|
28
28
|
"react-modal": "^3.16.1",
|
|
29
|
-
"react-pdf": "^
|
|
29
|
+
"react-pdf": "^7.1.1",
|
|
30
30
|
"react-use": "^17.4.0",
|
|
31
|
-
"@texonom/ntypes": "^1.1.
|
|
32
|
-
"@texonom/nutils": "^1.1.
|
|
31
|
+
"@texonom/ntypes": "^1.1.3",
|
|
32
|
+
"@texonom/nutils": "^1.1.3"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/lodash.throttle": "^4.1.7",
|
|
36
36
|
"@types/node": "^16.18.28",
|
|
37
|
-
"@types/react": "^
|
|
37
|
+
"@types/react": "^18.2.9",
|
|
38
38
|
"clipboard-copy": "^4.0.1",
|
|
39
39
|
"date-fns": "^2.30.0",
|
|
40
40
|
"format-number": "^3.0.0",
|
|
41
41
|
"lodash.throttle": "^4.1.1",
|
|
42
|
-
"react": "^
|
|
43
|
-
"react-dom": "^
|
|
42
|
+
"react": "^18.2.0",
|
|
43
|
+
"react-dom": "^18.2.0"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": ">=16",
|