@fraziym/axoniz 0.1.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/LICENSE +21 -0
- package/README.md +76 -0
- package/dist/agents/definition.d.ts +15 -0
- package/dist/agents/definition.d.ts.map +1 -0
- package/dist/agents/definition.js +41 -0
- package/dist/agents/definition.js.map +1 -0
- package/dist/agents/index.d.ts +12 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +11 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/agents/registry.d.ts +17 -0
- package/dist/agents/registry.d.ts.map +1 -0
- package/dist/agents/registry.js +23 -0
- package/dist/agents/registry.js.map +1 -0
- package/dist/agents/specialized.d.ts +31 -0
- package/dist/agents/specialized.d.ts.map +1 -0
- package/dist/agents/specialized.js +75 -0
- package/dist/agents/specialized.js.map +1 -0
- package/dist/awareness/index.d.ts +14 -0
- package/dist/awareness/index.d.ts.map +1 -0
- package/dist/awareness/index.js +22 -0
- package/dist/awareness/index.js.map +1 -0
- package/dist/awareness/service.d.ts +180 -0
- package/dist/awareness/service.d.ts.map +1 -0
- package/dist/awareness/service.js +789 -0
- package/dist/awareness/service.js.map +1 -0
- package/dist/cli/entry.d.ts +13 -0
- package/dist/cli/entry.d.ts.map +1 -0
- package/dist/cli/entry.js +35 -0
- package/dist/cli/entry.js.map +1 -0
- package/dist/comms/telegram.d.ts +41 -0
- package/dist/comms/telegram.d.ts.map +1 -0
- package/dist/comms/telegram.js +332 -0
- package/dist/comms/telegram.js.map +1 -0
- package/dist/core/agent.d.ts +252 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js +1399 -0
- package/dist/core/agent.js.map +1 -0
- package/dist/core/auth.d.ts +23 -0
- package/dist/core/auth.d.ts.map +1 -0
- package/dist/core/auth.js +113 -0
- package/dist/core/auth.js.map +1 -0
- package/dist/core/authority.d.ts +118 -0
- package/dist/core/authority.d.ts.map +1 -0
- package/dist/core/authority.js +402 -0
- package/dist/core/authority.js.map +1 -0
- package/dist/core/backend/async_queue.d.ts +17 -0
- package/dist/core/backend/async_queue.d.ts.map +1 -0
- package/dist/core/backend/async_queue.js +66 -0
- package/dist/core/backend/async_queue.js.map +1 -0
- package/dist/core/backend/index.d.ts +24 -0
- package/dist/core/backend/index.d.ts.map +1 -0
- package/dist/core/backend/index.js +128 -0
- package/dist/core/backend/index.js.map +1 -0
- package/dist/core/backend/llama_server.d.ts +39 -0
- package/dist/core/backend/llama_server.d.ts.map +1 -0
- package/dist/core/backend/llama_server.js +182 -0
- package/dist/core/backend/llama_server.js.map +1 -0
- package/dist/core/backend/llamacpp.d.ts +40 -0
- package/dist/core/backend/llamacpp.d.ts.map +1 -0
- package/dist/core/backend/llamacpp.js +200 -0
- package/dist/core/backend/llamacpp.js.map +1 -0
- package/dist/core/backend/lmstudio.d.ts +53 -0
- package/dist/core/backend/lmstudio.d.ts.map +1 -0
- package/dist/core/backend/lmstudio.js +274 -0
- package/dist/core/backend/lmstudio.js.map +1 -0
- package/dist/core/backend/ollama.d.ts +25 -0
- package/dist/core/backend/ollama.d.ts.map +1 -0
- package/dist/core/backend/ollama.js +86 -0
- package/dist/core/backend/ollama.js.map +1 -0
- package/dist/core/backend/openai.d.ts +27 -0
- package/dist/core/backend/openai.d.ts.map +1 -0
- package/dist/core/backend/openai.js +84 -0
- package/dist/core/backend/openai.js.map +1 -0
- package/dist/core/backend/types.d.ts +73 -0
- package/dist/core/backend/types.d.ts.map +1 -0
- package/dist/core/backend/types.js +137 -0
- package/dist/core/backend/types.js.map +1 -0
- package/dist/core/chat_store.d.ts +77 -0
- package/dist/core/chat_store.d.ts.map +1 -0
- package/dist/core/chat_store.js +332 -0
- package/dist/core/chat_store.js.map +1 -0
- package/dist/core/cli.d.ts +82 -0
- package/dist/core/cli.d.ts.map +1 -0
- package/dist/core/cli.js +602 -0
- package/dist/core/cli.js.map +1 -0
- package/dist/core/config.d.ts +127 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +295 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/debug.d.ts +8 -0
- package/dist/core/debug.d.ts.map +1 -0
- package/dist/core/debug.js +8 -0
- package/dist/core/debug.js.map +1 -0
- package/dist/core/downloader.d.ts +31 -0
- package/dist/core/downloader.d.ts.map +1 -0
- package/dist/core/downloader.js +180 -0
- package/dist/core/downloader.js.map +1 -0
- package/dist/core/errors.d.ts +80 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +134 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/extras.d.ts +160 -0
- package/dist/core/extras.d.ts.map +1 -0
- package/dist/core/extras.js +553 -0
- package/dist/core/extras.js.map +1 -0
- package/dist/core/health.d.ts +27 -0
- package/dist/core/health.d.ts.map +1 -0
- package/dist/core/health.js +96 -0
- package/dist/core/health.js.map +1 -0
- package/dist/core/history.d.ts +50 -0
- package/dist/core/history.d.ts.map +1 -0
- package/dist/core/history.js +276 -0
- package/dist/core/history.js.map +1 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +6 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/intelligence/ast_index.d.ts +255 -0
- package/dist/core/intelligence/ast_index.d.ts.map +1 -0
- package/dist/core/intelligence/ast_index.js +1369 -0
- package/dist/core/intelligence/ast_index.js.map +1 -0
- package/dist/core/intelligence/confidence.d.ts +113 -0
- package/dist/core/intelligence/confidence.d.ts.map +1 -0
- package/dist/core/intelligence/confidence.js +298 -0
- package/dist/core/intelligence/confidence.js.map +1 -0
- package/dist/core/intelligence/context_compressor.d.ts +80 -0
- package/dist/core/intelligence/context_compressor.d.ts.map +1 -0
- package/dist/core/intelligence/context_compressor.js +245 -0
- package/dist/core/intelligence/context_compressor.js.map +1 -0
- package/dist/core/intelligence/daemon.d.ts +247 -0
- package/dist/core/intelligence/daemon.d.ts.map +1 -0
- package/dist/core/intelligence/daemon.js +842 -0
- package/dist/core/intelligence/daemon.js.map +1 -0
- package/dist/core/intelligence/index.d.ts +60 -0
- package/dist/core/intelligence/index.d.ts.map +1 -0
- package/dist/core/intelligence/index.js +101 -0
- package/dist/core/intelligence/index.js.map +1 -0
- package/dist/core/intelligence/predictor.d.ts +246 -0
- package/dist/core/intelligence/predictor.d.ts.map +1 -0
- package/dist/core/intelligence/predictor.js +590 -0
- package/dist/core/intelligence/predictor.js.map +1 -0
- package/dist/core/intelligence/reflex.d.ts +84 -0
- package/dist/core/intelligence/reflex.d.ts.map +1 -0
- package/dist/core/intelligence/reflex.js +344 -0
- package/dist/core/intelligence/reflex.js.map +1 -0
- package/dist/core/intelligence/self_correction.d.ts +121 -0
- package/dist/core/intelligence/self_correction.d.ts.map +1 -0
- package/dist/core/intelligence/self_correction.js +327 -0
- package/dist/core/intelligence/self_correction.js.map +1 -0
- package/dist/core/intelligence/skill_distiller.d.ts +100 -0
- package/dist/core/intelligence/skill_distiller.d.ts.map +1 -0
- package/dist/core/intelligence/skill_distiller.js +246 -0
- package/dist/core/intelligence/skill_distiller.js.map +1 -0
- package/dist/core/intelligence/swarm.d.ts +330 -0
- package/dist/core/intelligence/swarm.d.ts.map +1 -0
- package/dist/core/intelligence/swarm.js +1064 -0
- package/dist/core/intelligence/swarm.js.map +1 -0
- package/dist/core/intelligence/trajectory.d.ts +107 -0
- package/dist/core/intelligence/trajectory.d.ts.map +1 -0
- package/dist/core/intelligence/trajectory.js +330 -0
- package/dist/core/intelligence/trajectory.js.map +1 -0
- package/dist/core/logger.d.ts +111 -0
- package/dist/core/logger.d.ts.map +1 -0
- package/dist/core/logger.js +640 -0
- package/dist/core/logger.js.map +1 -0
- package/dist/core/loop.d.ts +123 -0
- package/dist/core/loop.d.ts.map +1 -0
- package/dist/core/loop.js +423 -0
- package/dist/core/loop.js.map +1 -0
- package/dist/core/memory.d.ts +81 -0
- package/dist/core/memory.d.ts.map +1 -0
- package/dist/core/memory.js +328 -0
- package/dist/core/memory.js.map +1 -0
- package/dist/core/metrics.d.ts +29 -0
- package/dist/core/metrics.d.ts.map +1 -0
- package/dist/core/metrics.js +109 -0
- package/dist/core/metrics.js.map +1 -0
- package/dist/core/models.d.ts +51 -0
- package/dist/core/models.d.ts.map +1 -0
- package/dist/core/models.js +146 -0
- package/dist/core/models.js.map +1 -0
- package/dist/core/optimizer.d.ts +34 -0
- package/dist/core/optimizer.d.ts.map +1 -0
- package/dist/core/optimizer.js +131 -0
- package/dist/core/optimizer.js.map +1 -0
- package/dist/core/persona.d.ts +35 -0
- package/dist/core/persona.d.ts.map +1 -0
- package/dist/core/persona.js +126 -0
- package/dist/core/persona.js.map +1 -0
- package/dist/core/rate_limit.d.ts +23 -0
- package/dist/core/rate_limit.d.ts.map +1 -0
- package/dist/core/rate_limit.js +62 -0
- package/dist/core/rate_limit.js.map +1 -0
- package/dist/core/runner.d.ts +63 -0
- package/dist/core/runner.d.ts.map +1 -0
- package/dist/core/runner.js +671 -0
- package/dist/core/runner.js.map +1 -0
- package/dist/core/stream_parser.d.ts +43 -0
- package/dist/core/stream_parser.d.ts.map +1 -0
- package/dist/core/stream_parser.js +140 -0
- package/dist/core/stream_parser.js.map +1 -0
- package/dist/core/tool_schemas.d.ts +26 -0
- package/dist/core/tool_schemas.d.ts.map +1 -0
- package/dist/core/tool_schemas.js +124 -0
- package/dist/core/tool_schemas.js.map +1 -0
- package/dist/core/which.d.ts +2 -0
- package/dist/core/which.d.ts.map +1 -0
- package/dist/core/which.js +35 -0
- package/dist/core/which.js.map +1 -0
- package/dist/goals/index.d.ts +9 -0
- package/dist/goals/index.d.ts.map +1 -0
- package/dist/goals/index.js +17 -0
- package/dist/goals/index.js.map +1 -0
- package/dist/goals/service.d.ts +115 -0
- package/dist/goals/service.d.ts.map +1 -0
- package/dist/goals/service.js +415 -0
- package/dist/goals/service.js.map +1 -0
- package/dist/goals/types.d.ts +47 -0
- package/dist/goals/types.d.ts.map +1 -0
- package/dist/goals/types.js +66 -0
- package/dist/goals/types.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/integrations/autonomous_startup.d.ts +51 -0
- package/dist/integrations/autonomous_startup.d.ts.map +1 -0
- package/dist/integrations/autonomous_startup.js +419 -0
- package/dist/integrations/autonomous_startup.js.map +1 -0
- package/dist/integrations/goose.d.ts +105 -0
- package/dist/integrations/goose.d.ts.map +1 -0
- package/dist/integrations/goose.js +408 -0
- package/dist/integrations/goose.js.map +1 -0
- package/dist/integrations/index.d.ts +21 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +17 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/integrations/mcp.d.ts +73 -0
- package/dist/integrations/mcp.d.ts.map +1 -0
- package/dist/integrations/mcp.js +307 -0
- package/dist/integrations/mcp.js.map +1 -0
- package/dist/integrations/mempalace.d.ts +18 -0
- package/dist/integrations/mempalace.d.ts.map +1 -0
- package/dist/integrations/mempalace.js +25 -0
- package/dist/integrations/mempalace.js.map +1 -0
- package/dist/integrations/multi_agent.d.ts +82 -0
- package/dist/integrations/multi_agent.d.ts.map +1 -0
- package/dist/integrations/multi_agent.js +280 -0
- package/dist/integrations/multi_agent.js.map +1 -0
- package/dist/integrations/unified_memory.d.ts +415 -0
- package/dist/integrations/unified_memory.d.ts.map +1 -0
- package/dist/integrations/unified_memory.js +1489 -0
- package/dist/integrations/unified_memory.js.map +1 -0
- package/dist/roles/beru.yaml +48 -0
- package/dist/sidecar/client.d.ts +63 -0
- package/dist/sidecar/client.d.ts.map +1 -0
- package/dist/sidecar/client.js +222 -0
- package/dist/sidecar/client.js.map +1 -0
- package/dist/sidecar/index.d.ts +7 -0
- package/dist/sidecar/index.d.ts.map +1 -0
- package/dist/sidecar/index.js +6 -0
- package/dist/sidecar/index.js.map +1 -0
- package/dist/startup.d.ts +22 -0
- package/dist/startup.d.ts.map +1 -0
- package/dist/startup.js +194 -0
- package/dist/startup.js.map +1 -0
- package/dist/tools/_internal.d.ts +90 -0
- package/dist/tools/_internal.d.ts.map +1 -0
- package/dist/tools/_internal.js +375 -0
- package/dist/tools/_internal.js.map +1 -0
- package/dist/tools/_smoke.d.ts +2 -0
- package/dist/tools/_smoke.d.ts.map +1 -0
- package/dist/tools/_smoke.js +203 -0
- package/dist/tools/_smoke.js.map +1 -0
- package/dist/tools/axodex_tools.d.ts +51 -0
- package/dist/tools/axodex_tools.d.ts.map +1 -0
- package/dist/tools/axodex_tools.js +181 -0
- package/dist/tools/axodex_tools.js.map +1 -0
- package/dist/tools/code_tools.d.ts +33 -0
- package/dist/tools/code_tools.d.ts.map +1 -0
- package/dist/tools/code_tools.js +191 -0
- package/dist/tools/code_tools.js.map +1 -0
- package/dist/tools/computer_tools.d.ts +59 -0
- package/dist/tools/computer_tools.d.ts.map +1 -0
- package/dist/tools/computer_tools.js +348 -0
- package/dist/tools/computer_tools.js.map +1 -0
- package/dist/tools/file_tools.d.ts +51 -0
- package/dist/tools/file_tools.d.ts.map +1 -0
- package/dist/tools/file_tools.js +424 -0
- package/dist/tools/file_tools.js.map +1 -0
- package/dist/tools/index.d.ts +13 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +13 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/shell_tools.d.ts +39 -0
- package/dist/tools/shell_tools.d.ts.map +1 -0
- package/dist/tools/shell_tools.js +163 -0
- package/dist/tools/shell_tools.js.map +1 -0
- package/dist/tools/web_tools.d.ts +31 -0
- package/dist/tools/web_tools.d.ts.map +1 -0
- package/dist/tools/web_tools.js +117 -0
- package/dist/tools/web_tools.js.map +1 -0
- package/dist/voice/index.d.ts +41 -0
- package/dist/voice/index.d.ts.map +1 -0
- package/dist/voice/index.js +58 -0
- package/dist/voice/index.js.map +1 -0
- package/dist/voice/light_daemon.d.ts +197 -0
- package/dist/voice/light_daemon.d.ts.map +1 -0
- package/dist/voice/light_daemon.js +746 -0
- package/dist/voice/light_daemon.js.map +1 -0
- package/dist/voice/setup.d.ts +63 -0
- package/dist/voice/setup.d.ts.map +1 -0
- package/dist/voice/setup.js +443 -0
- package/dist/voice/setup.js.map +1 -0
- package/dist/voice/stt.d.ts +148 -0
- package/dist/voice/stt.d.ts.map +1 -0
- package/dist/voice/stt.js +361 -0
- package/dist/voice/stt.js.map +1 -0
- package/dist/voice/tts.d.ts +168 -0
- package/dist/voice/tts.d.ts.map +1 -0
- package/dist/voice/tts.js +698 -0
- package/dist/voice/tts.js.map +1 -0
- package/dist/voice/voice_loop.d.ts +101 -0
- package/dist/voice/voice_loop.d.ts.map +1 -0
- package/dist/voice/voice_loop.js +463 -0
- package/dist/voice/voice_loop.js.map +1 -0
- package/dist/voice/wake_word.d.ts +153 -0
- package/dist/voice/wake_word.d.ts.map +1 -0
- package/dist/voice/wake_word.js +458 -0
- package/dist/voice/wake_word.js.map +1 -0
- package/dist/voice/wav.d.ts +99 -0
- package/dist/voice/wav.d.ts.map +1 -0
- package/dist/voice/wav.js +306 -0
- package/dist/voice/wav.js.map +1 -0
- package/dist/web/broker.d.ts +33 -0
- package/dist/web/broker.d.ts.map +1 -0
- package/dist/web/broker.js +58 -0
- package/dist/web/broker.js.map +1 -0
- package/dist/web/open_browser.d.ts +2 -0
- package/dist/web/open_browser.d.ts.map +1 -0
- package/dist/web/open_browser.js +42 -0
- package/dist/web/open_browser.js.map +1 -0
- package/dist/web/server.d.ts +54 -0
- package/dist/web/server.d.ts.map +1 -0
- package/dist/web/server.js +831 -0
- package/dist/web/server.js.map +1 -0
- package/dist/web/static/app.js +4121 -0
- package/dist/web/static/index.html +2281 -0
- package/dist/web/static/js/MODULE_SUMMARY.md +124 -0
- package/dist/web/static/js/a11y.js +165 -0
- package/dist/web/static/js/admin.js +2145 -0
- package/dist/web/static/js/assistant.js +475 -0
- package/dist/web/static/js/calendar/reminders.js +114 -0
- package/dist/web/static/js/calendar/utils.js +166 -0
- package/dist/web/static/js/calendar.js +3348 -0
- package/dist/web/static/js/censor.js +356 -0
- package/dist/web/static/js/chat.js +4546 -0
- package/dist/web/static/js/chatRenderer.js +2294 -0
- package/dist/web/static/js/chatStream.js +276 -0
- package/dist/web/static/js/codeRunner.js +398 -0
- package/dist/web/static/js/color/hex.js +14 -0
- package/dist/web/static/js/colorPicker.js +453 -0
- package/dist/web/static/js/compare/icons.js +77 -0
- package/dist/web/static/js/compare/index.js +1482 -0
- package/dist/web/static/js/compare/models.js +104 -0
- package/dist/web/static/js/compare/panes.js +817 -0
- package/dist/web/static/js/compare/probe.js +78 -0
- package/dist/web/static/js/compare/scoreboard.js +223 -0
- package/dist/web/static/js/compare/selector.js +1335 -0
- package/dist/web/static/js/compare/state.js +58 -0
- package/dist/web/static/js/compare/stream.js +695 -0
- package/dist/web/static/js/compare/vote.js +254 -0
- package/dist/web/static/js/cookbook-diagnosis.js +694 -0
- package/dist/web/static/js/cookbook-hwfit.js +1888 -0
- package/dist/web/static/js/cookbook.js +2093 -0
- package/dist/web/static/js/cookbookDownload.js +633 -0
- package/dist/web/static/js/cookbookProgressSignal.js +29 -0
- package/dist/web/static/js/cookbookRunning.js +3506 -0
- package/dist/web/static/js/cookbookServe.js +2128 -0
- package/dist/web/static/js/document.js +9731 -0
- package/dist/web/static/js/documentLibrary.js +3376 -0
- package/dist/web/static/js/dragSort.js +265 -0
- package/dist/web/static/js/editor/ai-inpaint.js +374 -0
- package/dist/web/static/js/editor/ai-models.js +273 -0
- package/dist/web/static/js/editor/ai-rembg.js +230 -0
- package/dist/web/static/js/editor/ai-tool-runner.js +147 -0
- package/dist/web/static/js/editor/ai-tools-misc.js +216 -0
- package/dist/web/static/js/editor/build/controls.js +366 -0
- package/dist/web/static/js/editor/build/popups.js +112 -0
- package/dist/web/static/js/editor/build/right-panel.js +200 -0
- package/dist/web/static/js/editor/build/toolbar.js +73 -0
- package/dist/web/static/js/editor/build/topbar.js +131 -0
- package/dist/web/static/js/editor/build/transform-popup.js +109 -0
- package/dist/web/static/js/editor/canvas-coords.js +21 -0
- package/dist/web/static/js/editor/canvas-events.js +197 -0
- package/dist/web/static/js/editor/canvas-transforms.js +132 -0
- package/dist/web/static/js/editor/checkerboard.js +24 -0
- package/dist/web/static/js/editor/clipboard-and-drop.js +133 -0
- package/dist/web/static/js/editor/composite-helpers.js +83 -0
- package/dist/web/static/js/editor/filters/blur.js +118 -0
- package/dist/web/static/js/editor/filters/edge-feather.js +70 -0
- package/dist/web/static/js/editor/fx/adj-popup.js +677 -0
- package/dist/web/static/js/editor/fx/filter-string.js +38 -0
- package/dist/web/static/js/editor/fx/histogram.js +67 -0
- package/dist/web/static/js/editor/fx/pixel-pass.js +249 -0
- package/dist/web/static/js/editor/harmonize-masks.js +116 -0
- package/dist/web/static/js/editor/history-panel.js +176 -0
- package/dist/web/static/js/editor/keyboard-shortcuts.js +271 -0
- package/dist/web/static/js/editor/layer-helpers.js +131 -0
- package/dist/web/static/js/editor/layer-panel.js +600 -0
- package/dist/web/static/js/editor/mask-utils.js +91 -0
- package/dist/web/static/js/editor/shortcuts-popover.js +149 -0
- package/dist/web/static/js/editor/slider-ux.js +191 -0
- package/dist/web/static/js/editor/snap.js +107 -0
- package/dist/web/static/js/editor/state.js +257 -0
- package/dist/web/static/js/editor/stroke-pipeline.js +162 -0
- package/dist/web/static/js/editor/stroke-tool-sliders.js +64 -0
- package/dist/web/static/js/editor/tools/clone.js +81 -0
- package/dist/web/static/js/editor/tools/crop.js +137 -0
- package/dist/web/static/js/editor/tools/flood-fill.js +72 -0
- package/dist/web/static/js/editor/tools/lasso-mask.js +171 -0
- package/dist/web/static/js/editor/tools/lasso.js +65 -0
- package/dist/web/static/js/editor/tools/move.js +79 -0
- package/dist/web/static/js/editor/tools/stroke.js +123 -0
- package/dist/web/static/js/editor/tools/transform-drag.js +174 -0
- package/dist/web/static/js/editor/tools/transform-handles.js +271 -0
- package/dist/web/static/js/editor/tools/transform-session.js +381 -0
- package/dist/web/static/js/editor/tools/wand.js +46 -0
- package/dist/web/static/js/editor/wire-import.js +148 -0
- package/dist/web/static/js/editor/wire-inpaint-controls.js +164 -0
- package/dist/web/static/js/editor/wire-merge-buttons.js +103 -0
- package/dist/web/static/js/editor/wire-selection-controls.js +170 -0
- package/dist/web/static/js/editor/wire-topbar-menus.js +174 -0
- package/dist/web/static/js/editor/wire-topbar-overflow.js +49 -0
- package/dist/web/static/js/editor/wire-topbar.js +188 -0
- package/dist/web/static/js/emailInbox.js +1245 -0
- package/dist/web/static/js/emailLibrary/replyRecipients.js +27 -0
- package/dist/web/static/js/emailLibrary/signatureFold.js +339 -0
- package/dist/web/static/js/emailLibrary/state.js +34 -0
- package/dist/web/static/js/emailLibrary/utils.js +202 -0
- package/dist/web/static/js/emailLibrary.js +5217 -0
- package/dist/web/static/js/emojiPicker.js +311 -0
- package/dist/web/static/js/escMenuStack.js +102 -0
- package/dist/web/static/js/fileHandler.js +295 -0
- package/dist/web/static/js/gallery.js +2835 -0
- package/dist/web/static/js/galleryEditor.js +3798 -0
- package/dist/web/static/js/group.js +955 -0
- package/dist/web/static/js/init.js +405 -0
- package/dist/web/static/js/keyboard-shortcuts.js +292 -0
- package/dist/web/static/js/langIcons.js +187 -0
- package/dist/web/static/js/markdown/tableRow.js +19 -0
- package/dist/web/static/js/markdown.js +806 -0
- package/dist/web/static/js/memory.js +1418 -0
- package/dist/web/static/js/modalManager.js +1552 -0
- package/dist/web/static/js/modalSnap.js +782 -0
- package/dist/web/static/js/model/matchKey.js +19 -0
- package/dist/web/static/js/modelPicker.js +695 -0
- package/dist/web/static/js/modelSort.js +33 -0
- package/dist/web/static/js/models.js +642 -0
- package/dist/web/static/js/notes.js +5054 -0
- package/dist/web/static/js/package.json +1 -0
- package/dist/web/static/js/platform.js +47 -0
- package/dist/web/static/js/presets.js +1110 -0
- package/dist/web/static/js/providers.js +93 -0
- package/dist/web/static/js/rag.js +177 -0
- package/dist/web/static/js/research/jobs.js +335 -0
- package/dist/web/static/js/research/panel.js +1233 -0
- package/dist/web/static/js/researchSynapse.js +225 -0
- package/dist/web/static/js/search-chat.js +201 -0
- package/dist/web/static/js/search.js +52 -0
- package/dist/web/static/js/section-management.js +260 -0
- package/dist/web/static/js/sessions.js +3108 -0
- package/dist/web/static/js/settings.js +4991 -0
- package/dist/web/static/js/sidebar-layout.js +573 -0
- package/dist/web/static/js/signature.js +504 -0
- package/dist/web/static/js/skills.js +1908 -0
- package/dist/web/static/js/slashAutocomplete.js +267 -0
- package/dist/web/static/js/slashCommands.js +6099 -0
- package/dist/web/static/js/spinner.js +406 -0
- package/dist/web/static/js/storage.js +123 -0
- package/dist/web/static/js/tasks.js +2699 -0
- package/dist/web/static/js/theme.js +2086 -0
- package/dist/web/static/js/tileManager.js +386 -0
- package/dist/web/static/js/tourAutoplay.js +133 -0
- package/dist/web/static/js/tourHints.js +179 -0
- package/dist/web/static/js/tts-ai.js +521 -0
- package/dist/web/static/js/ui.js +1288 -0
- package/dist/web/static/js/util/ordinal.js +13 -0
- package/dist/web/static/js/voiceRecorder.js +283 -0
- package/dist/web/static/js/windowDrag.js +326 -0
- package/dist/web/static/js/windowResize.js +233 -0
- package/dist/web/static/landing.html +824 -0
- package/dist/web/static/lib/docx.umd.min.js +20116 -0
- package/dist/web/static/lib/highlight.min.js +1213 -0
- package/dist/web/static/lib/html2pdf.bundle.min.js +3 -0
- package/dist/web/static/lib/mammoth.browser.min.js +21 -0
- package/dist/web/static/lib/qrcode.min.js +8 -0
- package/dist/web/static/lib/xlsx.full.min.js +24 -0
- package/dist/web/static/login.html +582 -0
- package/dist/web/static/manifest.json +15 -0
- package/dist/web/static/style.css +35733 -0
- package/dist/web/static/sw.js +144 -0
- package/dist/workflows/engine.d.ts +162 -0
- package/dist/workflows/engine.d.ts.map +1 -0
- package/dist/workflows/engine.js +625 -0
- package/dist/workflows/engine.js.map +1 -0
- package/dist/workflows/index.d.ts +8 -0
- package/dist/workflows/index.d.ts.map +1 -0
- package/dist/workflows/index.js +14 -0
- package/dist/workflows/index.js.map +1 -0
- package/package.json +112 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mask-canvas helpers used by the inpaint pipeline.
|
|
3
|
+
*
|
|
4
|
+
* Pure utility functions — they take a canvas (or layer-shape) as
|
|
5
|
+
* input and return a fresh canvas, with no module-level state.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Dilate (positive `px`) or erode (negative `px`) a binary alpha mask.
|
|
10
|
+
*
|
|
11
|
+
* Strategy: blur the source by `|px|`, then re-threshold the result.
|
|
12
|
+
* - Dilation keeps anything with non-trivial blurred alpha (low cutoff).
|
|
13
|
+
* - Erosion keeps only pixels that retained near-full alpha after blur.
|
|
14
|
+
*
|
|
15
|
+
* @param {HTMLCanvasElement} src Source mask canvas.
|
|
16
|
+
* @param {number} px Pixels to dilate (>0) or erode (<0). 0 = copy.
|
|
17
|
+
* @returns {HTMLCanvasElement} Fresh canvas with the same dimensions.
|
|
18
|
+
*/
|
|
19
|
+
export function dilateMask(src, px) {
|
|
20
|
+
const w = src.width, h = src.height;
|
|
21
|
+
const tmp = document.createElement('canvas');
|
|
22
|
+
tmp.width = w; tmp.height = h;
|
|
23
|
+
const ctx = tmp.getContext('2d');
|
|
24
|
+
if (px === 0) {
|
|
25
|
+
ctx.drawImage(src, 0, 0);
|
|
26
|
+
return tmp;
|
|
27
|
+
}
|
|
28
|
+
const dilate = px > 0;
|
|
29
|
+
const radius = Math.abs(px);
|
|
30
|
+
ctx.filter = `blur(${radius}px)`;
|
|
31
|
+
ctx.drawImage(src, 0, 0);
|
|
32
|
+
ctx.filter = 'none';
|
|
33
|
+
const img = ctx.getImageData(0, 0, w, h);
|
|
34
|
+
const threshold = dilate ? 8 : 247;
|
|
35
|
+
for (let i = 0; i < img.data.length; i += 4) {
|
|
36
|
+
const a = img.data[i + 3];
|
|
37
|
+
const keep = dilate ? a > threshold : a >= threshold;
|
|
38
|
+
if (keep) {
|
|
39
|
+
img.data[i] = img.data[i + 1] = img.data[i + 2] = 255;
|
|
40
|
+
img.data[i + 3] = 255;
|
|
41
|
+
} else {
|
|
42
|
+
img.data[i + 3] = 0;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
ctx.putImageData(img, 0, 0);
|
|
46
|
+
return tmp;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Re-derive an inpaint-result layer's alpha from its cached AI image +
|
|
52
|
+
* the hard mask, applying a feather + optional dilate/erode of the
|
|
53
|
+
* boundary. Mutates `layer.canvas` in place via `layer.ctx`.
|
|
54
|
+
*
|
|
55
|
+
* The layer must carry an `inpaintSource = { ai, mask }` cache from the
|
|
56
|
+
* original inpaint call so we can re-shape the alpha cheaply (no
|
|
57
|
+
* second model call required).
|
|
58
|
+
*
|
|
59
|
+
* @param {{canvas: HTMLCanvasElement, ctx: CanvasRenderingContext2D,
|
|
60
|
+
* inpaintSource?: {ai: CanvasImageSource, mask: HTMLCanvasElement}}} layer
|
|
61
|
+
* @param {number} featherPx Gaussian blur radius applied to the mask alpha.
|
|
62
|
+
* @param {number} [edgeShiftPx] Dilate (+) or erode (-) the mask before blurring.
|
|
63
|
+
*/
|
|
64
|
+
export function applyInpaintFeather(layer, featherPx, edgeShiftPx = 0) {
|
|
65
|
+
if (!layer || !layer.inpaintSource) return;
|
|
66
|
+
const { ai, mask } = layer.inpaintSource;
|
|
67
|
+
const w = layer.canvas.width;
|
|
68
|
+
const h = layer.canvas.height;
|
|
69
|
+
// 1) Optional dilate/erode, then optional blur, into a fresh mask.
|
|
70
|
+
let shaped = mask;
|
|
71
|
+
if (edgeShiftPx !== 0) shaped = dilateMask(mask, edgeShiftPx);
|
|
72
|
+
const softMask = document.createElement('canvas');
|
|
73
|
+
softMask.width = w; softMask.height = h;
|
|
74
|
+
const smCtx = softMask.getContext('2d');
|
|
75
|
+
if (featherPx > 0) {
|
|
76
|
+
smCtx.filter = `blur(${featherPx}px)`;
|
|
77
|
+
smCtx.drawImage(shaped, 0, 0, w, h);
|
|
78
|
+
smCtx.filter = 'none';
|
|
79
|
+
} else {
|
|
80
|
+
smCtx.drawImage(shaped, 0, 0, w, h);
|
|
81
|
+
}
|
|
82
|
+
// 2) Draw the AI image fresh, then multiply alpha by the soft mask.
|
|
83
|
+
const ctx = layer.ctx;
|
|
84
|
+
ctx.save();
|
|
85
|
+
ctx.globalCompositeOperation = 'source-over';
|
|
86
|
+
ctx.clearRect(0, 0, w, h);
|
|
87
|
+
ctx.drawImage(ai, 0, 0);
|
|
88
|
+
ctx.globalCompositeOperation = 'destination-in';
|
|
89
|
+
ctx.drawImage(softMask, 0, 0);
|
|
90
|
+
ctx.restore();
|
|
91
|
+
}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shortcuts-cheatsheet popover — floating frosted-glass list of every
|
|
3
|
+
* editor keyboard shortcut, anchored above the topbar keyboard icon
|
|
4
|
+
* (drops below if there's no room above). Drag the header to move;
|
|
5
|
+
* Esc or click outside dismisses; position is persisted in
|
|
6
|
+
* localStorage so re-opening restores where the user left it.
|
|
7
|
+
*
|
|
8
|
+
* Public API: `toggleShortcuts(show?)` — true/false to force a state,
|
|
9
|
+
* undefined to toggle.
|
|
10
|
+
*
|
|
11
|
+
* @returns {{ toggleShortcuts: (show?: boolean) => void }}
|
|
12
|
+
*/
|
|
13
|
+
import { shortcutsPopupHTML } from './build/popups.js';
|
|
14
|
+
|
|
15
|
+
export function createShortcutsPopover() {
|
|
16
|
+
let pop = null;
|
|
17
|
+
let outside = null;
|
|
18
|
+
|
|
19
|
+
function ensurePopover() {
|
|
20
|
+
if (pop) return pop;
|
|
21
|
+
const el = document.createElement('div');
|
|
22
|
+
el.id = 'ge-shortcuts-popover';
|
|
23
|
+
el.style.cssText = [
|
|
24
|
+
'position:fixed', 'z-index:10000', 'display:none',
|
|
25
|
+
// Frosted-glass background: semi-transparent + heavy blur of
|
|
26
|
+
// what's behind. Layered with an inner translucent veil so
|
|
27
|
+
// light themes also read clearly without losing the see-through
|
|
28
|
+
// feel.
|
|
29
|
+
'background:color-mix(in srgb, var(--panel, #1a1a1a) 55%, transparent)',
|
|
30
|
+
'backdrop-filter:blur(18px) saturate(150%)',
|
|
31
|
+
'-webkit-backdrop-filter:blur(18px) saturate(150%)',
|
|
32
|
+
'color:var(--fg,#eee)',
|
|
33
|
+
'border:1px solid color-mix(in srgb, var(--fg, #eee) 18%, transparent)',
|
|
34
|
+
'border-radius:12px',
|
|
35
|
+
'box-shadow:0 14px 36px rgba(0,0,0,0.5), inset 0 1px 0 color-mix(in srgb, var(--fg, #fff) 8%, transparent)',
|
|
36
|
+
'padding:12px 14px', 'min-width:540px', 'max-width:min(720px,92vw)',
|
|
37
|
+
'font-size:12px', 'line-height:1.5',
|
|
38
|
+
].join(';');
|
|
39
|
+
el.innerHTML = shortcutsPopupHTML();
|
|
40
|
+
document.body.appendChild(el);
|
|
41
|
+
el.querySelector('#ge-shortcuts-close').addEventListener('click', () => toggleShortcuts(false));
|
|
42
|
+
|
|
43
|
+
// Drag by the header handle. Position survives across opens
|
|
44
|
+
// (localStorage).
|
|
45
|
+
const handle = el.querySelector('#ge-shortcuts-handle');
|
|
46
|
+
if (handle) {
|
|
47
|
+
let drag = null;
|
|
48
|
+
handle.addEventListener('pointerdown', (e) => {
|
|
49
|
+
if (e.target.closest('#ge-shortcuts-close')) return;
|
|
50
|
+
const r = el.getBoundingClientRect();
|
|
51
|
+
drag = { dx: e.clientX - r.left, dy: e.clientY - r.top, w: r.width, h: r.height };
|
|
52
|
+
handle.setPointerCapture(e.pointerId);
|
|
53
|
+
handle.style.cursor = 'grabbing';
|
|
54
|
+
// Mark as user-positioned so subsequent toggles don't re-anchor.
|
|
55
|
+
el.dataset.userPositioned = '1';
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
});
|
|
58
|
+
handle.addEventListener('pointermove', (e) => {
|
|
59
|
+
if (!drag) return;
|
|
60
|
+
let left = e.clientX - drag.dx;
|
|
61
|
+
let top = e.clientY - drag.dy;
|
|
62
|
+
const m = 4;
|
|
63
|
+
left = Math.max(m, Math.min(left, window.innerWidth - drag.w - m));
|
|
64
|
+
top = Math.max(m, Math.min(top, window.innerHeight - drag.h - m));
|
|
65
|
+
el.style.left = left + 'px';
|
|
66
|
+
el.style.top = top + 'px';
|
|
67
|
+
});
|
|
68
|
+
const endDrag = () => {
|
|
69
|
+
if (!drag) return;
|
|
70
|
+
drag = null;
|
|
71
|
+
handle.style.cursor = 'grab';
|
|
72
|
+
try {
|
|
73
|
+
localStorage.setItem('ge-shortcuts-pos', JSON.stringify({
|
|
74
|
+
left: el.style.left, top: el.style.top,
|
|
75
|
+
}));
|
|
76
|
+
} catch {}
|
|
77
|
+
};
|
|
78
|
+
handle.addEventListener('pointerup', endDrag);
|
|
79
|
+
handle.addEventListener('pointercancel', endDrag);
|
|
80
|
+
}
|
|
81
|
+
pop = el;
|
|
82
|
+
return pop;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function positionPopover(el, anchor) {
|
|
86
|
+
// Place ABOVE the anchor, horizontally centred but clamped to
|
|
87
|
+
// viewport. Falls back to BELOW if there's no room above.
|
|
88
|
+
el.style.display = 'block'; // need a layout pass for accurate size
|
|
89
|
+
const ar = anchor.getBoundingClientRect();
|
|
90
|
+
const pr = el.getBoundingClientRect();
|
|
91
|
+
const margin = 8;
|
|
92
|
+
let left = ar.left + (ar.width / 2) - (pr.width / 2);
|
|
93
|
+
let top = ar.top - pr.height - margin;
|
|
94
|
+
if (top < margin) top = ar.bottom + margin;
|
|
95
|
+
left = Math.max(margin, Math.min(left, window.innerWidth - pr.width - margin));
|
|
96
|
+
top = Math.max(margin, Math.min(top, window.innerHeight - pr.height - margin));
|
|
97
|
+
el.style.left = left + 'px';
|
|
98
|
+
el.style.top = top + 'px';
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function toggleShortcuts(show) {
|
|
102
|
+
const el = ensurePopover();
|
|
103
|
+
const open = show === undefined ? el.style.display === 'none' : show;
|
|
104
|
+
if (open) {
|
|
105
|
+
// Restore the user's last-dragged position if any; otherwise
|
|
106
|
+
// anchor above the button.
|
|
107
|
+
let saved = null;
|
|
108
|
+
try { saved = JSON.parse(localStorage.getItem('ge-shortcuts-pos') || 'null'); } catch {}
|
|
109
|
+
if (saved && saved.left && saved.top) {
|
|
110
|
+
el.style.display = 'block';
|
|
111
|
+
el.style.left = saved.left;
|
|
112
|
+
el.style.top = saved.top;
|
|
113
|
+
// Re-clamp in case the viewport changed since the user dragged.
|
|
114
|
+
requestAnimationFrame(() => {
|
|
115
|
+
const r = el.getBoundingClientRect();
|
|
116
|
+
const m = 4;
|
|
117
|
+
if (r.right > window.innerWidth) el.style.left = (window.innerWidth - r.width - m) + 'px';
|
|
118
|
+
if (r.bottom > window.innerHeight) el.style.top = (window.innerHeight - r.height - m) + 'px';
|
|
119
|
+
if (r.left < 0) el.style.left = m + 'px';
|
|
120
|
+
if (r.top < 0) el.style.top = m + 'px';
|
|
121
|
+
});
|
|
122
|
+
} else {
|
|
123
|
+
const anchor = document.getElementById('ge-shortcuts-btn');
|
|
124
|
+
if (anchor) positionPopover(el, anchor);
|
|
125
|
+
else el.style.display = 'block';
|
|
126
|
+
}
|
|
127
|
+
// Defer outside-click so the click that opened us doesn't close us.
|
|
128
|
+
outside = (e) => {
|
|
129
|
+
if (el.contains(e.target)) return;
|
|
130
|
+
if (e.target.closest('#ge-shortcuts-btn')) return;
|
|
131
|
+
toggleShortcuts(false);
|
|
132
|
+
};
|
|
133
|
+
setTimeout(() => document.addEventListener('mousedown', outside, true), 0);
|
|
134
|
+
} else {
|
|
135
|
+
el.style.display = 'none';
|
|
136
|
+
if (outside) {
|
|
137
|
+
document.removeEventListener('mousedown', outside, true);
|
|
138
|
+
outside = null;
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** True when the popover is currently visible. */
|
|
144
|
+
function isOpen() {
|
|
145
|
+
return !!(pop && pop.style.display && pop.style.display !== 'none');
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
return { toggleShortcuts, isOpen };
|
|
149
|
+
}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slider-UX wiring shared across the editor:
|
|
3
|
+
*
|
|
4
|
+
* 1. `is-using` class while a slider is being dragged (eraser-rows
|
|
5
|
+
* expand to a wider track when in use). Cleared 0.5s after
|
|
6
|
+
* pointerup so a quick click doesn't snap back instantly.
|
|
7
|
+
* 2. Floating value bubble above the thumb during drag.
|
|
8
|
+
* Desktop: only the layer-opacity slider gets a bubble (the
|
|
9
|
+
* eraser-row sliders already show a value chip on the right).
|
|
10
|
+
* Mobile: every slider in the editor gets a bubble.
|
|
11
|
+
* 3. Click the value chip to type a number directly — replaces
|
|
12
|
+
* the span with an inline input until blur/Enter.
|
|
13
|
+
*
|
|
14
|
+
* Wired ONCE on editor open; the listeners stay alive for the whole
|
|
15
|
+
* session via state.container delegation.
|
|
16
|
+
*
|
|
17
|
+
* @param {{
|
|
18
|
+
* registerDocClickAway: (handler: (e: Event) => void) => void,
|
|
19
|
+
* }} deps
|
|
20
|
+
*/
|
|
21
|
+
import { state } from './state.js';
|
|
22
|
+
|
|
23
|
+
export function wireSliderUx({ registerDocClickAway }) {
|
|
24
|
+
const container = state.container;
|
|
25
|
+
if (!container) return;
|
|
26
|
+
|
|
27
|
+
// ── Floating bubble ──
|
|
28
|
+
const sliderBubble = document.createElement('div');
|
|
29
|
+
sliderBubble.className = 'ge-slider-bubble';
|
|
30
|
+
sliderBubble.hidden = true;
|
|
31
|
+
let sliderBubbleSlider = null;
|
|
32
|
+
|
|
33
|
+
// Find the container row for any slider — works for ge-eraser-row
|
|
34
|
+
// sliders AND the layer-opacity slider on each layer item.
|
|
35
|
+
function bubbleRowFor(slider) {
|
|
36
|
+
return slider.closest('.ge-eraser-row, .ge-layer-item, .ge-control-row, .ge-adj-row');
|
|
37
|
+
}
|
|
38
|
+
function bubbleText(slider) {
|
|
39
|
+
const row = bubbleRowFor(slider);
|
|
40
|
+
// Pulled-out value chip (after the slider) wins; fall back to
|
|
41
|
+
// the various `<label> <span>` styles used across the editor.
|
|
42
|
+
const chip = row?.querySelector('.ge-slider-value')
|
|
43
|
+
|| row?.querySelector('label > span[id$="-label"]')
|
|
44
|
+
|| row?.querySelector('label > .ge-size-label')
|
|
45
|
+
|| row?.querySelector('.ge-adj-value');
|
|
46
|
+
if (chip) return chip.textContent;
|
|
47
|
+
if (slider.classList.contains('ge-layer-opacity')) {
|
|
48
|
+
return Math.round(parseFloat(slider.value)) + '%';
|
|
49
|
+
}
|
|
50
|
+
return slider.value;
|
|
51
|
+
}
|
|
52
|
+
function bubblePos(slider, cursorX) {
|
|
53
|
+
// Bubble is fixed-positioned on document.body so it escapes any
|
|
54
|
+
// overflow:hidden / overflow:auto on the row's ancestors. The
|
|
55
|
+
// bubble's X is CLAMPED to the slider's track so it can't follow
|
|
56
|
+
// a finger that drags way past either end.
|
|
57
|
+
const sliderRect = slider.getBoundingClientRect();
|
|
58
|
+
const minX = sliderRect.left + 8;
|
|
59
|
+
const maxX = sliderRect.right - 8;
|
|
60
|
+
const x = Math.max(minX, Math.min(maxX, cursorX));
|
|
61
|
+
sliderBubble.style.left = x + 'px';
|
|
62
|
+
sliderBubble.style.top = (sliderRect.top - 8) + 'px';
|
|
63
|
+
}
|
|
64
|
+
function showSliderBubble(slider, e) {
|
|
65
|
+
if (sliderBubble.parentElement !== document.body) document.body.appendChild(sliderBubble);
|
|
66
|
+
sliderBubble.textContent = bubbleText(slider);
|
|
67
|
+
bubblePos(slider, e ? e.clientX : slider.getBoundingClientRect().left + slider.offsetWidth / 2);
|
|
68
|
+
sliderBubble.hidden = false;
|
|
69
|
+
sliderBubble.classList.add('visible');
|
|
70
|
+
sliderBubbleSlider = slider;
|
|
71
|
+
}
|
|
72
|
+
function hideSliderBubble() {
|
|
73
|
+
sliderBubble.classList.remove('visible');
|
|
74
|
+
sliderBubble.hidden = true;
|
|
75
|
+
sliderBubbleSlider = null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const slidingTimers = new WeakMap();
|
|
79
|
+
// Desktop: only the layer-opacity slider gets the bubble (eraser-
|
|
80
|
+
// rows have their own chip). Mobile: every slider gets one.
|
|
81
|
+
const isMobileSliders = window.matchMedia('(max-width: 820px)').matches;
|
|
82
|
+
const SLIDER_SEL = isMobileSliders
|
|
83
|
+
? '.ge-layer-opacity, .ge-eraser-row input[type="range"], .ge-control-row input[type="range"], .ge-adj-row input[type="range"]'
|
|
84
|
+
: '.ge-layer-opacity';
|
|
85
|
+
|
|
86
|
+
container.addEventListener('pointerdown', (e) => {
|
|
87
|
+
const slider = e.target.closest(SLIDER_SEL);
|
|
88
|
+
if (!slider) return;
|
|
89
|
+
const t = slidingTimers.get(slider);
|
|
90
|
+
if (t) { clearTimeout(t); slidingTimers.delete(slider); }
|
|
91
|
+
slider.classList.add('is-using');
|
|
92
|
+
showSliderBubble(slider, e);
|
|
93
|
+
// Compensate for the leftward-expanding eraser sliders so the
|
|
94
|
+
// thumb lands at the cursor's X on the new (wider) track. Layer-
|
|
95
|
+
// opacity doesn't shift left when it grows, so it uses the
|
|
96
|
+
// browser default.
|
|
97
|
+
if (slider.matches('.ge-eraser-row input[type="range"]')) {
|
|
98
|
+
const rect = slider.getBoundingClientRect();
|
|
99
|
+
const valFrac = Math.max(0, Math.min(1, 1 - (rect.right - e.clientX) / 140));
|
|
100
|
+
const min = parseFloat(slider.min) || 0;
|
|
101
|
+
const max = parseFloat(slider.max) || 100;
|
|
102
|
+
const step = parseFloat(slider.step) || 1;
|
|
103
|
+
const raw = min + valFrac * (max - min);
|
|
104
|
+
const stepped = Math.round(raw / step) * step;
|
|
105
|
+
requestAnimationFrame(() => {
|
|
106
|
+
slider.value = String(stepped);
|
|
107
|
+
slider.dispatchEvent(new Event('input', { bubbles: true }));
|
|
108
|
+
sliderBubble.textContent = bubbleText(slider);
|
|
109
|
+
});
|
|
110
|
+
} else {
|
|
111
|
+
requestAnimationFrame(() => {
|
|
112
|
+
sliderBubble.textContent = bubbleText(slider);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}, true);
|
|
116
|
+
document.addEventListener('pointermove', (e) => {
|
|
117
|
+
if (!sliderBubbleSlider) return;
|
|
118
|
+
bubblePos(sliderBubbleSlider, e.clientX);
|
|
119
|
+
sliderBubble.textContent = bubbleText(sliderBubbleSlider);
|
|
120
|
+
});
|
|
121
|
+
const scheduleSliderRelease = (slider) => {
|
|
122
|
+
if (!slider) return;
|
|
123
|
+
const old = slidingTimers.get(slider);
|
|
124
|
+
if (old) clearTimeout(old);
|
|
125
|
+
const t = setTimeout(() => {
|
|
126
|
+
slider.classList.remove('is-using');
|
|
127
|
+
slidingTimers.delete(slider);
|
|
128
|
+
}, 500);
|
|
129
|
+
slidingTimers.set(slider, t);
|
|
130
|
+
};
|
|
131
|
+
document.addEventListener('pointerup', () => {
|
|
132
|
+
container.querySelectorAll('input[type="range"].is-using').forEach(scheduleSliderRelease);
|
|
133
|
+
hideSliderBubble();
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
// ── Click value chip to type a number ──
|
|
137
|
+
// Replaces the chip with a tiny inline input until blur/Enter,
|
|
138
|
+
// then writes back to the slider and dispatches `input` so
|
|
139
|
+
// previews react. Matches the legacy chip AND the pulled-out
|
|
140
|
+
// `.ge-slider-value` chip so every slider row in the editor is
|
|
141
|
+
// click-to-type editable.
|
|
142
|
+
registerDocClickAway((e) => {
|
|
143
|
+
const chip = e.target.closest(
|
|
144
|
+
'.ge-eraser-row .ge-slider-value, ' +
|
|
145
|
+
'.ge-eraser-row label > span[id$="-label"], ' +
|
|
146
|
+
'.ge-eraser-row > span[id$="-label"], ' +
|
|
147
|
+
'.ge-adj-row .ge-adj-value'
|
|
148
|
+
);
|
|
149
|
+
if (!chip) return;
|
|
150
|
+
const row = chip.closest('.ge-eraser-row, .ge-adj-row');
|
|
151
|
+
const slider = row?.querySelector('input[type="range"]');
|
|
152
|
+
if (!slider) return;
|
|
153
|
+
e.preventDefault();
|
|
154
|
+
e.stopPropagation();
|
|
155
|
+
const numeric = (slider.value ?? '').toString();
|
|
156
|
+
const inp = document.createElement('input');
|
|
157
|
+
inp.type = 'text';
|
|
158
|
+
inp.value = numeric;
|
|
159
|
+
inp.className = 'ge-slider-edit';
|
|
160
|
+
chip.style.visibility = 'hidden';
|
|
161
|
+
row.appendChild(inp);
|
|
162
|
+
// Position the input over where the chip sits.
|
|
163
|
+
const crect = chip.getBoundingClientRect();
|
|
164
|
+
const rrect = row.getBoundingClientRect();
|
|
165
|
+
inp.style.left = (crect.left - rrect.left) + 'px';
|
|
166
|
+
inp.style.top = (crect.top - rrect.top - 1) + 'px';
|
|
167
|
+
inp.style.width = Math.max(40, crect.width + 8) + 'px';
|
|
168
|
+
inp.focus();
|
|
169
|
+
inp.select();
|
|
170
|
+
const commit = () => {
|
|
171
|
+
const v = parseFloat(inp.value);
|
|
172
|
+
if (!Number.isNaN(v)) {
|
|
173
|
+
const min = parseFloat(slider.min) || 0;
|
|
174
|
+
const max = parseFloat(slider.max) || 100;
|
|
175
|
+
const clamped = Math.max(min, Math.min(max, v));
|
|
176
|
+
slider.value = String(clamped);
|
|
177
|
+
slider.dispatchEvent(new Event('input', { bubbles: true }));
|
|
178
|
+
}
|
|
179
|
+
cleanup();
|
|
180
|
+
};
|
|
181
|
+
const cleanup = () => {
|
|
182
|
+
inp.remove();
|
|
183
|
+
chip.style.visibility = '';
|
|
184
|
+
};
|
|
185
|
+
inp.addEventListener('blur', commit);
|
|
186
|
+
inp.addEventListener('keydown', (ev) => {
|
|
187
|
+
if (ev.key === 'Enter') { ev.preventDefault(); commit(); }
|
|
188
|
+
if (ev.key === 'Escape') { ev.preventDefault(); cleanup(); }
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Snap-while-dragging: when the move tool drags a layer near another
|
|
3
|
+
* layer's edge or the canvas centre/edges, gently lock the proposed
|
|
4
|
+
* (nx, ny) to the nearest target within SNAP_PX.
|
|
5
|
+
*
|
|
6
|
+
* The implementation is pure — it takes the layer being moved + the
|
|
7
|
+
* trial offset + a context describing zoom + the other layers, and
|
|
8
|
+
* returns the snapped position plus any guides to draw.
|
|
9
|
+
*
|
|
10
|
+
* The legacy gallery editor's `_computeSnap` is a one-line wrapper
|
|
11
|
+
* that builds the context from module state.
|
|
12
|
+
*
|
|
13
|
+
* @param {{canvas: HTMLCanvasElement, id: string}} layer
|
|
14
|
+
* The layer currently being moved.
|
|
15
|
+
* @param {number} nx / ny
|
|
16
|
+
* Trial offset (top-left) in canvas pixels, before snapping.
|
|
17
|
+
* @param {{
|
|
18
|
+
* zoom: number,
|
|
19
|
+
* canvasW: number,
|
|
20
|
+
* canvasH: number,
|
|
21
|
+
* otherLayers: Array<{visible: boolean, id: string, canvas: HTMLCanvasElement, offset: {x:number, y:number}}>,
|
|
22
|
+
* }} ctx
|
|
23
|
+
* @returns {{x: number, y: number, guides: Array}}
|
|
24
|
+
*/
|
|
25
|
+
export function computeSnap(layer, nx, ny, ctx) {
|
|
26
|
+
const SNAP_PX = 6 / Math.max(ctx.zoom, 0.0001);
|
|
27
|
+
const cw = ctx.canvasW, ch = ctx.canvasH;
|
|
28
|
+
const w = layer.canvas.width, h = layer.canvas.height;
|
|
29
|
+
|
|
30
|
+
const vTargets = [
|
|
31
|
+
{ x: 0, label: 'canvas-l' },
|
|
32
|
+
{ x: cw, label: 'canvas-r' },
|
|
33
|
+
{ x: cw / 2, label: 'canvas-cx' },
|
|
34
|
+
];
|
|
35
|
+
const hTargets = [
|
|
36
|
+
{ y: 0, label: 'canvas-t' },
|
|
37
|
+
{ y: ch, label: 'canvas-b' },
|
|
38
|
+
{ y: ch / 2, label: 'canvas-cy' },
|
|
39
|
+
];
|
|
40
|
+
const otherLayers = Array.isArray(ctx.otherLayers) ? ctx.otherLayers : [];
|
|
41
|
+
for (const other of otherLayers) {
|
|
42
|
+
if (!other.visible || other.id === layer.id) continue;
|
|
43
|
+
const o = other.offset || { x: 0, y: 0 };
|
|
44
|
+
const ow = other.canvas.width, oh = other.canvas.height;
|
|
45
|
+
vTargets.push({ x: o.x, label: 'layer-l' });
|
|
46
|
+
vTargets.push({ x: o.x + ow, label: 'layer-r' });
|
|
47
|
+
vTargets.push({ x: o.x + ow / 2, label: 'layer-cx' });
|
|
48
|
+
hTargets.push({ y: o.y, label: 'layer-t' });
|
|
49
|
+
hTargets.push({ y: o.y + oh, label: 'layer-b' });
|
|
50
|
+
hTargets.push({ y: o.y + oh / 2, label: 'layer-cy' });
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const myEdgesX = { l: nx, cx: nx + w / 2, r: nx + w };
|
|
54
|
+
const myEdgesY = { t: ny, cy: ny + h / 2, b: ny + h };
|
|
55
|
+
let bestX = null, bestDx = Infinity;
|
|
56
|
+
let bestY = null, bestDy = Infinity;
|
|
57
|
+
for (const [src, val] of Object.entries(myEdgesX)) {
|
|
58
|
+
for (const t of vTargets) {
|
|
59
|
+
const d = Math.abs(t.x - val);
|
|
60
|
+
if (d < SNAP_PX && d < bestDx) {
|
|
61
|
+
bestDx = d;
|
|
62
|
+
bestX = { snapTo: t.x, src, target: t };
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
for (const [src, val] of Object.entries(myEdgesY)) {
|
|
67
|
+
for (const t of hTargets) {
|
|
68
|
+
const d = Math.abs(t.y - val);
|
|
69
|
+
if (d < SNAP_PX && d < bestDy) {
|
|
70
|
+
bestDy = d;
|
|
71
|
+
bestY = { snapTo: t.y, src, target: t };
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const guides = [];
|
|
77
|
+
let snappedX = nx, snappedY = ny;
|
|
78
|
+
if (bestX) {
|
|
79
|
+
if (bestX.src === 'l') snappedX = bestX.snapTo;
|
|
80
|
+
else if (bestX.src === 'cx') snappedX = bestX.snapTo - w / 2;
|
|
81
|
+
else snappedX = bestX.snapTo - w;
|
|
82
|
+
guides.push({ vertical: true, x: bestX.snapTo });
|
|
83
|
+
}
|
|
84
|
+
if (bestY) {
|
|
85
|
+
if (bestY.src === 't') snappedY = bestY.snapTo;
|
|
86
|
+
else if (bestY.src === 'cy') snappedY = bestY.snapTo - h / 2;
|
|
87
|
+
else snappedY = bestY.snapTo - h;
|
|
88
|
+
guides.push({ vertical: false, y: bestY.snapTo });
|
|
89
|
+
}
|
|
90
|
+
return { x: snappedX, y: snappedY, guides };
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* CSS cursor name for each transform-tool handle.
|
|
96
|
+
*
|
|
97
|
+
* @param {'tl'|'tr'|'bl'|'br'|'rot'|string} id
|
|
98
|
+
* @returns {string}
|
|
99
|
+
*/
|
|
100
|
+
export function cursorForHandle(id) {
|
|
101
|
+
switch (id) {
|
|
102
|
+
case 'tl': case 'br': return 'nwse-resize';
|
|
103
|
+
case 'tr': case 'bl': return 'nesw-resize';
|
|
104
|
+
case 'rot': return 'grab';
|
|
105
|
+
default: return 'default';
|
|
106
|
+
}
|
|
107
|
+
}
|