@dotcms/react 1.5.1-next.1964 → 1.5.1-next.1965

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/index.esm.js CHANGED
@@ -5,5 +5,4 @@ export { useEditableDotCMSPage } from './lib/next/hooks/useEditableDotCMSPage.es
5
5
  export { DotCMSEditableText } from './lib/next/components/DotCMSEditableText/DotCMSEditableText.esm.js';
6
6
  export { DotCMSBlockEditorRenderer } from './lib/next/components/DotCMSBlockEditorRenderer/DotCMSBlockEditorRenderer.esm.js';
7
7
  export { useAISearch } from './lib/next/hooks/useAISearch.esm.js';
8
- export { useStyleEditorSchemas } from './lib/next/hooks/useStyleEditorSchemas.esm.js';
9
8
  export { buildSlots } from './lib/next/utils/buildSlots.esm.js';
@@ -1,6 +1,7 @@
1
1
  import { useState, useEffect } from 'react';
2
2
  import { UVEEventType } from '@dotcms/types';
3
3
  import { getUVEState, initUVE, updateNavigation, createUVESubscription } from '@dotcms/uve';
4
+ import { registerStyleEditorSchemas } from '@dotcms/uve/internal';
4
5
 
5
6
  /**
6
7
  * Custom hook to manage the editable state of a DotCMS page.
@@ -93,7 +94,7 @@ import { getUVEState, initUVE, updateNavigation, createUVESubscription } from '@
93
94
  const useEditableDotCMSPage = pageResponse => {
94
95
  const [updatedPageResponse, setUpdatedPageResponse] = useState(pageResponse);
95
96
  useEffect(() => {
96
- var _pageResponse$pageAss;
97
+ var _pageResponse$pageAss, _pageResponse$styleEd;
97
98
  if (!getUVEState()) {
98
99
  return;
99
100
  }
@@ -111,6 +112,9 @@ const useEditableDotCMSPage = pageResponse => {
111
112
  if (pageURI) {
112
113
  updateNavigation(pageURI);
113
114
  }
115
+ if ((_pageResponse$styleEd = pageResponse.styleEditorSchemas) != null && _pageResponse$styleEd.length) {
116
+ registerStyleEditorSchemas(pageResponse.styleEditorSchemas);
117
+ }
114
118
  return () => {
115
119
  destroyUVESubscriptions();
116
120
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotcms/react",
3
- "version": "1.5.1-next.1964",
3
+ "version": "1.5.1-next.1965",
4
4
  "peerDependencies": {
5
5
  "react": ">=18",
6
6
  "react-dom": ">=18"
package/src/index.d.ts CHANGED
@@ -7,6 +7,5 @@ export { DotCMSBlockEditorRenderer, CustomRenderer } from './lib/next/components
7
7
  export type { BlockEditorRendererProps, CustomRendererProps } from './lib/next/components/DotCMSBlockEditorRenderer/DotCMSBlockEditorRenderer';
8
8
  export type { DotCMSLayoutBodyProps } from './lib/next/components/DotCMSLayoutBody/DotCMSLayoutBody';
9
9
  export { useAISearch } from './lib/next/hooks/useAISearch';
10
- export { useStyleEditorSchemas } from './lib/next/hooks/useStyleEditorSchemas';
11
10
  export type { DotCMSAISearchValue, DotCMSAISearchProps } from './lib/next/shared/types';
12
11
  export { buildSlots } from './lib/next/utils/buildSlots';
@@ -1,15 +0,0 @@
1
- import { useEffect } from 'react';
2
- import { registerStyleEditorSchemas } from '@dotcms/uve';
3
-
4
- /**
5
- * Hook to register style editor forms with the UVE editor.
6
- * @param forms - Array of style editor form schemas to register
7
- * @returns void
8
- */
9
- const useStyleEditorSchemas = styleEditorForms => {
10
- useEffect(() => {
11
- registerStyleEditorSchemas(styleEditorForms);
12
- }, [styleEditorForms]);
13
- };
14
-
15
- export { useStyleEditorSchemas };
@@ -1,7 +0,0 @@
1
- import { StyleEditorFormSchema } from '@dotcms/uve';
2
- /**
3
- * Hook to register style editor forms with the UVE editor.
4
- * @param forms - Array of style editor form schemas to register
5
- * @returns void
6
- */
7
- export declare const useStyleEditorSchemas: (styleEditorForms: StyleEditorFormSchema[]) => void;