Skip to content

Commit

Permalink
feat: move defaultMapImageUrl and defaultMapPageUrl into notion-utils
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Nov 8, 2024
1 parent c4021b4 commit eb7dccc
Show file tree
Hide file tree
Showing 7 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions examples/full/lib/preview-images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import {
type PreviewImage,
type PreviewImageMap
} from 'notion-types'
import { getPageImageUrls } from 'notion-utils'
import { defaultMapImageUrl, getPageImageUrls } from 'notion-utils'
import pMap from 'p-map'
import pMemoize from 'p-memoize'
import { defaultMapImageUrl } from 'react-notion-x'
import {} from 'react-notion-x'

// NOTE: this is just an example of how to pre-compute preview images.
// Depending on how many images you're working with, this can potentially be
Expand Down
3 changes: 1 addition & 2 deletions examples/full/pages/[pageId].tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { type ExtendedRecordMap } from 'notion-types'
import { getAllPagesInSpace } from 'notion-utils'
import { defaultMapPageUrl } from 'react-notion-x'
import { defaultMapPageUrl, getAllPagesInSpace } from 'notion-utils'

import { NotionPage } from '../components/NotionPage'
import {
Expand Down
2 changes: 2 additions & 0 deletions packages/notion-utils/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export * from './get-page-title'
export * from './get-text-content'
export * from './id-to-uuid'
export * from './is-url'
export * from './map-image-url'
export * from './map-page-url'
export * from './merge-record-maps'
export * from './normalize-title'
export * from './normalize-url'
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion packages/react-notion-x/src/context.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { type ExtendedRecordMap } from 'notion-types'
import { defaultMapImageUrl, defaultMapPageUrl } from 'notion-utils'
import * as React from 'react'

import { AssetWrapper } from './components/asset-wrapper'
Expand All @@ -11,7 +12,6 @@ import {
type NotionComponents,
type SearchNotionFn
} from './types'
import { defaultMapImageUrl, defaultMapPageUrl } from './utils'

export interface NotionContext {
recordMap: ExtendedRecordMap
Expand Down
2 changes: 0 additions & 2 deletions packages/react-notion-x/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { type BlockMap } from 'notion-types'

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

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

0 comments on commit eb7dccc

Please sign in to comment.