@mindexec/cli 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +275 -0
- package/codex-runtime.js +960 -0
- package/launch-bridge.cjs +162 -0
- package/package.json +61 -0
- package/port-guard.cjs +232 -0
- package/scripts/setup-tree-sitter-grammars.mjs +59 -0
- package/server.js +8422 -0
- package/start-bridge.bat +32 -0
- package/start-bridge.sh +81 -0
- package/tree-sitter-grammars/README.md +18 -0
- package/tree-sitter-grammars/tree-sitter-c_sharp.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-go.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-java.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-javascript.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-python.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-rust.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-tsx.wasm +0 -0
- package/tree-sitter-grammars/tree-sitter-typescript.wasm +0 -0
- package/wwwroot/MindExecution.Web.styles.css +3 -0
- package/wwwroot/_content/MindExecution.Plugins.Admin/css/admin-dashboard.css +546 -0
- package/wwwroot/_content/MindExecution.Plugins.Directory/MindExecution.Plugins.Directory.u7utcng611.bundle.scp.css +7 -0
- package/wwwroot/_content/MindExecution.Plugins.Directory/background.png +0 -0
- package/wwwroot/_content/MindExecution.Plugins.Directory/directory-manager.js +202 -0
- package/wwwroot/_content/MindExecution.Plugins.Directory/exampleJsInterop.js +6 -0
- package/wwwroot/_content/MindExecution.Plugins.YouTube/css/youtube-search.css +251 -0
- package/wwwroot/_content/MindExecution.Shared/MindExecution.Shared.wsano1j4wp.bundle.scp.css +4 -0
- package/wwwroot/_content/MindExecution.Shared/css/admin-dashboard.css +559 -0
- package/wwwroot/_content/MindExecution.Shared/css/app.css +1 -0
- package/wwwroot/_content/MindExecution.Shared/css/mind-map-overrides.css +2936 -0
- package/wwwroot/_content/MindExecution.Shared/fonts/NotoSansKR-Bold.ttf +0 -0
- package/wwwroot/_content/MindExecution.Shared/fonts/NotoSansKR-Regular.ttf +0 -0
- package/wwwroot/_content/MindExecution.Shared/js/agent-visualization.js +359 -0
- package/wwwroot/_content/MindExecution.Shared/js/background-themes.js +1721 -0
- package/wwwroot/_content/MindExecution.Shared/js/code-master.js +8316 -0
- package/wwwroot/_content/MindExecution.Shared/js/file-system-helper.js +639 -0
- package/wwwroot/_content/MindExecution.Shared/js/helpers/InfiniteGridHelper.js +109 -0
- package/wwwroot/_content/MindExecution.Shared/js/marked.min.js +69 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-core.js +7982 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-core.js.backup +1059 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-css3d-manager.js +15803 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-dev-guards.js +325 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-dnd.js +1430 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-dnd.js.bak +434 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-glow-shader.js +260 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-interactions.js +7640 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-lod-plan-worker.js +160 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-lod-renderer.js +9923 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-logic-workers.js +977 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-menu-manager.js +1431 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-multi-select.js +1716 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-node-search-worker.js +553 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-nodes.js +4541 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-object-manager.js +489 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-object-manager.js.backup +372 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-pipeline.js +2075 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-text-lod-system.js +646 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-text-overlay-v2.js +4323 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-texture-factory.js +2260 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-texture-factory.js.backup +1258 -0
- package/wwwroot/_content/MindExecution.Shared/js/mind-map-visibility-worker.js +890 -0
- package/wwwroot/_content/MindExecution.Shared/js/mindmap-toolbar.js +594 -0
- package/wwwroot/_content/MindExecution.Shared/js/native-drop-handler.js +170 -0
- package/wwwroot/_content/MindExecution.Shared/js/plan-master.js +788 -0
- package/wwwroot/_content/MindExecution.Shared/js/renderers/CSS3DRenderer.js +50 -0
- package/wwwroot/_content/MindExecution.Shared/js/texture-worker-manager.js +188 -0
- package/wwwroot/_content/MindExecution.Shared/js/texture-worker.js +208 -0
- package/wwwroot/_content/MindExecution.Shared/js/three.min.js +6 -0
- package/wwwroot/_content/MindExecution.Shared/js/titlebar-handler.js +191 -0
- package/wwwroot/_content/MindExecution.Shared/js/token-manager.js +37 -0
- package/wwwroot/_content/MindExecution.Shared/js/token-worker.js +28 -0
- package/wwwroot/_content/MindExecution.Shared/js/troika-bundle.js +5626 -0
- package/wwwroot/_content/MindExecution.Shared/js/troika-bundle.js.map +7 -0
- package/wwwroot/_content/MindExecution.Shared/lib/font-awesome/css/all.min.css +9 -0
- package/wwwroot/_content/MindExecution.Shared/lib/font-awesome/webfonts/fa-brands-400.ttf +0 -0
- package/wwwroot/_content/MindExecution.Shared/lib/font-awesome/webfonts/fa-brands-400.woff2 +0 -0
- package/wwwroot/_content/MindExecution.Shared/lib/font-awesome/webfonts/fa-regular-400.ttf +0 -0
- package/wwwroot/_content/MindExecution.Shared/lib/font-awesome/webfonts/fa-regular-400.woff2 +0 -0
- package/wwwroot/_content/MindExecution.Shared/lib/font-awesome/webfonts/fa-solid-900.ttf +0 -0
- package/wwwroot/_content/MindExecution.Shared/lib/font-awesome/webfonts/fa-solid-900.woff2 +0 -0
- package/wwwroot/_content/MindExecution.Shared/models/all-MiniLM-L6-v2-quantized.onnx +0 -0
- package/wwwroot/_content/MindExecution.Shared/models/vocab.txt +30522 -0
- package/wwwroot/_framework/Google.Protobuf.9h59ukbel7.dll +0 -0
- package/wwwroot/_framework/Markdig.d1j7v41cl1.dll +0 -0
- package/wwwroot/_framework/MessagePack.Annotations.l6qv48kgpt.dll +0 -0
- package/wwwroot/_framework/MessagePack.eqoptzx9d5.dll +0 -0
- package/wwwroot/_framework/Microsoft.AspNetCore.Authorization.k7dsih5y5g.dll +0 -0
- package/wwwroot/_framework/Microsoft.AspNetCore.Components.6nyje9sa0g.dll +0 -0
- package/wwwroot/_framework/Microsoft.AspNetCore.Components.Authorization.iycd6unprw.dll +0 -0
- package/wwwroot/_framework/Microsoft.AspNetCore.Components.Web.487u3twia4.dll +0 -0
- package/wwwroot/_framework/Microsoft.AspNetCore.Components.WebAssembly.d0gcnmlxxz.dll +0 -0
- package/wwwroot/_framework/Microsoft.AspNetCore.Metadata.h4yevl9adi.dll +0 -0
- package/wwwroot/_framework/Microsoft.CSharp.qrvp77qmhs.dll +0 -0
- package/wwwroot/_framework/Microsoft.Data.Sqlite.jdlxgv2jtg.dll +0 -0
- package/wwwroot/_framework/Microsoft.EntityFrameworkCore.4gjazp7kjf.dll +0 -0
- package/wwwroot/_framework/Microsoft.EntityFrameworkCore.Abstractions.gocudnvz7b.dll +0 -0
- package/wwwroot/_framework/Microsoft.EntityFrameworkCore.Relational.lt4rsvinuo.dll +0 -0
- package/wwwroot/_framework/Microsoft.EntityFrameworkCore.Sqlite.69luj0fa9r.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.Caching.Abstractions.364t4jh3zz.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.Caching.Memory.izlxhpzosu.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.Configuration.8zq7hh41o7.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.Configuration.Abstractions.8if74zs6ea.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.Configuration.Json.duvlngw8i0.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.DependencyInjection.Abstractions.t2hh9kvx0o.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.DependencyInjection.n4tg99oy8l.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.DependencyModel.h0d06ixk3e.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.Logging.Abstractions.rl32bkx2sd.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.Logging.dlht1xei0t.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.Options.qeunebioml.dll +0 -0
- package/wwwroot/_framework/Microsoft.Extensions.Primitives.18cr6vnuuz.dll +0 -0
- package/wwwroot/_framework/Microsoft.IO.RecyclableMemoryStream.r915vovvw4.dll +0 -0
- package/wwwroot/_framework/Microsoft.IdentityModel.Abstractions.1ejljk3erv.dll +0 -0
- package/wwwroot/_framework/Microsoft.IdentityModel.JsonWebTokens.1596zr8gne.dll +0 -0
- package/wwwroot/_framework/Microsoft.IdentityModel.Logging.229uyvpgio.dll +0 -0
- package/wwwroot/_framework/Microsoft.IdentityModel.Tokens.9sibtajc9f.dll +0 -0
- package/wwwroot/_framework/Microsoft.JSInterop.17lq4j1j7g.dll +0 -0
- package/wwwroot/_framework/Microsoft.JSInterop.WebAssembly.ryia5gxiad.dll +0 -0
- package/wwwroot/_framework/Microsoft.ML.OnnxRuntime.w9deo1m5ss.dll +0 -0
- package/wwwroot/_framework/Microsoft.ML.Tokenizers.cm2vuv2z61.dll +0 -0
- package/wwwroot/_framework/Microsoft.NET.StringTools.3qbrf4v2ki.dll +0 -0
- package/wwwroot/_framework/MimeMapping.og9ys58ylm.dll +0 -0
- package/wwwroot/_framework/MindExecution.Core.1q1trifbuu.dll +0 -0
- package/wwwroot/_framework/MindExecution.Kernel.gwwc40sc45.dll +0 -0
- package/wwwroot/_framework/MindExecution.Plugins.Admin.0jgrn1sckv.dll +0 -0
- package/wwwroot/_framework/MindExecution.Plugins.Business.13mme2qcag.dll +0 -0
- package/wwwroot/_framework/MindExecution.Plugins.Concept.dfp2mdt45q.dll +0 -0
- package/wwwroot/_framework/MindExecution.Plugins.Directory.3w4t6n3se0.dll +0 -0
- package/wwwroot/_framework/MindExecution.Plugins.PlanMaster.s0qpntz420.dll +0 -0
- package/wwwroot/_framework/MindExecution.Plugins.YouTube.iu11fq8d16.dll +0 -0
- package/wwwroot/_framework/MindExecution.Shared.7j27dcqnrc.dll +0 -0
- package/wwwroot/_framework/MindExecution.Web.pq1ty8ov2v.dll +0 -0
- package/wwwroot/_framework/Newtonsoft.Json.a56zs13vug.dll +0 -0
- package/wwwroot/_framework/SQLitePCLRaw.batteries_v2.rrd1nzawpp.dll +0 -0
- package/wwwroot/_framework/SQLitePCLRaw.core.1dxloztpfz.dll +0 -0
- package/wwwroot/_framework/SQLitePCLRaw.provider.e_sqlite3.oekyzl53i1.dll +0 -0
- package/wwwroot/_framework/Supabase.Core.s1pkj4aj0l.dll +0 -0
- package/wwwroot/_framework/Supabase.Functions.qz4nu782sg.dll +0 -0
- package/wwwroot/_framework/Supabase.Gotrue.twah27pkik.dll +0 -0
- package/wwwroot/_framework/Supabase.Postgrest.gmuuv369ih.dll +0 -0
- package/wwwroot/_framework/Supabase.Realtime.ox3kchdy3w.dll +0 -0
- package/wwwroot/_framework/Supabase.Storage.fnjnepaowr.dll +0 -0
- package/wwwroot/_framework/Supabase.azmaw5pgcz.dll +0 -0
- package/wwwroot/_framework/System.Collections.Concurrent.y1zmvuyipi.dll +0 -0
- package/wwwroot/_framework/System.Collections.Immutable.ug3j698qms.dll +0 -0
- package/wwwroot/_framework/System.Collections.NonGeneric.h66hj3863h.dll +0 -0
- package/wwwroot/_framework/System.Collections.Specialized.umr3y27ntj.dll +0 -0
- package/wwwroot/_framework/System.Collections.x53e19vfsj.dll +0 -0
- package/wwwroot/_framework/System.ComponentModel.Annotations.tz6gnt4ebt.dll +0 -0
- package/wwwroot/_framework/System.ComponentModel.Primitives.j7tiphu4rg.dll +0 -0
- package/wwwroot/_framework/System.ComponentModel.TypeConverter.ujlztox1gx.dll +0 -0
- package/wwwroot/_framework/System.ComponentModel.x9xz0ojfb6.dll +0 -0
- package/wwwroot/_framework/System.Console.ijzpqmj7ne.dll +0 -0
- package/wwwroot/_framework/System.Data.Common.1r0sqffq1p.dll +0 -0
- package/wwwroot/_framework/System.Diagnostics.DiagnosticSource.9upoqwq09o.dll +0 -0
- package/wwwroot/_framework/System.Diagnostics.Process.m99azzntjm.dll +0 -0
- package/wwwroot/_framework/System.Diagnostics.TraceSource.pl7wv26myr.dll +0 -0
- package/wwwroot/_framework/System.Diagnostics.Tracing.crlhfx6tut.dll +0 -0
- package/wwwroot/_framework/System.Drawing.Primitives.22e4y9ikq9.dll +0 -0
- package/wwwroot/_framework/System.Drawing.mi7d8hwowb.dll +0 -0
- package/wwwroot/_framework/System.Formats.Asn1.jx23sjiqnn.dll +0 -0
- package/wwwroot/_framework/System.IO.Compression.6fyoii3uej.dll +0 -0
- package/wwwroot/_framework/System.IO.Pipelines.vg77t4cd4d.dll +0 -0
- package/wwwroot/_framework/System.IdentityModel.Tokens.Jwt.t67es60z5b.dll +0 -0
- package/wwwroot/_framework/System.Linq.1bkoxlqgmq.dll +0 -0
- package/wwwroot/_framework/System.Linq.Expressions.24xqiypwdt.dll +0 -0
- package/wwwroot/_framework/System.Linq.Queryable.hvd01d6rsa.dll +0 -0
- package/wwwroot/_framework/System.Memory.8dx3lwgym4.dll +0 -0
- package/wwwroot/_framework/System.Net.Http.Json.3mhdm9l1rf.dll +0 -0
- package/wwwroot/_framework/System.Net.Http.eitrz660my.dll +0 -0
- package/wwwroot/_framework/System.Net.NetworkInformation.3pkuofcv9r.dll +0 -0
- package/wwwroot/_framework/System.Net.Ping.8clj5pklrp.dll +0 -0
- package/wwwroot/_framework/System.Net.Primitives.qrp4wcjz1p.dll +0 -0
- package/wwwroot/_framework/System.Net.WebSockets.Client.2u6pv01g69.dll +0 -0
- package/wwwroot/_framework/System.Net.WebSockets.qp6u31zvm5.dll +0 -0
- package/wwwroot/_framework/System.Numerics.Tensors.0c7z4mt3on.dll +0 -0
- package/wwwroot/_framework/System.Numerics.Vectors.kc7ufp2j4l.dll +0 -0
- package/wwwroot/_framework/System.ObjectModel.qv82fot1ib.dll +0 -0
- package/wwwroot/_framework/System.Private.CoreLib.rkafq04oma.dll +0 -0
- package/wwwroot/_framework/System.Private.Uri.t9542hmr6j.dll +0 -0
- package/wwwroot/_framework/System.Private.Xml.Linq.n8n3ptrbwu.dll +0 -0
- package/wwwroot/_framework/System.Private.Xml.rxd3tytisn.dll +0 -0
- package/wwwroot/_framework/System.Reactive.t3fuon548l.dll +0 -0
- package/wwwroot/_framework/System.Reflection.Emit.9tjhp6y0j3.dll +0 -0
- package/wwwroot/_framework/System.Reflection.Emit.ILGeneration.stxyk8zoo1.dll +0 -0
- package/wwwroot/_framework/System.Reflection.Emit.Lightweight.6xrd5v8vg0.dll +0 -0
- package/wwwroot/_framework/System.Reflection.Primitives.wgn8fpwwvv.dll +0 -0
- package/wwwroot/_framework/System.Runtime.InteropServices.JavaScript.sliym526xh.dll +0 -0
- package/wwwroot/_framework/System.Runtime.InteropServices.RuntimeInformation.oji7zut14z.dll +0 -0
- package/wwwroot/_framework/System.Runtime.InteropServices.te07xr2we9.dll +0 -0
- package/wwwroot/_framework/System.Runtime.Intrinsics.507y4h8nzq.dll +0 -0
- package/wwwroot/_framework/System.Runtime.Loader.v7gk4bse0k.dll +0 -0
- package/wwwroot/_framework/System.Runtime.Numerics.eqy5xjv3nd.dll +0 -0
- package/wwwroot/_framework/System.Runtime.Serialization.Formatters.zpkrub8lab.dll +0 -0
- package/wwwroot/_framework/System.Runtime.Serialization.Primitives.vhkpnbxjip.dll +0 -0
- package/wwwroot/_framework/System.Runtime.jn319d5nyg.dll +0 -0
- package/wwwroot/_framework/System.Security.Claims.0ztig1q9vo.dll +0 -0
- package/wwwroot/_framework/System.Security.Cryptography.vttizqc9ho.dll +0 -0
- package/wwwroot/_framework/System.Text.Encoding.Extensions.utdd47ny8f.dll +0 -0
- package/wwwroot/_framework/System.Text.Encodings.Web.wah8r1zoe0.dll +0 -0
- package/wwwroot/_framework/System.Text.Json.kxlfxj0wrs.dll +0 -0
- package/wwwroot/_framework/System.Text.RegularExpressions.dbqn58klox.dll +0 -0
- package/wwwroot/_framework/System.Threading.42ao9vi047.dll +0 -0
- package/wwwroot/_framework/System.Threading.Channels.hfa7j0uv2w.dll +0 -0
- package/wwwroot/_framework/System.Threading.Thread.caul0pdqul.dll +0 -0
- package/wwwroot/_framework/System.Transactions.Local.fimi2hamzo.dll +0 -0
- package/wwwroot/_framework/System.Web.HttpUtility.gq8yz50p2e.dll +0 -0
- package/wwwroot/_framework/System.Xml.Linq.kitin4zjoj.dll +0 -0
- package/wwwroot/_framework/System.Xml.ReaderWriter.kzvw3qgxb0.dll +0 -0
- package/wwwroot/_framework/System.Xml.XDocument.c539ki6cuq.dll +0 -0
- package/wwwroot/_framework/System.m05i39uvk9.dll +0 -0
- package/wwwroot/_framework/Websocket.Client.vapounvmnl.dll +0 -0
- package/wwwroot/_framework/blazor.boot.json +305 -0
- package/wwwroot/_framework/blazor.webassembly.js +1 -0
- package/wwwroot/_framework/dotnet.js +4 -0
- package/wwwroot/_framework/dotnet.native.vz0adxojrz.wasm +0 -0
- package/wwwroot/_framework/dotnet.native.xsn1d6x2kd.js +16 -0
- package/wwwroot/_framework/dotnet.runtime.dstopyvqzi.js +4 -0
- package/wwwroot/_framework/icudt_CJK.tjcz0u77k5.dat +0 -0
- package/wwwroot/_framework/icudt_EFIGS.tptq2av103.dat +0 -0
- package/wwwroot/_framework/icudt_no_CJK.lfu7j35m59.dat +0 -0
- package/wwwroot/_framework/netstandard.0xet7jg7ky.dll +0 -0
- package/wwwroot/_headers +40 -0
- package/wwwroot/_redirects +1 -0
- package/wwwroot/appsettings.json +71 -0
- package/wwwroot/icon-192.png +0 -0
- package/wwwroot/icon-512.png +0 -0
- package/wwwroot/index.html +710 -0
- package/wwwroot/js/marketing-tool.js +180 -0
- package/wwwroot/manifest.webmanifest +22 -0
- package/wwwroot/robots.txt +4 -0
- package/wwwroot/service-worker-assets.js +857 -0
- package/wwwroot/service-worker.js +33 -0
- package/wwwroot/sitemap.xml +27 -0
|
@@ -0,0 +1,594 @@
|
|
|
1
|
+
// MindMap Toolbar Helper Functions
|
|
2
|
+
(function () {
|
|
3
|
+
'use strict';
|
|
4
|
+
|
|
5
|
+
const dropdownOutsideCloseHandlers = new WeakMap();
|
|
6
|
+
const surfaceOutsideClickCloseStatesByHelper = new WeakMap();
|
|
7
|
+
const surfaceOutsideClickCloseStatesByRoot = new WeakMap();
|
|
8
|
+
let layoutDotNetHelper = null;
|
|
9
|
+
let fallbackReadModeActive = false;
|
|
10
|
+
let fullscreenEventsRegistered = false;
|
|
11
|
+
let visibilityEventsRegistered = false;
|
|
12
|
+
let surfaceInteractionEventsRegistered = false;
|
|
13
|
+
let documentHiddenAtUtc = null;
|
|
14
|
+
|
|
15
|
+
function supportsFullscreenApi() {
|
|
16
|
+
const root = document.documentElement;
|
|
17
|
+
return !!(
|
|
18
|
+
root?.requestFullscreen ||
|
|
19
|
+
root?.webkitRequestFullscreen ||
|
|
20
|
+
root?.msRequestFullscreen ||
|
|
21
|
+
document.exitFullscreen ||
|
|
22
|
+
document.webkitExitFullscreen ||
|
|
23
|
+
document.msExitFullscreen
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function getFullscreenElement() {
|
|
28
|
+
return document.fullscreenElement || document.webkitFullscreenElement || document.msFullscreenElement || null;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function getCurrentReadModeState() {
|
|
32
|
+
return supportsFullscreenApi() ? !!getFullscreenElement() : fallbackReadModeActive === true;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function notifyLayoutFullscreenChanged(isActive) {
|
|
36
|
+
layoutDotNetHelper?.invokeMethodAsync?.('OnMindCanvasFullscreenChanged', isActive === true)
|
|
37
|
+
?.catch?.(() => { });
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function ensureFullscreenListeners() {
|
|
41
|
+
if (fullscreenEventsRegistered) {
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const handler = () => {
|
|
46
|
+
if (supportsFullscreenApi()) {
|
|
47
|
+
fallbackReadModeActive = false;
|
|
48
|
+
}
|
|
49
|
+
notifyLayoutFullscreenChanged(getCurrentReadModeState());
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
document.addEventListener('fullscreenchange', handler);
|
|
53
|
+
document.addEventListener('webkitfullscreenchange', handler);
|
|
54
|
+
document.addEventListener('MSFullscreenChange', handler);
|
|
55
|
+
fullscreenEventsRegistered = true;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function notifyLayoutDocumentVisibilityChanged() {
|
|
59
|
+
if (!layoutDotNetHelper?.invokeMethodAsync) {
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const isVisible = document.visibilityState !== 'hidden';
|
|
64
|
+
const nowUtc = new Date().toISOString();
|
|
65
|
+
if (!isVisible) {
|
|
66
|
+
documentHiddenAtUtc = nowUtc;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const eventAtUtc = isVisible ? (documentHiddenAtUtc || nowUtc) : documentHiddenAtUtc;
|
|
70
|
+
layoutDotNetHelper.invokeMethodAsync('OnDocumentVisibilityChanged', isVisible, eventAtUtc)
|
|
71
|
+
.catch(() => { });
|
|
72
|
+
|
|
73
|
+
if (isVisible) {
|
|
74
|
+
documentHiddenAtUtc = null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function ensureDocumentVisibilityListeners() {
|
|
79
|
+
if (visibilityEventsRegistered) {
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
document.addEventListener('visibilitychange', notifyLayoutDocumentVisibilityChanged);
|
|
84
|
+
window.addEventListener('pageshow', notifyLayoutDocumentVisibilityChanged);
|
|
85
|
+
window.addEventListener('focus', () => {
|
|
86
|
+
if (document.visibilityState !== 'hidden') {
|
|
87
|
+
notifyLayoutDocumentVisibilityChanged();
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
visibilityEventsRegistered = true;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function notifyMindCanvasSurfaceInteraction(event) {
|
|
94
|
+
if (!layoutDotNetHelper?.invokeMethodAsync) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const reason = String(event?.detail?.reason || 'canvas-interaction');
|
|
99
|
+
layoutDotNetHelper.invokeMethodAsync('OnMindCanvasSurfaceInteraction', reason)
|
|
100
|
+
.catch(() => { });
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function ensureMindCanvasSurfaceInteractionListener() {
|
|
104
|
+
if (surfaceInteractionEventsRegistered) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
window.addEventListener('mindcanvas:surface-interaction', notifyMindCanvasSurfaceInteraction);
|
|
109
|
+
surfaceInteractionEventsRegistered = true;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function isEventInsideRoot(rootElement, event) {
|
|
113
|
+
if (!rootElement || !event) {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const path = typeof event.composedPath === 'function'
|
|
118
|
+
? event.composedPath()
|
|
119
|
+
: null;
|
|
120
|
+
if (Array.isArray(path) && path.includes(rootElement)) {
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const target = event.target;
|
|
125
|
+
return !!target && rootElement.contains(target);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function isEventInsideIgnoredSelector(ignoreSelector, event) {
|
|
129
|
+
if (!ignoreSelector || !event) {
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const path = typeof event.composedPath === 'function'
|
|
134
|
+
? event.composedPath()
|
|
135
|
+
: null;
|
|
136
|
+
if (Array.isArray(path)) {
|
|
137
|
+
for (const entry of path) {
|
|
138
|
+
if (entry && typeof entry.matches === 'function' && entry.matches(ignoreSelector)) {
|
|
139
|
+
return true;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
const target = event.target;
|
|
145
|
+
return !!target && typeof target.closest === 'function' && !!target.closest(ignoreSelector);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function isNativeSelectEvent(event) {
|
|
149
|
+
if (!event) {
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const path = typeof event.composedPath === 'function'
|
|
154
|
+
? event.composedPath()
|
|
155
|
+
: null;
|
|
156
|
+
if (Array.isArray(path)) {
|
|
157
|
+
for (const entry of path) {
|
|
158
|
+
const tagName = entry?.tagName;
|
|
159
|
+
if (tagName === 'SELECT' || tagName === 'OPTION' || tagName === 'OPTGROUP') {
|
|
160
|
+
return true;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
const tagName = event.target?.tagName;
|
|
166
|
+
return tagName === 'SELECT' || tagName === 'OPTION' || tagName === 'OPTGROUP';
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function getInteractionTime() {
|
|
170
|
+
return typeof performance !== 'undefined' && typeof performance.now === 'function'
|
|
171
|
+
? performance.now()
|
|
172
|
+
: Date.now();
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
function markNativeSelectInteraction(state) {
|
|
176
|
+
if (!state) {
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
state.nativeSelectInteractionActive = true;
|
|
181
|
+
state.nativeSelectInteractionAt = getInteractionTime();
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function isNativeSelectFocusedInside(rootElement) {
|
|
185
|
+
const activeElement = document.activeElement;
|
|
186
|
+
return !!rootElement &&
|
|
187
|
+
!!activeElement &&
|
|
188
|
+
rootElement.contains(activeElement) &&
|
|
189
|
+
activeElement.tagName === 'SELECT';
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function scheduleNativeSelectInteractionClear(state) {
|
|
193
|
+
if (!state) {
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
window.setTimeout(() => {
|
|
198
|
+
if (!isNativeSelectFocusedInside(state.rootElement)) {
|
|
199
|
+
state.nativeSelectInteractionActive = false;
|
|
200
|
+
}
|
|
201
|
+
}, 0);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function shouldIgnoreDocumentClickForNativeSelect(state) {
|
|
205
|
+
if (!state?.nativeSelectInteractionActive) {
|
|
206
|
+
return false;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
if (isNativeSelectFocusedInside(state.rootElement)) {
|
|
210
|
+
return true;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return getInteractionTime() - state.nativeSelectInteractionAt < 350;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function resolveSurfaceRootElement(rootElement, options) {
|
|
217
|
+
const selector = options?.rootSelector;
|
|
218
|
+
if (selector && typeof document.querySelector === 'function') {
|
|
219
|
+
const currentElement = document.querySelector(selector);
|
|
220
|
+
if (currentElement) {
|
|
221
|
+
return currentElement;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
return rootElement;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
function isPointerWithinElementBounds(element, event) {
|
|
229
|
+
if (!element || !event) {
|
|
230
|
+
return false;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const clientX = Number(event.clientX);
|
|
234
|
+
const clientY = Number(event.clientY);
|
|
235
|
+
if (!Number.isFinite(clientX) || !Number.isFinite(clientY)) {
|
|
236
|
+
return false;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
const rect = element.getBoundingClientRect?.();
|
|
240
|
+
if (!rect) {
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
return clientX >= rect.left &&
|
|
245
|
+
clientX <= rect.right &&
|
|
246
|
+
clientY >= rect.top &&
|
|
247
|
+
clientY <= rect.bottom;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function getUploadDropPosition(viewport) {
|
|
251
|
+
const fallbackRect = viewport.getBoundingClientRect();
|
|
252
|
+
const fallbackPosition = {
|
|
253
|
+
clientX: fallbackRect.left + (fallbackRect.width / 2),
|
|
254
|
+
clientY: fallbackRect.top + (fallbackRect.height / 2)
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
const cursorPosition = window.mindMap?.getCursorClientPosition?.();
|
|
258
|
+
if (!cursorPosition || !Number.isFinite(cursorPosition.clientX) || !Number.isFinite(cursorPosition.clientY)) {
|
|
259
|
+
return fallbackPosition;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
return cursorPosition;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
// Simulate a file drop event at the current cursor position
|
|
266
|
+
window.triggerMindMapFileUpload = function (inputElementId) {
|
|
267
|
+
const input = document.getElementById(inputElementId);
|
|
268
|
+
if (!input || !input.files || input.files.length === 0) {
|
|
269
|
+
console.warn('[MindMapToolbar] No file selected');
|
|
270
|
+
return false;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
const files = Array.from(input.files);
|
|
274
|
+
const dataTransfer = new DataTransfer();
|
|
275
|
+
files.forEach((file) => dataTransfer.items.add(file));
|
|
276
|
+
|
|
277
|
+
const viewport = document.getElementById('mind-map-viewport');
|
|
278
|
+
if (!viewport) {
|
|
279
|
+
console.error('[MindMapToolbar] Viewport not found');
|
|
280
|
+
return false;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
try {
|
|
284
|
+
const { clientX, clientY } = getUploadDropPosition(viewport);
|
|
285
|
+
const mockEvent = new DragEvent('drop', {
|
|
286
|
+
bubbles: true,
|
|
287
|
+
cancelable: true,
|
|
288
|
+
dataTransfer: dataTransfer
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
Object.defineProperty(mockEvent, 'clientX', {
|
|
292
|
+
value: clientX,
|
|
293
|
+
writable: false
|
|
294
|
+
});
|
|
295
|
+
Object.defineProperty(mockEvent, 'clientY', {
|
|
296
|
+
value: clientY,
|
|
297
|
+
writable: false
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
viewport.dispatchEvent(mockEvent);
|
|
301
|
+
console.log('[MindMapToolbar] File drop event triggered for:', files.map((file) => file.name));
|
|
302
|
+
|
|
303
|
+
// Reset file input so selecting the same file(s) again still fires change.
|
|
304
|
+
input.value = '';
|
|
305
|
+
return true;
|
|
306
|
+
} catch (error) {
|
|
307
|
+
console.error('[MindMapToolbar] Error triggering file drop:', error);
|
|
308
|
+
return false;
|
|
309
|
+
}
|
|
310
|
+
};
|
|
311
|
+
|
|
312
|
+
// Focus on the global textarea
|
|
313
|
+
window.focusGlobalTextarea = function () {
|
|
314
|
+
const textarea = document.getElementById('global-input-textarea');
|
|
315
|
+
if (textarea) {
|
|
316
|
+
textarea.focus();
|
|
317
|
+
return true;
|
|
318
|
+
}
|
|
319
|
+
return false;
|
|
320
|
+
};
|
|
321
|
+
|
|
322
|
+
window.setMindMapPageScrollLock = function (active) {
|
|
323
|
+
const shouldLock = active === true;
|
|
324
|
+
const html = document.documentElement;
|
|
325
|
+
const body = document.body;
|
|
326
|
+
|
|
327
|
+
html?.classList.toggle('mind-map-scroll-locked', shouldLock);
|
|
328
|
+
body?.classList.toggle('mind-map-scroll-locked', shouldLock);
|
|
329
|
+
|
|
330
|
+
if (shouldLock) {
|
|
331
|
+
if (html) {
|
|
332
|
+
html.scrollTop = 0;
|
|
333
|
+
html.scrollLeft = 0;
|
|
334
|
+
}
|
|
335
|
+
if (body) {
|
|
336
|
+
body.scrollTop = 0;
|
|
337
|
+
body.scrollLeft = 0;
|
|
338
|
+
}
|
|
339
|
+
window.scrollTo(0, 0);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
return shouldLock;
|
|
343
|
+
};
|
|
344
|
+
|
|
345
|
+
window.initMindCanvasLayout = function (helper) {
|
|
346
|
+
layoutDotNetHelper = helper || null;
|
|
347
|
+
ensureFullscreenListeners();
|
|
348
|
+
ensureDocumentVisibilityListeners();
|
|
349
|
+
ensureMindCanvasSurfaceInteractionListener();
|
|
350
|
+
notifyLayoutFullscreenChanged(getCurrentReadModeState());
|
|
351
|
+
notifyLayoutDocumentVisibilityChanged();
|
|
352
|
+
return true;
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
window.getMindCanvasFullscreenState = function () {
|
|
356
|
+
return getCurrentReadModeState();
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
window.setMindCanvasFullscreen = async function (enabled) {
|
|
360
|
+
const shouldEnable = enabled === true;
|
|
361
|
+
const root = document.documentElement;
|
|
362
|
+
if (!root) {
|
|
363
|
+
return false;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
if (!supportsFullscreenApi()) {
|
|
367
|
+
fallbackReadModeActive = shouldEnable;
|
|
368
|
+
notifyLayoutFullscreenChanged(fallbackReadModeActive);
|
|
369
|
+
return fallbackReadModeActive;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
try {
|
|
373
|
+
if (shouldEnable) {
|
|
374
|
+
if (!getFullscreenElement()) {
|
|
375
|
+
if (root.requestFullscreen) {
|
|
376
|
+
await root.requestFullscreen();
|
|
377
|
+
} else if (root.webkitRequestFullscreen) {
|
|
378
|
+
await root.webkitRequestFullscreen();
|
|
379
|
+
} else if (root.msRequestFullscreen) {
|
|
380
|
+
await root.msRequestFullscreen();
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
} else if (getFullscreenElement()) {
|
|
384
|
+
if (document.exitFullscreen) {
|
|
385
|
+
await document.exitFullscreen();
|
|
386
|
+
} else if (document.webkitExitFullscreen) {
|
|
387
|
+
await document.webkitExitFullscreen();
|
|
388
|
+
} else if (document.msExitFullscreen) {
|
|
389
|
+
await document.msExitFullscreen();
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
} catch (error) {
|
|
393
|
+
console.warn('[MindMapToolbar] Fullscreen toggle failed, falling back to read-mode only:', error);
|
|
394
|
+
fallbackReadModeActive = shouldEnable;
|
|
395
|
+
notifyLayoutFullscreenChanged(fallbackReadModeActive);
|
|
396
|
+
return fallbackReadModeActive;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
fallbackReadModeActive = false;
|
|
400
|
+
const nextState = getCurrentReadModeState();
|
|
401
|
+
notifyLayoutFullscreenChanged(nextState);
|
|
402
|
+
return nextState;
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
window.toggleMindCanvasReadMode = function () {
|
|
406
|
+
return window.setMindCanvasFullscreen(!getCurrentReadModeState());
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
window.registerDropdownOutsideClose = function (rootElement, helper) {
|
|
410
|
+
if (!rootElement || !helper) {
|
|
411
|
+
return false;
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
window.unregisterDropdownOutsideClose(rootElement);
|
|
415
|
+
|
|
416
|
+
const handler = (event) => {
|
|
417
|
+
const target = event.target;
|
|
418
|
+
if (!target || rootElement.contains(target)) {
|
|
419
|
+
return;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
helper.invokeMethodAsync('CloseFromOutsidePointer')
|
|
423
|
+
.catch(() => { });
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
document.addEventListener('pointerdown', handler, true);
|
|
427
|
+
dropdownOutsideCloseHandlers.set(rootElement, handler);
|
|
428
|
+
return true;
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
window.unregisterDropdownOutsideClose = function (rootElement) {
|
|
432
|
+
if (!rootElement) {
|
|
433
|
+
return false;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
const handler = dropdownOutsideCloseHandlers.get(rootElement);
|
|
437
|
+
if (!handler) {
|
|
438
|
+
return false;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
document.removeEventListener('pointerdown', handler, true);
|
|
442
|
+
dropdownOutsideCloseHandlers.delete(rootElement);
|
|
443
|
+
return true;
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
function detachSurfaceOutsideClickCloseState(state) {
|
|
447
|
+
if (!state) {
|
|
448
|
+
return false;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
if (state.rootElement && state.rootPointerDownHandler) {
|
|
452
|
+
state.rootElement.removeEventListener('pointerdown', state.rootPointerDownHandler, true);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
if (state.rootElement && state.rootClickHandler) {
|
|
456
|
+
state.rootElement.removeEventListener('click', state.rootClickHandler, true);
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
if (state.rootElement && state.rootChangeHandler) {
|
|
460
|
+
state.rootElement.removeEventListener('change', state.rootChangeHandler, true);
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
if (state.rootElement && state.rootFocusOutHandler) {
|
|
464
|
+
state.rootElement.removeEventListener('focusout', state.rootFocusOutHandler, true);
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
if (state.documentClickHandler) {
|
|
468
|
+
document.removeEventListener('click', state.documentClickHandler, false);
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
if (state.helper) {
|
|
472
|
+
surfaceOutsideClickCloseStatesByHelper.delete(state.helper);
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
if (state.rootElement) {
|
|
476
|
+
surfaceOutsideClickCloseStatesByRoot.delete(state.rootElement);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
return true;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
window.registerSurfaceOutsideClickClose = function (rootElement, helper, options) {
|
|
483
|
+
if (!rootElement || !helper) {
|
|
484
|
+
return false;
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
detachSurfaceOutsideClickCloseState(surfaceOutsideClickCloseStatesByHelper.get(helper));
|
|
488
|
+
detachSurfaceOutsideClickCloseState(surfaceOutsideClickCloseStatesByRoot.get(rootElement));
|
|
489
|
+
|
|
490
|
+
const state = {
|
|
491
|
+
helper,
|
|
492
|
+
options,
|
|
493
|
+
rootElement,
|
|
494
|
+
suppressNextDocumentClick: false,
|
|
495
|
+
nativeSelectInteractionActive: false,
|
|
496
|
+
nativeSelectInteractionAt: 0,
|
|
497
|
+
rootPointerDownHandler: null,
|
|
498
|
+
rootClickHandler: null,
|
|
499
|
+
rootChangeHandler: null,
|
|
500
|
+
rootFocusOutHandler: null,
|
|
501
|
+
documentClickHandler: null
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
state.rootPointerDownHandler = (event) => {
|
|
505
|
+
state.suppressNextDocumentClick = true;
|
|
506
|
+
if (isNativeSelectEvent(event)) {
|
|
507
|
+
markNativeSelectInteraction(state);
|
|
508
|
+
}
|
|
509
|
+
};
|
|
510
|
+
|
|
511
|
+
state.rootClickHandler = (event) => {
|
|
512
|
+
state.suppressNextDocumentClick = true;
|
|
513
|
+
if (isNativeSelectEvent(event)) {
|
|
514
|
+
markNativeSelectInteraction(state);
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
state.rootChangeHandler = (event) => {
|
|
519
|
+
if (isNativeSelectEvent(event)) {
|
|
520
|
+
state.suppressNextDocumentClick = true;
|
|
521
|
+
markNativeSelectInteraction(state);
|
|
522
|
+
}
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
state.rootFocusOutHandler = () => {
|
|
526
|
+
scheduleNativeSelectInteractionClear(state);
|
|
527
|
+
};
|
|
528
|
+
|
|
529
|
+
state.documentClickHandler = (event) => {
|
|
530
|
+
if (typeof event.button === 'number' && event.button !== 0) {
|
|
531
|
+
return;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
if (state.suppressNextDocumentClick) {
|
|
535
|
+
state.suppressNextDocumentClick = false;
|
|
536
|
+
return;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
const currentRootElement = resolveSurfaceRootElement(state.rootElement, state.options);
|
|
540
|
+
if (currentRootElement && currentRootElement !== state.rootElement) {
|
|
541
|
+
state.rootElement.removeEventListener('pointerdown', state.rootPointerDownHandler, true);
|
|
542
|
+
state.rootElement.removeEventListener('click', state.rootClickHandler, true);
|
|
543
|
+
state.rootElement.removeEventListener('change', state.rootChangeHandler, true);
|
|
544
|
+
state.rootElement.removeEventListener('focusout', state.rootFocusOutHandler, true);
|
|
545
|
+
surfaceOutsideClickCloseStatesByRoot.delete(state.rootElement);
|
|
546
|
+
state.rootElement = currentRootElement;
|
|
547
|
+
surfaceOutsideClickCloseStatesByRoot.set(state.rootElement, state);
|
|
548
|
+
state.rootElement.addEventListener('pointerdown', state.rootPointerDownHandler, true);
|
|
549
|
+
state.rootElement.addEventListener('click', state.rootClickHandler, true);
|
|
550
|
+
state.rootElement.addEventListener('change', state.rootChangeHandler, true);
|
|
551
|
+
state.rootElement.addEventListener('focusout', state.rootFocusOutHandler, true);
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
if (shouldIgnoreDocumentClickForNativeSelect(state)) {
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
if (isEventInsideRoot(currentRootElement, event)) {
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
if (isPointerWithinElementBounds(currentRootElement, event)) {
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
if (isEventInsideIgnoredSelector(state.options?.ignoreSelector, event)) {
|
|
567
|
+
return;
|
|
568
|
+
}
|
|
569
|
+
|
|
570
|
+
state.helper.invokeMethodAsync('CloseFromOutsidePointer')
|
|
571
|
+
.catch(() => { });
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
state.rootElement.addEventListener('pointerdown', state.rootPointerDownHandler, true);
|
|
575
|
+
state.rootElement.addEventListener('click', state.rootClickHandler, true);
|
|
576
|
+
state.rootElement.addEventListener('change', state.rootChangeHandler, true);
|
|
577
|
+
state.rootElement.addEventListener('focusout', state.rootFocusOutHandler, true);
|
|
578
|
+
document.addEventListener('click', state.documentClickHandler, false);
|
|
579
|
+
|
|
580
|
+
surfaceOutsideClickCloseStatesByHelper.set(helper, state);
|
|
581
|
+
surfaceOutsideClickCloseStatesByRoot.set(rootElement, state);
|
|
582
|
+
return true;
|
|
583
|
+
};
|
|
584
|
+
|
|
585
|
+
window.unregisterSurfaceOutsideClickClose = function (rootElement) {
|
|
586
|
+
if (!rootElement) {
|
|
587
|
+
return false;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
return detachSurfaceOutsideClickCloseState(surfaceOutsideClickCloseStatesByRoot.get(rootElement));
|
|
591
|
+
};
|
|
592
|
+
|
|
593
|
+
console.log('? mindmap-toolbar.js loaded');
|
|
594
|
+
})();
|