@dotcms/react
Advanced tools
| /** | ||
| * @internal | ||
| * React hook that checks whether DotCMS Analytics is active. | ||
| * | ||
| * Uses useSyncExternalStore to subscribe to analytics state changes via custom events: | ||
| * - `dotcms:analytics:ready`: Fired when Analytics initializes | ||
| * - `dotcms:analytics:cleanup`: Fired on page unload | ||
| * | ||
| * Components automatically re-render when analytics state changes. Works regardless | ||
| * of initialization order and returns false during SSR. | ||
| * | ||
| * @returns {boolean} True if analytics is active, false otherwise | ||
| * | ||
| * @example | ||
| * ```tsx | ||
| * function Contentlet({ item }) { | ||
| * const isAnalyticsActive = useIsAnalyticsActive() | ||
| * | ||
| * const attrs = isAnalyticsActive | ||
| * ? { 'data-dot-analytics-id': item.id } | ||
| * : {} | ||
| * | ||
| * return <div {...attrs}>{item.title}</div> | ||
| * } | ||
| * ``` | ||
| */ | ||
| export declare const useIsAnalyticsActive: () => boolean; |
+1
-1
| { | ||
| "name": "@dotcms/react", | ||
| "version": "1.1.1", | ||
| "version": "1.2.0", | ||
| "peerDependencies": { | ||
@@ -5,0 +5,0 @@ "react": ">=18", |
+7
-7
@@ -29,5 +29,5 @@ # dotCMS React SDK | ||
| - [Migration from Alpha to 1.0.X](./MIGRATION.md) | ||
| - [dotCMS Support](#dotcms-support) | ||
| - [How To Contribute](#how-to-contribute) | ||
| - [Licensing Information](#licensing-information) | ||
| - [Support](#support) | ||
| - [Contributing](#contributing) | ||
| - [Licensing](#licensing) | ||
@@ -583,3 +583,3 @@ ## Prerequisites & Setup | ||
| ## dotCMS Support | ||
| ## Support | ||
@@ -600,5 +600,5 @@ We offer multiple channels to get help with the dotCMS React SDK: | ||
| ## How To Contribute | ||
| ## Contributing | ||
| GitHub pull requests are the preferred method to contribute code to dotCMS. We welcome contributions to the DotCMS UVE SDK! If you'd like to contribute, please follow these steps: | ||
| GitHub pull requests are the preferred method to contribute code to dotCMS. We welcome contributions to the dotCMS React SDK! If you'd like to contribute, please follow these steps: | ||
@@ -613,3 +613,3 @@ 1. Fork the repository [dotCMS/core](https://github.com/dotCMS/core) | ||
| ## Licensing Information | ||
| ## Licensing | ||
@@ -616,0 +616,0 @@ dotCMS comes in multiple editions and as such is dual-licensed. The dotCMS Community Edition is licensed under the GPL 3.0 and is freely available for download, customization, and deployment for use within organizations of all stripes. dotCMS Enterprise Editions (EE) adds several enterprise features and is available via a supported, indemnified commercial license from dotCMS. For the differences between the editions, see [the feature page](http://www.dotcms.com/cms-platform/features). |
+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
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
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
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
264842
8.6%33
3.13%6488
10.15%37
12.12%