mind-elixir 3.2.1 → 3.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/MindElixir.iife.js +8 -8
- package/dist/MindElixir.js +797 -785
- package/dist/MindElixirLite.iife.js +3 -3
- package/dist/MindElixirLite.js +62 -54
- package/dist/types/customLink.d.ts +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/methods.d.ts +1 -0
- package/package.json +1 -1
- package/readme.md +8 -11
package/dist/MindElixir.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".mind-elixir{--gap: 30px;--root-radius: 30px;--main-radius: 20px;--root-color: #ffffff;--root-bgcolor: #4c4f69;--main-color: #444446;--main-bgcolor: #ffffff;--topic-padding: 3px;--color: #777777;--bgcolor: #f6f6f6;--selected: #4dc4ff;--panel-color: #444446;--panel-bgcolor: #ffffff;--panel-border-color: #eaeaea;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0);font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif}.mind-elixir .hyper-link{text-decoration:none}.map-container{-webkit-user-select:none;user-select:none;height:100%;width:100%;overflow:scroll;font-size:15px}.map-container::-webkit-scrollbar{width:0px;height:0px}.map-container .selected{box-shadow:0 0 0 2px var(--selected)}.map-container .lhs{direction:rtl}.map-container .lhs me-tpc{direction:ltr}.map-container .map-canvas{height:20000px;width:20000px;position:relative;-webkit-user-select:none;user-select:none;transition:transform .3s;transform:scale(1);background-color:var(--bgcolor)}.map-container .map-canvas me-nodes{position:absolute;display:flex;justify-content:center;align-items:center;height:fit-content;width:fit-content}.map-container .map-canvas me-root{position:relative}.map-container .map-canvas me-root me-tpc{display:block;font-size:25px;line-height:1.2em;color:var(--root-color);padding:10px var(--gap);border-radius:var(--root-radius);white-space:pre-wrap;background-color:var(--root-bgcolor)}.map-container .map-canvas me-root me-tpc #input-box{padding:10px var(--gap)}.map-container me-main>me-wrapper{position:relative;margin:20px 65px}.map-container me-main>me-wrapper>me-parent{margin:var(--gap);padding:0}.map-container me-main>me-wrapper>me-parent>me-tpc{border-radius:var(--main-radius);background-color:var(--main-bgcolor);border:2px solid var(--main-color);color:var(--main-color);padding:8px var(--gap)}.map-container me-main>me-wrapper>me-parent>me-tpc #input-box{padding:8px var(--gap)}.map-container me-wrapper{display:block;pointer-events:none;width:fit-content}.map-container me-children,.map-container me-parent{display:inline-block;vertical-align:middle}.map-container me-parent{position:relative;cursor:pointer;padding:6px var(--gap);margin-top:10px}.map-container me-parent me-tpc{position:relative;display:block;border-radius:3px;color:var(--color);pointer-events:all;max-width:35em;white-space:pre-wrap;padding:var(--topic-padding);line-height:1.2em}.map-container me-parent me-tpc>div,.map-container me-parent me-tpc>span,.map-container me-parent me-tpc>img{pointer-events:none}.map-container me-parent me-tpc .insert-preview{position:absolute;width:100%;left:0;z-index:9}.map-container me-parent me-tpc .show{background:#7ad5ff;pointer-events:none;opacity:.7}.map-container me-parent me-tpc .before{height:14px;top:-14px}.map-container me-parent me-tpc .in{height:100%;top:0}.map-container me-parent me-tpc .after{height:14px;bottom:-14px}.map-container me-parent me-epd{position:absolute;height:18px;width:18px;opacity:.8;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdD0iMTY1NjY1NDcxNzI0MiIgY2xhc3M9Imljb24iIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIHZlcnNpb249IjEuMSIKICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+CiAgICA8cGF0aCBkPSJNNTEyIDc0LjY2NjY2N0MyNzAuOTMzMzMzIDc0LjY2NjY2NyA3NC42NjY2NjcgMjcwLjkzMzMzMyA3NC42NjY2NjcgNTEyUzI3MC45MzMzMzMgOTQ5LjMzMzMzMyA1MTIgOTQ5LjMzMzMzMyA5NDkuMzMzMzMzIDc1My4wNjY2NjcgOTQ5LjMzMzMzMyA1MTIgNzUzLjA2NjY2NyA3NC42NjY2NjcgNTEyIDc0LjY2NjY2N3oiIHN0cm9rZS13aWR0aD0iNTQiIHN0cm9rZT0nYmxhY2snIGZpbGw9J3doaXRlJyA+PC9wYXRoPgogICAgPHBhdGggZD0iTTY4Mi42NjY2NjcgNDgwaC0xMzguNjY2NjY3VjM0MS4zMzMzMzNjMC0xNy4wNjY2NjctMTQuOTMzMzMzLTMyLTMyLTMycy0zMiAxNC45MzMzMzMtMzIgMzJ2MTM4LjY2NjY2N0gzNDEuMzMzMzMzYy0xNy4wNjY2NjcgMC0zMiAxNC45MzMzMzMtMzIgMzJzMTQuOTMzMzMzIDMyIDMyIDMyaDEzOC42NjY2NjdWNjgyLjY2NjY2N2MwIDE3LjA2NjY2NyAxNC45MzMzMzMgMzIgMzIgMzJzMzItMTQuOTMzMzMzIDMyLTMydi0xMzguNjY2NjY3SDY4Mi42NjY2NjdjMTcuMDY2NjY3IDAgMzItMTQuOTMzMzMzIDMyLTMycy0xNC45MzMzMzMtMzItMzItMzJ6Ij48L3BhdGg+Cjwvc3ZnPg==);background-repeat:no-repeat;background-size:contain;background-position:center;pointer-events:all;z-index:9}.map-container me-parent me-epd.minus{background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+CjxzdmcgdD0iMTY1NjY1NTU2NDk4NSIgY2xhc3M9Imljb24iIHZpZXdCb3g9IjAgMCAxMDI0IDEwMjQiIHZlcnNpb249IjEuMSIKICAgIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIKICAgIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+CiAgICA8cGF0aCBkPSJNNTEyIDc0LjY2NjY2N0MyNzAuOTMzMzMzIDc0LjY2NjY2NyA3NC42NjY2NjcgMjcwLjkzMzMzMyA3NC42NjY2NjcgNTEyUzI3MC45MzMzMzMgOTQ5LjMzMzMzMyA1MTIgOTQ5LjMzMzMzMyA5NDkuMzMzMzMzIDc1My4wNjY2NjcgOTQ5LjMzMzMzMyA1MTIgNzUzLjA2NjY2NyA3NC42NjY2NjcgNTEyIDc0LjY2NjY2N3oiIHN0cm9rZS13aWR0aD0iNTQiIHN0cm9rZT0nYmxhY2snIGZpbGw9J3doaXRlJyA+PC9wYXRoPgogICAgPHBhdGggZD0iTTY4Mi42NjY2NjcgNTQ0SDM0MS4zMzMzMzNjLTE3LjA2NjY2NyAwLTMyLTE0LjkzMzMzMy0zMi0zMnMxNC45MzMzMzMtMzIgMzItMzJoMzQxLjMzMzMzNGMxNy4wNjY2NjcgMCAzMiAxNC45MzMzMzMgMzIgMzJzLTE0LjkzMzMzMyAzMi0zMiAzMnoiPjwvcGF0aD4KPC9zdmc+)!important;transition:opacity .3s;opacity:0}.map-container me-parent me-epd.minus:hover{opacity:.8}.map-container .icon{width:1em;height:1em;vertical-align:-.15em;fill:currentColor;overflow:hidden}.map-container .lines,.map-container .summary,.map-container .subLines,.map-container .topiclinks,.map-container .linkcontroller{position:absolute;height:102%;width:100%;top:0;left:0}.map-container .topiclinks,.map-container .linkcontroller,.map-container .summary{pointer-events:none}.map-container .topiclinks text,.map-container .linkcontroller text,.map-container .summary text{pointer-events:all}.map-container .topiclinks .selected,.map-container .linkcontroller .selected,.map-container .summary .selected{pointer-events:none}.map-container .lines,.map-container .subLines{pointer-events:none;z-index:-1}.map-container .topiclinks *,.map-container .linkcontroller *{z-index:100}.map-container .topiclinks g{cursor:pointer}.map-container #input-box{position:absolute;top:0;left:0;padding:var(--topic-padding);color:var(--color);background-color:var(--bgcolor);width:max-content;max-width:35em;z-index:11;direction:ltr;-webkit-user-select:auto;user-select:auto;pointer-events:all}.map-container me-tpc>img{pointer-events:none;display:block;margin-top:8px}.map-container .circle{position:absolute;height:10px;width:10px;margin-top:-5px;margin-left:-5px;border-radius:100%;background:#aaa;cursor:pointer}.map-container .tags{direction:ltr}.map-container .tags span{display:inline-block;border-radius:3px;padding:2px 4px;background:#d6f0f8;color:#276f86;margin:2px 3px 0 0;font-size:12px;line-height:1.3em}.map-container .icons{display:inline-block;direction:ltr;margin-right:10px}.map-container .icons span{display:inline-block}.map-container .mind-elixir-ghost{position:fixed;top:-100%;left:-100%;box-sizing:content-box;opacity:.5;background-color:#f6f6f6;max-width:200px;width:fit-content;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:8px 16px;border-radius:6px;border:#666666 2px solid}.selection-area{background:#4f90f22d;border:1px solid #4f90f2}.mind-elixir .context-menu{position:fixed;top:0;left:0;width:100%;height:100%;z-index:99}.mind-elixir .context-menu .menu-list{position:fixed;list-style:none;margin:0;padding:0;font:300 15px Roboto,sans-serif;color:var(--panel-color);box-shadow:0 12px 15px #0003}.mind-elixir .context-menu .menu-list li{min-width:200px;overflow:hidden;white-space:nowrap;padding:10px 14px;background:var(--panel-bgcolor);border-bottom:1px solid var(--panel-border-color)}.mind-elixir .context-menu .menu-list li a{color:#333;text-decoration:none}.mind-elixir .context-menu .menu-list li.disabled{display:none;color:#5e5e5e;background-color:#f7f7f7}.mind-elixir .context-menu .menu-list li.disabled:hover{cursor:default;background-color:#f7f7f7}.mind-elixir .context-menu .menu-list li:hover{cursor:pointer;filter:brightness(.9)}.mind-elixir .context-menu .menu-list li:first-child{border-radius:5px 5px 0 0}.mind-elixir .context-menu .menu-list li:last-child{border-bottom:0;border-radius:0 0 5px 5px}.mind-elixir .context-menu .menu-list li span:last-child{float:right}.mind-elixir .tips{position:absolute;bottom:20px;left:50%;transform:translate(-50%);color:var(--panel-color);font-weight:bolder}.mind-elixir .mobile-menu{position:absolute;left:20px;bottom:70px;z-index:99;margin:0;padding:0;color:#333;border-radius:5px;box-shadow:0 12px 15px #0003;overflow:hidden}.mind-elixir .mobile-menu *{transition:color .4s,background-color .4s}.mind-elixir .mobile-menu div{float:left;text-align:center;width:30px;overflow:hidden;white-space:nowrap;padding:8px;background-color:#fff;border-bottom:1px solid #ecf0f1}.mind-elixir .mobile-menu div a{color:#333;text-decoration:none}.mind-elixir .mobile-menu div.disabled{color:#5e5e5e;background-color:#f7f7f7}.mind-elixir .mobile-menu div.disabled:hover{cursor:default;background-color:#f7f7f7}.mind-elixir .mobile-menu div:hover{cursor:pointer;background-color:#ecf0f1}.mind-elixir-toolbar{font-family:iconfont;position:absolute;color:var(--panel-color);background:var(--panel-bgcolor);padding:10px;border-radius:5px;box-shadow:0 1px 2px #0003}.mind-elixir-toolbar svg{display:inline-block}.mind-elixir-toolbar span:active{opacity:.5}.mind-elixir-toolbar.rb{right:20px;bottom:20px}.mind-elixir-toolbar.rb span+span{margin-left:10px}.mind-elixir-toolbar.lt{font-size:20px;left:20px;top:20px}.mind-elixir-toolbar.lt span{display:block}.mind-elixir-toolbar.lt span+span{margin-top:10px}")),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
2
|
-
(function(
|
|
3
|
-
var e, n, i, o, s, r, l = '<svg><symbol id="icon-edit" viewBox="0 0 1024 1024"><path d="M423.765333 128a42.666667 42.666667 0 0 1 3.2 85.205333L423.765333 213.333333H234.666667a64 64 0 0 0-63.872 60.245334L170.666667 277.333333v512a64 64 0 0 0 60.245333 63.872L234.666667 853.333333h512a64 64 0 0 0 63.872-60.245333L810.666667 789.333333v-189.098666a42.666667 42.666667 0 0 1 85.205333-3.2l0.128 3.2V789.333333a149.333333 149.333333 0 0 1-144.213333 149.248L746.666667 938.666667h-512a149.333333 149.333333 0 0 1-149.248-144.213334L85.333333 789.333333v-512a149.333333 149.333333 0 0 1 144.213334-149.248L234.666667 128h189.098666z m324.949334-53.248a42.666667 42.666667 0 0 1 60.330666 0l150.869334 150.869333a42.666667 42.666667 0 0 1 0 60.330667l-329.386667 329.386667a42.666667 42.666667 0 0 1-29.44 12.458666l-153.386667 2.517334a42.666667 42.666667 0 0 1-43.349333-43.349334l2.56-153.386666a42.666667 42.666667 0 0 1 12.458667-29.44z m30.165333 90.496L491.946667 452.266667l-1.493334 91.989333 92.032-1.493333 286.976-286.976-90.538666-90.538667z" ></path></symbol><symbol id="icon-rising" viewBox="0 0 1024 1024"><path d="M553.173333 803.84h-64l0.021334-474.581333-224.021334 224-45.269333-45.226667L521.6 206.293333l301.717333 301.696-45.269333 45.269334-224.853333-224.896v475.477333z" ></path></symbol><symbol id="icon-falling" viewBox="0 0 1024 1024"><path d="M553.173333 238.314667h-64l0.021334 474.602666-224.021334-224-45.269333 45.226667L521.6 835.861333l301.717333-301.717333-45.269333-45.226667-224.853333 224.853334V238.336z" ></path></symbol><symbol id="icon-shanchu2" viewBox="0 0 1024 1024"><path d="M516.60601807 107.93026734c-82.64382935 0-149.71865844 65.51751709-152.5729065 147.77160644H171.37136841c-21.40603638 0-38.92044068 17.38504028-38.92044068 38.92126465 0 21.40686036 17.38504028 38.92208862 38.92126466 38.92208862h42.94308471v435.40136719c0 81.73498536 55.39828492 148.55026245 123.90106201 148.55026245h348.99444581c68.37341309 0 123.90106201-66.42553711 123.901062-148.55026245V333.80477906h38.92126465c21.40686036 0 38.92126464-17.38586426 38.92126465-38.92208863 0-21.40686036-17.38504028-38.92126464-38.92126465-38.92126465H668.91854859C666.45321656 173.44860839 599.24902344 107.93109131 516.60601807 107.93109131z m-79.65939331 147.77160644c2.85424805-42.16442872 37.2354126-74.85809326 79.78875732-74.85809326s76.93450927 32.82302857 79.39984131 74.85809326H436.94662476z m-98.86047364 589.01165771c-24.2611084 0-50.98754883-31.13717651-50.98754883-75.76693725V333.80477906h450.97036744V769.33551026c0 44.50039673-26.72644043 75.76776123-50.98754884 75.76776122H338.08615112v-0.38973999z m0 0" ></path><path d="M390.37063599 751.17263794c17.77313232 0 32.43411255-17.7739563 32.43411255-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43411255-40.08966065-17.77478027 0-32.43493653 17.77478027-32.43493653 40.08966065v228.72875976c0 22.18469239 14.27124023 40.08883667 32.43493653 40.08883667z m117.41308594 0c17.7739563 0 32.43411255-17.7739563 32.43411255-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43411255-40.08966065-17.7739563 0-32.43493653 17.77478027-32.43493653 40.08966065v228.72875976c0 22.18469239 14.66098023 40.08883667 32.43493653 40.08883667z m123.51049804 0c17.7739563 0 32.43493653-17.7739563 32.43493652-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43493652-40.08966065-17.7739563 0-32.43411255 17.77478027-32.43411255 40.08966065v228.72875976c0 22.18469239 14.14105224 40.08883667 32.43411255 40.08883667z m0 0" ></path></symbol><symbol id="icon-zijiedian" viewBox="0 0 1024 1024"><path d="M312.208 472c19.568-157.856 153.432-280 315.656-280 175.68 0 318.112 143.272 318.112 320S803.552 832 627.864 832c-162.224 0-296.08-122.144-315.656-280H120a40 40 0 0 1 0-80h192.208zM632 752c132.552 0 240-107.448 240-240 0-132.552-107.448-240-240-240-132.552 0-240 107.448-240 240 0 132.552 107.448 240 240 240z m-40-280v-80a40 40 0 0 1 80 0v80h80a40 40 0 0 1 0 80h-80v80a40 40 0 0 1-80 0v-80h-80a40 40 0 0 1 0-80h80z" ></path></symbol><symbol id="icon-tongjijiedian-" viewBox="0 0 1024 1024"><path d="M803.84 131.626667H410.24A59.733333 59.733333 0 0 0 350.506667 192v45.226667H199.68a51.626667 51.626667 0 0 0-51.626667 51.626666v465.92a51.626667 51.626667 0 0 0 51.626667 51.626667h187.52v-55.466667h-162.133333a21.333333 21.333333 0 0 1-21.333334-21.333333V313.386667a21.333333 21.333333 0 0 1 21.333334-21.333334h125.653333v64a59.733333 59.733333 0 0 0 59.733333 59.733334h393.386667a59.733333 59.733333 0 0 0 59.733333-59.733334V192a59.733333 59.733333 0 0 0-59.733333-60.373333z m4.266667 224.64a4.266667 4.266667 0 0 1-4.266667 4.266666H410.24a4.266667 4.266667 0 0 1-4.266667-4.266666V192a4.266667 4.266667 0 0 1 4.266667-4.266667h393.6a4.266667 4.266667 0 0 1 4.266667 4.266667zM716.16 749.44h-81.28v-81.493333a27.733333 27.733333 0 0 0-55.466667 0v81.28h-81.493333a27.733333 27.733333 0 1 0 0 55.466666h81.28v81.28a27.733333 27.733333 0 1 0 55.466667 0v-81.066666h81.28a27.733333 27.733333 0 0 0 0-55.466667z" ></path></symbol><symbol id="icon-close" viewBox="0 0 1024 1024"><path d="M557.312 513.248l265.28-263.904c12.544-12.48 12.608-32.704 0.128-45.248-12.512-12.576-32.704-12.608-45.248-0.128L512.128 467.904l-263.04-263.84c-12.448-12.48-32.704-12.544-45.248-0.064-12.512 12.48-12.544 32.736-0.064 45.28l262.976 263.776L201.6 776.8c-12.544 12.48-12.608 32.704-0.128 45.248a31.937 31.937 0 0 0 22.688 9.44c8.16 0 16.32-3.104 22.56-9.312l265.216-263.808 265.44 266.24c6.24 6.272 14.432 9.408 22.656 9.408a31.94 31.94 0 0 0 22.592-9.344c12.512-12.48 12.544-32.704 0.064-45.248L557.312 513.248z" fill="" ></path></symbol><symbol id="icon-menu" viewBox="0 0 1024 1024"><path d="M109.714 292.571h804.572c21.943 0 36.571-21.942 36.571-43.885 0-14.629-14.628-29.257-36.571-29.257H109.714c-21.943 0-36.571 14.628-36.571 36.571 0 14.629 14.628 36.571 36.571 36.571zM914.286 512H109.714c-21.943 0-36.571 14.629-36.571 36.571 0 14.629 14.628 36.572 36.571 36.572h804.572c21.943 0 36.571-21.943 36.571-43.886 0-14.628-14.628-29.257-36.571-29.257z m0 292.571H109.714c-21.943 0-36.571 14.629-36.571 36.572s14.628 36.571 36.571 36.571h804.572c21.943 0 36.571-21.943 36.571-36.571 0-21.943-14.628-36.572-36.571-36.572z" ></path></symbol><symbol id="icon-right" viewBox="0 0 1024 1024"><path d="M385 560.69999999L385 738.9c0 36.90000001 26.4 68.5 61.3 68.5l150.2 0c1.5 0 3-0.1 4.5-0.3 10.2 38.7 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-42 0-77.3 28.6-87.5 67.39999999-1.4-0.3-2.9-0.4-4.5-0.39999999L446.3 760.4c-6.8 0-14.3-8.9-14.3-21.49999999l0-427.00000001c0-12.7 7.40000001-21.5 14.30000001-21.5l150.19999999 0c1.5 0 3-0.2 4.5-0.4 10.2 38.8 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.4 0-49.9-40.5-90.6-90.5-90.59999999-42 0-77.3 28.6-87.5 67.39999999-1.4-0.2-2.9-0.4-4.49999999-0.4L446.3 243.3c-34.80000001 0-61.3 31.6-61.3 68.50000001L385 513.7l-79.1 0c-10.4-38.5-45.49999999-67-87.4-67-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c41.79999999 0 77.00000001-28.4 87.4-67L385 560.69999999z" fill="" ></path></symbol><symbol id="icon-left" viewBox="0 0 1024 1024"><path d="M639 463.30000001L639 285.1c0-36.90000001-26.4-68.5-61.3-68.5l-150.2 0c-1.5 0-3 0.1-4.5 0.3-10.2-38.7-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c42 0 77.3-28.6 87.5-67.39999999 1.4 0.3 2.9 0.4 4.5 0.39999999L577.7 263.6c6.8 0 14.3 8.9 14.3 21.49999999l0 427.00000001c0 12.7-7.40000001 21.5-14.30000001 21.5l-150.19999999 0c-1.5 0-3 0.2-4.5 0.4-10.2-38.8-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.4 0 49.9 40.5 90.6 90.5 90.59999999 42 0 77.3-28.6 87.5-67.39999999 1.4 0.2 2.9 0.4 4.49999999 0.4L577.7 780.7c34.80000001 0 61.3-31.6 61.3-68.50000001L639 510.3l79.1 0c10.4 38.5 45.49999999 67 87.4 67 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-41.79999999 0-77.00000001 28.4-87.4 67L639 463.30000001z" fill="" ></path></symbol><symbol id="icon-side" viewBox="0 0 1024 1024"><path d="M851.91168 328.45312c-59.97056 0-108.6208 48.47104-108.91264 108.36992l-137.92768 38.4a109.14304 109.14304 0 0 0-63.46752-46.58688l1.39264-137.11872c47.29344-11.86816 82.31936-54.66624 82.31936-105.64096 0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.76288-108.91776 108.91776c0 49.18784 32.60928 90.75712 77.38368 104.27392l-1.41312 138.87488a109.19936 109.19936 0 0 0-63.50336 48.55808l-138.93632-39.48544 0.01024-0.72704c0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.75776-108.91776 108.91776c0 60.15488 48.76288 108.91264 108.91776 108.91264 39.3984 0 73.91232-20.92032 93.03552-52.2496l139.19232 39.552-0.00512 0.2304c0 25.8304 9.00096 49.5616 24.02816 68.23424l-90.14272 132.63872a108.7488 108.7488 0 0 0-34.2528-5.504c-60.15488 0-108.91776 48.768-108.91776 108.91776 0 60.16 48.76288 108.91776 108.91776 108.91776 60.16 0 108.92288-48.75776 108.92288-108.91776 0-27.14624-9.9328-51.968-26.36288-71.04l89.04704-131.03104a108.544 108.544 0 0 0 37.6832 6.70208 108.672 108.672 0 0 0 36.48512-6.272l93.13792 132.57216a108.48256 108.48256 0 0 0-24.69888 69.0688c0 60.16 48.768 108.92288 108.91776 108.92288 60.16 0 108.91776-48.76288 108.91776-108.92288 0-60.14976-48.75776-108.91776-108.91776-108.91776a108.80512 108.80512 0 0 0-36.69504 6.3488l-93.07136-132.48a108.48768 108.48768 0 0 0 24.79616-72.22784l136.09984-37.888c18.99008 31.93856 53.84192 53.3504 93.69088 53.3504 60.16 0 108.92288-48.75776 108.92288-108.91264-0.00512-60.15488-48.77312-108.92288-108.92288-108.92288z" ></path></symbol><symbol id="icon-B" viewBox="0 0 1024 1024"><path d="M98.067692 65.457231H481.28c75.854769 0 132.411077 3.150769 169.668923 9.452307 37.336615 6.301538 70.656 19.534769 100.036923 39.620924 29.459692 20.007385 53.956923 46.710154 73.570462 80.029538 19.692308 33.398154 29.459692 70.734769 29.459692 112.167385 0 44.898462-12.130462 86.094769-36.233846 123.588923a224.886154 224.886154 0 0 1-98.461539 84.283077c58.368 17.092923 103.266462 46.08 134.695385 87.04 31.350154 40.96 47.025231 89.088 47.025231 144.462769 0 43.638154-10.082462 86.016-30.404923 127.212308-20.243692 41.196308-47.891692 74.043077-83.02277 98.697846-35.052308 24.654769-78.296615 39.778462-129.732923 45.449846-32.295385 3.465846-110.119385 5.671385-233.472 6.537846H98.067692V65.457231z m193.536 159.507692V446.621538h126.818462c75.460923 0 122.328615-1.024 140.603077-3.229538 33.083077-3.938462 59.155692-15.36 78.139077-34.343385 18.904615-18.904615 28.435692-43.874462 28.435692-74.830769 0-29.696-8.192-53.720615-24.497231-72.310154-16.384-18.510769-40.644923-29.696-72.940307-33.634461-19.140923-2.205538-74.279385-3.308308-165.415385-3.308308h-111.064615z m0 381.243077v256.315077h179.2c69.710769 0 113.979077-1.969231 132.726154-5.907692 28.750769-5.198769 52.145231-17.959385 70.262154-38.281847 18.116923-20.243692 27.096615-47.340308 27.096615-81.368615 0-28.750769-6.931692-53.169231-20.873846-73.255385a118.232615 118.232615 0 0 0-60.494769-43.795692c-26.387692-9.137231-83.574154-13.705846-171.638154-13.705846H291.603692z" ></path></symbol><symbol id="icon-a" viewBox="0 0 1024 1024"><path d="M757.76 665.6q0 20.48 1.536 34.304t7.68 22.016 18.944 12.288 34.304 4.096q-3.072 25.6-15.36 44.032-11.264 16.384-33.28 29.696t-62.976 13.312q-11.264 0-20.48-0.512t-17.408-2.56l-6.144-2.048-1.024 0q-4.096-1.024-10.24-4.096-2.048-2.048-4.096-2.048-1.024-1.024-2.048-1.024-14.336-8.192-23.552-17.408t-14.336-17.408q-6.144-10.24-9.216-20.48-63.488 75.776-178.176 75.776-48.128 0-88.064-15.36t-69.12-44.032-45.056-68.096-15.872-88.576 16.896-89.088 47.616-67.584 74.24-42.496 96.768-14.848q48.128 0 88.576 17.408t66.048 49.152q0-8.192 0.512-16.384t0.512-15.36q0-71.68-39.936-104.448t-128-32.768q-43.008 0-84.992 6.656t-84.992 17.92q14.336-28.672 25.088-47.616t24.064-29.184q30.72-24.576 158.72-24.576 79.872 0 135.168 13.824t90.624 43.52 51.2 75.264 15.872 108.032l0 200.704zM487.424 743.424q50.176 0 79.872-33.28t29.696-95.744q0-61.44-28.672-93.696t-76.8-32.256q-52.224 0-82.944 33.28t-30.72 94.72q0 58.368 31.744 92.672t77.824 34.304z" ></path></symbol><symbol id="icon-full" viewBox="0 0 1024 1024"><path d="M639.328 416c8.032 0 16.096-3.008 22.304-9.056l202.624-197.184-0.8 143.808c-0.096 17.696 14.144 32.096 31.808 32.192 0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808l1.248-222.208c0-0.672-0.352-1.248-0.384-1.92 0.032-0.512 0.288-0.896 0.288-1.408 0.032-17.664-14.272-32-31.968-32.032L671.552 96l-0.032 0c-17.664 0-31.968 14.304-32 31.968C639.488 145.632 653.824 160 671.488 160l151.872 0.224-206.368 200.8c-12.672 12.32-12.928 32.608-0.64 45.248C622.656 412.736 630.976 416 639.328 416z" ></path><path d="M896.032 639.552 896.032 639.552c-17.696 0-32 14.304-32.032 31.968l-0.224 151.872-200.832-206.4c-12.32-12.64-32.576-12.96-45.248-0.64-12.672 12.352-12.928 32.608-0.64 45.248l197.184 202.624-143.808-0.8c-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808-0.096 17.696 14.144 32.096 31.808 32.192l222.24 1.248c0.064 0 0.128 0 0.192 0 0.64 0 1.12-0.32 1.76-0.352 0.512 0.032 0.896 0.288 1.408 0.288l0.032 0c17.664 0 31.968-14.304 32-31.968L928 671.584C928.032 653.952 913.728 639.584 896.032 639.552z" ></path><path d="M209.76 159.744l143.808 0.8c0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808 0.096-17.696-14.144-32.096-31.808-32.192L131.68 95.328c-0.064 0-0.128 0-0.192 0-0.672 0-1.248 0.352-1.888 0.384-0.448 0-0.8-0.256-1.248-0.256 0 0-0.032 0-0.032 0-17.664 0-31.968 14.304-32 31.968L96 352.448c-0.032 17.664 14.272 32 31.968 32.032 0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968l0.224-151.936 200.832 206.4c6.272 6.464 14.624 9.696 22.944 9.696 8.032 0 16.096-3.008 22.304-9.056 12.672-12.32 12.96-32.608 0.64-45.248L209.76 159.744z" ></path><path d="M362.368 617.056l-202.624 197.184 0.8-143.808c0.096-17.696-14.144-32.096-31.808-32.192-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808l-1.248 222.24c0 0.704 0.352 1.312 0.384 2.016 0 0.448-0.256 0.832-0.256 1.312-0.032 17.664 14.272 32 31.968 32.032L352.448 928c0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968s-14.272-32-31.968-32.032l-151.936-0.224 206.4-200.832c12.672-12.352 12.96-32.608 0.64-45.248S375.008 604.704 362.368 617.056z" ></path></symbol><symbol id="icon-add" viewBox="0 0 1024 1024"><path d="M863.328 482.56l-317.344-1.12L545.984 162.816c0-17.664-14.336-32-32-32s-32 14.336-32 32l0 318.4L159.616 480.064c-0.032 0-0.064 0-0.096 0-17.632 0-31.936 14.24-32 31.904C127.424 529.632 141.728 544 159.392 544.064l322.592 1.152 0 319.168c0 17.696 14.336 32 32 32s32-14.304 32-32l0-318.944 317.088 1.12c0.064 0 0.096 0 0.128 0 17.632 0 31.936-14.24 32-31.904C895.264 496.992 880.96 482.624 863.328 482.56z" ></path></symbol><symbol id="icon-move" viewBox="0 0 1024 1024"><path d="M863.744 544 163.424 544c-17.664 0-32-14.336-32-32s14.336-32 32-32l700.32 0c17.696 0 32 14.336 32 32S881.44 544 863.744 544z" ></path></symbol><symbol id="icon-living" viewBox="0 0 1024 1024"><path d="M514.133333 488.533333m-106.666666 0a106.666667 106.666667 0 1 0 213.333333 0 106.666667 106.666667 0 1 0-213.333333 0Z" fill="" ></path><path d="M512 64C264.533333 64 64 264.533333 64 512c0 236.8 183.466667 428.8 416 445.866667v-134.4c-53.333333-59.733333-200.533333-230.4-200.533333-334.933334 0-130.133333 104.533333-234.666667 234.666666-234.666666s234.666667 104.533333 234.666667 234.666666c0 61.866667-49.066667 153.6-145.066667 270.933334l-59.733333 68.266666V960C776.533333 942.933333 960 748.8 960 512c0-247.466667-200.533333-448-448-448z" fill="" ></path></symbol></svg>', c = (c = document.getElementsByTagName("script"))[c.length - 1].getAttribute("data-injectcss");
|
|
4
|
-
if (c && !
|
|
5
|
-
|
|
2
|
+
(function(e) {
|
|
3
|
+
var t, n, i, o, s, r, l = '<svg><symbol id="icon-edit" viewBox="0 0 1024 1024"><path d="M423.765333 128a42.666667 42.666667 0 0 1 3.2 85.205333L423.765333 213.333333H234.666667a64 64 0 0 0-63.872 60.245334L170.666667 277.333333v512a64 64 0 0 0 60.245333 63.872L234.666667 853.333333h512a64 64 0 0 0 63.872-60.245333L810.666667 789.333333v-189.098666a42.666667 42.666667 0 0 1 85.205333-3.2l0.128 3.2V789.333333a149.333333 149.333333 0 0 1-144.213333 149.248L746.666667 938.666667h-512a149.333333 149.333333 0 0 1-149.248-144.213334L85.333333 789.333333v-512a149.333333 149.333333 0 0 1 144.213334-149.248L234.666667 128h189.098666z m324.949334-53.248a42.666667 42.666667 0 0 1 60.330666 0l150.869334 150.869333a42.666667 42.666667 0 0 1 0 60.330667l-329.386667 329.386667a42.666667 42.666667 0 0 1-29.44 12.458666l-153.386667 2.517334a42.666667 42.666667 0 0 1-43.349333-43.349334l2.56-153.386666a42.666667 42.666667 0 0 1 12.458667-29.44z m30.165333 90.496L491.946667 452.266667l-1.493334 91.989333 92.032-1.493333 286.976-286.976-90.538666-90.538667z" ></path></symbol><symbol id="icon-rising" viewBox="0 0 1024 1024"><path d="M553.173333 803.84h-64l0.021334-474.581333-224.021334 224-45.269333-45.226667L521.6 206.293333l301.717333 301.696-45.269333 45.269334-224.853333-224.896v475.477333z" ></path></symbol><symbol id="icon-falling" viewBox="0 0 1024 1024"><path d="M553.173333 238.314667h-64l0.021334 474.602666-224.021334-224-45.269333 45.226667L521.6 835.861333l301.717333-301.717333-45.269333-45.226667-224.853333 224.853334V238.336z" ></path></symbol><symbol id="icon-shanchu2" viewBox="0 0 1024 1024"><path d="M516.60601807 107.93026734c-82.64382935 0-149.71865844 65.51751709-152.5729065 147.77160644H171.37136841c-21.40603638 0-38.92044068 17.38504028-38.92044068 38.92126465 0 21.40686036 17.38504028 38.92208862 38.92126466 38.92208862h42.94308471v435.40136719c0 81.73498536 55.39828492 148.55026245 123.90106201 148.55026245h348.99444581c68.37341309 0 123.90106201-66.42553711 123.901062-148.55026245V333.80477906h38.92126465c21.40686036 0 38.92126464-17.38586426 38.92126465-38.92208863 0-21.40686036-17.38504028-38.92126464-38.92126465-38.92126465H668.91854859C666.45321656 173.44860839 599.24902344 107.93109131 516.60601807 107.93109131z m-79.65939331 147.77160644c2.85424805-42.16442872 37.2354126-74.85809326 79.78875732-74.85809326s76.93450927 32.82302857 79.39984131 74.85809326H436.94662476z m-98.86047364 589.01165771c-24.2611084 0-50.98754883-31.13717651-50.98754883-75.76693725V333.80477906h450.97036744V769.33551026c0 44.50039673-26.72644043 75.76776123-50.98754884 75.76776122H338.08615112v-0.38973999z m0 0" ></path><path d="M390.37063599 751.17263794c17.77313232 0 32.43411255-17.7739563 32.43411255-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43411255-40.08966065-17.77478027 0-32.43493653 17.77478027-32.43493653 40.08966065v228.72875976c0 22.18469239 14.27124023 40.08883667 32.43493653 40.08883667z m117.41308594 0c17.7739563 0 32.43411255-17.7739563 32.43411255-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43411255-40.08966065-17.7739563 0-32.43493653 17.77478027-32.43493653 40.08966065v228.72875976c0 22.18469239 14.66098023 40.08883667 32.43493653 40.08883667z m123.51049804 0c17.7739563 0 32.43493653-17.7739563 32.43493652-40.08883667V482.35504151c0-22.31488037-14.53079224-40.08966065-32.43493652-40.08966065-17.7739563 0-32.43411255 17.77478027-32.43411255 40.08966065v228.72875976c0 22.18469239 14.14105224 40.08883667 32.43411255 40.08883667z m0 0" ></path></symbol><symbol id="icon-zijiedian" viewBox="0 0 1024 1024"><path d="M312.208 472c19.568-157.856 153.432-280 315.656-280 175.68 0 318.112 143.272 318.112 320S803.552 832 627.864 832c-162.224 0-296.08-122.144-315.656-280H120a40 40 0 0 1 0-80h192.208zM632 752c132.552 0 240-107.448 240-240 0-132.552-107.448-240-240-240-132.552 0-240 107.448-240 240 0 132.552 107.448 240 240 240z m-40-280v-80a40 40 0 0 1 80 0v80h80a40 40 0 0 1 0 80h-80v80a40 40 0 0 1-80 0v-80h-80a40 40 0 0 1 0-80h80z" ></path></symbol><symbol id="icon-tongjijiedian-" viewBox="0 0 1024 1024"><path d="M803.84 131.626667H410.24A59.733333 59.733333 0 0 0 350.506667 192v45.226667H199.68a51.626667 51.626667 0 0 0-51.626667 51.626666v465.92a51.626667 51.626667 0 0 0 51.626667 51.626667h187.52v-55.466667h-162.133333a21.333333 21.333333 0 0 1-21.333334-21.333333V313.386667a21.333333 21.333333 0 0 1 21.333334-21.333334h125.653333v64a59.733333 59.733333 0 0 0 59.733333 59.733334h393.386667a59.733333 59.733333 0 0 0 59.733333-59.733334V192a59.733333 59.733333 0 0 0-59.733333-60.373333z m4.266667 224.64a4.266667 4.266667 0 0 1-4.266667 4.266666H410.24a4.266667 4.266667 0 0 1-4.266667-4.266666V192a4.266667 4.266667 0 0 1 4.266667-4.266667h393.6a4.266667 4.266667 0 0 1 4.266667 4.266667zM716.16 749.44h-81.28v-81.493333a27.733333 27.733333 0 0 0-55.466667 0v81.28h-81.493333a27.733333 27.733333 0 1 0 0 55.466666h81.28v81.28a27.733333 27.733333 0 1 0 55.466667 0v-81.066666h81.28a27.733333 27.733333 0 0 0 0-55.466667z" ></path></symbol><symbol id="icon-close" viewBox="0 0 1024 1024"><path d="M557.312 513.248l265.28-263.904c12.544-12.48 12.608-32.704 0.128-45.248-12.512-12.576-32.704-12.608-45.248-0.128L512.128 467.904l-263.04-263.84c-12.448-12.48-32.704-12.544-45.248-0.064-12.512 12.48-12.544 32.736-0.064 45.28l262.976 263.776L201.6 776.8c-12.544 12.48-12.608 32.704-0.128 45.248a31.937 31.937 0 0 0 22.688 9.44c8.16 0 16.32-3.104 22.56-9.312l265.216-263.808 265.44 266.24c6.24 6.272 14.432 9.408 22.656 9.408a31.94 31.94 0 0 0 22.592-9.344c12.512-12.48 12.544-32.704 0.064-45.248L557.312 513.248z" fill="" ></path></symbol><symbol id="icon-menu" viewBox="0 0 1024 1024"><path d="M109.714 292.571h804.572c21.943 0 36.571-21.942 36.571-43.885 0-14.629-14.628-29.257-36.571-29.257H109.714c-21.943 0-36.571 14.628-36.571 36.571 0 14.629 14.628 36.571 36.571 36.571zM914.286 512H109.714c-21.943 0-36.571 14.629-36.571 36.571 0 14.629 14.628 36.572 36.571 36.572h804.572c21.943 0 36.571-21.943 36.571-43.886 0-14.628-14.628-29.257-36.571-29.257z m0 292.571H109.714c-21.943 0-36.571 14.629-36.571 36.572s14.628 36.571 36.571 36.571h804.572c21.943 0 36.571-21.943 36.571-36.571 0-21.943-14.628-36.572-36.571-36.572z" ></path></symbol><symbol id="icon-right" viewBox="0 0 1024 1024"><path d="M385 560.69999999L385 738.9c0 36.90000001 26.4 68.5 61.3 68.5l150.2 0c1.5 0 3-0.1 4.5-0.3 10.2 38.7 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-42 0-77.3 28.6-87.5 67.39999999-1.4-0.3-2.9-0.4-4.5-0.39999999L446.3 760.4c-6.8 0-14.3-8.9-14.3-21.49999999l0-427.00000001c0-12.7 7.40000001-21.5 14.30000001-21.5l150.19999999 0c1.5 0 3-0.2 4.5-0.4 10.2 38.8 45.5 67.3 87.5 67.3 50 0 90.5-40.5 90.5-90.4 0-49.9-40.5-90.6-90.5-90.59999999-42 0-77.3 28.6-87.5 67.39999999-1.4-0.2-2.9-0.4-4.49999999-0.4L446.3 243.3c-34.80000001 0-61.3 31.6-61.3 68.50000001L385 513.7l-79.1 0c-10.4-38.5-45.49999999-67-87.4-67-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c41.79999999 0 77.00000001-28.4 87.4-67L385 560.69999999z" fill="" ></path></symbol><symbol id="icon-left" viewBox="0 0 1024 1024"><path d="M639 463.30000001L639 285.1c0-36.90000001-26.4-68.5-61.3-68.5l-150.2 0c-1.5 0-3 0.1-4.5 0.3-10.2-38.7-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.5s40.5 90.5 90.5 90.5c42 0 77.3-28.6 87.5-67.39999999 1.4 0.3 2.9 0.4 4.5 0.39999999L577.7 263.6c6.8 0 14.3 8.9 14.3 21.49999999l0 427.00000001c0 12.7-7.40000001 21.5-14.30000001 21.5l-150.19999999 0c-1.5 0-3 0.2-4.5 0.4-10.2-38.8-45.5-67.3-87.5-67.3-50 0-90.5 40.5-90.5 90.4 0 49.9 40.5 90.6 90.5 90.59999999 42 0 77.3-28.6 87.5-67.39999999 1.4 0.2 2.9 0.4 4.49999999 0.4L577.7 780.7c34.80000001 0 61.3-31.6 61.3-68.50000001L639 510.3l79.1 0c10.4 38.5 45.49999999 67 87.4 67 50 0 90.5-40.5 90.5-90.5s-40.5-90.5-90.5-90.5c-41.79999999 0-77.00000001 28.4-87.4 67L639 463.30000001z" fill="" ></path></symbol><symbol id="icon-side" viewBox="0 0 1024 1024"><path d="M851.91168 328.45312c-59.97056 0-108.6208 48.47104-108.91264 108.36992l-137.92768 38.4a109.14304 109.14304 0 0 0-63.46752-46.58688l1.39264-137.11872c47.29344-11.86816 82.31936-54.66624 82.31936-105.64096 0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.76288-108.91776 108.91776c0 49.18784 32.60928 90.75712 77.38368 104.27392l-1.41312 138.87488a109.19936 109.19936 0 0 0-63.50336 48.55808l-138.93632-39.48544 0.01024-0.72704c0-60.15488-48.76288-108.91776-108.91776-108.91776s-108.91776 48.75776-108.91776 108.91776c0 60.15488 48.76288 108.91264 108.91776 108.91264 39.3984 0 73.91232-20.92032 93.03552-52.2496l139.19232 39.552-0.00512 0.2304c0 25.8304 9.00096 49.5616 24.02816 68.23424l-90.14272 132.63872a108.7488 108.7488 0 0 0-34.2528-5.504c-60.15488 0-108.91776 48.768-108.91776 108.91776 0 60.16 48.76288 108.91776 108.91776 108.91776 60.16 0 108.92288-48.75776 108.92288-108.91776 0-27.14624-9.9328-51.968-26.36288-71.04l89.04704-131.03104a108.544 108.544 0 0 0 37.6832 6.70208 108.672 108.672 0 0 0 36.48512-6.272l93.13792 132.57216a108.48256 108.48256 0 0 0-24.69888 69.0688c0 60.16 48.768 108.92288 108.91776 108.92288 60.16 0 108.91776-48.76288 108.91776-108.92288 0-60.14976-48.75776-108.91776-108.91776-108.91776a108.80512 108.80512 0 0 0-36.69504 6.3488l-93.07136-132.48a108.48768 108.48768 0 0 0 24.79616-72.22784l136.09984-37.888c18.99008 31.93856 53.84192 53.3504 93.69088 53.3504 60.16 0 108.92288-48.75776 108.92288-108.91264-0.00512-60.15488-48.77312-108.92288-108.92288-108.92288z" ></path></symbol><symbol id="icon-B" viewBox="0 0 1024 1024"><path d="M98.067692 65.457231H481.28c75.854769 0 132.411077 3.150769 169.668923 9.452307 37.336615 6.301538 70.656 19.534769 100.036923 39.620924 29.459692 20.007385 53.956923 46.710154 73.570462 80.029538 19.692308 33.398154 29.459692 70.734769 29.459692 112.167385 0 44.898462-12.130462 86.094769-36.233846 123.588923a224.886154 224.886154 0 0 1-98.461539 84.283077c58.368 17.092923 103.266462 46.08 134.695385 87.04 31.350154 40.96 47.025231 89.088 47.025231 144.462769 0 43.638154-10.082462 86.016-30.404923 127.212308-20.243692 41.196308-47.891692 74.043077-83.02277 98.697846-35.052308 24.654769-78.296615 39.778462-129.732923 45.449846-32.295385 3.465846-110.119385 5.671385-233.472 6.537846H98.067692V65.457231z m193.536 159.507692V446.621538h126.818462c75.460923 0 122.328615-1.024 140.603077-3.229538 33.083077-3.938462 59.155692-15.36 78.139077-34.343385 18.904615-18.904615 28.435692-43.874462 28.435692-74.830769 0-29.696-8.192-53.720615-24.497231-72.310154-16.384-18.510769-40.644923-29.696-72.940307-33.634461-19.140923-2.205538-74.279385-3.308308-165.415385-3.308308h-111.064615z m0 381.243077v256.315077h179.2c69.710769 0 113.979077-1.969231 132.726154-5.907692 28.750769-5.198769 52.145231-17.959385 70.262154-38.281847 18.116923-20.243692 27.096615-47.340308 27.096615-81.368615 0-28.750769-6.931692-53.169231-20.873846-73.255385a118.232615 118.232615 0 0 0-60.494769-43.795692c-26.387692-9.137231-83.574154-13.705846-171.638154-13.705846H291.603692z" ></path></symbol><symbol id="icon-a" viewBox="0 0 1024 1024"><path d="M757.76 665.6q0 20.48 1.536 34.304t7.68 22.016 18.944 12.288 34.304 4.096q-3.072 25.6-15.36 44.032-11.264 16.384-33.28 29.696t-62.976 13.312q-11.264 0-20.48-0.512t-17.408-2.56l-6.144-2.048-1.024 0q-4.096-1.024-10.24-4.096-2.048-2.048-4.096-2.048-1.024-1.024-2.048-1.024-14.336-8.192-23.552-17.408t-14.336-17.408q-6.144-10.24-9.216-20.48-63.488 75.776-178.176 75.776-48.128 0-88.064-15.36t-69.12-44.032-45.056-68.096-15.872-88.576 16.896-89.088 47.616-67.584 74.24-42.496 96.768-14.848q48.128 0 88.576 17.408t66.048 49.152q0-8.192 0.512-16.384t0.512-15.36q0-71.68-39.936-104.448t-128-32.768q-43.008 0-84.992 6.656t-84.992 17.92q14.336-28.672 25.088-47.616t24.064-29.184q30.72-24.576 158.72-24.576 79.872 0 135.168 13.824t90.624 43.52 51.2 75.264 15.872 108.032l0 200.704zM487.424 743.424q50.176 0 79.872-33.28t29.696-95.744q0-61.44-28.672-93.696t-76.8-32.256q-52.224 0-82.944 33.28t-30.72 94.72q0 58.368 31.744 92.672t77.824 34.304z" ></path></symbol><symbol id="icon-full" viewBox="0 0 1024 1024"><path d="M639.328 416c8.032 0 16.096-3.008 22.304-9.056l202.624-197.184-0.8 143.808c-0.096 17.696 14.144 32.096 31.808 32.192 0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808l1.248-222.208c0-0.672-0.352-1.248-0.384-1.92 0.032-0.512 0.288-0.896 0.288-1.408 0.032-17.664-14.272-32-31.968-32.032L671.552 96l-0.032 0c-17.664 0-31.968 14.304-32 31.968C639.488 145.632 653.824 160 671.488 160l151.872 0.224-206.368 200.8c-12.672 12.32-12.928 32.608-0.64 45.248C622.656 412.736 630.976 416 639.328 416z" ></path><path d="M896.032 639.552 896.032 639.552c-17.696 0-32 14.304-32.032 31.968l-0.224 151.872-200.832-206.4c-12.32-12.64-32.576-12.96-45.248-0.64-12.672 12.352-12.928 32.608-0.64 45.248l197.184 202.624-143.808-0.8c-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808-0.096 17.696 14.144 32.096 31.808 32.192l222.24 1.248c0.064 0 0.128 0 0.192 0 0.64 0 1.12-0.32 1.76-0.352 0.512 0.032 0.896 0.288 1.408 0.288l0.032 0c17.664 0 31.968-14.304 32-31.968L928 671.584C928.032 653.952 913.728 639.584 896.032 639.552z" ></path><path d="M209.76 159.744l143.808 0.8c0.064 0 0.128 0 0.192 0 17.6 0 31.904-14.208 32-31.808 0.096-17.696-14.144-32.096-31.808-32.192L131.68 95.328c-0.064 0-0.128 0-0.192 0-0.672 0-1.248 0.352-1.888 0.384-0.448 0-0.8-0.256-1.248-0.256 0 0-0.032 0-0.032 0-17.664 0-31.968 14.304-32 31.968L96 352.448c-0.032 17.664 14.272 32 31.968 32.032 0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968l0.224-151.936 200.832 206.4c6.272 6.464 14.624 9.696 22.944 9.696 8.032 0 16.096-3.008 22.304-9.056 12.672-12.32 12.96-32.608 0.64-45.248L209.76 159.744z" ></path><path d="M362.368 617.056l-202.624 197.184 0.8-143.808c0.096-17.696-14.144-32.096-31.808-32.192-0.064 0-0.128 0-0.192 0-17.6 0-31.904 14.208-32 31.808l-1.248 222.24c0 0.704 0.352 1.312 0.384 2.016 0 0.448-0.256 0.832-0.256 1.312-0.032 17.664 14.272 32 31.968 32.032L352.448 928c0 0 0.032 0 0.032 0 17.664 0 31.968-14.304 32-31.968s-14.272-32-31.968-32.032l-151.936-0.224 206.4-200.832c12.672-12.352 12.96-32.608 0.64-45.248S375.008 604.704 362.368 617.056z" ></path></symbol><symbol id="icon-add" viewBox="0 0 1024 1024"><path d="M863.328 482.56l-317.344-1.12L545.984 162.816c0-17.664-14.336-32-32-32s-32 14.336-32 32l0 318.4L159.616 480.064c-0.032 0-0.064 0-0.096 0-17.632 0-31.936 14.24-32 31.904C127.424 529.632 141.728 544 159.392 544.064l322.592 1.152 0 319.168c0 17.696 14.336 32 32 32s32-14.304 32-32l0-318.944 317.088 1.12c0.064 0 0.096 0 0.128 0 17.632 0 31.936-14.24 32-31.904C895.264 496.992 880.96 482.624 863.328 482.56z" ></path></symbol><symbol id="icon-move" viewBox="0 0 1024 1024"><path d="M863.744 544 163.424 544c-17.664 0-32-14.336-32-32s14.336-32 32-32l700.32 0c17.696 0 32 14.336 32 32S881.44 544 863.744 544z" ></path></symbol><symbol id="icon-living" viewBox="0 0 1024 1024"><path d="M514.133333 488.533333m-106.666666 0a106.666667 106.666667 0 1 0 213.333333 0 106.666667 106.666667 0 1 0-213.333333 0Z" fill="" ></path><path d="M512 64C264.533333 64 64 264.533333 64 512c0 236.8 183.466667 428.8 416 445.866667v-134.4c-53.333333-59.733333-200.533333-230.4-200.533333-334.933334 0-130.133333 104.533333-234.666667 234.666666-234.666666s234.666667 104.533333 234.666667 234.666666c0 61.866667-49.066667 153.6-145.066667 270.933334l-59.733333 68.266666V960C776.533333 942.933333 960 748.8 960 512c0-247.466667-200.533333-448-448-448z" fill="" ></path></symbol></svg>', c = (c = document.getElementsByTagName("script"))[c.length - 1].getAttribute("data-injectcss");
|
|
4
|
+
if (c && !e.__iconfont__svg__cssinject__) {
|
|
5
|
+
e.__iconfont__svg__cssinject__ = !0;
|
|
6
6
|
try {
|
|
7
7
|
document.write(
|
|
8
8
|
"<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>"
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
function h() {
|
|
15
15
|
s || (s = !0, i());
|
|
16
16
|
}
|
|
17
|
-
|
|
17
|
+
t = function() {
|
|
18
18
|
var a, u, d, p;
|
|
19
19
|
(p = document.createElement("div")).innerHTML = l, l = null, (d = p.getElementsByTagName("svg")[0]) && (d.setAttribute("aria-hidden", "true"), d.style.position = "absolute", d.style.width = 0, d.style.height = 0, d.style.overflow = "hidden", a = d, (u = document.body).firstChild ? (p = a, (d = u.firstChild).parentNode.insertBefore(p, d)) : u.appendChild(a));
|
|
20
|
-
}, document.addEventListener ? ~["complete", "loaded", "interactive"].indexOf(document.readyState) ? setTimeout(
|
|
21
|
-
document.removeEventListener("DOMContentLoaded", n, !1),
|
|
22
|
-
}, document.addEventListener("DOMContentLoaded", n, !1)) : document.attachEvent && (i =
|
|
20
|
+
}, document.addEventListener ? ~["complete", "loaded", "interactive"].indexOf(document.readyState) ? setTimeout(t, 0) : (n = function() {
|
|
21
|
+
document.removeEventListener("DOMContentLoaded", n, !1), t();
|
|
22
|
+
}, document.addEventListener("DOMContentLoaded", n, !1)) : document.attachEvent && (i = t, o = e.document, s = !1, (r = function() {
|
|
23
23
|
try {
|
|
24
24
|
o.documentElement.doScroll("left");
|
|
25
25
|
} catch {
|
|
@@ -55,39 +55,39 @@ const S = 0, H = 1, K = 2, M = 30, L = 8, Se = {
|
|
|
55
55
|
"--panel-border-color": "#696969"
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
-
function ee(
|
|
59
|
-
return
|
|
58
|
+
function ee(e) {
|
|
59
|
+
return e.replace(/&/g, "&").replace(/</g, "<").replace(/"/g, """);
|
|
60
60
|
}
|
|
61
|
-
const Xe = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), Me = function(
|
|
62
|
-
if (
|
|
63
|
-
return
|
|
64
|
-
if (
|
|
65
|
-
for (let n = 0; n <
|
|
66
|
-
const i = Me(
|
|
61
|
+
const Xe = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), Me = function(e, t) {
|
|
62
|
+
if (t.id === e)
|
|
63
|
+
return t;
|
|
64
|
+
if (t.children && t.children.length) {
|
|
65
|
+
for (let n = 0; n < t.children.length; n++) {
|
|
66
|
+
const i = Me(e, t.children[n]);
|
|
67
67
|
if (i)
|
|
68
68
|
return i;
|
|
69
69
|
}
|
|
70
70
|
return null;
|
|
71
71
|
} else
|
|
72
72
|
return null;
|
|
73
|
-
}, T = (
|
|
74
|
-
if (
|
|
75
|
-
for (let n = 0; n <
|
|
76
|
-
T(
|
|
73
|
+
}, T = (e, t) => {
|
|
74
|
+
if (e.parent = t, e.children)
|
|
75
|
+
for (let n = 0; n < e.children.length; n++)
|
|
76
|
+
T(e.children[n], e);
|
|
77
77
|
};
|
|
78
|
-
function Te(
|
|
79
|
-
if (
|
|
80
|
-
for (let
|
|
81
|
-
Te(
|
|
78
|
+
function Te(e) {
|
|
79
|
+
if (e.id = U(), e.children)
|
|
80
|
+
for (let t = 0; t < e.children.length; t++)
|
|
81
|
+
Te(e.children[t]);
|
|
82
82
|
}
|
|
83
|
-
const Ke = (
|
|
83
|
+
const Ke = (e, t) => {
|
|
84
84
|
let n = Date.now();
|
|
85
85
|
return function(...i) {
|
|
86
|
-
Date.now() - n >=
|
|
86
|
+
Date.now() - n >= t && (e(...i), n = Date.now());
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
|
-
function $e(
|
|
90
|
-
const o = i -
|
|
89
|
+
function $e(e, t, n, i) {
|
|
90
|
+
const o = i - t, s = e - n;
|
|
91
91
|
let r = Math.atan(Math.abs(o) / Math.abs(s)) / 3.14 * 180;
|
|
92
92
|
s < 0 && o > 0 && (r = 180 - r), s < 0 && o < 0 && (r = 180 + r), s > 0 && o < 0 && (r = 360 - r);
|
|
93
93
|
const l = 15, c = 30, h = r + c, a = r - c;
|
|
@@ -102,130 +102,130 @@ function U() {
|
|
|
102
102
|
return ((/* @__PURE__ */ new Date()).getTime().toString(16) + Math.random().toString(16).substr(2)).substr(2, 16);
|
|
103
103
|
}
|
|
104
104
|
const Ue = function() {
|
|
105
|
-
const
|
|
105
|
+
const e = U();
|
|
106
106
|
return {
|
|
107
107
|
topic: this.newTopicName,
|
|
108
|
-
id:
|
|
108
|
+
id: e
|
|
109
109
|
};
|
|
110
110
|
};
|
|
111
|
-
function Ge(
|
|
111
|
+
function Ge(e, t) {
|
|
112
112
|
let n = !0;
|
|
113
|
-
for (;
|
|
114
|
-
if (
|
|
113
|
+
for (; t.parent; ) {
|
|
114
|
+
if (t.parent === e) {
|
|
115
115
|
n = !1;
|
|
116
116
|
break;
|
|
117
117
|
}
|
|
118
|
-
|
|
118
|
+
t = t.parent;
|
|
119
119
|
}
|
|
120
120
|
return n;
|
|
121
121
|
}
|
|
122
|
-
const P = (
|
|
122
|
+
const P = (e) => {
|
|
123
123
|
var i;
|
|
124
|
-
const
|
|
125
|
-
return { siblings:
|
|
124
|
+
const t = (i = e.parent) == null ? void 0 : i.children, n = t.indexOf(e);
|
|
125
|
+
return { siblings: t, index: n };
|
|
126
126
|
};
|
|
127
|
-
function Je(
|
|
128
|
-
const { siblings:
|
|
129
|
-
n === 0 ? (
|
|
127
|
+
function Je(e) {
|
|
128
|
+
const { siblings: t, index: n } = P(e), i = t[n];
|
|
129
|
+
n === 0 ? (t[n] = t[t.length - 1], t[t.length - 1] = i) : (t[n] = t[n - 1], t[n - 1] = i);
|
|
130
130
|
}
|
|
131
|
-
function Qe(
|
|
132
|
-
const { siblings:
|
|
133
|
-
n ===
|
|
131
|
+
function Qe(e) {
|
|
132
|
+
const { siblings: t, index: n } = P(e), i = t[n];
|
|
133
|
+
n === t.length - 1 ? (t[n] = t[0], t[0] = i) : (t[n] = t[n + 1], t[n + 1] = i);
|
|
134
134
|
}
|
|
135
|
-
function ie(
|
|
136
|
-
const { siblings:
|
|
137
|
-
return
|
|
135
|
+
function ie(e) {
|
|
136
|
+
const { siblings: t, index: n } = P(e);
|
|
137
|
+
return t.splice(n, 1), t.length;
|
|
138
138
|
}
|
|
139
|
-
function Ze(
|
|
140
|
-
const { siblings: n, index: i } = P(
|
|
141
|
-
n.splice(i + 1, 0,
|
|
142
|
-
}
|
|
143
|
-
function et(t, e) {
|
|
144
|
-
const { siblings: n, index: i } = P(t);
|
|
145
|
-
n.splice(i, 0, e);
|
|
146
|
-
}
|
|
147
|
-
function tt(t, e) {
|
|
148
|
-
const { siblings: n, index: i } = P(t);
|
|
149
|
-
n[i] = e, e.children = [t];
|
|
150
|
-
}
|
|
151
|
-
function nt(t, e) {
|
|
152
|
-
ie(t), e.children ? e.children.push(t) : e.children = [t];
|
|
139
|
+
function Ze(e, t) {
|
|
140
|
+
const { siblings: n, index: i } = P(e);
|
|
141
|
+
n.splice(i + 1, 0, t);
|
|
153
142
|
}
|
|
154
|
-
function
|
|
155
|
-
ie(t);
|
|
143
|
+
function et(e, t) {
|
|
156
144
|
const { siblings: n, index: i } = P(e);
|
|
157
145
|
n.splice(i, 0, t);
|
|
158
146
|
}
|
|
159
|
-
function
|
|
160
|
-
ie(t);
|
|
147
|
+
function tt(e, t) {
|
|
161
148
|
const { siblings: n, index: i } = P(e);
|
|
162
|
-
n
|
|
149
|
+
n[i] = t, t.children = [e];
|
|
163
150
|
}
|
|
164
|
-
function
|
|
151
|
+
function nt(e, t) {
|
|
152
|
+
ie(e), t.children ? t.children.push(e) : t.children = [e];
|
|
153
|
+
}
|
|
154
|
+
function it(e, t) {
|
|
155
|
+
ie(e);
|
|
156
|
+
const { siblings: n, index: i } = P(t);
|
|
157
|
+
n.splice(i, 0, e);
|
|
158
|
+
}
|
|
159
|
+
function ot(e, t) {
|
|
160
|
+
ie(e);
|
|
161
|
+
const { siblings: n, index: i } = P(t);
|
|
162
|
+
n.splice(i + 1, 0, e);
|
|
163
|
+
}
|
|
164
|
+
function De(e) {
|
|
165
165
|
return JSON.parse(
|
|
166
|
-
JSON.stringify(
|
|
166
|
+
JSON.stringify(e, (n, i) => {
|
|
167
167
|
if (n !== "parent")
|
|
168
168
|
return i;
|
|
169
169
|
})
|
|
170
170
|
);
|
|
171
171
|
}
|
|
172
|
-
const W = (
|
|
172
|
+
const W = (e, t) => {
|
|
173
173
|
let n = 0, i = 0;
|
|
174
|
-
for (;
|
|
175
|
-
n +=
|
|
174
|
+
for (; t && t !== e; )
|
|
175
|
+
n += t.offsetLeft, i += t.offsetTop, t = t.offsetParent;
|
|
176
176
|
return { offsetLeft: n, offsetTop: i };
|
|
177
|
-
}, N = (
|
|
178
|
-
for (const n in
|
|
179
|
-
|
|
177
|
+
}, N = (e, t) => {
|
|
178
|
+
for (const n in t)
|
|
179
|
+
e.setAttribute(n, t[n]);
|
|
180
180
|
}, D = {
|
|
181
181
|
moved: !1,
|
|
182
182
|
// diffrentiate click and move
|
|
183
183
|
mousedown: !1,
|
|
184
184
|
lastX: 0,
|
|
185
185
|
lastY: 0,
|
|
186
|
-
onMove(
|
|
186
|
+
onMove(e, t) {
|
|
187
187
|
if (this.mousedown) {
|
|
188
188
|
if (this.moved = !0, !this.lastX) {
|
|
189
|
-
this.lastX =
|
|
189
|
+
this.lastX = e.pageX, this.lastY = e.pageY;
|
|
190
190
|
return;
|
|
191
191
|
}
|
|
192
|
-
const n = this.lastX -
|
|
193
|
-
|
|
192
|
+
const n = this.lastX - e.pageX, i = this.lastY - e.pageY;
|
|
193
|
+
t.scrollTo(t.scrollLeft + n, t.scrollTop + i), this.lastX = e.pageX, this.lastY = e.pageY;
|
|
194
194
|
}
|
|
195
195
|
},
|
|
196
196
|
clear() {
|
|
197
197
|
this.moved = !1, this.mousedown = !1, this.lastX = 0, this.lastY = 0;
|
|
198
198
|
}
|
|
199
|
-
}, ue = (
|
|
200
|
-
function st(
|
|
201
|
-
|
|
199
|
+
}, ue = (e) => e.tagName === "ME-TPC";
|
|
200
|
+
function st(e) {
|
|
201
|
+
e.map.addEventListener("click", (t) => {
|
|
202
202
|
if (D.moved) {
|
|
203
203
|
D.clear();
|
|
204
204
|
return;
|
|
205
205
|
}
|
|
206
|
-
|
|
207
|
-
const n =
|
|
206
|
+
e.unselectNode(), e.unselectNodes(), e.unselectSummary(), e.unselectLink();
|
|
207
|
+
const n = t.target;
|
|
208
208
|
if (n.tagName === "ME-EPD")
|
|
209
|
-
|
|
210
|
-
else if (
|
|
211
|
-
ue(n) ?
|
|
209
|
+
e.expandNode(n.previousSibling);
|
|
210
|
+
else if (e.editable)
|
|
211
|
+
ue(n) ? e.selectNode(n, !1, t) : n.tagName === "text" ? n.dataset.type === "custom-link" ? e.selectLink(n.parentElement) : e.selectSummary(n.parentElement) : n.className === "circle" || e.hideLinkController && e.hideLinkController();
|
|
212
212
|
else
|
|
213
213
|
return;
|
|
214
|
-
}),
|
|
215
|
-
if (
|
|
214
|
+
}), e.map.addEventListener("dblclick", (t) => {
|
|
215
|
+
if (t.preventDefault(), !e.editable)
|
|
216
216
|
return;
|
|
217
|
-
const n =
|
|
218
|
-
ue(n) ?
|
|
219
|
-
}),
|
|
220
|
-
|
|
221
|
-
}),
|
|
222
|
-
|
|
223
|
-
}),
|
|
224
|
-
console.log(
|
|
225
|
-
}),
|
|
226
|
-
|
|
227
|
-
}),
|
|
228
|
-
|
|
217
|
+
const n = t.target;
|
|
218
|
+
ue(n) ? e.beginEdit(n) : n.tagName === "text" && (n.dataset.type === "custom-link" ? e.editCutsomLinkLabel(n.parentElement) : e.editSummary(n.parentElement));
|
|
219
|
+
}), e.map.addEventListener("mousemove", (t) => {
|
|
220
|
+
t.target.contentEditable !== "true" && D.onMove(t, e.container);
|
|
221
|
+
}), e.map.addEventListener("mousedown", (t) => {
|
|
222
|
+
t.button === 2 && t.target.contentEditable !== "true" && (D.moved = !1, D.mousedown = !0);
|
|
223
|
+
}), e.map.addEventListener("mouseleave", (t) => {
|
|
224
|
+
console.log(t.button), t.button === 2 && D.clear();
|
|
225
|
+
}), e.map.addEventListener("mouseup", (t) => {
|
|
226
|
+
t.button === 2 && D.clear();
|
|
227
|
+
}), e.map.addEventListener("contextmenu", (t) => {
|
|
228
|
+
t.preventDefault();
|
|
229
229
|
});
|
|
230
230
|
}
|
|
231
231
|
const rt = {
|
|
@@ -235,34 +235,34 @@ const rt = {
|
|
|
235
235
|
showHandler: function() {
|
|
236
236
|
console.log(this.handlers);
|
|
237
237
|
},
|
|
238
|
-
addListener: function(
|
|
239
|
-
this.handlers[
|
|
238
|
+
addListener: function(e, t) {
|
|
239
|
+
this.handlers[e] === void 0 && (this.handlers[e] = []), this.handlers[e].push(t);
|
|
240
240
|
},
|
|
241
|
-
fire: function(
|
|
242
|
-
if (this.handlers[
|
|
243
|
-
const n = this.handlers[
|
|
241
|
+
fire: function(e, ...t) {
|
|
242
|
+
if (this.handlers[e] instanceof Array) {
|
|
243
|
+
const n = this.handlers[e];
|
|
244
244
|
for (let i = 0; i < n.length; i++)
|
|
245
|
-
n[i](...
|
|
245
|
+
n[i](...t);
|
|
246
246
|
}
|
|
247
247
|
},
|
|
248
|
-
removeListener: function(
|
|
249
|
-
if (!this.handlers[
|
|
248
|
+
removeListener: function(e, t) {
|
|
249
|
+
if (!this.handlers[e])
|
|
250
250
|
return;
|
|
251
|
-
const n = this.handlers[
|
|
252
|
-
if (!
|
|
251
|
+
const n = this.handlers[e];
|
|
252
|
+
if (!t)
|
|
253
253
|
n.length = 0;
|
|
254
254
|
else if (n.length)
|
|
255
255
|
for (let i = 0; i < n.length; i++)
|
|
256
|
-
n[i] ===
|
|
256
|
+
n[i] === t && this.handlers[e].splice(i, 1);
|
|
257
257
|
}
|
|
258
258
|
};
|
|
259
259
|
}
|
|
260
260
|
}, te = document, lt = function() {
|
|
261
261
|
console.time("layout"), this.nodes.innerHTML = "";
|
|
262
|
-
const
|
|
263
|
-
ae(
|
|
264
|
-
const
|
|
265
|
-
|
|
262
|
+
const e = this.createTopic(this.nodeData);
|
|
263
|
+
ae(e, this.nodeData), e.draggable = !1;
|
|
264
|
+
const t = te.createElement("me-root");
|
|
265
|
+
t.appendChild(e);
|
|
266
266
|
const n = this.nodeData.children || [];
|
|
267
267
|
if (this.direction === K) {
|
|
268
268
|
let i = 0, o = 0;
|
|
@@ -270,115 +270,120 @@ const rt = {
|
|
|
270
270
|
s.direction === S ? i += 1 : s.direction === H ? o += 1 : i <= o ? (s.direction = S, i += 1) : (s.direction = H, o += 1);
|
|
271
271
|
});
|
|
272
272
|
}
|
|
273
|
-
ct(this, n,
|
|
274
|
-
}, ct = function(
|
|
273
|
+
ct(this, n, t), console.timeEnd("layout");
|
|
274
|
+
}, ct = function(e, t, n) {
|
|
275
275
|
const i = te.createElement("me-main");
|
|
276
276
|
i.className = "lhs";
|
|
277
277
|
const o = te.createElement("me-main");
|
|
278
278
|
o.className = "rhs";
|
|
279
|
-
for (let s = 0; s <
|
|
280
|
-
const r =
|
|
281
|
-
|
|
279
|
+
for (let s = 0; s < t.length; s++) {
|
|
280
|
+
const r = t[s], { grp: l } = e.createWrapper(r);
|
|
281
|
+
e.direction === K ? r.direction === S ? i.appendChild(l) : o.appendChild(l) : e.direction === S ? i.appendChild(l) : o.appendChild(l);
|
|
282
282
|
}
|
|
283
|
-
|
|
284
|
-
}, at = function(
|
|
283
|
+
e.nodes.appendChild(i), e.nodes.appendChild(n), e.nodes.appendChild(o), e.nodes.appendChild(e.lines);
|
|
284
|
+
}, at = function(e, t) {
|
|
285
285
|
const n = te.createElement("me-children");
|
|
286
|
-
for (let i = 0; i <
|
|
287
|
-
const o =
|
|
286
|
+
for (let i = 0; i < t.length; i++) {
|
|
287
|
+
const o = t[i], { grp: s } = e.createWrapper(o);
|
|
288
288
|
n.appendChild(s);
|
|
289
289
|
}
|
|
290
290
|
return n;
|
|
291
|
-
}, k = document, E = (
|
|
292
|
-
|
|
293
|
-
|
|
291
|
+
}, k = document, E = (e, t) => {
|
|
292
|
+
const i = (t ? t.mindElixirBox : k).querySelector(`[data-nodeid=me${e}]`);
|
|
293
|
+
if (!i)
|
|
294
|
+
throw new Error(`FindEle: Node ${e} not found, maybe it's collapsed.`);
|
|
295
|
+
return i;
|
|
296
|
+
}, ae = function(e, t) {
|
|
297
|
+
if (e.textContent = t.topic, t.style && (e.style.color = t.style.color || "", e.style.background = t.style.background || "", e.style.fontSize = t.style.fontSize + "px", e.style.fontWeight = t.style.fontWeight || "normal"), t.image) {
|
|
298
|
+
const n = t.image;
|
|
294
299
|
if (n.url && n.width && n.height) {
|
|
295
300
|
const i = k.createElement("img");
|
|
296
|
-
i.src = n.url, i.style.width = n.width + "px", i.style.height = n.height + "px",
|
|
301
|
+
i.src = n.url, i.style.width = n.width + "px", i.style.height = n.height + "px", e.appendChild(i), e.image = i;
|
|
297
302
|
} else
|
|
298
303
|
console.warn("image url/width/height are required");
|
|
299
304
|
}
|
|
300
|
-
if (
|
|
305
|
+
if (t.hyperLink) {
|
|
301
306
|
const n = k.createElement("a");
|
|
302
|
-
n.className = "hyper-link", n.target = "_blank", n.innerText = "🔗", n.href =
|
|
307
|
+
n.className = "hyper-link", n.target = "_blank", n.innerText = "🔗", n.href = t.hyperLink, e.appendChild(n), e.linkContainer = n;
|
|
303
308
|
} else
|
|
304
|
-
|
|
305
|
-
if (
|
|
309
|
+
e.linkContainer && (e.linkContainer.remove(), e.linkContainer = null);
|
|
310
|
+
if (t.icons && t.icons.length) {
|
|
306
311
|
const n = k.createElement("span");
|
|
307
|
-
n.className = "icons", n.innerHTML =
|
|
312
|
+
n.className = "icons", n.innerHTML = t.icons.map((i) => `<span>${ee(i)}</span>`).join(""), e.appendChild(n), e.icons = n;
|
|
308
313
|
}
|
|
309
|
-
if (
|
|
314
|
+
if (t.tags && t.tags.length) {
|
|
310
315
|
const n = k.createElement("div");
|
|
311
|
-
n.className = "tags", n.innerHTML =
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
}, dt = function(
|
|
315
|
-
const n = k.createElement("me-wrapper"), { p: i, tpc: o } = this.createParent(
|
|
316
|
-
if (n.appendChild(i), !
|
|
317
|
-
const s = oe(
|
|
318
|
-
if (i.appendChild(s),
|
|
319
|
-
const r = at(this,
|
|
316
|
+
n.className = "tags", n.innerHTML = t.tags.map((i) => `<span>${ee(i)}</span>`).join(""), e.appendChild(n), e.tags = n;
|
|
317
|
+
}
|
|
318
|
+
t.branchColor && (e.style.borderColor = t.branchColor);
|
|
319
|
+
}, dt = function(e, t) {
|
|
320
|
+
const n = k.createElement("me-wrapper"), { p: i, tpc: o } = this.createParent(e);
|
|
321
|
+
if (n.appendChild(i), !t && e.children && e.children.length > 0) {
|
|
322
|
+
const s = oe(e.expanded);
|
|
323
|
+
if (i.appendChild(s), e.expanded !== !1) {
|
|
324
|
+
const r = at(this, e.children);
|
|
320
325
|
n.appendChild(r);
|
|
321
326
|
}
|
|
322
327
|
}
|
|
323
328
|
return { grp: n, top: i, tpc: o };
|
|
324
|
-
}, ht = function(
|
|
325
|
-
const
|
|
326
|
-
return ae(n,
|
|
327
|
-
}, ut = function(
|
|
328
|
-
const
|
|
329
|
-
return
|
|
330
|
-
}, ft = function(
|
|
331
|
-
const
|
|
332
|
-
return
|
|
329
|
+
}, ht = function(e) {
|
|
330
|
+
const t = k.createElement("me-parent"), n = this.createTopic(e);
|
|
331
|
+
return ae(n, e), t.appendChild(n), { p: t, tpc: n };
|
|
332
|
+
}, ut = function(e) {
|
|
333
|
+
const t = k.createElement("me-children");
|
|
334
|
+
return t.append(...e), t;
|
|
335
|
+
}, ft = function(e) {
|
|
336
|
+
const t = k.createElement("me-tpc");
|
|
337
|
+
return t.nodeObj = e, t.dataset.nodeid = "me" + e.id, t.draggable = this.draggable, t;
|
|
333
338
|
};
|
|
334
|
-
function Oe(
|
|
335
|
-
const
|
|
336
|
-
|
|
339
|
+
function Oe(e) {
|
|
340
|
+
const t = k.createRange();
|
|
341
|
+
t.selectNodeContents(e);
|
|
337
342
|
const n = window.getSelection();
|
|
338
|
-
n && (n.removeAllRanges(), n.addRange(
|
|
343
|
+
n && (n.removeAllRanges(), n.addRange(t));
|
|
339
344
|
}
|
|
340
|
-
const pt = function(
|
|
341
|
-
if (console.time("editTopic"), !
|
|
345
|
+
const pt = function(e) {
|
|
346
|
+
if (console.time("editTopic"), !e)
|
|
342
347
|
return;
|
|
343
|
-
const
|
|
344
|
-
|
|
348
|
+
const t = k.createElement("div"), n = e.childNodes[0].textContent;
|
|
349
|
+
e.appendChild(t), t.id = "input-box", t.textContent = n, t.contentEditable = "true", t.spellcheck = !1, t.style.cssText = `min-width:${e.offsetWidth - 8}px;`, this.direction === S && (t.style.right = "0"), t.focus(), Oe(t), this.bus.fire("operation", {
|
|
345
350
|
name: "beginEdit",
|
|
346
|
-
obj:
|
|
347
|
-
}),
|
|
351
|
+
obj: e.nodeObj
|
|
352
|
+
}), t.addEventListener("keydown", (i) => {
|
|
348
353
|
i.stopPropagation();
|
|
349
354
|
const o = i.key;
|
|
350
355
|
if (o === "Enter" || o === "Tab") {
|
|
351
356
|
if (i.shiftKey)
|
|
352
357
|
return;
|
|
353
|
-
i.preventDefault(),
|
|
358
|
+
i.preventDefault(), t == null || t.blur(), this.map.focus();
|
|
354
359
|
}
|
|
355
|
-
}),
|
|
360
|
+
}), t.addEventListener("blur", () => {
|
|
356
361
|
var s;
|
|
357
|
-
if (!
|
|
362
|
+
if (!t)
|
|
358
363
|
return;
|
|
359
|
-
const i =
|
|
360
|
-
console.log(o), o === "" ? i.topic = n : i.topic = o,
|
|
364
|
+
const i = e.nodeObj, o = ((s = t.textContent) == null ? void 0 : s.trim()) || "";
|
|
365
|
+
console.log(o), o === "" ? i.topic = n : i.topic = o, t.remove(), o !== n && (e.childNodes[0].textContent = i.topic, this.linkDiv(), this.bus.fire("operation", {
|
|
361
366
|
name: "finishEdit",
|
|
362
367
|
obj: i,
|
|
363
368
|
origin: n
|
|
364
369
|
}));
|
|
365
370
|
}), console.timeEnd("editTopic");
|
|
366
|
-
}, oe = function(
|
|
367
|
-
const
|
|
368
|
-
return
|
|
369
|
-
}, z = document, R = "http://www.w3.org/2000/svg", mt = function(
|
|
371
|
+
}, oe = function(e) {
|
|
372
|
+
const t = k.createElement("me-epd");
|
|
373
|
+
return t.expanded = e !== !1, t.className = e !== !1 ? "minus" : "", t;
|
|
374
|
+
}, z = document, R = "http://www.w3.org/2000/svg", mt = function(e, t) {
|
|
370
375
|
const n = z.createElementNS(R, "path");
|
|
371
|
-
return n.setAttribute("d",
|
|
372
|
-
}, X = function(
|
|
373
|
-
const
|
|
374
|
-
return
|
|
376
|
+
return n.setAttribute("d", e), n.setAttribute("stroke", t || "#666"), n.setAttribute("fill", "none"), n.setAttribute("stroke-width", "3"), n;
|
|
377
|
+
}, X = function(e) {
|
|
378
|
+
const t = z.createElementNS(R, "svg");
|
|
379
|
+
return t.setAttribute("class", e), t.setAttribute("overflow", "visible"), t;
|
|
375
380
|
}, fe = function() {
|
|
376
|
-
const
|
|
377
|
-
return
|
|
378
|
-
}, gt = function(
|
|
381
|
+
const e = z.createElementNS(R, "line");
|
|
382
|
+
return e.setAttribute("stroke", "#bbb"), e.setAttribute("fill", "none"), e.setAttribute("stroke-width", "2"), e;
|
|
383
|
+
}, gt = function(e, t) {
|
|
379
384
|
const n = z.createElementNS(R, "path");
|
|
380
|
-
return n.setAttribute("d",
|
|
381
|
-
}, vt = function(
|
|
385
|
+
return n.setAttribute("d", e), n.setAttribute("stroke", t || "#555"), n.setAttribute("fill", "none"), n.setAttribute("stroke-linecap", "square"), n.setAttribute("stroke-width", "2"), n;
|
|
386
|
+
}, vt = function(e, t) {
|
|
382
387
|
const n = {
|
|
383
388
|
stroke: "rgb(235, 95, 82)",
|
|
384
389
|
fill: "none",
|
|
@@ -386,60 +391,60 @@ const pt = function(t) {
|
|
|
386
391
|
"stroke-width": "2"
|
|
387
392
|
}, i = z.createElementNS(R, "g"), o = z.createElementNS(R, "path"), s = z.createElementNS(R, "path");
|
|
388
393
|
return N(s, {
|
|
389
|
-
d:
|
|
394
|
+
d: t,
|
|
390
395
|
...n
|
|
391
396
|
}), N(o, {
|
|
392
|
-
d:
|
|
397
|
+
d: e,
|
|
393
398
|
...n,
|
|
394
399
|
"stroke-dasharray": "8,2"
|
|
395
400
|
}), i.appendChild(o), i.appendChild(s), i;
|
|
396
|
-
}, Ae = function(
|
|
397
|
-
if (console.time("editSummary"), !
|
|
401
|
+
}, Ae = function(e, t, n) {
|
|
402
|
+
if (console.time("editSummary"), !t)
|
|
398
403
|
return;
|
|
399
404
|
const i = document.createElement("div");
|
|
400
|
-
|
|
401
|
-
const o =
|
|
405
|
+
e.nodes.appendChild(i);
|
|
406
|
+
const o = t.innerHTML;
|
|
402
407
|
i.id = "input-box", i.textContent = o, i.contentEditable = "true", i.spellcheck = !1;
|
|
403
|
-
const s =
|
|
408
|
+
const s = t.getAttribute("x") + "px", r = t.getAttribute("y") + "px";
|
|
404
409
|
i.style.cssText = `min-width:${100 - 8}px;position:absolute;left:${s};top:${r};`;
|
|
405
|
-
const l =
|
|
410
|
+
const l = t.getAttribute("text-anchor");
|
|
406
411
|
l === "end" ? i.style.cssText += "transform: translate(-100%, -100%);" : l === "middle" ? i.style.cssText += "transform: translate(-50%, -100%);" : i.style.cssText += "transform: translate(0, -100%);", i.focus(), Oe(i), i.addEventListener("keydown", (c) => {
|
|
407
412
|
c.stopPropagation();
|
|
408
413
|
const h = c.key;
|
|
409
414
|
if (h === "Enter" || h === "Tab") {
|
|
410
415
|
if (c.shiftKey)
|
|
411
416
|
return;
|
|
412
|
-
c.preventDefault(), i.blur(),
|
|
417
|
+
c.preventDefault(), i.blur(), e.map.focus();
|
|
413
418
|
}
|
|
414
419
|
}), i.addEventListener("blur", () => {
|
|
415
420
|
i && n(i);
|
|
416
421
|
}), console.timeEnd("editSummary");
|
|
417
422
|
};
|
|
418
423
|
let Pe = He;
|
|
419
|
-
const bt = function(
|
|
424
|
+
const bt = function(e) {
|
|
420
425
|
console.time("linkDiv");
|
|
421
|
-
const
|
|
422
|
-
this.nodes.style.top = `${1e4 - this.nodes.offsetHeight / 2}px`, this.nodes.style.left = `${1e4 -
|
|
426
|
+
const t = this.map.querySelector("me-root");
|
|
427
|
+
this.nodes.style.top = `${1e4 - this.nodes.offsetHeight / 2}px`, this.nodes.style.left = `${1e4 - t.offsetLeft - t.offsetWidth / 2}px`;
|
|
423
428
|
const n = this.map.querySelectorAll("me-main > me-wrapper");
|
|
424
429
|
this.lines.innerHTML = "", Pe = this.subLinkStyle === 2 ? wt : He;
|
|
425
430
|
for (let i = 0; i < n.length; i++) {
|
|
426
431
|
const o = n[i], s = o.querySelector("me-tpc"), r = o.firstChild, l = o.parentNode.className;
|
|
427
|
-
let c =
|
|
428
|
-
const h =
|
|
432
|
+
let c = t.offsetLeft + t.offsetWidth / 2;
|
|
433
|
+
const h = t.offsetTop + t.offsetHeight / 2;
|
|
429
434
|
let a;
|
|
430
435
|
const u = this.theme.palette, d = s.nodeObj.branchColor || u[i % u.length], { offsetLeft: p, offsetTop: g } = W(this.nodes, r);
|
|
431
436
|
l === "lhs" ? a = p + r.offsetWidth : a = p;
|
|
432
437
|
const m = g + r.offsetHeight / 2;
|
|
433
438
|
let f = "";
|
|
434
439
|
if (this.mainLinkStyle === 2)
|
|
435
|
-
this.direction === K && (l === "lhs" ? c = c -
|
|
440
|
+
this.direction === K && (l === "lhs" ? c = c - t.offsetWidth / 6 : c = c + t.offsetWidth / 6), f = yt({ x1: c, y1: h, x2: a, y2: m });
|
|
436
441
|
else {
|
|
437
|
-
const b = (1 - Math.abs(m - o.parentElement.offsetTop - o.parentElement.offsetHeight / 2) / o.parentElement.offsetHeight) * 0.25 * (
|
|
438
|
-
l === "lhs" ? c = c -
|
|
442
|
+
const b = (1 - Math.abs(m - o.parentElement.offsetTop - o.parentElement.offsetHeight / 2) / o.parentElement.offsetHeight) * 0.25 * (t.offsetWidth / 2);
|
|
443
|
+
l === "lhs" ? c = c - t.offsetWidth / 10 - b : c = c + t.offsetWidth / 10 + b, f = xt({ x1: c, y1: h, x2: a, y2: m });
|
|
439
444
|
}
|
|
440
445
|
this.lines.appendChild(mt(f, d));
|
|
441
446
|
const v = o.children[0].children[1];
|
|
442
|
-
if (v && (v.style.top = (v.parentNode.offsetHeight - v.offsetHeight) / 2 + "px", l === "lhs" ? v.style.left = "-10px" : v.style.right = "-10px"), !(
|
|
447
|
+
if (v && (v.style.top = (v.parentNode.offsetHeight - v.offsetHeight) / 2 + "px", l === "lhs" ? v.style.left = "-10px" : v.style.right = "-10px"), !(e && e !== o) && o.childElementCount) {
|
|
443
448
|
const x = X("subLines"), b = o.lastChild;
|
|
444
449
|
b.tagName === "svg" && b.remove(), o.appendChild(x);
|
|
445
450
|
const y = o.firstChild, C = o.children[1].children, _ = je(C, y, l, !0);
|
|
@@ -447,11 +452,11 @@ const bt = function(t) {
|
|
|
447
452
|
}
|
|
448
453
|
}
|
|
449
454
|
this.renderCustomLink(), this.renderSummary(), console.timeEnd("linkDiv");
|
|
450
|
-
}, je = function(
|
|
455
|
+
}, je = function(e, t, n, i) {
|
|
451
456
|
let o = "";
|
|
452
|
-
const s =
|
|
453
|
-
for (let h = 0; h <
|
|
454
|
-
const a =
|
|
457
|
+
const s = t.offsetTop, r = t.offsetLeft, l = t.offsetWidth, c = t.offsetHeight;
|
|
458
|
+
for (let h = 0; h < e.length; h++) {
|
|
459
|
+
const a = e[h], u = a.firstChild, d = u.offsetTop, p = u.offsetLeft, g = u.offsetWidth, m = u.offsetHeight;
|
|
455
460
|
o += Pe({ pT: s, pL: r, pW: l, pH: c, cT: d, cL: p, cW: g, cH: m, direction: n, isFirst: i });
|
|
456
461
|
const f = u.children[1];
|
|
457
462
|
if (f) {
|
|
@@ -464,26 +469,26 @@ const bt = function(t) {
|
|
|
464
469
|
}
|
|
465
470
|
return o;
|
|
466
471
|
};
|
|
467
|
-
function yt({ x1:
|
|
468
|
-
return `M ${
|
|
472
|
+
function yt({ x1: e, y1: t, x2: n, y2: i }) {
|
|
473
|
+
return `M ${e} ${t} V ${i > t ? i - 20 : i + 20} C ${e} ${i} ${e} ${i} ${n > e ? e + 20 : e - 20} ${i} H ${n}`;
|
|
469
474
|
}
|
|
470
|
-
function xt({ x1:
|
|
471
|
-
return `M ${
|
|
475
|
+
function xt({ x1: e, y1: t, x2: n, y2: i }) {
|
|
476
|
+
return `M ${e} ${t} Q ${e} ${i} ${n} ${i}`;
|
|
472
477
|
}
|
|
473
|
-
function wt({ pT:
|
|
478
|
+
function wt({ pT: e, pL: t, pW: n, pH: i, cT: o, cL: s, cW: r, cH: l, direction: c, isFirst: h }) {
|
|
474
479
|
let a;
|
|
475
|
-
h ? a =
|
|
480
|
+
h ? a = e + i / 2 : a = e + i;
|
|
476
481
|
const u = o + l;
|
|
477
482
|
let d = 0, p = 0, g = 0;
|
|
478
|
-
return c === "lhs" ? (d =
|
|
483
|
+
return c === "lhs" ? (d = t + M, p = s, g = s + r) : c === "rhs" && (d = t + n - M, p = s + r, g = s), u < a + 50 && u > a - 50 ? `M ${d} ${a} H ${g} V ${u} H ${p}` : u >= a ? `M ${d} ${a} H ${g} V ${u - L} A ${L} ${L} 0 0 ${d > p ? 1 : 0} ${d > p ? g - L : g + L} ${u} H ${p}` : `M ${d} ${a} H ${g} V ${u + L} A ${L} ${L} 0 0 ${d > p ? 0 : 1} ${d > p ? g - L : g + L} ${u} H ${p}`;
|
|
479
484
|
}
|
|
480
|
-
function He({ pT:
|
|
485
|
+
function He({ pT: e, pL: t, pW: n, pH: i, cT: o, cL: s, cW: r, cH: l, direction: c, isFirst: h }) {
|
|
481
486
|
let a = 0, u = 0;
|
|
482
|
-
h ? a =
|
|
487
|
+
h ? a = e + i / 2 : a = e + i;
|
|
483
488
|
const d = o + l;
|
|
484
489
|
let p = 0, g = 0, m = 0;
|
|
485
490
|
const f = Math.min(Math.abs(a - d) / 800, 1.2) * M;
|
|
486
|
-
return c === "lhs" ? (m =
|
|
491
|
+
return c === "lhs" ? (m = t, p = m + M, g = m - M, u = s + M, `M ${p} ${a} C ${m} ${a} ${m + f} ${d} ${g} ${d} H ${u}`) : (m = t + n, p = m - M, g = m + M, u = s + r - M, `M ${p} ${a} C ${m} ${a} ${m - f} ${d} ${g} ${d} H ${u}`);
|
|
487
492
|
}
|
|
488
493
|
const pe = {
|
|
489
494
|
addChild: "插入子节点",
|
|
@@ -566,268 +571,272 @@ const pe = {
|
|
|
566
571
|
summary: "Resumo"
|
|
567
572
|
}
|
|
568
573
|
};
|
|
569
|
-
function Et(
|
|
574
|
+
function Et(e, t) {
|
|
570
575
|
const n = (b) => {
|
|
571
576
|
const y = document.createElement("div");
|
|
572
577
|
return y.innerText = b, y.className = "tips", y;
|
|
573
578
|
}, i = (b, y, C) => {
|
|
574
579
|
const _ = document.createElement("li");
|
|
575
580
|
return _.id = b, _.innerHTML = `<span>${ee(y)}</span><span>${ee(C)}</span>`, _;
|
|
576
|
-
}, o = me[
|
|
577
|
-
if (f.className = "menu-list", f.appendChild(r), f.appendChild(l), f.appendChild(c), f.appendChild(h), (!
|
|
578
|
-
for (let b = 0; b <
|
|
579
|
-
const y =
|
|
581
|
+
}, o = me[e.locale] ? e.locale : "en", s = me[o], r = i("cm-add_child", s.addChild, "tab"), l = i("cm-add_parent", s.addParent, ""), c = i("cm-add_sibling", s.addSibling, "enter"), h = i("cm-remove_child", s.removeNode, "delete"), a = i("cm-fucus", s.focus, ""), u = i("cm-unfucus", s.cancelFocus, ""), d = i("cm-up", s.moveUp, "PgUp"), p = i("cm-down", s.moveDown, "Pgdn"), g = i("cm-down", s.link, ""), m = i("cm-down", s.summary, ""), f = document.createElement("ul");
|
|
582
|
+
if (f.className = "menu-list", f.appendChild(r), f.appendChild(l), f.appendChild(c), f.appendChild(h), (!t || t.focus) && (f.appendChild(a), f.appendChild(u)), f.appendChild(d), f.appendChild(p), f.appendChild(m), (!t || t.link) && f.appendChild(g), t && t.extend)
|
|
583
|
+
for (let b = 0; b < t.extend.length; b++) {
|
|
584
|
+
const y = t.extend[b], C = i(y.name, y.name, y.key || "");
|
|
580
585
|
f.appendChild(C), C.onclick = (_) => {
|
|
581
586
|
y.onclick(_);
|
|
582
587
|
};
|
|
583
588
|
}
|
|
584
589
|
const v = document.createElement("div");
|
|
585
|
-
v.className = "context-menu", v.appendChild(f), v.hidden = !0,
|
|
590
|
+
v.className = "context-menu", v.appendChild(f), v.hidden = !0, e.container.append(v);
|
|
586
591
|
let x = !0;
|
|
587
|
-
|
|
588
|
-
if (b.preventDefault(), !
|
|
592
|
+
e.container.oncontextmenu = function(b) {
|
|
593
|
+
if (b.preventDefault(), !e.editable)
|
|
589
594
|
return;
|
|
590
595
|
const y = b.target;
|
|
591
596
|
if (y.tagName === "ME-TPC") {
|
|
592
|
-
y.parentElement.tagName === "ME-ROOT" ? x = !0 : x = !1, x ? (a.className = "disabled", d.className = "disabled", p.className = "disabled", l.className = "disabled", c.className = "disabled", h.className = "disabled") : (a.className = "", d.className = "", p.className = "", l.className = "", c.className = "", h.className = ""),
|
|
597
|
+
y.parentElement.tagName === "ME-ROOT" ? x = !0 : x = !1, x ? (a.className = "disabled", d.className = "disabled", p.className = "disabled", l.className = "disabled", c.className = "disabled", h.className = "disabled") : (a.className = "", d.className = "", p.className = "", l.className = "", c.className = "", h.className = ""), e.currentNodes || e.selectNode(y), v.hidden = !1;
|
|
593
598
|
const C = f.offsetHeight, _ = f.offsetWidth;
|
|
594
599
|
C + b.clientY > window.innerHeight ? (f.style.top = "", f.style.bottom = "0px") : (f.style.bottom = "", f.style.top = b.clientY + 15 + "px"), _ + b.clientX > window.innerWidth ? (f.style.left = "", f.style.right = "0px") : (f.style.right = "", f.style.left = b.clientX + 10 + "px");
|
|
595
600
|
}
|
|
596
601
|
}, v.onclick = (b) => {
|
|
597
602
|
b.target === v && (v.hidden = !0);
|
|
598
603
|
}, r.onclick = () => {
|
|
599
|
-
|
|
604
|
+
e.addChild(), v.hidden = !0;
|
|
600
605
|
}, l.onclick = () => {
|
|
601
|
-
|
|
606
|
+
e.insertParent(), v.hidden = !0;
|
|
602
607
|
}, c.onclick = () => {
|
|
603
|
-
x || (
|
|
608
|
+
x || (e.insertSibling(), v.hidden = !0);
|
|
604
609
|
}, h.onclick = () => {
|
|
605
|
-
x || (
|
|
610
|
+
x || (e.removeNode(), v.hidden = !0);
|
|
606
611
|
}, a.onclick = () => {
|
|
607
|
-
x || (
|
|
612
|
+
x || (e.focusNode(e.currentNode), v.hidden = !0);
|
|
608
613
|
}, u.onclick = () => {
|
|
609
|
-
|
|
614
|
+
e.cancelFocus(), v.hidden = !0;
|
|
610
615
|
}, d.onclick = () => {
|
|
611
|
-
x || (
|
|
616
|
+
x || (e.moveUpNode(), v.hidden = !0);
|
|
612
617
|
}, p.onclick = () => {
|
|
613
|
-
x || (
|
|
618
|
+
x || (e.moveDownNode(), v.hidden = !0);
|
|
614
619
|
}, g.onclick = () => {
|
|
615
620
|
v.hidden = !0;
|
|
616
|
-
const b =
|
|
617
|
-
|
|
621
|
+
const b = e.currentNode, y = n(s.clickTips);
|
|
622
|
+
e.container.appendChild(y), e.map.addEventListener(
|
|
618
623
|
"click",
|
|
619
624
|
(C) => {
|
|
620
625
|
C.preventDefault(), y.remove();
|
|
621
626
|
const _ = C.target;
|
|
622
|
-
_.parentElement.tagName === "ME-PARENT" || _.parentElement.tagName === "ME-ROOT" ?
|
|
627
|
+
_.parentElement.tagName === "ME-PARENT" || _.parentElement.tagName === "ME-ROOT" ? e.createLink(b, _) : console.log("link cancel");
|
|
623
628
|
},
|
|
624
629
|
{
|
|
625
630
|
once: !0
|
|
626
631
|
}
|
|
627
632
|
);
|
|
628
633
|
}, m.onclick = () => {
|
|
629
|
-
v.hidden = !0,
|
|
634
|
+
v.hidden = !0, e.createSummary(), e.unselectNodes();
|
|
630
635
|
};
|
|
631
636
|
}
|
|
632
|
-
const Nt = (
|
|
633
|
-
const
|
|
634
|
-
|
|
635
|
-
}, Ct = (
|
|
636
|
-
const
|
|
637
|
-
|
|
638
|
-
}, ge = (
|
|
639
|
-
|
|
637
|
+
const Nt = (e) => {
|
|
638
|
+
const t = e.map.querySelectorAll(".lhs>me-wrapper>me-parent>me-tpc");
|
|
639
|
+
e.selectNode(t[Math.ceil(t.length / 2) - 1]);
|
|
640
|
+
}, Ct = (e) => {
|
|
641
|
+
const t = e.map.querySelectorAll(".rhs>me-wrapper>me-parent>me-tpc");
|
|
642
|
+
e.selectNode(t[Math.ceil(t.length / 2) - 1]);
|
|
643
|
+
}, ge = (e) => {
|
|
644
|
+
e.selectNode(e.map.querySelector("me-root>me-tpc"));
|
|
640
645
|
};
|
|
641
|
-
function _t(
|
|
642
|
-
const
|
|
643
|
-
13: () => {
|
|
644
|
-
|
|
646
|
+
function _t(e) {
|
|
647
|
+
const t = {
|
|
648
|
+
13: (n) => {
|
|
649
|
+
n.shiftKey ? e.insertBefore() : e.insertSibling();
|
|
645
650
|
},
|
|
646
651
|
9: () => {
|
|
647
|
-
|
|
652
|
+
e.addChild();
|
|
648
653
|
},
|
|
649
654
|
112: () => {
|
|
650
|
-
|
|
655
|
+
e.toCenter();
|
|
651
656
|
},
|
|
652
657
|
113: () => {
|
|
653
|
-
|
|
658
|
+
e.beginEdit();
|
|
654
659
|
},
|
|
655
660
|
38: (n) => {
|
|
656
|
-
if (n.
|
|
657
|
-
|
|
658
|
-
|
|
661
|
+
if (n.altKey)
|
|
662
|
+
e.moveUpNode();
|
|
663
|
+
else {
|
|
664
|
+
if (n.metaKey || n.ctrlKey)
|
|
665
|
+
return e.initSide();
|
|
666
|
+
e.selectPrevSibling();
|
|
667
|
+
}
|
|
659
668
|
},
|
|
660
|
-
40: () => {
|
|
661
|
-
|
|
669
|
+
40: (n) => {
|
|
670
|
+
n.altKey ? e.moveDownNode() : e.selectNextSibling();
|
|
662
671
|
},
|
|
663
672
|
37: (n) => {
|
|
664
673
|
var s;
|
|
665
674
|
if (n.metaKey || n.ctrlKey)
|
|
666
|
-
return
|
|
667
|
-
if (!
|
|
675
|
+
return e.initLeft();
|
|
676
|
+
if (!e.currentNode)
|
|
668
677
|
return;
|
|
669
|
-
const i =
|
|
670
|
-
|
|
678
|
+
const i = e.currentNode.nodeObj, o = e.currentNode.offsetParent.offsetParent.parentElement;
|
|
679
|
+
e.currentNode.nodeObj.root ? Nt(e) : o.className === "rhs" ? (s = i.parent) != null && s.root ? ge(e) : e.selectParent() : o.className === "lhs" && e.selectFirstChild();
|
|
671
680
|
},
|
|
672
681
|
39: (n) => {
|
|
673
682
|
var s;
|
|
674
683
|
if (n.metaKey || n.ctrlKey)
|
|
675
|
-
return
|
|
676
|
-
if (!
|
|
684
|
+
return e.initRight();
|
|
685
|
+
if (!e.currentNode)
|
|
677
686
|
return;
|
|
678
|
-
const i =
|
|
679
|
-
i.root ? Ct(
|
|
687
|
+
const i = e.currentNode.nodeObj, o = e.currentNode.offsetParent.offsetParent.parentElement;
|
|
688
|
+
i.root ? Ct(e) : o.className === "lhs" ? (s = i.parent) != null && s.root ? ge(e) : e.selectParent() : o.className === "rhs" && e.selectFirstChild();
|
|
680
689
|
},
|
|
681
690
|
33() {
|
|
682
|
-
|
|
691
|
+
e.moveUpNode();
|
|
683
692
|
},
|
|
684
693
|
34() {
|
|
685
|
-
|
|
694
|
+
e.moveDownNode();
|
|
686
695
|
},
|
|
687
696
|
67: (n) => {
|
|
688
|
-
(n.metaKey || n.ctrlKey) && (
|
|
697
|
+
(n.metaKey || n.ctrlKey) && (e.waitCopy = e.currentNode);
|
|
689
698
|
},
|
|
690
699
|
86: (n) => {
|
|
691
|
-
!
|
|
700
|
+
!e.waitCopy || !e.currentNode || (n.metaKey || n.ctrlKey) && (e.copyNode(e.waitCopy, e.currentNode), e.waitCopy = null);
|
|
692
701
|
},
|
|
693
702
|
// ctrl +
|
|
694
703
|
187: (n) => {
|
|
695
704
|
if (n.metaKey || n.ctrlKey) {
|
|
696
|
-
if (
|
|
705
|
+
if (e.scaleVal > 1.6)
|
|
697
706
|
return;
|
|
698
|
-
|
|
707
|
+
e.scale(e.scaleVal += 0.2);
|
|
699
708
|
}
|
|
700
709
|
},
|
|
701
710
|
// ctrl -
|
|
702
711
|
189: (n) => {
|
|
703
712
|
if (n.metaKey || n.ctrlKey) {
|
|
704
|
-
if (
|
|
713
|
+
if (e.scaleVal < 0.6)
|
|
705
714
|
return;
|
|
706
|
-
|
|
715
|
+
e.scale(e.scaleVal -= 0.2);
|
|
707
716
|
}
|
|
708
717
|
},
|
|
709
718
|
// ctrl 0
|
|
710
719
|
48: (n) => {
|
|
711
|
-
(n.metaKey || n.ctrlKey) &&
|
|
720
|
+
(n.metaKey || n.ctrlKey) && e.scale(1);
|
|
712
721
|
}
|
|
713
722
|
};
|
|
714
|
-
|
|
715
|
-
if (n.preventDefault(), !!
|
|
723
|
+
e.map.onkeydown = (n) => {
|
|
724
|
+
if (n.preventDefault(), !!e.editable && n.target === n.currentTarget)
|
|
716
725
|
if (n.keyCode === 8 || n.keyCode === 46)
|
|
717
|
-
|
|
726
|
+
e.currentLink ? e.removeLink() : e.currentSummary ? e.removeSummary(e.currentSummary.summaryObj.id) : e.removeNode();
|
|
718
727
|
else {
|
|
719
|
-
const i =
|
|
728
|
+
const i = t[n.keyCode];
|
|
720
729
|
i && i(n);
|
|
721
730
|
}
|
|
722
731
|
};
|
|
723
732
|
}
|
|
724
|
-
function kt(
|
|
733
|
+
function kt(e, t) {
|
|
725
734
|
const n = (d, p) => {
|
|
726
735
|
const g = document.createElement("div");
|
|
727
736
|
return g.id = d, g.innerHTML = `<svg class="icon" aria-hidden="true">
|
|
728
737
|
<use xlink:href="#icon-${p}"></use>
|
|
729
738
|
</svg>`, g;
|
|
730
739
|
}, i = n("cm-add_child", "zijiedian"), o = n("cm-add_sibling", "tongjijiedian-"), s = n("cm-remove_child", "shanchu2"), r = n("cm-up", "rising"), l = n("cm-down", "falling"), c = n("cm-edit", "edit"), h = document.createElement("ul");
|
|
731
|
-
if (h.className = "menu-list",
|
|
732
|
-
for (let d = 0; d <
|
|
733
|
-
const p =
|
|
740
|
+
if (h.className = "menu-list", t && t.extend)
|
|
741
|
+
for (let d = 0; d < t.extend.length; d++) {
|
|
742
|
+
const p = t.extend[d], g = n(p.name, p.name);
|
|
734
743
|
h.appendChild(g), g.onclick = (m) => {
|
|
735
744
|
p.onclick(m);
|
|
736
745
|
};
|
|
737
746
|
}
|
|
738
747
|
const a = document.createElement("mmenu");
|
|
739
|
-
a.className = "mobile-menu", a.appendChild(i), a.appendChild(o), a.appendChild(s), a.appendChild(r), a.appendChild(l), a.appendChild(c), a.hidden = !0,
|
|
748
|
+
a.className = "mobile-menu", a.appendChild(i), a.appendChild(o), a.appendChild(s), a.appendChild(r), a.appendChild(l), a.appendChild(c), a.hidden = !0, e.container.append(a);
|
|
740
749
|
let u = !0;
|
|
741
|
-
|
|
750
|
+
e.bus.addListener("unselectNode", function() {
|
|
742
751
|
a.hidden = !0;
|
|
743
|
-
}),
|
|
752
|
+
}), e.bus.addListener("selectNode", function(d) {
|
|
744
753
|
a.hidden = !1, d.root ? u = !0 : u = !1;
|
|
745
754
|
}), a.onclick = (d) => {
|
|
746
755
|
d.target === a && (a.hidden = !0);
|
|
747
756
|
}, i.onclick = () => {
|
|
748
|
-
|
|
757
|
+
e.addChild();
|
|
749
758
|
}, o.onclick = () => {
|
|
750
|
-
u ||
|
|
759
|
+
u || e.insertSibling();
|
|
751
760
|
}, s.onclick = () => {
|
|
752
|
-
u ||
|
|
761
|
+
u || e.removeNode();
|
|
753
762
|
}, r.onclick = (d) => {
|
|
754
|
-
u ||
|
|
763
|
+
u || e.moveUpNode();
|
|
755
764
|
}, l.onclick = (d) => {
|
|
756
|
-
u ||
|
|
765
|
+
u || e.moveDownNode();
|
|
757
766
|
}, c.onclick = (d) => {
|
|
758
|
-
|
|
767
|
+
e.beginEdit();
|
|
759
768
|
};
|
|
760
769
|
}
|
|
761
|
-
const le = document, St = function(
|
|
762
|
-
if (!
|
|
763
|
-
return ce(
|
|
764
|
-
const n =
|
|
770
|
+
const le = document, St = function(e, t) {
|
|
771
|
+
if (!t)
|
|
772
|
+
return ce(e), e;
|
|
773
|
+
const n = e.getElementsByClassName("insert-preview"), i = `insert-preview ${t} show`;
|
|
765
774
|
if (n.length > 0)
|
|
766
775
|
n[0].className = i;
|
|
767
776
|
else {
|
|
768
777
|
const o = le.createElement("div");
|
|
769
|
-
o.className = i,
|
|
778
|
+
o.className = i, e.appendChild(o);
|
|
770
779
|
}
|
|
771
|
-
return
|
|
772
|
-
}, ce = function(
|
|
773
|
-
if (!
|
|
780
|
+
return e;
|
|
781
|
+
}, ce = function(e) {
|
|
782
|
+
if (!e)
|
|
774
783
|
return;
|
|
775
|
-
const
|
|
776
|
-
for (const n of
|
|
784
|
+
const t = e.getElementsByClassName("insert-preview");
|
|
785
|
+
for (const n of t || [])
|
|
777
786
|
n.remove();
|
|
778
|
-
}, ve = function(
|
|
779
|
-
const n =
|
|
780
|
-
return
|
|
781
|
-
}, Lt = function(
|
|
782
|
-
const
|
|
783
|
-
return
|
|
787
|
+
}, ve = function(e, t) {
|
|
788
|
+
const n = t.parentElement.parentElement.contains(e);
|
|
789
|
+
return e && e.tagName === "ME-TPC" && e !== t && !n && e.nodeObj.root !== !0;
|
|
790
|
+
}, Lt = function(e) {
|
|
791
|
+
const t = document.createElement("div");
|
|
792
|
+
return t.className = "mind-elixir-ghost", e.map.appendChild(t), t;
|
|
784
793
|
};
|
|
785
|
-
function Mt(
|
|
786
|
-
let
|
|
787
|
-
const o = Lt(
|
|
788
|
-
|
|
794
|
+
function Mt(e) {
|
|
795
|
+
let t = null, n = null, i = null;
|
|
796
|
+
const o = Lt(e), s = 12;
|
|
797
|
+
e.map.addEventListener("dragstart", (r) => {
|
|
789
798
|
var c;
|
|
790
799
|
const l = r.target;
|
|
791
800
|
if ((l == null ? void 0 : l.tagName) !== "ME-TPC") {
|
|
792
801
|
r.preventDefault();
|
|
793
802
|
return;
|
|
794
803
|
}
|
|
795
|
-
|
|
796
|
-
}),
|
|
797
|
-
if (!
|
|
804
|
+
t = l, t.parentElement.parentElement.style.opacity = "0.5", o.innerHTML = t.innerHTML, (c = r.dataTransfer) == null || c.setDragImage(o, 0, 0), D.clear();
|
|
805
|
+
}), e.map.addEventListener("dragend", async (r) => {
|
|
806
|
+
if (!t)
|
|
798
807
|
return;
|
|
799
|
-
|
|
808
|
+
t.parentElement.parentElement.style.opacity = "1";
|
|
800
809
|
const l = r.target;
|
|
801
810
|
if (l.style.opacity = "", !i)
|
|
802
811
|
return;
|
|
803
812
|
ce(i);
|
|
804
|
-
const c =
|
|
813
|
+
const c = t.nodeObj;
|
|
805
814
|
switch (n) {
|
|
806
815
|
case "before":
|
|
807
|
-
|
|
816
|
+
e.moveNodeBefore(t, i), e.selectNode(E(c.id));
|
|
808
817
|
break;
|
|
809
818
|
case "after":
|
|
810
|
-
|
|
819
|
+
e.moveNodeAfter(t, i), e.selectNode(E(c.id));
|
|
811
820
|
break;
|
|
812
821
|
case "in":
|
|
813
|
-
|
|
822
|
+
e.moveNode(t, i);
|
|
814
823
|
break;
|
|
815
824
|
}
|
|
816
|
-
|
|
817
|
-
}),
|
|
825
|
+
t = null;
|
|
826
|
+
}), e.map.addEventListener(
|
|
818
827
|
"dragover",
|
|
819
828
|
Ke(function(r) {
|
|
820
|
-
if (!
|
|
829
|
+
if (!t)
|
|
821
830
|
return;
|
|
822
831
|
ce(i);
|
|
823
832
|
const l = le.elementFromPoint(r.clientX, r.clientY - s);
|
|
824
|
-
if (ve(l,
|
|
833
|
+
if (ve(l, t)) {
|
|
825
834
|
i = l;
|
|
826
835
|
const c = l.getBoundingClientRect().y;
|
|
827
836
|
r.clientY > c + l.clientHeight ? n = "after" : r.clientY > c + l.clientHeight / 2 && (n = "in");
|
|
828
837
|
} else {
|
|
829
838
|
const c = le.elementFromPoint(r.clientX, r.clientY + s);
|
|
830
|
-
if (ve(c,
|
|
839
|
+
if (ve(c, t)) {
|
|
831
840
|
i = c;
|
|
832
841
|
const h = c.getBoundingClientRect().y;
|
|
833
842
|
r.clientY < h ? n = "before" : r.clientY < h + c.clientHeight / 2 && (n = "in");
|
|
@@ -838,77 +847,77 @@ function Mt(t) {
|
|
|
838
847
|
}, 200)
|
|
839
848
|
);
|
|
840
849
|
}
|
|
841
|
-
function Tt(
|
|
842
|
-
let
|
|
843
|
-
|
|
850
|
+
function Tt(e) {
|
|
851
|
+
let t = [], n = -1, i = e.getData();
|
|
852
|
+
e.bus.addListener("operation", (o) => {
|
|
844
853
|
if (o.name === "beginEdit")
|
|
845
854
|
return;
|
|
846
|
-
|
|
847
|
-
const s =
|
|
848
|
-
|
|
849
|
-
}),
|
|
855
|
+
t = t.slice(0, n + 1);
|
|
856
|
+
const s = e.getData();
|
|
857
|
+
t.push({ prev: i, currentNodeId: o.obj.id, next: s }), i = s, n = t.length - 1, console.log("operation", o.obj.id, t);
|
|
858
|
+
}), e.undo = function() {
|
|
850
859
|
if (n > -1) {
|
|
851
|
-
const o =
|
|
852
|
-
i = o.prev,
|
|
860
|
+
const o = t[n];
|
|
861
|
+
i = o.prev, e.refresh(o.prev), e.selectNode(E(o.currentNodeId)), n--, console.log("current", i);
|
|
853
862
|
}
|
|
854
|
-
},
|
|
855
|
-
if (n <
|
|
863
|
+
}, e.redo = function() {
|
|
864
|
+
if (n < t.length - 1) {
|
|
856
865
|
n++;
|
|
857
|
-
const o =
|
|
858
|
-
i = o.next,
|
|
866
|
+
const o = t[n];
|
|
867
|
+
i = o.next, e.refresh(o.next), e.selectNode(E(o.currentNodeId));
|
|
859
868
|
}
|
|
860
|
-
},
|
|
861
|
-
(o.metaKey || o.ctrlKey) && o.shiftKey && o.key === "Z" ?
|
|
869
|
+
}, e.map.addEventListener("keydown", (o) => {
|
|
870
|
+
(o.metaKey || o.ctrlKey) && o.shiftKey && o.key === "Z" ? e.redo() : (o.metaKey || o.ctrlKey) && o.key === "z" && e.undo();
|
|
862
871
|
});
|
|
863
872
|
}
|
|
864
|
-
const B = (
|
|
873
|
+
const B = (e, t) => {
|
|
865
874
|
const n = document.createElement("span");
|
|
866
|
-
return n.id =
|
|
867
|
-
<use xlink:href="#icon-${
|
|
875
|
+
return n.id = e, n.innerHTML = `<svg class="icon" aria-hidden="true">
|
|
876
|
+
<use xlink:href="#icon-${t}"></use>
|
|
868
877
|
</svg>`, n;
|
|
869
878
|
};
|
|
870
|
-
function $t(
|
|
871
|
-
const
|
|
872
|
-
return r.innerText = "100%",
|
|
873
|
-
|
|
879
|
+
function $t(e) {
|
|
880
|
+
const t = document.createElement("div"), n = B("fullscreen", "full"), i = B("toCenter", "living"), o = B("zoomout", "move"), s = B("zoomin", "add"), r = document.createElement("span");
|
|
881
|
+
return r.innerText = "100%", t.appendChild(n), t.appendChild(i), t.appendChild(o), t.appendChild(s), t.className = "mind-elixir-toolbar rb", n.onclick = () => {
|
|
882
|
+
e.container.requestFullscreen();
|
|
874
883
|
}, i.onclick = () => {
|
|
875
|
-
|
|
884
|
+
e.toCenter();
|
|
876
885
|
}, o.onclick = () => {
|
|
877
|
-
|
|
886
|
+
e.scaleVal < 0.6 || e.scale(e.scaleVal -= 0.2);
|
|
878
887
|
}, s.onclick = () => {
|
|
879
|
-
|
|
880
|
-
},
|
|
888
|
+
e.scaleVal > 1.6 || e.scale(e.scaleVal += 0.2);
|
|
889
|
+
}, t;
|
|
881
890
|
}
|
|
882
|
-
function Dt(
|
|
883
|
-
const
|
|
884
|
-
return
|
|
885
|
-
|
|
891
|
+
function Dt(e) {
|
|
892
|
+
const t = document.createElement("div"), n = B("tbltl", "left"), i = B("tbltr", "right"), o = B("tblts", "side");
|
|
893
|
+
return t.appendChild(n), t.appendChild(i), t.appendChild(o), t.className = "mind-elixir-toolbar lt", n.onclick = () => {
|
|
894
|
+
e.initLeft();
|
|
886
895
|
}, i.onclick = () => {
|
|
887
|
-
|
|
896
|
+
e.initRight();
|
|
888
897
|
}, o.onclick = () => {
|
|
889
|
-
|
|
890
|
-
},
|
|
898
|
+
e.initSide();
|
|
899
|
+
}, t;
|
|
891
900
|
}
|
|
892
|
-
function Ot(
|
|
893
|
-
|
|
901
|
+
function Ot(e) {
|
|
902
|
+
e.container.append($t(e)), e.container.append(Dt(e));
|
|
894
903
|
}
|
|
895
904
|
/*! @viselect/vanilla v3.3.1 MIT | https://github.com/Simonwep/selection/tree/master/packages/vanilla */
|
|
896
|
-
var At = Object.defineProperty, Pt = (
|
|
905
|
+
var At = Object.defineProperty, Pt = (e, t, n) => t in e ? At(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, w = (e, t, n) => (Pt(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
897
906
|
class jt {
|
|
898
907
|
constructor() {
|
|
899
908
|
w(this, "_listeners", /* @__PURE__ */ new Map()), w(this, "on", this.addEventListener), w(this, "off", this.removeEventListener), w(this, "emit", this.dispatchEvent);
|
|
900
909
|
}
|
|
901
|
-
addEventListener(
|
|
902
|
-
const i = this._listeners.get(
|
|
903
|
-
return this._listeners.set(
|
|
910
|
+
addEventListener(t, n) {
|
|
911
|
+
const i = this._listeners.get(t) ?? /* @__PURE__ */ new Set();
|
|
912
|
+
return this._listeners.set(t, i), i.add(n), this;
|
|
904
913
|
}
|
|
905
|
-
removeEventListener(
|
|
914
|
+
removeEventListener(t, n) {
|
|
906
915
|
var i;
|
|
907
|
-
return (i = this._listeners.get(
|
|
916
|
+
return (i = this._listeners.get(t)) == null || i.delete(n), this;
|
|
908
917
|
}
|
|
909
|
-
dispatchEvent(
|
|
918
|
+
dispatchEvent(t, ...n) {
|
|
910
919
|
let i = !0;
|
|
911
|
-
for (const o of this._listeners.get(
|
|
920
|
+
for (const o of this._listeners.get(t) ?? [])
|
|
912
921
|
i = o(...n) !== !1 && i;
|
|
913
922
|
return i;
|
|
914
923
|
}
|
|
@@ -916,55 +925,55 @@ class jt {
|
|
|
916
925
|
this._listeners.clear();
|
|
917
926
|
}
|
|
918
927
|
}
|
|
919
|
-
const be = (
|
|
920
|
-
function O({ style:
|
|
921
|
-
if (typeof
|
|
922
|
-
for (const [i, o] of Object.entries(
|
|
923
|
-
o !== void 0 && (
|
|
928
|
+
const be = (e, t = "px") => typeof e == "number" ? e + t : e;
|
|
929
|
+
function O({ style: e }, t, n) {
|
|
930
|
+
if (typeof t == "object")
|
|
931
|
+
for (const [i, o] of Object.entries(t))
|
|
932
|
+
o !== void 0 && (e[i] = be(o));
|
|
924
933
|
else
|
|
925
|
-
n !== void 0 && (t
|
|
934
|
+
n !== void 0 && (e[t] = be(n));
|
|
926
935
|
}
|
|
927
|
-
function Be(
|
|
928
|
-
return (
|
|
929
|
-
|
|
930
|
-
for (const s of
|
|
936
|
+
function Be(e) {
|
|
937
|
+
return (t, n, i, o = {}) => {
|
|
938
|
+
t instanceof HTMLCollection || t instanceof NodeList ? t = Array.from(t) : Array.isArray(t) || (t = [t]), Array.isArray(n) || (n = [n]);
|
|
939
|
+
for (const s of t)
|
|
931
940
|
for (const r of n)
|
|
932
|
-
s[
|
|
933
|
-
return [
|
|
941
|
+
s[e](r, i, { capture: !1, ...o });
|
|
942
|
+
return [t, n, i, o];
|
|
934
943
|
};
|
|
935
944
|
}
|
|
936
|
-
const q = Be("addEventListener"), A = Be("removeEventListener"), Q = (
|
|
937
|
-
var
|
|
938
|
-
const { clientX: n, clientY: i, target: o } = ((
|
|
945
|
+
const q = Be("addEventListener"), A = Be("removeEventListener"), Q = (e) => {
|
|
946
|
+
var t;
|
|
947
|
+
const { clientX: n, clientY: i, target: o } = ((t = e.touches) == null ? void 0 : t[0]) ?? e;
|
|
939
948
|
return { x: n, y: i, target: o };
|
|
940
949
|
};
|
|
941
|
-
function ye(
|
|
950
|
+
function ye(e, t, n = "touch") {
|
|
942
951
|
switch (n) {
|
|
943
952
|
case "center": {
|
|
944
|
-
const i =
|
|
945
|
-
return i >=
|
|
953
|
+
const i = t.left + t.width / 2, o = t.top + t.height / 2;
|
|
954
|
+
return i >= e.left && i <= e.right && o >= e.top && o <= e.bottom;
|
|
946
955
|
}
|
|
947
956
|
case "cover":
|
|
948
|
-
return
|
|
957
|
+
return t.left >= e.left && t.top >= e.top && t.right <= e.right && t.bottom <= e.bottom;
|
|
949
958
|
case "touch":
|
|
950
|
-
return
|
|
959
|
+
return e.right >= t.left && e.left <= t.right && e.bottom >= t.top && e.top <= t.bottom;
|
|
951
960
|
}
|
|
952
961
|
}
|
|
953
|
-
function F(
|
|
954
|
-
const n = Array.isArray(
|
|
962
|
+
function F(e, t = document) {
|
|
963
|
+
const n = Array.isArray(e) ? e : [e];
|
|
955
964
|
let i = [];
|
|
956
965
|
for (let o = 0, s = n.length; o < s; o++) {
|
|
957
966
|
const r = n[o];
|
|
958
|
-
typeof r == "string" ? i = i.concat(Array.from(
|
|
967
|
+
typeof r == "string" ? i = i.concat(Array.from(t.querySelectorAll(r))) : r instanceof Element && i.push(r);
|
|
959
968
|
}
|
|
960
969
|
return i;
|
|
961
970
|
}
|
|
962
|
-
const Ht = () => matchMedia("(hover: none), (pointer: coarse)").matches, Bt = () => "safari" in window, zt = (
|
|
963
|
-
let
|
|
971
|
+
const Ht = () => matchMedia("(hover: none), (pointer: coarse)").matches, Bt = () => "safari" in window, zt = (e) => {
|
|
972
|
+
let t, n = -1, i = !1;
|
|
964
973
|
return {
|
|
965
974
|
next(...o) {
|
|
966
|
-
|
|
967
|
-
|
|
975
|
+
t = o, i || (i = !0, n = requestAnimationFrame(() => {
|
|
976
|
+
e(...t), i = !1;
|
|
968
977
|
}));
|
|
969
978
|
},
|
|
970
979
|
cancel() {
|
|
@@ -973,7 +982,7 @@ const Ht = () => matchMedia("(hover: none), (pointer: coarse)").matches, Bt = ()
|
|
|
973
982
|
};
|
|
974
983
|
}, { abs: j, max: xe, min: we, ceil: Ee } = Math;
|
|
975
984
|
class ze extends jt {
|
|
976
|
-
constructor(
|
|
985
|
+
constructor(t) {
|
|
977
986
|
var n, i, o, s, r;
|
|
978
987
|
super(), w(this, "_options"), w(this, "_selection", {
|
|
979
988
|
stored: [],
|
|
@@ -993,31 +1002,31 @@ class ze extends jt {
|
|
|
993
1002
|
startAreas: ["html"],
|
|
994
1003
|
boundaries: ["html"],
|
|
995
1004
|
container: "body",
|
|
996
|
-
...
|
|
1005
|
+
...t,
|
|
997
1006
|
behaviour: {
|
|
998
1007
|
overlap: "invert",
|
|
999
1008
|
intersect: "touch",
|
|
1000
|
-
...
|
|
1001
|
-
startThreshold: (n =
|
|
1009
|
+
...t.behaviour,
|
|
1010
|
+
startThreshold: (n = t.behaviour) != null && n.startThreshold ? typeof t.behaviour.startThreshold == "number" ? t.behaviour.startThreshold : { x: 10, y: 10, ...t.behaviour.startThreshold } : { x: 10, y: 10 },
|
|
1002
1011
|
scrolling: {
|
|
1003
1012
|
speedDivider: 10,
|
|
1004
1013
|
manualSpeed: 750,
|
|
1005
|
-
...(i =
|
|
1014
|
+
...(i = t.behaviour) == null ? void 0 : i.scrolling,
|
|
1006
1015
|
startScrollMargins: {
|
|
1007
1016
|
x: 0,
|
|
1008
1017
|
y: 0,
|
|
1009
|
-
...(s = (o =
|
|
1018
|
+
...(s = (o = t.behaviour) == null ? void 0 : o.scrolling) == null ? void 0 : s.startScrollMargins
|
|
1010
1019
|
}
|
|
1011
1020
|
}
|
|
1012
1021
|
},
|
|
1013
1022
|
features: {
|
|
1014
1023
|
range: !0,
|
|
1015
1024
|
touch: !0,
|
|
1016
|
-
...
|
|
1025
|
+
...t.features,
|
|
1017
1026
|
singleTap: {
|
|
1018
1027
|
allow: !0,
|
|
1019
1028
|
intersect: "native",
|
|
1020
|
-
...(r =
|
|
1029
|
+
...(r = t.features) == null ? void 0 : r.singleTap
|
|
1021
1030
|
}
|
|
1022
1031
|
}
|
|
1023
1032
|
};
|
|
@@ -1040,26 +1049,26 @@ class ze extends jt {
|
|
|
1040
1049
|
this._recalculateSelectionAreaRect(), this._updateElementSelection(), this._emitEvent("move", a), this._redrawSelectionArea();
|
|
1041
1050
|
}), this.enable();
|
|
1042
1051
|
}
|
|
1043
|
-
_bindStartEvents(
|
|
1044
|
-
const { document: n, features: i } = this._options, o =
|
|
1052
|
+
_bindStartEvents(t = !0) {
|
|
1053
|
+
const { document: n, features: i } = this._options, o = t ? q : A;
|
|
1045
1054
|
o(n, "mousedown", this._onTapStart), i.touch && o(n, "touchstart", this._onTapStart, {
|
|
1046
1055
|
passive: !1
|
|
1047
1056
|
});
|
|
1048
1057
|
}
|
|
1049
|
-
_onTapStart(
|
|
1050
|
-
const { x: i, y: o, target: s } = Q(
|
|
1058
|
+
_onTapStart(t, n = !1) {
|
|
1059
|
+
const { x: i, y: o, target: s } = Q(t), { _options: r } = this, { document: l } = this._options, c = s.getBoundingClientRect(), h = F(r.startAreas, r.document), a = F(r.boundaries, r.document);
|
|
1051
1060
|
this._targetElement = a.find(
|
|
1052
1061
|
(p) => ye(p.getBoundingClientRect(), c)
|
|
1053
1062
|
);
|
|
1054
|
-
const u =
|
|
1055
|
-
if (!this._targetElement || !h.find((p) => u.includes(p)) || !a.find((p) => u.includes(p)) || !n && this._emitEvent("beforestart",
|
|
1063
|
+
const u = t.composedPath();
|
|
1064
|
+
if (!this._targetElement || !h.find((p) => u.includes(p)) || !a.find((p) => u.includes(p)) || !n && this._emitEvent("beforestart", t) === !1)
|
|
1056
1065
|
return;
|
|
1057
1066
|
this._areaLocation = { x1: i, y1: o, x2: 0, y2: 0 };
|
|
1058
1067
|
const d = l.scrollingElement ?? l.body;
|
|
1059
1068
|
this._scrollDelta = { x: d.scrollLeft, y: d.scrollTop }, this._singleClick = !0, this.clearSelection(!1, !0), q(l, ["touchmove", "mousemove"], this._delayedTapMove, { passive: !1 }), q(l, ["mouseup", "touchcancel", "touchend"], this._onTapStop), q(l, "scroll", this._onScroll);
|
|
1060
1069
|
}
|
|
1061
|
-
_onSingleTap(
|
|
1062
|
-
const { singleTap: { intersect: n }, range: i } = this._options.features, o = Q(
|
|
1070
|
+
_onSingleTap(t) {
|
|
1071
|
+
const { singleTap: { intersect: n }, range: i } = this._options.features, o = Q(t);
|
|
1063
1072
|
let s;
|
|
1064
1073
|
if (n === "native")
|
|
1065
1074
|
s = o.target;
|
|
@@ -1079,33 +1088,33 @@ class ze extends jt {
|
|
|
1079
1088
|
s = s.parentElement;
|
|
1080
1089
|
}
|
|
1081
1090
|
const { stored: r } = this._selection;
|
|
1082
|
-
if (this._emitEvent("start",
|
|
1091
|
+
if (this._emitEvent("start", t), t.shiftKey && i && this._latestElement) {
|
|
1083
1092
|
const l = this._latestElement, [c, h] = l.compareDocumentPosition(s) & 4 ? [s, l] : [l, s], a = [...this._selectables.filter(
|
|
1084
1093
|
(u) => u.compareDocumentPosition(c) & 4 && u.compareDocumentPosition(h) & 2
|
|
1085
1094
|
), c, h];
|
|
1086
1095
|
this.select(a), this._latestElement = l;
|
|
1087
1096
|
} else
|
|
1088
|
-
r.includes(s) && (r.length === 1 ||
|
|
1089
|
-
this._emitEvent("stop",
|
|
1097
|
+
r.includes(s) && (r.length === 1 || t.ctrlKey || r.every((l) => this._selection.stored.includes(l))) ? this.deselect(s) : (this.select(s), this._latestElement = s);
|
|
1098
|
+
this._emitEvent("stop", t);
|
|
1090
1099
|
}
|
|
1091
|
-
_delayedTapMove(
|
|
1092
|
-
const { container: n, document: i, behaviour: { startThreshold: o } } = this._options, { x1: s, y1: r } = this._areaLocation, { x: l, y: c } = Q(
|
|
1100
|
+
_delayedTapMove(t) {
|
|
1101
|
+
const { container: n, document: i, behaviour: { startThreshold: o } } = this._options, { x1: s, y1: r } = this._areaLocation, { x: l, y: c } = Q(t);
|
|
1093
1102
|
if (
|
|
1094
1103
|
// Single number for both coordinates
|
|
1095
1104
|
typeof o == "number" && j(l + c - (s + r)) >= o || // Different x and y threshold
|
|
1096
1105
|
typeof o == "object" && j(l - s) >= o.x || j(c - r) >= o.y
|
|
1097
1106
|
) {
|
|
1098
|
-
if (A(i, ["mousemove", "touchmove"], this._delayedTapMove, { passive: !1 }), this._emitEvent("beforedrag",
|
|
1107
|
+
if (A(i, ["mousemove", "touchmove"], this._delayedTapMove, { passive: !1 }), this._emitEvent("beforedrag", t) === !1) {
|
|
1099
1108
|
A(i, ["mouseup", "touchcancel", "touchend"], this._onTapStop);
|
|
1100
1109
|
return;
|
|
1101
1110
|
}
|
|
1102
|
-
q(i, ["mousemove", "touchmove"], this._onTapMove, { passive: !1 }), O(this._area, "display", "block"), F(n, i)[0].appendChild(this._clippingElement), this.resolveSelectables(), this._singleClick = !1, this._targetRect = this._targetElement.getBoundingClientRect(), this._scrollAvailable = this._targetElement.scrollHeight !== this._targetElement.clientHeight || this._targetElement.scrollWidth !== this._targetElement.clientWidth, this._scrollAvailable && (q(i, "wheel", this._manualScroll, { passive: !1 }), this._selectables = this._selectables.filter((h) => this._targetElement.contains(h))), this._setupSelectionArea(), this._emitEvent("start",
|
|
1111
|
+
q(i, ["mousemove", "touchmove"], this._onTapMove, { passive: !1 }), O(this._area, "display", "block"), F(n, i)[0].appendChild(this._clippingElement), this.resolveSelectables(), this._singleClick = !1, this._targetRect = this._targetElement.getBoundingClientRect(), this._scrollAvailable = this._targetElement.scrollHeight !== this._targetElement.clientHeight || this._targetElement.scrollWidth !== this._targetElement.clientWidth, this._scrollAvailable && (q(i, "wheel", this._manualScroll, { passive: !1 }), this._selectables = this._selectables.filter((h) => this._targetElement.contains(h))), this._setupSelectionArea(), this._emitEvent("start", t), this._onTapMove(t);
|
|
1103
1112
|
}
|
|
1104
|
-
this._handleMoveEvent(
|
|
1113
|
+
this._handleMoveEvent(t);
|
|
1105
1114
|
}
|
|
1106
1115
|
_setupSelectionArea() {
|
|
1107
|
-
const { _clippingElement:
|
|
1108
|
-
this._scrollAvailable ? (O(
|
|
1116
|
+
const { _clippingElement: t, _targetElement: n, _area: i } = this, o = this._targetRect = n.getBoundingClientRect();
|
|
1117
|
+
this._scrollAvailable ? (O(t, {
|
|
1109
1118
|
top: o.top,
|
|
1110
1119
|
left: o.left,
|
|
1111
1120
|
width: o.width,
|
|
@@ -1113,7 +1122,7 @@ class ze extends jt {
|
|
|
1113
1122
|
}), O(i, {
|
|
1114
1123
|
marginTop: -o.top,
|
|
1115
1124
|
marginLeft: -o.left
|
|
1116
|
-
})) : (O(
|
|
1125
|
+
})) : (O(t, {
|
|
1117
1126
|
top: 0,
|
|
1118
1127
|
left: 0,
|
|
1119
1128
|
width: "100%",
|
|
@@ -1123,8 +1132,8 @@ class ze extends jt {
|
|
|
1123
1132
|
marginLeft: 0
|
|
1124
1133
|
}));
|
|
1125
1134
|
}
|
|
1126
|
-
_onTapMove(
|
|
1127
|
-
const { x: n, y: i } = Q(
|
|
1135
|
+
_onTapMove(t) {
|
|
1136
|
+
const { x: n, y: i } = Q(t), { _scrollSpeed: o, _areaLocation: s, _options: r, _frame: l } = this, { speedDivider: c } = r.behaviour.scrolling, h = this._targetElement;
|
|
1128
1137
|
if (s.x2 = n, s.y2 = i, this._scrollAvailable && !this._scrollingActive && (o.y || o.x)) {
|
|
1129
1138
|
this._scrollingActive = !0;
|
|
1130
1139
|
const a = () => {
|
|
@@ -1133,46 +1142,46 @@ class ze extends jt {
|
|
|
1133
1142
|
return;
|
|
1134
1143
|
}
|
|
1135
1144
|
const { scrollTop: u, scrollLeft: d } = h;
|
|
1136
|
-
o.y && (h.scrollTop += Ee(o.y / c), s.y1 -= h.scrollTop - u), o.x && (h.scrollLeft += Ee(o.x / c), s.x1 -= h.scrollLeft - d), l.next(
|
|
1145
|
+
o.y && (h.scrollTop += Ee(o.y / c), s.y1 -= h.scrollTop - u), o.x && (h.scrollLeft += Ee(o.x / c), s.x1 -= h.scrollLeft - d), l.next(t), requestAnimationFrame(a);
|
|
1137
1146
|
};
|
|
1138
1147
|
requestAnimationFrame(a);
|
|
1139
1148
|
} else
|
|
1140
|
-
l.next(
|
|
1141
|
-
this._handleMoveEvent(
|
|
1149
|
+
l.next(t);
|
|
1150
|
+
this._handleMoveEvent(t);
|
|
1142
1151
|
}
|
|
1143
|
-
_handleMoveEvent(
|
|
1152
|
+
_handleMoveEvent(t) {
|
|
1144
1153
|
const { features: n } = this._options;
|
|
1145
|
-
(n.touch && Ht() || this._scrollAvailable && Bt()) &&
|
|
1154
|
+
(n.touch && Ht() || this._scrollAvailable && Bt()) && t.preventDefault();
|
|
1146
1155
|
}
|
|
1147
1156
|
_onScroll() {
|
|
1148
|
-
const { _scrollDelta:
|
|
1149
|
-
this._areaLocation.x1 +=
|
|
1157
|
+
const { _scrollDelta: t, _options: { document: n } } = this, { scrollTop: i, scrollLeft: o } = n.scrollingElement ?? n.body;
|
|
1158
|
+
this._areaLocation.x1 += t.x - o, this._areaLocation.y1 += t.y - i, t.x = o, t.y = i, this._setupSelectionArea(), this._frame.next(null);
|
|
1150
1159
|
}
|
|
1151
|
-
_manualScroll(
|
|
1152
|
-
const { manualSpeed: n } = this._options.behaviour.scrolling, i =
|
|
1153
|
-
this._scrollSpeed.y += i * n, this._scrollSpeed.x += o * n, this._onTapMove(
|
|
1160
|
+
_manualScroll(t) {
|
|
1161
|
+
const { manualSpeed: n } = this._options.behaviour.scrolling, i = t.deltaY ? t.deltaY > 0 ? 1 : -1 : 0, o = t.deltaX ? t.deltaX > 0 ? 1 : -1 : 0;
|
|
1162
|
+
this._scrollSpeed.y += i * n, this._scrollSpeed.x += o * n, this._onTapMove(t), t.preventDefault();
|
|
1154
1163
|
}
|
|
1155
1164
|
_recalculateSelectionAreaRect() {
|
|
1156
|
-
const { _scrollSpeed:
|
|
1165
|
+
const { _scrollSpeed: t, _areaLocation: n, _areaRect: i, _targetElement: o, _options: s } = this, { scrollTop: r, scrollHeight: l, clientHeight: c, scrollLeft: h, scrollWidth: a, clientWidth: u } = o, d = this._targetRect, { x1: p, y1: g } = n;
|
|
1157
1166
|
let { x2: m, y2: f } = n;
|
|
1158
1167
|
const { behaviour: { scrolling: { startScrollMargins: v } } } = s;
|
|
1159
|
-
m < d.left + v.x ? (
|
|
1168
|
+
m < d.left + v.x ? (t.x = h ? -j(d.left - m + v.x) : 0, m = m < d.left ? d.left : m) : m > d.right - v.x ? (t.x = a - h - u ? j(d.left + d.width - m - v.x) : 0, m = m > d.right ? d.right : m) : t.x = 0, f < d.top + v.y ? (t.y = r ? -j(d.top - f + v.y) : 0, f = f < d.top ? d.top : f) : f > d.bottom - v.y ? (t.y = l - r - c ? j(d.top + d.height - f - v.y) : 0, f = f > d.bottom ? d.bottom : f) : t.y = 0;
|
|
1160
1169
|
const x = we(p, m), b = we(g, f), y = xe(p, m), C = xe(g, f);
|
|
1161
1170
|
i.x = x, i.y = b, i.width = y - x, i.height = C - b;
|
|
1162
1171
|
}
|
|
1163
1172
|
_redrawSelectionArea() {
|
|
1164
|
-
const { x:
|
|
1165
|
-
s.left = `${
|
|
1173
|
+
const { x: t, y: n, width: i, height: o } = this._areaRect, { style: s } = this._area;
|
|
1174
|
+
s.left = `${t}px`, s.top = `${n}px`, s.width = `${i}px`, s.height = `${o}px`;
|
|
1166
1175
|
}
|
|
1167
|
-
_onTapStop(
|
|
1176
|
+
_onTapStop(t, n) {
|
|
1168
1177
|
var i;
|
|
1169
1178
|
const { document: o, features: s } = this._options, { _singleClick: r } = this;
|
|
1170
|
-
A(o, ["mousemove", "touchmove"], this._delayedTapMove), A(o, ["touchmove", "mousemove"], this._onTapMove), A(o, ["mouseup", "touchcancel", "touchend"], this._onTapStop), A(o, "scroll", this._onScroll), this._keepSelection(),
|
|
1179
|
+
A(o, ["mousemove", "touchmove"], this._delayedTapMove), A(o, ["touchmove", "mousemove"], this._onTapMove), A(o, ["mouseup", "touchcancel", "touchend"], this._onTapStop), A(o, "scroll", this._onScroll), this._keepSelection(), t && r && s.singleTap.allow ? this._onSingleTap(t) : !r && !n && (this._updateElementSelection(), this._emitEvent("stop", t)), this._scrollSpeed.x = 0, this._scrollSpeed.y = 0, this._scrollAvailable && A(o, "wheel", this._manualScroll, { passive: !0 }), this._clippingElement.remove(), (i = this._frame) == null || i.cancel(), O(this._area, "display", "none");
|
|
1171
1180
|
}
|
|
1172
1181
|
_updateElementSelection() {
|
|
1173
|
-
const { _selectables:
|
|
1174
|
-
for (let m = 0; m <
|
|
1175
|
-
const f =
|
|
1182
|
+
const { _selectables: t, _options: n, _selection: i, _areaRect: o } = this, { stored: s, selected: r, touched: l } = i, { intersect: c, overlap: h } = n.behaviour, a = h === "invert", u = [], d = [], p = [];
|
|
1183
|
+
for (let m = 0; m < t.length; m++) {
|
|
1184
|
+
const f = t[m];
|
|
1176
1185
|
if (ye(o, f.getBoundingClientRect(), c)) {
|
|
1177
1186
|
if (r.includes(f))
|
|
1178
1187
|
s.includes(f) && !l.includes(f) && l.push(f);
|
|
@@ -1194,16 +1203,16 @@ class ze extends jt {
|
|
|
1194
1203
|
}
|
|
1195
1204
|
i.selected = u, i.changed = { added: d, removed: p }, this._latestElement = void 0;
|
|
1196
1205
|
}
|
|
1197
|
-
_emitEvent(
|
|
1198
|
-
return this.emit(
|
|
1206
|
+
_emitEvent(t, n) {
|
|
1207
|
+
return this.emit(t, {
|
|
1199
1208
|
event: n,
|
|
1200
1209
|
store: this._selection,
|
|
1201
1210
|
selection: this
|
|
1202
1211
|
});
|
|
1203
1212
|
}
|
|
1204
1213
|
_keepSelection() {
|
|
1205
|
-
const { _options:
|
|
1206
|
-
switch (
|
|
1214
|
+
const { _options: t, _selection: n } = this, { selected: i, changed: o, touched: s, stored: r } = n, l = i.filter((c) => !r.includes(c));
|
|
1215
|
+
switch (t.behaviour.overlap) {
|
|
1207
1216
|
case "drop": {
|
|
1208
1217
|
n.stored = [
|
|
1209
1218
|
...l,
|
|
@@ -1235,8 +1244,8 @@ class ze extends jt {
|
|
|
1235
1244
|
* @param evt A MouseEvent / TouchEvent -like object
|
|
1236
1245
|
* @param silent If beforestart should be fired,
|
|
1237
1246
|
*/
|
|
1238
|
-
trigger(
|
|
1239
|
-
this._onTapStart(
|
|
1247
|
+
trigger(t, n = !0) {
|
|
1248
|
+
this._onTapStart(t, n);
|
|
1240
1249
|
}
|
|
1241
1250
|
/**
|
|
1242
1251
|
* Can be used if during a selection elements have been added.
|
|
@@ -1250,13 +1259,13 @@ class ze extends jt {
|
|
|
1250
1259
|
* @param includeStored If the store should also get cleared
|
|
1251
1260
|
* @param quiet If move / stop events should be fired
|
|
1252
1261
|
*/
|
|
1253
|
-
clearSelection(
|
|
1262
|
+
clearSelection(t = !0, n = !1) {
|
|
1254
1263
|
const { selected: i, stored: o, changed: s } = this._selection;
|
|
1255
1264
|
s.added = [], s.removed.push(
|
|
1256
1265
|
...i,
|
|
1257
|
-
...
|
|
1266
|
+
...t ? o : []
|
|
1258
1267
|
), n || (this._emitEvent("move", null), this._emitEvent("stop", null)), this._selection = {
|
|
1259
|
-
stored:
|
|
1268
|
+
stored: t ? [] : o,
|
|
1260
1269
|
selected: [],
|
|
1261
1270
|
touched: [],
|
|
1262
1271
|
changed: { added: [], removed: [] }
|
|
@@ -1278,8 +1287,8 @@ class ze extends jt {
|
|
|
1278
1287
|
* Cancel the current selection process.
|
|
1279
1288
|
* @param keepEvent {boolean} true to fire a stop event after cancel.
|
|
1280
1289
|
*/
|
|
1281
|
-
cancel(
|
|
1282
|
-
this._onTapStop(null, !
|
|
1290
|
+
cancel(t = !1) {
|
|
1291
|
+
this._onTapStop(null, !t);
|
|
1283
1292
|
}
|
|
1284
1293
|
/**
|
|
1285
1294
|
* Unbinds all events and removes the area-element.
|
|
@@ -1292,8 +1301,8 @@ class ze extends jt {
|
|
|
1292
1301
|
* @param query - CSS Query, can be an array of queries
|
|
1293
1302
|
* @param quiet - If this should not trigger the move event
|
|
1294
1303
|
*/
|
|
1295
|
-
select(
|
|
1296
|
-
const { changed: i, selected: o, stored: s } = this._selection, r = F(
|
|
1304
|
+
select(t, n = !1) {
|
|
1305
|
+
const { changed: i, selected: o, stored: s } = this._selection, r = F(t, this._options.document).filter(
|
|
1297
1306
|
(l) => !o.includes(l) && !s.includes(l)
|
|
1298
1307
|
);
|
|
1299
1308
|
return s.push(...r), o.push(...r), i.added.push(...r), i.removed = [], this._latestElement = void 0, n || (this._emitEvent("move", null), this._emitEvent("stop", null)), r;
|
|
@@ -1303,8 +1312,8 @@ class ze extends jt {
|
|
|
1303
1312
|
* @param query - CSS Query, can be an array of queries
|
|
1304
1313
|
* @param quiet - If this should not trigger the move event
|
|
1305
1314
|
*/
|
|
1306
|
-
deselect(
|
|
1307
|
-
const { selected: i, stored: o, changed: s } = this._selection, r = F(
|
|
1315
|
+
deselect(t, n = !1) {
|
|
1316
|
+
const { selected: i, stored: o, changed: s } = this._selection, r = F(t, this._options.document).filter(
|
|
1308
1317
|
(l) => i.includes(l) || o.includes(l)
|
|
1309
1318
|
);
|
|
1310
1319
|
r.length && (this._selection.stored = o.filter((l) => !r.includes(l)), this._selection.selected = i.filter((l) => !r.includes(l)), this._selection.changed.added = [], this._selection.changed.removed.push(
|
|
@@ -1313,11 +1322,11 @@ class ze extends jt {
|
|
|
1313
1322
|
}
|
|
1314
1323
|
}
|
|
1315
1324
|
w(ze, "version", "3.3.1");
|
|
1316
|
-
function Rt(
|
|
1317
|
-
const
|
|
1325
|
+
function Rt(e) {
|
|
1326
|
+
const t = new ze({
|
|
1318
1327
|
selectables: [".map-container me-tpc"],
|
|
1319
|
-
boundaries: [
|
|
1320
|
-
container:
|
|
1328
|
+
boundaries: [e.container],
|
|
1329
|
+
container: e.container,
|
|
1321
1330
|
behaviour: {
|
|
1322
1331
|
// Scroll configuration.
|
|
1323
1332
|
scrolling: {
|
|
@@ -1334,7 +1343,7 @@ function Rt(t) {
|
|
|
1334
1343
|
}
|
|
1335
1344
|
}
|
|
1336
1345
|
}).on("beforestart", ({ event: n }) => !(n.button !== 0 || n.target.tagName === "ME-TPC" || n.target.id === "input-box" || n.target.className === "circle")).on("start", ({ event: n }) => {
|
|
1337
|
-
!n.ctrlKey && !n.metaKey && (
|
|
1346
|
+
!n.ctrlKey && !n.metaKey && (e.unselectNode(), e.unselectNodes(), e.unselectSummary(), e.unselectLink(), t.clearSelection(!0, !0));
|
|
1338
1347
|
}).on(
|
|
1339
1348
|
"move",
|
|
1340
1349
|
({
|
|
@@ -1349,121 +1358,121 @@ function Rt(t) {
|
|
|
1349
1358
|
o.classList.remove("selected");
|
|
1350
1359
|
}
|
|
1351
1360
|
).on("stop", ({ store: { stored: n } }) => {
|
|
1352
|
-
console.log(n, "stored"),
|
|
1361
|
+
console.log(n, "stored"), e.selectNodes(n);
|
|
1353
1362
|
});
|
|
1354
1363
|
}
|
|
1355
|
-
const qt = function(
|
|
1356
|
-
this.theme =
|
|
1364
|
+
const qt = function(e, t = !0) {
|
|
1365
|
+
this.theme = e;
|
|
1357
1366
|
const n = this.theme.cssVar, i = Object.keys(n);
|
|
1358
1367
|
for (let o = 0; o < i.length; o++) {
|
|
1359
1368
|
const s = i[o];
|
|
1360
1369
|
this.mindElixirBox.style.setProperty(s, n[s]);
|
|
1361
1370
|
}
|
|
1362
|
-
|
|
1371
|
+
t && this.refresh();
|
|
1363
1372
|
};
|
|
1364
|
-
function Re(
|
|
1373
|
+
function Re(e) {
|
|
1365
1374
|
return {
|
|
1366
|
-
nodeData:
|
|
1367
|
-
linkData:
|
|
1368
|
-
summaries:
|
|
1369
|
-
direction:
|
|
1370
|
-
theme:
|
|
1375
|
+
nodeData: e.isFocusMode ? e.nodeDataBackup : e.nodeData,
|
|
1376
|
+
linkData: e.linkData,
|
|
1377
|
+
summaries: e.summaries,
|
|
1378
|
+
direction: e.direction,
|
|
1379
|
+
theme: e.theme
|
|
1371
1380
|
};
|
|
1372
1381
|
}
|
|
1373
|
-
const Ft = function(
|
|
1374
|
-
if (
|
|
1375
|
-
if (console.time("selectNode"), typeof
|
|
1376
|
-
const i = E(
|
|
1382
|
+
const Ft = function(e, t, n) {
|
|
1383
|
+
if (e) {
|
|
1384
|
+
if (console.time("selectNode"), typeof e == "string") {
|
|
1385
|
+
const i = E(e);
|
|
1377
1386
|
return i ? this.selectNode(i) : void 0;
|
|
1378
1387
|
}
|
|
1379
|
-
this.currentNode && (this.currentNode.className = ""),
|
|
1388
|
+
this.currentNode && (this.currentNode.className = ""), e.className = "selected", e.scrollIntoView({ block: "nearest", inline: "nearest" }), this.currentNode = e, t ? this.bus.fire("selectNewNode", e.nodeObj) : this.bus.fire("selectNode", e.nodeObj, n), console.timeEnd("selectNode");
|
|
1380
1389
|
}
|
|
1381
1390
|
}, Vt = function() {
|
|
1382
1391
|
this.currentNode && (this.currentNode.className = ""), this.currentNode = null, this.bus.fire("unselectNode");
|
|
1383
|
-
}, Wt = function(
|
|
1384
|
-
if (
|
|
1392
|
+
}, Wt = function(e) {
|
|
1393
|
+
if (e) {
|
|
1385
1394
|
console.time("selectNodes");
|
|
1386
|
-
for (const
|
|
1387
|
-
|
|
1388
|
-
this.currentNodes =
|
|
1395
|
+
for (const t of e)
|
|
1396
|
+
t.className = "selected";
|
|
1397
|
+
this.currentNodes = e, this.bus.fire(
|
|
1389
1398
|
"selectNodes",
|
|
1390
|
-
|
|
1399
|
+
e.map((t) => t.nodeObj)
|
|
1391
1400
|
), console.timeEnd("selectNodes");
|
|
1392
1401
|
}
|
|
1393
1402
|
}, Yt = function() {
|
|
1394
1403
|
if (this.currentNodes)
|
|
1395
|
-
for (const
|
|
1396
|
-
|
|
1404
|
+
for (const e of this.currentNodes)
|
|
1405
|
+
e.classList.remove("selected");
|
|
1397
1406
|
this.currentNodes = null, this.bus.fire("unselectNodes");
|
|
1398
1407
|
}, It = function() {
|
|
1399
1408
|
if (!this.currentNode || this.currentNode.dataset.nodeid === "meroot")
|
|
1400
1409
|
return !1;
|
|
1401
|
-
const
|
|
1402
|
-
let
|
|
1403
|
-
if (
|
|
1404
|
-
|
|
1410
|
+
const e = this.currentNode.parentElement.parentElement.nextSibling;
|
|
1411
|
+
let t;
|
|
1412
|
+
if (e)
|
|
1413
|
+
t = e.firstChild.firstChild;
|
|
1405
1414
|
else
|
|
1406
1415
|
return !1;
|
|
1407
|
-
return this.selectNode(
|
|
1416
|
+
return this.selectNode(t), !0;
|
|
1408
1417
|
}, Xt = function() {
|
|
1409
1418
|
if (!this.currentNode || this.currentNode.dataset.nodeid === "meroot")
|
|
1410
1419
|
return !1;
|
|
1411
|
-
const
|
|
1412
|
-
let
|
|
1413
|
-
if (
|
|
1414
|
-
|
|
1420
|
+
const e = this.currentNode.parentElement.parentElement.previousSibling;
|
|
1421
|
+
let t;
|
|
1422
|
+
if (e)
|
|
1423
|
+
t = e.firstChild.firstChild;
|
|
1415
1424
|
else
|
|
1416
1425
|
return !1;
|
|
1417
|
-
return this.selectNode(
|
|
1426
|
+
return this.selectNode(t), !0;
|
|
1418
1427
|
}, Kt = function() {
|
|
1419
1428
|
if (!this.currentNode)
|
|
1420
1429
|
return;
|
|
1421
|
-
const
|
|
1422
|
-
if (
|
|
1423
|
-
const
|
|
1424
|
-
this.selectNode(
|
|
1430
|
+
const e = this.currentNode.parentElement.nextSibling;
|
|
1431
|
+
if (e && e.firstChild) {
|
|
1432
|
+
const t = e.firstChild.firstChild.firstChild;
|
|
1433
|
+
this.selectNode(t);
|
|
1425
1434
|
}
|
|
1426
1435
|
}, Ut = function() {
|
|
1427
1436
|
if (!this.currentNode || this.currentNode.dataset.nodeid === "meroot")
|
|
1428
1437
|
return;
|
|
1429
|
-
const
|
|
1430
|
-
if (
|
|
1431
|
-
const
|
|
1432
|
-
this.selectNode(
|
|
1438
|
+
const e = this.currentNode.parentElement.parentElement.parentElement.previousSibling;
|
|
1439
|
+
if (e) {
|
|
1440
|
+
const t = e.firstChild;
|
|
1441
|
+
this.selectNode(t);
|
|
1433
1442
|
}
|
|
1434
1443
|
}, Gt = function() {
|
|
1435
|
-
const
|
|
1436
|
-
return JSON.stringify(
|
|
1437
|
-
if (!(
|
|
1444
|
+
const e = Re(this);
|
|
1445
|
+
return JSON.stringify(e, (t, n) => {
|
|
1446
|
+
if (!(t === "parent" && typeof n != "string"))
|
|
1438
1447
|
return n;
|
|
1439
1448
|
});
|
|
1440
1449
|
}, Jt = function() {
|
|
1441
1450
|
return JSON.parse(this.getDataString());
|
|
1442
1451
|
}, Qt = function() {
|
|
1443
|
-
const
|
|
1444
|
-
let
|
|
1452
|
+
const e = Re(this).nodeData;
|
|
1453
|
+
let t = "# " + e.topic + `
|
|
1445
1454
|
|
|
1446
1455
|
`;
|
|
1447
1456
|
function n(i, o) {
|
|
1448
1457
|
for (let s = 0; s < i.length; s++)
|
|
1449
|
-
o <= 6 ?
|
|
1458
|
+
o <= 6 ? t += "".padStart(o, "#") + " " + i[s].topic + `
|
|
1450
1459
|
|
|
1451
|
-
` :
|
|
1460
|
+
` : t += "".padStart(o - 7, " ") + "- " + i[s].topic + `
|
|
1452
1461
|
`, i[s].children && n(i[s].children || [], o + 1);
|
|
1453
1462
|
}
|
|
1454
|
-
return n(
|
|
1463
|
+
return n(e.children || [], 2), t;
|
|
1455
1464
|
}, Zt = function() {
|
|
1456
1465
|
this.editable = !0;
|
|
1457
1466
|
}, en = function() {
|
|
1458
1467
|
this.editable = !1;
|
|
1459
|
-
}, tn = function(
|
|
1460
|
-
this.scaleVal =
|
|
1468
|
+
}, tn = function(e) {
|
|
1469
|
+
this.scaleVal = e, this.map.style.transform = "scale(" + e + ")";
|
|
1461
1470
|
}, nn = function() {
|
|
1462
1471
|
this.container.scrollTo(1e4 - this.container.offsetWidth / 2, 1e4 - this.container.offsetHeight / 2);
|
|
1463
|
-
}, on = function(
|
|
1464
|
-
|
|
1465
|
-
}, sn = function(
|
|
1466
|
-
|
|
1472
|
+
}, on = function(e) {
|
|
1473
|
+
e(this);
|
|
1474
|
+
}, sn = function(e) {
|
|
1475
|
+
e.nodeObj.root || (this.tempDirection === null && (this.tempDirection = this.direction), this.isFocusMode || (this.nodeDataBackup = this.nodeData, this.isFocusMode = !0), this.nodeData = e.nodeObj, this.nodeData.root = !0, this.initRight(), this.toCenter());
|
|
1467
1476
|
}, rn = function() {
|
|
1468
1477
|
this.isFocusMode = !1, this.tempDirection !== null && (delete this.nodeData.root, this.nodeData = this.nodeDataBackup, this.direction = this.tempDirection, this.tempDirection = null, this.refresh(), this.toCenter());
|
|
1469
1478
|
}, ln = function() {
|
|
@@ -1472,13 +1481,13 @@ const Ft = function(t, e, n) {
|
|
|
1472
1481
|
this.direction = 1, this.refresh();
|
|
1473
1482
|
}, an = function() {
|
|
1474
1483
|
this.direction = 2, this.refresh();
|
|
1475
|
-
}, dn = function(
|
|
1476
|
-
this.locale =
|
|
1477
|
-
}, hn = function(
|
|
1478
|
-
const n =
|
|
1479
|
-
typeof
|
|
1480
|
-
}, un = function(
|
|
1481
|
-
|
|
1484
|
+
}, dn = function(e) {
|
|
1485
|
+
this.locale = e, this.refresh();
|
|
1486
|
+
}, hn = function(e, t) {
|
|
1487
|
+
const n = e.nodeObj;
|
|
1488
|
+
typeof t == "boolean" ? n.expanded = t : n.expanded !== !1 ? n.expanded = !1 : n.expanded = !0, this.layout(), this.linkDiv(), this.bus.fire("expandNode", n);
|
|
1489
|
+
}, un = function(e) {
|
|
1490
|
+
e && (e = JSON.parse(JSON.stringify(e)), this.nodeData = e.nodeData, this.linkData = e.linkData || {}), T(this.nodeData), this.layout(), this.linkDiv();
|
|
1482
1491
|
}, fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1483
1492
|
__proto__: null,
|
|
1484
1493
|
cancelFocus: rn,
|
|
@@ -1505,32 +1514,32 @@ const Ft = function(t, e, n) {
|
|
|
1505
1514
|
toCenter: nn,
|
|
1506
1515
|
unselectNode: Vt,
|
|
1507
1516
|
unselectNodes: Yt
|
|
1508
|
-
}, Symbol.toStringTag, { value: "Module" })), se = function(
|
|
1509
|
-
const n =
|
|
1517
|
+
}, Symbol.toStringTag, { value: "Module" })), se = function(e) {
|
|
1518
|
+
const n = e.parentElement.parentElement.lastElementChild;
|
|
1510
1519
|
(n == null ? void 0 : n.tagName) === "svg" && (n == null || n.remove());
|
|
1511
|
-
}, qe = function(
|
|
1520
|
+
}, qe = function(e, t) {
|
|
1512
1521
|
var n, i;
|
|
1513
|
-
if (
|
|
1522
|
+
if (e === S)
|
|
1514
1523
|
return S;
|
|
1515
|
-
if (
|
|
1524
|
+
if (e === H)
|
|
1516
1525
|
return H;
|
|
1517
|
-
if (
|
|
1526
|
+
if (e === K) {
|
|
1518
1527
|
const o = ((n = document.querySelector(".lhs")) == null ? void 0 : n.childElementCount) || 0, s = ((i = document.querySelector(".rhs")) == null ? void 0 : i.childElementCount) || 0;
|
|
1519
|
-
return o <= s ? (
|
|
1520
|
-
}
|
|
1521
|
-
}, pn = function(
|
|
1522
|
-
console.log(
|
|
1523
|
-
const n =
|
|
1524
|
-
i.style &&
|
|
1525
|
-
const o = Object.assign(n,
|
|
1526
|
-
ae(
|
|
1528
|
+
return o <= s ? (t.direction = S, S) : (t.direction = H, H);
|
|
1529
|
+
}
|
|
1530
|
+
}, pn = function(e, t) {
|
|
1531
|
+
console.log(t);
|
|
1532
|
+
const n = e.nodeObj, i = De(n);
|
|
1533
|
+
i.style && t.style && (t.style = Object.assign(i.style, t.style));
|
|
1534
|
+
const o = Object.assign(n, t);
|
|
1535
|
+
ae(e, o), this.linkDiv(), this.bus.fire("operation", {
|
|
1527
1536
|
name: "reshapeNode",
|
|
1528
1537
|
obj: o,
|
|
1529
1538
|
origin: i
|
|
1530
1539
|
});
|
|
1531
|
-
}, mn = function(
|
|
1540
|
+
}, mn = function(e, t) {
|
|
1532
1541
|
var h, a, u;
|
|
1533
|
-
const n =
|
|
1542
|
+
const n = e || this.currentNode;
|
|
1534
1543
|
if (!n)
|
|
1535
1544
|
return;
|
|
1536
1545
|
const i = n.nodeObj;
|
|
@@ -1541,17 +1550,17 @@ const Ft = function(t, e, n) {
|
|
|
1541
1550
|
this.addChild(E(i.parent.id));
|
|
1542
1551
|
return;
|
|
1543
1552
|
}
|
|
1544
|
-
const o =
|
|
1553
|
+
const o = t || this.generateNewObj();
|
|
1545
1554
|
Ze(i, o), T(this.nodeData);
|
|
1546
1555
|
const s = n.parentElement;
|
|
1547
1556
|
console.time("insertSibling_DOM");
|
|
1548
1557
|
const { grp: r, top: l } = this.createWrapper(o);
|
|
1549
|
-
s.parentNode.parentNode.insertBefore(r, s.parentNode.nextSibling), this.linkDiv(r.offsetParent),
|
|
1558
|
+
s.parentNode.parentNode.insertBefore(r, s.parentNode.nextSibling), this.linkDiv(r.offsetParent), t || this.editTopic(l.firstChild), this.selectNode(l.firstChild, !0), console.timeEnd("insertSibling_DOM"), this.bus.fire("operation", {
|
|
1550
1559
|
name: "insertSibling",
|
|
1551
1560
|
obj: o
|
|
1552
1561
|
});
|
|
1553
|
-
}, gn = function(
|
|
1554
|
-
const n =
|
|
1562
|
+
}, gn = function(e, t) {
|
|
1563
|
+
const n = e || this.currentNode;
|
|
1555
1564
|
if (!n)
|
|
1556
1565
|
return;
|
|
1557
1566
|
const i = n.nodeObj;
|
|
@@ -1559,43 +1568,43 @@ const Ft = function(t, e, n) {
|
|
|
1559
1568
|
this.addChild();
|
|
1560
1569
|
return;
|
|
1561
1570
|
}
|
|
1562
|
-
const o =
|
|
1571
|
+
const o = t || this.generateNewObj();
|
|
1563
1572
|
et(i, o), T(this.nodeData);
|
|
1564
1573
|
const s = n.parentElement;
|
|
1565
1574
|
console.time("insertSibling_DOM");
|
|
1566
1575
|
const { grp: r, top: l } = this.createWrapper(o);
|
|
1567
|
-
s.parentNode.parentNode.insertBefore(r, s.parentNode), this.linkDiv(r.offsetParent),
|
|
1576
|
+
s.parentNode.parentNode.insertBefore(r, s.parentNode), this.linkDiv(r.offsetParent), t || this.editTopic(l.firstChild), this.selectNode(l.firstChild, !0), console.timeEnd("insertSibling_DOM"), this.bus.fire("operation", {
|
|
1568
1577
|
name: "insertBefore",
|
|
1569
1578
|
obj: o
|
|
1570
1579
|
});
|
|
1571
|
-
}, vn = function(
|
|
1572
|
-
const n =
|
|
1580
|
+
}, vn = function(e, t) {
|
|
1581
|
+
const n = e || this.currentNode;
|
|
1573
1582
|
if (!n)
|
|
1574
1583
|
return;
|
|
1575
1584
|
se(n);
|
|
1576
1585
|
const i = n.nodeObj;
|
|
1577
1586
|
if (i.root === !0)
|
|
1578
1587
|
return;
|
|
1579
|
-
const o =
|
|
1588
|
+
const o = t || this.generateNewObj();
|
|
1580
1589
|
tt(i, o), T(this.nodeData);
|
|
1581
1590
|
const s = n.parentElement.parentElement;
|
|
1582
1591
|
console.time("insertParent_DOM");
|
|
1583
1592
|
const { grp: r, top: l } = this.createWrapper(o, !0);
|
|
1584
1593
|
l.appendChild(oe(!0)), s.insertAdjacentElement("afterend", r);
|
|
1585
1594
|
const c = this.createChildren([s]);
|
|
1586
|
-
l.insertAdjacentElement("afterend", c), this.linkDiv(),
|
|
1595
|
+
l.insertAdjacentElement("afterend", c), this.linkDiv(), t || this.editTopic(l.firstChild), this.selectNode(l.firstChild, !0), console.timeEnd("insertParent_DOM"), this.bus.fire("operation", {
|
|
1587
1596
|
name: "insertParent",
|
|
1588
1597
|
obj: o
|
|
1589
1598
|
});
|
|
1590
|
-
}, Fe = function(
|
|
1599
|
+
}, Fe = function(e, t) {
|
|
1591
1600
|
var l, c;
|
|
1592
|
-
if (!
|
|
1601
|
+
if (!e)
|
|
1593
1602
|
return null;
|
|
1594
|
-
const n =
|
|
1595
|
-
n.expanded === !1 && (this.expandNode(
|
|
1596
|
-
const i =
|
|
1603
|
+
const n = e.nodeObj;
|
|
1604
|
+
n.expanded === !1 && (this.expandNode(e, !0), e = E(n.id));
|
|
1605
|
+
const i = t || this.generateNewObj();
|
|
1597
1606
|
n.children ? n.children.push(i) : n.children = [i], T(this.nodeData);
|
|
1598
|
-
const o =
|
|
1607
|
+
const o = e.parentElement, { grp: s, top: r } = this.createWrapper(i);
|
|
1599
1608
|
if (o.tagName === "ME-PARENT") {
|
|
1600
1609
|
if (o.children[1])
|
|
1601
1610
|
o.nextSibling.appendChild(s);
|
|
@@ -1607,24 +1616,24 @@ const Ft = function(t, e, n) {
|
|
|
1607
1616
|
} else
|
|
1608
1617
|
o.tagName === "ME-ROOT" && (qe(this.direction, i) === S ? (l = document.querySelector(".lhs")) == null || l.appendChild(s) : (c = document.querySelector(".rhs")) == null || c.appendChild(s), this.linkDiv());
|
|
1609
1618
|
return { newTop: r, newNodeObj: i };
|
|
1610
|
-
}, bn = function(
|
|
1619
|
+
}, bn = function(e, t) {
|
|
1611
1620
|
console.time("addChild");
|
|
1612
|
-
const n =
|
|
1621
|
+
const n = e || this.currentNode;
|
|
1613
1622
|
if (!n)
|
|
1614
1623
|
return;
|
|
1615
|
-
const i = Fe.call(this, n,
|
|
1624
|
+
const i = Fe.call(this, n, t);
|
|
1616
1625
|
if (!i)
|
|
1617
1626
|
return;
|
|
1618
1627
|
const { newTop: o, newNodeObj: s } = i;
|
|
1619
1628
|
this.bus.fire("operation", {
|
|
1620
1629
|
name: "addChild",
|
|
1621
1630
|
obj: s
|
|
1622
|
-
}), console.timeEnd("addChild"),
|
|
1623
|
-
}, yn = function(
|
|
1631
|
+
}), console.timeEnd("addChild"), t || this.editTopic(o.firstChild), this.selectNode(o.firstChild, !0);
|
|
1632
|
+
}, yn = function(e, t) {
|
|
1624
1633
|
console.time("copyNode");
|
|
1625
|
-
const n = De(
|
|
1634
|
+
const n = De(e.nodeObj);
|
|
1626
1635
|
Te(n);
|
|
1627
|
-
const i = Fe.call(this,
|
|
1636
|
+
const i = Fe.call(this, t, n);
|
|
1628
1637
|
if (!i)
|
|
1629
1638
|
return;
|
|
1630
1639
|
const { newNodeObj: o } = i;
|
|
@@ -1632,33 +1641,33 @@ const Ft = function(t, e, n) {
|
|
|
1632
1641
|
name: "copyNode",
|
|
1633
1642
|
obj: o
|
|
1634
1643
|
});
|
|
1635
|
-
}, xn = function(
|
|
1636
|
-
const
|
|
1637
|
-
if (!
|
|
1644
|
+
}, xn = function(e) {
|
|
1645
|
+
const t = e || this.currentNode;
|
|
1646
|
+
if (!t)
|
|
1638
1647
|
return;
|
|
1639
|
-
const n =
|
|
1648
|
+
const n = t.parentNode.parentNode, i = t.nodeObj;
|
|
1640
1649
|
Je(i), n.parentNode.insertBefore(n, n.previousSibling), this.linkDiv(), this.bus.fire("operation", {
|
|
1641
1650
|
name: "moveUpNode",
|
|
1642
1651
|
obj: i
|
|
1643
1652
|
});
|
|
1644
|
-
}, wn = function(
|
|
1645
|
-
const
|
|
1646
|
-
if (!
|
|
1653
|
+
}, wn = function(e) {
|
|
1654
|
+
const t = e || this.currentNode;
|
|
1655
|
+
if (!t)
|
|
1647
1656
|
return;
|
|
1648
|
-
const n =
|
|
1657
|
+
const n = t.parentNode.parentNode, i = t.nodeObj;
|
|
1649
1658
|
Qe(i), n.nextSibling ? n.nextSibling.insertAdjacentElement("afterend", n) : n.parentNode.prepend(n), this.linkDiv(), this.bus.fire("operation", {
|
|
1650
1659
|
name: "moveDownNode",
|
|
1651
1660
|
obj: i
|
|
1652
1661
|
});
|
|
1653
|
-
}, En = function(
|
|
1662
|
+
}, En = function(e) {
|
|
1654
1663
|
var l;
|
|
1655
|
-
const
|
|
1656
|
-
if (!
|
|
1664
|
+
const t = e || this.currentNode;
|
|
1665
|
+
if (!t)
|
|
1657
1666
|
return;
|
|
1658
|
-
const n =
|
|
1667
|
+
const n = t.nodeObj;
|
|
1659
1668
|
if (n.root === !0)
|
|
1660
1669
|
throw new Error("Can not remove root node");
|
|
1661
|
-
const i = n.parent.children, o = i.findIndex((c) => c === n), s = ie(n), r =
|
|
1670
|
+
const i = n.parent.children, o = i.findIndex((c) => c === n), s = ie(n), r = t.parentNode;
|
|
1662
1671
|
if (s === 0) {
|
|
1663
1672
|
const c = r.parentNode.parentNode;
|
|
1664
1673
|
c.tagName !== "ME-MAIN" && c.previousSibling.children[1].remove();
|
|
@@ -1681,17 +1690,17 @@ const Ft = function(t, e, n) {
|
|
|
1681
1690
|
originIndex: o,
|
|
1682
1691
|
originParentId: (l = n == null ? void 0 : n.parent) == null ? void 0 : l.id
|
|
1683
1692
|
});
|
|
1684
|
-
}, Nn = function(
|
|
1693
|
+
}, Nn = function(e, t) {
|
|
1685
1694
|
var l;
|
|
1686
|
-
const n =
|
|
1687
|
-
if (i.expanded === !1 && (this.expandNode(
|
|
1695
|
+
const n = e.nodeObj, i = t.nodeObj, o = (l = n == null ? void 0 : n.parent) == null ? void 0 : l.id;
|
|
1696
|
+
if (i.expanded === !1 && (this.expandNode(t, !0), e = E(n.id), t = E(i.id)), !Ge(n, i)) {
|
|
1688
1697
|
console.warn("Invalid move");
|
|
1689
1698
|
return;
|
|
1690
1699
|
}
|
|
1691
1700
|
console.time("moveNode"), nt(n, i), T(this.nodeData);
|
|
1692
|
-
const s =
|
|
1701
|
+
const s = e.parentElement, r = t.parentElement;
|
|
1693
1702
|
if (r.tagName === "ME-PARENT")
|
|
1694
|
-
if (se(
|
|
1703
|
+
if (se(e), r.children[1])
|
|
1695
1704
|
r.nextSibling.appendChild(s.parentElement);
|
|
1696
1705
|
else {
|
|
1697
1706
|
const c = this.createChildren([s.parentElement]);
|
|
@@ -1705,33 +1714,33 @@ const Ft = function(t, e, n) {
|
|
|
1705
1714
|
toObj: i,
|
|
1706
1715
|
originParentId: o
|
|
1707
1716
|
}), console.timeEnd("moveNode");
|
|
1708
|
-
}, Cn = function(
|
|
1717
|
+
}, Cn = function(e, t) {
|
|
1709
1718
|
var h;
|
|
1710
|
-
const n =
|
|
1711
|
-
it(n, i), T(this.nodeData), se(
|
|
1712
|
-
const r =
|
|
1713
|
-
|
|
1719
|
+
const n = e.nodeObj, i = t.nodeObj, o = (h = n.parent) == null ? void 0 : h.id;
|
|
1720
|
+
it(n, i), T(this.nodeData), se(e);
|
|
1721
|
+
const r = e.parentElement.parentNode;
|
|
1722
|
+
t.parentElement.parentNode.insertAdjacentElement("beforebegin", r), this.linkDiv(), this.bus.fire("operation", {
|
|
1714
1723
|
name: "moveNodeBefore",
|
|
1715
1724
|
obj: n,
|
|
1716
1725
|
toObj: i,
|
|
1717
1726
|
originParentId: o
|
|
1718
1727
|
});
|
|
1719
|
-
}, _n = function(
|
|
1728
|
+
}, _n = function(e, t) {
|
|
1720
1729
|
var h;
|
|
1721
|
-
const n =
|
|
1722
|
-
ot(n, i), T(this.nodeData), se(
|
|
1723
|
-
const r =
|
|
1724
|
-
|
|
1730
|
+
const n = e.nodeObj, i = t.nodeObj, o = (h = n.parent) == null ? void 0 : h.id;
|
|
1731
|
+
ot(n, i), T(this.nodeData), se(e);
|
|
1732
|
+
const r = e.parentElement.parentElement;
|
|
1733
|
+
t.parentElement.parentElement.insertAdjacentElement("afterend", r), this.linkDiv(), this.bus.fire("operation", {
|
|
1725
1734
|
name: "moveNodeAfter",
|
|
1726
1735
|
obj: n,
|
|
1727
1736
|
toObj: i,
|
|
1728
1737
|
originParentId: o
|
|
1729
1738
|
});
|
|
1730
|
-
}, kn = function(
|
|
1731
|
-
const
|
|
1732
|
-
|
|
1733
|
-
}, Sn = function(
|
|
1734
|
-
|
|
1739
|
+
}, kn = function(e) {
|
|
1740
|
+
const t = e || this.currentNode;
|
|
1741
|
+
t && this.editTopic(t);
|
|
1742
|
+
}, Sn = function(e, t) {
|
|
1743
|
+
e.childNodes[0].textContent = t, e.nodeObj.topic = t, this.linkDiv();
|
|
1735
1744
|
}, Ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1736
1745
|
__proto__: null,
|
|
1737
1746
|
addChild: bn,
|
|
@@ -1748,34 +1757,34 @@ const Ft = function(t, e, n) {
|
|
|
1748
1757
|
removeNode: En,
|
|
1749
1758
|
reshapeNode: pn,
|
|
1750
1759
|
setNodeTopic: Sn
|
|
1751
|
-
}, Symbol.toStringTag, { value: "Module" })), Ln = function(
|
|
1760
|
+
}, Symbol.toStringTag, { value: "Module" })), Ln = function(e) {
|
|
1752
1761
|
return {
|
|
1753
|
-
dom:
|
|
1762
|
+
dom: e,
|
|
1754
1763
|
mousedown: !1,
|
|
1755
1764
|
lastX: 0,
|
|
1756
1765
|
lastY: 0,
|
|
1757
|
-
handleMouseMove(
|
|
1766
|
+
handleMouseMove(t) {
|
|
1758
1767
|
if (this.mousedown) {
|
|
1759
1768
|
if (!this.lastX) {
|
|
1760
|
-
this.lastX =
|
|
1769
|
+
this.lastX = t.pageX, this.lastY = t.pageY;
|
|
1761
1770
|
return;
|
|
1762
1771
|
}
|
|
1763
|
-
const n = this.lastX -
|
|
1764
|
-
this.cb && this.cb(n, i), this.lastX =
|
|
1772
|
+
const n = this.lastX - t.pageX, i = this.lastY - t.pageY;
|
|
1773
|
+
this.cb && this.cb(n, i), this.lastX = t.pageX, this.lastY = t.pageY;
|
|
1765
1774
|
}
|
|
1766
1775
|
},
|
|
1767
|
-
handleMouseDown(
|
|
1776
|
+
handleMouseDown(t) {
|
|
1768
1777
|
this.mousedown = !0;
|
|
1769
1778
|
},
|
|
1770
|
-
handleClear(
|
|
1779
|
+
handleClear(t) {
|
|
1771
1780
|
this.clear();
|
|
1772
1781
|
},
|
|
1773
1782
|
cb: null,
|
|
1774
|
-
init(
|
|
1775
|
-
this.cb = n, this.handleClear = this.handleClear.bind(this), this.handleMouseMove = this.handleMouseMove.bind(this), this.handleMouseDown = this.handleMouseDown.bind(this),
|
|
1783
|
+
init(t, n) {
|
|
1784
|
+
this.cb = n, this.handleClear = this.handleClear.bind(this), this.handleMouseMove = this.handleMouseMove.bind(this), this.handleMouseDown = this.handleMouseDown.bind(this), t.addEventListener("mousemove", this.handleMouseMove), t.addEventListener("mouseleave", this.handleClear), t.addEventListener("mouseup", this.handleClear), this.dom.addEventListener("mousedown", this.handleMouseDown);
|
|
1776
1785
|
},
|
|
1777
|
-
destory(
|
|
1778
|
-
|
|
1786
|
+
destory(t) {
|
|
1787
|
+
t.removeEventListener("mousemove", this.handleMouseMove), t.removeEventListener("mouseleave", this.handleClear), t.removeEventListener("mouseup", this.handleClear), this.dom.removeEventListener("mousedown", this.handleMouseDown);
|
|
1779
1788
|
},
|
|
1780
1789
|
clear() {
|
|
1781
1790
|
this.mousedown = !1, this.lastX = 0, this.lastY = 0;
|
|
@@ -1784,8 +1793,8 @@ const Ft = function(t, e, n) {
|
|
|
1784
1793
|
}, Ne = {
|
|
1785
1794
|
create: Ln
|
|
1786
1795
|
};
|
|
1787
|
-
function ne(
|
|
1788
|
-
const { offsetLeft: i, offsetTop: o } = W(
|
|
1796
|
+
function ne(e, t, n) {
|
|
1797
|
+
const { offsetLeft: i, offsetTop: o } = W(e.nodes, t), s = t.offsetWidth, r = t.offsetHeight, l = i + s / 2, c = o + r / 2, h = l + n.x, a = c + n.y;
|
|
1789
1798
|
return {
|
|
1790
1799
|
w: s,
|
|
1791
1800
|
h: r,
|
|
@@ -1795,40 +1804,40 @@ function ne(t, e, n) {
|
|
|
1795
1804
|
ctrlY: a
|
|
1796
1805
|
};
|
|
1797
1806
|
}
|
|
1798
|
-
function V(
|
|
1799
|
-
let
|
|
1800
|
-
const i = (
|
|
1801
|
-
return i >
|
|
1802
|
-
x:
|
|
1807
|
+
function V(e) {
|
|
1808
|
+
let t, n;
|
|
1809
|
+
const i = (e.cy - e.ctrlY) / (e.ctrlX - e.cx);
|
|
1810
|
+
return i > e.h / e.w || i < -e.h / e.w ? e.cy - e.ctrlY < 0 ? (t = e.cx - e.h / 2 / i, n = e.cy + e.h / 2) : (t = e.cx + e.h / 2 / i, n = e.cy - e.h / 2) : e.cx - e.ctrlX < 0 ? (t = e.cx + e.w / 2, n = e.cy - e.w * i / 2) : (t = e.cx - e.w / 2, n = e.cy + e.w * i / 2), {
|
|
1811
|
+
x: t,
|
|
1803
1812
|
y: n
|
|
1804
1813
|
};
|
|
1805
1814
|
}
|
|
1806
|
-
const Mn = function(
|
|
1815
|
+
const Mn = function(e, t, n, i) {
|
|
1807
1816
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
1808
1817
|
return N(o, {
|
|
1809
1818
|
"text-anchor": "middle",
|
|
1810
|
-
x:
|
|
1819
|
+
x: t + "",
|
|
1811
1820
|
y: n + "",
|
|
1812
1821
|
fill: i || "#666"
|
|
1813
|
-
}), o.dataset.type = "custom-link", o.innerHTML =
|
|
1814
|
-
}, Tn = function(
|
|
1815
|
-
if (!
|
|
1822
|
+
}), o.dataset.type = "custom-link", o.innerHTML = e, o;
|
|
1823
|
+
}, Tn = function(e, t, n, i) {
|
|
1824
|
+
if (!e || !t)
|
|
1816
1825
|
return;
|
|
1817
1826
|
const o = performance.now();
|
|
1818
1827
|
this.hideLinkController();
|
|
1819
|
-
const s = ne(this,
|
|
1828
|
+
const s = ne(this, e, n.delta1), r = ne(this, t, n.delta2), { x: l, y: c } = V(s), { ctrlX: h, ctrlY: a } = s, { ctrlX: u, ctrlY: d } = r, { x: p, y: g } = V(r), m = $e(u, d, p, g), f = vt(
|
|
1820
1829
|
`M ${l} ${c} C ${h} ${a} ${u} ${d} ${p} ${g}`,
|
|
1821
1830
|
`M ${m.x1} ${m.y1} L ${p} ${g} L ${m.x2} ${m.y2}`
|
|
1822
1831
|
), v = l / 8 + h * 3 / 8 + u * 3 / 8 + p / 8, x = c / 8 + a * 3 / 8 + d * 3 / 8 + g / 8, b = Mn(n.label, v, x, this.theme.cssVar["--color"]);
|
|
1823
1832
|
f.appendChild(b), f.linkObj = n, f.dataset.linkid = n.id, this.linkSvgGroup.appendChild(f), i || (this.linkData[n.id] = n, this.currentLink = f, this.showLinkController(n, s, r));
|
|
1824
1833
|
const y = performance.now();
|
|
1825
1834
|
console.log(`DrawCustomLink Execution time: ${y - o} ms`);
|
|
1826
|
-
}, $n = function(
|
|
1835
|
+
}, $n = function(e, t) {
|
|
1827
1836
|
const n = {
|
|
1828
1837
|
id: U(),
|
|
1829
1838
|
label: "Custom Link",
|
|
1830
|
-
from:
|
|
1831
|
-
to:
|
|
1839
|
+
from: e.nodeObj.id,
|
|
1840
|
+
to: t.nodeObj.id,
|
|
1832
1841
|
delta1: {
|
|
1833
1842
|
x: 0,
|
|
1834
1843
|
y: -200
|
|
@@ -1838,23 +1847,25 @@ const Mn = function(t, e, n, i) {
|
|
|
1838
1847
|
y: -200
|
|
1839
1848
|
}
|
|
1840
1849
|
};
|
|
1841
|
-
this.drawCustomLink(
|
|
1842
|
-
}, Dn = function(
|
|
1843
|
-
let
|
|
1844
|
-
if (
|
|
1850
|
+
this.drawCustomLink(e, t, n);
|
|
1851
|
+
}, Dn = function(e) {
|
|
1852
|
+
let t;
|
|
1853
|
+
if (e ? t = e : t = this.currentLink, !t)
|
|
1845
1854
|
return;
|
|
1846
1855
|
this.hideLinkController();
|
|
1847
|
-
const n =
|
|
1848
|
-
delete this.linkData[n],
|
|
1849
|
-
}, On = function(
|
|
1850
|
-
this.currentLink =
|
|
1851
|
-
const
|
|
1852
|
-
this.showLinkController(
|
|
1856
|
+
const n = t.linkObj.id;
|
|
1857
|
+
delete this.linkData[n], t.remove(), t = null;
|
|
1858
|
+
}, On = function(e) {
|
|
1859
|
+
this.currentLink = e;
|
|
1860
|
+
const t = e.linkObj, n = E(t.from), i = E(t.to), o = ne(this, n, t.delta1), s = ne(this, i, t.delta2);
|
|
1861
|
+
this.showLinkController(t, o, s);
|
|
1853
1862
|
}, An = function() {
|
|
1863
|
+
this.currentLink = null, this.hideLinkController();
|
|
1864
|
+
}, Pn = function() {
|
|
1854
1865
|
this.linkController.style.display = "none", this.P2.style.display = "none", this.P3.style.display = "none";
|
|
1855
|
-
},
|
|
1866
|
+
}, jn = function(e, t, n) {
|
|
1856
1867
|
this.linkController.style.display = "initial", this.P2.style.display = "initial", this.P3.style.display = "initial", this.nodes.appendChild(this.linkController), this.nodes.appendChild(this.P2), this.nodes.appendChild(this.P3);
|
|
1857
|
-
let { x: i, y: o } = V(
|
|
1868
|
+
let { x: i, y: o } = V(t), { ctrlX: s, ctrlY: r } = t, { ctrlX: l, ctrlY: c } = n, { x: h, y: a } = V(n);
|
|
1858
1869
|
this.P2.style.cssText = `top:${r}px;left:${s}px;`, this.P3.style.cssText = `top:${c}px;left:${l}px;`, N(this.line1, {
|
|
1859
1870
|
x1: i + "",
|
|
1860
1871
|
y1: o + "",
|
|
@@ -1868,7 +1879,7 @@ const Mn = function(t, e, n, i) {
|
|
|
1868
1879
|
}), this.helper1 && (this.helper1.destory(this.map), this.helper2.destory(this.map)), this.helper1 = Ne.create(this.P2), this.helper2 = Ne.create(this.P3), this.helper1.init(this.map, (u, d) => {
|
|
1869
1880
|
var f;
|
|
1870
1881
|
s = s - u / this.scaleVal, r = r - d / this.scaleVal;
|
|
1871
|
-
const p = V({ ...
|
|
1882
|
+
const p = V({ ...t, ctrlX: s, ctrlY: r });
|
|
1872
1883
|
i = p.x, o = p.y;
|
|
1873
1884
|
const g = i / 8 + s * 3 / 8 + l * 3 / 8 + h / 8, m = o / 8 + r * 3 / 8 + c * 3 / 8 + a / 8;
|
|
1874
1885
|
this.P2.style.top = r + "px", this.P2.style.left = s + "px", (f = this.currentLink) == null || f.children[0].setAttribute("d", `M ${i} ${o} C ${s} ${r} ${l} ${c} ${h} ${a}`), N(this.currentLink.children[2], {
|
|
@@ -1879,7 +1890,7 @@ const Mn = function(t, e, n, i) {
|
|
|
1879
1890
|
y1: o + "",
|
|
1880
1891
|
x2: s + "",
|
|
1881
1892
|
y2: r + ""
|
|
1882
|
-
}),
|
|
1893
|
+
}), e.delta1.x = s - t.cx, e.delta1.y = r - t.cy;
|
|
1883
1894
|
}), this.helper2.init(this.map, (u, d) => {
|
|
1884
1895
|
var v, x;
|
|
1885
1896
|
l = l - u / this.scaleVal, c = c - d / this.scaleVal;
|
|
@@ -1894,43 +1905,44 @@ const Mn = function(t, e, n, i) {
|
|
|
1894
1905
|
y1: c + "",
|
|
1895
1906
|
x2: h + "",
|
|
1896
1907
|
y2: a + ""
|
|
1897
|
-
}),
|
|
1908
|
+
}), e.delta2.x = l - n.cx, e.delta2.y = c - n.cy;
|
|
1898
1909
|
});
|
|
1899
1910
|
};
|
|
1900
|
-
function
|
|
1911
|
+
function Hn() {
|
|
1901
1912
|
this.linkSvgGroup.innerHTML = "";
|
|
1902
|
-
for (const
|
|
1903
|
-
const
|
|
1904
|
-
this.drawCustomLink(E(
|
|
1913
|
+
for (const e in this.linkData) {
|
|
1914
|
+
const t = this.linkData[e];
|
|
1915
|
+
this.drawCustomLink(E(t.from), E(t.to), t, !0);
|
|
1905
1916
|
}
|
|
1906
1917
|
this.nodes.appendChild(this.linkSvgGroup);
|
|
1907
1918
|
}
|
|
1908
|
-
function
|
|
1909
|
-
if (console.time("editSummary"), !
|
|
1919
|
+
function Bn(e) {
|
|
1920
|
+
if (console.time("editSummary"), !e)
|
|
1910
1921
|
return;
|
|
1911
|
-
const
|
|
1912
|
-
console.log(
|
|
1922
|
+
const t = e.children[2];
|
|
1923
|
+
console.log(t, e), Ae(this, t, (n) => {
|
|
1913
1924
|
var s;
|
|
1914
|
-
const i =
|
|
1915
|
-
o === "" ? i.label = origin : i.label = o, n.remove(), o !== origin && (
|
|
1925
|
+
const i = e.linkObj, o = ((s = n.textContent) == null ? void 0 : s.trim()) || "";
|
|
1926
|
+
o === "" ? i.label = origin : i.label = o, n.remove(), o !== origin && (t.innerHTML = i.label, this.linkDiv());
|
|
1916
1927
|
}), console.timeEnd("editSummary");
|
|
1917
1928
|
}
|
|
1918
|
-
const
|
|
1929
|
+
const zn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1919
1930
|
__proto__: null,
|
|
1920
1931
|
createLink: $n,
|
|
1921
1932
|
drawCustomLink: Tn,
|
|
1922
|
-
editCutsomLinkLabel:
|
|
1923
|
-
hideLinkController:
|
|
1933
|
+
editCutsomLinkLabel: Bn,
|
|
1934
|
+
hideLinkController: Pn,
|
|
1924
1935
|
removeLink: Dn,
|
|
1925
|
-
renderCustomLink:
|
|
1936
|
+
renderCustomLink: Hn,
|
|
1926
1937
|
selectLink: On,
|
|
1927
|
-
showLinkController:
|
|
1928
|
-
|
|
1938
|
+
showLinkController: jn,
|
|
1939
|
+
unselectLink: An
|
|
1940
|
+
}, Symbol.toStringTag, { value: "Module" })), Rn = function(e) {
|
|
1929
1941
|
var c, h;
|
|
1930
|
-
if (
|
|
1942
|
+
if (e.length === 0)
|
|
1931
1943
|
throw new Error("No selected node.");
|
|
1932
|
-
if (
|
|
1933
|
-
const a =
|
|
1944
|
+
if (e.length === 1) {
|
|
1945
|
+
const a = e[0].nodeObj, u = e[0].nodeObj.parent;
|
|
1934
1946
|
if (!u)
|
|
1935
1947
|
throw new Error("Can not select root node.");
|
|
1936
1948
|
const d = u.children.findIndex((p) => a === p);
|
|
@@ -1940,19 +1952,19 @@ const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1940
1952
|
end: d
|
|
1941
1953
|
};
|
|
1942
1954
|
}
|
|
1943
|
-
let
|
|
1944
|
-
const n =
|
|
1955
|
+
let t = 0;
|
|
1956
|
+
const n = e.map((a) => {
|
|
1945
1957
|
let u = a.nodeObj;
|
|
1946
1958
|
const d = [];
|
|
1947
1959
|
for (; u.parent; ) {
|
|
1948
1960
|
const p = u.parent, g = p.children, m = g == null ? void 0 : g.indexOf(u);
|
|
1949
1961
|
u = p, d.unshift({ node: u, index: m });
|
|
1950
1962
|
}
|
|
1951
|
-
return d.length >
|
|
1963
|
+
return d.length > t && (t = d.length), d;
|
|
1952
1964
|
});
|
|
1953
1965
|
let i = 0;
|
|
1954
1966
|
e:
|
|
1955
|
-
for (; i <
|
|
1967
|
+
for (; i < t; i++) {
|
|
1956
1968
|
const a = (c = n[0][i]) == null ? void 0 : c.node;
|
|
1957
1969
|
for (let u = 1; u < n.length; u++)
|
|
1958
1970
|
if (((h = n[u][i]) == null ? void 0 : h.node) !== a)
|
|
@@ -1968,141 +1980,141 @@ const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1968
1980
|
start: s,
|
|
1969
1981
|
end: r
|
|
1970
1982
|
};
|
|
1971
|
-
},
|
|
1972
|
-
const
|
|
1973
|
-
return
|
|
1974
|
-
}, Ce = function(
|
|
1983
|
+
}, qn = function(e) {
|
|
1984
|
+
const t = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
1985
|
+
return t.setAttribute("id", e), t;
|
|
1986
|
+
}, Ce = function(e, t) {
|
|
1975
1987
|
const n = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
1976
1988
|
return N(n, {
|
|
1977
|
-
d:
|
|
1978
|
-
stroke:
|
|
1989
|
+
d: e,
|
|
1990
|
+
stroke: t || "#666",
|
|
1979
1991
|
fill: "none",
|
|
1980
1992
|
"stroke-linecap": "round",
|
|
1981
1993
|
"stroke-width": "2"
|
|
1982
1994
|
}), n;
|
|
1983
|
-
}, _e = function(
|
|
1995
|
+
}, _e = function(e, t, n, i, o) {
|
|
1984
1996
|
const s = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
1985
1997
|
return N(s, {
|
|
1986
1998
|
"text-anchor": i,
|
|
1987
|
-
x:
|
|
1999
|
+
x: t + "",
|
|
1988
2000
|
y: n + "",
|
|
1989
2001
|
fill: o || "#666"
|
|
1990
|
-
}), s.innerHTML =
|
|
1991
|
-
},
|
|
2002
|
+
}), s.innerHTML = e, s;
|
|
2003
|
+
}, Fn = (e) => E(e).parentElement.parentElement, Vn = function({ parent: e, start: t }) {
|
|
1992
2004
|
var s, r;
|
|
1993
|
-
const n = E(
|
|
2005
|
+
const n = E(e), i = n.nodeObj;
|
|
1994
2006
|
let o;
|
|
1995
|
-
return i.root === !0 ? o = (s = E(i.children[
|
|
1996
|
-
}, We = function(
|
|
2007
|
+
return i.root === !0 ? o = (s = E(i.children[t].id).closest("me-main")) == null ? void 0 : s.className : o = (r = n.closest("me-main")) == null ? void 0 : r.className, o;
|
|
2008
|
+
}, We = function(e, t) {
|
|
1997
2009
|
var _;
|
|
1998
|
-
const { id: n, text: i, parent: o, start: s, end: r } =
|
|
2010
|
+
const { id: n, text: i, parent: o, start: s, end: r } = t, l = e.nodes, h = E(o).nodeObj, a = Vn(t);
|
|
1999
2011
|
let u = 1 / 0, d = 0, p = 0, g = 0;
|
|
2000
2012
|
for (let Y = s; Y <= r; Y++) {
|
|
2001
2013
|
const de = (_ = h.children) == null ? void 0 : _[Y];
|
|
2002
2014
|
if (!de)
|
|
2003
|
-
return console.warn("Child not found"),
|
|
2004
|
-
const G =
|
|
2015
|
+
return console.warn("Child not found"), e.removeSummary(n), null;
|
|
2016
|
+
const G = Fn(de.id), { offsetLeft: J, offsetTop: he } = W(l, G);
|
|
2005
2017
|
Y === s && (p = he), Y === r && (g = he + G.offsetHeight), J < u && (u = J), G.offsetWidth + J > d && (d = G.offsetWidth + J);
|
|
2006
2018
|
}
|
|
2007
2019
|
let m, f;
|
|
2008
|
-
const v = p + 10, x = g + 10, b = (v + x) / 2, y =
|
|
2020
|
+
const v = p + 10, x = g + 10, b = (v + x) / 2, y = e.theme.cssVar["--color"];
|
|
2009
2021
|
a === "lhs" ? (m = Ce(`M ${u + 10} ${v} c -5 0 -10 5 -10 10 L ${u} ${x - 10} c 0 5 5 10 10 10 M ${u} ${b} h -10`, y), f = _e(i, u - 20, b + 6, "end", y)) : (m = Ce(`M ${d - 10} ${v} c 5 0 10 5 10 10 L ${d} ${x - 10} c 0 5 -5 10 -10 10 M ${d} ${b} h 10`, y), f = _e(i, d + 20, b + 6, "start", y));
|
|
2010
|
-
const C =
|
|
2011
|
-
return C.appendChild(m), C.appendChild(f), C.summaryObj =
|
|
2012
|
-
},
|
|
2013
|
-
let
|
|
2014
|
-
this.currentNode ?
|
|
2015
|
-
const { parent:
|
|
2022
|
+
const C = qn("s-" + n);
|
|
2023
|
+
return C.appendChild(m), C.appendChild(f), C.summaryObj = t, e.summarySvg.appendChild(C), C;
|
|
2024
|
+
}, Wn = function() {
|
|
2025
|
+
let e = [];
|
|
2026
|
+
this.currentNode ? e = [this.currentNode] : this.currentNodes && (e = this.currentNodes);
|
|
2027
|
+
const { parent: t, start: n, end: i } = Rn(e), o = { id: U(), parent: t, start: n, end: i, text: "summary" }, s = We(this, o);
|
|
2016
2028
|
this.summaries.push(o), this.editSummary(s);
|
|
2017
|
-
},
|
|
2029
|
+
}, Yn = function(e) {
|
|
2018
2030
|
var n;
|
|
2019
|
-
const
|
|
2020
|
-
|
|
2021
|
-
},
|
|
2022
|
-
const
|
|
2031
|
+
const t = this.summaries.findIndex((i) => i.id === e);
|
|
2032
|
+
t > -1 && (this.summaries.splice(t, 1), (n = document.querySelector("#s-" + e)) == null || n.remove());
|
|
2033
|
+
}, In = function(e) {
|
|
2034
|
+
const t = e.children[1].getBBox(), n = 6, i = 3, o = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
2023
2035
|
N(o, {
|
|
2024
|
-
x:
|
|
2025
|
-
y:
|
|
2026
|
-
width:
|
|
2027
|
-
height:
|
|
2036
|
+
x: t.x - n + "",
|
|
2037
|
+
y: t.y - n + "",
|
|
2038
|
+
width: t.width + n * 2 + "",
|
|
2039
|
+
height: t.height + n * 2 + "",
|
|
2028
2040
|
rx: i + "",
|
|
2029
2041
|
stroke: this.theme.cssVar["--selected"] || "#4dc4ff",
|
|
2030
2042
|
"stroke-width": "2",
|
|
2031
2043
|
fill: "none"
|
|
2032
|
-
}), o.classList.add("selected"),
|
|
2033
|
-
}, In = function() {
|
|
2034
|
-
var t, e;
|
|
2035
|
-
(e = (t = this.currentSummary) == null ? void 0 : t.querySelector("rect")) == null || e.remove(), this.currentSummary = null;
|
|
2044
|
+
}), o.classList.add("selected"), e.appendChild(o), this.currentSummary = e;
|
|
2036
2045
|
}, Xn = function() {
|
|
2037
|
-
|
|
2038
|
-
|
|
2046
|
+
var e, t;
|
|
2047
|
+
(t = (e = this.currentSummary) == null ? void 0 : e.querySelector("rect")) == null || t.remove(), this.currentSummary = null;
|
|
2048
|
+
}, Kn = function() {
|
|
2049
|
+
this.summarySvg.innerHTML = "", this.summaries.forEach((e) => {
|
|
2050
|
+
We(this, e);
|
|
2039
2051
|
}), this.nodes.insertAdjacentElement("beforeend", this.summarySvg);
|
|
2040
|
-
},
|
|
2041
|
-
if (console.time("editSummary"), !
|
|
2052
|
+
}, Un = function(e) {
|
|
2053
|
+
if (console.time("editSummary"), !e)
|
|
2042
2054
|
return;
|
|
2043
|
-
const
|
|
2044
|
-
Ae(this,
|
|
2055
|
+
const t = e.childNodes[1];
|
|
2056
|
+
Ae(this, t, (n) => {
|
|
2045
2057
|
var s;
|
|
2046
|
-
const i =
|
|
2047
|
-
o === "" ? i.text = origin : i.text = o, n.remove(), o !== origin && (
|
|
2058
|
+
const i = e.summaryObj, o = ((s = n.textContent) == null ? void 0 : s.trim()) || "";
|
|
2059
|
+
o === "" ? i.text = origin : i.text = o, n.remove(), o !== origin && (t.innerHTML = i.text, this.linkDiv(), this.bus.fire("operation", {
|
|
2048
2060
|
name: "finishEditSummary",
|
|
2049
2061
|
obj: i,
|
|
2050
2062
|
origin
|
|
2051
2063
|
}));
|
|
2052
2064
|
}), console.timeEnd("editSummary");
|
|
2053
|
-
},
|
|
2065
|
+
}, Gn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2054
2066
|
__proto__: null,
|
|
2055
|
-
createSummary:
|
|
2056
|
-
editSummary:
|
|
2057
|
-
removeSummary:
|
|
2058
|
-
renderSummary:
|
|
2059
|
-
selectSummary:
|
|
2060
|
-
unselectSummary:
|
|
2067
|
+
createSummary: Wn,
|
|
2068
|
+
editSummary: Un,
|
|
2069
|
+
removeSummary: Yn,
|
|
2070
|
+
renderSummary: Kn,
|
|
2071
|
+
selectSummary: In,
|
|
2072
|
+
unselectSummary: Xn
|
|
2061
2073
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2062
|
-
function
|
|
2074
|
+
function Jn(e, t) {
|
|
2063
2075
|
const n = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
2064
2076
|
return N(n, {
|
|
2065
2077
|
version: "1.1",
|
|
2066
2078
|
xmlns: "http://www.w3.org/2000/svg",
|
|
2067
|
-
height:
|
|
2068
|
-
width:
|
|
2079
|
+
height: e,
|
|
2080
|
+
width: t
|
|
2069
2081
|
}), n;
|
|
2070
2082
|
}
|
|
2071
|
-
function
|
|
2072
|
-
return (parseInt(
|
|
2083
|
+
function Qn(e, t) {
|
|
2084
|
+
return (parseInt(e) - parseInt(t)) / 2;
|
|
2073
2085
|
}
|
|
2074
|
-
function
|
|
2086
|
+
function Zn(e, t, n, i) {
|
|
2075
2087
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
2076
|
-
return
|
|
2088
|
+
return e.childNodes[0].textContent.split(`
|
|
2077
2089
|
`).forEach((l, c) => {
|
|
2078
2090
|
const h = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
2079
2091
|
N(h, {
|
|
2080
|
-
x: n + parseInt(
|
|
2081
|
-
y: i + parseInt(
|
|
2092
|
+
x: n + parseInt(t.paddingLeft) + "",
|
|
2093
|
+
y: i + parseInt(t.paddingTop) + Qn(t.lineHeight, t.fontSize) * (c + 1) + parseFloat(t.fontSize) * (c + 1) + "",
|
|
2082
2094
|
"text-anchor": "start",
|
|
2083
|
-
"font-family":
|
|
2084
|
-
"font-size": `${
|
|
2085
|
-
"font-weight": `${
|
|
2086
|
-
fill: `${
|
|
2095
|
+
"font-family": t.fontFamily,
|
|
2096
|
+
"font-size": `${t.fontSize}`,
|
|
2097
|
+
"font-weight": `${t.fontWeight}`,
|
|
2098
|
+
fill: `${t.color}`
|
|
2087
2099
|
}), h.innerHTML = l, o.appendChild(h);
|
|
2088
2100
|
}), o;
|
|
2089
2101
|
}
|
|
2090
|
-
function
|
|
2091
|
-
const o =
|
|
2102
|
+
function ei(e, t, n, i) {
|
|
2103
|
+
const o = e.childNodes[0].textContent, s = document.createElementNS("http://www.w3.org/2000/svg", "foreignObject");
|
|
2092
2104
|
N(s, {
|
|
2093
|
-
x: n + parseInt(
|
|
2094
|
-
y: i + parseInt(
|
|
2095
|
-
width:
|
|
2096
|
-
height:
|
|
2105
|
+
x: n + parseInt(t.paddingLeft) + "",
|
|
2106
|
+
y: i + parseInt(t.paddingTop) + "",
|
|
2107
|
+
width: t.width,
|
|
2108
|
+
height: t.height
|
|
2097
2109
|
});
|
|
2098
2110
|
const r = document.createElement("div");
|
|
2099
2111
|
return N(r, {
|
|
2100
2112
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
2101
|
-
style: `font-family: ${
|
|
2113
|
+
style: `font-family: ${t.fontFamily}; font-size: ${t.fontSize}; font-weight: ${t.fontWeight}; color: ${t.color}; white-space: pre-wrap;`
|
|
2102
2114
|
}), r.innerHTML = o, s.appendChild(r), s;
|
|
2103
2115
|
}
|
|
2104
|
-
function re(
|
|
2105
|
-
const i = getComputedStyle(
|
|
2116
|
+
function re(e, t, n = !1) {
|
|
2117
|
+
const i = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = W(e.nodes, t), r = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
2106
2118
|
N(r, {
|
|
2107
2119
|
x: o + "",
|
|
2108
2120
|
y: s + "",
|
|
@@ -2117,10 +2129,10 @@ function re(t, e, n = !1) {
|
|
|
2117
2129
|
const l = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
2118
2130
|
l.appendChild(r);
|
|
2119
2131
|
let c;
|
|
2120
|
-
return n ? c =
|
|
2132
|
+
return n ? c = ei(t, i, o, s) : c = Zn(t, i, o, s), l.appendChild(c), l;
|
|
2121
2133
|
}
|
|
2122
|
-
function
|
|
2123
|
-
const n = getComputedStyle(
|
|
2134
|
+
function ti(e, t) {
|
|
2135
|
+
const n = getComputedStyle(t), { offsetLeft: i, offsetTop: o } = W(e.nodes, t), s = document.createElementNS("http://www.w3.org/2000/svg", "a"), r = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
2124
2136
|
return N(r, {
|
|
2125
2137
|
x: i + "",
|
|
2126
2138
|
y: o + parseInt(n.fontSize) + "",
|
|
@@ -2129,55 +2141,55 @@ function ei(t, e) {
|
|
|
2129
2141
|
"font-size": `${n.fontSize}`,
|
|
2130
2142
|
"font-weight": `${n.fontWeight}`,
|
|
2131
2143
|
fill: `${n.color}`
|
|
2132
|
-
}), r.innerHTML =
|
|
2144
|
+
}), r.innerHTML = t.textContent, s.appendChild(r), s.setAttribute("href", t.href), s;
|
|
2133
2145
|
}
|
|
2134
|
-
const Z = 100,
|
|
2146
|
+
const Z = 100, ni = '<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">', Ye = (e) => {
|
|
2135
2147
|
var a, u, d;
|
|
2136
|
-
const
|
|
2148
|
+
const t = e.nodes, n = t.offsetHeight + Z * 2, i = t.offsetWidth + Z * 2, o = Jn(n + "px", i + "px"), s = document.createElementNS("http://www.w3.org/2000/svg", "svg"), r = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
2137
2149
|
N(r, {
|
|
2138
2150
|
x: "0",
|
|
2139
2151
|
y: "0",
|
|
2140
2152
|
width: `${i}`,
|
|
2141
2153
|
height: `${n}`,
|
|
2142
|
-
fill:
|
|
2143
|
-
}), o.appendChild(r),
|
|
2144
|
-
const g = p.cloneNode(!0), { offsetLeft: m, offsetTop: f } = W(
|
|
2154
|
+
fill: e.theme.cssVar["--bgcolor"]
|
|
2155
|
+
}), o.appendChild(r), t.querySelectorAll(".subLines").forEach((p) => {
|
|
2156
|
+
const g = p.cloneNode(!0), { offsetLeft: m, offsetTop: f } = W(t, p.parentElement);
|
|
2145
2157
|
g.setAttribute("x", `${m}`), g.setAttribute("y", `${f}`), s.appendChild(g);
|
|
2146
2158
|
});
|
|
2147
|
-
const l = (a =
|
|
2159
|
+
const l = (a = t.querySelector(".lines")) == null ? void 0 : a.cloneNode(!0);
|
|
2148
2160
|
l && s.appendChild(l);
|
|
2149
|
-
const c = (u =
|
|
2161
|
+
const c = (u = t.querySelector(".topiclinks")) == null ? void 0 : u.cloneNode(!0);
|
|
2150
2162
|
c && s.appendChild(c);
|
|
2151
|
-
const h = (d =
|
|
2152
|
-
return h && s.appendChild(h),
|
|
2153
|
-
s.appendChild(re(
|
|
2154
|
-
}),
|
|
2155
|
-
s.appendChild(re(
|
|
2156
|
-
}),
|
|
2157
|
-
s.appendChild(re(
|
|
2158
|
-
}),
|
|
2159
|
-
s.appendChild(
|
|
2163
|
+
const h = (d = t.querySelector(".summary")) == null ? void 0 : d.cloneNode(!0);
|
|
2164
|
+
return h && s.appendChild(h), t.querySelectorAll("me-tpc").forEach((p) => {
|
|
2165
|
+
s.appendChild(re(e, p, !0));
|
|
2166
|
+
}), t.querySelectorAll(".tags > span").forEach((p) => {
|
|
2167
|
+
s.appendChild(re(e, p));
|
|
2168
|
+
}), t.querySelectorAll(".icons > span").forEach((p) => {
|
|
2169
|
+
s.appendChild(re(e, p));
|
|
2170
|
+
}), t.querySelectorAll(".hyper-link").forEach((p) => {
|
|
2171
|
+
s.appendChild(ti(e, p));
|
|
2160
2172
|
}), N(s, {
|
|
2161
2173
|
x: Z + "",
|
|
2162
2174
|
y: Z + "",
|
|
2163
2175
|
overflow: "visible"
|
|
2164
|
-
}), o.appendChild(s),
|
|
2176
|
+
}), o.appendChild(s), ni + o.outerHTML;
|
|
2165
2177
|
};
|
|
2166
|
-
function
|
|
2167
|
-
return new Promise((
|
|
2178
|
+
function ii(e) {
|
|
2179
|
+
return new Promise((t, n) => {
|
|
2168
2180
|
const i = new FileReader();
|
|
2169
2181
|
i.onload = (o) => {
|
|
2170
|
-
|
|
2182
|
+
t(o.target.result);
|
|
2171
2183
|
}, i.onerror = (o) => {
|
|
2172
2184
|
n(o);
|
|
2173
|
-
}, i.readAsDataURL(
|
|
2185
|
+
}, i.readAsDataURL(e);
|
|
2174
2186
|
});
|
|
2175
2187
|
}
|
|
2176
|
-
const
|
|
2177
|
-
const
|
|
2178
|
-
return new Blob([
|
|
2179
|
-
},
|
|
2180
|
-
const
|
|
2188
|
+
const oi = function() {
|
|
2189
|
+
const e = Ye(this);
|
|
2190
|
+
return new Blob([e], { type: "image/svg+xml" });
|
|
2191
|
+
}, si = async function() {
|
|
2192
|
+
const e = Ye(this), t = new Blob([e], { type: "image/svg+xml" }), n = await ii(t);
|
|
2181
2193
|
return new Promise((i, o) => {
|
|
2182
2194
|
const s = new Image();
|
|
2183
2195
|
s.setAttribute("crossOrigin", "anonymous"), s.onload = () => {
|
|
@@ -2185,23 +2197,23 @@ const ii = function() {
|
|
|
2185
2197
|
r.width = s.width, r.height = s.height, r.getContext("2d").drawImage(s, 0, 0), r.toBlob(i, "image/png", 1);
|
|
2186
2198
|
}, s.src = n, s.onerror = o;
|
|
2187
2199
|
});
|
|
2188
|
-
},
|
|
2200
|
+
}, ri = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2189
2201
|
__proto__: null,
|
|
2190
|
-
exportPng:
|
|
2191
|
-
exportSvg:
|
|
2202
|
+
exportPng: si,
|
|
2203
|
+
exportSvg: oi
|
|
2192
2204
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
2193
|
-
function
|
|
2205
|
+
function li(e, t) {
|
|
2194
2206
|
return async function(...n) {
|
|
2195
|
-
const i = this.before[
|
|
2196
|
-
i && !await i.apply(this, n) ||
|
|
2207
|
+
const i = this.before[t];
|
|
2208
|
+
i && !await i.apply(this, n) || e.apply(this, n);
|
|
2197
2209
|
};
|
|
2198
2210
|
}
|
|
2199
2211
|
const ke = Object.keys(Ve), Ie = {};
|
|
2200
|
-
for (let
|
|
2201
|
-
const
|
|
2202
|
-
Ie[
|
|
2212
|
+
for (let e = 0; e < ke.length; e++) {
|
|
2213
|
+
const t = ke[e];
|
|
2214
|
+
Ie[t] = li(Ve[t], t);
|
|
2203
2215
|
}
|
|
2204
|
-
const
|
|
2216
|
+
const ci = {
|
|
2205
2217
|
getObjById: Me,
|
|
2206
2218
|
generateNewObj: Ue,
|
|
2207
2219
|
layout: lt,
|
|
@@ -2215,18 +2227,18 @@ const li = {
|
|
|
2215
2227
|
changeTheme: qt,
|
|
2216
2228
|
...fn,
|
|
2217
2229
|
...Ie,
|
|
2218
|
-
...
|
|
2219
|
-
...
|
|
2220
|
-
...
|
|
2221
|
-
init(
|
|
2222
|
-
if (!
|
|
2230
|
+
...zn,
|
|
2231
|
+
...Gn,
|
|
2232
|
+
...ri,
|
|
2233
|
+
init(e) {
|
|
2234
|
+
if (!e || !e.nodeData)
|
|
2223
2235
|
return new Error("MindElixir: `data` is required");
|
|
2224
|
-
|
|
2236
|
+
e.direction !== void 0 && (this.direction = e.direction), this.changeTheme(e.theme || this.theme, !1), this.nodeData = e.nodeData, T(this.nodeData), this.linkData = e.linkData || {}, this.summaries = e.summaries || [], this.toolBar && Ot(this), this.keypress && _t(this), this.editable && Rt(this), Xe() && this.mobileMenu ? kt(this) : this.contextMenu && Et(this, this.contextMenuOption), this.draggable && Mt(this), this.allowUndo && Tt(this), this.toCenter(), this.layout(), this.linkDiv();
|
|
2225
2237
|
}
|
|
2226
2238
|
}, I = document;
|
|
2227
2239
|
function $({
|
|
2228
|
-
el:
|
|
2229
|
-
direction:
|
|
2240
|
+
el: e,
|
|
2241
|
+
direction: t,
|
|
2230
2242
|
locale: n,
|
|
2231
2243
|
draggable: i,
|
|
2232
2244
|
editable: o,
|
|
@@ -2245,27 +2257,27 @@ function $({
|
|
|
2245
2257
|
}) {
|
|
2246
2258
|
console.log("ME_version " + $.version, this);
|
|
2247
2259
|
let v = null;
|
|
2248
|
-
const x = Object.prototype.toString.call(
|
|
2249
|
-
if (x === "[object HTMLDivElement]" ? v =
|
|
2260
|
+
const x = Object.prototype.toString.call(e);
|
|
2261
|
+
if (x === "[object HTMLDivElement]" ? v = e : x === "[object String]" && (v = document.querySelector(e)), !v)
|
|
2250
2262
|
throw new Error("MindElixir: el is not a valid element");
|
|
2251
|
-
v.className += " mind-elixir", v.innerHTML = "", v.style.setProperty("--gap", M + "px"), this.mindElixirBox = v, this.before = h || {}, this.locale = n || "en", this.contextMenuOption = r, this.contextMenu = s === void 0 ? !0 : s, this.toolBar = l === void 0 ? !0 : l, this.keypress = c === void 0 ? !0 : c, this.mobileMenu = m || !1, this.direction = typeof
|
|
2263
|
+
v.className += " mind-elixir", v.innerHTML = "", v.style.setProperty("--gap", M + "px"), this.mindElixirBox = v, this.before = h || {}, this.locale = n || "en", this.contextMenuOption = r, this.contextMenu = s === void 0 ? !0 : s, this.toolBar = l === void 0 ? !0 : l, this.keypress = c === void 0 ? !0 : c, this.mobileMenu = m || !1, this.direction = typeof t == "number" ? t : 1, this.draggable = i === void 0 ? !0 : i, this.newTopicName = a || "new node", this.editable = o === void 0 ? !0 : o, this.allowUndo = u === void 0 ? !1 : u, this.currentNode = null, this.currentLink = null, this.scaleVal = 1, this.tempDirection = null, this.mainLinkStyle = d || 0, this.subLinkStyle = p || 0, this.overflowHidden = g || !1, this.bus = rt.create(), this.container = I.createElement("div"), this.container.className = "map-container";
|
|
2252
2264
|
const b = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2253
2265
|
this.theme = f || (b.matches ? Le : Se);
|
|
2254
2266
|
const y = I.createElement("div");
|
|
2255
2267
|
y.className = "map-canvas", this.map = y, this.map.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.mindElixirBox.appendChild(this.container), this.nodes = I.createElement("me-nodes"), this.nodes.className = "main-node-container", this.lines = X("lines"), this.summarySvg = X("summary"), this.linkController = X("linkcontroller"), this.P2 = I.createElement("div"), this.P3 = I.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = fe(), this.line2 = fe(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = X("topiclinks"), this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : st(this);
|
|
2256
2268
|
}
|
|
2257
|
-
$.prototype =
|
|
2269
|
+
$.prototype = ci;
|
|
2258
2270
|
$.LEFT = S;
|
|
2259
2271
|
$.RIGHT = H;
|
|
2260
2272
|
$.SIDE = K;
|
|
2261
2273
|
$.THEME = Se;
|
|
2262
2274
|
$.DARK_THEME = Le;
|
|
2263
|
-
$.version = "3.2.
|
|
2275
|
+
$.version = "3.2.3";
|
|
2264
2276
|
$.E = E;
|
|
2265
|
-
$.new = (
|
|
2277
|
+
$.new = (e) => ({
|
|
2266
2278
|
nodeData: {
|
|
2267
2279
|
id: U(),
|
|
2268
|
-
topic:
|
|
2280
|
+
topic: e || "new topic",
|
|
2269
2281
|
root: !0,
|
|
2270
2282
|
children: []
|
|
2271
2283
|
},
|