@celljs/ta 4.9.1 → 4.11.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.en.md +3 -1
- package/README.md +3 -1
- package/dist/cli.mjs +1753 -75
- package/dist/gateway.mjs +311 -25
- package/dist/pi/CHANGELOG.md +30 -0
- package/dist/pi/dist/bundle/chunks/anthropic-messages-CA3HHOL3.js +6 -0
- package/dist/pi/dist/bundle/chunks/{azure-openai-responses-FSC6BAW3.js → azure-openai-responses-76TWS6DT.js} +1 -1
- package/dist/pi/dist/bundle/chunks/bedrock-converse-stream.js +3 -3
- package/dist/pi/dist/bundle/chunks/chunk-4KSTFUIK.js +19 -0
- package/dist/pi/dist/bundle/chunks/chunk-4UNPP53I.js +55 -0
- package/dist/pi/dist/bundle/chunks/chunk-AUUCDC7R.js +4 -0
- package/dist/pi/dist/bundle/chunks/{chunk-V6KH5QG4.js → chunk-BAC3QPNW.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{chunk-4EYXVSA5.js → chunk-FF6XOTWB.js} +9 -9
- package/dist/pi/dist/bundle/chunks/chunk-FMPAMX2W.js +82 -0
- package/dist/pi/dist/bundle/chunks/chunk-GFUN2N5K.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-IEBK4HQA.js +2 -0
- package/dist/pi/dist/bundle/chunks/{chunk-C2WU32PX.js → chunk-IQUU5XIT.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{chunk-EBFHJFEE.js → chunk-LQLJ7CDW.js} +1 -1
- package/dist/pi/dist/bundle/chunks/chunk-MMDXLZVS.js +30 -0
- package/dist/pi/dist/bundle/chunks/{chunk-GN3QYODH.js → chunk-QN4TOIZN.js} +1 -1
- package/dist/pi/dist/bundle/chunks/chunk-RKNK4Y6L.js +2 -0
- package/dist/pi/dist/bundle/chunks/{chunk-B46VJEHW.js → chunk-V7SLUK6A.js} +1 -1
- package/dist/pi/dist/bundle/chunks/chunk-VEJDBY3O.js +1237 -0
- package/dist/pi/dist/bundle/chunks/chunk-VKJQ6CME.js +8 -0
- package/dist/pi/dist/bundle/chunks/{chunk-3TGLJEWK.js → chunk-WL4TUXY7.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{chunk-YZKQS34S.js → chunk-Y55SJART.js} +5 -1
- package/dist/pi/dist/bundle/chunks/{chunk-EOO47QGR.js → chunk-ZBIZYD6W.js} +1 -1
- package/dist/pi/dist/bundle/chunks/chunk-ZG74NES2.js +2 -0
- package/dist/pi/dist/bundle/chunks/chunk-ZGYS4UTC.js +2 -0
- package/dist/pi/dist/bundle/chunks/{cli-MCOUW5WS.js → cli-7RHMDOHL.js} +7 -7
- package/dist/pi/dist/bundle/chunks/{cloudflare-workers-ai-system-one-WLAFJSP6.js → cloudflare-workers-ai-system-one-U4J7D646.js} +1 -1
- package/dist/pi/dist/bundle/chunks/codemode-worker.js +2 -0
- package/dist/pi/dist/bundle/chunks/{easter-egg-3d-WMBNSJ4M.js → easter-egg-3d-GEVPKQF6.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{execute-4CEBORGZ.js → execute-L2EEDV3L.js} +5 -3
- package/dist/pi/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/pi/dist/bundle/chunks/{google-generative-ai-INGKNW72.js → google-generative-ai-D5B6W47J.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{google-vertex-IBTX6MBF.js → google-vertex-U4H5YDEW.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{llama-cpp-classify-V5U3QKXI.js → llama-cpp-classify-EJXCQRUQ.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{mistral-conversations-S4OWXIXQ.js → mistral-conversations-S277EKLB.js} +1 -1
- package/dist/pi/dist/bundle/chunks/openai-codex-responses-TEQRB65N.js +10 -0
- package/dist/pi/dist/bundle/chunks/{openai-completions-EJNYB6IX.js → openai-completions-HRZOSLBO.js} +3 -3
- package/dist/pi/dist/bundle/chunks/{openai-decisions-IXI34BYG.js → openai-decisions-F66BDLOM.js} +1 -1
- package/dist/pi/dist/bundle/chunks/openai-responses-BAKFWTGE.js +4 -0
- package/dist/pi/dist/bundle/chunks/{openrouter-images-PISKSFMS.js → openrouter-images-VXF5TVIK.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{pi-messages-NORUKF4E.js → pi-messages-UBJKNDRN.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{runtime-FQB7RU7U.js → runtime-J5ZSBGTX.js} +1 -1
- package/dist/pi/dist/bundle/chunks/{typesafe-system-one-CHVC2UUI.js → typesafe-system-one-56TEMIHL.js} +1 -1
- package/dist/pi/dist/bundle/chunks/virtual-modules-KITQRTYM.js +2 -0
- package/dist/pi/dist/bundle/cli-runtime.js +1 -1
- package/dist/pi/dist/bundle/index.js +1 -1
- package/dist/pi/dist/bundle/rpc-entry.js +1 -1
- package/dist/pi/docs/cli.md +14 -1
- package/dist/pi/docs/extensions.md +27 -7
- package/dist/pi/docs/keybindings.md +1 -1
- package/dist/pi/docs/llama-cpp.md +5 -8
- package/dist/pi/docs/models-configuration.md +6 -1
- package/dist/pi/docs/models.md +2 -1
- package/dist/pi/docs/prompt-templates.md +1 -1
- package/dist/pi/docs/providers.md +1 -1
- package/dist/pi/docs/rpc.md +4 -2
- package/dist/pi/docs/sessions.md +7 -1
- package/dist/pi/docs/settings.md +1 -1
- package/dist/pi/docs/tui.md +1 -1
- package/dist/pi/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/dist/pi/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/dist/pi/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/dist/pi/examples/extensions/gondolin/package-lock.json +2 -2
- package/dist/pi/examples/extensions/gondolin/package.json +1 -1
- package/dist/pi/examples/extensions/plan-mode/index.ts +23 -13
- package/dist/pi/examples/extensions/plan-mode/utils.ts +42 -16
- package/dist/pi/examples/extensions/subagent/README.md +14 -11
- package/dist/pi/examples/extensions/subagent/index.ts +392 -171
- package/dist/pi/examples/extensions/with-deps/package-lock.json +2 -2
- package/dist/pi/examples/extensions/with-deps/package.json +1 -1
- package/dist/pi/examples/tsconfig.json +63 -35
- package/dist/pi/package.json +1 -1
- package/dist/pi/packages/ta-agents/extension/index.mjs +185 -140
- package/dist/pi/packages/ta-agents/lib/acp-agent.js +30 -10
- package/dist/pi/packages/ta-agents/lib/agent-bindings.d.ts +2 -0
- package/dist/pi/packages/ta-agents/lib/agent-bindings.js +4 -0
- package/dist/pi/packages/ta-agents/lib/agent-catalog.d.ts +2 -2
- package/dist/pi/packages/ta-agents/lib/agent-catalog.js +4 -4
- package/dist/pi/packages/ta-agents/lib/agent-prompt.d.ts +6 -0
- package/dist/pi/packages/ta-agents/lib/agent-prompt.js +19 -0
- package/dist/pi/packages/ta-agents/lib/agent-session.d.ts +2 -0
- package/dist/pi/packages/ta-agents/lib/agent-session.js +2 -0
- package/dist/pi/packages/ta-agents/lib/agent-streamer.js +7 -0
- package/dist/pi/packages/ta-agents/lib/agent-tool.js +3 -2
- package/dist/pi/packages/ta-agents/lib/extension.js +15 -1
- package/dist/pi/packages/ta-agents/lib/texts.d.ts +4 -0
- package/dist/pi/packages/ta-agents/lib/texts.js +4 -0
- package/dist/pi/packages/ta-agents/package.json +3 -3
- package/dist/pi/packages/ta-bots/extension/index.mjs +31 -253
- package/dist/pi/packages/ta-bots/host/index.mjs +189 -1
- package/dist/pi/packages/ta-bots/lib/bots-protocol.d.ts +2 -0
- package/dist/pi/packages/ta-bots/lib/bots-protocol.js +3 -1
- package/dist/pi/packages/ta-bots/lib/bots-view.js +24 -12
- package/dist/pi/packages/ta-bots/lib/composer.js +1 -0
- package/dist/pi/packages/ta-bots/lib/extension.js +10 -17
- package/dist/pi/packages/ta-bots/lib/i18n.d.ts +1 -0
- package/dist/pi/packages/ta-bots/lib/i18n.js +2 -0
- package/dist/pi/packages/ta-bots/lib/index.js +2 -0
- package/dist/pi/packages/ta-bots/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-bots/lib/style.js +1 -0
- package/dist/pi/packages/ta-bots/lib/text-util.js +8 -1
- package/dist/pi/packages/ta-bots/lib/tool-line.d.ts +8 -0
- package/dist/pi/packages/ta-bots/lib/tool-line.js +19 -0
- package/dist/pi/packages/ta-bots/package.json +1 -1
- package/dist/pi/packages/ta-bots/web/index.js +47 -16
- package/dist/pi/packages/ta-changes/extension/index.mjs +23 -13
- package/dist/pi/packages/ta-changes/lib/card.js +18 -4
- package/dist/pi/packages/ta-changes/lib/changes-protocol.d.ts +0 -4
- package/dist/pi/packages/ta-changes/lib/changes-protocol.js +1 -5
- package/dist/pi/packages/ta-changes/lib/extension.js +5 -13
- package/dist/pi/packages/ta-changes/package.json +1 -1
- package/dist/pi/packages/ta-changes/web/index.js +16 -3
- package/dist/pi/packages/ta-channels/README.en.md +6 -5
- package/dist/pi/packages/ta-channels/README.md +6 -5
- package/dist/pi/packages/ta-channels/extension/index.mjs +350 -28
- package/dist/pi/packages/ta-channels/host/index.mjs +638 -43
- package/dist/pi/packages/ta-channels/lib/agent-cards.d.ts +19 -0
- package/dist/pi/packages/ta-channels/lib/agent-cards.js +58 -0
- package/dist/pi/packages/ta-channels/lib/agent-menu.d.ts +2 -2
- package/dist/pi/packages/ta-channels/lib/agent-menu.js +20 -6
- package/dist/pi/packages/ta-channels/lib/card.d.ts +27 -0
- package/dist/pi/packages/ta-channels/lib/card.js +178 -0
- package/dist/pi/packages/ta-channels/lib/channels-model.d.ts +65 -13
- package/dist/pi/packages/ta-channels/lib/channels-model.js +15 -6
- package/dist/pi/packages/ta-channels/lib/channels-util.d.ts +31 -2
- package/dist/pi/packages/ta-channels/lib/channels-util.js +100 -6
- package/dist/pi/packages/ta-channels/lib/channels.d.ts +28 -18
- package/dist/pi/packages/ta-channels/lib/channels.js +65 -65
- package/dist/pi/packages/ta-channels/lib/create.js +14 -4
- package/dist/pi/packages/ta-channels/lib/extension.d.ts +8 -0
- package/dist/pi/packages/ta-channels/lib/extension.js +104 -18
- package/dist/pi/packages/ta-channels/lib/faces.d.ts +2 -0
- package/dist/pi/packages/ta-channels/lib/faces.js +7 -1
- package/dist/pi/packages/ta-channels/lib/handoff-view.d.ts +19 -0
- package/dist/pi/packages/ta-channels/lib/handoff-view.js +113 -0
- package/dist/pi/packages/ta-channels/lib/handoff.d.ts +67 -0
- package/dist/pi/packages/ta-channels/lib/handoff.js +114 -0
- package/dist/pi/packages/ta-channels/lib/host.d.ts +1 -1
- package/dist/pi/packages/ta-channels/lib/host.js +1 -1
- package/dist/pi/packages/ta-channels/lib/i18n.d.ts +49 -8
- package/dist/pi/packages/ta-channels/lib/i18n.js +98 -16
- package/dist/pi/packages/ta-channels/lib/index.js +10 -1
- package/dist/pi/packages/ta-channels/lib/member-tools.d.ts +23 -0
- package/dist/pi/packages/ta-channels/lib/member-tools.js +56 -0
- package/dist/pi/packages/ta-channels/lib/members.js +6 -2
- package/dist/pi/packages/ta-channels/lib/more-menu.d.ts +3 -2
- package/dist/pi/packages/ta-channels/lib/more-menu.js +21 -29
- package/dist/pi/packages/ta-channels/lib/notice.d.ts +25 -0
- package/dist/pi/packages/ta-channels/lib/notice.js +101 -0
- package/dist/pi/packages/ta-channels/lib/room.js +26 -10
- package/dist/pi/packages/ta-channels/lib/sidebar.d.ts +1 -6
- package/dist/pi/packages/ta-channels/lib/sidebar.js +257 -84
- package/dist/pi/packages/ta-channels/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-channels/lib/style.js +151 -40
- package/dist/pi/packages/ta-channels/lib/tasks.js +3 -4
- package/dist/pi/packages/ta-channels/lib/team.d.ts +58 -10
- package/dist/pi/packages/ta-channels/lib/team.js +159 -38
- package/dist/pi/packages/ta-channels/lib/tool-lines.d.ts +22 -0
- package/dist/pi/packages/ta-channels/lib/tool-lines.js +113 -0
- package/dist/pi/packages/ta-channels/lib/views.d.ts +54 -1
- package/dist/pi/packages/ta-channels/lib/views.js +129 -1
- package/dist/pi/packages/ta-channels/package.json +2 -1
- package/dist/pi/packages/ta-channels/web/index.js +1792 -439
- package/dist/pi/packages/ta-computer-use/package.json +7 -2
- package/dist/pi/packages/ta-cron/README.en.md +6 -4
- package/dist/pi/packages/ta-cron/README.md +6 -4
- package/dist/pi/packages/ta-cron/extension/index.mjs +416 -44
- package/dist/pi/packages/ta-cron/host/index.mjs +30 -3
- package/dist/pi/packages/ta-cron/lib/chat-task.d.ts +48 -0
- package/dist/pi/packages/ta-cron/lib/chat-task.js +133 -0
- package/dist/pi/packages/ta-cron/lib/commands.d.ts +2 -1
- package/dist/pi/packages/ta-cron/lib/commands.js +10 -4
- package/dist/pi/packages/ta-cron/lib/composer.d.ts +11 -0
- package/dist/pi/packages/ta-cron/lib/composer.js +58 -0
- package/dist/pi/packages/ta-cron/lib/cron-protocol.d.ts +10 -3
- package/dist/pi/packages/ta-cron/lib/cron-protocol.js +6 -3
- package/dist/pi/packages/ta-cron/lib/editor.js +65 -30
- package/dist/pi/packages/ta-cron/lib/extension.d.ts +2 -0
- package/dist/pi/packages/ta-cron/lib/extension.js +33 -13
- package/dist/pi/packages/ta-cron/lib/i18n.d.ts +30 -1
- package/dist/pi/packages/ta-cron/lib/i18n.js +60 -2
- package/dist/pi/packages/ta-cron/lib/index.js +4 -0
- package/dist/pi/packages/ta-cron/lib/page.d.ts +38 -4
- package/dist/pi/packages/ta-cron/lib/page.js +131 -4
- package/dist/pi/packages/ta-cron/lib/react.d.ts +3 -0
- package/dist/pi/packages/ta-cron/lib/react.js +8 -0
- package/dist/pi/packages/ta-cron/lib/scheduler.js +3 -2
- package/dist/pi/packages/ta-cron/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-cron/lib/style.js +168 -50
- package/dist/pi/packages/ta-cron/lib/task-extension.d.ts +15 -0
- package/dist/pi/packages/ta-cron/lib/task-extension.js +56 -0
- package/dist/pi/packages/ta-cron/lib/task-util.d.ts +4 -0
- package/dist/pi/packages/ta-cron/lib/task-util.js +31 -1
- package/dist/pi/packages/ta-cron/lib/tasks-view.d.ts +4 -1
- package/dist/pi/packages/ta-cron/lib/tasks-view.js +107 -67
- package/dist/pi/packages/ta-cron/lib/tool-line.d.ts +9 -0
- package/dist/pi/packages/ta-cron/lib/tool-line.js +40 -0
- package/dist/pi/packages/ta-cron/lib/tool.d.ts +5 -1
- package/dist/pi/packages/ta-cron/lib/tool.js +6 -3
- package/dist/pi/packages/ta-cron/package.json +12 -1
- package/dist/pi/packages/ta-cron/web/index.js +1346 -415
- package/dist/pi/packages/ta-extensions/README.en.md +4 -2
- package/dist/pi/packages/ta-extensions/README.md +4 -2
- package/dist/pi/packages/ta-extensions/host/index.mjs +3 -2
- package/dist/pi/packages/ta-extensions/lib/actions.d.ts +4 -0
- package/dist/pi/packages/ta-extensions/lib/actions.js +16 -5
- package/dist/pi/packages/ta-extensions/lib/composer.d.ts +17 -0
- package/dist/pi/packages/ta-extensions/lib/composer.js +84 -0
- package/dist/pi/packages/ta-extensions/lib/extensions-util.d.ts +5 -0
- package/dist/pi/packages/ta-extensions/lib/extensions-util.js +10 -0
- package/dist/pi/packages/ta-extensions/lib/i18n.d.ts +9 -0
- package/dist/pi/packages/ta-extensions/lib/i18n.js +18 -0
- package/dist/pi/packages/ta-extensions/lib/index.js +4 -0
- package/dist/pi/packages/ta-extensions/lib/make-model.d.ts +20 -0
- package/dist/pi/packages/ta-extensions/lib/make-model.js +43 -0
- package/dist/pi/packages/ta-extensions/lib/market-parts.js +8 -2
- package/dist/pi/packages/ta-extensions/lib/market-style.d.ts +1 -1
- package/dist/pi/packages/ta-extensions/lib/market-style.js +4 -5
- package/dist/pi/packages/ta-extensions/lib/market-util.d.ts +2 -2
- package/dist/pi/packages/ta-extensions/lib/market-util.js +2 -2
- package/dist/pi/packages/ta-extensions/lib/page.js +52 -23
- package/dist/pi/packages/ta-extensions/lib/react.d.ts +3 -0
- package/dist/pi/packages/ta-extensions/lib/react.js +8 -0
- package/dist/pi/packages/ta-extensions/lib/settings.d.ts +4 -0
- package/dist/pi/packages/ta-extensions/lib/settings.js +44 -0
- package/dist/pi/packages/ta-extensions/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-extensions/lib/style.js +13 -6
- package/dist/pi/packages/ta-extensions/package.json +6 -1
- package/dist/pi/packages/ta-extensions/skills/ta-package/SKILL.md +25 -10
- package/dist/pi/packages/ta-extensions/web/index.js +459 -47
- package/dist/pi/packages/ta-games/README.en.md +47 -0
- package/dist/pi/packages/ta-games/README.md +47 -0
- package/dist/pi/packages/ta-games/host/index.mjs +65 -0
- package/dist/pi/packages/ta-games/lib/games-view.d.ts +16 -0
- package/dist/pi/packages/ta-games/lib/games-view.js +77 -0
- package/dist/pi/packages/ta-games/lib/host.d.ts +36 -0
- package/dist/pi/packages/ta-games/lib/host.js +83 -0
- package/dist/pi/packages/ta-games/lib/i18n.d.ts +35 -0
- package/dist/pi/packages/ta-games/lib/i18n.js +71 -0
- package/dist/pi/packages/ta-games/lib/ideas.d.ts +6 -0
- package/dist/pi/packages/ta-games/lib/ideas.js +62 -0
- package/dist/pi/packages/ta-games/lib/index.d.ts +7 -0
- package/dist/pi/packages/ta-games/lib/index.js +24 -0
- package/dist/pi/packages/ta-games/lib/make-game.d.ts +23 -0
- package/dist/pi/packages/ta-games/lib/make-game.js +67 -0
- package/dist/pi/packages/ta-games/lib/react.d.ts +11 -0
- package/dist/pi/packages/ta-games/lib/react.js +16 -0
- package/dist/pi/packages/ta-games/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-games/lib/style.js +33 -0
- package/dist/pi/packages/ta-games/package.json +60 -0
- package/dist/pi/packages/ta-games/skills/ta-game/SKILL.md +127 -0
- package/dist/pi/packages/ta-games/skills/ta-game/examples/dino-run/package.json +22 -0
- package/dist/pi/packages/ta-games/skills/ta-game/examples/dino-run/web.js +389 -0
- package/dist/pi/packages/ta-games/skills/ta-game/examples/stack/package.json +22 -0
- package/dist/pi/packages/ta-games/skills/ta-game/examples/stack/web.js +423 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/LICENSE.md +22 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/actions-and-utilities/SKILL.md +343 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/animations/SKILL.md +481 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/audio-and-sound/SKILL.md +453 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/cameras/SKILL.md +497 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/cameras/references/REFERENCE.md +128 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/curves-and-paths/SKILL.md +359 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/data-manager/SKILL.md +406 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/events-system/SKILL.md +497 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/filters-and-postfx/SKILL.md +449 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/game-object-components/SKILL.md +478 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/game-object-components/references/REFERENCE.md +76 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/game-setup-and-config/SKILL.md +485 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/geometry-and-math/SKILL.md +497 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/graphics-and-shapes/SKILL.md +473 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/groups-and-containers/SKILL.md +418 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/input-keyboard-mouse-touch/SKILL.md +500 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/input-keyboard-mouse-touch/references/REFERENCE.md +372 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/loading-assets/SKILL.md +474 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/loading-assets/references/REFERENCE.md +148 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/particles/SKILL.md +499 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/particles/references/REFERENCE.md +17 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/physics-arcade/SKILL.md +468 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/physics-matter/SKILL.md +499 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/render-textures/SKILL.md +441 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/scale-and-responsive/SKILL.md +371 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/scenes/SKILL.md +450 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/scenes/references/REFERENCE.md +78 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/sprites-and-images/SKILL.md +417 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/sprites-and-images/references/REFERENCE.md +160 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/text-and-bitmaptext/SKILL.md +460 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/tilemaps/SKILL.md +440 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/time-and-timers/SKILL.md +496 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/tweens/SKILL.md +414 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/v3-to-v4-migration/SKILL.md +430 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/v4-new-features/SKILL.md +384 -0
- package/dist/pi/packages/ta-games/skills/ta-game/phaser/v4-new-features/references/REFERENCE.md +69 -0
- package/dist/pi/packages/ta-games/web/index.js +431 -0
- package/dist/pi/packages/ta-glance/README.en.md +11 -0
- package/dist/pi/packages/ta-glance/README.md +11 -0
- package/dist/pi/packages/ta-glance/extension/index.mjs +67 -0
- package/dist/pi/packages/ta-glance/lib/card.d.ts +8 -0
- package/dist/pi/packages/ta-glance/lib/card.js +268 -0
- package/dist/pi/packages/ta-glance/lib/extension.d.ts +15 -0
- package/dist/pi/packages/ta-glance/lib/extension.js +24 -0
- package/dist/pi/packages/ta-glance/lib/glance-json.d.ts +9 -0
- package/dist/pi/packages/ta-glance/lib/glance-json.js +85 -0
- package/dist/pi/packages/ta-glance/lib/glance-prompt.d.ts +7 -0
- package/dist/pi/packages/ta-glance/lib/glance-prompt.js +34 -0
- package/dist/pi/packages/ta-glance/lib/glance-protocol.d.ts +98 -0
- package/dist/pi/packages/ta-glance/lib/glance-protocol.js +8 -0
- package/dist/pi/packages/ta-glance/lib/glance-spec.d.ts +6 -0
- package/dist/pi/packages/ta-glance/lib/glance-spec.js +204 -0
- package/dist/pi/packages/ta-glance/lib/glance-util.d.ts +3 -0
- package/dist/pi/packages/ta-glance/lib/glance-util.js +12 -0
- package/dist/pi/packages/ta-glance/lib/i18n.d.ts +22 -0
- package/dist/pi/packages/ta-glance/lib/i18n.js +41 -0
- package/dist/pi/packages/ta-glance/lib/index.d.ts +7 -0
- package/dist/pi/packages/ta-glance/lib/index.js +22 -0
- package/dist/pi/packages/ta-glance/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-glance/lib/react.js +8 -0
- package/dist/pi/packages/ta-glance/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-glance/lib/style.js +164 -0
- package/dist/pi/packages/ta-glance/package.json +53 -0
- package/dist/pi/packages/ta-glance/web/index.js +933 -0
- package/dist/pi/packages/ta-launcher/lib/actions.d.ts +4 -4
- package/dist/pi/packages/ta-launcher/lib/actions.js +7 -3
- package/dist/pi/packages/ta-launcher/lib/launcher-util.d.ts +7 -7
- package/dist/pi/packages/ta-launcher/lib/launcher-util.js +11 -8
- package/dist/pi/packages/ta-launcher/lib/launcher-view.js +13 -7
- package/dist/pi/packages/ta-launcher/lib/react.d.ts +3 -0
- package/dist/pi/packages/ta-launcher/lib/react.js +8 -0
- package/dist/pi/packages/ta-launcher/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-launcher/lib/style.js +6 -4
- package/dist/pi/packages/ta-launcher/package.json +1 -1
- package/dist/pi/packages/ta-launcher/web/index.js +34 -17
- package/dist/pi/packages/ta-manual/README.en.md +10 -0
- package/dist/pi/packages/ta-manual/README.md +10 -0
- package/dist/pi/packages/ta-manual/lib/i18n.d.ts +15 -0
- package/dist/pi/packages/ta-manual/lib/i18n.js +31 -0
- package/dist/pi/packages/ta-manual/lib/index.d.ts +7 -0
- package/dist/pi/packages/ta-manual/lib/index.js +24 -0
- package/dist/pi/packages/ta-manual/lib/manual-util.d.ts +18 -0
- package/dist/pi/packages/ta-manual/lib/manual-util.js +40 -0
- package/dist/pi/packages/ta-manual/lib/manual-view.d.ts +9 -0
- package/dist/pi/packages/ta-manual/lib/manual-view.js +81 -0
- package/dist/pi/packages/ta-manual/lib/pictures-a.d.ts +2 -0
- package/dist/pi/packages/ta-manual/lib/pictures-a.js +263 -0
- package/dist/pi/packages/ta-manual/lib/pictures-b.d.ts +2 -0
- package/dist/pi/packages/ta-manual/lib/pictures-b.js +216 -0
- package/dist/pi/packages/ta-manual/lib/pictures.d.ts +9 -0
- package/dist/pi/packages/ta-manual/lib/pictures.js +16 -0
- package/dist/pi/packages/ta-manual/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-manual/lib/react.js +8 -0
- package/dist/pi/packages/ta-manual/lib/scene.d.ts +68 -0
- package/dist/pi/packages/ta-manual/lib/scene.js +115 -0
- package/dist/pi/packages/ta-manual/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-manual/lib/style.js +47 -0
- package/dist/pi/packages/ta-manual/lib/topics.d.ts +42 -0
- package/dist/pi/packages/ta-manual/lib/topics.js +354 -0
- package/dist/pi/packages/ta-manual/package.json +54 -0
- package/dist/pi/packages/ta-manual/skills/ta-manual/SKILL.md +119 -0
- package/dist/pi/packages/ta-manual/web/index.js +2223 -0
- package/dist/pi/packages/ta-notify/README.en.md +29 -0
- package/dist/pi/packages/ta-notify/README.md +29 -0
- package/dist/pi/packages/ta-notify/extension/index.mjs +259 -0
- package/dist/pi/packages/ta-notify/host/index.mjs +163 -0
- package/dist/pi/packages/ta-notify/lib/ask-card.d.ts +9 -0
- package/dist/pi/packages/ta-notify/lib/ask-card.js +40 -0
- package/dist/pi/packages/ta-notify/lib/extension.d.ts +24 -0
- package/dist/pi/packages/ta-notify/lib/extension.js +102 -0
- package/dist/pi/packages/ta-notify/lib/host.d.ts +4 -0
- package/dist/pi/packages/ta-notify/lib/host.js +9 -0
- package/dist/pi/packages/ta-notify/lib/i18n.d.ts +31 -0
- package/dist/pi/packages/ta-notify/lib/i18n.js +63 -0
- package/dist/pi/packages/ta-notify/lib/index.d.ts +8 -0
- package/dist/pi/packages/ta-notify/lib/index.js +29 -0
- package/dist/pi/packages/ta-notify/lib/notify-protocol.d.ts +74 -0
- package/dist/pi/packages/ta-notify/lib/notify-protocol.js +23 -0
- package/dist/pi/packages/ta-notify/lib/notify-service.d.ts +21 -0
- package/dist/pi/packages/ta-notify/lib/notify-service.js +75 -0
- package/dist/pi/packages/ta-notify/lib/notify-util.d.ts +39 -0
- package/dist/pi/packages/ta-notify/lib/notify-util.js +119 -0
- package/dist/pi/packages/ta-notify/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-notify/lib/react.js +8 -0
- package/dist/pi/packages/ta-notify/lib/server-texts.d.ts +9 -0
- package/dist/pi/packages/ta-notify/lib/server-texts.js +22 -0
- package/dist/pi/packages/ta-notify/lib/settings.d.ts +8 -0
- package/dist/pi/packages/ta-notify/lib/settings.js +85 -0
- package/dist/pi/packages/ta-notify/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-notify/lib/style.js +29 -0
- package/dist/pi/packages/ta-notify/lib/tool-line.d.ts +9 -0
- package/dist/pi/packages/ta-notify/lib/tool-line.js +20 -0
- package/dist/pi/packages/ta-notify/lib/tool.d.ts +37 -0
- package/dist/pi/packages/ta-notify/lib/tool.js +46 -0
- package/dist/pi/packages/ta-notify/lib/watcher.d.ts +15 -0
- package/dist/pi/packages/ta-notify/lib/watcher.js +81 -0
- package/dist/pi/packages/ta-notify/package.json +55 -0
- package/dist/pi/packages/ta-notify/web/index.js +436 -0
- package/dist/pi/packages/ta-recall/README.en.md +19 -0
- package/dist/pi/packages/ta-recall/README.md +19 -0
- package/dist/pi/packages/ta-recall/extension/index.mjs +614 -0
- package/dist/pi/packages/ta-recall/host/index.mjs +820 -0
- package/dist/pi/packages/ta-recall/lib/brief-card.d.ts +21 -0
- package/dist/pi/packages/ta-recall/lib/brief-card.js +67 -0
- package/dist/pi/packages/ta-recall/lib/brief-home.d.ts +49 -0
- package/dist/pi/packages/ta-recall/lib/brief-home.js +143 -0
- package/dist/pi/packages/ta-recall/lib/brief-seen.d.ts +9 -0
- package/dist/pi/packages/ta-recall/lib/brief-seen.js +26 -0
- package/dist/pi/packages/ta-recall/lib/brief-util.d.ts +64 -0
- package/dist/pi/packages/ta-recall/lib/brief-util.js +179 -0
- package/dist/pi/packages/ta-recall/lib/chat-icons.d.ts +8 -0
- package/dist/pi/packages/ta-recall/lib/chat-icons.js +56 -0
- package/dist/pi/packages/ta-recall/lib/composer.d.ts +7 -0
- package/dist/pi/packages/ta-recall/lib/composer.js +38 -0
- package/dist/pi/packages/ta-recall/lib/conversation-index.d.ts +25 -0
- package/dist/pi/packages/ta-recall/lib/conversation-index.js +72 -0
- package/dist/pi/packages/ta-recall/lib/conversation-util.d.ts +16 -0
- package/dist/pi/packages/ta-recall/lib/conversation-util.js +109 -0
- package/dist/pi/packages/ta-recall/lib/conversations.d.ts +11 -0
- package/dist/pi/packages/ta-recall/lib/conversations.js +46 -0
- package/dist/pi/packages/ta-recall/lib/extension.d.ts +24 -0
- package/dist/pi/packages/ta-recall/lib/extension.js +131 -0
- package/dist/pi/packages/ta-recall/lib/host.d.ts +4 -0
- package/dist/pi/packages/ta-recall/lib/host.js +11 -0
- package/dist/pi/packages/ta-recall/lib/i18n.d.ts +41 -0
- package/dist/pi/packages/ta-recall/lib/i18n.js +83 -0
- package/dist/pi/packages/ta-recall/lib/index.d.ts +9 -0
- package/dist/pi/packages/ta-recall/lib/index.js +45 -0
- package/dist/pi/packages/ta-recall/lib/react.d.ts +11 -0
- package/dist/pi/packages/ta-recall/lib/react.js +16 -0
- package/dist/pi/packages/ta-recall/lib/recall-protocol.d.ts +186 -0
- package/dist/pi/packages/ta-recall/lib/recall-protocol.js +60 -0
- package/dist/pi/packages/ta-recall/lib/recall-service.d.ts +42 -0
- package/dist/pi/packages/ta-recall/lib/recall-service.js +241 -0
- package/dist/pi/packages/ta-recall/lib/search-source.d.ts +7 -0
- package/dist/pi/packages/ta-recall/lib/search-source.js +49 -0
- package/dist/pi/packages/ta-recall/lib/search-util.d.ts +30 -0
- package/dist/pi/packages/ta-recall/lib/search-util.js +167 -0
- package/dist/pi/packages/ta-recall/lib/server-texts.d.ts +7 -0
- package/dist/pi/packages/ta-recall/lib/server-texts.js +17 -0
- package/dist/pi/packages/ta-recall/lib/settings.d.ts +4 -0
- package/dist/pi/packages/ta-recall/lib/settings.js +77 -0
- package/dist/pi/packages/ta-recall/lib/skill-card.d.ts +9 -0
- package/dist/pi/packages/ta-recall/lib/skill-card.js +51 -0
- package/dist/pi/packages/ta-recall/lib/skill-util.d.ts +19 -0
- package/dist/pi/packages/ta-recall/lib/skill-util.js +110 -0
- package/dist/pi/packages/ta-recall/lib/stored.d.ts +5 -0
- package/dist/pi/packages/ta-recall/lib/stored.js +28 -0
- package/dist/pi/packages/ta-recall/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-recall/lib/style.js +48 -0
- package/dist/pi/packages/ta-recall/lib/tool-line.d.ts +10 -0
- package/dist/pi/packages/ta-recall/lib/tool-line.js +23 -0
- package/dist/pi/packages/ta-recall/lib/tool.d.ts +63 -0
- package/dist/pi/packages/ta-recall/lib/tool.js +71 -0
- package/dist/pi/packages/ta-recall/package.json +55 -0
- package/dist/pi/packages/ta-recall/web/index.js +1038 -0
- package/dist/pi/packages/ta-rooms/README.en.md +23 -0
- package/dist/pi/packages/ta-rooms/README.md +23 -0
- package/dist/pi/packages/ta-rooms/lib/dialogs.d.ts +39 -0
- package/dist/pi/packages/ta-rooms/lib/dialogs.js +235 -0
- package/dist/pi/packages/ta-rooms/lib/i18n.d.ts +101 -0
- package/dist/pi/packages/ta-rooms/lib/i18n.js +203 -0
- package/dist/pi/packages/ta-rooms/lib/index.d.ts +9 -0
- package/dist/pi/packages/ta-rooms/lib/index.js +85 -0
- package/dist/pi/packages/ta-rooms/lib/members-view.d.ts +3 -0
- package/dist/pi/packages/ta-rooms/lib/members-view.js +64 -0
- package/dist/pi/packages/ta-rooms/lib/page.d.ts +105 -0
- package/dist/pi/packages/ta-rooms/lib/page.js +306 -0
- package/dist/pi/packages/ta-rooms/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-rooms/lib/react.js +8 -0
- package/dist/pi/packages/ta-rooms/lib/room-view.d.ts +17 -0
- package/dist/pi/packages/ta-rooms/lib/room-view.js +150 -0
- package/dist/pi/packages/ta-rooms/lib/rooms-page.d.ts +8 -0
- package/dist/pi/packages/ta-rooms/lib/rooms-page.js +174 -0
- package/dist/pi/packages/ta-rooms/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-rooms/lib/style.js +154 -0
- package/dist/pi/packages/ta-rooms/package.json +50 -0
- package/dist/pi/packages/ta-rooms/web/index.js +1932 -0
- package/dist/pi/packages/ta-share/README.en.md +27 -0
- package/dist/pi/packages/ta-share/README.md +27 -0
- package/dist/pi/packages/ta-share/extension/index.mjs +184 -0
- package/dist/pi/packages/ta-share/host/index.mjs +364 -0
- package/dist/pi/packages/ta-share/lib/extension.d.ts +15 -0
- package/dist/pi/packages/ta-share/lib/extension.js +115 -0
- package/dist/pi/packages/ta-share/lib/host.d.ts +4 -0
- package/dist/pi/packages/ta-share/lib/host.js +9 -0
- package/dist/pi/packages/ta-share/lib/i18n.d.ts +106 -0
- package/dist/pi/packages/ta-share/lib/i18n.js +213 -0
- package/dist/pi/packages/ta-share/lib/index.d.ts +9 -0
- package/dist/pi/packages/ta-share/lib/index.js +77 -0
- package/dist/pi/packages/ta-share/lib/page.d.ts +48 -0
- package/dist/pi/packages/ta-share/lib/page.js +105 -0
- package/dist/pi/packages/ta-share/lib/react.d.ts +8 -0
- package/dist/pi/packages/ta-share/lib/react.js +8 -0
- package/dist/pi/packages/ta-share/lib/server-texts.d.ts +14 -0
- package/dist/pi/packages/ta-share/lib/server-texts.js +52 -0
- package/dist/pi/packages/ta-share/lib/share-dialog.d.ts +18 -0
- package/dist/pi/packages/ta-share/lib/share-dialog.js +233 -0
- package/dist/pi/packages/ta-share/lib/share-protocol.d.ts +86 -0
- package/dist/pi/packages/ta-share/lib/share-protocol.js +30 -0
- package/dist/pi/packages/ta-share/lib/share-service.d.ts +50 -0
- package/dist/pi/packages/ta-share/lib/share-service.js +130 -0
- package/dist/pi/packages/ta-share/lib/shared-view.d.ts +18 -0
- package/dist/pi/packages/ta-share/lib/shared-view.js +225 -0
- package/dist/pi/packages/ta-share/lib/shares-page.d.ts +3 -0
- package/dist/pi/packages/ta-share/lib/shares-page.js +54 -0
- package/dist/pi/packages/ta-share/lib/snapshot.d.ts +30 -0
- package/dist/pi/packages/ta-share/lib/snapshot.js +195 -0
- package/dist/pi/packages/ta-share/lib/style.d.ts +4 -0
- package/dist/pi/packages/ta-share/lib/style.js +111 -0
- package/dist/pi/packages/ta-share/package.json +56 -0
- package/dist/pi/packages/ta-share/web/index.js +1197 -0
- package/dist/pi/packages/ta-workspace/README.md +2 -2
- package/dist/pi/packages/ta-workspace/README.zh-cn.md +2 -2
- package/dist/pi/packages/ta-workspace/lib/browser-common.d.ts +1 -1
- package/dist/pi/packages/ta-workspace/lib/browser-common.js +29 -30
- package/dist/pi/packages/ta-workspace/lib/browser-tool-line.d.ts +15 -0
- package/dist/pi/packages/ta-workspace/lib/browser-tool-line.js +70 -0
- package/dist/pi/packages/ta-workspace/lib/bytes.d.ts +11 -0
- package/dist/pi/packages/ta-workspace/lib/bytes.js +40 -0
- package/dist/pi/packages/ta-workspace/lib/common.d.ts +2 -1
- package/dist/pi/packages/ta-workspace/lib/common.js +15 -37
- package/dist/pi/packages/ta-workspace/lib/editors.js +40 -4
- package/dist/pi/packages/ta-workspace/lib/i18n.d.ts +14 -4
- package/dist/pi/packages/ta-workspace/lib/i18n.js +31 -11
- package/dist/pi/packages/ta-workspace/lib/index.js +17 -0
- package/dist/pi/packages/ta-workspace/lib/launcher.d.ts +9 -0
- package/dist/pi/packages/ta-workspace/lib/launcher.js +39 -0
- package/dist/pi/packages/ta-workspace/lib/preview.d.ts +22 -3
- package/dist/pi/packages/ta-workspace/lib/preview.js +150 -22
- package/dist/pi/packages/ta-workspace/lib/style.d.ts +1 -1
- package/dist/pi/packages/ta-workspace/lib/style.js +70 -41
- package/dist/pi/packages/ta-workspace/lib/terminal-sessions.d.ts +15 -4
- package/dist/pi/packages/ta-workspace/lib/terminal-sessions.js +31 -9
- package/dist/pi/packages/ta-workspace/lib/terminal.d.ts +3 -2
- package/dist/pi/packages/ta-workspace/lib/terminal.js +51 -21
- package/dist/pi/packages/ta-workspace/lib/util/keys.d.ts +18 -0
- package/dist/pi/packages/ta-workspace/lib/util/keys.js +23 -0
- package/dist/pi/packages/ta-workspace/lib/util/preview.d.ts +46 -0
- package/dist/pi/packages/ta-workspace/lib/util/preview.js +106 -1
- package/dist/pi/packages/ta-workspace/lib/util/terminal.d.ts +5 -0
- package/dist/pi/packages/ta-workspace/lib/util/terminal.js +14 -0
- package/dist/pi/packages/ta-workspace/package.json +1 -1
- package/dist/pi/packages/ta-workspace/web/index.js +1032 -382
- package/dist/public/assets/OrbitControls-DVf70a7w.js +1 -0
- package/dist/public/assets/{abnfDiagram-S7VZAUFO-EVMX_yOb.js → abnfDiagram-S7VZAUFO-D9uU0Tx2.js} +1 -1
- package/dist/public/assets/{architecture-WOLXFQ4H-CDgbgZ_o.js → architecture-WOLXFQ4H-f7Nm7EIo.js} +1 -1
- package/dist/public/assets/{architectureDiagram-YGSQEFNW-dHreaCWz.js → architectureDiagram-YGSQEFNW-DSAqlcms.js} +1 -1
- package/dist/public/assets/{blockDiagram-APKKGZFW-D6FhzBDq.js → blockDiagram-APKKGZFW-C0lPIW9g.js} +1 -1
- package/dist/public/assets/browser-WLpgVYno.js +12 -0
- package/dist/public/assets/{c4Diagram-KJ2TOQU5-BFpcr8Cs.js → c4Diagram-KJ2TOQU5-CDcZ7mJq.js} +1 -1
- package/dist/public/assets/{chunk-6MUBBAK2-BczXkMV-.js → chunk-6MUBBAK2-CXPuyqPL.js} +1 -1
- package/dist/public/assets/{chunk-AXFCVDMN-CjJsv3jB.js → chunk-AXFCVDMN-Du6JRX1x.js} +1 -1
- package/dist/public/assets/{chunk-BG4553SI-FBaleaLz.js → chunk-BG4553SI-D592E55X.js} +1 -1
- package/dist/public/assets/{chunk-DQASFODM-BFdXY5sX.js → chunk-DQASFODM-BW2r2SL4.js} +1 -1
- package/dist/public/assets/{chunk-HFQBQIA3-C5cwK-Fg.js → chunk-HFQBQIA3-C3yoe54R.js} +1 -1
- package/dist/public/assets/{chunk-KQLB2F66-BUek3IRk.js → chunk-KQLB2F66-DF8gfYCy.js} +1 -1
- package/dist/public/assets/{chunk-KS47KZWR-BxsYBzt6.js → chunk-KS47KZWR-C8CRMTv1.js} +1 -1
- package/dist/public/assets/{chunk-LEVMRMFU-Bdcwz9fS.js → chunk-LEVMRMFU-BDcMKiwj.js} +1 -1
- package/dist/public/assets/{chunk-M57EVK23-kkpP5oug.js → chunk-M57EVK23-CKJPBygc.js} +1 -1
- package/dist/public/assets/{chunk-OY52VR5R-CFhQgxmD.js → chunk-OY52VR5R-B3ZWH07L.js} +1 -1
- package/dist/public/assets/{chunk-QB3YPZ4I-BVXqu0eC.js → chunk-QB3YPZ4I-DI-z4UPL.js} +1 -1
- package/dist/public/assets/{chunk-R3KSYZAL-B7SUqqLI.js → chunk-R3KSYZAL-Bg4-haAc.js} +1 -1
- package/dist/public/assets/{chunk-STOXU5M4-B3abfbnH.js → chunk-STOXU5M4-l_SHib3p.js} +1 -1
- package/dist/public/assets/{chunk-TU62E6Q5-C9NqnUav.js → chunk-TU62E6Q5-BINu9tIm.js} +1 -1
- package/dist/public/assets/{chunk-X4PVCEUW-BeLfETDx.js → chunk-X4PVCEUW-BQn-mvV5.js} +1 -1
- package/dist/public/assets/{chunk-XXDRQBXY-DXai1i8p.js → chunk-XXDRQBXY-uvpAu0Ys.js} +1 -1
- package/dist/public/assets/{classDiagram-v2-L25IHNXF-Zj6ne_tC.js → classDiagram-v2-L25IHNXF-BIowooW1.js} +1 -1
- package/dist/public/assets/{cose-bilkent-JH36ORCC-C0-TjqfJ.js → cose-bilkent-JH36ORCC-BTyx1Mh2.js} +1 -1
- package/dist/public/assets/cynefin-EF2NZ3EQ-Dg54eFzZ.js +1 -0
- package/dist/public/assets/{cynefinDiagram-L36ESFBY-BnqxfzPa.js → cynefinDiagram-L36ESFBY-D64EU9I0.js} +1 -1
- package/dist/public/assets/{d3-selection-DfFLTR9d.js → d3-selection-CN9k6_B9.js} +1 -1
- package/dist/public/assets/{dagre-SPEB5RXH-kI17e5cH.js → dagre-SPEB5RXH-FCbz2-Kk.js} +1 -1
- package/dist/public/assets/{diagram-3B7GL73J-DgPjeLA5.js → diagram-3B7GL73J-OhHUSI7j.js} +1 -1
- package/dist/public/assets/{diagram-DNEMPZML-CRhPfa0I.js → diagram-DNEMPZML-Be4xMtp6.js} +1 -1
- package/dist/public/assets/{diagram-L3MUGCDN-ExuTg12b.js → diagram-L3MUGCDN-CmKSs3aG.js} +1 -1
- package/dist/public/assets/{diagram-LA4NIPWU-Dgx5xNiY.js → diagram-LA4NIPWU-D1C32rMN.js} +1 -1
- package/dist/public/assets/{diagram-MHCOC4E2-BuifkUTl.js → diagram-MHCOC4E2-BjoE6JXs.js} +1 -1
- package/dist/public/assets/{diagram-XPFHEONP-CFEaBo7z.js → diagram-XPFHEONP-B22k4v8R.js} +1 -1
- package/dist/public/assets/{dist-C-iJHcSK.js → dist-DcBP8Cf6.js} +1 -1
- package/dist/public/assets/{ebnfDiagram-UZSYDL2S-D-hp5yNt.js → ebnfDiagram-UZSYDL2S-Tn-K8-X7.js} +1 -1
- package/dist/public/assets/{editor.api-BopUWpqY.js → editor.api-Bz4sjRz_.js} +1 -1
- package/dist/public/assets/{elk-XV6XMXQE-CBbk_IpU.js → elk-XV6XMXQE-COnQsWlN.js} +1 -1
- package/dist/public/assets/{erDiagram-EYBAPDEH-B02R_WWE.js → erDiagram-EYBAPDEH-c53dJilq.js} +1 -1
- package/dist/public/assets/{eventmodeling-K75KTNOO-aCZfYnCI.js → eventmodeling-K75KTNOO-DaFpPPks.js} +1 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-V5qkYWIO.js +1 -0
- package/dist/public/assets/{freemarker2-DMN60LeK.js → freemarker2-BLxfRHsw.js} +1 -1
- package/dist/public/assets/{ganttDiagram-23REXITY-DioU8TlD.js → ganttDiagram-23REXITY-Md-SavIS.js} +1 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-1q8ldRXU.js +1 -0
- package/dist/public/assets/{gitGraphDiagram-STJD7YCW--q3ctg6y.js → gitGraphDiagram-STJD7YCW-CMSwTghO.js} +1 -1
- package/dist/public/assets/{handlebars-B_-qdvpB.js → handlebars-sNpu01kP.js} +1 -1
- package/dist/public/assets/{html-BN8Ah3Js.js → html-C_tKd-uP.js} +1 -1
- package/dist/public/assets/{index-B3A--ac8.js → index-Bn86rI4n.js} +2 -2
- package/dist/public/assets/info-OHQRW6UA-Crere6sx.js +1 -0
- package/dist/public/assets/{infoDiagram-KBXO4MBG-CGXteYo9.js → infoDiagram-KBXO4MBG-CwgNj-7i.js} +1 -1
- package/dist/public/assets/{ishikawaDiagram-M35NCXHK-DM2LmOAc.js → ishikawaDiagram-M35NCXHK-BSlzQNMN.js} +1 -1
- package/dist/public/assets/{javascript-BlizGb0q.js → javascript-l3qKw0L-.js} +1 -1
- package/dist/public/assets/{journeyDiagram-OPLOXDXO-CNITRtGl.js → journeyDiagram-OPLOXDXO-B09LPEnF.js} +1 -1
- package/dist/public/assets/{jsonMode-CEUmT5sN.js → jsonMode-5SQQn1EX.js} +1 -1
- package/dist/public/assets/{kanban-definition-BZKZHSQY-BPUuS9um.js → kanban-definition-BZKZHSQY-BiW4aJ29.js} +1 -1
- package/dist/public/assets/{liquid-BbyLjUbE.js → liquid-BGyTIIUt.js} +1 -1
- package/dist/public/assets/{mdx-DiQz7Q35.js → mdx-8tGjz4em.js} +1 -1
- package/dist/public/assets/{mermaid-parser.core-Dum100hC.js → mermaid-parser.core-CctN5b0z.js} +3 -3
- package/dist/public/assets/{mermaid.core-BWmWf6XO.js → mermaid.core-7ERSdZ4-.js} +4 -4
- package/dist/public/assets/{mindmap-definition-I2QAS2VK-L8HyYUDY.js → mindmap-definition-I2QAS2VK-D-GOUwW1.js} +1 -1
- package/dist/public/assets/module-DEqsdd00.js +1 -0
- package/dist/public/assets/module-TWc52XwT.js +2244 -0
- package/dist/public/assets/{monaco-zOOyBmxy.js → monaco-B_9hlk78.js} +3 -3
- package/dist/public/assets/packet-JDAUHWVQ-qMf5LkHT.js +1 -0
- package/dist/public/assets/{pegDiagram-FD4XPPHP-CTZKPo0Z.js → pegDiagram-FD4XPPHP-Dmy1fWB3.js} +1 -1
- package/dist/public/assets/phaser.esm-BxCDEWDb.js +3202 -0
- package/dist/public/assets/pie-XZMESJXO-BjqLn4qm.js +1 -0
- package/dist/public/assets/{pieDiagram-J4AKIIQI-DAeT3dFi.js → pieDiagram-J4AKIIQI-CXFHLYTg.js} +1 -1
- package/dist/public/assets/{python-C984gt98.js → python-e-JK0s5M.js} +1 -1
- package/dist/public/assets/{quadrantDiagram-XTYBLID2--PXxwV1Z.js → quadrantDiagram-XTYBLID2-RQvEpGWO.js} +1 -1
- package/dist/public/assets/radar-ABXABTNO-DWO6t_4C.js +1 -0
- package/dist/public/assets/railroad-I3PHUGI6-D1XOJPWy.js +1 -0
- package/dist/public/assets/{railroad-abnf-LNEFI6M7-BYcFfrCa.js → railroad-abnf-LNEFI6M7-CDOSPZwX.js} +1 -1
- package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-Cd33qxAm.js → railroad-ebnf-DWYD2UWJ-BTrNQ0DX.js} +1 -1
- package/dist/public/assets/{railroad-peg-JR7BVNR7-C5TpzaU8.js → railroad-peg-JR7BVNR7-B7NtVofS.js} +1 -1
- package/dist/public/assets/{railroadDiagram-MRQ6NCDL-DlWwjbhH.js → railroadDiagram-MRQ6NCDL-DsDrT0Jf.js} +1 -1
- package/dist/public/assets/{razor-BBqMR1Qn.js → razor-DtSPwumi.js} +1 -1
- package/dist/public/assets/{requirementDiagram-Y7LWUY3S-CsYBy9HS.js → requirementDiagram-Y7LWUY3S-BQh0hFuA.js} +1 -1
- package/dist/public/assets/{sankeyDiagram-WGJFYUXA-Baxyb5p9.js → sankeyDiagram-WGJFYUXA-BUXNAQEF.js} +1 -1
- package/dist/public/assets/{sequenceDiagram-5NDRBG5M-Cq6VeBT_.js → sequenceDiagram-5NDRBG5M-05f-N5V_.js} +1 -1
- package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-O60WKaE7.js → stateDiagram-v2-FJ4FJNEA-D6V1fGWV.js} +1 -1
- package/dist/public/assets/{swimlanes-UMQ2AFYF-C2nf1-Cc.js → swimlanes-UMQ2AFYF-DWhlPvKs.js} +1 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-CRn5uHsY.js +8 -0
- package/dist/public/assets/three.module-CeVBJVoU.js +4225 -0
- package/dist/public/assets/{timeline-definition-SEUHKTQE-DEfUG6YH.js → timeline-definition-SEUHKTQE-CMdocOui.js} +1 -1
- package/dist/public/assets/treeView-D4JQ5SDB-D09wHNzT.js +1 -0
- package/dist/public/assets/treemap-SAJKECNS-ChxAT7Fq.js +1 -0
- package/dist/public/assets/{typescript-Gtq7f0aU.js → typescript-65jNyipU.js} +1 -1
- package/dist/public/assets/{usecaseDiagram-AFA6YXN4-Gw9DyJcx.js → usecaseDiagram-AFA6YXN4-BQTHUX1f.js} +1 -1
- package/dist/public/assets/{vennDiagram-NNMJR3RB-Clb3MLWF.js → vennDiagram-NNMJR3RB-BULkVTfA.js} +1 -1
- package/dist/public/assets/wardley-7MLQ67FV-DfSjKzbJ.js +1 -0
- package/dist/public/assets/{wardleyDiagram-S7YFUSEH-BrTRpwu2.js → wardleyDiagram-S7YFUSEH-Cek6l8lz.js} +1 -1
- package/dist/public/assets/{xml-Bx3nk7iG.js → xml-DWBejfu-.js} +1 -1
- package/dist/public/assets/{xychartDiagram-GGNKY7IX-BfjTcIsb.js → xychartDiagram-GGNKY7IX-ujnZQTWA.js} +1 -1
- package/dist/public/assets/{yaml-dFLE_rSl.js → yaml-CwRCT7q1.js} +1 -1
- package/dist/public/index.html +1 -1
- package/dist/public/launch.svg +46 -42
- package/dist/serve/index.mjs +8244 -3756
- package/package.json +33 -26
- package/dist/pi/dist/bundle/chunks/anthropic-messages-BWGCKOF4.js +0 -6
- package/dist/pi/dist/bundle/chunks/chunk-44DLKSKE.js +0 -1232
- package/dist/pi/dist/bundle/chunks/chunk-62VOPMLK.js +0 -65
- package/dist/pi/dist/bundle/chunks/chunk-7O7QKK6A.js +0 -2
- package/dist/pi/dist/bundle/chunks/chunk-CHWNPHIS.js +0 -82
- package/dist/pi/dist/bundle/chunks/chunk-NL4X6LBY.js +0 -4
- package/dist/pi/dist/bundle/chunks/chunk-NZY7EIPA.js +0 -4
- package/dist/pi/dist/bundle/chunks/chunk-R2EGYMOO.js +0 -7
- package/dist/pi/dist/bundle/chunks/chunk-UKVNB6C4.js +0 -2
- package/dist/pi/dist/bundle/chunks/chunk-USJZMAIR.js +0 -2
- package/dist/pi/dist/bundle/chunks/chunk-VOLAXWGI.js +0 -2
- package/dist/pi/dist/bundle/chunks/openai-codex-responses-QAWLOQSN.js +0 -10
- package/dist/pi/dist/bundle/chunks/openai-responses-MD3562FB.js +0 -4
- package/dist/pi/dist/bundle/chunks/virtual-modules-O76XM3OB.js +0 -2
- package/dist/public/assets/browser-y6EDNUmc.js +0 -12
- package/dist/public/assets/cynefin-EF2NZ3EQ-CoY4CrZu.js +0 -1
- package/dist/public/assets/flowDiagram-MALGAFMO-CATkJShO.js +0 -1
- package/dist/public/assets/gitGraph-VSP46ZUC-g4yHXXxx.js +0 -1
- package/dist/public/assets/info-OHQRW6UA-CKADJjz4.js +0 -1
- package/dist/public/assets/module-CH7IXa5L.js +0 -1781
- package/dist/public/assets/module-DNAasuMC.js +0 -1
- package/dist/public/assets/packet-JDAUHWVQ-CpKMhX4K.js +0 -1
- package/dist/public/assets/pie-XZMESJXO-CW-zGDRd.js +0 -1
- package/dist/public/assets/radar-ABXABTNO-Cg8W433p.js +0 -1
- package/dist/public/assets/railroad-I3PHUGI6-DriMt2PQ.js +0 -1
- package/dist/public/assets/swimlanesDiagram-OMPLPG4O-B46JxqS8.js +0 -8
- package/dist/public/assets/treeView-D4JQ5SDB-1LhEWwC9.js +0 -1
- package/dist/public/assets/treemap-SAJKECNS-D3t3N7nS.js +0 -1
- package/dist/public/assets/wardley-7MLQ67FV-D3sAsd8p.js +0 -1
|
@@ -185,39 +185,26 @@ function useContextMenu() {
|
|
|
185
185
|
const target = event.currentTarget;
|
|
186
186
|
const box = target.getBoundingClientRect();
|
|
187
187
|
const pointer = "clientX" in event && (event.clientX || event.clientY);
|
|
188
|
-
setMenu({ x:
|
|
188
|
+
setMenu(pointer ? { x: event.clientX, y: event.clientY, around: { top: box.top, bottom: box.bottom }, items } : { x: box.left + 16, y: box.bottom, items });
|
|
189
189
|
}, []);
|
|
190
|
+
const close = React.useCallback(() => setMenu(undefined), []);
|
|
190
191
|
const element = menu ? /* @__PURE__ */ React.createElement(ContextMenu, {
|
|
191
192
|
...menu,
|
|
192
|
-
onClose:
|
|
193
|
+
onClose: close
|
|
193
194
|
}) : null;
|
|
194
195
|
return [element, open];
|
|
195
196
|
}
|
|
196
|
-
function
|
|
197
|
-
const probe = document.createElement("div");
|
|
198
|
-
probe.style.cssText = "position:fixed;visibility:hidden;pointer-events:none;padding-top:env(safe-area-inset-top)";
|
|
199
|
-
element.appendChild(probe);
|
|
200
|
-
const top = Number.parseFloat(getComputedStyle(probe).paddingTop) || 0;
|
|
201
|
-
probe.remove();
|
|
202
|
-
return top;
|
|
203
|
-
}
|
|
204
|
-
function ContextMenu({ x, y, items, onClose }) {
|
|
197
|
+
function ContextMenu({ x, y, around, items, onClose }) {
|
|
205
198
|
const root = React.useRef(null);
|
|
206
|
-
const [place, setPlace] = React.useState({ left: 0, top: 0, ready: false });
|
|
207
199
|
React.useLayoutEffect(() => {
|
|
208
200
|
const element = root.current;
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
const top = touch ? above >= safeTop + 4 ? above : clamp(y + 14, window.innerHeight - box.height) : y + box.height > window.innerHeight - 4 ? Math.max(4, y - box.height) : y;
|
|
217
|
-
setPlace({ left, top, ready: true });
|
|
218
|
-
}
|
|
219
|
-
root.current?.querySelector("button:not(:disabled)")?.focus();
|
|
220
|
-
}, [x, y]);
|
|
201
|
+
if (!element) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
const stop = pi.ui.attachMenu(element, { x, y, around }, onClose);
|
|
205
|
+
element.querySelector("button:not(:disabled)")?.focus();
|
|
206
|
+
return stop;
|
|
207
|
+
}, [x, y, around, onClose]);
|
|
221
208
|
React.useEffect(() => {
|
|
222
209
|
const close = (event) => {
|
|
223
210
|
if (!root.current?.contains(event.target)) {
|
|
@@ -249,7 +236,6 @@ function ContextMenu({ x, y, items, onClose }) {
|
|
|
249
236
|
ref: root,
|
|
250
237
|
className: "taw-menu",
|
|
251
238
|
role: "menu",
|
|
252
|
-
style: { left: place.left, top: place.top, visibility: place.ready ? "visible" : "hidden" },
|
|
253
239
|
onKeyDown,
|
|
254
240
|
onContextMenu: (event) => event.preventDefault()
|
|
255
241
|
}, items.map((item, index) => item === "-" ? /* @__PURE__ */ React.createElement("hr", {
|
|
@@ -462,12 +448,26 @@ var ZH = {
|
|
|
462
448
|
closeTabsToTheRight: "关闭右侧",
|
|
463
449
|
closeEnded: "关闭已退出的",
|
|
464
450
|
openCount: "{count} 个已打开",
|
|
451
|
+
workbench: "工作台",
|
|
465
452
|
explorer: "资源管理器",
|
|
466
453
|
openFiles: "打开的文件",
|
|
467
454
|
search: "搜索",
|
|
468
455
|
scm: "源代码管理",
|
|
469
456
|
terminal: "终端",
|
|
470
457
|
browser: "浏览器",
|
|
458
|
+
agentNavigate: "打开网页",
|
|
459
|
+
agentBack: "网页后退",
|
|
460
|
+
agentForward: "网页前进",
|
|
461
|
+
agentReload: "刷新网页",
|
|
462
|
+
agentSnapshot: "读取网页",
|
|
463
|
+
agentClick: "点击",
|
|
464
|
+
agentType: "输入",
|
|
465
|
+
agentPress: "按键",
|
|
466
|
+
agentScroll: "滚动网页",
|
|
467
|
+
agentScreenshot: "网页截图",
|
|
468
|
+
agentEvaluate: "在网页里运行",
|
|
469
|
+
agentWait: "等待网页",
|
|
470
|
+
agentCdp: "调试网页",
|
|
471
471
|
refresh: "刷新",
|
|
472
472
|
collapseAll: "全部折叠",
|
|
473
473
|
showExcluded: "显示默认隐藏的文件(.git、.DS_Store 等)",
|
|
@@ -508,18 +508,16 @@ var ZH = {
|
|
|
508
508
|
forward: "前进",
|
|
509
509
|
openExternal: "在新窗口打开",
|
|
510
510
|
recent: "最近访问",
|
|
511
|
-
browserTitle: "在这里打开网页",
|
|
512
|
-
browserHint: "输入网址或搜索,也可以打开本机的开发服务器。",
|
|
513
511
|
home: "起始页",
|
|
514
512
|
removeRecent: "从最近访问中移除",
|
|
515
|
-
frameHint: "
|
|
513
|
+
frameHint: "页面空白时,可在新窗口打开",
|
|
516
514
|
stop: "停止",
|
|
517
515
|
openBrowser: "在默认浏览器中打开",
|
|
518
516
|
loadFailed: "无法打开这个网页",
|
|
519
517
|
pageCrashed: "这个网页崩溃了",
|
|
520
518
|
retry: "重试",
|
|
521
519
|
agentDriving: "Ta 正在操作",
|
|
522
|
-
importSignIns: "
|
|
520
|
+
importSignIns: "导入浏览器登录状态",
|
|
523
521
|
importTitle: "导入登录状态",
|
|
524
522
|
importHint: "把所选浏览器的 Cookie 复制到这里,你和 Agent 都能直接使用已登录的网站。不导入密码和浏览记录。",
|
|
525
523
|
importFrom: "从哪个浏览器导入",
|
|
@@ -547,9 +545,7 @@ var ZH = {
|
|
|
547
545
|
save: "保存",
|
|
548
546
|
saveFailed: "保存失败:{message}",
|
|
549
547
|
changedOnDisk: "文件已在磁盘上更改。",
|
|
550
|
-
reload: "放弃我的更改"
|
|
551
|
-
fit: "适应窗口",
|
|
552
|
-
actualSize: "实际大小"
|
|
548
|
+
reload: "放弃我的更改"
|
|
553
549
|
};
|
|
554
550
|
var EN = {
|
|
555
551
|
newFile: "New File…",
|
|
@@ -658,12 +654,26 @@ var EN = {
|
|
|
658
654
|
closeTabsToTheRight: "Close to the Right",
|
|
659
655
|
closeEnded: "Close Exited",
|
|
660
656
|
openCount: "{count} open",
|
|
657
|
+
workbench: "Workbench",
|
|
661
658
|
explorer: "Explorer",
|
|
662
659
|
openFiles: "Open files",
|
|
663
660
|
search: "Search",
|
|
664
661
|
scm: "Source control",
|
|
665
662
|
terminal: "Terminal",
|
|
666
663
|
browser: "Browser",
|
|
664
|
+
agentNavigate: "Open",
|
|
665
|
+
agentBack: "Go back",
|
|
666
|
+
agentForward: "Go forward",
|
|
667
|
+
agentReload: "Reload the page",
|
|
668
|
+
agentSnapshot: "Read the page",
|
|
669
|
+
agentClick: "Click",
|
|
670
|
+
agentType: "Type",
|
|
671
|
+
agentPress: "Press",
|
|
672
|
+
agentScroll: "Scroll the page",
|
|
673
|
+
agentScreenshot: "Screenshot the page",
|
|
674
|
+
agentEvaluate: "Run in the page",
|
|
675
|
+
agentWait: "Wait for the page",
|
|
676
|
+
agentCdp: "Debug the page",
|
|
667
677
|
refresh: "Refresh",
|
|
668
678
|
collapseAll: "Collapse all",
|
|
669
679
|
showExcluded: "Show files hidden by default (.git, .DS_Store…)",
|
|
@@ -704,11 +714,9 @@ var EN = {
|
|
|
704
714
|
forward: "Forward",
|
|
705
715
|
openExternal: "Open in a new window",
|
|
706
716
|
recent: "Recent",
|
|
707
|
-
browserTitle: "Open a page here",
|
|
708
|
-
browserHint: "Enter an address or search, or open a dev server on this machine.",
|
|
709
717
|
home: "Start page",
|
|
710
718
|
removeRecent: "Remove from recent",
|
|
711
|
-
frameHint: "
|
|
719
|
+
frameHint: "Page blank? Open it in a new window",
|
|
712
720
|
stop: "Stop",
|
|
713
721
|
openBrowser: "Open in the default browser",
|
|
714
722
|
loadFailed: "This page did not open",
|
|
@@ -743,9 +751,7 @@ var EN = {
|
|
|
743
751
|
save: "Save",
|
|
744
752
|
saveFailed: "Could not save: {message}",
|
|
745
753
|
changedOnDisk: "The file changed on disk.",
|
|
746
|
-
reload: "Discard my changes"
|
|
747
|
-
fit: "Fit to window",
|
|
748
|
-
actualSize: "Actual size"
|
|
754
|
+
reload: "Discard my changes"
|
|
749
755
|
};
|
|
750
756
|
function t(key, vars = {}) {
|
|
751
757
|
const words = pi.ui.language === "zh-CN" ? ZH : EN;
|
|
@@ -1258,13 +1264,12 @@ var Recent;
|
|
|
1258
1264
|
}
|
|
1259
1265
|
})(Recent ||= {});
|
|
1260
1266
|
var SUGGESTIONS = ["localhost:5173", "localhost:3000", "localhost:8080"];
|
|
1261
|
-
function
|
|
1267
|
+
function siteOf(url) {
|
|
1262
1268
|
try {
|
|
1263
1269
|
const parsed = new URL(url);
|
|
1264
|
-
|
|
1265
|
-
return { host: parsed.host || url, rest };
|
|
1270
|
+
return { host: parsed.host || url, icon: parsed.host ? `${parsed.origin}/favicon.ico` : undefined };
|
|
1266
1271
|
} catch {
|
|
1267
|
-
return { host: url
|
|
1272
|
+
return { host: url };
|
|
1268
1273
|
}
|
|
1269
1274
|
}
|
|
1270
1275
|
function AddressIcon({ value, loading, favicon }) {
|
|
@@ -1384,61 +1389,62 @@ function BrowserBar(props) {
|
|
|
1384
1389
|
className: "taw-browser-loading"
|
|
1385
1390
|
}) : undefined);
|
|
1386
1391
|
}
|
|
1387
|
-
function
|
|
1388
|
-
const
|
|
1392
|
+
function Site({ address, onOpen, onRemove }) {
|
|
1393
|
+
const { host, icon } = siteOf(address);
|
|
1394
|
+
const name = host.replace(/^www\./, "");
|
|
1395
|
+
const local = WorkspaceUtil.localPort(address) !== undefined;
|
|
1396
|
+
const [broken, setBroken] = React.useState(local || !icon);
|
|
1397
|
+
let index = 0;
|
|
1398
|
+
for (const char of name) {
|
|
1399
|
+
index = (index * 31 + char.charCodeAt(0)) % 9;
|
|
1400
|
+
}
|
|
1389
1401
|
return /* @__PURE__ */ React.createElement("div", {
|
|
1390
|
-
className:
|
|
1391
|
-
}, /* @__PURE__ */ React.createElement("
|
|
1392
|
-
|
|
1402
|
+
className: "taw-browser-site"
|
|
1403
|
+
}, /* @__PURE__ */ React.createElement("button", {
|
|
1404
|
+
type: "button",
|
|
1405
|
+
className: "taw-browser-site-main",
|
|
1406
|
+
title: address,
|
|
1407
|
+
onClick: () => onOpen(address)
|
|
1393
1408
|
}, /* @__PURE__ */ React.createElement("span", {
|
|
1394
|
-
className: "taw-browser-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
},
|
|
1409
|
+
className: "taw-browser-tile",
|
|
1410
|
+
style: local ? undefined : { "--taw-tint": `var(--ta-tint-${index})`, "--taw-ink": `var(--ta-tint-ink-${index})` }
|
|
1411
|
+
}, broken ? local ? /* @__PURE__ */ React.createElement(Glyph, {
|
|
1412
|
+
name: "Server",
|
|
1413
|
+
size: 18
|
|
1414
|
+
}) : name.charAt(0).toUpperCase() : /* @__PURE__ */ React.createElement("img", {
|
|
1415
|
+
src: icon,
|
|
1416
|
+
alt: "",
|
|
1417
|
+
referrerPolicy: "no-referrer",
|
|
1418
|
+
onError: () => setBroken(true)
|
|
1419
|
+
})), /* @__PURE__ */ React.createElement("span", {
|
|
1420
|
+
className: "taw-browser-host"
|
|
1421
|
+
}, name)), onRemove ? /* @__PURE__ */ React.createElement("button", {
|
|
1405
1422
|
type: "button",
|
|
1423
|
+
className: "taw-action taw-browser-remove",
|
|
1424
|
+
title: t("removeRecent"),
|
|
1425
|
+
"aria-label": t("removeRecent"),
|
|
1426
|
+
onClick: onRemove
|
|
1427
|
+
}, /* @__PURE__ */ React.createElement(Glyph, {
|
|
1428
|
+
name: "X",
|
|
1429
|
+
size: 11
|
|
1430
|
+
})) : undefined);
|
|
1431
|
+
}
|
|
1432
|
+
function Home({ onOpen, foot, extra }) {
|
|
1433
|
+
const recent = React.useSyncExternalStore(Recent.subscribe, Recent.all);
|
|
1434
|
+
const sites = recent.length > 0 ? recent : SUGGESTIONS.map((address) => `http://${address}`);
|
|
1435
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
1436
|
+
className: "taw-browser-home"
|
|
1437
|
+
}, /* @__PURE__ */ React.createElement("nav", {
|
|
1438
|
+
className: "taw-browser-sites",
|
|
1439
|
+
"aria-label": t("recent")
|
|
1440
|
+
}, sites.map((address) => /* @__PURE__ */ React.createElement(Site, {
|
|
1406
1441
|
key: address,
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
}, /* @__PURE__ */ React.createElement("h3", {
|
|
1412
|
-
className: "taw-browser-heading"
|
|
1413
|
-
}, t("recent")), recent.map((address) => {
|
|
1414
|
-
const { host, rest } = parts(address);
|
|
1415
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
1416
|
-
key: address,
|
|
1417
|
-
className: "taw-browser-site"
|
|
1418
|
-
}, /* @__PURE__ */ React.createElement("button", {
|
|
1419
|
-
type: "button",
|
|
1420
|
-
className: "taw-browser-site-main",
|
|
1421
|
-
title: address,
|
|
1422
|
-
onClick: () => onOpen(address)
|
|
1423
|
-
}, /* @__PURE__ */ React.createElement("span", {
|
|
1424
|
-
className: "taw-browser-letter"
|
|
1425
|
-
}, host.replace(/^www\./, "").charAt(0).toUpperCase()), /* @__PURE__ */ React.createElement("span", {
|
|
1426
|
-
className: "taw-browser-host"
|
|
1427
|
-
}, host), /* @__PURE__ */ React.createElement("span", {
|
|
1428
|
-
className: "taw-browser-path"
|
|
1429
|
-
}, rest)), /* @__PURE__ */ React.createElement("button", {
|
|
1430
|
-
type: "button",
|
|
1431
|
-
className: "taw-action taw-browser-remove",
|
|
1432
|
-
title: t("removeRecent"),
|
|
1433
|
-
"aria-label": t("removeRecent"),
|
|
1434
|
-
onClick: () => Recent.remove(address)
|
|
1435
|
-
}, /* @__PURE__ */ React.createElement(Glyph, {
|
|
1436
|
-
name: "X",
|
|
1437
|
-
size: 13
|
|
1438
|
-
})));
|
|
1439
|
-
})) : undefined, foot ? /* @__PURE__ */ React.createElement("p", {
|
|
1442
|
+
address,
|
|
1443
|
+
onOpen,
|
|
1444
|
+
onRemove: recent.length > 0 ? () => Recent.remove(address) : undefined
|
|
1445
|
+
}))), extra || foot ? /* @__PURE__ */ React.createElement("footer", {
|
|
1440
1446
|
className: "taw-browser-foot"
|
|
1441
|
-
}, foot) : undefined);
|
|
1447
|
+
}, extra, foot ? /* @__PURE__ */ React.createElement("span", null, foot) : undefined) : undefined);
|
|
1442
1448
|
}
|
|
1443
1449
|
var ShowPage = new Channel;
|
|
1444
1450
|
function useForwarded(url, cwd) {
|
|
@@ -1604,13 +1610,13 @@ var BrowserSnapshot;
|
|
|
1604
1610
|
}
|
|
1605
1611
|
BrowserSnapshot.center = center;
|
|
1606
1612
|
function key(input) {
|
|
1607
|
-
const
|
|
1608
|
-
const name = input.endsWith("++") || input === "+" ? "+" :
|
|
1613
|
+
const parts = input.split("+");
|
|
1614
|
+
const name = input.endsWith("++") || input === "+" ? "+" : parts.pop();
|
|
1609
1615
|
if (!name) {
|
|
1610
1616
|
return;
|
|
1611
1617
|
}
|
|
1612
1618
|
let modifiers = 0;
|
|
1613
|
-
for (const part of input === "+" ? [] :
|
|
1619
|
+
for (const part of input === "+" ? [] : parts.filter(Boolean)) {
|
|
1614
1620
|
const bit = MODIFIERS[part.toLowerCase()];
|
|
1615
1621
|
if (bit === undefined) {
|
|
1616
1622
|
return;
|
|
@@ -2417,6 +2423,96 @@ function BrowserView() {
|
|
|
2417
2423
|
return pi.ui.supportsWebview ? /* @__PURE__ */ React.createElement(WebviewBrowser, null) : /* @__PURE__ */ React.createElement(FrameBrowser, null);
|
|
2418
2424
|
}
|
|
2419
2425
|
|
|
2426
|
+
// web-src/browser-tool-line.ts
|
|
2427
|
+
var VERBS = {
|
|
2428
|
+
navigate: "agentNavigate",
|
|
2429
|
+
back: "agentBack",
|
|
2430
|
+
forward: "agentForward",
|
|
2431
|
+
reload: "agentReload",
|
|
2432
|
+
snapshot: "agentSnapshot",
|
|
2433
|
+
click: "agentClick",
|
|
2434
|
+
type: "agentType",
|
|
2435
|
+
press: "agentPress",
|
|
2436
|
+
scroll: "agentScroll",
|
|
2437
|
+
screenshot: "agentScreenshot",
|
|
2438
|
+
evaluate: "agentEvaluate",
|
|
2439
|
+
wait: "agentWait",
|
|
2440
|
+
cdp: "agentCdp"
|
|
2441
|
+
};
|
|
2442
|
+
function text(value) {
|
|
2443
|
+
return typeof value === "string" ? value.trim() : "";
|
|
2444
|
+
}
|
|
2445
|
+
function at(args) {
|
|
2446
|
+
if (typeof args.ref === "number") {
|
|
2447
|
+
return `[${args.ref}]`;
|
|
2448
|
+
}
|
|
2449
|
+
return typeof args.x === "number" && typeof args.y === "number" ? `${Math.round(args.x)}, ${Math.round(args.y)}` : "";
|
|
2450
|
+
}
|
|
2451
|
+
var BrowserToolLine;
|
|
2452
|
+
((BrowserToolLine) => {
|
|
2453
|
+
function renderCall(args, words) {
|
|
2454
|
+
const action = text(args.action);
|
|
2455
|
+
const verb = words(VERBS[action] ?? "browser");
|
|
2456
|
+
switch (action) {
|
|
2457
|
+
case "navigate":
|
|
2458
|
+
return { verb, target: text(args.url) };
|
|
2459
|
+
case "click":
|
|
2460
|
+
return { verb, target: at(args) };
|
|
2461
|
+
case "type":
|
|
2462
|
+
return { verb, target: [at(args), text(args.text)].filter(Boolean).join(" ") };
|
|
2463
|
+
case "press":
|
|
2464
|
+
return { verb, target: text(args.key), code: true };
|
|
2465
|
+
case "scroll":
|
|
2466
|
+
return { verb, target: at(args) || (args.direction === "up" ? "↑" : args.direction === "down" ? "↓" : "") };
|
|
2467
|
+
case "evaluate":
|
|
2468
|
+
return { verb, target: text(args.expression).split(`
|
|
2469
|
+
`)[0], code: true };
|
|
2470
|
+
case "wait":
|
|
2471
|
+
return { verb, target: text(args.text) || (typeof args.ms === "number" ? `${args.ms} ms` : "") };
|
|
2472
|
+
case "cdp":
|
|
2473
|
+
return { verb, target: text(args.method), code: true };
|
|
2474
|
+
default:
|
|
2475
|
+
return { verb };
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
BrowserToolLine.renderCall = renderCall;
|
|
2479
|
+
function register(pi2, words) {
|
|
2480
|
+
pi2.registerToolRenderer?.((name, next) => name === AgentBrowser.TOOL.name ? { renderCall: (args) => renderCall(args, words) } : next());
|
|
2481
|
+
}
|
|
2482
|
+
BrowserToolLine.register = register;
|
|
2483
|
+
})(BrowserToolLine ||= {});
|
|
2484
|
+
|
|
2485
|
+
// web-src/bytes.ts
|
|
2486
|
+
function useFileBytesUrl(url, version) {
|
|
2487
|
+
const [state, setState] = React.useState({});
|
|
2488
|
+
React.useEffect(() => {
|
|
2489
|
+
if (!url) {
|
|
2490
|
+
setState({});
|
|
2491
|
+
return;
|
|
2492
|
+
}
|
|
2493
|
+
let live = true;
|
|
2494
|
+
let made;
|
|
2495
|
+
pi.files.read(url).then((file) => {
|
|
2496
|
+
if (!live) {
|
|
2497
|
+
return;
|
|
2498
|
+
}
|
|
2499
|
+
made = URL.createObjectURL(new Blob([file.data], { type: file.type }));
|
|
2500
|
+
setState({ url: made, size: file.size });
|
|
2501
|
+
}, (error) => {
|
|
2502
|
+
if (live) {
|
|
2503
|
+
setState({ error: Host.message(error) });
|
|
2504
|
+
}
|
|
2505
|
+
});
|
|
2506
|
+
return () => {
|
|
2507
|
+
live = false;
|
|
2508
|
+
if (made) {
|
|
2509
|
+
URL.revokeObjectURL(made);
|
|
2510
|
+
}
|
|
2511
|
+
};
|
|
2512
|
+
}, [url, version]);
|
|
2513
|
+
return state;
|
|
2514
|
+
}
|
|
2515
|
+
|
|
2420
2516
|
// web-src/util/seti.ts
|
|
2421
2517
|
var SETI_ICONS = [
|
|
2422
2518
|
[57379, "#d4d7d6", "#bfc2c1"],
|
|
@@ -3347,7 +3443,7 @@ function findClosingBracket(str, b) {
|
|
|
3347
3443
|
function outputLink(cap, link, raw, lexer) {
|
|
3348
3444
|
const href = link.href;
|
|
3349
3445
|
const title = link.title ? escape$1(link.title) : null;
|
|
3350
|
-
const
|
|
3446
|
+
const text2 = cap[1].replace(/\\([\[\]])/g, "$1");
|
|
3351
3447
|
if (cap[0].charAt(0) !== "!") {
|
|
3352
3448
|
lexer.state.inLink = true;
|
|
3353
3449
|
const token = {
|
|
@@ -3355,8 +3451,8 @@ function outputLink(cap, link, raw, lexer) {
|
|
|
3355
3451
|
raw,
|
|
3356
3452
|
href,
|
|
3357
3453
|
title,
|
|
3358
|
-
text,
|
|
3359
|
-
tokens: lexer.inlineTokens(
|
|
3454
|
+
text: text2,
|
|
3455
|
+
tokens: lexer.inlineTokens(text2)
|
|
3360
3456
|
};
|
|
3361
3457
|
lexer.state.inLink = false;
|
|
3362
3458
|
return token;
|
|
@@ -3366,16 +3462,16 @@ function outputLink(cap, link, raw, lexer) {
|
|
|
3366
3462
|
raw,
|
|
3367
3463
|
href,
|
|
3368
3464
|
title,
|
|
3369
|
-
text: escape$1(
|
|
3465
|
+
text: escape$1(text2)
|
|
3370
3466
|
};
|
|
3371
3467
|
}
|
|
3372
|
-
function indentCodeCompensation(raw,
|
|
3468
|
+
function indentCodeCompensation(raw, text2) {
|
|
3373
3469
|
const matchIndentToCode = raw.match(/^(\s+)(?:```)/);
|
|
3374
3470
|
if (matchIndentToCode === null) {
|
|
3375
|
-
return
|
|
3471
|
+
return text2;
|
|
3376
3472
|
}
|
|
3377
3473
|
const indentToCode = matchIndentToCode[1];
|
|
3378
|
-
return
|
|
3474
|
+
return text2.split(`
|
|
3379
3475
|
`).map((node) => {
|
|
3380
3476
|
const matchIndentInNode = node.match(/^\s+/);
|
|
3381
3477
|
if (matchIndentInNode === null) {
|
|
@@ -3409,13 +3505,13 @@ class _Tokenizer {
|
|
|
3409
3505
|
code(src) {
|
|
3410
3506
|
const cap = this.rules.block.code.exec(src);
|
|
3411
3507
|
if (cap) {
|
|
3412
|
-
const
|
|
3508
|
+
const text2 = cap[0].replace(/^ {1,4}/gm, "");
|
|
3413
3509
|
return {
|
|
3414
3510
|
type: "code",
|
|
3415
3511
|
raw: cap[0],
|
|
3416
3512
|
codeBlockStyle: "indented",
|
|
3417
|
-
text: !this.options.pedantic ? rtrim(
|
|
3418
|
-
`) :
|
|
3513
|
+
text: !this.options.pedantic ? rtrim(text2, `
|
|
3514
|
+
`) : text2
|
|
3419
3515
|
};
|
|
3420
3516
|
}
|
|
3421
3517
|
}
|
|
@@ -3423,33 +3519,33 @@ class _Tokenizer {
|
|
|
3423
3519
|
const cap = this.rules.block.fences.exec(src);
|
|
3424
3520
|
if (cap) {
|
|
3425
3521
|
const raw = cap[0];
|
|
3426
|
-
const
|
|
3522
|
+
const text2 = indentCodeCompensation(raw, cap[3] || "");
|
|
3427
3523
|
return {
|
|
3428
3524
|
type: "code",
|
|
3429
3525
|
raw,
|
|
3430
3526
|
lang: cap[2] ? cap[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : cap[2],
|
|
3431
|
-
text
|
|
3527
|
+
text: text2
|
|
3432
3528
|
};
|
|
3433
3529
|
}
|
|
3434
3530
|
}
|
|
3435
3531
|
heading(src) {
|
|
3436
3532
|
const cap = this.rules.block.heading.exec(src);
|
|
3437
3533
|
if (cap) {
|
|
3438
|
-
let
|
|
3439
|
-
if (/#$/.test(
|
|
3440
|
-
const trimmed = rtrim(
|
|
3534
|
+
let text2 = cap[2].trim();
|
|
3535
|
+
if (/#$/.test(text2)) {
|
|
3536
|
+
const trimmed = rtrim(text2, "#");
|
|
3441
3537
|
if (this.options.pedantic) {
|
|
3442
|
-
|
|
3538
|
+
text2 = trimmed.trim();
|
|
3443
3539
|
} else if (!trimmed || / $/.test(trimmed)) {
|
|
3444
|
-
|
|
3540
|
+
text2 = trimmed.trim();
|
|
3445
3541
|
}
|
|
3446
3542
|
}
|
|
3447
3543
|
return {
|
|
3448
3544
|
type: "heading",
|
|
3449
3545
|
raw: cap[0],
|
|
3450
3546
|
depth: cap[1].length,
|
|
3451
|
-
text,
|
|
3452
|
-
tokens: this.lexer.inline(
|
|
3547
|
+
text: text2,
|
|
3548
|
+
tokens: this.lexer.inline(text2)
|
|
3453
3549
|
};
|
|
3454
3550
|
}
|
|
3455
3551
|
}
|
|
@@ -3470,7 +3566,7 @@ class _Tokenizer {
|
|
|
3470
3566
|
`).split(`
|
|
3471
3567
|
`);
|
|
3472
3568
|
let raw = "";
|
|
3473
|
-
let
|
|
3569
|
+
let text2 = "";
|
|
3474
3570
|
const tokens = [];
|
|
3475
3571
|
while (lines.length > 0) {
|
|
3476
3572
|
let inBlockquote = false;
|
|
@@ -3493,7 +3589,7 @@ class _Tokenizer {
|
|
|
3493
3589
|
$1`).replace(/^ {0,3}>[ \t]?/gm, "");
|
|
3494
3590
|
raw = raw ? `${raw}
|
|
3495
3591
|
${currentRaw}` : currentRaw;
|
|
3496
|
-
|
|
3592
|
+
text2 = text2 ? `${text2}
|
|
3497
3593
|
${currentText}` : currentText;
|
|
3498
3594
|
const top = this.lexer.state.top;
|
|
3499
3595
|
this.lexer.state.top = true;
|
|
@@ -3513,7 +3609,7 @@ ${currentText}` : currentText;
|
|
|
3513
3609
|
const newToken = this.blockquote(newText);
|
|
3514
3610
|
tokens[tokens.length - 1] = newToken;
|
|
3515
3611
|
raw = raw.substring(0, raw.length - oldToken.raw.length) + newToken.raw;
|
|
3516
|
-
|
|
3612
|
+
text2 = text2.substring(0, text2.length - oldToken.text.length) + newToken.text;
|
|
3517
3613
|
break;
|
|
3518
3614
|
} else if (lastToken?.type === "list") {
|
|
3519
3615
|
const oldToken = lastToken;
|
|
@@ -3523,7 +3619,7 @@ ${currentText}` : currentText;
|
|
|
3523
3619
|
const newToken = this.list(newText);
|
|
3524
3620
|
tokens[tokens.length - 1] = newToken;
|
|
3525
3621
|
raw = raw.substring(0, raw.length - lastToken.raw.length) + newToken.raw;
|
|
3526
|
-
|
|
3622
|
+
text2 = text2.substring(0, text2.length - oldToken.raw.length) + newToken.raw;
|
|
3527
3623
|
lines = newText.substring(tokens[tokens.length - 1].raw.length).split(`
|
|
3528
3624
|
`);
|
|
3529
3625
|
continue;
|
|
@@ -3533,7 +3629,7 @@ ${currentText}` : currentText;
|
|
|
3533
3629
|
type: "blockquote",
|
|
3534
3630
|
raw,
|
|
3535
3631
|
tokens,
|
|
3536
|
-
text
|
|
3632
|
+
text: text2
|
|
3537
3633
|
};
|
|
3538
3634
|
}
|
|
3539
3635
|
}
|
|
@@ -3789,13 +3885,13 @@ ${currentText}` : currentText;
|
|
|
3789
3885
|
paragraph(src) {
|
|
3790
3886
|
const cap = this.rules.block.paragraph.exec(src);
|
|
3791
3887
|
if (cap) {
|
|
3792
|
-
const
|
|
3888
|
+
const text2 = cap[1].charAt(cap[1].length - 1) === `
|
|
3793
3889
|
` ? cap[1].slice(0, -1) : cap[1];
|
|
3794
3890
|
return {
|
|
3795
3891
|
type: "paragraph",
|
|
3796
3892
|
raw: cap[0],
|
|
3797
|
-
text,
|
|
3798
|
-
tokens: this.lexer.inline(
|
|
3893
|
+
text: text2,
|
|
3894
|
+
tokens: this.lexer.inline(text2)
|
|
3799
3895
|
};
|
|
3800
3896
|
}
|
|
3801
3897
|
}
|
|
@@ -3896,11 +3992,11 @@ ${currentText}` : currentText;
|
|
|
3896
3992
|
const linkString = (cap[2] || cap[1]).replace(/\s+/g, " ");
|
|
3897
3993
|
const link = links[linkString.toLowerCase()];
|
|
3898
3994
|
if (!link) {
|
|
3899
|
-
const
|
|
3995
|
+
const text2 = cap[0].charAt(0);
|
|
3900
3996
|
return {
|
|
3901
3997
|
type: "text",
|
|
3902
|
-
raw:
|
|
3903
|
-
text
|
|
3998
|
+
raw: text2,
|
|
3999
|
+
text: text2
|
|
3904
4000
|
};
|
|
3905
4001
|
}
|
|
3906
4002
|
return outputLink(cap, link, cap[0], this.lexer);
|
|
@@ -3940,20 +4036,20 @@ ${currentText}` : currentText;
|
|
|
3940
4036
|
const lastCharLength = [...match[0]][0].length;
|
|
3941
4037
|
const raw = src.slice(0, lLength + match.index + lastCharLength + rLength);
|
|
3942
4038
|
if (Math.min(lLength, rLength) % 2) {
|
|
3943
|
-
const
|
|
4039
|
+
const text3 = raw.slice(1, -1);
|
|
3944
4040
|
return {
|
|
3945
4041
|
type: "em",
|
|
3946
4042
|
raw,
|
|
3947
|
-
text:
|
|
3948
|
-
tokens: this.lexer.inlineTokens(
|
|
4043
|
+
text: text3,
|
|
4044
|
+
tokens: this.lexer.inlineTokens(text3)
|
|
3949
4045
|
};
|
|
3950
4046
|
}
|
|
3951
|
-
const
|
|
4047
|
+
const text2 = raw.slice(2, -2);
|
|
3952
4048
|
return {
|
|
3953
4049
|
type: "strong",
|
|
3954
4050
|
raw,
|
|
3955
|
-
text,
|
|
3956
|
-
tokens: this.lexer.inlineTokens(
|
|
4051
|
+
text: text2,
|
|
4052
|
+
tokens: this.lexer.inlineTokens(text2)
|
|
3957
4053
|
};
|
|
3958
4054
|
}
|
|
3959
4055
|
}
|
|
@@ -3961,17 +4057,17 @@ ${currentText}` : currentText;
|
|
|
3961
4057
|
codespan(src) {
|
|
3962
4058
|
const cap = this.rules.inline.code.exec(src);
|
|
3963
4059
|
if (cap) {
|
|
3964
|
-
let
|
|
3965
|
-
const hasNonSpaceChars = /[^ ]/.test(
|
|
3966
|
-
const hasSpaceCharsOnBothEnds = /^ /.test(
|
|
4060
|
+
let text2 = cap[2].replace(/\n/g, " ");
|
|
4061
|
+
const hasNonSpaceChars = /[^ ]/.test(text2);
|
|
4062
|
+
const hasSpaceCharsOnBothEnds = /^ /.test(text2) && / $/.test(text2);
|
|
3967
4063
|
if (hasNonSpaceChars && hasSpaceCharsOnBothEnds) {
|
|
3968
|
-
|
|
4064
|
+
text2 = text2.substring(1, text2.length - 1);
|
|
3969
4065
|
}
|
|
3970
|
-
|
|
4066
|
+
text2 = escape$1(text2, true);
|
|
3971
4067
|
return {
|
|
3972
4068
|
type: "codespan",
|
|
3973
4069
|
raw: cap[0],
|
|
3974
|
-
text
|
|
4070
|
+
text: text2
|
|
3975
4071
|
};
|
|
3976
4072
|
}
|
|
3977
4073
|
}
|
|
@@ -3998,24 +4094,24 @@ ${currentText}` : currentText;
|
|
|
3998
4094
|
autolink(src) {
|
|
3999
4095
|
const cap = this.rules.inline.autolink.exec(src);
|
|
4000
4096
|
if (cap) {
|
|
4001
|
-
let
|
|
4097
|
+
let text2, href;
|
|
4002
4098
|
if (cap[2] === "@") {
|
|
4003
|
-
|
|
4004
|
-
href = "mailto:" +
|
|
4099
|
+
text2 = escape$1(cap[1]);
|
|
4100
|
+
href = "mailto:" + text2;
|
|
4005
4101
|
} else {
|
|
4006
|
-
|
|
4007
|
-
href =
|
|
4102
|
+
text2 = escape$1(cap[1]);
|
|
4103
|
+
href = text2;
|
|
4008
4104
|
}
|
|
4009
4105
|
return {
|
|
4010
4106
|
type: "link",
|
|
4011
4107
|
raw: cap[0],
|
|
4012
|
-
text,
|
|
4108
|
+
text: text2,
|
|
4013
4109
|
href,
|
|
4014
4110
|
tokens: [
|
|
4015
4111
|
{
|
|
4016
4112
|
type: "text",
|
|
4017
|
-
raw:
|
|
4018
|
-
text
|
|
4113
|
+
raw: text2,
|
|
4114
|
+
text: text2
|
|
4019
4115
|
}
|
|
4020
4116
|
]
|
|
4021
4117
|
};
|
|
@@ -4024,17 +4120,17 @@ ${currentText}` : currentText;
|
|
|
4024
4120
|
url(src) {
|
|
4025
4121
|
let cap;
|
|
4026
4122
|
if (cap = this.rules.inline.url.exec(src)) {
|
|
4027
|
-
let
|
|
4123
|
+
let text2, href;
|
|
4028
4124
|
if (cap[2] === "@") {
|
|
4029
|
-
|
|
4030
|
-
href = "mailto:" +
|
|
4125
|
+
text2 = escape$1(cap[0]);
|
|
4126
|
+
href = "mailto:" + text2;
|
|
4031
4127
|
} else {
|
|
4032
4128
|
let prevCapZero;
|
|
4033
4129
|
do {
|
|
4034
4130
|
prevCapZero = cap[0];
|
|
4035
4131
|
cap[0] = this.rules.inline._backpedal.exec(cap[0])?.[0] ?? "";
|
|
4036
4132
|
} while (prevCapZero !== cap[0]);
|
|
4037
|
-
|
|
4133
|
+
text2 = escape$1(cap[0]);
|
|
4038
4134
|
if (cap[1] === "www.") {
|
|
4039
4135
|
href = "http://" + cap[0];
|
|
4040
4136
|
} else {
|
|
@@ -4044,13 +4140,13 @@ ${currentText}` : currentText;
|
|
|
4044
4140
|
return {
|
|
4045
4141
|
type: "link",
|
|
4046
4142
|
raw: cap[0],
|
|
4047
|
-
text,
|
|
4143
|
+
text: text2,
|
|
4048
4144
|
href,
|
|
4049
4145
|
tokens: [
|
|
4050
4146
|
{
|
|
4051
4147
|
type: "text",
|
|
4052
|
-
raw:
|
|
4053
|
-
text
|
|
4148
|
+
raw: text2,
|
|
4149
|
+
text: text2
|
|
4054
4150
|
}
|
|
4055
4151
|
]
|
|
4056
4152
|
};
|
|
@@ -4059,16 +4155,16 @@ ${currentText}` : currentText;
|
|
|
4059
4155
|
inlineText(src) {
|
|
4060
4156
|
const cap = this.rules.inline.text.exec(src);
|
|
4061
4157
|
if (cap) {
|
|
4062
|
-
let
|
|
4158
|
+
let text2;
|
|
4063
4159
|
if (this.lexer.state.inRawBlock) {
|
|
4064
|
-
|
|
4160
|
+
text2 = cap[0];
|
|
4065
4161
|
} else {
|
|
4066
|
-
|
|
4162
|
+
text2 = escape$1(cap[0]);
|
|
4067
4163
|
}
|
|
4068
4164
|
return {
|
|
4069
4165
|
type: "text",
|
|
4070
4166
|
raw: cap[0],
|
|
4071
|
-
text
|
|
4167
|
+
text: text2
|
|
4072
4168
|
};
|
|
4073
4169
|
}
|
|
4074
4170
|
}
|
|
@@ -4570,9 +4666,9 @@ class _Renderer {
|
|
|
4570
4666
|
space(token) {
|
|
4571
4667
|
return "";
|
|
4572
4668
|
}
|
|
4573
|
-
code({ text, lang, escaped }) {
|
|
4669
|
+
code({ text: text2, lang, escaped }) {
|
|
4574
4670
|
const langString = (lang || "").match(/^\S*/)?.[0];
|
|
4575
|
-
const code =
|
|
4671
|
+
const code = text2.replace(/\n$/, "") + `
|
|
4576
4672
|
`;
|
|
4577
4673
|
if (!langString) {
|
|
4578
4674
|
return "<pre><code>" + (escaped ? code : escape$1(code, true)) + `</code></pre>
|
|
@@ -4587,8 +4683,8 @@ class _Renderer {
|
|
|
4587
4683
|
${body}</blockquote>
|
|
4588
4684
|
`;
|
|
4589
4685
|
}
|
|
4590
|
-
html({ text }) {
|
|
4591
|
-
return
|
|
4686
|
+
html({ text: text2 }) {
|
|
4687
|
+
return text2;
|
|
4592
4688
|
}
|
|
4593
4689
|
heading({ tokens, depth }) {
|
|
4594
4690
|
return `<h${depth}>${this.parser.parseInline(tokens)}</h${depth}>
|
|
@@ -4668,9 +4764,9 @@ ${body}</blockquote>
|
|
|
4668
4764
|
` + body + `</table>
|
|
4669
4765
|
`;
|
|
4670
4766
|
}
|
|
4671
|
-
tablerow({ text }) {
|
|
4767
|
+
tablerow({ text: text2 }) {
|
|
4672
4768
|
return `<tr>
|
|
4673
|
-
${
|
|
4769
|
+
${text2}</tr>
|
|
4674
4770
|
`;
|
|
4675
4771
|
}
|
|
4676
4772
|
tablecell(token) {
|
|
@@ -4686,8 +4782,8 @@ ${text}</tr>
|
|
|
4686
4782
|
em({ tokens }) {
|
|
4687
4783
|
return `<em>${this.parser.parseInline(tokens)}</em>`;
|
|
4688
4784
|
}
|
|
4689
|
-
codespan({ text }) {
|
|
4690
|
-
return `<code>${
|
|
4785
|
+
codespan({ text: text2 }) {
|
|
4786
|
+
return `<code>${text2}</code>`;
|
|
4691
4787
|
}
|
|
4692
4788
|
br(token) {
|
|
4693
4789
|
return "<br>";
|
|
@@ -4696,26 +4792,26 @@ ${text}</tr>
|
|
|
4696
4792
|
return `<del>${this.parser.parseInline(tokens)}</del>`;
|
|
4697
4793
|
}
|
|
4698
4794
|
link({ href, title, tokens }) {
|
|
4699
|
-
const
|
|
4795
|
+
const text2 = this.parser.parseInline(tokens);
|
|
4700
4796
|
const cleanHref = cleanUrl(href);
|
|
4701
4797
|
if (cleanHref === null) {
|
|
4702
|
-
return
|
|
4798
|
+
return text2;
|
|
4703
4799
|
}
|
|
4704
4800
|
href = cleanHref;
|
|
4705
4801
|
let out = '<a href="' + href + '"';
|
|
4706
4802
|
if (title) {
|
|
4707
4803
|
out += ' title="' + title + '"';
|
|
4708
4804
|
}
|
|
4709
|
-
out += ">" +
|
|
4805
|
+
out += ">" + text2 + "</a>";
|
|
4710
4806
|
return out;
|
|
4711
4807
|
}
|
|
4712
|
-
image({ href, title, text }) {
|
|
4808
|
+
image({ href, title, text: text2 }) {
|
|
4713
4809
|
const cleanHref = cleanUrl(href);
|
|
4714
4810
|
if (cleanHref === null) {
|
|
4715
|
-
return
|
|
4811
|
+
return text2;
|
|
4716
4812
|
}
|
|
4717
4813
|
href = cleanHref;
|
|
4718
|
-
let out = `<img src="${href}" alt="${
|
|
4814
|
+
let out = `<img src="${href}" alt="${text2}"`;
|
|
4719
4815
|
if (title) {
|
|
4720
4816
|
out += ` title="${title}"`;
|
|
4721
4817
|
}
|
|
@@ -4728,29 +4824,29 @@ ${text}</tr>
|
|
|
4728
4824
|
}
|
|
4729
4825
|
|
|
4730
4826
|
class _TextRenderer {
|
|
4731
|
-
strong({ text }) {
|
|
4732
|
-
return
|
|
4827
|
+
strong({ text: text2 }) {
|
|
4828
|
+
return text2;
|
|
4733
4829
|
}
|
|
4734
|
-
em({ text }) {
|
|
4735
|
-
return
|
|
4830
|
+
em({ text: text2 }) {
|
|
4831
|
+
return text2;
|
|
4736
4832
|
}
|
|
4737
|
-
codespan({ text }) {
|
|
4738
|
-
return
|
|
4833
|
+
codespan({ text: text2 }) {
|
|
4834
|
+
return text2;
|
|
4739
4835
|
}
|
|
4740
|
-
del({ text }) {
|
|
4741
|
-
return
|
|
4836
|
+
del({ text: text2 }) {
|
|
4837
|
+
return text2;
|
|
4742
4838
|
}
|
|
4743
|
-
html({ text }) {
|
|
4744
|
-
return
|
|
4839
|
+
html({ text: text2 }) {
|
|
4840
|
+
return text2;
|
|
4745
4841
|
}
|
|
4746
|
-
text({ text }) {
|
|
4747
|
-
return
|
|
4842
|
+
text({ text: text2 }) {
|
|
4843
|
+
return text2;
|
|
4748
4844
|
}
|
|
4749
|
-
link({ text }) {
|
|
4750
|
-
return "" +
|
|
4845
|
+
link({ text: text2 }) {
|
|
4846
|
+
return "" + text2;
|
|
4751
4847
|
}
|
|
4752
|
-
image({ text }) {
|
|
4753
|
-
return "" +
|
|
4848
|
+
image({ text: text2 }) {
|
|
4849
|
+
return "" + text2;
|
|
4754
4850
|
}
|
|
4755
4851
|
br() {
|
|
4756
4852
|
return "";
|
|
@@ -5261,6 +5357,8 @@ var parser = _Parser.parse;
|
|
|
5261
5357
|
var lexer = _Lexer.lex;
|
|
5262
5358
|
|
|
5263
5359
|
// web-src/util/preview.ts
|
|
5360
|
+
var PAGE_SANDBOX = "allow-scripts allow-forms allow-popups";
|
|
5361
|
+
var PAGE_CSP = "default-src 'none'; script-src 'unsafe-inline' blob:; style-src 'unsafe-inline' blob:; img-src data: blob:; media-src data: blob:; font-src data:; form-action 'none'; connect-src 'none'";
|
|
5264
5362
|
var KINDS = {
|
|
5265
5363
|
md: "markdown",
|
|
5266
5364
|
markdown: "markdown",
|
|
@@ -5289,6 +5387,13 @@ var KINDS = {
|
|
|
5289
5387
|
flac: "audio",
|
|
5290
5388
|
pdf: "pdf"
|
|
5291
5389
|
};
|
|
5390
|
+
var LONG_CELL = 24;
|
|
5391
|
+
var LONG_CELL_PX = 196;
|
|
5392
|
+
var CHAR_PX = 7;
|
|
5393
|
+
var CELL_EDGE_PX = 25;
|
|
5394
|
+
var PAGE_EDGE_PX = 64;
|
|
5395
|
+
var CARDS_MAX_PX = 640;
|
|
5396
|
+
var CARDS_STEP_PX = 20;
|
|
5292
5397
|
var TEXT_KINDS = new Set(["md", "markdown", "html", "htm", "svg"]);
|
|
5293
5398
|
var PreviewUtil;
|
|
5294
5399
|
((PreviewUtil) => {
|
|
@@ -5301,6 +5406,15 @@ var PreviewUtil;
|
|
|
5301
5406
|
return KINDS[extension(path)];
|
|
5302
5407
|
}
|
|
5303
5408
|
PreviewUtil.kind = kind;
|
|
5409
|
+
function siblings(entries, path) {
|
|
5410
|
+
const pictures = entries.filter((entry) => entry.kind === "file" && kind(entry.path) === "image").map((entry) => entry.path).sort((a, b) => WorkspaceUtil.compareNames(WorkspaceUtil.basename(a), WorkspaceUtil.basename(b)));
|
|
5411
|
+
const index = pictures.indexOf(path);
|
|
5412
|
+
if (index < 0 || pictures.length < 2) {
|
|
5413
|
+
return;
|
|
5414
|
+
}
|
|
5415
|
+
return { index, count: pictures.length, previous: pictures[index - 1], next: pictures[index + 1] };
|
|
5416
|
+
}
|
|
5417
|
+
PreviewUtil.siblings = siblings;
|
|
5304
5418
|
function hasText(path) {
|
|
5305
5419
|
return TEXT_KINDS.has(extension(path));
|
|
5306
5420
|
}
|
|
@@ -5324,13 +5438,55 @@ var PreviewUtil;
|
|
|
5324
5438
|
}
|
|
5325
5439
|
}
|
|
5326
5440
|
PreviewUtil.resolve = resolve;
|
|
5327
|
-
function slug(
|
|
5328
|
-
const base =
|
|
5441
|
+
function slug(text2, taken) {
|
|
5442
|
+
const base = text2.trim().toLowerCase().replace(/[^\p{L}\p{N}\s_-]/gu, "").replace(/\s/g, "-");
|
|
5329
5443
|
const count = taken.get(base) ?? 0;
|
|
5330
5444
|
taken.set(base, count + 1);
|
|
5331
5445
|
return count ? `${base}-${count}` : base;
|
|
5332
5446
|
}
|
|
5333
5447
|
PreviewUtil.slug = slug;
|
|
5448
|
+
function pageDocument(html2) {
|
|
5449
|
+
const meta = `<meta http-equiv="Content-Security-Policy" content="${PAGE_CSP}">`;
|
|
5450
|
+
const head = /<head[^>]*>/i.exec(html2);
|
|
5451
|
+
if (head) {
|
|
5452
|
+
const at3 = head.index + head[0].length;
|
|
5453
|
+
return html2.slice(0, at3) + meta + html2.slice(at3);
|
|
5454
|
+
}
|
|
5455
|
+
const doctype = /<!doctype[^>]*>/i.exec(html2);
|
|
5456
|
+
const at2 = doctype ? doctype.index + doctype[0].length : 0;
|
|
5457
|
+
return html2.slice(0, at2) + meta + html2.slice(at2);
|
|
5458
|
+
}
|
|
5459
|
+
PreviewUtil.pageDocument = pageDocument;
|
|
5460
|
+
function units(text2) {
|
|
5461
|
+
let count = 0;
|
|
5462
|
+
for (const char of text2) {
|
|
5463
|
+
count += (char.codePointAt(0) ?? 0) >= 11904 ? 2 : 1;
|
|
5464
|
+
}
|
|
5465
|
+
return count;
|
|
5466
|
+
}
|
|
5467
|
+
function longCell(text2) {
|
|
5468
|
+
return units(text2.trim()) > LONG_CELL;
|
|
5469
|
+
}
|
|
5470
|
+
PreviewUtil.longCell = longCell;
|
|
5471
|
+
function tableWidth(rows) {
|
|
5472
|
+
const columns = [];
|
|
5473
|
+
for (const row of rows) {
|
|
5474
|
+
row.forEach((cell, index) => {
|
|
5475
|
+
const width = longCell(cell) ? LONG_CELL_PX : units(cell.trim()) * CHAR_PX;
|
|
5476
|
+
columns[index] = Math.max(columns[index] ?? 0, width + CELL_EDGE_PX);
|
|
5477
|
+
});
|
|
5478
|
+
}
|
|
5479
|
+
return columns.reduce((sum, width) => sum + width, 0);
|
|
5480
|
+
}
|
|
5481
|
+
PreviewUtil.tableWidth = tableWidth;
|
|
5482
|
+
function cardsBelow(rows) {
|
|
5483
|
+
if (Math.max(0, ...rows.map((row) => row.length)) < 2) {
|
|
5484
|
+
return 0;
|
|
5485
|
+
}
|
|
5486
|
+
const page = tableWidth(rows) + PAGE_EDGE_PX;
|
|
5487
|
+
return Math.min(CARDS_MAX_PX, Math.ceil(page / CARDS_STEP_PX) * CARDS_STEP_PX);
|
|
5488
|
+
}
|
|
5489
|
+
PreviewUtil.cardsBelow = cardsBelow;
|
|
5334
5490
|
function markdownDocument(body, style) {
|
|
5335
5491
|
return `<!doctype html><html><head><meta charset="utf-8"><style>${style}</style></head><body><article class="markdown">${body}</article></body></html>`;
|
|
5336
5492
|
}
|
|
@@ -5338,7 +5494,6 @@ var PreviewUtil;
|
|
|
5338
5494
|
})(PreviewUtil ||= {});
|
|
5339
5495
|
|
|
5340
5496
|
// web-src/preview.tsx
|
|
5341
|
-
var PAGE_SANDBOX = "allow-scripts allow-forms allow-popups allow-modals allow-downloads";
|
|
5342
5497
|
var MARKDOWN_SANDBOX = "allow-same-origin allow-popups allow-popups-to-escape-sandbox";
|
|
5343
5498
|
var LINKED = [
|
|
5344
5499
|
["img", "src"],
|
|
@@ -5351,10 +5506,26 @@ var LINKED = [
|
|
|
5351
5506
|
function themeValue(name) {
|
|
5352
5507
|
return getComputedStyle(document.documentElement).getPropertyValue(name).trim();
|
|
5353
5508
|
}
|
|
5354
|
-
function
|
|
5509
|
+
function cardStyle(width, v) {
|
|
5510
|
+
const table = `.table[data-cards='${width}']`;
|
|
5511
|
+
return `
|
|
5512
|
+
@media (max-width: ${width - 0.02}px) {
|
|
5513
|
+
${table} { width: auto; overflow: visible; border: 0; border-radius: 0; }
|
|
5514
|
+
${table} :is(table, tbody, tr, td) { display: block; }
|
|
5515
|
+
${table} thead { display: none; }
|
|
5516
|
+
${table} tr { margin: 0 0 10px; padding: 8px 14px 6px; border: 1px solid ${v("border")}; border-radius: 10px; background: ${v("card")}; }
|
|
5517
|
+
${table} tr:last-child { margin-bottom: 0; }
|
|
5518
|
+
${table} td { display: grid; grid-template-columns: min(34%, 9em) minmax(0, 1fr); gap: 12px; min-width: 0; padding: 4px 0; border: 0; white-space: normal; overflow-wrap: anywhere; text-align: left; }
|
|
5519
|
+
${table} td > .label { display: block; color: ${v("muted")}; }
|
|
5520
|
+
${table} td:first-child { display: block; padding: 2px 0 8px; margin-bottom: 4px; border-bottom: 1px solid ${v("border-muted")}; color: ${v("text")}; font-weight: 600; }
|
|
5521
|
+
${table} td:first-child > .label, ${table} td:not(:first-child):has(> .value:empty) { display: none; }
|
|
5522
|
+
}`;
|
|
5523
|
+
}
|
|
5524
|
+
function markdownStyle(cards) {
|
|
5355
5525
|
const v = (name) => themeValue(`--ta-${name}`);
|
|
5356
5526
|
return `
|
|
5357
5527
|
:root { color-scheme: ${pi.ui.theme}; }
|
|
5528
|
+
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
|
|
5358
5529
|
html, body { margin: 0; overscroll-behavior: none; background: ${v("main")}; color: ${v("body")}; font: 14px/1.7 ${v("sans")}; -webkit-font-smoothing: antialiased; }
|
|
5359
5530
|
.markdown { max-width: 860px; margin: 0 auto; padding: 24px 32px 48px; overflow-wrap: break-word; }
|
|
5360
5531
|
.markdown > :first-child { margin-top: 0; }
|
|
@@ -5371,16 +5542,67 @@ code { padding: 0.15em 0.4em; border-radius: 5px; background: ${v("chip")}; font
|
|
|
5371
5542
|
pre { padding: 12px 14px; overflow: auto; border: 1px solid ${v("border")}; border-radius: 10px; background: ${v("code")}; line-height: 1.55; }
|
|
5372
5543
|
pre code { padding: 0; background: none; font-size: 12.5px; }
|
|
5373
5544
|
blockquote { padding: 0 1em; border-left: 3px solid ${v("border-field")}; color: ${v("secondary")}; }
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5545
|
+
/* A table: short cells keep to one line, long ones wrap from a width that reads; wider than the page, it scrolls
|
|
5546
|
+
in its frame — or, on a narrow page, shows its rows as cards (cardStyle) — rather than squeezes its columns.
|
|
5547
|
+
Its frame, rows and head are those of a table in a conversation (.ta-table of the page). */
|
|
5548
|
+
.table { width: fit-content; max-width: 100%; margin: 0 0 1em; overflow-x: auto; overscroll-behavior-x: contain; border: 1px solid ${v("border")}; border-radius: 10px; }
|
|
5549
|
+
.table > table { margin: 0; border-collapse: collapse; font-variant-numeric: tabular-nums; }
|
|
5550
|
+
th, td { padding: 7px 12px; border: 0; border-bottom: 1px solid ${v("border-muted")}; text-align: left; vertical-align: top; white-space: nowrap; }
|
|
5551
|
+
tr:last-child > td { border-bottom: 0; }
|
|
5552
|
+
th { background: ${v("raised")}; font-weight: 600; color: ${v("text")}; }
|
|
5553
|
+
:is(th, td)[align='center'] { text-align: center; } :is(th, td)[align='right'] { text-align: right; }
|
|
5554
|
+
:is(th, td).long { min-width: 14em; white-space: normal; overflow-wrap: anywhere; }
|
|
5555
|
+
td > .label { display: none; }
|
|
5556
|
+
img, video { max-width: 100%; height: auto; } img { border-radius: 4px; }
|
|
5377
5557
|
hr { height: 0; margin: 1.6em 0; border: 0; border-top: 1px solid ${v("border")}; }
|
|
5378
|
-
@media (max-width: 600px) {
|
|
5558
|
+
@media (max-width: 600px) {
|
|
5559
|
+
.markdown { padding: 16px 16px 32px; }
|
|
5560
|
+
h1 { font-size: 1.6em; } h2 { font-size: 1.3em; } h3 { font-size: 1.12em; }
|
|
5561
|
+
ul, ol { padding-left: 1.3em; }
|
|
5562
|
+
blockquote { padding: 0 0.8em; }
|
|
5563
|
+
pre { padding: 10px 12px; } pre code { font-size: 12px; }
|
|
5564
|
+
}
|
|
5565
|
+
:not(pre) > code { overflow-wrap: anywhere; }
|
|
5379
5566
|
kbd { padding: 1px 5px; border: 1px solid ${v("border")}; border-bottom-width: 2px; border-radius: 4px; font-family: ${v("mono")}; font-size: 0.85em; }
|
|
5567
|
+
${[...new Set(cards)].map((width) => cardStyle(width, v)).join("")}
|
|
5380
5568
|
`;
|
|
5381
5569
|
}
|
|
5382
|
-
function
|
|
5383
|
-
const
|
|
5570
|
+
function fitTables(body) {
|
|
5571
|
+
const widths = [];
|
|
5572
|
+
for (const table of body.querySelectorAll("table")) {
|
|
5573
|
+
const rows = [...table.rows];
|
|
5574
|
+
const text2 = rows.map((row) => [...row.cells].map((cell) => cell.textContent ?? ""));
|
|
5575
|
+
const head = table.tHead?.rows[0];
|
|
5576
|
+
for (const [index, row] of rows.entries()) {
|
|
5577
|
+
for (const [column, cell] of [...row.cells].entries()) {
|
|
5578
|
+
if (PreviewUtil.longCell(text2[index][column])) {
|
|
5579
|
+
cell.classList.add("long");
|
|
5580
|
+
}
|
|
5581
|
+
if (cell.tagName === "TD") {
|
|
5582
|
+
const value = body.ownerDocument.createElement("span");
|
|
5583
|
+
value.className = "value";
|
|
5584
|
+
value.append(...cell.childNodes);
|
|
5585
|
+
const label2 = body.ownerDocument.createElement("span");
|
|
5586
|
+
label2.className = "label";
|
|
5587
|
+
label2.innerHTML = head?.cells[column]?.innerHTML ?? "";
|
|
5588
|
+
cell.append(label2, value);
|
|
5589
|
+
}
|
|
5590
|
+
}
|
|
5591
|
+
}
|
|
5592
|
+
const frame = body.ownerDocument.createElement("div");
|
|
5593
|
+
frame.className = "table";
|
|
5594
|
+
const below = PreviewUtil.cardsBelow(text2);
|
|
5595
|
+
if (below) {
|
|
5596
|
+
frame.dataset.cards = String(below);
|
|
5597
|
+
widths.push(below);
|
|
5598
|
+
}
|
|
5599
|
+
table.replaceWith(frame);
|
|
5600
|
+
frame.append(table);
|
|
5601
|
+
}
|
|
5602
|
+
return widths;
|
|
5603
|
+
}
|
|
5604
|
+
function renderMarkdown(text2, directory) {
|
|
5605
|
+
const html2 = marked.parse(text2, { async: false, gfm: true });
|
|
5384
5606
|
const body = new DOMParser().parseFromString(html2, "text/html").body;
|
|
5385
5607
|
for (const [tag2, attribute] of LINKED) {
|
|
5386
5608
|
for (const element of body.querySelectorAll(`${tag2}[${attribute}]`)) {
|
|
@@ -5397,11 +5619,12 @@ function renderMarkdown(text, directory) {
|
|
|
5397
5619
|
for (const heading2 of body.querySelectorAll("h1, h2, h3, h4, h5, h6")) {
|
|
5398
5620
|
heading2.id ||= PreviewUtil.slug(heading2.textContent ?? "", taken);
|
|
5399
5621
|
}
|
|
5400
|
-
|
|
5622
|
+
const cards = fitTables(body);
|
|
5623
|
+
return PreviewUtil.markdownDocument(body.innerHTML, markdownStyle(cards));
|
|
5401
5624
|
}
|
|
5402
|
-
function MarkdownPreview({ text, url }) {
|
|
5625
|
+
function MarkdownPreview({ text: text2, url }) {
|
|
5403
5626
|
const theme = useTheme();
|
|
5404
|
-
const document2 = React.useMemo(() => renderMarkdown(
|
|
5627
|
+
const document2 = React.useMemo(() => renderMarkdown(text2, PreviewUtil.directoryUrl(new URL(url, location.href).href)), [text2, url, theme]);
|
|
5405
5628
|
return /* @__PURE__ */ React.createElement("iframe", {
|
|
5406
5629
|
className: "taw-preview-frame",
|
|
5407
5630
|
title: "Markdown",
|
|
@@ -5409,33 +5632,85 @@ function MarkdownPreview({ text, url }) {
|
|
|
5409
5632
|
srcDoc: document2
|
|
5410
5633
|
});
|
|
5411
5634
|
}
|
|
5412
|
-
|
|
5413
|
-
|
|
5635
|
+
var browsedTo;
|
|
5636
|
+
var browseListeners = new Set;
|
|
5637
|
+
var BROWSE_FOCUS_MS = 2000;
|
|
5638
|
+
function browsePicture(id) {
|
|
5639
|
+
browsedTo = id;
|
|
5640
|
+
for (const listener of browseListeners) {
|
|
5641
|
+
listener();
|
|
5642
|
+
}
|
|
5643
|
+
}
|
|
5644
|
+
function useBrowsedTo(id) {
|
|
5645
|
+
const [at2, setAt] = React.useState(0);
|
|
5646
|
+
React.useEffect(() => {
|
|
5647
|
+
const take = () => {
|
|
5648
|
+
if (browsedTo === id) {
|
|
5649
|
+
browsedTo = undefined;
|
|
5650
|
+
setAt(Date.now());
|
|
5651
|
+
}
|
|
5652
|
+
};
|
|
5653
|
+
take();
|
|
5654
|
+
browseListeners.add(take);
|
|
5655
|
+
return () => {
|
|
5656
|
+
browseListeners.delete(take);
|
|
5657
|
+
};
|
|
5658
|
+
}, [id]);
|
|
5659
|
+
return at2;
|
|
5660
|
+
}
|
|
5661
|
+
function ImagePreview({
|
|
5662
|
+
url,
|
|
5663
|
+
size,
|
|
5664
|
+
onInfo,
|
|
5665
|
+
previous,
|
|
5666
|
+
next,
|
|
5667
|
+
browsedAt = 0
|
|
5668
|
+
}) {
|
|
5669
|
+
const root = React.useRef(null);
|
|
5670
|
+
React.useEffect(() => {
|
|
5671
|
+
if (Date.now() - browsedAt > BROWSE_FOCUS_MS) {
|
|
5672
|
+
return;
|
|
5673
|
+
}
|
|
5674
|
+
const frame = requestAnimationFrame(() => root.current?.querySelector(".ta-zoom-viewport")?.focus({ preventScroll: true }));
|
|
5675
|
+
return () => cancelAnimationFrame(frame);
|
|
5676
|
+
}, [browsedAt]);
|
|
5414
5677
|
return /* @__PURE__ */ React.createElement("div", {
|
|
5415
|
-
|
|
5416
|
-
|
|
5417
|
-
|
|
5418
|
-
className: "taw-image-toggle",
|
|
5419
|
-
title: t(actual ? "fit" : "actualSize"),
|
|
5420
|
-
onClick: () => setActual((value) => !value)
|
|
5421
|
-
}, /* @__PURE__ */ React.createElement("img", {
|
|
5678
|
+
ref: root,
|
|
5679
|
+
className: "taw-preview-picture"
|
|
5680
|
+
}, /* @__PURE__ */ React.createElement(pi.ui.ImageViewer, {
|
|
5422
5681
|
src: url,
|
|
5423
|
-
|
|
5424
|
-
onLoad: (
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5682
|
+
className: "taw-preview-image",
|
|
5683
|
+
onLoad: (image) => onInfo(`${image.width} × ${image.height} · ${WorkspaceUtil.size(size)}`),
|
|
5684
|
+
onPrevious: previous,
|
|
5685
|
+
onNext: next
|
|
5686
|
+
}));
|
|
5687
|
+
}
|
|
5688
|
+
function PagePreview({ url, text: text2 }) {
|
|
5689
|
+
if (url) {
|
|
5690
|
+
return /* @__PURE__ */ React.createElement("iframe", {
|
|
5691
|
+
className: "taw-preview-frame taw-preview-page",
|
|
5692
|
+
title: "HTML",
|
|
5693
|
+
sandbox: PAGE_SANDBOX,
|
|
5694
|
+
src: url
|
|
5695
|
+
});
|
|
5696
|
+
}
|
|
5697
|
+
return /* @__PURE__ */ React.createElement("iframe", {
|
|
5698
|
+
className: "taw-preview-frame taw-preview-page",
|
|
5699
|
+
title: "HTML",
|
|
5700
|
+
sandbox: PAGE_SANDBOX,
|
|
5701
|
+
srcDoc: PreviewUtil.pageDocument(text2)
|
|
5702
|
+
});
|
|
5429
5703
|
}
|
|
5430
|
-
function MediaPreview({
|
|
5704
|
+
function MediaPreview({
|
|
5705
|
+
kind,
|
|
5706
|
+
url,
|
|
5707
|
+
size,
|
|
5708
|
+
onInfo,
|
|
5709
|
+
previous,
|
|
5710
|
+
next,
|
|
5711
|
+
browsedAt
|
|
5712
|
+
}) {
|
|
5431
5713
|
switch (kind) {
|
|
5432
|
-
case "html":
|
|
5433
|
-
return /* @__PURE__ */ React.createElement("iframe", {
|
|
5434
|
-
className: "taw-preview-frame taw-preview-page",
|
|
5435
|
-
title: "HTML",
|
|
5436
|
-
sandbox: PAGE_SANDBOX,
|
|
5437
|
-
src: url
|
|
5438
|
-
});
|
|
5439
5714
|
case "pdf":
|
|
5440
5715
|
return /* @__PURE__ */ React.createElement("iframe", {
|
|
5441
5716
|
className: "taw-preview-frame",
|
|
@@ -5446,7 +5721,10 @@ function MediaPreview({ kind, url, size, onInfo }) {
|
|
|
5446
5721
|
return /* @__PURE__ */ React.createElement(ImagePreview, {
|
|
5447
5722
|
url,
|
|
5448
5723
|
size,
|
|
5449
|
-
onInfo
|
|
5724
|
+
onInfo,
|
|
5725
|
+
previous,
|
|
5726
|
+
next,
|
|
5727
|
+
browsedAt
|
|
5450
5728
|
});
|
|
5451
5729
|
case "video":
|
|
5452
5730
|
return /* @__PURE__ */ React.createElement("div", {
|
|
@@ -5604,14 +5882,29 @@ var TaLocation;
|
|
|
5604
5882
|
return name || (remote === null || remote === undefined ? undefined : remote.host) || location2;
|
|
5605
5883
|
}
|
|
5606
5884
|
TaLocation2.basename = basename;
|
|
5885
|
+
function homeRelative(location2) {
|
|
5886
|
+
var _a;
|
|
5887
|
+
const remote = parse(location2);
|
|
5888
|
+
const path2 = remote ? remote.path ? remote.path.slice(1) : "~" : location2;
|
|
5889
|
+
const match = /^~(?:[\\/]+(.*))?$/.exec(path2);
|
|
5890
|
+
return match ? ((_a = match[1]) !== null && _a !== undefined ? _a : "").replace(/[\\/]+$/, "") : undefined;
|
|
5891
|
+
}
|
|
5892
|
+
TaLocation2.homeRelative = homeRelative;
|
|
5893
|
+
function isAbsolute(location2) {
|
|
5894
|
+
if (homeRelative(location2) !== undefined) {
|
|
5895
|
+
return false;
|
|
5896
|
+
}
|
|
5897
|
+
return isRemote(location2) || /^([\\/]|[A-Za-z]:)/.test(location2);
|
|
5898
|
+
}
|
|
5899
|
+
TaLocation2.isAbsolute = isAbsolute;
|
|
5607
5900
|
function parentPath(path2) {
|
|
5608
5901
|
const trimmed = path2.replace(/[\\/]+$/, "");
|
|
5609
|
-
const
|
|
5610
|
-
if (
|
|
5902
|
+
const at2 = Math.max(trimmed.lastIndexOf("/"), trimmed.lastIndexOf("\\"));
|
|
5903
|
+
if (at2 < 0) {
|
|
5611
5904
|
return;
|
|
5612
5905
|
}
|
|
5613
|
-
const head = trimmed.slice(0,
|
|
5614
|
-
return head === "" || /^[A-Za-z]:$/.test(head) ? head + trimmed[
|
|
5906
|
+
const head = trimmed.slice(0, at2);
|
|
5907
|
+
return head === "" || /^[A-Za-z]:$/.test(head) ? head + trimmed[at2] : head;
|
|
5615
5908
|
}
|
|
5616
5909
|
function childPath(path2, name) {
|
|
5617
5910
|
const separator = path2.includes("/") || !path2.includes("\\") ? "/" : "\\";
|
|
@@ -5626,12 +5919,12 @@ var TaLocation;
|
|
|
5626
5919
|
var TaPackageServer = Symbol("TaPackageServer");
|
|
5627
5920
|
var TaPackageTextUtil;
|
|
5628
5921
|
(function(TaPackageTextUtil2) {
|
|
5629
|
-
function pick(
|
|
5922
|
+
function pick(text2, language) {
|
|
5630
5923
|
var _a, _b, _c, _d;
|
|
5631
|
-
if (
|
|
5632
|
-
return
|
|
5924
|
+
if (text2 === undefined || typeof text2 === "string") {
|
|
5925
|
+
return text2;
|
|
5633
5926
|
}
|
|
5634
|
-
return (_d = (_c = (_b = (_a =
|
|
5927
|
+
return (_d = (_c = (_b = (_a = text2[language]) !== null && _a !== undefined ? _a : text2[language.split("-")[0]]) !== null && _b !== undefined ? _b : text2.en) !== null && _c !== undefined ? _c : text2["en-US"]) !== null && _d !== undefined ? _d : Object.values(text2)[0];
|
|
5635
5928
|
}
|
|
5636
5929
|
TaPackageTextUtil2.pick = pick;
|
|
5637
5930
|
})(TaPackageTextUtil || (TaPackageTextUtil = {}));
|
|
@@ -5639,8 +5932,64 @@ var TaPackageTextUtil;
|
|
|
5639
5932
|
var TaRelayServer = Symbol("TaRelayServer");
|
|
5640
5933
|
// ../ta-protocol/esm/common/remote-protocol.js
|
|
5641
5934
|
var TaRemoteServer = Symbol("TaRemoteServer");
|
|
5935
|
+
// ../ta-protocol/esm/common/room-protocol.js
|
|
5936
|
+
var TaRoomServer = Symbol("TaRoomServer");
|
|
5937
|
+
var TaRoomWatchUtil;
|
|
5938
|
+
(function(TaRoomWatchUtil2) {
|
|
5939
|
+
function of(messages, state) {
|
|
5940
|
+
const prefixes = Array.isArray(state) ? state.filter((prefix) => typeof prefix === "string" && prefix.length > 0) : [];
|
|
5941
|
+
return { messages: messages !== false, state: [...new Set(prefixes)].sort() };
|
|
5942
|
+
}
|
|
5943
|
+
TaRoomWatchUtil2.of = of;
|
|
5944
|
+
function union(watches) {
|
|
5945
|
+
let messages = false;
|
|
5946
|
+
const state = [];
|
|
5947
|
+
for (const watch of watches) {
|
|
5948
|
+
messages || (messages = watch.messages);
|
|
5949
|
+
state.push(...watch.state);
|
|
5950
|
+
}
|
|
5951
|
+
return of(messages, messages ? [] : state);
|
|
5952
|
+
}
|
|
5953
|
+
TaRoomWatchUtil2.union = union;
|
|
5954
|
+
function same(a, b) {
|
|
5955
|
+
return a === b || !!a && !!b && a.messages === b.messages && a.state.join(`
|
|
5956
|
+
`) === b.state.join(`
|
|
5957
|
+
`);
|
|
5958
|
+
}
|
|
5959
|
+
TaRoomWatchUtil2.same = same;
|
|
5960
|
+
function hears(watch, event) {
|
|
5961
|
+
if (event.type === "message") {
|
|
5962
|
+
return watch.messages;
|
|
5963
|
+
}
|
|
5964
|
+
if (event.type === "state") {
|
|
5965
|
+
return watch.messages || watch.state.some((prefix) => event.key.startsWith(prefix));
|
|
5966
|
+
}
|
|
5967
|
+
return true;
|
|
5968
|
+
}
|
|
5969
|
+
TaRoomWatchUtil2.hears = hears;
|
|
5970
|
+
})(TaRoomWatchUtil || (TaRoomWatchUtil = {}));
|
|
5642
5971
|
// ../ta-protocol/esm/common/settings-protocol.js
|
|
5643
5972
|
var TaSettingsServer = Symbol("TaSettingsServer");
|
|
5973
|
+
// ../ta-protocol/esm/common/ta-extension-host.js
|
|
5974
|
+
var TA_HOST_EVENT = "ta:host";
|
|
5975
|
+
var TaHostUtil;
|
|
5976
|
+
(function(TaHostUtil2) {
|
|
5977
|
+
TaHostUtil2.WAIT_MS = 1000;
|
|
5978
|
+
function reach(events, name, waitMs = TaHostUtil2.WAIT_MS) {
|
|
5979
|
+
return new Promise((resolve) => {
|
|
5980
|
+
const timer = setTimeout(() => resolve(undefined), waitMs);
|
|
5981
|
+
const request = {
|
|
5982
|
+
name,
|
|
5983
|
+
resolve: (answer) => {
|
|
5984
|
+
clearTimeout(timer);
|
|
5985
|
+
resolve(answer);
|
|
5986
|
+
}
|
|
5987
|
+
};
|
|
5988
|
+
events.emit(TA_HOST_EVENT, request);
|
|
5989
|
+
});
|
|
5990
|
+
}
|
|
5991
|
+
TaHostUtil2.reach = reach;
|
|
5992
|
+
})(TaHostUtil || (TaHostUtil = {}));
|
|
5644
5993
|
// ../ta-protocol/esm/common/ta-protocol.js
|
|
5645
5994
|
var TaServer = Symbol("TaServer");
|
|
5646
5995
|
var TaClient = Symbol("TaClient");
|
|
@@ -5655,6 +6004,15 @@ var TaErrorUtil;
|
|
|
5655
6004
|
}
|
|
5656
6005
|
TaErrorUtil2.code = code;
|
|
5657
6006
|
})(TaErrorUtil || (TaErrorUtil = {}));
|
|
6007
|
+
var TaSlashCommandUtil;
|
|
6008
|
+
(function(TaSlashCommandUtil2) {
|
|
6009
|
+
function description(command, language) {
|
|
6010
|
+
var _a, _b;
|
|
6011
|
+
const { descriptions } = command;
|
|
6012
|
+
return (_b = (_a = descriptions === null || descriptions === undefined ? undefined : descriptions[language]) !== null && _a !== undefined ? _a : descriptions === null || descriptions === undefined ? undefined : descriptions[language.split("-")[0]]) !== null && _b !== undefined ? _b : command.description;
|
|
6013
|
+
}
|
|
6014
|
+
TaSlashCommandUtil2.description = description;
|
|
6015
|
+
})(TaSlashCommandUtil || (TaSlashCommandUtil = {}));
|
|
5658
6016
|
var TaMessageContext;
|
|
5659
6017
|
(function(TaMessageContext2) {
|
|
5660
6018
|
const BLOCK = /^<context>\n?[\s\S]*?\n?<\/context>\n?/;
|
|
@@ -5670,6 +6028,109 @@ ${message}`;
|
|
|
5670
6028
|
}
|
|
5671
6029
|
TaMessageContext2.strip = strip;
|
|
5672
6030
|
})(TaMessageContext || (TaMessageContext = {}));
|
|
6031
|
+
var TaImageNote;
|
|
6032
|
+
(function(TaImageNote2) {
|
|
6033
|
+
const NOTE = /^\[Image: original \d+x\d+, displayed at \d+x\d+\. Multiply coordinates by [\d.]+ to map to original image\.\]$|^\[Image converted from [^\]]+ to [^\]]+\.\]$/;
|
|
6034
|
+
function strip(text2) {
|
|
6035
|
+
const lines = text2.split(`
|
|
6036
|
+
`);
|
|
6037
|
+
const kept = lines.filter((line) => !NOTE.test(line.trim()));
|
|
6038
|
+
if (kept.length === lines.length) {
|
|
6039
|
+
return text2;
|
|
6040
|
+
}
|
|
6041
|
+
return kept.join(`
|
|
6042
|
+
`).replace(/\n+$/, "").replace(/^\n+/, "");
|
|
6043
|
+
}
|
|
6044
|
+
TaImageNote2.strip = strip;
|
|
6045
|
+
})(TaImageNote || (TaImageNote = {}));
|
|
6046
|
+
var TaImageSize;
|
|
6047
|
+
(function(TaImageSize2) {
|
|
6048
|
+
const JPEG_BYTES = 256 * 1024;
|
|
6049
|
+
function of(base64) {
|
|
6050
|
+
var _a, _b, _c;
|
|
6051
|
+
let bytes;
|
|
6052
|
+
try {
|
|
6053
|
+
const binary = atob(base64.slice(0, Math.ceil(JPEG_BYTES * 4 / 3 / 4) * 4));
|
|
6054
|
+
bytes = Uint8Array.from(binary, (char) => char.charCodeAt(0));
|
|
6055
|
+
} catch (_d) {
|
|
6056
|
+
return;
|
|
6057
|
+
}
|
|
6058
|
+
const size = (_c = (_b = (_a = png(bytes)) !== null && _a !== undefined ? _a : gif(bytes)) !== null && _b !== undefined ? _b : webp(bytes)) !== null && _c !== undefined ? _c : jpeg(bytes);
|
|
6059
|
+
return size && size.width > 0 && size.height > 0 ? size : undefined;
|
|
6060
|
+
}
|
|
6061
|
+
TaImageSize2.of = of;
|
|
6062
|
+
function u16be(bytes, at2) {
|
|
6063
|
+
return bytes[at2] << 8 | bytes[at2 + 1];
|
|
6064
|
+
}
|
|
6065
|
+
function u16le(bytes, at2) {
|
|
6066
|
+
return bytes[at2] | bytes[at2 + 1] << 8;
|
|
6067
|
+
}
|
|
6068
|
+
function u24le(bytes, at2) {
|
|
6069
|
+
return bytes[at2] | bytes[at2 + 1] << 8 | bytes[at2 + 2] << 16;
|
|
6070
|
+
}
|
|
6071
|
+
function u32be(bytes, at2) {
|
|
6072
|
+
return (bytes[at2] << 24 | bytes[at2 + 1] << 16 | bytes[at2 + 2] << 8 | bytes[at2 + 3]) >>> 0;
|
|
6073
|
+
}
|
|
6074
|
+
function text2(bytes, at2, length) {
|
|
6075
|
+
return String.fromCharCode(...bytes.subarray(at2, at2 + length));
|
|
6076
|
+
}
|
|
6077
|
+
function png(bytes) {
|
|
6078
|
+
return bytes.length >= 24 && bytes[0] === 137 && text2(bytes, 1, 3) === "PNG" ? { width: u32be(bytes, 16), height: u32be(bytes, 20) } : undefined;
|
|
6079
|
+
}
|
|
6080
|
+
function gif(bytes) {
|
|
6081
|
+
return bytes.length >= 10 && text2(bytes, 0, 3) === "GIF" ? { width: u16le(bytes, 6), height: u16le(bytes, 8) } : undefined;
|
|
6082
|
+
}
|
|
6083
|
+
function webp(bytes) {
|
|
6084
|
+
if (bytes.length < 30 || text2(bytes, 0, 4) !== "RIFF" || text2(bytes, 8, 4) !== "WEBP") {
|
|
6085
|
+
return;
|
|
6086
|
+
}
|
|
6087
|
+
switch (text2(bytes, 12, 4)) {
|
|
6088
|
+
case "VP8 ":
|
|
6089
|
+
return { width: u16le(bytes, 26) & 16383, height: u16le(bytes, 28) & 16383 };
|
|
6090
|
+
case "VP8L": {
|
|
6091
|
+
const bits = bytes[21] | bytes[22] << 8 | bytes[23] << 16 | bytes[24] << 24;
|
|
6092
|
+
return { width: (bits & 16383) + 1, height: (bits >> 14 & 16383) + 1 };
|
|
6093
|
+
}
|
|
6094
|
+
case "VP8X":
|
|
6095
|
+
return { width: u24le(bytes, 24) + 1, height: u24le(bytes, 27) + 1 };
|
|
6096
|
+
default:
|
|
6097
|
+
return;
|
|
6098
|
+
}
|
|
6099
|
+
}
|
|
6100
|
+
function jpeg(bytes) {
|
|
6101
|
+
if (bytes[0] !== 255 || bytes[1] !== 216) {
|
|
6102
|
+
return;
|
|
6103
|
+
}
|
|
6104
|
+
let at2 = 2;
|
|
6105
|
+
while (at2 + 9 < bytes.length) {
|
|
6106
|
+
if (bytes[at2] !== 255) {
|
|
6107
|
+
return;
|
|
6108
|
+
}
|
|
6109
|
+
const marker = bytes[at2 + 1];
|
|
6110
|
+
if (marker >= 192 && marker <= 207 && marker !== 196 && marker !== 200 && marker !== 204) {
|
|
6111
|
+
return { width: u16be(bytes, at2 + 7), height: u16be(bytes, at2 + 5) };
|
|
6112
|
+
}
|
|
6113
|
+
at2 += 2 + u16be(bytes, at2 + 2);
|
|
6114
|
+
}
|
|
6115
|
+
return;
|
|
6116
|
+
}
|
|
6117
|
+
})(TaImageSize || (TaImageSize = {}));
|
|
6118
|
+
var TaAgentSummary;
|
|
6119
|
+
(function(TaAgentSummary2) {
|
|
6120
|
+
const START = /^\s*<conversation_history_summary>/;
|
|
6121
|
+
const BLOCK = /^\s*<conversation_history_summary>[\s\S]*?(?:<\/conversation_history_summary>\s*|$)/;
|
|
6122
|
+
function read(text2) {
|
|
6123
|
+
if (!START.test(text2)) {
|
|
6124
|
+
return;
|
|
6125
|
+
}
|
|
6126
|
+
return text2.replace(/<\/?(?:conversation_history_summary|summary)>/g, "").replace(/<\/?\w*$/, "").trim();
|
|
6127
|
+
}
|
|
6128
|
+
TaAgentSummary2.read = read;
|
|
6129
|
+
function strip(text2) {
|
|
6130
|
+
return text2.replace(BLOCK, "");
|
|
6131
|
+
}
|
|
6132
|
+
TaAgentSummary2.strip = strip;
|
|
6133
|
+
})(TaAgentSummary || (TaAgentSummary = {}));
|
|
5673
6134
|
var TaSkillUse;
|
|
5674
6135
|
(function(TaSkillUse2) {
|
|
5675
6136
|
const BLOCK = /^<skill name="([^"]+)" location="([^"]+)">\n([\s\S]*?)\n<\/skill>(?:\n\n([\s\S]+))?$/;
|
|
@@ -5803,8 +6264,8 @@ var SearchUtil;
|
|
|
5803
6264
|
}
|
|
5804
6265
|
}
|
|
5805
6266
|
SearchUtil.patternError = patternError;
|
|
5806
|
-
function escapeText(
|
|
5807
|
-
return
|
|
6267
|
+
function escapeText(text2) {
|
|
6268
|
+
return text2.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
5808
6269
|
}
|
|
5809
6270
|
SearchUtil.escapeText = escapeText;
|
|
5810
6271
|
function toExtendedRegExp(source) {
|
|
@@ -5812,10 +6273,10 @@ var SearchUtil;
|
|
|
5812
6273
|
return source.replace(/\\\\|\\([dDwWsS])/g, (all, name) => name ? classes[name] : all);
|
|
5813
6274
|
}
|
|
5814
6275
|
SearchUtil.toExtendedRegExp = toExtendedRegExp;
|
|
5815
|
-
function find(
|
|
6276
|
+
function find(text2, expression) {
|
|
5816
6277
|
const out = [];
|
|
5817
6278
|
expression.lastIndex = 0;
|
|
5818
|
-
for (let found = expression.exec(
|
|
6279
|
+
for (let found = expression.exec(text2);found; found = expression.exec(text2)) {
|
|
5819
6280
|
if (!found[0]) {
|
|
5820
6281
|
expression.lastIndex++;
|
|
5821
6282
|
continue;
|
|
@@ -5837,60 +6298,60 @@ var SearchUtil;
|
|
|
5837
6298
|
if (filter && !filter(path)) {
|
|
5838
6299
|
continue;
|
|
5839
6300
|
}
|
|
5840
|
-
const
|
|
5841
|
-
for (const [index, length] of find(
|
|
6301
|
+
const text2 = found[3].replace(/\r$/, "");
|
|
6302
|
+
for (const [index, length] of find(text2, expression)) {
|
|
5842
6303
|
if (matches.length === limit) {
|
|
5843
6304
|
return { matches, truncated: true };
|
|
5844
6305
|
}
|
|
5845
|
-
matches.push({ path, line: Number(found[2]), column: index + 1, length, ...preview(
|
|
6306
|
+
matches.push({ path, line: Number(found[2]), column: index + 1, length, ...preview(text2, index, length) });
|
|
5846
6307
|
}
|
|
5847
6308
|
}
|
|
5848
6309
|
return { matches, truncated: false };
|
|
5849
6310
|
}
|
|
5850
6311
|
SearchUtil.parseMatches = parseMatches;
|
|
5851
|
-
function preview(
|
|
5852
|
-
const trimmed =
|
|
5853
|
-
const
|
|
6312
|
+
function preview(text2, index, length = 0) {
|
|
6313
|
+
const trimmed = text2.trimStart();
|
|
6314
|
+
const at2 = Math.max(0, index - (text2.length - trimmed.length));
|
|
5854
6315
|
if (trimmed.length <= PREVIEW_CHARS) {
|
|
5855
|
-
return { preview: trimmed, previewColumn:
|
|
6316
|
+
return { preview: trimmed, previewColumn: at2 };
|
|
5856
6317
|
}
|
|
5857
|
-
const start = Math.max(0, Math.min(
|
|
5858
|
-
const end = Math.max(start + PREVIEW_CHARS,
|
|
6318
|
+
const start = Math.max(0, Math.min(at2 - PREVIEW_CHARS / 4, trimmed.length - Math.max(PREVIEW_CHARS, length)));
|
|
6319
|
+
const end = Math.max(start + PREVIEW_CHARS, at2 + length);
|
|
5859
6320
|
const head = start > 0 ? "…" : "";
|
|
5860
|
-
return { preview: head + trimmed.slice(start, end) + (end < trimmed.length ? "…" : ""), previewColumn:
|
|
6321
|
+
return { preview: head + trimmed.slice(start, end) + (end < trimmed.length ? "…" : ""), previewColumn: at2 - start + head.length };
|
|
5861
6322
|
}
|
|
5862
6323
|
SearchUtil.preview = preview;
|
|
5863
|
-
function replace(
|
|
6324
|
+
function replace(text2, query, replacement, at2) {
|
|
5864
6325
|
const expression = queryRegExp(query);
|
|
5865
6326
|
const expand = (match, groups) => query.regex ? substitute(replacement, match, groups) : replacement;
|
|
5866
|
-
if (!
|
|
6327
|
+
if (!at2) {
|
|
5867
6328
|
let count = 0;
|
|
5868
|
-
const replaced =
|
|
6329
|
+
const replaced = text2.replace(expression, (match, ...rest) => {
|
|
5869
6330
|
count++;
|
|
5870
6331
|
return expand(match, groupsOf(rest));
|
|
5871
6332
|
});
|
|
5872
6333
|
return { text: replaced, count };
|
|
5873
6334
|
}
|
|
5874
6335
|
let start = 0;
|
|
5875
|
-
for (let line = 1;line <
|
|
5876
|
-
const next =
|
|
6336
|
+
for (let line = 1;line < at2.line; line++) {
|
|
6337
|
+
const next = text2.indexOf(`
|
|
5877
6338
|
`, start);
|
|
5878
6339
|
if (next < 0) {
|
|
5879
|
-
return { text, count: 0 };
|
|
6340
|
+
return { text: text2, count: 0 };
|
|
5880
6341
|
}
|
|
5881
6342
|
start = next + 1;
|
|
5882
6343
|
}
|
|
5883
|
-
const end =
|
|
6344
|
+
const end = text2.indexOf(`
|
|
5884
6345
|
`, start);
|
|
5885
|
-
const lineText =
|
|
6346
|
+
const lineText = text2.slice(start, end < 0 ? text2.length : end);
|
|
5886
6347
|
const sticky = new RegExp(expression.source, expression.flags.replace("g", "y"));
|
|
5887
|
-
sticky.lastIndex =
|
|
6348
|
+
sticky.lastIndex = at2.column - 1;
|
|
5888
6349
|
const found = sticky.exec(lineText);
|
|
5889
6350
|
if (!found?.[0]) {
|
|
5890
|
-
return { text, count: 0 };
|
|
6351
|
+
return { text: text2, count: 0 };
|
|
5891
6352
|
}
|
|
5892
6353
|
const offset = start + found.index;
|
|
5893
|
-
return { text:
|
|
6354
|
+
return { text: text2.slice(0, offset) + expand(found[0], found.slice(1)) + text2.slice(offset + found[0].length), count: 1 };
|
|
5894
6355
|
}
|
|
5895
6356
|
SearchUtil.replace = replace;
|
|
5896
6357
|
function groupsOf(rest) {
|
|
@@ -5915,11 +6376,11 @@ var SearchUtil;
|
|
|
5915
6376
|
var UploadUtil;
|
|
5916
6377
|
((UploadUtil) => {
|
|
5917
6378
|
function segments(path) {
|
|
5918
|
-
const
|
|
5919
|
-
if (!
|
|
6379
|
+
const parts2 = path.split(/[\\/]+/).filter((part) => part && part !== ".");
|
|
6380
|
+
if (!parts2.length || parts2.some((part) => part === ".." || part.includes("\x00"))) {
|
|
5920
6381
|
throw new Error(`Not a path to upload to: ${path}`);
|
|
5921
6382
|
}
|
|
5922
|
-
return
|
|
6383
|
+
return parts2;
|
|
5923
6384
|
}
|
|
5924
6385
|
UploadUtil.segments = segments;
|
|
5925
6386
|
function fromFiles(files) {
|
|
@@ -5968,9 +6429,9 @@ var UploadUtil;
|
|
|
5968
6429
|
function emptyFolders(batch) {
|
|
5969
6430
|
const filled = new Set;
|
|
5970
6431
|
for (const { path } of batch.files) {
|
|
5971
|
-
const
|
|
5972
|
-
for (let i = 1;i <
|
|
5973
|
-
filled.add(
|
|
6432
|
+
const parts2 = segments(path);
|
|
6433
|
+
for (let i = 1;i < parts2.length; i++) {
|
|
6434
|
+
filled.add(parts2.slice(0, i).join("/"));
|
|
5974
6435
|
}
|
|
5975
6436
|
}
|
|
5976
6437
|
const folders = batch.folders.map((folder) => segments(folder).join("/"));
|
|
@@ -5981,7 +6442,7 @@ var UploadUtil;
|
|
|
5981
6442
|
return batch.files.reduce((sum, { file }) => sum + file.size, 0);
|
|
5982
6443
|
}
|
|
5983
6444
|
UploadUtil.totalBytes = totalBytes;
|
|
5984
|
-
function
|
|
6445
|
+
function parts(size, partBytes) {
|
|
5985
6446
|
if (size === 0) {
|
|
5986
6447
|
return [[0, 0]];
|
|
5987
6448
|
}
|
|
@@ -5991,7 +6452,7 @@ var UploadUtil;
|
|
|
5991
6452
|
}
|
|
5992
6453
|
return out;
|
|
5993
6454
|
}
|
|
5994
|
-
UploadUtil.parts =
|
|
6455
|
+
UploadUtil.parts = parts;
|
|
5995
6456
|
function toBase64(bytes) {
|
|
5996
6457
|
let binary = "";
|
|
5997
6458
|
for (let i = 0;i < bytes.length; i += 32768) {
|
|
@@ -6053,14 +6514,14 @@ var ZipUtil;
|
|
|
6053
6514
|
}
|
|
6054
6515
|
const header = (signature, central) => {
|
|
6055
6516
|
const view = new DataView(new ArrayBuffer(central ? 46 : 30));
|
|
6056
|
-
let
|
|
6517
|
+
let at3 = 0;
|
|
6057
6518
|
const u16 = (value) => {
|
|
6058
|
-
view.setUint16(
|
|
6059
|
-
|
|
6519
|
+
view.setUint16(at3, value, true);
|
|
6520
|
+
at3 += 2;
|
|
6060
6521
|
};
|
|
6061
6522
|
const u32 = (value) => {
|
|
6062
|
-
view.setUint32(
|
|
6063
|
-
|
|
6523
|
+
view.setUint32(at3, value >>> 0, true);
|
|
6524
|
+
at3 += 4;
|
|
6064
6525
|
};
|
|
6065
6526
|
u32(signature);
|
|
6066
6527
|
if (central) {
|
|
@@ -6097,12 +6558,12 @@ var ZipUtil;
|
|
|
6097
6558
|
end.setUint16(10, entries.length, true);
|
|
6098
6559
|
end.setUint32(12, centralSize, true);
|
|
6099
6560
|
end.setUint32(16, offset, true);
|
|
6100
|
-
const
|
|
6101
|
-
const out = new Uint8Array(
|
|
6102
|
-
let
|
|
6103
|
-
for (const part of
|
|
6104
|
-
out.set(part,
|
|
6105
|
-
|
|
6561
|
+
const parts = [...locals, ...centrals, new Uint8Array(end.buffer)];
|
|
6562
|
+
const out = new Uint8Array(parts.reduce((sum, part) => sum + part.length, 0));
|
|
6563
|
+
let at2 = 0;
|
|
6564
|
+
for (const part of parts) {
|
|
6565
|
+
out.set(part, at2);
|
|
6566
|
+
at2 += part.length;
|
|
6106
6567
|
}
|
|
6107
6568
|
return out;
|
|
6108
6569
|
}
|
|
@@ -6457,12 +6918,26 @@ function Message({ children, tone }) {
|
|
|
6457
6918
|
}, children);
|
|
6458
6919
|
}
|
|
6459
6920
|
function Header({ path, extra }) {
|
|
6921
|
+
const parts = path.split(/[\\/]/).filter(Boolean);
|
|
6922
|
+
const name = parts.pop() ?? path;
|
|
6460
6923
|
return /* @__PURE__ */ React.createElement("header", {
|
|
6461
6924
|
className: "taw-editor-head"
|
|
6462
6925
|
}, /* @__PURE__ */ React.createElement("span", {
|
|
6463
|
-
className: "taw-
|
|
6926
|
+
className: "taw-crumbs",
|
|
6464
6927
|
title: path
|
|
6465
|
-
},
|
|
6928
|
+
}, parts.map((part, index) => /* @__PURE__ */ React.createElement(React.Fragment, {
|
|
6929
|
+
key: index
|
|
6930
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
6931
|
+
className: "taw-crumb"
|
|
6932
|
+
}, part), /* @__PURE__ */ React.createElement(Glyph, {
|
|
6933
|
+
name: "ChevronRight",
|
|
6934
|
+
size: 12
|
|
6935
|
+
}))), /* @__PURE__ */ React.createElement("span", {
|
|
6936
|
+
className: "taw-crumb taw-crumb-file"
|
|
6937
|
+
}, /* @__PURE__ */ React.createElement(FileIcon, {
|
|
6938
|
+
path: name,
|
|
6939
|
+
size: 14
|
|
6940
|
+
}), /* @__PURE__ */ React.createElement("span", null, name))), extra);
|
|
6466
6941
|
}
|
|
6467
6942
|
function useVersion(url) {
|
|
6468
6943
|
const changed = useFilesChanged();
|
|
@@ -6520,21 +6995,31 @@ function FileEditor({ id, cwd, path }) {
|
|
|
6520
6995
|
const file = useLoad(async () => textual ? pi.workspace.readFile(path, cwd) : undefined, [cwd, path, changed]);
|
|
6521
6996
|
const url = useLoad(() => kind ? pi.workspace.fileUrl(path, cwd) : Promise.resolve(undefined), [cwd, path]);
|
|
6522
6997
|
const { version, size } = useVersion(kind && kind !== "markdown" ? url.value : undefined);
|
|
6998
|
+
const byUrl = pi.files.byUrl;
|
|
6999
|
+
const media = !byUrl && !!kind && kind !== "markdown" && kind !== "html";
|
|
7000
|
+
const bytes = useFileBytesUrl(media ? url.value : undefined, changed);
|
|
6523
7001
|
const [info, setInfo] = React.useState();
|
|
7002
|
+
const pictures = useLoad(async () => kind === "image" ? PreviewUtil.siblings(await pi.workspace.listDirectory(WorkspaceUtil.dirname(path), cwd), path) : undefined, [cwd, path, changed]);
|
|
7003
|
+
const siblings = pictures.value;
|
|
7004
|
+
const browsedAt = useBrowsedTo(id);
|
|
7005
|
+
const showPicture = (to) => to === undefined ? undefined : () => {
|
|
7006
|
+
browsePicture(fileId(cwd, to));
|
|
7007
|
+
openFile(cwd, to, undefined, { preview: true });
|
|
7008
|
+
};
|
|
6524
7009
|
const [draft, setDraft] = React.useState();
|
|
6525
7010
|
const [base, setBase] = React.useState();
|
|
6526
7011
|
const [saving, setSaving] = React.useState(false);
|
|
6527
|
-
const
|
|
6528
|
-
const dirty = draft !== undefined && draft !==
|
|
7012
|
+
const text2 = file.value?.text;
|
|
7013
|
+
const dirty = draft !== undefined && draft !== text2;
|
|
6529
7014
|
React.useEffect(() => pi.ui.setEditorDirty(id, dirty), [id, dirty]);
|
|
6530
7015
|
React.useEffect(() => {
|
|
6531
|
-
if (draft !== undefined && draft ===
|
|
7016
|
+
if (draft !== undefined && draft === text2) {
|
|
6532
7017
|
setDraft(undefined);
|
|
6533
7018
|
setBase(undefined);
|
|
6534
7019
|
}
|
|
6535
|
-
}, [draft,
|
|
7020
|
+
}, [draft, text2]);
|
|
6536
7021
|
const save = async (value) => {
|
|
6537
|
-
if (saving || value ===
|
|
7022
|
+
if (saving || value === text2) {
|
|
6538
7023
|
return;
|
|
6539
7024
|
}
|
|
6540
7025
|
setSaving(true);
|
|
@@ -6572,11 +7057,13 @@ function FileEditor({ id, cwd, path }) {
|
|
|
6572
7057
|
const showPreview = !!kind && (mode === "preview" || !textual);
|
|
6573
7058
|
const extra = /* @__PURE__ */ React.createElement("div", {
|
|
6574
7059
|
className: "taw-editor-tools"
|
|
6575
|
-
}, showPreview &&
|
|
7060
|
+
}, showPreview && siblings && /* @__PURE__ */ React.createElement("span", {
|
|
7061
|
+
className: "taw-note"
|
|
7062
|
+
}, siblings.index + 1, " / ", siblings.count), showPreview && info && /* @__PURE__ */ React.createElement("span", {
|
|
6576
7063
|
className: "taw-note"
|
|
6577
7064
|
}, info), !showPreview && readOnly && /* @__PURE__ */ React.createElement("span", {
|
|
6578
7065
|
className: "taw-note"
|
|
6579
|
-
}, t("truncated")), !showPreview && dirty && base !== undefined && base !==
|
|
7066
|
+
}, t("truncated")), !showPreview && dirty && base !== undefined && base !== text2 && /* @__PURE__ */ React.createElement("span", {
|
|
6580
7067
|
className: "taw-note taw-warning"
|
|
6581
7068
|
}, t("changedOnDisk"), " ", /* @__PURE__ */ React.createElement("button", {
|
|
6582
7069
|
type: "button",
|
|
@@ -6595,30 +7082,39 @@ function FileEditor({ id, cwd, path }) {
|
|
|
6595
7082
|
onChange: setMode
|
|
6596
7083
|
}));
|
|
6597
7084
|
const fileUrl = url.value && PreviewUtil.versioned(url.value, version);
|
|
7085
|
+
const shownUrl = byUrl ? fileUrl : bytes.url;
|
|
6598
7086
|
return /* @__PURE__ */ React.createElement("div", {
|
|
6599
7087
|
className: "taw-editor"
|
|
6600
7088
|
}, /* @__PURE__ */ React.createElement(Header, {
|
|
6601
7089
|
path,
|
|
6602
7090
|
extra
|
|
6603
7091
|
}), showPreview && fileUrl && kind === "markdown" && /* @__PURE__ */ React.createElement(MarkdownPreview, {
|
|
6604
|
-
text: draft ??
|
|
7092
|
+
text: draft ?? text2 ?? "",
|
|
6605
7093
|
url: fileUrl
|
|
6606
|
-
}), showPreview &&
|
|
6607
|
-
|
|
7094
|
+
}), showPreview && kind === "html" && /* @__PURE__ */ React.createElement(PagePreview, {
|
|
7095
|
+
url: byUrl ? fileUrl : undefined,
|
|
7096
|
+
text: draft ?? text2 ?? ""
|
|
7097
|
+
}), showPreview && kind && kind !== "markdown" && kind !== "html" && shownUrl && /* @__PURE__ */ React.createElement(MediaPreview, {
|
|
7098
|
+
key: shownUrl,
|
|
6608
7099
|
kind,
|
|
6609
|
-
url:
|
|
6610
|
-
size: file.value?.size ?? size ?? 0,
|
|
6611
|
-
onInfo: setInfo
|
|
6612
|
-
|
|
7100
|
+
url: shownUrl,
|
|
7101
|
+
size: file.value?.size ?? bytes.size ?? size ?? 0,
|
|
7102
|
+
onInfo: setInfo,
|
|
7103
|
+
previous: showPicture(siblings?.previous),
|
|
7104
|
+
next: showPicture(siblings?.next),
|
|
7105
|
+
browsedAt
|
|
7106
|
+
}), showPreview && kind && kind !== "markdown" && kind !== "html" && !shownUrl && /* @__PURE__ */ React.createElement(Message, {
|
|
7107
|
+
tone: bytes.error ? "error" : undefined
|
|
7108
|
+
}, bytes.error ?? t("loading")), !showPreview && /* @__PURE__ */ React.createElement(pi.ui.CodeEditor, {
|
|
6613
7109
|
path,
|
|
6614
|
-
value: draft ??
|
|
7110
|
+
value: draft ?? text2 ?? "",
|
|
6615
7111
|
readOnly,
|
|
6616
7112
|
line: target?.line,
|
|
6617
7113
|
column: target?.column,
|
|
6618
7114
|
endColumn: target?.endColumn,
|
|
6619
7115
|
selection: target?.endLine ? { startLine: target.line, startColumn: target.column, endLine: target.endLine, endColumn: target.endColumn } : undefined,
|
|
6620
7116
|
onChange: (value) => {
|
|
6621
|
-
setBase((previous) => previous === undefined ?
|
|
7117
|
+
setBase((previous) => previous === undefined ? text2 : previous);
|
|
6622
7118
|
setDraft(value);
|
|
6623
7119
|
},
|
|
6624
7120
|
onSave: (value) => void save(value)
|
|
@@ -6999,21 +7495,21 @@ function SearchView() {
|
|
|
6999
7495
|
const dismiss = (key) => setState((previous) => ({ ...previous, dismissed: [...previous.dismissed, key] }));
|
|
7000
7496
|
const refresh = () => setState((previous) => ({ ...previous, run: previous.run + 1 }));
|
|
7001
7497
|
const replacing = state.showReplace;
|
|
7002
|
-
const replaceIn = async (path,
|
|
7498
|
+
const replaceIn = async (path, at2) => {
|
|
7003
7499
|
const file = await pi.workspace.readFile(path, cwd);
|
|
7004
7500
|
if (file.text === undefined || file.truncated) {
|
|
7005
7501
|
throw new Error(t("cannotReplace", { path }));
|
|
7006
7502
|
}
|
|
7007
|
-
const done = SearchUtil.replace(file.text, query, state.replace,
|
|
7503
|
+
const done = SearchUtil.replace(file.text, query, state.replace, at2 && { line: at2.line, column: at2.column });
|
|
7008
7504
|
if (done.count) {
|
|
7009
7505
|
await pi.workspace.writeFile(path, done.text, cwd);
|
|
7010
7506
|
}
|
|
7011
7507
|
return done.count;
|
|
7012
7508
|
};
|
|
7013
|
-
const replace = async (paths,
|
|
7509
|
+
const replace = async (paths, at2) => {
|
|
7014
7510
|
try {
|
|
7015
7511
|
for (const path of paths) {
|
|
7016
|
-
await replaceIn(path,
|
|
7512
|
+
await replaceIn(path, at2);
|
|
7017
7513
|
}
|
|
7018
7514
|
} catch (error) {
|
|
7019
7515
|
pi.ui.notify(Host.message(error), "error");
|
|
@@ -7835,6 +8331,47 @@ function Guides({ depth }) {
|
|
|
7835
8331
|
})));
|
|
7836
8332
|
}
|
|
7837
8333
|
|
|
8334
|
+
// web-src/launcher.tsx
|
|
8335
|
+
var TOOLS = [
|
|
8336
|
+
{ name: "explorer", icon: "Files" },
|
|
8337
|
+
{ name: "search", icon: "Search" },
|
|
8338
|
+
{ name: "scm", icon: "GitBranch" },
|
|
8339
|
+
{ name: "terminal", icon: "SquareTerminal" }
|
|
8340
|
+
];
|
|
8341
|
+
function showTool(name) {
|
|
8342
|
+
pi.ui.showView(`${PACKAGE}/${name}`);
|
|
8343
|
+
}
|
|
8344
|
+
function LauncherTools() {
|
|
8345
|
+
const cwd = pi.ui.useCwd();
|
|
8346
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
8347
|
+
className: "taw-launch"
|
|
8348
|
+
}, /* @__PURE__ */ React.createElement("header", {
|
|
8349
|
+
className: "taw-launch-head"
|
|
8350
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
8351
|
+
className: "taw-launch-label"
|
|
8352
|
+
}, t("workbench")), /* @__PURE__ */ React.createElement("span", {
|
|
8353
|
+
className: "taw-launch-cwd",
|
|
8354
|
+
title: cwd
|
|
8355
|
+
}, /* @__PURE__ */ React.createElement(Glyph, {
|
|
8356
|
+
name: "Folder",
|
|
8357
|
+
size: 13
|
|
8358
|
+
}), /* @__PURE__ */ React.createElement("span", null, WorkspaceUtil.basename(cwd)))), /* @__PURE__ */ React.createElement("div", {
|
|
8359
|
+
className: "taw-launch-row"
|
|
8360
|
+
}, TOOLS.map((tool) => /* @__PURE__ */ React.createElement("button", {
|
|
8361
|
+
key: tool.name,
|
|
8362
|
+
type: "button",
|
|
8363
|
+
className: `taw-launch-tile taw-launch-${tool.name}`,
|
|
8364
|
+
onClick: () => showTool(tool.name)
|
|
8365
|
+
}, /* @__PURE__ */ React.createElement("span", {
|
|
8366
|
+
className: "taw-launch-icon"
|
|
8367
|
+
}, /* @__PURE__ */ React.createElement(Glyph, {
|
|
8368
|
+
name: tool.icon,
|
|
8369
|
+
size: 24
|
|
8370
|
+
})), /* @__PURE__ */ React.createElement("span", {
|
|
8371
|
+
className: "taw-launch-name"
|
|
8372
|
+
}, t(tool.name))))));
|
|
8373
|
+
}
|
|
8374
|
+
|
|
7838
8375
|
// web-src/open-files.tsx
|
|
7839
8376
|
function close(files) {
|
|
7840
8377
|
for (const file of files) {
|
|
@@ -8192,15 +8729,15 @@ function treeRows(list2) {
|
|
|
8192
8729
|
return da === db ? WorkspaceUtil.compareNames(a.file.path, b.file.path) : WorkspaceUtil.compareNames(da, db);
|
|
8193
8730
|
});
|
|
8194
8731
|
for (const row of sorted) {
|
|
8195
|
-
const
|
|
8196
|
-
for (let depth = 0;depth <
|
|
8197
|
-
const folder =
|
|
8732
|
+
const parts = row.file.path.split("/");
|
|
8733
|
+
for (let depth = 0;depth < parts.length - 1; depth++) {
|
|
8734
|
+
const folder = parts.slice(0, depth + 1).join("/");
|
|
8198
8735
|
if (!seen.has(folder)) {
|
|
8199
8736
|
seen.add(folder);
|
|
8200
8737
|
out.push({ folder, depth });
|
|
8201
8738
|
}
|
|
8202
8739
|
}
|
|
8203
|
-
out.push({ row, depth:
|
|
8740
|
+
out.push({ row, depth: parts.length - 1 });
|
|
8204
8741
|
}
|
|
8205
8742
|
return out;
|
|
8206
8743
|
}
|
|
@@ -8297,7 +8834,7 @@ var STYLE = `
|
|
|
8297
8834
|
.taw-name-input .taw-input-message { position: absolute; z-index: 5; top: 100%; left: 0; right: 0; margin-top: 1px; box-shadow: var(--ta-shadow-pop); }
|
|
8298
8835
|
.taw-input-message.taw-error { background: color-mix(in srgb, var(--ta-red) 16%, var(--ta-card)); border: 1px solid var(--ta-red); color: var(--ta-text); }
|
|
8299
8836
|
.taw-input-message.taw-warning { background: color-mix(in srgb, var(--ta-yellow) 16%, var(--ta-card)); border: 1px solid var(--ta-yellow); color: var(--ta-text); }
|
|
8300
|
-
.taw-menu { position: fixed; z-index: 80; min-width: 210px; max-width: 320px; display: flex; flex-direction: column; gap: 1px; padding: 6px; border-radius: 12px; border: 1px solid var(--ta-border); background: var(--ta-side); box-shadow: var(--ta-shadow-pop); animation: taw-fade 100ms ease-out; }
|
|
8837
|
+
.taw-menu { position: fixed; left: 0; top: 0; z-index: 80; min-width: 210px; max-width: 320px; display: flex; flex-direction: column; gap: 1px; padding: 6px; border-radius: 12px; border: 1px solid var(--ta-border); background: var(--ta-side); box-shadow: var(--ta-shadow-pop); animation: taw-fade 100ms ease-out; }
|
|
8301
8838
|
.taw-menu-item { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex: none; height: 30px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--ta-text); font: inherit; font-size: calc(13px * var(--ta-font-scale)); text-align: left; cursor: pointer; outline: none; }
|
|
8302
8839
|
.taw-menu-item:hover:not(:disabled), .taw-menu-item:focus-visible { background: var(--ta-hover); }
|
|
8303
8840
|
.taw-menu-item:disabled { opacity: 0.45; cursor: default; }
|
|
@@ -8369,7 +8906,12 @@ var STYLE = `
|
|
|
8369
8906
|
.taw-chip { padding: 0 6px; border-radius: 8px; background: var(--ta-chip); font-size: calc(11px * var(--ta-font-scale)); line-height: calc(18px * var(--ta-font-scale)); }
|
|
8370
8907
|
.taw-editor { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--ta-main); color: var(--ta-text); }
|
|
8371
8908
|
.taw-editor-head { display: flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border-bottom: 1px solid var(--ta-border-muted); font-size: calc(12px * var(--ta-font-scale)); color: var(--ta-secondary); flex: none; }
|
|
8372
|
-
|
|
8909
|
+
/* The breadcrumbs of a file: its directories give way first (they shrink, the name does not). */
|
|
8910
|
+
.taw-crumbs { flex: 1; min-width: 0; display: flex; align-items: center; gap: 3px; overflow: hidden; white-space: nowrap; }
|
|
8911
|
+
.taw-crumbs > svg { flex: none; color: var(--ta-muted); opacity: 0.8; }
|
|
8912
|
+
.taw-crumb { flex: 0 1 auto; min-width: 1.5em; overflow: hidden; text-overflow: ellipsis; }
|
|
8913
|
+
.taw-crumb-file { flex: 0 0 auto; min-width: 0; max-width: 100%; display: inline-flex; align-items: center; gap: 5px; color: var(--ta-text); }
|
|
8914
|
+
.taw-crumb-file > span:last-child { overflow: hidden; text-overflow: ellipsis; }
|
|
8373
8915
|
.taw-view > .taw-editor { flex: 1; height: auto; }
|
|
8374
8916
|
.taw-browser { display: flex; flex-direction: column; height: 100%; min-height: 0; color: var(--ta-text); font-size: calc(13px * var(--ta-font-scale)); }
|
|
8375
8917
|
.taw-browser-bar { position: relative; display: flex; align-items: center; gap: 2px; height: 42px; padding: 0 8px; border-bottom: 1px solid var(--ta-border-muted); flex: none; }
|
|
@@ -8384,28 +8926,28 @@ var STYLE = `
|
|
|
8384
8926
|
.taw-spin { display: inline-flex; animation: taw-spin 0.9s linear infinite; }
|
|
8385
8927
|
@keyframes taw-spin { to { transform: rotate(360deg); } }
|
|
8386
8928
|
.taw-browser-loading { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, transparent, var(--ta-accent), transparent) 0 0 / 30% 100% no-repeat; animation: taw-slide 1.1s linear infinite; pointer-events: none; }
|
|
8387
|
-
.taw-browser-home { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; padding:
|
|
8388
|
-
.taw-browser-
|
|
8389
|
-
.taw-browser-
|
|
8390
|
-
.taw-browser-
|
|
8929
|
+
.taw-browser-home { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; align-items: center; padding: clamp(40px, 20%, 160px) 16px 14px; }
|
|
8930
|
+
.taw-browser-sites { display: grid; grid-template-columns: repeat(auto-fit, 100px); justify-content: center; gap: 4px; width: 100%; max-width: 624px; }
|
|
8931
|
+
.taw-browser-site { position: relative; }
|
|
8932
|
+
.taw-browser-site-main { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; padding: 12px 4px 8px; border: 0; border-radius: 10px; background: none; color: var(--ta-secondary); font: inherit; cursor: pointer; outline: none; transition: background-color 120ms, color 120ms; }
|
|
8933
|
+
.taw-browser-site-main:hover { background: var(--ta-hover); color: var(--ta-text); }
|
|
8934
|
+
.taw-browser-site-main:focus-visible { box-shadow: inset 0 0 0 1px var(--ta-border-focus); }
|
|
8935
|
+
.taw-browser-tile { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--ta-chip); color: var(--ta-secondary); font-size: calc(16px * var(--ta-font-scale)); font-weight: 600; }
|
|
8936
|
+
.taw-browser-tile[style] { background: var(--taw-tint); color: var(--taw-ink); }
|
|
8937
|
+
.taw-browser-tile img { width: 20px; height: 20px; object-fit: contain; }
|
|
8938
|
+
.taw-browser-host { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(11.5px * var(--ta-font-scale)); }
|
|
8939
|
+
.taw-browser-remove { position: absolute; top: 4px; right: 8px; width: 18px; height: 18px; border-radius: 9px; background: var(--ta-raised); opacity: 0; }
|
|
8940
|
+
.taw-browser-site:hover .taw-browser-remove, .taw-browser-remove:focus-visible { opacity: 1; }
|
|
8941
|
+
.taw-browser-foot { display: flex; flex-direction: column; align-items: center; gap: 6px; margin-top: auto; padding-top: 24px; max-width: 360px; text-align: center; font-size: calc(11.5px * var(--ta-font-scale)); line-height: 1.6; color: var(--ta-muted); }
|
|
8942
|
+
.taw-browser-import { display: inline-flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: var(--ta-muted); font: inherit; cursor: pointer; }
|
|
8943
|
+
.taw-browser-import:hover { color: var(--ta-text); }
|
|
8391
8944
|
.taw-browser-mark { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; margin-bottom: 14px; border-radius: 14px; background: var(--ta-chip); color: var(--ta-secondary); }
|
|
8392
8945
|
.taw-browser-title { margin: 0; font-size: calc(14px * var(--ta-font-scale)); font-weight: 600; color: var(--ta-text); }
|
|
8393
8946
|
.taw-browser-sub { margin: 6px 0 0; font-size: calc(12.5px * var(--ta-font-scale)); line-height: 1.6; color: var(--ta-muted); }
|
|
8394
8947
|
.taw-browser-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 16px; }
|
|
8395
8948
|
.taw-browser-chip { height: 26px; padding: 0 10px; border: 1px solid var(--ta-border); border-radius: 13px; background: none; color: var(--ta-secondary); font-family: var(--ta-mono); font-size: calc(11px * var(--ta-font-scale)); cursor: pointer; transition: background-color 120ms, color 120ms; }
|
|
8396
8949
|
.taw-browser-chip:hover { background: var(--ta-hover); color: var(--ta-text); }
|
|
8397
|
-
.taw-browser-recent { width: 100%; max-width: 480px; margin-top: 32px; }
|
|
8398
|
-
.taw-browser-heading { margin: 0 0 4px; padding: 0 10px; font-size: calc(11px * var(--ta-font-scale)); font-weight: 600; color: var(--ta-secondary); }
|
|
8399
|
-
.taw-browser-site { display: flex; align-items: center; border-radius: 8px; }
|
|
8400
|
-
.taw-browser-site:hover { background: var(--ta-hover); }
|
|
8401
|
-
.taw-browser-site-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 4px 0 8px; border: 0; background: none; color: var(--ta-body); font: inherit; text-align: left; cursor: pointer; outline: none; }
|
|
8402
8950
|
.taw-browser-letter { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px; border-radius: 6px; background: var(--ta-chip); color: var(--ta-secondary); font-size: calc(11px * var(--ta-font-scale)); font-weight: 600; }
|
|
8403
|
-
.taw-browser-host { flex: none; max-width: 60%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-text); }
|
|
8404
|
-
.taw-browser-path { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }
|
|
8405
|
-
.taw-browser-remove { margin-right: 6px; opacity: 0; }
|
|
8406
|
-
.taw-browser-site:hover .taw-browser-remove, .taw-browser-remove:focus-visible { opacity: 1; }
|
|
8407
|
-
.taw-browser-site-main:focus-visible { box-shadow: inset 0 0 0 1px var(--ta-border-focus); border-radius: 8px; }
|
|
8408
|
-
.taw-browser-foot { margin: auto 0 0; padding-top: 24px; max-width: 340px; text-align: center; font-size: calc(11.5px * var(--ta-font-scale)); line-height: 1.6; color: var(--ta-muted); opacity: 0.8; }
|
|
8409
8951
|
.taw-editor-tools { display: flex; align-items: center; gap: 8px; flex: none; min-width: 0; }
|
|
8410
8952
|
.taw-editor-tools .taw-note { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
8411
8953
|
.taw-warning { color: var(--ta-yellow); }
|
|
@@ -8424,14 +8966,10 @@ var STYLE = `
|
|
|
8424
8966
|
.taw-preview-media { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 16px; overflow: auto; background: var(--ta-code); }
|
|
8425
8967
|
.taw-preview-media video { max-width: 100%; max-height: 100%; border-radius: 8px; background: #000; outline: none; }
|
|
8426
8968
|
.taw-preview-media audio { width: min(480px, 100%); }
|
|
8969
|
+
.taw-preview-picture { flex: 1; display: flex; min-height: 0; }
|
|
8427
8970
|
.taw-preview-image { background-color: var(--ta-code); background-image: linear-gradient(45deg, var(--ta-chip) 25%, transparent 25%, transparent 75%, var(--ta-chip) 75%), linear-gradient(45deg, var(--ta-chip) 25%, transparent 25%, transparent 75%, var(--ta-chip) 75%); background-size: 16px 16px; background-position: 0 0, 8px 8px; }
|
|
8428
|
-
|
|
8429
|
-
.taw-
|
|
8430
|
-
.taw-preview-image img { max-width: 100%; max-height: 100%; object-fit: contain; }
|
|
8431
|
-
.taw-preview-image.taw-actual { align-items: flex-start; justify-content: flex-start; }
|
|
8432
|
-
.taw-preview-image.taw-actual .taw-image-toggle { max-width: none; max-height: none; margin: auto; cursor: zoom-out; }
|
|
8433
|
-
.taw-preview-image.taw-actual img { max-width: none; max-height: none; }
|
|
8434
|
-
.taw-message { padding: 16px; color: var(--ta-muted); font-size: calc(13px * var(--ta-font-scale)); }
|
|
8971
|
+
/* What a file shows while it loads, or why it does not: in the middle of where the file would be. */
|
|
8972
|
+
.taw-message { flex: 1; display: flex; align-items: center; justify-content: center; height: 100%; min-height: 0; padding: 16px; text-align: center; color: var(--ta-muted); font-size: calc(13px * var(--ta-font-scale)); }
|
|
8435
8973
|
.taw-code { flex: 1; min-height: 0; overflow: auto; padding: 6px 0; background: var(--ta-code); font-family: var(--ta-mono); font-size: calc(12px * var(--ta-font-scale)); line-height: calc(20px * var(--ta-font-scale)); }
|
|
8436
8974
|
.taw-code-block { content-visibility: auto; }
|
|
8437
8975
|
.taw-code-line { display: flex; min-width: max-content; white-space: pre; }
|
|
@@ -8445,8 +8983,6 @@ var STYLE = `
|
|
|
8445
8983
|
.taw-browser-driven { display: inline-flex; align-items: center; flex: none; gap: 6px; height: 22px; margin-right: 2px; padding: 0 9px 0 8px; border-radius: 11px; background: color-mix(in srgb, var(--ta-green) 14%, transparent); color: var(--ta-green); font-size: calc(11.5px * var(--ta-font-scale)); white-space: nowrap; }
|
|
8446
8984
|
.taw-browser-driven-dot { width: 6px; height: 6px; border-radius: 3px; background: currentColor; animation: taw-pulse 1.2s ease-in-out infinite; }
|
|
8447
8985
|
@keyframes taw-pulse { 50% { opacity: 0.35; } }
|
|
8448
|
-
.taw-browser-import { display: inline-flex; align-items: center; gap: 6px; margin-top: 18px; padding: 0; border: 0; background: none; color: var(--ta-secondary); font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); cursor: pointer; }
|
|
8449
|
-
.taw-browser-import:hover { color: var(--ta-text); text-decoration: underline; text-underline-offset: 3px; }
|
|
8450
8986
|
.taw-import { display: flex; flex-direction: column; gap: 12px; width: min(420px, 80vw); font-size: calc(13px * var(--ta-font-scale)); color: var(--ta-text); }
|
|
8451
8987
|
.taw-import-hint { margin: 0; color: var(--ta-secondary); line-height: 1.6; }
|
|
8452
8988
|
.taw-import-error { margin: 0; color: var(--ta-red); line-height: 1.5; overflow-wrap: anywhere; }
|
|
@@ -8485,26 +9021,35 @@ var STYLE = `
|
|
|
8485
9021
|
}
|
|
8486
9022
|
.taw-file-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; overflow: hidden; font-family: 'taw-seti'; font-style: normal; font-weight: normal; line-height: 1; color: var(--taw-icon); -webkit-font-smoothing: antialiased; speak: never; }
|
|
8487
9023
|
:root[data-theme='light'] .taw-file-icon { color: var(--taw-icon-light); }
|
|
8488
|
-
/*
|
|
9024
|
+
/*
|
|
9025
|
+
* Terminals: a bar over the screen (its title, or tabs when there are more), the screen, and under it the keys of a
|
|
9026
|
+
* touch screen or how it ended. Tabs a level under those of the workbench (cards): words over a line, the one
|
|
9027
|
+
* shown underlined, its cross stronger; + after the last, the kill of the one shown at the end.
|
|
9028
|
+
*/
|
|
8489
9029
|
.taw-terminals .taw-editor { background: var(--ta-code); }
|
|
8490
|
-
.taw-terminal-bar { display: flex; align-items:
|
|
8491
|
-
.taw-terminal-
|
|
9030
|
+
.taw-terminal-bar { display: flex; align-items: stretch; gap: 2px; height: 36px; padding: 0 6px 0 4px; flex: none; background: var(--ta-main); box-shadow: inset 0 -1px 0 var(--ta-border-muted); }
|
|
9031
|
+
.taw-terminal-bar > .taw-action { align-self: center; }
|
|
9032
|
+
.taw-terminal-bar > .taw-actions { align-items: center; margin-left: auto; }
|
|
9033
|
+
.taw-terminal-tabs { display: flex; align-items: stretch; gap: 2px; flex: 0 1 auto; min-width: 0; overflow-x: auto; scrollbar-width: none; }
|
|
8492
9034
|
.taw-terminal-tabs::-webkit-scrollbar { display: none; }
|
|
8493
|
-
.taw-terminal-tab { display: flex; align-items: center; flex: none; max-width: 200px;
|
|
8494
|
-
.taw-terminal-tab
|
|
8495
|
-
.taw-terminal-tab
|
|
8496
|
-
.taw-terminal-tab-
|
|
8497
|
-
.taw-terminal-tab-
|
|
9035
|
+
.taw-terminal-tab { position: relative; display: flex; align-items: center; flex: none; max-width: 200px; padding-right: 2px; color: var(--ta-muted); transition: color 0.12s; }
|
|
9036
|
+
.taw-terminal-tab::after { content: ''; position: absolute; left: 6px; right: 6px; bottom: 0; height: 2px; border-radius: 2px 2px 0 0; background: var(--ta-text); opacity: 0; transform: scaleX(0.6); transition: opacity 0.16s, transform 0.2s var(--ta-ease); }
|
|
9037
|
+
.taw-terminal-tab:hover { color: var(--ta-body); }
|
|
9038
|
+
.taw-terminal-tab.taw-on { color: var(--ta-text); }
|
|
9039
|
+
.taw-terminal-tab.taw-on::after { opacity: 1; transform: none; }
|
|
9040
|
+
.taw-terminal-tab-main { display: flex; align-items: center; gap: 6px; min-width: 0; height: 100%; padding: 0 4px 0 8px; border: 0; background: none; color: inherit; font: inherit; font-size: calc(12.5px * var(--ta-font-scale)); cursor: pointer; }
|
|
9041
|
+
.taw-terminal-tab-main:focus-visible { outline: 1px solid var(--ta-border-focus); outline-offset: -5px; border-radius: 8px; }
|
|
8498
9042
|
.taw-terminal-tab-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
9043
|
+
/* The number after a title another tab has too (cell 2): quieter than the title. */
|
|
9044
|
+
.taw-terminal-ordinal { color: var(--ta-muted); font-variant-numeric: tabular-nums; }
|
|
9045
|
+
.taw-terminal-tab.taw-on .taw-terminal-ordinal { color: var(--ta-secondary); }
|
|
8499
9046
|
.taw-terminal-tab > .taw-action { width: 18px; height: 18px; border-radius: 4px; opacity: 0; transition: opacity 0.12s; }
|
|
8500
9047
|
.taw-terminal-tab:hover > .taw-action, .taw-terminal-tab.taw-on > .taw-action, .taw-terminal-tab:focus-within > .taw-action { opacity: 1; }
|
|
8501
9048
|
.taw-terminal-tab > .taw-action svg { width: 13px; height: 13px; }
|
|
8502
|
-
.taw-terminal-title { display: flex; align-items: center; gap: 7px; flex: 1; min-width: 0; padding: 0 6px; font-size: calc(12px * var(--ta-font-scale)); color: var(--ta-secondary); cursor: default; }
|
|
9049
|
+
.taw-terminal-title { display: flex; align-items: center; gap: 7px; flex: 0 1 auto; min-width: 0; padding: 0 6px 0 8px; font-size: calc(12px * var(--ta-font-scale)); color: var(--ta-secondary); cursor: default; }
|
|
8503
9050
|
.taw-terminal-rename { width: 140px; min-width: 0; height: 20px; padding: 0 5px; border: 1px solid var(--ta-border-focus); border-radius: 4px; background: var(--ta-input); color: var(--ta-text); font: inherit; font-size: calc(12px * var(--ta-font-scale)); outline: none; }
|
|
8504
9051
|
.taw-terminal-dot { flex: none; width: 7px; height: 7px; margin: 0 3px; border-radius: 50%; background: var(--ta-muted); }
|
|
8505
9052
|
.taw-terminal-dot.taw-failed { background: var(--ta-red); }
|
|
8506
|
-
.taw-terminal-index { flex: none; min-width: 20px; height: 16px; padding: 0 4px; border-radius: 4px; background: color-mix(in srgb, currentColor 12%, transparent); font-family: var(--ta-mono); font-size: calc(10px * var(--ta-font-scale)); font-weight: 600; line-height: calc(16px * var(--ta-font-scale)); text-align: center; letter-spacing: 0.02em; }
|
|
8507
|
-
.taw-terminal-tab.taw-on .taw-terminal-index { background: color-mix(in srgb, currentColor 16%, transparent); }
|
|
8508
9053
|
/* What its program says of itself: at work (a spinner), how far (a ring), that it rang while out of sight (a dot after the title). */
|
|
8509
9054
|
.taw-terminal-spinner { flex: none; box-sizing: border-box; width: 12px; height: 12px; margin: 0 0.5px; border: 1.6px solid color-mix(in srgb, currentColor 22%, transparent); border-top-color: var(--ta-brand); border-radius: 50%; animation: taw-terminal-spin 0.9s linear infinite; }
|
|
8510
9055
|
@keyframes taw-terminal-spin { to { transform: rotate(360deg); } }
|
|
@@ -8527,11 +9072,32 @@ var STYLE = `
|
|
|
8527
9072
|
.taw-touch-key { flex: none; min-width: 42px; height: 36px; padding: 0 10px; border: 1px solid var(--ta-border); border-radius: 8px; background: var(--ta-card); color: var(--ta-text); font-family: var(--ta-mono); font-size: calc(14px * var(--ta-font-scale)); -webkit-user-select: none; user-select: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
|
|
8528
9073
|
.taw-touch-key:active { background: var(--ta-hover); }
|
|
8529
9074
|
.taw-touch-key.taw-on { border-color: var(--ta-brand); background: var(--ta-brand); color: var(--ta-brand-text); }
|
|
8530
|
-
:
|
|
8531
|
-
:root[data-touch] .taw-terminal-
|
|
8532
|
-
:root[data-touch] .taw-terminal-tab-main { font-size: calc(
|
|
8533
|
-
:root[data-touch] .taw-terminal-tab > .taw-action { width: 30px; height: 30px; }
|
|
9075
|
+
/* A finger: a bar of its height, tabs of its width; the cross of the one shown only; a tap leaves no hover behind. */
|
|
9076
|
+
:root[data-touch] .taw-terminal-bar { height: 44px; padding-left: 2px; }
|
|
9077
|
+
:root[data-touch] .taw-terminal-tab-main { padding: 0 6px 0 10px; font-size: calc(13.5px * var(--ta-font-scale)); }
|
|
9078
|
+
:root[data-touch] .taw-terminal-tab > .taw-action { width: 30px; height: 30px; margin-left: -6px; }
|
|
8534
9079
|
:root[data-touch] .taw-terminal-tab:not(.taw-on) > .taw-action { display: none; }
|
|
9080
|
+
:root[data-touch] .taw-terminal-tab:hover:not(.taw-on) { color: var(--ta-muted); }
|
|
9081
|
+
:root[data-touch] .taw-action:hover:not(:disabled):not(.taw-on) { background: none; color: var(--ta-muted); }
|
|
9082
|
+
:root[data-touch] .taw-action:active:not(:disabled):not(.taw-on) { background: var(--ta-hover); color: var(--ta-text); }
|
|
9083
|
+
/* The tools of the workbench in the launcher, as the tiles of the launcher's own sections */
|
|
9084
|
+
.taw-launch { display: flex; flex-direction: column; }
|
|
9085
|
+
.taw-launch-head { display: flex; align-items: center; gap: 8px; min-height: 30px; margin: 0 2px 10px; }
|
|
9086
|
+
.taw-launch-label { flex: 1; min-width: 0; color: var(--ta-muted); font-size: calc(13px * var(--ta-font-scale)); line-height: calc(18px * var(--ta-font-scale)); font-weight: 500; }
|
|
9087
|
+
.taw-launch-cwd { display: flex; align-items: center; gap: 4px; min-width: 0; max-width: 55%; color: var(--ta-muted); font-size: calc(12px * var(--ta-font-scale)); }
|
|
9088
|
+
.taw-launch-cwd > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
9089
|
+
.taw-launch-cwd > svg { flex: none; }
|
|
9090
|
+
.taw-launch-explorer { --taw-tint: var(--ta-tint-8); --taw-ink: var(--ta-tint-ink-8); }
|
|
9091
|
+
.taw-launch-search { --taw-tint: var(--ta-tint-4); --taw-ink: var(--ta-tint-ink-4); }
|
|
9092
|
+
.taw-launch-scm { --taw-tint: var(--ta-tint-3); --taw-ink: var(--ta-tint-ink-3); }
|
|
9093
|
+
.taw-launch-terminal { --taw-tint: var(--ta-tint-5); --taw-ink: var(--ta-tint-ink-5); }
|
|
9094
|
+
.taw-launch-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 -2px; }
|
|
9095
|
+
.taw-launch-tile { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; padding: 4px 2px; border: 0; border-radius: 14px; background: none; color: var(--ta-text); font: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; -webkit-touch-callout: none; user-select: none; }
|
|
9096
|
+
.taw-launch-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; background: var(--taw-tint); color: var(--taw-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--taw-ink) 10%, transparent); transition: transform 160ms var(--ta-ease), filter 160ms; }
|
|
9097
|
+
.taw-launch-tile:hover .taw-launch-icon { filter: brightness(0.97); }
|
|
9098
|
+
.taw-launch-tile:active .taw-launch-icon { transform: scale(0.92); }
|
|
9099
|
+
.taw-launch-tile:focus-visible { outline: 1px solid var(--ta-border-focus); outline-offset: -1px; }
|
|
9100
|
+
.taw-launch-name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ta-body); font-size: calc(12px * var(--ta-font-scale)); line-height: calc(16px * var(--ta-font-scale)); }
|
|
8535
9101
|
`;
|
|
8536
9102
|
function injectStyle() {
|
|
8537
9103
|
const element = document.createElement("style");
|
|
@@ -8553,16 +9119,16 @@ var CTRL_SYMBOLS = { "@": "\x00", " ": "\x00", "[": "\x1B", "\\": "\x1C", "]": "
|
|
|
8553
9119
|
var TerminalUtil;
|
|
8554
9120
|
((TerminalUtil) => {
|
|
8555
9121
|
function title(raw) {
|
|
8556
|
-
const
|
|
8557
|
-
if (!
|
|
9122
|
+
const text2 = raw?.trim();
|
|
9123
|
+
if (!text2) {
|
|
8558
9124
|
return;
|
|
8559
9125
|
}
|
|
8560
|
-
const
|
|
8561
|
-
const where =
|
|
9126
|
+
const at2 = text2.lastIndexOf(":");
|
|
9127
|
+
const where = at2 < 0 ? "" : text2.slice(at2 + 1).trim();
|
|
8562
9128
|
if (where === "~") {
|
|
8563
9129
|
return where;
|
|
8564
9130
|
}
|
|
8565
|
-
return /[\\/]/.test(where) ? dir(where.replace(/[\\/]+$/, "")) ||
|
|
9131
|
+
return /[\\/]/.test(where) ? dir(where.replace(/[\\/]+$/, "")) || text2 : text2;
|
|
8566
9132
|
}
|
|
8567
9133
|
TerminalUtil.title = title;
|
|
8568
9134
|
function dir(cwd) {
|
|
@@ -8577,6 +9143,15 @@ var TerminalUtil;
|
|
|
8577
9143
|
return terminals.map((terminal) => terminal.name || terminal.title || shellName(terminal.shell) || fallback);
|
|
8578
9144
|
}
|
|
8579
9145
|
TerminalUtil.titles = titles;
|
|
9146
|
+
function ordinals(titles2) {
|
|
9147
|
+
const seen = new Map;
|
|
9148
|
+
return titles2.map((title2) => {
|
|
9149
|
+
const count = (seen.get(title2) ?? 0) + 1;
|
|
9150
|
+
seen.set(title2, count);
|
|
9151
|
+
return count > 1 ? count : undefined;
|
|
9152
|
+
});
|
|
9153
|
+
}
|
|
9154
|
+
TerminalUtil.ordinals = ordinals;
|
|
8580
9155
|
function ctrl(data) {
|
|
8581
9156
|
if (data.length !== 1) {
|
|
8582
9157
|
return data;
|
|
@@ -8601,6 +9176,7 @@ var Terminals;
|
|
|
8601
9176
|
let list2 = [];
|
|
8602
9177
|
let frame = 0;
|
|
8603
9178
|
let seen;
|
|
9179
|
+
let fitted;
|
|
8604
9180
|
function all() {
|
|
8605
9181
|
return list2;
|
|
8606
9182
|
}
|
|
@@ -8625,8 +9201,7 @@ var Terminals;
|
|
|
8625
9201
|
});
|
|
8626
9202
|
}
|
|
8627
9203
|
}
|
|
8628
|
-
function create(info, name) {
|
|
8629
|
-
const terminal = pi.ui.createTerminal({ cols: OPEN_COLS, rows: OPEN_ROWS, cwd: info.cwd || undefined });
|
|
9204
|
+
function create(info, terminal, name) {
|
|
8630
9205
|
const created = { info, terminal, name };
|
|
8631
9206
|
const id = info.terminalId;
|
|
8632
9207
|
terminal.onData((data) => {
|
|
@@ -8644,6 +9219,7 @@ var Terminals;
|
|
|
8644
9219
|
});
|
|
8645
9220
|
let timer;
|
|
8646
9221
|
terminal.onResize(({ cols, rows }) => {
|
|
9222
|
+
fitted = { cols, rows };
|
|
8647
9223
|
clearTimeout(timer);
|
|
8648
9224
|
timer = setTimeout(() => void pi.terminals.resizeTerminal(id, cols, rows).catch(() => {
|
|
8649
9225
|
return;
|
|
@@ -8671,10 +9247,10 @@ var Terminals;
|
|
|
8671
9247
|
});
|
|
8672
9248
|
return created;
|
|
8673
9249
|
}
|
|
8674
|
-
function add(info) {
|
|
9250
|
+
function add(info, terminal) {
|
|
8675
9251
|
let session = sessions.get(info.terminalId);
|
|
8676
9252
|
if (!session) {
|
|
8677
|
-
session = create(info);
|
|
9253
|
+
session = create(info, terminal ?? pi.ui.createTerminal({ cols: OPEN_COLS, rows: OPEN_ROWS, cwd: info.cwd || undefined }));
|
|
8678
9254
|
sessions.set(info.terminalId, session);
|
|
8679
9255
|
changed();
|
|
8680
9256
|
}
|
|
@@ -8734,11 +9310,25 @@ var Terminals;
|
|
|
8734
9310
|
}
|
|
8735
9311
|
}
|
|
8736
9312
|
Terminals.setCtrl = setCtrl;
|
|
9313
|
+
function viewSize() {
|
|
9314
|
+
return fitted;
|
|
9315
|
+
}
|
|
9316
|
+
Terminals.viewSize = viewSize;
|
|
9317
|
+
function fit(terminal) {
|
|
9318
|
+
return new Promise((resolve) => {
|
|
9319
|
+
const off = terminal.onResize((size) => {
|
|
9320
|
+
off();
|
|
9321
|
+
fitted = size;
|
|
9322
|
+
resolve(size);
|
|
9323
|
+
});
|
|
9324
|
+
});
|
|
9325
|
+
}
|
|
9326
|
+
Terminals.fit = fit;
|
|
8737
9327
|
async function restart(session) {
|
|
8738
9328
|
const old = session.info.terminalId;
|
|
8739
9329
|
const { cols, rows } = session.terminal;
|
|
8740
9330
|
const info = await pi.terminals.openTerminal({ cwd: session.info.cwd || undefined, cols, rows });
|
|
8741
|
-
const created = create(info, session.name);
|
|
9331
|
+
const created = create(info, pi.ui.createTerminal({ cols, rows, cwd: info.cwd || undefined }), session.name);
|
|
8742
9332
|
sessions = new Map([...sessions].map(([id, other]) => id === old ? [info.terminalId, created] : [id, other]));
|
|
8743
9333
|
if (!sessions.has(info.terminalId)) {
|
|
8744
9334
|
sessions.set(info.terminalId, created);
|
|
@@ -8785,26 +9375,23 @@ function closeEach(sessions) {
|
|
|
8785
9375
|
}
|
|
8786
9376
|
}
|
|
8787
9377
|
function copySelection(session) {
|
|
8788
|
-
const
|
|
8789
|
-
if (
|
|
8790
|
-
navigator.clipboard?.writeText(
|
|
9378
|
+
const text2 = session.terminal.getSelection();
|
|
9379
|
+
if (text2) {
|
|
9380
|
+
navigator.clipboard?.writeText(text2).catch(() => {
|
|
8791
9381
|
return;
|
|
8792
9382
|
});
|
|
8793
9383
|
}
|
|
8794
9384
|
}
|
|
8795
9385
|
function pasteClipboard(session) {
|
|
8796
|
-
navigator.clipboard?.readText().then((
|
|
9386
|
+
navigator.clipboard?.readText().then((text2) => text2 && session.terminal.paste(text2)).catch(() => {
|
|
8797
9387
|
return;
|
|
8798
9388
|
});
|
|
8799
9389
|
}
|
|
8800
9390
|
|
|
8801
9391
|
// web-src/terminal.tsx
|
|
8802
|
-
function TerminalBadge({ session
|
|
9392
|
+
function TerminalBadge({ session }) {
|
|
8803
9393
|
const progress = session.progress;
|
|
8804
|
-
return
|
|
8805
|
-
className: "taw-terminal-index",
|
|
8806
|
-
"aria-hidden": "true"
|
|
8807
|
-
}, "T", index + 1), session.exitCode !== undefined ? /* @__PURE__ */ React.createElement("span", {
|
|
9394
|
+
return session.exitCode !== undefined ? /* @__PURE__ */ React.createElement("span", {
|
|
8808
9395
|
className: `taw-terminal-dot ${session.exitCode ? "taw-failed" : ""}`,
|
|
8809
9396
|
"aria-hidden": "true"
|
|
8810
9397
|
}) : progress?.state === "busy" ? /* @__PURE__ */ React.createElement("span", {
|
|
@@ -8813,7 +9400,7 @@ function TerminalBadge({ session, index }) {
|
|
|
8813
9400
|
}) : progress && (progress.value !== undefined || progress.state === "error") ? /* @__PURE__ */ React.createElement(ProgressRing, {
|
|
8814
9401
|
state: progress.state,
|
|
8815
9402
|
value: progress.value ?? 100
|
|
8816
|
-
}) : null
|
|
9403
|
+
}) : null;
|
|
8817
9404
|
}
|
|
8818
9405
|
function ProgressRing({ state, value }) {
|
|
8819
9406
|
const radius = 5;
|
|
@@ -8880,17 +9467,35 @@ function TerminalView() {
|
|
|
8880
9467
|
const [renaming, setRenaming] = React.useState();
|
|
8881
9468
|
const [error, setError] = React.useState();
|
|
8882
9469
|
const opening = React.useRef(false);
|
|
9470
|
+
const [measuring, setMeasuring] = React.useState();
|
|
9471
|
+
const unmounted = React.useRef(false);
|
|
9472
|
+
React.useEffect(() => () => {
|
|
9473
|
+
unmounted.current = true;
|
|
9474
|
+
}, []);
|
|
8883
9475
|
const create = React.useCallback(async () => {
|
|
8884
9476
|
if (opening.current) {
|
|
8885
9477
|
return;
|
|
8886
9478
|
}
|
|
8887
9479
|
opening.current = true;
|
|
9480
|
+
const known = Terminals.viewSize();
|
|
9481
|
+
const terminal = pi.ui.createTerminal({ cols: known?.cols ?? 2, rows: known?.rows ?? 1, cwd });
|
|
8888
9482
|
try {
|
|
8889
9483
|
setError(undefined);
|
|
8890
|
-
|
|
9484
|
+
if (!known) {
|
|
9485
|
+
setMeasuring(terminal);
|
|
9486
|
+
await Terminals.fit(terminal);
|
|
9487
|
+
}
|
|
9488
|
+
if (unmounted.current) {
|
|
9489
|
+
terminal.dispose();
|
|
9490
|
+
return;
|
|
9491
|
+
}
|
|
9492
|
+
const info = await pi.terminals.openTerminal({ cwd, cols: terminal.cols, rows: terminal.rows });
|
|
9493
|
+
setShown(Terminals.add(info, terminal).info.terminalId);
|
|
8891
9494
|
} catch (failure) {
|
|
9495
|
+
terminal.dispose();
|
|
8892
9496
|
setError(Host.message(failure));
|
|
8893
9497
|
} finally {
|
|
9498
|
+
setMeasuring(undefined);
|
|
8894
9499
|
opening.current = false;
|
|
8895
9500
|
}
|
|
8896
9501
|
}, [cwd]);
|
|
@@ -8912,6 +9517,13 @@ function TerminalView() {
|
|
|
8912
9517
|
shell: session.info.shell
|
|
8913
9518
|
})), t("terminal"));
|
|
8914
9519
|
const titleOf = (session) => titles[sessions.indexOf(session)] ?? t("terminal");
|
|
9520
|
+
const ordinals = TerminalUtil.ordinals(titles);
|
|
9521
|
+
const ordinalOf = (session) => {
|
|
9522
|
+
const ordinal = ordinals[sessions.indexOf(session)];
|
|
9523
|
+
return ordinal && /* @__PURE__ */ React.createElement("span", {
|
|
9524
|
+
className: "taw-terminal-ordinal"
|
|
9525
|
+
}, ` ${ordinal}`);
|
|
9526
|
+
};
|
|
8915
9527
|
const restart = (session) => {
|
|
8916
9528
|
Terminals.restart(session).then(setShown, (failure) => setError(Host.message(failure)));
|
|
8917
9529
|
};
|
|
@@ -8924,10 +9536,10 @@ function TerminalView() {
|
|
|
8924
9536
|
};
|
|
8925
9537
|
const [menu, openMenu] = useContextMenu();
|
|
8926
9538
|
const tabMenu = (session) => {
|
|
8927
|
-
const
|
|
9539
|
+
const at2 = sessions.indexOf(session);
|
|
8928
9540
|
const others = sessions.filter((other) => other !== session);
|
|
8929
|
-
const left = sessions.slice(0,
|
|
8930
|
-
const right = sessions.slice(
|
|
9541
|
+
const left = sessions.slice(0, at2);
|
|
9542
|
+
const right = sessions.slice(at2 + 1);
|
|
8931
9543
|
const ended = sessions.filter((other) => other.exitCode !== undefined);
|
|
8932
9544
|
return [
|
|
8933
9545
|
{ label: t("renameTerminal"), run: () => setRenaming(session.info.terminalId) },
|
|
@@ -8983,8 +9595,7 @@ function TerminalView() {
|
|
|
8983
9595
|
}, renaming === id ? /* @__PURE__ */ React.createElement("span", {
|
|
8984
9596
|
className: "taw-terminal-tab-main"
|
|
8985
9597
|
}, /* @__PURE__ */ React.createElement(TerminalBadge, {
|
|
8986
|
-
session
|
|
8987
|
-
index: sessions.indexOf(session)
|
|
9598
|
+
session
|
|
8988
9599
|
}), /* @__PURE__ */ React.createElement(RenameField, {
|
|
8989
9600
|
value: title,
|
|
8990
9601
|
onDone: finishRename(session)
|
|
@@ -8998,11 +9609,10 @@ function TerminalView() {
|
|
|
8998
9609
|
onAuxClick: (event) => event.button === 1 && void close2(session),
|
|
8999
9610
|
onContextMenu: (event) => openMenu(event, tabMenu(session))
|
|
9000
9611
|
}, /* @__PURE__ */ React.createElement(TerminalBadge, {
|
|
9001
|
-
session
|
|
9002
|
-
index: sessions.indexOf(session)
|
|
9612
|
+
session
|
|
9003
9613
|
}), /* @__PURE__ */ React.createElement("span", {
|
|
9004
9614
|
className: "taw-terminal-tab-title"
|
|
9005
|
-
}, title), stateOf(session) && /* @__PURE__ */ React.createElement("span", {
|
|
9615
|
+
}, title, ordinalOf(session)), stateOf(session) && /* @__PURE__ */ React.createElement("span", {
|
|
9006
9616
|
className: "taw-sr-only"
|
|
9007
9617
|
}, stateOf(session)), session.attention && !on && /* @__PURE__ */ React.createElement("span", {
|
|
9008
9618
|
className: "taw-terminal-attention"
|
|
@@ -9019,27 +9629,26 @@ function TerminalView() {
|
|
|
9019
9629
|
onDoubleClick: () => setRenaming(current.info.terminalId),
|
|
9020
9630
|
onContextMenu: (event) => openMenu(event, tabMenu(current))
|
|
9021
9631
|
}, /* @__PURE__ */ React.createElement(TerminalBadge, {
|
|
9022
|
-
session: current
|
|
9023
|
-
index: sessions.indexOf(current)
|
|
9632
|
+
session: current
|
|
9024
9633
|
}), renaming === current.info.terminalId ? /* @__PURE__ */ React.createElement(RenameField, {
|
|
9025
9634
|
value: titleOf(current),
|
|
9026
9635
|
onDone: finishRename(current)
|
|
9027
9636
|
}) : /* @__PURE__ */ React.createElement("span", {
|
|
9028
9637
|
className: "taw-terminal-tab-title"
|
|
9029
|
-
}, titleOf(current))), /* @__PURE__ */ React.createElement(
|
|
9030
|
-
className: "taw-actions"
|
|
9031
|
-
}, /* @__PURE__ */ React.createElement(Action, {
|
|
9638
|
+
}, titleOf(current))), /* @__PURE__ */ React.createElement(Action, {
|
|
9032
9639
|
icon: "Plus",
|
|
9033
9640
|
label: t("newTerminal"),
|
|
9034
9641
|
onClick: () => void create()
|
|
9035
|
-
}),
|
|
9642
|
+
}), /* @__PURE__ */ React.createElement("div", {
|
|
9643
|
+
className: "taw-actions"
|
|
9644
|
+
}, current && /* @__PURE__ */ React.createElement(Action, {
|
|
9036
9645
|
icon: "Trash2",
|
|
9037
9646
|
label: t("killTerminal"),
|
|
9038
9647
|
onClick: () => void close2(current)
|
|
9039
9648
|
}))), menu, error && /* @__PURE__ */ React.createElement(Empty, {
|
|
9040
9649
|
tone: "error",
|
|
9041
9650
|
title: t("failed", { message: error })
|
|
9042
|
-
}), !error && sessions.length === 0 && /* @__PURE__ */ React.createElement(Empty, {
|
|
9651
|
+
}), !error && sessions.length === 0 && !measuring && /* @__PURE__ */ React.createElement(Empty, {
|
|
9043
9652
|
title: t("noTerminals")
|
|
9044
9653
|
}, /* @__PURE__ */ React.createElement("button", {
|
|
9045
9654
|
type: "button",
|
|
@@ -9048,7 +9657,9 @@ function TerminalView() {
|
|
|
9048
9657
|
}, /* @__PURE__ */ React.createElement(Glyph, {
|
|
9049
9658
|
name: "Plus",
|
|
9050
9659
|
size: 14
|
|
9051
|
-
}), t("newTerminal"))), current && /* @__PURE__ */ React.createElement(
|
|
9660
|
+
}), t("newTerminal"))), measuring && !current && /* @__PURE__ */ React.createElement(MeasuringScreen, {
|
|
9661
|
+
terminal: measuring
|
|
9662
|
+
}), current && /* @__PURE__ */ React.createElement(TerminalEditor, {
|
|
9052
9663
|
key: current.info.terminalId,
|
|
9053
9664
|
terminalId: current.info.terminalId,
|
|
9054
9665
|
onMenu: (event, session) => openMenu(event, screenMenu(session)),
|
|
@@ -9085,7 +9696,7 @@ function TouchKeys({ session }) {
|
|
|
9085
9696
|
onPointerDown: keep,
|
|
9086
9697
|
onMouseDown: keep,
|
|
9087
9698
|
onClick: press(() => Terminals.setCtrl(id, !session.ctrl))
|
|
9088
|
-
}, "Ctrl"), TOUCH_KEYS.map(({ label: label2, key, text }) => /* @__PURE__ */ React.createElement("button", {
|
|
9699
|
+
}, "Ctrl"), TOUCH_KEYS.map(({ label: label2, key, text: text2 }) => /* @__PURE__ */ React.createElement("button", {
|
|
9089
9700
|
key: label2,
|
|
9090
9701
|
type: "button",
|
|
9091
9702
|
className: "taw-touch-key",
|
|
@@ -9095,12 +9706,22 @@ function TouchKeys({ session }) {
|
|
|
9095
9706
|
if (key) {
|
|
9096
9707
|
Terminals.setCtrl(id, false);
|
|
9097
9708
|
session.terminal.sendKey(key);
|
|
9098
|
-
} else if (
|
|
9099
|
-
session.terminal.type(
|
|
9709
|
+
} else if (text2) {
|
|
9710
|
+
session.terminal.type(text2);
|
|
9100
9711
|
}
|
|
9101
9712
|
})
|
|
9102
9713
|
}, label2)));
|
|
9103
9714
|
}
|
|
9715
|
+
function MeasuringScreen({ terminal }) {
|
|
9716
|
+
const box = React.useRef(null);
|
|
9717
|
+
React.useEffect(() => box.current ? terminal.attach(box.current) : undefined, [terminal]);
|
|
9718
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
9719
|
+
className: "taw-editor"
|
|
9720
|
+
}, /* @__PURE__ */ React.createElement("div", {
|
|
9721
|
+
className: "taw-terminal",
|
|
9722
|
+
ref: box
|
|
9723
|
+
}));
|
|
9724
|
+
}
|
|
9104
9725
|
function TerminalEditor({
|
|
9105
9726
|
terminalId,
|
|
9106
9727
|
onMenu,
|
|
@@ -9181,6 +9802,23 @@ function TerminalEditor({
|
|
|
9181
9802
|
}));
|
|
9182
9803
|
}
|
|
9183
9804
|
|
|
9805
|
+
// web-src/util/keys.ts
|
|
9806
|
+
var WorkspaceKeys;
|
|
9807
|
+
((WorkspaceKeys) => {
|
|
9808
|
+
const LETTERS = { e: "explorer", f: "search", g: "scm" };
|
|
9809
|
+
function tool(event, mac) {
|
|
9810
|
+
if (event.altKey) {
|
|
9811
|
+
return;
|
|
9812
|
+
}
|
|
9813
|
+
if (event.ctrlKey && !event.metaKey && !event.shiftKey && (event.code === "Backquote" || event.key === "`")) {
|
|
9814
|
+
return "terminal";
|
|
9815
|
+
}
|
|
9816
|
+
const mod = mac ? event.metaKey && !event.ctrlKey : event.ctrlKey && !event.metaKey;
|
|
9817
|
+
return mod && event.shiftKey ? LETTERS[event.key.toLowerCase()] : undefined;
|
|
9818
|
+
}
|
|
9819
|
+
WorkspaceKeys.tool = tool;
|
|
9820
|
+
})(WorkspaceKeys ||= {});
|
|
9821
|
+
|
|
9184
9822
|
// web-src/index.tsx
|
|
9185
9823
|
function openLink(pi2, link2) {
|
|
9186
9824
|
if (link2.type === "file") {
|
|
@@ -9216,9 +9854,21 @@ function activate(pi2) {
|
|
|
9216
9854
|
if (pi2.ui.debugWebview) {
|
|
9217
9855
|
pi2.registerTool(AgentBrowser.TOOL);
|
|
9218
9856
|
}
|
|
9857
|
+
BrowserToolLine.register(pi2, (key) => t(key));
|
|
9858
|
+
pi2.registerView("launcher", { title: label("workbench"), icon: Host.icon("SquareTerminal"), render: LauncherTools, location: "launcher", order: -10 });
|
|
9859
|
+
const onKey = (event) => {
|
|
9860
|
+
const tool = WorkspaceKeys.tool(event, MAC);
|
|
9861
|
+
if (tool) {
|
|
9862
|
+
event.preventDefault();
|
|
9863
|
+
event.stopPropagation();
|
|
9864
|
+
showTool(tool);
|
|
9865
|
+
}
|
|
9866
|
+
};
|
|
9867
|
+
window.addEventListener("keydown", onKey, true);
|
|
9219
9868
|
const stopTerminals = pi2.onTerminalData((terminalId, data, exitCode) => Terminals.receive(terminalId, data, exitCode));
|
|
9220
9869
|
OpenFiles.restore();
|
|
9221
9870
|
return () => {
|
|
9871
|
+
window.removeEventListener("keydown", onKey, true);
|
|
9222
9872
|
stopTerminals();
|
|
9223
9873
|
removeStyle();
|
|
9224
9874
|
};
|