Closed egordidenko closed 2 weeks ago
The changes introduce a new property, source
, across multiple components, enhancing the output and documentation with additional context about the origin of uploads. New methods and typedefs improve functionality and type-checking. The UploaderBlock
class includes deprecation notices for certain enums, and the handling of source types has been updated throughout the codebase. A new conditional branch is added to handle object types in the build-ssr-stubs.js
file.
File Path | Change Summary |
---|---|
abstract/UploaderPublicApi.js | Added source property to the output object, derived from uploadEntryData?.source . |
abstract/uploadEntrySchema.js | Updated documentation to include source as a String property in the upload entry schema. |
blocks/FileItem/FileItem.js | Introduced source property in the FileItem class, populated from entry.getValue('source') . |
abstract/UploaderBlock.js | Added getList method to return sourceTypes , added deprecation notices for extSrcList and sourceTypes , and defined SourceTypes typedef. |
blocks/DropArea/DropArea.js | Updated isEnabled logic to check for UploadSource.LOCAL instead of UploaderBlock.sourceTypes.LOCAL . |
blocks/EditorFilerobotImage/EditorFilerobotImage.js | Introduced new class for managing image editing activities with lifecycle methods. |
blocks/SourceBtn/SourceBtn.js | Replaced UploaderBlock.sourceTypes with UploadSource for defining source types. |
blocks/UrlSource/UrlSource.js | Updated addFileFromUrl method to use UploadSource.URL instead of UploadSource.URL_TAB . |
blocks/utils/UploadSource.js | Added ExternalUploadSource and new properties URL and DRAW to UploadSource , and defined SourceTypes typedef. |
index.js | Exported new entities UploadSource and ExternalUploadSource from blocks/utils/UploadSource.js . |
build-ssr-stubs.js | Added handling for object types in stubbedExports , converting them to JSON strings. |
sequenceDiagram
participant User
participant UploaderPublicApi
participant FileItem
User->>UploaderPublicApi: Initiate upload
UploaderPublicApi->>FileItem: Create FileItem with entry
FileItem->>entry: Retrieve source value
FileItem-->>UploaderPublicApi: Return FileItem with source
UploaderPublicApi-->>User: Upload result with source
π In the meadow, a change did bloom,
A newsource
to dispel the gloom.
With every upload, a tale to tell,
Of where it came from, all is well!
Hopping with joy, we celebrate,
Data enriched, oh, isnβt it great? π
Description
Checklist
Summary by CodeRabbit
New Features
source
property to enhance the upload entry information in the Uploader API.source
property for better tracking and categorization.source
property in the FileItem class to capture additional file-related information during uploads.getList
method in the UploaderBlock class for easier access to predefined source types.EditorFilerobotImage
class for managing image editing activities.ExternalUploadSource
constant for better organization.UploadSource
andExternalUploadSource
for enhanced module functionality.Bug Fixes
Documentation
SourceTypes
type and updating theOutputFileEntry
structure.