mind-elixir 4.5.1 → 5.0.0-beta.1
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 +7 -7
- package/dist/MindElixir.js +511 -518
- package/dist/MindElixirLite.iife.js +7 -7
- package/dist/MindElixirLite.js +373 -390
- package/dist/mind-elixir.d.ts +663 -0
- package/dist/types/docs.d.ts +2 -2
- package/dist/types/index.d.ts +13 -16
- package/dist/types/interact.d.ts +0 -4
- package/dist/types/methods.d.ts +9 -11
- package/dist/types/nodeOperation.d.ts +1 -1
- package/dist/types/summary.d.ts +0 -1
- package/dist/types/tsdoc-metadata.json +11 -0
- package/dist/types/types/index.d.ts +4 -22
- package/dist/types/utils/domManipulation.d.ts +1 -1
- package/dist/types/utils/dragMoveHelper.d.ts +1 -2
- package/dist/types/utils/pubsub.d.ts +2 -2
- package/package.json +92 -92
- package/readme.md +430 -430
package/dist/MindElixirLite.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".mind-elixir{--gap: 30px;--root-radius: 30px;--main-radius: 20px;--root-color: #ffffff;--root-bgcolor: #4c4f69;--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;position:relative;-webkit-tap-highlight-color:rgba(0,0,0,0);font-family:-apple-system,BlinkMacSystemFont,Helvetica Neue,PingFang SC,Microsoft YaHei,Source Han Sans SC,Noto Sans CJK SC,WenQuanYi Micro Hei,sans-serif}.mind-elixir .hyper-link{text-decoration:none;margin-left:.3em}.map-container{-webkit-user-select:none;user-select:none;height:100%;width:100%;overflow:scroll;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 .lhs{direction:rtl}.map-container .lhs me-tpc{direction:ltr}.map-container .map-canvas{height:20000px;width:20000px;position:relative;-webkit-user-select:none;user-select:none;transition:transform .3s;transform:scale(1);background-color:var(--bgcolor)}.map-container .map-canvas me-nodes{position:absolute;display:flex;justify-content:center;align-items:center;height:fit-content;width:fit-content}.map-container .map-canvas me-root{position:relative}.map-container .map-canvas me-root me-tpc{display:block;font-size:25px;color:var(--root-color);padding:10px var(--gap);border-radius:var(--root-radius);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}.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+DQo8c3ZnIHQ9IjE2NTY2NTQ3MTcyNDIiIGNsYXNzPSJpY29uIiB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB2ZXJzaW9uPSIxLjEiDQogICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIg0KICAgIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+DQogICAgPHBhdGggZD0iTTUxMiA3NC42NjY2NjdDMjcwLjkzMzMzMyA3NC42NjY2NjcgNzQuNjY2NjY3IDI3MC45MzMzMzMgNzQuNjY2NjY3IDUxMlMyNzAuOTMzMzMzIDk0OS4zMzMzMzMgNTEyIDk0OS4zMzMzMzMgOTQ5LjMzMzMzMyA3NTMuMDY2NjY3IDk0OS4zMzMzMzMgNTEyIDc1My4wNjY2NjcgNzQuNjY2NjY3IDUxMiA3NC42NjY2Njd6IiBzdHJva2Utd2lkdGg9IjU0IiBzdHJva2U9J2JsYWNrJyBmaWxsPSd3aGl0ZScgPjwvcGF0aD4NCiAgICA8cGF0aCBkPSJNNjgyLjY2NjY2NyA0ODBoLTEzOC42NjY2NjdWMzQxLjMzMzMzM2MwLTE3LjA2NjY2Ny0xNC45MzMzMzMtMzItMzItMzJzLTMyIDE0LjkzMzMzMy0zMiAzMnYxMzguNjY2NjY3SDM0MS4zMzMzMzNjLTE3LjA2NjY2NyAwLTMyIDE0LjkzMzMzMy0zMiAzMnMxNC45MzMzMzMgMzIgMzIgMzJoMTM4LjY2NjY2N1Y2ODIuNjY2NjY3YzAgMTcuMDY2NjY3IDE0LjkzMzMzMyAzMiAzMiAzMnMzMi0xNC45MzMzMzMgMzItMzJ2LTEzOC42NjY2NjdINjgyLjY2NjY2N2MxNy4wNjY2NjcgMCAzMi0xNC45MzMzMzMgMzItMzJzLTE0LjkzMzMzMy0zMi0zMi0zMnoiPjwvcGF0aD4NCjwvc3ZnPg==);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+DQo8c3ZnIHQ9IjE2NTY2NTU1NjQ5ODUiIGNsYXNzPSJpY29uIiB2aWV3Qm94PSIwIDAgMTAyNCAxMDI0IiB2ZXJzaW9uPSIxLjEiDQogICAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIg0KICAgIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iMjAwIiBoZWlnaHQ9IjIwMCI+DQogICAgPHBhdGggZD0iTTUxMiA3NC42NjY2NjdDMjcwLjkzMzMzMyA3NC42NjY2NjcgNzQuNjY2NjY3IDI3MC45MzMzMzMgNzQuNjY2NjY3IDUxMlMyNzAuOTMzMzMzIDk0OS4zMzMzMzMgNTEyIDk0OS4zMzMzMzMgOTQ5LjMzMzMzMyA3NTMuMDY2NjY3IDk0OS4zMzMzMzMgNTEyIDc1My4wNjY2NjcgNzQuNjY2NjY3IDUxMiA3NC42NjY2Njd6IiBzdHJva2Utd2lkdGg9IjU0IiBzdHJva2U9J2JsYWNrJyBmaWxsPSd3aGl0ZScgPjwvcGF0aD4NCiAgICA8cGF0aCBkPSJNNjgyLjY2NjY2NyA1NDRIMzQxLjMzMzMzM2MtMTcuMDY2NjY3IDAtMzItMTQuOTMzMzMzLTMyLTMyczE0LjkzMzMzMy0zMiAzMi0zMmgzNDEuMzMzMzM0YzE3LjA2NjY2NyAwIDMyIDE0LjkzMzMzMyAzMiAzMnMtMTQuOTMzMzMzIDMyLTMyIDMyeiI+PC9wYXRoPg0KPC9zdmc+)!important;transition:opacity .3s;opacity:0}.map-container me-parent me-epd.minus:hover{opacity:.8}.map-container .icon{width:1em;height:1em;vertical-align:-.15em;fill:currentColor;overflow:hidden}.map-container .lines,.map-container .summary,.map-container .subLines,.map-container .topiclinks,.map-container .linkcontroller{position:absolute;height:102%;width:100%;top:0;left:0}.map-container .topiclinks,.map-container .linkcontroller,.map-container .summary{pointer-events:none}.map-container .topiclinks text,.map-container .linkcontroller text,.map-container .summary text{pointer-events:all}.map-container .topiclinks .selected,.map-container .linkcontroller .selected,.map-container .summary .selected{pointer-events:none}.map-container .lines,.map-container .subLines{pointer-events:none;z-index:-1}.map-container .topiclinks *,.map-container .linkcontroller *{z-index:100}.map-container .topiclinks g{cursor:pointer}.map-container #input-box{position:absolute;top:0;left:0;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:#f6f6f6;max-width:200px;width:fit-content;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;padding:8px 16px;border-radius:6px;border:#666666 2px solid}.map-container .selection-area{background:#4f90f22d;border:1px solid #4f90f2}.mind-elixir .context-menu{position:fixed;top:0;left:0;width:100%;height:100%;z-index:99}.mind-elixir .context-menu .menu-list{position:fixed;list-style:none;margin:0;padding:0;color:var(--panel-color);box-shadow:0 12px 15px #0003;border-radius:5px;overflow:hidden}.mind-elixir .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}.mind-elixir .context-menu .menu-list li span{line-height:20px}.mind-elixir .context-menu .menu-list li a{color:#333;text-decoration:none}.mind-elixir .context-menu .menu-list li.disabled{display:none}.mind-elixir .context-menu .menu-list li:hover{filter:brightness(.95)}.mind-elixir .context-menu .menu-list li:last-child{border-bottom:0}.mind-elixir .context-menu .menu-list li span:last-child{float:right}.mind-elixir .context-menu .key{font-size:10px;background-color:#f1f1f1;color:#333;padding:2px 5px;border-radius:3px}.mind-elixir .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(i){console.error("vite-plugin-css-injected-by-js",i)}})();
|
|
2
2
|
(function(e) {
|
|
3
3
|
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");
|
|
4
4
|
if (c && !e.__iconfont__svg__cssinject__) {
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
i || (i = !0, o());
|
|
15
15
|
}
|
|
16
16
|
t = function() {
|
|
17
|
-
var
|
|
18
|
-
(f = document.createElement("div")).innerHTML = l, l = null, (
|
|
17
|
+
var h, u, a, f;
|
|
18
|
+
(f = document.createElement("div")).innerHTML = l, l = null, (a = f.getElementsByTagName("svg")[0]) && (a.setAttribute("aria-hidden", "true"), a.style.position = "absolute", a.style.width = 0, a.style.height = 0, a.style.overflow = "hidden", h = a, (u = document.body).firstChild ? (f = h, (a = u.firstChild).parentNode.insertBefore(f, a)) : u.appendChild(h));
|
|
19
19
|
}, document.addEventListener ? ~["complete", "loaded", "interactive"].indexOf(document.readyState) ? setTimeout(t, 0) : (n = function() {
|
|
20
20
|
document.removeEventListener("DOMContentLoaded", n, !1), t();
|
|
21
21
|
}, document.addEventListener("DOMContentLoaded", n, !1)) : document.attachEvent && (o = t, s = e.document, i = !1, (r = function() {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
s.readyState == "complete" && (s.onreadystatechange = null, d());
|
|
30
30
|
});
|
|
31
31
|
})(window);
|
|
32
|
-
const j = 0,
|
|
32
|
+
const j = 0, ee = 1, te = 2, be = {
|
|
33
33
|
name: "Latte",
|
|
34
34
|
type: "light",
|
|
35
35
|
palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
|
|
@@ -43,7 +43,7 @@ const j = 0, te = 1, ne = 2, xe = {
|
|
|
43
43
|
"--panel-bgcolor": "#ffffff",
|
|
44
44
|
"--panel-border-color": "#eaeaea"
|
|
45
45
|
}
|
|
46
|
-
},
|
|
46
|
+
}, xe = {
|
|
47
47
|
name: "Dark",
|
|
48
48
|
type: "dark",
|
|
49
49
|
palette: ["#848FA0", "#748BE9", "#D2F9FE", "#4145A5", "#789AFA", "#706CF4", "#EF987F", "#775DD5", "#FCEECF", "#DA7FBC"],
|
|
@@ -57,48 +57,48 @@ const j = 0, te = 1, ne = 2, xe = {
|
|
|
57
57
|
"--panel-border-color": "#696969"
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
|
-
function
|
|
60
|
+
function ce(e) {
|
|
61
61
|
return e.replace(/&/g, "&").replace(/</g, "<").replace(/"/g, """);
|
|
62
62
|
}
|
|
63
|
-
const
|
|
63
|
+
const U = function(e, t) {
|
|
64
64
|
if (t.id === e)
|
|
65
65
|
return t;
|
|
66
66
|
if (t.children && t.children.length) {
|
|
67
67
|
for (let n = 0; n < t.children.length; n++) {
|
|
68
|
-
const o =
|
|
68
|
+
const o = U(e, t.children[n]);
|
|
69
69
|
if (o)
|
|
70
70
|
return o;
|
|
71
71
|
}
|
|
72
72
|
return null;
|
|
73
73
|
} else
|
|
74
74
|
return null;
|
|
75
|
-
},
|
|
75
|
+
}, ne = (e, t) => {
|
|
76
76
|
if (e.parent = t, e.children)
|
|
77
77
|
for (let n = 0; n < e.children.length; n++)
|
|
78
|
-
|
|
78
|
+
ne(e.children[n], e);
|
|
79
79
|
};
|
|
80
|
-
function
|
|
80
|
+
function J(e, t, n, o) {
|
|
81
81
|
const s = o - t, i = e - n;
|
|
82
82
|
let r = Math.atan(Math.abs(s) / Math.abs(i)) / 3.14 * 180;
|
|
83
83
|
i < 0 && s > 0 && (r = 180 - r), i < 0 && s < 0 && (r = 180 + r), i > 0 && s < 0 && (r = 360 - r);
|
|
84
|
-
const l = 12, c = 30, d = r + c,
|
|
84
|
+
const l = 12, c = 30, d = r + c, h = r - c;
|
|
85
85
|
return {
|
|
86
86
|
x1: n + Math.cos(Math.PI * d / 180) * l,
|
|
87
87
|
y1: o - Math.sin(Math.PI * d / 180) * l,
|
|
88
|
-
x2: n + Math.cos(Math.PI *
|
|
89
|
-
y2: o - Math.sin(Math.PI *
|
|
88
|
+
x2: n + Math.cos(Math.PI * h / 180) * l,
|
|
89
|
+
y2: o - Math.sin(Math.PI * h / 180) * l
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function oe() {
|
|
93
93
|
return ((/* @__PURE__ */ new Date()).getTime().toString(16) + Math.random().toString(16).substr(2)).substr(2, 16);
|
|
94
94
|
}
|
|
95
95
|
const Ne = function() {
|
|
96
|
-
const e =
|
|
96
|
+
const e = oe();
|
|
97
97
|
return {
|
|
98
98
|
topic: this.newTopicName,
|
|
99
99
|
id: e
|
|
100
100
|
};
|
|
101
|
-
},
|
|
101
|
+
}, k = (e, t) => {
|
|
102
102
|
let n = 0, o = 0;
|
|
103
103
|
for (; t && t !== e; )
|
|
104
104
|
n += t.offsetLeft, o += t.offsetTop, t = t.offsetParent;
|
|
@@ -106,20 +106,15 @@ const Ne = function() {
|
|
|
106
106
|
}, x = (e, t) => {
|
|
107
107
|
for (const n in t)
|
|
108
108
|
e.setAttribute(n, t[n]);
|
|
109
|
-
},
|
|
109
|
+
}, ae = (e) => e ? e.tagName === "ME-TPC" : !1, N = {
|
|
110
110
|
moved: !1,
|
|
111
111
|
// diffrentiate click and move
|
|
112
112
|
mousedown: !1,
|
|
113
113
|
onMove(e, t) {
|
|
114
114
|
if (this.mousedown) {
|
|
115
115
|
this.moved = !0;
|
|
116
|
-
const n = e.movementX, o = e.movementY
|
|
117
|
-
|
|
118
|
-
if (r < 1) {
|
|
119
|
-
const d = (s.scrollWidth - i.clientWidth * r) / 2, a = (s.scrollHeight - i.clientHeight * r) / 2;
|
|
120
|
-
l = Math.max(d, Math.min(s.scrollWidth - d - s.clientWidth, l)), c = Math.max(a, Math.min(s.scrollHeight - a - s.clientHeight, c));
|
|
121
|
-
}
|
|
122
|
-
s.scrollTo(l, c);
|
|
116
|
+
const n = e.movementX, o = e.movementY;
|
|
117
|
+
t.scrollTo(t.scrollLeft - n, t.scrollTop - o);
|
|
123
118
|
}
|
|
124
119
|
},
|
|
125
120
|
clear() {
|
|
@@ -141,15 +136,15 @@ function ke(e) {
|
|
|
141
136
|
e.helper2.clear();
|
|
142
137
|
return;
|
|
143
138
|
}
|
|
144
|
-
if (
|
|
145
|
-
|
|
139
|
+
if (N.moved) {
|
|
140
|
+
N.clear();
|
|
146
141
|
return;
|
|
147
142
|
}
|
|
148
143
|
e.clearSelection();
|
|
149
144
|
const n = t.target;
|
|
150
145
|
if (n.tagName === "ME-EPD")
|
|
151
146
|
e.expandNode(n.previousSibling);
|
|
152
|
-
else if (
|
|
147
|
+
else if (ae(n))
|
|
153
148
|
e.selectNode(n, !1, t);
|
|
154
149
|
else if (e.editable)
|
|
155
150
|
n.tagName === "text" ? n.dataset.type === "custom-link" ? e.selectArrow(n.parentElement) : e.selectSummary(n.parentElement) : n.className;
|
|
@@ -159,18 +154,18 @@ function ke(e) {
|
|
|
159
154
|
if (!e.editable)
|
|
160
155
|
return;
|
|
161
156
|
const n = t.target;
|
|
162
|
-
|
|
157
|
+
ae(n) ? e.beginEdit(n) : n.tagName === "text" && (n.dataset.type === "custom-link" ? e.editArrowLabel(n.parentElement) : e.editSummary(n.parentElement));
|
|
163
158
|
}), e.map.addEventListener("mousemove", (t) => {
|
|
164
|
-
t.target.contentEditable
|
|
159
|
+
t.target.contentEditable !== "true" && N.onMove(t, e.container);
|
|
165
160
|
}), e.map.addEventListener("mousedown", (t) => {
|
|
166
161
|
const n = e.mouseSelectionButton === 0 ? 2 : 0;
|
|
167
|
-
t.button === n && t.target.contentEditable
|
|
162
|
+
t.button === n && t.target.contentEditable !== "true" && (N.moved = !1, N.mousedown = !0);
|
|
168
163
|
}), e.map.addEventListener("mouseleave", (t) => {
|
|
169
164
|
const n = e.mouseSelectionButton === 0 ? 2 : 0;
|
|
170
|
-
t.button === n &&
|
|
165
|
+
t.button === n && N.clear();
|
|
171
166
|
}), e.map.addEventListener("mouseup", (t) => {
|
|
172
167
|
const n = e.mouseSelectionButton === 0 ? 2 : 0;
|
|
173
|
-
t.button === n &&
|
|
168
|
+
t.button === n && N.clear();
|
|
174
169
|
});
|
|
175
170
|
}
|
|
176
171
|
const He = {
|
|
@@ -202,29 +197,29 @@ const He = {
|
|
|
202
197
|
};
|
|
203
198
|
}
|
|
204
199
|
};
|
|
205
|
-
var
|
|
200
|
+
var M = /* @__PURE__ */ ((e) => (e.LHS = "lhs", e.RHS = "rhs", e))(M || {});
|
|
206
201
|
const Q = document, De = function() {
|
|
207
202
|
this.nodes.innerHTML = "";
|
|
208
203
|
const e = this.createTopic(this.nodeData);
|
|
209
|
-
|
|
204
|
+
we(e, this.nodeData), e.draggable = !1;
|
|
210
205
|
const t = Q.createElement("me-root");
|
|
211
206
|
t.appendChild(e);
|
|
212
207
|
const n = this.nodeData.children || [];
|
|
213
|
-
if (this.direction ===
|
|
208
|
+
if (this.direction === te) {
|
|
214
209
|
let o = 0, s = 0;
|
|
215
210
|
n.map((i) => {
|
|
216
|
-
i.direction === j ? o += 1 : i.direction ===
|
|
211
|
+
i.direction === j ? o += 1 : i.direction === ee ? s += 1 : o <= s ? (i.direction = j, o += 1) : (i.direction = ee, s += 1);
|
|
217
212
|
});
|
|
218
213
|
}
|
|
219
214
|
Be(this, n, t);
|
|
220
215
|
}, Be = function(e, t, n) {
|
|
221
216
|
const o = Q.createElement("me-main");
|
|
222
|
-
o.className =
|
|
217
|
+
o.className = M.LHS;
|
|
223
218
|
const s = Q.createElement("me-main");
|
|
224
|
-
s.className =
|
|
219
|
+
s.className = M.RHS;
|
|
225
220
|
for (let i = 0; i < t.length; i++) {
|
|
226
221
|
const r = t[i], { grp: l } = e.createWrapper(r);
|
|
227
|
-
e.direction ===
|
|
222
|
+
e.direction === te ? r.direction === j ? o.appendChild(l) : s.appendChild(l) : e.direction === j ? o.appendChild(l) : s.appendChild(l);
|
|
228
223
|
}
|
|
229
224
|
e.nodes.appendChild(o), e.nodes.appendChild(n), e.nodes.appendChild(s), e.nodes.appendChild(e.lines);
|
|
230
225
|
}, Pe = function(e, t) {
|
|
@@ -234,12 +229,12 @@ const Q = document, De = function() {
|
|
|
234
229
|
n.appendChild(i);
|
|
235
230
|
}
|
|
236
231
|
return n;
|
|
237
|
-
},
|
|
238
|
-
const o = (t ? t.mindElixirBox :
|
|
232
|
+
}, S = document, L = (e, t) => {
|
|
233
|
+
const o = (t ? t.mindElixirBox : S).querySelector(`[data-nodeid=me${e}]`);
|
|
239
234
|
if (!o)
|
|
240
235
|
throw new Error(`FindEle: Node ${e} not found, maybe it's collapsed.`);
|
|
241
236
|
return o;
|
|
242
|
-
},
|
|
237
|
+
}, we = function(e, t) {
|
|
243
238
|
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) {
|
|
244
239
|
e.innerHTML = t.dangerouslySetInnerHTML;
|
|
245
240
|
return;
|
|
@@ -247,32 +242,32 @@ const Q = document, De = function() {
|
|
|
247
242
|
if (t.image) {
|
|
248
243
|
const n = t.image;
|
|
249
244
|
if (n.url && n.width && n.height) {
|
|
250
|
-
const o =
|
|
245
|
+
const o = S.createElement("img");
|
|
251
246
|
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;
|
|
252
247
|
}
|
|
253
248
|
} else
|
|
254
249
|
e.image && (e.image = void 0);
|
|
255
250
|
{
|
|
256
|
-
const n =
|
|
251
|
+
const n = S.createElement("span");
|
|
257
252
|
n.className = "text", n.textContent = t.topic, e.appendChild(n), e.text = n;
|
|
258
253
|
}
|
|
259
254
|
if (t.hyperLink) {
|
|
260
|
-
const n =
|
|
255
|
+
const n = S.createElement("a");
|
|
261
256
|
n.className = "hyper-link", n.target = "_blank", n.innerText = "🔗", n.href = t.hyperLink, e.appendChild(n), e.link = n;
|
|
262
257
|
} else
|
|
263
258
|
e.link && (e.link = void 0);
|
|
264
259
|
if (t.icons && t.icons.length) {
|
|
265
|
-
const n =
|
|
266
|
-
n.className = "icons", n.innerHTML = t.icons.map((o) => `<span>${
|
|
260
|
+
const n = S.createElement("span");
|
|
261
|
+
n.className = "icons", n.innerHTML = t.icons.map((o) => `<span>${ce(o)}</span>`).join(""), e.appendChild(n), e.icons = n;
|
|
267
262
|
} else
|
|
268
263
|
e.icons && (e.icons = void 0);
|
|
269
264
|
if (t.tags && t.tags.length) {
|
|
270
|
-
const n =
|
|
271
|
-
n.className = "tags", n.innerHTML = t.tags.map((o) => `<span>${
|
|
265
|
+
const n = S.createElement("div");
|
|
266
|
+
n.className = "tags", n.innerHTML = t.tags.map((o) => `<span>${ce(o)}</span>`).join(""), e.appendChild(n), e.tags = n;
|
|
272
267
|
} else
|
|
273
268
|
e.tags && (e.tags = void 0);
|
|
274
269
|
}, ze = function(e, t) {
|
|
275
|
-
const n =
|
|
270
|
+
const n = S.createElement("me-wrapper"), { p: o, tpc: s } = this.createParent(e);
|
|
276
271
|
if (n.appendChild(o), !t && e.children && e.children.length > 0) {
|
|
277
272
|
const i = Ve(e.expanded);
|
|
278
273
|
if (o.appendChild(i), e.expanded !== !1) {
|
|
@@ -282,17 +277,17 @@ const Q = document, De = function() {
|
|
|
282
277
|
}
|
|
283
278
|
return { grp: n, top: o, tpc: s };
|
|
284
279
|
}, Oe = function(e) {
|
|
285
|
-
const t =
|
|
286
|
-
return
|
|
280
|
+
const t = S.createElement("me-parent"), n = this.createTopic(e);
|
|
281
|
+
return we(n, e), t.appendChild(n), { p: t, tpc: n };
|
|
287
282
|
}, je = function(e) {
|
|
288
|
-
const t =
|
|
283
|
+
const t = S.createElement("me-children");
|
|
289
284
|
return t.append(...e), t;
|
|
290
285
|
}, Re = function(e) {
|
|
291
|
-
const t =
|
|
286
|
+
const t = S.createElement("me-tpc");
|
|
292
287
|
return t.nodeObj = e, t.dataset.nodeid = "me" + e.id, t.draggable = this.draggable, t;
|
|
293
288
|
};
|
|
294
|
-
function
|
|
295
|
-
const t =
|
|
289
|
+
function _e(e) {
|
|
290
|
+
const t = S.createRange();
|
|
296
291
|
t.selectNodeContents(e);
|
|
297
292
|
const n = window.getSelection();
|
|
298
293
|
n && (n.removeAllRanges(), n.addRange(t));
|
|
@@ -300,8 +295,8 @@ function Ee(e) {
|
|
|
300
295
|
const qe = function(e) {
|
|
301
296
|
if (!e)
|
|
302
297
|
return;
|
|
303
|
-
const t =
|
|
304
|
-
e.appendChild(t), t.id = "input-box", t.textContent = n, t.contentEditable = "
|
|
298
|
+
const t = S.createElement("div"), n = e.text.textContent;
|
|
299
|
+
e.appendChild(t), t.id = "input-box", t.textContent = n, t.contentEditable = "true", t.spellcheck = !1;
|
|
305
300
|
const o = getComputedStyle(e);
|
|
306
301
|
t.style.cssText = `min-width:${e.offsetWidth - 8}px;
|
|
307
302
|
color:${o.color};
|
|
@@ -309,7 +304,7 @@ const qe = function(e) {
|
|
|
309
304
|
margin:${o.margin};
|
|
310
305
|
font:${o.font};
|
|
311
306
|
background-color:${o.backgroundColor !== "rgba(0, 0, 0, 0)" && o.backgroundColor};
|
|
312
|
-
border-radius:${o.borderRadius};`, this.direction === j && (t.style.right = "0"), t.focus(),
|
|
307
|
+
border-radius:${o.borderRadius};`, this.direction === j && (t.style.right = "0"), t.focus(), _e(t), this.bus.fire("operation", {
|
|
313
308
|
name: "beginEdit",
|
|
314
309
|
obj: e.nodeObj
|
|
315
310
|
}), t.addEventListener("keydown", (s) => {
|
|
@@ -332,43 +327,43 @@ const qe = function(e) {
|
|
|
332
327
|
}));
|
|
333
328
|
});
|
|
334
329
|
}, Ve = function(e) {
|
|
335
|
-
const t =
|
|
330
|
+
const t = S.createElement("me-epd");
|
|
336
331
|
return t.expanded = e !== !1, t.className = e !== !1 ? "minus" : "", t;
|
|
337
|
-
},
|
|
338
|
-
const o =
|
|
332
|
+
}, F = document, I = "http://www.w3.org/2000/svg", Ee = function(e, t, n) {
|
|
333
|
+
const o = F.createElementNS(I, "path");
|
|
339
334
|
return x(o, {
|
|
340
335
|
d: e,
|
|
341
336
|
stroke: t || "#666",
|
|
342
337
|
fill: "none",
|
|
343
338
|
"stroke-width": n
|
|
344
339
|
}), o;
|
|
345
|
-
},
|
|
346
|
-
const t =
|
|
340
|
+
}, V = function(e) {
|
|
341
|
+
const t = F.createElementNS(I, "svg");
|
|
347
342
|
return t.setAttribute("class", e), t.setAttribute("overflow", "visible"), t;
|
|
348
|
-
},
|
|
349
|
-
const e =
|
|
343
|
+
}, he = function() {
|
|
344
|
+
const e = F.createElementNS(I, "line");
|
|
350
345
|
return e.setAttribute("stroke", "#bbb"), e.setAttribute("fill", "none"), e.setAttribute("stroke-width", "2"), e;
|
|
351
|
-
},
|
|
346
|
+
}, Fe = function(e, t, n) {
|
|
352
347
|
const o = {
|
|
353
348
|
stroke: "rgb(235, 95, 82)",
|
|
354
349
|
fill: "none",
|
|
355
350
|
"stroke-linecap": "cap",
|
|
356
351
|
"stroke-width": "2"
|
|
357
|
-
}, s =
|
|
352
|
+
}, s = F.createElementNS(I, "g");
|
|
358
353
|
return [e, t, n].forEach((i, r) => {
|
|
359
|
-
const l =
|
|
354
|
+
const l = F.createElementNS(I, "path"), c = {
|
|
360
355
|
d: i,
|
|
361
356
|
...o
|
|
362
357
|
};
|
|
363
358
|
x(l, c), r === 0 && l.setAttribute("stroke-dasharray", "8,2"), s.appendChild(l);
|
|
364
359
|
}), s;
|
|
365
|
-
},
|
|
360
|
+
}, Se = function(e, t, n) {
|
|
366
361
|
if (!t)
|
|
367
362
|
return;
|
|
368
|
-
const o =
|
|
363
|
+
const o = document.createElement("div");
|
|
369
364
|
e.nodes.appendChild(o);
|
|
370
365
|
const s = t.innerHTML;
|
|
371
|
-
o.id = "input-box", o.textContent = s, o.contentEditable = "
|
|
366
|
+
o.id = "input-box", o.textContent = s, o.contentEditable = "true", o.spellcheck = !1;
|
|
372
367
|
const i = t.getBBox();
|
|
373
368
|
o.style.cssText = `
|
|
374
369
|
min-width:${Math.max(88, i.width)}px;
|
|
@@ -377,7 +372,7 @@ const qe = function(e) {
|
|
|
377
372
|
top:${i.y}px;
|
|
378
373
|
padding: 2px 4px;
|
|
379
374
|
margin: -2px -4px;
|
|
380
|
-
`, o.focus(),
|
|
375
|
+
`, o.focus(), _e(o), o.addEventListener("keydown", (r) => {
|
|
381
376
|
r.stopPropagation();
|
|
382
377
|
const l = r.key;
|
|
383
378
|
if (l === "Enter" || l === "Tab") {
|
|
@@ -388,36 +383,36 @@ const qe = function(e) {
|
|
|
388
383
|
}), o.addEventListener("blur", () => {
|
|
389
384
|
o && n(o);
|
|
390
385
|
});
|
|
391
|
-
},
|
|
392
|
-
const t = this.map.querySelector("me-root"), n = t.offsetTop, o = t.offsetLeft, s = t.offsetWidth, i = t.offsetHeight
|
|
393
|
-
this.nodes.style.top = `${1e4 - this.nodes.offsetHeight / 2}px`, this.
|
|
394
|
-
const
|
|
386
|
+
}, Ie = function(e) {
|
|
387
|
+
const t = this.map.querySelector("me-root"), n = t.offsetTop, o = t.offsetLeft, s = t.offsetWidth, i = t.offsetHeight;
|
|
388
|
+
this.nodes.style.top = `${1e4 - this.nodes.offsetHeight / 2}px`, this.nodes.style.left = `${1e4 - o - s / 2}px`;
|
|
389
|
+
const r = this.map.querySelectorAll("me-main > me-wrapper");
|
|
395
390
|
this.lines.innerHTML = "";
|
|
396
|
-
for (let
|
|
397
|
-
const
|
|
398
|
-
|
|
399
|
-
const
|
|
400
|
-
if (
|
|
391
|
+
for (let l = 0; l < r.length; l++) {
|
|
392
|
+
const c = r[l], d = c.querySelector("me-tpc"), { offsetLeft: h, offsetTop: u } = k(this.nodes, d), a = d.offsetWidth, f = d.offsetHeight, p = c.parentNode.className, g = this.generateMainBranch({ pT: n, pL: o, pW: s, pH: i, cT: u, cL: h, cW: a, cH: f, direction: p, containerHeight: this.nodes.offsetHeight }), m = this.theme.palette, v = d.nodeObj.branchColor || m[l % m.length];
|
|
393
|
+
d.style.borderColor = v, this.lines.appendChild(Ee(g, v, "3"));
|
|
394
|
+
const y = c.children[0].children[1];
|
|
395
|
+
if (y && (y.style.top = (y.parentNode.offsetHeight - y.offsetHeight) / 2 + "px", p === M.LHS ? y.style.left = "-10px" : y.style.right = "-10px"), e && e !== c)
|
|
401
396
|
continue;
|
|
402
|
-
const
|
|
403
|
-
|
|
397
|
+
const _ = V("subLines"), E = c.lastChild;
|
|
398
|
+
E.tagName === "svg" && E.remove(), c.appendChild(_), Ce(this, _, v, c, p, !0);
|
|
404
399
|
}
|
|
405
400
|
this.renderArrow(), this.renderSummary(), this.bus.fire("linkDiv");
|
|
406
|
-
},
|
|
401
|
+
}, Ce = function(e, t, n, o, s, i) {
|
|
407
402
|
const r = o.firstChild, l = o.children[1].children;
|
|
408
403
|
if (l.length === 0)
|
|
409
404
|
return;
|
|
410
|
-
const c = r.offsetTop, d = r.offsetLeft,
|
|
411
|
-
for (let
|
|
412
|
-
const f = l[
|
|
413
|
-
t.appendChild(
|
|
414
|
-
const w =
|
|
405
|
+
const c = r.offsetTop, d = r.offsetLeft, h = r.offsetWidth, u = r.offsetHeight;
|
|
406
|
+
for (let a = 0; a < l.length; a++) {
|
|
407
|
+
const f = l[a], p = f.firstChild, g = p.offsetTop, m = p.offsetLeft, v = p.offsetWidth, y = p.offsetHeight, _ = p.firstChild.nodeObj.branchColor || n, E = e.generateSubBranch({ pT: c, pL: d, pW: h, pH: u, cT: g, cL: m, cW: v, cH: y, direction: s, isFirst: i });
|
|
408
|
+
t.appendChild(Ee(E, _, "2"));
|
|
409
|
+
const w = p.children[1];
|
|
415
410
|
if (w) {
|
|
416
|
-
if (w.style.bottom = -(w.offsetHeight / 2) + "px", s ===
|
|
411
|
+
if (w.style.bottom = -(w.offsetHeight / 2) + "px", s === M.LHS ? w.style.left = "10px" : s === M.RHS && (w.style.right = "10px"), !w.expanded)
|
|
417
412
|
continue;
|
|
418
413
|
} else
|
|
419
414
|
continue;
|
|
420
|
-
|
|
415
|
+
Ce(e, t, _, f, s);
|
|
421
416
|
}
|
|
422
417
|
};
|
|
423
418
|
const B = (e, t) => {
|
|
@@ -426,7 +421,7 @@ const B = (e, t) => {
|
|
|
426
421
|
<use xlink:href="#icon-${t}"></use>
|
|
427
422
|
</svg>`, n;
|
|
428
423
|
};
|
|
429
|
-
function
|
|
424
|
+
function We(e) {
|
|
430
425
|
const t = document.createElement("div"), n = B("fullscreen", "full"), o = B("toCenter", "living"), s = B("zoomout", "move"), i = B("zoomin", "add"), r = document.createElement("span");
|
|
431
426
|
return r.innerText = "100%", t.appendChild(n), t.appendChild(o), t.appendChild(s), t.appendChild(i), t.className = "mind-elixir-toolbar rb", n.onclick = () => {
|
|
432
427
|
e.mindElixirBox.requestFullscreen();
|
|
@@ -449,11 +444,11 @@ function Xe(e) {
|
|
|
449
444
|
}, t;
|
|
450
445
|
}
|
|
451
446
|
function Ye(e) {
|
|
452
|
-
e.container.append(
|
|
447
|
+
e.container.append(We(e)), e.container.append(Xe(e));
|
|
453
448
|
}
|
|
454
449
|
/*! @viselect/vanilla v3.5.1 MIT | https://github.com/Simonwep/selection/tree/master/packages/vanilla */
|
|
455
450
|
var Ge = Object.defineProperty, Ke = (e, t, n) => t in e ? Ge(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n, b = (e, t, n) => (Ke(e, typeof t != "symbol" ? t + "" : t, n), n);
|
|
456
|
-
class
|
|
451
|
+
class Ue {
|
|
457
452
|
constructor() {
|
|
458
453
|
b(this, "_listeners", /* @__PURE__ */ new Map()), b(this, "on", this.addEventListener), b(this, "off", this.removeEventListener), b(this, "emit", this.dispatchEvent);
|
|
459
454
|
}
|
|
@@ -475,27 +470,27 @@ class Je {
|
|
|
475
470
|
this._listeners.clear();
|
|
476
471
|
}
|
|
477
472
|
}
|
|
478
|
-
const
|
|
479
|
-
function
|
|
473
|
+
const de = (e, t = "px") => typeof e == "number" ? e + t : e;
|
|
474
|
+
function $({ style: e }, t, n) {
|
|
480
475
|
if (typeof t == "object")
|
|
481
476
|
for (const [o, s] of Object.entries(t))
|
|
482
|
-
s !== void 0 && (e[o] =
|
|
477
|
+
s !== void 0 && (e[o] = de(s));
|
|
483
478
|
else
|
|
484
|
-
n !== void 0 && (e[t] =
|
|
479
|
+
n !== void 0 && (e[t] = de(n));
|
|
485
480
|
}
|
|
486
|
-
const
|
|
481
|
+
const Le = (e) => (t, n, o, s = {}) => {
|
|
487
482
|
t instanceof HTMLCollection || t instanceof NodeList ? t = Array.from(t) : Array.isArray(t) || (t = [t]), Array.isArray(n) || (n = [n]);
|
|
488
483
|
for (const i of t)
|
|
489
484
|
if (i)
|
|
490
485
|
for (const r of n)
|
|
491
486
|
i[e](r, o, { capture: !1, ...s });
|
|
492
487
|
return [t, n, o, s];
|
|
493
|
-
}, P =
|
|
488
|
+
}, P = Le("addEventListener"), A = Le("removeEventListener"), Y = (e) => {
|
|
494
489
|
var t;
|
|
495
490
|
const { clientX: n, clientY: o, target: s } = ((t = e.touches) == null ? void 0 : t[0]) ?? e;
|
|
496
491
|
return { x: n, y: o, target: s };
|
|
497
492
|
};
|
|
498
|
-
function
|
|
493
|
+
function ue(e, t, n = "touch") {
|
|
499
494
|
switch (n) {
|
|
500
495
|
case "center": {
|
|
501
496
|
const o = t.left + t.width / 2, s = t.top + t.height / 2;
|
|
@@ -516,7 +511,7 @@ function z(e, t = document) {
|
|
|
516
511
|
}
|
|
517
512
|
return o;
|
|
518
513
|
}
|
|
519
|
-
const
|
|
514
|
+
const Je = () => matchMedia("(hover: none), (pointer: coarse)").matches, Qe = () => "safari" in window, Ze = (e) => {
|
|
520
515
|
let t, n = -1, o = !1;
|
|
521
516
|
return {
|
|
522
517
|
next(...s) {
|
|
@@ -549,8 +544,8 @@ function et(e, t) {
|
|
|
549
544
|
}
|
|
550
545
|
return !1;
|
|
551
546
|
}
|
|
552
|
-
const { abs: D, max:
|
|
553
|
-
class tt extends
|
|
547
|
+
const { abs: D, max: fe, min: pe, ceil: me } = Math;
|
|
548
|
+
class tt extends Ue {
|
|
554
549
|
constructor(t) {
|
|
555
550
|
var n, o, s, i, r;
|
|
556
551
|
super(), b(this, "_options"), b(this, "_selection", {
|
|
@@ -600,27 +595,27 @@ class tt extends Je {
|
|
|
600
595
|
}
|
|
601
596
|
}
|
|
602
597
|
};
|
|
603
|
-
for (const
|
|
604
|
-
typeof this[
|
|
598
|
+
for (const h of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))
|
|
599
|
+
typeof this[h] == "function" && (this[h] = this[h].bind(this));
|
|
605
600
|
const { document: l, selectionAreaClass: c, selectionContainerClass: d } = this._options;
|
|
606
|
-
this._area = l.createElement("div"), this._clippingElement = l.createElement("div"), this._clippingElement.appendChild(this._area), this._area.classList.add(c), d && this._clippingElement.classList.add(d),
|
|
601
|
+
this._area = l.createElement("div"), this._clippingElement = l.createElement("div"), this._clippingElement.appendChild(this._area), this._area.classList.add(c), d && this._clippingElement.classList.add(d), $(this._area, {
|
|
607
602
|
willChange: "top, left, bottom, right, width, height",
|
|
608
603
|
top: 0,
|
|
609
604
|
left: 0,
|
|
610
605
|
position: "fixed"
|
|
611
|
-
}),
|
|
606
|
+
}), $(this._clippingElement, {
|
|
612
607
|
overflow: "hidden",
|
|
613
608
|
position: "fixed",
|
|
614
609
|
transform: "translate3d(0, 0, 0)",
|
|
615
610
|
// https://stackoverflow.com/a/38268846
|
|
616
611
|
pointerEvents: "none",
|
|
617
612
|
zIndex: "1"
|
|
618
|
-
}), this._frame = Ze((
|
|
619
|
-
this._recalculateSelectionAreaRect(), this._updateElementSelection(), this._emitEvent("move",
|
|
613
|
+
}), this._frame = Ze((h) => {
|
|
614
|
+
this._recalculateSelectionAreaRect(), this._updateElementSelection(), this._emitEvent("move", h), this._redrawSelectionArea();
|
|
620
615
|
}), this.enable();
|
|
621
616
|
}
|
|
622
617
|
_bindStartEvents(t = !0) {
|
|
623
|
-
const { document: n, features: o } = this._options, s = t ? P :
|
|
618
|
+
const { document: n, features: o } = this._options, s = t ? P : A;
|
|
624
619
|
s(n, "mousedown", this._onTapStart), o.touch && s(n, "touchstart", this._onTapStart, {
|
|
625
620
|
passive: !1
|
|
626
621
|
});
|
|
@@ -629,16 +624,16 @@ class tt extends Je {
|
|
|
629
624
|
const { x: o, y: s, target: i } = Y(t), { _options: r } = this, { document: l } = this._options, c = i.getBoundingClientRect();
|
|
630
625
|
if (t instanceof MouseEvent && !et(t, r.behaviour.triggers))
|
|
631
626
|
return;
|
|
632
|
-
const d = z(r.startAreas, r.document),
|
|
633
|
-
this._targetElement =
|
|
634
|
-
(f) =>
|
|
627
|
+
const d = z(r.startAreas, r.document), h = z(r.boundaries, r.document);
|
|
628
|
+
this._targetElement = h.find(
|
|
629
|
+
(f) => ue(f.getBoundingClientRect(), c)
|
|
635
630
|
);
|
|
636
631
|
const u = t.composedPath();
|
|
637
|
-
if (!this._targetElement || !d.find((f) => u.includes(f)) || !
|
|
632
|
+
if (!this._targetElement || !d.find((f) => u.includes(f)) || !h.find((f) => u.includes(f)) || !n && this._emitEvent("beforestart", t) === !1)
|
|
638
633
|
return;
|
|
639
634
|
this._areaLocation = { x1: o, y1: s, x2: 0, y2: 0 };
|
|
640
|
-
const
|
|
641
|
-
this._scrollDelta = { x:
|
|
635
|
+
const a = l.scrollingElement ?? l.body;
|
|
636
|
+
this._scrollDelta = { x: a.scrollLeft, y: a.scrollTop }, this._singleClick = !0, this.clearSelection(!1, !0), P(l, ["touchmove", "mousemove"], this._delayedTapMove, { passive: !1 }), P(l, ["mouseup", "touchcancel", "touchend"], this._onTapStop), P(l, "scroll", this._onScroll);
|
|
642
637
|
}
|
|
643
638
|
_onSingleTap(t) {
|
|
644
639
|
const { singleTap: { intersect: n }, range: o } = this._options.features, s = Y(t);
|
|
@@ -649,8 +644,8 @@ class tt extends Je {
|
|
|
649
644
|
this.resolveSelectables();
|
|
650
645
|
const { x: l, y: c } = s;
|
|
651
646
|
i = this._selectables.find((d) => {
|
|
652
|
-
const { right:
|
|
653
|
-
return l <
|
|
647
|
+
const { right: h, left: u, top: a, bottom: f } = d.getBoundingClientRect();
|
|
648
|
+
return l < h && l > u && c < f && c > a;
|
|
654
649
|
});
|
|
655
650
|
}
|
|
656
651
|
if (!i)
|
|
@@ -662,10 +657,10 @@ class tt extends Je {
|
|
|
662
657
|
}
|
|
663
658
|
const { stored: r } = this._selection;
|
|
664
659
|
if (this._emitEvent("start", t), t.shiftKey && o && this._latestElement) {
|
|
665
|
-
const l = this._latestElement, [c, d] = l.compareDocumentPosition(i) & 4 ? [i, l] : [l, i],
|
|
660
|
+
const l = this._latestElement, [c, d] = l.compareDocumentPosition(i) & 4 ? [i, l] : [l, i], h = [...this._selectables.filter(
|
|
666
661
|
(u) => u.compareDocumentPosition(c) & 4 && u.compareDocumentPosition(d) & 2
|
|
667
662
|
), c, d];
|
|
668
|
-
this.select(
|
|
663
|
+
this.select(h), this._latestElement = l;
|
|
669
664
|
} else
|
|
670
665
|
r.includes(i) && (r.length === 1 || t.ctrlKey || r.every((l) => this._selection.stored.includes(l))) ? this.deselect(i) : (this.select(i), this._latestElement = i);
|
|
671
666
|
}
|
|
@@ -676,30 +671,30 @@ class tt extends Je {
|
|
|
676
671
|
typeof s == "number" && D(l + c - (i + r)) >= s || // Different x and y threshold
|
|
677
672
|
typeof s == "object" && D(l - i) >= s.x || D(c - r) >= s.y
|
|
678
673
|
) {
|
|
679
|
-
if (
|
|
680
|
-
|
|
674
|
+
if (A(o, ["mousemove", "touchmove"], this._delayedTapMove, { passive: !1 }), this._emitEvent("beforedrag", t) === !1) {
|
|
675
|
+
A(o, ["mouseup", "touchcancel", "touchend"], this._onTapStop);
|
|
681
676
|
return;
|
|
682
677
|
}
|
|
683
|
-
P(o, ["mousemove", "touchmove"], this._onTapMove, { passive: !1 }),
|
|
678
|
+
P(o, ["mousemove", "touchmove"], this._onTapMove, { passive: !1 }), $(this._area, "display", "block"), z(n, o)[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 && (P(this._targetElement, "wheel", this._manualScroll, { passive: !1 }), this._selectables = this._selectables.filter((d) => this._targetElement.contains(d))), this._setupSelectionArea(), this._emitEvent("start", t), this._onTapMove(t);
|
|
684
679
|
}
|
|
685
680
|
this._handleMoveEvent(t);
|
|
686
681
|
}
|
|
687
682
|
_setupSelectionArea() {
|
|
688
683
|
const { _clippingElement: t, _targetElement: n, _area: o } = this, s = this._targetRect = n.getBoundingClientRect();
|
|
689
|
-
this._scrollAvailable ? (
|
|
684
|
+
this._scrollAvailable ? ($(t, {
|
|
690
685
|
top: s.top,
|
|
691
686
|
left: s.left,
|
|
692
687
|
width: s.width,
|
|
693
688
|
height: s.height
|
|
694
|
-
}),
|
|
689
|
+
}), $(o, {
|
|
695
690
|
marginTop: -s.top,
|
|
696
691
|
marginLeft: -s.left
|
|
697
|
-
})) : (
|
|
692
|
+
})) : ($(t, {
|
|
698
693
|
top: 0,
|
|
699
694
|
left: 0,
|
|
700
695
|
width: "100%",
|
|
701
696
|
height: "100%"
|
|
702
|
-
}),
|
|
697
|
+
}), $(o, {
|
|
703
698
|
marginTop: 0,
|
|
704
699
|
marginLeft: 0
|
|
705
700
|
}));
|
|
@@ -708,22 +703,22 @@ class tt extends Je {
|
|
|
708
703
|
const { x: n, y: o } = Y(t), { _scrollSpeed: s, _areaLocation: i, _options: r, _frame: l } = this, { speedDivider: c } = r.behaviour.scrolling, d = this._targetElement;
|
|
709
704
|
if (i.x2 = n, i.y2 = o, this._scrollAvailable && !this._scrollingActive && (s.y || s.x)) {
|
|
710
705
|
this._scrollingActive = !0;
|
|
711
|
-
const
|
|
706
|
+
const h = () => {
|
|
712
707
|
if (!s.x && !s.y) {
|
|
713
708
|
this._scrollingActive = !1;
|
|
714
709
|
return;
|
|
715
710
|
}
|
|
716
|
-
const { scrollTop: u, scrollLeft:
|
|
717
|
-
s.y && (d.scrollTop +=
|
|
711
|
+
const { scrollTop: u, scrollLeft: a } = d;
|
|
712
|
+
s.y && (d.scrollTop += me(s.y / c), i.y1 -= d.scrollTop - u), s.x && (d.scrollLeft += me(s.x / c), i.x1 -= d.scrollLeft - a), l.next(t), requestAnimationFrame(h);
|
|
718
713
|
};
|
|
719
|
-
requestAnimationFrame(
|
|
714
|
+
requestAnimationFrame(h);
|
|
720
715
|
} else
|
|
721
716
|
l.next(t);
|
|
722
717
|
this._handleMoveEvent(t);
|
|
723
718
|
}
|
|
724
719
|
_handleMoveEvent(t) {
|
|
725
720
|
const { features: n } = this._options;
|
|
726
|
-
(n.touch &&
|
|
721
|
+
(n.touch && Je() || this._scrollAvailable && Qe()) && t.preventDefault();
|
|
727
722
|
}
|
|
728
723
|
_onScroll() {
|
|
729
724
|
const { _scrollDelta: t, _options: { document: n } } = this, { scrollTop: o, scrollLeft: s } = n.scrollingElement ?? n.body;
|
|
@@ -734,12 +729,12 @@ class tt extends Je {
|
|
|
734
729
|
this._scrollSpeed.y += o * n, this._scrollSpeed.x += s * n, this._onTapMove(t), t.preventDefault();
|
|
735
730
|
}
|
|
736
731
|
_recalculateSelectionAreaRect() {
|
|
737
|
-
const { _scrollSpeed: t, _areaLocation: n, _areaRect: o, _targetElement: s, _options: i } = this, { scrollTop: r, scrollHeight: l, clientHeight: c, scrollLeft: d, scrollWidth:
|
|
738
|
-
let { x2: g, y2:
|
|
732
|
+
const { _scrollSpeed: t, _areaLocation: n, _areaRect: o, _targetElement: s, _options: i } = this, { scrollTop: r, scrollHeight: l, clientHeight: c, scrollLeft: d, scrollWidth: h, clientWidth: u } = s, a = this._targetRect, { x1: f, y1: p } = n;
|
|
733
|
+
let { x2: g, y2: m } = n;
|
|
739
734
|
const { behaviour: { scrolling: { startScrollMargins: v } } } = i;
|
|
740
|
-
g <
|
|
741
|
-
const
|
|
742
|
-
o.x =
|
|
735
|
+
g < a.left + v.x ? (t.x = d ? -D(a.left - g + v.x) : 0, g = g < a.left ? a.left : g) : g > a.right - v.x ? (t.x = h - d - u ? D(a.left + a.width - g - v.x) : 0, g = g > a.right ? a.right : g) : t.x = 0, m < a.top + v.y ? (t.y = r ? -D(a.top - m + v.y) : 0, m = m < a.top ? a.top : m) : m > a.bottom - v.y ? (t.y = l - r - c ? D(a.top + a.height - m - v.y) : 0, m = m > a.bottom ? a.bottom : m) : t.y = 0;
|
|
736
|
+
const y = pe(f, g), _ = pe(p, m), E = fe(f, g), w = fe(p, m);
|
|
737
|
+
o.x = y, o.y = _, o.width = E - y, o.height = w - _;
|
|
743
738
|
}
|
|
744
739
|
_redrawSelectionArea() {
|
|
745
740
|
const { x: t, y: n, width: o, height: s } = this._areaRect, { style: i } = this._area;
|
|
@@ -748,32 +743,32 @@ class tt extends Je {
|
|
|
748
743
|
_onTapStop(t, n) {
|
|
749
744
|
var o;
|
|
750
745
|
const { document: s, features: i } = this._options, { _singleClick: r } = this;
|
|
751
|
-
|
|
746
|
+
A(s, ["mousemove", "touchmove"], this._delayedTapMove), A(s, ["touchmove", "mousemove"], this._onTapMove), A(s, ["mouseup", "touchcancel", "touchend"], this._onTapStop), A(s, "scroll", this._onScroll), this._keepSelection(), t && r && i.singleTap.allow ? this._onSingleTap(t) : !r && !n && (this._updateElementSelection(), this._emitEvent("stop", t)), this._scrollSpeed.x = 0, this._scrollSpeed.y = 0, A(this._targetElement, "wheel", this._manualScroll, { passive: !0 }), this._clippingElement.remove(), (o = this._frame) == null || o.cancel(), $(this._area, "display", "none");
|
|
752
747
|
}
|
|
753
748
|
_updateElementSelection() {
|
|
754
|
-
const { _selectables: t, _options: n, _selection: o, _areaRect: s } = this, { stored: i, selected: r, touched: l } = o, { intersect: c, overlap: d } = n.behaviour,
|
|
749
|
+
const { _selectables: t, _options: n, _selection: o, _areaRect: s } = this, { stored: i, selected: r, touched: l } = o, { intersect: c, overlap: d } = n.behaviour, h = d === "invert", u = [], a = [], f = [];
|
|
755
750
|
for (let g = 0; g < t.length; g++) {
|
|
756
|
-
const
|
|
757
|
-
if (
|
|
758
|
-
if (r.includes(
|
|
759
|
-
i.includes(
|
|
760
|
-
else if (
|
|
761
|
-
f.push(
|
|
751
|
+
const m = t[g];
|
|
752
|
+
if (ue(s, m.getBoundingClientRect(), c)) {
|
|
753
|
+
if (r.includes(m))
|
|
754
|
+
i.includes(m) && !l.includes(m) && l.push(m);
|
|
755
|
+
else if (h && i.includes(m)) {
|
|
756
|
+
f.push(m);
|
|
762
757
|
continue;
|
|
763
758
|
} else
|
|
764
|
-
|
|
765
|
-
u.push(
|
|
759
|
+
a.push(m);
|
|
760
|
+
u.push(m);
|
|
766
761
|
}
|
|
767
762
|
}
|
|
768
|
-
|
|
769
|
-
const
|
|
763
|
+
h && a.push(...i.filter((g) => !r.includes(g)));
|
|
764
|
+
const p = d === "keep";
|
|
770
765
|
for (let g = 0; g < r.length; g++) {
|
|
771
|
-
const
|
|
772
|
-
!u.includes(
|
|
766
|
+
const m = r[g];
|
|
767
|
+
!u.includes(m) && !// Check if user wants to keep previously selected elements, e.g.
|
|
773
768
|
// not make them part of the current selection as soon as they're touched.
|
|
774
|
-
(
|
|
769
|
+
(p && i.includes(m)) && f.push(m);
|
|
775
770
|
}
|
|
776
|
-
o.selected = u, o.changed = { added:
|
|
771
|
+
o.selected = u, o.changed = { added: a, removed: f }, this._latestElement = void 0;
|
|
777
772
|
}
|
|
778
773
|
_emitEvent(t, n) {
|
|
779
774
|
return this.emit(t, {
|
|
@@ -897,17 +892,17 @@ b(tt, "version", "3.5.1");
|
|
|
897
892
|
const nt = function(e, t = !0) {
|
|
898
893
|
this.theme = e;
|
|
899
894
|
const n = this.theme.cssVar, o = Object.keys(n);
|
|
900
|
-
this.
|
|
895
|
+
this.mindElixirBox.style.cssText = "";
|
|
901
896
|
for (let s = 0; s < o.length; s++) {
|
|
902
897
|
const i = o[s];
|
|
903
|
-
this.
|
|
898
|
+
this.mindElixirBox.style.setProperty(i, n[i]);
|
|
904
899
|
}
|
|
905
|
-
e.cssVar["--gap"] || this.
|
|
900
|
+
e.cssVar["--gap"] || this.mindElixirBox.style.setProperty("--gap", "30px"), t && this.refresh();
|
|
906
901
|
}, ot = function(e) {
|
|
907
902
|
const n = e.parentElement.parentElement.lastElementChild;
|
|
908
903
|
(n == null ? void 0 : n.tagName) === "svg" && (n == null || n.remove());
|
|
909
904
|
};
|
|
910
|
-
function
|
|
905
|
+
function Me(e) {
|
|
911
906
|
return {
|
|
912
907
|
nodeData: e.isFocusMode ? e.nodeDataBackup : e.nodeData,
|
|
913
908
|
arrows: e.arrows,
|
|
@@ -919,7 +914,7 @@ function Te(e) {
|
|
|
919
914
|
const st = function(e, t, n) {
|
|
920
915
|
if (e) {
|
|
921
916
|
if (this.clearSelection(), typeof e == "string") {
|
|
922
|
-
const o =
|
|
917
|
+
const o = L(e);
|
|
923
918
|
return o ? this.selectNode(o) : void 0;
|
|
924
919
|
}
|
|
925
920
|
e.className = "selected", e.scrollIntoView({ block: "nearest", inline: "nearest" }), this.currentNode = e, t ? this.bus.fire("selectNewNode", e.nodeObj) : this.bus.fire("selectNode", e.nodeObj, n);
|
|
@@ -942,7 +937,7 @@ const st = function(e, t, n) {
|
|
|
942
937
|
}, ct = function() {
|
|
943
938
|
this.unselectNode(), this.unselectNodes(), this.unselectSummary(), this.unselectArrow();
|
|
944
939
|
}, at = function() {
|
|
945
|
-
const e =
|
|
940
|
+
const e = Me(this);
|
|
946
941
|
return JSON.stringify(e, (t, n) => {
|
|
947
942
|
if (!(t === "parent" && typeof n != "string"))
|
|
948
943
|
return n;
|
|
@@ -950,7 +945,7 @@ const st = function(e, t, n) {
|
|
|
950
945
|
}, ht = function() {
|
|
951
946
|
return JSON.parse(this.getDataString());
|
|
952
947
|
}, dt = function() {
|
|
953
|
-
const e =
|
|
948
|
+
const e = Me(this).nodeData;
|
|
954
949
|
let t = "# " + e.topic + `
|
|
955
950
|
|
|
956
951
|
`;
|
|
@@ -969,25 +964,22 @@ const st = function(e, t, n) {
|
|
|
969
964
|
}, pt = function(e) {
|
|
970
965
|
this.scaleVal = e, this.map.style.transform = "scale(" + e + ")", this.bus.fire("scale", e);
|
|
971
966
|
}, mt = function() {
|
|
972
|
-
const e = this.nodes.offsetHeight / this.container.offsetHeight, t = this.nodes.offsetWidth / this.container.offsetWidth, n = 1 / Math.max(1, Math.max(e, t));
|
|
973
|
-
this.scaleVal = n, this.map.style.transform = "scale(" + n + ")", this.bus.fire("scale", n);
|
|
974
|
-
}, gt = function() {
|
|
975
967
|
this.container.scrollTo(1e4 - this.container.offsetWidth / 2, 1e4 - this.container.offsetHeight / 2);
|
|
976
|
-
},
|
|
968
|
+
}, gt = function(e) {
|
|
977
969
|
e(this);
|
|
978
|
-
},
|
|
970
|
+
}, vt = function(e) {
|
|
979
971
|
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());
|
|
980
|
-
},
|
|
972
|
+
}, yt = function() {
|
|
981
973
|
this.isFocusMode = !1, this.tempDirection !== null && (this.nodeData = this.nodeDataBackup, this.direction = this.tempDirection, this.tempDirection = null, this.refresh(), this.toCenter());
|
|
982
|
-
},
|
|
974
|
+
}, bt = function() {
|
|
983
975
|
this.direction = 0, this.refresh();
|
|
984
|
-
},
|
|
976
|
+
}, xt = function() {
|
|
985
977
|
this.direction = 1, this.refresh();
|
|
986
|
-
},
|
|
978
|
+
}, wt = function() {
|
|
987
979
|
this.direction = 2, this.refresh();
|
|
988
|
-
},
|
|
980
|
+
}, _t = function(e) {
|
|
989
981
|
this.locale = e, this.refresh();
|
|
990
|
-
},
|
|
982
|
+
}, Et = function(e, t) {
|
|
991
983
|
const n = e.nodeObj;
|
|
992
984
|
typeof t == "boolean" ? n.expanded = t : n.expanded !== !1 ? n.expanded = !1 : n.expanded = !0;
|
|
993
985
|
const o = e.parentNode, s = o.children[1];
|
|
@@ -1001,33 +993,32 @@ const st = function(e, t, n) {
|
|
|
1001
993
|
this.linkDiv(e.closest("me-main > me-wrapper"));
|
|
1002
994
|
const i = e.getBoundingClientRect(), r = this.container.getBoundingClientRect();
|
|
1003
995
|
(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);
|
|
1004
|
-
},
|
|
1005
|
-
e && (e = JSON.parse(JSON.stringify(e)), this.nodeData = e.nodeData, this.arrows = e.arrows || [], this.summaries = e.summaries || []),
|
|
1006
|
-
},
|
|
996
|
+
}, St = function(e) {
|
|
997
|
+
e && (e = JSON.parse(JSON.stringify(e)), this.nodeData = e.nodeData, this.arrows = e.arrows || [], this.summaries = e.summaries || []), ne(this.nodeData), this.layout(), this.linkDiv();
|
|
998
|
+
}, Ct = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1007
999
|
__proto__: null,
|
|
1008
|
-
cancelFocus:
|
|
1000
|
+
cancelFocus: yt,
|
|
1009
1001
|
clearSelection: ct,
|
|
1010
1002
|
disableEdit: ft,
|
|
1011
1003
|
enableEdit: ut,
|
|
1012
|
-
expandNode:
|
|
1013
|
-
focusNode:
|
|
1004
|
+
expandNode: Et,
|
|
1005
|
+
focusNode: vt,
|
|
1014
1006
|
getData: ht,
|
|
1015
1007
|
getDataMd: dt,
|
|
1016
1008
|
getDataString: at,
|
|
1017
|
-
initLeft:
|
|
1018
|
-
initRight:
|
|
1019
|
-
initSide:
|
|
1020
|
-
install:
|
|
1021
|
-
refresh:
|
|
1009
|
+
initLeft: bt,
|
|
1010
|
+
initRight: xt,
|
|
1011
|
+
initSide: wt,
|
|
1012
|
+
install: gt,
|
|
1013
|
+
refresh: St,
|
|
1022
1014
|
scale: pt,
|
|
1023
|
-
scaleFit: mt,
|
|
1024
1015
|
selectNode: st,
|
|
1025
1016
|
selectNodes: rt,
|
|
1026
|
-
setLocale:
|
|
1027
|
-
toCenter:
|
|
1017
|
+
setLocale: _t,
|
|
1018
|
+
toCenter: mt,
|
|
1028
1019
|
unselectNode: it,
|
|
1029
1020
|
unselectNodes: lt
|
|
1030
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1021
|
+
}, Symbol.toStringTag, { value: "Module" })), Lt = function(e) {
|
|
1031
1022
|
return {
|
|
1032
1023
|
dom: e,
|
|
1033
1024
|
moved: !1,
|
|
@@ -1053,18 +1044,18 @@ const st = function(e, t, n) {
|
|
|
1053
1044
|
this.moved = !1, this.mousedown = !1;
|
|
1054
1045
|
}
|
|
1055
1046
|
};
|
|
1056
|
-
},
|
|
1057
|
-
create:
|
|
1047
|
+
}, ge = {
|
|
1048
|
+
create: Lt
|
|
1058
1049
|
};
|
|
1059
1050
|
function Z(e, t, n) {
|
|
1060
|
-
const { offsetLeft: o, offsetTop: s } =
|
|
1051
|
+
const { offsetLeft: o, offsetTop: s } = k(e.nodes, t), i = t.offsetWidth, r = t.offsetHeight, l = o + i / 2, c = s + r / 2, d = l + n.x, h = c + n.y;
|
|
1061
1052
|
return {
|
|
1062
1053
|
w: i,
|
|
1063
1054
|
h: r,
|
|
1064
1055
|
cx: l,
|
|
1065
1056
|
cy: c,
|
|
1066
1057
|
ctrlX: d,
|
|
1067
|
-
ctrlY:
|
|
1058
|
+
ctrlY: h
|
|
1068
1059
|
};
|
|
1069
1060
|
}
|
|
1070
1061
|
function O(e) {
|
|
@@ -1075,7 +1066,7 @@ function O(e) {
|
|
|
1075
1066
|
y: n
|
|
1076
1067
|
};
|
|
1077
1068
|
}
|
|
1078
|
-
const
|
|
1069
|
+
const Mt = function(e, t, n, o) {
|
|
1079
1070
|
const s = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
1080
1071
|
return x(s, {
|
|
1081
1072
|
"text-anchor": "middle",
|
|
@@ -1083,21 +1074,21 @@ const Tt = function(e, t, n, o) {
|
|
|
1083
1074
|
y: n + "",
|
|
1084
1075
|
fill: o || "#666"
|
|
1085
1076
|
}), s.dataset.type = "custom-link", s.innerHTML = e, s;
|
|
1086
|
-
},
|
|
1077
|
+
}, Te = function(e, t, n, o, s) {
|
|
1087
1078
|
if (!t || !n)
|
|
1088
1079
|
return;
|
|
1089
1080
|
performance.now();
|
|
1090
|
-
const i = Z(e, t, o.delta1), r = Z(e, n, o.delta2), { x: l, y: c } = O(i), { ctrlX: d, ctrlY:
|
|
1081
|
+
const i = Z(e, t, o.delta1), r = Z(e, n, o.delta2), { x: l, y: c } = O(i), { ctrlX: d, ctrlY: h } = i, { ctrlX: u, ctrlY: a } = r, { x: f, y: p } = O(r), g = J(u, a, f, p), m = `M ${g.x1} ${g.y1} L ${f} ${p} L ${g.x2} ${g.y2}`;
|
|
1091
1082
|
let v = "";
|
|
1092
1083
|
if (o.bidirectional) {
|
|
1093
|
-
const
|
|
1094
|
-
v = `M ${
|
|
1084
|
+
const H = J(d, h, l, c);
|
|
1085
|
+
v = `M ${H.x1} ${H.y1} L ${l} ${c} L ${H.x2} ${H.y2}`;
|
|
1095
1086
|
}
|
|
1096
|
-
const
|
|
1097
|
-
|
|
1098
|
-
},
|
|
1087
|
+
const y = Fe(`M ${l} ${c} C ${d} ${h} ${u} ${a} ${f} ${p}`, m, v), _ = l / 8 + d * 3 / 8 + u * 3 / 8 + f / 8, E = c / 8 + h * 3 / 8 + a * 3 / 8 + p / 8, w = Mt(o.label, _, E, e.theme.cssVar["--color"]);
|
|
1088
|
+
y.appendChild(w), y.arrowObj = o, y.dataset.linkid = o.id, e.linkSvgGroup.appendChild(y), s || (e.arrows.push(o), e.currentArrow = y, $e(e, o, i, r)), performance.now();
|
|
1089
|
+
}, Tt = function(e, t, n = {}) {
|
|
1099
1090
|
const o = {
|
|
1100
|
-
id:
|
|
1091
|
+
id: oe(),
|
|
1101
1092
|
label: "Custom Link",
|
|
1102
1093
|
from: e.nodeObj.id,
|
|
1103
1094
|
to: t.nodeObj.id,
|
|
@@ -1111,11 +1102,11 @@ const Tt = function(e, t, n, o) {
|
|
|
1111
1102
|
},
|
|
1112
1103
|
...n
|
|
1113
1104
|
};
|
|
1114
|
-
|
|
1105
|
+
Te(this, e, t, o), this.bus.fire("operation", {
|
|
1115
1106
|
name: "createArrow",
|
|
1116
1107
|
obj: o
|
|
1117
1108
|
});
|
|
1118
|
-
},
|
|
1109
|
+
}, $t = function(e) {
|
|
1119
1110
|
let t;
|
|
1120
1111
|
if (e ? t = e : t = this.currentArrow, !t)
|
|
1121
1112
|
return;
|
|
@@ -1127,18 +1118,18 @@ const Tt = function(e, t, n, o) {
|
|
|
1127
1118
|
id: n
|
|
1128
1119
|
}
|
|
1129
1120
|
});
|
|
1130
|
-
},
|
|
1121
|
+
}, At = function(e) {
|
|
1131
1122
|
this.currentArrow = e;
|
|
1132
|
-
const t = e.arrowObj, n =
|
|
1133
|
-
|
|
1134
|
-
},
|
|
1123
|
+
const t = e.arrowObj, n = L(t.from), o = L(t.to), s = Z(this, n, t.delta1), i = Z(this, o, t.delta2);
|
|
1124
|
+
$e(this, t, s, i);
|
|
1125
|
+
}, Nt = function() {
|
|
1135
1126
|
this.currentArrow = null, se(this);
|
|
1136
1127
|
}, se = function(e) {
|
|
1137
1128
|
var t, n;
|
|
1138
1129
|
(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";
|
|
1139
|
-
},
|
|
1130
|
+
}, $e = function(e, t, n, o) {
|
|
1140
1131
|
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);
|
|
1141
|
-
let { x: s, y: i } = O(n), { ctrlX: r, ctrlY: l } = n, { ctrlX: c, ctrlY: d } = o, { x:
|
|
1132
|
+
let { x: s, y: i } = O(n), { ctrlX: r, ctrlY: l } = n, { ctrlX: c, ctrlY: d } = o, { x: h, y: u } = O(o);
|
|
1142
1133
|
e.P2.style.cssText = `top:${l}px;left:${r}px;`, e.P3.style.cssText = `top:${d}px;left:${c}px;`, x(e.line1, {
|
|
1143
1134
|
x1: s + "",
|
|
1144
1135
|
y1: i + "",
|
|
@@ -1147,62 +1138,62 @@ const Tt = function(e, t, n, o) {
|
|
|
1147
1138
|
}), x(e.line2, {
|
|
1148
1139
|
x1: c + "",
|
|
1149
1140
|
y1: d + "",
|
|
1150
|
-
x2:
|
|
1141
|
+
x2: h + "",
|
|
1151
1142
|
y2: u + ""
|
|
1152
|
-
}), e.helper1 =
|
|
1143
|
+
}), e.helper1 = ge.create(e.P2), e.helper2 = ge.create(e.P3), e.helper1.init(e.map, (a, f) => {
|
|
1153
1144
|
if (!e.currentArrow)
|
|
1154
1145
|
return;
|
|
1155
|
-
r = r +
|
|
1156
|
-
const
|
|
1157
|
-
s =
|
|
1158
|
-
const g = s / 8 + r * 3 / 8 + c * 3 / 8 +
|
|
1159
|
-
if (e.P2.style.top = l + "px", e.P2.style.left = r + "px", e.currentArrow.children[0].setAttribute("d", `M ${s} ${i} C ${r} ${l} ${c} ${d} ${
|
|
1160
|
-
const v =
|
|
1146
|
+
r = r + a / e.scaleVal, l = l + f / e.scaleVal;
|
|
1147
|
+
const p = O({ ...n, ctrlX: r, ctrlY: l });
|
|
1148
|
+
s = p.x, i = p.y;
|
|
1149
|
+
const g = s / 8 + r * 3 / 8 + c * 3 / 8 + h / 8, m = i / 8 + l * 3 / 8 + d * 3 / 8 + u / 8;
|
|
1150
|
+
if (e.P2.style.top = l + "px", e.P2.style.left = r + "px", e.currentArrow.children[0].setAttribute("d", `M ${s} ${i} C ${r} ${l} ${c} ${d} ${h} ${u}`), t.bidirectional) {
|
|
1151
|
+
const v = J(r, l, s, i);
|
|
1161
1152
|
e.currentArrow.children[2].setAttribute("d", `M ${v.x1} ${v.y1} L ${s} ${i} L ${v.x2} ${v.y2}`);
|
|
1162
1153
|
}
|
|
1163
1154
|
x(e.currentArrow.children[3], {
|
|
1164
1155
|
x: g + "",
|
|
1165
|
-
y:
|
|
1156
|
+
y: m + ""
|
|
1166
1157
|
}), x(e.line1, {
|
|
1167
1158
|
x1: s + "",
|
|
1168
1159
|
y1: i + "",
|
|
1169
1160
|
x2: r + "",
|
|
1170
1161
|
y2: l + ""
|
|
1171
1162
|
}), t.delta1.x = r - n.cx, t.delta1.y = l - n.cy, e.bus.fire("updateArrowDelta", t);
|
|
1172
|
-
}), e.helper2.init(e.map, (
|
|
1163
|
+
}), e.helper2.init(e.map, (a, f) => {
|
|
1173
1164
|
if (!e.currentArrow)
|
|
1174
1165
|
return;
|
|
1175
|
-
c = c +
|
|
1176
|
-
const
|
|
1177
|
-
|
|
1178
|
-
const g = s / 8 + r * 3 / 8 + c * 3 / 8 +
|
|
1179
|
-
e.P3.style.top = d + "px", e.P3.style.left = c + "px", e.currentArrow.children[0].setAttribute("d", `M ${s} ${i} C ${r} ${l} ${c} ${d} ${
|
|
1166
|
+
c = c + a / e.scaleVal, d = d + f / e.scaleVal;
|
|
1167
|
+
const p = O({ ...o, ctrlX: c, ctrlY: d });
|
|
1168
|
+
h = p.x, u = p.y;
|
|
1169
|
+
const g = s / 8 + r * 3 / 8 + c * 3 / 8 + h / 8, m = i / 8 + l * 3 / 8 + d * 3 / 8 + u / 8, v = J(c, d, h, u);
|
|
1170
|
+
e.P3.style.top = d + "px", e.P3.style.left = c + "px", e.currentArrow.children[0].setAttribute("d", `M ${s} ${i} C ${r} ${l} ${c} ${d} ${h} ${u}`), e.currentArrow.children[1].setAttribute("d", `M ${v.x1} ${v.y1} L ${h} ${u} L ${v.x2} ${v.y2}`), x(e.currentArrow.children[3], {
|
|
1180
1171
|
x: g + "",
|
|
1181
|
-
y:
|
|
1172
|
+
y: m + ""
|
|
1182
1173
|
}), x(e.line2, {
|
|
1183
1174
|
x1: c + "",
|
|
1184
1175
|
y1: d + "",
|
|
1185
|
-
x2:
|
|
1176
|
+
x2: h + "",
|
|
1186
1177
|
y2: u + ""
|
|
1187
1178
|
}), t.delta2.x = c - o.cx, t.delta2.y = d - o.cy, e.bus.fire("updateArrowDelta", t);
|
|
1188
1179
|
});
|
|
1189
1180
|
};
|
|
1190
|
-
function
|
|
1181
|
+
function kt() {
|
|
1191
1182
|
this.linkSvgGroup.innerHTML = "";
|
|
1192
1183
|
for (let e = 0; e < this.arrows.length; e++) {
|
|
1193
1184
|
const t = this.arrows[e];
|
|
1194
1185
|
try {
|
|
1195
|
-
|
|
1186
|
+
Te(this, L(t.from), L(t.to), t, !0);
|
|
1196
1187
|
} catch {
|
|
1197
1188
|
}
|
|
1198
1189
|
}
|
|
1199
1190
|
this.nodes.appendChild(this.linkSvgGroup);
|
|
1200
1191
|
}
|
|
1201
|
-
function
|
|
1192
|
+
function Ht(e) {
|
|
1202
1193
|
if (se(this), !e)
|
|
1203
1194
|
return;
|
|
1204
1195
|
const t = e.children[3];
|
|
1205
|
-
|
|
1196
|
+
Se(this, t, (n) => {
|
|
1206
1197
|
var i;
|
|
1207
1198
|
const o = e.arrowObj, s = ((i = n.textContent) == null ? void 0 : i.trim()) || "";
|
|
1208
1199
|
s === "" ? o.label = origin : o.label = s, n.remove(), s !== origin && (t.innerHTML = o.label, this.linkDiv(), this.bus.fire("operation", {
|
|
@@ -1211,54 +1202,54 @@ function Dt(e) {
|
|
|
1211
1202
|
}));
|
|
1212
1203
|
});
|
|
1213
1204
|
}
|
|
1214
|
-
function
|
|
1215
|
-
this.arrows = this.arrows.filter((e) =>
|
|
1205
|
+
function Dt() {
|
|
1206
|
+
this.arrows = this.arrows.filter((e) => U(e.from, this.nodeData) && U(e.to, this.nodeData));
|
|
1216
1207
|
}
|
|
1217
|
-
const
|
|
1208
|
+
const Bt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1218
1209
|
__proto__: null,
|
|
1219
|
-
createArrow:
|
|
1220
|
-
editArrowLabel:
|
|
1221
|
-
removeArrow:
|
|
1222
|
-
renderArrow:
|
|
1223
|
-
selectArrow:
|
|
1224
|
-
tidyArrow:
|
|
1225
|
-
unselectArrow:
|
|
1226
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1210
|
+
createArrow: Tt,
|
|
1211
|
+
editArrowLabel: Ht,
|
|
1212
|
+
removeArrow: $t,
|
|
1213
|
+
renderArrow: kt,
|
|
1214
|
+
selectArrow: At,
|
|
1215
|
+
tidyArrow: Dt,
|
|
1216
|
+
unselectArrow: Nt
|
|
1217
|
+
}, Symbol.toStringTag, { value: "Module" })), Pt = function(e) {
|
|
1227
1218
|
var c, d;
|
|
1228
1219
|
if (e.length === 0)
|
|
1229
1220
|
throw new Error("No selected node.");
|
|
1230
1221
|
if (e.length === 1) {
|
|
1231
|
-
const
|
|
1222
|
+
const h = e[0].nodeObj, u = e[0].nodeObj.parent;
|
|
1232
1223
|
if (!u)
|
|
1233
1224
|
throw new Error("Can not select root node.");
|
|
1234
|
-
const
|
|
1225
|
+
const a = u.children.findIndex((f) => h === f);
|
|
1235
1226
|
return {
|
|
1236
1227
|
parent: u.id,
|
|
1237
|
-
start:
|
|
1238
|
-
end:
|
|
1228
|
+
start: a,
|
|
1229
|
+
end: a
|
|
1239
1230
|
};
|
|
1240
1231
|
}
|
|
1241
1232
|
let t = 0;
|
|
1242
|
-
const n = e.map((
|
|
1243
|
-
let u =
|
|
1244
|
-
const
|
|
1233
|
+
const n = e.map((h) => {
|
|
1234
|
+
let u = h.nodeObj;
|
|
1235
|
+
const a = [];
|
|
1245
1236
|
for (; u.parent; ) {
|
|
1246
|
-
const f = u.parent,
|
|
1247
|
-
u = f,
|
|
1237
|
+
const f = u.parent, p = f.children, g = p == null ? void 0 : p.indexOf(u);
|
|
1238
|
+
u = f, a.unshift({ node: u, index: g });
|
|
1248
1239
|
}
|
|
1249
|
-
return
|
|
1240
|
+
return a.length > t && (t = a.length), a;
|
|
1250
1241
|
});
|
|
1251
1242
|
let o = 0;
|
|
1252
1243
|
e:
|
|
1253
1244
|
for (; o < t; o++) {
|
|
1254
|
-
const
|
|
1245
|
+
const h = (c = n[0][o]) == null ? void 0 : c.node;
|
|
1255
1246
|
for (let u = 1; u < n.length; u++)
|
|
1256
|
-
if (((d = n[u][o]) == null ? void 0 : d.node) !==
|
|
1247
|
+
if (((d = n[u][o]) == null ? void 0 : d.node) !== h)
|
|
1257
1248
|
break e;
|
|
1258
1249
|
}
|
|
1259
1250
|
if (!o)
|
|
1260
1251
|
throw new Error("Can not select root node.");
|
|
1261
|
-
const s = n.map((
|
|
1252
|
+
const s = n.map((h) => h[o - 1].index).sort(), i = s[0] || 0, r = s[s.length - 1] || 0, l = n[0][o - 1].node;
|
|
1262
1253
|
if (!l.parent)
|
|
1263
1254
|
throw new Error("Please select nodes in the same main topic.");
|
|
1264
1255
|
return {
|
|
@@ -1266,10 +1257,10 @@ const Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1266
1257
|
start: i,
|
|
1267
1258
|
end: r
|
|
1268
1259
|
};
|
|
1269
|
-
},
|
|
1260
|
+
}, zt = function(e) {
|
|
1270
1261
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "g");
|
|
1271
1262
|
return t.setAttribute("id", e), t;
|
|
1272
|
-
},
|
|
1263
|
+
}, ve = function(e, t) {
|
|
1273
1264
|
const n = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
1274
1265
|
return x(n, {
|
|
1275
1266
|
d: e,
|
|
@@ -1278,7 +1269,7 @@ const Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1278
1269
|
"stroke-linecap": "round",
|
|
1279
1270
|
"stroke-width": "2"
|
|
1280
1271
|
}), n;
|
|
1281
|
-
},
|
|
1272
|
+
}, ye = function(e, t, n, o, s) {
|
|
1282
1273
|
const i = document.createElementNS("http://www.w3.org/2000/svg", "text");
|
|
1283
1274
|
return x(i, {
|
|
1284
1275
|
"text-anchor": o,
|
|
@@ -1286,48 +1277,42 @@ const Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1286
1277
|
y: n + "",
|
|
1287
1278
|
fill: s || "#666"
|
|
1288
1279
|
}), i.innerHTML = e, i;
|
|
1289
|
-
},
|
|
1290
|
-
const n =
|
|
1280
|
+
}, Ot = (e) => L(e).parentElement.parentElement, jt = function({ parent: e, start: t }) {
|
|
1281
|
+
const n = L(e), o = n.nodeObj;
|
|
1291
1282
|
let s;
|
|
1292
|
-
return o.parent ? s = n.closest("me-main").className : s =
|
|
1293
|
-
},
|
|
1294
|
-
var
|
|
1295
|
-
const { id: n, text: o, parent: s, start: i, end: r } = t, l = e.nodes, d =
|
|
1296
|
-
let u = 1 / 0,
|
|
1297
|
-
for (let
|
|
1298
|
-
const
|
|
1299
|
-
if (!
|
|
1283
|
+
return o.parent ? s = n.closest("me-main").className : s = L(o.children[t].id).closest("me-main").className, s;
|
|
1284
|
+
}, Ae = function(e, t) {
|
|
1285
|
+
var H;
|
|
1286
|
+
const { id: n, text: o, parent: s, start: i, end: r } = t, l = e.nodes, d = L(s).nodeObj, h = jt(t);
|
|
1287
|
+
let u = 1 / 0, a = 0, f = 0, p = 0;
|
|
1288
|
+
for (let R = i; R <= r; R++) {
|
|
1289
|
+
const ie = (H = d.children) == null ? void 0 : H[R];
|
|
1290
|
+
if (!ie)
|
|
1300
1291
|
return e.removeSummary(n), null;
|
|
1301
|
-
const
|
|
1302
|
-
|
|
1292
|
+
const W = Ot(ie.id), { offsetLeft: X, offsetTop: re } = k(l, W), le = i === r ? 10 : 20;
|
|
1293
|
+
R === i && (f = re + le), R === r && (p = re + W.offsetHeight - le), X < u && (u = X), W.offsetWidth + X > a && (a = W.offsetWidth + X);
|
|
1303
1294
|
}
|
|
1304
|
-
let g,
|
|
1305
|
-
const v = f + 10,
|
|
1306
|
-
|
|
1307
|
-
const w =
|
|
1308
|
-
return w.appendChild(g), w.appendChild(
|
|
1309
|
-
},
|
|
1295
|
+
let g, m;
|
|
1296
|
+
const v = f + 10, y = p + 10, _ = (v + y) / 2, E = e.theme.cssVar["--color"];
|
|
1297
|
+
h === M.LHS ? (g = ve(`M ${u + 10} ${v} c -5 0 -10 5 -10 10 L ${u} ${y - 10} c 0 5 5 10 10 10 M ${u} ${_} h -10`, E), m = ye(o, u - 20, _ + 6, "end", E)) : (g = ve(`M ${a - 10} ${v} c 5 0 10 5 10 10 L ${a} ${y - 10} c 0 5 -5 10 -10 10 M ${a} ${_} h 10`, E), m = ye(o, a + 20, _ + 6, "start", E));
|
|
1298
|
+
const w = zt("s-" + n);
|
|
1299
|
+
return w.appendChild(g), w.appendChild(m), w.summaryObj = t, e.summarySvg.appendChild(w), w;
|
|
1300
|
+
}, Rt = function() {
|
|
1310
1301
|
let e = [];
|
|
1311
1302
|
this.currentNode ? e = [this.currentNode] : this.currentNodes && (e = this.currentNodes);
|
|
1312
|
-
const { parent: t, start: n, end: o } =
|
|
1303
|
+
const { parent: t, start: n, end: o } = Pt(e), s = { id: oe(), parent: t, start: n, end: o, text: "summary" }, i = Ae(this, s);
|
|
1313
1304
|
this.summaries.push(s), this.editSummary(i), this.bus.fire("operation", {
|
|
1314
1305
|
name: "createSummary",
|
|
1315
1306
|
obj: s
|
|
1316
1307
|
});
|
|
1317
|
-
},
|
|
1318
|
-
const t = ee(), n = { ...e, id: t };
|
|
1319
|
-
ie(this, n), this.summaries.push(n), this.bus.fire("operation", {
|
|
1320
|
-
name: "createSummary",
|
|
1321
|
-
obj: n
|
|
1322
|
-
});
|
|
1323
|
-
}, Wt = function(e) {
|
|
1308
|
+
}, qt = function(e) {
|
|
1324
1309
|
var n;
|
|
1325
1310
|
const t = this.summaries.findIndex((o) => o.id === e);
|
|
1326
1311
|
t > -1 && (this.summaries.splice(t, 1), (n = document.querySelector("#s-" + e)) == null || n.remove()), this.bus.fire("operation", {
|
|
1327
1312
|
name: "removeSummary",
|
|
1328
1313
|
obj: { id: e }
|
|
1329
1314
|
});
|
|
1330
|
-
},
|
|
1315
|
+
}, Vt = function(e) {
|
|
1331
1316
|
const t = e.children[1].getBBox(), n = 6, o = 3, s = document.createElementNS("http://www.w3.org/2000/svg", "rect");
|
|
1332
1317
|
x(s, {
|
|
1333
1318
|
x: t.x - n + "",
|
|
@@ -1339,21 +1324,21 @@ const Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1339
1324
|
"stroke-width": "2",
|
|
1340
1325
|
fill: "none"
|
|
1341
1326
|
}), e.appendChild(s), this.currentSummary = e;
|
|
1342
|
-
},
|
|
1327
|
+
}, Ft = function() {
|
|
1343
1328
|
var e, t;
|
|
1344
1329
|
(t = (e = this.currentSummary) == null ? void 0 : e.querySelector("rect")) == null || t.remove(), this.currentSummary = null;
|
|
1345
|
-
},
|
|
1330
|
+
}, It = function() {
|
|
1346
1331
|
this.summarySvg.innerHTML = "", this.summaries.forEach((e) => {
|
|
1347
1332
|
try {
|
|
1348
|
-
|
|
1333
|
+
Ae(this, e);
|
|
1349
1334
|
} catch {
|
|
1350
1335
|
}
|
|
1351
1336
|
}), this.nodes.insertAdjacentElement("beforeend", this.summarySvg);
|
|
1352
|
-
},
|
|
1337
|
+
}, Wt = function(e) {
|
|
1353
1338
|
if (!e)
|
|
1354
1339
|
return;
|
|
1355
1340
|
const t = e.childNodes[1];
|
|
1356
|
-
|
|
1341
|
+
Se(this, t, (n) => {
|
|
1357
1342
|
var i;
|
|
1358
1343
|
const o = e.summaryObj, s = ((i = n.textContent) == null ? void 0 : i.trim()) || "";
|
|
1359
1344
|
s === "" ? o.text = origin : o.text = s, n.remove(), s !== origin && (t.innerHTML = o.text, this.linkDiv(), this.bus.fire("operation", {
|
|
@@ -1361,37 +1346,36 @@ const Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1361
1346
|
obj: o
|
|
1362
1347
|
}));
|
|
1363
1348
|
});
|
|
1364
|
-
},
|
|
1349
|
+
}, Xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1365
1350
|
__proto__: null,
|
|
1366
|
-
createSummary:
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
const n = document.createElementNS(L, "svg");
|
|
1351
|
+
createSummary: Rt,
|
|
1352
|
+
editSummary: Wt,
|
|
1353
|
+
removeSummary: qt,
|
|
1354
|
+
renderSummary: It,
|
|
1355
|
+
selectSummary: Vt,
|
|
1356
|
+
unselectSummary: Ft
|
|
1357
|
+
}, Symbol.toStringTag, { value: "Module" })), C = "http://www.w3.org/2000/svg";
|
|
1358
|
+
function Yt(e, t) {
|
|
1359
|
+
const n = document.createElementNS(C, "svg");
|
|
1376
1360
|
return x(n, {
|
|
1377
1361
|
version: "1.1",
|
|
1378
|
-
xmlns:
|
|
1362
|
+
xmlns: C,
|
|
1379
1363
|
height: e,
|
|
1380
1364
|
width: t
|
|
1381
1365
|
}), n;
|
|
1382
1366
|
}
|
|
1383
|
-
function
|
|
1367
|
+
function Gt(e, t) {
|
|
1384
1368
|
return (parseInt(e) - parseInt(t)) / 2;
|
|
1385
1369
|
}
|
|
1386
|
-
function
|
|
1387
|
-
const s = document.createElementNS(
|
|
1370
|
+
function Kt(e, t, n, o) {
|
|
1371
|
+
const s = document.createElementNS(C, "g");
|
|
1388
1372
|
let i = "";
|
|
1389
1373
|
return e.text ? i = e.text.textContent : i = e.childNodes[0].textContent, i.split(`
|
|
1390
1374
|
`).forEach((l, c) => {
|
|
1391
|
-
const d = document.createElementNS(
|
|
1375
|
+
const d = document.createElementNS(C, "text");
|
|
1392
1376
|
x(d, {
|
|
1393
1377
|
x: n + parseInt(t.paddingLeft) + "",
|
|
1394
|
-
y: o + parseInt(t.paddingTop) +
|
|
1378
|
+
y: o + parseInt(t.paddingTop) + Gt(t.lineHeight, t.fontSize) * (c + 1) + parseFloat(t.fontSize) * (c + 1) + "",
|
|
1395
1379
|
"text-anchor": "start",
|
|
1396
1380
|
"font-family": t.fontFamily,
|
|
1397
1381
|
"font-size": `${t.fontSize}`,
|
|
@@ -1400,11 +1384,11 @@ function Ut(e, t, n, o) {
|
|
|
1400
1384
|
}), d.innerHTML = l, s.appendChild(d);
|
|
1401
1385
|
}), s;
|
|
1402
1386
|
}
|
|
1403
|
-
function
|
|
1387
|
+
function Ut(e, t, n, o) {
|
|
1404
1388
|
var l;
|
|
1405
1389
|
let s = "";
|
|
1406
1390
|
(l = e.nodeObj) != null && l.dangerouslySetInnerHTML ? s = e.nodeObj.dangerouslySetInnerHTML : e.text ? s = e.text.textContent : s = e.childNodes[0].textContent;
|
|
1407
|
-
const i = document.createElementNS(
|
|
1391
|
+
const i = document.createElementNS(C, "foreignObject");
|
|
1408
1392
|
x(i, {
|
|
1409
1393
|
x: n + parseInt(t.paddingLeft) + "",
|
|
1410
1394
|
y: o + parseInt(t.paddingTop) + "",
|
|
@@ -1417,8 +1401,8 @@ function Qt(e, t, n, o) {
|
|
|
1417
1401
|
style: `font-family: ${t.fontFamily}; font-size: ${t.fontSize}; font-weight: ${t.fontWeight}; color: ${t.color}; white-space: pre-wrap;`
|
|
1418
1402
|
}), r.innerHTML = s, i.appendChild(r), i;
|
|
1419
1403
|
}
|
|
1420
|
-
function
|
|
1421
|
-
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } =
|
|
1404
|
+
function Jt(e, t) {
|
|
1405
|
+
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = k(e.nodes, t), i = document.createElementNS(C, "rect");
|
|
1422
1406
|
return x(i, {
|
|
1423
1407
|
x: o + "",
|
|
1424
1408
|
y: s + "",
|
|
@@ -1432,7 +1416,7 @@ function Zt(e, t) {
|
|
|
1432
1416
|
}), i;
|
|
1433
1417
|
}
|
|
1434
1418
|
function G(e, t, n = !1) {
|
|
1435
|
-
const o = getComputedStyle(t), { offsetLeft: s, offsetTop: i } =
|
|
1419
|
+
const o = getComputedStyle(t), { offsetLeft: s, offsetTop: i } = k(e.nodes, t), r = document.createElementNS(C, "rect");
|
|
1436
1420
|
x(r, {
|
|
1437
1421
|
x: s + "",
|
|
1438
1422
|
y: i + "",
|
|
@@ -1444,13 +1428,13 @@ function G(e, t, n = !1) {
|
|
|
1444
1428
|
stroke: o.borderColor,
|
|
1445
1429
|
"stroke-width": o.borderWidth
|
|
1446
1430
|
});
|
|
1447
|
-
const l = document.createElementNS(
|
|
1431
|
+
const l = document.createElementNS(C, "g");
|
|
1448
1432
|
l.appendChild(r);
|
|
1449
1433
|
let c;
|
|
1450
|
-
return n ? c =
|
|
1434
|
+
return n ? c = Ut(t, o, s, i) : c = Kt(t, o, s, i), l.appendChild(c), l;
|
|
1451
1435
|
}
|
|
1452
|
-
function
|
|
1453
|
-
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } =
|
|
1436
|
+
function Qt(e, t) {
|
|
1437
|
+
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = k(e.nodes, t), i = document.createElementNS(C, "a"), r = document.createElementNS(C, "text");
|
|
1454
1438
|
return x(r, {
|
|
1455
1439
|
x: o + "",
|
|
1456
1440
|
y: s + parseInt(n.fontSize) + "",
|
|
@@ -1461,8 +1445,8 @@ function en(e, t) {
|
|
|
1461
1445
|
fill: `${n.color}`
|
|
1462
1446
|
}), r.innerHTML = t.textContent, i.appendChild(r), i.setAttribute("href", t.href), i;
|
|
1463
1447
|
}
|
|
1464
|
-
function
|
|
1465
|
-
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } =
|
|
1448
|
+
function Zt(e, t) {
|
|
1449
|
+
const n = getComputedStyle(t), { offsetLeft: o, offsetTop: s } = k(e.nodes, t), i = document.createElementNS(C, "image");
|
|
1466
1450
|
return x(i, {
|
|
1467
1451
|
x: o + "",
|
|
1468
1452
|
y: s + "",
|
|
@@ -1471,41 +1455,41 @@ function tn(e, t) {
|
|
|
1471
1455
|
href: t.src
|
|
1472
1456
|
}), i;
|
|
1473
1457
|
}
|
|
1474
|
-
const K = 100,
|
|
1475
|
-
var u,
|
|
1476
|
-
const n = e.nodes, o = n.offsetHeight + K * 2, s = n.offsetWidth + K * 2, i =
|
|
1458
|
+
const K = 100, en = '<?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">', tn = (e, t = !1) => {
|
|
1459
|
+
var u, a, f;
|
|
1460
|
+
const n = e.nodes, o = n.offsetHeight + K * 2, s = n.offsetWidth + K * 2, i = Yt(o + "px", s + "px"), r = document.createElementNS(C, "svg"), l = document.createElementNS(C, "rect");
|
|
1477
1461
|
x(l, {
|
|
1478
1462
|
x: "0",
|
|
1479
1463
|
y: "0",
|
|
1480
1464
|
width: `${s}`,
|
|
1481
1465
|
height: `${o}`,
|
|
1482
1466
|
fill: e.theme.cssVar["--bgcolor"]
|
|
1483
|
-
}), i.appendChild(l), n.querySelectorAll(".subLines").forEach((
|
|
1484
|
-
const g =
|
|
1485
|
-
g.setAttribute("x", `${
|
|
1467
|
+
}), i.appendChild(l), n.querySelectorAll(".subLines").forEach((p) => {
|
|
1468
|
+
const g = p.cloneNode(!0), { offsetLeft: m, offsetTop: v } = k(n, p.parentElement);
|
|
1469
|
+
g.setAttribute("x", `${m}`), g.setAttribute("y", `${v}`), r.appendChild(g);
|
|
1486
1470
|
});
|
|
1487
1471
|
const c = (u = n.querySelector(".lines")) == null ? void 0 : u.cloneNode(!0);
|
|
1488
1472
|
c && r.appendChild(c);
|
|
1489
|
-
const d = (
|
|
1473
|
+
const d = (a = n.querySelector(".topiclinks")) == null ? void 0 : a.cloneNode(!0);
|
|
1490
1474
|
d && r.appendChild(d);
|
|
1491
|
-
const
|
|
1492
|
-
return
|
|
1493
|
-
|
|
1494
|
-
}), n.querySelectorAll(".tags > span").forEach((
|
|
1495
|
-
r.appendChild(G(e,
|
|
1496
|
-
}), n.querySelectorAll(".icons > span").forEach((
|
|
1497
|
-
r.appendChild(G(e,
|
|
1498
|
-
}), n.querySelectorAll(".hyper-link").forEach((
|
|
1499
|
-
r.appendChild(
|
|
1500
|
-
}), n.querySelectorAll("img").forEach((
|
|
1501
|
-
r.appendChild(
|
|
1475
|
+
const h = (f = n.querySelector(".summary")) == null ? void 0 : f.cloneNode(!0);
|
|
1476
|
+
return h && r.appendChild(h), n.querySelectorAll("me-tpc").forEach((p) => {
|
|
1477
|
+
p.nodeObj.dangerouslySetInnerHTML ? r.appendChild(G(e, p, !t)) : (r.appendChild(Jt(e, p)), r.appendChild(G(e, p.text, !t)));
|
|
1478
|
+
}), n.querySelectorAll(".tags > span").forEach((p) => {
|
|
1479
|
+
r.appendChild(G(e, p));
|
|
1480
|
+
}), n.querySelectorAll(".icons > span").forEach((p) => {
|
|
1481
|
+
r.appendChild(G(e, p));
|
|
1482
|
+
}), n.querySelectorAll(".hyper-link").forEach((p) => {
|
|
1483
|
+
r.appendChild(Qt(e, p));
|
|
1484
|
+
}), n.querySelectorAll("img").forEach((p) => {
|
|
1485
|
+
r.appendChild(Zt(e, p));
|
|
1502
1486
|
}), x(r, {
|
|
1503
1487
|
x: K + "",
|
|
1504
1488
|
y: K + "",
|
|
1505
1489
|
overflow: "visible"
|
|
1506
1490
|
}), i.appendChild(r), i;
|
|
1507
|
-
},
|
|
1508
|
-
function
|
|
1491
|
+
}, nn = (e, t) => (t && e.insertAdjacentHTML("afterbegin", "<style>" + t + "</style>"), en + e.outerHTML);
|
|
1492
|
+
function on(e) {
|
|
1509
1493
|
return new Promise((t, n) => {
|
|
1510
1494
|
const o = new FileReader();
|
|
1511
1495
|
o.onload = (s) => {
|
|
@@ -1515,11 +1499,11 @@ function rn(e) {
|
|
|
1515
1499
|
}, o.readAsDataURL(e);
|
|
1516
1500
|
});
|
|
1517
1501
|
}
|
|
1518
|
-
const
|
|
1519
|
-
const n =
|
|
1502
|
+
const sn = function(e = !1, t) {
|
|
1503
|
+
const n = tn(this, e), o = nn(n, t);
|
|
1520
1504
|
return new Blob([o], { type: "image/svg+xml" });
|
|
1521
|
-
},
|
|
1522
|
-
const n = this.exportSvg(e, t), o = await
|
|
1505
|
+
}, rn = async function(e = !1, t) {
|
|
1506
|
+
const n = this.exportSvg(e, t), o = await on(n);
|
|
1523
1507
|
return new Promise((s, i) => {
|
|
1524
1508
|
const r = new Image();
|
|
1525
1509
|
r.setAttribute("crossOrigin", "anonymous"), r.onload = () => {
|
|
@@ -1527,56 +1511,56 @@ const ln = function(e = !1, t) {
|
|
|
1527
1511
|
l.width = r.width, l.height = r.height, l.getContext("2d").drawImage(r, 0, 0), l.toBlob(s, "image/png", 1);
|
|
1528
1512
|
}, r.src = o, r.onerror = i;
|
|
1529
1513
|
});
|
|
1530
|
-
},
|
|
1514
|
+
}, ln = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1531
1515
|
__proto__: null,
|
|
1532
|
-
exportPng:
|
|
1533
|
-
exportSvg:
|
|
1534
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1535
|
-
getObjById:
|
|
1516
|
+
exportPng: rn,
|
|
1517
|
+
exportSvg: sn
|
|
1518
|
+
}, Symbol.toStringTag, { value: "Module" })), cn = {}, an = {
|
|
1519
|
+
getObjById: U,
|
|
1536
1520
|
generateNewObj: Ne,
|
|
1537
1521
|
layout: De,
|
|
1538
|
-
linkDiv:
|
|
1522
|
+
linkDiv: Ie,
|
|
1539
1523
|
editTopic: qe,
|
|
1540
1524
|
createWrapper: ze,
|
|
1541
1525
|
createParent: Oe,
|
|
1542
1526
|
createChildren: je,
|
|
1543
1527
|
createTopic: Re,
|
|
1544
|
-
findEle:
|
|
1528
|
+
findEle: L,
|
|
1545
1529
|
changeTheme: nt,
|
|
1546
|
-
...
|
|
1547
|
-
...
|
|
1548
|
-
...
|
|
1549
|
-
...
|
|
1550
|
-
...
|
|
1530
|
+
...Ct,
|
|
1531
|
+
...cn,
|
|
1532
|
+
...Bt,
|
|
1533
|
+
...Xt,
|
|
1534
|
+
...ln,
|
|
1551
1535
|
init(e) {
|
|
1552
|
-
if (
|
|
1536
|
+
if (!e || !e.nodeData)
|
|
1553
1537
|
return new Error("MindElixir: `data` is required");
|
|
1554
|
-
e.direction !== void 0 && (this.direction = e.direction), this.changeTheme(e.theme || this.theme, !1), this.nodeData = e.nodeData,
|
|
1538
|
+
e.direction !== void 0 && (this.direction = e.direction), this.changeTheme(e.theme || this.theme, !1), this.nodeData = e.nodeData, ne(this.nodeData), this.arrows = e.arrows || [], this.summaries = e.summaries || [], this.tidyArrow(), this.toolBar && Ye(this), this.toCenter(), this.layout(), this.linkDiv();
|
|
1555
1539
|
},
|
|
1556
1540
|
destroy() {
|
|
1557
1541
|
var e;
|
|
1558
1542
|
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.currentNode = 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;
|
|
1559
1543
|
}
|
|
1560
1544
|
};
|
|
1561
|
-
function
|
|
1562
|
-
let
|
|
1545
|
+
function hn({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: r, cH: l, direction: c, containerHeight: d }) {
|
|
1546
|
+
let h = t + n / 2;
|
|
1563
1547
|
const u = e + o / 2;
|
|
1564
|
-
let
|
|
1565
|
-
c ===
|
|
1548
|
+
let a;
|
|
1549
|
+
c === M.LHS ? a = i + r : a = i;
|
|
1566
1550
|
const f = s + l / 2, g = (1 - Math.abs(f - u) / d) * 0.25 * (n / 2);
|
|
1567
|
-
return c ===
|
|
1551
|
+
return c === M.LHS ? h = h - n / 10 - g : h = h + n / 10 + g, `M ${h} ${u} Q ${h} ${f} ${a} ${f}`;
|
|
1568
1552
|
}
|
|
1569
|
-
function
|
|
1570
|
-
const
|
|
1571
|
-
let u = 0,
|
|
1553
|
+
function dn({ pT: e, pL: t, pW: n, pH: o, cT: s, cL: i, cW: r, cH: l, direction: c, isFirst: d }) {
|
|
1554
|
+
const h = parseInt(this.mindElixirBox.style.getPropertyValue("--gap"));
|
|
1555
|
+
let u = 0, a = 0;
|
|
1572
1556
|
d ? u = e + o / 2 : u = e + o;
|
|
1573
1557
|
const f = s + l;
|
|
1574
|
-
let
|
|
1575
|
-
const v = Math.abs(u - f) / 300 *
|
|
1576
|
-
return c ===
|
|
1558
|
+
let p = 0, g = 0, m = 0;
|
|
1559
|
+
const v = Math.abs(u - f) / 300 * h;
|
|
1560
|
+
return c === M.LHS ? (m = t, p = m + h, g = m - h, a = i + h, `M ${p} ${u} C ${m} ${u} ${m + v} ${f} ${g} ${f} H ${a}`) : (m = t + n, p = m - h, g = m + h, a = i + r - h, `M ${p} ${u} C ${m} ${u} ${m - v} ${f} ${g} ${f} H ${a}`);
|
|
1577
1561
|
}
|
|
1578
|
-
const
|
|
1579
|
-
function
|
|
1562
|
+
const un = "4.4.1", q = document;
|
|
1563
|
+
function T({
|
|
1580
1564
|
el: e,
|
|
1581
1565
|
direction: t,
|
|
1582
1566
|
locale: n,
|
|
@@ -1587,35 +1571,34 @@ function $({
|
|
|
1587
1571
|
toolBar: l,
|
|
1588
1572
|
keypress: c,
|
|
1589
1573
|
mouseSelectionButton: d,
|
|
1590
|
-
selectionContainer:
|
|
1574
|
+
selectionContainer: h,
|
|
1591
1575
|
before: u,
|
|
1592
|
-
newTopicName:
|
|
1576
|
+
newTopicName: a,
|
|
1593
1577
|
allowUndo: f,
|
|
1594
|
-
generateMainBranch:
|
|
1578
|
+
generateMainBranch: p,
|
|
1595
1579
|
generateSubBranch: g,
|
|
1596
|
-
overflowHidden:
|
|
1597
|
-
theme: v
|
|
1598
|
-
alignment: E
|
|
1580
|
+
overflowHidden: m,
|
|
1581
|
+
theme: v
|
|
1599
1582
|
}) {
|
|
1600
1583
|
let y = null;
|
|
1601
1584
|
const _ = Object.prototype.toString.call(e);
|
|
1602
1585
|
if (_ === "[object HTMLDivElement]" ? y = e : _ === "[object String]" && (y = document.querySelector(e)), !y)
|
|
1603
1586
|
throw new Error("MindElixir: el is not a valid element");
|
|
1604
|
-
y.
|
|
1605
|
-
const
|
|
1606
|
-
this.theme = v || (
|
|
1607
|
-
const
|
|
1608
|
-
|
|
1587
|
+
y.className += " mind-elixir", y.innerHTML = "", this.mindElixirBox = y, 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 = a || "new node", this.editable = s === void 0 ? !0 : s, this.allowUndo = f === void 0 ? !1 : f, this.currentNode = null, this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.generateMainBranch = p || hn, this.generateSubBranch = g || dn, this.overflowHidden = m || !1, this.bus = He.create(), this.container = q.createElement("div"), this.selectionContainer = h || this.container, this.container.className = "map-container";
|
|
1588
|
+
const E = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1589
|
+
this.theme = v || (E.matches ? xe : be);
|
|
1590
|
+
const w = q.createElement("div");
|
|
1591
|
+
w.className = "map-canvas", this.map = w, this.map.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.mindElixirBox.appendChild(this.container), this.nodes = q.createElement("me-nodes"), this.nodes.className = "main-node-container", this.lines = V("lines"), this.summarySvg = V("summary"), this.linkController = V("linkcontroller"), this.P2 = q.createElement("div"), this.P3 = q.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = he(), this.line2 = he(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = V("topiclinks"), this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : ke(this);
|
|
1609
1592
|
}
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1593
|
+
T.prototype = an;
|
|
1594
|
+
T.LEFT = j;
|
|
1595
|
+
T.RIGHT = ee;
|
|
1596
|
+
T.SIDE = te;
|
|
1597
|
+
T.THEME = be;
|
|
1598
|
+
T.DARK_THEME = xe;
|
|
1599
|
+
T.version = un;
|
|
1600
|
+
T.E = L;
|
|
1601
|
+
T.dragMoveHelper = N;
|
|
1619
1602
|
export {
|
|
1620
|
-
|
|
1603
|
+
T as default
|
|
1621
1604
|
};
|