@dotcms/react 0.0.1-beta.31 → 0.0.1-beta.32

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 (2) hide show
  1. package/next.esm.js +7 -6
  2. package/package.json +3 -3
package/next.esm.js CHANGED
@@ -695,30 +695,31 @@ function DotCMSEditableText({
695
695
  const [scriptSrc, setScriptSrc] = useState('');
696
696
  const [initEditor, setInitEditor] = useState(false);
697
697
  const [content, setContent] = useState((contentlet == null ? void 0 : contentlet[fieldName]) || '');
698
+ useEffect(() => {
699
+ setContent((contentlet == null ? void 0 : contentlet[fieldName]) || '');
700
+ }, [fieldName, contentlet]);
698
701
  useEffect(() => {
699
702
  var _state$dotCMSHost, _editorRef$current;
700
703
  const state = getUVEState();
701
704
  setInitEditor((state == null ? void 0 : state.mode) === UVE_MODE.EDIT && !!(state != null && (_state$dotCMSHost = state.dotCMSHost) != null && _state$dotCMSHost.length));
702
705
  if (!contentlet || !fieldName) {
703
- console.error('DotCMSEditableText: contentlet or fieldName is missing', 'Ensure that all needed props are passed to view and edit the content');
706
+ console.error('[DotCMSEditableText]: contentlet or fieldName is missing', 'Ensure that all needed props are passed to view and edit the content');
704
707
  return;
705
708
  }
706
709
  if (state && state.mode !== UVE_MODE.EDIT) {
707
- console.warn('DotCMSEditableText: TinyMCE is not available in the current mode');
710
+ console.warn('[DotCMSEditableText]: TinyMCE is not available in the current mode');
708
711
  return;
709
712
  }
710
713
  if (!(state != null && state.dotCMSHost)) {
711
- console.warn('The `dotCMSHost` parameter is not defined. Check that the UVE is sending the correct parameters.');
714
+ console.warn('[DotCMSEditableText]: The `dotCMSHost` parameter is not defined. Check that the UVE is sending the correct parameters.');
712
715
  return;
713
716
  }
714
717
  const createURL = new URL(__TINYMCE_PATH_ON_DOTCMS__, state.dotCMSHost);
715
718
  setScriptSrc(createURL.toString());
716
- const content = (contentlet == null ? void 0 : contentlet[fieldName]) || '';
717
719
  (_editorRef$current = editorRef.current) == null || _editorRef$current.setContent(content, {
718
720
  format
719
721
  });
720
- setContent(content);
721
- }, [format, fieldName, contentlet]);
722
+ }, [format, fieldName, contentlet, content]);
722
723
  useEffect(() => {
723
724
  var _getUVEState;
724
725
  if (((_getUVEState = getUVEState()) == null ? void 0 : _getUVEState.mode) !== UVE_MODE.EDIT) {
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@dotcms/react",
3
- "version": "0.0.1-beta.31",
3
+ "version": "0.0.1-beta.32",
4
4
  "peerDependencies": {
5
5
  "react": ">=18",
6
6
  "react-dom": ">=18",
7
- "@dotcms/client": "0.0.1-beta.31",
8
- "@dotcms/uve": "0.0.1-beta.31",
7
+ "@dotcms/client": "0.0.1-beta.32",
8
+ "@dotcms/uve": "0.0.1-beta.32",
9
9
  "@tinymce/tinymce-react": "^6.0.0"
10
10
  },
11
11
  "devDependencies": {