Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,8 @@ export * from './useVideoPlayer/index.js';

export * from './ContentLink/index.js';
export * from './useContentLink/index.js';

// Re-export types and utilities from @datocms/content-link for convenience
// Do NOT put these in a 'use client' component or custom hook or they won't run in RSCs correctly
export { decodeStega, revealStega, stripStega } from '@datocms/content-link';
export type { Controller } from '@datocms/content-link';
8 changes: 2 additions & 6 deletions src/useContentLink/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
'use client';

import { type Controller, createController } from '@datocms/content-link';
import { useCallback, useEffect, useRef } from 'react';

// Re-export types and utilities from @datocms/content-link for convenience
export { decodeStega, revealStega, stripStega } from '@datocms/content-link';
export type { Controller } from '@datocms/content-link';
import { type RefObject, useCallback, useEffect, useRef } from 'react';

export type UseContentLinkOptions = {
/**
Expand All @@ -26,7 +22,7 @@ export type UseContentLinkOptions = {
/** Callback when Web Previews plugin requests navigation */
onNavigateTo?: (path: string) => void;
/** Ref to limit scanning to this root instead of document */
root?: React.RefObject<HTMLElement>;
root?: RefObject<HTMLElement>;
/**
* Hue (0–359) of the overlay accent color.
* @default 17 (orange)
Expand Down
Loading