mind-elixir 3.1.3 → 3.2.0
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 +9 -8
- package/dist/MindElixir.js +1376 -1179
- package/dist/MindElixirLite.iife.js +7 -6
- package/dist/MindElixirLite.js +822 -638
- package/dist/example.iife.js +1 -1
- package/dist/example.js +17 -2
- package/dist/types/customLink.d.ts +8 -3
- package/dist/types/index.d.ts +7 -2
- package/dist/types/methods.d.ts +7 -2
- package/dist/types/plugin/exportImage.d.ts +3 -0
- package/dist/types/types/dom.d.ts +2 -2
- package/dist/types/utils/index.d.ts +0 -9
- package/dist/types/utils/svg.d.ts +3 -1
- package/package.json +1 -2
- package/readme.md +49 -3
package/dist/MindElixir.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
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;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:800px;white-space:pre-wrap;padding:var(--topic-padding);line-height:1.2}.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:800px;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:16px}.map-container .icons{display:inline-block;direction:ltr;margin-right:10px}.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 .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 t, n, i, s, o, 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
|
-
|
|
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(t) {
|
|
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 && !t.__iconfont__svg__cssinject__) {
|
|
5
|
+
t.__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>"
|
|
9
9
|
);
|
|
10
|
-
} catch (
|
|
11
|
-
console && console.log(
|
|
10
|
+
} catch (a) {
|
|
11
|
+
console && console.log(a);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
14
|
+
function h() {
|
|
15
|
+
s || (s = !0, i());
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
var
|
|
19
|
-
(p = document.createElement("div")).innerHTML = l, l = null, (
|
|
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 =
|
|
17
|
+
e = function() {
|
|
18
|
+
var a, u, d, p;
|
|
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(e, 0) : (n = function() {
|
|
21
|
+
document.removeEventListener("DOMContentLoaded", n, !1), e();
|
|
22
|
+
}, document.addEventListener("DOMContentLoaded", n, !1)) : document.attachEvent && (i = e, o = t.document, s = !1, (r = function() {
|
|
23
23
|
try {
|
|
24
|
-
|
|
24
|
+
o.documentElement.doScroll("left");
|
|
25
25
|
} catch {
|
|
26
26
|
return void setTimeout(r, 50);
|
|
27
27
|
}
|
|
28
|
-
|
|
29
|
-
})(),
|
|
30
|
-
|
|
28
|
+
h();
|
|
29
|
+
})(), o.onreadystatechange = function() {
|
|
30
|
+
o.readyState == "complete" && (o.onreadystatechange = null, h());
|
|
31
31
|
});
|
|
32
32
|
})(window);
|
|
33
|
-
const S = 0,
|
|
33
|
+
const S = 0, H = 1, K = 2, M = 30, L = 8, Se = {
|
|
34
34
|
name: "Latte",
|
|
35
35
|
palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
|
|
36
36
|
cssVar: {
|
|
@@ -42,7 +42,7 @@ const S = 0, R = 1, I = 2, T = 30, L = 8, _e = {
|
|
|
42
42
|
"--panel-bgcolor": "#ffffff",
|
|
43
43
|
"--panel-border-color": "#eaeaea"
|
|
44
44
|
}
|
|
45
|
-
},
|
|
45
|
+
}, Le = {
|
|
46
46
|
name: "Dark",
|
|
47
47
|
palette: ["#848FA0", "#748BE9", "#D2F9FE", "#4145A5", "#789AFA", "#706CF4", "#EF987F", "#775DD5", "#FCEECF", "#DA7FBC"],
|
|
48
48
|
cssVar: {
|
|
@@ -55,424 +55,435 @@ const S = 0, R = 1, I = 2, T = 30, L = 8, _e = {
|
|
|
55
55
|
"--panel-border-color": "#696969"
|
|
56
56
|
}
|
|
57
57
|
};
|
|
58
|
-
function
|
|
59
|
-
return
|
|
58
|
+
function ee(t) {
|
|
59
|
+
return t.replace(/&/g, "&").replace(/</g, "<").replace(/"/g, """);
|
|
60
60
|
}
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
63
|
-
return
|
|
64
|
-
if (
|
|
65
|
-
for (let n = 0; n <
|
|
66
|
-
const i =
|
|
61
|
+
const Xe = () => /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent), Me = function(t, e) {
|
|
62
|
+
if (e.id === t)
|
|
63
|
+
return e;
|
|
64
|
+
if (e.children && e.children.length) {
|
|
65
|
+
for (let n = 0; n < e.children.length; n++) {
|
|
66
|
+
const i = Me(t, e.children[n]);
|
|
67
67
|
if (i)
|
|
68
68
|
return i;
|
|
69
69
|
}
|
|
70
70
|
return null;
|
|
71
71
|
} else
|
|
72
72
|
return null;
|
|
73
|
-
},
|
|
74
|
-
if (
|
|
75
|
-
for (let n = 0; n <
|
|
76
|
-
|
|
73
|
+
}, T = (t, e) => {
|
|
74
|
+
if (t.parent = e, t.children)
|
|
75
|
+
for (let n = 0; n < t.children.length; n++)
|
|
76
|
+
T(t.children[n], t);
|
|
77
77
|
};
|
|
78
|
-
function
|
|
79
|
-
if (
|
|
80
|
-
for (let
|
|
81
|
-
|
|
78
|
+
function Te(t) {
|
|
79
|
+
if (t.id = U(), t.children)
|
|
80
|
+
for (let e = 0; e < t.children.length; e++)
|
|
81
|
+
Te(t.children[e]);
|
|
82
82
|
}
|
|
83
|
-
const
|
|
83
|
+
const Ke = (t, e) => {
|
|
84
84
|
let n = Date.now();
|
|
85
85
|
return function(...i) {
|
|
86
|
-
Date.now() - n >=
|
|
86
|
+
Date.now() - n >= e && (t(...i), n = Date.now());
|
|
87
87
|
};
|
|
88
88
|
};
|
|
89
|
-
function
|
|
90
|
-
const
|
|
91
|
-
let r = Math.atan(Math.abs(
|
|
92
|
-
|
|
93
|
-
const l =
|
|
89
|
+
function $e(t, e, n, i) {
|
|
90
|
+
const o = i - e, s = t - n;
|
|
91
|
+
let r = Math.atan(Math.abs(o) / Math.abs(s)) / 3.14 * 180;
|
|
92
|
+
s < 0 && o > 0 && (r = 180 - r), s < 0 && o < 0 && (r = 180 + r), s > 0 && o < 0 && (r = 360 - r);
|
|
93
|
+
const l = 15, c = 30, h = r + c, a = r - c;
|
|
94
94
|
return {
|
|
95
|
-
x1: n + Math.cos(Math.PI *
|
|
96
|
-
y1: i - Math.sin(Math.PI *
|
|
97
|
-
x2: n + Math.cos(Math.PI *
|
|
98
|
-
y2: i - Math.sin(Math.PI *
|
|
95
|
+
x1: n + Math.cos(Math.PI * h / 180) * l,
|
|
96
|
+
y1: i - Math.sin(Math.PI * h / 180) * l,
|
|
97
|
+
x2: n + Math.cos(Math.PI * a / 180) * l,
|
|
98
|
+
y2: i - Math.sin(Math.PI * a / 180) * l
|
|
99
99
|
};
|
|
100
100
|
}
|
|
101
|
-
function
|
|
102
|
-
let i, s;
|
|
103
|
-
const o = (e.cy - n) / (t - e.cx);
|
|
104
|
-
return o > e.h / e.w || o < -e.h / e.w ? e.cy - n < 0 ? (i = e.cx - e.h / 2 / o, s = e.cy + e.h / 2) : (i = e.cx + e.h / 2 / o, s = e.cy - e.h / 2) : e.cx - t < 0 ? (i = e.cx + e.w / 2, s = e.cy - e.w * o / 2) : (i = e.cx - e.w / 2, s = e.cy + e.w * o / 2), {
|
|
105
|
-
x: i,
|
|
106
|
-
y: s
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
function ie(e, t, n) {
|
|
110
|
-
let i, s;
|
|
111
|
-
const o = (e.cy - n) / (t - e.cx);
|
|
112
|
-
return o > e.h / e.w || o < -e.h / e.w ? e.cy - n < 0 ? (i = e.cx - e.h / 2 / o, s = e.cy + e.h / 2) : (i = e.cx + e.h / 2 / o, s = e.cy - e.h / 2) : e.cx - t < 0 ? (i = e.cx + e.w / 2, s = e.cy - e.w * o / 2) : (i = e.cx - e.w / 2, s = e.cy + e.w * o / 2), {
|
|
113
|
-
x: i,
|
|
114
|
-
y: s
|
|
115
|
-
};
|
|
116
|
-
}
|
|
117
|
-
function K() {
|
|
101
|
+
function U() {
|
|
118
102
|
return ((/* @__PURE__ */ new Date()).getTime().toString(16) + Math.random().toString(16).substr(2)).substr(2, 16);
|
|
119
103
|
}
|
|
120
|
-
const
|
|
121
|
-
const
|
|
104
|
+
const Ue = function() {
|
|
105
|
+
const t = U();
|
|
122
106
|
return {
|
|
123
107
|
topic: this.newTopicName,
|
|
124
|
-
id:
|
|
108
|
+
id: t
|
|
125
109
|
};
|
|
126
110
|
};
|
|
127
|
-
function
|
|
111
|
+
function Ge(t, e) {
|
|
128
112
|
let n = !0;
|
|
129
|
-
for (;
|
|
130
|
-
if (
|
|
113
|
+
for (; e.parent; ) {
|
|
114
|
+
if (e.parent === t) {
|
|
131
115
|
n = !1;
|
|
132
116
|
break;
|
|
133
117
|
}
|
|
134
|
-
|
|
118
|
+
e = e.parent;
|
|
135
119
|
}
|
|
136
120
|
return n;
|
|
137
121
|
}
|
|
138
|
-
const
|
|
122
|
+
const P = (t) => {
|
|
139
123
|
var i;
|
|
140
|
-
const
|
|
141
|
-
return { siblings:
|
|
124
|
+
const e = (i = t.parent) == null ? void 0 : i.children, n = e.indexOf(t);
|
|
125
|
+
return { siblings: e, index: n };
|
|
142
126
|
};
|
|
143
|
-
function
|
|
144
|
-
const { siblings:
|
|
145
|
-
n === 0 ? (
|
|
127
|
+
function Je(t) {
|
|
128
|
+
const { siblings: e, index: n } = P(t), i = e[n];
|
|
129
|
+
n === 0 ? (e[n] = e[e.length - 1], e[e.length - 1] = i) : (e[n] = e[n - 1], e[n - 1] = i);
|
|
146
130
|
}
|
|
147
|
-
function
|
|
148
|
-
const { siblings:
|
|
149
|
-
n ===
|
|
131
|
+
function Qe(t) {
|
|
132
|
+
const { siblings: e, index: n } = P(t), i = e[n];
|
|
133
|
+
n === e.length - 1 ? (e[n] = e[0], e[0] = i) : (e[n] = e[n + 1], e[n + 1] = i);
|
|
150
134
|
}
|
|
151
|
-
function
|
|
152
|
-
const { siblings:
|
|
153
|
-
return
|
|
135
|
+
function ie(t) {
|
|
136
|
+
const { siblings: e, index: n } = P(t);
|
|
137
|
+
return e.splice(n, 1), e.length;
|
|
154
138
|
}
|
|
155
|
-
function
|
|
156
|
-
const { siblings: n, index: i } =
|
|
157
|
-
n.splice(i + 1, 0,
|
|
139
|
+
function Ze(t, e) {
|
|
140
|
+
const { siblings: n, index: i } = P(t);
|
|
141
|
+
n.splice(i + 1, 0, e);
|
|
158
142
|
}
|
|
159
|
-
function
|
|
160
|
-
const { siblings: n, index: i } =
|
|
161
|
-
n.splice(i, 0,
|
|
143
|
+
function et(t, e) {
|
|
144
|
+
const { siblings: n, index: i } = P(t);
|
|
145
|
+
n.splice(i, 0, e);
|
|
162
146
|
}
|
|
163
|
-
function
|
|
164
|
-
const { siblings: n, index: i } =
|
|
165
|
-
n[i] =
|
|
147
|
+
function tt(t, e) {
|
|
148
|
+
const { siblings: n, index: i } = P(t);
|
|
149
|
+
n[i] = e, e.children = [t];
|
|
166
150
|
}
|
|
167
|
-
function
|
|
168
|
-
|
|
151
|
+
function nt(t, e) {
|
|
152
|
+
ie(t), e.children ? e.children.push(t) : e.children = [t];
|
|
169
153
|
}
|
|
170
|
-
function
|
|
171
|
-
|
|
172
|
-
const { siblings: n, index: i } =
|
|
173
|
-
n.splice(i, 0,
|
|
154
|
+
function it(t, e) {
|
|
155
|
+
ie(t);
|
|
156
|
+
const { siblings: n, index: i } = P(e);
|
|
157
|
+
n.splice(i, 0, t);
|
|
174
158
|
}
|
|
175
|
-
function
|
|
176
|
-
|
|
177
|
-
const { siblings: n, index: i } =
|
|
178
|
-
n.splice(i + 1, 0,
|
|
159
|
+
function ot(t, e) {
|
|
160
|
+
ie(t);
|
|
161
|
+
const { siblings: n, index: i } = P(e);
|
|
162
|
+
n.splice(i + 1, 0, t);
|
|
179
163
|
}
|
|
180
|
-
function
|
|
164
|
+
function De(t) {
|
|
181
165
|
return JSON.parse(
|
|
182
|
-
JSON.stringify(
|
|
166
|
+
JSON.stringify(t, (n, i) => {
|
|
183
167
|
if (n !== "parent")
|
|
184
168
|
return i;
|
|
185
169
|
})
|
|
186
170
|
);
|
|
187
171
|
}
|
|
188
|
-
const
|
|
172
|
+
const W = (t, e) => {
|
|
189
173
|
let n = 0, i = 0;
|
|
190
|
-
for (;
|
|
191
|
-
n +=
|
|
174
|
+
for (; e && e !== t; )
|
|
175
|
+
n += e.offsetLeft, i += e.offsetTop, e = e.offsetParent;
|
|
192
176
|
return { offsetLeft: n, offsetTop: i };
|
|
193
|
-
},
|
|
194
|
-
for (const n in
|
|
195
|
-
|
|
196
|
-
},
|
|
177
|
+
}, N = (t, e) => {
|
|
178
|
+
for (const n in e)
|
|
179
|
+
t.setAttribute(n, e[n]);
|
|
180
|
+
}, D = {
|
|
197
181
|
moved: !1,
|
|
198
182
|
// diffrentiate click and move
|
|
199
183
|
mousedown: !1,
|
|
200
184
|
lastX: 0,
|
|
201
185
|
lastY: 0,
|
|
202
|
-
onMove(
|
|
186
|
+
onMove(t, e) {
|
|
203
187
|
if (this.mousedown) {
|
|
204
188
|
if (this.moved = !0, !this.lastX) {
|
|
205
|
-
this.lastX =
|
|
189
|
+
this.lastX = t.pageX, this.lastY = t.pageY;
|
|
206
190
|
return;
|
|
207
191
|
}
|
|
208
|
-
const n = this.lastX -
|
|
209
|
-
|
|
192
|
+
const n = this.lastX - t.pageX, i = this.lastY - t.pageY;
|
|
193
|
+
e.scrollTo(e.scrollLeft + n, e.scrollTop + i), this.lastX = t.pageX, this.lastY = t.pageY;
|
|
210
194
|
}
|
|
211
195
|
},
|
|
212
196
|
clear() {
|
|
213
197
|
this.moved = !1, this.mousedown = !1, this.lastX = 0, this.lastY = 0;
|
|
214
198
|
}
|
|
215
|
-
},
|
|
216
|
-
function
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
j.clear();
|
|
199
|
+
}, ue = (t) => t.tagName === "ME-TPC";
|
|
200
|
+
function st(t) {
|
|
201
|
+
t.map.addEventListener("click", (e) => {
|
|
202
|
+
if (D.moved) {
|
|
203
|
+
D.clear();
|
|
221
204
|
return;
|
|
222
205
|
}
|
|
223
|
-
|
|
224
|
-
const n =
|
|
206
|
+
t.unselectNode(), t.unselectNodes(), t.unselectSummary();
|
|
207
|
+
const n = e.target;
|
|
225
208
|
if (n.tagName === "ME-EPD")
|
|
226
|
-
|
|
227
|
-
else if (
|
|
228
|
-
|
|
209
|
+
t.expandNode(n.previousSibling);
|
|
210
|
+
else if (t.editable)
|
|
211
|
+
ue(n) ? t.selectNode(n, !1, e) : n.tagName === "text" ? n.dataset.type === "custom-link" ? t.selectLink(n.parentElement) : t.selectSummary(n.parentElement) : n.className === "circle" || t.hideLinkController && t.hideLinkController();
|
|
229
212
|
else
|
|
230
213
|
return;
|
|
231
|
-
}),
|
|
232
|
-
if (
|
|
214
|
+
}), t.map.addEventListener("dblclick", (e) => {
|
|
215
|
+
if (e.preventDefault(), !t.editable)
|
|
233
216
|
return;
|
|
234
|
-
const n =
|
|
235
|
-
|
|
236
|
-
}),
|
|
237
|
-
|
|
238
|
-
}),
|
|
239
|
-
|
|
240
|
-
}),
|
|
241
|
-
console.log(
|
|
242
|
-
}),
|
|
243
|
-
|
|
217
|
+
const n = e.target;
|
|
218
|
+
ue(n) ? t.beginEdit(n) : n.tagName === "text" && (n.dataset.type === "custom-link" ? t.editCutsomLinkLabel(n.parentElement) : t.editSummary(n.parentElement));
|
|
219
|
+
}), t.map.addEventListener("mousemove", (e) => {
|
|
220
|
+
e.target.contentEditable !== "true" && D.onMove(e, t.container);
|
|
221
|
+
}), t.map.addEventListener("mousedown", (e) => {
|
|
222
|
+
e.button === 2 && e.target.contentEditable !== "true" && (D.moved = !1, D.mousedown = !0);
|
|
223
|
+
}), t.map.addEventListener("mouseleave", (e) => {
|
|
224
|
+
console.log(e.button), e.button === 2 && D.clear();
|
|
225
|
+
}), t.map.addEventListener("mouseup", (e) => {
|
|
226
|
+
e.button === 2 && D.clear();
|
|
244
227
|
});
|
|
245
228
|
}
|
|
246
|
-
const
|
|
229
|
+
const rt = {
|
|
247
230
|
create() {
|
|
248
231
|
return {
|
|
249
232
|
handlers: {},
|
|
250
233
|
showHandler: function() {
|
|
251
234
|
console.log(this.handlers);
|
|
252
235
|
},
|
|
253
|
-
addListener: function(
|
|
254
|
-
this.handlers[
|
|
236
|
+
addListener: function(t, e) {
|
|
237
|
+
this.handlers[t] === void 0 && (this.handlers[t] = []), this.handlers[t].push(e);
|
|
255
238
|
},
|
|
256
|
-
fire: function(
|
|
257
|
-
if (this.handlers[
|
|
258
|
-
const n = this.handlers[
|
|
239
|
+
fire: function(t, ...e) {
|
|
240
|
+
if (this.handlers[t] instanceof Array) {
|
|
241
|
+
const n = this.handlers[t];
|
|
259
242
|
for (let i = 0; i < n.length; i++)
|
|
260
|
-
n[i](...
|
|
243
|
+
n[i](...e);
|
|
261
244
|
}
|
|
262
245
|
},
|
|
263
|
-
removeListener: function(
|
|
264
|
-
if (!this.handlers[
|
|
246
|
+
removeListener: function(t, e) {
|
|
247
|
+
if (!this.handlers[t])
|
|
265
248
|
return;
|
|
266
|
-
const n = this.handlers[
|
|
267
|
-
if (!
|
|
249
|
+
const n = this.handlers[t];
|
|
250
|
+
if (!e)
|
|
268
251
|
n.length = 0;
|
|
269
252
|
else if (n.length)
|
|
270
253
|
for (let i = 0; i < n.length; i++)
|
|
271
|
-
n[i] ===
|
|
254
|
+
n[i] === e && this.handlers[t].splice(i, 1);
|
|
272
255
|
}
|
|
273
256
|
};
|
|
274
257
|
}
|
|
275
|
-
},
|
|
258
|
+
}, te = document, lt = function() {
|
|
276
259
|
console.time("layout"), this.nodes.innerHTML = "";
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
const
|
|
280
|
-
|
|
260
|
+
const t = this.createTopic(this.nodeData);
|
|
261
|
+
ae(t, this.nodeData), t.draggable = !1;
|
|
262
|
+
const e = te.createElement("me-root");
|
|
263
|
+
e.appendChild(t);
|
|
281
264
|
const n = this.nodeData.children || [];
|
|
282
|
-
if (this.direction ===
|
|
283
|
-
let i = 0,
|
|
284
|
-
n.map((
|
|
285
|
-
|
|
265
|
+
if (this.direction === K) {
|
|
266
|
+
let i = 0, o = 0;
|
|
267
|
+
n.map((s) => {
|
|
268
|
+
s.direction === S ? i += 1 : s.direction === H ? o += 1 : i <= o ? (s.direction = S, i += 1) : (s.direction = H, o += 1);
|
|
286
269
|
});
|
|
287
270
|
}
|
|
288
|
-
|
|
289
|
-
},
|
|
290
|
-
const i =
|
|
271
|
+
ct(this, n, e), console.timeEnd("layout");
|
|
272
|
+
}, ct = function(t, e, n) {
|
|
273
|
+
const i = te.createElement("me-main");
|
|
291
274
|
i.className = "lhs";
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
for (let
|
|
295
|
-
const r =
|
|
296
|
-
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
},
|
|
300
|
-
const n =
|
|
301
|
-
for (let i = 0; i <
|
|
302
|
-
const
|
|
303
|
-
n.appendChild(
|
|
275
|
+
const o = te.createElement("me-main");
|
|
276
|
+
o.className = "rhs";
|
|
277
|
+
for (let s = 0; s < e.length; s++) {
|
|
278
|
+
const r = e[s], { grp: l } = t.createWrapper(r);
|
|
279
|
+
t.direction === K ? r.direction === S ? i.appendChild(l) : o.appendChild(l) : t.direction === S ? i.appendChild(l) : o.appendChild(l);
|
|
280
|
+
}
|
|
281
|
+
t.nodes.appendChild(i), t.nodes.appendChild(n), t.nodes.appendChild(o), t.nodes.appendChild(t.lines);
|
|
282
|
+
}, at = function(t, e) {
|
|
283
|
+
const n = te.createElement("me-children");
|
|
284
|
+
for (let i = 0; i < e.length; i++) {
|
|
285
|
+
const o = e[i], { grp: s } = t.createWrapper(o);
|
|
286
|
+
n.appendChild(s);
|
|
304
287
|
}
|
|
305
288
|
return n;
|
|
306
|
-
},
|
|
307
|
-
if (
|
|
308
|
-
const n =
|
|
289
|
+
}, k = document, E = (t, e) => (e ? e.mindElixirBox : k).querySelector(`[data-nodeid=me${t}]`), ae = function(t, e) {
|
|
290
|
+
if (t.textContent = e.topic, e.style && (t.style.color = e.style.color || "", t.style.background = e.style.background || "", t.style.fontSize = e.style.fontSize + "px", t.style.fontWeight = e.style.fontWeight || "normal"), e.image) {
|
|
291
|
+
const n = e.image;
|
|
309
292
|
if (n.url && n.width && n.height) {
|
|
310
|
-
const i =
|
|
311
|
-
i.src = n.url, i.style.width = n.width + "px", i.style.height = n.height + "px",
|
|
293
|
+
const i = k.createElement("img");
|
|
294
|
+
i.src = n.url, i.style.width = n.width + "px", i.style.height = n.height + "px", t.appendChild(i), t.image = i;
|
|
312
295
|
} else
|
|
313
296
|
console.warn("image url/width/height are required");
|
|
314
297
|
}
|
|
315
|
-
if (
|
|
316
|
-
const n =
|
|
317
|
-
n.className = "hyper-link", n.target = "_blank", n.innerText = "🔗", n.href =
|
|
298
|
+
if (e.hyperLink) {
|
|
299
|
+
const n = k.createElement("a");
|
|
300
|
+
n.className = "hyper-link", n.target = "_blank", n.innerText = "🔗", n.href = e.hyperLink, t.appendChild(n), t.linkContainer = n;
|
|
318
301
|
} else
|
|
319
|
-
|
|
320
|
-
if (
|
|
321
|
-
const n =
|
|
322
|
-
n.className = "icons", n.innerHTML =
|
|
323
|
-
}
|
|
324
|
-
if (
|
|
325
|
-
const n =
|
|
326
|
-
n.className = "tags", n.innerHTML =
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
},
|
|
330
|
-
const n =
|
|
331
|
-
if (n.appendChild(i), !
|
|
332
|
-
const
|
|
333
|
-
if (i.appendChild(
|
|
334
|
-
const r =
|
|
302
|
+
t.linkContainer && (t.linkContainer.remove(), t.linkContainer = null);
|
|
303
|
+
if (e.icons && e.icons.length) {
|
|
304
|
+
const n = k.createElement("span");
|
|
305
|
+
n.className = "icons", n.innerHTML = e.icons.map((i) => `<span>${ee(i)}</span>`).join(""), t.appendChild(n), t.icons = n;
|
|
306
|
+
}
|
|
307
|
+
if (e.tags && e.tags.length) {
|
|
308
|
+
const n = k.createElement("div");
|
|
309
|
+
n.className = "tags", n.innerHTML = e.tags.map((i) => `<span>${ee(i)}</span>`).join(""), t.appendChild(n), t.tags = n;
|
|
310
|
+
}
|
|
311
|
+
e.branchColor && (t.style.borderColor = e.branchColor);
|
|
312
|
+
}, dt = function(t, e) {
|
|
313
|
+
const n = k.createElement("me-wrapper"), { p: i, tpc: o } = this.createParent(t);
|
|
314
|
+
if (n.appendChild(i), !e && t.children && t.children.length > 0) {
|
|
315
|
+
const s = oe(t.expanded);
|
|
316
|
+
if (i.appendChild(s), t.expanded !== !1) {
|
|
317
|
+
const r = at(this, t.children);
|
|
335
318
|
n.appendChild(r);
|
|
336
319
|
}
|
|
337
320
|
}
|
|
338
|
-
return { grp: n, top: i, tpc:
|
|
339
|
-
},
|
|
340
|
-
const
|
|
341
|
-
return
|
|
342
|
-
},
|
|
343
|
-
const
|
|
344
|
-
return
|
|
345
|
-
},
|
|
346
|
-
const
|
|
347
|
-
return
|
|
321
|
+
return { grp: n, top: i, tpc: o };
|
|
322
|
+
}, ht = function(t) {
|
|
323
|
+
const e = k.createElement("me-parent"), n = this.createTopic(t);
|
|
324
|
+
return ae(n, t), e.appendChild(n), { p: e, tpc: n };
|
|
325
|
+
}, ut = function(t) {
|
|
326
|
+
const e = k.createElement("me-children");
|
|
327
|
+
return e.append(...t), e;
|
|
328
|
+
}, ft = function(t) {
|
|
329
|
+
const e = k.createElement("me-tpc");
|
|
330
|
+
return e.nodeObj = t, e.dataset.nodeid = "me" + t.id, e.draggable = this.draggable, e;
|
|
348
331
|
};
|
|
349
|
-
function
|
|
350
|
-
const
|
|
351
|
-
|
|
332
|
+
function Oe(t) {
|
|
333
|
+
const e = k.createRange();
|
|
334
|
+
e.selectNodeContents(t);
|
|
352
335
|
const n = window.getSelection();
|
|
353
|
-
n && (n.removeAllRanges(), n.addRange(
|
|
336
|
+
n && (n.removeAllRanges(), n.addRange(e));
|
|
354
337
|
}
|
|
355
|
-
const
|
|
356
|
-
if (console.time("editTopic"), !
|
|
338
|
+
const pt = function(t) {
|
|
339
|
+
if (console.time("editTopic"), !t)
|
|
357
340
|
return;
|
|
358
|
-
const
|
|
359
|
-
|
|
341
|
+
const e = k.createElement("div"), n = t.childNodes[0].textContent;
|
|
342
|
+
t.appendChild(e), e.id = "input-box", e.textContent = n, e.contentEditable = "true", e.spellcheck = !1, e.style.cssText = `min-width:${t.offsetWidth - 8}px;`, this.direction === S && (e.style.right = "0"), e.focus(), Oe(e), this.bus.fire("operation", {
|
|
360
343
|
name: "beginEdit",
|
|
361
|
-
obj:
|
|
362
|
-
}),
|
|
344
|
+
obj: t.nodeObj
|
|
345
|
+
}), e.addEventListener("keydown", (i) => {
|
|
363
346
|
i.stopPropagation();
|
|
364
|
-
const
|
|
365
|
-
if (
|
|
347
|
+
const o = i.key;
|
|
348
|
+
if (o === "Enter" || o === "Tab") {
|
|
366
349
|
if (i.shiftKey)
|
|
367
350
|
return;
|
|
368
|
-
i.preventDefault(),
|
|
351
|
+
i.preventDefault(), e == null || e.blur(), this.map.focus();
|
|
369
352
|
}
|
|
370
|
-
}),
|
|
371
|
-
var
|
|
372
|
-
if (!
|
|
353
|
+
}), e.addEventListener("blur", () => {
|
|
354
|
+
var s;
|
|
355
|
+
if (!e)
|
|
373
356
|
return;
|
|
374
|
-
const i =
|
|
375
|
-
console.log(
|
|
357
|
+
const i = t.nodeObj, o = ((s = e.textContent) == null ? void 0 : s.trim()) || "";
|
|
358
|
+
console.log(o), o === "" ? i.topic = n : i.topic = o, e.remove(), o !== n && (t.childNodes[0].textContent = i.topic, this.linkDiv(), this.bus.fire("operation", {
|
|
376
359
|
name: "finishEdit",
|
|
377
360
|
obj: i,
|
|
378
361
|
origin: n
|
|
379
362
|
}));
|
|
380
363
|
}), console.timeEnd("editTopic");
|
|
381
|
-
},
|
|
382
|
-
const
|
|
383
|
-
return
|
|
384
|
-
},
|
|
385
|
-
const n =
|
|
386
|
-
return n.setAttribute("d",
|
|
387
|
-
}, X = function(
|
|
388
|
-
const
|
|
389
|
-
return
|
|
390
|
-
},
|
|
391
|
-
const
|
|
392
|
-
return
|
|
393
|
-
},
|
|
394
|
-
const n =
|
|
395
|
-
return n.setAttribute("d",
|
|
396
|
-
},
|
|
397
|
-
const n =
|
|
398
|
-
|
|
364
|
+
}, oe = function(t) {
|
|
365
|
+
const e = k.createElement("me-epd");
|
|
366
|
+
return e.expanded = t !== !1, e.className = t !== !1 ? "minus" : "", e;
|
|
367
|
+
}, z = document, R = "http://www.w3.org/2000/svg", mt = function(t, e) {
|
|
368
|
+
const n = z.createElementNS(R, "path");
|
|
369
|
+
return n.setAttribute("d", t), n.setAttribute("stroke", e || "#666"), n.setAttribute("fill", "none"), n.setAttribute("stroke-width", "3"), n;
|
|
370
|
+
}, X = function(t) {
|
|
371
|
+
const e = z.createElementNS(R, "svg");
|
|
372
|
+
return e.setAttribute("class", t), e.setAttribute("overflow", "visible"), e;
|
|
373
|
+
}, fe = function() {
|
|
374
|
+
const t = z.createElementNS(R, "line");
|
|
375
|
+
return t.setAttribute("stroke", "#bbb"), t.setAttribute("fill", "none"), t.setAttribute("stroke-width", "2"), t;
|
|
376
|
+
}, gt = function(t, e) {
|
|
377
|
+
const n = z.createElementNS(R, "path");
|
|
378
|
+
return n.setAttribute("d", t), n.setAttribute("stroke", e || "#555"), n.setAttribute("fill", "none"), n.setAttribute("stroke-linecap", "square"), n.setAttribute("stroke-width", "2"), n;
|
|
379
|
+
}, vt = function(t, e) {
|
|
380
|
+
const n = {
|
|
381
|
+
stroke: "rgb(235, 95, 82)",
|
|
382
|
+
fill: "none",
|
|
383
|
+
"stroke-linecap": "cap",
|
|
384
|
+
"stroke-width": "2"
|
|
385
|
+
}, i = z.createElementNS(R, "g"), o = z.createElementNS(R, "path"), s = z.createElementNS(R, "path");
|
|
386
|
+
return N(s, {
|
|
387
|
+
d: e,
|
|
388
|
+
...n
|
|
389
|
+
}), N(o, {
|
|
390
|
+
d: t,
|
|
391
|
+
...n,
|
|
392
|
+
"stroke-dasharray": "8,2"
|
|
393
|
+
}), i.appendChild(o), i.appendChild(s), i;
|
|
394
|
+
}, Ae = function(t, e, n) {
|
|
395
|
+
if (console.time("editSummary"), !e)
|
|
396
|
+
return;
|
|
397
|
+
const i = document.createElement("div");
|
|
398
|
+
t.nodes.appendChild(i);
|
|
399
|
+
const o = e.innerHTML;
|
|
400
|
+
i.id = "input-box", i.textContent = o, i.contentEditable = "true", i.spellcheck = !1;
|
|
401
|
+
const s = e.getAttribute("x") + "px", r = e.getAttribute("y") + "px";
|
|
402
|
+
i.style.cssText = `min-width:${100 - 8}px;position:absolute;left:${s};top:${r};`;
|
|
403
|
+
const l = e.getAttribute("text-anchor");
|
|
404
|
+
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) => {
|
|
405
|
+
c.stopPropagation();
|
|
406
|
+
const h = c.key;
|
|
407
|
+
if (h === "Enter" || h === "Tab") {
|
|
408
|
+
if (c.shiftKey)
|
|
409
|
+
return;
|
|
410
|
+
c.preventDefault(), i.blur(), t.map.focus();
|
|
411
|
+
}
|
|
412
|
+
}), i.addEventListener("blur", () => {
|
|
413
|
+
i && n(i);
|
|
414
|
+
}), console.timeEnd("editSummary");
|
|
399
415
|
};
|
|
400
|
-
let
|
|
401
|
-
const
|
|
416
|
+
let Pe = He;
|
|
417
|
+
const bt = function(t) {
|
|
402
418
|
console.time("linkDiv");
|
|
403
|
-
const
|
|
404
|
-
this.nodes.style.top = `${1e4 - this.nodes.offsetHeight / 2}px`, this.nodes.style.left = `${1e4 -
|
|
419
|
+
const e = this.map.querySelector("me-root");
|
|
420
|
+
this.nodes.style.top = `${1e4 - this.nodes.offsetHeight / 2}px`, this.nodes.style.left = `${1e4 - e.offsetLeft - e.offsetWidth / 2}px`;
|
|
405
421
|
const n = this.map.querySelectorAll("me-main > me-wrapper");
|
|
406
|
-
this.lines.innerHTML = "",
|
|
422
|
+
this.lines.innerHTML = "", Pe = this.subLinkStyle === 2 ? wt : He;
|
|
407
423
|
for (let i = 0; i < n.length; i++) {
|
|
408
|
-
const
|
|
409
|
-
let c =
|
|
410
|
-
const
|
|
411
|
-
let
|
|
412
|
-
const
|
|
413
|
-
l === "lhs" ?
|
|
424
|
+
const o = n[i], s = o.querySelector("me-tpc"), r = o.firstChild, l = o.parentNode.className;
|
|
425
|
+
let c = e.offsetLeft + e.offsetWidth / 2;
|
|
426
|
+
const h = e.offsetTop + e.offsetHeight / 2;
|
|
427
|
+
let a;
|
|
428
|
+
const u = this.theme.palette, d = s.nodeObj.branchColor || u[i % u.length], { offsetLeft: p, offsetTop: g } = W(this.nodes, r);
|
|
429
|
+
l === "lhs" ? a = p + r.offsetWidth : a = p;
|
|
414
430
|
const m = g + r.offsetHeight / 2;
|
|
415
431
|
let f = "";
|
|
416
432
|
if (this.mainLinkStyle === 2)
|
|
417
|
-
this.direction ===
|
|
433
|
+
this.direction === K && (l === "lhs" ? c = c - e.offsetWidth / 6 : c = c + e.offsetWidth / 6), f = yt({ x1: c, y1: h, x2: a, y2: m });
|
|
418
434
|
else {
|
|
419
|
-
const
|
|
420
|
-
l === "lhs" ? c = c -
|
|
435
|
+
const b = (1 - Math.abs(m - o.parentElement.offsetTop - o.parentElement.offsetHeight / 2) / o.parentElement.offsetHeight) * 0.25 * (e.offsetWidth / 2);
|
|
436
|
+
l === "lhs" ? c = c - e.offsetWidth / 10 - b : c = c + e.offsetWidth / 10 + b, f = xt({ x1: c, y1: h, x2: a, y2: m });
|
|
421
437
|
}
|
|
422
|
-
this.lines.appendChild(
|
|
423
|
-
const
|
|
424
|
-
if (
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
-
const y =
|
|
428
|
-
|
|
438
|
+
this.lines.appendChild(mt(f, d));
|
|
439
|
+
const v = o.children[0].children[1];
|
|
440
|
+
if (v && (v.style.top = (v.parentNode.offsetHeight - v.offsetHeight) / 2 + "px", l === "lhs" ? v.style.left = "-10px" : v.style.right = "-10px"), !(t && t !== o) && o.childElementCount) {
|
|
441
|
+
const x = X("subLines"), b = o.lastChild;
|
|
442
|
+
b.tagName === "svg" && b.remove(), o.appendChild(x);
|
|
443
|
+
const y = o.firstChild, C = o.children[1].children, _ = je(C, y, l, !0);
|
|
444
|
+
x.appendChild(gt(_, d));
|
|
429
445
|
}
|
|
430
446
|
}
|
|
431
|
-
this.
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
const o = t.offsetTop, r = t.offsetLeft, l = t.offsetWidth, c = t.offsetHeight;
|
|
440
|
-
for (let u = 0; u < e.length; u++) {
|
|
441
|
-
const d = e[u], h = d.firstChild, a = h.offsetTop, p = h.offsetLeft, g = h.offsetWidth, m = h.offsetHeight;
|
|
442
|
-
s += Ae({ pT: o, pL: r, pW: l, pH: c, cT: a, cL: p, cW: g, cH: m, direction: n, isFirst: i });
|
|
443
|
-
const f = h.children[1];
|
|
447
|
+
this.renderCustomLink(), this.renderSummary(), console.timeEnd("linkDiv");
|
|
448
|
+
}, je = function(t, e, n, i) {
|
|
449
|
+
let o = "";
|
|
450
|
+
const s = e.offsetTop, r = e.offsetLeft, l = e.offsetWidth, c = e.offsetHeight;
|
|
451
|
+
for (let h = 0; h < t.length; h++) {
|
|
452
|
+
const a = t[h], u = a.firstChild, d = u.offsetTop, p = u.offsetLeft, g = u.offsetWidth, m = u.offsetHeight;
|
|
453
|
+
o += Pe({ pT: s, pL: r, pW: l, pH: c, cT: d, cL: p, cW: g, cH: m, direction: n, isFirst: i });
|
|
454
|
+
const f = u.children[1];
|
|
444
455
|
if (f) {
|
|
445
456
|
if (f.style.bottom = -(f.offsetHeight / 2) + "px", n === "lhs" ? f.style.left = "10px" : n === "rhs" && (f.style.right = "10px"), !f.expanded)
|
|
446
457
|
continue;
|
|
447
458
|
} else
|
|
448
459
|
continue;
|
|
449
|
-
const
|
|
450
|
-
|
|
460
|
+
const v = a.children[1].children;
|
|
461
|
+
v.length > 0 && (o += je(v, u, n));
|
|
451
462
|
}
|
|
452
|
-
return
|
|
463
|
+
return o;
|
|
453
464
|
};
|
|
454
|
-
function
|
|
455
|
-
return `M ${
|
|
465
|
+
function yt({ x1: t, y1: e, x2: n, y2: i }) {
|
|
466
|
+
return `M ${t} ${e} V ${i > e ? i - 20 : i + 20} C ${t} ${i} ${t} ${i} ${n > t ? t + 20 : t - 20} ${i} H ${n}`;
|
|
456
467
|
}
|
|
457
|
-
function
|
|
458
|
-
return `M ${
|
|
468
|
+
function xt({ x1: t, y1: e, x2: n, y2: i }) {
|
|
469
|
+
return `M ${t} ${e} Q ${t} ${i} ${n} ${i}`;
|
|
459
470
|
}
|
|
460
|
-
function
|
|
461
|
-
let
|
|
462
|
-
|
|
463
|
-
const
|
|
464
|
-
let
|
|
465
|
-
return c === "lhs" ? (
|
|
471
|
+
function wt({ pT: t, pL: e, pW: n, pH: i, cT: o, cL: s, cW: r, cH: l, direction: c, isFirst: h }) {
|
|
472
|
+
let a;
|
|
473
|
+
h ? a = t + i / 2 : a = t + i;
|
|
474
|
+
const u = o + l;
|
|
475
|
+
let d = 0, p = 0, g = 0;
|
|
476
|
+
return c === "lhs" ? (d = e + M, p = s, g = s + r) : c === "rhs" && (d = e + 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}`;
|
|
466
477
|
}
|
|
467
|
-
function
|
|
468
|
-
let
|
|
469
|
-
|
|
470
|
-
const
|
|
478
|
+
function He({ pT: t, pL: e, pW: n, pH: i, cT: o, cL: s, cW: r, cH: l, direction: c, isFirst: h }) {
|
|
479
|
+
let a = 0, u = 0;
|
|
480
|
+
h ? a = t + i / 2 : a = t + i;
|
|
481
|
+
const d = o + l;
|
|
471
482
|
let p = 0, g = 0, m = 0;
|
|
472
|
-
const f = Math.min(Math.abs(
|
|
473
|
-
return c === "lhs" ? (m =
|
|
483
|
+
const f = Math.min(Math.abs(a - d) / 800, 1.2) * M;
|
|
484
|
+
return c === "lhs" ? (m = e, p = m + M, g = m - M, u = s + M, `M ${p} ${a} C ${m} ${a} ${m + f} ${d} ${g} ${d} H ${u}`) : (m = e + n, p = m - M, g = m + M, u = s + r - M, `M ${p} ${a} C ${m} ${a} ${m - f} ${d} ${g} ${d} H ${u}`);
|
|
474
485
|
}
|
|
475
|
-
const
|
|
486
|
+
const pe = {
|
|
476
487
|
addChild: "插入子节点",
|
|
477
488
|
addParent: "插入父节点",
|
|
478
489
|
addSibling: "插入同级节点",
|
|
@@ -484,9 +495,9 @@ const he = {
|
|
|
484
495
|
link: "连接",
|
|
485
496
|
clickTips: "请点击目标节点",
|
|
486
497
|
summary: "摘要"
|
|
487
|
-
},
|
|
488
|
-
cn:
|
|
489
|
-
zh_CN:
|
|
498
|
+
}, me = {
|
|
499
|
+
cn: pe,
|
|
500
|
+
zh_CN: pe,
|
|
490
501
|
zh_TW: {
|
|
491
502
|
addChild: "插入子節點",
|
|
492
503
|
addParent: "插入父節點",
|
|
@@ -553,403 +564,416 @@ const he = {
|
|
|
553
564
|
summary: "Resumo"
|
|
554
565
|
}
|
|
555
566
|
};
|
|
556
|
-
function
|
|
557
|
-
const n = (
|
|
567
|
+
function Et(t, e) {
|
|
568
|
+
const n = (b) => {
|
|
558
569
|
const y = document.createElement("div");
|
|
559
|
-
return y.innerText =
|
|
560
|
-
}, i = (
|
|
570
|
+
return y.innerText = b, y.className = "tips", y;
|
|
571
|
+
}, i = (b, y, C) => {
|
|
561
572
|
const _ = document.createElement("li");
|
|
562
|
-
return _.id =
|
|
563
|
-
},
|
|
564
|
-
if (f.className = "menu-list", f.appendChild(r), f.appendChild(l), f.appendChild(c), f.appendChild(
|
|
565
|
-
for (let
|
|
566
|
-
const y =
|
|
567
|
-
f.appendChild(
|
|
573
|
+
return _.id = b, _.innerHTML = `<span>${ee(y)}</span><span>${ee(C)}</span>`, _;
|
|
574
|
+
}, o = me[t.locale] ? t.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");
|
|
575
|
+
if (f.className = "menu-list", f.appendChild(r), f.appendChild(l), f.appendChild(c), f.appendChild(h), (!e || e.focus) && (f.appendChild(a), f.appendChild(u)), f.appendChild(d), f.appendChild(p), f.appendChild(m), (!e || e.link) && f.appendChild(g), e && e.extend)
|
|
576
|
+
for (let b = 0; b < e.extend.length; b++) {
|
|
577
|
+
const y = e.extend[b], C = i(y.name, y.name, y.key || "");
|
|
578
|
+
f.appendChild(C), C.onclick = (_) => {
|
|
568
579
|
y.onclick(_);
|
|
569
580
|
};
|
|
570
581
|
}
|
|
571
|
-
const
|
|
572
|
-
|
|
573
|
-
let
|
|
574
|
-
|
|
575
|
-
if (
|
|
582
|
+
const v = document.createElement("div");
|
|
583
|
+
v.className = "context-menu", v.appendChild(f), v.hidden = !0, t.container.append(v);
|
|
584
|
+
let x = !0;
|
|
585
|
+
t.container.oncontextmenu = function(b) {
|
|
586
|
+
if (b.preventDefault(), !t.editable)
|
|
576
587
|
return;
|
|
577
|
-
const y =
|
|
588
|
+
const y = b.target;
|
|
578
589
|
if (y.tagName === "ME-TPC") {
|
|
579
|
-
y.parentElement.tagName === "ME-ROOT" ?
|
|
580
|
-
const
|
|
581
|
-
|
|
590
|
+
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 = ""), t.currentNodes || t.selectNode(y), v.hidden = !1;
|
|
591
|
+
const C = f.offsetHeight, _ = f.offsetWidth;
|
|
592
|
+
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");
|
|
582
593
|
}
|
|
583
|
-
},
|
|
584
|
-
|
|
594
|
+
}, v.onclick = (b) => {
|
|
595
|
+
b.target === v && (v.hidden = !0);
|
|
585
596
|
}, r.onclick = () => {
|
|
586
|
-
|
|
597
|
+
t.addChild(), v.hidden = !0;
|
|
587
598
|
}, l.onclick = () => {
|
|
588
|
-
|
|
599
|
+
t.insertParent(), v.hidden = !0;
|
|
589
600
|
}, c.onclick = () => {
|
|
590
|
-
|
|
591
|
-
}, u.onclick = () => {
|
|
592
|
-
N || (e.removeNode(), b.hidden = !0);
|
|
593
|
-
}, d.onclick = () => {
|
|
594
|
-
N || (e.focusNode(e.currentNode), b.hidden = !0);
|
|
601
|
+
x || (t.insertSibling(), v.hidden = !0);
|
|
595
602
|
}, h.onclick = () => {
|
|
596
|
-
|
|
603
|
+
x || (t.removeNode(), v.hidden = !0);
|
|
597
604
|
}, a.onclick = () => {
|
|
598
|
-
|
|
605
|
+
x || (t.focusNode(t.currentNode), v.hidden = !0);
|
|
606
|
+
}, u.onclick = () => {
|
|
607
|
+
t.cancelFocus(), v.hidden = !0;
|
|
608
|
+
}, d.onclick = () => {
|
|
609
|
+
x || (t.moveUpNode(), v.hidden = !0);
|
|
599
610
|
}, p.onclick = () => {
|
|
600
|
-
|
|
611
|
+
x || (t.moveDownNode(), v.hidden = !0);
|
|
601
612
|
}, g.onclick = () => {
|
|
602
|
-
|
|
603
|
-
const
|
|
604
|
-
|
|
613
|
+
v.hidden = !0;
|
|
614
|
+
const b = t.currentNode, y = n(s.clickTips);
|
|
615
|
+
t.container.appendChild(y), t.map.addEventListener(
|
|
605
616
|
"click",
|
|
606
|
-
(
|
|
607
|
-
|
|
608
|
-
const _ =
|
|
609
|
-
_.parentElement.tagName === "ME-PARENT" || _.parentElement.tagName === "ME-ROOT" ?
|
|
617
|
+
(C) => {
|
|
618
|
+
C.preventDefault(), y.remove();
|
|
619
|
+
const _ = C.target;
|
|
620
|
+
_.parentElement.tagName === "ME-PARENT" || _.parentElement.tagName === "ME-ROOT" ? t.createLink(b, _) : console.log("link cancel");
|
|
610
621
|
},
|
|
611
622
|
{
|
|
612
623
|
once: !0
|
|
613
624
|
}
|
|
614
625
|
);
|
|
615
626
|
}, m.onclick = () => {
|
|
616
|
-
|
|
627
|
+
v.hidden = !0, t.createSummary(), t.unselectNodes();
|
|
617
628
|
};
|
|
618
629
|
}
|
|
619
|
-
const Nt = (
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
},
|
|
623
|
-
const
|
|
624
|
-
|
|
625
|
-
},
|
|
626
|
-
|
|
630
|
+
const Nt = (t) => {
|
|
631
|
+
const e = t.map.querySelectorAll(".lhs>me-wrapper>me-parent>me-tpc");
|
|
632
|
+
t.selectNode(e[Math.ceil(e.length / 2) - 1]);
|
|
633
|
+
}, Ct = (t) => {
|
|
634
|
+
const e = t.map.querySelectorAll(".rhs>me-wrapper>me-parent>me-tpc");
|
|
635
|
+
t.selectNode(e[Math.ceil(e.length / 2) - 1]);
|
|
636
|
+
}, ge = (t) => {
|
|
637
|
+
t.selectNode(t.map.querySelector("me-root>me-tpc"));
|
|
627
638
|
};
|
|
628
|
-
function
|
|
629
|
-
const
|
|
639
|
+
function _t(t) {
|
|
640
|
+
const e = {
|
|
630
641
|
13: () => {
|
|
631
|
-
|
|
642
|
+
t.insertSibling();
|
|
632
643
|
},
|
|
633
644
|
9: () => {
|
|
634
|
-
|
|
645
|
+
t.addChild();
|
|
646
|
+
},
|
|
647
|
+
112: () => {
|
|
648
|
+
t.toCenter();
|
|
635
649
|
},
|
|
636
650
|
113: () => {
|
|
637
|
-
|
|
651
|
+
t.beginEdit();
|
|
638
652
|
},
|
|
639
|
-
38: () => {
|
|
640
|
-
|
|
653
|
+
38: (n) => {
|
|
654
|
+
if (n.metaKey || n.ctrlKey)
|
|
655
|
+
return t.initSide();
|
|
656
|
+
t.selectPrevSibling();
|
|
641
657
|
},
|
|
642
658
|
40: () => {
|
|
643
|
-
|
|
659
|
+
t.selectNextSibling();
|
|
644
660
|
},
|
|
645
|
-
37: () => {
|
|
661
|
+
37: (n) => {
|
|
646
662
|
var s;
|
|
647
|
-
if (
|
|
663
|
+
if (n.metaKey || n.ctrlKey)
|
|
664
|
+
return t.initLeft();
|
|
665
|
+
if (!t.currentNode)
|
|
648
666
|
return;
|
|
649
|
-
const
|
|
650
|
-
|
|
667
|
+
const i = t.currentNode.nodeObj, o = t.currentNode.offsetParent.offsetParent.parentElement;
|
|
668
|
+
t.currentNode.nodeObj.root ? Nt(t) : o.className === "rhs" ? (s = i.parent) != null && s.root ? ge(t) : t.selectParent() : o.className === "lhs" && t.selectFirstChild();
|
|
651
669
|
},
|
|
652
|
-
39: () => {
|
|
670
|
+
39: (n) => {
|
|
653
671
|
var s;
|
|
654
|
-
if (
|
|
672
|
+
if (n.metaKey || n.ctrlKey)
|
|
673
|
+
return t.initRight();
|
|
674
|
+
if (!t.currentNode)
|
|
655
675
|
return;
|
|
656
|
-
const
|
|
657
|
-
|
|
676
|
+
const i = t.currentNode.nodeObj, o = t.currentNode.offsetParent.offsetParent.parentElement;
|
|
677
|
+
i.root ? Ct(t) : o.className === "lhs" ? (s = i.parent) != null && s.root ? ge(t) : t.selectParent() : o.className === "rhs" && t.selectFirstChild();
|
|
658
678
|
},
|
|
659
679
|
33() {
|
|
660
|
-
|
|
680
|
+
t.moveUpNode();
|
|
661
681
|
},
|
|
662
682
|
34() {
|
|
663
|
-
|
|
683
|
+
t.moveDownNode();
|
|
664
684
|
},
|
|
665
685
|
67: (n) => {
|
|
666
|
-
(n.metaKey || n.ctrlKey) && (
|
|
686
|
+
(n.metaKey || n.ctrlKey) && (t.waitCopy = t.currentNode);
|
|
667
687
|
},
|
|
668
688
|
86: (n) => {
|
|
669
|
-
!
|
|
689
|
+
!t.waitCopy || !t.currentNode || (n.metaKey || n.ctrlKey) && (t.copyNode(t.waitCopy, t.currentNode), t.waitCopy = null);
|
|
670
690
|
},
|
|
671
691
|
// ctrl +
|
|
672
692
|
187: (n) => {
|
|
673
693
|
if (n.metaKey || n.ctrlKey) {
|
|
674
|
-
if (
|
|
694
|
+
if (t.scaleVal > 1.6)
|
|
675
695
|
return;
|
|
676
|
-
|
|
696
|
+
t.scale(t.scaleVal += 0.2);
|
|
677
697
|
}
|
|
678
698
|
},
|
|
679
699
|
// ctrl -
|
|
680
700
|
189: (n) => {
|
|
681
701
|
if (n.metaKey || n.ctrlKey) {
|
|
682
|
-
if (
|
|
702
|
+
if (t.scaleVal < 0.6)
|
|
683
703
|
return;
|
|
684
|
-
|
|
704
|
+
t.scale(t.scaleVal -= 0.2);
|
|
685
705
|
}
|
|
706
|
+
},
|
|
707
|
+
// ctrl 0
|
|
708
|
+
48: (n) => {
|
|
709
|
+
(n.metaKey || n.ctrlKey) && t.scale(1);
|
|
686
710
|
}
|
|
687
711
|
};
|
|
688
|
-
|
|
689
|
-
if (n.preventDefault(), !!
|
|
712
|
+
t.map.onkeydown = (n) => {
|
|
713
|
+
if (n.preventDefault(), !!t.editable && n.target === n.currentTarget)
|
|
690
714
|
if (n.keyCode === 8 || n.keyCode === 46)
|
|
691
|
-
|
|
715
|
+
t.currentLink ? t.removeLink() : t.currentSummary ? t.removeSummary(t.currentSummary.summaryObj.id) : t.removeNode();
|
|
692
716
|
else {
|
|
693
|
-
const i =
|
|
717
|
+
const i = e[n.keyCode];
|
|
694
718
|
i && i(n);
|
|
695
719
|
}
|
|
696
720
|
};
|
|
697
721
|
}
|
|
698
|
-
function
|
|
699
|
-
const n = (
|
|
722
|
+
function kt(t, e) {
|
|
723
|
+
const n = (d, p) => {
|
|
700
724
|
const g = document.createElement("div");
|
|
701
|
-
return g.id =
|
|
725
|
+
return g.id = d, g.innerHTML = `<svg class="icon" aria-hidden="true">
|
|
702
726
|
<use xlink:href="#icon-${p}"></use>
|
|
703
727
|
</svg>`, g;
|
|
704
|
-
}, i = n("cm-add_child", "zijiedian"),
|
|
705
|
-
if (
|
|
706
|
-
for (let
|
|
707
|
-
const p =
|
|
708
|
-
|
|
728
|
+
}, 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");
|
|
729
|
+
if (h.className = "menu-list", e && e.extend)
|
|
730
|
+
for (let d = 0; d < e.extend.length; d++) {
|
|
731
|
+
const p = e.extend[d], g = n(p.name, p.name);
|
|
732
|
+
h.appendChild(g), g.onclick = (m) => {
|
|
709
733
|
p.onclick(m);
|
|
710
734
|
};
|
|
711
735
|
}
|
|
712
|
-
const
|
|
713
|
-
|
|
714
|
-
let
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
}),
|
|
718
|
-
|
|
719
|
-
}),
|
|
720
|
-
|
|
736
|
+
const a = document.createElement("mmenu");
|
|
737
|
+
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, t.container.append(a);
|
|
738
|
+
let u = !0;
|
|
739
|
+
t.bus.addListener("unselectNode", function() {
|
|
740
|
+
a.hidden = !0;
|
|
741
|
+
}), t.bus.addListener("selectNode", function(d) {
|
|
742
|
+
a.hidden = !1, d.root ? u = !0 : u = !1;
|
|
743
|
+
}), a.onclick = (d) => {
|
|
744
|
+
d.target === a && (a.hidden = !0);
|
|
721
745
|
}, i.onclick = () => {
|
|
722
|
-
|
|
723
|
-
}, s.onclick = () => {
|
|
724
|
-
h || e.insertSibling();
|
|
746
|
+
t.addChild();
|
|
725
747
|
}, o.onclick = () => {
|
|
726
|
-
|
|
727
|
-
},
|
|
728
|
-
|
|
729
|
-
},
|
|
730
|
-
|
|
731
|
-
},
|
|
732
|
-
|
|
748
|
+
u || t.insertSibling();
|
|
749
|
+
}, s.onclick = () => {
|
|
750
|
+
u || t.removeNode();
|
|
751
|
+
}, r.onclick = (d) => {
|
|
752
|
+
u || t.moveUpNode();
|
|
753
|
+
}, l.onclick = (d) => {
|
|
754
|
+
u || t.moveDownNode();
|
|
755
|
+
}, c.onclick = (d) => {
|
|
756
|
+
t.beginEdit();
|
|
733
757
|
};
|
|
734
758
|
}
|
|
735
|
-
const
|
|
736
|
-
if (!
|
|
737
|
-
return
|
|
738
|
-
const n =
|
|
759
|
+
const le = document, St = function(t, e) {
|
|
760
|
+
if (!e)
|
|
761
|
+
return ce(t), t;
|
|
762
|
+
const n = t.getElementsByClassName("insert-preview"), i = `insert-preview ${e} show`;
|
|
739
763
|
if (n.length > 0)
|
|
740
764
|
n[0].className = i;
|
|
741
765
|
else {
|
|
742
|
-
const
|
|
743
|
-
|
|
766
|
+
const o = le.createElement("div");
|
|
767
|
+
o.className = i, t.appendChild(o);
|
|
744
768
|
}
|
|
745
|
-
return
|
|
746
|
-
},
|
|
747
|
-
if (!
|
|
769
|
+
return t;
|
|
770
|
+
}, ce = function(t) {
|
|
771
|
+
if (!t)
|
|
748
772
|
return;
|
|
749
|
-
const
|
|
750
|
-
for (const n of
|
|
773
|
+
const e = t.getElementsByClassName("insert-preview");
|
|
774
|
+
for (const n of e || [])
|
|
751
775
|
n.remove();
|
|
752
|
-
},
|
|
753
|
-
const n =
|
|
754
|
-
return
|
|
755
|
-
},
|
|
756
|
-
const
|
|
757
|
-
return
|
|
776
|
+
}, ve = function(t, e) {
|
|
777
|
+
const n = e.parentElement.parentElement.contains(t);
|
|
778
|
+
return t && t.tagName === "ME-TPC" && t !== e && !n && t.nodeObj.root !== !0;
|
|
779
|
+
}, Lt = function(t) {
|
|
780
|
+
const e = document.createElement("div");
|
|
781
|
+
return e.className = "mind-elixir-ghost", t.map.appendChild(e), e;
|
|
758
782
|
};
|
|
759
|
-
function
|
|
760
|
-
let
|
|
761
|
-
const
|
|
762
|
-
|
|
783
|
+
function Mt(t) {
|
|
784
|
+
let e = null, n = null, i = null;
|
|
785
|
+
const o = Lt(t), s = 12;
|
|
786
|
+
t.map.addEventListener("dragstart", (r) => {
|
|
763
787
|
var c;
|
|
764
788
|
const l = r.target;
|
|
765
789
|
if ((l == null ? void 0 : l.tagName) !== "ME-TPC") {
|
|
766
790
|
r.preventDefault();
|
|
767
791
|
return;
|
|
768
792
|
}
|
|
769
|
-
|
|
770
|
-
}),
|
|
771
|
-
if (!
|
|
793
|
+
e = l, e.parentElement.parentElement.style.opacity = "0.5", o.innerHTML = e.innerHTML, (c = r.dataTransfer) == null || c.setDragImage(o, 0, 0), D.clear();
|
|
794
|
+
}), t.map.addEventListener("dragend", async (r) => {
|
|
795
|
+
if (!e)
|
|
772
796
|
return;
|
|
773
|
-
|
|
797
|
+
e.parentElement.parentElement.style.opacity = "1";
|
|
774
798
|
const l = r.target;
|
|
775
799
|
if (l.style.opacity = "", !i)
|
|
776
800
|
return;
|
|
777
|
-
|
|
778
|
-
const c =
|
|
801
|
+
ce(i);
|
|
802
|
+
const c = e.nodeObj;
|
|
779
803
|
switch (n) {
|
|
780
804
|
case "before":
|
|
781
|
-
|
|
805
|
+
t.moveNodeBefore(e, i), t.selectNode(E(c.id));
|
|
782
806
|
break;
|
|
783
807
|
case "after":
|
|
784
|
-
|
|
808
|
+
t.moveNodeAfter(e, i), t.selectNode(E(c.id));
|
|
785
809
|
break;
|
|
786
810
|
case "in":
|
|
787
|
-
|
|
811
|
+
t.moveNode(e, i);
|
|
788
812
|
break;
|
|
789
813
|
}
|
|
790
|
-
|
|
791
|
-
}),
|
|
814
|
+
e = null;
|
|
815
|
+
}), t.map.addEventListener(
|
|
792
816
|
"dragover",
|
|
793
|
-
|
|
794
|
-
if (!
|
|
817
|
+
Ke(function(r) {
|
|
818
|
+
if (!e)
|
|
795
819
|
return;
|
|
796
|
-
|
|
797
|
-
const l =
|
|
798
|
-
if (
|
|
820
|
+
ce(i);
|
|
821
|
+
const l = le.elementFromPoint(r.clientX, r.clientY - s);
|
|
822
|
+
if (ve(l, e)) {
|
|
799
823
|
i = l;
|
|
800
824
|
const c = l.getBoundingClientRect().y;
|
|
801
825
|
r.clientY > c + l.clientHeight ? n = "after" : r.clientY > c + l.clientHeight / 2 && (n = "in");
|
|
802
826
|
} else {
|
|
803
|
-
const c =
|
|
804
|
-
if (
|
|
827
|
+
const c = le.elementFromPoint(r.clientX, r.clientY + s);
|
|
828
|
+
if (ve(c, e)) {
|
|
805
829
|
i = c;
|
|
806
|
-
const
|
|
807
|
-
r.clientY <
|
|
830
|
+
const h = c.getBoundingClientRect().y;
|
|
831
|
+
r.clientY < h ? n = "before" : r.clientY < h + c.clientHeight / 2 && (n = "in");
|
|
808
832
|
} else
|
|
809
833
|
n = i = null;
|
|
810
834
|
}
|
|
811
|
-
i &&
|
|
835
|
+
i && St(i, n);
|
|
812
836
|
}, 200)
|
|
813
837
|
);
|
|
814
838
|
}
|
|
815
|
-
function
|
|
816
|
-
let
|
|
817
|
-
|
|
818
|
-
if (
|
|
839
|
+
function Tt(t) {
|
|
840
|
+
let e = [], n = -1, i = t.getData();
|
|
841
|
+
t.bus.addListener("operation", (o) => {
|
|
842
|
+
if (o.name === "beginEdit")
|
|
819
843
|
return;
|
|
820
|
-
|
|
821
|
-
const
|
|
822
|
-
|
|
823
|
-
}),
|
|
844
|
+
e = e.slice(0, n + 1);
|
|
845
|
+
const s = t.getData();
|
|
846
|
+
e.push({ prev: i, currentNodeId: o.obj.id, next: s }), i = s, n = e.length - 1, console.log("operation", o.obj.id, e);
|
|
847
|
+
}), t.undo = function() {
|
|
824
848
|
if (n > -1) {
|
|
825
|
-
const
|
|
826
|
-
i =
|
|
849
|
+
const o = e[n];
|
|
850
|
+
i = o.prev, t.refresh(o.prev), t.selectNode(E(o.currentNodeId)), n--, console.log("current", i);
|
|
827
851
|
}
|
|
828
|
-
},
|
|
829
|
-
if (n <
|
|
852
|
+
}, t.redo = function() {
|
|
853
|
+
if (n < e.length - 1) {
|
|
830
854
|
n++;
|
|
831
|
-
const
|
|
832
|
-
i =
|
|
855
|
+
const o = e[n];
|
|
856
|
+
i = o.next, t.refresh(o.next), t.selectNode(E(o.currentNodeId));
|
|
833
857
|
}
|
|
834
|
-
},
|
|
835
|
-
(
|
|
858
|
+
}, t.map.addEventListener("keydown", (o) => {
|
|
859
|
+
(o.metaKey || o.ctrlKey) && o.shiftKey && o.key === "Z" ? t.redo() : (o.metaKey || o.ctrlKey) && o.key === "z" && t.undo();
|
|
836
860
|
});
|
|
837
861
|
}
|
|
838
|
-
const
|
|
862
|
+
const B = (t, e) => {
|
|
839
863
|
const n = document.createElement("span");
|
|
840
|
-
return n.id =
|
|
841
|
-
<use xlink:href="#icon-${
|
|
864
|
+
return n.id = t, n.innerHTML = `<svg class="icon" aria-hidden="true">
|
|
865
|
+
<use xlink:href="#icon-${e}"></use>
|
|
842
866
|
</svg>`, n;
|
|
843
867
|
};
|
|
844
|
-
function
|
|
845
|
-
const
|
|
846
|
-
return r.innerText = "100%",
|
|
847
|
-
|
|
868
|
+
function $t(t) {
|
|
869
|
+
const e = document.createElement("div"), n = B("fullscreen", "full"), i = B("toCenter", "living"), o = B("zoomout", "move"), s = B("zoomin", "add"), r = document.createElement("span");
|
|
870
|
+
return r.innerText = "100%", e.appendChild(n), e.appendChild(i), e.appendChild(o), e.appendChild(s), e.className = "mind-elixir-toolbar rb", n.onclick = () => {
|
|
871
|
+
t.container.requestFullscreen();
|
|
848
872
|
}, i.onclick = () => {
|
|
849
|
-
|
|
850
|
-
}, s.onclick = () => {
|
|
851
|
-
e.scaleVal < 0.6 || e.scale(e.scaleVal -= 0.2);
|
|
873
|
+
t.toCenter();
|
|
852
874
|
}, o.onclick = () => {
|
|
853
|
-
|
|
854
|
-
},
|
|
875
|
+
t.scaleVal < 0.6 || t.scale(t.scaleVal -= 0.2);
|
|
876
|
+
}, s.onclick = () => {
|
|
877
|
+
t.scaleVal > 1.6 || t.scale(t.scaleVal += 0.2);
|
|
878
|
+
}, e;
|
|
855
879
|
}
|
|
856
|
-
function
|
|
857
|
-
const
|
|
858
|
-
return
|
|
859
|
-
|
|
880
|
+
function Dt(t) {
|
|
881
|
+
const e = document.createElement("div"), n = B("tbltl", "left"), i = B("tbltr", "right"), o = B("tblts", "side");
|
|
882
|
+
return e.appendChild(n), e.appendChild(i), e.appendChild(o), e.className = "mind-elixir-toolbar lt", n.onclick = () => {
|
|
883
|
+
t.initLeft();
|
|
860
884
|
}, i.onclick = () => {
|
|
861
|
-
|
|
862
|
-
},
|
|
863
|
-
|
|
864
|
-
},
|
|
885
|
+
t.initRight();
|
|
886
|
+
}, o.onclick = () => {
|
|
887
|
+
t.initSide();
|
|
888
|
+
}, e;
|
|
865
889
|
}
|
|
866
|
-
function
|
|
867
|
-
|
|
890
|
+
function Ot(t) {
|
|
891
|
+
t.container.append($t(t)), t.container.append(Dt(t));
|
|
868
892
|
}
|
|
869
893
|
/*! @viselect/vanilla v3.3.1 MIT | https://github.com/Simonwep/selection/tree/master/packages/vanilla */
|
|
870
|
-
var
|
|
871
|
-
class
|
|
894
|
+
var At = Object.defineProperty, Pt = (t, e, n) => e in t ? At(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, w = (t, e, n) => (Pt(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
895
|
+
class jt {
|
|
872
896
|
constructor() {
|
|
873
|
-
|
|
897
|
+
w(this, "_listeners", /* @__PURE__ */ new Map()), w(this, "on", this.addEventListener), w(this, "off", this.removeEventListener), w(this, "emit", this.dispatchEvent);
|
|
874
898
|
}
|
|
875
|
-
addEventListener(
|
|
876
|
-
const i = this._listeners.get(
|
|
877
|
-
return this._listeners.set(
|
|
899
|
+
addEventListener(e, n) {
|
|
900
|
+
const i = this._listeners.get(e) ?? /* @__PURE__ */ new Set();
|
|
901
|
+
return this._listeners.set(e, i), i.add(n), this;
|
|
878
902
|
}
|
|
879
|
-
removeEventListener(
|
|
903
|
+
removeEventListener(e, n) {
|
|
880
904
|
var i;
|
|
881
|
-
return (i = this._listeners.get(
|
|
905
|
+
return (i = this._listeners.get(e)) == null || i.delete(n), this;
|
|
882
906
|
}
|
|
883
|
-
dispatchEvent(
|
|
907
|
+
dispatchEvent(e, ...n) {
|
|
884
908
|
let i = !0;
|
|
885
|
-
for (const
|
|
886
|
-
i =
|
|
909
|
+
for (const o of this._listeners.get(e) ?? [])
|
|
910
|
+
i = o(...n) !== !1 && i;
|
|
887
911
|
return i;
|
|
888
912
|
}
|
|
889
913
|
unbindAllListeners() {
|
|
890
914
|
this._listeners.clear();
|
|
891
915
|
}
|
|
892
916
|
}
|
|
893
|
-
const
|
|
894
|
-
function
|
|
895
|
-
if (typeof
|
|
896
|
-
for (const [i,
|
|
897
|
-
|
|
917
|
+
const be = (t, e = "px") => typeof t == "number" ? t + e : t;
|
|
918
|
+
function O({ style: t }, e, n) {
|
|
919
|
+
if (typeof e == "object")
|
|
920
|
+
for (const [i, o] of Object.entries(e))
|
|
921
|
+
o !== void 0 && (t[i] = be(o));
|
|
898
922
|
else
|
|
899
|
-
n !== void 0 && (e
|
|
923
|
+
n !== void 0 && (t[e] = be(n));
|
|
900
924
|
}
|
|
901
|
-
function
|
|
902
|
-
return (
|
|
903
|
-
|
|
904
|
-
for (const
|
|
925
|
+
function Be(t) {
|
|
926
|
+
return (e, n, i, o = {}) => {
|
|
927
|
+
e instanceof HTMLCollection || e instanceof NodeList ? e = Array.from(e) : Array.isArray(e) || (e = [e]), Array.isArray(n) || (n = [n]);
|
|
928
|
+
for (const s of e)
|
|
905
929
|
for (const r of n)
|
|
906
|
-
|
|
907
|
-
return [
|
|
930
|
+
s[t](r, i, { capture: !1, ...o });
|
|
931
|
+
return [e, n, i, o];
|
|
908
932
|
};
|
|
909
933
|
}
|
|
910
|
-
const
|
|
911
|
-
var
|
|
912
|
-
const { clientX: n, clientY: i, target:
|
|
913
|
-
return { x: n, y: i, target:
|
|
934
|
+
const q = Be("addEventListener"), A = Be("removeEventListener"), Q = (t) => {
|
|
935
|
+
var e;
|
|
936
|
+
const { clientX: n, clientY: i, target: o } = ((e = t.touches) == null ? void 0 : e[0]) ?? t;
|
|
937
|
+
return { x: n, y: i, target: o };
|
|
914
938
|
};
|
|
915
|
-
function
|
|
939
|
+
function ye(t, e, n = "touch") {
|
|
916
940
|
switch (n) {
|
|
917
941
|
case "center": {
|
|
918
|
-
const i =
|
|
919
|
-
return i >=
|
|
942
|
+
const i = e.left + e.width / 2, o = e.top + e.height / 2;
|
|
943
|
+
return i >= t.left && i <= t.right && o >= t.top && o <= t.bottom;
|
|
920
944
|
}
|
|
921
945
|
case "cover":
|
|
922
|
-
return
|
|
946
|
+
return e.left >= t.left && e.top >= t.top && e.right <= t.right && e.bottom <= t.bottom;
|
|
923
947
|
case "touch":
|
|
924
|
-
return
|
|
948
|
+
return t.right >= e.left && t.left <= e.right && t.bottom >= e.top && t.top <= e.bottom;
|
|
925
949
|
}
|
|
926
950
|
}
|
|
927
|
-
function
|
|
928
|
-
const n = Array.isArray(
|
|
951
|
+
function F(t, e = document) {
|
|
952
|
+
const n = Array.isArray(t) ? t : [t];
|
|
929
953
|
let i = [];
|
|
930
|
-
for (let
|
|
931
|
-
const r = n[
|
|
932
|
-
typeof r == "string" ? i = i.concat(Array.from(
|
|
954
|
+
for (let o = 0, s = n.length; o < s; o++) {
|
|
955
|
+
const r = n[o];
|
|
956
|
+
typeof r == "string" ? i = i.concat(Array.from(e.querySelectorAll(r))) : r instanceof Element && i.push(r);
|
|
933
957
|
}
|
|
934
958
|
return i;
|
|
935
959
|
}
|
|
936
|
-
const
|
|
937
|
-
let
|
|
960
|
+
const Ht = () => matchMedia("(hover: none), (pointer: coarse)").matches, Bt = () => "safari" in window, zt = (t) => {
|
|
961
|
+
let e, n = -1, i = !1;
|
|
938
962
|
return {
|
|
939
|
-
next(...
|
|
940
|
-
|
|
941
|
-
|
|
963
|
+
next(...o) {
|
|
964
|
+
e = o, i || (i = !0, n = requestAnimationFrame(() => {
|
|
965
|
+
t(...e), i = !1;
|
|
942
966
|
}));
|
|
943
967
|
},
|
|
944
968
|
cancel() {
|
|
945
969
|
cancelAnimationFrame(n), i = !1;
|
|
946
970
|
}
|
|
947
971
|
};
|
|
948
|
-
}, { abs:
|
|
949
|
-
class
|
|
950
|
-
constructor(
|
|
951
|
-
var n, i,
|
|
952
|
-
super(),
|
|
972
|
+
}, { abs: j, max: xe, min: we, ceil: Ee } = Math;
|
|
973
|
+
class ze extends jt {
|
|
974
|
+
constructor(e) {
|
|
975
|
+
var n, i, o, s, r;
|
|
976
|
+
super(), w(this, "_options"), w(this, "_selection", {
|
|
953
977
|
stored: [],
|
|
954
978
|
selected: [],
|
|
955
979
|
touched: [],
|
|
@@ -959,7 +983,7 @@ class De extends Ot {
|
|
|
959
983
|
removed: []
|
|
960
984
|
// Removed elements since last selection
|
|
961
985
|
}
|
|
962
|
-
}),
|
|
986
|
+
}), w(this, "_area"), w(this, "_clippingElement"), w(this, "_targetElement"), w(this, "_targetRect"), w(this, "_selectables", []), w(this, "_latestElement"), w(this, "_areaRect", new DOMRect()), w(this, "_areaLocation", { y1: 0, x2: 0, y2: 0, x1: 0 }), w(this, "_singleClick", !0), w(this, "_frame"), w(this, "_scrollAvailable", !0), w(this, "_scrollingActive", !1), w(this, "_scrollSpeed", { x: 0, y: 0 }), w(this, "_scrollDelta", { x: 0, y: 0 }), w(this, "disable", this._bindStartEvents.bind(this, !1)), w(this, "enable", this._bindStartEvents), this._options = {
|
|
963
987
|
selectionAreaClass: "selection-area",
|
|
964
988
|
selectionContainerClass: void 0,
|
|
965
989
|
selectables: [],
|
|
@@ -967,221 +991,221 @@ class De extends Ot {
|
|
|
967
991
|
startAreas: ["html"],
|
|
968
992
|
boundaries: ["html"],
|
|
969
993
|
container: "body",
|
|
970
|
-
...
|
|
994
|
+
...e,
|
|
971
995
|
behaviour: {
|
|
972
996
|
overlap: "invert",
|
|
973
997
|
intersect: "touch",
|
|
974
|
-
...
|
|
975
|
-
startThreshold: (n =
|
|
998
|
+
...e.behaviour,
|
|
999
|
+
startThreshold: (n = e.behaviour) != null && n.startThreshold ? typeof e.behaviour.startThreshold == "number" ? e.behaviour.startThreshold : { x: 10, y: 10, ...e.behaviour.startThreshold } : { x: 10, y: 10 },
|
|
976
1000
|
scrolling: {
|
|
977
1001
|
speedDivider: 10,
|
|
978
1002
|
manualSpeed: 750,
|
|
979
|
-
...(i =
|
|
1003
|
+
...(i = e.behaviour) == null ? void 0 : i.scrolling,
|
|
980
1004
|
startScrollMargins: {
|
|
981
1005
|
x: 0,
|
|
982
1006
|
y: 0,
|
|
983
|
-
...(
|
|
1007
|
+
...(s = (o = e.behaviour) == null ? void 0 : o.scrolling) == null ? void 0 : s.startScrollMargins
|
|
984
1008
|
}
|
|
985
1009
|
}
|
|
986
1010
|
},
|
|
987
1011
|
features: {
|
|
988
1012
|
range: !0,
|
|
989
1013
|
touch: !0,
|
|
990
|
-
...
|
|
1014
|
+
...e.features,
|
|
991
1015
|
singleTap: {
|
|
992
1016
|
allow: !0,
|
|
993
1017
|
intersect: "native",
|
|
994
|
-
...(r =
|
|
1018
|
+
...(r = e.features) == null ? void 0 : r.singleTap
|
|
995
1019
|
}
|
|
996
1020
|
}
|
|
997
1021
|
};
|
|
998
|
-
for (const
|
|
999
|
-
typeof this[
|
|
1000
|
-
const { document: l, selectionAreaClass: c, selectionContainerClass:
|
|
1001
|
-
this._area = l.createElement("div"), this._clippingElement = l.createElement("div"), this._clippingElement.appendChild(this._area), this._area.classList.add(c),
|
|
1022
|
+
for (const a of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))
|
|
1023
|
+
typeof this[a] == "function" && (this[a] = this[a].bind(this));
|
|
1024
|
+
const { document: l, selectionAreaClass: c, selectionContainerClass: h } = this._options;
|
|
1025
|
+
this._area = l.createElement("div"), this._clippingElement = l.createElement("div"), this._clippingElement.appendChild(this._area), this._area.classList.add(c), h && this._clippingElement.classList.add(h), O(this._area, {
|
|
1002
1026
|
willChange: "top, left, bottom, right, width, height",
|
|
1003
1027
|
top: 0,
|
|
1004
1028
|
left: 0,
|
|
1005
1029
|
position: "fixed"
|
|
1006
|
-
}),
|
|
1030
|
+
}), O(this._clippingElement, {
|
|
1007
1031
|
overflow: "hidden",
|
|
1008
1032
|
position: "fixed",
|
|
1009
1033
|
transform: "translate3d(0, 0, 0)",
|
|
1010
1034
|
// https://stackoverflow.com/a/38268846
|
|
1011
1035
|
pointerEvents: "none",
|
|
1012
1036
|
zIndex: "1"
|
|
1013
|
-
}), this._frame =
|
|
1014
|
-
this._recalculateSelectionAreaRect(), this._updateElementSelection(), this._emitEvent("move",
|
|
1037
|
+
}), this._frame = zt((a) => {
|
|
1038
|
+
this._recalculateSelectionAreaRect(), this._updateElementSelection(), this._emitEvent("move", a), this._redrawSelectionArea();
|
|
1015
1039
|
}), this.enable();
|
|
1016
1040
|
}
|
|
1017
|
-
_bindStartEvents(
|
|
1018
|
-
const { document: n, features: i } = this._options,
|
|
1019
|
-
|
|
1041
|
+
_bindStartEvents(e = !0) {
|
|
1042
|
+
const { document: n, features: i } = this._options, o = e ? q : A;
|
|
1043
|
+
o(n, "mousedown", this._onTapStart), i.touch && o(n, "touchstart", this._onTapStart, {
|
|
1020
1044
|
passive: !1
|
|
1021
1045
|
});
|
|
1022
1046
|
}
|
|
1023
|
-
_onTapStart(
|
|
1024
|
-
const { x: i, y:
|
|
1025
|
-
this._targetElement =
|
|
1026
|
-
(p) =>
|
|
1047
|
+
_onTapStart(e, n = !1) {
|
|
1048
|
+
const { x: i, y: o, target: s } = Q(e), { _options: r } = this, { document: l } = this._options, c = s.getBoundingClientRect(), h = F(r.startAreas, r.document), a = F(r.boundaries, r.document);
|
|
1049
|
+
this._targetElement = a.find(
|
|
1050
|
+
(p) => ye(p.getBoundingClientRect(), c)
|
|
1027
1051
|
);
|
|
1028
|
-
const
|
|
1029
|
-
if (!this._targetElement || !
|
|
1052
|
+
const u = e.composedPath();
|
|
1053
|
+
if (!this._targetElement || !h.find((p) => u.includes(p)) || !a.find((p) => u.includes(p)) || !n && this._emitEvent("beforestart", e) === !1)
|
|
1030
1054
|
return;
|
|
1031
|
-
this._areaLocation = { x1: i, y1:
|
|
1032
|
-
const
|
|
1033
|
-
this._scrollDelta = { x:
|
|
1055
|
+
this._areaLocation = { x1: i, y1: o, x2: 0, y2: 0 };
|
|
1056
|
+
const d = l.scrollingElement ?? l.body;
|
|
1057
|
+
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);
|
|
1034
1058
|
}
|
|
1035
|
-
_onSingleTap(
|
|
1036
|
-
const { singleTap: { intersect: n }, range: i } = this._options.features,
|
|
1037
|
-
let
|
|
1059
|
+
_onSingleTap(e) {
|
|
1060
|
+
const { singleTap: { intersect: n }, range: i } = this._options.features, o = Q(e);
|
|
1061
|
+
let s;
|
|
1038
1062
|
if (n === "native")
|
|
1039
|
-
|
|
1063
|
+
s = o.target;
|
|
1040
1064
|
else if (n === "touch") {
|
|
1041
1065
|
this.resolveSelectables();
|
|
1042
|
-
const { x: l, y: c } =
|
|
1043
|
-
|
|
1044
|
-
const { right:
|
|
1045
|
-
return l <
|
|
1066
|
+
const { x: l, y: c } = o;
|
|
1067
|
+
s = this._selectables.find((h) => {
|
|
1068
|
+
const { right: a, left: u, top: d, bottom: p } = h.getBoundingClientRect();
|
|
1069
|
+
return l < a && l > u && c < p && c > d;
|
|
1046
1070
|
});
|
|
1047
1071
|
}
|
|
1048
|
-
if (!
|
|
1072
|
+
if (!s)
|
|
1049
1073
|
return;
|
|
1050
|
-
for (this.resolveSelectables(); !this._selectables.includes(
|
|
1051
|
-
if (!
|
|
1074
|
+
for (this.resolveSelectables(); !this._selectables.includes(s); ) {
|
|
1075
|
+
if (!s.parentElement)
|
|
1052
1076
|
return;
|
|
1053
|
-
|
|
1077
|
+
s = s.parentElement;
|
|
1054
1078
|
}
|
|
1055
1079
|
const { stored: r } = this._selection;
|
|
1056
|
-
if (this._emitEvent("start",
|
|
1057
|
-
const l = this._latestElement, [c,
|
|
1058
|
-
(
|
|
1059
|
-
), c,
|
|
1060
|
-
this.select(
|
|
1080
|
+
if (this._emitEvent("start", e), e.shiftKey && i && this._latestElement) {
|
|
1081
|
+
const l = this._latestElement, [c, h] = l.compareDocumentPosition(s) & 4 ? [s, l] : [l, s], a = [...this._selectables.filter(
|
|
1082
|
+
(u) => u.compareDocumentPosition(c) & 4 && u.compareDocumentPosition(h) & 2
|
|
1083
|
+
), c, h];
|
|
1084
|
+
this.select(a), this._latestElement = l;
|
|
1061
1085
|
} else
|
|
1062
|
-
r.includes(
|
|
1063
|
-
this._emitEvent("stop",
|
|
1086
|
+
r.includes(s) && (r.length === 1 || e.ctrlKey || r.every((l) => this._selection.stored.includes(l))) ? this.deselect(s) : (this.select(s), this._latestElement = s);
|
|
1087
|
+
this._emitEvent("stop", e);
|
|
1064
1088
|
}
|
|
1065
|
-
_delayedTapMove(
|
|
1066
|
-
const { container: n, document: i, behaviour: { startThreshold:
|
|
1089
|
+
_delayedTapMove(e) {
|
|
1090
|
+
const { container: n, document: i, behaviour: { startThreshold: o } } = this._options, { x1: s, y1: r } = this._areaLocation, { x: l, y: c } = Q(e);
|
|
1067
1091
|
if (
|
|
1068
1092
|
// Single number for both coordinates
|
|
1069
|
-
typeof
|
|
1070
|
-
typeof
|
|
1093
|
+
typeof o == "number" && j(l + c - (s + r)) >= o || // Different x and y threshold
|
|
1094
|
+
typeof o == "object" && j(l - s) >= o.x || j(c - r) >= o.y
|
|
1071
1095
|
) {
|
|
1072
|
-
if (
|
|
1073
|
-
|
|
1096
|
+
if (A(i, ["mousemove", "touchmove"], this._delayedTapMove, { passive: !1 }), this._emitEvent("beforedrag", e) === !1) {
|
|
1097
|
+
A(i, ["mouseup", "touchcancel", "touchend"], this._onTapStop);
|
|
1074
1098
|
return;
|
|
1075
1099
|
}
|
|
1076
|
-
|
|
1100
|
+
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", e), this._onTapMove(e);
|
|
1077
1101
|
}
|
|
1078
|
-
this._handleMoveEvent(
|
|
1102
|
+
this._handleMoveEvent(e);
|
|
1079
1103
|
}
|
|
1080
1104
|
_setupSelectionArea() {
|
|
1081
|
-
const { _clippingElement:
|
|
1082
|
-
this._scrollAvailable ? (
|
|
1083
|
-
top:
|
|
1084
|
-
left:
|
|
1085
|
-
width:
|
|
1086
|
-
height:
|
|
1087
|
-
}),
|
|
1088
|
-
marginTop: -
|
|
1089
|
-
marginLeft: -
|
|
1090
|
-
})) : (
|
|
1105
|
+
const { _clippingElement: e, _targetElement: n, _area: i } = this, o = this._targetRect = n.getBoundingClientRect();
|
|
1106
|
+
this._scrollAvailable ? (O(e, {
|
|
1107
|
+
top: o.top,
|
|
1108
|
+
left: o.left,
|
|
1109
|
+
width: o.width,
|
|
1110
|
+
height: o.height
|
|
1111
|
+
}), O(i, {
|
|
1112
|
+
marginTop: -o.top,
|
|
1113
|
+
marginLeft: -o.left
|
|
1114
|
+
})) : (O(e, {
|
|
1091
1115
|
top: 0,
|
|
1092
1116
|
left: 0,
|
|
1093
1117
|
width: "100%",
|
|
1094
1118
|
height: "100%"
|
|
1095
|
-
}),
|
|
1119
|
+
}), O(i, {
|
|
1096
1120
|
marginTop: 0,
|
|
1097
1121
|
marginLeft: 0
|
|
1098
1122
|
}));
|
|
1099
1123
|
}
|
|
1100
|
-
_onTapMove(
|
|
1101
|
-
const { x: n, y: i } =
|
|
1102
|
-
if (
|
|
1124
|
+
_onTapMove(e) {
|
|
1125
|
+
const { x: n, y: i } = Q(e), { _scrollSpeed: o, _areaLocation: s, _options: r, _frame: l } = this, { speedDivider: c } = r.behaviour.scrolling, h = this._targetElement;
|
|
1126
|
+
if (s.x2 = n, s.y2 = i, this._scrollAvailable && !this._scrollingActive && (o.y || o.x)) {
|
|
1103
1127
|
this._scrollingActive = !0;
|
|
1104
|
-
const
|
|
1105
|
-
if (!
|
|
1128
|
+
const a = () => {
|
|
1129
|
+
if (!o.x && !o.y) {
|
|
1106
1130
|
this._scrollingActive = !1;
|
|
1107
1131
|
return;
|
|
1108
1132
|
}
|
|
1109
|
-
const { scrollTop:
|
|
1110
|
-
|
|
1133
|
+
const { scrollTop: u, scrollLeft: d } = h;
|
|
1134
|
+
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(e), requestAnimationFrame(a);
|
|
1111
1135
|
};
|
|
1112
|
-
requestAnimationFrame(
|
|
1136
|
+
requestAnimationFrame(a);
|
|
1113
1137
|
} else
|
|
1114
|
-
l.next(
|
|
1115
|
-
this._handleMoveEvent(
|
|
1138
|
+
l.next(e);
|
|
1139
|
+
this._handleMoveEvent(e);
|
|
1116
1140
|
}
|
|
1117
|
-
_handleMoveEvent(
|
|
1141
|
+
_handleMoveEvent(e) {
|
|
1118
1142
|
const { features: n } = this._options;
|
|
1119
|
-
(n.touch &&
|
|
1143
|
+
(n.touch && Ht() || this._scrollAvailable && Bt()) && e.preventDefault();
|
|
1120
1144
|
}
|
|
1121
1145
|
_onScroll() {
|
|
1122
|
-
const { _scrollDelta:
|
|
1123
|
-
this._areaLocation.x1 +=
|
|
1146
|
+
const { _scrollDelta: e, _options: { document: n } } = this, { scrollTop: i, scrollLeft: o } = n.scrollingElement ?? n.body;
|
|
1147
|
+
this._areaLocation.x1 += e.x - o, this._areaLocation.y1 += e.y - i, e.x = o, e.y = i, this._setupSelectionArea(), this._frame.next(null);
|
|
1124
1148
|
}
|
|
1125
|
-
_manualScroll(
|
|
1126
|
-
const { manualSpeed: n } = this._options.behaviour.scrolling, i =
|
|
1127
|
-
this._scrollSpeed.y += i * n, this._scrollSpeed.x +=
|
|
1149
|
+
_manualScroll(e) {
|
|
1150
|
+
const { manualSpeed: n } = this._options.behaviour.scrolling, i = e.deltaY ? e.deltaY > 0 ? 1 : -1 : 0, o = e.deltaX ? e.deltaX > 0 ? 1 : -1 : 0;
|
|
1151
|
+
this._scrollSpeed.y += i * n, this._scrollSpeed.x += o * n, this._onTapMove(e), e.preventDefault();
|
|
1128
1152
|
}
|
|
1129
1153
|
_recalculateSelectionAreaRect() {
|
|
1130
|
-
const { _scrollSpeed:
|
|
1154
|
+
const { _scrollSpeed: e, _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;
|
|
1131
1155
|
let { x2: m, y2: f } = n;
|
|
1132
|
-
const { behaviour: { scrolling: { startScrollMargins:
|
|
1133
|
-
m <
|
|
1134
|
-
const
|
|
1135
|
-
i.x =
|
|
1156
|
+
const { behaviour: { scrolling: { startScrollMargins: v } } } = s;
|
|
1157
|
+
m < d.left + v.x ? (e.x = h ? -j(d.left - m + v.x) : 0, m = m < d.left ? d.left : m) : m > d.right - v.x ? (e.x = a - h - u ? j(d.left + d.width - m - v.x) : 0, m = m > d.right ? d.right : m) : e.x = 0, f < d.top + v.y ? (e.y = r ? -j(d.top - f + v.y) : 0, f = f < d.top ? d.top : f) : f > d.bottom - v.y ? (e.y = l - r - c ? j(d.top + d.height - f - v.y) : 0, f = f > d.bottom ? d.bottom : f) : e.y = 0;
|
|
1158
|
+
const x = we(p, m), b = we(g, f), y = xe(p, m), C = xe(g, f);
|
|
1159
|
+
i.x = x, i.y = b, i.width = y - x, i.height = C - b;
|
|
1136
1160
|
}
|
|
1137
1161
|
_redrawSelectionArea() {
|
|
1138
|
-
const { x:
|
|
1139
|
-
|
|
1162
|
+
const { x: e, y: n, width: i, height: o } = this._areaRect, { style: s } = this._area;
|
|
1163
|
+
s.left = `${e}px`, s.top = `${n}px`, s.width = `${i}px`, s.height = `${o}px`;
|
|
1140
1164
|
}
|
|
1141
|
-
_onTapStop(
|
|
1165
|
+
_onTapStop(e, n) {
|
|
1142
1166
|
var i;
|
|
1143
|
-
const { document:
|
|
1144
|
-
|
|
1167
|
+
const { document: o, features: s } = this._options, { _singleClick: r } = this;
|
|
1168
|
+
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(), e && r && s.singleTap.allow ? this._onSingleTap(e) : !r && !n && (this._updateElementSelection(), this._emitEvent("stop", e)), 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");
|
|
1145
1169
|
}
|
|
1146
1170
|
_updateElementSelection() {
|
|
1147
|
-
const { _selectables:
|
|
1148
|
-
for (let m = 0; m <
|
|
1149
|
-
const f =
|
|
1150
|
-
if (
|
|
1171
|
+
const { _selectables: e, _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 = [];
|
|
1172
|
+
for (let m = 0; m < e.length; m++) {
|
|
1173
|
+
const f = e[m];
|
|
1174
|
+
if (ye(o, f.getBoundingClientRect(), c)) {
|
|
1151
1175
|
if (r.includes(f))
|
|
1152
|
-
|
|
1153
|
-
else if (
|
|
1176
|
+
s.includes(f) && !l.includes(f) && l.push(f);
|
|
1177
|
+
else if (a && s.includes(f)) {
|
|
1154
1178
|
p.push(f);
|
|
1155
1179
|
continue;
|
|
1156
1180
|
} else
|
|
1157
|
-
|
|
1158
|
-
|
|
1181
|
+
d.push(f);
|
|
1182
|
+
u.push(f);
|
|
1159
1183
|
}
|
|
1160
1184
|
}
|
|
1161
|
-
|
|
1162
|
-
const g =
|
|
1185
|
+
a && d.push(...s.filter((m) => !r.includes(m)));
|
|
1186
|
+
const g = h === "keep";
|
|
1163
1187
|
for (let m = 0; m < r.length; m++) {
|
|
1164
1188
|
const f = r[m];
|
|
1165
|
-
!
|
|
1189
|
+
!u.includes(f) && !// Check if user wants to keep previously selected elements, e.g.
|
|
1166
1190
|
// not make them part of the current selection as soon as they're touched.
|
|
1167
|
-
(g &&
|
|
1191
|
+
(g && s.includes(f)) && p.push(f);
|
|
1168
1192
|
}
|
|
1169
|
-
i.selected =
|
|
1193
|
+
i.selected = u, i.changed = { added: d, removed: p }, this._latestElement = void 0;
|
|
1170
1194
|
}
|
|
1171
|
-
_emitEvent(
|
|
1172
|
-
return this.emit(
|
|
1195
|
+
_emitEvent(e, n) {
|
|
1196
|
+
return this.emit(e, {
|
|
1173
1197
|
event: n,
|
|
1174
1198
|
store: this._selection,
|
|
1175
1199
|
selection: this
|
|
1176
1200
|
});
|
|
1177
1201
|
}
|
|
1178
1202
|
_keepSelection() {
|
|
1179
|
-
const { _options:
|
|
1180
|
-
switch (
|
|
1203
|
+
const { _options: e, _selection: n } = this, { selected: i, changed: o, touched: s, stored: r } = n, l = i.filter((c) => !r.includes(c));
|
|
1204
|
+
switch (e.behaviour.overlap) {
|
|
1181
1205
|
case "drop": {
|
|
1182
1206
|
n.stored = [
|
|
1183
1207
|
...l,
|
|
1184
|
-
...r.filter((c) => !
|
|
1208
|
+
...r.filter((c) => !s.includes(c))
|
|
1185
1209
|
// Elements not touched
|
|
1186
1210
|
];
|
|
1187
1211
|
break;
|
|
@@ -1189,7 +1213,7 @@ class De extends Ot {
|
|
|
1189
1213
|
case "invert": {
|
|
1190
1214
|
n.stored = [
|
|
1191
1215
|
...l,
|
|
1192
|
-
...r.filter((c) => !
|
|
1216
|
+
...r.filter((c) => !o.removed.includes(c))
|
|
1193
1217
|
// Elements not removed from selection
|
|
1194
1218
|
];
|
|
1195
1219
|
break;
|
|
@@ -1209,28 +1233,28 @@ class De extends Ot {
|
|
|
1209
1233
|
* @param evt A MouseEvent / TouchEvent -like object
|
|
1210
1234
|
* @param silent If beforestart should be fired,
|
|
1211
1235
|
*/
|
|
1212
|
-
trigger(
|
|
1213
|
-
this._onTapStart(
|
|
1236
|
+
trigger(e, n = !0) {
|
|
1237
|
+
this._onTapStart(e, n);
|
|
1214
1238
|
}
|
|
1215
1239
|
/**
|
|
1216
1240
|
* Can be used if during a selection elements have been added.
|
|
1217
1241
|
* Will update everything which can be selected.
|
|
1218
1242
|
*/
|
|
1219
1243
|
resolveSelectables() {
|
|
1220
|
-
this._selectables =
|
|
1244
|
+
this._selectables = F(this._options.selectables, this._options.document);
|
|
1221
1245
|
}
|
|
1222
1246
|
/**
|
|
1223
1247
|
* Same as deselect, but for all elements currently selected.
|
|
1224
1248
|
* @param includeStored If the store should also get cleared
|
|
1225
1249
|
* @param quiet If move / stop events should be fired
|
|
1226
1250
|
*/
|
|
1227
|
-
clearSelection(
|
|
1228
|
-
const { selected: i, stored:
|
|
1229
|
-
|
|
1251
|
+
clearSelection(e = !0, n = !1) {
|
|
1252
|
+
const { selected: i, stored: o, changed: s } = this._selection;
|
|
1253
|
+
s.added = [], s.removed.push(
|
|
1230
1254
|
...i,
|
|
1231
|
-
...
|
|
1255
|
+
...e ? o : []
|
|
1232
1256
|
), n || (this._emitEvent("move", null), this._emitEvent("stop", null)), this._selection = {
|
|
1233
|
-
stored:
|
|
1257
|
+
stored: e ? [] : o,
|
|
1234
1258
|
selected: [],
|
|
1235
1259
|
touched: [],
|
|
1236
1260
|
changed: { added: [], removed: [] }
|
|
@@ -1252,8 +1276,8 @@ class De extends Ot {
|
|
|
1252
1276
|
* Cancel the current selection process.
|
|
1253
1277
|
* @param keepEvent {boolean} true to fire a stop event after cancel.
|
|
1254
1278
|
*/
|
|
1255
|
-
cancel(
|
|
1256
|
-
this._onTapStop(null, !
|
|
1279
|
+
cancel(e = !1) {
|
|
1280
|
+
this._onTapStop(null, !e);
|
|
1257
1281
|
}
|
|
1258
1282
|
/**
|
|
1259
1283
|
* Unbinds all events and removes the area-element.
|
|
@@ -1266,29 +1290,29 @@ class De extends Ot {
|
|
|
1266
1290
|
* @param query - CSS Query, can be an array of queries
|
|
1267
1291
|
* @param quiet - If this should not trigger the move event
|
|
1268
1292
|
*/
|
|
1269
|
-
select(
|
|
1270
|
-
const { changed: i, selected:
|
|
1271
|
-
(l) => !
|
|
1293
|
+
select(e, n = !1) {
|
|
1294
|
+
const { changed: i, selected: o, stored: s } = this._selection, r = F(e, this._options.document).filter(
|
|
1295
|
+
(l) => !o.includes(l) && !s.includes(l)
|
|
1272
1296
|
);
|
|
1273
|
-
return
|
|
1297
|
+
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;
|
|
1274
1298
|
}
|
|
1275
1299
|
/**
|
|
1276
1300
|
* Removes a particular element from the selection.
|
|
1277
1301
|
* @param query - CSS Query, can be an array of queries
|
|
1278
1302
|
* @param quiet - If this should not trigger the move event
|
|
1279
1303
|
*/
|
|
1280
|
-
deselect(
|
|
1281
|
-
const { selected: i, stored:
|
|
1282
|
-
(l) => i.includes(l) ||
|
|
1304
|
+
deselect(e, n = !1) {
|
|
1305
|
+
const { selected: i, stored: o, changed: s } = this._selection, r = F(e, this._options.document).filter(
|
|
1306
|
+
(l) => i.includes(l) || o.includes(l)
|
|
1283
1307
|
);
|
|
1284
|
-
r.length && (this._selection.stored =
|
|
1285
|
-
...r.filter((l) => !
|
|
1308
|
+
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(
|
|
1309
|
+
...r.filter((l) => !s.removed.includes(l))
|
|
1286
1310
|
), this._latestElement = void 0, n || (this._emitEvent("move", null), this._emitEvent("stop", null)));
|
|
1287
1311
|
}
|
|
1288
1312
|
}
|
|
1289
|
-
|
|
1290
|
-
function
|
|
1291
|
-
const
|
|
1313
|
+
w(ze, "version", "3.3.1");
|
|
1314
|
+
function Rt(t) {
|
|
1315
|
+
const e = new ze({
|
|
1292
1316
|
selectables: [".map-container me-tpc"],
|
|
1293
1317
|
boundaries: [".map-container"],
|
|
1294
1318
|
container: ".map-container",
|
|
@@ -1307,8 +1331,8 @@ function Ht(e) {
|
|
|
1307
1331
|
startScrollMargins: { x: 10, y: 10 }
|
|
1308
1332
|
}
|
|
1309
1333
|
}
|
|
1310
|
-
}).on("beforestart", ({ event: n }) => !(n.button !== 0 || n.target.tagName === "ME-TPC" || n.target.id === "input-box")).on("start", ({ event: n }) => {
|
|
1311
|
-
!n.ctrlKey && !n.metaKey && (
|
|
1334
|
+
}).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 }) => {
|
|
1335
|
+
!n.ctrlKey && !n.metaKey && (t.unselectNode(), t.unselectNodes(), t.unselectSummary(), e.clearSelection(!0, !0));
|
|
1312
1336
|
}).on(
|
|
1313
1337
|
"move",
|
|
1314
1338
|
({
|
|
@@ -1316,217 +1340,217 @@ function Ht(e) {
|
|
|
1316
1340
|
changed: { added: n, removed: i }
|
|
1317
1341
|
}
|
|
1318
1342
|
}) => {
|
|
1319
|
-
|
|
1320
|
-
for (const
|
|
1321
|
-
|
|
1322
|
-
for (const
|
|
1323
|
-
|
|
1343
|
+
D.moved = !0;
|
|
1344
|
+
for (const o of n)
|
|
1345
|
+
o.classList.add("selected");
|
|
1346
|
+
for (const o of i)
|
|
1347
|
+
o.classList.remove("selected");
|
|
1324
1348
|
}
|
|
1325
1349
|
).on("stop", ({ store: { stored: n } }) => {
|
|
1326
|
-
console.log(n, "stored"),
|
|
1350
|
+
console.log(n, "stored"), t.selectNodes(n);
|
|
1327
1351
|
});
|
|
1328
|
-
console.log(
|
|
1352
|
+
console.log(e, "selection");
|
|
1329
1353
|
}
|
|
1330
|
-
const
|
|
1331
|
-
this.theme =
|
|
1354
|
+
const qt = function(t, e = !0) {
|
|
1355
|
+
this.theme = t;
|
|
1332
1356
|
const n = this.theme.cssVar, i = Object.keys(n);
|
|
1333
|
-
for (let
|
|
1334
|
-
const
|
|
1335
|
-
this.mindElixirBox.style.setProperty(
|
|
1357
|
+
for (let o = 0; o < i.length; o++) {
|
|
1358
|
+
const s = i[o];
|
|
1359
|
+
this.mindElixirBox.style.setProperty(s, n[s]);
|
|
1336
1360
|
}
|
|
1337
|
-
|
|
1361
|
+
e && this.refresh();
|
|
1338
1362
|
};
|
|
1339
|
-
function
|
|
1363
|
+
function Re(t) {
|
|
1340
1364
|
return {
|
|
1341
|
-
nodeData:
|
|
1342
|
-
linkData:
|
|
1343
|
-
summaries:
|
|
1344
|
-
direction:
|
|
1345
|
-
theme:
|
|
1365
|
+
nodeData: t.isFocusMode ? t.nodeDataBackup : t.nodeData,
|
|
1366
|
+
linkData: t.linkData,
|
|
1367
|
+
summaries: t.summaries,
|
|
1368
|
+
direction: t.direction,
|
|
1369
|
+
theme: t.theme
|
|
1346
1370
|
};
|
|
1347
1371
|
}
|
|
1348
|
-
const
|
|
1349
|
-
if (
|
|
1350
|
-
if (console.time("selectNode"), typeof
|
|
1351
|
-
const i =
|
|
1372
|
+
const Ft = function(t, e, n) {
|
|
1373
|
+
if (t) {
|
|
1374
|
+
if (console.time("selectNode"), typeof t == "string") {
|
|
1375
|
+
const i = E(t);
|
|
1352
1376
|
return i ? this.selectNode(i) : void 0;
|
|
1353
1377
|
}
|
|
1354
|
-
this.currentNode && (this.currentNode.className = ""),
|
|
1378
|
+
this.currentNode && (this.currentNode.className = ""), t.className = "selected", t.scrollIntoView({ block: "nearest", inline: "nearest" }), this.currentNode = t, e ? this.bus.fire("selectNewNode", t.nodeObj) : this.bus.fire("selectNode", t.nodeObj, n), console.timeEnd("selectNode");
|
|
1355
1379
|
}
|
|
1356
|
-
},
|
|
1380
|
+
}, Vt = function() {
|
|
1357
1381
|
this.currentNode && (this.currentNode.className = ""), this.currentNode = null, this.bus.fire("unselectNode");
|
|
1358
|
-
},
|
|
1359
|
-
if (
|
|
1382
|
+
}, Wt = function(t) {
|
|
1383
|
+
if (t) {
|
|
1360
1384
|
console.time("selectNodes");
|
|
1361
|
-
for (const
|
|
1362
|
-
|
|
1363
|
-
this.currentNodes =
|
|
1385
|
+
for (const e of t)
|
|
1386
|
+
e.className = "selected";
|
|
1387
|
+
this.currentNodes = t, this.bus.fire(
|
|
1364
1388
|
"selectNodes",
|
|
1365
|
-
|
|
1389
|
+
t.map((e) => e.nodeObj)
|
|
1366
1390
|
), console.timeEnd("selectNodes");
|
|
1367
1391
|
}
|
|
1368
|
-
},
|
|
1392
|
+
}, Yt = function() {
|
|
1369
1393
|
if (this.currentNodes)
|
|
1370
|
-
for (const
|
|
1371
|
-
|
|
1394
|
+
for (const t of this.currentNodes)
|
|
1395
|
+
t.classList.remove("selected");
|
|
1372
1396
|
this.currentNodes = null, this.bus.fire("unselectNodes");
|
|
1373
|
-
},
|
|
1397
|
+
}, It = function() {
|
|
1374
1398
|
if (!this.currentNode || this.currentNode.dataset.nodeid === "meroot")
|
|
1375
1399
|
return !1;
|
|
1376
|
-
const
|
|
1377
|
-
let
|
|
1378
|
-
if (
|
|
1379
|
-
|
|
1400
|
+
const t = this.currentNode.parentElement.parentElement.nextSibling;
|
|
1401
|
+
let e;
|
|
1402
|
+
if (t)
|
|
1403
|
+
e = t.firstChild.firstChild;
|
|
1380
1404
|
else
|
|
1381
1405
|
return !1;
|
|
1382
|
-
return this.selectNode(
|
|
1383
|
-
},
|
|
1406
|
+
return this.selectNode(e), !0;
|
|
1407
|
+
}, Xt = function() {
|
|
1384
1408
|
if (!this.currentNode || this.currentNode.dataset.nodeid === "meroot")
|
|
1385
1409
|
return !1;
|
|
1386
|
-
const
|
|
1387
|
-
let
|
|
1388
|
-
if (
|
|
1389
|
-
|
|
1410
|
+
const t = this.currentNode.parentElement.parentElement.previousSibling;
|
|
1411
|
+
let e;
|
|
1412
|
+
if (t)
|
|
1413
|
+
e = t.firstChild.firstChild;
|
|
1390
1414
|
else
|
|
1391
1415
|
return !1;
|
|
1392
|
-
return this.selectNode(
|
|
1393
|
-
},
|
|
1416
|
+
return this.selectNode(e), !0;
|
|
1417
|
+
}, Kt = function() {
|
|
1394
1418
|
if (!this.currentNode)
|
|
1395
1419
|
return;
|
|
1396
|
-
const
|
|
1397
|
-
if (
|
|
1398
|
-
const
|
|
1399
|
-
this.selectNode(
|
|
1420
|
+
const t = this.currentNode.parentElement.nextSibling;
|
|
1421
|
+
if (t && t.firstChild) {
|
|
1422
|
+
const e = t.firstChild.firstChild.firstChild;
|
|
1423
|
+
this.selectNode(e);
|
|
1400
1424
|
}
|
|
1401
|
-
},
|
|
1425
|
+
}, Ut = function() {
|
|
1402
1426
|
if (!this.currentNode || this.currentNode.dataset.nodeid === "meroot")
|
|
1403
1427
|
return;
|
|
1404
|
-
const
|
|
1405
|
-
if (
|
|
1406
|
-
const
|
|
1407
|
-
this.selectNode(
|
|
1428
|
+
const t = this.currentNode.parentElement.parentElement.parentElement.previousSibling;
|
|
1429
|
+
if (t) {
|
|
1430
|
+
const e = t.firstChild;
|
|
1431
|
+
this.selectNode(e);
|
|
1408
1432
|
}
|
|
1409
|
-
},
|
|
1410
|
-
const
|
|
1411
|
-
return JSON.stringify(
|
|
1412
|
-
if (!(
|
|
1413
|
-
return
|
|
1433
|
+
}, Gt = function() {
|
|
1434
|
+
const t = Re(this);
|
|
1435
|
+
return JSON.stringify(t, (e, n) => {
|
|
1436
|
+
if (!(e === "parent" && typeof n != "string"))
|
|
1437
|
+
return n;
|
|
1414
1438
|
});
|
|
1415
|
-
},
|
|
1439
|
+
}, Jt = function() {
|
|
1416
1440
|
return JSON.parse(this.getDataString());
|
|
1417
|
-
},
|
|
1418
|
-
const
|
|
1419
|
-
let
|
|
1441
|
+
}, Qt = function() {
|
|
1442
|
+
const t = Re(this).nodeData;
|
|
1443
|
+
let e = "# " + t.topic + `
|
|
1420
1444
|
|
|
1421
1445
|
`;
|
|
1422
|
-
function n(i,
|
|
1423
|
-
for (let
|
|
1424
|
-
|
|
1446
|
+
function n(i, o) {
|
|
1447
|
+
for (let s = 0; s < i.length; s++)
|
|
1448
|
+
o <= 6 ? e += "".padStart(o, "#") + " " + i[s].topic + `
|
|
1425
1449
|
|
|
1426
|
-
` :
|
|
1427
|
-
`, i[
|
|
1450
|
+
` : e += "".padStart(o - 7, " ") + "- " + i[s].topic + `
|
|
1451
|
+
`, i[s].children && n(i[s].children || [], o + 1);
|
|
1428
1452
|
}
|
|
1429
|
-
return n(
|
|
1430
|
-
},
|
|
1453
|
+
return n(t.children || [], 2), e;
|
|
1454
|
+
}, Zt = function() {
|
|
1431
1455
|
this.editable = !0;
|
|
1432
|
-
},
|
|
1456
|
+
}, en = function() {
|
|
1433
1457
|
this.editable = !1;
|
|
1434
|
-
},
|
|
1435
|
-
this.scaleVal =
|
|
1436
|
-
}, Zt = function() {
|
|
1437
|
-
this.container.scrollTo(1e4 - this.container.offsetWidth / 2, 1e4 - this.container.offsetHeight / 2);
|
|
1438
|
-
}, en = function(e) {
|
|
1439
|
-
e(this);
|
|
1440
|
-
}, tn = function(e) {
|
|
1441
|
-
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());
|
|
1458
|
+
}, tn = function(t) {
|
|
1459
|
+
this.scaleVal = t, this.map.style.transform = "scale(" + t + ")";
|
|
1442
1460
|
}, nn = function() {
|
|
1461
|
+
this.container.scrollTo(1e4 - this.container.offsetWidth / 2, 1e4 - this.container.offsetHeight / 2);
|
|
1462
|
+
}, on = function(t) {
|
|
1463
|
+
t(this);
|
|
1464
|
+
}, sn = function(t) {
|
|
1465
|
+
t.nodeObj.root || (this.tempDirection === null && (this.tempDirection = this.direction), this.isFocusMode || (this.nodeDataBackup = this.nodeData, this.isFocusMode = !0), this.nodeData = t.nodeObj, this.nodeData.root = !0, this.initRight(), this.toCenter());
|
|
1466
|
+
}, rn = function() {
|
|
1443
1467
|
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());
|
|
1444
|
-
},
|
|
1468
|
+
}, ln = function() {
|
|
1445
1469
|
this.direction = 0, this.refresh();
|
|
1446
|
-
},
|
|
1470
|
+
}, cn = function() {
|
|
1447
1471
|
this.direction = 1, this.refresh();
|
|
1448
|
-
},
|
|
1472
|
+
}, an = function() {
|
|
1449
1473
|
this.direction = 2, this.refresh();
|
|
1450
|
-
},
|
|
1451
|
-
this.locale =
|
|
1452
|
-
},
|
|
1453
|
-
const n =
|
|
1454
|
-
typeof
|
|
1455
|
-
},
|
|
1456
|
-
|
|
1457
|
-
},
|
|
1474
|
+
}, dn = function(t) {
|
|
1475
|
+
this.locale = t, this.refresh();
|
|
1476
|
+
}, hn = function(t, e) {
|
|
1477
|
+
const n = t.nodeObj;
|
|
1478
|
+
typeof e == "boolean" ? n.expanded = e : n.expanded !== !1 ? n.expanded = !1 : n.expanded = !0, this.layout(), this.linkDiv(), this.bus.fire("expandNode", n);
|
|
1479
|
+
}, un = function(t) {
|
|
1480
|
+
t && (t = JSON.parse(JSON.stringify(t)), this.nodeData = t.nodeData, this.linkData = t.linkData || {}), T(this.nodeData), this.layout(), this.linkDiv();
|
|
1481
|
+
}, fn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1458
1482
|
__proto__: null,
|
|
1459
|
-
cancelFocus:
|
|
1460
|
-
disableEdit:
|
|
1461
|
-
enableEdit:
|
|
1462
|
-
expandNode:
|
|
1463
|
-
focusNode:
|
|
1464
|
-
getData:
|
|
1465
|
-
getDataMd:
|
|
1466
|
-
getDataString:
|
|
1467
|
-
initLeft:
|
|
1468
|
-
initRight:
|
|
1469
|
-
initSide:
|
|
1470
|
-
install:
|
|
1471
|
-
refresh:
|
|
1472
|
-
scale:
|
|
1473
|
-
selectFirstChild:
|
|
1474
|
-
selectNextSibling:
|
|
1475
|
-
selectNode:
|
|
1476
|
-
selectNodes:
|
|
1477
|
-
selectParent:
|
|
1478
|
-
selectPrevSibling:
|
|
1479
|
-
setLocale:
|
|
1480
|
-
toCenter:
|
|
1481
|
-
unselectNode:
|
|
1482
|
-
unselectNodes:
|
|
1483
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1484
|
-
const n =
|
|
1483
|
+
cancelFocus: rn,
|
|
1484
|
+
disableEdit: en,
|
|
1485
|
+
enableEdit: Zt,
|
|
1486
|
+
expandNode: hn,
|
|
1487
|
+
focusNode: sn,
|
|
1488
|
+
getData: Jt,
|
|
1489
|
+
getDataMd: Qt,
|
|
1490
|
+
getDataString: Gt,
|
|
1491
|
+
initLeft: ln,
|
|
1492
|
+
initRight: cn,
|
|
1493
|
+
initSide: an,
|
|
1494
|
+
install: on,
|
|
1495
|
+
refresh: un,
|
|
1496
|
+
scale: tn,
|
|
1497
|
+
selectFirstChild: Kt,
|
|
1498
|
+
selectNextSibling: It,
|
|
1499
|
+
selectNode: Ft,
|
|
1500
|
+
selectNodes: Wt,
|
|
1501
|
+
selectParent: Ut,
|
|
1502
|
+
selectPrevSibling: Xt,
|
|
1503
|
+
setLocale: dn,
|
|
1504
|
+
toCenter: nn,
|
|
1505
|
+
unselectNode: Vt,
|
|
1506
|
+
unselectNodes: Yt
|
|
1507
|
+
}, Symbol.toStringTag, { value: "Module" })), se = function(t) {
|
|
1508
|
+
const n = t.parentElement.parentElement.lastElementChild;
|
|
1485
1509
|
(n == null ? void 0 : n.tagName) === "svg" && (n == null || n.remove());
|
|
1486
|
-
},
|
|
1510
|
+
}, qe = function(t, e) {
|
|
1487
1511
|
var n, i;
|
|
1488
|
-
if (
|
|
1512
|
+
if (t === S)
|
|
1489
1513
|
return S;
|
|
1490
|
-
if (
|
|
1491
|
-
return
|
|
1492
|
-
if (
|
|
1493
|
-
const
|
|
1494
|
-
return
|
|
1495
|
-
}
|
|
1496
|
-
},
|
|
1497
|
-
console.log(
|
|
1498
|
-
const n =
|
|
1499
|
-
i.style &&
|
|
1500
|
-
const
|
|
1501
|
-
|
|
1514
|
+
if (t === H)
|
|
1515
|
+
return H;
|
|
1516
|
+
if (t === K) {
|
|
1517
|
+
const o = ((n = document.querySelector(".lhs")) == null ? void 0 : n.childElementCount) || 0, s = ((i = document.querySelector(".rhs")) == null ? void 0 : i.childElementCount) || 0;
|
|
1518
|
+
return o <= s ? (e.direction = S, S) : (e.direction = H, H);
|
|
1519
|
+
}
|
|
1520
|
+
}, pn = function(t, e) {
|
|
1521
|
+
console.log(e);
|
|
1522
|
+
const n = t.nodeObj, i = De(n);
|
|
1523
|
+
i.style && e.style && (e.style = Object.assign(i.style, e.style));
|
|
1524
|
+
const o = Object.assign(n, e);
|
|
1525
|
+
ae(t, o), this.linkDiv(), this.bus.fire("operation", {
|
|
1502
1526
|
name: "reshapeNode",
|
|
1503
|
-
obj:
|
|
1527
|
+
obj: o,
|
|
1504
1528
|
origin: i
|
|
1505
1529
|
});
|
|
1506
|
-
},
|
|
1507
|
-
var
|
|
1508
|
-
const n =
|
|
1530
|
+
}, mn = function(t, e) {
|
|
1531
|
+
var h, a, u;
|
|
1532
|
+
const n = t || this.currentNode;
|
|
1509
1533
|
if (!n)
|
|
1510
1534
|
return;
|
|
1511
1535
|
const i = n.nodeObj;
|
|
1512
1536
|
if (i.root === !0) {
|
|
1513
1537
|
this.addChild();
|
|
1514
1538
|
return;
|
|
1515
|
-
} else if (((
|
|
1516
|
-
this.addChild(
|
|
1539
|
+
} else if (((h = i.parent) == null ? void 0 : h.root) === !0 && ((u = (a = i.parent) == null ? void 0 : a.children) == null ? void 0 : u.length) === 1) {
|
|
1540
|
+
this.addChild(E(i.parent.id));
|
|
1517
1541
|
return;
|
|
1518
1542
|
}
|
|
1519
|
-
const
|
|
1520
|
-
|
|
1521
|
-
const
|
|
1543
|
+
const o = e || this.generateNewObj();
|
|
1544
|
+
Ze(i, o), T(this.nodeData);
|
|
1545
|
+
const s = n.parentElement;
|
|
1522
1546
|
console.time("insertSibling_DOM");
|
|
1523
|
-
const { grp: r, top: l } = this.createWrapper(
|
|
1524
|
-
|
|
1547
|
+
const { grp: r, top: l } = this.createWrapper(o);
|
|
1548
|
+
s.parentNode.parentNode.insertBefore(r, s.parentNode.nextSibling), this.linkDiv(r.offsetParent), e || this.editTopic(l.firstChild), this.selectNode(l.firstChild, !0), console.timeEnd("insertSibling_DOM"), this.bus.fire("operation", {
|
|
1525
1549
|
name: "insertSibling",
|
|
1526
|
-
obj:
|
|
1550
|
+
obj: o
|
|
1527
1551
|
});
|
|
1528
|
-
},
|
|
1529
|
-
const n =
|
|
1552
|
+
}, gn = function(t, e) {
|
|
1553
|
+
const n = t || this.currentNode;
|
|
1530
1554
|
if (!n)
|
|
1531
1555
|
return;
|
|
1532
1556
|
const i = n.nodeObj;
|
|
@@ -1534,545 +1558,718 @@ const Rt = function(e, t, n) {
|
|
|
1534
1558
|
this.addChild();
|
|
1535
1559
|
return;
|
|
1536
1560
|
}
|
|
1537
|
-
const
|
|
1538
|
-
|
|
1539
|
-
const
|
|
1561
|
+
const o = e || this.generateNewObj();
|
|
1562
|
+
et(i, o), T(this.nodeData);
|
|
1563
|
+
const s = n.parentElement;
|
|
1540
1564
|
console.time("insertSibling_DOM");
|
|
1541
|
-
const { grp: r, top: l } = this.createWrapper(
|
|
1542
|
-
|
|
1565
|
+
const { grp: r, top: l } = this.createWrapper(o);
|
|
1566
|
+
s.parentNode.parentNode.insertBefore(r, s.parentNode), this.linkDiv(r.offsetParent), e || this.editTopic(l.firstChild), this.selectNode(l.firstChild, !0), console.timeEnd("insertSibling_DOM"), this.bus.fire("operation", {
|
|
1543
1567
|
name: "insertBefore",
|
|
1544
|
-
obj:
|
|
1568
|
+
obj: o
|
|
1545
1569
|
});
|
|
1546
|
-
},
|
|
1547
|
-
const n =
|
|
1570
|
+
}, vn = function(t, e) {
|
|
1571
|
+
const n = t || this.currentNode;
|
|
1548
1572
|
if (!n)
|
|
1549
1573
|
return;
|
|
1550
|
-
|
|
1574
|
+
se(n);
|
|
1551
1575
|
const i = n.nodeObj;
|
|
1552
1576
|
if (i.root === !0)
|
|
1553
1577
|
return;
|
|
1554
|
-
const
|
|
1555
|
-
|
|
1556
|
-
const
|
|
1578
|
+
const o = e || this.generateNewObj();
|
|
1579
|
+
tt(i, o), T(this.nodeData);
|
|
1580
|
+
const s = n.parentElement.parentElement;
|
|
1557
1581
|
console.time("insertParent_DOM");
|
|
1558
|
-
const { grp: r, top: l } = this.createWrapper(
|
|
1559
|
-
l.appendChild(
|
|
1560
|
-
const c = this.createChildren([
|
|
1561
|
-
l.insertAdjacentElement("afterend", c), this.linkDiv(),
|
|
1582
|
+
const { grp: r, top: l } = this.createWrapper(o, !0);
|
|
1583
|
+
l.appendChild(oe(!0)), s.insertAdjacentElement("afterend", r);
|
|
1584
|
+
const c = this.createChildren([s]);
|
|
1585
|
+
l.insertAdjacentElement("afterend", c), this.linkDiv(), e || this.editTopic(l.firstChild), this.selectNode(l.firstChild, !0), console.timeEnd("insertParent_DOM"), this.bus.fire("operation", {
|
|
1562
1586
|
name: "insertParent",
|
|
1563
|
-
obj:
|
|
1587
|
+
obj: o
|
|
1564
1588
|
});
|
|
1565
|
-
},
|
|
1589
|
+
}, Fe = function(t, e) {
|
|
1566
1590
|
var l, c;
|
|
1567
|
-
if (!
|
|
1591
|
+
if (!t)
|
|
1568
1592
|
return null;
|
|
1569
|
-
const n =
|
|
1570
|
-
n.expanded === !1 && (this.expandNode(
|
|
1571
|
-
const i =
|
|
1572
|
-
n.children ? n.children.push(i) : n.children = [i],
|
|
1573
|
-
const
|
|
1574
|
-
if (
|
|
1575
|
-
if (
|
|
1576
|
-
|
|
1593
|
+
const n = t.nodeObj;
|
|
1594
|
+
n.expanded === !1 && (this.expandNode(t, !0), t = E(n.id));
|
|
1595
|
+
const i = e || this.generateNewObj();
|
|
1596
|
+
n.children ? n.children.push(i) : n.children = [i], T(this.nodeData);
|
|
1597
|
+
const o = t.parentElement, { grp: s, top: r } = this.createWrapper(i);
|
|
1598
|
+
if (o.tagName === "ME-PARENT") {
|
|
1599
|
+
if (o.children[1])
|
|
1600
|
+
o.nextSibling.appendChild(s);
|
|
1577
1601
|
else {
|
|
1578
|
-
const
|
|
1579
|
-
|
|
1602
|
+
const h = this.createChildren([s]);
|
|
1603
|
+
o.appendChild(oe(!0)), o.insertAdjacentElement("afterend", h);
|
|
1580
1604
|
}
|
|
1581
|
-
this.linkDiv(
|
|
1605
|
+
this.linkDiv(s.offsetParent);
|
|
1582
1606
|
} else
|
|
1583
|
-
|
|
1607
|
+
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());
|
|
1584
1608
|
return { newTop: r, newNodeObj: i };
|
|
1585
|
-
},
|
|
1609
|
+
}, bn = function(t, e) {
|
|
1586
1610
|
console.time("addChild");
|
|
1587
|
-
const n =
|
|
1611
|
+
const n = t || this.currentNode;
|
|
1588
1612
|
if (!n)
|
|
1589
1613
|
return;
|
|
1590
|
-
const i =
|
|
1614
|
+
const i = Fe.call(this, n, e);
|
|
1591
1615
|
if (!i)
|
|
1592
1616
|
return;
|
|
1593
|
-
const { newTop:
|
|
1617
|
+
const { newTop: o, newNodeObj: s } = i;
|
|
1594
1618
|
this.bus.fire("operation", {
|
|
1595
1619
|
name: "addChild",
|
|
1596
|
-
obj:
|
|
1597
|
-
}), console.timeEnd("addChild"),
|
|
1598
|
-
},
|
|
1620
|
+
obj: s
|
|
1621
|
+
}), console.timeEnd("addChild"), e || this.editTopic(o.firstChild), this.selectNode(o.firstChild, !0);
|
|
1622
|
+
}, yn = function(t, e) {
|
|
1599
1623
|
console.time("copyNode");
|
|
1600
|
-
const n =
|
|
1601
|
-
|
|
1602
|
-
const i =
|
|
1624
|
+
const n = De(t.nodeObj);
|
|
1625
|
+
Te(n);
|
|
1626
|
+
const i = Fe.call(this, e, n);
|
|
1603
1627
|
if (!i)
|
|
1604
1628
|
return;
|
|
1605
|
-
const { newNodeObj:
|
|
1629
|
+
const { newNodeObj: o } = i;
|
|
1606
1630
|
console.timeEnd("copyNode"), this.bus.fire("operation", {
|
|
1607
1631
|
name: "copyNode",
|
|
1608
|
-
obj:
|
|
1632
|
+
obj: o
|
|
1609
1633
|
});
|
|
1610
|
-
},
|
|
1611
|
-
const
|
|
1612
|
-
if (!
|
|
1634
|
+
}, xn = function(t) {
|
|
1635
|
+
const e = t || this.currentNode;
|
|
1636
|
+
if (!e)
|
|
1613
1637
|
return;
|
|
1614
|
-
const n =
|
|
1615
|
-
|
|
1638
|
+
const n = e.parentNode.parentNode, i = e.nodeObj;
|
|
1639
|
+
Je(i), n.parentNode.insertBefore(n, n.previousSibling), this.linkDiv(), this.bus.fire("operation", {
|
|
1616
1640
|
name: "moveUpNode",
|
|
1617
1641
|
obj: i
|
|
1618
1642
|
});
|
|
1619
|
-
},
|
|
1620
|
-
const
|
|
1621
|
-
if (!
|
|
1643
|
+
}, wn = function(t) {
|
|
1644
|
+
const e = t || this.currentNode;
|
|
1645
|
+
if (!e)
|
|
1622
1646
|
return;
|
|
1623
|
-
const n =
|
|
1624
|
-
|
|
1647
|
+
const n = e.parentNode.parentNode, i = e.nodeObj;
|
|
1648
|
+
Qe(i), n.nextSibling ? n.nextSibling.insertAdjacentElement("afterend", n) : n.parentNode.prepend(n), this.linkDiv(), this.bus.fire("operation", {
|
|
1625
1649
|
name: "moveDownNode",
|
|
1626
1650
|
obj: i
|
|
1627
1651
|
});
|
|
1628
|
-
},
|
|
1652
|
+
}, En = function(t) {
|
|
1629
1653
|
var l;
|
|
1630
|
-
const
|
|
1631
|
-
if (!
|
|
1654
|
+
const e = t || this.currentNode;
|
|
1655
|
+
if (!e)
|
|
1632
1656
|
return;
|
|
1633
|
-
const n =
|
|
1657
|
+
const n = e.nodeObj;
|
|
1634
1658
|
if (n.root === !0)
|
|
1635
1659
|
throw new Error("Can not remove root node");
|
|
1636
|
-
const i = n.parent.children,
|
|
1637
|
-
if (
|
|
1660
|
+
const i = n.parent.children, o = i.findIndex((c) => c === n), s = ie(n), r = e.parentNode;
|
|
1661
|
+
if (s === 0) {
|
|
1638
1662
|
const c = r.parentNode.parentNode;
|
|
1639
1663
|
c.tagName !== "ME-MAIN" && c.previousSibling.children[1].remove();
|
|
1640
1664
|
}
|
|
1641
1665
|
if (i.length !== 0) {
|
|
1642
|
-
const c = i[
|
|
1643
|
-
this.selectNode(
|
|
1666
|
+
const c = i[o] || i[o - 1];
|
|
1667
|
+
this.selectNode(E(c.id));
|
|
1644
1668
|
} else
|
|
1645
|
-
this.selectNode(
|
|
1669
|
+
this.selectNode(E(n.parent.id));
|
|
1646
1670
|
for (const c in this.linkData) {
|
|
1647
|
-
const
|
|
1648
|
-
if (
|
|
1649
|
-
const
|
|
1650
|
-
this.removeLink(
|
|
1671
|
+
const h = this.linkData[c];
|
|
1672
|
+
if (h.from === n.id || h.to === n.id) {
|
|
1673
|
+
const a = this.mindElixirBox.querySelector(`[data-linkid=${this.linkData[c].id}]`);
|
|
1674
|
+
this.removeLink(a);
|
|
1651
1675
|
}
|
|
1652
1676
|
}
|
|
1653
1677
|
r.parentNode.remove(), this.linkDiv(), this.bus.fire("operation", {
|
|
1654
1678
|
name: "removeNode",
|
|
1655
1679
|
obj: n,
|
|
1656
|
-
originIndex:
|
|
1680
|
+
originIndex: o,
|
|
1657
1681
|
originParentId: (l = n == null ? void 0 : n.parent) == null ? void 0 : l.id
|
|
1658
1682
|
});
|
|
1659
|
-
}, Nn = function(
|
|
1683
|
+
}, Nn = function(t, e) {
|
|
1660
1684
|
var l;
|
|
1661
|
-
const n =
|
|
1662
|
-
if (i.expanded === !1 && (this.expandNode(
|
|
1685
|
+
const n = t.nodeObj, i = e.nodeObj, o = (l = n == null ? void 0 : n.parent) == null ? void 0 : l.id;
|
|
1686
|
+
if (i.expanded === !1 && (this.expandNode(e, !0), t = E(n.id), e = E(i.id)), !Ge(n, i)) {
|
|
1663
1687
|
console.warn("Invalid move");
|
|
1664
1688
|
return;
|
|
1665
1689
|
}
|
|
1666
|
-
console.time("moveNode"),
|
|
1667
|
-
const
|
|
1690
|
+
console.time("moveNode"), nt(n, i), T(this.nodeData);
|
|
1691
|
+
const s = t.parentElement, r = e.parentElement;
|
|
1668
1692
|
if (r.tagName === "ME-PARENT")
|
|
1669
|
-
if (
|
|
1670
|
-
r.nextSibling.appendChild(
|
|
1693
|
+
if (se(t), r.children[1])
|
|
1694
|
+
r.nextSibling.appendChild(s.parentElement);
|
|
1671
1695
|
else {
|
|
1672
|
-
const c = this.createChildren([
|
|
1673
|
-
r.appendChild(
|
|
1696
|
+
const c = this.createChildren([s.parentElement]);
|
|
1697
|
+
r.appendChild(oe(!0)), r.parentElement.insertBefore(c, r.nextSibling);
|
|
1674
1698
|
}
|
|
1675
1699
|
else
|
|
1676
|
-
r.tagName === "ME-ROOT" && (
|
|
1700
|
+
r.tagName === "ME-ROOT" && (qe(this.direction, n), r.nextSibling.appendChild(s.parentElement));
|
|
1677
1701
|
this.linkDiv(), this.bus.fire("operation", {
|
|
1678
1702
|
name: "moveNode",
|
|
1679
1703
|
obj: n,
|
|
1680
1704
|
toObj: i,
|
|
1681
|
-
originParentId:
|
|
1705
|
+
originParentId: o
|
|
1682
1706
|
}), console.timeEnd("moveNode");
|
|
1683
|
-
},
|
|
1684
|
-
var
|
|
1685
|
-
const n =
|
|
1686
|
-
|
|
1687
|
-
const r =
|
|
1688
|
-
|
|
1707
|
+
}, Cn = function(t, e) {
|
|
1708
|
+
var h;
|
|
1709
|
+
const n = t.nodeObj, i = e.nodeObj, o = (h = n.parent) == null ? void 0 : h.id;
|
|
1710
|
+
it(n, i), T(this.nodeData), se(t);
|
|
1711
|
+
const r = t.parentElement.parentNode;
|
|
1712
|
+
e.parentElement.parentNode.insertAdjacentElement("beforebegin", r), this.linkDiv(), this.bus.fire("operation", {
|
|
1689
1713
|
name: "moveNodeBefore",
|
|
1690
1714
|
obj: n,
|
|
1691
1715
|
toObj: i,
|
|
1692
|
-
originParentId:
|
|
1716
|
+
originParentId: o
|
|
1693
1717
|
});
|
|
1694
|
-
},
|
|
1695
|
-
var
|
|
1696
|
-
const n =
|
|
1697
|
-
|
|
1698
|
-
const r =
|
|
1699
|
-
|
|
1718
|
+
}, _n = function(t, e) {
|
|
1719
|
+
var h;
|
|
1720
|
+
const n = t.nodeObj, i = e.nodeObj, o = (h = n.parent) == null ? void 0 : h.id;
|
|
1721
|
+
ot(n, i), T(this.nodeData), se(t);
|
|
1722
|
+
const r = t.parentElement.parentElement;
|
|
1723
|
+
e.parentElement.parentElement.insertAdjacentElement("afterend", r), this.linkDiv(), this.bus.fire("operation", {
|
|
1700
1724
|
name: "moveNodeAfter",
|
|
1701
1725
|
obj: n,
|
|
1702
1726
|
toObj: i,
|
|
1703
|
-
originParentId:
|
|
1727
|
+
originParentId: o
|
|
1704
1728
|
});
|
|
1705
|
-
},
|
|
1706
|
-
const
|
|
1707
|
-
|
|
1708
|
-
},
|
|
1709
|
-
|
|
1710
|
-
},
|
|
1729
|
+
}, kn = function(t) {
|
|
1730
|
+
const e = t || this.currentNode;
|
|
1731
|
+
e && this.editTopic(e);
|
|
1732
|
+
}, Sn = function(t, e) {
|
|
1733
|
+
t.childNodes[0].textContent = e, t.nodeObj.topic = e, this.linkDiv();
|
|
1734
|
+
}, Ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1711
1735
|
__proto__: null,
|
|
1712
|
-
addChild:
|
|
1713
|
-
beginEdit:
|
|
1714
|
-
copyNode:
|
|
1715
|
-
insertBefore:
|
|
1716
|
-
insertParent:
|
|
1717
|
-
insertSibling:
|
|
1718
|
-
moveDownNode:
|
|
1736
|
+
addChild: bn,
|
|
1737
|
+
beginEdit: kn,
|
|
1738
|
+
copyNode: yn,
|
|
1739
|
+
insertBefore: gn,
|
|
1740
|
+
insertParent: vn,
|
|
1741
|
+
insertSibling: mn,
|
|
1742
|
+
moveDownNode: wn,
|
|
1719
1743
|
moveNode: Nn,
|
|
1720
|
-
moveNodeAfter:
|
|
1721
|
-
moveNodeBefore:
|
|
1722
|
-
moveUpNode:
|
|
1723
|
-
removeNode:
|
|
1724
|
-
reshapeNode:
|
|
1725
|
-
setNodeTopic:
|
|
1726
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1744
|
+
moveNodeAfter: _n,
|
|
1745
|
+
moveNodeBefore: Cn,
|
|
1746
|
+
moveUpNode: xn,
|
|
1747
|
+
removeNode: En,
|
|
1748
|
+
reshapeNode: pn,
|
|
1749
|
+
setNodeTopic: Sn
|
|
1750
|
+
}, Symbol.toStringTag, { value: "Module" })), Ln = function(t) {
|
|
1727
1751
|
return {
|
|
1728
|
-
dom:
|
|
1752
|
+
dom: t,
|
|
1729
1753
|
mousedown: !1,
|
|
1730
1754
|
lastX: 0,
|
|
1731
1755
|
lastY: 0,
|
|
1732
|
-
handleMouseMove(
|
|
1733
|
-
if (
|
|
1756
|
+
handleMouseMove(e) {
|
|
1757
|
+
if (this.mousedown) {
|
|
1734
1758
|
if (!this.lastX) {
|
|
1735
|
-
this.lastX =
|
|
1759
|
+
this.lastX = e.pageX, this.lastY = e.pageY;
|
|
1736
1760
|
return;
|
|
1737
1761
|
}
|
|
1738
|
-
const n = this.lastX -
|
|
1739
|
-
this.cb && this.cb(n, i), this.lastX =
|
|
1762
|
+
const n = this.lastX - e.pageX, i = this.lastY - e.pageY;
|
|
1763
|
+
this.cb && this.cb(n, i), this.lastX = e.pageX, this.lastY = e.pageY;
|
|
1740
1764
|
}
|
|
1741
1765
|
},
|
|
1742
|
-
handleMouseDown(
|
|
1743
|
-
|
|
1766
|
+
handleMouseDown(e) {
|
|
1767
|
+
this.mousedown = !0;
|
|
1744
1768
|
},
|
|
1745
|
-
handleClear(
|
|
1746
|
-
|
|
1769
|
+
handleClear(e) {
|
|
1770
|
+
this.clear();
|
|
1747
1771
|
},
|
|
1748
1772
|
cb: null,
|
|
1749
|
-
init(
|
|
1750
|
-
this.cb = n, this.handleClear = this.handleClear.bind(this), this.handleMouseMove = this.handleMouseMove.bind(this), this.handleMouseDown = this.handleMouseDown.bind(this),
|
|
1773
|
+
init(e, n) {
|
|
1774
|
+
this.cb = n, this.handleClear = this.handleClear.bind(this), this.handleMouseMove = this.handleMouseMove.bind(this), this.handleMouseDown = this.handleMouseDown.bind(this), e.addEventListener("mousemove", this.handleMouseMove), e.addEventListener("mouseleave", this.handleClear), e.addEventListener("mouseup", this.handleClear), this.dom.addEventListener("mousedown", this.handleMouseDown);
|
|
1751
1775
|
},
|
|
1752
|
-
destory(
|
|
1753
|
-
|
|
1776
|
+
destory(e) {
|
|
1777
|
+
e.removeEventListener("mousemove", this.handleMouseMove), e.removeEventListener("mouseleave", this.handleClear), e.removeEventListener("mouseup", this.handleClear), this.dom.removeEventListener("mousedown", this.handleMouseDown);
|
|
1754
1778
|
},
|
|
1755
1779
|
clear() {
|
|
1756
1780
|
this.mousedown = !1, this.lastX = 0, this.lastY = 0;
|
|
1757
1781
|
}
|
|
1758
1782
|
};
|
|
1759
1783
|
}, Ne = {
|
|
1760
|
-
create:
|
|
1761
|
-
}
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
n && i ? (h = l + i.delta1.x, a = c + i.delta1.y, p = u + i.delta2.x, g = d + i.delta2.y) : (c + d) / 2 - c <= o.height / 2 ? (h = (o.x + o.width - s.x) / this.scaleVal + 100, a = c, p = (r.x + r.width - s.x) / this.scaleVal + 100, g = d) : (h = (l + u) / 2, a = (c + d) / 2, p = (l + u) / 2, g = (c + d) / 2);
|
|
1768
|
-
const m = {
|
|
1784
|
+
create: Ln
|
|
1785
|
+
};
|
|
1786
|
+
function ne(t, e, n) {
|
|
1787
|
+
const { offsetLeft: i, offsetTop: o } = W(t.nodes, e), s = e.offsetWidth, r = e.offsetHeight, l = i + s / 2, c = o + r / 2, h = l + n.x, a = c + n.y;
|
|
1788
|
+
return {
|
|
1789
|
+
w: s,
|
|
1790
|
+
h: r,
|
|
1769
1791
|
cx: l,
|
|
1770
1792
|
cy: c,
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
}
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1793
|
+
ctrlX: h,
|
|
1794
|
+
ctrlY: a
|
|
1795
|
+
};
|
|
1796
|
+
}
|
|
1797
|
+
function V(t) {
|
|
1798
|
+
let e, n;
|
|
1799
|
+
const i = (t.cy - t.ctrlY) / (t.ctrlX - t.cx);
|
|
1800
|
+
return i > t.h / t.w || i < -t.h / t.w ? t.cy - t.ctrlY < 0 ? (e = t.cx - t.h / 2 / i, n = t.cy + t.h / 2) : (e = t.cx + t.h / 2 / i, n = t.cy - t.h / 2) : t.cx - t.ctrlX < 0 ? (e = t.cx + t.w / 2, n = t.cy - t.w * i / 2) : (e = t.cx - t.w / 2, n = t.cy + t.w * i / 2), {
|
|
1801
|
+
x: e,
|
|
1802
|
+
y: n
|
|
1803
|
+
};
|
|
1804
|
+
}
|
|
1805
|
+
const Mn = function(t, e, n, i) {
|
|
1806
|
+
const o = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
1807
|
+
return N(o, {
|
|
1808
|
+
"text-anchor": "middle",
|
|
1809
|
+
x: e + "",
|
|
1810
|
+
y: n + "",
|
|
1811
|
+
fill: i || "#666"
|
|
1812
|
+
}), o.dataset.type = "custom-link", o.innerHTML = t, o;
|
|
1813
|
+
}, Tn = function(t, e, n, i) {
|
|
1814
|
+
if (!t || !e)
|
|
1815
|
+
return;
|
|
1816
|
+
const o = performance.now();
|
|
1817
|
+
this.hideLinkController();
|
|
1818
|
+
const s = ne(this, t, n.delta1), r = ne(this, e, 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(
|
|
1819
|
+
`M ${l} ${c} C ${h} ${a} ${u} ${d} ${p} ${g}`,
|
|
1820
|
+
`M ${m.x1} ${m.y1} L ${p} ${g} L ${m.x2} ${m.y2}`
|
|
1821
|
+
), 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"]);
|
|
1822
|
+
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));
|
|
1823
|
+
const y = performance.now();
|
|
1824
|
+
console.log(`DrawCustomLink Execution time: ${y - o} ms`);
|
|
1825
|
+
}, $n = function(t, e) {
|
|
1826
|
+
const n = {
|
|
1827
|
+
id: U(),
|
|
1828
|
+
label: "Custom Link",
|
|
1829
|
+
from: t.nodeObj.id,
|
|
1830
|
+
to: e.nodeObj.id,
|
|
1783
1831
|
delta1: {
|
|
1784
|
-
x:
|
|
1785
|
-
y:
|
|
1832
|
+
x: 0,
|
|
1833
|
+
y: -200
|
|
1786
1834
|
},
|
|
1787
1835
|
delta2: {
|
|
1788
|
-
x:
|
|
1789
|
-
y:
|
|
1836
|
+
x: 0,
|
|
1837
|
+
y: -200
|
|
1790
1838
|
}
|
|
1791
|
-
}
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
}, Sn = function(e) {
|
|
1797
|
-
let t;
|
|
1798
|
-
if (e ? t = e : t = this.currentLink, !t)
|
|
1799
|
-
return;
|
|
1800
|
-
console.log(t), this.hideLinkController();
|
|
1801
|
-
const n = t.linkObj.id;
|
|
1802
|
-
console.log(n), delete this.linkData[n], t.remove(), t = null;
|
|
1803
|
-
}, Mn = function(e) {
|
|
1804
|
-
this.currentLink = e;
|
|
1805
|
-
const t = e.linkObj;
|
|
1806
|
-
if (!t)
|
|
1839
|
+
};
|
|
1840
|
+
this.drawCustomLink(t, e, n);
|
|
1841
|
+
}, Dn = function(t) {
|
|
1842
|
+
let e;
|
|
1843
|
+
if (t ? e = t : e = this.currentLink, !e)
|
|
1807
1844
|
return;
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
w: r.width,
|
|
1817
|
-
h: r.height
|
|
1818
|
-
}, p = l + t.delta1.x, g = c + t.delta1.y, m = u + t.delta2.x, f = d + t.delta2.y;
|
|
1819
|
-
this.showLinkController(p, g, m, f, t, h, a);
|
|
1820
|
-
}, Ln = function() {
|
|
1845
|
+
this.hideLinkController();
|
|
1846
|
+
const n = e.linkObj.id;
|
|
1847
|
+
delete this.linkData[n], e.remove(), e = null;
|
|
1848
|
+
}, On = function(t) {
|
|
1849
|
+
this.currentLink = t;
|
|
1850
|
+
const e = t.linkObj, n = E(e.from), i = E(e.to), o = ne(this, n, e.delta1), s = ne(this, i, e.delta2);
|
|
1851
|
+
this.showLinkController(e, o, s);
|
|
1852
|
+
}, An = function() {
|
|
1821
1853
|
this.linkController.style.display = "none", this.P2.style.display = "none", this.P3.style.display = "none";
|
|
1822
|
-
},
|
|
1823
|
-
this.linkController.style.display = "initial", this.P2.style.display = "initial", this.P3.style.display = "initial";
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1854
|
+
}, Pn = function(t, e, n) {
|
|
1855
|
+
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);
|
|
1856
|
+
let { x: i, y: o } = V(e), { ctrlX: s, ctrlY: r } = e, { ctrlX: l, ctrlY: c } = n, { x: h, y: a } = V(n);
|
|
1857
|
+
this.P2.style.cssText = `top:${r}px;left:${s}px;`, this.P3.style.cssText = `top:${c}px;left:${l}px;`, N(this.line1, {
|
|
1858
|
+
x1: i + "",
|
|
1859
|
+
y1: o + "",
|
|
1860
|
+
x2: s + "",
|
|
1861
|
+
y2: r + ""
|
|
1862
|
+
}), N(this.line2, {
|
|
1863
|
+
x1: l + "",
|
|
1864
|
+
y1: c + "",
|
|
1865
|
+
x2: h + "",
|
|
1866
|
+
y2: a + ""
|
|
1867
|
+
}), 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) => {
|
|
1829
1868
|
var f;
|
|
1830
|
-
|
|
1831
|
-
const
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1869
|
+
s = s - u / this.scaleVal, r = r - d / this.scaleVal;
|
|
1870
|
+
const p = V({ ...e, ctrlX: s, ctrlY: r });
|
|
1871
|
+
i = p.x, o = p.y;
|
|
1872
|
+
const g = i / 8 + s * 3 / 8 + l * 3 / 8 + h / 8, m = o / 8 + r * 3 / 8 + c * 3 / 8 + a / 8;
|
|
1873
|
+
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], {
|
|
1874
|
+
x: g + "",
|
|
1875
|
+
y: m + ""
|
|
1876
|
+
}), N(this.line1, {
|
|
1877
|
+
x1: i + "",
|
|
1878
|
+
y1: o + "",
|
|
1879
|
+
x2: s + "",
|
|
1880
|
+
y2: r + ""
|
|
1881
|
+
}), t.delta1.x = s - e.cx, t.delta1.y = r - e.cy;
|
|
1882
|
+
}), this.helper2.init(this.map, (u, d) => {
|
|
1883
|
+
var v, x;
|
|
1884
|
+
l = l - u / this.scaleVal, c = c - d / this.scaleVal;
|
|
1885
|
+
const p = V({ ...n, ctrlX: l, ctrlY: c });
|
|
1886
|
+
h = p.x, a = p.y;
|
|
1887
|
+
const g = i / 8 + s * 3 / 8 + l * 3 / 8 + h / 8, m = o / 8 + r * 3 / 8 + c * 3 / 8 + a / 8, f = $e(l, c, h, a);
|
|
1888
|
+
this.P3.style.top = c + "px", this.P3.style.left = l + "px", (v = this.currentLink) == null || v.children[0].setAttribute("d", `M ${i} ${o} C ${s} ${r} ${l} ${c} ${h} ${a}`), (x = this.currentLink) == null || x.children[1].setAttribute("d", `M ${f.x1} ${f.y1} L ${h} ${a} L ${f.x2} ${f.y2}`), N(this.currentLink.children[2], {
|
|
1889
|
+
x: g + "",
|
|
1890
|
+
y: m + ""
|
|
1891
|
+
}), N(this.line2, {
|
|
1892
|
+
x1: l + "",
|
|
1893
|
+
y1: c + "",
|
|
1894
|
+
x2: h + "",
|
|
1895
|
+
y2: a + ""
|
|
1896
|
+
}), t.delta2.x = l - n.cx, t.delta2.y = c - n.cy;
|
|
1840
1897
|
});
|
|
1841
|
-
}
|
|
1898
|
+
};
|
|
1899
|
+
function jn() {
|
|
1900
|
+
this.linkSvgGroup.innerHTML = "";
|
|
1901
|
+
for (const t in this.linkData) {
|
|
1902
|
+
const e = this.linkData[t];
|
|
1903
|
+
this.drawCustomLink(E(e.from), E(e.to), e, !0);
|
|
1904
|
+
}
|
|
1905
|
+
this.nodes.appendChild(this.linkSvgGroup);
|
|
1906
|
+
}
|
|
1907
|
+
function Hn(t) {
|
|
1908
|
+
if (console.time("editSummary"), !t)
|
|
1909
|
+
return;
|
|
1910
|
+
const e = t.children[2];
|
|
1911
|
+
console.log(e, t), Ae(this, e, (n) => {
|
|
1912
|
+
var s;
|
|
1913
|
+
const i = t.linkObj, o = ((s = n.textContent) == null ? void 0 : s.trim()) || "";
|
|
1914
|
+
o === "" ? i.label = origin : i.label = o, n.remove(), o !== origin && (e.innerHTML = i.label, this.linkDiv());
|
|
1915
|
+
}), console.timeEnd("editSummary");
|
|
1916
|
+
}
|
|
1917
|
+
const Bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1842
1918
|
__proto__: null,
|
|
1843
|
-
createLink:
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1919
|
+
createLink: $n,
|
|
1920
|
+
drawCustomLink: Tn,
|
|
1921
|
+
editCutsomLinkLabel: Hn,
|
|
1922
|
+
hideLinkController: An,
|
|
1923
|
+
removeLink: Dn,
|
|
1924
|
+
renderCustomLink: jn,
|
|
1925
|
+
selectLink: On,
|
|
1926
|
+
showLinkController: Pn
|
|
1927
|
+
}, Symbol.toStringTag, { value: "Module" })), zn = function(t) {
|
|
1928
|
+
var c, h;
|
|
1929
|
+
if (t.length === 0)
|
|
1851
1930
|
throw new Error("No selected node.");
|
|
1852
|
-
if (
|
|
1853
|
-
const
|
|
1854
|
-
if (!
|
|
1931
|
+
if (t.length === 1) {
|
|
1932
|
+
const a = t[0].nodeObj, u = t[0].nodeObj.parent;
|
|
1933
|
+
if (!u)
|
|
1855
1934
|
throw new Error("Can not select root node.");
|
|
1856
|
-
const
|
|
1935
|
+
const d = u.children.findIndex((p) => a === p);
|
|
1857
1936
|
return {
|
|
1858
|
-
parent:
|
|
1859
|
-
start:
|
|
1860
|
-
end:
|
|
1937
|
+
parent: u.id,
|
|
1938
|
+
start: d,
|
|
1939
|
+
end: d
|
|
1861
1940
|
};
|
|
1862
1941
|
}
|
|
1863
|
-
let
|
|
1864
|
-
const n =
|
|
1865
|
-
let
|
|
1866
|
-
const
|
|
1867
|
-
for (;
|
|
1868
|
-
const p =
|
|
1869
|
-
|
|
1942
|
+
let e = 0;
|
|
1943
|
+
const n = t.map((a) => {
|
|
1944
|
+
let u = a.nodeObj;
|
|
1945
|
+
const d = [];
|
|
1946
|
+
for (; u.parent; ) {
|
|
1947
|
+
const p = u.parent, g = p.children, m = g == null ? void 0 : g.indexOf(u);
|
|
1948
|
+
u = p, d.unshift({ node: u, index: m });
|
|
1870
1949
|
}
|
|
1871
|
-
return
|
|
1950
|
+
return d.length > e && (e = d.length), d;
|
|
1872
1951
|
});
|
|
1873
1952
|
let i = 0;
|
|
1874
1953
|
e:
|
|
1875
|
-
for (; i <
|
|
1876
|
-
const
|
|
1877
|
-
for (let
|
|
1878
|
-
if (((
|
|
1954
|
+
for (; i < e; i++) {
|
|
1955
|
+
const a = (c = n[0][i]) == null ? void 0 : c.node;
|
|
1956
|
+
for (let u = 1; u < n.length; u++)
|
|
1957
|
+
if (((h = n[u][i]) == null ? void 0 : h.node) !== a)
|
|
1879
1958
|
break e;
|
|
1880
1959
|
}
|
|
1881
1960
|
if (!i)
|
|
1882
1961
|
throw new Error("Can not select root node.");
|
|
1883
|
-
const
|
|
1962
|
+
const o = n.map((a) => a[i - 1].index).sort(), s = o[0] || 0, r = o[o.length - 1] || 0, l = n[0][i - 1].node;
|
|
1884
1963
|
if (l.root)
|
|
1885
1964
|
throw new Error("Please select nodes in the same main topic.");
|
|
1886
1965
|
return {
|
|
1887
1966
|
parent: l.id,
|
|
1888
|
-
start:
|
|
1967
|
+
start: s,
|
|
1889
1968
|
end: r
|
|
1890
1969
|
};
|
|
1891
|
-
},
|
|
1892
|
-
const
|
|
1893
|
-
return
|
|
1894
|
-
},
|
|
1970
|
+
}, Rn = function(t) {
|
|
1971
|
+
const e = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
1972
|
+
return e.setAttribute("id", t), e;
|
|
1973
|
+
}, Ce = function(t, e) {
|
|
1895
1974
|
const n = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
1896
|
-
return
|
|
1897
|
-
d:
|
|
1898
|
-
stroke:
|
|
1975
|
+
return N(n, {
|
|
1976
|
+
d: t,
|
|
1977
|
+
stroke: e || "#666",
|
|
1899
1978
|
fill: "none",
|
|
1900
1979
|
"stroke-linecap": "round",
|
|
1901
1980
|
"stroke-width": "2"
|
|
1902
1981
|
}), n;
|
|
1903
|
-
},
|
|
1904
|
-
const
|
|
1905
|
-
return
|
|
1982
|
+
}, _e = function(t, e, n, i, o) {
|
|
1983
|
+
const s = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
1984
|
+
return N(s, {
|
|
1906
1985
|
"text-anchor": i,
|
|
1907
|
-
x:
|
|
1986
|
+
x: e + "",
|
|
1908
1987
|
y: n + "",
|
|
1909
|
-
fill:
|
|
1910
|
-
}),
|
|
1911
|
-
},
|
|
1912
|
-
var
|
|
1913
|
-
const n =
|
|
1914
|
-
let
|
|
1915
|
-
return i.root === !0 ?
|
|
1916
|
-
},
|
|
1988
|
+
fill: o || "#666"
|
|
1989
|
+
}), s.innerHTML = t, s;
|
|
1990
|
+
}, qn = (t) => E(t).parentElement.parentElement, Fn = function({ parent: t, start: e }) {
|
|
1991
|
+
var s, r;
|
|
1992
|
+
const n = E(t), i = n.nodeObj;
|
|
1993
|
+
let o;
|
|
1994
|
+
return i.root === !0 ? o = (s = E(i.children[e].id).closest("me-main")) == null ? void 0 : s.className : o = (r = n.closest("me-main")) == null ? void 0 : r.className, o;
|
|
1995
|
+
}, We = function(t, e) {
|
|
1917
1996
|
var _;
|
|
1918
|
-
const { id: n, text: i, parent:
|
|
1919
|
-
let
|
|
1920
|
-
for (let
|
|
1921
|
-
const
|
|
1922
|
-
if (!
|
|
1923
|
-
return console.warn("Child not found"),
|
|
1924
|
-
const
|
|
1925
|
-
|
|
1997
|
+
const { id: n, text: i, parent: o, start: s, end: r } = e, l = t.nodes, h = E(o).nodeObj, a = Fn(e);
|
|
1998
|
+
let u = 1 / 0, d = 0, p = 0, g = 0;
|
|
1999
|
+
for (let Y = s; Y <= r; Y++) {
|
|
2000
|
+
const de = (_ = h.children) == null ? void 0 : _[Y];
|
|
2001
|
+
if (!de)
|
|
2002
|
+
return console.warn("Child not found"), t.removeSummary(n), null;
|
|
2003
|
+
const G = qn(de.id), { offsetLeft: J, offsetTop: he } = W(l, G);
|
|
2004
|
+
Y === s && (p = he), Y === r && (g = he + G.offsetHeight), J < u && (u = J), G.offsetWidth + J > d && (d = G.offsetWidth + J);
|
|
1926
2005
|
}
|
|
1927
2006
|
let m, f;
|
|
1928
|
-
const
|
|
1929
|
-
|
|
1930
|
-
const
|
|
1931
|
-
return
|
|
1932
|
-
},
|
|
1933
|
-
let
|
|
1934
|
-
this.currentNode ?
|
|
1935
|
-
const { parent:
|
|
1936
|
-
this.summaries.push(
|
|
1937
|
-
},
|
|
2007
|
+
const v = p + 10, x = g + 10, b = (v + x) / 2, y = t.theme.cssVar["--color"];
|
|
2008
|
+
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));
|
|
2009
|
+
const C = Rn("s-" + n);
|
|
2010
|
+
return C.appendChild(m), C.appendChild(f), C.summaryObj = e, t.summarySvg.appendChild(C), C;
|
|
2011
|
+
}, Vn = function() {
|
|
2012
|
+
let t = [];
|
|
2013
|
+
this.currentNode ? t = [this.currentNode] : this.currentNodes && (t = this.currentNodes);
|
|
2014
|
+
const { parent: e, start: n, end: i } = zn(t), o = { id: U(), parent: e, start: n, end: i, text: "summary" }, s = We(this, o);
|
|
2015
|
+
this.summaries.push(o), this.editSummary(s);
|
|
2016
|
+
}, Wn = function(t) {
|
|
1938
2017
|
var n;
|
|
1939
|
-
const
|
|
1940
|
-
|
|
1941
|
-
},
|
|
1942
|
-
const
|
|
1943
|
-
|
|
1944
|
-
x:
|
|
1945
|
-
y:
|
|
1946
|
-
width:
|
|
1947
|
-
height:
|
|
2018
|
+
const e = this.summaries.findIndex((i) => i.id === t);
|
|
2019
|
+
e > -1 && (this.summaries.splice(e, 1), (n = document.querySelector("#s-" + t)) == null || n.remove());
|
|
2020
|
+
}, Yn = function(t) {
|
|
2021
|
+
const e = t.children[1].getBBox(), n = 6, i = 3, o = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
2022
|
+
N(o, {
|
|
2023
|
+
x: e.x - n + "",
|
|
2024
|
+
y: e.y - n + "",
|
|
2025
|
+
width: e.width + n * 2 + "",
|
|
2026
|
+
height: e.height + n * 2 + "",
|
|
1948
2027
|
rx: i + "",
|
|
1949
2028
|
stroke: this.theme.cssVar["--selected"] || "#4dc4ff",
|
|
1950
2029
|
"stroke-width": "2",
|
|
1951
2030
|
fill: "none"
|
|
1952
|
-
}),
|
|
1953
|
-
},
|
|
1954
|
-
var
|
|
1955
|
-
(
|
|
1956
|
-
},
|
|
1957
|
-
this.summarySvg.innerHTML = "", this.summaries.forEach((
|
|
1958
|
-
|
|
2031
|
+
}), o.classList.add("selected"), t.appendChild(o), this.currentSummary = t;
|
|
2032
|
+
}, In = function() {
|
|
2033
|
+
var t, e;
|
|
2034
|
+
(e = (t = this.currentSummary) == null ? void 0 : t.querySelector("rect")) == null || e.remove(), this.currentSummary = null;
|
|
2035
|
+
}, Xn = function() {
|
|
2036
|
+
this.summarySvg.innerHTML = "", this.summaries.forEach((t) => {
|
|
2037
|
+
We(this, t);
|
|
1959
2038
|
}), this.nodes.insertAdjacentElement("beforeend", this.summarySvg);
|
|
1960
|
-
},
|
|
1961
|
-
if (console.time("editSummary"), !
|
|
2039
|
+
}, Kn = function(t) {
|
|
2040
|
+
if (console.time("editSummary"), !t)
|
|
1962
2041
|
return;
|
|
1963
|
-
const
|
|
1964
|
-
this
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
n.style.cssText = `min-width:${100 - 8}px;position:absolute;left:${s};top:${o};`, Ve(e.summaryObj) === "lhs" ? n.style.cssText += "transform: translate(-100%, -100%);" : n.style.cssText += "transform: translate(0, -100%);", n.focus(), $e(n), n.addEventListener("keydown", (r) => {
|
|
1969
|
-
r.stopPropagation();
|
|
1970
|
-
const l = r.key;
|
|
1971
|
-
if (l === "Enter" || l === "Tab") {
|
|
1972
|
-
if (r.shiftKey)
|
|
1973
|
-
return;
|
|
1974
|
-
r.preventDefault(), n.blur(), this.map.focus();
|
|
1975
|
-
}
|
|
1976
|
-
}), n.addEventListener("blur", () => {
|
|
1977
|
-
var c;
|
|
1978
|
-
if (!n)
|
|
1979
|
-
return;
|
|
1980
|
-
const r = e.summaryObj, l = ((c = n.textContent) == null ? void 0 : c.trim()) || "";
|
|
1981
|
-
l === "" ? r.text = i : r.text = l, n.remove(), l !== i && (t.innerHTML = r.text, this.linkDiv(), this.bus.fire("operation", {
|
|
2042
|
+
const e = t.childNodes[1];
|
|
2043
|
+
Ae(this, e, (n) => {
|
|
2044
|
+
var s;
|
|
2045
|
+
const i = t.summaryObj, o = ((s = n.textContent) == null ? void 0 : s.trim()) || "";
|
|
2046
|
+
o === "" ? i.text = origin : i.text = o, n.remove(), o !== origin && (e.innerHTML = i.text, this.linkDiv(), this.bus.fire("operation", {
|
|
1982
2047
|
name: "finishEditSummary",
|
|
1983
|
-
obj:
|
|
1984
|
-
origin
|
|
2048
|
+
obj: i,
|
|
2049
|
+
origin
|
|
1985
2050
|
}));
|
|
1986
2051
|
}), console.timeEnd("editSummary");
|
|
1987
|
-
},
|
|
2052
|
+
}, Un = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
2053
|
+
__proto__: null,
|
|
2054
|
+
createSummary: Vn,
|
|
2055
|
+
editSummary: Kn,
|
|
2056
|
+
removeSummary: Wn,
|
|
2057
|
+
renderSummary: Xn,
|
|
2058
|
+
selectSummary: Yn,
|
|
2059
|
+
unselectSummary: In
|
|
2060
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
2061
|
+
function Gn(t, e) {
|
|
2062
|
+
const n = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
2063
|
+
return N(n, {
|
|
2064
|
+
version: "1.1",
|
|
2065
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
2066
|
+
height: t,
|
|
2067
|
+
width: e
|
|
2068
|
+
}), n;
|
|
2069
|
+
}
|
|
2070
|
+
function Jn(t, e) {
|
|
2071
|
+
return (parseInt(t) - parseInt(e)) / 2;
|
|
2072
|
+
}
|
|
2073
|
+
function Qn(t, e, n, i) {
|
|
2074
|
+
const o = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
2075
|
+
return t.childNodes[0].textContent.split(`
|
|
2076
|
+
`).forEach((l, c) => {
|
|
2077
|
+
const h = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
2078
|
+
N(h, {
|
|
2079
|
+
x: n + parseInt(e.paddingLeft) + "",
|
|
2080
|
+
y: i + parseInt(e.paddingTop) + Jn(e.lineHeight, e.fontSize) * (c + 1) + parseFloat(e.fontSize) * (c + 1) + "",
|
|
2081
|
+
"text-anchor": "start",
|
|
2082
|
+
"font-family": e.fontFamily,
|
|
2083
|
+
"font-size": `${e.fontSize}`,
|
|
2084
|
+
"font-weight": `${e.fontWeight}`,
|
|
2085
|
+
fill: `${e.color}`
|
|
2086
|
+
}), h.innerHTML = l, o.appendChild(h);
|
|
2087
|
+
}), o;
|
|
2088
|
+
}
|
|
2089
|
+
function Zn(t, e, n, i) {
|
|
2090
|
+
const o = t.childNodes[0].textContent, s = document.createElementNS("http://www.w3.org/2000/svg", "foreignObject");
|
|
2091
|
+
N(s, {
|
|
2092
|
+
x: n + parseInt(e.paddingLeft) + "",
|
|
2093
|
+
y: i + parseInt(e.paddingTop) + "",
|
|
2094
|
+
width: e.width,
|
|
2095
|
+
height: e.height
|
|
2096
|
+
});
|
|
2097
|
+
const r = document.createElement("div");
|
|
2098
|
+
return N(r, {
|
|
2099
|
+
xmlns: "http://www.w3.org/1999/xhtml",
|
|
2100
|
+
style: `font-family: ${e.fontFamily}; font-size: ${e.fontSize}; font-weight: ${e.fontWeight}; color: ${e.color}; white-space: pre-wrap;`
|
|
2101
|
+
}), r.innerHTML = o, s.appendChild(r), s;
|
|
2102
|
+
}
|
|
2103
|
+
function re(t, e, n = !1) {
|
|
2104
|
+
const i = getComputedStyle(e), { offsetLeft: o, offsetTop: s } = W(t.nodes, e), r = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
2105
|
+
N(r, {
|
|
2106
|
+
x: o + "",
|
|
2107
|
+
y: s + "",
|
|
2108
|
+
rx: i.borderRadius,
|
|
2109
|
+
ry: i.borderRadius,
|
|
2110
|
+
width: i.width,
|
|
2111
|
+
height: i.height,
|
|
2112
|
+
fill: i.backgroundColor,
|
|
2113
|
+
stroke: i.borderColor,
|
|
2114
|
+
"stroke-width": i.borderWidth
|
|
2115
|
+
});
|
|
2116
|
+
const l = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
2117
|
+
l.appendChild(r);
|
|
2118
|
+
let c;
|
|
2119
|
+
return n ? c = Zn(e, i, o, s) : c = Qn(e, i, o, s), l.appendChild(c), l;
|
|
2120
|
+
}
|
|
2121
|
+
function ei(t, e) {
|
|
2122
|
+
const n = getComputedStyle(e), { offsetLeft: i, offsetTop: o } = W(t.nodes, e), s = document.createElementNS("http://www.w3.org/2000/svg", "a"), r = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
2123
|
+
return N(r, {
|
|
2124
|
+
x: i + "",
|
|
2125
|
+
y: o + parseInt(n.fontSize) + "",
|
|
2126
|
+
"text-anchor": "start",
|
|
2127
|
+
"font-family": n.fontFamily,
|
|
2128
|
+
"font-size": `${n.fontSize}`,
|
|
2129
|
+
"font-weight": `${n.fontWeight}`,
|
|
2130
|
+
fill: `${n.color}`
|
|
2131
|
+
}), r.innerHTML = e.textContent, s.appendChild(r), s.setAttribute("href", e.href), s;
|
|
2132
|
+
}
|
|
2133
|
+
const Z = 100, ti = '<?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 = (t) => {
|
|
2134
|
+
var a, u, d;
|
|
2135
|
+
const e = t.nodes, n = e.offsetHeight + Z * 2, i = e.offsetWidth + Z * 2, o = Gn(n + "px", i + "px"), s = document.createElementNS("http://www.w3.org/2000/svg", "svg"), r = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
2136
|
+
N(r, {
|
|
2137
|
+
x: "0",
|
|
2138
|
+
y: "0",
|
|
2139
|
+
width: `${i}`,
|
|
2140
|
+
height: `${n}`,
|
|
2141
|
+
fill: t.theme.cssVar["--bgcolor"]
|
|
2142
|
+
}), o.appendChild(r), e.querySelectorAll(".subLines").forEach((p) => {
|
|
2143
|
+
const g = p.cloneNode(!0), { offsetLeft: m, offsetTop: f } = W(e, p.parentElement);
|
|
2144
|
+
g.setAttribute("x", `${m}`), g.setAttribute("y", `${f}`), s.appendChild(g);
|
|
2145
|
+
});
|
|
2146
|
+
const l = (a = e.querySelector(".lines")) == null ? void 0 : a.cloneNode(!0);
|
|
2147
|
+
l && s.appendChild(l);
|
|
2148
|
+
const c = (u = e.querySelector(".topiclinks")) == null ? void 0 : u.cloneNode(!0);
|
|
2149
|
+
c && s.appendChild(c);
|
|
2150
|
+
const h = (d = e.querySelector(".summary")) == null ? void 0 : d.cloneNode(!0);
|
|
2151
|
+
return h && s.appendChild(h), e.querySelectorAll("me-tpc").forEach((p) => {
|
|
2152
|
+
s.appendChild(re(t, p, !0));
|
|
2153
|
+
}), e.querySelectorAll(".tags > span").forEach((p) => {
|
|
2154
|
+
s.appendChild(re(t, p));
|
|
2155
|
+
}), e.querySelectorAll(".icons > span").forEach((p) => {
|
|
2156
|
+
s.appendChild(re(t, p));
|
|
2157
|
+
}), e.querySelectorAll(".hyper-link").forEach((p) => {
|
|
2158
|
+
s.appendChild(ei(t, p));
|
|
2159
|
+
}), N(s, {
|
|
2160
|
+
x: Z + "",
|
|
2161
|
+
y: Z + "",
|
|
2162
|
+
overflow: "visible"
|
|
2163
|
+
}), o.appendChild(s), ti + o.outerHTML;
|
|
2164
|
+
};
|
|
2165
|
+
function ni(t) {
|
|
2166
|
+
return new Promise((e, n) => {
|
|
2167
|
+
const i = new FileReader();
|
|
2168
|
+
i.onload = (o) => {
|
|
2169
|
+
e(o.target.result);
|
|
2170
|
+
}, i.onerror = (o) => {
|
|
2171
|
+
n(o);
|
|
2172
|
+
}, i.readAsDataURL(t);
|
|
2173
|
+
});
|
|
2174
|
+
}
|
|
2175
|
+
const ii = function() {
|
|
2176
|
+
const t = Ye(this);
|
|
2177
|
+
return new Blob([t], { type: "image/svg+xml" });
|
|
2178
|
+
}, oi = async function() {
|
|
2179
|
+
const t = Ye(this), e = new Blob([t], { type: "image/svg+xml" }), n = await ni(e);
|
|
2180
|
+
return new Promise((i, o) => {
|
|
2181
|
+
const s = new Image();
|
|
2182
|
+
s.setAttribute("crossOrigin", "anonymous"), s.onload = () => {
|
|
2183
|
+
const r = document.createElement("canvas");
|
|
2184
|
+
r.width = s.width, r.height = s.height, r.getContext("2d").drawImage(s, 0, 0), r.toBlob(i, "image/png", 1);
|
|
2185
|
+
}, s.src = n, s.onerror = o;
|
|
2186
|
+
});
|
|
2187
|
+
}, si = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1988
2188
|
__proto__: null,
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
removeSummary: Dn,
|
|
1992
|
-
renderSummary: Rn,
|
|
1993
|
-
selectSummary: Hn,
|
|
1994
|
-
unselectSummary: Bn
|
|
2189
|
+
exportPng: oi,
|
|
2190
|
+
exportSvg: ii
|
|
1995
2191
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1996
|
-
function
|
|
2192
|
+
function ri(t, e) {
|
|
1997
2193
|
return async function(...n) {
|
|
1998
|
-
const i = this.before[
|
|
1999
|
-
i && !await i.apply(this, n) ||
|
|
2194
|
+
const i = this.before[e];
|
|
2195
|
+
i && !await i.apply(this, n) || t.apply(this, n);
|
|
2000
2196
|
};
|
|
2001
2197
|
}
|
|
2002
|
-
const
|
|
2003
|
-
for (let
|
|
2004
|
-
const
|
|
2005
|
-
|
|
2198
|
+
const ke = Object.keys(Ve), Ie = {};
|
|
2199
|
+
for (let t = 0; t < ke.length; t++) {
|
|
2200
|
+
const e = ke[t];
|
|
2201
|
+
Ie[e] = ri(Ve[e], e);
|
|
2006
2202
|
}
|
|
2007
|
-
const
|
|
2008
|
-
getObjById:
|
|
2009
|
-
generateNewObj:
|
|
2010
|
-
layout:
|
|
2011
|
-
linkDiv:
|
|
2012
|
-
editTopic:
|
|
2013
|
-
createWrapper:
|
|
2014
|
-
createParent:
|
|
2015
|
-
createChildren:
|
|
2016
|
-
createTopic:
|
|
2017
|
-
findEle:
|
|
2018
|
-
changeTheme:
|
|
2019
|
-
...
|
|
2020
|
-
...
|
|
2021
|
-
|
|
2022
|
-
...
|
|
2023
|
-
|
|
2024
|
-
|
|
2203
|
+
const li = {
|
|
2204
|
+
getObjById: Me,
|
|
2205
|
+
generateNewObj: Ue,
|
|
2206
|
+
layout: lt,
|
|
2207
|
+
linkDiv: bt,
|
|
2208
|
+
editTopic: pt,
|
|
2209
|
+
createWrapper: dt,
|
|
2210
|
+
createParent: ht,
|
|
2211
|
+
createChildren: ut,
|
|
2212
|
+
createTopic: ft,
|
|
2213
|
+
findEle: E,
|
|
2214
|
+
changeTheme: qt,
|
|
2215
|
+
...fn,
|
|
2216
|
+
...Ie,
|
|
2217
|
+
...Bn,
|
|
2218
|
+
...Un,
|
|
2219
|
+
...si,
|
|
2220
|
+
init(t) {
|
|
2221
|
+
if (!t || !t.nodeData)
|
|
2025
2222
|
return new Error("MindElixir: `data` is required");
|
|
2026
|
-
|
|
2223
|
+
t.direction !== void 0 && (this.direction = t.direction), this.changeTheme(t.theme || this.theme, !1), this.nodeData = t.nodeData, T(this.nodeData), this.linkData = t.linkData || {}, this.summaries = t.summaries || [], this.toolBar && Ot(this), this.keypress && _t(this), Xe() && this.mobileMenu ? kt(this) : this.contextMenu && Et(this, this.contextMenuOption), this.draggable && Mt(this), this.allowUndo && Tt(this), Rt(this), this.toCenter(), this.layout(), this.linkDiv();
|
|
2027
2224
|
}
|
|
2028
|
-
},
|
|
2029
|
-
function
|
|
2030
|
-
el:
|
|
2031
|
-
direction:
|
|
2225
|
+
}, I = document;
|
|
2226
|
+
function $({
|
|
2227
|
+
el: t,
|
|
2228
|
+
direction: e,
|
|
2032
2229
|
locale: n,
|
|
2033
2230
|
draggable: i,
|
|
2034
|
-
editable:
|
|
2035
|
-
contextMenu:
|
|
2231
|
+
editable: o,
|
|
2232
|
+
contextMenu: s,
|
|
2036
2233
|
contextMenuOption: r,
|
|
2037
2234
|
toolBar: l,
|
|
2038
2235
|
keypress: c,
|
|
2039
|
-
before:
|
|
2040
|
-
newTopicName:
|
|
2041
|
-
allowUndo:
|
|
2042
|
-
mainLinkStyle:
|
|
2236
|
+
before: h,
|
|
2237
|
+
newTopicName: a,
|
|
2238
|
+
allowUndo: u,
|
|
2239
|
+
mainLinkStyle: d,
|
|
2043
2240
|
subLinkStyle: p,
|
|
2044
2241
|
overflowHidden: g,
|
|
2045
2242
|
mobileMenu: m,
|
|
2046
2243
|
theme: f
|
|
2047
2244
|
}) {
|
|
2048
|
-
console.log("ME_version " +
|
|
2049
|
-
let
|
|
2050
|
-
const
|
|
2051
|
-
if (
|
|
2245
|
+
console.log("ME_version " + $.version, this);
|
|
2246
|
+
let v = null;
|
|
2247
|
+
const x = Object.prototype.toString.call(t);
|
|
2248
|
+
if (x === "[object HTMLDivElement]" ? v = t : x === "[object String]" && (v = document.querySelector(t)), !v)
|
|
2052
2249
|
throw new Error("MindElixir: el is not a valid element");
|
|
2053
|
-
|
|
2054
|
-
const
|
|
2055
|
-
this.theme = f || (
|
|
2056
|
-
const y =
|
|
2057
|
-
y.className = "map-canvas", this.map = y, this.map.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.mindElixirBox.appendChild(this.container), this.nodes =
|
|
2250
|
+
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 e == "number" ? e : 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";
|
|
2251
|
+
const b = window.matchMedia("(prefers-color-scheme: dark)");
|
|
2252
|
+
this.theme = f || (b.matches ? Le : Se);
|
|
2253
|
+
const y = I.createElement("div");
|
|
2254
|
+
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);
|
|
2058
2255
|
}
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2256
|
+
$.prototype = li;
|
|
2257
|
+
$.LEFT = S;
|
|
2258
|
+
$.RIGHT = H;
|
|
2259
|
+
$.SIDE = K;
|
|
2260
|
+
$.THEME = Se;
|
|
2261
|
+
$.DARK_THEME = Le;
|
|
2262
|
+
$.version = "3.2.0";
|
|
2263
|
+
$.E = E;
|
|
2264
|
+
$.new = (t) => ({
|
|
2068
2265
|
nodeData: {
|
|
2069
|
-
id:
|
|
2070
|
-
topic:
|
|
2266
|
+
id: U(),
|
|
2267
|
+
topic: t || "new topic",
|
|
2071
2268
|
root: !0,
|
|
2072
2269
|
children: []
|
|
2073
2270
|
},
|
|
2074
2271
|
linkData: {}
|
|
2075
2272
|
});
|
|
2076
2273
|
export {
|
|
2077
|
-
|
|
2274
|
+
$ as default
|
|
2078
2275
|
};
|