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

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.9
7
7
  */
8
8
 
9
9
  import * as EFFECTS from '@galacean/effects';
@@ -60834,6 +60834,19 @@ var PageDataUtils = /*#__PURE__*/ function() {
60834
60834
  }).call(this);
60835
60835
  };
60836
60836
  /**
60837
+ * @description 设置元素extension字段
60838
+ */ _proto.setItemExtension = function setItemExtension(itemId, extension) {
60839
+ var item = this.getSDKItem(itemId);
60840
+ if (!item) {
60841
+ console.warn('setItemExtension: item not found');
60842
+ return;
60843
+ }
60844
+ for(var _iterator = _create_for_of_iterator_helper_loose(Object.entries(extension)), _step; !(_step = _iterator()).done;){
60845
+ var _step_value = _step.value, key = _step_value[0], value = _step_value[1];
60846
+ item.extension.set(key, value);
60847
+ }
60848
+ };
60849
+ /**
60837
60850
  * @description 场景 1: 设置单个元素的单个属性
60838
60851
  */ _proto.setSingleItemSingleProperty = function setSingleItemSingleProperty(param) {
60839
60852
  return _async_to_generator(function() {
@@ -62584,6 +62597,10 @@ var PageDataUtils = /*#__PURE__*/ function() {
62584
62597
  }
62585
62598
  break;
62586
62599
  }
62600
+ case 'cardType':
62601
+ {
62602
+ break;
62603
+ }
62587
62604
  default:
62588
62605
  {
62589
62606
  console.warn("Target property " + propertyName + " can not be changed.");
@@ -65656,7 +65673,7 @@ var PageDataUtils = /*#__PURE__*/ function() {
65656
65673
  _this = this;
65657
65674
  changeProeprty = function changeProeprty(targetCreateInfo) {
65658
65675
  return _async_to_generator(function() {
65659
- var currentCreateInfo;
65676
+ var currentCreateInfo, itemId;
65660
65677
  return _ts_generator(this, function(_state) {
65661
65678
  switch(_state.label){
65662
65679
  case 0:
@@ -65667,16 +65684,20 @@ var PageDataUtils = /*#__PURE__*/ function() {
65667
65684
  2
65668
65685
  ];
65669
65686
  }
65687
+ itemId = targetCreateInfo.id;
65670
65688
  return [
65671
65689
  4,
65672
65690
  this.setItemProperty({
65673
- itemId: currentCreateInfo.id,
65691
+ itemId: itemId,
65674
65692
  type: currentCreateInfo.type,
65675
65693
  property: targetCreateInfo.property
65676
65694
  })
65677
65695
  ];
65678
65696
  case 1:
65679
65697
  _state.sent();
65698
+ if (targetCreateInfo.extension) {
65699
+ this.setItemExtension(itemId, targetCreateInfo.extension);
65700
+ }
65680
65701
  return [
65681
65702
  2
65682
65703
  ];
@@ -92554,6 +92575,9 @@ var HTMLOverlayManager = /*#__PURE__*/ function() {
92554
92575
  };
92555
92576
  _proto.syncActiveContentInteraction = function syncActiveContentInteraction(event) {
92556
92577
  var decision = this.resolveHTMLInteractionTarget(event);
92578
+ if (decision.kind === 'canvas' && this.shouldKeepActiveContentInteractionForFocusedElement()) {
92579
+ return;
92580
+ }
92557
92581
  this.setActiveContentInteraction(decision.kind === 'html' ? decision.interaction : undefined);
92558
92582
  };
92559
92583
  _proto.scheduleActiveContentInteractionSync = function scheduleActiveContentInteractionSync(event) {
@@ -92593,6 +92617,18 @@ var HTMLOverlayManager = /*#__PURE__*/ function() {
92593
92617
  _this.syncContentInteraction(id);
92594
92618
  });
92595
92619
  };
92620
+ _proto.shouldKeepActiveContentInteractionForFocusedElement = function shouldKeepActiveContentInteractionForFocusedElement() {
92621
+ var activeInteraction = this.state.activeContentInteraction;
92622
+ if (!activeInteraction || typeof document === 'undefined') {
92623
+ return false;
92624
+ }
92625
+ var activeElement = document.activeElement;
92626
+ if (!activeElement || activeElement === document.body) {
92627
+ return false;
92628
+ }
92629
+ var interactionElement = activeInteraction.element;
92630
+ return interactionElement === activeElement || typeof interactionElement.contains === 'function' && interactionElement.contains(activeElement);
92631
+ };
92596
92632
  _proto.resolveHTMLInteractionTarget = function resolveHTMLInteractionTarget(event) {
92597
92633
  var id = this.getHTMLCardIdByEvent(event);
92598
92634
  if (!id || this.isEditableCard(id)) {