@dotcms/uve 1.1.1-next.4 → 1.1.1-next.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotcms/uve",
3
- "version": "1.1.1-next.4",
3
+ "version": "1.1.1-next.5",
4
4
  "description": "Official JavaScript library for interacting with Universal Visual Editor (UVE)",
5
5
  "repository": {
6
6
  "type": "git",
package/public.cjs.js CHANGED
@@ -696,17 +696,20 @@ function setBounds(bounds) {
696
696
  });
697
697
  }
698
698
  /**
699
- * Validates the structure of a Block Editor block.
700
- *
701
- * This function checks that:
702
- * 1. The blocks parameter is a valid object
703
- * 2. The block has a 'doc' type
704
- * 3. The block has a valid content array that is not empty
705
- *
706
- * @param {Block} blocks - The blocks structure to validate
707
- * @returns {BlockEditorState} Object containing validation state and any error message
708
- * @property {boolean} BlockEditorState.isValid - Whether the blocks structure is valid
709
- * @property {string | null} BlockEditorState.error - Error message if invalid, null if valid
699
+ * Validates the structure of a Block Editor node.
700
+ *
701
+ * This function performs validation checks on a BlockEditorNode object to ensure:
702
+ * - The node exists and is a valid object
703
+ * - The node has a 'doc' type
704
+ * - The node has a valid content array containing at least one block
705
+ * - Each block in the content array:
706
+ * - Has a valid string type property
707
+ * - Has valid object attributes (if present)
708
+ * - Has valid nested content (if present)
709
+ *
710
+ * @param {BlockEditorNode} blocks - The BlockEditorNode structure to validate
711
+ * @returns {BlockEditorState} The validation result
712
+ * @property {string | null} BlockEditorState.error - Error message if validation fails, null if valid
710
713
  */
711
714
  const isValidBlocks = blocks => {
712
715
  if (!blocks) {
package/public.esm.js CHANGED
@@ -694,17 +694,20 @@ function setBounds(bounds) {
694
694
  });
695
695
  }
696
696
  /**
697
- * Validates the structure of a Block Editor block.
698
- *
699
- * This function checks that:
700
- * 1. The blocks parameter is a valid object
701
- * 2. The block has a 'doc' type
702
- * 3. The block has a valid content array that is not empty
703
- *
704
- * @param {Block} blocks - The blocks structure to validate
705
- * @returns {BlockEditorState} Object containing validation state and any error message
706
- * @property {boolean} BlockEditorState.isValid - Whether the blocks structure is valid
707
- * @property {string | null} BlockEditorState.error - Error message if invalid, null if valid
697
+ * Validates the structure of a Block Editor node.
698
+ *
699
+ * This function performs validation checks on a BlockEditorNode object to ensure:
700
+ * - The node exists and is a valid object
701
+ * - The node has a 'doc' type
702
+ * - The node has a valid content array containing at least one block
703
+ * - Each block in the content array:
704
+ * - Has a valid string type property
705
+ * - Has valid object attributes (if present)
706
+ * - Has valid nested content (if present)
707
+ *
708
+ * @param {BlockEditorNode} blocks - The BlockEditorNode structure to validate
709
+ * @returns {BlockEditorState} The validation result
710
+ * @property {string | null} BlockEditorState.error - Error message if validation fails, null if valid
708
711
  */
709
712
  const isValidBlocks = blocks => {
710
713
  if (!blocks) {
@@ -1,4 +1,4 @@
1
- import { BlockEditorContent } from '@dotcms/types';
1
+ import { BlockEditorNode } from '@dotcms/types';
2
2
  import { BlockEditorState, DotCMSContainerBound } from '@dotcms/types/internal';
3
3
  /**
4
4
  * Sets the bounds of the containers in the editor.
@@ -8,16 +8,19 @@ import { BlockEditorState, DotCMSContainerBound } from '@dotcms/types/internal';
8
8
  */
9
9
  export declare function setBounds(bounds: DotCMSContainerBound[]): void;
10
10
  /**
11
- * Validates the structure of a Block Editor block.
11
+ * Validates the structure of a Block Editor node.
12
12
  *
13
- * This function checks that:
14
- * 1. The blocks parameter is a valid object
15
- * 2. The block has a 'doc' type
16
- * 3. The block has a valid content array that is not empty
13
+ * This function performs validation checks on a BlockEditorNode object to ensure:
14
+ * - The node exists and is a valid object
15
+ * - The node has a 'doc' type
16
+ * - The node has a valid content array containing at least one block
17
+ * - Each block in the content array:
18
+ * - Has a valid string type property
19
+ * - Has valid object attributes (if present)
20
+ * - Has valid nested content (if present)
17
21
  *
18
- * @param {Block} blocks - The blocks structure to validate
19
- * @returns {BlockEditorState} Object containing validation state and any error message
20
- * @property {boolean} BlockEditorState.isValid - Whether the blocks structure is valid
21
- * @property {string | null} BlockEditorState.error - Error message if invalid, null if valid
22
+ * @param {BlockEditorNode} blocks - The BlockEditorNode structure to validate
23
+ * @returns {BlockEditorState} The validation result
24
+ * @property {string | null} BlockEditorState.error - Error message if validation fails, null if valid
22
25
  */
23
- export declare const isValidBlocks: (blocks: BlockEditorContent) => BlockEditorState;
26
+ export declare const isValidBlocks: (blocks: BlockEditorNode) => BlockEditorState;