@uppy/dashboard
Advanced tools
Comparing version 3.7.3 to 3.7.4
# @uppy/dashboard | ||
## 3.7.4 | ||
Released: 2024-02-22 | ||
Included in: Uppy v3.22.2 | ||
- @uppy/dashboard: MetaEditor + ImageEditor - new state machine logic (Evgenia Karunus / #4939) | ||
## 3.7.3 | ||
@@ -4,0 +11,0 @@ |
@@ -7,3 +7,3 @@ import { h } from 'preact'; | ||
props.uppy.emit('file-editor:cancel', file); | ||
props.hideAllPanels(); | ||
props.closeFileEditor(); | ||
}; | ||
@@ -10,0 +10,0 @@ return h("div", { |
@@ -18,3 +18,3 @@ function _classPrivateFieldLooseBase(receiver, privateKey) { if (!Object.prototype.hasOwnProperty.call(receiver, privateKey)) { throw new TypeError("attempted to use private field on non-instance"); } return receiver; } | ||
const packageJson = { | ||
"version": "3.7.3" | ||
"version": "3.7.4" | ||
}; | ||
@@ -137,2 +137,20 @@ import locale from './locale.js'; | ||
}; | ||
this.closeFileEditor = () => { | ||
const { | ||
metaFields | ||
} = this.getPluginState(); | ||
const isMetaEditorEnabled = metaFields && metaFields.length > 0; | ||
if (isMetaEditorEnabled) { | ||
this.setPluginState({ | ||
showFileEditor: false, | ||
activeOverlayType: 'FileCard' | ||
}); | ||
} else { | ||
this.setPluginState({ | ||
showFileEditor: false, | ||
fileCardFor: null, | ||
activeOverlayType: 'AddFiles' | ||
}); | ||
} | ||
}; | ||
this.saveFileEditor = () => { | ||
@@ -146,3 +164,3 @@ const { | ||
}); | ||
this.hideAllPanels(); | ||
this.closeFileEditor(); | ||
}; | ||
@@ -636,3 +654,10 @@ this.openModal = () => { | ||
const firstFile = files[0]; | ||
if (this.canEditFile(firstFile)) { | ||
const { | ||
metaFields | ||
} = this.getPluginState(); | ||
const isMetaEditorEnabled = metaFields && metaFields.length > 0; | ||
const isFileEditorEnabled = this.canEditFile(firstFile); | ||
if (isMetaEditorEnabled) { | ||
this.toggleFileCard(true, firstFile.id); | ||
} else if (isFileEditorEnabled) { | ||
this.openFileEditor(firstFile); | ||
@@ -658,3 +683,2 @@ } | ||
this.uppy.on('dashboard:modal-closed', this.hideAllPanels); | ||
this.uppy.on('file-editor:complete', this.hideAllPanels); | ||
this.uppy.on('complete', this.handleComplete); | ||
@@ -687,3 +711,2 @@ this.uppy.on('files-added', _classPrivateFieldLooseBase(this, _generateLargeThumbnailIfSingleFile)[_generateLargeThumbnailIfSingleFile]); | ||
this.uppy.off('dashboard:modal-closed', this.hideAllPanels); | ||
this.uppy.off('file-editor:complete', this.hideAllPanels); | ||
this.uppy.off('complete', this.handleComplete); | ||
@@ -844,2 +867,3 @@ this.uppy.off('files-added', _classPrivateFieldLooseBase(this, _generateLargeThumbnailIfSingleFile)[_generateLargeThumbnailIfSingleFile]); | ||
saveFileEditor: this.saveFileEditor, | ||
closeFileEditor: this.closeFileEditor, | ||
disableInteractiveElements: this.disableInteractiveElements, | ||
@@ -846,0 +870,0 @@ animateOpenClose: this.opts.animateOpenClose, |
{ | ||
"name": "@uppy/dashboard", | ||
"description": "Universal UI plugin for Uppy.", | ||
"version": "3.7.3", | ||
"version": "3.7.4", | ||
"license": "MIT", | ||
@@ -29,5 +29,5 @@ "main": "lib/index.js", | ||
"@uppy/provider-views": "^3.9.1", | ||
"@uppy/status-bar": "^3.2.7", | ||
"@uppy/status-bar": "^3.2.8", | ||
"@uppy/thumbnail-generator": "^3.0.8", | ||
"@uppy/utils": "^5.7.2", | ||
"@uppy/utils": "^5.7.3", | ||
"classnames": "^2.2.6", | ||
@@ -42,3 +42,3 @@ "is-shallow-equal": "^1.0.1", | ||
"@uppy/google-drive": "^3.4.0", | ||
"@uppy/status-bar": "^3.2.7", | ||
"@uppy/status-bar": "^3.2.8", | ||
"@uppy/url": "^3.5.0", | ||
@@ -50,4 +50,4 @@ "@uppy/webcam": "^3.3.6", | ||
"peerDependencies": { | ||
"@uppy/core": "^3.9.1" | ||
"@uppy/core": "^3.9.2" | ||
} | ||
} |
@@ -9,3 +9,3 @@ import { h } from 'preact' | ||
props.uppy.emit('file-editor:cancel', file) | ||
props.hideAllPanels() | ||
props.closeFileEditor() | ||
} | ||
@@ -12,0 +12,0 @@ |
@@ -211,2 +211,20 @@ import { UIPlugin } from '@uppy/core' | ||
closeFileEditor = () => { | ||
const { metaFields } = this.getPluginState() | ||
const isMetaEditorEnabled = metaFields && metaFields.length > 0 | ||
if (isMetaEditorEnabled) { | ||
this.setPluginState({ | ||
showFileEditor: false, | ||
activeOverlayType: 'FileCard' | ||
}) | ||
} else { | ||
this.setPluginState({ | ||
showFileEditor: false, | ||
fileCardFor: null, | ||
activeOverlayType: 'AddFiles' | ||
}) | ||
} | ||
} | ||
saveFileEditor = () => { | ||
@@ -220,3 +238,3 @@ const { targets } = this.getPluginState() | ||
this.hideAllPanels() | ||
this.closeFileEditor() | ||
} | ||
@@ -735,3 +753,10 @@ | ||
const firstFile = files[0] | ||
if (this.canEditFile(firstFile)) { | ||
const {metaFields} = this.getPluginState() | ||
const isMetaEditorEnabled = metaFields && metaFields.length > 0 | ||
const isFileEditorEnabled = this.canEditFile(firstFile) | ||
if (isMetaEditorEnabled) { | ||
this.toggleFileCard(true, firstFile.id) | ||
} else if (isFileEditorEnabled) { | ||
this.openFileEditor(firstFile) | ||
@@ -759,3 +784,2 @@ } | ||
this.uppy.on('dashboard:modal-closed', this.hideAllPanels) | ||
this.uppy.on('file-editor:complete', this.hideAllPanels) | ||
this.uppy.on('complete', this.handleComplete) | ||
@@ -794,3 +818,2 @@ | ||
this.uppy.off('dashboard:modal-closed', this.hideAllPanels) | ||
this.uppy.off('file-editor:complete', this.hideAllPanels) | ||
this.uppy.off('complete', this.handleComplete) | ||
@@ -962,2 +985,3 @@ | ||
saveFileEditor: this.saveFileEditor, | ||
closeFileEditor: this.closeFileEditor, | ||
disableInteractiveElements: this.disableInteractiveElements, | ||
@@ -964,0 +988,0 @@ animateOpenClose: this.opts.animateOpenClose, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
689639
9836
Updated@uppy/status-bar@^3.2.8
Updated@uppy/utils@^5.7.3