Commit aa944340 authored by Dafrok's avatar Dafrok

feat(release): release v1.4.49

parent dc6cce77
......@@ -15,6 +15,79 @@
margin: 0;
}
.km-view image{
.km-view image {
cursor: zoom-in;
}
.km-image-viewer {
position: fixed;
z-index: 99999;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, .75);
}
.km-image-viewer .km-image-viewer-container {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
text-align: center;
white-space: nowrap;
overflow: auto;
}
.km-image-viewer .km-image-viewer-container::before {
content: '';
display: inline-block;
height: 100%;
width: 0;
font-size: 0;
vertical-align: middle;
}
.km-image-viewer .km-image-viewer-container img {
cursor: zoom-out;
vertical-align: middle;
}
.km-image-viewer .km-image-viewer-container img.limited {
cursor: zoom-in;
max-width: 100%;
max-height: 100%;
}
.km-image-viewer .km-image-viewer-toolbar {
z-index: 1;
background: rgba(0, 0, 0, .75);
text-align: right;
transition: all .25s;
}
.km-image-viewer .km-image-viewer-toolbar.hidden {
transform: translate(0, -100%);
opacity: 0;
}
.km-image-viewer .km-image-viewer-btn {
cursor: pointer;
outline: 0;
border: 0;
width: 44px;
height: 44px;
background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjY0IiBoZWlnaHQ9Ijg4IiB2aWV3Qm94PSIwIDAgMjY0IDg4IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjx0aXRsZT5kZWZhdWx0LXNraW4gMjwvdGl0bGU+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Zz48cGF0aCBkPSJNNjcuMDAyIDU5LjV2My43NjhjLTYuMzA3Ljg0LTkuMTg0IDUuNzUtMTAuMDAyIDkuNzMyIDIuMjItMi44MyA1LjU2NC01LjA5OCAxMC4wMDItNS4wOThWNzEuNUw3MyA2NS41ODUgNjcuMDAyIDU5LjV6IiBpZD0iU2hhcGUiIGZpbGw9IiNmZmYiLz48ZyBmaWxsPSIjZmZmIj48cGF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2MiA1LjUgNS41IDUuNXoiIGlkPSJPdmFsLTEiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIxLjUiLz48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMTUwIDIxaDV2MWgtNXoiLz48L2c+PGc+PHBhdGggZD0iTTExNi45NTcgMjguNTQzbC0xLjQxNCAxLjQxNC0zLjI1LTMuMjUgMS40MTQtMS40MTQgMy4yNSAzLjI1eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMDguNSAyN2MzLjAzOCAwIDUuNS0yLjQ2MiA1LjUtNS41cy0yLjQ2Mi01LjUtNS41LTUuNS01LjUgMi40NjItNS41IDUuNSAyLjQ2MiA1LjUgNS41IDUuNXoiIHN0cm9rZT0iI2ZmZiIgc3Ryb2tlLXdpZHRoPSIxLjUiLz48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMTA2IDIxaDV2MWgtNXoiLz48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMTA5LjA0MyAxOS4wMDhsLS4wODUgNS0xLS4wMTcuMDg1LTV6Ii8+PC9nPjwvZz48L2c+PC9zdmc+);
}
.km-image-viewer .km-image-viewer-toolbar {
position: absolute;
top: 0;
left: 0;
right: 0;
}
.km-image-viewer .km-image-viewer-close {
background-position: 0 -44px;
}
\ No newline at end of file
/*!
* ====================================================
* Kity Minder Core - v1.4.48 - 2018-03-27
* Kity Minder Core - v1.4.49 - 2018-04-02
* https://github.com/fex-team/kityminder-core
* GitHub: https://github.com/fex-team/kityminder-core.git
* Copyright (c) 2018 Baidu FEX; Licensed BSD-3-Clause
......@@ -3810,8 +3810,8 @@ _p[35] = {
_p.r(46);
_p.r(47);
_p.r(48);
_p.r(49);
_p.r(50);
_p.r(49);
_p.r(51);
_p.r(52);
_p.r(53);
......@@ -3825,23 +3825,24 @@ _p[35] = {
_p.r(61);
_p.r(62);
_p.r(63);
_p.r(67);
_p.r(64);
_p.r(66);
_p.r(68);
_p.r(65);
_p.r(67);
_p.r(66);
_p.r(40);
_p.r(36);
_p.r(37);
_p.r(38);
_p.r(39);
_p.r(41);
_p.r(74);
_p.r(77);
_p.r(76);
_p.r(75);
_p.r(78);
_p.r(77);
_p.r(79);
_p.r(76);
_p.r(78);
_p.r(80);
_p.r(79);
_p.r(0);
_p.r(1);
_p.r(2);
......@@ -3849,12 +3850,12 @@ _p[35] = {
_p.r(4);
_p.r(5);
_p.r(6);
_p.r(68);
_p.r(72);
_p.r(69);
_p.r(71);
_p.r(70);
_p.r(73);
_p.r(70);
_p.r(72);
_p.r(71);
_p.r(74);
module.exports = kityminder;
}
};
......@@ -4446,7 +4447,7 @@ _p[43] = {
var MinderNode = _p.r(21);
var Command = _p.r(9);
var Module = _p.r(20);
var TextRenderer = _p.r(60);
var TextRenderer = _p.r(61);
Module.register("basestylemodule", function() {
var km = this;
function getNodeDataOrStyle(node, name) {
......@@ -5317,7 +5318,7 @@ _p[47] = {
var MinderNode = _p.r(21);
var Command = _p.r(9);
var Module = _p.r(20);
var TextRenderer = _p.r(60);
var TextRenderer = _p.r(61);
function getNodeDataOrStyle(node, name) {
return node.getData(name) || node.getStyle(name);
}
......@@ -5567,8 +5568,113 @@ _p[48] = {
}
};
//src/module/image.js
//src/module/image-viewer.js
_p[49] = {
value: function(require, exports, module) {
var kity = _p.r(17);
var keymap = _p.r(15);
var Module = _p.r(20);
var Command = _p.r(9);
Module.register("ImageViewer", function() {
function createEl(name, classNames, children) {
var el = document.createElement(name);
addClass(el, classNames);
children && children.length && children.forEach(function(child) {
el.appendChild(child);
});
return el;
}
function on(el, event, handler) {
el.addEventListener(event, handler);
}
function addClass(el, classNames) {
classNames && classNames.split(" ").forEach(function(className) {
el.classList.add(className);
});
}
function removeClass(el, classNames) {
classNames && classNames.split(" ").forEach(function(className) {
el.classList.remove(className);
});
}
var ImageViewer = kity.createClass("ImageViewer", {
constructor: function() {
var btnClose = createEl("button", "km-image-viewer-btn km-image-viewer-close");
var btnSource = createEl("button", "km-image-viewer-btn km-image-viewer-source");
var image = this.image = createEl("img");
var toolbar = this.toolbar = createEl("div", "km-image-viewer-toolbar", [ btnSource, btnClose ]);
var container = createEl("div", "km-image-viewer-container", [ image ]);
var viewer = this.viewer = createEl("div", "km-image-viewer", [ toolbar, container ]);
this.hotkeyHandler = this.hotkeyHandler.bind(this);
on(btnClose, "click", this.close.bind(this));
on(btnSource, "click", this.viewSource.bind(this));
on(image, "click", this.zoomImage.bind(this));
on(viewer, "contextmenu", this.toggleToolbar.bind(this));
on(document, "keydown", this.hotkeyHandler);
},
dispose: function() {
this.close();
document.removeEventListener("remove", this.hotkeyHandler);
},
hotkeyHandler: function(e) {
if (!this.actived) {
return;
}
if (e.keyCode === keymap["esc"]) {
this.close();
}
},
toggleToolbar: function(e) {
e && e.preventDefault();
this.toolbar.classList.toggle("hidden");
},
zoomImage: function(restore) {
var image = this.image;
if (typeof restore === "boolean") {
restore && addClass(image, "limited");
} else {
image.classList.toggle("limited");
}
},
viewSource: function(src) {
window.open(this.image.src);
},
open: function(src) {
var input = document.querySelector("input");
if (input) {
input.focus();
input.blur();
}
this.image.src = src;
this.zoomImage(true);
document.body.appendChild(this.viewer);
this.actived = true;
},
close: function() {
this.image.src = "";
document.body.removeChild(this.viewer);
this.actived = false;
}
});
return {
init: function() {
this.viewer = new ImageViewer();
},
events: {
"normal.dblclick": function(e) {
var shape = e.kityEvent.targetShape;
if (shape.__KityClassName === "Image" && shape.url) {
this.viewer.open(shape.url);
}
}
}
};
});
}
};
//src/module/image.js
_p[50] = {
value: function(require, exports, module) {
var kity = _p.r(17);
var utils = _p.r(33);
......@@ -5667,9 +5773,6 @@ _p[49] = {
if (title) {
image.node.setAttributeNS("http://www.w3.org/1999/xlink", "title", title);
}
image.node.ondblclick = function() {
!image.dragging && window.open(image.url);
};
var x = box.cx - size.width / 2;
var y = box.y - size.height - spaceTop;
image.setUrl(url).setX(x | 0).setY(y | 0).setWidth(size.width | 0).setHeight(size.height | 0);
......@@ -5693,7 +5796,7 @@ _p[49] = {
};
//src/module/keynav.js
_p[50] = {
_p[51] = {
value: function(require, exports, module) {
var kity = _p.r(17);
var utils = _p.r(33);
......@@ -5848,7 +5951,7 @@ _p[50] = {
* @author: techird
* @copyright: Baidu FEX, 2014
*/
_p[51] = {
_p[52] = {
value: function(require, exports, module) {
var kity = _p.r(17);
var Command = _p.r(9);
......@@ -5923,7 +6026,7 @@ _p[51] = {
};
//src/module/node.js
_p[52] = {
_p[53] = {
value: function(require, exports, module) {
var kity = _p.r(17);
var utils = _p.r(33);
......@@ -6073,7 +6176,7 @@ _p[52] = {
* @author: techird
* @copyright: Baidu FEX, 2014
*/
_p[53] = {
_p[54] = {
value: function(require, exports, module) {
var kity = _p.r(17);
var utils = _p.r(33);
......@@ -6171,7 +6274,7 @@ _p[53] = {
};
//src/module/outline.js
_p[54] = {
_p[55] = {
value: function(require, exports, module) {
var kity = _p.r(17);
var utils = _p.r(33);
......@@ -6288,7 +6391,7 @@ _p[54] = {
};
//src/module/priority.js
_p[55] = {
_p[56] = {
value: function(require, exports, module) {
var kity = _p.r(17);
var utils = _p.r(33);
......@@ -6414,7 +6517,7 @@ _p[55] = {
};
//src/module/progress.js
_p[56] = {
_p[57] = {
value: function(require, exports, module) {
var kity = _p.r(17);
var utils = _p.r(33);
......@@ -6539,7 +6642,7 @@ _p[56] = {
};
//src/module/resource.js
_p[57] = {
_p[58] = {
value: function(require, exports, module) {
var kity = _p.r(17);
var utils = _p.r(33);
......@@ -6869,7 +6972,7 @@ _p[57] = {
};
//src/module/select.js
_p[58] = {
_p[59] = {
value: function(require, exports, module) {
var kity = _p.r(17);
var utils = _p.r(33);
......@@ -7014,7 +7117,7 @@ _p[58] = {
};
//src/module/style.js
_p[59] = {
_p[60] = {
value: function(require, exports, module) {
var kity = _p.r(17);
var utils = _p.r(33);
......@@ -7119,7 +7222,7 @@ _p[59] = {
};
//src/module/text.js
_p[60] = {
_p[61] = {
value: function(require, exports, module) {
var kity = _p.r(17);
var utils = _p.r(33);
......@@ -7373,7 +7476,7 @@ _p[60] = {
};
//src/module/view.js
_p[61] = {
_p[62] = {
value: function(require, exports, module) {
var kity = _p.r(17);
var utils = _p.r(33);
......@@ -7695,7 +7798,7 @@ _p[61] = {
};
//src/module/zoom.js
_p[62] = {
_p[63] = {
value: function(require, exports, module) {
var kity = _p.r(17);
var utils = _p.r(33);
......@@ -7877,7 +7980,7 @@ _p[62] = {
};
//src/protocol/json.js
_p[63] = {
_p[64] = {
value: function(require, exports, module) {
var data = _p.r(12);
data.registerProtocol("json", module.exports = {
......@@ -7896,7 +7999,7 @@ _p[63] = {
};
//src/protocol/markdown.js
_p[64] = {
_p[65] = {
value: function(require, exports, module) {
var data = _p.r(12);
var LINE_ENDING_SPLITER = /\r\n|\r|\n/;
......@@ -8027,7 +8130,7 @@ _p[64] = {
};
//src/protocol/png.js
_p[65] = {
_p[66] = {
value: function(require, exports, module) {
var kity = _p.r(17);
var data = _p.r(12);
......@@ -8247,7 +8350,7 @@ _p[65] = {
};
//src/protocol/svg.js
_p[66] = {
_p[67] = {
value: function(require, exports, module) {
var data = _p.r(12);
/**
......@@ -8519,7 +8622,7 @@ _p[66] = {
};
//src/protocol/text.js
_p[67] = {
_p[68] = {
value: function(require, exports, module) {
var data = _p.r(12);
var Browser = _p.r(17).Browser;
......@@ -8750,7 +8853,7 @@ _p[67] = {
* @author: techird
* @copyright: Baidu FEX, 2014
*/
_p[68] = {
_p[69] = {
value: function(require, exports, module) {
var template = _p.r(31);
template.register("default", {
......@@ -8784,7 +8887,7 @@ _p[68] = {
* @author: techird
* @copyright: Baidu FEX, 2014
*/
_p[69] = {
_p[70] = {
value: function(require, exports, module) {
var template = _p.r(31);
template.register("filetree", {
......@@ -8812,7 +8915,7 @@ _p[69] = {
* @author: techird
* @copyright: Baidu FEX, 2014
*/
_p[70] = {
_p[71] = {
value: function(require, exports, module) {
var template = _p.r(31);
template.register("fish-bone", {
......@@ -8854,7 +8957,7 @@ _p[70] = {
* @author: techird
* @copyright: Baidu FEX, 2014
*/
_p[71] = {
_p[72] = {
value: function(require, exports, module) {
var template = _p.r(31);
template.register("right", {
......@@ -8878,7 +8981,7 @@ _p[71] = {
* @author: techird
* @copyright: Baidu FEX, 2014
*/
_p[72] = {
_p[73] = {
value: function(require, exports, module) {
var template = _p.r(31);
template.register("structure", {
......@@ -8901,7 +9004,7 @@ _p[72] = {
* @author: along
* @copyright: bpd729@163.com, 2015
*/
_p[73] = {
_p[74] = {
value: function(require, exports, module) {
var template = _p.r(31);
template.register("tianpan", {
......@@ -8922,7 +9025,7 @@ _p[73] = {
};
//src/theme/default.js
_p[74] = {
_p[75] = {
value: function(require, exports, module) {
var theme = _p.r(32);
[ "classic", "classic-compact" ].forEach(function(name) {
......@@ -8981,7 +9084,7 @@ _p[74] = {
};
//src/theme/fish.js
_p[75] = {
_p[76] = {
value: function(require, exports, module) {
var theme = _p.r(32);
theme.register("fish", {
......@@ -9032,7 +9135,7 @@ _p[75] = {
};
//src/theme/fresh.js
_p[76] = {
_p[77] = {
value: function(require, exports, module) {
var kity = _p.r(17);
var theme = _p.r(32);
......@@ -9101,7 +9204,7 @@ _p[76] = {
};
//src/theme/snow.js
_p[77] = {
_p[78] = {
value: function(require, exports, module) {
var theme = _p.r(32);
[ "snow", "snow-compact" ].forEach(function(name) {
......@@ -9156,7 +9259,7 @@ _p[77] = {
};
//src/theme/tianpan.js
_p[78] = {
_p[79] = {
value: function(require, exports, module) {
var theme = _p.r(32);
[ "tianpan", "tianpan-compact" ].forEach(function(name) {
......@@ -9218,7 +9321,7 @@ _p[78] = {
};
//src/theme/wire.js
_p[79] = {
_p[80] = {
value: function(require, exports, module) {
var theme = _p.r(32);
theme.register("wire", {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -2,7 +2,7 @@
"name": "kityminder-core",
"title": "Kity Minder Core",
"description": "KityMinder Core Implement",
"version": "1.4.48",
"version": "1.4.49",
"homepage": "https://github.com/fex-team/kityminder-core",
"author": {
"name": "Baidu FEX",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment