@meta2d/core 1.0.61 → 1.0.62
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/package.json +1 -1
- package/src/canvas/canvas.d.ts +0 -1
- package/src/canvas/canvas.js +24 -20
- package/src/canvas/canvas.js.map +1 -1
- package/src/core.d.ts +1 -1
- package/src/core.js +10 -2
- package/src/core.js.map +1 -1
- package/src/pen/model.d.ts +7 -0
- package/src/pen/model.js.map +1 -1
- package/src/pen/render.d.ts +1 -0
- package/src/pen/render.js +40 -2
- package/src/pen/render.js.map +1 -1
package/package.json
CHANGED
package/src/canvas/canvas.d.ts
CHANGED
package/src/canvas/canvas.js
CHANGED
|
@@ -94,7 +94,7 @@ export class Canvas {
|
|
|
94
94
|
inputParent = document.createElement('div');
|
|
95
95
|
// input = document.createElement('textarea');
|
|
96
96
|
inputDiv = document.createElement('div');
|
|
97
|
-
inputRight = document.createElement('div');
|
|
97
|
+
// inputRight = document.createElement('div');
|
|
98
98
|
dropdown = document.createElement('ul');
|
|
99
99
|
tooltip;
|
|
100
100
|
title;
|
|
@@ -126,13 +126,13 @@ export class Canvas {
|
|
|
126
126
|
this.canvasImage = new CanvasImage(parentElement, store);
|
|
127
127
|
this.canvasImage.canvas.style.zIndex = '4';
|
|
128
128
|
this.magnifierCanvas = new MagnifierCanvas(this, parentElement, store);
|
|
129
|
-
this.magnifierCanvas.canvas.style.zIndex = '
|
|
129
|
+
this.magnifierCanvas.canvas.style.zIndex = '5';
|
|
130
130
|
this.externalElements.style.position = 'absolute';
|
|
131
131
|
this.externalElements.style.left = '0';
|
|
132
132
|
this.externalElements.style.top = '0';
|
|
133
133
|
this.externalElements.style.outline = 'none';
|
|
134
134
|
this.externalElements.style.background = 'transparent';
|
|
135
|
-
this.externalElements.style.zIndex = '
|
|
135
|
+
this.externalElements.style.zIndex = '5';
|
|
136
136
|
parentElement.style.position = 'relative';
|
|
137
137
|
parentElement.appendChild(this.externalElements);
|
|
138
138
|
this.createInput();
|
|
@@ -6149,15 +6149,15 @@ export class Canvas {
|
|
|
6149
6149
|
this.inputDiv.contentEditable =
|
|
6150
6150
|
pen.disableInput == undefined ? 'true' : pen.disableInput.toString();
|
|
6151
6151
|
if (pen.dropdownList && this.dropdown.style.display !== 'block') {
|
|
6152
|
-
if (!this.store.data.locked) {
|
|
6153
|
-
|
|
6154
|
-
}
|
|
6152
|
+
// if (!this.store.data.locked) {
|
|
6153
|
+
// this.inputRight.style.display = 'none';
|
|
6154
|
+
// }
|
|
6155
6155
|
this.dropdown.style.background = pen.dropdownBackground || '#fff';
|
|
6156
6156
|
this.dropdown.style.color = pen.dropdownColor || '#bdc7db';
|
|
6157
6157
|
this.setDropdownList();
|
|
6158
6158
|
}
|
|
6159
6159
|
else {
|
|
6160
|
-
this.inputRight.style.display = 'none';
|
|
6160
|
+
// this.inputRight.style.display = 'none';
|
|
6161
6161
|
}
|
|
6162
6162
|
this.inputDiv.contentEditable = 'true';
|
|
6163
6163
|
this.inputDiv.focus();
|
|
@@ -6385,10 +6385,10 @@ export class Canvas {
|
|
|
6385
6385
|
};
|
|
6386
6386
|
createInput() {
|
|
6387
6387
|
this.inputParent.classList.add('meta2d-input');
|
|
6388
|
-
this.inputRight.classList.add('right');
|
|
6388
|
+
// this.inputRight.classList.add('right');
|
|
6389
6389
|
this.inputDiv.classList.add('input-div');
|
|
6390
6390
|
this.inputParent.appendChild(this.inputDiv);
|
|
6391
|
-
this.inputParent.appendChild(this.inputRight);
|
|
6391
|
+
// this.inputParent.appendChild(this.inputRight);
|
|
6392
6392
|
this.dropdown.onmouseleave = () => {
|
|
6393
6393
|
this.store.hover = null;
|
|
6394
6394
|
};
|
|
@@ -6397,9 +6397,9 @@ export class Canvas {
|
|
|
6397
6397
|
this.inputParent.onmousedown = this.stopPropagation;
|
|
6398
6398
|
this.inputDiv.onmousedown = this.stopPropagation;
|
|
6399
6399
|
this.inputDiv.contentEditable = 'false';
|
|
6400
|
-
this.inputRight.onmousedown = this.stopPropagation;
|
|
6400
|
+
// this.inputRight.onmousedown = this.stopPropagation;
|
|
6401
6401
|
this.dropdown.onmousedown = this.stopPropagation;
|
|
6402
|
-
this.inputRight.style.transform = 'rotate(135deg)';
|
|
6402
|
+
// this.inputRight.style.transform = 'rotate(135deg)';
|
|
6403
6403
|
let sheet;
|
|
6404
6404
|
for (let i = 0; i < document.styleSheets.length; i++) {
|
|
6405
6405
|
if (document.styleSheets[i].title === 'le5le.com') {
|
|
@@ -6493,11 +6493,11 @@ export class Canvas {
|
|
|
6493
6493
|
const pen = this.store.pens[this.inputDiv.dataset.penId];
|
|
6494
6494
|
if (this.dropdown.style.display === 'block') {
|
|
6495
6495
|
this.dropdown.style.display = 'none';
|
|
6496
|
-
this.inputRight.style.transform = 'rotate(135deg)';
|
|
6496
|
+
// this.inputRight.style.transform = 'rotate(135deg)';
|
|
6497
6497
|
}
|
|
6498
6498
|
else if (pen?.dropdownList && this.store.data.locked) {
|
|
6499
6499
|
this.dropdown.style.display = 'block';
|
|
6500
|
-
this.inputRight.style.transform = 'rotate(315deg)';
|
|
6500
|
+
// this.inputRight.style.transform = 'rotate(315deg)';
|
|
6501
6501
|
}
|
|
6502
6502
|
this.store.emitter.emit('clickInput', pen);
|
|
6503
6503
|
};
|
|
@@ -6538,15 +6538,15 @@ export class Canvas {
|
|
|
6538
6538
|
return;
|
|
6539
6539
|
}
|
|
6540
6540
|
this.dropdown.style.display = 'block';
|
|
6541
|
-
this.inputRight.style.display = 'block';
|
|
6542
|
-
setTimeout(() => {
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
});
|
|
6541
|
+
// this.inputRight.style.display = 'block';
|
|
6542
|
+
// setTimeout(() => {
|
|
6543
|
+
// this.inputRight.style.transform = 'rotate(315deg)';
|
|
6544
|
+
// (this.inputRight.style as any).zoom = this.store.data.scale;
|
|
6545
|
+
// });
|
|
6546
6546
|
if (!pen || !pen.dropdownList) {
|
|
6547
6547
|
this.dropdown.style.display = 'none';
|
|
6548
|
-
this.inputRight.style.display = 'none';
|
|
6549
|
-
this.inputRight.style.transform = 'rotate(135deg)';
|
|
6548
|
+
// this.inputRight.style.display = 'none';
|
|
6549
|
+
// this.inputRight.style.transform = 'rotate(135deg)';
|
|
6550
6550
|
return;
|
|
6551
6551
|
}
|
|
6552
6552
|
if (!pen.dropdownList.length) {
|
|
@@ -7221,12 +7221,16 @@ export class Canvas {
|
|
|
7221
7221
|
this.render();
|
|
7222
7222
|
}
|
|
7223
7223
|
showMagnifier() {
|
|
7224
|
+
this.magnifierCanvas.canvas.style.zIndex = '100';
|
|
7225
|
+
this.externalElements.style.zIndex = '101';
|
|
7224
7226
|
this.magnifierCanvas.magnifier = true;
|
|
7225
7227
|
this.magnifierCanvas.updateDomOffscreen();
|
|
7226
7228
|
this.externalElements.style.cursor = 'default';
|
|
7227
7229
|
this.render();
|
|
7228
7230
|
}
|
|
7229
7231
|
hideMagnifier() {
|
|
7232
|
+
this.magnifierCanvas.canvas.style.zIndex = '5';
|
|
7233
|
+
this.externalElements.style.zIndex = '5';
|
|
7230
7234
|
this.magnifierCanvas.magnifier = false;
|
|
7231
7235
|
this.externalElements.style.cursor = 'default';
|
|
7232
7236
|
this.render();
|