@dotcms/react 0.0.1-alpha.2 → 0.0.1-alpha.4
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/README.md +16 -21
- package/index.esm.js +912 -391
- package/package.json +2 -2
- package/src/lib/components/Column/Column.d.ts +1 -2
- package/src/lib/components/PageProvider/PageProvider.d.ts +1 -0
- package/src/lib/hooks/usePageEditor.d.ts +5 -3
- package/src/lib/mocks/mockPageContext.d.ts +5 -0
- package/src/lib/utils/utils.d.ts +5 -0
package/README.md
CHANGED
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
7
|
+
- A collection of React components and hooks tailored to render dotCMS pages.
|
|
8
|
+
- Streamlined integration with dotCMS page editor.
|
|
9
|
+
- Improved development experience with comprehensive TypeScript typings.
|
|
10
10
|
|
|
11
11
|
## Installation
|
|
12
12
|
|
|
@@ -30,7 +30,7 @@ A functional component that renders a layout for a dotCMS page.
|
|
|
30
30
|
|
|
31
31
|
#### Props
|
|
32
32
|
|
|
33
|
-
-
|
|
33
|
+
- **entity**: The context for a dotCMS page.
|
|
34
34
|
|
|
35
35
|
#### Usage
|
|
36
36
|
|
|
@@ -38,7 +38,7 @@ A functional component that renders a layout for a dotCMS page.
|
|
|
38
38
|
import { DotcmsLayout } from '@dotcms/react';
|
|
39
39
|
|
|
40
40
|
const MyPage = ({ entity }) => {
|
|
41
|
-
|
|
41
|
+
return <DotcmsLayout entity={entity} />;
|
|
42
42
|
};
|
|
43
43
|
```
|
|
44
44
|
|
|
@@ -50,7 +50,7 @@ A custom React hook that provides access to the `PageProviderContext`.
|
|
|
50
50
|
|
|
51
51
|
#### Returns
|
|
52
52
|
|
|
53
|
-
-
|
|
53
|
+
- `PageProviderContext | null`: The context value or `null` if it's not available.
|
|
54
54
|
|
|
55
55
|
#### Usage
|
|
56
56
|
|
|
@@ -58,8 +58,8 @@ A custom React hook that provides access to the `PageProviderContext`.
|
|
|
58
58
|
import { useDotcmsPageContext } from '@dotcms/react';
|
|
59
59
|
|
|
60
60
|
const MyComponent = () => {
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
const context = useDotcmsPageContext();
|
|
62
|
+
// Use the context
|
|
63
63
|
};
|
|
64
64
|
```
|
|
65
65
|
|
|
@@ -69,11 +69,11 @@ A custom React hook that sets up the page editor for a dotCMS page.
|
|
|
69
69
|
|
|
70
70
|
#### Parameters
|
|
71
71
|
|
|
72
|
-
-
|
|
72
|
+
- **props**: `PageEditorOptions` - The options for the page editor. Includes a `reloadFunction` and a `pathname`.
|
|
73
73
|
|
|
74
74
|
#### Returns
|
|
75
75
|
|
|
76
|
-
-
|
|
76
|
+
- `React.RefObject<HTMLDivElement>[]`: A reference to the rows of the page.
|
|
77
77
|
|
|
78
78
|
#### Usage
|
|
79
79
|
|
|
@@ -81,8 +81,8 @@ A custom React hook that sets up the page editor for a dotCMS page.
|
|
|
81
81
|
import { usePageEditor } from '@dotcms/react';
|
|
82
82
|
|
|
83
83
|
const MyEditor = () => {
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
const rowsRef = usePageEditor({ pathname: '/my-page' });
|
|
85
|
+
// Use the rowsRef
|
|
86
86
|
};
|
|
87
87
|
```
|
|
88
88
|
|
|
@@ -94,8 +94,8 @@ A functional component that provides a context for a dotCMS page.
|
|
|
94
94
|
|
|
95
95
|
#### Props
|
|
96
96
|
|
|
97
|
-
-
|
|
98
|
-
-
|
|
97
|
+
- **entity**: The entity representing the page's data.
|
|
98
|
+
- **children**: The children components.
|
|
99
99
|
|
|
100
100
|
#### Usage
|
|
101
101
|
|
|
@@ -103,11 +103,7 @@ A functional component that provides a context for a dotCMS page.
|
|
|
103
103
|
import { PageProvider } from '@dotcms/react';
|
|
104
104
|
|
|
105
105
|
const MyApp = ({ entity }) => {
|
|
106
|
-
|
|
107
|
-
<PageProvider entity={entity}>
|
|
108
|
-
{/* children */}
|
|
109
|
-
</PageProvider>
|
|
110
|
-
);
|
|
106
|
+
return <PageProvider entity={entity}>{/* children */}</PageProvider>;
|
|
111
107
|
};
|
|
112
108
|
```
|
|
113
109
|
|
|
@@ -115,7 +111,6 @@ const MyApp = ({ entity }) => {
|
|
|
115
111
|
|
|
116
112
|
GitHub pull requests are the preferred method to contribute code to dotCMS. Before any pull requests can be accepted, an automated tool will ask you to agree to the [dotCMS Contributor's Agreement](https://gist.github.com/wezell/85ef45298c48494b90d92755b583acb3).
|
|
117
113
|
|
|
118
|
-
|
|
119
114
|
## Licensing
|
|
120
115
|
|
|
121
116
|
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 a number of enterprise features and is available via a supported, indemnified commercial license from dotCMS. For the differences between the editions, see [the feature page](http://dotcms.com/cms-platform/features).
|
|
@@ -138,4 +133,4 @@ Always refer to the official [DotCMS documentation](https://www.dotcms.com/docs/
|
|
|
138
133
|
| Code Examples | [Codeshare](https://dotcms.com/codeshare/) |
|
|
139
134
|
| Forums/Listserv | [via Google Groups](https://groups.google.com/forum/#!forum/dotCMS) |
|
|
140
135
|
| Twitter | @dotCMS |
|
|
141
|
-
| Main Site | [dotCMS.com](https://dotcms.com/) |
|
|
136
|
+
| Main Site | [dotCMS.com](https://dotcms.com/) |
|