@vvfx/sdk 0.2.2-beta.7 → 0.2.2-beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -81,6 +81,7 @@ export declare class HTMLOverlayManager {
81
81
  private syncActiveContentInteraction;
82
82
  private scheduleActiveContentInteractionSync;
83
83
  private setActiveContentInteraction;
84
+ private shouldKeepActiveContentInteractionForFocusedElement;
84
85
  private resolveHTMLInteractionTarget;
85
86
  private getActiveSubtreeInteractionAtEvent;
86
87
  private resolveContentInteractionZone;
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Description: TODO
4
4
  * Author: Ant Group CO., Ltd.
5
5
  * Contributors: 赤芍,何即,不择,意绮
6
- * Version: v0.2.2-beta.7
6
+ * Version: v0.2.2-beta.8
7
7
  */
8
8
 
9
9
  import * as EFFECTS from '@galacean/effects';
@@ -92554,6 +92554,9 @@ var HTMLOverlayManager = /*#__PURE__*/ function() {
92554
92554
  };
92555
92555
  _proto.syncActiveContentInteraction = function syncActiveContentInteraction(event) {
92556
92556
  var decision = this.resolveHTMLInteractionTarget(event);
92557
+ if (decision.kind === 'canvas' && this.shouldKeepActiveContentInteractionForFocusedElement()) {
92558
+ return;
92559
+ }
92557
92560
  this.setActiveContentInteraction(decision.kind === 'html' ? decision.interaction : undefined);
92558
92561
  };
92559
92562
  _proto.scheduleActiveContentInteractionSync = function scheduleActiveContentInteractionSync(event) {
@@ -92593,6 +92596,18 @@ var HTMLOverlayManager = /*#__PURE__*/ function() {
92593
92596
  _this.syncContentInteraction(id);
92594
92597
  });
92595
92598
  };
92599
+ _proto.shouldKeepActiveContentInteractionForFocusedElement = function shouldKeepActiveContentInteractionForFocusedElement() {
92600
+ var activeInteraction = this.state.activeContentInteraction;
92601
+ if (!activeInteraction || typeof document === 'undefined') {
92602
+ return false;
92603
+ }
92604
+ var activeElement = document.activeElement;
92605
+ if (!activeElement || activeElement === document.body) {
92606
+ return false;
92607
+ }
92608
+ var interactionElement = activeInteraction.element;
92609
+ return interactionElement === activeElement || typeof interactionElement.contains === 'function' && interactionElement.contains(activeElement);
92610
+ };
92596
92611
  _proto.resolveHTMLInteractionTarget = function resolveHTMLInteractionTarget(event) {
92597
92612
  var id = this.getHTMLCardIdByEvent(event);
92598
92613
  if (!id || this.isEditableCard(id)) {