Skip to content

Commit 50638ba

Browse files
committed
DOC-3224: New options for dialog components.
1 parent 6d77f0f commit 50638ba

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

modules/ROOT/pages/8.3.0-release-notes.adoc

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,18 @@ Added new configuration options to the Link plugin to support file uploads throu
7171

7272
For more information, see xref:link.adoc#files_upload_handler[`+files_upload_handler+`], xref:link.adoc#documents_file_types[`+documents_file_types+`], and xref:link.adoc#link_uploadtab[`+link_uploadtab+`].
7373

74+
=== New options for `dropzone` dialog components
75+
// #TINY-13278
76+
77+
Added new configuration options to the `dropzone` dialog component to customize the dropzone UI and file type restrictions:
78+
79+
* xref:dialog-components.adoc#dropzone[`+dropAreaLabel+`] - Specifies the text label for the drop area where files can be dragged (default: `+'Drop an image here'+`)
80+
* xref:dialog-components.adoc#dropzone[`+buttonLabel+`] - Specifies the text label for the browse button (default: `+'Browse for an image'+`)
81+
* xref:dialog-components.adoc#dropzone[`+allowedFileTypes+`] - Specifies a MIME type pattern for allowed file types (default: `+'image/*'+`, e.g., `+'image/*'+`, `+'application/pdf'+`)
82+
* xref:dialog-components.adoc#dropzone[`+allowedFileExtensions+`] - Specifies an array of allowed file extensions (default: xref:file-image-upload.adoc#images_file_types[`+images_file_types+`], e.g., `+['.jpg', '.png', '.pdf']+`)
83+
84+
For more information, see xref:dialog-components.adoc#dropzone[dropzone component].
85+
7486

7587
[[changes]]
7688
== Changes

modules/ROOT/pages/dialog-components.adoc

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,13 +298,30 @@ A *dropzone* is a composite component that catches drag and drops items or lets
298298

299299
*Events:* Interacting with a *dropzone* component will fire the `+onChange+` function in the dialog's configuration.
300300

301+
[cols="1,1,1,3",options="header"]
302+
|===
303+
|Name |Type |Requirement |Description
304+
|type |`+'dropzone'+` |required |The component type. Must be `+'dropzone'+`.
305+
|name |string |required |An identifier for the dropzone.
306+
|label |string |optional |Text for the label displayed above the dropzone.
307+
|dropAreaLabel |string |optional |default: `+'Drop an image here'+` - Text label for the drop area where files can be dragged.
308+
|buttonLabel |string |optional |default: `+'Browse for an image'+` - Text label for the browse button.
309+
|allowedFileTypes |string |optional |default: `+'image/*'+` - MIME type pattern that specifies allowed file types (e.g., `+'image/*'+`, `+'application/pdf'+`).
310+
|allowedFileExtensions |array |optional |default: xref:file-image-upload.adoc#images_file_types[`+images_file_types+`] - Array of allowed file extensions (e.g., `+['.jpg', '.png', '.pdf']+`).
311+
|context |string |optional |Context condition for when the dropzone is active (e.g., `+'mode:design'+`). Only effective when `+enabled+` is `+true+`.
312+
|===
313+
301314
[source,js]
302315
----
303316
{
304317
type: 'dropzone', // component type
305318
name: 'dropzone', // identifier
306319
label: 'Dropzone', // text for the label
307-
context: 'mode:design' // dropzone is active when the editor is in design mode, only effective when enabled is true
320+
dropAreaLabel: 'Drag and drop files here', // text for the drop area (default: 'Drop an image here')
321+
buttonLabel: 'Browse files', // text for the browse button (default: 'Browse for an image')
322+
allowedFileTypes: 'image/*', // MIME type pattern (default: 'image/*')
323+
allowedFileExtensions: ['.jpg', '.png', '.pdf'], // allowed file extensions (default: images_file_types)
324+
context: 'mode:design' // dropzone is active when the editor is in design mode
308325
}
309326
----
310327

0 commit comments

Comments
 (0)