Skip to content

Commit

Permalink
Documentation: EntitiesSavedStates editor component (WordPress#62377)
Browse files Browse the repository at this point in the history
* Add JSDoc block for EntitiesSavedStatesExtensible function

* Add JSDoc block for EntitiesSavedStates editor component

* Auto-generate editor component docs for EntitiesSavedStates
  • Loading branch information
colorful-tones authored and patil-vipul committed Jun 17, 2024
1 parent 920a89a commit 32ff444
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/editor/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,17 @@ _Returns_

### EntitiesSavedStates

Undocumented declaration.
Renders the component for managing saved states of entities.

_Parameters_

- _props_ `Object`: The component props.
- _props.close_ `Function`: The function to close the dialog.
- _props.renderDialog_ `Function`: The function to render the dialog.

_Returns_

- `JSX.Element`: The rendered component.

### ErrorBoundary

Expand Down
26 changes: 26 additions & 0 deletions packages/editor/src/components/entities-saved-states/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ function identity( values ) {
return values;
}

/**
* Renders the component for managing saved states of entities.
*
* @param {Object} props The component props.
* @param {Function} props.close The function to close the dialog.
* @param {Function} props.renderDialog The function to render the dialog.
*
* @return {JSX.Element} The rendered component.
*/
export default function EntitiesSavedStates( {
close,
renderDialog = undefined,
Expand All @@ -40,6 +49,23 @@ export default function EntitiesSavedStates( {
);
}

/**
* Renders a panel for saving entities with dirty records.
*
* @param {Object} props The component props.
* @param {string} props.additionalPrompt Additional prompt to display.
* @param {Function} props.close Function to close the panel.
* @param {Function} props.onSave Function to call when saving entities.
* @param {boolean} props.saveEnabled Flag indicating if save is enabled.
* @param {string} props.saveLabel Label for the save button.
* @param {Function} props.renderDialog Function to render a custom dialog.
* @param {Array} props.dirtyEntityRecords Array of dirty entity records.
* @param {boolean} props.isDirty Flag indicating if there are dirty entities.
* @param {Function} props.setUnselectedEntities Function to set unselected entities.
* @param {Array} props.unselectedEntities Array of unselected entities.
*
* @return {JSX.Element} The rendered component.
*/
export function EntitiesSavedStatesExtensible( {
additionalPrompt = undefined,
close,
Expand Down

0 comments on commit 32ff444

Please sign in to comment.