@hailin-zheng/editor-core 1.1.12 → 1.1.13
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.
- package/controls/SurfaceView.d.ts +1 -1
- package/index-cjs.js +16 -7
- package/index-cjs.js.map +1 -1
- package/index.js +16 -7
- package/index.js.map +1 -1
- package/package.json +1 -1
@@ -36,7 +36,7 @@ export declare class SurfaceView extends NodeItems {
|
|
36
36
|
invokeInput(data: string): void;
|
37
37
|
invokeKeydown(evt: KeyboardEvent): void;
|
38
38
|
setInputPosition({ x, y, height }: Omit<Rect, 'width'>): void;
|
39
|
-
|
39
|
+
setInputFocus(state?: boolean): void;
|
40
40
|
hiddenInput(): void;
|
41
41
|
endInput(): void;
|
42
42
|
}
|
package/index-cjs.js
CHANGED
@@ -16972,6 +16972,9 @@ class ElementTrackManage {
|
|
16972
16972
|
* 执行撤销
|
16973
16973
|
*/
|
16974
16974
|
undo() {
|
16975
|
+
if (!this.canUndo) {
|
16976
|
+
return;
|
16977
|
+
}
|
16975
16978
|
suppressTracking(() => {
|
16976
16979
|
this.index--;
|
16977
16980
|
this.executeCommand('undo');
|
@@ -16993,6 +16996,9 @@ class ElementTrackManage {
|
|
16993
16996
|
* 执行重做
|
16994
16997
|
*/
|
16995
16998
|
redo() {
|
16999
|
+
if (!this.canRedo) {
|
17000
|
+
return;
|
17001
|
+
}
|
16996
17002
|
suppressTracking(() => {
|
16997
17003
|
this.executeCommand('redo');
|
16998
17004
|
this.index++;
|
@@ -18167,15 +18173,15 @@ class NodeEvent {
|
|
18167
18173
|
canvas.addEventListener('wheel', evt => {
|
18168
18174
|
this.setActiveAppContext(() => this.onWheelHandler(evt));
|
18169
18175
|
});
|
18176
|
+
canvas.addEventListener('click', evt => {
|
18177
|
+
this.root.setInputFocus(true);
|
18178
|
+
});
|
18170
18179
|
canvas.addEventListener('dblclick', evt => {
|
18171
18180
|
this.setActiveAppContext(() => this.onDblClickHandler(evt));
|
18172
18181
|
});
|
18173
18182
|
canvas.addEventListener('contextmenu', evt => {
|
18174
18183
|
this.setActiveAppContext(() => this.onContextMenuHandler(evt));
|
18175
18184
|
});
|
18176
|
-
canvas.addEventListener('keydown', evt => {
|
18177
|
-
this.setActiveAppContext(() => this.onKeydownHandler(evt));
|
18178
|
-
});
|
18179
18185
|
this.root.addEventListener('preGotFocus', (evt) => {
|
18180
18186
|
this.invokeNodeFocusedEvent(this.prevNode, this.prevFocusNodes, evt.source);
|
18181
18187
|
}, true);
|
@@ -19045,6 +19051,7 @@ class SurfaceView extends NodeItems {
|
|
19045
19051
|
this.invokeKeydown(evt);
|
19046
19052
|
});
|
19047
19053
|
this.input.addEventListener('copy', evt => {
|
19054
|
+
console.log('copy了');
|
19048
19055
|
this.invokeClipboardEvent(evt, 'copy');
|
19049
19056
|
});
|
19050
19057
|
this.input.addEventListener('paste', evt => {
|
@@ -19103,6 +19110,7 @@ class SurfaceView extends NodeItems {
|
|
19103
19110
|
return;
|
19104
19111
|
}
|
19105
19112
|
this.input.style.display = '';
|
19113
|
+
this.input.readOnly = false;
|
19106
19114
|
const left = Math.floor(x) + 'px';
|
19107
19115
|
const top = Math.floor(y) + 'px';
|
19108
19116
|
if (left !== this.input.style.left || top !== this.input.style.top) {
|
@@ -19116,9 +19124,10 @@ class SurfaceView extends NodeItems {
|
|
19116
19124
|
state ? this.input.focus() : this.input.blur();
|
19117
19125
|
}
|
19118
19126
|
hiddenInput() {
|
19119
|
-
this.input.style.display = 'none';
|
19120
|
-
this.input.style.left = '
|
19121
|
-
this.input.style.top = '
|
19127
|
+
//this.input.style.display = 'none';
|
19128
|
+
this.input.style.left = '-2px';
|
19129
|
+
this.input.style.top = '-2px';
|
19130
|
+
this.input.readOnly = true;
|
19122
19131
|
}
|
19123
19132
|
endInput() {
|
19124
19133
|
}
|
@@ -20482,7 +20491,7 @@ class CanvasTextEditor extends AbsolutePanel {
|
|
20482
20491
|
*/
|
20483
20492
|
setCursor() {
|
20484
20493
|
const { startControl, startOffset } = this.selectionState;
|
20485
|
-
if (!this.canSetCursor()) {
|
20494
|
+
if (!this.canSetCursor() || !this.documentEvent.startHitInfo) {
|
20486
20495
|
this.selectionState.editable = false;
|
20487
20496
|
this.documentInput.setCursorVisibility(false);
|
20488
20497
|
return false;
|