@meta2d/core 1.0.64 → 1.0.65
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.js +16 -6
- package/src/canvas/canvas.js.map +1 -1
- package/src/core.d.ts +3 -2
- package/src/core.js +256 -207
- package/src/core.js.map +1 -1
- package/src/diagrams/video.js +1 -0
- package/src/diagrams/video.js.map +1 -1
- package/src/dialog/dialog.d.ts +9 -3
- package/src/dialog/dialog.js +79 -6
- package/src/dialog/dialog.js.map +1 -1
- package/src/pen/render.js +29 -11
- package/src/pen/render.js.map +1 -1
- package/src/utils/url.d.ts +3 -0
- package/src/utils/url.js +63 -0
- package/src/utils/url.js.map +1 -1
package/package.json
CHANGED
package/src/canvas/canvas.js
CHANGED
|
@@ -146,7 +146,7 @@ export class Canvas {
|
|
|
146
146
|
setHover(hover, false);
|
|
147
147
|
};
|
|
148
148
|
this.popconfirm = new Popconfirm(parentElement, store);
|
|
149
|
-
this.dialog = new Dialog(parentElement);
|
|
149
|
+
this.dialog = new Dialog(parentElement, store);
|
|
150
150
|
this.title = new Title(parentElement);
|
|
151
151
|
if (this.store.options.scroll) {
|
|
152
152
|
this.scroll = new Scroll(this);
|
|
@@ -366,7 +366,7 @@ export class Canvas {
|
|
|
366
366
|
}
|
|
367
367
|
let data = JSON.parse(e.data);
|
|
368
368
|
if (typeof data === 'object') {
|
|
369
|
-
this.parent.doMessageEvent(data.name, data.
|
|
369
|
+
this.parent.doMessageEvent(data.name, JSON.stringify(data.data));
|
|
370
370
|
}
|
|
371
371
|
else {
|
|
372
372
|
this.parent.doMessageEvent(data);
|
|
@@ -2208,7 +2208,12 @@ export class Canvas {
|
|
|
2208
2208
|
if (e.button !== 2) {
|
|
2209
2209
|
if (distance(this.mouseDown, e) < 2) {
|
|
2210
2210
|
if (this.store.hover && this.store.hover.input) {
|
|
2211
|
-
|
|
2211
|
+
if (this.store.hover.onShowInput) {
|
|
2212
|
+
this.store.hover.onShowInput(this.store.hover, e);
|
|
2213
|
+
}
|
|
2214
|
+
else {
|
|
2215
|
+
this.showInput(this.store.hover);
|
|
2216
|
+
}
|
|
2212
2217
|
}
|
|
2213
2218
|
this.store.emitter.emit('click', {
|
|
2214
2219
|
x: e.x,
|
|
@@ -6156,9 +6161,9 @@ export class Canvas {
|
|
|
6156
6161
|
// this.inputDiv.style.fontSize = pen.calculative.fontSize + 'px';
|
|
6157
6162
|
// this.inputDiv.style.color = getTextColor(pen, this.store);
|
|
6158
6163
|
this.inputParent.style.left =
|
|
6159
|
-
textRect.x + this.store.data.x - (pen.textLeft || 0) + 'px'; //+ 5
|
|
6164
|
+
textRect.x + this.store.data.x - (pen.calculative.textLeft || 0) + 'px'; //+ 5
|
|
6160
6165
|
this.inputParent.style.top =
|
|
6161
|
-
textRect.y + this.store.data.y - (pen.textTop || 0) + 'px'; //+ 5
|
|
6166
|
+
textRect.y + this.store.data.y - (pen.calculative.textTop || 0) + 'px'; //+ 5
|
|
6162
6167
|
let _width = textRect.width; //+ (pen.textLeft || 0);
|
|
6163
6168
|
this.inputParent.style.width = (_width < 0 ? 12 : _width) + 'px'; //(textRect.width < pen.width ? 0 : 10)
|
|
6164
6169
|
this.inputParent.style.height = textRect.height + (pen.textTop || 0) + 'px'; // (textRect.height < pen.height ? 0 : 10)
|
|
@@ -6180,6 +6185,8 @@ export class Canvas {
|
|
|
6180
6185
|
// }
|
|
6181
6186
|
this.dropdown.style.background = pen.dropdownBackground || '#fff';
|
|
6182
6187
|
this.dropdown.style.color = pen.dropdownColor || '#bdc7db';
|
|
6188
|
+
this.dropdown.style.width = this.inputParent.style.width;
|
|
6189
|
+
this.dropdown.style.fontSize = (pen.fontSize || 12) + 'px';
|
|
6183
6190
|
this.setDropdownList();
|
|
6184
6191
|
this.externalElements.style.zIndex = '9999';
|
|
6185
6192
|
}
|
|
@@ -6442,7 +6449,7 @@ export class Canvas {
|
|
|
6442
6449
|
sheet.insertRule('.meta2d-input{display:none;position:absolute;outline:none;align-items: center;}');
|
|
6443
6450
|
sheet.insertRule('.meta2d-input textarea{resize:none;border:none;outline:none;background:transparent;flex-grow:1;height:100%;left:0;top:0}');
|
|
6444
6451
|
sheet.insertRule('.meta2d-input .right{width:10px;height:10px;flex-shrink:0;border-top: 1px solid;border-right: 1px solid;margin-right: 5px;transition: all .3s cubic-bezier(.645,.045,.355,1);position:absolute;right:1px;}');
|
|
6445
|
-
sheet.insertRule('.meta2d-input ul{position:absolute;top:100%;
|
|
6452
|
+
sheet.insertRule('.meta2d-input ul{position:absolute;top:100%;margin-top:4px; width:calc(100% + 10px);min-height:30px;border-radius: 2px;box-shadow: 0 2px 8px #00000026;list-style-type: none;background-color: #fff;padding: 4px 0;max-height: 105px;overflow-y: auto;}');
|
|
6446
6453
|
sheet.insertRule('.meta2d-input ul li{padding: 5px 12px;line-height: 22px;white-space: nowrap;cursor: pointer;}');
|
|
6447
6454
|
sheet.insertRule('.meta2d-input ul li:hover{background: #eeeeee;}');
|
|
6448
6455
|
sheet.insertRule(`.input-div::-webkit-scrollbar {display:none}`);
|
|
@@ -7055,6 +7062,9 @@ export class Canvas {
|
|
|
7055
7062
|
if (!isShowChild(pen, this.store) || pen.visible == false) {
|
|
7056
7063
|
continue;
|
|
7057
7064
|
}
|
|
7065
|
+
if (pen.name === 'combine' && !pen.draw) {
|
|
7066
|
+
continue;
|
|
7067
|
+
}
|
|
7058
7068
|
// TODO: hover 待考虑,若出现再补上
|
|
7059
7069
|
const { active } = pen.calculative;
|
|
7060
7070
|
pen.calculative.active = false;
|