123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537 |
- (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<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,i,r){return i&&e(t.prototype,i),r&&e(t,r),t}}(),l=function(){function e(t){var i=this;if(r(this,e),this.config=e.mergeSettings(t),this.selector="string"==typeof this.config.selector?document.querySelector(this.config.selector):this.config.selector,null===this.selector)throw new Error("Something wrong with your selector 😭");this.resolveSlidesNumber(),this.selectorWidth=this.selector.offsetWidth,this.innerElements=[].slice.call(this.selector.children),this.currentSlide=this.config.loop?this.config.startIndex%this.innerElements.length:Math.max(0,Math.min(this.config.startIndex,this.innerElements.length-this.perPage)),this.transformProperty=e.webkitOrNot(),["resizeHandler","touchstartHandler","touchendHandler","touchmoveHandler","mousedownHandler","mouseupHandler","mouseleaveHandler","mousemoveHandler","clickHandler"].forEach(function(e){i[e]=i[e].bind(i)}),this.init()}return s(e,[{key:"attachEvents",value:function(){window.addEventListener("resize",this.resizeHandler),this.config.draggable&&(this.pointerDown=!1,this.drag={startX:0,endX:0,startY:0,letItGo:null,preventClick:!1},this.selector.addEventListener("touchstart",this.touchstartHandler),this.selector.addEventListener("touchend",this.touchendHandler),this.selector.addEventListener("touchmove",this.touchmoveHandler),this.selector.addEventListener("mousedown",this.mousedownHandler),this.selector.addEventListener("mouseup",this.mouseupHandler),this.selector.addEventListener("mouseleave",this.mouseleaveHandler),this.selector.addEventListener("mousemove",this.mousemoveHandler),this.selector.addEventListener("click",this.clickHandler))}},{key:"detachEvents",value:function(){window.removeEventListener("resize",this.resizeHandler),this.selector.removeEventListener("touchstart",this.touchstartHandler),this.selector.removeEventListener("touchend",this.touchendHandler),this.selector.removeEventListener("touchmove",this.touchmoveHandler),this.selector.removeEventListener("mousedown",this.mousedownHandler),this.selector.removeEventListener("mouseup",this.mouseupHandler),this.selector.removeEventListener("mouseleave",this.mouseleaveHandler),this.selector.removeEventListener("mousemove",this.mousemoveHandler),this.selector.removeEventListener("click",this.clickHandler)}},{key:"init",value:function(){this.attachEvents(),this.selector.style.overflow="hidden",this.selector.style.direction=this.config.rtl?"rtl":"ltr",this.buildSliderFrame(),this.config.onInit.call(this)}},{key:"buildSliderFrame",value:function(){var e=this.selectorWidth/this.perPage,t=this.config.loop?this.innerElements.length+2*this.perPage:this.innerElements.length;this.sliderFrame=document.createElement("div"),this.sliderFrame.style.width=e*t+"px",this.enableTransition(),this.config.draggable&&(this.selector.style.cursor="-webkit-grab");var i=document.createDocumentFragment();if(this.config.loop)for(var r=this.innerElements.length-this.perPage;r<this.innerElements.length;r++){var n=this.buildSliderFrameItem(this.innerElements[r].cloneNode(!0));i.appendChild(n)}for(var s=0;s<this.innerElements.length;s++){var l=this.buildSliderFrameItem(this.innerElements[s]);i.appendChild(l)}if(this.config.loop)for(var o=0;o<this.perPage;o++){var a=this.buildSliderFrameItem(this.innerElements[o].cloneNode(!0));i.appendChild(a)}this.sliderFrame.appendChild(i),this.selector.innerHTML="",this.selector.appendChild(this.sliderFrame),this.slideToCurrent()}},{key:"buildSliderFrameItem",value:function(e){var t=document.createElement("div");return t.style.cssFloat=this.config.rtl?"right":"left",t.style.float=this.config.rtl?"right":"left",t.style.width=(this.config.loop?100/(this.innerElements.length+2*this.perPage):100/this.innerElements.length)+"%",t.appendChild(e),t}},{key:"resolveSlidesNumber",value:function(){if("number"==typeof this.config.perPage)this.perPage=this.config.perPage;else if("object"===n(this.config.perPage)){this.perPage=1;for(var e in this.config.perPage)window.innerWidth>=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)<Math.abs(this.drag.startX-e.touches[0].pageX)),this.pointerDown&&this.drag.letItGo){e.preventDefault(),this.drag.endX=e.touches[0].pageX,this.sliderFrame.style.webkitTransition="all 0ms "+this.config.easing,this.sliderFrame.style.transition="all 0ms "+this.config.easing;var t=this.config.loop?this.currentSlide+this.perPage:this.currentSlide,i=t*(this.selectorWidth/this.perPage),r=this.drag.endX-this.drag.startX,n=this.config.rtl?i+r:i-r;this.sliderFrame.style[this.transformProperty]="translate3d("+(this.config.rtl?1:-1)*n+"px, 0, 0)"}}},{key:"mousedownHandler",value:function(e){-1!==["TEXTAREA","OPTION","INPUT","SELECT"].indexOf(e.target.nodeName)||(e.preventDefault(),e.stopPropagation(),this.pointerDown=!0,this.drag.startX=e.pageX)}},{key:"mouseupHandler",value:function(e){e.stopPropagation(),this.pointerDown=!1,this.selector.style.cursor="-webkit-grab",this.enableTransition(),this.drag.endX&&this.updateAfterDrag(),this.clearDrag()}},{key:"mousemoveHandler",value:function(e){if(e.preventDefault(),this.pointerDown){"A"===e.target.nodeName&&(this.drag.preventClick=!0),this.drag.endX=e.pageX,this.selector.style.cursor="-webkit-grabbing",this.sliderFrame.style.webkitTransition="all 0ms "+this.config.easing,this.sliderFrame.style.transition="all 0ms "+this.config.easing;var t=this.config.loop?this.currentSlide+this.perPage:this.currentSlide,i=t*(this.selectorWidth/this.perPage),r=this.drag.endX-this.drag.startX,n=this.config.rtl?i+r:i-r;this.sliderFrame.style[this.transformProperty]="translate3d("+(this.config.rtl?1:-1)*n+"px, 0, 0)"}}},{key:"mouseleaveHandler",value:function(e){this.pointerDown&&(this.pointerDown=!1,this.selector.style.cursor="-webkit-grab",this.drag.endX=e.pageX,this.drag.preventClick=!1,this.enableTransition(),this.updateAfterDrag(),this.clearDrag())}},{key:"clickHandler",value:function(e){this.drag.preventClick&&e.preventDefault(),this.drag.preventClick=!1}},{key:"remove",value:function(e,t){if(e<0||e>=this.innerElements.length)throw new Error("Item to remove doesn't exist 😭");var i=e<this.currentSlide,r=this.currentSlide+this.perPage-1===e;(i||r)&&this.currentSlide--,this.innerElements.splice(e,1),this.buildSliderFrame(),t&&t.call(this)}},{key:"insert",value:function(e,t,i){if(t<0||t>this.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<this.innerElements.length;r++)i.appendChild(this.innerElements[r]);this.selector.innerHTML="",this.selector.appendChild(i),this.selector.removeAttribute("style")}t&&t.call(this)}}],[{key:"mergeSettings",value:function(e){var t={selector:".siema",duration:200,easing:"ease-out",perPage:1,startIndex:0,draggable:!0,multipleDrag:!0,threshold:20,loop:!1,rtl:!1,onInit:function(){},onChange:function(){}},i=e;for(var r in i)t[r]=i[r];return t}},{key:"webkitOrNot",value:function(){return"string"==typeof document.documentElement.style.transform?"transform":"WebkitTransform"}}]),e}();t.default=l,e.exports=t.default}])});
-
- /***/ }),
-
- /***/ "./node_modules/style-loader/lib/addStyles.js":
- /*!****************************************************!*\
- !*** ./node_modules/style-loader/lib/addStyles.js ***!
- \****************************************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- /*
- MIT License http://www.opensource.org/licenses/mit-license.php
- Author Tobias Koppers @sokra
- */
-
- var stylesInDom = {};
-
- var memoize = function (fn) {
- var memo;
-
- return function () {
- if (typeof memo === "undefined") memo = fn.apply(this, arguments);
- return memo;
- };
- };
-
- var isOldIE = memoize(function () {
- // Test for IE <= 9 as proposed by Browserhacks
- // @see http://browserhacks.com/#hack-e71d8692f65334173fee715c222cb805
- // Tests for existence of standard globals is to allow style-loader
- // to operate correctly into non-standard environments
- // @see https://github.com/webpack-contrib/style-loader/issues/177
- return window && document && document.all && !window.atob;
- });
-
- var getTarget = function (target, parent) {
- if (parent){
- return parent.querySelector(target);
- }
- return document.querySelector(target);
- };
-
- var getElement = (function (fn) {
- var memo = {};
-
- return function(target, parent) {
- // If passing function in options, then use it for resolve "head" element.
- // Useful for Shadow Root style i.e
- // {
- // insertInto: function () { return document.querySelector("#foo").shadowRoot }
- // }
- if (typeof target === 'function') {
- return target();
- }
- if (typeof memo[target] === "undefined") {
- var styleTarget = getTarget.call(this, target, parent);
- // Special case to return head of iframe instead of iframe itself
- if (window.HTMLIFrameElement && styleTarget instanceof window.HTMLIFrameElement) {
- try {
- // This will throw an exception if access to iframe is blocked
- // due to cross-origin restrictions
- styleTarget = styleTarget.contentDocument.head;
- } catch(e) {
- styleTarget = null;
- }
- }
- memo[target] = styleTarget;
- }
- return memo[target]
- };
- })();
-
- var singleton = null;
- var singletonCounter = 0;
- var stylesInsertedAtTop = [];
-
- var fixUrls = __webpack_require__(/*! ./urls */ "./node_modules/style-loader/lib/urls.js");
-
- module.exports = function(list, options) {
- if (typeof DEBUG !== "undefined" && DEBUG) {
- if (typeof document !== "object") throw new Error("The style-loader cannot be used in a non-browser environment");
- }
-
- options = options || {};
-
- options.attrs = typeof options.attrs === "object" ? options.attrs : {};
-
- // Force single-tag solution on IE6-9, which has a hard limit on the # of <style>
- // tags it will allow on a page
- if (!options.singleton && typeof options.singleton !== "boolean") options.singleton = isOldIE();
-
- // By default, add <style> tags to the <head> element
- if (!options.insertInto) options.insertInto = "head";
-
- // By default, add <style> tags to the bottom of the target
- if (!options.insertAt) options.insertAt = "bottom";
-
- var styles = listToStyles(list, options);
-
- addStylesToDom(styles, options);
-
- return function update (newList) {
- var mayRemove = [];
-
- for (var i = 0; i < styles.length; i++) {
- var item = styles[i];
- var domStyle = stylesInDom[item.id];
-
- domStyle.refs--;
- mayRemove.push(domStyle);
- }
-
- if(newList) {
- var newStyles = listToStyles(newList, options);
- addStylesToDom(newStyles, options);
- }
-
- for (var i = 0; i < mayRemove.length; i++) {
- var domStyle = mayRemove[i];
-
- if(domStyle.refs === 0) {
- for (var j = 0; j < domStyle.parts.length; j++) domStyle.parts[j]();
-
- delete stylesInDom[domStyle.id];
- }
- }
- };
- };
-
- function addStylesToDom (styles, options) {
- for (var i = 0; i < styles.length; i++) {
- var item = styles[i];
- var domStyle = stylesInDom[item.id];
-
- if(domStyle) {
- domStyle.refs++;
-
- for(var j = 0; j < domStyle.parts.length; j++) {
- domStyle.parts[j](item.parts[j]);
- }
-
- for(; j < item.parts.length; j++) {
- domStyle.parts.push(addStyle(item.parts[j], options));
- }
- } else {
- var parts = [];
-
- for(var j = 0; j < item.parts.length; j++) {
- parts.push(addStyle(item.parts[j], options));
- }
-
- stylesInDom[item.id] = {id: item.id, refs: 1, parts: parts};
- }
- }
- }
-
- function listToStyles (list, options) {
- var styles = [];
- var newStyles = {};
-
- for (var i = 0; i < list.length; i++) {
- var item = list[i];
- var id = options.base ? item[0] + options.base : item[0];
- var css = item[1];
- var media = item[2];
- var sourceMap = item[3];
- var part = {css: css, media: media, sourceMap: sourceMap};
-
- if(!newStyles[id]) styles.push(newStyles[id] = {id: id, parts: [part]});
- else newStyles[id].parts.push(part);
- }
-
- return styles;
- }
-
- function insertStyleElement (options, style) {
- var target = getElement(options.insertInto)
-
- if (!target) {
- throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");
- }
-
- var lastStyleElementInsertedAtTop = stylesInsertedAtTop[stylesInsertedAtTop.length - 1];
-
- if (options.insertAt === "top") {
- if (!lastStyleElementInsertedAtTop) {
- target.insertBefore(style, target.firstChild);
- } else if (lastStyleElementInsertedAtTop.nextSibling) {
- target.insertBefore(style, lastStyleElementInsertedAtTop.nextSibling);
- } else {
- target.appendChild(style);
- }
- stylesInsertedAtTop.push(style);
- } else if (options.insertAt === "bottom") {
- target.appendChild(style);
- } else if (typeof options.insertAt === "object" && options.insertAt.before) {
- var nextSibling = getElement(options.insertAt.before, target);
- target.insertBefore(style, nextSibling);
- } else {
- throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");
- }
- }
-
- function removeStyleElement (style) {
- if (style.parentNode === null) return false;
- style.parentNode.removeChild(style);
-
- var idx = stylesInsertedAtTop.indexOf(style);
- if(idx >= 0) {
- stylesInsertedAtTop.splice(idx, 1);
- }
- }
-
- function createStyleElement (options) {
- var style = document.createElement("style");
-
- if(options.attrs.type === undefined) {
- options.attrs.type = "text/css";
- }
-
- if(options.attrs.nonce === undefined) {
- var nonce = getNonce();
- if (nonce) {
- options.attrs.nonce = nonce;
- }
- }
-
- addAttrs(style, options.attrs);
- insertStyleElement(options, style);
-
- return style;
- }
-
- function createLinkElement (options) {
- var link = document.createElement("link");
-
- if(options.attrs.type === undefined) {
- options.attrs.type = "text/css";
- }
- options.attrs.rel = "stylesheet";
-
- addAttrs(link, options.attrs);
- insertStyleElement(options, link);
-
- return link;
- }
-
- function addAttrs (el, attrs) {
- Object.keys(attrs).forEach(function (key) {
- el.setAttribute(key, attrs[key]);
- });
- }
-
- function getNonce() {
- if (false) {}
-
- return __webpack_require__.nc;
- }
-
- function addStyle (obj, options) {
- var style, update, remove, result;
-
- // If a transform function was defined, run it on the css
- if (options.transform && obj.css) {
- result = typeof options.transform === 'function'
- ? options.transform(obj.css)
- : options.transform.default(obj.css);
-
- if (result) {
- // If transform returns a value, use that instead of the original css.
- // This allows running runtime transformations on the css.
- obj.css = result;
- } else {
- // If the transform function returns a falsy value, don't add this css.
- // This allows conditional loading of css
- return function() {
- // noop
- };
- }
- }
-
- if (options.singleton) {
- var styleIndex = singletonCounter++;
-
- style = singleton || (singleton = createStyleElement(options));
-
- update = applyToSingletonTag.bind(null, style, styleIndex, false);
- remove = applyToSingletonTag.bind(null, style, styleIndex, true);
-
- } else if (
- obj.sourceMap &&
- typeof URL === "function" &&
- typeof URL.createObjectURL === "function" &&
- typeof URL.revokeObjectURL === "function" &&
- typeof Blob === "function" &&
- typeof btoa === "function"
- ) {
- style = createLinkElement(options);
- update = updateLink.bind(null, style, options);
- remove = function () {
- removeStyleElement(style);
-
- if(style.href) URL.revokeObjectURL(style.href);
- };
- } else {
- style = createStyleElement(options);
- update = applyToTag.bind(null, style);
- remove = function () {
- removeStyleElement(style);
- };
- }
-
- update(obj);
-
- return function updateStyle (newObj) {
- if (newObj) {
- if (
- newObj.css === obj.css &&
- newObj.media === obj.media &&
- newObj.sourceMap === obj.sourceMap
- ) {
- return;
- }
-
- update(obj = newObj);
- } else {
- remove();
- }
- };
- }
-
- var replaceText = (function () {
- var textStore = [];
-
- return function (index, replacement) {
- textStore[index] = replacement;
-
- return textStore.filter(Boolean).join('\n');
- };
- })();
-
- function applyToSingletonTag (style, index, remove, obj) {
- var css = remove ? "" : obj.css;
-
- if (style.styleSheet) {
- style.styleSheet.cssText = replaceText(index, css);
- } else {
- var cssNode = document.createTextNode(css);
- var childNodes = style.childNodes;
-
- if (childNodes[index]) style.removeChild(childNodes[index]);
-
- if (childNodes.length) {
- style.insertBefore(cssNode, childNodes[index]);
- } else {
- style.appendChild(cssNode);
- }
- }
- }
-
- function applyToTag (style, obj) {
- var css = obj.css;
- var media = obj.media;
-
- if(media) {
- style.setAttribute("media", media)
- }
-
- if(style.styleSheet) {
- style.styleSheet.cssText = css;
- } else {
- while(style.firstChild) {
- style.removeChild(style.firstChild);
- }
-
- style.appendChild(document.createTextNode(css));
- }
- }
-
- function updateLink (link, options, obj) {
- var css = obj.css;
- var sourceMap = obj.sourceMap;
-
- /*
- If convertToAbsoluteUrls isn't defined, but sourcemaps are enabled
- and there is no publicPath defined then lets turn convertToAbsoluteUrls
- on by default. Otherwise default to the convertToAbsoluteUrls option
- directly
- */
- var autoFixUrls = options.convertToAbsoluteUrls === undefined && sourceMap;
-
- if (options.convertToAbsoluteUrls || autoFixUrls) {
- css = fixUrls(css);
- }
-
- if (sourceMap) {
- // http://stackoverflow.com/a/26603875
- css += "\n/*# sourceMappingURL=data:application/json;base64," + btoa(unescape(encodeURIComponent(JSON.stringify(sourceMap)))) + " */";
- }
-
- var blob = new Blob([css], { type: "text/css" });
-
- var oldSrc = link.href;
-
- link.href = URL.createObjectURL(blob);
-
- if(oldSrc) URL.revokeObjectURL(oldSrc);
- }
-
-
- /***/ }),
-
- /***/ "./node_modules/style-loader/lib/urls.js":
- /*!***********************************************!*\
- !*** ./node_modules/style-loader/lib/urls.js ***!
- \***********************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
-
- /**
- * When source maps are enabled, `style-loader` uses a link element with a data-uri to
- * embed the css on the page. This breaks all relative urls because now they are relative to a
- * bundle instead of the current page.
- *
- * One solution is to only use full urls, but that may be impossible.
- *
- * Instead, this function "fixes" the relative urls to be absolute according to the current page location.
- *
- * A rudimentary test suite is located at `test/fixUrls.js` and can be run via the `npm test` command.
- *
- */
-
- module.exports = function (css) {
- // get current location
- var location = typeof window !== "undefined" && window.location;
-
- if (!location) {
- throw new Error("fixUrls requires window.location");
- }
-
- // blank or null?
- if (!css || typeof css !== "string") {
- return css;
- }
-
- var baseUrl = location.protocol + "//" + location.host;
- var currentDir = baseUrl + location.pathname.replace(/\/[^\/]*$/, "/");
-
- // convert each url(...)
- /*
- This regular expression is just a way to recursively match brackets within
- a string.
-
- /url\s*\( = Match on the word "url" with any whitespace after it and then a parens
- ( = Start a capturing group
- (?: = Start a non-capturing group
- [^)(] = Match anything that isn't a parentheses
- | = OR
- \( = Match a start parentheses
- (?: = Start another non-capturing groups
- [^)(]+ = Match anything that isn't a parentheses
- | = OR
- \( = Match a start parentheses
- [^)(]* = Match anything that isn't a parentheses
- \) = Match a end parentheses
- ) = End Group
- *\) = Match anything and then a close parens
- ) = Close non-capturing group
- * = Match anything
- ) = Close capturing group
- \) = Match a close parens
-
- /gi = Get all matches, not the first. Be case insensitive.
- */
- var fixedCss = css.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi, function(fullMatch, origUrl) {
- // strip quotes (if they exist)
- var unquotedOrigUrl = origUrl
- .trim()
- .replace(/^"(.*)"$/, function(o, $1){ return $1; })
- .replace(/^'(.*)'$/, function(o, $1){ return $1; });
-
- // already a full url? no change
- if (/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(unquotedOrigUrl)) {
- return fullMatch;
- }
-
- // convert the url to a full url
- var newUrl;
-
- if (unquotedOrigUrl.indexOf("//") === 0) {
- //TODO: should we add protocol?
- newUrl = unquotedOrigUrl;
- } else if (unquotedOrigUrl.indexOf("/") === 0) {
- // path should be relative to the base url
- newUrl = baseUrl + unquotedOrigUrl; // already starts with '/'
- } else {
- // path should be relative to current directory
- newUrl = currentDir + unquotedOrigUrl.replace(/^\.\//, ""); // Strip leading './'
- }
-
- // send back the fixed url(...)
- return "url(" + JSON.stringify(newUrl) + ")";
- });
-
- // send back the fixed css
- return fixedCss;
- };
-
-
- /***/ }),
-
- /***/ "./node_modules/uuid/lib/bytesToUuid.js":
- /*!**********************************************!*\
- !*** ./node_modules/uuid/lib/bytesToUuid.js ***!
- \**********************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- /**
- * Convert array of 16 byte values to UUID string format of the form:
- * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
- */
- var byteToHex = [];
- for (var i = 0; i < 256; ++i) {
- byteToHex[i] = (i + 0x100).toString(16).substr(1);
- }
-
- function bytesToUuid(buf, offset) {
- var i = offset || 0;
- var bth = byteToHex;
- // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
- return ([bth[buf[i++]], bth[buf[i++]],
- bth[buf[i++]], bth[buf[i++]], '-',
- bth[buf[i++]], bth[buf[i++]], '-',
- bth[buf[i++]], bth[buf[i++]], '-',
- bth[buf[i++]], bth[buf[i++]], '-',
- bth[buf[i++]], bth[buf[i++]],
- bth[buf[i++]], bth[buf[i++]],
- bth[buf[i++]], bth[buf[i++]]]).join('');
- }
-
- module.exports = bytesToUuid;
-
-
- /***/ }),
-
- /***/ "./node_modules/uuid/lib/rng-browser.js":
- /*!**********************************************!*\
- !*** ./node_modules/uuid/lib/rng-browser.js ***!
- \**********************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- // Unique ID creation requires a high quality random # generator. In the
- // browser this is a little complicated due to unknown quality of Math.random()
- // and inconsistent support for the `crypto` API. We do the best we can via
- // feature-detection
-
- // getRandomValues needs to be invoked in a context where "this" is a Crypto
- // implementation. Also, find the complete implementation of crypto on IE11.
- var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
- (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
-
- if (getRandomValues) {
- // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
- var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
-
- module.exports = function whatwgRNG() {
- getRandomValues(rnds8);
- return rnds8;
- };
- } else {
- // Math.random()-based (RNG)
- //
- // If all else fails, use Math.random(). It's fast, but is of unspecified
- // quality.
- var rnds = new Array(16);
-
- module.exports = function mathRNG() {
- for (var i = 0, r; i < 16; i++) {
- if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
- rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
- }
-
- return rnds;
- };
- }
-
-
- /***/ }),
-
- /***/ "./node_modules/uuid/v1.js":
- /*!*********************************!*\
- !*** ./node_modules/uuid/v1.js ***!
- \*********************************/
- /*! no static exports found */
- /***/ (function(module, exports, __webpack_require__) {
-
- var rng = __webpack_require__(/*! ./lib/rng */ "./node_modules/uuid/lib/rng-browser.js");
- var bytesToUuid = __webpack_require__(/*! ./lib/bytesToUuid */ "./node_modules/uuid/lib/bytesToUuid.js");
-
- // **`v1()` - Generate time-based UUID**
- //
- // Inspired by https://github.com/LiosK/UUID.js
- // and http://docs.python.org/library/uuid.html
-
- var _nodeId;
- var _clockseq;
-
- // Previous uuid creation time
- var _lastMSecs = 0;
- var _lastNSecs = 0;
-
- // See https://github.com/broofa/node-uuid for API details
- function v1(options, buf, offset) {
- var i = buf && offset || 0;
- var b = buf || [];
-
- options = options || {};
- var node = options.node || _nodeId;
- var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
-
- // node and clockseq need to be initialized to random values if they're not
- // specified. We do this lazily to minimize issues related to insufficient
- // system entropy. See #189
- if (node == null || clockseq == null) {
- var seedBytes = rng();
- if (node == null) {
- // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
- node = _nodeId = [
- seedBytes[0] | 0x01,
- seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
- ];
- }
- if (clockseq == null) {
- // Per 4.2.2, randomize (14 bit) clockseq
- clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
- }
- }
-
- // UUID timestamps are 100 nano-second units since the Gregorian epoch,
- // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
- // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
- // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
- var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
-
- // Per 4.2.1.2, use count of uuid's generated during the current clock
- // cycle to simulate higher resolution clock
- var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
-
- // Time since last uuid creation (in msecs)
- var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
-
- // Per 4.2.1.2, Bump clockseq on clock regression
- if (dt < 0 && options.clockseq === undefined) {
- clockseq = clockseq + 1 & 0x3fff;
- }
-
- // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
- // time interval
- if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
- nsecs = 0;
- }
-
- // Per 4.2.1.2 Throw error if too many uuids are requested
- if (nsecs >= 10000) {
- throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
- }
-
- _lastMSecs = msecs;
- _lastNSecs = nsecs;
- _clockseq = clockseq;
-
- // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
- msecs += 12219292800000;
-
- // `time_low`
- var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
- b[i++] = tl >>> 24 & 0xff;
- b[i++] = tl >>> 16 & 0xff;
- b[i++] = tl >>> 8 & 0xff;
- b[i++] = tl & 0xff;
-
- // `time_mid`
- var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
- b[i++] = tmh >>> 8 & 0xff;
- b[i++] = tmh & 0xff;
-
- // `time_high_and_version`
- b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
- b[i++] = tmh >>> 16 & 0xff;
-
- // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
- b[i++] = clockseq >>> 8 | 0x80;
-
- // `clock_seq_low`
- b[i++] = clockseq & 0xff;
-
- // `node`
- for (var n = 0; n < 6; ++n) {
- b[i + n] = node[n];
- }
-
- return buf ? buf : bytesToUuid(b);
- }
-
- module.exports = v1;
-
-
- /***/ }),
-
- /***/ "./src/assets/arrow.svg":
- /*!******************************!*\
- !*** ./src/assets/arrow.svg ***!
- \******************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path d=\"M313.941 216H12c-6.627 0-12 5.373-12 12v56c0 6.627 5.373 12 12 12h301.941v46.059c0 21.382 25.851 32.09 40.971 16.971l86.059-86.059c9.373-9.373 9.373-24.569 0-33.941l-86.059-86.059c-15.119-15.119-40.971-4.411-40.971 16.971V216z\"></path></svg><!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->"
-
- /***/ }),
-
- /***/ "./src/assets/bx-left-arrow.svg":
- /*!**************************************!*\
- !*** ./src/assets/bx-left-arrow.svg ***!
- \**************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg t=\"1553418887330\" class=\"icon\" style viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2264\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><defs><style type=\"text/css\"></style></defs><path d=\"M787.797333 90.197333a42.581333 42.581333 0 0 0-44.074666 2.688l-554.666667 384a42.794667 42.794667 0 0 0 0 70.186667l554.666667 384A42.666667 42.666667 0 0 0 810.666667 896V128a42.666667 42.666667 0 0 0-22.869334-37.802667zM725.333333 814.549333L288.298667 512 725.333333 209.450667v605.098666z\" p-id=\"2265\"></path></svg>"
-
- /***/ }),
-
- /***/ "./src/assets/bx-right-arrow.svg":
- /*!***************************************!*\
- !*** ./src/assets/bx-right-arrow.svg ***!
- \***************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg t=\"1553418900235\" class=\"icon\" style viewBox=\"0 0 1024 1024\" version=\"1.1\" xmlns=\"http://www.w3.org/2000/svg\" p-id=\"2709\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"><defs><style type=\"text/css\"></style></defs><path d=\"M236.202667 933.802667a42.837333 42.837333 0 0 0 44.074666-2.730667l554.666667-384a42.666667 42.666667 0 0 0 0-70.144l-554.666667-384A42.581333 42.581333 0 0 0 213.333333 128v768a42.666667 42.666667 0 0 0 22.869334 37.802667zM298.666667 209.450667L735.701333 512 298.666667 814.549333V209.450667z\" p-id=\"2710\"></path></svg>"
-
- /***/ }),
-
- /***/ "./src/assets/check.svg":
- /*!******************************!*\
- !*** ./src/assets/check.svg ***!
- \******************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path d=\"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z\"></path></svg><!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->"
-
- /***/ }),
-
- /***/ "./src/assets/cover.svg":
- /*!******************************!*\
- !*** ./src/assets/cover.svg ***!
- \******************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path d=\"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48z\"></path></svg><!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->"
-
- /***/ }),
-
- /***/ "./src/assets/eraser.svg":
- /*!*******************************!*\
- !*** ./src/assets/eraser.svg ***!
- \*******************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\"><path d=\"M497.941 273.941c18.745-18.745 18.745-49.137 0-67.882l-160-160c-18.745-18.745-49.136-18.746-67.883 0l-256 256c-18.745 18.745-18.745 49.137 0 67.882l96 96A48.004 48.004 0 0 0 144 480h356c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12H355.883l142.058-142.059zm-302.627-62.627l137.373 137.373L265.373 416H150.628l-80-80 124.686-124.686z\"></path></svg><!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->"
-
- /***/ }),
-
- /***/ "./src/assets/highlight.svg":
- /*!**********************************!*\
- !*** ./src/assets/highlight.svg ***!
- \**********************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 544 512\"><path d=\"M0 479.98L99.92 512l35.45-35.45-67.04-67.04L0 479.98zm124.61-240.01a36.592 36.592 0 0 0-10.79 38.1l13.05 42.83-50.93 50.94 96.23 96.23 50.86-50.86 42.74 13.08c13.73 4.2 28.65-.01 38.15-10.78l35.55-41.64-173.34-173.34-41.52 35.44zm403.31-160.7l-63.2-63.2c-20.49-20.49-53.38-21.52-75.12-2.35L190.55 183.68l169.77 169.78L530.27 154.4c19.18-21.74 18.15-54.63-2.35-75.13z\"></path></svg><!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->"
-
- /***/ }),
-
- /***/ "./src/assets/line.svg":
- /*!*****************************!*\
- !*** ./src/assets/line.svg ***!
- \*****************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 640 512\"><path d=\"M594.53 508.63L6.18 53.9c-6.97-5.42-8.23-15.47-2.81-22.45L23.01 6.18C28.43-.8 38.49-2.06 45.47 3.37L633.82 458.1c6.97 5.42 8.23 15.47 2.81 22.45l-19.64 25.27c-5.42 6.98-15.48 8.23-22.46 2.81z\"></path></svg><!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->"
-
- /***/ }),
-
- /***/ "./src/assets/mouse-pointer.svg":
- /*!**************************************!*\
- !*** ./src/assets/mouse-pointer.svg ***!
- \**************************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 320 512\"><path d=\"M302.189 329.126H196.105l55.831 135.993c3.889 9.428-.555 19.999-9.444 23.999l-49.165 21.427c-9.165 4-19.443-.571-23.332-9.714l-53.053-129.136-86.664 89.138C18.729 472.71 0 463.554 0 447.977V18.299C0 1.899 19.921-6.096 30.277 5.443l284.412 292.542c11.472 11.179 3.007 31.141-12.5 31.141z\"></path></svg><!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->"
-
- /***/ }),
-
- /***/ "./src/assets/rect.svg":
- /*!*****************************!*\
- !*** ./src/assets/rect.svg ***!
- \*****************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path d=\"M400 32H48C21.5 32 0 53.5 0 80v352c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48V80c0-26.5-21.5-48-48-48zm-6 400H54c-3.3 0-6-2.7-6-6V86c0-3.3 2.7-6 6-6h340c3.3 0 6 2.7 6 6v340c0 3.3-2.7 6-6 6z\"></path></svg><!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->"
-
- /***/ }),
-
- /***/ "./src/assets/text.svg":
- /*!*****************************!*\
- !*** ./src/assets/text.svg ***!
- \*****************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 448 512\"><path d=\"M152 416h-24.013l26.586-80.782H292.8L319.386 416H296c-8.837 0-16 7.163-16 16v32c0 8.837 7.163 16 16 16h136c8.837 0 16-7.163 16-16v-32c0-8.837-7.163-16-16-16h-26.739L275.495 42.746A16 16 0 0 0 260.382 32h-72.766a16 16 0 0 0-15.113 10.746L42.739 416H16c-8.837 0-16 7.163-16 16v32c0 8.837 7.163 16 16 16h136c8.837 0 16-7.163 16-16v-32c0-8.837-7.163-16-16-16zm64.353-271.778c4.348-15.216 6.61-28.156 7.586-34.644.839 6.521 2.939 19.476 7.727 34.706l41.335 124.006h-98.619l41.971-124.068z\"></path></svg><!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->"
-
- /***/ }),
-
- /***/ "./src/assets/times.svg":
- /*!******************************!*\
- !*** ./src/assets/times.svg ***!
- \******************************/
- /*! no static exports found */
- /***/ (function(module, exports) {
-
- module.exports = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 352 512\"><path d=\"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z\"></path></svg><!-- Font Awesome Free 5.5.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) -->"
-
- /***/ }),
-
- /***/ "./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
|