@dotcms/react 0.0.1-beta.9 → 1.0.0

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.
Files changed (57) hide show
  1. package/README.md +531 -93
  2. package/index.esm.js +2992 -786
  3. package/package.json +9 -11
  4. package/src/index.d.ts +7 -1
  5. package/src/lib/next/__test__/mock.d.ts +2 -1
  6. package/src/lib/next/components/Column/Column.d.ts +1 -1
  7. package/src/lib/next/components/Container/Container.d.ts +1 -1
  8. package/src/lib/next/components/Container/{ContainerFallbakcs.d.ts → ContainerFallbacks.d.ts} +2 -2
  9. package/src/lib/next/components/Contentlet/Contentlet.d.ts +2 -2
  10. package/src/lib/next/components/DotCMSBlockEditorRenderer/DotCMSBlockEditorRenderer.d.ts +27 -0
  11. package/src/lib/{deprecated/components/BlockEditorRenderer/item → next/components/DotCMSBlockEditorRenderer/components}/BlockEditorBlock.d.ts +8 -5
  12. package/src/lib/next/components/DotCMSBlockEditorRenderer/components/blocks/Code.d.ts +24 -0
  13. package/src/lib/next/components/DotCMSBlockEditorRenderer/components/blocks/DotContent.d.ts +14 -0
  14. package/src/lib/next/components/DotCMSBlockEditorRenderer/components/blocks/Image.d.ts +10 -0
  15. package/src/lib/{deprecated/components/BlockEditorRenderer → next/components/DotCMSBlockEditorRenderer/components}/blocks/Lists.d.ts +8 -4
  16. package/src/lib/next/components/DotCMSBlockEditorRenderer/components/blocks/NoComponentProvided.d.ts +3 -0
  17. package/src/lib/{deprecated/components/BlockEditorRenderer → next/components/DotCMSBlockEditorRenderer/components}/blocks/Table.d.ts +3 -3
  18. package/src/lib/{deprecated/components/BlockEditorRenderer → next/components/DotCMSBlockEditorRenderer/components}/blocks/Texts.d.ts +23 -13
  19. package/src/lib/next/components/DotCMSBlockEditorRenderer/components/blocks/Video.d.ts +10 -0
  20. package/src/lib/{deprecated/components/DotEditableText/DotEditableText.d.ts → next/components/DotCMSEditableText/DotCMSEditableText.d.ts} +8 -6
  21. package/src/lib/{deprecated/components/DotEditableText → next/components/DotCMSEditableText}/utils.d.ts +9 -9
  22. package/src/lib/next/components/DotCMSLayoutBody/DotCMSLayoutBody.d.ts +5 -5
  23. package/src/lib/next/components/DotCMSLayoutBody/components/ErrorMessage.d.ts +1 -4
  24. package/src/lib/next/components/DotCMSShow/DotCMSShow.d.ts +2 -2
  25. package/src/lib/next/components/FallbackComponent/FallbackComponent.d.ts +6 -6
  26. package/src/lib/next/components/Row/Row.d.ts +1 -1
  27. package/src/lib/next/contexts/DotCMSPageContext.d.ts +2 -3
  28. package/src/lib/next/hooks/{useShowInUVE.d.ts → useDotCMSShowWhen.d.ts} +5 -5
  29. package/src/lib/next/hooks/useEditableDotCMSPage.d.ts +90 -0
  30. package/src/lib/next/hooks/useIsDevMode.d.ts +2 -5
  31. package/es.regexp.to-string.esm.js +0 -1878
  32. package/next.esm.d.ts +0 -1
  33. package/next.esm.js +0 -738
  34. package/src/lib/deprecated/components/BlockEditorRenderer/BlockEditorRenderer.d.ts +0 -37
  35. package/src/lib/deprecated/components/BlockEditorRenderer/blocks/Code.d.ts +0 -17
  36. package/src/lib/deprecated/components/BlockEditorRenderer/blocks/Contentlet.d.ts +0 -41
  37. package/src/lib/deprecated/components/BlockEditorRenderer/blocks/Image.d.ts +0 -8
  38. package/src/lib/deprecated/components/BlockEditorRenderer/blocks/Video.d.ts +0 -8
  39. package/src/lib/deprecated/components/Column/Column.d.ts +0 -19
  40. package/src/lib/deprecated/components/Container/Container.d.ts +0 -19
  41. package/src/lib/deprecated/components/DotcmsLayout/DotcmsLayout.d.ts +0 -34
  42. package/src/lib/deprecated/components/PageProvider/PageProvider.d.ts +0 -14
  43. package/src/lib/deprecated/components/Row/Row.d.ts +0 -26
  44. package/src/lib/deprecated/contexts/PageContext.d.ts +0 -8
  45. package/src/lib/deprecated/deprecated_api.d.ts +0 -7
  46. package/src/lib/deprecated/hooks/useCheckHaveContent.d.ts +0 -5
  47. package/src/lib/deprecated/hooks/useDotcmsEditor.d.ts +0 -13
  48. package/src/lib/deprecated/hooks/useDotcmsPageContext.d.ts +0 -9
  49. package/src/lib/deprecated/mocks/index.d.ts +0 -1
  50. package/src/lib/deprecated/mocks/mockPageContext.d.ts +0 -7
  51. package/src/lib/deprecated/models/blocks.interface.d.ts +0 -89
  52. package/src/lib/deprecated/models/content-node.interface.d.ts +0 -82
  53. package/src/lib/deprecated/models/index.d.ts +0 -127
  54. package/src/lib/deprecated/utils/utils.d.ts +0 -58
  55. package/src/lib/next/types.d.ts +0 -421
  56. package/src/lib/next/utils/index.d.ts +0 -136
  57. package/src/next.d.ts +0 -3
