(function webpackUniversalModuleDefinition(root, factory) { if(typeof exports === 'object' && typeof module === 'object') module.exports = factory(); else if(typeof define === 'function' && define.amd) define([], factory); else { var a = factory(); for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i]; } })(window, function() { return /******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); /******/ } /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // create a fake namespace object /******/ // mode & 1: value is a module id, require it /******/ // mode & 2: merge all properties of value into the ns /******/ // mode & 4: return value when already ns object /******/ // mode & 8|1: behave like require /******/ __webpack_require__.t = function(value, mode) { /******/ if(mode & 1) value = __webpack_require__(value); /******/ if(mode & 8) return value; /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value; /******/ var ns = Object.create(null); /******/ __webpack_require__.r(ns); /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value }); /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key)); /******/ return ns; /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./src/index.ts"); /******/ }) /************************************************************************/ /******/ ({ /***/ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js!./node_modules/less-loader/dist/cjs.js?!./src/board/Drawboard/index.less": /*!*****************************************************************************************************************************************************************************!*\ !*** ./node_modules/css-loader/dist/cjs.js??ref--11-1!./node_modules/postcss-loader/src!./node_modules/less-loader/dist/cjs.js??ref--11-3!./src/board/Drawboard/index.less ***! \*****************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false); // Module exports.push([module.i, ".fc-whiteboard-logo {\n display: inline-block;\n margin: 0px;\n padding: 0px;\n fill: #333333;\n}\n.fc-whiteboard-logo a {\n display: grid;\n -ms-flex-align: center;\n align-items: center;\n justify-items: center;\n padding: 3px;\n width: 20px;\n height: 20px;\n}\n.fc-whiteboard-logo a:hover {\n fill: #ff8080;\n}\n.fc-whiteboard-toolbar {\n background-color: #cccccc;\n padding: 0px 5px;\n margin: 0px;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n display: grid;\n grid-template-columns: repeat(20, auto);\n}\n.fc-whiteboard-toolbar-button,\n.fc-whiteboard-toolbar-logo a {\n display: inline-block;\n margin: 2px;\n padding: 3px;\n cursor: pointer;\n width: 20px;\n height: 20px;\n border-radius: 2px;\n border-bottom: transparent solid 1px;\n border-right: transparent solid 1px;\n fill: #333333;\n display: grid;\n -ms-flex-align: center;\n align-items: center;\n justify-items: center;\n}\n.fc-whiteboard-toolbar-separator {\n margin: 5px 5px;\n border: 1px solid #dddddd;\n}\n.fc-whiteboard-toolbar-button:hover,\n.fc-whiteboard-toolbar-logo a:hover {\n background-color: #eeeeee;\n background: -webkit-radial-gradient(#eeeeee, #cccccc);\n background: -o-radial-gradient(#eeeeee, #cccccc);\n background: radial-gradient(#eeeeee, #cccccc);\n fill: #ff8080;\n}\n.fc-whiteboard-toolbar-button svg {\n height: 16px;\n}\n.fc-whiteboard-text-editor {\n position: fixed;\n z-index: 20000;\n left: 0px;\n top: 0px;\n width: 100vw;\n height: 100vh;\n background-color: rgba(0, 0, 0, 0.9);\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: column;\n flex-direction: column;\n -ms-flex-align: center;\n align-items: center;\n -ms-flex-pack: center;\n justify-content: center;\n}\n.fc-whiteboard-text-editor textarea {\n width: 50%;\n min-width: 50px;\n max-width: 500px;\n height: 50%;\n min-height: 50px;\n max-height: 500px;\n}\n.fc-whiteboard-text-editor .fc-whiteboard-text-editor-button-bar {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-direction: row;\n flex-direction: row;\n -ms-flex-pack: end;\n justify-content: flex-end;\n width: 50%;\n min-width: 50px;\n max-width: 500px;\n padding-top: 10px;\n}\n.fc-whiteboard-text-editor .fc-whiteboard-text-editor-button {\n display: grid;\n -ms-flex-align: center;\n align-items: center;\n padding: 0px;\n margin-left: 15px;\n width: 20px;\n height: 20px;\n cursor: pointer;\n fill: #888888;\n}\n.fc-whiteboard-text-editor .fc-whiteboard-text-editor-button:hover {\n fill: #ff8080;\n}\n", ""]); /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js!./node_modules/less-loader/dist/cjs.js?!./src/board/WhitePage/index.less": /*!*****************************************************************************************************************************************************************************!*\ !*** ./node_modules/css-loader/dist/cjs.js??ref--11-1!./node_modules/postcss-loader/src!./node_modules/less-loader/dist/cjs.js??ref--11-3!./src/board/WhitePage/index.less ***! \*****************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false); // Module exports.push([module.i, ".fcw-page img {\n width: 100%;\n height: 100%;\n}\n", ""]); /***/ }), /***/ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js!./node_modules/less-loader/dist/cjs.js?!./src/board/Whiteboard/index.less": /*!******************************************************************************************************************************************************************************!*\ !*** ./node_modules/css-loader/dist/cjs.js??ref--11-1!./node_modules/postcss-loader/src!./node_modules/less-loader/dist/cjs.js??ref--11-3!./src/board/Whiteboard/index.less ***! \******************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { exports = module.exports = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ "./node_modules/css-loader/dist/runtime/api.js")(false); // Module exports.push([module.i, ".fcw-board-imgs,\n.fcw-board-pages,\n.fcw-board .fcw-page {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n.fcw-board-img {\n width: 100%;\n height: 100%;\n}\n.fcw-board-flip-arrow {\n height: 20px;\n width: 20px;\n cursor: pointer;\n}\n.fcw-board-controller {\n position: absolute;\n display: -ms-flexbox;\n display: flex;\n width: 50px;\n height: 30px;\n -ms-flex-pack: justify;\n justify-content: space-between;\n -ms-flex-align: center;\n align-items: center;\n top: -30px;\n background-color: #cccccc;\n padding: 0px 5px;\n margin: 0px;\n border-top-left-radius: 10px;\n border-top-right-radius: 10px;\n}\n", ""]); /***/ }), /***/ "./node_modules/css-loader/dist/runtime/api.js": /*!*****************************************************!*\ !*** ./node_modules/css-loader/dist/runtime/api.js ***! \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; /* MIT License http://www.opensource.org/licenses/mit-license.php Author Tobias Koppers @sokra */ // css base code, injected by the css-loader module.exports = function (useSourceMap) { var list = []; // return the list of modules as css string list.toString = function toString() { return this.map(function (item) { var content = cssWithMappingToString(item, useSourceMap); if (item[2]) { return '@media ' + item[2] + '{' + content + '}'; } else { return content; } }).join(''); }; // import a list of modules into the list list.i = function (modules, mediaQuery) { if (typeof modules === 'string') { modules = [[null, modules, '']]; } var alreadyImportedModules = {}; for (var i = 0; i < this.length; i++) { var id = this[i][0]; if (id != null) { alreadyImportedModules[id] = true; } } for (i = 0; i < modules.length; i++) { var item = modules[i]; // skip already imported module // this implementation is not 100% perfect for weird media query combinations // when a module is imported multiple times with different media queries. // I hope this will never occur (Hey this way we have smaller bundles) if (item[0] == null || !alreadyImportedModules[item[0]]) { if (mediaQuery && !item[2]) { item[2] = mediaQuery; } else if (mediaQuery) { item[2] = '(' + item[2] + ') and (' + mediaQuery + ')'; } list.push(item); } } }; return list; }; function cssWithMappingToString(item, useSourceMap) { var content = item[1] || ''; var cssMapping = item[3]; if (!cssMapping) { return content; } if (useSourceMap && typeof btoa === 'function') { var sourceMapping = toComment(cssMapping); var sourceURLs = cssMapping.sources.map(function (source) { return '/*# sourceURL=' + cssMapping.sourceRoot + source + ' */'; }); return [content].concat(sourceURLs).concat([sourceMapping]).join('\n'); } return [content].join('\n'); } // Adapted from convert-source-map (MIT) function toComment(sourceMap) { // eslint-disable-next-line no-undef var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))); var data = 'sourceMappingURL=data:application/json;charset=utf-8;base64,' + base64; return '/*# ' + data + ' */'; } /***/ }), /***/ "./node_modules/siema/dist/siema.min.js": /*!**********************************************!*\ !*** ./node_modules/siema/dist/siema.min.js ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { !function(e,t){ true?module.exports=t():undefined}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(i[r])return i[r].exports;var n=i[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,t),n.l=!0,n.exports}var i={};return t.m=e,t.c=i,t.d=function(e,i,r){t.o(e,i)||Object.defineProperty(e,i,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var i=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(i,"a",i),i},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,i){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},s=function(){function e(e,t){for(var i=0;i=e&&(this.perPage=this.config.perPage[e])}}},{key:"prev",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments[1];if(!(this.innerElements.length<=this.perPage)){var i=this.currentSlide;if(this.config.loop){if(this.currentSlide-e<0){this.disableTransition();var r=this.currentSlide+this.innerElements.length,n=this.perPage,s=r+n,l=(this.config.rtl?1:-1)*s*(this.selectorWidth/this.perPage),o=this.config.draggable?this.drag.endX-this.drag.startX:0;this.sliderFrame.style[this.transformProperty]="translate3d("+(l+o)+"px, 0, 0)",this.currentSlide=r-e}else this.currentSlide=this.currentSlide-e}else this.currentSlide=Math.max(this.currentSlide-e,0);i!==this.currentSlide&&(this.slideToCurrent(this.config.loop),this.config.onChange.call(this),t&&t.call(this))}}},{key:"next",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments[1];if(!(this.innerElements.length<=this.perPage)){var i=this.currentSlide;if(this.config.loop){if(this.currentSlide+e>this.innerElements.length-this.perPage){this.disableTransition();var r=this.currentSlide-this.innerElements.length,n=this.perPage,s=r+n,l=(this.config.rtl?1:-1)*s*(this.selectorWidth/this.perPage),o=this.config.draggable?this.drag.endX-this.drag.startX:0;this.sliderFrame.style[this.transformProperty]="translate3d("+(l+o)+"px, 0, 0)",this.currentSlide=r+e}else this.currentSlide=this.currentSlide+e}else this.currentSlide=Math.min(this.currentSlide+e,this.innerElements.length-this.perPage);i!==this.currentSlide&&(this.slideToCurrent(this.config.loop),this.config.onChange.call(this),t&&t.call(this))}}},{key:"disableTransition",value:function(){this.sliderFrame.style.webkitTransition="all 0ms "+this.config.easing,this.sliderFrame.style.transition="all 0ms "+this.config.easing}},{key:"enableTransition",value:function(){this.sliderFrame.style.webkitTransition="all "+this.config.duration+"ms "+this.config.easing,this.sliderFrame.style.transition="all "+this.config.duration+"ms "+this.config.easing}},{key:"goTo",value:function(e,t){if(!(this.innerElements.length<=this.perPage)){var i=this.currentSlide;this.currentSlide=this.config.loop?e%this.innerElements.length:Math.min(Math.max(e,0),this.innerElements.length-this.perPage),i!==this.currentSlide&&(this.slideToCurrent(),this.config.onChange.call(this),t&&t.call(this))}}},{key:"slideToCurrent",value:function(e){var t=this,i=this.config.loop?this.currentSlide+this.perPage:this.currentSlide,r=(this.config.rtl?1:-1)*i*(this.selectorWidth/this.perPage);e?requestAnimationFrame(function(){requestAnimationFrame(function(){t.enableTransition(),t.sliderFrame.style[t.transformProperty]="translate3d("+r+"px, 0, 0)"})}):this.sliderFrame.style[this.transformProperty]="translate3d("+r+"px, 0, 0)"}},{key:"updateAfterDrag",value:function(){var e=(this.config.rtl?-1:1)*(this.drag.endX-this.drag.startX),t=Math.abs(e),i=this.config.multipleDrag?Math.ceil(t/(this.selectorWidth/this.perPage)):1,r=e>0&&this.currentSlide-i<0,n=e<0&&this.currentSlide+i>this.innerElements.length-this.perPage;e>0&&t>this.config.threshold&&this.innerElements.length>this.perPage?this.prev(i):e<0&&t>this.config.threshold&&this.innerElements.length>this.perPage&&this.next(i),this.slideToCurrent(r||n)}},{key:"resizeHandler",value:function(){this.resolveSlidesNumber(),this.currentSlide+this.perPage>this.innerElements.length&&(this.currentSlide=this.innerElements.length<=this.perPage?0:this.innerElements.length-this.perPage),this.selectorWidth=this.selector.offsetWidth,this.buildSliderFrame()}},{key:"clearDrag",value:function(){this.drag={startX:0,endX:0,startY:0,letItGo:null,preventClick:this.drag.preventClick}}},{key:"touchstartHandler",value:function(e){-1!==["TEXTAREA","OPTION","INPUT","SELECT"].indexOf(e.target.nodeName)||(e.stopPropagation(),this.pointerDown=!0,this.drag.startX=e.touches[0].pageX,this.drag.startY=e.touches[0].pageY)}},{key:"touchendHandler",value:function(e){e.stopPropagation(),this.pointerDown=!1,this.enableTransition(),this.drag.endX&&this.updateAfterDrag(),this.clearDrag()}},{key:"touchmoveHandler",value:function(e){if(e.stopPropagation(),null===this.drag.letItGo&&(this.drag.letItGo=Math.abs(this.drag.startY-e.touches[0].pageY)=this.innerElements.length)throw new Error("Item to remove doesn't exist 😭");var i=ethis.innerElements.length+1)throw new Error("Unable to inset it at this index 😭");if(-1!==this.innerElements.indexOf(e))throw new Error("The same item in a carousel? Really? Nope 😭");var r=t<=this.currentSlide>0&&this.innerElements.length;this.currentSlide=r?this.currentSlide+1:this.currentSlide,this.innerElements.splice(t,0,e),this.buildSliderFrame(),i&&i.call(this)}},{key:"prepend",value:function(e,t){this.insert(e,0),t&&t.call(this)}},{key:"append",value:function(e,t){this.insert(e,this.innerElements.length+1),t&&t.call(this)}},{key:"destroy",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments[1];if(this.detachEvents(),this.selector.style.cursor="auto",e){for(var i=document.createDocumentFragment(),r=0;r // tags it will allow on a page if (!options.singleton && typeof options.singleton !== "boolean") options.singleton = isOldIE(); // By default, add " /***/ }), /***/ "./src/assets/bx-right-arrow.svg": /*!***************************************!*\ !*** ./src/assets/bx-right-arrow.svg ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = "" /***/ }), /***/ "./src/assets/check.svg": /*!******************************!*\ !*** ./src/assets/check.svg ***! \******************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = "" /***/ }), /***/ "./src/assets/cover.svg": /*!******************************!*\ !*** ./src/assets/cover.svg ***! \******************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = "" /***/ }), /***/ "./src/assets/eraser.svg": /*!*******************************!*\ !*** ./src/assets/eraser.svg ***! \*******************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = "" /***/ }), /***/ "./src/assets/highlight.svg": /*!**********************************!*\ !*** ./src/assets/highlight.svg ***! \**********************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = "" /***/ }), /***/ "./src/assets/line.svg": /*!*****************************!*\ !*** ./src/assets/line.svg ***! \*****************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = "" /***/ }), /***/ "./src/assets/mouse-pointer.svg": /*!**************************************!*\ !*** ./src/assets/mouse-pointer.svg ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = "" /***/ }), /***/ "./src/assets/rect.svg": /*!*****************************!*\ !*** ./src/assets/rect.svg ***! \*****************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = "" /***/ }), /***/ "./src/assets/text.svg": /*!*****************************!*\ !*** ./src/assets/text.svg ***! \*****************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = "" /***/ }), /***/ "./src/assets/times.svg": /*!******************************!*\ !*** ./src/assets/times.svg ***! \******************************/ /*! no static exports found */ /***/ (function(module, exports) { module.exports = "" /***/ }), /***/ "./src/board/Baseboard/index.ts": /*!**************************************!*\ !*** ./src/board/Baseboard/index.ts ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var uuid_1 = __webpack_require__(/*! ./../../utils/uuid */ "./src/utils/uuid.ts"); var index_1 = __webpack_require__(/*! ./../../renderer/SvgHelper/index */ "./src/renderer/SvgHelper/index.ts"); var Baseboard = function () { function Baseboard(source) { var _this = this; this.id = uuid_1.uuid(); this.initBoard = function () { _this.boardHolder = document.createElement('div'); _this.boardHolder.id = "fcw-board-holder-" + _this.id; _this.boardHolder.style.setProperty('touch-action', 'none'); _this.boardHolder.style.setProperty('-ms-touch-action', 'none'); document.body.appendChild(_this.boardHolder); _this.boardCanvas = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); _this.boardCanvas.setAttribute('xmlns', 'http://www.w3.org/2000/svg'); _this.boardCanvas.setAttribute('width', _this.width.toString()); _this.boardCanvas.setAttribute('height', _this.height.toString()); _this.boardCanvas.setAttribute('viewBox', '0 0 ' + _this.width.toString() + ' ' + _this.height.toString()); _this.boardHolder.style.position = 'absolute'; _this.boardHolder.style.width = _this.width + "px"; _this.boardHolder.style.height = _this.height + "px"; _this.boardHolder.style.transformOrigin = 'top left'; _this.positionBoard(); _this.defs = index_1.SvgHelper.createDefs(); _this.boardCanvas.appendChild(_this.defs); _this.boardHolder.appendChild(_this.boardCanvas); }; this.positionBoard = function () { _this.boardHolder.style.top = _this.targetRect.top + 'px'; _this.boardHolder.style.left = _this.targetRect.left + 'px'; }; this.source = source; if (source.imgEle) { this.target = source.imgEle; this.width = this.target.clientWidth; this.height = this.target.clientHeight; } } return Baseboard; }(); exports.Baseboard = Baseboard; /***/ }), /***/ "./src/board/Drawboard/index.less": /*!****************************************!*\ !*** ./src/board/Drawboard/index.less ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js??ref--11-1!../../../node_modules/postcss-loader/src!../../../node_modules/less-loader/dist/cjs.js??ref--11-3!./index.less */ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js!./node_modules/less-loader/dist/cjs.js?!./src/board/Drawboard/index.less"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/board/Drawboard/index.ts": /*!**************************************!*\ !*** ./src/board/Drawboard/index.ts ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var index_1 = __webpack_require__(/*! ./../Baseboard/index */ "./src/board/Baseboard/index.ts"); var toolbar_items_1 = __webpack_require__(/*! ./../../toolbar/toolbar-items */ "./src/toolbar/toolbar-items.ts"); var Synthetizer_1 = __webpack_require__(/*! ../../renderer/Synthetizer */ "./src/renderer/Synthetizer/index.ts"); var Toolbar_1 = __webpack_require__(/*! ../../toolbar/Toolbar */ "./src/toolbar/Toolbar.ts"); __webpack_require__(/*! ./index.less */ "./src/board/Drawboard/index.less"); var Drawboard = function (_super) { __extends(Drawboard, _super); function Drawboard(source, _a) { var _b = _a === void 0 ? {} : _a, page = _b.page, onChange = _b.onChange; var _this = _super.call(this, source) || this; _this.scale = 1.0; _this.onComplete = function () {}; _this.onChange = function () {}; _this.open = function (onComplete, onCancel) { if (onComplete) { _this.onComplete = onComplete; } if (onCancel) { _this.onCancel = onCancel; } _this.setTargetRect(); _this.initBoard(); _this.attachEvents(); _this.setStyles(); window.addEventListener('resize', _this.adjustUI); if (_this.page.mode === 'master') { _this.showUI(); } }; _this.hide = function () { if (_this.source.imgSrc) { _this.target.style.display = 'none'; } _this.boardHolder.style.visibility = 'hidden'; _this.boardHolder.style.zIndex = '-1'; if (_this.toolbar) { _this.toolbar.hide(); } }; _this.show = function () { if (_this.source.imgSrc) { _this.target.style.display = 'block'; } _this.boardHolder.style.visibility = 'visible'; _this.boardHolder.style.zIndex = '9999'; if (_this.toolbar) { _this.toolbar.show(); } }; _this.close = function () { if (_this.toolbarUI) { document.body.removeChild(_this.toolbarUI); } if (_this.boardCanvas) { document.body.removeChild(_this.boardHolder); } }; _this.render = function (onComplete, onCancel) { _this.onComplete = onComplete; if (onCancel) { _this.onCancel = onCancel; } _this.selectMarker(null); _this.startRender(_this.renderFinished); }; _this.addMarker = function (markerType, _a) { var id = (_a === void 0 ? {} : _a).id; var marker = markerType.createMarker(_this.page); if (id) { marker.id = id; } marker.onSelected = _this.selectMarker; marker.onChange = _this.onChange; if (marker.defs && marker.defs.length > 0) { for (var _i = 0, _b = marker.defs; _i < _b.length; _i++) { var d = _b[_i]; if (d.id && !_this.boardCanvas.getElementById(d.id)) { _this.defs.appendChild(d); } } } _this.onChange({ target: 'marker', parentId: _this.page ? _this.page.id : _this.id, event: 'add', data: { type: marker.type, id: marker.id } }); _this.markers.push(marker); _this.selectMarker(marker); _this.boardCanvas.appendChild(marker.visual); var bbox = marker.visual.getBBox(); var x = _this.width / 2 / _this.scale - bbox.width / 2; var y = _this.height / 2 / _this.scale - bbox.height / 2; var translate = marker.visual.transform.baseVal.getItem(0); translate.setMatrix(translate.matrix.translate(x, y)); marker.visual.transform.baseVal.replaceItem(translate, 0); }; _this.deleteActiveMarker = function () { if (_this.activeMarker) { if (_this.onChange) { _this.onChange({ event: 'remove', id: _this.activeMarker.id, target: 'marker', data: { id: _this.activeMarker.id } }); } _this.deleteMarker(_this.activeMarker); } }; _this.setTargetRect = function () { var targetRect = _this.target.getBoundingClientRect(); var bodyRect = document.body.parentElement.getBoundingClientRect(); _this.targetRect = { left: targetRect.left - bodyRect.left, top: targetRect.top - bodyRect.top }; }; _this.startRender = function (done) { var renderer = new Synthetizer_1.Synthetizer(); renderer.rasterize(_this.target, _this.boardCanvas, done); }; _this.attachEvents = function () { _this.boardCanvas.addEventListener('mousedown', _this.mouseDown); _this.boardCanvas.addEventListener('mousemove', _this.mouseMove); _this.boardCanvas.addEventListener('mouseup', _this.mouseUp); }; _this.mouseDown = function (ev) { if (_this.activeMarker && (ev.buttons & 1) > 0) { _this.activeMarker.deselect(); _this.activeMarker = null; } }; _this.mouseMove = function (ev) { if (_this.activeMarker && (ev.buttons & 1) > 0) { _this.activeMarker.manipulate(ev); } }; _this.mouseUp = function (ev) { if (_this.activeMarker) { _this.activeMarker.endManipulation(); } }; _this.adjustUI = function (ev) { _this.adjustSize(); _this.positionUI(); }; _this.adjustSize = function () { _this.width = _this.target.clientWidth; _this.height = _this.target.clientHeight; var scale = _this.target.clientWidth / _this.boardHolder.clientWidth; if (scale !== 1.0) { _this.scale *= scale; _this.boardHolder.style.width = _this.width + "px"; _this.boardHolder.style.height = _this.height + "px"; _this.boardHolder.style.transform = "scale(" + _this.scale + ")"; } }; _this.positionUI = function () { _this.setTargetRect(); _this.positionBoard(); _this.positionToolbar(); }; _this.positionToolbar = function () { _this.toolbarUI.style.left = _this.targetRect.left + _this.target.offsetWidth - _this.toolbarUI.clientWidth + "px"; _this.toolbarUI.style.top = _this.targetRect.top - _this.toolbarUI.clientHeight + "px"; }; _this.showUI = function () { _this.toolbar = new Toolbar_1.Toolbar(_this.toolbars, _this.toolbarClick); _this.toolbarUI = _this.toolbar.getUI(); document.body.appendChild(_this.toolbarUI); _this.toolbarUI.style.position = 'absolute'; _this.positionToolbar(); }; _this.setStyles = function () { var editorStyleSheet = document.createElementNS('http://www.w3.org/2000/svg', 'style'); editorStyleSheet.innerHTML = "\n .rect-marker .render-visual {\n stroke: #ff0000;\n stroke-width: 3;\n fill: transparent;\n }\n .cover-marker .render-visual {\n stroke-width: 0;\n fill: #000000;\n }\n .highlight-marker .render-visual {\n stroke: transparent;\n stroke-width: 0;\n fill: #ffff00;\n fill-opacity: 0.4;\n }\n .line-marker .render-visual {\n stroke: #ff0000;\n stroke-width: 3;\n fill: transparent;\n }\n .arrow-marker .render-visual {\n stroke: #ff0000;\n stroke-width: 3;\n fill: transparent;\n }\n .arrow-marker-tip {\n stroke-width: 0;\n fill: #ff0000;\n }\n .text-marker text {\n fill: #ff0000;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\",\n Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\",\n \"Segoe UI Emoji\", \"Segoe UI Symbol\";\n }\n .fc-whiteboard-rect-control-box .fc-whiteboard-rect-control-rect {\n stroke: black;\n stroke-width: 1;\n stroke-opacity: 0.5;\n stroke-dasharray: 3, 2;\n fill: transparent;\n }\n .fc-whiteboard-control-grip {\n fill: #cccccc;\n stroke: #333333;\n stroke-width: 2;\n }\n "; _this.boardCanvas.appendChild(editorStyleSheet); }; _this.toolbarClick = function (ev, toolbarItem) { if (toolbarItem.markerType) { _this.addMarker(toolbarItem.markerType); } else { switch (toolbarItem.name) { case 'delete': { _this.deleteActiveMarker(); break; } case 'pointer': { if (_this.activeMarker) { _this.selectMarker(null); } break; } case 'close': { _this.cancel(); break; } case 'ok': { _this.complete(); break; } default: break; } } }; _this.selectMarker = function (marker) { if (_this.activeMarker && _this.activeMarker !== marker) { _this.activeMarker.deselect(); } _this.activeMarker = marker; }; _this.deleteMarker = function (marker) { _this.boardCanvas.removeChild(marker.visual); if (_this.activeMarker === marker) { _this.activeMarker = null; } _this.markers.splice(_this.markers.indexOf(marker), 1); }; _this.complete = function () { _this.selectMarker(null); _this.startRender(_this.renderFinishedClose); }; _this.cancel = function () { _this.close(); if (_this.onCancel) { _this.onCancel(); } }; _this.renderFinished = function (dataUrl) { _this.onComplete(dataUrl); }; _this.renderFinishedClose = function (dataUrl) { _this.close(); _this.onComplete(dataUrl); }; if (page) { _this.page = page; } _this.markers = []; _this.activeMarker = null; _this.toolbars = toolbar_items_1.getToolbars(page); if (onChange) { _this.onChange = onChange; } return _this; } Object.defineProperty(Drawboard.prototype, "markerMap", { get: function () { var map = {}; this.markers.forEach(function (marker) { map[marker.id] = marker; }); return map; }, enumerable: true, configurable: true }); return Drawboard; }(index_1.Baseboard); exports.Drawboard = Drawboard; /***/ }), /***/ "./src/board/WhitePage/index.less": /*!****************************************!*\ !*** ./src/board/WhitePage/index.less ***! \****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js??ref--11-1!../../../node_modules/postcss-loader/src!../../../node_modules/less-loader/dist/cjs.js??ref--11-3!./index.less */ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js!./node_modules/less-loader/dist/cjs.js?!./src/board/WhitePage/index.less"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/board/WhitePage/index.ts": /*!**************************************!*\ !*** ./src/board/WhitePage/index.ts ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var index_1 = __webpack_require__(/*! ./../Drawboard/index */ "./src/board/Drawboard/index.ts"); var uuid_1 = __webpack_require__(/*! ./../../utils/uuid */ "./src/utils/uuid.ts"); var types_1 = __webpack_require__(/*! ../../markers/types */ "./src/markers/types.ts"); __webpack_require__(/*! ./index.less */ "./src/board/WhitePage/index.less"); var dom_1 = __webpack_require__(/*! ../../utils/dom */ "./src/utils/dom.ts"); var prefix = 'fcw-page'; var WhitePage = function () { function WhitePage(source, _a) { var _b = _a === void 0 ? {} : _a, mode = _b.mode, eventHub = _b.eventHub, parentContainer = _b.parentContainer; this.id = uuid_1.uuid(); this.mode = 'master'; if (mode) { this.mode = mode; } this.eventHub = eventHub; this.parentContainer = parentContainer; this.initSource(source); if (this.mode === 'master') { this.initMaster(); } if (this.mode === 'mirror') { this.initMirror(); } } WhitePage.prototype.open = function () { this.drawboard.open(); }; WhitePage.prototype.hide = function () { this.drawboard.hide(); }; WhitePage.prototype.show = function () { this.drawboard.show(); }; WhitePage.prototype.close = function () { this.drawboard.close(); }; WhitePage.prototype.initSource = function (source) { if (typeof source.imgSrc === 'string' && !this.parentContainer) { throw new Error('Invalid source, If you set image url, you must also set parentContainer'); } this.source = source; if (source.imgEle) { this.target = source.imgEle; } if (typeof source.imgSrc === 'string') { this.container = dom_1.createDivWithClassName(prefix, this.parentContainer); this.container.id = this.id; this.target = document.createElement('img'); this.target.src = source.imgSrc; this.target.alt = 'Siema image'; this.container.appendChild(this.target); } }; WhitePage.prototype.initMaster = function () { var _this = this; if (this.eventHub) { this.drawboard = new index_1.Drawboard({ imgEle: this.target }, { page: this, onChange: function (ev) { return _this.eventHub.emit('sync', ev); } }); } else { this.drawboard = new index_1.Drawboard({ imgEle: this.target }, { page: this }); } }; WhitePage.prototype.initMirror = function () { var _this = this; if (!this.eventHub) { throw new Error('Invalid eventHub'); } this.drawboard = new index_1.Drawboard({ imgEle: this.target }, { page: this }); this.eventHub.on('sync', function (ev) { try { if (ev.target === 'page' && ev.id === _this.id) { _this.onPageSync(); } if (ev.target === 'marker') { _this.onMarkerSync(ev); } } catch (e) { console.warn(e); } }); }; WhitePage.prototype.onPageSync = function () {}; WhitePage.prototype.onMarkerSync = function (ev) { if (ev.event === 'add' && ev.parentId === this.id) { var data = ev.data; var marker = this.drawboard.markerMap[data.id]; if (!marker) { this.drawboard.addMarker(types_1.getMarkerByType(data.type), { id: data.id }); } } if (!ev.id) { return; } if (ev.event === 'remove') { var data = ev.data; var marker = this.drawboard.markerMap[data.id]; if (marker) { this.drawboard.deleteMarker(marker); } } if (ev.event === 'move' || ev.event === 'resize') { var marker = this.drawboard.markerMap[ev.id]; if (marker) { marker.reactToManipulation(ev.event, ev.data); } } if (ev.event === 'changeText') { var marker = this.drawboard.markerMap[ev.id]; if (marker) { marker.setText(ev.data); } } }; return WhitePage; }(); exports.WhitePage = WhitePage; /***/ }), /***/ "./src/board/Whiteboard/index.less": /*!*****************************************!*\ !*** ./src/board/Whiteboard/index.less ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { var content = __webpack_require__(/*! !../../../node_modules/css-loader/dist/cjs.js??ref--11-1!../../../node_modules/postcss-loader/src!../../../node_modules/less-loader/dist/cjs.js??ref--11-3!./index.less */ "./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js!./node_modules/less-loader/dist/cjs.js?!./src/board/Whiteboard/index.less"); if(typeof content === 'string') content = [[module.i, content, '']]; var transform; var insertInto; var options = {"hmr":true} options.transform = transform options.insertInto = undefined; var update = __webpack_require__(/*! ../../../node_modules/style-loader/lib/addStyles.js */ "./node_modules/style-loader/lib/addStyles.js")(content, options); if(content.locals) module.exports = content.locals; if(false) {} /***/ }), /***/ "./src/board/Whiteboard/index.ts": /*!***************************************!*\ !*** ./src/board/Whiteboard/index.ts ***! \***************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Siema = __webpack_require__(/*! siema */ "./node_modules/siema/dist/siema.min.js"); var index_1 = __webpack_require__(/*! ../WhitePage/index */ "./src/board/WhitePage/index.ts"); var uuid_1 = __webpack_require__(/*! ../../utils/uuid */ "./src/utils/uuid.ts"); var dom_1 = __webpack_require__(/*! ../../utils/dom */ "./src/utils/dom.ts"); __webpack_require__(/*! ./index.less */ "./src/board/Whiteboard/index.less"); var LeftArrowIcon = __webpack_require__(/*! ../../assets/bx-left-arrow.svg */ "./src/assets/bx-left-arrow.svg"); var RightArrowIcon = __webpack_require__(/*! ../../assets/bx-right-arrow.svg */ "./src/assets/bx-right-arrow.svg"); var prefix = 'fcw-board'; var SerializableWhiteboard = function () { function SerializableWhiteboard() {} return SerializableWhiteboard; }(); exports.SerializableWhiteboard = SerializableWhiteboard; var Whiteboard = function () { function Whiteboard(target, _a) { var _b = _a === void 0 ? {} : _a, sources = _b.sources, eventHub = _b.eventHub, mode = _b.mode, visiblePageIndex = _b.visiblePageIndex; this.id = uuid_1.uuid(); this.sources = []; this.mode = 'master'; this.isFullscreen = false; this.pages = []; this.isInitialized = false; this.isSyncing = false; this.visiblePageIndex = 0; if (target) { this.target = target; } else { this.target = document.createElement('div'); document.body.appendChild(this.target); } if (!this.target.id) { this.target.id = this.id; } dom_1.addClassName(this.target, prefix); if (sources) { this.sources = sources; } this.eventHub = eventHub; if (mode) { this.mode = mode; } if (typeof visiblePageIndex !== 'undefined') { this.visiblePageIndex = visiblePageIndex; } this.init(); } Object.defineProperty(Whiteboard.prototype, "activePage", { get: function () { return this.pages[this.visiblePageIndex]; }, enumerable: true, configurable: true }); Whiteboard.prototype.open = function () { var _this = this; this.pages.forEach(function (page, i) { page.open(); if (i !== _this.visiblePageIndex) { page.hide(); } }); }; Whiteboard.prototype.close = function () { if (this.emitInterval) { clearInterval(this.emitInterval); } }; Whiteboard.prototype.show = function () { if (this.activePage) { this.activePage.show(); } }; Whiteboard.prototype.hide = function () { if (this.activePage) { this.activePage.hide(); } }; Whiteboard.prototype.snap = function () { return { id: this.id, sources: this.sources, pageIds: this.pages.map(function (page) { return page.id; }), visiblePageIndex: this.visiblePageIndex }; }; Whiteboard.prototype.init = function () { this.imgsContainer = dom_1.createDivWithClassName(prefix + "-imgs", this.target); this.pagesContainer = dom_1.createDivWithClassName(prefix + "-pages", this.target); if (this.mode === 'master') { this.initMaster(); this.emitSnapshot(); } if (this.mode === 'mirror') { this.initMirror(); } }; Whiteboard.prototype.initMaster = function () { var _this = this; this.sources.forEach(function (source) { var page = new index_1.WhitePage({ imgSrc: source }, { mode: _this.mode, eventHub: _this.eventHub, parentContainer: _this.pagesContainer }); page.container.style.visibility = 'hidden'; _this.pages.push(page); }); this.initSiema(); var controller = dom_1.createDivWithClassName(prefix + "-controller", this.target); var prevEle = dom_1.createDivWithClassName(prefix + "-flip-arrow", controller); prevEle.innerHTML = LeftArrowIcon; var nextEle = dom_1.createDivWithClassName(prefix + "-flip-arrow", controller); nextEle.innerHTML = RightArrowIcon; nextEle.addEventListener('click', function () { var nextPageIndex = _this.visiblePageIndex + 1 > _this.pages.length - 1 ? 0 : _this.visiblePageIndex + 1; _this.onPageChange(nextPageIndex); }); prevEle.addEventListener('click', function () { var nextPageIndex = _this.visiblePageIndex - 1 < 0 ? _this.pages.length - 1 : _this.visiblePageIndex - 1; _this.onPageChange(nextPageIndex); }); }; Whiteboard.prototype.initMirror = function () { var _this = this; if (!this.eventHub) { throw new Error('Invalid eventHub'); } this.eventHub.on('sync', function (ev) { if (ev.target !== 'whiteboard') { return; } if (ev.event === 'snap') { if (_this.isInitialized) { return; } _this.onSnapshot(ev.data); } if (ev.event === 'changeIndex' && ev.id === _this.id) { if (_this.isInitialized) { _this.onPageChange(ev.data); } } }); }; Whiteboard.prototype.initSiema = function () { var _this = this; this.sources.forEach(function (source) { var imgEle = document.createElement('img'); dom_1.addClassName(imgEle, prefix + "-img"); imgEle.src = source; imgEle.alt = 'Siema image'; _this.imgsContainer.appendChild(imgEle); }); this.siema = new Siema({ selector: this.imgsContainer, duration: 200, easing: 'ease-out', perPage: 1, startIndex: 0, draggable: false, multipleDrag: true, threshold: 20, loop: false, rtl: false }); }; Whiteboard.prototype.onPageChange = function (nextPageIndex) { this.siema.goTo(nextPageIndex); this.visiblePageIndex = nextPageIndex; this.pages.forEach(function (page, i) { if (nextPageIndex === i) { page.show(); } else { page.hide(); } }); if (this.mode === 'master' && this.eventHub) { this.eventHub.emit('sync', { event: 'changeIndex', id: this.id, target: 'whiteboard', data: nextPageIndex }); } }; Whiteboard.prototype.emitSnapshot = function () { var _this = this; var innerFunc = function () { if (_this.eventHub) { _this.eventHub.emit('sync', { event: 'snap', id: _this.id, target: 'whiteboard', data: _this.snap() }); } }; this.emitInterval = setInterval(function () { innerFunc(); }, 5 * 1000); setTimeout(innerFunc, 500); }; Whiteboard.prototype.onSnapshot = function (snap) { var _this = this; var id = snap.id, sources = snap.sources, pageIds = snap.pageIds, visiblePageIndex = snap.visiblePageIndex; if (!this.isInitialized && !this.isSyncing) { this.id = id; this.sources = sources; this.isSyncing = true; this.sources.forEach(function (source, i) { var page = new index_1.WhitePage({ imgSrc: source }, { mode: _this.mode, eventHub: _this.eventHub, parentContainer: _this.pagesContainer }); page.id = pageIds[i]; page.container.style.visibility = 'hidden'; _this.pages.push(page); page.open(); }); this.initSiema(); } this.isInitialized = true; this.isSyncing = false; this.onPageChange(visiblePageIndex); }; return Whiteboard; }(); exports.Whiteboard = Whiteboard; /***/ }), /***/ "./src/index.ts": /*!**********************!*\ !*** ./src/index.ts ***! \**********************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var Drawboard_1 = __webpack_require__(/*! ./board/Drawboard */ "./src/board/Drawboard/index.ts"); exports.Drawboard = Drawboard_1.Drawboard; var Whiteboard_1 = __webpack_require__(/*! ./board/Whiteboard */ "./src/board/Whiteboard/index.ts"); exports.Whiteboard = Whiteboard_1.Whiteboard; /***/ }), /***/ "./src/markers/ArrowMarker/index.ts": /*!******************************************!*\ !*** ./src/markers/ArrowMarker/index.ts ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var LinearMarker_1 = __webpack_require__(/*! ../LinearMarker */ "./src/markers/LinearMarker/index.ts"); var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts"); var ArrowMarker = function (_super) { __extends(ArrowMarker, _super); function ArrowMarker() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.type = 'arrow'; _this.ARROW_SIZE = 6; return _this; } ArrowMarker.prototype.setup = function () { _super.prototype.setup.call(this); SvgHelper_1.SvgHelper.setAttributes(this.visual, [['class', 'arrow-marker']]); var tip = SvgHelper_1.SvgHelper.createPolygon("0,0 " + this.ARROW_SIZE + "," + this.ARROW_SIZE / 2 + " 0," + this.ARROW_SIZE, [['class', 'arrow-marker-tip']]); this.defs.push(SvgHelper_1.SvgHelper.createMarker('arrow-marker-head', 'auto', this.ARROW_SIZE, this.ARROW_SIZE, this.ARROW_SIZE - 1, this.ARROW_SIZE / 2, tip)); this.markerLine.setAttribute('marker-end', 'url(#arrow-marker-head'); }; ArrowMarker.createMarker = function (page) { var marker = new ArrowMarker(); marker.page = page; marker.setup(); return marker; }; return ArrowMarker; }(LinearMarker_1.LinearMarker); exports.ArrowMarker = ArrowMarker; /***/ }), /***/ "./src/markers/BaseMarker/ResizeGrip.ts": /*!**********************************************!*\ !*** ./src/markers/BaseMarker/ResizeGrip.ts ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts"); var ResizeGrip = function () { function ResizeGrip() { this.GRIP_SIZE = 10; this.visual = SvgHelper_1.SvgHelper.createCircle(this.GRIP_SIZE, [['class', 'fc-whiteboard-control-grip']]); } return ResizeGrip; }(); exports.ResizeGrip = ResizeGrip; /***/ }), /***/ "./src/markers/BaseMarker/index.ts": /*!*****************************************!*\ !*** ./src/markers/BaseMarker/index.ts ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var uuid = __webpack_require__(/*! uuid/v1 */ "./node_modules/uuid/v1.js"); var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts"); var BaseMarker = function () { function BaseMarker() { var _this = this; this.id = uuid(); this.type = 'base'; this.onChange = function () {}; this.defs = []; this.width = 200; this.height = 50; this.isActive = true; this.isDragging = false; this.isResizing = false; this.previousMouseX = 0; this.previousMouseY = 0; this.manipulate = function (ev) { var scale = _this.visual.getScreenCTM().a; var dx = (ev.screenX - _this.previousMouseX) / scale; var dy = (ev.screenY - _this.previousMouseY) / scale; if (_this.isDragging) { _this.onChange({ target: 'marker', id: _this.id, event: 'move', data: { dx: dx, dy: dy } }); _this.move(dx, dy); } if (_this.isResizing) { _this.resize(dx, dy, function (pos) { _this.onChange({ target: 'marker', id: _this.id, event: 'resize', data: { dx: dx, dy: dy, pos: pos } }); }); } _this.previousMouseX = ev.screenX; _this.previousMouseY = ev.screenY; }; this.addToVisual = function (el) { _this.visual.appendChild(el); }; this.addToRenderVisual = function (el) { _this.renderVisual.appendChild(el); }; this.mouseDown = function (ev) { ev.stopPropagation(); if (_this.page && _this.page.mode === 'mirror') { return; } _this.select(); _this.isDragging = true; _this.previousMouseX = ev.screenX; _this.previousMouseY = ev.screenY; }; this.mouseUp = function (ev) { ev.stopPropagation(); _this.endManipulation(); }; this.mouseMove = function (ev) { ev.stopPropagation(); _this.manipulate(ev); }; this.move = function (dx, dy) { var translate = _this.visual.transform.baseVal.getItem(0); translate.setMatrix(translate.matrix.translate(dx, dy)); _this.visual.transform.baseVal.replaceItem(translate, 0); }; } BaseMarker.prototype.reactToManipulation = function (type, _a) { var dx = _a.dx, dy = _a.dy, pos = _a.pos; if (type === 'move') { this.move(dx, dy); } if (type === 'resize') { this.resizeByEvent(dx, dy, pos); } }; BaseMarker.prototype.endManipulation = function () { this.isDragging = false; this.isResizing = false; }; BaseMarker.prototype.select = function () { this.isActive = true; if (this.onSelected) { this.onSelected(this); } return; }; BaseMarker.prototype.deselect = function () { this.isActive = false; this.endManipulation(); return; }; BaseMarker.prototype.setup = function () { this.visual = SvgHelper_1.SvgHelper.createGroup(); this.visual.transform.baseVal.appendItem(SvgHelper_1.SvgHelper.createTransform()); this.visual.addEventListener('mousedown', this.mouseDown); this.visual.addEventListener('mouseup', this.mouseUp); this.visual.addEventListener('mousemove', this.mouseMove); this.visual.addEventListener('touchstart', this.onTouch, { passive: false }); this.visual.addEventListener('touchend', this.onTouch, { passive: false }); this.visual.addEventListener('touchmove', this.onTouch, { passive: false }); this.renderVisual = SvgHelper_1.SvgHelper.createGroup([['class', 'render-visual']]); this.visual.appendChild(this.renderVisual); }; BaseMarker.prototype.resize = function (x, y, cb) { return; }; BaseMarker.prototype.resizeByEvent = function (x, y, pos) { return; }; BaseMarker.prototype.onTouch = function (ev) { ev.preventDefault(); var newEvt = document.createEvent('MouseEvents'); var touch = ev.changedTouches[0]; var type = null; switch (ev.type) { case 'touchstart': type = 'mousedown'; break; case 'touchmove': type = 'mousemove'; break; case 'touchend': type = 'mouseup'; break; default: break; } newEvt.initMouseEvent(type, true, true, window, 0, touch.screenX, touch.screenY, touch.clientX, touch.clientY, ev.ctrlKey, ev.altKey, ev.shiftKey, ev.metaKey, 0, null); ev.target.dispatchEvent(newEvt); }; BaseMarker.createMarker = function (page) { var marker = new BaseMarker(); marker.page = page; marker.setup(); return marker; }; return BaseMarker; }(); exports.BaseMarker = BaseMarker; /***/ }), /***/ "./src/markers/CoverMarker/index.ts": /*!******************************************!*\ !*** ./src/markers/CoverMarker/index.ts ***! \******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts"); var RectBaseMarker_1 = __webpack_require__(/*! ../RectMarker/RectBaseMarker */ "./src/markers/RectMarker/RectBaseMarker.ts"); var CoverMarker = function (_super) { __extends(CoverMarker, _super); function CoverMarker() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.type = 'cover'; return _this; } CoverMarker.prototype.setup = function () { _super.prototype.setup.call(this); SvgHelper_1.SvgHelper.setAttributes(this.visual, [['class', 'cover-marker']]); }; CoverMarker.createMarker = function (page) { var marker = new CoverMarker(); marker.page = page; marker.setup(); return marker; }; return CoverMarker; }(RectBaseMarker_1.RectBaseMarker); exports.CoverMarker = CoverMarker; /***/ }), /***/ "./src/markers/HighlightMarker/index.ts": /*!**********************************************!*\ !*** ./src/markers/HighlightMarker/index.ts ***! \**********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts"); var RectBaseMarker_1 = __webpack_require__(/*! ../RectMarker/RectBaseMarker */ "./src/markers/RectMarker/RectBaseMarker.ts"); var HighlightMarker = function (_super) { __extends(HighlightMarker, _super); function HighlightMarker() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.type = 'highlight'; return _this; } HighlightMarker.prototype.setup = function () { _super.prototype.setup.call(this); SvgHelper_1.SvgHelper.setAttributes(this.visual, [['class', 'highlight-marker']]); }; HighlightMarker.createMarker = function (page) { var marker = new HighlightMarker(); marker.page = page; marker.setup(); return marker; }; return HighlightMarker; }(RectBaseMarker_1.RectBaseMarker); exports.HighlightMarker = HighlightMarker; /***/ }), /***/ "./src/markers/LineMarker/index.ts": /*!*****************************************!*\ !*** ./src/markers/LineMarker/index.ts ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var LinearMarker_1 = __webpack_require__(/*! ../LinearMarker */ "./src/markers/LinearMarker/index.ts"); var index_1 = __webpack_require__(/*! ./../../renderer/SvgHelper/index */ "./src/renderer/SvgHelper/index.ts"); var LineMarker = function (_super) { __extends(LineMarker, _super); function LineMarker() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.type = 'line'; return _this; } LineMarker.prototype.setup = function () { _super.prototype.setup.call(this); index_1.SvgHelper.setAttributes(this.visual, [['class', 'line-marker']]); }; LineMarker.createMarker = function (page) { var marker = new LineMarker(); marker.page = page; marker.setup(); return marker; }; return LineMarker; }(LinearMarker_1.LinearMarker); exports.LineMarker = LineMarker; /***/ }), /***/ "./src/markers/LinearMarker/index.ts": /*!*******************************************!*\ !*** ./src/markers/LinearMarker/index.ts ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var BaseMarker_1 = __webpack_require__(/*! ../BaseMarker */ "./src/markers/BaseMarker/index.ts"); var ResizeGrip_1 = __webpack_require__(/*! ../BaseMarker/ResizeGrip */ "./src/markers/BaseMarker/ResizeGrip.ts"); var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts"); var LinearMarker = function (_super) { __extends(LinearMarker, _super); function LinearMarker() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.MIN_LENGTH = 20; _this.x1 = 0; _this.y1 = 0; _this.x2 = _this.width; _this.y2 = 0; _this.getLineLength = function (x1, y1, x2, y2) { var dx = Math.abs(x1 - x2); var dy = Math.abs(y1 - y2); return Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2)); }; _this.addControlBox = function () { _this.controlBox = SvgHelper_1.SvgHelper.createGroup([['class', 'fc-whiteboard-line-control-box']]); _this.addToVisual(_this.controlBox); _this.addControlGrips(); }; _this.adjustControlBox = function () { _this.positionGrips(); }; _this.addControlGrips = function () { _this.controlGrips = { left: _this.createGrip(), right: _this.createGrip() }; _this.positionGrips(); }; _this.createGrip = function () { var grip = new ResizeGrip_1.ResizeGrip(); grip.visual.transform.baseVal.appendItem(SvgHelper_1.SvgHelper.createTransform()); _this.controlBox.appendChild(grip.visual); grip.visual.addEventListener('mousedown', _this.gripMouseDown); grip.visual.addEventListener('mousemove', _this.gripMouseMove); grip.visual.addEventListener('mouseup', _this.gripMouseUp); grip.visual.addEventListener('touchstart', _this.onTouch, { passive: false }); grip.visual.addEventListener('touchend', _this.onTouch, { passive: false }); grip.visual.addEventListener('touchmove', _this.onTouch, { passive: false }); return grip; }; _this.positionGrips = function () { var gripSize = _this.controlGrips.left.GRIP_SIZE; var x1 = _this.x1 - gripSize / 2; var y1 = _this.y1 - gripSize / 2; var x2 = _this.x2 - gripSize / 2; var y2 = _this.y2 - gripSize / 2; _this.positionGrip(_this.controlGrips.left.visual, x1, y1); _this.positionGrip(_this.controlGrips.right.visual, x2, y2); }; _this.positionGrip = function (grip, x, y) { var translate = grip.transform.baseVal.getItem(0); translate.setTranslate(x, y); grip.transform.baseVal.replaceItem(translate, 0); }; _this.gripMouseDown = function (ev) { _this.isResizing = true; _this.activeGrip = ev.target === _this.controlGrips.left.visual ? _this.controlGrips.left : _this.controlGrips.right; _this.previousMouseX = ev.screenX; _this.previousMouseY = ev.screenY; ev.stopPropagation(); }; _this.gripMouseUp = function (ev) { _this.isResizing = false; _this.activeGrip = null; ev.stopPropagation(); }; _this.gripMouseMove = function (ev) { if (_this.isResizing) { _this.resize(ev.movementX, ev.movementY); } }; return _this; } LinearMarker.prototype.endManipulation = function () { _super.prototype.endManipulation.call(this); this.isResizing = false; this.activeGrip = null; }; LinearMarker.prototype.select = function () { _super.prototype.select.call(this); this.controlBox.style.display = ''; }; LinearMarker.prototype.deselect = function () { _super.prototype.deselect.call(this); this.controlBox.style.display = 'none'; }; LinearMarker.prototype.setup = function () { _super.prototype.setup.call(this); this.markerBgLine = SvgHelper_1.SvgHelper.createLine(0, 0, this.x2, 0, [['stroke', 'transparent'], ['stroke-width', '30']]); this.addToRenderVisual(this.markerBgLine); this.markerLine = SvgHelper_1.SvgHelper.createLine(0, 0, this.x2, 0); this.addToRenderVisual(this.markerLine); this.addControlBox(); if (this.page && this.page.mode === 'mirror') { this.controlBox.style.display = 'none'; } }; LinearMarker.prototype.resize = function (x, y, onPosition) { if (this.activeGrip) { if (this.activeGrip === this.controlGrips.left && this.getLineLength(this.x1 + x, this.y1 + 1, this.x2, this.y2) >= this.MIN_LENGTH) { this.x1 += x; this.y1 += y; this.markerBgLine.setAttribute('x1', this.x1.toString()); this.markerBgLine.setAttribute('y1', this.y1.toString()); this.markerLine.setAttribute('x1', this.x1.toString()); this.markerLine.setAttribute('y1', this.y1.toString()); if (onPosition) { onPosition('left'); } } else if (this.activeGrip === this.controlGrips.right && this.getLineLength(this.x1, this.y1, this.x2 + x, this.y2 + y) >= this.MIN_LENGTH) { this.x2 += x; this.y2 += y; this.markerBgLine.setAttribute('x2', this.x2.toString()); this.markerBgLine.setAttribute('y2', this.y2.toString()); this.markerLine.setAttribute('x2', this.x2.toString()); this.markerLine.setAttribute('y2', this.y2.toString()); if (onPosition) { onPosition('right'); } } } this.adjustControlBox(); }; LinearMarker.prototype.resizeByEvent = function (x, y, pos) { if (pos === 'left') { this.activeGrip = this.controlGrips.left; } else { this.activeGrip = this.controlGrips.right; } this.resize(x, y); }; LinearMarker.createMarker = function (page) { var marker = new LinearMarker(); marker.page = page; marker.setup(); return marker; }; return LinearMarker; }(BaseMarker_1.BaseMarker); exports.LinearMarker = LinearMarker; /***/ }), /***/ "./src/markers/RectMarker/RectBaseMarker.ts": /*!**************************************************!*\ !*** ./src/markers/RectMarker/RectBaseMarker.ts ***! \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts"); var RectangularMarker_1 = __webpack_require__(/*! ../RectangularMarker */ "./src/markers/RectangularMarker/index.ts"); var RectBaseMarker = function (_super) { __extends(RectBaseMarker, _super); function RectBaseMarker() { return _super !== null && _super.apply(this, arguments) || this; } RectBaseMarker.prototype.setup = function () { _super.prototype.setup.call(this); this.markerRect = SvgHelper_1.SvgHelper.createRect(this.width, this.height); this.addToRenderVisual(this.markerRect); }; RectBaseMarker.prototype.resize = function (x, y, onPosition) { _super.prototype.resize.call(this, x, y, onPosition); this.markerRect.setAttribute('width', this.width.toString()); this.markerRect.setAttribute('height', this.height.toString()); }; RectBaseMarker.createMarker = function (page) { var marker = new RectBaseMarker(); marker.page = page; marker.setup(); return marker; }; return RectBaseMarker; }(RectangularMarker_1.RectangularMarker); exports.RectBaseMarker = RectBaseMarker; /***/ }), /***/ "./src/markers/RectMarker/index.ts": /*!*****************************************!*\ !*** ./src/markers/RectMarker/index.ts ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var RectBaseMarker_1 = __webpack_require__(/*! ./RectBaseMarker */ "./src/markers/RectMarker/RectBaseMarker.ts"); var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts"); var RectMarker = function (_super) { __extends(RectMarker, _super); function RectMarker() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.type = 'rect'; return _this; } RectMarker.prototype.setup = function () { _super.prototype.setup.call(this); SvgHelper_1.SvgHelper.setAttributes(this.visual, [['class', 'rect-marker']]); }; RectMarker.createMarker = function (page) { var marker = new RectMarker(); marker.page = page; marker.setup(); return marker; }; return RectMarker; }(RectBaseMarker_1.RectBaseMarker); exports.RectMarker = RectMarker; /***/ }), /***/ "./src/markers/RectangularMarker/RectangularMarkerGrips.ts": /*!*****************************************************************!*\ !*** ./src/markers/RectangularMarker/RectangularMarkerGrips.ts ***! \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var RectangularMarkerGrips = function () { function RectangularMarkerGrips() { var _this = this; this.findGripByVisual = function (gripVisual) { switch (gripVisual) { case _this.topLeft.visual: return _this.topLeft; case _this.topCenter.visual: return _this.topCenter; case _this.topRight.visual: return _this.topRight; case _this.centerLeft.visual: return _this.centerLeft; case _this.centerRight.visual: return _this.centerRight; case _this.bottomLeft.visual: return _this.bottomLeft; case _this.bottomCenter.visual: return _this.bottomCenter; case _this.bottomRight.visual: return _this.bottomRight; default: return _this.topLeft; } }; } return RectangularMarkerGrips; }(); exports.RectangularMarkerGrips = RectangularMarkerGrips; /***/ }), /***/ "./src/markers/RectangularMarker/index.ts": /*!************************************************!*\ !*** ./src/markers/RectangularMarker/index.ts ***! \************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var RectangularMarkerGrips_1 = __webpack_require__(/*! ./RectangularMarkerGrips */ "./src/markers/RectangularMarker/RectangularMarkerGrips.ts"); var BaseMarker_1 = __webpack_require__(/*! ../BaseMarker */ "./src/markers/BaseMarker/index.ts"); var ResizeGrip_1 = __webpack_require__(/*! ../BaseMarker/ResizeGrip */ "./src/markers/BaseMarker/ResizeGrip.ts"); var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts"); var RectangularMarker = function (_super) { __extends(RectangularMarker, _super); function RectangularMarker() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.MIN_SIZE = 5; _this.CB_DISTANCE = 10; _this.addControlBox = function () { _this.controlBox = SvgHelper_1.SvgHelper.createGroup([['class', 'fc-whiteboard-rect-control-box']]); var translate = SvgHelper_1.SvgHelper.createTransform(); translate.setTranslate(-_this.CB_DISTANCE / 2, -_this.CB_DISTANCE / 2); _this.controlBox.transform.baseVal.appendItem(translate); _this.addToVisual(_this.controlBox); _this.controlRect = SvgHelper_1.SvgHelper.createRect(_this.width + _this.CB_DISTANCE, _this.height + _this.CB_DISTANCE, [['class', 'fc-whiteboard-rect-control-rect']]); _this.controlBox.appendChild(_this.controlRect); _this.controlGrips = new RectangularMarkerGrips_1.RectangularMarkerGrips(); _this.addControlGrips(); }; _this.adjustControlBox = function () { _this.controlRect.setAttribute('width', (_this.width + _this.CB_DISTANCE).toString()); _this.controlRect.setAttribute('height', (_this.height + _this.CB_DISTANCE).toString()); _this.positionGrips(); }; _this.addControlGrips = function () { _this.controlGrips.topLeft = _this.createGrip(); _this.controlGrips.topCenter = _this.createGrip(); _this.controlGrips.topRight = _this.createGrip(); _this.controlGrips.centerLeft = _this.createGrip(); _this.controlGrips.centerRight = _this.createGrip(); _this.controlGrips.bottomLeft = _this.createGrip(); _this.controlGrips.bottomCenter = _this.createGrip(); _this.controlGrips.bottomRight = _this.createGrip(); _this.positionGrips(); }; _this.createGrip = function () { var grip = new ResizeGrip_1.ResizeGrip(); grip.visual.transform.baseVal.appendItem(SvgHelper_1.SvgHelper.createTransform()); _this.controlBox.appendChild(grip.visual); grip.visual.addEventListener('mousedown', _this.gripMouseDown); grip.visual.addEventListener('mousemove', _this.gripMouseMove); grip.visual.addEventListener('mouseup', _this.gripMouseUp); grip.visual.addEventListener('touchstart', _this.onTouch, { passive: false }); grip.visual.addEventListener('touchend', _this.onTouch, { passive: false }); grip.visual.addEventListener('touchmove', _this.onTouch, { passive: false }); return grip; }; _this.positionGrips = function () { var gripSize = _this.controlGrips.topLeft.GRIP_SIZE; var left = -gripSize / 2; var top = left; var cx = (_this.width + _this.CB_DISTANCE) / 2 - gripSize / 2; var cy = (_this.height + _this.CB_DISTANCE) / 2 - gripSize / 2; var bottom = _this.height + _this.CB_DISTANCE - gripSize / 2; var right = _this.width + _this.CB_DISTANCE - gripSize / 2; _this.positionGrip(_this.controlGrips.topLeft.visual, left, top); _this.positionGrip(_this.controlGrips.topCenter.visual, cx, top); _this.positionGrip(_this.controlGrips.topRight.visual, right, top); _this.positionGrip(_this.controlGrips.centerLeft.visual, left, cy); _this.positionGrip(_this.controlGrips.centerRight.visual, right, cy); _this.positionGrip(_this.controlGrips.bottomLeft.visual, left, bottom); _this.positionGrip(_this.controlGrips.bottomCenter.visual, cx, bottom); _this.positionGrip(_this.controlGrips.bottomRight.visual, right, bottom); }; _this.positionGrip = function (grip, x, y) { var translate = grip.transform.baseVal.getItem(0); translate.setTranslate(x, y); grip.transform.baseVal.replaceItem(translate, 0); }; _this.gripMouseDown = function (ev) { _this.isResizing = true; _this.activeGrip = _this.controlGrips.findGripByVisual(ev.target) || null; _this.previousMouseX = ev.screenX; _this.previousMouseY = ev.screenY; ev.stopPropagation(); }; _this.gripMouseUp = function (ev) { _this.isResizing = false; _this.activeGrip = null; ev.stopPropagation(); }; _this.gripMouseMove = function (ev) { if (_this.isResizing) { _this.manipulate(ev); } }; return _this; } RectangularMarker.prototype.endManipulation = function () { _super.prototype.endManipulation.call(this); this.isResizing = false; this.activeGrip = null; }; RectangularMarker.prototype.select = function () { _super.prototype.select.call(this); this.controlBox.style.display = ''; }; RectangularMarker.prototype.deselect = function () { _super.prototype.deselect.call(this); this.controlBox.style.display = 'none'; }; RectangularMarker.prototype.setup = function () { _super.prototype.setup.call(this); this.addControlBox(); if (this.page && this.page.mode === 'mirror') { this.controlBox.style.display = 'none'; } }; RectangularMarker.prototype.resizeByEvent = function (x, y, pos) { this.activeGrip = this.controlGrips[pos]; this.resize(x, y); }; RectangularMarker.prototype.resize = function (x, y, onPosition) { var translateX = 0; var translateY = 0; switch (this.activeGrip) { case this.controlGrips.topLeft: this.width -= x; this.height -= y; translateX += x; translateY += y; if (onPosition) { onPosition('topLeft'); } break; case this.controlGrips.bottomLeft: this.width -= x; this.height += y; translateX += x; if (onPosition) { onPosition('bottomLeft'); } break; case this.controlGrips.topRight: this.width += x; this.height -= y; translateY += y; if (onPosition) { onPosition('topRight'); } break; case this.controlGrips.bottomRight: this.width += x; this.height += y; if (onPosition) { onPosition('bottomRight'); } break; case this.controlGrips.centerLeft: this.width -= x; translateX += x; if (onPosition) { onPosition('centerLeft'); } break; case this.controlGrips.centerRight: this.width += x; if (onPosition) { onPosition('centerRight'); } break; case this.controlGrips.topCenter: this.height -= y; translateY += y; if (onPosition) { onPosition('topCenter'); } break; case this.controlGrips.bottomCenter: this.height += y; if (onPosition) { onPosition('bottomCenter'); } break; default: break; } if (this.width < this.MIN_SIZE) { var offset = this.MIN_SIZE - this.width; this.width = this.MIN_SIZE; if (translateX !== 0) { translateX -= offset; } } if (this.height < this.MIN_SIZE) { var offset = this.MIN_SIZE - this.height; this.height = this.MIN_SIZE; if (translateY !== 0) { translateY -= offset; } } if (translateX !== 0 || translateY !== 0) { var translate = this.visual.transform.baseVal.getItem(0); translate.setMatrix(translate.matrix.translate(translateX, translateY)); this.visual.transform.baseVal.replaceItem(translate, 0); } this.adjustControlBox(); }; RectangularMarker.prototype.onTouch = function (ev) { _super.prototype.onTouch.call(this, ev); }; RectangularMarker.createMarker = function (page) { var marker = new RectangularMarker(); marker.page = page; marker.setup(); return marker; }; return RectangularMarker; }(BaseMarker_1.BaseMarker); exports.RectangularMarker = RectangularMarker; /***/ }), /***/ "./src/markers/TextMarker/index.ts": /*!*****************************************!*\ !*** ./src/markers/TextMarker/index.ts ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; var __extends = this && this.__extends || function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; } || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; }(); Object.defineProperty(exports, "__esModule", { value: true }); var RectangularMarker_1 = __webpack_require__(/*! ../RectangularMarker */ "./src/markers/RectangularMarker/index.ts"); var SvgHelper_1 = __webpack_require__(/*! ../../renderer/SvgHelper */ "./src/renderer/SvgHelper/index.ts"); var OkIcon = __webpack_require__(/*! ../../assets/check.svg */ "./src/assets/check.svg"); var CancelIcon = __webpack_require__(/*! ../../assets/times.svg */ "./src/assets/times.svg"); var TextMarker = function (_super) { __extends(TextMarker, _super); function TextMarker() { var _this = _super !== null && _super.apply(this, arguments) || this; _this.type = 'text'; _this.MIN_SIZE = 50; _this.DEFAULT_TEXT = 'Double-click to edit text'; _this.text = _this.DEFAULT_TEXT; _this.inDoubleTap = false; _this.renderText = function () { var LINE_SIZE = '1.2em'; while (_this.textElement.lastChild) { _this.textElement.removeChild(_this.textElement.lastChild); } var lines = _this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/); for (var _i = 0, lines_1 = lines; _i < lines_1.length; _i++) { var line = lines_1[_i]; if (line.trim() === '') { line = ' '; } _this.textElement.appendChild(SvgHelper_1.SvgHelper.createTSpan(line, [['x', '0'], ['dy', LINE_SIZE]])); } setTimeout(_this.sizeText, 10); }; _this.sizeText = function () { var textSize = _this.textElement.getBBox(); var x = 0; var y = 0; var scale = 1.0; if (textSize.width > 0 && textSize.height > 0) { var xScale = _this.width * 1.0 / textSize.width; var yScale = _this.height * 1.0 / textSize.height; scale = Math.min(xScale, yScale); x = (_this.width - textSize.width * scale) / 2; y = (_this.height - textSize.height * scale) / 2; } _this.textElement.transform.baseVal.getItem(0).setTranslate(x, y); _this.textElement.transform.baseVal.getItem(1).setScale(scale, scale); }; _this.onDblClick = function (ev) { _this.showEditor(); }; _this.onTap = function (ev) { if (_this.inDoubleTap) { _this.inDoubleTap = false; _this.showEditor(); } else { _this.inDoubleTap = true; setTimeout(function () { _this.inDoubleTap = false; }, 300); } }; _this.showEditor = function () { _this.editor = document.createElement('div'); _this.editor.className = 'fc-whiteboard-text-editor'; _this.editorTextArea = document.createElement('textarea'); if (_this.text !== _this.DEFAULT_TEXT) { _this.editorTextArea.value = _this.text; } _this.editorTextArea.addEventListener('keydown', _this.onEditorKeyDown); _this.editor.appendChild(_this.editorTextArea); document.body.appendChild(_this.editor); var buttons = document.createElement('div'); buttons.className = 'fc-whiteboard-text-editor-button-bar'; _this.editor.appendChild(buttons); var okButton = document.createElement('div'); okButton.className = 'fc-whiteboard-text-editor-button'; okButton.innerHTML = OkIcon; okButton.addEventListener('click', _this.onEditorOkClick); buttons.appendChild(okButton); var cancelButton = document.createElement('div'); cancelButton.className = 'fc-whiteboard-text-editor-button'; cancelButton.innerHTML = CancelIcon; cancelButton.addEventListener('click', _this.closeEditor); buttons.appendChild(cancelButton); }; _this.onEditorOkClick = function (ev) { if (_this.editorTextArea.value.trim()) { _this.text = _this.editorTextArea.value; } else { _this.text = _this.DEFAULT_TEXT; } _this.onChange({ target: 'marker', id: _this.id, event: 'changeText', data: _this.text }); _this.renderText(); _this.closeEditor(); }; _this.closeEditor = function () { document.body.removeChild(_this.editor); }; _this.onEditorKeyDown = function (ev) { if (ev.key === 'Enter' && ev.ctrlKey) { ev.preventDefault(); _this.onEditorOkClick(null); } }; return _this; } TextMarker.prototype.setText = function (text) { this.text = text; this.renderText(); }; TextMarker.prototype.setup = function () { _super.prototype.setup.call(this); this.textElement = SvgHelper_1.SvgHelper.createText(); this.addToRenderVisual(this.textElement); SvgHelper_1.SvgHelper.setAttributes(this.visual, [['class', 'text-marker']]); this.textElement.transform.baseVal.appendItem(SvgHelper_1.SvgHelper.createTransform()); this.textElement.transform.baseVal.appendItem(SvgHelper_1.SvgHelper.createTransform()); this.renderText(); this.visual.addEventListener('dblclick', this.onDblClick); this.visual.addEventListener('touchstart', this.onTap); }; TextMarker.prototype.resize = function (x, y, onPosition) { _super.prototype.resize.call(this, x, y, onPosition); this.sizeText(); }; TextMarker.createMarker = function (page) { var marker = new TextMarker(); marker.page = page; marker.setup(); return marker; }; return TextMarker; }(RectangularMarker_1.RectangularMarker); exports.TextMarker = TextMarker; /***/ }), /***/ "./src/markers/types.ts": /*!******************************!*\ !*** ./src/markers/types.ts ***! \******************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var index_1 = __webpack_require__(/*! ./HighlightMarker/index */ "./src/markers/HighlightMarker/index.ts"); var index_2 = __webpack_require__(/*! ./TextMarker/index */ "./src/markers/TextMarker/index.ts"); var index_3 = __webpack_require__(/*! ./ArrowMarker/index */ "./src/markers/ArrowMarker/index.ts"); var index_4 = __webpack_require__(/*! ./BaseMarker/index */ "./src/markers/BaseMarker/index.ts"); var CoverMarker_1 = __webpack_require__(/*! ./CoverMarker */ "./src/markers/CoverMarker/index.ts"); var LineMarker_1 = __webpack_require__(/*! ./LineMarker */ "./src/markers/LineMarker/index.ts"); var RectMarker_1 = __webpack_require__(/*! ./RectMarker */ "./src/markers/RectMarker/index.ts"); function getMarkerByType(type) { switch (type) { case 'arrow': return index_3.ArrowMarker; case 'base': return index_4.BaseMarker; case 'cover': return CoverMarker_1.CoverMarker; case 'highlight': return index_1.HighlightMarker; case 'line': return LineMarker_1.LineMarker; case 'rect': return RectMarker_1.RectMarker; case 'text': return index_2.TextMarker; default: return index_4.BaseMarker; } } exports.getMarkerByType = getMarkerByType; /***/ }), /***/ "./src/renderer/SvgHelper/index.ts": /*!*****************************************!*\ !*** ./src/renderer/SvgHelper/index.ts ***! \*****************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var SvgHelper = function () { function SvgHelper() {} SvgHelper.createRect = function (width, height, attributes) { var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect'); rect.setAttribute('width', width.toString()); rect.setAttribute('height', height.toString()); if (attributes) { SvgHelper.setAttributes(rect, attributes); } return rect; }; SvgHelper.createLine = function (x1, y1, x2, y2, attributes) { var line = document.createElementNS('http://www.w3.org/2000/svg', 'line'); line.setAttribute('x1', x1.toString()); line.setAttribute('y1', y1.toString()); line.setAttribute('x2', x2.toString()); line.setAttribute('y2', y2.toString()); if (attributes) { SvgHelper.setAttributes(line, attributes); } return line; }; SvgHelper.createPolygon = function (points, attributes) { var polygon = document.createElementNS('http://www.w3.org/2000/svg', 'polygon'); polygon.setAttribute('points', points); if (attributes) { SvgHelper.setAttributes(polygon, attributes); } return polygon; }; SvgHelper.createCircle = function (radius, attributes) { var circle = document.createElementNS('http://www.w3.org/2000/svg', 'circle'); circle.setAttribute('cx', (radius / 2).toString()); circle.setAttribute('cy', (radius / 2).toString()); circle.setAttribute('r', radius.toString()); if (attributes) { SvgHelper.setAttributes(circle, attributes); } return circle; }; SvgHelper.createGroup = function (attributes) { var g = document.createElementNS('http://www.w3.org/2000/svg', 'g'); if (attributes) { SvgHelper.setAttributes(g, attributes); } return g; }; SvgHelper.setAttributes = function (el, attributes) { for (var _i = 0, attributes_1 = attributes; _i < attributes_1.length; _i++) { var _a = attributes_1[_i], attr = _a[0], value = _a[1]; el.setAttribute(attr, value); } }; SvgHelper.createTransform = function () { var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); return svg.createSVGTransform(); }; SvgHelper.createDefs = function () { var defs = document.createElementNS('http://www.w3.org/2000/svg', 'defs'); return defs; }; SvgHelper.createMarker = function (id, orient, markerWidth, markerHeight, refX, refY, markerElement) { var marker = document.createElementNS('http://www.w3.org/2000/svg', 'marker'); SvgHelper.setAttributes(marker, [['id', id], ['orient', orient], ['markerWidth', markerWidth.toString()], ['markerHeight', markerHeight.toString()], ['refX', refX.toString()], ['refY', refY.toString()]]); marker.appendChild(markerElement); return marker; }; SvgHelper.createText = function (attributes) { var text = document.createElementNS('http://www.w3.org/2000/svg', 'text'); text.setAttribute('x', '0'); text.setAttribute('y', '0'); if (attributes) { SvgHelper.setAttributes(text, attributes); } return text; }; SvgHelper.createTSpan = function (text, attributes) { var tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan'); tspan.textContent = text; if (attributes) { SvgHelper.setAttributes(tspan, attributes); } return tspan; }; return SvgHelper; }(); exports.SvgHelper = SvgHelper; /***/ }), /***/ "./src/renderer/Synthetizer/index.ts": /*!*******************************************!*\ !*** ./src/renderer/Synthetizer/index.ts ***! \*******************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var validator_1 = __webpack_require__(/*! ../../utils/validator */ "./src/utils/validator.ts"); var Synthetizer = function () { function Synthetizer() {} Synthetizer.prototype.rasterize = function (target, markerImage, done) { if (!validator_1.isHTMLImageElement(target)) { throw new Error('Error: only support export HTMLImageElement'); } var canvas = document.createElement('canvas'); canvas.width = markerImage.width.baseVal.value; canvas.height = markerImage.height.baseVal.value; var data = markerImage.outerHTML; var ctx = canvas.getContext('2d'); if (!ctx) { throw new Error('Invalid ctx'); } ctx.drawImage(target, 0, 0, canvas.width, canvas.height); var DOMURL = window.URL; var img = new Image(canvas.width, canvas.height); img.setAttribute('crossOrigin', 'anonymous'); var blob = new Blob([data], { type: 'image/svg+xml' }); var url = DOMURL.createObjectURL(blob); img.onload = function () { ctx.drawImage(img, 0, 0); DOMURL.revokeObjectURL(url); done(canvas.toDataURL('image/png')); }; img.src = url; }; return Synthetizer; }(); exports.Synthetizer = Synthetizer; /***/ }), /***/ "./src/toolbar/Toolbar.ts": /*!********************************!*\ !*** ./src/toolbar/Toolbar.ts ***! \********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var ToolbarButton_1 = __webpack_require__(/*! ./ToolbarButton */ "./src/toolbar/ToolbarButton.ts"); var uuid_1 = __webpack_require__(/*! ../utils/uuid */ "./src/utils/uuid.ts"); var Toolbar = function () { function Toolbar(toolbarItems, clickHandler) { var _this = this; this.id = uuid_1.uuid(); this.getUI = function () { _this.toolbarUI = document.createElement('div'); _this.toolbarUI.id = "fcw-toolbar-" + _this.id; _this.toolbarUI.className = 'fc-whiteboard-toolbar'; for (var _i = 0, _a = _this.toolbarItems; _i < _a.length; _i++) { var toolbarItem = _a[_i]; var toolbarButton = new ToolbarButton_1.ToolbarButton(toolbarItem, _this.clickHandler); _this.toolbarUI.appendChild(toolbarButton.getElement()); } return _this.toolbarUI; }; this.toolbarItems = toolbarItems; this.clickHandler = clickHandler; } Toolbar.prototype.hide = function () { this.toolbarUI.style.visibility = 'hidden'; this.toolbarUI.style.zIndex = '-1'; }; Toolbar.prototype.show = function () { this.toolbarUI.style.visibility = 'visible'; this.toolbarUI.style.zIndex = '999'; }; return Toolbar; }(); exports.Toolbar = Toolbar; /***/ }), /***/ "./src/toolbar/ToolbarButton.ts": /*!**************************************!*\ !*** ./src/toolbar/ToolbarButton.ts ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var ToolbarButton = function () { function ToolbarButton(toolbarItem, clickHandler) { var _this = this; this.getElement = function () { var div = document.createElement('div'); if (_this.toolbarItem.name !== 'separator') { div.className = 'fc-whiteboard-toolbar-button'; if (_this.clickHandler) { div.addEventListener('click', function (ev) { if (_this.clickHandler) { _this.clickHandler(ev, _this.toolbarItem); } }); } if (_this.toolbarItem.icon) { div.title = _this.toolbarItem.tooltipText; div.innerHTML = _this.toolbarItem.icon; } else { div.innerText = _this.toolbarItem.tooltipText; } } else { div.className = 'fc-whiteboard-toolbar-separator'; } return div; }; this.toolbarItem = toolbarItem; if (clickHandler) { this.clickHandler = clickHandler; } } return ToolbarButton; }(); exports.ToolbarButton = ToolbarButton; /***/ }), /***/ "./src/toolbar/ToolbarItem.ts": /*!************************************!*\ !*** ./src/toolbar/ToolbarItem.ts ***! \************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var ToolbarItem = function () { function ToolbarItem(_a) { var name = _a.name, tooltipText = _a.tooltipText, icon = _a.icon, markerType = _a.markerType; this.name = name; this.tooltipText = tooltipText; this.icon = icon; this.markerType = markerType; } return ToolbarItem; }(); exports.ToolbarItem = ToolbarItem; /***/ }), /***/ "./src/toolbar/toolbar-items.ts": /*!**************************************!*\ !*** ./src/toolbar/toolbar-items.ts ***! \**************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var index_1 = __webpack_require__(/*! ./../markers/RectMarker/index */ "./src/markers/RectMarker/index.ts"); var index_2 = __webpack_require__(/*! ./../markers/CoverMarker/index */ "./src/markers/CoverMarker/index.ts"); var index_3 = __webpack_require__(/*! ./../markers/TextMarker/index */ "./src/markers/TextMarker/index.ts"); var index_4 = __webpack_require__(/*! ./../markers/ArrowMarker/index */ "./src/markers/ArrowMarker/index.ts"); var index_5 = __webpack_require__(/*! ./../markers/HighlightMarker/index */ "./src/markers/HighlightMarker/index.ts"); var ToolbarItem_1 = __webpack_require__(/*! ./ToolbarItem */ "./src/toolbar/ToolbarItem.ts"); var LineMarker_1 = __webpack_require__(/*! ../markers/LineMarker */ "./src/markers/LineMarker/index.ts"); var OkIcon = __webpack_require__(/*! ../assets/check.svg */ "./src/assets/check.svg"); var DeleteIcon = __webpack_require__(/*! ../assets/eraser.svg */ "./src/assets/eraser.svg"); var PointerIcon = __webpack_require__(/*! ../assets/mouse-pointer.svg */ "./src/assets/mouse-pointer.svg"); var CloseIcon = __webpack_require__(/*! ../assets/times.svg */ "./src/assets/times.svg"); exports.highlightMarkerToolbarItem = new ToolbarItem_1.ToolbarItem({ name: 'cover-marker', tooltipText: 'Cover', icon: __webpack_require__(/*! ../assets/highlight.svg */ "./src/assets/highlight.svg"), markerType: index_5.HighlightMarker }); exports.arrowMarkerToolbarItem = new ToolbarItem_1.ToolbarItem({ name: 'arrow-marker', tooltipText: 'Arrow', icon: __webpack_require__(/*! ../assets/arrow.svg */ "./src/assets/arrow.svg"), markerType: index_4.ArrowMarker }); exports.textMarkerToolbarItem = new ToolbarItem_1.ToolbarItem({ name: 'text-marker', tooltipText: 'Text', icon: __webpack_require__(/*! ../assets/text.svg */ "./src/assets/text.svg"), markerType: index_3.TextMarker }); exports.coverMarkerToolbarItem = new ToolbarItem_1.ToolbarItem({ name: 'cover-marker', tooltipText: 'Cover', icon: __webpack_require__(/*! ../assets/cover.svg */ "./src/assets/cover.svg"), markerType: index_2.CoverMarker }); exports.rectMarkerToolbarItem = new ToolbarItem_1.ToolbarItem({ name: 'rect-marker', tooltipText: 'Rectangle', icon: __webpack_require__(/*! ../assets/rect.svg */ "./src/assets/rect.svg"), markerType: index_1.RectMarker }); exports.lineMarkerToolbarItem = new ToolbarItem_1.ToolbarItem({ name: 'line-marker', tooltipText: 'Line', icon: __webpack_require__(/*! ../assets/line.svg */ "./src/assets/line.svg"), markerType: LineMarker_1.LineMarker }); function getToolbars(page) { var toolbars = [{ icon: PointerIcon, name: 'pointer', tooltipText: 'Pointer' }, { icon: DeleteIcon, name: 'delete', tooltipText: 'Delete' }, { name: 'separator', tooltipText: '' }, exports.rectMarkerToolbarItem, exports.coverMarkerToolbarItem, exports.highlightMarkerToolbarItem, exports.lineMarkerToolbarItem, exports.arrowMarkerToolbarItem, exports.textMarkerToolbarItem, { name: 'separator', tooltipText: '' }]; if (!page) { toolbars.push.apply(toolbars, [{ icon: OkIcon, name: 'ok', tooltipText: 'OK' }]); } toolbars.push({ icon: CloseIcon, name: 'close', tooltipText: 'Close' }); return toolbars; } exports.getToolbars = getToolbars; /***/ }), /***/ "./src/utils/dom.ts": /*!**************************!*\ !*** ./src/utils/dom.ts ***! \**************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function createDivWithClassName(className, parent) { var ele = document.createElement('div'); if (parent) { parent.appendChild(ele); } if (className) { addClassName(ele, className); } return ele; } exports.createDivWithClassName = createDivWithClassName; function addClassName(ele, className) { if (!ele) { return; } ele.className = ((ele.className || '') + " " + className).trim(); } exports.addClassName = addClassName; /***/ }), /***/ "./src/utils/uuid.ts": /*!***************************!*\ !*** ./src/utils/uuid.ts ***! \***************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var uuidV1 = __webpack_require__(/*! uuid/v1 */ "./node_modules/uuid/v1.js"); exports.uuid = uuidV1; /***/ }), /***/ "./src/utils/validator.ts": /*!********************************!*\ !*** ./src/utils/validator.ts ***! \********************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); function isHTMLImageElement(ele) { if (typeof ele === 'object' && ele instanceof HTMLImageElement) { return true; } return false; } exports.isHTMLImageElement = isHTMLImageElement; /***/ }) /******/ }); }); //# sourceMappingURL=index.js.map