mind-elixir 5.0.0-beta.9 → 5.0.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/LayoutSsr.iife.js +1 -0
- package/dist/LayoutSsr.js +95 -0
- package/dist/MindElixir.iife.js +7 -10
- package/dist/MindElixir.js +1404 -1300
- package/dist/MindElixirLite.iife.js +7 -10
- package/dist/MindElixirLite.js +785 -1124
- package/dist/example.iife.js +3 -3
- package/dist/example.js +169 -44
- package/dist/style.css +1 -0
- package/dist/types/arrow.d.ts +38 -1
- package/dist/types/exampleData/1.cn.d.ts +3 -125
- package/dist/types/index.d.ts +50 -51
- package/dist/types/interact.d.ts +4 -3
- package/dist/types/linkDiv.d.ts +1 -1
- package/dist/types/methods.d.ts +12 -12
- package/dist/types/mouse.d.ts +1 -1
- package/dist/types/nodeOperation.d.ts +1 -2
- package/dist/types/plugin/contextMenu.d.ts +1 -1
- package/dist/types/plugin/keypress.d.ts +6 -2
- package/dist/types/plugin/nodeDraggable.d.ts +1 -1
- package/dist/types/plugin/operationHistory.d.ts +1 -1
- package/dist/types/summary.d.ts +1 -1
- package/dist/types/types/index.d.ts +31 -39
- package/dist/types/utils/LinkDragMoveHelper.d.ts +14 -10
- package/dist/types/utils/dom.d.ts +1 -1
- package/dist/types/utils/dragMoveHelper.d.ts +1 -1
- package/dist/types/utils/index.d.ts +5 -0
- package/dist/types/utils/layout-ssr.d.ts +90 -0
- package/dist/types/utils/pubsub.d.ts +4 -10
- package/dist/types/utils/svg.d.ts +9 -1
- package/dist/types/utils/theme.d.ts +1 -2
- package/package.json +11 -5
- package/readme.md +59 -68
package/dist/MindElixirLite.js
CHANGED
|
@@ -1,128 +1,145 @@
|
|
|
1
|
-
|
|
2
|
-
(function(t) {
|
|
3
|
-
var e, 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
|
-
if (c && !t.__iconfont__svg__cssinject__) {
|
|
5
|
-
t.__iconfont__svg__cssinject__ = !0;
|
|
6
|
-
try {
|
|
7
|
-
document.write(
|
|
8
|
-
"<style>.svgfont {display: inline-block;width: 1em;height: 1em;fill: currentColor;vertical-align: -0.1em;font-size:16px;}</style>"
|
|
9
|
-
);
|
|
10
|
-
} catch {
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
function u() {
|
|
14
|
-
i || (i = !0, o());
|
|
15
|
-
}
|
|
16
|
-
e = function() {
|
|
17
|
-
var a, d, h, f;
|
|
18
|
-
(f = document.createElement("div")).innerHTML = l, l = null, (h = f.getElementsByTagName("svg")[0]) && (h.setAttribute("aria-hidden", "true"), h.style.position = "absolute", h.style.width = 0, h.style.height = 0, h.style.overflow = "hidden", a = h, (d = document.body).firstChild ? (f = a, (h = d.firstChild).parentNode.insertBefore(f, h)) : d.appendChild(a));
|
|
19
|
-
}, document.addEventListener ? ~["complete", "loaded", "interactive"].indexOf(document.readyState) ? setTimeout(e, 0) : (n = function() {
|
|
20
|
-
document.removeEventListener("DOMContentLoaded", n, !1), e();
|
|
21
|
-
}, document.addEventListener("DOMContentLoaded", n, !1)) : document.attachEvent && (o = e, s = t.document, i = !1, (r = function() {
|
|
22
|
-
try {
|
|
23
|
-
s.documentElement.doScroll("left");
|
|
24
|
-
} catch {
|
|
25
|
-
return void setTimeout(r, 50);
|
|
26
|
-
}
|
|
27
|
-
u();
|
|
28
|
-
})(), s.onreadystatechange = function() {
|
|
29
|
-
s.readyState == "complete" && (s.onreadystatechange = null, u());
|
|
30
|
-
});
|
|
31
|
-
})(window);
|
|
32
|
-
const R = 0, tt = 1, et = 2, xt = {
|
|
1
|
+
const U = {
|
|
33
2
|
name: "Latte",
|
|
34
3
|
type: "light",
|
|
35
4
|
palette: ["#dd7878", "#ea76cb", "#8839ef", "#e64553", "#fe640b", "#df8e1d", "#40a02b", "#209fb5", "#1e66f5", "#7287fd"],
|
|
36
5
|
cssVar: {
|
|
37
|
-
"--gap": "30px",
|
|
6
|
+
"--node-gap-x": "30px",
|
|
7
|
+
"--node-gap-y": "10px",
|
|
8
|
+
"--main-gap-x": "65px",
|
|
9
|
+
"--main-gap-y": "45px",
|
|
10
|
+
"--root-radius": "30px",
|
|
11
|
+
"--main-radius": "20px",
|
|
12
|
+
"--root-color": "#ffffff",
|
|
13
|
+
"--root-bgcolor": "#4c4f69",
|
|
14
|
+
"--root-border-color": "rgba(0, 0, 0, 0)",
|
|
38
15
|
"--main-color": "#444446",
|
|
39
16
|
"--main-bgcolor": "#ffffff",
|
|
17
|
+
"--topic-padding": "3px",
|
|
40
18
|
"--color": "#777777",
|
|
41
19
|
"--bgcolor": "#f6f6f6",
|
|
20
|
+
"--selected": "#4dc4ff",
|
|
42
21
|
"--panel-color": "#444446",
|
|
43
22
|
"--panel-bgcolor": "#ffffff",
|
|
44
|
-
"--panel-border-color": "#eaeaea"
|
|
23
|
+
"--panel-border-color": "#eaeaea",
|
|
24
|
+
"--map-padding": "50px"
|
|
45
25
|
}
|
|
46
|
-
},
|
|
26
|
+
}, K = {
|
|
47
27
|
name: "Dark",
|
|
48
28
|
type: "dark",
|
|
49
29
|
palette: ["#848FA0", "#748BE9", "#D2F9FE", "#4145A5", "#789AFA", "#706CF4", "#EF987F", "#775DD5", "#FCEECF", "#DA7FBC"],
|
|
50
30
|
cssVar: {
|
|
31
|
+
"--node-gap-x": "30px",
|
|
32
|
+
"--node-gap-y": "10px",
|
|
33
|
+
"--main-gap-x": "65px",
|
|
34
|
+
"--main-gap-y": "45px",
|
|
35
|
+
"--root-radius": "30px",
|
|
36
|
+
"--main-radius": "20px",
|
|
37
|
+
"--root-color": "#ffffff",
|
|
38
|
+
"--root-bgcolor": "#2d3748",
|
|
39
|
+
"--root-border-color": "rgba(255, 255, 255, 0.1)",
|
|
51
40
|
"--main-color": "#ffffff",
|
|
52
41
|
"--main-bgcolor": "#4c4f69",
|
|
42
|
+
"--topic-padding": "3px",
|
|
53
43
|
"--color": "#cccccc",
|
|
54
44
|
"--bgcolor": "#252526",
|
|
45
|
+
"--selected": "#4dc4ff",
|
|
55
46
|
"--panel-color": "#ffffff",
|
|
56
47
|
"--panel-bgcolor": "#2d3748",
|
|
57
|
-
"--panel-border-color": "#696969"
|
|
48
|
+
"--panel-border-color": "#696969",
|
|
49
|
+
"--map-padding": "50px 80px"
|
|
58
50
|
}
|
|
59
51
|
};
|
|
60
|
-
function
|
|
52
|
+
function it(t) {
|
|
61
53
|
return t.replace(/&/g, "&").replace(/</g, "<").replace(/"/g, """);
|
|
62
54
|
}
|
|
63
|
-
const
|
|
55
|
+
const Y = function(t, e) {
|
|
64
56
|
if (e.id === t)
|
|
65
57
|
return e;
|
|
66
58
|
if (e.children && e.children.length) {
|
|
67
59
|
for (let n = 0; n < e.children.length; n++) {
|
|
68
|
-
const o =
|
|
60
|
+
const o = Y(t, e.children[n]);
|
|
69
61
|
if (o)
|
|
70
62
|
return o;
|
|
71
63
|
}
|
|
72
64
|
return null;
|
|
73
65
|
} else
|
|
74
66
|
return null;
|
|
75
|
-
},
|
|
67
|
+
}, J = (t, e) => {
|
|
76
68
|
if (t.parent = e, t.children)
|
|
77
69
|
for (let n = 0; n < t.children.length; n++)
|
|
78
|
-
|
|
70
|
+
J(t.children[n], t);
|
|
79
71
|
};
|
|
80
|
-
function
|
|
81
|
-
const
|
|
82
|
-
let r = Math.atan(Math.abs(
|
|
72
|
+
function R(t, e, n, o) {
|
|
73
|
+
const i = o - e, s = t - n;
|
|
74
|
+
let r = Math.atan(Math.abs(i) / Math.abs(s)) / 3.14 * 180;
|
|
83
75
|
if (isNaN(r))
|
|
84
76
|
return;
|
|
85
|
-
|
|
86
|
-
const
|
|
77
|
+
s < 0 && i > 0 && (r = 180 - r), s < 0 && i < 0 && (r = 180 + r), s > 0 && i < 0 && (r = 360 - r);
|
|
78
|
+
const a = 12, f = 30, d = r + f, p = r - f;
|
|
87
79
|
return {
|
|
88
|
-
x1: n + Math.cos(Math.PI *
|
|
89
|
-
y1: o - Math.sin(Math.PI *
|
|
90
|
-
x2: n + Math.cos(Math.PI *
|
|
91
|
-
y2: o - Math.sin(Math.PI *
|
|
80
|
+
x1: n + Math.cos(Math.PI * d / 180) * a,
|
|
81
|
+
y1: o - Math.sin(Math.PI * d / 180) * a,
|
|
82
|
+
x2: n + Math.cos(Math.PI * p / 180) * a,
|
|
83
|
+
y2: o - Math.sin(Math.PI * p / 180) * a
|
|
92
84
|
};
|
|
93
85
|
}
|
|
94
86
|
function W() {
|
|
95
87
|
return ((/* @__PURE__ */ new Date()).getTime().toString(16) + Math.random().toString(16).substr(2)).substr(2, 16);
|
|
96
88
|
}
|
|
97
|
-
const
|
|
89
|
+
const St = function() {
|
|
98
90
|
const t = W();
|
|
99
91
|
return {
|
|
100
92
|
topic: this.newTopicName,
|
|
101
93
|
id: t
|
|
102
94
|
};
|
|
103
|
-
},
|
|
95
|
+
}, D = (t, e) => {
|
|
104
96
|
let n = 0, o = 0;
|
|
105
97
|
for (; e && e !== t; )
|
|
106
98
|
n += e.offsetLeft, o += e.offsetTop, e = e.offsetParent;
|
|
107
99
|
return { offsetLeft: n, offsetTop: o };
|
|
108
|
-
},
|
|
100
|
+
}, v = (t, e) => {
|
|
109
101
|
for (const n in e)
|
|
110
102
|
t.setAttribute(n, e[n]);
|
|
111
|
-
},
|
|
103
|
+
}, st = (t) => t ? t.tagName === "ME-TPC" : !1, ft = (t) => {
|
|
112
104
|
const e = /translate\(([^,]+),\s*([^)]+)\)/, n = t.match(e);
|
|
113
105
|
return n ? { x: parseFloat(n[1]), y: parseFloat(n[2]) } : { x: 0, y: 0 };
|
|
106
|
+
}, pt = function(t) {
|
|
107
|
+
for (let e = 0; e < t.length; e++) {
|
|
108
|
+
const { dom: n, evt: o, func: i } = t[e];
|
|
109
|
+
n.addEventListener(o, i);
|
|
110
|
+
}
|
|
111
|
+
return function() {
|
|
112
|
+
for (let n = 0; n < t.length; n++) {
|
|
113
|
+
const { dom: o, evt: i, func: s } = t[n];
|
|
114
|
+
o.removeEventListener(i, s);
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
var P = /* @__PURE__ */ ((t) => (t.LHS = "lhs", t.RHS = "rhs", t))(P || {});
|
|
119
|
+
const rt = function(t, e, n) {
|
|
120
|
+
const { scaleVal: o, scaleSensitivity: i } = t;
|
|
121
|
+
switch (e) {
|
|
122
|
+
case "in":
|
|
123
|
+
if (o > 1.6)
|
|
124
|
+
return;
|
|
125
|
+
t.scale(o + i, n);
|
|
126
|
+
break;
|
|
127
|
+
case "out":
|
|
128
|
+
if (o < 0.6)
|
|
129
|
+
return;
|
|
130
|
+
t.scale(o - i, n);
|
|
131
|
+
}
|
|
114
132
|
};
|
|
115
|
-
function
|
|
116
|
-
const { dragMoveHelper: e } = t
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (n.button !== 0)
|
|
133
|
+
function Et(t) {
|
|
134
|
+
const { dragMoveHelper: e } = t, n = (l) => {
|
|
135
|
+
var m, w, x;
|
|
136
|
+
if (l.button !== 0)
|
|
120
137
|
return;
|
|
121
|
-
if ((
|
|
138
|
+
if ((m = t.helper1) != null && m.moved) {
|
|
122
139
|
t.helper1.clear();
|
|
123
140
|
return;
|
|
124
141
|
}
|
|
125
|
-
if ((
|
|
142
|
+
if ((w = t.helper2) != null && w.moved) {
|
|
126
143
|
t.helper2.clear();
|
|
127
144
|
return;
|
|
128
145
|
}
|
|
@@ -130,41 +147,74 @@ function Nt(t) {
|
|
|
130
147
|
e.clear();
|
|
131
148
|
return;
|
|
132
149
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
t.selectNode(o, !1, n);
|
|
150
|
+
const c = l.target;
|
|
151
|
+
if (c.tagName === "ME-EPD")
|
|
152
|
+
l.ctrlKey || l.metaKey ? t.expandNodeAll(c.previousSibling) : t.expandNode(c.previousSibling);
|
|
153
|
+
else if (c.tagName === "ME-TPC" && t.currentNodes.length > 1)
|
|
154
|
+
t.selectNode(c);
|
|
139
155
|
else if (!t.editable)
|
|
140
156
|
return;
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
var
|
|
157
|
+
const h = (x = c.parentElement) == null ? void 0 : x.parentElement;
|
|
158
|
+
h.getAttribute("class") === "topiclinks" ? t.selectArrow(c.parentElement) : h.getAttribute("class") === "summary" && t.selectSummary(c.parentElement);
|
|
159
|
+
}, o = (l) => {
|
|
160
|
+
var m;
|
|
145
161
|
if (!t.editable)
|
|
146
162
|
return;
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
const
|
|
150
|
-
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
163
|
+
const c = l.target;
|
|
164
|
+
st(c) && t.beginEdit(c);
|
|
165
|
+
const h = (m = c.parentElement) == null ? void 0 : m.parentElement;
|
|
166
|
+
h.getAttribute("class") === "topiclinks" ? t.editArrowLabel(c.parentElement) : h.getAttribute("class") === "summary" && t.editSummary(c.parentElement);
|
|
167
|
+
};
|
|
168
|
+
let i = 0;
|
|
169
|
+
const s = (l) => {
|
|
170
|
+
if (l.pointerType === "mouse")
|
|
171
|
+
return;
|
|
172
|
+
const c = (/* @__PURE__ */ new Date()).getTime(), h = c - i;
|
|
173
|
+
h < 300 && h > 0 && o(l), i = c;
|
|
174
|
+
}, r = (l) => {
|
|
175
|
+
e.moved = !1;
|
|
176
|
+
const c = t.mouseSelectionButton === 0 ? 2 : 0;
|
|
177
|
+
if (l.button !== c && l.pointerType === "mouse")
|
|
178
|
+
return;
|
|
179
|
+
e.x = l.clientX, e.y = l.clientY;
|
|
180
|
+
const h = l.target;
|
|
181
|
+
h.className !== "circle" && h.contentEditable !== "plaintext-only" && (e.mousedown = !0, t.map.style.transition = "none", h.setPointerCapture(l.pointerId));
|
|
182
|
+
}, a = (l) => {
|
|
183
|
+
if (l.target.contentEditable !== "plaintext-only") {
|
|
184
|
+
const c = l.clientX - e.x, h = l.clientY - e.y;
|
|
185
|
+
e.onMove(c, h);
|
|
186
|
+
}
|
|
187
|
+
e.x = l.clientX, e.y = l.clientY;
|
|
188
|
+
}, f = (l) => {
|
|
189
|
+
const c = t.mouseSelectionButton === 0 ? 2 : 0;
|
|
190
|
+
if (l.button !== c && l.pointerType === "mouse")
|
|
191
|
+
return;
|
|
192
|
+
const h = l.target;
|
|
193
|
+
h.hasPointerCapture && h.hasPointerCapture(l.pointerId) && h.releasePointerCapture(l.pointerId), e.clear();
|
|
194
|
+
}, d = (l) => {
|
|
195
|
+
if (l.preventDefault(), l.button !== 2 || !t.editable)
|
|
196
|
+
return;
|
|
197
|
+
const c = l.target;
|
|
198
|
+
st(c) && !c.classList.contains("selected") && t.selectNode(c), setTimeout(() => {
|
|
199
|
+
t.dragMoveHelper.moved || t.bus.fire("showContextMenu", l);
|
|
200
|
+
}, 200);
|
|
201
|
+
}, p = (l) => {
|
|
202
|
+
l.stopPropagation(), l.preventDefault(), l.ctrlKey || l.metaKey ? l.deltaY < 0 ? rt(t, "in", t.dragMoveHelper) : t.scaleVal - t.scaleSensitivity > 0 && rt(t, "out", t.dragMoveHelper) : l.shiftKey ? t.move(-l.deltaY, 0) : (t.map.style.transition = "none", t.move(-l.deltaX, -l.deltaY), t.map.style.transition = "transform 0.3s");
|
|
203
|
+
}, { container: u } = t;
|
|
204
|
+
return pt([
|
|
205
|
+
{ dom: u, evt: "pointerdown", func: r },
|
|
206
|
+
{ dom: u, evt: "pointermove", func: a },
|
|
207
|
+
{ dom: u, evt: "pointerup", func: f },
|
|
208
|
+
{ dom: u, evt: "pointerup", func: s },
|
|
209
|
+
{ dom: u, evt: "click", func: n },
|
|
210
|
+
{ dom: u, evt: "dblclick", func: o },
|
|
211
|
+
{ dom: u, evt: "contextmenu", func: d },
|
|
212
|
+
{ dom: u, evt: "wheel", func: p }
|
|
213
|
+
]);
|
|
162
214
|
}
|
|
163
|
-
function
|
|
215
|
+
function Tt() {
|
|
164
216
|
return {
|
|
165
217
|
handlers: {},
|
|
166
|
-
showHandler: function() {
|
|
167
|
-
},
|
|
168
218
|
addListener: function(t, e) {
|
|
169
219
|
this.handlers[t] === void 0 && (this.handlers[t] = []), this.handlers[t].push(e);
|
|
170
220
|
},
|
|
@@ -187,105 +237,109 @@ function kt() {
|
|
|
187
237
|
}
|
|
188
238
|
};
|
|
189
239
|
}
|
|
190
|
-
|
|
191
|
-
const Q = document, Ht = function() {
|
|
240
|
+
const X = document, Lt = function() {
|
|
192
241
|
this.nodes.innerHTML = "";
|
|
193
242
|
const t = this.createTopic(this.nodeData);
|
|
194
|
-
|
|
195
|
-
const e =
|
|
243
|
+
gt(t, this.nodeData), t.draggable = !1;
|
|
244
|
+
const e = X.createElement("me-root");
|
|
196
245
|
e.appendChild(t);
|
|
197
246
|
const n = this.nodeData.children || [];
|
|
198
|
-
if (this.direction ===
|
|
199
|
-
let o = 0,
|
|
200
|
-
n.map((
|
|
201
|
-
|
|
247
|
+
if (this.direction === 2) {
|
|
248
|
+
let o = 0, i = 0;
|
|
249
|
+
n.map((s) => {
|
|
250
|
+
s.direction === 0 ? o += 1 : s.direction === 1 ? i += 1 : o <= i ? (s.direction = 0, o += 1) : (s.direction = 1, i += 1);
|
|
202
251
|
});
|
|
203
252
|
}
|
|
204
|
-
|
|
205
|
-
},
|
|
206
|
-
const o =
|
|
207
|
-
o.className =
|
|
208
|
-
const
|
|
209
|
-
|
|
210
|
-
for (let
|
|
211
|
-
const r = e[
|
|
212
|
-
t.direction ===
|
|
253
|
+
kt(this, n, e);
|
|
254
|
+
}, kt = function(t, e, n) {
|
|
255
|
+
const o = X.createElement("me-main");
|
|
256
|
+
o.className = P.LHS;
|
|
257
|
+
const i = X.createElement("me-main");
|
|
258
|
+
i.className = P.RHS;
|
|
259
|
+
for (let s = 0; s < e.length; s++) {
|
|
260
|
+
const r = e[s], { grp: a } = t.createWrapper(r);
|
|
261
|
+
t.direction === 2 ? r.direction === 0 ? o.appendChild(a) : i.appendChild(a) : t.direction === 0 ? o.appendChild(a) : i.appendChild(a);
|
|
213
262
|
}
|
|
214
|
-
t.nodes.appendChild(o), t.nodes.appendChild(n), t.nodes.appendChild(
|
|
215
|
-
},
|
|
216
|
-
const n =
|
|
263
|
+
t.nodes.appendChild(o), t.nodes.appendChild(n), t.nodes.appendChild(i), t.nodes.appendChild(t.lines);
|
|
264
|
+
}, $t = function(t, e) {
|
|
265
|
+
const n = X.createElement("me-children");
|
|
217
266
|
for (let o = 0; o < e.length; o++) {
|
|
218
|
-
const
|
|
219
|
-
n.appendChild(
|
|
267
|
+
const i = e[o], { grp: s } = t.createWrapper(i);
|
|
268
|
+
n.appendChild(s);
|
|
220
269
|
}
|
|
221
270
|
return n;
|
|
222
|
-
},
|
|
223
|
-
const o = (
|
|
271
|
+
}, k = document, ut = function(t, e) {
|
|
272
|
+
const o = (this != null && this.el ? this.el : e || document).querySelector(`[data-nodeid=me${t}]`);
|
|
224
273
|
if (!o)
|
|
225
274
|
throw new Error(`FindEle: Node ${t} not found, maybe it's collapsed.`);
|
|
226
275
|
return o;
|
|
227
|
-
},
|
|
228
|
-
if (t.innerHTML = "", e.style
|
|
276
|
+
}, gt = function(t, e) {
|
|
277
|
+
if (t.innerHTML = "", e.style) {
|
|
278
|
+
const n = e.style;
|
|
279
|
+
for (const o in n)
|
|
280
|
+
t.style[o] = n[o];
|
|
281
|
+
}
|
|
282
|
+
if (e.dangerouslySetInnerHTML) {
|
|
229
283
|
t.innerHTML = e.dangerouslySetInnerHTML;
|
|
230
284
|
return;
|
|
231
285
|
}
|
|
232
286
|
if (e.image) {
|
|
233
287
|
const n = e.image;
|
|
234
288
|
if (n.url && n.width && n.height) {
|
|
235
|
-
const o =
|
|
289
|
+
const o = k.createElement("img");
|
|
236
290
|
o.src = n.url, o.style.width = n.width + "px", o.style.height = n.height + "px", n.fit && (o.style.objectFit = n.fit), t.appendChild(o), t.image = o;
|
|
237
291
|
}
|
|
238
292
|
} else
|
|
239
293
|
t.image && (t.image = void 0);
|
|
240
294
|
{
|
|
241
|
-
const n =
|
|
295
|
+
const n = k.createElement("span");
|
|
242
296
|
n.className = "text", n.textContent = e.topic, t.appendChild(n), t.text = n;
|
|
243
297
|
}
|
|
244
298
|
if (e.hyperLink) {
|
|
245
|
-
const n =
|
|
299
|
+
const n = k.createElement("a");
|
|
246
300
|
n.className = "hyper-link", n.target = "_blank", n.innerText = "🔗", n.href = e.hyperLink, t.appendChild(n), t.link = n;
|
|
247
301
|
} else
|
|
248
302
|
t.link && (t.link = void 0);
|
|
249
303
|
if (e.icons && e.icons.length) {
|
|
250
|
-
const n =
|
|
251
|
-
n.className = "icons", n.innerHTML = e.icons.map((o) => `<span>${
|
|
304
|
+
const n = k.createElement("span");
|
|
305
|
+
n.className = "icons", n.innerHTML = e.icons.map((o) => `<span>${it(o)}</span>`).join(""), t.appendChild(n), t.icons = n;
|
|
252
306
|
} else
|
|
253
307
|
t.icons && (t.icons = void 0);
|
|
254
308
|
if (e.tags && e.tags.length) {
|
|
255
|
-
const n =
|
|
256
|
-
n.className = "tags", n.innerHTML = e.tags.map((o) => `<span>${
|
|
309
|
+
const n = k.createElement("div");
|
|
310
|
+
n.className = "tags", n.innerHTML = e.tags.map((o) => `<span>${it(o)}</span>`).join(""), t.appendChild(n), t.tags = n;
|
|
257
311
|
} else
|
|
258
312
|
t.tags && (t.tags = void 0);
|
|
259
|
-
},
|
|
260
|
-
const n =
|
|
313
|
+
}, At = function(t, e) {
|
|
314
|
+
const n = k.createElement("me-wrapper"), { p: o, tpc: i } = this.createParent(t);
|
|
261
315
|
if (n.appendChild(o), !e && t.children && t.children.length > 0) {
|
|
262
|
-
const
|
|
263
|
-
if (o.appendChild(
|
|
264
|
-
const r =
|
|
316
|
+
const s = Ht(t.expanded);
|
|
317
|
+
if (o.appendChild(s), t.expanded !== !1) {
|
|
318
|
+
const r = $t(this, t.children);
|
|
265
319
|
n.appendChild(r);
|
|
266
320
|
}
|
|
267
321
|
}
|
|
268
|
-
return { grp: n, top: o, tpc:
|
|
269
|
-
},
|
|
270
|
-
const e =
|
|
271
|
-
return
|
|
272
|
-
},
|
|
273
|
-
const e =
|
|
322
|
+
return { grp: n, top: o, tpc: i };
|
|
323
|
+
}, Dt = function(t) {
|
|
324
|
+
const e = k.createElement("me-parent"), n = this.createTopic(t);
|
|
325
|
+
return gt(n, t), e.appendChild(n), { p: e, tpc: n };
|
|
326
|
+
}, Mt = function(t) {
|
|
327
|
+
const e = k.createElement("me-children");
|
|
274
328
|
return e.append(...t), e;
|
|
275
|
-
},
|
|
276
|
-
const e =
|
|
329
|
+
}, Nt = function(t) {
|
|
330
|
+
const e = k.createElement("me-tpc");
|
|
277
331
|
return e.nodeObj = t, e.dataset.nodeid = "me" + t.id, e.draggable = this.draggable, e;
|
|
278
332
|
};
|
|
279
|
-
function
|
|
280
|
-
const e =
|
|
333
|
+
function mt(t) {
|
|
334
|
+
const e = k.createRange();
|
|
281
335
|
e.selectNodeContents(t);
|
|
282
336
|
const n = window.getSelection();
|
|
283
337
|
n && (n.removeAllRanges(), n.addRange(e));
|
|
284
338
|
}
|
|
285
|
-
const
|
|
339
|
+
const Pt = function(t) {
|
|
286
340
|
if (!t)
|
|
287
341
|
return;
|
|
288
|
-
const e =
|
|
342
|
+
const e = k.createElement("div"), n = t.text.textContent;
|
|
289
343
|
t.appendChild(e), e.id = "input-box", e.textContent = n, e.contentEditable = "plaintext-only", e.spellcheck = !1;
|
|
290
344
|
const o = getComputedStyle(t);
|
|
291
345
|
e.style.cssText = `min-width:${t.offsetWidth - 8}px;
|
|
@@ -294,47 +348,47 @@ const Rt = function(t) {
|
|
|
294
348
|
margin:${o.margin};
|
|
295
349
|
font:${o.font};
|
|
296
350
|
background-color:${o.backgroundColor !== "rgba(0, 0, 0, 0)" && o.backgroundColor};
|
|
297
|
-
border-radius:${o.borderRadius};`, this.direction ===
|
|
351
|
+
border-radius:${o.borderRadius};`, this.direction === 0 && (e.style.right = "0"), mt(e), this.bus.fire("operation", {
|
|
298
352
|
name: "beginEdit",
|
|
299
353
|
obj: t.nodeObj
|
|
300
|
-
}), e.addEventListener("keydown", (
|
|
301
|
-
|
|
302
|
-
const
|
|
303
|
-
if (
|
|
304
|
-
if (
|
|
354
|
+
}), e.addEventListener("keydown", (i) => {
|
|
355
|
+
i.stopPropagation();
|
|
356
|
+
const s = i.key;
|
|
357
|
+
if (s === "Enter" || s === "Tab") {
|
|
358
|
+
if (i.shiftKey)
|
|
305
359
|
return;
|
|
306
|
-
|
|
360
|
+
i.preventDefault(), e.blur(), this.container.focus();
|
|
307
361
|
}
|
|
308
362
|
}), e.addEventListener("blur", () => {
|
|
309
363
|
var r;
|
|
310
364
|
if (!e)
|
|
311
365
|
return;
|
|
312
|
-
const
|
|
313
|
-
|
|
366
|
+
const i = t.nodeObj, s = ((r = e.textContent) == null ? void 0 : r.trim()) || "";
|
|
367
|
+
s === "" ? i.topic = n : i.topic = s, e.remove(), s !== n && (t.text.textContent = i.topic, this.linkDiv(), this.bus.fire("operation", {
|
|
314
368
|
name: "finishEdit",
|
|
315
|
-
obj:
|
|
369
|
+
obj: i,
|
|
316
370
|
origin: n
|
|
317
371
|
}));
|
|
318
372
|
});
|
|
319
|
-
},
|
|
320
|
-
const e =
|
|
373
|
+
}, Ht = function(t) {
|
|
374
|
+
const e = k.createElement("me-epd");
|
|
321
375
|
return e.expanded = t !== !1, e.className = t !== !1 ? "minus" : "", e;
|
|
322
|
-
},
|
|
323
|
-
const o =
|
|
324
|
-
return
|
|
376
|
+
}, N = document, T = "http://www.w3.org/2000/svg", wt = function(t, e, n) {
|
|
377
|
+
const o = N.createElementNS(T, "path");
|
|
378
|
+
return v(o, {
|
|
325
379
|
d: t,
|
|
326
380
|
stroke: e || "#666",
|
|
327
381
|
fill: "none",
|
|
328
382
|
"stroke-width": n
|
|
329
383
|
}), o;
|
|
330
|
-
},
|
|
331
|
-
const e =
|
|
384
|
+
}, V = function(t) {
|
|
385
|
+
const e = N.createElementNS(T, "svg");
|
|
332
386
|
return e.setAttribute("class", t), e.setAttribute("overflow", "visible"), e;
|
|
333
|
-
},
|
|
334
|
-
const t =
|
|
335
|
-
return t.setAttribute("stroke", "#
|
|
336
|
-
},
|
|
337
|
-
const
|
|
387
|
+
}, ct = function() {
|
|
388
|
+
const t = N.createElementNS(T, "line");
|
|
389
|
+
return t.setAttribute("stroke", "#4dc4ff"), t.setAttribute("fill", "none"), t.setAttribute("stroke-width", "2"), t.setAttribute("opacity", "0.45"), t;
|
|
390
|
+
}, Bt = function(t, e, n, o) {
|
|
391
|
+
const i = N.createElementNS(T, "g");
|
|
338
392
|
return [
|
|
339
393
|
{
|
|
340
394
|
name: "line",
|
|
@@ -348,52 +402,52 @@ const Rt = function(t) {
|
|
|
348
402
|
name: "arrow2",
|
|
349
403
|
d: n
|
|
350
404
|
}
|
|
351
|
-
].forEach((
|
|
352
|
-
const
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
stroke: "rgb(235, 95, 82)",
|
|
405
|
+
].forEach((r, a) => {
|
|
406
|
+
const f = r.d, d = N.createElementNS(T, "path"), p = {
|
|
407
|
+
d: f,
|
|
408
|
+
stroke: (o == null ? void 0 : o.stroke) || "rgb(235, 95, 82)",
|
|
356
409
|
fill: "none",
|
|
357
|
-
"stroke-linecap": "cap",
|
|
358
|
-
"stroke-width": "2"
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
410
|
+
"stroke-linecap": (o == null ? void 0 : o.strokeLinecap) || "cap",
|
|
411
|
+
"stroke-width": String((o == null ? void 0 : o.strokeWidth) || "2")
|
|
412
|
+
};
|
|
413
|
+
(o == null ? void 0 : o.opacity) !== void 0 && (p.opacity = String(o.opacity)), v(d, p), a === 0 && d.setAttribute("stroke-dasharray", (o == null ? void 0 : o.strokeDasharray) || "8,2");
|
|
414
|
+
const u = N.createElementNS(T, "path");
|
|
415
|
+
v(u, {
|
|
416
|
+
d: f,
|
|
363
417
|
stroke: "transparent",
|
|
364
418
|
fill: "none",
|
|
365
419
|
"stroke-width": "15"
|
|
366
|
-
}),
|
|
367
|
-
}),
|
|
368
|
-
},
|
|
420
|
+
}), i.appendChild(u), i.appendChild(d), i[r.name] = d;
|
|
421
|
+
}), i;
|
|
422
|
+
}, xt = function(t, e, n) {
|
|
369
423
|
if (!e)
|
|
370
424
|
return;
|
|
371
|
-
const o =
|
|
425
|
+
const o = N.createElement("div");
|
|
372
426
|
t.nodes.appendChild(o);
|
|
373
|
-
const
|
|
374
|
-
o.id = "input-box", o.textContent =
|
|
375
|
-
const
|
|
427
|
+
const i = e.innerHTML;
|
|
428
|
+
o.id = "input-box", o.textContent = i, o.contentEditable = "plaintext-only", o.spellcheck = !1;
|
|
429
|
+
const s = e.getBBox();
|
|
376
430
|
o.style.cssText = `
|
|
377
|
-
min-width:${Math.max(88,
|
|
431
|
+
min-width:${Math.max(88, s.width)}px;
|
|
378
432
|
position:absolute;
|
|
379
|
-
left:${
|
|
380
|
-
top:${
|
|
433
|
+
left:${s.x}px;
|
|
434
|
+
top:${s.y}px;
|
|
381
435
|
padding: 2px 4px;
|
|
382
436
|
margin: -2px -4px;
|
|
383
|
-
`, o
|
|
437
|
+
`, mt(o), t.scrollIntoView(o), o.addEventListener("keydown", (r) => {
|
|
384
438
|
r.stopPropagation();
|
|
385
|
-
const
|
|
386
|
-
if (
|
|
439
|
+
const a = r.key;
|
|
440
|
+
if (a === "Enter" || a === "Tab") {
|
|
387
441
|
if (r.shiftKey)
|
|
388
442
|
return;
|
|
389
|
-
r.preventDefault(), o.blur(), t.
|
|
443
|
+
r.preventDefault(), o.blur(), t.container.focus();
|
|
390
444
|
}
|
|
391
445
|
}), o.addEventListener("blur", () => {
|
|
392
|
-
var
|
|
446
|
+
var a;
|
|
393
447
|
if (!o)
|
|
394
448
|
return;
|
|
395
|
-
const r = ((
|
|
396
|
-
r === "" ? n.label =
|
|
449
|
+
const r = ((a = o.textContent) == null ? void 0 : a.trim()) || "";
|
|
450
|
+
r === "" ? n.label = i : n.label = r, o.remove(), r !== i && (e.innerHTML = n.label, t.linkDiv(), "parent" in n ? t.bus.fire("operation", {
|
|
397
451
|
name: "finishEditSummary",
|
|
398
452
|
obj: n
|
|
399
453
|
}) : t.bus.fire("operation", {
|
|
@@ -401,526 +455,88 @@ const Rt = function(t) {
|
|
|
401
455
|
obj: n
|
|
402
456
|
}));
|
|
403
457
|
});
|
|
404
|
-
},
|
|
405
|
-
const e = this.map.querySelector("me-root"), n = e.offsetTop, o = e.offsetLeft,
|
|
406
|
-
this.nodes.style.top = `${1e4 - this.nodes.offsetHeight / 2}px`, this.alignment === "root" ? this.nodes.style.left = `${1e4 - o - s / 2}px` : this.nodes.style.left = `${1e4 - l / 2}px`;
|
|
407
|
-
const c = this.map.querySelectorAll("me-main > me-wrapper");
|
|
458
|
+
}, Ot = function(t) {
|
|
459
|
+
const e = this.map.querySelector("me-root"), n = e.offsetTop, o = e.offsetLeft, i = e.offsetWidth, s = e.offsetHeight, r = this.map.querySelectorAll("me-main > me-wrapper");
|
|
408
460
|
this.lines.innerHTML = "";
|
|
409
|
-
for (let
|
|
410
|
-
const
|
|
411
|
-
d.style.borderColor =
|
|
412
|
-
const E = a.children[0].children[1];
|
|
413
|
-
if (E && (E.style.top = (E.parentNode.offsetHeight - E.offsetHeight) / 2 + "px", p === T.LHS ? E.style.left = "-10px" : E.style.right = "-10px"), t && t !== a)
|
|
461
|
+
for (let a = 0; a < r.length; a++) {
|
|
462
|
+
const f = r[a], d = f.querySelector("me-tpc"), { offsetLeft: p, offsetTop: u } = D(this.nodes, d), g = d.offsetWidth, l = d.offsetHeight, c = f.parentNode.className, h = this.generateMainBranch({ pT: n, pL: o, pW: i, pH: s, cT: u, cL: p, cW: g, cH: l, direction: c, containerHeight: this.nodes.offsetHeight }), m = this.theme.palette, w = d.nodeObj.branchColor || m[a % m.length];
|
|
463
|
+
if (d.style.borderColor = w, this.lines.appendChild(wt(h, w, "3")), t && t !== f)
|
|
414
464
|
continue;
|
|
415
|
-
const
|
|
416
|
-
|
|
465
|
+
const x = V("subLines"), y = f.lastChild;
|
|
466
|
+
y.tagName === "svg" && y.remove(), f.appendChild(x), yt(this, x, w, f, c, !0);
|
|
417
467
|
}
|
|
418
468
|
this.renderArrow(), this.renderSummary(), this.bus.fire("linkDiv");
|
|
419
|
-
},
|
|
420
|
-
const r = o.firstChild,
|
|
421
|
-
if (
|
|
469
|
+
}, yt = function(t, e, n, o, i, s) {
|
|
470
|
+
const r = o.firstChild, a = o.children[1].children;
|
|
471
|
+
if (a.length === 0)
|
|
422
472
|
return;
|
|
423
|
-
const
|
|
424
|
-
for (let
|
|
425
|
-
const
|
|
426
|
-
e.appendChild(
|
|
427
|
-
const
|
|
428
|
-
if (
|
|
429
|
-
if (
|
|
473
|
+
const f = r.offsetTop, d = r.offsetLeft, p = r.offsetWidth, u = r.offsetHeight;
|
|
474
|
+
for (let g = 0; g < a.length; g++) {
|
|
475
|
+
const l = a[g], c = l.firstChild, h = c.offsetTop, m = c.offsetLeft, w = c.offsetWidth, x = c.offsetHeight, y = c.firstChild.nodeObj.branchColor || n, b = t.generateSubBranch({ pT: f, pL: d, pW: p, pH: u, cT: h, cL: m, cW: w, cH: x, direction: i, isFirst: s });
|
|
476
|
+
e.appendChild(wt(b, y, "2"));
|
|
477
|
+
const C = c.children[1];
|
|
478
|
+
if (C) {
|
|
479
|
+
if (!C.expanded)
|
|
430
480
|
continue;
|
|
431
481
|
} else
|
|
432
482
|
continue;
|
|
433
|
-
|
|
483
|
+
yt(t, e, y, l, i);
|
|
434
484
|
}
|
|
435
485
|
};
|
|
436
|
-
const
|
|
486
|
+
const Vt = '<?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"><svg t="1750169394918" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2021" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><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" p-id="2022"></path></svg>', Wt = '<?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"><svg t="1750169375313" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1775" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><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="currentColor" p-id="1776"></path></svg>', Gt = '<?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"><svg t="1750169667709" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3037" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><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="currentColor" p-id="3038"></path></svg>', It = '<?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"><svg t="1750169402629" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2170" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><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" p-id="2171"></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" p-id="2172"></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" p-id="2173"></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" p-id="2174"></path></svg>', Ft = '<?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"><svg t="1750169573443" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2883" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><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="currentColor" p-id="2884"></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="currentColor" p-id="2885"></path></svg>', jt = '<?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"><svg t="1750169419447" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2480" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><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" p-id="2481"></path></svg>', zt = '<?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"><svg t="1750169426515" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2730" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><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" p-id="2731"></path></svg>';
|
|
487
|
+
const Yt = {
|
|
488
|
+
side: Vt,
|
|
489
|
+
left: Wt,
|
|
490
|
+
right: Gt,
|
|
491
|
+
full: It,
|
|
492
|
+
living: Ft,
|
|
493
|
+
zoomin: jt,
|
|
494
|
+
zoomout: zt
|
|
495
|
+
}, M = (t, e) => {
|
|
437
496
|
const n = document.createElement("span");
|
|
438
|
-
return n.id = t, n.innerHTML =
|
|
439
|
-
<use xlink:href="#icon-${e}"></use>
|
|
440
|
-
</svg>`, n;
|
|
497
|
+
return n.id = t, n.innerHTML = Yt[e], n;
|
|
441
498
|
};
|
|
442
|
-
function
|
|
443
|
-
const e = document.createElement("div"), n =
|
|
444
|
-
return r.innerText = "100%", e.appendChild(n), e.appendChild(o), e.appendChild(
|
|
445
|
-
t.
|
|
499
|
+
function Rt(t) {
|
|
500
|
+
const e = document.createElement("div"), n = M("fullscreen", "full"), o = M("toCenter", "living"), i = M("zoomout", "zoomout"), s = M("zoomin", "zoomin"), r = document.createElement("span");
|
|
501
|
+
return r.innerText = "100%", e.appendChild(n), e.appendChild(o), e.appendChild(i), e.appendChild(s), e.className = "mind-elixir-toolbar rb", n.onclick = () => {
|
|
502
|
+
document.fullscreenElement === t.el ? document.exitFullscreen() : t.el.requestFullscreen();
|
|
446
503
|
}, o.onclick = () => {
|
|
447
504
|
t.toCenter();
|
|
448
|
-
}, s.onclick = () => {
|
|
449
|
-
t.scaleVal < 0.6 || t.scale(t.scaleVal - 0.2);
|
|
450
505
|
}, i.onclick = () => {
|
|
451
|
-
t.scaleVal
|
|
506
|
+
t.scaleVal < 0.6 || t.scale(t.scaleVal - t.scaleSensitivity);
|
|
507
|
+
}, s.onclick = () => {
|
|
508
|
+
t.scaleVal > 1.6 || t.scale(t.scaleVal + t.scaleSensitivity);
|
|
452
509
|
}, e;
|
|
453
510
|
}
|
|
454
|
-
function
|
|
455
|
-
const e = document.createElement("div"), n =
|
|
456
|
-
return e.appendChild(n), e.appendChild(o), e.appendChild(
|
|
511
|
+
function Xt(t) {
|
|
512
|
+
const e = document.createElement("div"), n = M("tbltl", "left"), o = M("tbltr", "right"), i = M("tblts", "side");
|
|
513
|
+
return e.appendChild(n), e.appendChild(o), e.appendChild(i), e.className = "mind-elixir-toolbar lt", n.onclick = () => {
|
|
457
514
|
t.initLeft();
|
|
458
515
|
}, o.onclick = () => {
|
|
459
516
|
t.initRight();
|
|
460
|
-
},
|
|
517
|
+
}, i.onclick = () => {
|
|
461
518
|
t.initSide();
|
|
462
519
|
}, e;
|
|
463
520
|
}
|
|
464
|
-
function
|
|
465
|
-
t.container.append(
|
|
466
|
-
}
|
|
467
|
-
/*! @viselect/vanilla v3.5.1 MIT | https://github.com/Simonwep/selection/tree/master/packages/vanilla */
|
|
468
|
-
var Yt = Object.defineProperty, Gt = (t, e, n) => e in t ? Yt(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, b = (t, e, n) => (Gt(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
469
|
-
class Kt {
|
|
470
|
-
constructor() {
|
|
471
|
-
b(this, "_listeners", /* @__PURE__ */ new Map()), b(this, "on", this.addEventListener), b(this, "off", this.removeEventListener), b(this, "emit", this.dispatchEvent);
|
|
472
|
-
}
|
|
473
|
-
addEventListener(e, n) {
|
|
474
|
-
const o = this._listeners.get(e) ?? /* @__PURE__ */ new Set();
|
|
475
|
-
return this._listeners.set(e, o), o.add(n), this;
|
|
476
|
-
}
|
|
477
|
-
removeEventListener(e, n) {
|
|
478
|
-
var o;
|
|
479
|
-
return (o = this._listeners.get(e)) == null || o.delete(n), this;
|
|
480
|
-
}
|
|
481
|
-
dispatchEvent(e, ...n) {
|
|
482
|
-
let o = !0;
|
|
483
|
-
for (const s of this._listeners.get(e) ?? [])
|
|
484
|
-
o = s(...n) !== !1 && o;
|
|
485
|
-
return o;
|
|
486
|
-
}
|
|
487
|
-
unbindAllListeners() {
|
|
488
|
-
this._listeners.clear();
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
const ut = (t, e = "px") => typeof t == "number" ? t + e : t;
|
|
492
|
-
function $({ style: t }, e, n) {
|
|
493
|
-
if (typeof e == "object")
|
|
494
|
-
for (const [o, s] of Object.entries(e))
|
|
495
|
-
s !== void 0 && (t[o] = ut(s));
|
|
496
|
-
else
|
|
497
|
-
n !== void 0 && (t[e] = ut(n));
|
|
498
|
-
}
|
|
499
|
-
const Tt = (t) => (e, n, o, s = {}) => {
|
|
500
|
-
e instanceof HTMLCollection || e instanceof NodeList ? e = Array.from(e) : Array.isArray(e) || (e = [e]), Array.isArray(n) || (n = [n]);
|
|
501
|
-
for (const i of e)
|
|
502
|
-
if (i)
|
|
503
|
-
for (const r of n)
|
|
504
|
-
i[t](r, o, { capture: !1, ...s });
|
|
505
|
-
return [e, n, o, s];
|
|
506
|
-
}, P = Tt("addEventListener"), A = Tt("removeEventListener"), Y = (t) => {
|
|
507
|
-
var e;
|
|
508
|
-
const { clientX: n, clientY: o, target: s } = ((e = t.touches) == null ? void 0 : e[0]) ?? t;
|
|
509
|
-
return { x: n, y: o, target: s };
|
|
510
|
-
};
|
|
511
|
-
function ft(t, e, n = "touch") {
|
|
512
|
-
switch (n) {
|
|
513
|
-
case "center": {
|
|
514
|
-
const o = e.left + e.width / 2, s = e.top + e.height / 2;
|
|
515
|
-
return o >= t.left && o <= t.right && s >= t.top && s <= t.bottom;
|
|
516
|
-
}
|
|
517
|
-
case "cover":
|
|
518
|
-
return e.left >= t.left && e.top >= t.top && e.right <= t.right && e.bottom <= t.bottom;
|
|
519
|
-
case "touch":
|
|
520
|
-
return t.right >= e.left && t.left <= e.right && t.bottom >= e.top && t.top <= e.bottom;
|
|
521
|
-
}
|
|
522
|
-
}
|
|
523
|
-
function z(t, e = document) {
|
|
524
|
-
const n = Array.isArray(t) ? t : [t];
|
|
525
|
-
let o = [];
|
|
526
|
-
for (let s = 0, i = n.length; s < i; s++) {
|
|
527
|
-
const r = n[s];
|
|
528
|
-
typeof r == "string" ? o = o.concat(Array.from(e.querySelectorAll(r))) : r instanceof Element && o.push(r);
|
|
529
|
-
}
|
|
530
|
-
return o;
|
|
531
|
-
}
|
|
532
|
-
const Jt = () => matchMedia("(hover: none), (pointer: coarse)").matches, Ut = () => "safari" in window, Qt = (t) => {
|
|
533
|
-
let e, n = -1, o = !1;
|
|
534
|
-
return {
|
|
535
|
-
next(...s) {
|
|
536
|
-
e = s, o || (o = !0, n = requestAnimationFrame(() => {
|
|
537
|
-
t(...e), o = !1;
|
|
538
|
-
}));
|
|
539
|
-
},
|
|
540
|
-
cancel() {
|
|
541
|
-
cancelAnimationFrame(n), o = !1;
|
|
542
|
-
}
|
|
543
|
-
};
|
|
544
|
-
};
|
|
545
|
-
function Zt(t, e) {
|
|
546
|
-
for (const n of e) {
|
|
547
|
-
if (typeof n == "number")
|
|
548
|
-
return t.button === n;
|
|
549
|
-
if (typeof n == "object") {
|
|
550
|
-
const o = n.button === t.button, s = n.modifiers.every((i) => {
|
|
551
|
-
switch (i) {
|
|
552
|
-
case "alt":
|
|
553
|
-
return t.altKey;
|
|
554
|
-
case "ctrl":
|
|
555
|
-
return t.ctrlKey || t.metaKey;
|
|
556
|
-
case "shift":
|
|
557
|
-
return t.shiftKey;
|
|
558
|
-
}
|
|
559
|
-
});
|
|
560
|
-
return o && s;
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
return !1;
|
|
564
|
-
}
|
|
565
|
-
const { abs: H, max: pt, min: mt, ceil: gt } = Math;
|
|
566
|
-
class te extends Kt {
|
|
567
|
-
constructor(e) {
|
|
568
|
-
var n, o, s, i, r;
|
|
569
|
-
super(), b(this, "_options"), b(this, "_selection", {
|
|
570
|
-
stored: [],
|
|
571
|
-
selected: [],
|
|
572
|
-
touched: [],
|
|
573
|
-
changed: {
|
|
574
|
-
added: [],
|
|
575
|
-
// Added elements since last selection
|
|
576
|
-
removed: []
|
|
577
|
-
// Removed elements since last selection
|
|
578
|
-
}
|
|
579
|
-
}), b(this, "_area"), b(this, "_clippingElement"), b(this, "_targetElement"), b(this, "_targetRect"), b(this, "_selectables", []), b(this, "_latestElement"), b(this, "_areaRect", new DOMRect()), b(this, "_areaLocation", { y1: 0, x2: 0, y2: 0, x1: 0 }), b(this, "_singleClick", !0), b(this, "_frame"), b(this, "_scrollAvailable", !0), b(this, "_scrollingActive", !1), b(this, "_scrollSpeed", { x: 0, y: 0 }), b(this, "_scrollDelta", { x: 0, y: 0 }), b(this, "disable", this._bindStartEvents.bind(this, !1)), b(this, "enable", this._bindStartEvents), this._options = {
|
|
580
|
-
selectionAreaClass: "selection-area",
|
|
581
|
-
selectionContainerClass: void 0,
|
|
582
|
-
selectables: [],
|
|
583
|
-
document: window.document,
|
|
584
|
-
startAreas: ["html"],
|
|
585
|
-
boundaries: ["html"],
|
|
586
|
-
container: "body",
|
|
587
|
-
...e,
|
|
588
|
-
behaviour: {
|
|
589
|
-
overlap: "invert",
|
|
590
|
-
intersect: "touch",
|
|
591
|
-
triggers: [0],
|
|
592
|
-
...e.behaviour,
|
|
593
|
-
startThreshold: (n = e.behaviour) != null && n.startThreshold ? typeof e.behaviour.startThreshold == "number" ? e.behaviour.startThreshold : { x: 10, y: 10, ...e.behaviour.startThreshold } : { x: 10, y: 10 },
|
|
594
|
-
scrolling: {
|
|
595
|
-
speedDivider: 10,
|
|
596
|
-
manualSpeed: 750,
|
|
597
|
-
...(o = e.behaviour) == null ? void 0 : o.scrolling,
|
|
598
|
-
startScrollMargins: {
|
|
599
|
-
x: 0,
|
|
600
|
-
y: 0,
|
|
601
|
-
...(i = (s = e.behaviour) == null ? void 0 : s.scrolling) == null ? void 0 : i.startScrollMargins
|
|
602
|
-
}
|
|
603
|
-
}
|
|
604
|
-
},
|
|
605
|
-
features: {
|
|
606
|
-
range: !0,
|
|
607
|
-
touch: !0,
|
|
608
|
-
...e.features,
|
|
609
|
-
singleTap: {
|
|
610
|
-
allow: !0,
|
|
611
|
-
intersect: "native",
|
|
612
|
-
...(r = e.features) == null ? void 0 : r.singleTap
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
};
|
|
616
|
-
for (const a of Object.getOwnPropertyNames(Object.getPrototypeOf(this)))
|
|
617
|
-
typeof this[a] == "function" && (this[a] = this[a].bind(this));
|
|
618
|
-
const { document: l, selectionAreaClass: c, selectionContainerClass: u } = this._options;
|
|
619
|
-
this._area = l.createElement("div"), this._clippingElement = l.createElement("div"), this._clippingElement.appendChild(this._area), this._area.classList.add(c), u && this._clippingElement.classList.add(u), $(this._area, {
|
|
620
|
-
willChange: "top, left, bottom, right, width, height",
|
|
621
|
-
top: 0,
|
|
622
|
-
left: 0,
|
|
623
|
-
position: "fixed"
|
|
624
|
-
}), $(this._clippingElement, {
|
|
625
|
-
overflow: "hidden",
|
|
626
|
-
position: "fixed",
|
|
627
|
-
transform: "translate3d(0, 0, 0)",
|
|
628
|
-
// https://stackoverflow.com/a/38268846
|
|
629
|
-
pointerEvents: "none",
|
|
630
|
-
zIndex: "1"
|
|
631
|
-
}), this._frame = Qt((a) => {
|
|
632
|
-
this._recalculateSelectionAreaRect(), this._updateElementSelection(), this._emitEvent("move", a), this._redrawSelectionArea();
|
|
633
|
-
}), this.enable();
|
|
634
|
-
}
|
|
635
|
-
_bindStartEvents(e = !0) {
|
|
636
|
-
const { document: n, features: o } = this._options, s = e ? P : A;
|
|
637
|
-
s(n, "mousedown", this._onTapStart), o.touch && s(n, "touchstart", this._onTapStart, {
|
|
638
|
-
passive: !1
|
|
639
|
-
});
|
|
640
|
-
}
|
|
641
|
-
_onTapStart(e, n = !1) {
|
|
642
|
-
const { x: o, y: s, target: i } = Y(e), { _options: r } = this, { document: l } = this._options, c = i.getBoundingClientRect();
|
|
643
|
-
if (e instanceof MouseEvent && !Zt(e, r.behaviour.triggers))
|
|
644
|
-
return;
|
|
645
|
-
const u = z(r.startAreas, r.document), a = z(r.boundaries, r.document);
|
|
646
|
-
this._targetElement = a.find(
|
|
647
|
-
(f) => ft(f.getBoundingClientRect(), c)
|
|
648
|
-
);
|
|
649
|
-
const d = e.composedPath();
|
|
650
|
-
if (!this._targetElement || !u.find((f) => d.includes(f)) || !a.find((f) => d.includes(f)) || !n && this._emitEvent("beforestart", e) === !1)
|
|
651
|
-
return;
|
|
652
|
-
this._areaLocation = { x1: o, y1: s, x2: 0, y2: 0 };
|
|
653
|
-
const h = l.scrollingElement ?? l.body;
|
|
654
|
-
this._scrollDelta = { x: h.scrollLeft, y: h.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);
|
|
655
|
-
}
|
|
656
|
-
_onSingleTap(e) {
|
|
657
|
-
const { singleTap: { intersect: n }, range: o } = this._options.features, s = Y(e);
|
|
658
|
-
let i;
|
|
659
|
-
if (n === "native")
|
|
660
|
-
i = s.target;
|
|
661
|
-
else if (n === "touch") {
|
|
662
|
-
this.resolveSelectables();
|
|
663
|
-
const { x: l, y: c } = s;
|
|
664
|
-
i = this._selectables.find((u) => {
|
|
665
|
-
const { right: a, left: d, top: h, bottom: f } = u.getBoundingClientRect();
|
|
666
|
-
return l < a && l > d && c < f && c > h;
|
|
667
|
-
});
|
|
668
|
-
}
|
|
669
|
-
if (!i)
|
|
670
|
-
return;
|
|
671
|
-
for (this.resolveSelectables(); !this._selectables.includes(i); ) {
|
|
672
|
-
if (!i.parentElement)
|
|
673
|
-
return;
|
|
674
|
-
i = i.parentElement;
|
|
675
|
-
}
|
|
676
|
-
const { stored: r } = this._selection;
|
|
677
|
-
if (this._emitEvent("start", e), e.shiftKey && o && this._latestElement) {
|
|
678
|
-
const l = this._latestElement, [c, u] = l.compareDocumentPosition(i) & 4 ? [i, l] : [l, i], a = [...this._selectables.filter(
|
|
679
|
-
(d) => d.compareDocumentPosition(c) & 4 && d.compareDocumentPosition(u) & 2
|
|
680
|
-
), c, u];
|
|
681
|
-
this.select(a), this._latestElement = l;
|
|
682
|
-
} else
|
|
683
|
-
r.includes(i) && (r.length === 1 || e.ctrlKey || r.every((l) => this._selection.stored.includes(l))) ? this.deselect(i) : (this.select(i), this._latestElement = i);
|
|
684
|
-
}
|
|
685
|
-
_delayedTapMove(e) {
|
|
686
|
-
const { container: n, document: o, behaviour: { startThreshold: s } } = this._options, { x1: i, y1: r } = this._areaLocation, { x: l, y: c } = Y(e);
|
|
687
|
-
if (
|
|
688
|
-
// Single number for both coordinates
|
|
689
|
-
typeof s == "number" && H(l + c - (i + r)) >= s || // Different x and y threshold
|
|
690
|
-
typeof s == "object" && H(l - i) >= s.x || H(c - r) >= s.y
|
|
691
|
-
) {
|
|
692
|
-
if (A(o, ["mousemove", "touchmove"], this._delayedTapMove, { passive: !1 }), this._emitEvent("beforedrag", e) === !1) {
|
|
693
|
-
A(o, ["mouseup", "touchcancel", "touchend"], this._onTapStop);
|
|
694
|
-
return;
|
|
695
|
-
}
|
|
696
|
-
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((u) => this._targetElement.contains(u))), this._setupSelectionArea(), this._emitEvent("start", e), this._onTapMove(e);
|
|
697
|
-
}
|
|
698
|
-
this._handleMoveEvent(e);
|
|
699
|
-
}
|
|
700
|
-
_setupSelectionArea() {
|
|
701
|
-
const { _clippingElement: e, _targetElement: n, _area: o } = this, s = this._targetRect = n.getBoundingClientRect();
|
|
702
|
-
this._scrollAvailable ? ($(e, {
|
|
703
|
-
top: s.top,
|
|
704
|
-
left: s.left,
|
|
705
|
-
width: s.width,
|
|
706
|
-
height: s.height
|
|
707
|
-
}), $(o, {
|
|
708
|
-
marginTop: -s.top,
|
|
709
|
-
marginLeft: -s.left
|
|
710
|
-
})) : ($(e, {
|
|
711
|
-
top: 0,
|
|
712
|
-
left: 0,
|
|
713
|
-
width: "100%",
|
|
714
|
-
height: "100%"
|
|
715
|
-
}), $(o, {
|
|
716
|
-
marginTop: 0,
|
|
717
|
-
marginLeft: 0
|
|
718
|
-
}));
|
|
719
|
-
}
|
|
720
|
-
_onTapMove(e) {
|
|
721
|
-
const { x: n, y: o } = Y(e), { _scrollSpeed: s, _areaLocation: i, _options: r, _frame: l } = this, { speedDivider: c } = r.behaviour.scrolling, u = this._targetElement;
|
|
722
|
-
if (i.x2 = n, i.y2 = o, this._scrollAvailable && !this._scrollingActive && (s.y || s.x)) {
|
|
723
|
-
this._scrollingActive = !0;
|
|
724
|
-
const a = () => {
|
|
725
|
-
if (!s.x && !s.y) {
|
|
726
|
-
this._scrollingActive = !1;
|
|
727
|
-
return;
|
|
728
|
-
}
|
|
729
|
-
const { scrollTop: d, scrollLeft: h } = u;
|
|
730
|
-
s.y && (u.scrollTop += gt(s.y / c), i.y1 -= u.scrollTop - d), s.x && (u.scrollLeft += gt(s.x / c), i.x1 -= u.scrollLeft - h), l.next(e), requestAnimationFrame(a);
|
|
731
|
-
};
|
|
732
|
-
requestAnimationFrame(a);
|
|
733
|
-
} else
|
|
734
|
-
l.next(e);
|
|
735
|
-
this._handleMoveEvent(e);
|
|
736
|
-
}
|
|
737
|
-
_handleMoveEvent(e) {
|
|
738
|
-
const { features: n } = this._options;
|
|
739
|
-
(n.touch && Jt() || this._scrollAvailable && Ut()) && e.preventDefault();
|
|
740
|
-
}
|
|
741
|
-
_onScroll() {
|
|
742
|
-
const { _scrollDelta: e, _options: { document: n } } = this, { scrollTop: o, scrollLeft: s } = n.scrollingElement ?? n.body;
|
|
743
|
-
this._areaLocation.x1 += e.x - s, this._areaLocation.y1 += e.y - o, e.x = s, e.y = o, this._setupSelectionArea(), this._frame.next(null);
|
|
744
|
-
}
|
|
745
|
-
_manualScroll(e) {
|
|
746
|
-
const { manualSpeed: n } = this._options.behaviour.scrolling, o = e.deltaY ? e.deltaY > 0 ? 1 : -1 : 0, s = e.deltaX ? e.deltaX > 0 ? 1 : -1 : 0;
|
|
747
|
-
this._scrollSpeed.y += o * n, this._scrollSpeed.x += s * n, this._onTapMove(e), e.preventDefault();
|
|
748
|
-
}
|
|
749
|
-
_recalculateSelectionAreaRect() {
|
|
750
|
-
const { _scrollSpeed: e, _areaLocation: n, _areaRect: o, _targetElement: s, _options: i } = this, { scrollTop: r, scrollHeight: l, clientHeight: c, scrollLeft: u, scrollWidth: a, clientWidth: d } = s, h = this._targetRect, { x1: f, y1: g } = n;
|
|
751
|
-
let { x2: m, y2: p } = n;
|
|
752
|
-
const { behaviour: { scrolling: { startScrollMargins: v } } } = i;
|
|
753
|
-
m < h.left + v.x ? (e.x = u ? -H(h.left - m + v.x) : 0, m = m < h.left ? h.left : m) : m > h.right - v.x ? (e.x = a - u - d ? H(h.left + h.width - m - v.x) : 0, m = m > h.right ? h.right : m) : e.x = 0, p < h.top + v.y ? (e.y = r ? -H(h.top - p + v.y) : 0, p = p < h.top ? h.top : p) : p > h.bottom - v.y ? (e.y = l - r - c ? H(h.top + h.height - p - v.y) : 0, p = p > h.bottom ? h.bottom : p) : e.y = 0;
|
|
754
|
-
const _ = mt(f, m), y = mt(g, p), E = pt(f, m), w = pt(g, p);
|
|
755
|
-
o.x = _, o.y = y, o.width = E - _, o.height = w - y;
|
|
756
|
-
}
|
|
757
|
-
_redrawSelectionArea() {
|
|
758
|
-
const { x: e, y: n, width: o, height: s } = this._areaRect, { style: i } = this._area;
|
|
759
|
-
i.left = `${e}px`, i.top = `${n}px`, i.width = `${o}px`, i.height = `${s}px`;
|
|
760
|
-
}
|
|
761
|
-
_onTapStop(e, n) {
|
|
762
|
-
var o;
|
|
763
|
-
const { document: s, features: i } = this._options, { _singleClick: r } = this;
|
|
764
|
-
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(), e && r && i.singleTap.allow ? this._onSingleTap(e) : !r && !n && (this._updateElementSelection(), this._emitEvent("stop", e)), 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");
|
|
765
|
-
}
|
|
766
|
-
_updateElementSelection() {
|
|
767
|
-
const { _selectables: e, _options: n, _selection: o, _areaRect: s } = this, { stored: i, selected: r, touched: l } = o, { intersect: c, overlap: u } = n.behaviour, a = u === "invert", d = [], h = [], f = [];
|
|
768
|
-
for (let m = 0; m < e.length; m++) {
|
|
769
|
-
const p = e[m];
|
|
770
|
-
if (ft(s, p.getBoundingClientRect(), c)) {
|
|
771
|
-
if (r.includes(p))
|
|
772
|
-
i.includes(p) && !l.includes(p) && l.push(p);
|
|
773
|
-
else if (a && i.includes(p)) {
|
|
774
|
-
f.push(p);
|
|
775
|
-
continue;
|
|
776
|
-
} else
|
|
777
|
-
h.push(p);
|
|
778
|
-
d.push(p);
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
a && h.push(...i.filter((m) => !r.includes(m)));
|
|
782
|
-
const g = u === "keep";
|
|
783
|
-
for (let m = 0; m < r.length; m++) {
|
|
784
|
-
const p = r[m];
|
|
785
|
-
!d.includes(p) && !// Check if user wants to keep previously selected elements, e.g.
|
|
786
|
-
// not make them part of the current selection as soon as they're touched.
|
|
787
|
-
(g && i.includes(p)) && f.push(p);
|
|
788
|
-
}
|
|
789
|
-
o.selected = d, o.changed = { added: h, removed: f }, this._latestElement = void 0;
|
|
790
|
-
}
|
|
791
|
-
_emitEvent(e, n) {
|
|
792
|
-
return this.emit(e, {
|
|
793
|
-
event: n,
|
|
794
|
-
store: this._selection,
|
|
795
|
-
selection: this
|
|
796
|
-
});
|
|
797
|
-
}
|
|
798
|
-
_keepSelection() {
|
|
799
|
-
const { _options: e, _selection: n } = this, { selected: o, changed: s, touched: i, stored: r } = n, l = o.filter((c) => !r.includes(c));
|
|
800
|
-
switch (e.behaviour.overlap) {
|
|
801
|
-
case "drop": {
|
|
802
|
-
n.stored = [
|
|
803
|
-
...l,
|
|
804
|
-
...r.filter((c) => !i.includes(c))
|
|
805
|
-
// Elements not touched
|
|
806
|
-
];
|
|
807
|
-
break;
|
|
808
|
-
}
|
|
809
|
-
case "invert": {
|
|
810
|
-
n.stored = [
|
|
811
|
-
...l,
|
|
812
|
-
...r.filter((c) => !s.removed.includes(c))
|
|
813
|
-
// Elements not removed from selection
|
|
814
|
-
];
|
|
815
|
-
break;
|
|
816
|
-
}
|
|
817
|
-
case "keep": {
|
|
818
|
-
n.stored = [
|
|
819
|
-
...r,
|
|
820
|
-
...o.filter((c) => !r.includes(c))
|
|
821
|
-
// Newly added
|
|
822
|
-
];
|
|
823
|
-
break;
|
|
824
|
-
}
|
|
825
|
-
}
|
|
826
|
-
}
|
|
827
|
-
/**
|
|
828
|
-
* Manually triggers the start of a selection
|
|
829
|
-
* @param evt A MouseEvent / TouchEvent -like object
|
|
830
|
-
* @param silent If beforestart should be fired,
|
|
831
|
-
*/
|
|
832
|
-
trigger(e, n = !0) {
|
|
833
|
-
this._onTapStart(e, n);
|
|
834
|
-
}
|
|
835
|
-
/**
|
|
836
|
-
* Can be used if during a selection elements have been added.
|
|
837
|
-
* Will update everything which can be selected.
|
|
838
|
-
*/
|
|
839
|
-
resolveSelectables() {
|
|
840
|
-
this._selectables = z(this._options.selectables, this._options.document);
|
|
841
|
-
}
|
|
842
|
-
/**
|
|
843
|
-
* Same as deselect, but for all elements currently selected.
|
|
844
|
-
* @param includeStored If the store should also get cleared
|
|
845
|
-
* @param quiet If move / stop events should be fired
|
|
846
|
-
*/
|
|
847
|
-
clearSelection(e = !0, n = !1) {
|
|
848
|
-
const { selected: o, stored: s, changed: i } = this._selection;
|
|
849
|
-
i.added = [], i.removed.push(
|
|
850
|
-
...o,
|
|
851
|
-
...e ? s : []
|
|
852
|
-
), n || (this._emitEvent("move", null), this._emitEvent("stop", null)), this._selection = {
|
|
853
|
-
stored: e ? [] : s,
|
|
854
|
-
selected: [],
|
|
855
|
-
touched: [],
|
|
856
|
-
changed: { added: [], removed: [] }
|
|
857
|
-
};
|
|
858
|
-
}
|
|
859
|
-
/**
|
|
860
|
-
* @returns {Array} Selected elements
|
|
861
|
-
*/
|
|
862
|
-
getSelection() {
|
|
863
|
-
return this._selection.stored;
|
|
864
|
-
}
|
|
865
|
-
/**
|
|
866
|
-
* @returns {HTMLElement} The selection area element
|
|
867
|
-
*/
|
|
868
|
-
getSelectionArea() {
|
|
869
|
-
return this._area;
|
|
870
|
-
}
|
|
871
|
-
/**
|
|
872
|
-
* Cancel the current selection process.
|
|
873
|
-
* @param keepEvent {boolean} true to fire a stop event after cancel.
|
|
874
|
-
*/
|
|
875
|
-
cancel(e = !1) {
|
|
876
|
-
this._onTapStop(null, !e);
|
|
877
|
-
}
|
|
878
|
-
/**
|
|
879
|
-
* Unbinds all events and removes the area-element.
|
|
880
|
-
*/
|
|
881
|
-
destroy() {
|
|
882
|
-
this.cancel(), this.disable(), this._clippingElement.remove(), super.unbindAllListeners();
|
|
883
|
-
}
|
|
884
|
-
/**
|
|
885
|
-
* Adds elements to the selection
|
|
886
|
-
* @param query - CSS Query, can be an array of queries
|
|
887
|
-
* @param quiet - If this should not trigger the move event
|
|
888
|
-
*/
|
|
889
|
-
select(e, n = !1) {
|
|
890
|
-
const { changed: o, selected: s, stored: i } = this._selection, r = z(e, this._options.document).filter(
|
|
891
|
-
(l) => !s.includes(l) && !i.includes(l)
|
|
892
|
-
);
|
|
893
|
-
return i.push(...r), s.push(...r), o.added.push(...r), o.removed = [], this._latestElement = void 0, n || (this._emitEvent("move", null), this._emitEvent("stop", null)), r;
|
|
894
|
-
}
|
|
895
|
-
/**
|
|
896
|
-
* Removes a particular element from the selection.
|
|
897
|
-
* @param query - CSS Query, can be an array of queries
|
|
898
|
-
* @param quiet - If this should not trigger the move event
|
|
899
|
-
*/
|
|
900
|
-
deselect(e, n = !1) {
|
|
901
|
-
const { selected: o, stored: s, changed: i } = this._selection, r = z(e, this._options.document).filter(
|
|
902
|
-
(l) => o.includes(l) || s.includes(l)
|
|
903
|
-
);
|
|
904
|
-
r.length && (this._selection.stored = s.filter((l) => !r.includes(l)), this._selection.selected = o.filter((l) => !r.includes(l)), this._selection.changed.added = [], this._selection.changed.removed.push(
|
|
905
|
-
...r.filter((l) => !i.removed.includes(l))
|
|
906
|
-
), this._latestElement = void 0, n || (this._emitEvent("move", null), this._emitEvent("stop", null)));
|
|
907
|
-
}
|
|
521
|
+
function qt(t) {
|
|
522
|
+
t.container.append(Rt(t)), t.container.append(Xt(t));
|
|
908
523
|
}
|
|
909
|
-
|
|
910
|
-
const ee = function(t, e = !0) {
|
|
524
|
+
const _t = function(t, e = !0) {
|
|
911
525
|
this.theme = t;
|
|
912
|
-
const
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
526
|
+
const o = {
|
|
527
|
+
...(t.type === "dark" ? K : U).cssVar,
|
|
528
|
+
...t.cssVar
|
|
529
|
+
}, i = Object.keys(o);
|
|
530
|
+
for (let s = 0; s < i.length; s++) {
|
|
531
|
+
const r = i[s];
|
|
532
|
+
this.container.style.setProperty(r, o[r]);
|
|
917
533
|
}
|
|
918
|
-
|
|
919
|
-
},
|
|
534
|
+
e && this.refresh();
|
|
535
|
+
}, Ut = function(t) {
|
|
920
536
|
const n = t.parentElement.parentElement.lastElementChild;
|
|
921
537
|
(n == null ? void 0 : n.tagName) === "svg" && (n == null || n.remove());
|
|
922
538
|
};
|
|
923
|
-
function
|
|
539
|
+
function Kt(t) {
|
|
924
540
|
return {
|
|
925
541
|
nodeData: t.isFocusMode ? t.nodeDataBackup : t.nodeData,
|
|
926
542
|
arrows: t.arrows,
|
|
@@ -929,150 +545,202 @@ function oe(t) {
|
|
|
929
545
|
theme: t.theme
|
|
930
546
|
};
|
|
931
547
|
}
|
|
932
|
-
const
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
}
|
|
938
|
-
t.className = "selected", t.scrollIntoView({ block: "nearest", inline: "nearest" }), this.currentNode = t, e ? this.bus.fire("selectNewNode", t.nodeObj) : this.bus.fire("selectNode", t.nodeObj, n);
|
|
548
|
+
const Jt = function(t) {
|
|
549
|
+
const e = this.container, n = t.getBoundingClientRect(), o = e.getBoundingClientRect();
|
|
550
|
+
if (n.top > o.bottom || n.bottom < o.top || n.left > o.right || n.right < o.left) {
|
|
551
|
+
const s = n.left + n.width / 2, r = n.top + n.height / 2, a = o.left + o.width / 2, f = o.top + o.height / 2, d = s - a, p = r - f;
|
|
552
|
+
this.move(-d, -p);
|
|
939
553
|
}
|
|
940
|
-
},
|
|
941
|
-
this.
|
|
942
|
-
},
|
|
943
|
-
this.
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
);
|
|
950
|
-
}, le = function() {
|
|
951
|
-
if (this.currentNodes)
|
|
952
|
-
for (const t of this.currentNodes)
|
|
953
|
-
t.classList.remove("selected");
|
|
954
|
-
this.currentNodes = null, this.bus.fire("unselectNodes");
|
|
955
|
-
}, ce = function() {
|
|
956
|
-
this.unselectNode(), this.unselectNodes(), this.unselectSummary(), this.unselectArrow();
|
|
957
|
-
}, ae = function() {
|
|
958
|
-
const t = oe(this);
|
|
554
|
+
}, Qt = function(t, e, n) {
|
|
555
|
+
this.clearSelection(), this.scrollIntoView(t), this.selection.select(t), e && this.bus.fire("selectNewNode", t.nodeObj);
|
|
556
|
+
}, Zt = function(t) {
|
|
557
|
+
this.selection.select(t);
|
|
558
|
+
}, te = function(t) {
|
|
559
|
+
this.selection.deselect(t);
|
|
560
|
+
}, ee = function() {
|
|
561
|
+
this.unselectNodes(this.currentNodes), this.unselectSummary(), this.unselectArrow();
|
|
562
|
+
}, ne = function() {
|
|
563
|
+
const t = Kt(this);
|
|
959
564
|
return JSON.stringify(t, (e, n) => {
|
|
960
565
|
if (!(e === "parent" && typeof n != "string"))
|
|
961
566
|
return n;
|
|
962
567
|
});
|
|
963
|
-
},
|
|
568
|
+
}, oe = function() {
|
|
964
569
|
return JSON.parse(this.getDataString());
|
|
965
|
-
},
|
|
570
|
+
}, ie = function() {
|
|
966
571
|
this.editable = !0;
|
|
967
|
-
},
|
|
572
|
+
}, se = function() {
|
|
968
573
|
this.editable = !1;
|
|
969
|
-
},
|
|
970
|
-
const n = this.container.getBoundingClientRect(), o = n.width / 2
|
|
971
|
-
this.map.style.transform = `translate(${
|
|
972
|
-
},
|
|
574
|
+
}, re = function(t, e = { x: 0, y: 0 }) {
|
|
575
|
+
const n = this.container.getBoundingClientRect(), o = e.x ? e.x - n.left - n.width / 2 : 0, i = e.y ? e.y - n.top - n.height / 2 : 0, { dx: s, dy: r } = vt(this), a = this.map.style.transform, { x: f, y: d } = ft(a), p = f - s, u = d - r, g = this.scaleVal, l = (-o + p) * (1 - t / g), c = (-i + u) * (1 - t / g);
|
|
576
|
+
this.map.style.transform = `translate(${f - l}px, ${d - c}px) scale(${t})`, this.scaleVal = t, this.bus.fire("scale", t);
|
|
577
|
+
}, ce = function() {
|
|
973
578
|
const t = this.nodes.offsetHeight / this.container.offsetHeight, e = this.nodes.offsetWidth / this.container.offsetWidth, n = 1 / Math.max(1, Math.max(t, e));
|
|
974
579
|
this.scaleVal = n, this.map.style.transform = "scale(" + n + ")", this.bus.fire("scale", n);
|
|
975
|
-
},
|
|
976
|
-
const { map: n, scaleVal: o,
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
580
|
+
}, le = function(t, e) {
|
|
581
|
+
const { map: n, scaleVal: o, bus: i } = this, s = n.style.transform;
|
|
582
|
+
let { x: r, y: a } = ft(s);
|
|
583
|
+
r += t, a += e, n.style.transform = `translate(${r}px, ${a}px) scale(${o})`, i.fire("move", { dx: t, dy: e });
|
|
584
|
+
}, vt = (t) => {
|
|
585
|
+
const { container: e, map: n, nodes: o } = t, i = n.querySelector("me-root"), s = i.offsetTop, r = i.offsetLeft, a = i.offsetWidth, f = i.offsetHeight;
|
|
586
|
+
let d, p;
|
|
587
|
+
return t.alignment === "root" ? (d = e.offsetWidth / 2 - r - a / 2, p = e.offsetHeight / 2 - s - f / 2, n.style.transformOrigin = `${r + a / 2}px 50%`) : (d = (e.offsetWidth - o.offsetWidth) / 2, p = (e.offsetHeight - o.offsetHeight) / 2, n.style.transformOrigin = "50% 50%"), { dx: d, dy: p };
|
|
588
|
+
}, ae = function() {
|
|
589
|
+
const { map: t } = this, { dx: e, dy: n } = vt(this);
|
|
590
|
+
t.style.transform = `translate(${e}px, ${n}px) scale(${this.scaleVal})`;
|
|
591
|
+
}, he = function(t) {
|
|
982
592
|
t(this);
|
|
983
|
-
},
|
|
984
|
-
t.nodeObj.parent && (this.tempDirection === null && (this.tempDirection = this.direction), this.isFocusMode || (this.nodeDataBackup = this.nodeData, this.isFocusMode = !0), this.nodeData = t.nodeObj, this.initRight(), this.toCenter());
|
|
985
|
-
},
|
|
593
|
+
}, de = function(t) {
|
|
594
|
+
t.nodeObj.parent && (this.clearSelection(), this.tempDirection === null && (this.tempDirection = this.direction), this.isFocusMode || (this.nodeDataBackup = this.nodeData, this.isFocusMode = !0), this.nodeData = t.nodeObj, this.initRight(), this.toCenter());
|
|
595
|
+
}, fe = function() {
|
|
986
596
|
this.isFocusMode = !1, this.tempDirection !== null && (this.nodeData = this.nodeDataBackup, this.direction = this.tempDirection, this.tempDirection = null, this.refresh(), this.toCenter());
|
|
987
|
-
},
|
|
988
|
-
this.direction = 0, this.refresh();
|
|
989
|
-
},
|
|
990
|
-
this.direction = 1, this.refresh();
|
|
991
|
-
},
|
|
992
|
-
this.direction = 2, this.refresh();
|
|
993
|
-
},
|
|
597
|
+
}, pe = function() {
|
|
598
|
+
this.direction = 0, this.refresh(), this.toCenter();
|
|
599
|
+
}, ue = function() {
|
|
600
|
+
this.direction = 1, this.refresh(), this.toCenter();
|
|
601
|
+
}, ge = function() {
|
|
602
|
+
this.direction = 2, this.refresh(), this.toCenter();
|
|
603
|
+
}, me = function(t) {
|
|
994
604
|
this.locale = t, this.refresh();
|
|
995
|
-
},
|
|
605
|
+
}, we = function(t, e) {
|
|
996
606
|
const n = t.nodeObj;
|
|
997
607
|
typeof e == "boolean" ? n.expanded = e : n.expanded !== !1 ? n.expanded = !1 : n.expanded = !0;
|
|
998
|
-
const o = t.parentNode,
|
|
999
|
-
if (
|
|
1000
|
-
const
|
|
1001
|
-
n.children.map((
|
|
608
|
+
const o = t.parentNode, i = o.children[1];
|
|
609
|
+
if (i.expanded = n.expanded, i.className = n.expanded ? "minus" : "", Ut(t), n.expanded) {
|
|
610
|
+
const f = this.createChildren(
|
|
611
|
+
n.children.map((d) => this.createWrapper(d).grp)
|
|
1002
612
|
);
|
|
1003
|
-
o.parentNode.appendChild(
|
|
613
|
+
o.parentNode.appendChild(f);
|
|
1004
614
|
} else
|
|
1005
615
|
o.parentNode.children[1].remove();
|
|
1006
616
|
this.linkDiv(t.closest("me-main > me-wrapper"));
|
|
1007
|
-
const
|
|
1008
|
-
(
|
|
1009
|
-
},
|
|
1010
|
-
|
|
1011
|
-
|
|
617
|
+
const s = t.getBoundingClientRect(), r = this.container.getBoundingClientRect();
|
|
618
|
+
(s.bottom > r.bottom || s.top < r.top || s.right > r.right || s.left < r.left) && this.scrollIntoView(t), this.bus.fire("expandNode", n);
|
|
619
|
+
}, xe = function(t, e) {
|
|
620
|
+
const n = t.nodeObj, o = (i, s) => {
|
|
621
|
+
i.expanded = s, i.children && i.children.forEach((r) => {
|
|
622
|
+
o(r, s);
|
|
623
|
+
});
|
|
624
|
+
};
|
|
625
|
+
typeof e == "boolean" ? o(n, e) : n.expanded !== !1 ? o(n, !1) : o(n, !0), this.refresh();
|
|
626
|
+
}, ye = function(t) {
|
|
627
|
+
t && (t = JSON.parse(JSON.stringify(t)), this.nodeData = t.nodeData, this.arrows = t.arrows || [], this.summaries = t.summaries || []), J(this.nodeData), this.layout(), this.linkDiv();
|
|
628
|
+
}, ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1012
629
|
__proto__: null,
|
|
1013
|
-
cancelFocus:
|
|
1014
|
-
clearSelection:
|
|
1015
|
-
disableEdit:
|
|
1016
|
-
enableEdit:
|
|
1017
|
-
expandNode:
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
630
|
+
cancelFocus: fe,
|
|
631
|
+
clearSelection: ee,
|
|
632
|
+
disableEdit: se,
|
|
633
|
+
enableEdit: ie,
|
|
634
|
+
expandNode: we,
|
|
635
|
+
expandNodeAll: xe,
|
|
636
|
+
focusNode: de,
|
|
637
|
+
getData: oe,
|
|
638
|
+
getDataString: ne,
|
|
639
|
+
initLeft: pe,
|
|
640
|
+
initRight: ue,
|
|
641
|
+
initSide: ge,
|
|
642
|
+
install: he,
|
|
643
|
+
move: le,
|
|
644
|
+
refresh: ye,
|
|
645
|
+
scale: re,
|
|
646
|
+
scaleFit: ce,
|
|
647
|
+
scrollIntoView: Jt,
|
|
648
|
+
selectNode: Qt,
|
|
649
|
+
selectNodes: Zt,
|
|
650
|
+
setLocale: me,
|
|
651
|
+
toCenter: ae,
|
|
652
|
+
unselectNodes: te
|
|
653
|
+
}, Symbol.toStringTag, { value: "Module" })), be = function(t) {
|
|
1036
654
|
return {
|
|
1037
655
|
dom: t,
|
|
1038
656
|
moved: !1,
|
|
1039
|
-
//
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
657
|
+
// differentiate click and move
|
|
658
|
+
pointerdown: !1,
|
|
659
|
+
lastX: 0,
|
|
660
|
+
lastY: 0,
|
|
661
|
+
handlePointerMove(e) {
|
|
662
|
+
if (this.pointerdown) {
|
|
663
|
+
this.moved = !0;
|
|
664
|
+
const n = e.clientX - this.lastX, o = e.clientY - this.lastY;
|
|
665
|
+
this.lastX = e.clientX, this.lastY = e.clientY, this.cb && this.cb(n, o);
|
|
666
|
+
}
|
|
1043
667
|
},
|
|
1044
|
-
|
|
1045
|
-
e.button === 0 && (this.
|
|
668
|
+
handlePointerDown(e) {
|
|
669
|
+
e.button === 0 && (this.pointerdown = !0, this.lastX = e.clientX, this.lastY = e.clientY, this.dom.setPointerCapture(e.pointerId));
|
|
1046
670
|
},
|
|
1047
671
|
handleClear(e) {
|
|
1048
|
-
this.
|
|
672
|
+
this.pointerdown = !1, e.pointerId !== void 0 && this.dom.releasePointerCapture(e.pointerId);
|
|
1049
673
|
},
|
|
1050
674
|
cb: null,
|
|
1051
675
|
init(e, n) {
|
|
1052
|
-
this.cb = n, this.handleClear = this.handleClear.bind(this), this.
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
676
|
+
this.cb = n, this.handleClear = this.handleClear.bind(this), this.handlePointerMove = this.handlePointerMove.bind(this), this.handlePointerDown = this.handlePointerDown.bind(this), this.destroy = pt([
|
|
677
|
+
{ dom: e, evt: "pointermove", func: this.handlePointerMove },
|
|
678
|
+
{ dom: e, evt: "pointerleave", func: this.handleClear },
|
|
679
|
+
{ dom: e, evt: "pointerup", func: this.handleClear },
|
|
680
|
+
{ dom: this.dom, evt: "pointerdown", func: this.handlePointerDown }
|
|
681
|
+
]);
|
|
1056
682
|
},
|
|
683
|
+
destroy: null,
|
|
1057
684
|
clear() {
|
|
1058
|
-
this.moved = !1, this.
|
|
685
|
+
this.moved = !1, this.pointerdown = !1;
|
|
1059
686
|
}
|
|
1060
687
|
};
|
|
1061
|
-
},
|
|
1062
|
-
create:
|
|
1063
|
-
};
|
|
1064
|
-
function
|
|
1065
|
-
const { offsetLeft: o, offsetTop: s } = N(t.nodes, e), i = e.offsetWidth, r = e.offsetHeight, l = o + i / 2, c = s + r / 2, u = l + n.x, a = c + n.y;
|
|
688
|
+
}, lt = {
|
|
689
|
+
create: be
|
|
690
|
+
}, Ce = "#4dc4ff";
|
|
691
|
+
function bt(t, e, n, o, i, s, r, a) {
|
|
1066
692
|
return {
|
|
1067
|
-
|
|
693
|
+
x: t / 8 + n * 3 / 8 + i * 3 / 8 + r / 8,
|
|
694
|
+
y: e / 8 + o * 3 / 8 + s * 3 / 8 + a / 8
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
function Se(t, e, n) {
|
|
698
|
+
v(t, {
|
|
699
|
+
x: e + "",
|
|
700
|
+
y: n + ""
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
function F(t, e, n, o, i) {
|
|
704
|
+
v(t, {
|
|
705
|
+
x1: e + "",
|
|
706
|
+
y1: n + "",
|
|
707
|
+
x2: o + "",
|
|
708
|
+
y2: i + ""
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
function at(t, e, n, o, i, s, r, a, f, d) {
|
|
712
|
+
var l;
|
|
713
|
+
if (t.line.setAttribute("d", `M ${e} ${n} C ${o} ${i} ${s} ${r} ${a} ${f}`), d.style) {
|
|
714
|
+
const c = d.style;
|
|
715
|
+
c.stroke && t.line.setAttribute("stroke", c.stroke), c.strokeWidth && t.line.setAttribute("stroke-width", String(c.strokeWidth)), c.strokeDasharray && t.line.setAttribute("stroke-dasharray", c.strokeDasharray), c.strokeLinecap && t.line.setAttribute("stroke-linecap", c.strokeLinecap), c.opacity !== void 0 && t.line.setAttribute("opacity", String(c.opacity));
|
|
716
|
+
}
|
|
717
|
+
const p = R(s, r, a, f);
|
|
718
|
+
if (p && (t.arrow1.setAttribute("d", `M ${p.x1} ${p.y1} L ${a} ${f} L ${p.x2} ${p.y2}`), d.style)) {
|
|
719
|
+
const c = d.style;
|
|
720
|
+
c.stroke && t.arrow1.setAttribute("stroke", c.stroke), c.strokeWidth && t.arrow1.setAttribute("stroke-width", String(c.strokeWidth)), c.strokeLinecap && t.arrow1.setAttribute("stroke-linecap", c.strokeLinecap), c.opacity !== void 0 && t.arrow1.setAttribute("opacity", String(c.opacity));
|
|
721
|
+
}
|
|
722
|
+
if (d.bidirectional) {
|
|
723
|
+
const c = R(o, i, e, n);
|
|
724
|
+
if (c && (t.arrow2.setAttribute("d", `M ${c.x1} ${c.y1} L ${e} ${n} L ${c.x2} ${c.y2}`), d.style)) {
|
|
725
|
+
const h = d.style;
|
|
726
|
+
h.stroke && t.arrow2.setAttribute("stroke", h.stroke), h.strokeWidth && t.arrow2.setAttribute("stroke-width", String(h.strokeWidth)), h.strokeLinecap && t.arrow2.setAttribute("stroke-linecap", h.strokeLinecap), h.opacity !== void 0 && t.arrow2.setAttribute("opacity", String(h.opacity));
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
const { x: u, y: g } = bt(e, n, o, i, s, r, a, f);
|
|
730
|
+
Se(t.label, u, g), (l = d.style) != null && l.labelColor && t.label.setAttribute("fill", d.style.labelColor), Ne(t);
|
|
731
|
+
}
|
|
732
|
+
function q(t, e, n) {
|
|
733
|
+
const { offsetLeft: o, offsetTop: i } = D(t.nodes, e), s = e.offsetWidth, r = e.offsetHeight, a = o + s / 2, f = i + r / 2, d = a + n.x, p = f + n.y;
|
|
734
|
+
return {
|
|
735
|
+
w: s,
|
|
1068
736
|
h: r,
|
|
1069
|
-
cx:
|
|
1070
|
-
cy:
|
|
1071
|
-
ctrlX:
|
|
1072
|
-
ctrlY:
|
|
737
|
+
cx: a,
|
|
738
|
+
cy: f,
|
|
739
|
+
ctrlX: d,
|
|
740
|
+
ctrlY: p
|
|
1073
741
|
};
|
|
1074
742
|
}
|
|
1075
|
-
function
|
|
743
|
+
function H(t) {
|
|
1076
744
|
let e, n;
|
|
1077
745
|
const o = (t.cy - t.ctrlY) / (t.ctrlX - t.cx);
|
|
1078
746
|
return o > t.h / t.w || o < -t.h / t.w ? t.cy - t.ctrlY < 0 ? (e = t.cx - t.h / 2 / o, n = t.cy + t.h / 2) : (e = t.cx + t.h / 2 / o, n = t.cy - t.h / 2) : t.cx - t.ctrlX < 0 ? (e = t.cx + t.w / 2, n = t.cy - t.w * o / 2) : (e = t.cx - t.w / 2, n = t.cy + t.w * o / 2), {
|
|
@@ -1080,32 +748,32 @@ function O(t) {
|
|
|
1080
748
|
y: n
|
|
1081
749
|
};
|
|
1082
750
|
}
|
|
1083
|
-
const
|
|
1084
|
-
const
|
|
1085
|
-
return
|
|
751
|
+
const Ee = function(t, e, n, o) {
|
|
752
|
+
const i = document.createElementNS(T, "text");
|
|
753
|
+
return v(i, {
|
|
1086
754
|
"text-anchor": "middle",
|
|
1087
755
|
x: e + "",
|
|
1088
756
|
y: n + "",
|
|
1089
|
-
fill: o || "
|
|
1090
|
-
}),
|
|
1091
|
-
},
|
|
757
|
+
fill: o || "rgb(235, 95, 82)"
|
|
758
|
+
}), i.dataset.type = "custom-link", i.innerHTML = t, i;
|
|
759
|
+
}, Q = function(t, e, n, o, i) {
|
|
760
|
+
var E;
|
|
1092
761
|
if (!e || !n)
|
|
1093
762
|
return;
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
if (!m)
|
|
763
|
+
const s = q(t, e, o.delta1), r = q(t, n, o.delta2), { x: a, y: f } = H(s), { ctrlX: d, ctrlY: p } = s, { ctrlX: u, ctrlY: g } = r, { x: l, y: c } = H(r), h = R(u, g, l, c);
|
|
764
|
+
if (!h)
|
|
1097
765
|
return;
|
|
1098
|
-
const
|
|
1099
|
-
let
|
|
766
|
+
const m = `M ${h.x1} ${h.y1} L ${l} ${c} L ${h.x2} ${h.y2}`;
|
|
767
|
+
let w = "";
|
|
1100
768
|
if (o.bidirectional) {
|
|
1101
|
-
const
|
|
1102
|
-
if (!
|
|
769
|
+
const A = R(d, p, a, f);
|
|
770
|
+
if (!A)
|
|
1103
771
|
return;
|
|
1104
|
-
|
|
772
|
+
w = `M ${A.x1} ${A.y1} L ${a} ${f} L ${A.x2} ${A.y2}`;
|
|
1105
773
|
}
|
|
1106
|
-
const
|
|
1107
|
-
|
|
1108
|
-
},
|
|
774
|
+
const x = Bt(`M ${a} ${f} C ${d} ${p} ${u} ${g} ${l} ${c}`, m, w, o.style), { x: y, y: b } = bt(a, f, d, p, u, g, l, c), C = (E = o.style) == null ? void 0 : E.labelColor, S = Ee(o.label, y, b, C);
|
|
775
|
+
x.appendChild(S), x.label = S, x.arrowObj = o, x.dataset.linkid = o.id, t.linkSvgGroup.appendChild(x), i || (t.arrows.push(o), t.currentArrow = x, Ct(t, o, s, r));
|
|
776
|
+
}, Te = function(t, e, n = {}) {
|
|
1109
777
|
const o = {
|
|
1110
778
|
id: W(),
|
|
1111
779
|
label: "Custom Link",
|
|
@@ -1121,21 +789,21 @@ const Te = function(t, e, n, o) {
|
|
|
1121
789
|
},
|
|
1122
790
|
...n
|
|
1123
791
|
};
|
|
1124
|
-
|
|
792
|
+
Q(this, t, e, o), this.bus.fire("operation", {
|
|
1125
793
|
name: "createArrow",
|
|
1126
794
|
obj: o
|
|
1127
795
|
});
|
|
1128
|
-
},
|
|
796
|
+
}, Le = function(t) {
|
|
1129
797
|
const e = { ...t, id: W() };
|
|
1130
|
-
|
|
798
|
+
Q(this, this.findEle(e.from), this.findEle(e.to), e), this.bus.fire("operation", {
|
|
1131
799
|
name: "createArrow",
|
|
1132
800
|
obj: e
|
|
1133
801
|
});
|
|
1134
|
-
},
|
|
802
|
+
}, ke = function(t) {
|
|
1135
803
|
let e;
|
|
1136
804
|
if (t ? e = t : e = this.currentArrow, !e)
|
|
1137
805
|
return;
|
|
1138
|
-
|
|
806
|
+
Z(this);
|
|
1139
807
|
const n = e.arrowObj.id;
|
|
1140
808
|
this.arrows = this.arrows.filter((o) => o.id !== n), e.remove(), this.bus.fire("operation", {
|
|
1141
809
|
name: "removeArrow",
|
|
@@ -1143,205 +811,198 @@ const Te = function(t, e, n, o) {
|
|
|
1143
811
|
id: n
|
|
1144
812
|
}
|
|
1145
813
|
});
|
|
1146
|
-
},
|
|
814
|
+
}, $e = function(t) {
|
|
1147
815
|
this.currentArrow = t;
|
|
1148
|
-
const e = t.arrowObj, n =
|
|
1149
|
-
|
|
1150
|
-
},
|
|
1151
|
-
this.currentArrow = null
|
|
1152
|
-
},
|
|
816
|
+
const e = t.arrowObj, n = this.findEle(e.from), o = this.findEle(e.to), i = q(this, n, e.delta1), s = q(this, o, e.delta2);
|
|
817
|
+
Ct(this, e, i, s);
|
|
818
|
+
}, Ae = function() {
|
|
819
|
+
Z(this), this.currentArrow = null;
|
|
820
|
+
}, _ = function(t, e) {
|
|
821
|
+
const n = document.createElementNS(T, "path");
|
|
822
|
+
return v(n, {
|
|
823
|
+
d: t,
|
|
824
|
+
stroke: e,
|
|
825
|
+
fill: "none",
|
|
826
|
+
"stroke-width": "6",
|
|
827
|
+
"stroke-linecap": "round",
|
|
828
|
+
"stroke-linejoin": "round"
|
|
829
|
+
}), n;
|
|
830
|
+
}, De = function(t, e) {
|
|
831
|
+
const n = document.createElementNS(T, "g");
|
|
832
|
+
n.setAttribute("class", "arrow-highlight"), n.setAttribute("opacity", "0.45");
|
|
833
|
+
const o = _(t.line.getAttribute("d"), e);
|
|
834
|
+
n.appendChild(o);
|
|
835
|
+
const i = _(t.arrow1.getAttribute("d"), e);
|
|
836
|
+
if (n.appendChild(i), t.arrow2.getAttribute("d")) {
|
|
837
|
+
const s = _(t.arrow2.getAttribute("d"), e);
|
|
838
|
+
n.appendChild(s);
|
|
839
|
+
}
|
|
840
|
+
t.insertBefore(n, t.firstChild);
|
|
841
|
+
}, Me = function(t) {
|
|
842
|
+
const e = t.querySelector(".arrow-highlight");
|
|
843
|
+
e && e.remove();
|
|
844
|
+
}, Ne = function(t) {
|
|
845
|
+
const e = t.querySelector(".arrow-highlight");
|
|
846
|
+
if (!e)
|
|
847
|
+
return;
|
|
848
|
+
const n = e.querySelectorAll("path");
|
|
849
|
+
n.length >= 1 && n[0].setAttribute("d", t.line.getAttribute("d")), n.length >= 2 && n[1].setAttribute("d", t.arrow1.getAttribute("d")), n.length >= 3 && t.arrow2.getAttribute("d") && n[2].setAttribute("d", t.arrow2.getAttribute("d"));
|
|
850
|
+
}, Z = function(t) {
|
|
1153
851
|
var e, n;
|
|
1154
|
-
(e = t.helper1) == null || e.
|
|
1155
|
-
},
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
if (!t.currentArrow)
|
|
1170
|
-
return;
|
|
1171
|
-
r = r + h / t.scaleVal, l = l + f / t.scaleVal;
|
|
1172
|
-
const g = O({ ...n, ctrlX: r, ctrlY: l });
|
|
1173
|
-
s = g.x, i = g.y;
|
|
1174
|
-
const m = s / 8 + r * 3 / 8 + c * 3 / 8 + a / 8, p = i / 8 + l * 3 / 8 + u * 3 / 8 + d / 8;
|
|
1175
|
-
if (t.P2.style.top = l + "px", t.P2.style.left = r + "px", t.currentArrow.line.setAttribute("d", `M ${s} ${i} C ${r} ${l} ${c} ${u} ${a} ${d}`), e.bidirectional) {
|
|
1176
|
-
const v = U(r, l, s, i);
|
|
1177
|
-
if (!v)
|
|
1178
|
-
return;
|
|
1179
|
-
t.currentArrow.arrow2.setAttribute("d", `M ${v.x1} ${v.y1} L ${s} ${i} L ${v.x2} ${v.y2}`);
|
|
1180
|
-
}
|
|
1181
|
-
x(t.currentArrow.label, {
|
|
1182
|
-
x: m + "",
|
|
1183
|
-
y: p + ""
|
|
1184
|
-
}), x(t.line1, {
|
|
1185
|
-
x1: s + "",
|
|
1186
|
-
y1: i + "",
|
|
1187
|
-
x2: r + "",
|
|
1188
|
-
y2: l + ""
|
|
1189
|
-
}), e.delta1.x = r - n.cx, e.delta1.y = l - n.cy, t.bus.fire("updateArrowDelta", e);
|
|
1190
|
-
}), t.helper2.init(t.map, (h, f) => {
|
|
1191
|
-
if (!t.currentArrow)
|
|
1192
|
-
return;
|
|
1193
|
-
c = c + h / t.scaleVal, u = u + f / t.scaleVal;
|
|
1194
|
-
const g = O({ ...o, ctrlX: c, ctrlY: u });
|
|
1195
|
-
a = g.x, d = g.y;
|
|
1196
|
-
const m = s / 8 + r * 3 / 8 + c * 3 / 8 + a / 8, p = i / 8 + l * 3 / 8 + u * 3 / 8 + d / 8, v = U(c, u, a, d);
|
|
1197
|
-
v && (t.P3.style.top = u + "px", t.P3.style.left = c + "px", t.currentArrow.line.setAttribute("d", `M ${s} ${i} C ${r} ${l} ${c} ${u} ${a} ${d}`), t.currentArrow.arrow1.setAttribute("d", `M ${v.x1} ${v.y1} L ${a} ${d} L ${v.x2} ${v.y2}`), x(t.currentArrow.label, {
|
|
1198
|
-
x: m + "",
|
|
1199
|
-
y: p + ""
|
|
1200
|
-
}), x(t.line2, {
|
|
1201
|
-
x1: c + "",
|
|
1202
|
-
y1: u + "",
|
|
1203
|
-
x2: a + "",
|
|
1204
|
-
y2: d + ""
|
|
1205
|
-
}), e.delta2.x = c - o.cx, e.delta2.y = u - o.cy, t.bus.fire("updateArrowDelta", e));
|
|
852
|
+
(e = t.helper1) == null || e.destroy(), (n = t.helper2) == null || n.destroy(), t.linkController.style.display = "none", t.P2.style.display = "none", t.P3.style.display = "none", t.currentArrow && Me(t.currentArrow);
|
|
853
|
+
}, Ct = function(t, e, n, o) {
|
|
854
|
+
const { linkController: i, P2: s, P3: r, line1: a, line2: f, nodes: d, map: p, currentArrow: u, bus: g } = t;
|
|
855
|
+
if (!u)
|
|
856
|
+
return;
|
|
857
|
+
i.style.display = "initial", s.style.display = "initial", r.style.display = "initial", d.appendChild(i), d.appendChild(s), d.appendChild(r), De(u, Ce);
|
|
858
|
+
let { x: l, y: c } = H(n), { ctrlX: h, ctrlY: m } = n, { ctrlX: w, ctrlY: x } = o, { x: y, y: b } = H(o);
|
|
859
|
+
s.style.cssText = `top:${m}px;left:${h}px;`, r.style.cssText = `top:${x}px;left:${w}px;`, F(a, l, c, h, m), F(f, w, x, y, b), t.helper1 = lt.create(s), t.helper2 = lt.create(r), t.helper1.init(p, (C, S) => {
|
|
860
|
+
h = h + C / t.scaleVal, m = m + S / t.scaleVal;
|
|
861
|
+
const E = H({ ...n, ctrlX: h, ctrlY: m });
|
|
862
|
+
l = E.x, c = E.y, s.style.top = m + "px", s.style.left = h + "px", at(u, l, c, h, m, w, x, y, b, e), F(a, l, c, h, m), e.delta1.x = h - n.cx, e.delta1.y = m - n.cy, g.fire("updateArrowDelta", e);
|
|
863
|
+
}), t.helper2.init(p, (C, S) => {
|
|
864
|
+
w = w + C / t.scaleVal, x = x + S / t.scaleVal;
|
|
865
|
+
const E = H({ ...o, ctrlX: w, ctrlY: x });
|
|
866
|
+
y = E.x, b = E.y, r.style.top = x + "px", r.style.left = w + "px", at(u, l, c, h, m, w, x, y, b, e), F(f, w, x, y, b), e.delta2.x = w - o.cx, e.delta2.y = x - o.cy, g.fire("updateArrowDelta", e);
|
|
1206
867
|
});
|
|
1207
868
|
};
|
|
1208
|
-
function
|
|
869
|
+
function Pe() {
|
|
1209
870
|
this.linkSvgGroup.innerHTML = "";
|
|
1210
871
|
for (let t = 0; t < this.arrows.length; t++) {
|
|
1211
872
|
const e = this.arrows[t];
|
|
1212
873
|
try {
|
|
1213
|
-
|
|
874
|
+
Q(this, this.findEle(e.from), this.findEle(e.to), e, !0);
|
|
1214
875
|
} catch {
|
|
1215
876
|
}
|
|
1216
877
|
}
|
|
1217
878
|
this.nodes.appendChild(this.linkSvgGroup);
|
|
1218
879
|
}
|
|
1219
|
-
function
|
|
1220
|
-
if (
|
|
880
|
+
function He(t) {
|
|
881
|
+
if (Z(this), !t)
|
|
1221
882
|
return;
|
|
1222
883
|
const e = t.label;
|
|
1223
|
-
|
|
884
|
+
xt(this, e, t.arrowObj);
|
|
1224
885
|
}
|
|
1225
|
-
function
|
|
1226
|
-
this.arrows = this.arrows.filter((t) =>
|
|
886
|
+
function Be() {
|
|
887
|
+
this.arrows = this.arrows.filter((t) => Y(t.from, this.nodeData) && Y(t.to, this.nodeData));
|
|
1227
888
|
}
|
|
1228
|
-
const
|
|
889
|
+
const Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1229
890
|
__proto__: null,
|
|
1230
|
-
createArrow:
|
|
1231
|
-
createArrowFrom:
|
|
1232
|
-
editArrowLabel:
|
|
1233
|
-
removeArrow:
|
|
1234
|
-
renderArrow:
|
|
1235
|
-
selectArrow:
|
|
1236
|
-
tidyArrow:
|
|
1237
|
-
unselectArrow:
|
|
1238
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1239
|
-
var
|
|
891
|
+
createArrow: Te,
|
|
892
|
+
createArrowFrom: Le,
|
|
893
|
+
editArrowLabel: He,
|
|
894
|
+
removeArrow: ke,
|
|
895
|
+
renderArrow: Pe,
|
|
896
|
+
selectArrow: $e,
|
|
897
|
+
tidyArrow: Be,
|
|
898
|
+
unselectArrow: Ae
|
|
899
|
+
}, Symbol.toStringTag, { value: "Module" })), Ve = function(t) {
|
|
900
|
+
var f, d;
|
|
1240
901
|
if (t.length === 0)
|
|
1241
902
|
throw new Error("No selected node.");
|
|
1242
903
|
if (t.length === 1) {
|
|
1243
|
-
const
|
|
1244
|
-
if (!
|
|
904
|
+
const p = t[0].nodeObj, u = t[0].nodeObj.parent;
|
|
905
|
+
if (!u)
|
|
1245
906
|
throw new Error("Can not select root node.");
|
|
1246
|
-
const
|
|
907
|
+
const g = u.children.findIndex((l) => p === l);
|
|
1247
908
|
return {
|
|
1248
|
-
parent:
|
|
1249
|
-
start:
|
|
1250
|
-
end:
|
|
909
|
+
parent: u.id,
|
|
910
|
+
start: g,
|
|
911
|
+
end: g
|
|
1251
912
|
};
|
|
1252
913
|
}
|
|
1253
914
|
let e = 0;
|
|
1254
|
-
const n = t.map((
|
|
1255
|
-
let
|
|
1256
|
-
const
|
|
1257
|
-
for (;
|
|
1258
|
-
const
|
|
1259
|
-
|
|
915
|
+
const n = t.map((p) => {
|
|
916
|
+
let u = p.nodeObj;
|
|
917
|
+
const g = [];
|
|
918
|
+
for (; u.parent; ) {
|
|
919
|
+
const l = u.parent, c = l.children, h = c == null ? void 0 : c.indexOf(u);
|
|
920
|
+
u = l, g.unshift({ node: u, index: h });
|
|
1260
921
|
}
|
|
1261
|
-
return
|
|
922
|
+
return g.length > e && (e = g.length), g;
|
|
1262
923
|
});
|
|
1263
924
|
let o = 0;
|
|
1264
925
|
t:
|
|
1265
926
|
for (; o < e; o++) {
|
|
1266
|
-
const
|
|
1267
|
-
for (let
|
|
1268
|
-
if (((
|
|
927
|
+
const p = (f = n[0][o]) == null ? void 0 : f.node;
|
|
928
|
+
for (let u = 1; u < n.length; u++)
|
|
929
|
+
if (((d = n[u][o]) == null ? void 0 : d.node) !== p)
|
|
1269
930
|
break t;
|
|
1270
931
|
}
|
|
1271
932
|
if (!o)
|
|
1272
933
|
throw new Error("Can not select root node.");
|
|
1273
|
-
const
|
|
1274
|
-
if (!
|
|
934
|
+
const i = n.map((p) => p[o - 1].index).sort(), s = i[0] || 0, r = i[i.length - 1] || 0, a = n[0][o - 1].node;
|
|
935
|
+
if (!a.parent)
|
|
1275
936
|
throw new Error("Please select nodes in the same main topic.");
|
|
1276
937
|
return {
|
|
1277
|
-
parent:
|
|
1278
|
-
start:
|
|
938
|
+
parent: a.id,
|
|
939
|
+
start: s,
|
|
1279
940
|
end: r
|
|
1280
941
|
};
|
|
1281
|
-
},
|
|
1282
|
-
const e = document.createElementNS(
|
|
942
|
+
}, We = function(t) {
|
|
943
|
+
const e = document.createElementNS(T, "g");
|
|
1283
944
|
return e.setAttribute("id", t), e;
|
|
1284
|
-
},
|
|
1285
|
-
const n = document.createElementNS(
|
|
1286
|
-
return
|
|
945
|
+
}, ht = function(t, e) {
|
|
946
|
+
const n = document.createElementNS(T, "path");
|
|
947
|
+
return v(n, {
|
|
1287
948
|
d: t,
|
|
1288
949
|
stroke: e || "#666",
|
|
1289
950
|
fill: "none",
|
|
1290
951
|
"stroke-linecap": "round",
|
|
1291
952
|
"stroke-width": "2"
|
|
1292
953
|
}), n;
|
|
1293
|
-
},
|
|
1294
|
-
const
|
|
1295
|
-
return
|
|
954
|
+
}, dt = function(t, e, n, o, i) {
|
|
955
|
+
const s = document.createElementNS(T, "text");
|
|
956
|
+
return v(s, {
|
|
1296
957
|
"text-anchor": o,
|
|
1297
958
|
x: e + "",
|
|
1298
959
|
y: n + "",
|
|
1299
|
-
fill:
|
|
1300
|
-
}),
|
|
1301
|
-
},
|
|
1302
|
-
const
|
|
960
|
+
fill: i || "#666"
|
|
961
|
+
}), s.innerHTML = t, s;
|
|
962
|
+
}, Ge = (t) => t.parentElement.parentElement, Ie = function(t, { parent: e, start: n }) {
|
|
963
|
+
const o = t.findEle(e), i = o.nodeObj;
|
|
1303
964
|
let s;
|
|
1304
|
-
return
|
|
1305
|
-
},
|
|
1306
|
-
var
|
|
1307
|
-
const { id: n, label: o, parent:
|
|
1308
|
-
let
|
|
1309
|
-
for (let
|
|
1310
|
-
const
|
|
1311
|
-
if (!
|
|
965
|
+
return i.parent ? s = o.closest("me-main").className : s = t.findEle(i.children[n].id).closest("me-main").className, s;
|
|
966
|
+
}, tt = function(t, e) {
|
|
967
|
+
var A;
|
|
968
|
+
const { id: n, label: o, parent: i, start: s, end: r } = e, { nodes: a, theme: f, summarySvg: d } = t, u = t.findEle(i).nodeObj, g = Ie(t, e);
|
|
969
|
+
let l = 1 / 0, c = 0, h = 0, m = 0;
|
|
970
|
+
for (let B = s; B <= r; B++) {
|
|
971
|
+
const et = (A = u.children) == null ? void 0 : A[B];
|
|
972
|
+
if (!et)
|
|
1312
973
|
return t.removeSummary(n), null;
|
|
1313
|
-
const
|
|
1314
|
-
|
|
974
|
+
const G = Ge(t.findEle(et.id)), { offsetLeft: I, offsetTop: nt } = D(a, G), ot = s === r ? 10 : 20;
|
|
975
|
+
B === s && (h = nt + ot), B === r && (m = nt + G.offsetHeight - ot), I < l && (l = I), G.offsetWidth + I > c && (c = G.offsetWidth + I);
|
|
1315
976
|
}
|
|
1316
|
-
let
|
|
1317
|
-
const
|
|
1318
|
-
|
|
1319
|
-
const
|
|
1320
|
-
return
|
|
1321
|
-
},
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
const {
|
|
1325
|
-
|
|
977
|
+
let w, x;
|
|
978
|
+
const y = h + 10, b = m + 10, C = (y + b) / 2, S = f.cssVar["--color"];
|
|
979
|
+
g === P.LHS ? (w = ht(`M ${l + 10} ${y} c -5 0 -10 5 -10 10 L ${l} ${b - 10} c 0 5 5 10 10 10 M ${l} ${C} h -10`, S), x = dt(o, l - 20, C + 6, "end", S)) : (w = ht(`M ${c - 10} ${y} c 5 0 10 5 10 10 L ${c} ${b - 10} c 0 5 -5 10 -10 10 M ${c} ${C} h 10`, S), x = dt(o, c + 20, C + 6, "start", S));
|
|
980
|
+
const E = We("s-" + n);
|
|
981
|
+
return E.appendChild(w), E.appendChild(x), E.summaryObj = e, d.appendChild(E), E;
|
|
982
|
+
}, Fe = function() {
|
|
983
|
+
if (!this.currentNodes)
|
|
984
|
+
return;
|
|
985
|
+
const { currentNodes: t, summaries: e, bus: n } = this, { parent: o, start: i, end: s } = Ve(t), r = { id: W(), parent: o, start: i, end: s, label: "summary" }, a = tt(this, r);
|
|
986
|
+
e.push(r), this.editSummary(a), n.fire("operation", {
|
|
1326
987
|
name: "createSummary",
|
|
1327
|
-
obj:
|
|
988
|
+
obj: r
|
|
1328
989
|
});
|
|
1329
|
-
},
|
|
990
|
+
}, je = function(t) {
|
|
1330
991
|
const e = W(), n = { ...t, id: e };
|
|
1331
|
-
|
|
992
|
+
tt(this, n), this.summaries.push(n), this.bus.fire("operation", {
|
|
1332
993
|
name: "createSummary",
|
|
1333
994
|
obj: n
|
|
1334
995
|
});
|
|
1335
|
-
},
|
|
996
|
+
}, ze = function(t) {
|
|
1336
997
|
var n;
|
|
1337
998
|
const e = this.summaries.findIndex((o) => o.id === t);
|
|
1338
999
|
e > -1 && (this.summaries.splice(e, 1), (n = document.querySelector("#s-" + t)) == null || n.remove()), this.bus.fire("operation", {
|
|
1339
1000
|
name: "removeSummary",
|
|
1340
1001
|
obj: { id: t }
|
|
1341
1002
|
});
|
|
1342
|
-
},
|
|
1343
|
-
const e = t.children[1].getBBox(), n = 6, o = 3,
|
|
1344
|
-
|
|
1003
|
+
}, Ye = function(t) {
|
|
1004
|
+
const e = t.children[1].getBBox(), n = 6, o = 3, i = document.createElementNS(T, "rect");
|
|
1005
|
+
v(i, {
|
|
1345
1006
|
x: e.x - n + "",
|
|
1346
1007
|
y: e.y - n + "",
|
|
1347
1008
|
width: e.width + n * 2 + "",
|
|
@@ -1350,83 +1011,83 @@ const ze = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1350
1011
|
stroke: this.theme.cssVar["--selected"] || "#4dc4ff",
|
|
1351
1012
|
"stroke-width": "2",
|
|
1352
1013
|
fill: "none"
|
|
1353
|
-
}), t.appendChild(
|
|
1354
|
-
},
|
|
1014
|
+
}), t.appendChild(i), this.currentSummary = t;
|
|
1015
|
+
}, Re = function() {
|
|
1355
1016
|
var t, e;
|
|
1356
1017
|
(e = (t = this.currentSummary) == null ? void 0 : t.querySelector("rect")) == null || e.remove(), this.currentSummary = null;
|
|
1357
|
-
},
|
|
1018
|
+
}, Xe = function() {
|
|
1358
1019
|
this.summarySvg.innerHTML = "", this.summaries.forEach((t) => {
|
|
1359
1020
|
try {
|
|
1360
|
-
|
|
1021
|
+
tt(this, t);
|
|
1361
1022
|
} catch {
|
|
1362
1023
|
}
|
|
1363
1024
|
}), this.nodes.insertAdjacentElement("beforeend", this.summarySvg);
|
|
1364
|
-
},
|
|
1025
|
+
}, qe = function(t) {
|
|
1365
1026
|
if (!t)
|
|
1366
1027
|
return;
|
|
1367
1028
|
const e = t.childNodes[1];
|
|
1368
|
-
|
|
1369
|
-
},
|
|
1029
|
+
xt(this, e, t.summaryObj);
|
|
1030
|
+
}, _e = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1370
1031
|
__proto__: null,
|
|
1371
|
-
createSummary:
|
|
1372
|
-
createSummaryFrom:
|
|
1373
|
-
editSummary:
|
|
1374
|
-
removeSummary:
|
|
1375
|
-
renderSummary:
|
|
1376
|
-
selectSummary:
|
|
1377
|
-
unselectSummary:
|
|
1378
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1379
|
-
function
|
|
1380
|
-
const n = document.createElementNS(
|
|
1381
|
-
return
|
|
1032
|
+
createSummary: Fe,
|
|
1033
|
+
createSummaryFrom: je,
|
|
1034
|
+
editSummary: qe,
|
|
1035
|
+
removeSummary: ze,
|
|
1036
|
+
renderSummary: Xe,
|
|
1037
|
+
selectSummary: Ye,
|
|
1038
|
+
unselectSummary: Re
|
|
1039
|
+
}, Symbol.toStringTag, { value: "Module" })), L = "http://www.w3.org/2000/svg";
|
|
1040
|
+
function Ue(t, e) {
|
|
1041
|
+
const n = document.createElementNS(L, "svg");
|
|
1042
|
+
return v(n, {
|
|
1382
1043
|
version: "1.1",
|
|
1383
|
-
xmlns:
|
|
1044
|
+
xmlns: L,
|
|
1384
1045
|
height: t,
|
|
1385
1046
|
width: e
|
|
1386
1047
|
}), n;
|
|
1387
1048
|
}
|
|
1388
|
-
function
|
|
1049
|
+
function Ke(t, e) {
|
|
1389
1050
|
return (parseInt(t) - parseInt(e)) / 2;
|
|
1390
1051
|
}
|
|
1391
|
-
function
|
|
1392
|
-
const
|
|
1393
|
-
let
|
|
1394
|
-
return t.text ?
|
|
1395
|
-
`).forEach((
|
|
1396
|
-
const
|
|
1397
|
-
|
|
1052
|
+
function Je(t, e, n, o) {
|
|
1053
|
+
const i = document.createElementNS(L, "g");
|
|
1054
|
+
let s = "";
|
|
1055
|
+
return t.text ? s = t.text.textContent : s = t.childNodes[0].textContent, s.split(`
|
|
1056
|
+
`).forEach((a, f) => {
|
|
1057
|
+
const d = document.createElementNS(L, "text");
|
|
1058
|
+
v(d, {
|
|
1398
1059
|
x: n + parseInt(e.paddingLeft) + "",
|
|
1399
|
-
y: o + parseInt(e.paddingTop) +
|
|
1060
|
+
y: o + parseInt(e.paddingTop) + Ke(e.lineHeight, e.fontSize) * (f + 1) + parseFloat(e.fontSize) * (f + 1) + "",
|
|
1400
1061
|
"text-anchor": "start",
|
|
1401
1062
|
"font-family": e.fontFamily,
|
|
1402
1063
|
"font-size": `${e.fontSize}`,
|
|
1403
1064
|
"font-weight": `${e.fontWeight}`,
|
|
1404
1065
|
fill: `${e.color}`
|
|
1405
|
-
}),
|
|
1406
|
-
}),
|
|
1066
|
+
}), d.innerHTML = a, i.appendChild(d);
|
|
1067
|
+
}), i;
|
|
1407
1068
|
}
|
|
1408
|
-
function
|
|
1409
|
-
var
|
|
1410
|
-
let
|
|
1411
|
-
(
|
|
1412
|
-
const
|
|
1413
|
-
|
|
1069
|
+
function Qe(t, e, n, o) {
|
|
1070
|
+
var a;
|
|
1071
|
+
let i = "";
|
|
1072
|
+
(a = t.nodeObj) != null && a.dangerouslySetInnerHTML ? i = t.nodeObj.dangerouslySetInnerHTML : t.text ? i = t.text.textContent : i = t.childNodes[0].textContent;
|
|
1073
|
+
const s = document.createElementNS(L, "foreignObject");
|
|
1074
|
+
v(s, {
|
|
1414
1075
|
x: n + parseInt(e.paddingLeft) + "",
|
|
1415
1076
|
y: o + parseInt(e.paddingTop) + "",
|
|
1416
1077
|
width: e.width,
|
|
1417
1078
|
height: e.height
|
|
1418
1079
|
});
|
|
1419
1080
|
const r = document.createElement("div");
|
|
1420
|
-
return
|
|
1081
|
+
return v(r, {
|
|
1421
1082
|
xmlns: "http://www.w3.org/1999/xhtml",
|
|
1422
1083
|
style: `font-family: ${e.fontFamily}; font-size: ${e.fontSize}; font-weight: ${e.fontWeight}; color: ${e.color}; white-space: pre-wrap;`
|
|
1423
|
-
}), r.innerHTML =
|
|
1084
|
+
}), r.innerHTML = i, s.appendChild(r), s;
|
|
1424
1085
|
}
|
|
1425
|
-
function
|
|
1426
|
-
const n = getComputedStyle(e), { offsetLeft: o, offsetTop:
|
|
1427
|
-
return
|
|
1086
|
+
function Ze(t, e) {
|
|
1087
|
+
const n = getComputedStyle(e), { offsetLeft: o, offsetTop: i } = D(t.nodes, e), s = document.createElementNS(L, "rect");
|
|
1088
|
+
return v(s, {
|
|
1428
1089
|
x: o + "",
|
|
1429
|
-
y:
|
|
1090
|
+
y: i + "",
|
|
1430
1091
|
rx: n.borderRadius,
|
|
1431
1092
|
ry: n.borderRadius,
|
|
1432
1093
|
width: n.width,
|
|
@@ -1434,13 +1095,13 @@ function tn(t, e) {
|
|
|
1434
1095
|
fill: n.backgroundColor,
|
|
1435
1096
|
stroke: n.borderColor,
|
|
1436
1097
|
"stroke-width": n.borderWidth
|
|
1437
|
-
}),
|
|
1098
|
+
}), s;
|
|
1438
1099
|
}
|
|
1439
|
-
function
|
|
1440
|
-
const o = getComputedStyle(e), { offsetLeft:
|
|
1441
|
-
|
|
1442
|
-
x:
|
|
1443
|
-
y:
|
|
1100
|
+
function j(t, e, n = !1) {
|
|
1101
|
+
const o = getComputedStyle(e), { offsetLeft: i, offsetTop: s } = D(t.nodes, e), r = document.createElementNS(L, "rect");
|
|
1102
|
+
v(r, {
|
|
1103
|
+
x: i + "",
|
|
1104
|
+
y: s + "",
|
|
1444
1105
|
rx: o.borderRadius,
|
|
1445
1106
|
ry: o.borderRadius,
|
|
1446
1107
|
width: o.width,
|
|
@@ -1449,138 +1110,138 @@ function G(t, e, n = !1) {
|
|
|
1449
1110
|
stroke: o.borderColor,
|
|
1450
1111
|
"stroke-width": o.borderWidth
|
|
1451
1112
|
});
|
|
1452
|
-
const
|
|
1453
|
-
|
|
1454
|
-
let
|
|
1455
|
-
return n ?
|
|
1113
|
+
const a = document.createElementNS(L, "g");
|
|
1114
|
+
a.appendChild(r);
|
|
1115
|
+
let f;
|
|
1116
|
+
return n ? f = Qe(e, o, i, s) : f = Je(e, o, i, s), a.appendChild(f), a;
|
|
1456
1117
|
}
|
|
1457
|
-
function
|
|
1458
|
-
const n = getComputedStyle(e), { offsetLeft: o, offsetTop:
|
|
1459
|
-
return
|
|
1118
|
+
function tn(t, e) {
|
|
1119
|
+
const n = getComputedStyle(e), { offsetLeft: o, offsetTop: i } = D(t.nodes, e), s = document.createElementNS(L, "a"), r = document.createElementNS(L, "text");
|
|
1120
|
+
return v(r, {
|
|
1460
1121
|
x: o + "",
|
|
1461
|
-
y:
|
|
1122
|
+
y: i + parseInt(n.fontSize) + "",
|
|
1462
1123
|
"text-anchor": "start",
|
|
1463
1124
|
"font-family": n.fontFamily,
|
|
1464
1125
|
"font-size": `${n.fontSize}`,
|
|
1465
1126
|
"font-weight": `${n.fontWeight}`,
|
|
1466
1127
|
fill: `${n.color}`
|
|
1467
|
-
}), r.innerHTML = e.textContent,
|
|
1128
|
+
}), r.innerHTML = e.textContent, s.appendChild(r), s.setAttribute("href", e.href), s;
|
|
1468
1129
|
}
|
|
1469
|
-
function
|
|
1470
|
-
const n = getComputedStyle(e), { offsetLeft: o, offsetTop:
|
|
1471
|
-
return
|
|
1130
|
+
function en(t, e) {
|
|
1131
|
+
const n = getComputedStyle(e), { offsetLeft: o, offsetTop: i } = D(t.nodes, e), s = document.createElementNS(L, "image");
|
|
1132
|
+
return v(s, {
|
|
1472
1133
|
x: o + "",
|
|
1473
|
-
y:
|
|
1134
|
+
y: i + "",
|
|
1474
1135
|
width: n.width + "",
|
|
1475
1136
|
height: n.height + "",
|
|
1476
1137
|
href: e.src
|
|
1477
|
-
}),
|
|
1138
|
+
}), s;
|
|
1478
1139
|
}
|
|
1479
|
-
const
|
|
1480
|
-
var
|
|
1481
|
-
const n = t.nodes, o = n.offsetHeight +
|
|
1482
|
-
|
|
1140
|
+
const z = 100, nn = '<?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">', on = (t, e = !1) => {
|
|
1141
|
+
var u, g, l;
|
|
1142
|
+
const n = t.nodes, o = n.offsetHeight + z * 2, i = n.offsetWidth + z * 2, s = Ue(o + "px", i + "px"), r = document.createElementNS(L, "svg"), a = document.createElementNS(L, "rect");
|
|
1143
|
+
v(a, {
|
|
1483
1144
|
x: "0",
|
|
1484
1145
|
y: "0",
|
|
1485
|
-
width: `${
|
|
1146
|
+
width: `${i}`,
|
|
1486
1147
|
height: `${o}`,
|
|
1487
1148
|
fill: t.theme.cssVar["--bgcolor"]
|
|
1488
|
-
}),
|
|
1489
|
-
const
|
|
1490
|
-
|
|
1149
|
+
}), s.appendChild(a), n.querySelectorAll(".subLines").forEach((c) => {
|
|
1150
|
+
const h = c.cloneNode(!0), { offsetLeft: m, offsetTop: w } = D(n, c.parentElement);
|
|
1151
|
+
h.setAttribute("x", `${m}`), h.setAttribute("y", `${w}`), r.appendChild(h);
|
|
1491
1152
|
});
|
|
1492
|
-
const
|
|
1493
|
-
|
|
1494
|
-
const
|
|
1495
|
-
|
|
1496
|
-
const
|
|
1497
|
-
return
|
|
1498
|
-
|
|
1499
|
-
}), n.querySelectorAll(".tags > span").forEach((
|
|
1500
|
-
r.appendChild(
|
|
1501
|
-
}), n.querySelectorAll(".icons > span").forEach((
|
|
1502
|
-
r.appendChild(
|
|
1503
|
-
}), n.querySelectorAll(".hyper-link").forEach((
|
|
1504
|
-
r.appendChild(
|
|
1505
|
-
}), n.querySelectorAll("img").forEach((
|
|
1506
|
-
r.appendChild(
|
|
1507
|
-
}),
|
|
1508
|
-
x:
|
|
1509
|
-
y:
|
|
1153
|
+
const f = (u = n.querySelector(".lines")) == null ? void 0 : u.cloneNode(!0);
|
|
1154
|
+
f && r.appendChild(f);
|
|
1155
|
+
const d = (g = n.querySelector(".topiclinks")) == null ? void 0 : g.cloneNode(!0);
|
|
1156
|
+
d && r.appendChild(d);
|
|
1157
|
+
const p = (l = n.querySelector(".summary")) == null ? void 0 : l.cloneNode(!0);
|
|
1158
|
+
return p && r.appendChild(p), n.querySelectorAll("me-tpc").forEach((c) => {
|
|
1159
|
+
c.nodeObj.dangerouslySetInnerHTML ? r.appendChild(j(t, c, !e)) : (r.appendChild(Ze(t, c)), r.appendChild(j(t, c.text, !e)));
|
|
1160
|
+
}), n.querySelectorAll(".tags > span").forEach((c) => {
|
|
1161
|
+
r.appendChild(j(t, c));
|
|
1162
|
+
}), n.querySelectorAll(".icons > span").forEach((c) => {
|
|
1163
|
+
r.appendChild(j(t, c));
|
|
1164
|
+
}), n.querySelectorAll(".hyper-link").forEach((c) => {
|
|
1165
|
+
r.appendChild(tn(t, c));
|
|
1166
|
+
}), n.querySelectorAll("img").forEach((c) => {
|
|
1167
|
+
r.appendChild(en(t, c));
|
|
1168
|
+
}), v(r, {
|
|
1169
|
+
x: z + "",
|
|
1170
|
+
y: z + "",
|
|
1510
1171
|
overflow: "visible"
|
|
1511
|
-
}),
|
|
1512
|
-
},
|
|
1513
|
-
function
|
|
1172
|
+
}), s.appendChild(r), s;
|
|
1173
|
+
}, sn = (t, e) => (e && t.insertAdjacentHTML("afterbegin", "<style>" + e + "</style>"), nn + t.outerHTML);
|
|
1174
|
+
function rn(t) {
|
|
1514
1175
|
return new Promise((e, n) => {
|
|
1515
1176
|
const o = new FileReader();
|
|
1516
|
-
o.onload = (
|
|
1517
|
-
e(
|
|
1518
|
-
}, o.onerror = (
|
|
1519
|
-
n(
|
|
1177
|
+
o.onload = (i) => {
|
|
1178
|
+
e(i.target.result);
|
|
1179
|
+
}, o.onerror = (i) => {
|
|
1180
|
+
n(i);
|
|
1520
1181
|
}, o.readAsDataURL(t);
|
|
1521
1182
|
});
|
|
1522
1183
|
}
|
|
1523
1184
|
const cn = function(t = !1, e) {
|
|
1524
|
-
const n =
|
|
1185
|
+
const n = on(this, t), o = sn(n, e);
|
|
1525
1186
|
return new Blob([o], { type: "image/svg+xml" });
|
|
1526
|
-
},
|
|
1527
|
-
const n = this.exportSvg(t, e), o = await
|
|
1528
|
-
return new Promise((
|
|
1187
|
+
}, ln = async function(t = !1, e) {
|
|
1188
|
+
const n = this.exportSvg(t, e), o = await rn(n);
|
|
1189
|
+
return new Promise((i, s) => {
|
|
1529
1190
|
const r = new Image();
|
|
1530
1191
|
r.setAttribute("crossOrigin", "anonymous"), r.onload = () => {
|
|
1531
|
-
const
|
|
1532
|
-
|
|
1533
|
-
}, r.src = o, r.onerror =
|
|
1192
|
+
const a = document.createElement("canvas");
|
|
1193
|
+
a.width = r.width, a.height = r.height, a.getContext("2d").drawImage(r, 0, 0), a.toBlob(i, "image/png", 1);
|
|
1194
|
+
}, r.src = o, r.onerror = s;
|
|
1534
1195
|
});
|
|
1535
|
-
},
|
|
1196
|
+
}, an = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1536
1197
|
__proto__: null,
|
|
1537
|
-
exportPng:
|
|
1198
|
+
exportPng: ln,
|
|
1538
1199
|
exportSvg: cn
|
|
1539
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1540
|
-
getObjById:
|
|
1541
|
-
generateNewObj:
|
|
1542
|
-
layout:
|
|
1543
|
-
linkDiv:
|
|
1544
|
-
editTopic:
|
|
1545
|
-
createWrapper:
|
|
1546
|
-
createParent:
|
|
1547
|
-
createChildren:
|
|
1548
|
-
createTopic:
|
|
1549
|
-
findEle:
|
|
1550
|
-
changeTheme:
|
|
1551
|
-
...
|
|
1552
|
-
...dn,
|
|
1553
|
-
...ze,
|
|
1554
|
-
...Ke,
|
|
1200
|
+
}, Symbol.toStringTag, { value: "Module" })), hn = {}, dn = {
|
|
1201
|
+
getObjById: Y,
|
|
1202
|
+
generateNewObj: St,
|
|
1203
|
+
layout: Lt,
|
|
1204
|
+
linkDiv: Ot,
|
|
1205
|
+
editTopic: Pt,
|
|
1206
|
+
createWrapper: At,
|
|
1207
|
+
createParent: Dt,
|
|
1208
|
+
createChildren: Mt,
|
|
1209
|
+
createTopic: Nt,
|
|
1210
|
+
findEle: ut,
|
|
1211
|
+
changeTheme: _t,
|
|
1212
|
+
...ve,
|
|
1555
1213
|
...hn,
|
|
1214
|
+
...Oe,
|
|
1215
|
+
..._e,
|
|
1216
|
+
...an,
|
|
1556
1217
|
init(t) {
|
|
1557
1218
|
if (t = JSON.parse(JSON.stringify(t)), !t || !t.nodeData)
|
|
1558
1219
|
return new Error("MindElixir: `data` is required");
|
|
1559
|
-
t.direction !== void 0 && (this.direction = t.direction), this.changeTheme(t.theme || this.theme, !1), this.nodeData = t.nodeData,
|
|
1220
|
+
t.direction !== void 0 && (this.direction = t.direction), this.changeTheme(t.theme || this.theme, !1), this.nodeData = t.nodeData, J(this.nodeData), this.arrows = t.arrows || [], this.summaries = t.summaries || [], this.tidyArrow(), this.toolBar && qt(this), this.layout(), this.linkDiv(), this.toCenter();
|
|
1560
1221
|
},
|
|
1561
1222
|
destroy() {
|
|
1562
1223
|
var t;
|
|
1563
|
-
this.disposable.forEach((e) => e()), this.
|
|
1224
|
+
this.disposable.forEach((e) => e()), this.el && (this.el.innerHTML = ""), this.el = void 0, this.nodeData = void 0, this.arrows = void 0, this.summaries = void 0, this.currentArrow = void 0, this.currentNodes = void 0, this.currentSummary = void 0, this.waitCopy = void 0, this.theme = void 0, this.direction = void 0, this.bus = void 0, this.container = void 0, this.map = void 0, this.lines = void 0, this.linkController = void 0, this.linkSvgGroup = void 0, this.P2 = void 0, this.P3 = void 0, this.line1 = void 0, this.line2 = void 0, this.nodes = void 0, (t = this.selection) == null || t.destroy(), this.selection = void 0;
|
|
1564
1225
|
}
|
|
1565
1226
|
};
|
|
1566
|
-
function fn({ pT: t, pL: e, pW: n, pH: o, cT:
|
|
1567
|
-
let
|
|
1568
|
-
const
|
|
1569
|
-
let
|
|
1570
|
-
|
|
1571
|
-
const
|
|
1572
|
-
return
|
|
1227
|
+
function fn({ pT: t, pL: e, pW: n, pH: o, cT: i, cL: s, cW: r, cH: a, direction: f, containerHeight: d }) {
|
|
1228
|
+
let p = e + n / 2;
|
|
1229
|
+
const u = t + o / 2;
|
|
1230
|
+
let g;
|
|
1231
|
+
f === P.LHS ? g = s + r : g = s;
|
|
1232
|
+
const l = i + a / 2, h = (1 - Math.abs(l - u) / d) * 0.25 * (n / 2);
|
|
1233
|
+
return f === P.LHS ? p = p - n / 10 - h : p = p + n / 10 + h, `M ${p} ${u} Q ${p} ${l} ${g} ${l}`;
|
|
1573
1234
|
}
|
|
1574
|
-
function pn({ pT: t, pL: e, pW: n, pH: o, cT:
|
|
1575
|
-
const
|
|
1576
|
-
let
|
|
1577
|
-
|
|
1578
|
-
const
|
|
1579
|
-
let
|
|
1580
|
-
const
|
|
1581
|
-
return
|
|
1235
|
+
function pn({ pT: t, pL: e, pW: n, pH: o, cT: i, cL: s, cW: r, cH: a, direction: f, isFirst: d }) {
|
|
1236
|
+
const p = parseInt(this.container.style.getPropertyValue("--node-gap-x"));
|
|
1237
|
+
let u = 0, g = 0;
|
|
1238
|
+
d ? u = t + o / 2 : u = t + o;
|
|
1239
|
+
const l = i + a;
|
|
1240
|
+
let c = 0, h = 0, m = 0;
|
|
1241
|
+
const w = Math.abs(u - l) / 300 * p;
|
|
1242
|
+
return f === P.LHS ? (m = e, c = m + p, h = m - p, g = s + p, `M ${c} ${u} C ${m} ${u} ${m + w} ${l} ${h} ${l} H ${g}`) : (m = e + n, c = m - p, h = m + p, g = s + r - p, `M ${c} ${u} C ${m} ${u} ${m - w} ${l} ${h} ${l} H ${g}`);
|
|
1582
1243
|
}
|
|
1583
|
-
const
|
|
1244
|
+
const un = "5.0.1";
|
|
1584
1245
|
function gn(t) {
|
|
1585
1246
|
return {
|
|
1586
1247
|
x: 0,
|
|
@@ -1588,62 +1249,62 @@ function gn(t) {
|
|
|
1588
1249
|
moved: !1,
|
|
1589
1250
|
// diffrentiate click and move
|
|
1590
1251
|
mousedown: !1,
|
|
1591
|
-
onMove(e) {
|
|
1592
|
-
|
|
1593
|
-
this.moved = !0;
|
|
1594
|
-
const n = e.movementX, o = e.movementY;
|
|
1595
|
-
t.move(n, o);
|
|
1596
|
-
}
|
|
1252
|
+
onMove(e, n) {
|
|
1253
|
+
this.mousedown && (this.moved = !0, t.move(e, n));
|
|
1597
1254
|
},
|
|
1598
1255
|
clear() {
|
|
1599
|
-
|
|
1600
|
-
this.moved = !1, this.mousedown = !1, t.map.style.transition = "transform 0.3s";
|
|
1601
|
-
}, 0);
|
|
1256
|
+
this.mousedown = !1, t.map.style.transition = "transform 0.3s";
|
|
1602
1257
|
}
|
|
1603
1258
|
};
|
|
1604
1259
|
}
|
|
1605
|
-
const
|
|
1606
|
-
function
|
|
1260
|
+
const O = document;
|
|
1261
|
+
function $({
|
|
1607
1262
|
el: t,
|
|
1608
1263
|
direction: e,
|
|
1609
1264
|
locale: n,
|
|
1610
1265
|
draggable: o,
|
|
1611
|
-
editable:
|
|
1612
|
-
contextMenu:
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1266
|
+
editable: i,
|
|
1267
|
+
contextMenu: s,
|
|
1268
|
+
toolBar: r,
|
|
1269
|
+
keypress: a,
|
|
1270
|
+
mouseSelectionButton: f,
|
|
1271
|
+
selectionContainer: d,
|
|
1272
|
+
before: p,
|
|
1273
|
+
newTopicName: u,
|
|
1274
|
+
allowUndo: g,
|
|
1275
|
+
generateMainBranch: l,
|
|
1276
|
+
generateSubBranch: c,
|
|
1277
|
+
overflowHidden: h,
|
|
1278
|
+
theme: m,
|
|
1279
|
+
alignment: w,
|
|
1280
|
+
scaleSensitivity: x
|
|
1626
1281
|
}) {
|
|
1627
1282
|
let y = null;
|
|
1628
|
-
const
|
|
1629
|
-
if (
|
|
1283
|
+
const b = Object.prototype.toString.call(t);
|
|
1284
|
+
if (b === "[object HTMLDivElement]" ? y = t : b === "[object String]" && (y = document.querySelector(t)), !y)
|
|
1630
1285
|
throw new Error("MindElixir: el is not a valid element");
|
|
1631
|
-
y.style.position = "relative", y.innerHTML = "", this.
|
|
1632
|
-
const
|
|
1633
|
-
this.theme =
|
|
1634
|
-
const S =
|
|
1286
|
+
y.style.position = "relative", y.innerHTML = "", this.el = y, this.disposable = [], this.before = p || {}, this.locale = n || "en", this.contextMenu = s === void 0 ? !0 : s, this.toolBar = r === void 0 ? !0 : r, this.keypress = a === void 0 ? !0 : a, this.mouseSelectionButton = f || 0, this.direction = typeof e == "number" ? e : 1, this.draggable = o === void 0 ? !0 : o, this.newTopicName = u || "new node", this.editable = i === void 0 ? !0 : i, this.allowUndo = g === void 0 ? !1 : g, this.scaleSensitivity = typeof x == "number" ? x : 0.2, this.currentNodes = [], this.currentArrow = null, this.scaleVal = 1, this.tempDirection = null, this.generateMainBranch = l || fn, this.generateSubBranch = c || pn, this.overflowHidden = h || !1, this.dragMoveHelper = gn(this), this.bus = Tt(), this.container = O.createElement("div"), this.selectionContainer = d || this.container, this.container.className = "map-container";
|
|
1287
|
+
const C = window.matchMedia("(prefers-color-scheme: dark)");
|
|
1288
|
+
this.theme = m || (C.matches ? K : U);
|
|
1289
|
+
const S = O.createElement("div");
|
|
1635
1290
|
S.className = "map-canvas", setTimeout(() => {
|
|
1636
1291
|
S.style.transition = "all 0.3s";
|
|
1637
|
-
}, 300), this.map = S, this.
|
|
1292
|
+
}, 300), this.map = S, this.container.setAttribute("tabindex", "0"), this.container.appendChild(this.map), this.el.appendChild(this.container), this.nodes = O.createElement("me-nodes"), this.lines = V("lines"), this.summarySvg = V("summary"), this.linkController = V("linkcontroller"), this.P2 = O.createElement("div"), this.P3 = O.createElement("div"), this.P2.className = this.P3.className = "circle", this.P2.style.display = this.P3.style.display = "none", this.line1 = ct(), this.line2 = ct(), this.linkController.appendChild(this.line1), this.linkController.appendChild(this.line2), this.linkSvgGroup = V("topiclinks"), this.alignment = w ?? "root", this.map.appendChild(this.nodes), this.overflowHidden ? this.container.style.overflow = "hidden" : this.disposable.push(Et(this));
|
|
1638
1293
|
}
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1294
|
+
$.prototype = dn;
|
|
1295
|
+
Object.defineProperty($.prototype, "currentNode", {
|
|
1296
|
+
get() {
|
|
1297
|
+
return this.currentNodes[this.currentNodes.length - 1];
|
|
1298
|
+
},
|
|
1299
|
+
enumerable: !0
|
|
1300
|
+
});
|
|
1301
|
+
$.LEFT = 0;
|
|
1302
|
+
$.RIGHT = 1;
|
|
1303
|
+
$.SIDE = 2;
|
|
1304
|
+
$.THEME = U;
|
|
1305
|
+
$.DARK_THEME = K;
|
|
1306
|
+
$.version = un;
|
|
1307
|
+
$.E = ut;
|
|
1647
1308
|
export {
|
|
1648
|
-
|
|
1309
|
+
$ as default
|
|
1649
1310
|
};
|