Skip to content

Commit eb7dccc

Browse files
feat: move defaultMapImageUrl and defaultMapPageUrl into notion-utils
1 parent c4021b4 commit eb7dccc

File tree

7 files changed

+6
-7
lines changed

7 files changed

+6
-7
lines changed

examples/full/lib/preview-images.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ import {
55
type PreviewImage,
66
type PreviewImageMap
77
} from 'notion-types'
8-
import { getPageImageUrls } from 'notion-utils'
8+
import { defaultMapImageUrl, getPageImageUrls } from 'notion-utils'
99
import pMap from 'p-map'
1010
import pMemoize from 'p-memoize'
11-
import { defaultMapImageUrl } from 'react-notion-x'
11+
import {} from 'react-notion-x'
1212

1313
// NOTE: this is just an example of how to pre-compute preview images.
1414
// Depending on how many images you're working with, this can potentially be

examples/full/pages/[pageId].tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { type ExtendedRecordMap } from 'notion-types'
2-
import { getAllPagesInSpace } from 'notion-utils'
3-
import { defaultMapPageUrl } from 'react-notion-x'
2+
import { defaultMapPageUrl, getAllPagesInSpace } from 'notion-utils'
43

54
import { NotionPage } from '../components/NotionPage'
65
import {

packages/notion-utils/src/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export * from './get-page-title'
1717
export * from './get-text-content'
1818
export * from './id-to-uuid'
1919
export * from './is-url'
20+
export * from './map-image-url'
21+
export * from './map-page-url'
2022
export * from './merge-record-maps'
2123
export * from './normalize-title'
2224
export * from './normalize-url'

packages/react-notion-x/src/context.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { type ExtendedRecordMap } from 'notion-types'
2+
import { defaultMapImageUrl, defaultMapPageUrl } from 'notion-utils'
23
import * as React from 'react'
34

45
import { AssetWrapper } from './components/asset-wrapper'
@@ -11,7 +12,6 @@ import {
1112
type NotionComponents,
1213
type SearchNotionFn
1314
} from './types'
14-
import { defaultMapImageUrl, defaultMapPageUrl } from './utils'
1515

1616
export interface NotionContext {
1717
recordMap: ExtendedRecordMap

packages/react-notion-x/src/utils.ts

-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { type BlockMap } from 'notion-types'
22

3-
export * from './map-image-url'
4-
export * from './map-page-url'
53
export { formatDate, formatNotionDateTime, isUrl } from 'notion-utils'
64

75
export const cs = (...classes: Array<string | undefined | false>) =>

0 commit comments

Comments
 (0)