@dotcms/react 0.0.1-alpha.45 → 0.0.1-alpha.47

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/index.esm.js +11 -7
  2. package/package.json +2 -2
package/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import { useState, useEffect, createContext, useRef, useContext, createElement as createElement$1, forwardRef } from 'react';
3
- import { isInsideEditor, initEditor, updateNavigation, destroyEditor, DotCmsClient, postMessageToEditor, CUSTOMER_ACTIONS } from '@dotcms/client';
3
+ import { isInsideEditor, initEditor, updateNavigation, destroyEditor, DotCmsClient, postMessageToEditor, CLIENT_ACTIONS, NOTIFY_CLIENT } from '@dotcms/client';
4
4
  import { Editor } from '@tinymce/tinymce-react';
5
5
 
6
6
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -1681,7 +1681,7 @@ const useDotcmsEditor = ({
1681
1681
  return;
1682
1682
  }
1683
1683
  postMessageToEditor({
1684
- action: CUSTOMER_ACTIONS.CLIENT_READY,
1684
+ action: CLIENT_ACTIONS.CLIENT_READY,
1685
1685
  payload: editor
1686
1686
  });
1687
1687
  }, [pathname, editor]);
@@ -1802,6 +1802,7 @@ const startClassMap = {
1802
1802
  * @returns {Object} Container with all the data it has.
1803
1803
  */
1804
1804
  const getContainersData = (containers, containerRef) => {
1805
+ var _containers$identifie;
1805
1806
  const {
1806
1807
  identifier,
1807
1808
  uuid
@@ -1817,10 +1818,13 @@ const getContainersData = (containers, containerRef) => {
1817
1818
  // Get accepts types of content types for this container
1818
1819
  const acceptTypes = containerStructures.map(structure => structure.contentTypeVar).join(',');
1819
1820
  // Get the contentlets for "this" container
1820
- const contentlets = containers[identifier].contentlets[`uuid-${uuid}`];
1821
+ const contentlets = (_containers$identifie = containers[identifier].contentlets[`uuid-${uuid}`]) != null ? _containers$identifie : containers[identifier].contentlets[`uuid-dotParser_${uuid}`];
1822
+ if (!contentlets) {
1823
+ console.warn(`We couldn't find the contentlets for the container with the identifier ${identifier} and the uuid ${uuid} becareful by adding content to this container.\nWe recommend to change the container in the layout and add the content again.`);
1824
+ }
1821
1825
  return Object.assign({}, containers[identifier].container, {
1822
1826
  acceptTypes,
1823
- contentlets,
1827
+ contentlets: contentlets != null ? contentlets : [],
1824
1828
  variantId
1825
1829
  });
1826
1830
  };
@@ -4582,7 +4586,7 @@ function DotEditableText({
4582
4586
  name,
4583
4587
  payload
4584
4588
  } = data;
4585
- if (name !== 'COPY_CONTENTLET_INLINE_EDITING_SUCCESS') {
4589
+ if (name !== NOTIFY_CLIENT.UVE_COPY_CONTENTLET_INLINE_EDITING_SUCCESS) {
4586
4590
  return;
4587
4591
  }
4588
4592
  const {
@@ -4616,7 +4620,7 @@ function DotEditableText({
4616
4620
  event.stopPropagation();
4617
4621
  event.preventDefault();
4618
4622
  postMessageToEditor({
4619
- action: CUSTOMER_ACTIONS.COPY_CONTENTLET_INLINE_EDITING,
4623
+ action: CLIENT_ACTIONS.COPY_CONTENTLET_INLINE_EDITING,
4620
4624
  payload: {
4621
4625
  dataset: {
4622
4626
  inode,
@@ -4639,7 +4643,7 @@ function DotEditableText({
4639
4643
  return;
4640
4644
  }
4641
4645
  postMessageToEditor({
4642
- action: CUSTOMER_ACTIONS.UPDATE_CONTENTLET_INLINE_EDITING,
4646
+ action: CLIENT_ACTIONS.UPDATE_CONTENTLET_INLINE_EDITING,
4643
4647
  payload: {
4644
4648
  content: editedContent,
4645
4649
  dataset: {
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@dotcms/react",
3
- "version": "0.0.1-alpha.45",
3
+ "version": "0.0.1-alpha.47",
4
4
  "peerDependencies": {
5
5
  "react": ">=18",
6
6
  "react-dom": ">=18",
7
- "@dotcms/client": "0.0.1-alpha.45",
7
+ "@dotcms/client": "0.0.1-alpha.47",
8
8
  "@tinymce/tinymce-react": "^5.1.1"
9
9
  },
10
10
  "description": "Official React Components library to render a dotCMS page.",