@dotcms/react 0.0.1-alpha.32 → 0.0.1-alpha.33

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.
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@dotcms/react",
3
- "version": "0.0.1-alpha.32",
3
+ "version": "0.0.1-alpha.33",
4
4
  "peerDependencies": {
5
5
  "react": ">=18",
6
6
  "react-dom": ">=18",
7
- "@dotcms/client": "0.0.1-alpha.32"
7
+ "@dotcms/client": "0.0.1-alpha.33",
8
+ "@tinymce/tinymce-react": "^5.1.1"
8
9
  },
9
10
  "description": "Official React Components library to render a dotCMS page.",
10
11
  "repository": {
package/src/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './lib/components/DotcmsLayout/DotcmsLayout';
2
+ export * from './lib/components/DotEditableText/DotEditableText';
2
3
  export * from './lib/components/PageProvider/PageProvider';
3
4
  export * from './lib/components/Row/Row';
4
5
  export * from './lib/hooks/useDotcmsPageContext';
@@ -0,0 +1,3 @@
1
+ import { DotEditableTextProps } from './utils';
2
+ export declare function DotEditableText({ mode, format, contentlet, fieldName }: Readonly<DotEditableTextProps>): import("react/jsx-runtime").JSX.Element;
3
+ export default DotEditableText;
@@ -0,0 +1,36 @@
1
+ import { IAllProps } from '@tinymce/tinymce-react';
2
+ import { DotCMSContentlet } from '../../models';
3
+ export type DOT_EDITABLE_TEXT_FORMAT = 'html' | 'text';
4
+ export type DOT_EDITABLE_TEXT_MODE = 'minimal' | 'full' | 'plain';
5
+ export interface DotEditableTextProps {
6
+ /**
7
+ * Represents the field name of the `contentlet` that can be edited
8
+ *
9
+ * @memberof DotEditableTextProps
10
+ */
11
+ fieldName: string;
12
+ /**
13
+ * Represents the format of the editor which can be `text` or `html`
14
+ *
15
+ * @type {DOT_EDITABLE_TEXT_FORMAT}
16
+ * @memberof DotEditableTextProps
17
+ */
18
+ format?: DOT_EDITABLE_TEXT_FORMAT;
19
+ /**
20
+ * Represents the mode of the editor which can be `plain`, `minimal`, or `full`
21
+ *
22
+ * @type {DOT_EDITABLE_TEXT_MODE}
23
+ * @memberof DotEditableTextProps
24
+ */
25
+ mode?: DOT_EDITABLE_TEXT_MODE;
26
+ /**
27
+ * Represents the `contentlet` that can be inline edited
28
+ *
29
+ * @type {DotCMSContentlet}
30
+ * @memberof DotEditableTextProps
31
+ */
32
+ contentlet: DotCMSContentlet;
33
+ }
34
+ export declare const TINYMCE_CONFIG: {
35
+ [key in DOT_EDITABLE_TEXT_MODE]: IAllProps['init'];
36
+ };
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { DotCMSPageContext } from '../models';
2
+ import { DotCMSPageContext, DotCMSContentlet } from '../models';
3
+ export declare const dotcmsContentletMock: DotCMSContentlet;
3
4
  export declare const mockPageContext: DotCMSPageContext;
4
5
  export declare const MockContextRender: ({ children, mockContext }: {
5
6
  children: JSX.Element;
@@ -86,3 +86,42 @@ export interface DotCMSPageContext {
86
86
  };
87
87
  isInsideEditor: boolean;
88
88
  }
89
+ export interface DotCMSContentlet {
90
+ archived: boolean;
91
+ binaryContentAsset?: string;
92
+ deleted?: boolean;
93
+ baseType: string;
94
+ binary?: string;
95
+ binaryVersion?: string;
96
+ file?: string;
97
+ contentType: string;
98
+ hasLiveVersion?: boolean;
99
+ folder: string;
100
+ hasTitleImage: boolean;
101
+ hostName: string;
102
+ host: string;
103
+ inode: string;
104
+ identifier: string;
105
+ languageId: number;
106
+ image?: string;
107
+ locked: boolean;
108
+ language?: string;
109
+ mimeType?: string;
110
+ modUser: string;
111
+ modDate: string;
112
+ live: boolean;
113
+ sortOrder: number;
114
+ owner: string;
115
+ title: string;
116
+ stInode: string;
117
+ titleImage: string;
118
+ modUserName: string;
119
+ text?: string;
120
+ working: boolean;
121
+ url: string;
122
+ contentTypeIcon?: string;
123
+ body?: string;
124
+ variant?: string;
125
+ __icon__?: string;
126
+ [key: string]: any;
127
+ }