@dotcms/react
Advanced tools
+1
-1
| { | ||
| "name": "@dotcms/react", | ||
| "version": "1.1.1-next.4", | ||
| "version": "1.1.1-next.5", | ||
| "peerDependencies": { | ||
@@ -5,0 +5,0 @@ "react": ">=18", |
+1
-1
@@ -6,3 +6,3 @@ export { DotCMSLayoutBody } from './lib/next/components/DotCMSLayoutBody/DotCMSLayoutBody'; | ||
| export { DotCMSEditableText } from './lib/next/components/DotCMSEditableText/DotCMSEditableText'; | ||
| export { DotCMSBlockEditorRenderer, BlockEditorRendererProps } from './lib/next/components/DotCMSBlockEditorRenderer/DotCMSBlockEditorRenderer'; | ||
| export { DotCMSBlockEditorRenderer, BlockEditorRendererProps, CustomRenderer, CustomRendererProps } from './lib/next/components/DotCMSBlockEditorRenderer/DotCMSBlockEditorRenderer'; | ||
| export { DotCMSLayoutBodyProps } from './lib/next/components/DotCMSLayoutBody/DotCMSLayoutBody'; |
| import { BlockEditorNode } from '@dotcms/types'; | ||
| import { CustomRenderer } from '../../DotCMSBlockEditorRenderer'; | ||
| interface DotContentProps { | ||
| customRenderers: CustomRenderer; | ||
| customRenderers?: CustomRenderer; | ||
| node: BlockEditorNode; | ||
@@ -6,0 +6,0 @@ } |
@@ -1,11 +0,38 @@ | ||
| import { BlockEditorContent } from '@dotcms/types'; | ||
| import { BlockEditorNode } from '@dotcms/types'; | ||
| /** | ||
| * Represents a Custom Renderer used by the Block Editor Component | ||
| * Props that all custom renderers must accept. | ||
| * | ||
| * @export | ||
| * @interface CustomRendererProps | ||
| * @template TData - The type of data stored in node.attrs.data (for contentlet blocks) | ||
| */ | ||
| export interface CustomRendererProps<TData = any> { | ||
| /** The full BlockEditorNode with attrs, marks, content, etc. */ | ||
| node: BlockEditorNode & { | ||
| attrs?: { | ||
| data?: TData; | ||
| [key: string]: any; | ||
| }; | ||
| }; | ||
| /** Rendered children from nested content (if any) */ | ||
| children?: React.ReactNode; | ||
| } | ||
| /** | ||
| * Custom renderer component type - must accept node and optional children. | ||
| * Can be specialized with a specific data type for node.attrs.data. | ||
| * | ||
| * @export | ||
| * @template TData - The type of contentlet data in node.attrs.data | ||
| */ | ||
| export type CustomRendererComponent<TData = any> = React.FC<CustomRendererProps<TData>>; | ||
| /** | ||
| * Map of block type names to custom renderer components. | ||
| * Use the generic parameter to type specific contentlet data. | ||
| * | ||
| * @export | ||
| * @interface CustomRenderer | ||
| */ | ||
| export type CustomRenderer<T = any> = Record<string, React.FC<T>>; | ||
| export type CustomRenderer = Record<string, CustomRendererComponent<any>>; | ||
| export interface BlockEditorRendererProps { | ||
| blocks: BlockEditorContent; | ||
| blocks: BlockEditorNode; | ||
| style?: React.CSSProperties; | ||
@@ -20,3 +47,3 @@ className?: string; | ||
| * @param {Object} props - The component props. | ||
| * @param {BlockEditorContent} props.blocks - The blocks of content to render. | ||
| * @param {BlockEditorNode} props.blocks - The blocks of content to render. | ||
| * @param {CustomRenderer} [props.customRenderers] - Optional custom renderers for specific block types. | ||
@@ -23,0 +50,0 @@ * @param {string} [props.className] - Optional CSS class name for the container div. |
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
244841
0.39%5919
0.49%