@uploadcare/blocks
Advanced tools
Comparing version 0.15.0-alpha.2 to 0.15.0-alpha.3
@@ -49,2 +49,7 @@ export class Block extends BaseComponent<any> { | ||
setForCtxTarget(consumerScope: string, prop: string, newVal: any): void; | ||
/** | ||
* @param {String} consumerScope | ||
* @param {String} prop | ||
*/ | ||
getForCtxTarget(consumerScope: string, prop: string): any; | ||
/** @param {String} activityType */ | ||
@@ -51,0 +56,0 @@ setActivity(activityType: string): void; |
@@ -104,2 +104,11 @@ import { BaseComponent, Data } from '@symbiotejs/symbiote'; | ||
} | ||
/** | ||
* @param {String} consumerScope | ||
* @param {String} prop | ||
*/ | ||
getForCtxTarget(consumerScope, prop) { | ||
if (this.findBlockInCtx((b) => /** @type {typeof Block} */ (b.constructor).StateConsumerScope === consumerScope)) { | ||
return this.$[prop]; | ||
} | ||
} | ||
@@ -106,0 +115,0 @@ /** @param {String} activityType */ |
@@ -6,2 +6,3 @@ export class DropArea extends UploaderBlock { | ||
isClickable: boolean; | ||
isFullscreen: boolean; | ||
text: string; | ||
@@ -18,3 +19,3 @@ '*commonProgress': number; | ||
'*closeModal': () => void; | ||
'*blocksRegistry': Set<import("../../index.js").Block>; | ||
'*blocksRegistry': Set<Block>; | ||
}; | ||
@@ -29,2 +30,3 @@ /** @private */ | ||
import { UploaderBlock } from "../../abstract/UploaderBlock.js"; | ||
import { Block } from "../../abstract/Block.js"; | ||
//# sourceMappingURL=DropArea.d.ts.map |
@@ -6,2 +6,3 @@ import { UploaderBlock } from '../../abstract/UploaderBlock.js'; | ||
import { Modal } from '../Modal/Modal.js'; | ||
import { Block } from '../../abstract/Block.js'; | ||
@@ -14,2 +15,3 @@ export class DropArea extends UploaderBlock { | ||
isClickable: false, | ||
isFullscreen: false, | ||
text: this.l10n('drop-files-here'), | ||
@@ -26,2 +28,6 @@ }; | ||
}); | ||
this.defineAccessor('fullscreen', (value) => { | ||
this.set$({ isFullscreen: typeof value === 'string' }); | ||
}); | ||
this.defineAccessor('text', (value) => { | ||
@@ -39,2 +45,6 @@ if (value) { | ||
onChange: (state) => { | ||
if (this.$.isFullscreen && this.getForCtxTarget(Modal.StateConsumerScope, '*modalActive')) { | ||
return; | ||
} | ||
this.$.state = state; | ||
@@ -117,2 +127,3 @@ }, | ||
text: null, | ||
fullscreen: null, | ||
}); |
@@ -241,3 +241,2 @@ import { UploaderBlock } from '../../abstract/UploaderBlock.js'; | ||
this._subEntry('isImage', (isImage) => { | ||
this.$.isEditable = isImage; | ||
let imagesOnly = this.getCssData('--cfg-img-only'); | ||
@@ -294,2 +293,3 @@ if (entry.getValue('externalUrl') && !entry.getValue('uuid') && imagesOnly && !isImage) { | ||
progressVisible: state === FileItemState.UPLOADING, | ||
isEditable: state === FileItemState.FINISHED && this._entry?.getValue('isImage'), | ||
}); | ||
@@ -398,5 +398,2 @@ | ||
}); | ||
if (entry === this._entry) { | ||
this._debouncedCalculateState(); | ||
} | ||
entry.setMultipleValues({ | ||
@@ -412,6 +409,12 @@ fileInfo, | ||
}); | ||
if (entry === this._entry) { | ||
this._debouncedCalculateState(); | ||
} | ||
} catch (error) { | ||
entry.setValue('abortController', null); | ||
entry.setValue('isUploading', false); | ||
entry.setValue('uploadProgress', 0); | ||
entry.setMultipleValues({ | ||
abortController: null, | ||
isUploading: false, | ||
uploadProgress: 0, | ||
}); | ||
@@ -418,0 +421,0 @@ if (entry === this._entry) { |
{ | ||
"name": "@uploadcare/blocks", | ||
"version": "0.15.0-alpha.2", | ||
"version": "0.15.0-alpha.3", | ||
"description": "Building blocks for Uploadcare products integration", | ||
@@ -107,8 +107,8 @@ "keywords": [ | ||
"shipjs": "^0.24.4", | ||
"stylelint": "^14.7.1", | ||
"stylelint-config-prettier": "^9.0.3", | ||
"stylelint": "^14.16.1", | ||
"stylelint-config-prettier": "^9.0.4", | ||
"stylelint-config-rational-order": "^0.1.2", | ||
"stylelint-config-standard": "^25.0.0", | ||
"stylelint-declaration-block-no-ignored-properties": "^2.5.0", | ||
"stylelint-order": "^5.0.0", | ||
"stylelint-config-standard": "^29.0.0", | ||
"stylelint-declaration-block-no-ignored-properties": "^2.6.0", | ||
"stylelint-order": "^6.0.1", | ||
"typescript": "^4.8.2" | ||
@@ -115,0 +115,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
1730981
17400