@dotcms/react 0.0.1-beta.28 → 0.0.1-beta.29
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/next.esm.js
CHANGED
|
@@ -2,9 +2,8 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import { createContext, useContext, useState, useEffect, useLayoutEffect, useRef, useMemo } from 'react';
|
|
3
3
|
import { s as styleInject } from './web.url-search-params.size.esm.js';
|
|
4
4
|
import { UVE_MODE, UVEEventType, DotCMSUVEAction } from '@dotcms/types';
|
|
5
|
-
import { getUVEState, initUVE, createUVESubscription, sendMessageToUVE } from '@dotcms/uve';
|
|
5
|
+
import { getUVEState, initUVE, updateNavigation, createUVESubscription, sendMessageToUVE } from '@dotcms/uve';
|
|
6
6
|
import { DEVELOPMENT_MODE, EMPTY_CONTAINER_STYLE_REACT, getDotContentletAttributes, CUSTOM_NO_COMPONENT, getContainersData, getContentletsInContainer, getDotContainerAttributes, getColumnPositionClasses, combineClasses, __DEFAULT_TINYMCE_CONFIG__, __BASE_TINYMCE_CONFIG_WITH_NO_DEFAULT__, __TINYMCE_PATH_ON_DOTCMS__, isValidBlocks } from '@dotcms/uve/internal';
|
|
7
|
-
import { updateNavigation } from '@dotcms/client';
|
|
8
7
|
import { Editor } from '@tinymce/tinymce-react';
|
|
9
8
|
import { __DOTCMS_UVE_EVENT__, BlockEditorDefaultBlocks } from '@dotcms/types/internal';
|
|
10
9
|
|
|
@@ -607,39 +606,39 @@ const DotCMSShow = ({
|
|
|
607
606
|
* </div>
|
|
608
607
|
* );
|
|
609
608
|
* ```
|
|
610
|
-
* @param {
|
|
609
|
+
* @param {DotCMSPageResponse} pageResponse - The initial editable page data from client.page.get().
|
|
611
610
|
*
|
|
612
|
-
* @returns {
|
|
611
|
+
* @returns {DotCMSPageResponse} The updated editable page state that reflects any changes made in the UVE.
|
|
613
612
|
* The structure includes page data and any GraphQL content that was requested.
|
|
614
613
|
*/
|
|
615
|
-
const useEditableDotCMSPage =
|
|
616
|
-
const [
|
|
614
|
+
const useEditableDotCMSPage = pageResponse => {
|
|
615
|
+
const [updatedPageResponse, setUpdatedPageResponse] = useState(pageResponse);
|
|
617
616
|
useEffect(() => {
|
|
618
|
-
var
|
|
617
|
+
var _pageResponse$pageAss, _pageResponse$pageAss2;
|
|
619
618
|
if (!getUVEState()) {
|
|
620
619
|
return;
|
|
621
620
|
}
|
|
622
|
-
const pageURI = (
|
|
621
|
+
const pageURI = (_pageResponse$pageAss = pageResponse == null || (_pageResponse$pageAss2 = pageResponse.pageAsset) == null || (_pageResponse$pageAss2 = _pageResponse$pageAss2.page) == null ? void 0 : _pageResponse$pageAss2.pageURI) != null ? _pageResponse$pageAss : '/';
|
|
623
622
|
const {
|
|
624
623
|
destroyUVESubscriptions
|
|
625
|
-
} = initUVE(
|
|
624
|
+
} = initUVE(pageResponse);
|
|
626
625
|
// Update the navigation to the pageURI
|
|
627
626
|
updateNavigation(pageURI);
|
|
628
627
|
return () => {
|
|
629
628
|
destroyUVESubscriptions();
|
|
630
629
|
};
|
|
631
|
-
}, [
|
|
630
|
+
}, [pageResponse]);
|
|
632
631
|
useEffect(() => {
|
|
633
632
|
const {
|
|
634
633
|
unsubscribe
|
|
635
634
|
} = createUVESubscription(UVEEventType.CONTENT_CHANGES, payload => {
|
|
636
|
-
|
|
635
|
+
setUpdatedPageResponse(payload);
|
|
637
636
|
});
|
|
638
637
|
return () => {
|
|
639
638
|
unsubscribe();
|
|
640
639
|
};
|
|
641
640
|
}, []);
|
|
642
|
-
return
|
|
641
|
+
return updatedPageResponse;
|
|
643
642
|
};
|
|
644
643
|
|
|
645
644
|
const DEFAULT_TINYMCE_CONFIG = Object.assign({}, __DEFAULT_TINYMCE_CONFIG__, {
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dotcms/react",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.29",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"react": ">=18",
|
|
6
6
|
"react-dom": ">=18",
|
|
7
|
-
"@dotcms/client": "0.0.1-beta.
|
|
8
|
-
"@dotcms/uve": "0.0.1-beta.
|
|
7
|
+
"@dotcms/client": "0.0.1-beta.29",
|
|
8
|
+
"@dotcms/uve": "0.0.1-beta.29",
|
|
9
9
|
"@tinymce/tinymce-react": "^6.0.0"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DotCMSPageResponse } from '@dotcms/types';
|
|
2
2
|
/**
|
|
3
3
|
* Custom hook to manage the editable state of a DotCMS page.
|
|
4
4
|
*
|
|
@@ -82,9 +82,9 @@ import { DotCMSEditablePage } from '@dotcms/types';
|
|
|
82
82
|
* </div>
|
|
83
83
|
* );
|
|
84
84
|
* ```
|
|
85
|
-
* @param {
|
|
85
|
+
* @param {DotCMSPageResponse} pageResponse - The initial editable page data from client.page.get().
|
|
86
86
|
*
|
|
87
|
-
* @returns {
|
|
87
|
+
* @returns {DotCMSPageResponse} The updated editable page state that reflects any changes made in the UVE.
|
|
88
88
|
* The structure includes page data and any GraphQL content that was requested.
|
|
89
89
|
*/
|
|
90
|
-
export declare const useEditableDotCMSPage: (
|
|
90
|
+
export declare const useEditableDotCMSPage: (pageResponse: DotCMSPageResponse) => DotCMSPageResponse;
|