Skip to content

Commit

Permalink
Merge branch 'NotionX:master' into collection-view-calendar
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelCasaDev authored Oct 10, 2024
2 parents e6e62b6 + 3e8b41b commit d899d24
Show file tree
Hide file tree
Showing 14 changed files with 47 additions and 31 deletions.
6 changes: 3 additions & 3 deletions examples/cra/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "notion-x-example-cra",
"version": "6.16.0",
"version": "6.16.1",
"private": true,
"scripts": {
"dev": "GENERATE_SOURCEMAP=false react-scripts start",
Expand All @@ -12,10 +12,10 @@
"@types/node": "^16.11.26",
"@types/react": "^17.0.43",
"@types/react-dom": "^17.0.14",
"notion-types": "^6.15.6",
"notion-types": "^6.16.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-notion-x": "^6.16.0",
"react-notion-x": "^6.16.1",
"react-scripts": "5.0.0",
"typescript": "^4.6.3"
},
Expand Down
10 changes: 5 additions & 5 deletions examples/full/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "notion-x-example-full",
"version": "6.16.0",
"version": "6.16.2",
"private": true,
"type": "commonjs",
"scripts": {
Expand All @@ -18,14 +18,14 @@
"got": "^12.0.2",
"lqip-modern": "^1.2.0",
"next": "^12.1.0",
"notion-client": "^6.16.0",
"notion-compat": "^6.16.0",
"notion-utils": "^6.16.0",
"notion-client": "^6.16.1",
"notion-compat": "^6.16.1",
"notion-utils": "^6.16.1",
"p-map": "^5.3.0",
"p-memoize": "^6.0.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-notion-x": "^6.16.0",
"react-notion-x": "^6.16.1",
"react-tweet-embed": "^2.0.0"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions examples/full/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import 'prismjs/themes/prism-tomorrow.css'
// core styles shared by all of react-notion-x (required)
import 'react-notion-x/src/styles.css'

// force push
import '../styles/globals.css'

function MyApp({ Component, pageProps }) {
Expand Down
8 changes: 4 additions & 4 deletions examples/minimal/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "notion-x-example-minimal",
"version": "6.16.0",
"version": "6.16.1",
"private": true,
"type": "commonjs",
"scripts": {
Expand All @@ -11,11 +11,11 @@
},
"dependencies": {
"next": "^12.1.0",
"notion-client": "^6.16.0",
"notion-utils": "^6.16.0",
"notion-client": "^6.16.1",
"notion-utils": "^6.16.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-notion-x": "^6.16.0"
"react-notion-x": "^6.16.1"
},
"devDependencies": {
"@types/node": "^16.11.2",
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "6.16.0",
"version": "6.16.2",
"npmClient": "yarn",
"useWorkspaces": true,
"packages": [
Expand Down
6 changes: 3 additions & 3 deletions packages/notion-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "notion-client",
"version": "6.16.0",
"version": "6.16.1",
"type": "module",
"description": "Robust TypeScript client for the unofficial Notion API.",
"repository": "NotionX/react-notion-x",
Expand All @@ -23,8 +23,8 @@
},
"dependencies": {
"got": "^11.8.1",
"notion-types": "^6.16.0",
"notion-utils": "^6.16.0",
"notion-types": "^6.16.1",
"notion-utils": "^6.16.1",
"p-map": "^5.3.0"
},
"ava": {
Expand Down
8 changes: 4 additions & 4 deletions packages/notion-compat/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "notion-compat",
"version": "6.16.0",
"version": "6.16.1",
"type": "module",
"description": "Compatibility layer between the official Notion API and unofficial private API.",
"repository": "NotionX/react-notion-x",
Expand All @@ -22,13 +22,13 @@
"test": "ava"
},
"dependencies": {
"notion-types": "^6.16.0",
"notion-utils": "^6.16.0",
"notion-types": "^6.16.1",
"notion-utils": "^6.16.1",
"p-queue": "^7.2.0"
},
"devDependencies": {
"@notionhq/client": "^1.0.4",
"notion-client": "^6.16.0"
"notion-client": "^6.16.1"
},
"peerDependencies": {
"@notionhq/client": "^1.0.4"
Expand Down
2 changes: 1 addition & 1 deletion packages/notion-types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "notion-types",
"version": "6.16.0",
"version": "6.16.1",
"type": "module",
"description": "TypeScript types for core Notion data structures.",
"repository": "NotionX/react-notion-x",
Expand Down
4 changes: 2 additions & 2 deletions packages/notion-utils/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "notion-utils",
"version": "6.16.0",
"version": "6.16.1",
"type": "module",
"description": "Useful utilities for working with Notion data. Isomorphic.",
"repository": "NotionX/react-notion-x",
Expand Down Expand Up @@ -31,7 +31,7 @@
"is-url-superb": "^6.1.0",
"mem": "^9.0.2",
"normalize-url": "^7.0.3",
"notion-types": "^6.16.0",
"notion-types": "^6.16.1",
"p-queue": "^7.2.0"
},
"ava": {
Expand Down
2 changes: 1 addition & 1 deletion packages/notion-utils/src/get-all-pages-in-space.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export async function getAllPagesInSpace(
Object.keys(page.block)
.filter((key) => {
const block = page.block[key]?.value
if (!block) return false
if (!block || block.alive === false) return false

if (
block.type !== 'page' &&
Expand Down
6 changes: 3 additions & 3 deletions packages/react-notion-x/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-notion-x",
"version": "6.16.0",
"version": "6.16.1",
"type": "module",
"description": "Fast and accurate React renderer for Notion.",
"repository": "NotionX/react-notion-x",
Expand All @@ -25,8 +25,8 @@
"@fisch0920/medium-zoom": "^1.0.7",
"@matejmazur/react-katex": "^3.1.3",
"katex": "^0.15.3",
"notion-types": "^6.16.0",
"notion-utils": "^6.16.0",
"notion-types": "^6.16.1",
"notion-utils": "^6.16.1",
"prismjs": "^1.27.0",
"react-fast-compare": "^3.2.0",
"react-hotkeys-hook": "^3.0.3",
Expand Down
10 changes: 8 additions & 2 deletions packages/react-notion-x/src/components/eoi.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,14 @@ export const EOI: React.FC<{

<div className='notion-external-description'>
<div className='notion-external-title'>{title}</div>

{(owner || lastUpdated) && (
{!inline && owner ? (
<div className='notion-external-block-desc'>
{owner}
{lastUpdated && <span></span>}
{lastUpdated && `Updated ${lastUpdated}`}
</div>
) : null}
{inline && (owner || lastUpdated) && (
<MentionPreviewCard
title={title}
owner={owner}
Expand Down
7 changes: 7 additions & 0 deletions packages/react-notion-x/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -2985,6 +2985,13 @@ svg.notion-page-icon {
color: var(--fg-color-3);
}

.notion-external-block-desc {
color: rgba(55, 53, 47, 0.65);
font-size: 12px;
white-space: nowrap;
padding-top: 4px;
}

.notion-external-mention .notion-external-subtitle {
display: none;
position: absolute;
Expand Down
6 changes: 4 additions & 2 deletions packages/react-notion-x/src/third-party/collection-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,9 @@ export const CollectionCard: React.FC<CollectionCardProps> = ({
} = ctx
let coverContent = null

const { page_cover_position = 0.5 } = block.format || {}
const { page_cover_position = 0.5, card_cover_position = 0.5 } = block.format || {}

Check failure on line 32 in packages/react-notion-x/src/third-party/collection-card.tsx

View workflow job for this annotation

GitHub Actions / build-minimal

Property 'card_cover_position' does not exist on type '{ page_full_width?: boolean; page_small_text?: boolean; page_cover_position?: number; block_locked?: boolean; block_locked_by?: string; page_cover?: string; page_icon?: string; block_color?: Color; }'.

Check failure on line 32 in packages/react-notion-x/src/third-party/collection-card.tsx

View workflow job for this annotation

GitHub Actions / test

Property 'card_cover_position' does not exist on type '{ page_full_width?: boolean; page_small_text?: boolean; page_cover_position?: number; block_locked?: boolean; block_locked_by?: string; page_cover?: string; page_icon?: string; block_color?: Color; }'.

Check failure on line 32 in packages/react-notion-x/src/third-party/collection-card.tsx

View workflow job for this annotation

GitHub Actions / build-full

Property 'card_cover_position' does not exist on type '{ page_full_width?: boolean; page_small_text?: boolean; page_cover_position?: number; block_locked?: boolean; block_locked_by?: string; page_cover?: string; page_icon?: string; block_color?: Color; }'.
const coverPosition = (1 - page_cover_position) * 100
const cardCoverPosition = (1 - card_cover_position) * 100

if (cover?.type === 'page_content') {
const contentBlockId = block.content?.find((blockId) => {
Expand All @@ -57,7 +58,8 @@ export const CollectionCard: React.FC<CollectionCardProps> = ({
src={src}
alt={caption || 'notion image'}
style={{
objectFit: coverAspect
objectFit: coverAspect,
objectPosition: `center ${cardCoverPosition}%`
}}
/>
)
Expand Down

0 comments on commit d899d24

Please sign in to comment.