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