rotion 2.0.0 → 2.0.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.
@@ -1,4 +1,4 @@
1
- import React, { ReactNode, JSX } from 'react';
1
+ import React, { ReactNode, JSX, ComponentType, ComponentProps } from 'react';
2
2
  import { QueryDatabaseResponse, PageObjectResponse, GetPagePropertyResponse, DatabaseObjectResponse, TextRichTextItemResponse, MentionRichTextItemResponse, GetSelfResponse, EquationRichTextItemResponse, ListBlockChildrenResponse, ParagraphBlockObjectResponse, Heading1BlockObjectResponse, Heading2BlockObjectResponse, Heading3BlockObjectResponse, BulletedListItemBlockObjectResponse, NumberedListItemBlockObjectResponse, QuoteBlockObjectResponse, ToDoBlockObjectResponse, ToggleBlockObjectResponse, TemplateBlockObjectResponse, SyncedBlockBlockObjectResponse, ChildPageBlockObjectResponse, ChildDatabaseBlockObjectResponse, EquationBlockObjectResponse, CodeBlockObjectResponse, CalloutBlockObjectResponse, RichTextItemResponse, DividerBlockObjectResponse, BreadcrumbBlockObjectResponse, TableOfContentsBlockObjectResponse, ColumnListBlockObjectResponse, ColumnBlockObjectResponse, LinkToPageBlockObjectResponse, TableBlockObjectResponse, TableRowBlockObjectResponse, EmbedBlockObjectResponse, BookmarkBlockObjectResponse, ImageBlockObjectResponse, VideoBlockObjectResponse, PdfBlockObjectResponse, FileBlockObjectResponse, AudioBlockObjectResponse, LinkPreviewBlockObjectResponse, UnsupportedBlockObjectResponse, GetPageResponse } from '@notionhq/client/build/src/api-endpoints.js';
3
3
  import { ParsedUrlQueryInput } from 'node:querystring';
4
4
  import { UrlObject } from 'node:url';
@@ -932,5 +932,36 @@ declare function GenHtmlId(uuidv8Id: string): string;
932
932
  */
933
933
  declare const TableOfContents: ({ blocks }: TableOfContentsProps) => React.JSX.Element;
934
934
 
935
- export { BookmarkBlock, BreadcrumbBlock, Breadcrumbs, BuildPlainTextByPage, BulletedListBlock, CalloutBlock, Checkbox, ChildDatabaseBlock, ChildPageBlock, CodeBlock, ColumnListBlock, EmbedBlock, EquationBlock, FileBlock, Gallery, GalleryCard, GalleryCheckboxField, GalleryDateField, GalleryFormulaField, GalleryMultiSelectField$1 as GalleryMultiSelectField, GalleryNumberField, GalleryRichTextField, GalleryMultiSelectField as GallerySelectField, GalleryTitleField, GalleryUrlField, GenHtmlId, Icon, ImageBlock, LinkPreviewBlock, List, ListCheckboxField, ListDateField, ListFormulaField, ListMultiSelectField, ListNumberField, ListRichTextField, ListSelectField, ListTitleField, ListUrlField, NumberedListBlock, Page, PdfBlock, PrefixSuffix, RichText, SyncedBlock, Table, TableBlock, TableCheckboxField, TableDateField, TableFormulaField, TableIcon, TableMultiSelectField, TableNumberField, TableOfContents, TableOfContentsBlock, TableRichTextField, TableSelectField, TableTitleField, TableUrlField, TextBlock, ToDoBlock, ToggleBlock, UsePagination, VideoBlock, getDatetimeFormat, getLinkPathAndLinkKey, getSlug, pathBasename, queryToString, splitUrl };
935
+ /**
936
+ * Creates a Client Component wrapper for a Link component to use with rotion in Next.js App Router
937
+ *
938
+ * In Next.js App Router, you cannot pass Server Components (like next/link) directly to
939
+ * Client Components. This helper creates a Client Component wrapper that can be safely passed.
940
+ *
941
+ * @example Next.js App Router
942
+ * ```tsx
943
+ * // app/lib/rotion.ts
944
+ * import { createClientLink } from 'rotion/helpers'
945
+ * import NextLink from 'next/link'
946
+ *
947
+ * export const ClientLink = createClientLink(NextLink)
948
+ * ```
949
+ *
950
+ * ```tsx
951
+ * // app/page.tsx
952
+ * import { Page } from 'rotion/ui'
953
+ * import { ClientLink } from './lib/rotion'
954
+ *
955
+ * export default async function MyPage() {
956
+ * const blocks = await FetchBlocks(...)
957
+ * return <Page blocks={blocks} link={ClientLink} />
958
+ * }
959
+ * ```
960
+ *
961
+ * @param LinkComponent - The Link component from your framework (e.g., next/link)
962
+ * @returns A Client Component wrapper that can be used with rotion
963
+ */
964
+ declare function createClientLink<T extends ComponentType<any>>(LinkComponent: T): ComponentType<ComponentProps<T>>;
965
+
966
+ export { BookmarkBlock, BreadcrumbBlock, Breadcrumbs, BuildPlainTextByPage, BulletedListBlock, CalloutBlock, Checkbox, ChildDatabaseBlock, ChildPageBlock, CodeBlock, ColumnListBlock, EmbedBlock, EquationBlock, FileBlock, Gallery, GalleryCard, GalleryCheckboxField, GalleryDateField, GalleryFormulaField, GalleryMultiSelectField$1 as GalleryMultiSelectField, GalleryNumberField, GalleryRichTextField, GalleryMultiSelectField as GallerySelectField, GalleryTitleField, GalleryUrlField, GenHtmlId, Icon, ImageBlock, LinkPreviewBlock, List, ListCheckboxField, ListDateField, ListFormulaField, ListMultiSelectField, ListNumberField, ListRichTextField, ListSelectField, ListTitleField, ListUrlField, NumberedListBlock, Page, PdfBlock, PrefixSuffix, RichText, SyncedBlock, Table, TableBlock, TableCheckboxField, TableDateField, TableFormulaField, TableIcon, TableMultiSelectField, TableNumberField, TableOfContents, TableOfContentsBlock, TableRichTextField, TableSelectField, TableTitleField, TableUrlField, TextBlock, ToDoBlock, ToggleBlock, UsePagination, VideoBlock, createClientLink, getDatetimeFormat, getLinkPathAndLinkKey, getSlug, pathBasename, queryToString, splitUrl };
936
967
  export type { Link };