@easy-editor/core 0.0.9 → 0.0.10

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.
@@ -74,8 +74,9 @@ export declare class Dragon {
74
74
  * boost your dragObject for dragging(flying)
75
75
  * @param dragObject drag object
76
76
  * @param boostEvent drag start event
77
+ * @param shell shell element(which trigger the boost)
77
78
  */
78
- boost(dragObject: DragObject, boostEvent: MouseEvent | DragEvent): void;
79
+ boost(dragObject: DragObject, boostEvent: MouseEvent | DragEvent, shell?: HTMLElement): void;
79
80
  /**
80
81
  * get master sensors(opened documents)
81
82
  */
@@ -92,7 +93,13 @@ export declare class Dragon {
92
93
  * 移除投放感应
93
94
  */
94
95
  removeSensor(sensor: Sensor): void;
95
- onDragstart(func: (e: LocateEvent) => void): () => void;
96
+ onDragstart(func: (e: LocateEvent & {
97
+ /**
98
+ * 触发拖拽的元素
99
+ * @description 目前用于 Snippet
100
+ */
101
+ shell?: HTMLElement;
102
+ }) => void): () => void;
96
103
  onDrag(func: (e: LocateEvent) => void): () => void;
97
104
  onDragend(func: (e: {
98
105
  dragObject: DragObject;
@@ -114,6 +114,7 @@ export declare class Node<Schema extends NodeSchema = NodeSchema> {
114
114
  setPropValue(path: string, value: PropValue): void;
115
115
  getExtraPropValue(key: string): unknown;
116
116
  setExtraPropValue(key: string, value: PropValue): void;
117
+ clearExtraPropValue(key: string): void;
117
118
  clearPropValue(path: string): void;
118
119
  mergeProps(props: PropsMap): void;
119
120
  setProps(props?: PropsMap | Props | null): void;
@@ -7328,6 +7328,9 @@ let Node$1 = class Node {
7328
7328
  setExtraPropValue(key, value) {
7329
7329
  this.setPropValue(getConvertedExtraKey(key), value);
7330
7330
  }
7331
+ clearExtraPropValue(key) {
7332
+ this.getProp(getConvertedExtraKey(key), false)?.unset();
7333
+ }
7331
7334
  clearPropValue(path) {
7332
7335
  this.getProp(path, false)?.unset();
7333
7336
  }
@@ -9023,7 +9026,7 @@ class Dragon {
9023
9026
  if (!dragObject) {
9024
9027
  return;
9025
9028
  }
9026
- this.boost(dragObject, e);
9029
+ this.boost(dragObject, e, shell);
9027
9030
  };
9028
9031
  if (eventType === 'drag') {
9029
9032
  shell.draggable = true;
@@ -9039,7 +9042,7 @@ class Dragon {
9039
9042
  };
9040
9043
  }
9041
9044
  }
9042
- boost(dragObject, boostEvent) {
9045
+ boost(dragObject, boostEvent, shell) {
9043
9046
  const {
9044
9047
  designer
9045
9048
  } = this;
@@ -9087,7 +9090,10 @@ class Dragon {
9087
9090
  doc.addEventListener('keydown', checkEsc, false);
9088
9091
  });
9089
9092
  }
9090
- this.emitter.emit(DRAGON_EVENT.DRAGSTART, locateEvent);
9093
+ this.emitter.emit(DRAGON_EVENT.DRAGSTART, {
9094
+ ...locateEvent,
9095
+ shell
9096
+ });
9091
9097
  };
9092
9098
  const move = e => {
9093
9099
  if (isBoostFromDragAPI) {