Skip to content

Commit 340b7a9

Browse files
committed
MC-2294: Architectural Review for MC-2294
- Added constructor docs
1 parent 194d499 commit 340b7a9

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

app/code/Magento/PageBuilder/docs/image-uploader.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,18 @@ To update the `<YourModule>/view/adminhtml/web/js/content-type/<content_type_nam
113113
import Uploader from "../uploader";
114114
```
115115

116+
**Constructor arguments**
117+
118+
| Argument | Type | Description | Required | Default |
119+
| ------------------ | --------- | ----------------------------------------------------------------------------------- | -------- | ------------------------------------------------------------------------------------------------------- |
120+
| `name` | string | Used to locate the component in the UIRegistry once it is created. | true | None |
121+
| `uploaderConfig` | object | Used to initialize the Image Uploader UIComponent. | true | None |
122+
| `contentTypeId` | string | The ID of the parent content type this will be used in. | true | None |
123+
| `dataStore` | DataStore | The DataStore that the selected image should be stored in. | true | None |
124+
| `initialValue` | Object[] | The value that should be used for the initial state of the component. | true | None |
125+
| `onChangeCallback` | Function | A callback that will be called when an image is selected. | false | The image will be saved to the provided `dataStore` using `uploaderConfig.dataScope` as the key. |
126+
| `onDeleteCallback` | Function | A callback that will be called when the current used image is deleted from storage. | false | The image will be removed from to the provided `dataStore` using `uploaderConfig.dataScope` as the key. |
127+
116128
2. Add configuration for the uploader in the `<content-type-name>.xml` file to initialize the uploader.
117129

118130
3. Register the listener to specify when the image is loaded from the uploader UI component:

0 commit comments

Comments
 (0)