# Gutenberg

### Built In Block Editing Components

{% embed url="<https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/inspector-controls/README.md>" %}
Inspector Controls
{% endembed %}

### Gutenberg Packages

{% embed url="<https://github.com/WordPress/gutenberg/tree/15a198cbf3603ed7b1d673b807910418c92b0468/packages/block-library/src>" %}

### getEntityRecords

{% embed url="<https://ryanwelcher.com/2021/08/requesting-data-in-gutenberg-with-getentityrecords#:~:text=As%20getEntityRecords%20is%20part%20of%20the%20WordPress%20datastore%2C,we%20can%20make%20a%20request%20in%20our%20component>" %}

{% embed url="<https://rudrastyh.com/gutenberg/get-posts-in-dynamic-select-control.html#query_parameters>" %}

### Block Library

{% embed url="<https://github.com/WordPress/gutenberg/tree/trunk/packages/block-library/src>" %}

### Theme.JSON

{% embed url="<https://developer.wordpress.org/block-editor/how-to-guides/themes/theme-json>" %}
theme.json docs
{% endembed %}

### Locking Blocks

{% embed url="<https://make.wordpress.org/core/2022/01/08/locking-blocks-in-wordpress-5-9>" %}
locking block templates
{% endembed %}

### More Block Data

{% code title="backend/plugins/gravity-platform-core/src/index.tsx" %}

```tsx
wp.domReady(() => {
	// wp.blocks.unregisterBlockStyle("core/quote", ["default", "plain", "large"]);
	// THIS CAN SHOW THE BLOCK OBJECTS IN THE CONSOLE OF THE PAGE EDITOR
	wp.blocks.getBlockTypes().forEach((block) => {
	 	console.log("block :", block);
	 });
});
```

{% endcode %}

### Removing Editor Panels

{% code title="backend/plugins/gravity-platform-core/src/index.tsx" %}

```javascript
wp.domReady(() => {
	wp.blocks.unregisterBlockStyle("core/quote", ["default", "plain", "large"]);
	wp.data.dispatch("core/edit-post").removeEditorPanel("discussion-panel");
	wp.data.dispatch("core/edit-post").removeEditorPanel("template");
});
```

{% endcode %}

We can use `wp.data.dispatch` to remove editor panels as shown above.

We can also toggle them open by default as you can see below.

```javascript
if (!wp.data.select("core/edit-post").isPanelOpened("featured-image")) {
	wp.data
		.dispatch("core/edit-post")
		.toggleEditorPanelOpened("featured-image");
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://shaunh.gitbook.io/kairos/gutenberg.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
