From 2abe55f0b6d1ae4f46dc895fdf00646d81a11011 Mon Sep 17 00:00:00 2001 From: nd0ut Date: Wed, 14 Feb 2024 01:14:24 +0300 Subject: [PATCH 1/2] fix(cloud-image-editor): disable image enter transition --- blocks/CloudImageEditor/src/css/common.css | 1 - 1 file changed, 1 deletion(-) diff --git a/blocks/CloudImageEditor/src/css/common.css b/blocks/CloudImageEditor/src/css/common.css index 6e80dd82d..60e68c0d7 100644 --- a/blocks/CloudImageEditor/src/css/common.css +++ b/blocks/CloudImageEditor/src/css/common.css @@ -140,7 +140,6 @@ height: 100%; overflow: hidden; overflow-y: auto; - transition: 0.3s; } @media only screen and (max-width: 800px) { From c264c6494f88cb1307ac83f5e811da8ac334a54b Mon Sep 17 00:00:00 2001 From: nd0ut Date: Wed, 14 Feb 2024 01:15:49 +0300 Subject: [PATCH 2/2] fix(cloud-image-editor): weird ui glitches when updating `cdnUrl` on change --- .../src/CloudImageEditorBlock.js | 33 +++++++++++-------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/blocks/CloudImageEditor/src/CloudImageEditorBlock.js b/blocks/CloudImageEditor/src/CloudImageEditorBlock.js index 71214480d..071303d76 100644 --- a/blocks/CloudImageEditor/src/CloudImageEditorBlock.js +++ b/blocks/CloudImageEditor/src/CloudImageEditorBlock.js @@ -84,26 +84,33 @@ export class CloudImageEditorBlock extends CloudImageEditorBase { } await this._waitForSize(); - if (this.$['*tabId'] === TabId.CROP) { - this.$['*cropperEl'].deactivate({ reset: true }); - } else { - this.$['*faderEl'].deactivate(); - } - - this.$['*editorTransformations'] = {}; - if (this.$.cdnUrl) { - let uuid = extractUuid(this.$.cdnUrl); - this.$['*originalUrl'] = createOriginalUrl(this.$.cdnUrl, uuid); - let operations = extractOperations(this.$.cdnUrl); - let transformations = operationsToTransformations(operations); + const uuid = extractUuid(this.$.cdnUrl); + const originalUrl = createOriginalUrl(this.$.cdnUrl, uuid); + if (originalUrl === this.$['*originalUrl']) { + return; + } + this.$['*originalUrl'] = originalUrl; + const operations = extractOperations(this.$.cdnUrl); + const transformations = operationsToTransformations(operations); this.$['*editorTransformations'] = transformations; } else if (this.$.uuid) { - this.$['*originalUrl'] = createOriginalUrl(this.cfg.cdnCname, this.$.uuid); + const originalUrl = createOriginalUrl(this.cfg.cdnCname, this.$.uuid); + if (originalUrl === this.$['*originalUrl']) { + return; + } + this.$['*originalUrl'] = originalUrl; + this.$['*editorTransformations'] = {}; } else { throw new Error('No UUID nor CDN URL provided'); } + if (this.$['*tabId'] === TabId.CROP) { + this.$['*cropperEl'].deactivate({ reset: true }); + } else { + this.$['*faderEl'].deactivate(); + } + try { const cdnUrl = createCdnUrl(this.$['*originalUrl'], createCdnUrlModifiers('json')); const json = await fetch(cdnUrl).then((response) => response.json());