package/package.json CHANGED
@@ -1,12 +1,17 @@
1
1
  {
2
2
  "name": "@dotcms/react",
3
- "version": "0.0.1-beta.9",
3
+ "version": "1.0.0",
4
4
  "peerDependencies": {
5
5
  "react": ">=18",
6
6
  "react-dom": ">=18",
7
- "@dotcms/client": "0.0.1-beta.9",
8
- "@dotcms/uve": "0.0.1-beta.9",
9
- "@tinymce/tinymce-react": "^5.1.1"
7
+ "@dotcms/uve": "^1.0.0",
8
+ "@dotcms/client": "^1.0.0"
9
+ },
10
+ "dependencies": {
11
+ "@tinymce/tinymce-react": "6.2.1"
12
+ },
13
+ "devDependencies": {
14
+ "@dotcms/types": "latest"
10
15
  },
11
16
  "description": "Official React Components library to render a dotCMS page.",
12
17
  "repository": {
@@ -27,19 +32,12 @@
27
32
  ".": {
28
33
  "import": "./index.esm.js",
29
34
  "types": "./index.esm.d.ts"
30
- },
31
- "./next": {
32
- "import": "./next.esm.js",
33
- "types": "./next.esm.d.ts"
34
35
  }
35
36
  },
36
37
  "typesVersions": {
37
38
  "*": {
38
39
  ".": [
39
40
  "./src/index.d.ts"
40
- ],
41
- "next": [
42
- "./src/next.d.ts"
43
41
  ]
44
42
  }
45
43
  },
package/src/index.d.ts CHANGED
@@ -1 +1,7 @@
1
- export * from './lib/deprecated/deprecated_api';
1
+ export { DotCMSLayoutBody } from './lib/next/components/DotCMSLayoutBody/DotCMSLayoutBody';
2
+ export { DotCMSShow } from './lib/next/components/DotCMSShow/DotCMSShow';
3
+ export { useDotCMSShowWhen } from './lib/next/hooks/useDotCMSShowWhen';
4
+ export { useEditableDotCMSPage } from './lib/next/hooks/useEditableDotCMSPage';
5
+ export { DotCMSEditableText } from './lib/next/components/DotCMSEditableText/DotCMSEditableText';
6
+ export { DotCMSBlockEditorRenderer, BlockEditorRendererProps } from './lib/next/components/DotCMSBlockEditorRenderer/DotCMSBlockEditorRenderer';
7
+ export { DotCMSLayoutBodyProps } from './lib/next/components/DotCMSLayoutBody/DotCMSLayoutBody';
@@ -1,4 +1,4 @@
1
- import { DotCMSColumnContainer, DotCMSPageAsset, DotPageAssetLayoutColumn } from '../types';
1
+ import { DotCMSColumnContainer, DotCMSPageAsset, DotPageAssetLayoutColumn, DotCMSBasicContentlet } from '@dotcms/types';
2
2
  export declare const MOCK_COLUMN: DotPageAssetLayoutColumn;
3
3
  export declare const MOCK_CONTAINER: DotCMSColumnContainer;
4
4
  export declare const MOCK_PAGE_ASSET: DotCMSPageAsset;
@@ -9,3 +9,4 @@ export declare const MOCK_CONTAINER_DATA: {
9
9
  acceptTypes: string;
10
10
  maxContentlets: number;
11
11
  };
12
+ export declare const MOCK_CONTENTLET: DotCMSBasicContentlet;
@@ -1,4 +1,4 @@
1
- import { DotPageAssetLayoutColumn } from '../../types';
1
+ import { DotPageAssetLayoutColumn } from '@dotcms/types';
2
2
  /**
3
3
  * @internal
4
4
  *
@@ -1,4 +1,4 @@
1
- import { DotCMSColumnContainer } from '../../types';
1
+ import { DotCMSColumnContainer } from '@dotcms/types';
2
2
  /**
3
3
  * @internal
4
4
  *
@@ -1,4 +1,4 @@
1
- import { DotContainerAttributes } from '../../utils';
1
+ import { DotContainerAttributes } from '@dotcms/types/internal';
2
2
  /**
3
3
  * @internal
4
4
  *
@@ -10,7 +10,7 @@ import { DotContainerAttributes } from '../../utils';
10
10
  * @param {string} props.identifier - Container identifier
11
11
  * @returns {JSX.Element | null} Message about missing container or null in production
12
12
  */
13
- export declare const ContainerNoFound: ({ identifier }: {
13
+ export declare const ContainerNotFound: ({ identifier }: {
14
14
  identifier: string;
15
15
  }) => import("react/jsx-runtime").JSX.Element | null;
16
16
  /**
@@ -1,4 +1,4 @@
1
- import { DotCMSContentlet } from '../../types';
1
+ import { DotCMSBasicContentlet } from '@dotcms/types';
2
2
  /**
3
3
  * @internal
4
4
  *
@@ -8,7 +8,7 @@ import { DotCMSContentlet } from '../../types';
8
8
  * @property {string} container - The container identifier where the contentlet is placed
9
9
  */
10
10
  interface DotCMSContentletRendererProps {
11
- contentlet: DotCMSContentlet;
11
+ contentlet: DotCMSBasicContentlet;
12
12
  container: string;
13
13
  }
14
14
  /**
@@ -0,0 +1,27 @@
1
+ /// <reference types="react" />
2
+ import { BlockEditorContent } from '@dotcms/types';
3
+ /**
4
+ * Represents a Custom Renderer used by the Block Editor Component
5
+ *
6
+ * @export
7
+ * @interface CustomRenderer
8
+ */
9
+ export type CustomRenderer<T = any> = Record<string, React.FC<T>>;
10
+ export interface BlockEditorRendererProps {
11
+ blocks: BlockEditorContent;
12
+ style?: React.CSSProperties;
13
+ className?: string;
14
+ customRenderers?: CustomRenderer;
15
+ }
16
+ /**
17
+ * BlockEditorRenderer component for rendering block editor field.
18
+ *
19
+ * @component
20
+ * @param {Object} props - The component props.
21
+ * @param {BlockEditorContent} props.blocks - The blocks of content to render.
22
+ * @param {CustomRenderer} [props.customRenderers] - Optional custom renderers for specific block types.
23
+ * @param {string} [props.className] - Optional CSS class name for the container div.
24
+ * @param {React.CSSProperties} [props.style] - Optional inline styles for the container div.
25
+ * @returns {JSX.Element} A div containing the rendered blocks of content.
26
+ */
27
+ export declare const DotCMSBlockEditorRenderer: ({ blocks, style, className, customRenderers }: BlockEditorRendererProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,4 +1,9 @@
1
- import { ContentNode, CustomRenderer } from '../../../models/content-node.interface';
1
+ import { BlockEditorNode } from '@dotcms/types';
2
+ import { CustomRenderer } from '../DotCMSBlockEditorRenderer';
3
+ interface BlockEditorBlockProps {
4
+ content: BlockEditorNode[] | undefined;
5
+ customRenderers?: CustomRenderer;
6
+ }
2
7
  /**
3
8
  * Renders a block editor item based on the provided content and custom renderers.
4
9
  *
@@ -6,7 +11,5 @@ import { ContentNode, CustomRenderer } from '../../../models/content-node.interf
6
11
  * @param customRenderers - Optional custom renderers for specific node types.
7
12
  * @returns The rendered block editor item.
8
13
  */
9
- export declare const BlockEditorBlock: ({ content, customRenderers }: {
10
- content: ContentNode[];
11
- customRenderers?: CustomRenderer;
12
- }) => import("react/jsx-runtime").JSX.Element[];
14
+ export declare const BlockEditorBlock: ({ content, customRenderers }: BlockEditorBlockProps) => import("react/jsx-runtime").JSX.Element[] | null;
15
+ export {};
@@ -0,0 +1,24 @@
1
+ /// <reference types="react" />
2
+ import { BlockEditorNode } from '@dotcms/types';
3
+ interface CodeBlockProps {
4
+ node: BlockEditorNode;
5
+ children: React.ReactNode;
6
+ }
7
+ /**
8
+ * Renders a code block component.
9
+ *
10
+ * @param attrs - The attributes of the code block.
11
+ * @param children - The content of the code block.
12
+ * @returns The rendered code block component.
13
+ */
14
+ export declare const CodeBlock: ({ node, children }: CodeBlockProps) => import("react/jsx-runtime").JSX.Element;
15
+ /**
16
+ * Renders a blockquote component.
17
+ *
18
+ * @param children - The content to be rendered inside the blockquote.
19
+ * @returns The rendered blockquote component.
20
+ */
21
+ export declare const BlockQuote: ({ children }: {
22
+ children: React.ReactNode;
23
+ }) => import("react/jsx-runtime").JSX.Element;
24
+ export {};
@@ -0,0 +1,14 @@
1
+ import { BlockEditorNode } from '@dotcms/types';
2
+ import { CustomRenderer } from '../../DotCMSBlockEditorRenderer';
3
+ interface DotContentProps {
4
+ customRenderers: CustomRenderer;
5
+ node: BlockEditorNode;
6
+ }
7
+ /**
8
+ * Renders a DotContent component.
9
+ *
10
+ * @param {DotContentProps} props - The props for the DotContent component.
11
+ * @returns {JSX.Element} The rendered DotContent component.
12
+ */
13
+ export declare const DotContent: ({ customRenderers, node }: DotContentProps) => import("react/jsx-runtime").JSX.Element | null;
14
+ export {};
@@ -0,0 +1,10 @@
1
+ import { BlockEditorNode } from '@dotcms/types';
2
+ /**
3
+ * Renders an image component for dotCMS.
4
+ *
5
+ * @param node - The node for the DotCMSImage component.
6
+ * @returns The rendered image component.
7
+ */
8
+ export declare const DotCMSImage: ({ node }: {
9
+ node: BlockEditorNode;
10
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -1,22 +1,26 @@
1
- import { BlockProps } from '../../../models/blocks.interface';
1
+ /// <reference types="react" />
2
+ interface ListItemProps {
3
+ children: React.ReactNode;
4
+ }
2
5
  /**
3
6
  * ListItem component represents a list item in a block editor.
4
7
  *
5
8
  * @param children - The content of the list item.
6
9
  * @returns The rendered list item element.
7
10
  */
8
- export declare const ListItem: ({ children }: BlockProps) => import("react/jsx-runtime").JSX.Element;
11
+ export declare const ListItem: ({ children }: ListItemProps) => import("react/jsx-runtime").JSX.Element;
9
12
  /**
10
13
  * Renders an ordered list component.
11
14
  *
12
15
  * @param children - The content to be rendered inside the ordered list.
13
16
  * @returns The ordered list component.
14
17
  */
15
- export declare const OrderedList: ({ children }: BlockProps) => import("react/jsx-runtime").JSX.Element;
18
+ export declare const OrderedList: ({ children }: ListItemProps) => import("react/jsx-runtime").JSX.Element;
16
19
  /**
17
20
  * Renders a bullet list component.
18
21
  *
19
22
  * @param children - The content of the bullet list.
20
23
  * @returns The rendered bullet list component.
21
24
  */
22
- export declare const BulletList: ({ children }: BlockProps) => import("react/jsx-runtime").JSX.Element;
25
+ export declare const BulletList: ({ children }: ListItemProps) => import("react/jsx-runtime").JSX.Element;
26
+ export {};
@@ -0,0 +1,3 @@
1
+ export declare const NoComponentProvided: ({ contentType }: {
2
+ contentType: string;
3
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,9 @@
1
1
  import React from 'react';
2
- import { ContentNode } from '../../../models/content-node.interface';
2
+ import { BlockEditorNode } from '@dotcms/types';
3
3
  interface TableRendererProps {
4
- content: ContentNode[];
4
+ content: BlockEditorNode[];
5
5
  blockEditorItem: React.FC<{
6
- content: ContentNode[];
6
+ content: BlockEditorNode[];
7
7
  }>;
8
8
  }
9
9
  /**
@@ -1,29 +1,40 @@
1
- import { BlockProps } from '../../../models/blocks.interface';
2
- import { ContentNode, HeadingProps, LinkProps, ParagraphProps } from '../../../models/content-node.interface';
1
+ /// <reference types="react" />
2
+ import { BlockEditorMark, BlockEditorNode } from '@dotcms/types';
3
+ interface MarkProps extends BlockEditorMark {
4
+ children: React.ReactNode;
5
+ }
6
+ interface TextComponentProp {
7
+ children: React.ReactNode;
8
+ node: BlockEditorNode;
9
+ }
10
+ interface TextNodeProps {
11
+ marks?: BlockEditorMark[];
12
+ text?: string;
13
+ }
3
14
  /**
4
15
  * Renders the text in bold.
5
16
  *
6
17
  * @param children - The content to be rendered in bold.
7
18
  */
8
- export declare const Bold: ({ children }: BlockProps) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const Bold: ({ children }: MarkProps) => import("react/jsx-runtime").JSX.Element;
9
20
  /**
10
21
  * Renders the text in italic format.
11
22
  *
12
23
  * @param children - The content to be rendered in italic.
13
24
  */
14
- export declare const Italic: ({ children }: BlockProps) => import("react/jsx-runtime").JSX.Element;
25
+ export declare const Italic: ({ children }: MarkProps) => import("react/jsx-runtime").JSX.Element;
15
26
  /**
16
27
  * Renders a strike-through text.
17
28
  *
18
29
  * @param children - The content to be rendered within the strike-through element.
19
30
  */
20
- export declare const Strike: ({ children }: BlockProps) => import("react/jsx-runtime").JSX.Element;
31
+ export declare const Strike: ({ children }: MarkProps) => import("react/jsx-runtime").JSX.Element;
21
32
  /**
22
33
  * Renders an underline element for the given children.
23
34
  *
24
35
  * @param children - The content to be underlined.
25
36
  */
26
- export declare const Underline: ({ children }: BlockProps) => import("react/jsx-runtime").JSX.Element;
37
+ export declare const Underline: ({ children }: MarkProps) => import("react/jsx-runtime").JSX.Element;
27
38
  /**
28
39
  * Renders a paragraph element.
29
40
  *
@@ -31,7 +42,7 @@ export declare const Underline: ({ children }: BlockProps) => import("react/jsx-
31
42
  * @param attrs - The style attributes for the paragraph.
32
43
  * @returns The rendered paragraph element.
33
44
  */
34
- export declare const Paragraph: ({ children, attrs }: ParagraphProps) => import("react/jsx-runtime").JSX.Element;
45
+ export declare const Paragraph: ({ children, node }: TextComponentProp) => import("react/jsx-runtime").JSX.Element;
35
46
  /**
36
47
  * Renders a link component.
37
48
  *
@@ -39,7 +50,7 @@ export declare const Paragraph: ({ children, attrs }: ParagraphProps) => import(
39
50
  * @param attrs - The attributes to be applied to the link.
40
51
  * @returns The rendered link component.
41
52
  */
42
- export declare const Link: ({ children, attrs }: LinkProps) => import("react/jsx-runtime").JSX.Element;
53
+ export declare const Link: ({ children, attrs }: MarkProps) => import("react/jsx-runtime").JSX.Element;
43
54
  /**
44
55
  * Renders a heading element with the specified level.
45
56
  *
@@ -47,25 +58,24 @@ export declare const Link: ({ children, attrs }: LinkProps) => import("react/jsx
47
58
  * @param attrs - The attributes for the heading.
48
59
  * @returns The rendered heading element.
49
60
  */
50
- export declare const Heading: ({ children, attrs }: HeadingProps) => import("react/jsx-runtime").JSX.Element;
61
+ export declare const Heading: ({ children, node }: TextComponentProp) => import("react/jsx-runtime").JSX.Element;
51
62
  /**
52
63
  * Renders the superscript text.
53
64
  *
54
65
  * @param children - The content to be rendered as superscript.
55
66
  */
56
- export declare const Superscript: ({ children }: BlockProps) => import("react/jsx-runtime").JSX.Element;
67
+ export declare const Superscript: ({ children }: MarkProps) => import("react/jsx-runtime").JSX.Element;
57
68
  /**
58
69
  * Renders a subscript element.
59
70
  *
60
71
  * @param children - The content to be rendered as subscript.
61
72
  */
62
- export declare const Subscript: ({ children }: BlockProps) => import("react/jsx-runtime").JSX.Element;
63
- type TextBlockProps = Omit<ContentNode, 'content' | 'attrs'>;
73
+ export declare const Subscript: ({ children }: MarkProps) => import("react/jsx-runtime").JSX.Element;
64
74
  /**
65
75
  * Renders a text block with optional marks.
66
76
  *
67
77
  * @param props - The props for the TextBlock component.
68
78
  * @returns The rendered text block.
69
79
  */
70
- export declare const TextBlock: (props: TextBlockProps) => string | import("react/jsx-runtime").JSX.Element | undefined;
80
+ export declare const TextBlock: (props?: TextNodeProps) => string | import("react/jsx-runtime").JSX.Element | undefined;
71
81
  export {};
@@ -0,0 +1,10 @@
1
+ import { BlockEditorNode } from '@dotcms/types';
2
+ /**
3
+ * Renders a video component for displaying videos.
4
+ *
5
+ * @param props - The properties for the video component.
6
+ * @returns The rendered video component.
7
+ */
8
+ export declare const DotCMSVideo: ({ node }: {
9
+ node: BlockEditorNode;
10
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -1,10 +1,12 @@
1
- import { DotEditableTextProps } from './utils';
1
+ /// <reference types="react" />
2
+ import { DotCMSBasicContentlet } from '@dotcms/types';
3
+ import { DotCMSEditableTextProps } from './utils';
2
4
  /**
3
5
  * Allows inline edit content pulled from dotCMS API using TinyMCE editor
4
6
  *
5
7
  * @export
6
8
  * @component
7
- * @param {Readonly<DotEditableTextProps>} props {
9
+ * @param {Readonly<DotCMSEditableTextProps>} props {
8
10
  * mode = 'plain',
9
11
  * format = 'text',
10
12
  * contentlet,
@@ -12,11 +14,11 @@ import { DotEditableTextProps } from './utils';
12
14
  * }
13
15
  * @example
14
16
  * ```javascript
15
- * import { DotEditableText } from '@dotcms/react';
17
+ * import { DotCMSEditableText } from '@dotcms/react';
16
18
  *
17
19
  * const MyContentletWithTitle = ({ contentlet }) => (
18
20
  * <h2>
19
- * <DotEditableText
21
+ * <DotCMSEditableText
20
22
  * contentlet={contentlet}
21
23
  * fieldName="title"
22
24
  * mode='full'
@@ -26,5 +28,5 @@ import { DotEditableTextProps } from './utils';
26
28
  * ```
27
29
  * @returns {JSX.Element} A component to edit content inline
28
30
  */
29
- export declare function DotEditableText({ mode, format, contentlet, fieldName }: Readonly<DotEditableTextProps>): JSX.Element;
30
- export default DotEditableText;
31
+ export declare function DotCMSEditableText<T extends DotCMSBasicContentlet>({ mode, format, contentlet, fieldName }: Readonly<DotCMSEditableTextProps<T>>): JSX.Element;
32
+ export default DotCMSEditableText;
@@ -1,35 +1,35 @@
1
1
  import { IAllProps } from '@tinymce/tinymce-react';
2
- import { DotCMSContentlet } from '../../models';
2
+ import { DotCMSBasicContentlet } from '@dotcms/types';
3
3
  export type DOT_EDITABLE_TEXT_FORMAT = 'html' | 'text';
4
4
  export type DOT_EDITABLE_TEXT_MODE = 'minimal' | 'full' | 'plain';
5
- export interface DotEditableTextProps {
5
+ export interface DotCMSEditableTextProps<T extends DotCMSBasicContentlet> {
6
6
  /**
7
7
  * Represents the field name of the `contentlet` that can be edited
8
8
  *
9
- * @memberof DotEditableTextProps
9
+ * @memberof DotCMSEditableTextProps
10
10
  */
11
- fieldName: string;
11
+ fieldName: keyof T;
12
12
  /**
13
13
  * Represents the format of the editor which can be `text` or `html`
14
14
  *
15
15
  * @type {DOT_EDITABLE_TEXT_FORMAT}
16
- * @memberof DotEditableTextProps
16
+ * @memberof DotCMSEditableTextProps
17
17
  */
18
18
  format?: DOT_EDITABLE_TEXT_FORMAT;
19
19
  /**
20
20
  * Represents the mode of the editor which can be `plain`, `minimal`, or `full`
21
21
  *
22
22
  * @type {DOT_EDITABLE_TEXT_MODE}
23
- * @memberof DotEditableTextProps
23
+ * @memberof DotCMSEditableTextProps
24
24
  */
25
25
  mode?: DOT_EDITABLE_TEXT_MODE;
26
26
  /**
27
27
  * Represents the `contentlet` that can be inline edited
28
28
  *
29
- * @type {DotCMSContentlet}
30
- * @memberof DotEditableTextProps
29
+ * @type {DotCMSBasicContentlet}
30
+ * @memberof DotCMSEditableTextProps
31
31
  */
32
- contentlet: DotCMSContentlet;
32
+ contentlet: T;
33
33
  }
34
34
  export declare const TINYMCE_CONFIG: {
35
35
  [key in DOT_EDITABLE_TEXT_MODE]: IAllProps['init'];
@@ -1,9 +1,10 @@
1
1
  /// <reference types="react" />
2
- import { DotCMSPageRendererMode } from '../../contexts/DotCMSPageContext';
3
- import { DotCMSContentlet, DotCMSPageAsset } from '../../types';
4
- interface DotCMSLayoutBodyProps {
2
+ import { DotCMSBasicContentlet, DotCMSPageAsset, DotCMSPageRendererMode } from '@dotcms/types';
3
+ export interface DotCMSLayoutBodyProps<TContentlet extends DotCMSBasicContentlet = DotCMSBasicContentlet> {
5
4
  page: DotCMSPageAsset;
6
- components: Record<string, React.ComponentType<DotCMSContentlet>>;
5
+ components: {
6
+ [key: string]: React.ComponentType<TContentlet> | React.ComponentType<any>;
7
+ };
7
8
  mode?: DotCMSPageRendererMode;
8
9
  }
9
10
  /**
@@ -23,4 +24,3 @@ interface DotCMSLayoutBodyProps {
23
24
  *
24
25
  */
25
26
  export declare const DotCMSLayoutBody: ({ page, components, mode }: DotCMSLayoutBodyProps) => import("react/jsx-runtime").JSX.Element;
26
- export {};
@@ -1,9 +1,6 @@
1
- import { DotCMSPageRendererMode } from '../../../contexts/DotCMSPageContext';
2
1
  /**
3
2
  * Error message component for when the page body is missing
4
3
  *
5
4
  * @return {JSX.Element} Error message component
6
5
  */
7
- export declare const ErrorMessage: ({ mode }: {
8
- mode: DotCMSPageRendererMode;
9
- }) => import("react/jsx-runtime").JSX.Element | null;
6
+ export declare const ErrorMessage: () => false | import("react/jsx-runtime").JSX.Element;
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { UVE_MODE } from '@dotcms/uve/types';
2
+ import { UVE_MODE } from '@dotcms/types';
3
3
  /**
4
4
  * Props for the DotCMSShow component.
5
5
  *
@@ -45,5 +45,5 @@ type DotCMSShowProps = {
45
45
  *
46
46
  * // LiveContentComponent will only be rendered if the UVE is in live mode.
47
47
  */
48
- export declare const DotCMSShow: ({ children, when }: DotCMSShowProps) => import("react").ReactNode;
48
+ export declare const DotCMSShow: ({ children, when }: DotCMSShowProps) => React.ReactNode | null;
49
49
  export {};
@@ -1,22 +1,22 @@
1
1
  /// <reference types="react" />
2
- import { DotCMSContentlet } from '../../types';
2
+ import { DotCMSBasicContentlet } from '@dotcms/types';
3
3
  /**
4
4
  * @internal
5
5
  *
6
6
  * Type definition for components that can be used as fallback when no matching component is found
7
7
  */
8
- export type NoComponentType = React.ComponentType<DotCMSContentlet>;
8
+ export type NoComponentType = React.ComponentType<DotCMSBasicContentlet>;
9
9
  /**
10
10
  * @internal
11
11
  *
12
12
  * Props for the FallbackComponent
13
13
  * @interface DotCMSFallbackComponentProps
14
- * @property {React.ComponentType<DotCMSContentlet>} [UserNoComponent] - Optional custom component to render when no matching component is found
15
- * @property {DotCMSContentlet} [contentlet] - The contentlet that couldn't be rendered
14
+ * @property {React.ComponentType<DotCMSBasicContentlet>} [UserNoComponent] - Optional custom component to render when no matching component is found
15
+ * @property {DotCMSBasicContentlet} [contentlet] - The contentlet that couldn't be rendered
16
16
  */
17
17
  interface DotCMSFallbackComponentProps {
18
- contentlet: DotCMSContentlet;
19
- UserNoComponent?: React.ComponentType<DotCMSContentlet>;
18
+ contentlet: DotCMSBasicContentlet;
19
+ UserNoComponent?: React.ComponentType<DotCMSBasicContentlet>;
20
20
  }
21
21
  /**
22
22
  * @internal
@@ -1,4 +1,4 @@
1
- import { DotPageAssetLayoutRow } from '../../types';
1
+ import { DotPageAssetLayoutRow } from '@dotcms/types';
2
2
  /**
3
3
  * @internal
4
4
  *
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { DotCMSContentlet, DotCMSPageAsset } from '../types';
3
- export type DotCMSPageRendererMode = 'production' | 'development';
2
+ import { DotCMSBasicContentlet, DotCMSPageAsset, DotCMSPageRendererMode } from '@dotcms/types';
4
3
  /**
5
4
  * @internal
6
5
  *
@@ -13,7 +12,7 @@ export type DotCMSPageRendererMode = 'production' | 'development';
13
12
  export interface DotCMSPageContextProps {
14
13
  pageAsset: DotCMSPageAsset;
15
14
  mode: DotCMSPageRendererMode;
16
- userComponents: Record<string, React.ComponentType<DotCMSContentlet>>;
15
+ userComponents: Record<string, React.ComponentType<DotCMSBasicContentlet>>;
17
16
  }
18
17
  /**
19
18
  * The `PageContext` is a React context that provides access to the DotCMS page context.
@@ -1,4 +1,4 @@
1
- import { UVE_MODE } from '@dotcms/uve/types';
1
+ import { UVE_MODE } from '@dotcms/types';
2
2
  /**
3
3
  * Custom hook to determine if the current UVE (Universal Visual Editor) mode
4
4
  * matches the specified mode. This hook is useful for conditionally rendering
@@ -9,23 +9,23 @@ import { UVE_MODE } from '@dotcms/uve/types';
9
9
  *
10
10
  * @example
11
11
  * // Basic usage: Check if the UVE is in edit mode
12
- * const showInEditMode = useShowInUVE(UVE_MODE.EDIT);
12
+ * const showInEditMode = useDotCMSShowWhen(UVE_MODE.EDIT);
13
13
  * if (showInEditMode) {
14
14
  * // Render edit-specific components
15
15
  * }
16
16
  *
17
17
  * @example
18
18
  * // Check if the UVE is in preview mode
19
- * const showInPreviewMode = useShowInUVE(UVE_MODE.PREVIEW);
19
+ * const showInPreviewMode = useDotCMSShowWhen(UVE_MODE.PREVIEW);
20
20
  * if (showInPreviewMode) {
21
21
  * // Render preview-specific components
22
22
  * }
23
23
  *
24
24
  * @example
25
25
  * // Check if the UVE is in live mode
26
- * const showInLiveMode = useShowInUVE(UVE_MODE.LIVE);
26
+ * const showInLiveMode = useDotCMSShowWhen(UVE_MODE.LIVE);
27
27
  * if (showInLiveMode) {
28
28
  * // Render live-specific components
29
29
  * }
30
30
  */
31
- export declare const useShowInUVE: (when: UVE_MODE) => boolean;
31
+ export declare const useDotCMSShowWhen: (when: UVE_MODE) => boolean;