-In this section, you will see how to setup and take the full advantage of built-in Asset Manager in GrapesJS, which is intentionally lightweight and implements just an `image` in its core, but as you'll see next it's easy to extend and create your own asset types.
+In this section, you will see how to setup and take the full advantage of built-in Asset Manager in GrapesJS. The Asset Manager is lightweight and implements just an `image` in its core, but as you'll see next it's easy to extend and create your own asset types.
[[toc]]
## Configuration
-To change default configurations you have to pass `assetManager` property with the main configuration object
+To change default configurations you'll have to pass `assetManager` property with the main configuration object
```js
const editor = grapesjs.init({
@@ -33,7 +33,7 @@ const amConfig = editor.AssetManager.getConfig();
```
-Below the list of currently available options
+Below is a list of currently available options
```js
// Default assets
@@ -119,7 +119,7 @@ Below the list of currently available options
modalTitle: 'Select Image',
```
-Not always docs are in inline with its code, therefore we'd suggest to keep an eye at the current state of configurations by checking the dedicated source file [Asset Manager Config](https://github.com/artf/grapesjs/blob/dev/src/asset_manager/config/config.js)
+Sometimes the code gets ahead of the docs, therefore we'd suggest to keep an eye at the current state of configurations by checking the dedicated source file [Asset Manager Config](https://github.com/artf/grapesjs/blob/dev/src/asset_manager/config/config.js)
@@ -127,7 +127,7 @@ Not always docs are in inline with its code, therefore we'd suggest to keep an e
## Initialization
-The Asset Manager is ready to work by default, so just pass few urls to see them loaded
+The Asset Manager is ready to work by default, so pass few URLs to see them loaded
```js
const editor = grapesjs.init({
@@ -155,7 +155,7 @@ const editor = grapesjs.init({
```
-If you want a complete list of available properties check the source [AssetImage Model](https://github.com/artf/grapesjs/blob/dev/src/asset_manager/model/AssetImage.js)
+If you want a complete list of available properties check out the source [AssetImage Model](https://github.com/artf/grapesjs/blob/dev/src/asset_manager/model/AssetImage.js)
The built-in Asset Manager modal is implemented and is showing up when requested. By default, you can make it appear by dragging Image Components in canvas, double clicking on images and all other stuff related to images (eg. CSS styling)
@@ -163,7 +163,7 @@ The built-in Asset Manager modal is implemented and is showing up when requested
-Showing up of the modal is registered with a command, so you can make it appear with this
+Making the modal appear is registered with a command, so you can make it appear with this
```js
// This command shows only assets with `image` type
@@ -218,7 +218,7 @@ am.add([
]);
```
-Now if you call the `render()`, without any argument, you will see all the assets rendered
+Now if you call the `render()`, without an argument, you will see all the assets rendered
```js
// without any argument
@@ -241,7 +241,7 @@ am.getAll().length // Still have 3 assets
am.getAllVisible().length // but only 2 are shown
```
-Obviously, you can mix more arrays of assets
+You can also mix arrays of assets
```js
am.render([...assets1, ...assets2, ...assets3]);
@@ -261,10 +261,10 @@ For more APIs methods check out the [API Reference](API-Asset-Manager)
### Define new Asset type
-Generally speaking, an asset is not only an image, it could be a `video`, `svg-icon`, or any other kind of `document`. Each type of the asset is applied in our templates/pages differently. If you need to change the image of the Component all you need is another `url` in `src` attribute, but in case of `svg-icon`, for instance, its not the same, you might want to replace the element with a new `