Skip to content

Commit

Permalink
feat: [RichText] export DOMPurify
Browse files Browse the repository at this point in the history
  • Loading branch information
akai committed Apr 29, 2021
1 parent cc37be4 commit 730b626
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/components/RichText/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import clsx from 'clsx';
import DOMPurify from 'dompurify';
import './configDOMPurify';

export type RichTextProps = {
className?: string;
export interface RichTextProps {
content: string;
className?: string;
options?: DOMPurify.Config;
};
}

export const RichText = React.forwardRef<HTMLDivElement, RichTextProps>((props, ref) => {
const { className, content, options = {}, ...other } = props;
Expand Down
7 changes: 4 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import 'intersection-observer';

export { default as clsx } from 'clsx';
export { default as DOMPurify } from 'dompurify';

export { importScript } from './utils/importScript';
export { lazyComponent } from './utils/lazyComponent';
export { mountComponent } from './utils/mountComponent';

export { default as useMessages } from './hooks/useMessages';
export { default as useQuickReplies } from './hooks/useQuickReplies';

export { ComponentsProvider, useComponents } from './components/ComponentsProvider';
export type { ComponentsProviderProps, ComponentsMap } from './components/ComponentsProvider';

Expand Down Expand Up @@ -111,9 +115,6 @@ export { Video } from './components/Video';
export type { VideoProps } from './components/Video';
export { VisuallyHidden } from './components/VisuallyHidden';

export { default as useMessages } from './hooks/useMessages';
export { default as useQuickReplies } from './hooks/useQuickReplies';

export { FileCard } from './components/FileCard';
export type { FileCardProps } from './components/FileCard';
export { Goods } from './components/Goods';
Expand Down

0 comments on commit 730b626

Please sign in to comment.