@layers-app/editor 0.0.17-editor-01 → 0.0.17-editor-03

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/README.md CHANGED
@@ -149,12 +149,12 @@ Use **StylesProvider** to add styling to your HTML content.
149
149
 
150
150
  ## Image upload
151
151
 
152
- To start working with image uploads, use the **fetchUploadImage** function, which takes three parameters: **file**, **success**, and **error**. After successfully uploading the image to your service, you should call the **success** function and pass two required arguments: the **URL** of the image and its **ID**.
152
+ To start working with image uploads, use the **fetchUploadMedia** function, which takes three parameters: **file**, **success**, and **error**. After successfully uploading the image to your service, you should call the **success** function and pass two required arguments: the **URL** of the image and its **ID**.
153
153
 
154
154
  ```
155
- const fetchUploadImage = async (
155
+ const fetchUploadMedia = async (
156
156
  file: File,
157
- success: (url: string, id: string) => void,
157
+ success: (url: string, id: string, data?: object) => void,
158
158
  error?: (error?: Error) => void
159
159
  ) => {
160
160
  const formData = new FormData();
@@ -189,16 +189,16 @@ To start working with image uploads, use the **fetchUploadImage** function, whic
189
189
 
190
190
  <Editor
191
191
  ...props
192
- fetchUploadImage={fetchUploadImage}
192
+ fetchUploadMedia={fetchUploadMedia}
193
193
  />
194
194
  ```
195
195
 
196
196
  ## Image Deletion
197
197
 
198
- To have greater control over image deletion, pass an optional function **fetchDeleteImage** to the editor, which accepts three parameters: **id**, **success**, and **error**. After successfully deleting the image from your service, the **success** function should be called.
198
+ To have greater control over image deletion, pass an optional function **fetchDeleteMedia** to the editor, which accepts three parameters: **id**, **success**, and **error**. After successfully deleting the image from your service, the **success** function should be called.
199
199
 
200
200
  ```
201
- const fetchDeleteImage = async (
201
+ const fetchDeleteMedia = async (
202
202
  id: string,
203
203
  success: () => void,
204
204
  error?: (error?: Error) => void
@@ -230,8 +230,8 @@ To have greater control over image deletion, pass an optional function **fetchDe
230
230
 
231
231
  <Editor
232
232
  ...props
233
- fetchUploadImage={fetchUploadImage}
234
- fetchDeleteImage={fetchUploadImage}
233
+ fetchUploadMedia={fetchUploadMedia}
234
+ fetchDeleteMedia={fetchUploadMedia}
235
235
  />
236
236
  ```
237
237
 
@@ -281,7 +281,7 @@ Dropzone.Idle is visible when the user is not dragging any file into the drop zo
281
281
 
282
282
  <Editor
283
283
  ...props
284
- fetchUploadImage={fetchUploadImage}
284
+ fetchUploadMedia={fetchUploadMedia}
285
285
  contentModalUploadImage={Content}
286
286
  maxImageSize={5}
287
287
  maxImageSizeError={() => {}}
@@ -356,8 +356,8 @@ outputFormat?: 'html' | 'json' - The outputFormat property defines whether we wa
356
356
  initialContent: string | object - The initial content for the editor.
357
357
  maxHeight?: number - Sets the height of the editor. The default is 100%.
358
358
  mode?: 'simple' | 'default' | 'full' | 'editor' - The editor mode. Depending on the chosen mode, functionality may be restricted or extended. The default is default.
359
- fetchUploadImage?: (file: File, success: (url: string, id: string, error?: (error?: Error) => void) => void) - Function to upload an image to your service.
360
- fetchDeleteImage?: (id: string, success: () => void, error?: (error?: Error) => void) - Helper function to delete an image.
359
+ fetchUploadMedia?: (file: File, success: (url: string, id: string, error?: (error?: Error) => void) => void) - Function to upload an image to your service.
360
+ fetchDeleteMedia?: (id: string, success: () => void, error?: (error?: Error) => void) - Helper function to delete an image.
361
361
  maxImageSize?: number - The maximum image size in megabytes.
362
362
  contentModalUploadImage?: React.FunctionComponent - A React component to replace content in DropZone.
363
363
  maxImageSizeError?: () => void - A function that is called if the image exceeds the maxImageSize.