@songsid/agend 2.4.0-beta.3 → 2.4.0-beta.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -1
- package/README.zh-TW.md +11 -1
- package/dist/accounts-profiles.d.ts +1 -1
- package/dist/accounts-view.d.ts +32 -0
- package/dist/accounts-view.js +2 -14
- package/dist/accounts-view.js.map +1 -1
- package/dist/agend-home.js +5 -5
- package/dist/agend-home.js.map +1 -1
- package/dist/agent-cli-instructions.md +19 -7
- package/dist/agent-cli.js +199 -51
- package/dist/agent-cli.js.map +1 -1
- package/dist/agent-endpoint.d.ts +5 -1
- package/dist/agent-endpoint.js +62 -11
- package/dist/agent-endpoint.js.map +1 -1
- package/dist/agent-export.d.ts +3 -1
- package/dist/agent-export.js +18 -1
- package/dist/agent-export.js.map +1 -1
- package/dist/agent-file-read.js +3 -3
- package/dist/agent-file-read.js.map +1 -1
- package/dist/agent-whats-new.js +35 -0
- package/dist/agent-whats-new.js.map +1 -1
- package/dist/agent-workspace.d.ts +18 -2
- package/dist/agent-workspace.js +15 -4
- package/dist/agent-workspace.js.map +1 -1
- package/dist/app-message-origin.d.ts +2 -0
- package/dist/app-message-origin.js +3 -0
- package/dist/app-message-origin.js.map +1 -0
- package/dist/apply-job.d.ts +2 -2
- package/dist/auth-api.d.ts +12 -0
- package/dist/auth-api.js +87 -5
- package/dist/auth-api.js.map +1 -1
- package/dist/authority/authority-state.d.ts +7 -0
- package/dist/authority/authority-state.js +17 -2
- package/dist/authority/authority-state.js.map +1 -1
- package/dist/authority/web-authority.d.ts +28 -4
- package/dist/authority/web-authority.js +67 -4
- package/dist/authority/web-authority.js.map +1 -1
- package/dist/backend/agy-model-switch.d.ts +22 -0
- package/dist/backend/agy-model-switch.js +62 -0
- package/dist/backend/agy-model-switch.js.map +1 -0
- package/dist/backend/antigravity.d.ts +9 -2
- package/dist/backend/antigravity.js +82 -13
- package/dist/backend/antigravity.js.map +1 -1
- package/dist/backend/claude-carry.d.ts +11 -0
- package/dist/backend/claude-carry.js +88 -6
- package/dist/backend/claude-carry.js.map +1 -1
- package/dist/backend/claude-code.d.ts +39 -7
- package/dist/backend/claude-code.js +234 -32
- package/dist/backend/claude-code.js.map +1 -1
- package/dist/backend/claude-mcp-carry.d.ts +63 -0
- package/dist/backend/claude-mcp-carry.js +242 -0
- package/dist/backend/claude-mcp-carry.js.map +1 -0
- package/dist/backend/claude-transcript-errors.d.ts +4 -0
- package/dist/backend/claude-transcript-errors.js +5 -1
- package/dist/backend/claude-transcript-errors.js.map +1 -1
- package/dist/backend/claude-usage-credits.d.ts +8 -0
- package/dist/backend/claude-usage-credits.js +121 -0
- package/dist/backend/claude-usage-credits.js.map +1 -0
- package/dist/backend/cli-env-probe.js +1 -1
- package/dist/backend/cli-env-probe.js.map +1 -1
- package/dist/backend/cli-runtime-switch.d.ts +90 -0
- package/dist/backend/cli-runtime-switch.js +273 -0
- package/dist/backend/cli-runtime-switch.js.map +1 -0
- package/dist/backend/codex-footer-hints.d.ts +1 -0
- package/dist/backend/codex-footer-hints.js +15 -0
- package/dist/backend/codex-footer-hints.js.map +1 -1
- package/dist/backend/codex-model-switch.d.ts +41 -0
- package/dist/backend/codex-model-switch.js +170 -0
- package/dist/backend/codex-model-switch.js.map +1 -0
- package/dist/backend/codex-precaution.d.ts +7 -0
- package/dist/backend/codex-precaution.js +103 -0
- package/dist/backend/codex-precaution.js.map +1 -0
- package/dist/backend/codex.d.ts +7 -4
- package/dist/backend/codex.js +56 -10
- package/dist/backend/codex.js.map +1 -1
- package/dist/backend/grok-model-switch.d.ts +16 -0
- package/dist/backend/grok-model-switch.js +45 -0
- package/dist/backend/grok-model-switch.js.map +1 -0
- package/dist/backend/grok.js +33 -7
- package/dist/backend/grok.js.map +1 -1
- package/dist/backend/kiro-auth-store.d.ts +15 -2
- package/dist/backend/kiro-auth-store.js +64 -0
- package/dist/backend/kiro-auth-store.js.map +1 -1
- package/dist/backend/kiro.js +10 -5
- package/dist/backend/kiro.js.map +1 -1
- package/dist/backend/muse.d.ts +2 -0
- package/dist/backend/muse.js +7 -3
- package/dist/backend/muse.js.map +1 -1
- package/dist/backend/native-pane.js +1 -1
- package/dist/backend/native-pane.js.map +1 -1
- package/dist/backend/types.d.ts +59 -2
- package/dist/backend/types.js.map +1 -1
- package/dist/backend-availability.d.ts +23 -16
- package/dist/backend-availability.js +73 -93
- package/dist/backend-availability.js.map +1 -1
- package/dist/backend-command.d.ts +4 -2
- package/dist/backend-command.js +3 -0
- package/dist/backend-command.js.map +1 -1
- package/dist/backend-signin-guide.js +1 -1
- package/dist/backend-signin-guide.js.map +1 -1
- package/dist/backend-version-static.d.ts +15 -0
- package/dist/backend-version-static.js +95 -0
- package/dist/backend-version-static.js.map +1 -0
- package/dist/browser-backend-signins.d.ts +1 -0
- package/dist/browser-backend-signins.js +3 -1
- package/dist/browser-backend-signins.js.map +1 -1
- package/dist/build-provenance.json +1 -1
- package/dist/cache-ledger.d.ts +23 -21
- package/dist/cache-ledger.js +70 -6
- package/dist/cache-ledger.js.map +1 -1
- package/dist/cache-prices.d.ts +8 -6
- package/dist/cache-prices.js +12 -5
- package/dist/cache-prices.js.map +1 -1
- package/dist/cache-service.d.ts +9 -5
- package/dist/cache-service.js +202 -50
- package/dist/cache-service.js.map +1 -1
- package/dist/channel/adapters/discord.d.ts +23 -1
- package/dist/channel/adapters/discord.js +97 -26
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/adapters/telegram.d.ts +2 -0
- package/dist/channel/adapters/telegram.js +9 -4
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/ipc-bridge.d.ts +7 -0
- package/dist/channel/ipc-bridge.js +45 -11
- package/dist/channel/ipc-bridge.js.map +1 -1
- package/dist/channel/mcp-server.js +39 -5
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/mcp-tools.d.ts +27 -1
- package/dist/channel/mcp-tools.js +107 -14
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/channel/tool-router.d.ts +4 -0
- package/dist/channel/tool-router.js +51 -19
- package/dist/channel/tool-router.js.map +1 -1
- package/dist/channel/types.d.ts +10 -0
- package/dist/chat-task-refs.d.ts +61 -0
- package/dist/chat-task-refs.js +112 -0
- package/dist/chat-task-refs.js.map +1 -0
- package/dist/classic-channel-manager.d.ts +6 -2
- package/dist/classic-channel-manager.js +29 -4
- package/dist/classic-channel-manager.js.map +1 -1
- package/dist/classic-cli-guard.d.ts +66 -0
- package/dist/classic-cli-guard.js +209 -0
- package/dist/classic-cli-guard.js.map +1 -0
- package/dist/claude-credential-change.d.ts +22 -0
- package/dist/claude-credential-change.js +47 -0
- package/dist/claude-credential-change.js.map +1 -0
- package/dist/claude-credential-launch.d.ts +69 -0
- package/dist/claude-credential-launch.js +328 -0
- package/dist/claude-credential-launch.js.map +1 -0
- package/dist/claude-credential-runner.d.ts +1 -0
- package/dist/claude-credential-runner.js +58 -0
- package/dist/claude-credential-runner.js.map +1 -0
- package/dist/claude-credential-vault.d.ts +57 -0
- package/dist/claude-credential-vault.js +277 -0
- package/dist/claude-credential-vault.js.map +1 -0
- package/dist/claude-install-kind.d.ts +19 -0
- package/dist/claude-install-kind.js +54 -0
- package/dist/claude-install-kind.js.map +1 -0
- package/dist/claude-request-observation.d.ts +7 -0
- package/dist/claude-request-observation.js +26 -0
- package/dist/claude-request-observation.js.map +1 -0
- package/dist/claude-setup-token-transport.d.ts +9 -0
- package/dist/claude-setup-token-transport.js +104 -0
- package/dist/claude-setup-token-transport.js.map +1 -0
- package/dist/claude-setup-token.d.ts +51 -0
- package/dist/claude-setup-token.js +83 -0
- package/dist/claude-setup-token.js.map +1 -0
- package/dist/claude-turn-boundaries.d.ts +15 -0
- package/dist/claude-turn-boundaries.js +88 -0
- package/dist/claude-turn-boundaries.js.map +1 -0
- package/dist/cli-audited.js +30 -17
- package/dist/cli-audited.js.map +1 -1
- package/dist/cli-capability.d.ts +3 -0
- package/dist/cli-capability.js.map +1 -1
- package/dist/cli-registry-check.js +1 -1
- package/dist/cli-registry-check.js.map +1 -1
- package/dist/cli-registry.d.ts +1 -0
- package/dist/cli-spec-antigravity.d.ts +1 -0
- package/dist/cli-spec-antigravity.js +3 -1
- package/dist/cli-spec-antigravity.js.map +1 -1
- package/dist/cli.js +231 -24
- package/dist/cli.js.map +1 -1
- package/dist/command-report.d.ts +11 -0
- package/dist/command-report.js +2 -0
- package/dist/command-report.js.map +1 -0
- package/dist/composite-tools.d.ts +11 -0
- package/dist/composite-tools.js +29 -0
- package/dist/composite-tools.js.map +1 -0
- package/dist/config-validator.js +69 -3
- package/dist/config-validator.js.map +1 -1
- package/dist/config.js +17 -2
- package/dist/config.js.map +1 -1
- package/dist/connect/control.d.ts +20 -0
- package/dist/connect/control.js +236 -0
- package/dist/connect/control.js.map +1 -0
- package/dist/connect/install.d.ts +13 -0
- package/dist/connect/install.js +12 -0
- package/dist/connect/install.js.map +1 -0
- package/dist/connect/mcp.d.ts +9 -0
- package/dist/connect/mcp.js +10 -0
- package/dist/connect/mcp.js.map +1 -0
- package/dist/connect/protocol.d.ts +38 -0
- package/dist/connect/protocol.js +36 -0
- package/dist/connect/protocol.js.map +1 -0
- package/dist/connect/service.d.ts +19 -0
- package/dist/connect/service.js +79 -0
- package/dist/connect/service.js.map +1 -0
- package/dist/connect/stdio-entry.d.ts +1 -0
- package/dist/connect/stdio-entry.js +6 -0
- package/dist/connect/stdio-entry.js.map +1 -0
- package/dist/connect/stdio.d.ts +5 -0
- package/dist/connect/stdio.js +33 -0
- package/dist/connect/stdio.js.map +1 -0
- package/dist/contact-auth-api.d.ts +17 -0
- package/dist/contact-auth-api.js +90 -0
- package/dist/contact-auth-api.js.map +1 -0
- package/dist/contact-auth-files.d.ts +6 -0
- package/dist/contact-auth-files.js +29 -0
- package/dist/contact-auth-files.js.map +1 -0
- package/dist/contact-auth-policy.d.ts +81 -0
- package/dist/contact-auth-policy.js +26 -0
- package/dist/contact-auth-policy.js.map +1 -0
- package/dist/contact-auth-service.d.ts +32 -0
- package/dist/contact-auth-service.js +110 -0
- package/dist/contact-auth-service.js.map +1 -0
- package/dist/contact-auth-store.d.ts +149 -0
- package/dist/contact-auth-store.js +573 -0
- package/dist/contact-auth-store.js.map +1 -0
- package/dist/contact-auth-types.d.ts +202 -0
- package/dist/contact-auth-types.js +7 -0
- package/dist/contact-auth-types.js.map +1 -0
- package/dist/contact-change-proposals.d.ts +98 -0
- package/dist/contact-change-proposals.js +166 -0
- package/dist/contact-change-proposals.js.map +1 -0
- package/dist/contact-state-view.d.ts +103 -0
- package/dist/contact-state-view.js +80 -0
- package/dist/contact-state-view.js.map +1 -0
- package/dist/cross-instance-notice.d.ts +1 -0
- package/dist/cross-instance-notice.js +9 -8
- package/dist/cross-instance-notice.js.map +1 -1
- package/dist/daemon.d.ts +247 -3
- package/dist/daemon.js +1714 -181
- package/dist/daemon.js.map +1 -1
- package/dist/darwin-memory.js +2 -1
- package/dist/darwin-memory.js.map +1 -1
- package/dist/dashboard-permissions.d.ts +23 -8
- package/dist/dashboard-permissions.js +33 -10
- package/dist/dashboard-permissions.js.map +1 -1
- package/dist/delivery-consumed-watch.js +3 -0
- package/dist/delivery-consumed-watch.js.map +1 -1
- package/dist/delivery-outbox.d.ts +213 -10
- package/dist/delivery-outbox.js +664 -49
- package/dist/delivery-outbox.js.map +1 -1
- package/dist/delivery-outbox.test.js +132 -96
- package/dist/delivery-outbox.test.js.map +1 -1
- package/dist/detached-fleet-stop.d.ts +40 -0
- package/dist/detached-fleet-stop.js +126 -0
- package/dist/detached-fleet-stop.js.map +1 -0
- package/dist/dispatcher-liveness.d.ts +51 -1
- package/dist/dispatcher-liveness.js +94 -4
- package/dist/dispatcher-liveness.js.map +1 -1
- package/dist/event-log.d.ts +12 -0
- package/dist/event-log.js +40 -0
- package/dist/event-log.js.map +1 -1
- package/dist/fleet-context.d.ts +9 -0
- package/dist/fleet-level-config.d.ts +1 -1
- package/dist/fleet-level-config.js +1 -0
- package/dist/fleet-level-config.js.map +1 -1
- package/dist/fleet-lock.d.ts +88 -2
- package/dist/fleet-lock.js +296 -3
- package/dist/fleet-lock.js.map +1 -1
- package/dist/fleet-manager.d.ts +1397 -29
- package/dist/fleet-manager.js +8180 -623
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-windows-runtime.d.ts +59 -4
- package/dist/fleet-windows-runtime.js +307 -40
- package/dist/fleet-windows-runtime.js.map +1 -1
- package/dist/fleet-yaml-stringify.d.ts +3 -0
- package/dist/fleet-yaml-stringify.js +132 -0
- package/dist/fleet-yaml-stringify.js.map +1 -0
- package/dist/general-knowledge/skills/admin/SKILL.md +52 -0
- package/dist/general-knowledge/skills/concepts/SKILL.md +106 -23
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +19 -1
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +68 -1
- package/dist/general-knowledge/skills/fleet-config/SKILL.md +24 -4
- package/dist/general-knowledge/skills/fleet-health/SKILL.md +9 -1
- package/dist/general-knowledge/skills/hub/SKILL.md +393 -27
- package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +6 -2
- package/dist/general-knowledge/skills/model-discovery/SKILL.md +7 -2
- package/dist/general-knowledge/skills/persona-emoji/SKILL.md +3 -0
- package/dist/general-knowledge/skills/task-board/SKILL.md +98 -0
- package/dist/general-knowledge/skills/web-appearance/SKILL.md +35 -3
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +391 -70
- package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +7 -1
- package/dist/general-knowledge/steering/core-rules.md +15 -78
- package/dist/general-role-block.d.ts +19 -0
- package/dist/general-role-block.js +56 -0
- package/dist/general-role-block.js.map +1 -0
- package/dist/general-role.d.ts +1 -1
- package/dist/general-role.js +2 -0
- package/dist/general-role.js.map +1 -1
- package/dist/home-update-lock.d.ts +35 -0
- package/dist/home-update-lock.js +81 -0
- package/dist/home-update-lock.js.map +1 -0
- package/dist/host-memory.d.ts +24 -1
- package/dist/host-memory.js +30 -4
- package/dist/host-memory.js.map +1 -1
- package/dist/host-monitoring/darwin/collector.d.ts +18 -0
- package/dist/host-monitoring/darwin/collector.js +65 -0
- package/dist/host-monitoring/darwin/collector.js.map +1 -0
- package/dist/host-monitoring/darwin/defaults.d.ts +2 -0
- package/dist/host-monitoring/darwin/defaults.js +9 -0
- package/dist/host-monitoring/darwin/defaults.js.map +1 -0
- package/dist/host-monitoring/darwin/interpretation.d.ts +20 -0
- package/dist/host-monitoring/darwin/interpretation.js +73 -0
- package/dist/host-monitoring/darwin/interpretation.js.map +1 -0
- package/dist/host-monitoring/linux/collector.d.ts +17 -0
- package/dist/host-monitoring/linux/collector.js +55 -0
- package/dist/host-monitoring/linux/collector.js.map +1 -0
- package/dist/host-monitoring/linux/defaults.d.ts +2 -0
- package/dist/host-monitoring/linux/defaults.js +9 -0
- package/dist/host-monitoring/linux/defaults.js.map +1 -0
- package/dist/host-monitoring/linux/interpretation.d.ts +22 -0
- package/dist/host-monitoring/linux/interpretation.js +76 -0
- package/dist/host-monitoring/linux/interpretation.js.map +1 -0
- package/dist/host-monitoring/transport.d.ts +42 -0
- package/dist/host-monitoring/transport.js +101 -0
- package/dist/host-monitoring/transport.js.map +1 -0
- package/dist/host-monitoring/wsl/collector.d.ts +19 -0
- package/dist/host-monitoring/wsl/collector.js +72 -0
- package/dist/host-monitoring/wsl/collector.js.map +1 -0
- package/dist/host-monitoring/wsl/defaults.d.ts +2 -0
- package/dist/host-monitoring/wsl/defaults.js +9 -0
- package/dist/host-monitoring/wsl/defaults.js.map +1 -0
- package/dist/host-monitoring/wsl/interpretation.d.ts +22 -0
- package/dist/host-monitoring/wsl/interpretation.js +77 -0
- package/dist/host-monitoring/wsl/interpretation.js.map +1 -0
- package/dist/host-monitoring-alert-policy.d.ts +73 -0
- package/dist/host-monitoring-alert-policy.js +152 -0
- package/dist/host-monitoring-alert-policy.js.map +1 -0
- package/dist/host-monitoring-alert-resources.d.ts +11 -0
- package/dist/host-monitoring-alert-resources.js +16 -0
- package/dist/host-monitoring-alert-resources.js.map +1 -0
- package/dist/host-monitoring-alert-settings.d.ts +16 -0
- package/dist/host-monitoring-alert-settings.js +68 -0
- package/dist/host-monitoring-alert-settings.js.map +1 -0
- package/dist/host-monitoring-alert-store.d.ts +49 -0
- package/dist/host-monitoring-alert-store.js +228 -0
- package/dist/host-monitoring-alert-store.js.map +1 -0
- package/dist/host-monitoring-alert-text.d.ts +7 -0
- package/dist/host-monitoring-alert-text.js +10 -0
- package/dist/host-monitoring-alert-text.js.map +1 -0
- package/dist/host-monitoring-alerts.d.ts +79 -0
- package/dist/host-monitoring-alerts.js +276 -0
- package/dist/host-monitoring-alerts.js.map +1 -0
- package/dist/host-monitoring-config.d.ts +15 -0
- package/dist/host-monitoring-config.js +36 -0
- package/dist/host-monitoring-config.js.map +1 -0
- package/dist/host-monitoring-defaults.d.ts +19 -0
- package/dist/host-monitoring-defaults.js +10 -0
- package/dist/host-monitoring-defaults.js.map +1 -0
- package/dist/host-monitoring-footprint-policy.d.ts +45 -0
- package/dist/host-monitoring-footprint-policy.js +150 -0
- package/dist/host-monitoring-footprint-policy.js.map +1 -0
- package/dist/host-monitoring-footprint.d.ts +42 -0
- package/dist/host-monitoring-footprint.js +169 -0
- package/dist/host-monitoring-footprint.js.map +1 -0
- package/dist/host-monitoring-history-files.d.ts +2 -0
- package/dist/host-monitoring-history-files.js +16 -0
- package/dist/host-monitoring-history-files.js.map +1 -0
- package/dist/host-monitoring-history-policy.d.ts +57 -0
- package/dist/host-monitoring-history-policy.js +107 -0
- package/dist/host-monitoring-history-policy.js.map +1 -0
- package/dist/host-monitoring-history-store.d.ts +52 -0
- package/dist/host-monitoring-history-store.js +178 -0
- package/dist/host-monitoring-history-store.js.map +1 -0
- package/dist/host-monitoring-history-worker.d.ts +1 -0
- package/dist/host-monitoring-history-worker.js +66 -0
- package/dist/host-monitoring-history-worker.js.map +1 -0
- package/dist/host-monitoring-history.d.ts +80 -0
- package/dist/host-monitoring-history.js +301 -0
- package/dist/host-monitoring-history.js.map +1 -0
- package/dist/host-monitoring-platform.d.ts +21 -0
- package/dist/host-monitoring-platform.js +18 -0
- package/dist/host-monitoring-platform.js.map +1 -0
- package/dist/host-monitoring-process-identity.d.ts +8 -0
- package/dist/host-monitoring-process-identity.js +81 -0
- package/dist/host-monitoring-process-identity.js.map +1 -0
- package/dist/host-monitoring-runtime.d.ts +42 -0
- package/dist/host-monitoring-runtime.js +95 -0
- package/dist/host-monitoring-runtime.js.map +1 -0
- package/dist/host-monitoring-settings-store.d.ts +5 -0
- package/dist/host-monitoring-settings-store.js +49 -0
- package/dist/host-monitoring-settings-store.js.map +1 -0
- package/dist/host-monitoring.d.ts +123 -0
- package/dist/host-monitoring.js +157 -0
- package/dist/host-monitoring.js.map +1 -0
- package/dist/hub/admin-dashboard.d.ts +85 -0
- package/dist/hub/admin-dashboard.js +177 -0
- package/dist/hub/admin-dashboard.js.map +1 -0
- package/dist/hub/agent-catalog-model.d.ts +297 -0
- package/dist/hub/agent-catalog-model.js +57 -0
- package/dist/hub/agent-catalog-model.js.map +1 -0
- package/dist/hub/agent-catalog.d.ts +140 -0
- package/dist/hub/agent-catalog.js +130 -0
- package/dist/hub/agent-catalog.js.map +1 -0
- package/dist/hub/agent-intro-model.d.ts +38 -0
- package/dist/hub/agent-intro-model.js +14 -0
- package/dist/hub/agent-intro-model.js.map +1 -0
- package/dist/hub/agent-intro-tool.d.ts +35 -0
- package/dist/hub/agent-intro-tool.js +83 -0
- package/dist/hub/agent-intro-tool.js.map +1 -0
- package/dist/hub/agent-intro.d.ts +31 -0
- package/dist/hub/agent-intro.js +51 -0
- package/dist/hub/agent-intro.js.map +1 -0
- package/dist/hub/agent-pictures-model.d.ts +275 -0
- package/dist/hub/agent-pictures-model.js +103 -0
- package/dist/hub/agent-pictures-model.js.map +1 -0
- package/dist/hub/agent-pictures.d.ts +64 -0
- package/dist/hub/agent-pictures.js +256 -0
- package/dist/hub/agent-pictures.js.map +1 -0
- package/dist/hub/attachments/store.d.ts +2 -0
- package/dist/hub/attachments/store.js +6 -0
- package/dist/hub/attachments/store.js.map +1 -1
- package/dist/hub/audit/index.d.ts +5 -1
- package/dist/hub/audit/index.js +43 -3
- package/dist/hub/audit/index.js.map +1 -1
- package/dist/hub/buttons.js +3 -1
- package/dist/hub/buttons.js.map +1 -1
- package/dist/hub/catalog.d.ts +19 -6
- package/dist/hub/catalog.js +102 -27
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/client.d.ts +20 -0
- package/dist/hub/client.js +175 -12
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +65 -8
- package/dist/hub/compose/member.js +404 -35
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +30 -5
- package/dist/hub/compose/server.js +140 -20
- package/dist/hub/compose/server.js.map +1 -1
- package/dist/hub/direct-posts-model.d.ts +1 -0
- package/dist/hub/direct-posts-model.js +2 -0
- package/dist/hub/direct-posts-model.js.map +1 -0
- package/dist/hub/direct-posts.d.ts +36 -0
- package/dist/hub/direct-posts.js +145 -0
- package/dist/hub/direct-posts.js.map +1 -0
- package/dist/hub/directory/directory.js +27 -7
- package/dist/hub/directory/directory.js.map +1 -1
- package/dist/hub/directory/types.d.ts +10 -4
- package/dist/hub/directory/types.js.map +1 -1
- package/dist/hub/display-name.d.ts +10 -0
- package/dist/hub/display-name.js +35 -0
- package/dist/hub/display-name.js.map +1 -0
- package/dist/hub/execution/service.d.ts +2 -1
- package/dist/hub/execution/service.js +2 -1
- package/dist/hub/execution/service.js.map +1 -1
- package/dist/hub/fleet-info.d.ts +12 -0
- package/dist/hub/fleet-info.js +14 -0
- package/dist/hub/fleet-info.js.map +1 -0
- package/dist/hub/fleet-update-model.d.ts +100 -0
- package/dist/hub/fleet-update-model.js +15 -0
- package/dist/hub/fleet-update-model.js.map +1 -0
- package/dist/hub/fleet-updates.d.ts +46 -0
- package/dist/hub/fleet-updates.js +284 -0
- package/dist/hub/fleet-updates.js.map +1 -0
- package/dist/hub/fleet-versions.d.ts +28 -0
- package/dist/hub/fleet-versions.js +81 -0
- package/dist/hub/fleet-versions.js.map +1 -0
- package/dist/hub/group-policy/admin-api.d.ts +1 -0
- package/dist/hub/group-policy/admin-api.js +10 -1
- package/dist/hub/group-policy/admin-api.js.map +1 -1
- package/dist/hub/group-policy/admin-control.d.ts +1 -0
- package/dist/hub/group-policy/admin-control.js +13 -4
- package/dist/hub/group-policy/admin-control.js.map +1 -1
- package/dist/hub/group-policy/admin-dto.d.ts +39 -1
- package/dist/hub/group-policy/admin-dto.js.map +1 -1
- package/dist/hub/group-policy/admin-facts.d.ts +4 -2
- package/dist/hub/group-policy/admin-facts.js +17 -2
- package/dist/hub/group-policy/admin-facts.js.map +1 -1
- package/dist/hub/group-policy/admin-impact.d.ts +36 -6
- package/dist/hub/group-policy/admin-impact.js +21 -7
- package/dist/hub/group-policy/admin-impact.js.map +1 -1
- package/dist/hub/group-policy/admin-inventory.d.ts +2 -0
- package/dist/hub/group-policy/admin-inventory.js +13 -4
- package/dist/hub/group-policy/admin-inventory.js.map +1 -1
- package/dist/hub/group-policy/admin-search.d.ts +2 -1
- package/dist/hub/group-policy/admin-search.js +56 -7
- package/dist/hub/group-policy/admin-search.js.map +1 -1
- package/dist/hub/group-policy/authorization.d.ts +2 -0
- package/dist/hub/group-policy/authorization.js +7 -2
- package/dist/hub/group-policy/authorization.js.map +1 -1
- package/dist/hub/group-policy/impact-inventory.d.ts +4 -1
- package/dist/hub/group-policy/impact-inventory.js +23 -2
- package/dist/hub/group-policy/impact-inventory.js.map +1 -1
- package/dist/hub/group-policy/model.d.ts +52 -1
- package/dist/hub/group-policy/model.js +20 -7
- package/dist/hub/group-policy/model.js.map +1 -1
- package/dist/hub/group-policy/resources.d.ts +2 -0
- package/dist/hub/group-policy/resources.js +12 -1
- package/dist/hub/group-policy/resources.js.map +1 -1
- package/dist/hub/group-policy/store.js +22 -3
- package/dist/hub/group-policy/store.js.map +1 -1
- package/dist/hub/group-policy/team-subjects.d.ts +16 -0
- package/dist/hub/group-policy/team-subjects.js +32 -0
- package/dist/hub/group-policy/team-subjects.js.map +1 -0
- package/dist/hub/http/compose.d.ts +17 -0
- package/dist/hub/http/compose.js +903 -100
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/core.d.ts +11 -1
- package/dist/hub/http/core.js +70 -10
- package/dist/hub/http/core.js.map +1 -1
- package/dist/hub/http/deps.d.ts +21 -0
- package/dist/hub/http/schema.js +54 -1
- package/dist/hub/http/schema.js.map +1 -1
- package/dist/hub/init/text.js +1 -1
- package/dist/hub/invitations.js +15 -7
- package/dist/hub/invitations.js.map +1 -1
- package/dist/hub/join/client.js +75 -42
- package/dist/hub/join/client.js.map +1 -1
- package/dist/hub/join/service.d.ts +9 -1
- package/dist/hub/join/service.js +17 -3
- package/dist/hub/join/service.js.map +1 -1
- package/dist/hub/lapse-carry.d.ts +45 -0
- package/dist/hub/lapse-carry.js +62 -0
- package/dist/hub/lapse-carry.js.map +1 -0
- package/dist/hub/mcp/auth-schema.d.ts +7 -0
- package/dist/hub/mcp/auth-schema.js +31 -0
- package/dist/hub/mcp/auth-schema.js.map +1 -0
- package/dist/hub/mcp/auth.d.ts +89 -0
- package/dist/hub/mcp/auth.js +374 -0
- package/dist/hub/mcp/auth.js.map +1 -0
- package/dist/hub/mcp/catalog.d.ts +44 -0
- package/dist/hub/mcp/catalog.js +31 -0
- package/dist/hub/mcp/catalog.js.map +1 -0
- package/dist/hub/mcp/door-schema.d.ts +7 -0
- package/dist/hub/mcp/door-schema.js +20 -0
- package/dist/hub/mcp/door-schema.js.map +1 -0
- package/dist/hub/mcp/http.d.ts +25 -0
- package/dist/hub/mcp/http.js +259 -0
- package/dist/hub/mcp/http.js.map +1 -0
- package/dist/hub/mcp/policy.d.ts +65 -0
- package/dist/hub/mcp/policy.js +153 -0
- package/dist/hub/mcp/policy.js.map +1 -0
- package/dist/hub/mcp/server.d.ts +3 -0
- package/dist/hub/mcp/server.js +32 -0
- package/dist/hub/mcp/server.js.map +1 -0
- package/dist/hub/mcp/tools.d.ts +31 -0
- package/dist/hub/mcp/tools.js +177 -0
- package/dist/hub/mcp/tools.js.map +1 -0
- package/dist/hub/member/agent-catalog.d.ts +31 -0
- package/dist/hub/member/agent-catalog.js +91 -0
- package/dist/hub/member/agent-catalog.js.map +1 -0
- package/dist/hub/member/agent-intro.d.ts +29 -0
- package/dist/hub/member/agent-intro.js +73 -0
- package/dist/hub/member/agent-intro.js.map +1 -0
- package/dist/hub/member/agent-pictures.d.ts +76 -0
- package/dist/hub/member/agent-pictures.js +196 -0
- package/dist/hub/member/agent-pictures.js.map +1 -0
- package/dist/hub/member/direct-rooms.d.ts +9 -0
- package/dist/hub/member/direct-rooms.js +14 -0
- package/dist/hub/member/direct-rooms.js.map +1 -0
- package/dist/hub/member/display-name.d.ts +9 -0
- package/dist/hub/member/display-name.js +71 -0
- package/dist/hub/member/display-name.js.map +1 -0
- package/dist/hub/member/exposure-api.d.ts +11 -3
- package/dist/hub/member/exposure-api.js +24 -10
- package/dist/hub/member/exposure-api.js.map +1 -1
- package/dist/hub/member/exposures.d.ts +16 -4
- package/dist/hub/member/exposures.js +47 -13
- package/dist/hub/member/exposures.js.map +1 -1
- package/dist/hub/member/pairing-api.js +3 -2
- package/dist/hub/member/pairing-api.js.map +1 -1
- package/dist/hub/member/recommendations.d.ts +37 -0
- package/dist/hub/member/recommendations.js +129 -0
- package/dist/hub/member/recommendations.js.map +1 -0
- package/dist/hub/member/room-ask.d.ts +104 -6
- package/dist/hub/member/room-ask.js +505 -34
- package/dist/hub/member/room-ask.js.map +1 -1
- package/dist/hub/member/room-asker-store.d.ts +48 -0
- package/dist/hub/member/room-asker-store.js +181 -0
- package/dist/hub/member/room-asker-store.js.map +1 -0
- package/dist/hub/member/room-context-budget.d.ts +5 -0
- package/dist/hub/member/room-context-budget.js +34 -0
- package/dist/hub/member/room-context-budget.js.map +1 -0
- package/dist/hub/member/room-mention-feedback.d.ts +46 -0
- package/dist/hub/member/room-mention-feedback.js +121 -0
- package/dist/hub/member/room-mention-feedback.js.map +1 -0
- package/dist/hub/member/room-notification.d.ts +9 -0
- package/dist/hub/member/room-notification.js +2 -0
- package/dist/hub/member/room-notification.js.map +1 -0
- package/dist/hub/member/room-post-answers.d.ts +48 -0
- package/dist/hub/member/room-post-answers.js +152 -0
- package/dist/hub/member/room-post-answers.js.map +1 -0
- package/dist/hub/member/room-post-receipt.d.ts +21 -0
- package/dist/hub/member/room-post-receipt.js +49 -0
- package/dist/hub/member/room-post-receipt.js.map +1 -0
- package/dist/hub/member/room-post.d.ts +144 -0
- package/dist/hub/member/room-post.js +339 -0
- package/dist/hub/member/room-post.js.map +1 -0
- package/dist/hub/member/room-reaction-acks.d.ts +12 -0
- package/dist/hub/member/room-reaction-acks.js +44 -0
- package/dist/hub/member/room-reaction-acks.js.map +1 -0
- package/dist/hub/member/sharing-journal.d.ts +252 -0
- package/dist/hub/member/sharing-journal.js +212 -0
- package/dist/hub/member/sharing-journal.js.map +1 -0
- package/dist/hub/member/sharing-link.d.ts +25 -0
- package/dist/hub/member/sharing-link.js +68 -0
- package/dist/hub/member/sharing-link.js.map +1 -0
- package/dist/hub/member/sharing-result.d.ts +6 -0
- package/dist/hub/member/sharing-result.js +46 -0
- package/dist/hub/member/sharing-result.js.map +1 -0
- package/dist/hub/member/sharing.d.ts +39 -0
- package/dist/hub/member/sharing.js +188 -0
- package/dist/hub/member/sharing.js.map +1 -0
- package/dist/hub/member/updates.d.ts +98 -0
- package/dist/hub/member/updates.js +322 -0
- package/dist/hub/member/updates.js.map +1 -0
- package/dist/hub/pairing.d.ts +15 -1
- package/dist/hub/pairing.js +33 -2
- package/dist/hub/pairing.js.map +1 -1
- package/dist/hub/personal/owner-host.d.ts +146 -0
- package/dist/hub/personal/owner-host.js +289 -0
- package/dist/hub/personal/owner-host.js.map +1 -0
- package/dist/hub/personal/refusals.d.ts +11 -0
- package/dist/hub/personal/refusals.js +33 -0
- package/dist/hub/personal/refusals.js.map +1 -0
- package/dist/hub/personal/runtime-host.d.ts +26 -0
- package/dist/hub/personal/runtime-host.js +51 -0
- package/dist/hub/personal/runtime-host.js.map +1 -0
- package/dist/hub/personal/schema.d.ts +4 -0
- package/dist/hub/personal/schema.js +54 -0
- package/dist/hub/personal/schema.js.map +1 -0
- package/dist/hub/personal/turns.d.ts +39 -0
- package/dist/hub/personal/turns.js +221 -0
- package/dist/hub/personal/turns.js.map +1 -0
- package/dist/hub/personal/types.d.ts +42 -0
- package/dist/hub/personal/types.js +2 -0
- package/dist/hub/personal/types.js.map +1 -0
- package/dist/hub/policy.d.ts +12 -3
- package/dist/hub/policy.js +107 -23
- package/dist/hub/policy.js.map +1 -1
- package/dist/hub/protocol.d.ts +1481 -49
- package/dist/hub/protocol.js +130 -17
- package/dist/hub/protocol.js.map +1 -1
- package/dist/hub/published-version.d.ts +3 -0
- package/dist/hub/published-version.js +35 -0
- package/dist/hub/published-version.js.map +1 -0
- package/dist/hub/question-close-model.d.ts +17 -0
- package/dist/hub/question-close-model.js +7 -0
- package/dist/hub/question-close-model.js.map +1 -0
- package/dist/hub/quota.d.ts +2 -2
- package/dist/hub/quota.js +9 -5
- package/dist/hub/quota.js.map +1 -1
- package/dist/hub/read-statement.d.ts +6 -0
- package/dist/hub/read-statement.js +33 -0
- package/dist/hub/read-statement.js.map +1 -0
- package/dist/hub/recommendation-model.d.ts +36 -0
- package/dist/hub/recommendation-model.js +9 -0
- package/dist/hub/recommendation-model.js.map +1 -0
- package/dist/hub/recommendations.d.ts +58 -0
- package/dist/hub/recommendations.js +212 -0
- package/dist/hub/recommendations.js.map +1 -0
- package/dist/hub/representative.d.ts +57 -0
- package/dist/hub/representative.js +239 -19
- package/dist/hub/representative.js.map +1 -1
- package/dist/hub/roles/admin-control.d.ts +29 -0
- package/dist/hub/roles/admin-control.js +187 -0
- package/dist/hub/roles/admin-control.js.map +1 -0
- package/dist/hub/roles/admin-types.d.ts +72 -0
- package/dist/hub/roles/admin-types.js +2 -0
- package/dist/hub/roles/admin-types.js.map +1 -0
- package/dist/hub/roles/allowed-list-control.d.ts +34 -0
- package/dist/hub/roles/allowed-list-control.js +179 -0
- package/dist/hub/roles/allowed-list-control.js.map +1 -0
- package/dist/hub/roles/allowed-list.d.ts +8 -0
- package/dist/hub/roles/allowed-list.js +49 -0
- package/dist/hub/roles/allowed-list.js.map +1 -0
- package/dist/hub/roles/audit-details.d.ts +146 -0
- package/dist/hub/roles/audit-details.js +26 -0
- package/dist/hub/roles/audit-details.js.map +1 -0
- package/dist/hub/roles/authority.d.ts +20 -3
- package/dist/hub/roles/authority.js +165 -87
- package/dist/hub/roles/authority.js.map +1 -1
- package/dist/hub/roles/change.d.ts +3 -1
- package/dist/hub/roles/change.js +7 -2
- package/dist/hub/roles/change.js.map +1 -1
- package/dist/hub/roles/clock.d.ts +4 -1
- package/dist/hub/roles/clock.js +15 -12
- package/dist/hub/roles/clock.js.map +1 -1
- package/dist/hub/roles/convert.js +1 -1
- package/dist/hub/roles/convert.js.map +1 -1
- package/dist/hub/roles/cutover-clock-facts.d.ts +13 -0
- package/dist/hub/roles/cutover-clock-facts.js +25 -0
- package/dist/hub/roles/cutover-clock-facts.js.map +1 -0
- package/dist/hub/roles/cutover-inventory.d.ts +5 -0
- package/dist/hub/roles/cutover-inventory.js +27 -4
- package/dist/hub/roles/cutover-inventory.js.map +1 -1
- package/dist/hub/roles/cutover-marker.d.ts +18 -2
- package/dist/hub/roles/cutover-marker.js +6 -2
- package/dist/hub/roles/cutover-marker.js.map +1 -1
- package/dist/hub/roles/cutover.d.ts +2 -2
- package/dist/hub/roles/cutover.js +3 -4
- package/dist/hub/roles/cutover.js.map +1 -1
- package/dist/hub/roles/delegation.d.ts +4 -1
- package/dist/hub/roles/delegation.js +9 -4
- package/dist/hub/roles/delegation.js.map +1 -1
- package/dist/hub/roles/evaluate.d.ts +2 -1
- package/dist/hub/roles/evaluate.js +14 -0
- package/dist/hub/roles/evaluate.js.map +1 -1
- package/dist/hub/roles/expiry-effects.d.ts +8 -0
- package/dist/hub/roles/expiry-effects.js +50 -0
- package/dist/hub/roles/expiry-effects.js.map +1 -0
- package/dist/hub/roles/migrations.d.ts +7 -0
- package/dist/hub/roles/migrations.js +44 -0
- package/dist/hub/roles/migrations.js.map +1 -0
- package/dist/hub/roles/model.d.ts +30 -2
- package/dist/hub/roles/model.js +14 -7
- package/dist/hub/roles/model.js.map +1 -1
- package/dist/hub/roles/overview.d.ts +8 -0
- package/dist/hub/roles/overview.js +15 -0
- package/dist/hub/roles/overview.js.map +1 -0
- package/dist/hub/roles/read.d.ts +4 -0
- package/dist/hub/roles/read.js +37 -7
- package/dist/hub/roles/read.js.map +1 -1
- package/dist/hub/roles/resource-effects.d.ts +17 -0
- package/dist/hub/roles/resource-effects.js +62 -0
- package/dist/hub/roles/resource-effects.js.map +1 -0
- package/dist/hub/roles/review.d.ts +16 -0
- package/dist/hub/roles/review.js +42 -0
- package/dist/hub/roles/review.js.map +1 -0
- package/dist/hub/roles/writer.d.ts +14 -3
- package/dist/hub/roles/writer.js +64 -16
- package/dist/hub/roles/writer.js.map +1 -1
- package/dist/hub/room-agent-discovery-model.d.ts +29 -0
- package/dist/hub/room-agent-discovery-model.js +33 -0
- package/dist/hub/room-agent-discovery-model.js.map +1 -0
- package/dist/hub/room-agent-discovery.d.ts +14 -0
- package/dist/hub/room-agent-discovery.js +65 -0
- package/dist/hub/room-agent-discovery.js.map +1 -0
- package/dist/hub/room-agent-requests.d.ts +71 -0
- package/dist/hub/room-agent-requests.js +377 -0
- package/dist/hub/room-agent-requests.js.map +1 -0
- package/dist/hub/room-answer-status-model.d.ts +3 -0
- package/dist/hub/room-answer-status-model.js +4 -0
- package/dist/hub/room-answer-status-model.js.map +1 -0
- package/dist/hub/room-asker-identity-model.d.ts +53 -0
- package/dist/hub/room-asker-identity-model.js +14 -0
- package/dist/hub/room-asker-identity-model.js.map +1 -0
- package/dist/hub/room-asker-identity.d.ts +22 -0
- package/dist/hub/room-asker-identity.js +43 -0
- package/dist/hub/room-asker-identity.js.map +1 -0
- package/dist/hub/room-brief-model.d.ts +30 -0
- package/dist/hub/room-brief-model.js +38 -0
- package/dist/hub/room-brief-model.js.map +1 -0
- package/dist/hub/room-context-model.d.ts +45 -0
- package/dist/hub/room-context-model.js +12 -0
- package/dist/hub/room-context-model.js.map +1 -0
- package/dist/hub/room-history-model.d.ts +87 -0
- package/dist/hub/room-history-model.js +14 -0
- package/dist/hub/room-history-model.js.map +1 -0
- package/dist/hub/room-members-model.d.ts +63 -0
- package/dist/hub/room-members-model.js +7 -0
- package/dist/hub/room-members-model.js.map +1 -0
- package/dist/hub/room-mention-feedback-model.d.ts +12 -0
- package/dist/hub/room-mention-feedback-model.js +12 -0
- package/dist/hub/room-mention-feedback-model.js.map +1 -0
- package/dist/hub/room-react-ack-model.d.ts +2 -0
- package/dist/hub/room-react-ack-model.js +3 -0
- package/dist/hub/room-react-ack-model.js.map +1 -0
- package/dist/hub/rooms/admin.d.ts +6 -0
- package/dist/hub/rooms/admin.js +33 -0
- package/dist/hub/rooms/admin.js.map +1 -1
- package/dist/hub/rooms/agents.d.ts +52 -11
- package/dist/hub/rooms/agents.js +418 -37
- package/dist/hub/rooms/agents.js.map +1 -1
- package/dist/hub/rooms/asker-identity.d.ts +21 -0
- package/dist/hub/rooms/asker-identity.js +86 -0
- package/dist/hub/rooms/asker-identity.js.map +1 -0
- package/dist/hub/rooms/assistant.d.ts +1 -6
- package/dist/hub/rooms/assistant.js +7 -2
- package/dist/hub/rooms/assistant.js.map +1 -1
- package/dist/hub/rooms/automation.d.ts +24 -0
- package/dist/hub/rooms/automation.js +66 -0
- package/dist/hub/rooms/automation.js.map +1 -0
- package/dist/hub/rooms/brief.d.ts +18 -0
- package/dist/hub/rooms/brief.js +39 -0
- package/dist/hub/rooms/brief.js.map +1 -0
- package/dist/hub/rooms/buttons.d.ts +85 -0
- package/dist/hub/rooms/buttons.js +62 -0
- package/dist/hub/rooms/buttons.js.map +1 -0
- package/dist/hub/rooms/context-cursor.d.ts +18 -0
- package/dist/hub/rooms/context-cursor.js +61 -0
- package/dist/hub/rooms/context-cursor.js.map +1 -0
- package/dist/hub/rooms/context.d.ts +1 -1
- package/dist/hub/rooms/context.js +4 -4
- package/dist/hub/rooms/context.js.map +1 -1
- package/dist/hub/rooms/direct-view.d.ts +12 -3
- package/dist/hub/rooms/direct-view.js +26 -10
- package/dist/hub/rooms/direct-view.js.map +1 -1
- package/dist/hub/rooms/directory.d.ts +13 -0
- package/dist/hub/rooms/directory.js +12 -3
- package/dist/hub/rooms/directory.js.map +1 -1
- package/dist/hub/rooms/history.d.ts +8 -0
- package/dist/hub/rooms/history.js +31 -0
- package/dist/hub/rooms/history.js.map +1 -0
- package/dist/hub/rooms/members-page.d.ts +33 -0
- package/dist/hub/rooms/members-page.js +37 -0
- package/dist/hub/rooms/members-page.js.map +1 -0
- package/dist/hub/rooms/mentions.d.ts +15 -0
- package/dist/hub/rooms/mentions.js +43 -0
- package/dist/hub/rooms/mentions.js.map +1 -0
- package/dist/hub/rooms/office.d.ts +141 -0
- package/dist/hub/rooms/office.js +81 -0
- package/dist/hub/rooms/office.js.map +1 -0
- package/dist/hub/rooms/post-replies.d.ts +23 -0
- package/dist/hub/rooms/post-replies.js +114 -0
- package/dist/hub/rooms/post-replies.js.map +1 -0
- package/dist/hub/rooms/purpose.d.ts +7 -0
- package/dist/hub/rooms/purpose.js +14 -0
- package/dist/hub/rooms/purpose.js.map +1 -0
- package/dist/hub/rooms/schema.d.ts +16 -0
- package/dist/hub/rooms/schema.js +56 -0
- package/dist/hub/rooms/schema.js.map +1 -1
- package/dist/hub/rooms/service.d.ts +400 -8
- package/dist/hub/rooms/service.js +1231 -72
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +48 -4
- package/dist/hub/rooms.d.ts +33 -6
- package/dist/hub/rooms.js +236 -51
- package/dist/hub/rooms.js.map +1 -1
- package/dist/hub/runtime.d.ts +1 -1
- package/dist/hub/runtime.js +17 -4
- package/dist/hub/runtime.js.map +1 -1
- package/dist/hub/send-timing.d.ts +6 -0
- package/dist/hub/send-timing.js +39 -0
- package/dist/hub/send-timing.js.map +1 -0
- package/dist/hub/server.d.ts +8 -1
- package/dist/hub/server.js +187 -7
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/session-directory-transition.d.ts +3 -1
- package/dist/hub/session-directory-transition.js +25 -12
- package/dist/hub/session-directory-transition.js.map +1 -1
- package/dist/hub/session-epoch.js +2 -1
- package/dist/hub/session-epoch.js.map +1 -1
- package/dist/hub/session-limits.d.ts +58 -0
- package/dist/hub/session-limits.js +121 -0
- package/dist/hub/session-limits.js.map +1 -0
- package/dist/hub/sessions.d.ts +5 -2
- package/dist/hub/sessions.js +84 -12
- package/dist/hub/sessions.js.map +1 -1
- package/dist/hub/settings-commit.d.ts +32 -1
- package/dist/hub/settings-commit.js +11 -4
- package/dist/hub/settings-commit.js.map +1 -1
- package/dist/hub/settings-directory-ca.js +1 -1
- package/dist/hub/settings-directory-ca.js.map +1 -1
- package/dist/hub/settings-directory-control.js +7 -7
- package/dist/hub/settings-directory-control.js.map +1 -1
- package/dist/hub/settings-directory-decision.js +15 -8
- package/dist/hub/settings-directory-decision.js.map +1 -1
- package/dist/hub/settings-directory-http.d.ts +2 -0
- package/dist/hub/settings-directory-http.js +21 -6
- package/dist/hub/settings-directory-http.js.map +1 -1
- package/dist/hub/settings-directory-proof.d.ts +5 -1
- package/dist/hub/settings-directory-proof.js +49 -10
- package/dist/hub/settings-directory-proof.js.map +1 -1
- package/dist/hub/settings-directory-recovery.js +2 -1
- package/dist/hub/settings-directory-recovery.js.map +1 -1
- package/dist/hub/settings-directory-save.d.ts +2 -0
- package/dist/hub/settings-directory-save.js +9 -6
- package/dist/hub/settings-directory-save.js.map +1 -1
- package/dist/hub/settings-member-address-decision.js +3 -2
- package/dist/hub/settings-member-address-decision.js.map +1 -1
- package/dist/hub/settings-web-address-decision.js +2 -1
- package/dist/hub/settings-web-address-decision.js.map +1 -1
- package/dist/hub/sharing-previous-access.d.ts +22 -0
- package/dist/hub/sharing-previous-access.js +93 -0
- package/dist/hub/sharing-previous-access.js.map +1 -0
- package/dist/hub/sharing-requests.d.ts +174 -0
- package/dist/hub/sharing-requests.js +326 -0
- package/dist/hub/sharing-requests.js.map +1 -0
- package/dist/hub/sharing-retention.d.ts +47 -0
- package/dist/hub/sharing-retention.js +83 -0
- package/dist/hub/sharing-retention.js.map +1 -0
- package/dist/hub/sharing-withdrawal.d.ts +14 -0
- package/dist/hub/sharing-withdrawal.js +28 -0
- package/dist/hub/sharing-withdrawal.js.map +1 -0
- package/dist/hub/sharing.js +2 -2
- package/dist/hub/sharing.js.map +1 -1
- package/dist/hub/socket.d.ts +1 -0
- package/dist/hub/socket.js +39 -2
- package/dist/hub/socket.js.map +1 -1
- package/dist/hub/store.d.ts +5 -0
- package/dist/hub/store.js +28 -5
- package/dist/hub/store.js.map +1 -1
- package/dist/hub/teams/index.d.ts +8 -3
- package/dist/hub/teams/index.js +106 -31
- package/dist/hub/teams/index.js.map +1 -1
- package/dist/hub/teams/store.d.ts +5 -1
- package/dist/hub/teams/store.js +25 -2
- package/dist/hub/teams/store.js.map +1 -1
- package/dist/hub/teams/types.d.ts +19 -2
- package/dist/hub/types.d.ts +176 -5
- package/dist/hub-agent-incarnation-record.d.ts +24 -0
- package/dist/hub-agent-incarnation-record.js +46 -0
- package/dist/hub-agent-incarnation-record.js.map +1 -0
- package/dist/hub-character-plan.d.ts +47 -0
- package/dist/hub-character-plan.js +70 -0
- package/dist/hub-character-plan.js.map +1 -0
- package/dist/hub-classic-private.d.ts +19 -0
- package/dist/hub-classic-private.js +64 -0
- package/dist/hub-classic-private.js.map +1 -0
- package/dist/hub-contact-windows.d.ts +23 -0
- package/dist/hub-contact-windows.js +89 -0
- package/dist/hub-contact-windows.js.map +1 -0
- package/dist/hub-page-sharing-settings.d.ts +6 -0
- package/dist/hub-page-sharing-settings.js +19 -0
- package/dist/hub-page-sharing-settings.js.map +1 -0
- package/dist/hub-pairing-summary.d.ts +1 -1
- package/dist/hub-picture-reduce.d.ts +34 -0
- package/dist/hub-picture-reduce.js +101 -0
- package/dist/hub-picture-reduce.js.map +1 -0
- package/dist/hub-picture-worker.d.ts +1 -0
- package/dist/hub-picture-worker.js +19 -0
- package/dist/hub-picture-worker.js.map +1 -0
- package/dist/hub-report-target.d.ts +6 -0
- package/dist/hub-report-target.js +6 -0
- package/dist/hub-report-target.js.map +1 -1
- package/dist/hub-room-conversation.d.ts +14 -0
- package/dist/hub-room-conversation.js +60 -0
- package/dist/hub-room-conversation.js.map +1 -0
- package/dist/hub-room-reply-warning.d.ts +2 -0
- package/dist/hub-room-reply-warning.js +16 -0
- package/dist/hub-room-reply-warning.js.map +1 -0
- package/dist/hub-sharing-notice.d.ts +43 -0
- package/dist/hub-sharing-notice.js +34 -0
- package/dist/hub-sharing-notice.js.map +1 -0
- package/dist/hub-update-notice.d.ts +12 -0
- package/dist/hub-update-notice.js +35 -0
- package/dist/hub-update-notice.js.map +1 -0
- package/dist/human-delivery-receipts.d.ts +27 -5
- package/dist/human-delivery-receipts.js +52 -8
- package/dist/human-delivery-receipts.js.map +1 -1
- package/dist/install-lock.d.ts +15 -1
- package/dist/install-lock.js +16 -8
- package/dist/install-lock.js.map +1 -1
- package/dist/install-ownership.d.ts +165 -0
- package/dist/install-ownership.js +404 -0
- package/dist/install-ownership.js.map +1 -0
- package/dist/instance-config-impact.js +7 -2
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +32 -4
- package/dist/instance-lifecycle.js +111 -25
- package/dist/instance-lifecycle.js.map +1 -1
- package/dist/instruction-file-sizes.d.ts +46 -0
- package/dist/instruction-file-sizes.js +115 -0
- package/dist/instruction-file-sizes.js.map +1 -0
- package/dist/instructions.d.ts +40 -2
- package/dist/instructions.js +68 -34
- package/dist/instructions.js.map +1 -1
- package/dist/local-pane-endpoint.d.ts +18 -1
- package/dist/local-pane-endpoint.js +44 -2
- package/dist/local-pane-endpoint.js.map +1 -1
- package/dist/locale.d.ts +2 -0
- package/dist/locale.js +956 -295
- package/dist/locale.js.map +1 -1
- package/dist/log-steps.d.ts +5 -0
- package/dist/log-steps.js +6 -2
- package/dist/log-steps.js.map +1 -1
- package/dist/login-controller.d.ts +45 -2
- package/dist/login-controller.js +98 -10
- package/dist/login-controller.js.map +1 -1
- package/dist/login-flows.js +1 -1
- package/dist/login-flows.js.map +1 -1
- package/dist/ls-rows.d.ts +2 -0
- package/dist/ls-rows.js.map +1 -1
- package/dist/memory-guidance.d.ts +5 -0
- package/dist/memory-guidance.js +14 -0
- package/dist/memory-guidance.js.map +1 -0
- package/dist/memory-pressure.js +8 -1
- package/dist/memory-pressure.js.map +1 -1
- package/dist/model-defaults.d.ts +5 -0
- package/dist/model-defaults.js +6 -0
- package/dist/model-defaults.js.map +1 -0
- package/dist/native-agent-admission.d.ts +7 -0
- package/dist/native-agent-admission.js +55 -3
- package/dist/native-agent-admission.js.map +1 -1
- package/dist/native-exec-context.d.ts +11 -0
- package/dist/native-exec-context.js +18 -0
- package/dist/native-exec-context.js.map +1 -0
- package/dist/native-exec-input.d.ts +56 -0
- package/dist/native-exec-input.js +89 -0
- package/dist/native-exec-input.js.map +1 -0
- package/dist/native-mcp.d.ts +26 -1
- package/dist/native-mcp.js +85 -18
- package/dist/native-mcp.js.map +1 -1
- package/dist/native-model-catalog.d.ts +15 -0
- package/dist/native-model-catalog.js +43 -3
- package/dist/native-model-catalog.js.map +1 -1
- package/dist/native-pane-lifecycle.d.ts +12 -0
- package/dist/native-pane-lifecycle.js +28 -2
- package/dist/native-pane-lifecycle.js.map +1 -1
- package/dist/native-pane-manager.d.ts +37 -6
- package/dist/native-pane-manager.js +160 -8
- package/dist/native-pane-manager.js.map +1 -1
- package/dist/native-pane-tools.js +3 -0
- package/dist/native-pane-tools.js.map +1 -1
- package/dist/needs-you-hub.d.ts +7 -0
- package/dist/needs-you-hub.js +48 -7
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +66 -2
- package/dist/needs-you.js +26 -1
- package/dist/needs-you.js.map +1 -1
- package/dist/office-share-page.js +5 -5
- package/dist/office-share-page.js.map +1 -1
- package/dist/office-share.js +2 -1
- package/dist/office-share.js.map +1 -1
- package/dist/outbound-handlers.d.ts +49 -4
- package/dist/outbound-handlers.js +263 -20
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +44 -0
- package/dist/outbound-schemas.js +56 -30
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/package-preimage.js +4 -0
- package/dist/package-preimage.js.map +1 -1
- package/dist/pane-port.d.ts +3 -0
- package/dist/pause-marker.d.ts +1 -1
- package/dist/pause-marker.js +1 -1
- package/dist/pause-marker.js.map +1 -1
- package/dist/plist-args.d.ts +9 -0
- package/dist/plist-args.js +22 -0
- package/dist/plist-args.js.map +1 -0
- package/dist/profile-signins.d.ts +1 -0
- package/dist/profile-signins.js +3 -1
- package/dist/profile-signins.js.map +1 -1
- package/dist/public-preview.d.ts +4 -6
- package/dist/public-preview.js +5 -2
- package/dist/public-preview.js.map +1 -1
- package/dist/public-web-gateway.d.ts +20 -0
- package/dist/public-web-gateway.js +262 -9
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/public-web-link.d.ts +34 -3
- package/dist/public-web-link.js +50 -3
- package/dist/public-web-link.js.map +1 -1
- package/dist/queued-handoffs.d.ts +16 -4
- package/dist/queued-handoffs.js +18 -1
- package/dist/queued-handoffs.js.map +1 -1
- package/dist/quickstart-api.d.ts +0 -1
- package/dist/quickstart-api.js +8 -1
- package/dist/quickstart-api.js.map +1 -1
- package/dist/quickstart.d.ts +1 -1
- package/dist/quickstart.js +2 -3
- package/dist/quickstart.js.map +1 -1
- package/dist/recover.cjs +2639 -0
- package/dist/remote-card-answer.d.ts +1 -1
- package/dist/remote-card-answer.js +8 -1
- package/dist/remote-card-answer.js.map +1 -1
- package/dist/remote-card-prompt.d.ts +7 -2
- package/dist/remote-card-prompt.js +13 -4
- package/dist/remote-card-prompt.js.map +1 -1
- package/dist/reply-buttons-controller.d.ts +3 -1
- package/dist/reply-buttons-controller.js +1 -1
- package/dist/reply-buttons-controller.js.map +1 -1
- package/dist/reply-dedup.js +3 -1
- package/dist/reply-dedup.js.map +1 -1
- package/dist/reply-draft.d.ts +12 -0
- package/dist/reply-draft.js +81 -0
- package/dist/reply-draft.js.map +1 -0
- package/dist/reply-preview-files.d.ts +38 -0
- package/dist/reply-preview-files.js +142 -0
- package/dist/reply-preview-files.js.map +1 -0
- package/dist/reply-preview-spec.d.ts +18 -0
- package/dist/reply-preview-spec.js +27 -0
- package/dist/reply-preview-spec.js.map +1 -0
- package/dist/request-contact-api.d.ts +15 -0
- package/dist/request-contact-api.js +120 -0
- package/dist/request-contact-api.js.map +1 -0
- package/dist/request-contact-card.d.ts +36 -0
- package/dist/request-contact-card.js +206 -0
- package/dist/request-contact-card.js.map +1 -0
- package/dist/request-contact-gate.d.ts +81 -0
- package/dist/request-contact-gate.js +267 -0
- package/dist/request-contact-gate.js.map +1 -0
- package/dist/request-contact-native.d.ts +52 -0
- package/dist/request-contact-native.js +87 -0
- package/dist/request-contact-native.js.map +1 -0
- package/dist/request-contact-types.d.ts +86 -0
- package/dist/request-contact-types.js +7 -0
- package/dist/request-contact-types.js.map +1 -0
- package/dist/request-context-activation.d.ts +29 -0
- package/dist/request-context-activation.js +85 -0
- package/dist/request-context-activation.js.map +1 -0
- package/dist/request-context-admission.d.ts +22 -0
- package/dist/request-context-admission.js +12 -0
- package/dist/request-context-admission.js.map +1 -0
- package/dist/request-context-boot.d.ts +35 -0
- package/dist/request-context-boot.js +97 -0
- package/dist/request-context-boot.js.map +1 -0
- package/dist/request-context-call-protocol.d.ts +12 -0
- package/dist/request-context-call-protocol.js +14 -0
- package/dist/request-context-call-protocol.js.map +1 -0
- package/dist/request-context-call.d.ts +25 -0
- package/dist/request-context-call.js +35 -0
- package/dist/request-context-call.js.map +1 -0
- package/dist/request-context-compatibility.d.ts +20 -0
- package/dist/request-context-compatibility.js +82 -0
- package/dist/request-context-compatibility.js.map +1 -0
- package/dist/request-context-continuation.d.ts +6 -0
- package/dist/request-context-continuation.js +24 -0
- package/dist/request-context-continuation.js.map +1 -0
- package/dist/request-context-control-api.d.ts +119 -0
- package/dist/request-context-control-api.js +179 -0
- package/dist/request-context-control-api.js.map +1 -0
- package/dist/request-context-control-copy.d.ts +3 -0
- package/dist/request-context-control-copy.js +7 -0
- package/dist/request-context-control-copy.js.map +1 -0
- package/dist/request-context-controller.d.ts +44 -0
- package/dist/request-context-controller.js +129 -0
- package/dist/request-context-controller.js.map +1 -0
- package/dist/request-context-delivery-resolver.d.ts +13 -0
- package/dist/request-context-delivery-resolver.js +30 -0
- package/dist/request-context-delivery-resolver.js.map +1 -0
- package/dist/request-context-drain-projection.d.ts +8 -0
- package/dist/request-context-drain-projection.js +40 -0
- package/dist/request-context-drain-projection.js.map +1 -0
- package/dist/request-context-drain.d.ts +61 -0
- package/dist/request-context-drain.js +291 -0
- package/dist/request-context-drain.js.map +1 -0
- package/dist/request-context-enable-offer.d.ts +13 -0
- package/dist/request-context-enable-offer.js +31 -0
- package/dist/request-context-enable-offer.js.map +1 -0
- package/dist/request-context-exec-owner.d.ts +39 -0
- package/dist/request-context-exec-owner.js +128 -0
- package/dist/request-context-exec-owner.js.map +1 -0
- package/dist/request-context-fence.d.ts +28 -0
- package/dist/request-context-fence.js +58 -0
- package/dist/request-context-fence.js.map +1 -0
- package/dist/request-context-go-back-view.d.ts +1 -0
- package/dist/request-context-go-back-view.js +17 -0
- package/dist/request-context-go-back-view.js.map +1 -0
- package/dist/request-context-helper-readiness.d.ts +14 -0
- package/dist/request-context-helper-readiness.js +23 -0
- package/dist/request-context-helper-readiness.js.map +1 -0
- package/dist/request-context-helper.d.ts +20 -0
- package/dist/request-context-helper.js +41 -0
- package/dist/request-context-helper.js.map +1 -0
- package/dist/request-context-hub-resolver.d.ts +29 -0
- package/dist/request-context-hub-resolver.js +90 -0
- package/dist/request-context-hub-resolver.js.map +1 -0
- package/dist/request-context-human-resolver.d.ts +20 -0
- package/dist/request-context-human-resolver.js +77 -0
- package/dist/request-context-human-resolver.js.map +1 -0
- package/dist/request-context-human.d.ts +112 -0
- package/dist/request-context-human.js +176 -0
- package/dist/request-context-human.js.map +1 -0
- package/dist/request-context-inputs.d.ts +21 -0
- package/dist/request-context-inputs.js +63 -0
- package/dist/request-context-inputs.js.map +1 -0
- package/dist/request-context-installation.d.ts +117 -0
- package/dist/request-context-installation.js +328 -0
- package/dist/request-context-installation.js.map +1 -0
- package/dist/request-context-knowledge.d.ts +5 -0
- package/dist/request-context-knowledge.js +32 -0
- package/dist/request-context-knowledge.js.map +1 -0
- package/dist/request-context-migration.d.ts +75 -0
- package/dist/request-context-migration.js +171 -0
- package/dist/request-context-migration.js.map +1 -0
- package/dist/request-context-native-human.d.ts +20 -0
- package/dist/request-context-native-human.js +91 -0
- package/dist/request-context-native-human.js.map +1 -0
- package/dist/request-context-native-output.d.ts +15 -0
- package/dist/request-context-native-output.js +46 -0
- package/dist/request-context-native-output.js.map +1 -0
- package/dist/request-context-native-result.d.ts +15 -0
- package/dist/request-context-native-result.js +46 -0
- package/dist/request-context-native-result.js.map +1 -0
- package/dist/request-context-off.d.ts +22 -0
- package/dist/request-context-off.js +77 -0
- package/dist/request-context-off.js.map +1 -0
- package/dist/request-context-outside-label.d.ts +5 -0
- package/dist/request-context-outside-label.js +28 -0
- package/dist/request-context-outside-label.js.map +1 -0
- package/dist/request-context-pane.d.ts +33 -0
- package/dist/request-context-pane.js +67 -0
- package/dist/request-context-pane.js.map +1 -0
- package/dist/request-context-pending-work.d.ts +11 -0
- package/dist/request-context-pending-work.js +43 -0
- package/dist/request-context-pending-work.js.map +1 -0
- package/dist/request-context-policy.d.ts +90 -0
- package/dist/request-context-policy.js +194 -0
- package/dist/request-context-policy.js.map +1 -0
- package/dist/request-context-protocol.d.ts +137 -0
- package/dist/request-context-protocol.js +38 -0
- package/dist/request-context-protocol.js.map +1 -0
- package/dist/request-context-readiness.d.ts +49 -0
- package/dist/request-context-readiness.js +64 -0
- package/dist/request-context-readiness.js.map +1 -0
- package/dist/request-context-recovery.d.ts +18 -0
- package/dist/request-context-recovery.js +81 -0
- package/dist/request-context-recovery.js.map +1 -0
- package/dist/request-context-relay.d.ts +19 -0
- package/dist/request-context-relay.js +63 -0
- package/dist/request-context-relay.js.map +1 -0
- package/dist/request-context-reply-pending.d.ts +16 -0
- package/dist/request-context-reply-pending.js +77 -0
- package/dist/request-context-reply-pending.js.map +1 -0
- package/dist/request-context-resolution.d.ts +35 -0
- package/dist/request-context-resolution.js +86 -0
- package/dist/request-context-resolution.js.map +1 -0
- package/dist/request-context-retirement.d.ts +21 -0
- package/dist/request-context-retirement.js +16 -0
- package/dist/request-context-retirement.js.map +1 -0
- package/dist/request-context-returns.d.ts +67 -0
- package/dist/request-context-returns.js +211 -0
- package/dist/request-context-returns.js.map +1 -0
- package/dist/request-context-start.d.ts +15 -0
- package/dist/request-context-start.js +2 -0
- package/dist/request-context-start.js.map +1 -0
- package/dist/request-context-store.d.ts +26 -0
- package/dist/request-context-store.js +144 -0
- package/dist/request-context-store.js.map +1 -0
- package/dist/request-context-turns.d.ts +99 -0
- package/dist/request-context-turns.js +216 -0
- package/dist/request-context-turns.js.map +1 -0
- package/dist/request-context-unproved-label.d.ts +4 -0
- package/dist/request-context-unproved-label.js +25 -0
- package/dist/request-context-unproved-label.js.map +1 -0
- package/dist/request-context-update-guard.d.ts +15 -0
- package/dist/request-context-update-guard.js +54 -0
- package/dist/request-context-update-guard.js.map +1 -0
- package/dist/request-context-view.d.ts +33 -0
- package/dist/request-context-view.js +36 -0
- package/dist/request-context-view.js.map +1 -0
- package/dist/request-context-work.d.ts +50 -0
- package/dist/request-context-work.js +178 -0
- package/dist/request-context-work.js.map +1 -0
- package/dist/request-hub-context.d.ts +131 -0
- package/dist/request-hub-context.js +89 -0
- package/dist/request-hub-context.js.map +1 -0
- package/dist/request-hub-output.d.ts +13 -0
- package/dist/request-hub-output.js +33 -0
- package/dist/request-hub-output.js.map +1 -0
- package/dist/restart-progress.d.ts +6 -0
- package/dist/restart-progress.js +5 -0
- package/dist/restart-progress.js.map +1 -1
- package/dist/retained-human-control.d.ts +11 -0
- package/dist/retained-human-control.js +11 -0
- package/dist/retained-human-control.js.map +1 -0
- package/dist/runtime-api.js +10 -2
- package/dist/runtime-api.js.map +1 -1
- package/dist/runtime-build-info.js +2 -1
- package/dist/runtime-build-info.js.map +1 -1
- package/dist/runtime-cli-install.js +20 -14
- package/dist/runtime-cli-install.js.map +1 -1
- package/dist/runtime-cli.js +31 -5
- package/dist/runtime-cli.js.map +1 -1
- package/dist/runtime-client-store.d.ts +5 -0
- package/dist/runtime-client-store.js +35 -1
- package/dist/runtime-client-store.js.map +1 -1
- package/dist/runtime-client.d.ts +6 -0
- package/dist/runtime-client.js +63 -15
- package/dist/runtime-client.js.map +1 -1
- package/dist/runtime-coordinator.d.ts +31 -3
- package/dist/runtime-coordinator.js +145 -12
- package/dist/runtime-coordinator.js.map +1 -1
- package/dist/runtime-install.d.ts +6 -1
- package/dist/runtime-install.js +12 -4
- package/dist/runtime-install.js.map +1 -1
- package/dist/runtime-pane-assets.d.ts +1 -1
- package/dist/runtime-pane-assets.js +1 -1
- package/dist/runtime-pane-assets.js.map +1 -1
- package/dist/runtime-pane-host.d.ts +3 -0
- package/dist/runtime-pane-host.js +39 -21
- package/dist/runtime-pane-host.js.map +1 -1
- package/dist/runtime-pane-link.d.ts +6 -2
- package/dist/runtime-pane-link.js +17 -4
- package/dist/runtime-pane-link.js.map +1 -1
- package/dist/runtime-pane-mcp-relay.d.ts +11 -1
- package/dist/runtime-pane-mcp-relay.js +69 -3
- package/dist/runtime-pane-mcp-relay.js.map +1 -1
- package/dist/runtime-pane-mcp.d.ts +37 -1
- package/dist/runtime-pane-mcp.js +120 -19
- package/dist/runtime-pane-mcp.js.map +1 -1
- package/dist/runtime-pane-native.js +5 -2
- package/dist/runtime-pane-native.js.map +1 -1
- package/dist/runtime-pane-port.d.ts +6 -0
- package/dist/runtime-pane-port.js +23 -4
- package/dist/runtime-pane-port.js.map +1 -1
- package/dist/runtime-pane-protocol.d.ts +4 -0
- package/dist/runtime-pane-protocol.js +11 -4
- package/dist/runtime-pane-protocol.js.map +1 -1
- package/dist/runtime-pane-service.d.ts +1 -0
- package/dist/runtime-pane-service.js +25 -9
- package/dist/runtime-pane-service.js.map +1 -1
- package/dist/runtime-pane-stdio-protocol.d.ts +4 -0
- package/dist/runtime-pane-stdio-protocol.js +12 -5
- package/dist/runtime-pane-stdio-protocol.js.map +1 -1
- package/dist/runtime-pane-stdio.js +5 -5
- package/dist/runtime-pane-stdio.js.map +1 -1
- package/dist/runtime-personal-answer-only-probe.d.ts +3 -0
- package/dist/runtime-personal-answer-only-probe.js +134 -0
- package/dist/runtime-personal-answer-only-probe.js.map +1 -0
- package/dist/runtime-personal-answer-only.d.ts +16 -0
- package/dist/runtime-personal-answer-only.js +54 -0
- package/dist/runtime-personal-answer-only.js.map +1 -0
- package/dist/runtime-personal-answer.d.ts +30 -0
- package/dist/runtime-personal-answer.js +124 -0
- package/dist/runtime-personal-answer.js.map +1 -0
- package/dist/runtime-personal-preflight.d.ts +8 -0
- package/dist/runtime-personal-preflight.js +103 -0
- package/dist/runtime-personal-preflight.js.map +1 -0
- package/dist/runtime-personal-profile.d.ts +40 -0
- package/dist/runtime-personal-profile.js +81 -0
- package/dist/runtime-personal-profile.js.map +1 -0
- package/dist/runtime-personal-protocol.d.ts +10 -0
- package/dist/runtime-personal-protocol.js +15 -0
- package/dist/runtime-personal-protocol.js.map +1 -0
- package/dist/runtime-personal-stage.d.ts +37 -0
- package/dist/runtime-personal-stage.js +167 -0
- package/dist/runtime-personal-stage.js.map +1 -0
- package/dist/runtime-protocol.d.ts +7 -0
- package/dist/runtime-protocol.js.map +1 -1
- package/dist/runtime-update-controller.js +1 -1
- package/dist/runtime-update-controller.js.map +1 -1
- package/dist/runtime-windows-bridge.d.ts +8 -0
- package/dist/runtime-windows-bridge.js +50 -3
- package/dist/runtime-windows-bridge.js.map +1 -1
- package/dist/scheduler/db.js +37 -0
- package/dist/scheduler/db.js.map +1 -1
- package/dist/scheduler/scheduler.d.ts +15 -0
- package/dist/scheduler/scheduler.js +45 -1
- package/dist/scheduler/scheduler.js.map +1 -1
- package/dist/scheduler/scheduler.test.js +17 -0
- package/dist/scheduler/scheduler.test.js.map +1 -1
- package/dist/scheduler/task-board-mentions.d.ts +32 -0
- package/dist/scheduler/task-board-mentions.js +97 -0
- package/dist/scheduler/task-board-mentions.js.map +1 -0
- package/dist/scheduler/task-board-text.d.ts +5 -6
- package/dist/scheduler/task-board-text.js +30 -10
- package/dist/scheduler/task-board-text.js.map +1 -1
- package/dist/scheduler/task-board-unread.d.ts +90 -0
- package/dist/scheduler/task-board-unread.js +192 -0
- package/dist/scheduler/task-board-unread.js.map +1 -0
- package/dist/scheduler/task-board.d.ts +628 -10
- package/dist/scheduler/task-board.js +1496 -48
- package/dist/scheduler/task-board.js.map +1 -1
- package/dist/scheduler/task-files.d.ts +80 -0
- package/dist/scheduler/task-files.js +357 -0
- package/dist/scheduler/task-files.js.map +1 -0
- package/dist/scheduler/types.d.ts +1 -1
- package/dist/service-activation.js +3 -13
- package/dist/service-activation.js.map +1 -1
- package/dist/service-install-handover.d.ts +52 -0
- package/dist/service-install-handover.js +50 -0
- package/dist/service-install-handover.js.map +1 -0
- package/dist/service-installer.d.ts +12 -0
- package/dist/service-installer.js +24 -10
- package/dist/service-installer.js.map +1 -1
- package/dist/service-lock.d.ts +28 -0
- package/dist/service-lock.js +85 -0
- package/dist/service-lock.js.map +1 -0
- package/dist/settings-api.d.ts +46 -1
- package/dist/settings-api.js +642 -97
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.d.ts +6 -0
- package/dist/settings-baseline.js +11 -8
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-change.js +60 -7
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-confirmation.d.ts +2 -0
- package/dist/settings-confirmation.js +6 -0
- package/dist/settings-confirmation.js.map +1 -1
- package/dist/settings-effect.d.ts +11 -0
- package/dist/settings-effect.js +154 -7
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.d.ts +3 -0
- package/dist/settings-http-confirmation.js +46 -43
- package/dist/settings-http-confirmation.js.map +1 -1
- package/dist/settings-instance-patch.js +3 -1
- package/dist/settings-instance-patch.js.map +1 -1
- package/dist/settings-route-lifetime.d.ts +3 -1
- package/dist/settings-route-lifetime.js +15 -5
- package/dist/settings-route-lifetime.js.map +1 -1
- package/dist/settings-transaction.d.ts +3 -2
- package/dist/settings-transaction.js.map +1 -1
- package/dist/setup-form.js +10 -0
- package/dist/setup-form.js.map +1 -1
- package/dist/setup-host.d.ts +2 -3
- package/dist/setup-host.js +3 -5
- package/dist/setup-host.js.map +1 -1
- package/dist/setup-i18n.js +2 -2
- package/dist/setup-i18n.js.map +1 -1
- package/dist/setup-wizard.js +0 -2
- package/dist/setup-wizard.js.map +1 -1
- package/dist/shared-default-adoption.d.ts +24 -0
- package/dist/shared-default-adoption.js +73 -0
- package/dist/shared-default-adoption.js.map +1 -0
- package/dist/state-lease.d.ts +24 -0
- package/dist/state-lease.js +103 -0
- package/dist/state-lease.js.map +1 -0
- package/dist/subagent-records.d.ts +2 -0
- package/dist/subagent-records.js +64 -12
- package/dist/subagent-records.js.map +1 -1
- package/dist/subagent-service.d.ts +3 -0
- package/dist/subagent-service.js +27 -5
- package/dist/subagent-service.js.map +1 -1
- package/dist/task-attach-client.d.ts +43 -0
- package/dist/task-attach-client.js +125 -0
- package/dist/task-attach-client.js.map +1 -0
- package/dist/task-board-tool.d.ts +60 -0
- package/dist/task-board-tool.js +216 -11
- package/dist/task-board-tool.js.map +1 -1
- package/dist/task-board-waker.d.ts +75 -31
- package/dist/task-board-waker.js +311 -101
- package/dist/task-board-waker.js.map +1 -1
- package/dist/task-file-limits.d.ts +15 -0
- package/dist/task-file-limits.js +21 -0
- package/dist/task-file-limits.js.map +1 -0
- package/dist/tips.js +4 -4
- package/dist/tips.js.map +1 -1
- package/dist/tmux-binary.js +1 -1
- package/dist/tmux-binary.js.map +1 -1
- package/dist/tmux-manager.d.ts +2 -0
- package/dist/tmux-manager.js +2 -0
- package/dist/tmux-manager.js.map +1 -1
- package/dist/tool-permissions.d.ts +32 -0
- package/dist/tool-permissions.js +68 -2
- package/dist/tool-permissions.js.map +1 -1
- package/dist/tool-progress.d.ts +9 -0
- package/dist/tool-progress.js +141 -32
- package/dist/tool-progress.js.map +1 -1
- package/dist/tool-receipt-output.d.ts +8 -6
- package/dist/topic-commands.d.ts +7 -1
- package/dist/topic-commands.js +124 -92
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-monitor.d.ts +7 -1
- package/dist/transcript-monitor.js +79 -3
- package/dist/transcript-monitor.js.map +1 -1
- package/dist/transcript-turns.d.ts +3 -0
- package/dist/transcript-turns.js +5 -0
- package/dist/transcript-turns.js.map +1 -1
- package/dist/tunnel/lease.d.ts +14 -0
- package/dist/tunnel/lease.js +23 -0
- package/dist/tunnel/lease.js.map +1 -1
- package/dist/tunnel/named-link-test.d.ts +27 -0
- package/dist/tunnel/named-link-test.js +41 -0
- package/dist/tunnel/named-link-test.js.map +1 -1
- package/dist/turn-reply-guard.d.ts +18 -3
- package/dist/turn-reply-guard.js +23 -5
- package/dist/turn-reply-guard.js.map +1 -1
- package/dist/types.d.ts +50 -2
- package/dist/ui/accounts-keepalive.js +4 -2
- package/dist/ui/accounts-view.js +18 -9
- package/dist/ui/agent-details-settings.js +11 -7
- package/dist/ui/agent-export-dialog.js +4 -3
- package/dist/ui/agent-export-strings.js +5 -5
- package/dist/ui/agent-page-strings.js +23 -5
- package/dist/ui/agent-who-can-use-strings.js +125 -0
- package/dist/ui/agent-who-can-use.js +238 -0
- package/dist/ui/app.html +2 -2
- package/dist/ui/backend-signin.js +94 -23
- package/dist/ui/chat-activity-groups.js +42 -9
- package/dist/ui/chat-activity.js +24 -4
- package/dist/ui/chat-commands.js +2 -0
- package/dist/ui/chat-mentions.js +13 -0
- package/dist/ui/chat-msg-actions.js +3 -222
- package/dist/ui/chat-pins.js +107 -0
- package/dist/ui/chat-popout-header.js +2 -2
- package/dist/ui/chat-popout-transport.js +49 -19
- package/dist/ui/chat-popout.js +15 -1
- package/dist/ui/chat-quote.js +3 -261
- package/dist/ui/chat-store.js +182 -19
- package/dist/ui/chat-task-ref-strings.js +24 -0
- package/dist/ui/chat-task-refs.js +131 -0
- package/dist/ui/chat-tour.js +1 -1
- package/dist/ui/chat-workspace.js +3 -3
- package/dist/ui/claude-credentials.js +124 -0
- package/dist/ui/claude-setup-token.js +36 -0
- package/dist/ui/contact-auth-client.js +55 -0
- package/dist/ui/contact-auth-strings.js +272 -0
- package/dist/ui/contact-authorizations.js +159 -0
- package/dist/ui/contact-grant-editor.js +110 -0
- package/dist/ui/contact-needs.js +124 -0
- package/dist/ui/contact-permissions.js +278 -0
- package/dist/ui/contact-ticket-badge.js +54 -0
- package/dist/ui/contact-tool-groups.js +39 -0
- package/dist/ui/contact-verify-need.js +46 -0
- package/dist/ui/fleet-cache.js +7 -6
- package/dist/ui/fleet-canvas.js +21 -8
- package/dist/ui/fleet-office-card.js +505 -45
- package/dist/ui/fleet-office-carousel.d.ts +14 -0
- package/dist/ui/fleet-office-carousel.js +95 -0
- package/dist/ui/fleet-office-dialogue.d.ts +6 -3
- package/dist/ui/fleet-office-dialogue.js +16 -6
- package/dist/ui/fleet-office-editor.js +11 -6
- package/dist/ui/fleet-office-layout.js +15 -15
- package/dist/ui/fleet-office-model.js +5 -3
- package/dist/ui/fleet-office-overview.js +1 -1
- package/dist/ui/fleet-office-pack.d.ts +92 -5
- package/dist/ui/fleet-office-pack.js +596 -50
- package/dist/ui/fleet-office-play.js +498 -0
- package/dist/ui/fleet-office-skin.js +360 -52
- package/dist/ui/fleet-office-store.js +121 -5
- package/dist/ui/fleet-office-talk.js +423 -0
- package/dist/ui/fleet-office-vehicles.js +147 -0
- package/dist/ui/fleet-office-view.js +58 -17
- package/dist/ui/fleet-office-zones.js +174 -39
- package/dist/ui/fleet-office.js +1462 -188
- package/dist/ui/fleet-org.js +9 -4
- package/dist/ui/fleet-route.js +44 -6
- package/dist/ui/fleet-tab-icons.js +19 -0
- package/dist/ui/fleet-task-activity.js +430 -0
- package/dist/ui/fleet-task-archive.js +111 -0
- package/dist/ui/fleet-task-card.js +386 -317
- package/dist/ui/fleet-task-common.js +117 -13
- package/dist/ui/fleet-task-create.js +67 -0
- package/dist/ui/fleet-task-edit.js +211 -0
- package/dist/ui/fleet-task-files.js +196 -0
- package/dist/ui/fleet-task-flow.js +353 -0
- package/dist/ui/fleet-task-follow.js +123 -0
- package/dist/ui/fleet-task-md.js +98 -0
- package/dist/ui/fleet-task-menu.js +2 -2
- package/dist/ui/fleet-task-owner.js +252 -0
- package/dist/ui/fleet-task-run.js +333 -0
- package/dist/ui/fleet-task-sort.js +88 -0
- package/dist/ui/fleet-task-stats.js +2 -2
- package/dist/ui/fleet-task-thread.js +245 -0
- package/dist/ui/fleet-task-unread.js +100 -0
- package/dist/ui/fleet-task-view.js +221 -46
- package/dist/ui/fleet-task-wake.js +140 -0
- package/dist/ui/fleet-task-work.js +2 -2
- package/dist/ui/fleet-tasks.js +336 -145
- package/dist/ui/fleet-usage.js +8 -7
- package/dist/ui/host-alerts.js +23 -0
- package/dist/ui/host-footprint.js +17 -0
- package/dist/ui/host-health-model.js +42 -0
- package/dist/ui/host-health.js +82 -0
- package/dist/ui/host-install.js +87 -7
- package/dist/ui/host-monitoring-darwin.js +6 -0
- package/dist/ui/host-monitoring-help.js +7 -0
- package/dist/ui/host-monitoring-linux.js +6 -0
- package/dist/ui/host-monitoring-wsl.js +6 -0
- package/dist/ui/host-time.js +5 -0
- package/dist/ui/hub-admin-overview.js +190 -0
- package/dist/ui/hub-admin-rooms-strings.js +6 -2
- package/dist/ui/hub-admin-rooms.js +4 -2
- package/dist/ui/hub-agent-copy.js +8 -2
- package/dist/ui/hub-agent-intro.js +36 -0
- package/dist/ui/hub-ai-apps-strings.js +6 -0
- package/dist/ui/hub-ai-apps.js +84 -0
- package/dist/ui/hub-assistant-admin.js +2 -1
- package/dist/ui/hub-attachments.js +81 -3
- package/dist/ui/hub-chat-store.js +4 -3
- package/dist/ui/hub-chat-strings.js +14 -4
- package/dist/ui/hub-client.js +126 -12
- package/dist/ui/hub-directory-editor-strings.js +2 -2
- package/dist/ui/hub-directory-editor.js +1 -0
- package/dist/ui/hub-directory-notices.js +2 -1
- package/dist/ui/hub-enrolment-code.js +2 -1
- package/dist/ui/hub-fleet-versions.js +393 -0
- package/dist/ui/hub-grant-picker.js +28 -47
- package/dist/ui/hub-group-policy.js +26 -13
- package/dist/ui/hub-group-search.js +2 -2
- package/dist/ui/hub-group-strings.js +28 -18
- package/dist/ui/hub-intro-notice.js +16 -0
- package/dist/ui/hub-invitations.js +5 -1
- package/dist/ui/hub-join-steps.js +27 -15
- package/dist/ui/hub-my-agents-model.js +42 -0
- package/dist/ui/hub-my-agents-strings.js +20 -0
- package/dist/ui/hub-my-agents.js +170 -0
- package/dist/ui/hub-notify-keep.js +49 -0
- package/dist/ui/hub-owner-strings.js +9 -8
- package/dist/ui/hub-personal-agent-strings.js +246 -0
- package/dist/ui/hub-personal-agent.js +119 -0
- package/dist/ui/hub-policy-subjects.js +35 -0
- package/dist/ui/hub-quick-pairing.js +9 -3
- package/dist/ui/hub-quota.js +2 -1
- package/dist/ui/hub-role-audit.js +40 -0
- package/dist/ui/hub-role-forms.js +100 -0
- package/dist/ui/hub-role-notices.js +11 -0
- package/dist/ui/hub-role-view.js +87 -0
- package/dist/ui/hub-roles-strings.js +444 -0
- package/dist/ui/hub-roles.js +84 -0
- package/dist/ui/hub-room-agent-strings.js +29 -0
- package/dist/ui/hub-room-composer.js +174 -17
- package/dist/ui/hub-room-list.js +8 -5
- package/dist/ui/hub-room-members-strings.js +11 -4
- package/dist/ui/hub-room-members.js +134 -18
- package/dist/ui/hub-room-new-strings.js +2 -1
- package/dist/ui/hub-room-new.js +17 -7
- package/dist/ui/hub-room-notify.js +162 -0
- package/dist/ui/hub-room-office.js +271 -0
- package/dist/ui/hub-room-owner-requests-strings.js +114 -0
- package/dist/ui/hub-room-owner-requests.js +265 -0
- package/dist/ui/hub-room-pins.js +44 -0
- package/dist/ui/hub-room-presence.js +19 -2
- package/dist/ui/hub-room-purpose.js +35 -0
- package/dist/ui/hub-room-search.js +126 -0
- package/dist/ui/hub-room-settings-strings.js +8 -0
- package/dist/ui/hub-room-settings.js +110 -3
- package/dist/ui/hub-room-source-strings.js +17 -0
- package/dist/ui/hub-room-source.js +37 -0
- package/dist/ui/hub-room-strings.js +102 -7
- package/dist/ui/hub-room-thread.js +522 -69
- package/dist/ui/hub-room-unread.js +2 -1
- package/dist/ui/hub-room-working.js +37 -0
- package/dist/ui/hub-session-limits.js +79 -0
- package/dist/ui/hub-strings.js +23 -10
- package/dist/ui/hub-subject-picker.js +58 -0
- package/dist/ui/hub-switcher.js +2 -2
- package/dist/ui/hub-teams-strings.js +10 -6
- package/dist/ui/hub-teams.js +58 -29
- package/dist/ui/hub-this-hub.js +2 -2
- package/dist/ui/hub-welcome.js +122 -75
- package/dist/ui/icons/hub-apple-touch-icon.png +0 -0
- package/dist/ui/icons/hub-favicon.ico +0 -0
- package/dist/ui/icons/hub-favicon.svg +10 -0
- package/dist/ui/icons/hub-icon-192.png +0 -0
- package/dist/ui/icons/hub-icon-512.png +0 -0
- package/dist/ui/icons/hub-icon-maskable-192.png +0 -0
- package/dist/ui/icons/hub-icon-maskable-512.png +0 -0
- package/dist/ui/icons/hub-maskable.svg +12 -0
- package/dist/ui/image-annotate.js +2 -283
- package/dist/ui/image-lightbox.js +2 -176
- package/dist/ui/image-zoom.js +2 -242
- package/dist/ui/log-row.js +11 -8
- package/dist/ui/model-picker.js +7 -3
- package/dist/ui/native-instance-settings.js +4 -2
- package/dist/ui/notice-hub-sharing.js +81 -0
- package/dist/ui/notice-hub-update.js +94 -0
- package/dist/ui/office-share-dialog.js +4 -3
- package/dist/ui/office-share-page.js +7 -2
- package/dist/ui/page-share-dialog.js +3 -2
- package/dist/ui/panel-chat.js +515 -81
- package/dist/ui/panel-details.js +27 -3
- package/dist/ui/panel-fleet.js +61 -21
- package/dist/ui/panel-hub.js +478 -135
- package/dist/ui/panel-log.js +7 -7
- package/dist/ui/panel-needs.js +139 -28
- package/dist/ui/panel-notices.js +6 -2
- package/dist/ui/panel-runtimes.js +6 -4
- package/dist/ui/panel-settings.js +150 -61
- package/dist/ui/panel-windows-cli.js +4 -3
- package/dist/ui/preview-panel.js +3 -1
- package/dist/ui/preview-popout.js +134 -0
- package/dist/ui/reply-file-preview.js +65 -0
- package/dist/ui/request-contact-card.js +287 -0
- package/dist/ui/request-contact-client.js +83 -0
- package/dist/ui/request-contact-page.js +78 -0
- package/dist/ui/request-context-control.js +209 -0
- package/dist/ui/runtime-cli-install.js +3 -2
- package/dist/ui/runtime-commands.d.ts +2 -2
- package/dist/ui/runtime-commands.js +7 -4
- package/dist/ui/runtime-update-status.js +1 -1
- package/dist/ui/search-dialog.js +8 -1
- package/dist/ui/settings-access-overview.js +5 -4
- package/dist/ui/settings-access-strings.js +1 -1
- package/dist/ui/settings-appearance.js +15 -12
- package/dist/ui/settings-apply.js +8 -3
- package/dist/ui/settings-archive-files.js +109 -0
- package/dist/ui/settings-build-version.js +2 -2
- package/dist/ui/settings-capabilities.js +2 -0
- package/dist/ui/settings-catalog.js +22 -0
- package/dist/ui/settings-connector-strings.js +23 -0
- package/dist/ui/settings-connector.js +40 -0
- package/dist/ui/settings-default-model-scope.js +40 -0
- package/dist/ui/settings-default-model-strings.js +43 -0
- package/dist/ui/settings-dialogs.js +9 -5
- package/dist/ui/settings-guests-entries.js +16 -0
- package/dist/ui/settings-guests.js +61 -18
- package/dist/ui/settings-host-alerts.js +23 -0
- package/dist/ui/settings-host-monitoring.js +71 -0
- package/dist/ui/settings-hub-connection.js +6 -7
- package/dist/ui/settings-hub-member-address.js +2 -1
- package/dist/ui/settings-hub-membership.js +6 -7
- package/dist/ui/settings-hub-page-sharing.js +52 -0
- package/dist/ui/settings-hub-section.js +2 -4
- package/dist/ui/settings-hub-setup-strings.js +1 -1
- package/dist/ui/settings-hub-setup.js +4 -2
- package/dist/ui/settings-hub-updates.js +67 -0
- package/dist/ui/settings-hub-web-address.js +2 -1
- package/dist/ui/settings-hub.js +37 -8
- package/dist/ui/settings-layout.js +18 -15
- package/dist/ui/settings-model.js +9 -5
- package/dist/ui/settings-named-test.js +16 -16
- package/dist/ui/settings-preview-address.js +156 -0
- package/dist/ui/settings-public-session-strings.js +2 -2
- package/dist/ui/settings-quota-notice.js +3 -3
- package/dist/ui/settings-registry.js +32 -5
- package/dist/ui/settings-revoke-strings.js +1 -1
- package/dist/ui/settings-shared-strings.js +35 -2
- package/dist/ui/settings-shared.js +67 -14
- package/dist/ui/settings-strings.js +58 -49
- package/dist/ui/settings-update.js +28 -7
- package/dist/ui/settings-web-authority.js +9 -6
- package/dist/ui/shared/access-overview.css +2 -2
- package/dist/ui/shared/accounts-keepalive.css +1 -1
- package/dist/ui/shared/accounts.css +9 -5
- package/dist/ui/shared/agent-sheet.js +121 -0
- package/dist/ui/shared/agent-widget.js +1 -2
- package/dist/ui/shared/app-i18n.js +12 -4
- package/dist/ui/shared/app-install.js +123 -0
- package/dist/ui/shared/app-nav.js +9 -5
- package/dist/ui/shared/app-needs.js +8 -1
- package/dist/ui/shared/app-prefs.js +9 -3
- package/dist/ui/shared/app-route.js +5 -3
- package/dist/ui/shared/app-session.js +4 -3
- package/dist/ui/shared/app-shell.js +218 -46
- package/dist/ui/shared/app-store.js +7 -3
- package/dist/ui/shared/app-stream.js +11 -2
- package/dist/ui/shared/app-swipe.js +3 -1
- package/dist/ui/shared/app-themes.js +3 -5
- package/dist/ui/shared/app-update.js +107 -10
- package/dist/ui/shared/app.css +1398 -275
- package/dist/ui/shared/app.js +34 -5
- package/dist/ui/shared/asset-url.d.ts +2 -0
- package/dist/ui/shared/asset-url.js +20 -0
- package/dist/ui/shared/chat-composer.js +30 -8
- package/dist/ui/shared/chat-msg-actions.js +233 -0
- package/dist/ui/shared/chat-quote.js +285 -0
- package/dist/ui/shared/chat-render.js +63 -10
- package/dist/ui/shared/chat-strings.js +49 -24
- package/dist/ui/shared/chat-table-select.js +175 -0
- package/dist/ui/shared/chat-thread.js +181 -29
- package/dist/ui/shared/chat-time.js +7 -4
- package/dist/ui/shared/chat-work-bar.css +97 -15
- package/dist/ui/shared/clock-text.js +57 -0
- package/dist/ui/shared/composer-focus.js +21 -0
- package/dist/ui/shared/connector-prompt.d.ts +3 -0
- package/dist/ui/shared/connector-prompt.js +20 -0
- package/dist/ui/shared/device-roles.js +6 -5
- package/dist/ui/shared/hub-ai-apps.css +12 -0
- package/dist/ui/shared/hub-chat.css +114 -4
- package/dist/ui/shared/hub-groups.css +19 -15
- package/dist/ui/shared/hub-my-agents.css +41 -0
- package/dist/ui/shared/hub-owner.css +123 -3
- package/dist/ui/shared/hub-roles.css +99 -0
- package/dist/ui/shared/hub-rooms-u2.css +98 -0
- package/dist/ui/shared/hub-signin.css +2 -0
- package/dist/ui/shared/hub.css +23 -5
- package/dist/ui/shared/image-annotate.css +22 -3
- package/dist/ui/shared/image-annotate.js +416 -0
- package/dist/ui/shared/image-lightbox.js +218 -0
- package/dist/ui/shared/image-zoom.js +316 -0
- package/dist/ui/shared/info-tip.js +64 -0
- package/dist/ui/shared/instance-nav.js +197 -21
- package/dist/ui/shared/jump-idle.js +36 -0
- package/dist/ui/shared/loading.css +1 -1
- package/dist/ui/shared/model-picker.css +28 -1
- package/dist/ui/shared/module-warm.d.ts +3 -0
- package/dist/ui/shared/module-warm.js +39 -0
- package/dist/ui/shared/office-dialogue.css +122 -0
- package/dist/ui/shared/owner-css.js +1 -1
- package/dist/ui/shared/panel-view.js +7 -1
- package/dist/ui/shared/preview-panel-actions.js +1 -1
- package/dist/ui/shared/preview-panel.js +51 -21
- package/dist/ui/shared/preview-popout.css +11 -0
- package/dist/ui/shared/preview.js +11 -2
- package/dist/ui/shared/reply-previews.css +4 -0
- package/dist/ui/shared/runtime-install.css +5 -0
- package/dist/ui/shared/settings-connector.css +7 -0
- package/dist/ui/shared/signin.js +27 -12
- package/dist/ui/shared/task-board.css +733 -11
- package/dist/ui/shared/text-undo.js +17 -3
- package/dist/ui/shared/theme-picker.js +46 -0
- package/dist/ui/shared/theme.js +101 -2
- package/dist/ui/shared/tokens.css +318 -13
- package/dist/ui/shared/ui-confirm.js +10 -5
- package/dist/ui/shared/ui-icons.js +7 -0
- package/dist/ui/shared/ui-menu.js +17 -11
- package/dist/ui/shared/ui-states.js +9 -2
- package/dist/ui/shared/ui-toast.js +4 -4
- package/dist/ui/shared/update-card-ui.js +586 -0
- package/dist/ui/shared/usage-dialog.js +90 -18
- package/dist/ui/shared/view-history.js +2 -1
- package/dist/ui/shared/view-strings.js +57 -13
- package/dist/ui/shared/web-authorize.js +6 -5
- package/dist/ui/shared/workspace.css +7 -0
- package/dist/ui/signin.html +4 -2
- package/dist/ui/structured-signin.js +64 -12
- package/dist/ui/subagent-row.js +5 -3
- package/dist/ui/task-unread.js +70 -0
- package/dist/ui/trigger-complete.js +71 -0
- package/dist/ui/usage-credits-card.js +84 -0
- package/dist/ui/usage-pool.js +2 -1
- package/dist/ui/web-terminal/terminal.css +1 -1
- package/dist/ui/windows-cli-catalog.js +33 -6
- package/dist/ui/workspace-ignored-strings.js +16 -0
- package/dist/ui/workspace-panel.js +21 -10
- package/dist/update-abandon.d.ts +26 -0
- package/dist/update-abandon.js +111 -0
- package/dist/update-abandon.js.map +1 -0
- package/dist/update-card.d.ts +193 -0
- package/dist/update-card.js +620 -0
- package/dist/update-card.js.map +1 -0
- package/dist/update-dispatch.d.ts +24 -2
- package/dist/update-dispatch.js +28 -5
- package/dist/update-dispatch.js.map +1 -1
- package/dist/update-fix.d.ts +66 -0
- package/dist/update-fix.js +67 -0
- package/dist/update-fix.js.map +1 -0
- package/dist/update-forward.d.ts +59 -0
- package/dist/update-forward.js +227 -0
- package/dist/update-forward.js.map +1 -0
- package/dist/update-goback.d.ts +90 -0
- package/dist/update-goback.js +272 -0
- package/dist/update-goback.js.map +1 -0
- package/dist/update-idle.d.ts +66 -0
- package/dist/update-idle.js +199 -0
- package/dist/update-idle.js.map +1 -0
- package/dist/update-install.d.ts +2 -1
- package/dist/update-install.js +18 -10
- package/dist/update-install.js.map +1 -1
- package/dist/update-journal.d.ts +359 -0
- package/dist/update-journal.js +723 -0
- package/dist/update-journal.js.map +1 -0
- package/dist/update-launch.d.ts +1 -1
- package/dist/update-launch.js +10 -3
- package/dist/update-launch.js.map +1 -1
- package/dist/update-npm-env.d.ts +45 -12
- package/dist/update-npm-env.js +48 -0
- package/dist/update-npm-env.js.map +1 -1
- package/dist/update-package-restore.d.ts +84 -0
- package/dist/update-package-restore.js +329 -0
- package/dist/update-package-restore.js.map +1 -0
- package/dist/update-quiescence.d.ts +221 -0
- package/dist/update-quiescence.js +370 -0
- package/dist/update-quiescence.js.map +1 -0
- package/dist/update-readiness-host.d.ts +61 -0
- package/dist/update-readiness-host.js +297 -0
- package/dist/update-readiness-host.js.map +1 -0
- package/dist/update-readiness.d.ts +85 -0
- package/dist/update-readiness.js +463 -0
- package/dist/update-readiness.js.map +1 -0
- package/dist/update-recovery/kit.d.ts +35 -0
- package/dist/update-recovery/kit.js +99 -0
- package/dist/update-recovery/kit.js.map +1 -0
- package/dist/update-recovery/pre-start.d.ts +34 -0
- package/dist/update-recovery/pre-start.js +103 -0
- package/dist/update-recovery/pre-start.js.map +1 -0
- package/dist/update-recovery/recover-main.d.ts +1 -0
- package/dist/update-recovery/recover-main.js +4 -0
- package/dist/update-recovery/recover-main.js.map +1 -0
- package/dist/update-recovery/recover.d.ts +22 -0
- package/dist/update-recovery/recover.js +134 -0
- package/dist/update-recovery/recover.js.map +1 -0
- package/dist/update-recovery/route.d.ts +53 -0
- package/dist/update-recovery/route.js +262 -0
- package/dist/update-recovery/route.js.map +1 -0
- package/dist/update-recovery/runner.d.ts +62 -0
- package/dist/update-recovery/runner.js +229 -0
- package/dist/update-recovery/runner.js.map +1 -0
- package/dist/update-recovery/service-manager.d.ts +39 -0
- package/dist/update-recovery/service-manager.js +57 -0
- package/dist/update-recovery/service-manager.js.map +1 -0
- package/dist/update-restore.d.ts +50 -0
- package/dist/update-restore.js +360 -0
- package/dist/update-restore.js.map +1 -0
- package/dist/update-retained.d.ts +65 -0
- package/dist/update-retained.js +116 -0
- package/dist/update-retained.js.map +1 -0
- package/dist/update-rollback.d.ts +74 -0
- package/dist/update-rollback.js +221 -0
- package/dist/update-rollback.js.map +1 -0
- package/dist/update-settings.d.ts +63 -0
- package/dist/update-settings.js +162 -0
- package/dist/update-settings.js.map +1 -0
- package/dist/update-snapshot-manifest.d.ts +32 -0
- package/dist/update-snapshot-manifest.js +65 -0
- package/dist/update-snapshot-manifest.js.map +1 -0
- package/dist/update-snapshot-scope.d.ts +67 -0
- package/dist/update-snapshot-scope.js +174 -0
- package/dist/update-snapshot-scope.js.map +1 -0
- package/dist/update-snapshot.d.ts +34 -0
- package/dist/update-snapshot.js +246 -0
- package/dist/update-snapshot.js.map +1 -0
- package/dist/update-writers.d.ts +71 -0
- package/dist/update-writers.js +235 -0
- package/dist/update-writers.js.map +1 -0
- package/dist/usage/i18n-keys.d.ts +1 -1
- package/dist/usage/i18n-keys.js +10 -1
- package/dist/usage/i18n-keys.js.map +1 -1
- package/dist/usage/profile-timeline.d.ts +2 -0
- package/dist/usage/profile-timeline.js +4 -0
- package/dist/usage/profile-timeline.js.map +1 -1
- package/dist/usage/providers.d.ts +4 -11
- package/dist/usage/providers.js +109 -134
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/usage-api.js +5 -2
- package/dist/usage/usage-api.js.map +1 -1
- package/dist/wake-coordinator.js +3 -2
- package/dist/wake-coordinator.js.map +1 -1
- package/dist/web-api.d.ts +132 -9
- package/dist/web-api.js +1468 -242
- package/dist/web-api.js.map +1 -1
- package/dist/web-asset-version.d.ts +65 -0
- package/dist/web-asset-version.js +259 -0
- package/dist/web-asset-version.js.map +1 -0
- package/dist/web-backend-login.d.ts +5 -1
- package/dist/web-backend-login.js +8 -2
- package/dist/web-backend-login.js.map +1 -1
- package/dist/web-chat-archive.d.ts +147 -0
- package/dist/web-chat-archive.js +530 -0
- package/dist/web-chat-archive.js.map +1 -0
- package/dist/web-chat-history.d.ts +137 -2
- package/dist/web-chat-history.js +335 -12
- package/dist/web-chat-history.js.map +1 -1
- package/dist/web-claude-credentials.d.ts +31 -0
- package/dist/web-claude-credentials.js +138 -0
- package/dist/web-claude-credentials.js.map +1 -0
- package/dist/web-commands.d.ts +9 -5
- package/dist/web-commands.js +7 -4
- package/dist/web-commands.js.map +1 -1
- package/dist/web-guest-access.d.ts +3 -0
- package/dist/web-guest-access.js +8 -4
- package/dist/web-guest-access.js.map +1 -1
- package/dist/web-host-guard.js +3 -1
- package/dist/web-host-guard.js.map +1 -1
- package/dist/web-host-install.d.ts +30 -3
- package/dist/web-host-install.js +50 -4
- package/dist/web-host-install.js.map +1 -1
- package/dist/web-icons.d.ts +20 -3
- package/dist/web-icons.js +79 -10
- package/dist/web-icons.js.map +1 -1
- package/dist/web-login.d.ts +13 -1
- package/dist/web-login.js +16 -4
- package/dist/web-login.js.map +1 -1
- package/dist/web-mentions.d.ts +29 -8
- package/dist/web-mentions.js +128 -1
- package/dist/web-mentions.js.map +1 -1
- package/dist/web-notices.d.ts +20 -0
- package/dist/web-notices.js +64 -8
- package/dist/web-notices.js.map +1 -1
- package/dist/web-office-acts.d.ts +16 -0
- package/dist/web-office-acts.js +30 -9
- package/dist/web-office-acts.js.map +1 -1
- package/dist/web-office-pack-read.js +1 -1
- package/dist/web-office-pack-read.js.map +1 -1
- package/dist/web-office-skins.d.ts +19 -6
- package/dist/web-office-skins.js +85 -36
- package/dist/web-office-skins.js.map +1 -1
- package/dist/web-office-store.d.ts +2 -0
- package/dist/web-office-store.js +20 -6
- package/dist/web-office-store.js.map +1 -1
- package/dist/web-pin-store.d.ts +58 -0
- package/dist/web-pin-store.js +170 -0
- package/dist/web-pin-store.js.map +1 -0
- package/dist/web-prefs.js +5 -1
- package/dist/web-prefs.js.map +1 -1
- package/dist/web-preview.d.ts +5 -0
- package/dist/web-preview.js +1 -1
- package/dist/web-preview.js.map +1 -1
- package/dist/web-reply-files.d.ts +1 -0
- package/dist/web-reply-files.js +2 -0
- package/dist/web-reply-files.js.map +1 -1
- package/dist/web-session-authorization.d.ts +27 -0
- package/dist/web-session-authorization.js +32 -0
- package/dist/web-session-authorization.js.map +1 -1
- package/dist/web-session.d.ts +26 -5
- package/dist/web-session.js +32 -3
- package/dist/web-session.js.map +1 -1
- package/dist/web-settings-patch.d.ts +51 -3
- package/dist/web-settings-patch.js +124 -1
- package/dist/web-settings-patch.js.map +1 -1
- package/dist/web-shell-routes.d.ts +2 -2
- package/dist/web-shell-routes.js +3 -2
- package/dist/web-shell-routes.js.map +1 -1
- package/dist/web-terminal.d.ts +9 -0
- package/dist/web-terminal.js +27 -1
- package/dist/web-terminal.js.map +1 -1
- package/dist/web-theme.js +2 -2
- package/dist/web-update.d.ts +30 -1
- package/dist/web-upload.d.ts +37 -1
- package/dist/web-upload.js +105 -5
- package/dist/web-upload.js.map +1 -1
- package/dist/windows-agents.d.ts +36 -2
- package/dist/windows-agents.js +115 -4
- package/dist/windows-agents.js.map +1 -1
- package/dist/windows-cli-api.d.ts +10 -7
- package/dist/windows-cli-api.js +17 -14
- package/dist/windows-cli-api.js.map +1 -1
- package/dist/windows-cli-worker.d.ts +10 -0
- package/dist/windows-cli-worker.js +118 -15
- package/dist/windows-cli-worker.js.map +1 -1
- package/dist/windows-cli.d.ts +65 -2
- package/dist/windows-cli.js +192 -28
- package/dist/windows-cli.js.map +1 -1
- package/dist/windows-native-mcp.js +5 -2
- package/dist/windows-native-mcp.js.map +1 -1
- package/dist/windows-shortcuts.d.ts +3 -22
- package/dist/windows-shortcuts.js +5 -45
- package/dist/windows-shortcuts.js.map +1 -1
- package/dist/workflow-templates/default.md +8 -8
- package/dist/wsl-host.d.ts +52 -0
- package/dist/wsl-host.js +97 -0
- package/dist/wsl-host.js.map +1 -0
- package/launcher/agend +4 -1
- package/launcher/agend-agent +4 -1
- package/launcher/agend-install.cjs +63 -14
- package/launcher/install-admission.d.cts +8 -0
- package/launcher/npm-allow-scripts.cjs +72 -0
- package/launcher/npm-global-prefix.cjs +81 -0
- package/launcher/postinstall.cjs +9 -8
- package/launcher/runtime-select.cjs +8 -2
- package/package.json +4 -3
- package/scripts/preinstall-guard.cjs +1 -1
- package/templates/runtime-install/install.ps1 +24 -4
package/dist/ui/fleet-office.js
CHANGED
|
@@ -55,6 +55,12 @@
|
|
|
55
55
|
// that office; a person opens their chat. A tile too small to read (under TAG_MIN_K) shows name tags on hover only;
|
|
56
56
|
// bubbles are drawn after every tile (never cut at a tile's edge). Fit keeps the tiles clear of the controls
|
|
57
57
|
// (FIT_PAD). Edit offices and Edit layout wait for a single office.
|
|
58
|
+
// - Carousel (#4010; offered with two or more stored offices, on the signed-in dashboard only): chosen offices, each
|
|
59
|
+
// the full-size office in turn (not All offices' tiles), for a TV. One n/m button opens a scrollable checklist
|
|
60
|
+
// (inline ticks wrapped the bar at ~10). The offices and the interval are kept per browser; playing starts on enter
|
|
61
|
+
// and on reload. Space pauses, ← / → (and N / P, media keys) step; Pause and Next on the bar and in fullscreen.
|
|
62
|
+
// Edit offices and Edit layout wait. A share link does not offer it.
|
|
63
|
+
import { assetUrl } from "/assets/asset-url.js";
|
|
58
64
|
import { html, useEffect, useLayoutEffect, useMemo, useRef, useState } from "/assets/app-html.js";
|
|
59
65
|
import { appStore } from "/assets/app-store.js";
|
|
60
66
|
import { t, lang, register } from "/assets/app-i18n.js";
|
|
@@ -65,24 +71,29 @@ import { nodeText, stateWords } from "./fleet-org.js";
|
|
|
65
71
|
import { hits, needle } from "./fleet-canvas-layout.js";
|
|
66
72
|
import { AUTO_ID, LOBBY, autoLayout, backingScale, coatOf, createFlights, customLayout, deskAt, desksOf, filterOk, lampOf, layoutOk, lightOf, membersOf,
|
|
67
73
|
officePose, officeRooms, signOf, workOn } from "./fleet-office-model.js";
|
|
68
|
-
import { BUILT_IN_SKINS, CHAR_DEPTH, DEFAULT_PAL, PICTURE_SKINS, bubbleBox, pixelSkin, loadBuiltInSkin, loadPackSkin, modeOf, skinFor, tagBox, tagFootprint } from "./fleet-office-skin.js";
|
|
69
|
-
import {
|
|
74
|
+
import { BUILT_IN_SKINS, CHAR_DEPTH, DEFAULT_PAL, PICTURE_SKINS, bubbleBox, pixelSkin, loadBuiltInSkin, loadPackSkin, modeOf, skinFor, tagBox, tagFootprint, withCharacters } from "./fleet-office-skin.js";
|
|
75
|
+
import { createRiders, facing, seatAt, vehicleAt } from "./fleet-office-vehicles.js";
|
|
76
|
+
import { CALLING, activeFurniture, bubbleAt, hiddenBy, bubbleRank, NIGHT, WANDER, createMail, createWalkers, isNight, linesFor, npcKey, personAt, placeBubbles, routeStaysInArea, thinBubbles, walkTargets, zonesLayout } from "./fleet-office-zones.js";
|
|
70
77
|
import { actsOk, createOfficeStore } from "./fleet-office-store.js";
|
|
71
78
|
import { badgeOf, fixedOf, mergeLevels } from "./fleet-office-levels.js";
|
|
72
79
|
import { OfficeCard, cardModel } from "./fleet-office-card.js";
|
|
80
|
+
import { PLAY, applySeatDrop, patLook, clampDropForArea, createHold, createSnackDrag, createSnacks, findSeatDropTarget, playAllowed, playOffForMotion, pruneReactions, reactionAt, scatterWords, seatDropTargets } from "./fleet-office-play.js";
|
|
73
81
|
import { POLL_MS } from "./fleet-traffic.js";
|
|
74
82
|
import { OfficeEditor, officeForSave } from "./fleet-office-editor.js";
|
|
75
83
|
import { LayoutEditor, handlesOf } from "./fleet-office-layout.js";
|
|
76
84
|
import { ShareButton } from "./office-share-dialog.js";
|
|
85
|
+
import { Dialog } from "/assets/ui-dialog.js";
|
|
77
86
|
import { DLG, boxColours, boxLayout, createDialogue, createFaces, drawBox, fitBox, messageOf, onBox, pickFront, portraitSrc, stageOf, talkOf, wrap } from "./fleet-office-dialogue.js";
|
|
78
|
-
import { applyOverrides, fitNight, fitSeatFor, stripBox } from "./fleet-office-pack.js";
|
|
87
|
+
import { applyOverrides, createClipClocks, fitNight, fitSeatFor, packMaxFps, snackLabel, stripBox, stripDurationMs } from "./fleet-office-pack.js";
|
|
79
88
|
import { ALL_ID, LOBBY_TILE, OV, createCrossFlights, cropToRooms, fromTile, inTile, labelAt, lobbyNodes, overviewOk, tileAt, tileBox, tileLayout, visibleTiles } from "./fleet-office-overview.js";
|
|
89
|
+
import { CAROUSEL_ID, INTERVALS, carouselHeld, carouselIdsOk, carouselKey, carouselOk, intervalOk, nextIndex, prevIndex } from "./fleet-office-carousel.js";
|
|
80
90
|
import { centreOn, gestureState, gestures, miniPoint, toScreen, toWorld, wheelFactor, zoomKey, zoomTo } from "./fleet-canvas-view.js";
|
|
81
|
-
import { OK_MAX,
|
|
91
|
+
import { OK_MAX, cardSpot, clampPan, desksK, minK, edgeMatte, edgeStrips, fitScene, layerScale, miniBox, miniFrame, openingView, pinchOffice, savedOf, stepK, viewFromSaved,
|
|
82
92
|
wholeInView, zoomLabel, zoomOffice } from "./fleet-office-view.js";
|
|
83
93
|
|
|
84
94
|
register("orgo", {
|
|
85
95
|
en: {
|
|
96
|
+
display: "Display options", playMotionOff: "Off: your system asks for reduced motion",
|
|
86
97
|
label: "Office: each team is a room and each instance a desk; General and the instances in no team are in the lobby. Drag to pan; the wheel, a pinch, + and − zoom, 0 fits, F is fullscreen.",
|
|
87
98
|
office: "Office", allOffice: "Whole fleet", show: "Show", allTeams: "All teams", lobby: "Lobby (General, no team)", lobbyRoom: "Lobby",
|
|
88
99
|
people: "People", peopleN: "People ({0})", findPerson: "Find a person", everyone: "Show everyone", nobody: "No one here matches this filter.",
|
|
@@ -92,22 +103,32 @@ register("orgo", {
|
|
|
92
103
|
b_working: "On it.|Typing…|Almost there|In the zone|One more test", b_idle: "Tea time|Ready when you are|Stretching|Anything for me?",
|
|
93
104
|
b_paused: "Zzz…|Back later", b_stopped: "Off duty|Zzz…", b_needs: "Need you!|A question for you|Over here!",
|
|
94
105
|
b_crashed: "Ouch, crashed|Help!", b_stuck: "Hmm, stuck?|Still thinking…",
|
|
95
|
-
hideAsleep: "Hide paused and stopped", nightOn: "Bedtime 0–6:
|
|
106
|
+
options: "Office options", hideAsleep: "Hide paused and stopped", hideNames: "Hide names and levels", hideMini: "Hide the minimap", nightOn: "Bedtime (0–6): idle agents sleep", playOn: "Drag and pat", playStill: "Off while reduced motion is on", layoutIgnored: "Its saved layout does not fit this style: drawn as the style's own.",
|
|
96
107
|
styleForAll: "The whole fleet's style, for everyone: every device and share link", styleHere: "The whole fleet's style in this browser",
|
|
97
108
|
styleFailed: "The style was not saved for everyone ({0}).", styleBusy: "Too many changes. Try again in a minute.",
|
|
98
109
|
fit: "Fit the office", overview: "Overview: click to move there", fullscreen: "Fullscreen", exitFullscreen: "Exit fullscreen",
|
|
99
|
-
fill: "Fill", fillTitle: "Fill the panel (the scene's overflow is cropped; drag to see it)", zoomLevel: "Zoom {0}",
|
|
100
|
-
allOffices: "All offices", labelAll: "All offices: each office is a tile, drawn in its own style. Drag to pan; the wheel, a pinch, + and − zoom, 0 fits, F is fullscreen.
|
|
110
|
+
fill: "Fill", fillTitle: "Fill the panel (the scene's overflow is cropped; drag to see it)", zoomLevel: "Zoom {0}", view: "View", zoomIn: "Zoom in", zoomOut: "Zoom out", live: "Live",
|
|
111
|
+
allOffices: "All offices", labelAll: "All offices: each office is a tile, drawn in its own style. Drag to pan; the wheel, a pinch, + and − zoom, 0 fits, F is fullscreen. Click a tile to open that office.",
|
|
112
|
+
backAll: "← All offices",
|
|
101
113
|
key: "Key", keyTitle: "What the items carried between desks are", keyLabel: "Carried between desks",
|
|
102
114
|
keyTask: "Folder: a task", keySend: "Envelope: a message", keyReport: "Paper: a report", keyBroadcast: "Horn: a broadcast",
|
|
103
115
|
tileLabel: "{0} ({1})", openOffice: "Open the office {0}", lobbyTile: "Lobby tile (in no office)", lobbyEveryone: "Everyone is in an office", overviewNoEdit: "Pick one office to edit offices or a layout",
|
|
116
|
+
carousel: "Carousel…", labelCarousel: "Carousel: each chosen office fills the screen in turn. Space pauses; ← and → step; F is fullscreen.",
|
|
117
|
+
carouselNoEdit: "Leave the carousel to edit offices or a layout", pause: "Pause", resume: "Play", next: "Next",
|
|
118
|
+
playing: "Playing", paused: "Paused", interval: "Interval", intervalSec: "{0} s", intervalMin: "{0} min",
|
|
119
|
+
officesInCarousel: "Offices in the carousel",
|
|
120
|
+
officesCount: "Carousel {0}/{1} offices ▾", selectAll: "Select all", selectNone: "Select none",
|
|
104
121
|
dialogue: "Dialogue", dialogueTitle: "When a person messages someone here, show their words and the reply in a box at the bottom (this browser only)",
|
|
105
|
-
dlgWorking: "Working…", dlgSomeone: "Someone", dlgHeardShare: "Sent {0} a message.", dlgAnsweredShare: "Replied.", dlgFile: "(sent a file)", dlgSays: "{0}: {1}",
|
|
122
|
+
dlgOpenChat: "Open the agent’s chat in a new window", dlgWorking: "Working…", dlgSomeone: "Someone", dlgHeardShare: "Sent {0} a message.", dlgAnsweredShare: "Replied.", dlgFile: "(sent a file)", dlgSays: "{0}: {1}",
|
|
106
123
|
dlgBox: "Dialogue: {0}. Click for their card, double-click for their chat.",
|
|
124
|
+
zones: "Go to an area", zoneAll: "Whole office", zoneN: "{0} {1}",
|
|
125
|
+
snacks: "Snacks", snackFeed: "Feed {0}", snackPlace: "Place here",
|
|
126
|
+
snackArm: "{0}: drag onto someone to feed, or onto the floor to place; click to select",
|
|
107
127
|
},
|
|
108
128
|
"zh-TW": {
|
|
109
|
-
|
|
110
|
-
|
|
129
|
+
display: "顯示選項", playMotionOff: "已關閉:系統開了「減少動態效果」",
|
|
130
|
+
label: "辦公室:每個團隊是一間房間,每個 Agent 一張桌子;General 和未加入團隊的 Agent 在大廳。拖曳平移;滾輪、雙指、+ 和 − 縮放,0 顯示整個場景,F 切換全螢幕。",
|
|
131
|
+
office: "辦公室", allOffice: "整個 fleet", show: "顯示", allTeams: "所有團隊", lobby: "大廳(General、未加入團隊)", lobbyRoom: "大廳",
|
|
111
132
|
people: "成員", peopleN: "成員({0})", findPerson: "尋找成員", everyone: "顯示全部", nobody: "沒有符合這個篩選的成員。",
|
|
112
133
|
unseated: "{0} 位沒有座位", skinUnknown: "這裡沒有它的風格「{0}」:以辦公桌顯示。", closed: "休息中", desks: "桌子", tapAgain: "再點一下開啟聊天",
|
|
113
134
|
capWorking: "埋頭打字中", capIdle: "喝茶休息", capPaused: "睡著了", capNeeds: "在呼叫你", capAway: "空位", capStarting: "剛到座位", capQueued: "等待啟動",
|
|
@@ -115,27 +136,67 @@ register("orgo", {
|
|
|
115
136
|
b_working: "處理中|打字中…|快好了|專心中|再測一次", b_idle: "喝茶中|隨時可以開工|伸個懶腰|有事找我嗎?",
|
|
116
137
|
b_paused: "Zzz…|晚點回來", b_stopped: "下班了|Zzz…", b_needs: "需要你!|有個問題|在這裡!",
|
|
117
138
|
b_crashed: "糟糕,當掉了|救命!", b_stuck: "嗯,卡住了?|還在想…",
|
|
118
|
-
hideAsleep: "隱藏暫停與停止的成員", nightOn: "0–6 點就寢:閒著的人去睡", layoutIgnored: "它儲存的配置不適用這個風格:以風格本身的配置顯示。",
|
|
139
|
+
options: "辦公室選項", hideAsleep: "隱藏暫停與停止的成員", hideNames: "隱藏名字和等級", hideMini: "隱藏小地圖", nightOn: "0–6 點就寢:閒著的人去睡", playOn: "拖曳與摸頭", playStill: "開啟「減少動態效果」時關閉", layoutIgnored: "它儲存的配置不適用這個風格:以風格本身的配置顯示。",
|
|
119
140
|
styleForAll: "整個 fleet 的風格,所有人共用:每台裝置與分享連結都一樣", styleHere: "這個瀏覽器裡整個 fleet 的風格",
|
|
120
141
|
styleFailed: "風格沒有替所有人儲存({0})。", styleBusy: "變更太頻繁,請一分鐘後再試。",
|
|
121
142
|
fit: "顯示整個辦公室", overview: "總覽:點一下移到那裡", fullscreen: "全螢幕", exitFullscreen: "結束全螢幕",
|
|
122
|
-
fill: "填滿", fillTitle: "填滿整個面板(超出的部分會被裁切,拖曳即可看到)", zoomLevel: "縮放 {0}",
|
|
123
|
-
allOffices: "所有辦公室", labelAll: "所有辦公室:每間辦公室是一格,以它自己的風格顯示。拖曳平移;滾輪、雙指、+ 和 − 縮放,0 顯示全部,F
|
|
143
|
+
fill: "填滿", fillTitle: "填滿整個面板(超出的部分會被裁切,拖曳即可看到)", zoomLevel: "縮放 {0}", view: "檢視", zoomIn: "放大", zoomOut: "縮小", live: "即時",
|
|
144
|
+
allOffices: "所有辦公室", labelAll: "所有辦公室:每間辦公室是一格,以它自己的風格顯示。拖曳平移;滾輪、雙指、+ 和 − 縮放,0 顯示全部,F 切換全螢幕。點一格即可開啟那間辦公室。",
|
|
145
|
+
backAll: "← 返回全域",
|
|
124
146
|
key: "圖例", keyTitle: "桌子之間傳遞的物品代表什麼", keyLabel: "桌子之間傳遞的物品",
|
|
125
147
|
keyTask: "資料夾:任務", keySend: "信封:訊息", keyReport: "紙張:回報", keyBroadcast: "喇叭:廣播",
|
|
126
148
|
tileLabel: "{0}({1})", openOffice: "開啟辦公室「{0}」", lobbyTile: "大廳格(不在任何辦公室)", lobbyEveryone: "每個成員都已在某間辦公室", overviewNoEdit: "請先選一間辦公室,再編輯辦公室或配置",
|
|
149
|
+
carousel: "輪播…", labelCarousel: "輪播:每間勾選的辦公室輪流佔滿畫面。空白鍵暫停;← 與 → 切換;F 切換全螢幕。",
|
|
150
|
+
carouselNoEdit: "請先離開輪播,再編輯辦公室或配置", pause: "暫停", resume: "播放", next: "下一間",
|
|
151
|
+
playing: "播放中", paused: "已暫停", interval: "間隔", intervalSec: "{0} 秒", intervalMin: "{0} 分鐘",
|
|
152
|
+
officesInCarousel: "輪播的辦公室",
|
|
153
|
+
officesCount: "輪播 {0}/{1} 間 ▾", selectAll: "全選", selectNone: "全不選",
|
|
127
154
|
dialogue: "對話框", dialogueTitle: "有人傳訊息給這裡的成員時,在下方的對話框顯示訊息與回覆(只限這個瀏覽器)",
|
|
128
|
-
dlgWorking: "處理中…", dlgSomeone: "有人", dlgHeardShare: "傳了一則訊息給 {0}。", dlgAnsweredShare: "已回覆。", dlgFile: "(傳了一個檔案)", dlgSays: "{0}:{1}",
|
|
155
|
+
dlgOpenChat: "在新視窗開啟這個 Agent 的聊天", dlgWorking: "處理中…", dlgSomeone: "有人", dlgHeardShare: "傳了一則訊息給 {0}。", dlgAnsweredShare: "已回覆。", dlgFile: "(傳了一個檔案)", dlgSays: "{0}:{1}",
|
|
129
156
|
dlgBox: "對話框:{0}。點一下看資料卡,點兩下開啟聊天。",
|
|
157
|
+
zones: "移到區域", zoneAll: "總覽", zoneN: "{0} {1}",
|
|
158
|
+
snacks: "零食", snackFeed: "餵給 {0}", snackPlace: "放在這裡",
|
|
159
|
+
snackArm: "{0}:拖到成員身上餵食,或放到空地讓閒置成員過來搶;點一下可選取",
|
|
130
160
|
},
|
|
131
161
|
});
|
|
132
162
|
const to = (k, ...v) => t(`orgo.${k}`, ...v);
|
|
163
|
+
/**
|
|
164
|
+
* #4010 follow-up: the carousel's offices as one n/m button, not inline checkboxes (those wrap the bar at ~10).
|
|
165
|
+
* Esc and a click outside close it; Select all / Select none sit above the scrollable list.
|
|
166
|
+
*/
|
|
167
|
+
function CarouselOffices({ stored, carIds, open, onOpen, onToggle, onAll, onNone }) {
|
|
168
|
+
const wrap = useRef(null);
|
|
169
|
+
useEffect(() => {
|
|
170
|
+
if (!open) return undefined;
|
|
171
|
+
const doc = globalThis.document;
|
|
172
|
+
const key = (e) => { if (e.key === "Escape") { e.preventDefault(); e.stopPropagation(); onOpen(false); } };
|
|
173
|
+
const press = (e) => { if (wrap.current && !wrap.current.contains(e.target)) onOpen(false); };
|
|
174
|
+
doc?.addEventListener?.("keydown", key, true);
|
|
175
|
+
doc?.addEventListener?.("pointerdown", press, true);
|
|
176
|
+
return () => { doc?.removeEventListener?.("keydown", key, true); doc?.removeEventListener?.("pointerdown", press, true); };
|
|
177
|
+
}, [open]);
|
|
178
|
+
const n = carIds.length, m = stored.length;
|
|
179
|
+
return html`<div class="oo-car-pick" ref=${wrap}>
|
|
180
|
+
<button type="button" class="btn btn-sm oo-car-offices" aria-haspopup="true" aria-expanded=${open ? "true" : "false"}
|
|
181
|
+
aria-label=${to("officesInCarousel")} onClick=${() => onOpen(!open)}>${to("officesCount", n, m)}</button>
|
|
182
|
+
${open ? html`<div class="oo-car-menu" role="group" aria-label=${to("officesInCarousel")}>
|
|
183
|
+
<div class="oo-car-menu-acts">
|
|
184
|
+
<button type="button" class="btn btn-sm oo-car-all" onClick=${onAll}>${to("selectAll")}</button>
|
|
185
|
+
<button type="button" class="btn btn-sm oo-car-none" onClick=${onNone}>${to("selectNone")}</button>
|
|
186
|
+
</div>
|
|
187
|
+
<div class="oo-carousel-offices">${stored.map((o) => html`<label key=${o.id} class="check"><input type="checkbox" checked=${carIds.includes(o.id)}
|
|
188
|
+
onChange=${() => onToggle(o.id)} /><span>${o.name}</span></label>`)}</div>
|
|
189
|
+
</div>` : null}
|
|
190
|
+
</div>`;
|
|
191
|
+
}
|
|
133
192
|
const CAPTION = { working: "capWorking", idle: "capIdle", paused: "capPaused", needs: "capNeeds", walk: "capIdle", away: "capAway" };
|
|
134
193
|
/** States whose pose is shared but whose words are their own (a queued instance is not asleep). */
|
|
135
194
|
const CAPTION_OF_STATE = { starting: "capStarting", queued: "capQueued" };
|
|
136
195
|
/** What a pose says in words (the tooltip, the desk list); `state`, when its words differ from its pose's. */
|
|
137
196
|
export const caption = (pose, state) => to(CAPTION_OF_STATE[state] || CAPTION[pose] || "capIdle");
|
|
138
197
|
|
|
198
|
+
/** M-3556: the most a dropdown starting at `top` may be tall to end `margin` px above `bottom` (never under `min`). */
|
|
199
|
+
export const popMaxHeight = (bottom, top, margin = 8, min = 96) => Math.max(min, Math.floor(bottom - top - margin));
|
|
139
200
|
const reducedMotion = () => typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
140
201
|
/** The device's ratio (CSS px → device px), kept sane. */
|
|
141
202
|
const deviceRatio = () => Math.max(0.5, Math.min(4, Number(globalThis.devicePixelRatio) || 1));
|
|
@@ -145,8 +206,34 @@ const SIZE0 = { w: 960, h: 600 };
|
|
|
145
206
|
const FIT_PAD = 60;
|
|
146
207
|
/** #2860: how far below its place a crowded area's compact tag drops when a neighbour's is in the way (a tag's height + 1). */
|
|
147
208
|
const COMPACT_ROW = 12;
|
|
209
|
+
/** M-3539: how far below its place a full name tag drops when another tag or an area's name is in the way (a tag's height + 2). */
|
|
210
|
+
const TAG_ROW = 16;
|
|
211
|
+
/** M-3539: the controls drawn over the scene that name tags keep clear of: the zoom stack, the minimap, and the phone's zone chips where they float over it. */
|
|
212
|
+
const KEEP_CLEAR = ".oo-zoom, .oo-mini, .oo-stage > .oo-zone-pills";
|
|
213
|
+
/** M-3539: those controls' boxes in the scene's logical units at the view `v` ({ k, x, y }: CSS px a unit, the origin), 4 CSS px round each. */
|
|
214
|
+
export function keepClearOf(cv, v) {
|
|
215
|
+
const root = cv && typeof cv.closest === "function" ? cv.closest(".oo") : null;
|
|
216
|
+
if (!root || typeof cv.getBoundingClientRect !== "function" || !(v.k > 0)) return [];
|
|
217
|
+
const c = cv.getBoundingClientRect(), out = [];
|
|
218
|
+
for (const el of root.querySelectorAll(KEEP_CLEAR)) {
|
|
219
|
+
const r = el.getBoundingClientRect();
|
|
220
|
+
if (!r.width || !r.height || r.right <= c.left || r.left >= c.right || r.bottom <= c.top || r.top >= c.bottom) continue;
|
|
221
|
+
out.push({ x: (r.left - c.left - 4 - v.x) / v.k, y: (r.top - c.top - 4 - v.y) / v.k, w: (r.width + 8) / v.k, h: (r.height + 8) / v.k });
|
|
222
|
+
}
|
|
223
|
+
return out;
|
|
224
|
+
}
|
|
225
|
+
/** Whether two boxes ({ x, y, w, h }) overlap. */
|
|
226
|
+
const overlaps = (a, b) => a.x < b.x + b.w && b.x < a.x + a.w && a.y < b.y + b.h && b.y < a.y + a.h;
|
|
227
|
+
/** M-3539: the box a person's figure covers where they are now (the skin's own, else the built-in figure's). */
|
|
228
|
+
const figureBox = (sk, q) => (sk.charBox ? sk.charBox(q.look, q.at) : { x: q.at.x - 24, y: q.at.y - 52, w: 48, h: 66 });
|
|
148
229
|
/** #2554: in All offices a tile's name tags show (always) from this many CSS px a unit up; below it on hover only. */
|
|
149
230
|
export const TAG_MIN_K = 0.75;
|
|
231
|
+
/**
|
|
232
|
+
* M-3665: one office below this zoom (a phone's whole office, about 30 %: a 10 px tag is 3 px on the page) draws no
|
|
233
|
+
* name tags but the hovered, focused or found one: the names are read in the people row over the stage's foot and on
|
|
234
|
+
* a person's card. A desk's fit keeps them (the Fleet's 70 % and up; a Hub room's 60 %).
|
|
235
|
+
*/
|
|
236
|
+
export const TAG_READ_K = 0.5;
|
|
150
237
|
const PAN_KEYS = { ArrowLeft: [-1, 0], ArrowRight: [1, 0], ArrowUp: [0, -1], ArrowDown: [0, 1] };
|
|
151
238
|
/** Typing: no single-key shortcut (the `f` of fullscreen) there. */
|
|
152
239
|
const typing = (el) => !!el && (el.tagName === "INPUT" || el.tagName === "SELECT" || el.tagName === "TEXTAREA" || el.isContentEditable === true);
|
|
@@ -176,11 +263,44 @@ const UP_MS = 1800;
|
|
|
176
263
|
const FIND_K = 2;
|
|
177
264
|
/** #2661: below this stage width (CSS px) the card is a bottom sheet. */
|
|
178
265
|
const SHEET_W = 560;
|
|
266
|
+
/** M-3633: the corner of an area its name takes (logical units, from the area's top left): a floating card keeps off it. */
|
|
267
|
+
const AREA_LABEL = { w: 320, h: 44 };
|
|
268
|
+
/**
|
|
269
|
+
* M-3253 (Argon's phone review): the Office's phone layout — a phone's width (the shell's), or a phone turned sideways (a
|
|
270
|
+
* coarse pointer in a short window: an iPhone's 956 × 440 is wider than 899 px). There the Office's tools are one ⋯ sheet,
|
|
271
|
+
* zone pills jump to a readable zoom, a tap near a person picks them, and their card is a bottom sheet.
|
|
272
|
+
*/
|
|
273
|
+
export const OFFICE_PHONE_Q = "(max-width: 899px), (pointer: coarse) and (max-height: 500px) and (max-width: 1023px)";
|
|
274
|
+
export function useOfficePhone() {
|
|
275
|
+
const read = () => { try { return typeof matchMedia === "function" && matchMedia(OFFICE_PHONE_Q).matches; } catch { return false; } };
|
|
276
|
+
const [on, setOn] = useState(read);
|
|
277
|
+
useEffect(() => {
|
|
278
|
+
if (typeof matchMedia !== "function") return undefined;
|
|
279
|
+
const mq = matchMedia(OFFICE_PHONE_Q), changed = () => setOn(!!mq.matches);
|
|
280
|
+
changed(); mq.addEventListener?.("change", changed);
|
|
281
|
+
return () => mq.removeEventListener?.("change", changed);
|
|
282
|
+
}, []);
|
|
283
|
+
return on;
|
|
284
|
+
}
|
|
285
|
+
/** M-3253: a tap this many CSS px from a person (a fingertip's 44 px across) picks them when nobody is right under it. */
|
|
286
|
+
export const TAP_R = 22;
|
|
287
|
+
/** M-3253: a zone pill's zoom (CSS px a logical unit): the name tags at their own size. */
|
|
288
|
+
export const ZONE_K = 1;
|
|
289
|
+
/** M-3253: of `list` ({ x, y } in logical units), the one nearest (x, y) within `r` logical units, or null. */
|
|
290
|
+
export function nearestPerson(list, x, y, r) {
|
|
291
|
+
let best = null, bestD = r * r;
|
|
292
|
+
for (const it of list) { const d = (it.x - x) ** 2 + (it.y - y) ** 2; if (d <= bestD) { bestD = d; best = it; } }
|
|
293
|
+
return best;
|
|
294
|
+
}
|
|
179
295
|
/** How often the picture can change when nothing is in the air (the poses loop at 4 fps; a bubble types faster). */
|
|
180
296
|
const FPS = 12;
|
|
297
|
+
/** At most this many frames a second while anyone walks or anything moves. */
|
|
298
|
+
const AIR_FPS = 30;
|
|
181
299
|
const STYLES = BUILT_IN_SKINS;
|
|
182
300
|
/** Paused and stopped: left out when "Hide paused and stopped" is on. */
|
|
183
301
|
const ASLEEP = new Set(["paused", "stopped"]);
|
|
302
|
+
/** A seat's standFacing (#4503) as a walk heading. */
|
|
303
|
+
const STAND_FACING = { up: { dx: 0, dy: -1 }, down: { dx: 0, dy: 1 }, left: { dx: -1, dy: 0 }, right: { dx: 1, dy: 0 } };
|
|
184
304
|
const BUBBLE_STATES = ["working", "idle", "paused", "stopped", "needs", "crashed", "stuck"];
|
|
185
305
|
/** The page's own bubble lines, by state, in its language (short, never message content). */
|
|
186
306
|
export const bubbleDefaults = () => Object.fromEntries(BUBBLE_STATES.map((s) => [s, to(`b_${s}`).split("|")]));
|
|
@@ -220,9 +340,25 @@ function looksOf(L, work, q, mode, zones, badge = () => null) {
|
|
|
220
340
|
// At night (#2568) the idle are drawn asleep (their state stays idle: the tooltip and the list say so).
|
|
221
341
|
return [d.key, { name: n.name, label: nodeText(n).primary, state: n.state, pose: officePose(d.night ? "paused" : n.state), night: !!d.night, light: lightOf(n.state), lamp: lampOf(n.state),
|
|
222
342
|
sign: zones ? null : signOf(n.state), coat: coatOf(n.i, n.i ? identityOf(n.i) : null, mode), work: work.get(n.name) || 0, dim: !!q && !match, match, free: zones,
|
|
223
|
-
badge: badge(n.name) }];
|
|
343
|
+
badge: badge(n.name), fit: n.i && n.i.tag_fit && typeof n.i.tag_fit === "object" ? n.i.tag_fit : null }];
|
|
224
344
|
}));
|
|
225
345
|
}
|
|
346
|
+
/**
|
|
347
|
+
* #4466: whoever's card is open (`carded`, the page's cardDesk) stands where they are now: `to` gets their place. Not
|
|
348
|
+
* while carried (the hold sets that), and not while calling (#4467 review: a caller walks to the Help desk as usual).
|
|
349
|
+
*/
|
|
350
|
+
export function cardStay(to, carded, held, walkers, t) {
|
|
351
|
+
if (!carded || !carded.walks || CALLING.has(carded.state) || (held && held.name === carded.name)) return;
|
|
352
|
+
const at = walkers.at(carded.name, t);
|
|
353
|
+
if (at) to.set(carded.name, { x: at.x, y: at.y });
|
|
354
|
+
}
|
|
355
|
+
/** `view` (buildOrgView's) with each renamed person's nickname set to the name this browser gives them. */
|
|
356
|
+
export function renamedView(view, renames) {
|
|
357
|
+
if (!view || !renames || !Object.keys(renames).length) return view;
|
|
358
|
+
const one = (n) => (n && n.i && Object.prototype.hasOwnProperty.call(renames, n.name) ? { ...n, i: { ...n.i, display_name: renames[n.name] } } : n);
|
|
359
|
+
return { ...view, top: (view.top || []).map(one), teams: (view.teams || []).map((t) => ({ ...t, nodes: (t.nodes || []).map(one) })),
|
|
360
|
+
rest: view.rest ? { ...view.rest, nodes: (view.rest.nodes || []).map(one) } : view.rest };
|
|
361
|
+
}
|
|
226
362
|
/** A stored office's own layout on a zones style (its overrides); `ignored`: they do not fit this style. */
|
|
227
363
|
function withOverrides(baseSkin, zones, office) {
|
|
228
364
|
const ov = zones && office ? office.overrides : null;
|
|
@@ -283,7 +419,7 @@ const hidingBox = (f) => {
|
|
|
283
419
|
/** #2698: name tags in one row centred on (x, y) — each { look, x } (its centre), TAG_GAP apart. */
|
|
284
420
|
const TAG_GAP = 4;
|
|
285
421
|
export function tagRow(ctx, x, y, looks) {
|
|
286
|
-
const ws = looks.map((l) => tagBox(ctx, x, y, l.label).w), total = ws.reduce((a, w) => a + w, 0) + TAG_GAP * Math.max(0, ws.length - 1);
|
|
422
|
+
const ws = looks.map((l) => tagBox(ctx, x, y, l.label, false, l.fit).w), total = ws.reduce((a, w) => a + w, 0) + TAG_GAP * Math.max(0, ws.length - 1);
|
|
287
423
|
let left = x - total / 2;
|
|
288
424
|
return looks.map((look, i) => { const cx = Math.round(left + ws[i] / 2); left += ws[i] + TAG_GAP; return { look, x: cx }; });
|
|
289
425
|
}
|
|
@@ -301,8 +437,36 @@ export function speakerAt(sk, look, at) {
|
|
|
301
437
|
}
|
|
302
438
|
/** The pose an area's seats are for: the first state (asleep, working, calling, idle) the pack sends there. */
|
|
303
439
|
const GHOST_POSE = [["paused", "paused"], ["stopped", "paused"], ["working", "working"], ["needs", "needs"], ["crashed", "needs"], ["stuck", "needs"], ["idle", "idle"]];
|
|
440
|
+
/** M-3533 R2c: how far inside its area's top edge a room character's speech bubble stays (scene units). */
|
|
441
|
+
const BUBBLE_IN_AREA = 8;
|
|
304
442
|
/** How faint Edit layout's figures are: seen through, yet readable over a busy picture (a dimmed person is 0.35). */
|
|
305
443
|
const GHOST_ALPHA = 0.6;
|
|
444
|
+
/**
|
|
445
|
+
* M-3665: stopped — or, in a Hub room, an agent whose computer is offline — is not the same as paused, though both
|
|
446
|
+
* doze in the nap corner. A paused person is drawn as ever (its Zzz); a stopped one faded (OFF_ALPHA) with a small
|
|
447
|
+
* power-off mark beside it, on every style and every pack (the pack's own paused strip draws both).
|
|
448
|
+
*/
|
|
449
|
+
const OFF_ALPHA = 0.45;
|
|
450
|
+
export const offLook = (look) => !!look && look.state === "stopped" && look.pose !== "away";
|
|
451
|
+
export function drawOffMark(ctx, x, y, env) {
|
|
452
|
+
const pal = (env && env.pal) || {}, r = 6;
|
|
453
|
+
ctx.save();
|
|
454
|
+
ctx.globalAlpha = 1;
|
|
455
|
+
ctx.fillStyle = pal.surface || "#2f2f2f"; ctx.strokeStyle = pal.text3 || "#bbbbbb"; ctx.lineWidth = 1.2;
|
|
456
|
+
ctx.beginPath(); ctx.arc(x, y, r + 2, 0, Math.PI * 2); ctx.fill(); ctx.stroke();
|
|
457
|
+
ctx.strokeStyle = pal.text2 || "#cfcfcf"; ctx.lineWidth = 1.6; ctx.lineCap = "round";
|
|
458
|
+
ctx.beginPath(); ctx.arc(x, y + 0.5, r - 2, -Math.PI / 2 + 0.75, Math.PI * 1.5 - 0.75); ctx.stroke(); // the power symbol's ring…
|
|
459
|
+
ctx.beginPath(); ctx.moveTo(x, y - r + 1); ctx.lineTo(x, y - 0.5); ctx.stroke(); // …and its bar
|
|
460
|
+
ctx.restore();
|
|
461
|
+
}
|
|
462
|
+
/** A person drawn by the skin; stopped (offline): faded, with the power-off mark at (mx, my). */
|
|
463
|
+
function drawPerson(ctx, sk, box, look, ms, env, mx, my, markScale = 1) {
|
|
464
|
+
if (!offLook(look)) { sk.drawCharacter(ctx, box, look, ms, env); return; }
|
|
465
|
+
ctx.save(); ctx.globalAlpha *= OFF_ALPHA; sk.drawCharacter(ctx, box, look, ms, env); ctx.restore();
|
|
466
|
+
// M-3665 (leader's check): zoomed out past TAG_READ_K the mark keeps its size at TAG_READ_K, centred where it was.
|
|
467
|
+
if (markScale === 1) { drawOffMark(ctx, mx, my, env); return; }
|
|
468
|
+
ctx.save(); ctx.translate(mx, my); ctx.scale(markScale, markScale); drawOffMark(ctx, 0, 0, env); ctx.restore();
|
|
469
|
+
}
|
|
306
470
|
/** Edit layout's faint figures: one on each seat no one is on, { x, y, look } (the pack's default set; drawn at GHOST_ALPHA). */
|
|
307
471
|
export function ghostsOf(pack, people = []) {
|
|
308
472
|
const taken = (s) => people.some((q) => Math.abs(q.at.x - s.x) < 2 && Math.abs(q.at.y - s.y) < 2);
|
|
@@ -331,6 +495,31 @@ export function actLive(a, state, at = Date.now(), seen = null) {
|
|
|
331
495
|
if (state !== "working") { seen.add(k); return true; }
|
|
332
496
|
return !seen.has(k) && (!a.state || a.state === "working");
|
|
333
497
|
}
|
|
498
|
+
/**
|
|
499
|
+
* Whether an agent's ride (office_set `ride`) holds now: set and not past its end, the person neither asleep nor calling
|
|
500
|
+
* (#4415: nothing keeps a caller from the Help desk; the ride resumes when the call is over). Working or a new turn do
|
|
501
|
+
* not end it (it is where they choose to be); clearing it, a new office_set or its end do.
|
|
502
|
+
*/
|
|
503
|
+
/**
|
|
504
|
+
* #4503: the vehicle whose seat names `name` as its `worker`, while they are working (any other state, a call above
|
|
505
|
+
* all, is null: they go where that state sends them, the Help desk for a call, as anyone does); else null. Here, not in
|
|
506
|
+
* fleet-office-vehicles.js: a tab opened before an upgrade may keep that module, and a named import it lacks would stop
|
|
507
|
+
* this one linking (#4505 review). The riders' `waitingFor` is optional for the same reason (`p.waitingFor ?`).
|
|
508
|
+
*/
|
|
509
|
+
export const workVehicleOf = (vehicles, name, state) => (state === "working" ? (vehicles.find((v) => v.seats.some((s) => s.worker === name)) || {}).id ?? null : null);
|
|
510
|
+
/**
|
|
511
|
+
* #4504: what the card's pose preview offers — every pose a character set may draw, walking by direction. Here, not in
|
|
512
|
+
* fleet-office-pack.js: a tab opened before an upgrade may keep that module, and a named import it lacks would stop this
|
|
513
|
+
* one linking (#4505/#4508 review).
|
|
514
|
+
*/
|
|
515
|
+
export const PREVIEW_POSES = ["idle", "working", "paused", "needs", "walkDown", "walkUp", "walkSide", "walkLeft", "eat", "pat", "dragged", "stand"];
|
|
516
|
+
const PREVIEW_HEADINGS = { walkDown: { dx: 0, dy: 1 }, walkUp: { dx: 0, dy: -1 }, walkSide: { dx: 1, dy: 0 }, walkLeft: { dx: -1, dy: 0 } };
|
|
517
|
+
/** A look showing `pose` in place (a walking direction walks on the spot); a set without that strip shows its own pose. */
|
|
518
|
+
export function previewLook(look, pose) {
|
|
519
|
+
const heading = PREVIEW_HEADINGS[pose];
|
|
520
|
+
return heading ? { ...look, pose: "walk", heading } : { ...look, pose, basePose: look.pose };
|
|
521
|
+
}
|
|
522
|
+
export const rideLive = (a, state, at = Date.now()) => !!a && !!a.ride && at < a.until && !ASLEEP.has(state) && !CALLING.has(state);
|
|
334
523
|
/** How far beside the person an agent going to them stands. */
|
|
335
524
|
const ACT_BESIDE = 48;
|
|
336
525
|
/** Where an agent's act sends it at `t`: its point, beside the person it goes to (where they are now), or null. */
|
|
@@ -372,34 +561,74 @@ function paintLayers(p, env, ls, tagsOff = false) {
|
|
|
372
561
|
for (const r of L.rooms) skin.drawRoom(g, r, env);
|
|
373
562
|
for (const d of all) skin.drawDeskBack(g, d, looks.get(d.key), env);
|
|
374
563
|
});
|
|
375
|
-
|
|
376
|
-
|
|
564
|
+
// Zones: the pack's foreground, painted once at the layer's scale (it was drawn from the full picture every frame).
|
|
565
|
+
const front = zones ? (skin.pack && skin.pack.foreground && skin.drawForeground ? layer((g) => skin.drawForeground(g, L, env)) : null) : layer((g) => {
|
|
566
|
+
for (const d of all) { const lk = looks.get(d.key); skin.drawDeskFront(g, d, !tagsOff || !lk || lk.match ? lk : tagsOff === "names" && CALLING.has(lk.state) ? { ...lk, badge: null } : { ...lk, notag: true }, env); }
|
|
377
567
|
});
|
|
378
568
|
return { ls, tagsOff, back, front };
|
|
379
569
|
}
|
|
570
|
+
/** Final painted bubbles, topmost first; touch adds a 44 CSS-pixel target without changing the drawing. */
|
|
571
|
+
export function officeBubbleAt(hits, x, y, minSize = 0) {
|
|
572
|
+
const reversed = [...hits].reverse();
|
|
573
|
+
const exact = reversed.find(({ box: b }) => x >= b.x && y >= b.y && x <= b.x + b.w && y <= b.y + b.h);
|
|
574
|
+
if (exact || !minSize) return exact || null;
|
|
575
|
+
let nearest = null, distance = Infinity;
|
|
576
|
+
for (const hit of reversed) {
|
|
577
|
+
const b = hit.box, dx = x - b.x - b.w / 2, dy = y - b.y - b.h / 2;
|
|
578
|
+
if (Math.abs(dx) <= Math.max(minSize, b.w) / 2 && Math.abs(dy) <= Math.max(minSize, b.h) / 2 && dx * dx + dy * dy < distance) {
|
|
579
|
+
nearest = hit; distance = dx * dx + dy * dy;
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
return nearest;
|
|
583
|
+
}
|
|
380
584
|
/**
|
|
381
585
|
* One frame of a scene at `ms` (0: still), a logical unit `a` bitmap px, its origin at (ox, oy); `hot`: the desk key
|
|
382
586
|
* hovered (its name tag shows even in a crowd); `tagsOff` (#2554: a tile too small to read them): the name tags show
|
|
383
587
|
* only for the one hovered and the Find box's matches. Whether anything in it is moving (in the air, or someone walking).
|
|
384
588
|
*/
|
|
385
|
-
export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false, defer = null) {
|
|
589
|
+
export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false, defer = null, bubbleHits = null) {
|
|
386
590
|
const sk = p.skin;
|
|
387
591
|
const ls = layerScale(a, p.L.width, p.L.height);
|
|
388
|
-
|
|
592
|
+
// M-3665: the view's CSS zoom (a is bitmap px a unit: the zoom × the device ratio, Prism #4423). Below TAG_READ_K what must
|
|
593
|
+
// stay readable is drawn larger: the offline mark readScale times (its size at TAG_READ_K), a caller's tag callerScale.
|
|
594
|
+
const zk = a / ((env && env.ratio) || 1), readScale = zk < TAG_READ_K ? TAG_READ_K / zk : 1;
|
|
595
|
+
// A caller's tag at its full size (1×: the leader's call, "who needs you at a glance"); other floors stay at TAG_READ_K.
|
|
596
|
+
const callerScale = zk < 1 ? 1 / zk : 1;
|
|
597
|
+
// Zones zoomed in past the layers' budget (a big pack): the layer would be coarser than the screen and the picture,
|
|
598
|
+
// so the background and foreground are drawn from their pictures instead (only the part on screen is rasterised).
|
|
599
|
+
const direct = !!p.zones && ls < a - 1e-6;
|
|
600
|
+
if (!direct && (!p.layers || p.layers.ls !== ls || p.layers.tagsOff !== tagsOff)) p.layers = paintLayers(p, env, ls, tagsOff);
|
|
389
601
|
const T = () => ctx.setTransform(a, 0, 0, a, ox, oy);
|
|
390
602
|
const blit = (c) => { if (!c) return; ctx.setTransform(a / ls, 0, 0, a / ls, ox, oy); ctx.drawImage(c, 0, 0); T(); };
|
|
391
|
-
|
|
603
|
+
if (direct) { T(); ctx.fillStyle = env.pal.bg; ctx.fillRect(0, 0, p.L.width, p.L.height); sk.drawBackground(ctx, p.L, env); }
|
|
604
|
+
else blit(p.layers.back);
|
|
392
605
|
T();
|
|
393
|
-
const speakers = [], tags = [];
|
|
606
|
+
const speakers = [], tags = [], titleBoxes = []; // M-3539: the area names bubbles keep off too
|
|
607
|
+
const titleDraws = []; // M-3722: and redrawn over a bubble's tail that crosses one
|
|
394
608
|
const up = still ? [] : p.flights.frame(ms, p.L);
|
|
395
609
|
// Mail from another office (#2564): flying in at the door, or on the floor until its person picks it up.
|
|
396
610
|
const post = still || !p.mail || !p.zones ? [] : p.mail.frame(ms > 0 ? ms : now(), p.L, p.walkers);
|
|
397
|
-
let walking = false;
|
|
611
|
+
let walking = false, carsOn = false;
|
|
398
612
|
if (p.zones) {
|
|
399
613
|
// Furniture under the people; the people (nearest last) with the furniture whose depth is "y" among them, by base
|
|
400
614
|
// y (a tie: the item first, the person in front); furniture over them; things in the air; the pack's foreground
|
|
401
615
|
// (door frames, pillars, table fronts); then what must stay readable: crowd counts and name tags (bubbles below).
|
|
402
616
|
const t = ms > 0 ? ms : now(), live = furnitureAt(p, t);
|
|
617
|
+
const draggedHeld = p.hold ? p.hold.held() : null;
|
|
618
|
+
const heldName = draggedHeld ? draggedHeld.name : null;
|
|
619
|
+
if (!still && ms > 0 && p.snacks) {
|
|
620
|
+
const snackHidden = heldName ? new Map(live.hidden).set(heldName, "__held__") : live.hidden;
|
|
621
|
+
const changed = p.snacks.step(t, {
|
|
622
|
+
desks: p.desks, walkers: p.walkers, hidden: snackHidden, ownArea: !!p.ownArea,
|
|
623
|
+
areas: p.L.areas, graph: p.L, snacksById: p.snacksById,
|
|
624
|
+
charEatOf: (n) => (sk.eatStrip ? sk.eatStrip(n) : null),
|
|
625
|
+
onClaim: p.onSnackClaim,
|
|
626
|
+
});
|
|
627
|
+
if (changed && typeof p.onSnacksChanged === "function") p.onSnacksChanged();
|
|
628
|
+
}
|
|
629
|
+
// Off screen (the canvas in logical units, with room for the tallest sprite and its bubble): not drawn.
|
|
630
|
+
const cw = ctx.canvas && ctx.canvas.width, chh = ctx.canvas && ctx.canvas.height, M = 320;
|
|
631
|
+
const offView = cw ? (at) => at.x < -ox / a - M || at.x > (cw - ox) / a + M || at.y < -oy / a - M / 4 || at.y > (chh - oy) / a + M : () => false;
|
|
403
632
|
const people = p.desks.map((d) => {
|
|
404
633
|
const at = p.walkers.at(d.node.name, t) || { ...d.seat, walking: false };
|
|
405
634
|
if (at.walking) walking = true;
|
|
@@ -407,44 +636,206 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
|
|
|
407
636
|
}).sort((x, y) => x.at.y - y.at.y);
|
|
408
637
|
const furniture = strollFurniture(p.night ? nightFurniture(sk.pack.furniture) : sk.pack.furniture, (k) => p.walkers.at(k, t));
|
|
409
638
|
if (furniture.some((f) => f.walking)) walking = true;
|
|
410
|
-
const
|
|
639
|
+
const placedSnacks = p.snacks ? p.snacks.placedList() : [];
|
|
640
|
+
const wall = Date.now(), cars = (sk.pack.vehicles || []).map((v) => ({ v, at: vehicleAt(v, wall) }));
|
|
641
|
+
carsOn = cars.length > 0;
|
|
642
|
+
const band = [...furniture.filter((f) => f.depth === "y").map((f) => ({ y: f.y, k: 0, f })),
|
|
643
|
+
...cars.map((c) => ({ y: c.at.y, k: 0.8, car: c })),
|
|
644
|
+
...cars.map((c) => ({ y: Math.max(c.at.y, ...people.filter((q) => q.at.riding && p.riding && (p.riding(q.look.name) || {}).vehicle === c.v.id).map((q) => q.at.y)), k: 1.5, front: c })),
|
|
645
|
+
...placedSnacks.map((sn) => ({ y: sn.y, k: 0.5, sn })),
|
|
646
|
+
...people.map((q) => ({ y: q.at.y, k: 1, p: q })),
|
|
411
647
|
...(p.ghosts ? ghostsOf(sk.pack, people).map((g) => ({ y: g.y, k: 1, g })) : []),
|
|
412
648
|
// #2665: by day, each item's night place too (at night the items are there already).
|
|
413
649
|
...(p.ghosts && !p.night ? nightGhostsOf(sk.pack).map((n) => ({ y: n.y, k: 1, n })) : [])]
|
|
414
650
|
.sort((x, y) => x.y - y.y || x.k - y.k);
|
|
651
|
+
// M-3432 (#4255) & M-3445 (#4266): draw drop-target rings above the floor layer only, never over furniture or characters.
|
|
652
|
+
const drop = p.snackDrop && p.snackDrop.current;
|
|
653
|
+
if (drop && drop.kind === "place") {
|
|
654
|
+
ctx.save();
|
|
655
|
+
ctx.fillStyle = "rgba(0, 0, 0, 0.16)";
|
|
656
|
+
ctx.beginPath(); ctx.ellipse(drop.x, drop.y, 16, 7, 0, 0, Math.PI * 2); ctx.fill();
|
|
657
|
+
ctx.strokeStyle = env.pal.accent; ctx.lineWidth = 1.5; ctx.setLineDash([4, 3]);
|
|
658
|
+
ctx.beginPath(); ctx.ellipse(drop.x, drop.y, 16, 7, 0, 0, Math.PI * 2); ctx.stroke();
|
|
659
|
+
ctx.restore();
|
|
660
|
+
} else if (drop && drop.kind === "feed") {
|
|
661
|
+
const target = people.find((q) => q.look.name === drop.name && !live.hidden.has(q.look.name));
|
|
662
|
+
if (target) {
|
|
663
|
+
ctx.save();
|
|
664
|
+
ctx.fillStyle = env.pal.accentDim;
|
|
665
|
+
ctx.beginPath(); ctx.ellipse(target.at.x, target.at.y, 24, 10, 0, 0, Math.PI * 2); ctx.fill();
|
|
666
|
+
ctx.strokeStyle = env.pal.accent; ctx.lineWidth = 2;
|
|
667
|
+
ctx.beginPath(); ctx.ellipse(target.at.x, target.at.y, 24, 10, 0, 0, Math.PI * 2); ctx.stroke();
|
|
668
|
+
ctx.restore();
|
|
669
|
+
}
|
|
670
|
+
}
|
|
671
|
+
const seatDrop = heldName && p.seatDrop ? p.seatDrop.current : null;
|
|
672
|
+
if (seatDrop && seatDrop.name === heldName && Array.isArray(seatDrop.targets)) {
|
|
673
|
+
for (const st of seatDrop.targets) {
|
|
674
|
+
if (st.current) continue;
|
|
675
|
+
const isHover = !!seatDrop.hover && seatDrop.hover.area === st.area && seatDrop.hover.slot === st.slot;
|
|
676
|
+
ctx.save();
|
|
677
|
+
if (isHover) {
|
|
678
|
+
ctx.fillStyle = env.pal.accentDim;
|
|
679
|
+
ctx.beginPath(); ctx.ellipse(st.x, st.y, 26, 11, 0, 0, Math.PI * 2); ctx.fill();
|
|
680
|
+
ctx.strokeStyle = "rgba(0, 0, 0, 0.38)"; ctx.lineWidth = 4.5;
|
|
681
|
+
ctx.beginPath(); ctx.ellipse(st.x, st.y, 26, 11, 0, 0, Math.PI * 2); ctx.stroke();
|
|
682
|
+
ctx.strokeStyle = env.pal.accent; ctx.lineWidth = 2.5;
|
|
683
|
+
ctx.beginPath(); ctx.ellipse(st.x, st.y, 26, 11, 0, 0, Math.PI * 2); ctx.stroke();
|
|
684
|
+
} else {
|
|
685
|
+
ctx.globalAlpha = 0.9;
|
|
686
|
+
ctx.fillStyle = env.pal.accentDim;
|
|
687
|
+
ctx.beginPath(); ctx.ellipse(st.x, st.y, 22, 10, 0, 0, Math.PI * 2); ctx.fill();
|
|
688
|
+
ctx.strokeStyle = "rgba(0, 0, 0, 0.35)"; ctx.lineWidth = 3.5;
|
|
689
|
+
ctx.beginPath(); ctx.ellipse(st.x, st.y, 22, 10, 0, 0, Math.PI * 2); ctx.stroke();
|
|
690
|
+
ctx.strokeStyle = env.pal.accent; ctx.lineWidth = 2; ctx.setLineDash([5, 3]);
|
|
691
|
+
ctx.beginPath(); ctx.ellipse(st.x, st.y, 22, 10, 0, 0, Math.PI * 2); ctx.stroke();
|
|
692
|
+
}
|
|
693
|
+
ctx.restore();
|
|
694
|
+
}
|
|
695
|
+
}
|
|
415
696
|
for (const f of furniture) if (f.depth !== "y" && f.depth < CHAR_DEPTH) sk.drawFurniture(ctx, f, f.asleep || live.active.has(f.id), ms, env);
|
|
416
697
|
for (const it of post) if (it.t === 0) sk.drawProp(ctx, it, ms, env); // a letter on the floor: under the people
|
|
417
|
-
|
|
698
|
+
let heldPerson = null;
|
|
699
|
+
for (const { f, p: q, g, n, sn, car, front } of band) {
|
|
700
|
+
if (car) { if (sk.drawVehicle) sk.drawVehicle(ctx, car.v, car.at, ms, env); continue; }
|
|
701
|
+
if (front) { if (sk.drawVehicleFront) sk.drawVehicleFront(ctx, front.v, front.at, ms, env); continue; }
|
|
418
702
|
if (f) { sk.drawFurniture(ctx, f, f.asleep || live.active.has(f.id), ms, env); continue; }
|
|
703
|
+
if (sn) {
|
|
704
|
+
const sdef = p.snacksById && p.snacksById.get(sn.snackId);
|
|
705
|
+
if (sdef && sk.drawSnack) {
|
|
706
|
+
ctx.save();
|
|
707
|
+
ctx.fillStyle = "rgba(0, 0, 0, 0.22)";
|
|
708
|
+
ctx.beginPath(); ctx.ellipse(sn.x, sn.y + 1, Math.max(8, Math.round(sdef.sprite.dw * 0.38)), 4, 0, 0, Math.PI * 2); ctx.fill();
|
|
709
|
+
ctx.restore();
|
|
710
|
+
sk.drawSnack(ctx, sdef.sprite, ms, sn.x, sn.y, env, `sn:${sn.id}`);
|
|
711
|
+
}
|
|
712
|
+
continue;
|
|
713
|
+
}
|
|
419
714
|
if (n) { ctx.save(); ctx.globalAlpha = GHOST_ALPHA; sk.drawFurniture(ctx, n, true, 0, env); ctx.restore(); continue; }
|
|
420
715
|
if (g) { ctx.save(); ctx.globalAlpha = GHOST_ALPHA; sk.drawCharacter(ctx, { x: g.x - 44, y: g.y - 53, w: 88, h: 53, seat: g }, g.look, 0, env); ctx.restore(); continue; }
|
|
716
|
+
if (heldName && q.look.name === heldName) { heldPerson = q; continue; } // M-3445 (#4267): drawn lifted on top below
|
|
421
717
|
if (live.hidden.has(q.look.name)) continue; // #2698: drawn as the item (never while walking)
|
|
718
|
+
if (offView(q.at)) continue;
|
|
422
719
|
const box = { ...q.d, x: q.at.x - 44, y: q.at.y - 53, w: 88, h: 53, seat: { x: q.at.x, y: q.at.y } };
|
|
423
|
-
// An agent's own pose (office_set, #2578) while its act lasts and nothing calls it; walking is walking.
|
|
720
|
+
// An agent's own pose (office_set, #2578) while its act lasts and nothing calls it; walking is walking; M-3432: eating when fed.
|
|
424
721
|
const posed = actPosed(p, q.look);
|
|
425
|
-
const
|
|
426
|
-
|
|
427
|
-
|
|
722
|
+
const eating = !q.at.walking && p.snacks && ms > 0 ? p.snacks.eatingOf(q.look.name, t) : null;
|
|
723
|
+
const canEat = !!eating && !CALLING.has(q.look.state) && !ASLEEP.has(q.look.state) && !q.look.night;
|
|
724
|
+
// A pat shows the set's `pat` strip for one full pass of it (pat.until), each pat from frame 0; a set without one keeps its pose.
|
|
725
|
+
const canPat = !q.at.walking && !canEat && ms > 0 && !!p.reacts && !CALLING.has(q.look.state) && !ASLEEP.has(q.look.state) && !q.look.night;
|
|
726
|
+
const patted = canPat ? patLook(posed, p.reacts.get(q.look.name), t) : null;
|
|
727
|
+
// #4503: working but not typing — at a standing desk (its seat's standFacing), or waiting for their train (facing
|
|
728
|
+
// where it stops) — they stand: their walk strip's first frame, that way.
|
|
729
|
+
const track = !q.at.walking && !q.at.riding && posed.pose === "working" && p.waitingFor ? p.waitingFor(q.look.name) : null;
|
|
730
|
+
const stand = q.at.walking || q.at.riding || posed.pose !== "working" ? null
|
|
731
|
+
: track ? (track.x !== q.at.x || track.y !== q.at.y ? { dx: track.x - q.at.x, dy: track.y - q.at.y } : null)
|
|
732
|
+
: q.d.seat && q.d.seat.standFacing && q.at.x === q.d.seat.x && q.at.y === q.d.seat.y ? STAND_FACING[q.d.seat.standFacing] : null;
|
|
733
|
+
const look0 = q.at.walking ? { ...q.look, pose: "walk", heading: q.at.heading }
|
|
734
|
+
: canEat ? { ...posed, pose: "eat", basePose: posed.pose }
|
|
735
|
+
: patted || (stand ? { ...posed, pose: "walk", heading: stand } : posed);
|
|
736
|
+
// #4504: the card's pose preview (this viewer's own): the picked pose in place, from its first frame (`clip`:
|
|
737
|
+
// Replay starts it again). Never over a call: a caller shows that they call, preview or not.
|
|
738
|
+
const pv = p.preview && p.preview.current;
|
|
739
|
+
const previewing = pv && pv.name === q.look.name && !q.at.walking && !CALLING.has(q.look.state);
|
|
740
|
+
const look = previewing ? { ...previewLook(posed, pv.pose), clip: `#${pv.t0}` } : look0;
|
|
741
|
+
drawPerson(ctx, sk, box, look, !previewing && stand && look.pose === "walk" ? 0 : ms, env, q.at.x + 20, q.at.y - 34, readScale);
|
|
742
|
+
if (canEat && eating.snackId && p.snacksById && sk.drawSnack) {
|
|
743
|
+
const sdef = p.snacksById.get(eating.snackId);
|
|
744
|
+
if (sdef && sdef.eat) sk.drawSnack(ctx, sdef.eat, Math.max(0, t - eating.t0), q.at.x, q.at.y, env);
|
|
745
|
+
}
|
|
746
|
+
if (!q.at.walking || (p.snacks && ms > 0 && p.snacks.scatterOf(q.look.name, t))) {
|
|
747
|
+
speakers.push({ look: q.look, ...speakerAt(sk, look, q.at), area: q.d.area });
|
|
748
|
+
}
|
|
428
749
|
}
|
|
429
750
|
for (const f of furniture) if (f.depth !== "y" && f.depth >= CHAR_DEPTH) sk.drawFurniture(ctx, f, f.asleep || live.active.has(f.id), ms, env);
|
|
751
|
+
// M-3445 (#4267): the character currently being dragged renders lifted above furniture and other characters in its `dragged` pose.
|
|
752
|
+
if (heldPerson) {
|
|
753
|
+
const box = { ...heldPerson.d, x: heldPerson.at.x - 44, y: heldPerson.at.y - 53, w: 88, h: 53, seat: { x: heldPerson.at.x, y: heldPerson.at.y } };
|
|
754
|
+
const posed = actPosed(p, heldPerson.look);
|
|
755
|
+
sk.drawCharacter(ctx, box, { ...posed, pose: "dragged", basePose: posed.pose }, ms, env);
|
|
756
|
+
}
|
|
430
757
|
for (const it of up) sk.drawProp(ctx, it, ms, env);
|
|
431
758
|
for (const it of post) if (it.t > 0) sk.drawProp(ctx, it, ms, env);
|
|
432
|
-
if (sk.drawForeground) sk.drawForeground(ctx, p.L, env);
|
|
759
|
+
if (direct) { if (sk.pack && sk.pack.foreground && sk.drawForeground) sk.drawForeground(ctx, p.L, env); }
|
|
760
|
+
else if (p.layers.front) blit(p.layers.front);
|
|
433
761
|
// Who found no spot in an area: a count in its corner (never over its name).
|
|
434
762
|
for (const [ar, n] of p.L.crowd || []) if (p.L.areas[ar] && sk.drawCrowd) sk.drawCrowd(ctx, p.L.areas[ar], n, env);
|
|
435
|
-
//
|
|
436
|
-
|
|
437
|
-
|
|
763
|
+
// M-3539: an area's name a figure stands on is written again over the people (休息區 under a crowd's heads).
|
|
764
|
+
const titles = sk.areaTitleBox ? Object.values(p.L.areas || {}).map((ar) => ({ ar, box: sk.areaTitleBox(ctx, ar, env) })) : [];
|
|
765
|
+
if (sk.drawAreaTitle) for (const { ar, box } of titles) {
|
|
766
|
+
if (people.some((q) => !live.hidden.has(q.look.name) && overlaps(figureBox(sk, q), box))) sk.drawAreaTitle(ctx, ar, env);
|
|
767
|
+
}
|
|
768
|
+
// Name tags never cover each other, an area's name or what the page keeps clear over the scene (`env.keepClear`:
|
|
769
|
+
// the zoom control, M-3539). In an area over capacity (#2513: a crowd's full tags covered each other) everyone keeps
|
|
770
|
+
// a compact tag (#2860: in Cozy, the default, most of a fleet is in a crowd, and hover-only hid names and levels).
|
|
771
|
+
// The full tags go first: the one hovered or found, then the people at their place, then those walking (a stroll
|
|
772
|
+
// passes others' tags, M-3539); each where it is, else a row lower, else compact (there, then a row lower); one
|
|
773
|
+
// that fits nowhere is left to hover or focus. Then an item's own name and the row it carries; then the crowd's.
|
|
438
774
|
const over = p.L.over || new Set();
|
|
439
|
-
const
|
|
440
|
-
const
|
|
775
|
+
const pinned = (q) => q.d.key === hot || !!q.look.match;
|
|
776
|
+
const crowded = (q) => over.has(q.d.area) && !pinned(q);
|
|
777
|
+
// M-3665 (leader's check): too far out to read (tagsOff true), a caller still says who they are on the map — their tag
|
|
778
|
+
// at its full size (1×), where they stand (the chip row below lists them too). Drawn after the tags, below.
|
|
779
|
+
const beaconOn = tagsOff === true && readScale > 1;
|
|
780
|
+
const beacon = (q) => beaconOn && CALLING.has(q.look.state);
|
|
781
|
+
// A caller keeps their tag with names hidden (#4467 review): the Help desk always says who needs you.
|
|
782
|
+
const tagged = (q) => !beacon(q) && (pinned(q) || (tagsOff === "names" && CALLING.has(q.look.state)) || !(tagsOff || over.has(q.d.area)));
|
|
783
|
+
// Names hidden: a caller's tag is their name only; the level stays hidden (the one hovered or found keeps it).
|
|
784
|
+
const tagLook = (q) => (tagsOff === "names" && !pinned(q) && q.look.badge ? { ...q.look, badge: null } : q.look);
|
|
785
|
+
const keep = [...titles.map((x) => x.box), ...(env.keepClear || [])];
|
|
786
|
+
titleBoxes.push(...titles.map((x) => x.box)); titleDraws.push(...titles);
|
|
441
787
|
const taken = [];
|
|
442
|
-
const touches = (b) => taken.some((o) => b
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
788
|
+
const touches = (b) => taken.some((o) => overlaps(b, o)) || keep.some((o) => overlaps(b, o));
|
|
789
|
+
// Under an open card (`p.cover`, bitmap px; #4379 review): no tag, its level badge included, rather than a piece of one
|
|
790
|
+
// past the card's edge — a forced one (hovered, found) too.
|
|
791
|
+
const cv = p.cover ? { x: (p.cover.x - ox) / a, y: (p.cover.y - oy) / a, w: p.cover.w / a, h: p.cover.h / a } : null;
|
|
792
|
+
const covered = (b) => !!cv && overlaps(b, cv);
|
|
793
|
+
/**
|
|
794
|
+
* Draws `look`'s tag at (x, y) at the first of `tries` ([dy, compact]) clear of the others; `force`: at the first.
|
|
795
|
+
* None clear: slid sideways just past what it would touch of `keep` (an area's name, the minimap: never another
|
|
796
|
+
* tag), at most its own width, at its place — so a name beside the minimap reads instead of going (leader's check).
|
|
797
|
+
*/
|
|
798
|
+
const place = (x0, y, look, tries, force = false) => {
|
|
799
|
+
// M-3539: a tag stays within the sides of the area its person stands in (a wide name at a lounge's first column
|
|
800
|
+
// poked past its edge): moved in by what it would stick out.
|
|
801
|
+
const ar = Object.values(p.L.areas || {}).find((a) => a.rect && x0 >= a.rect.x && x0 <= a.rect.x + a.rect.w && y >= a.rect.y && y <= a.rect.y + a.rect.h);
|
|
802
|
+
const w0 = tagBox(ctx, x0, y, look.label, false, look.fit).w, x = !ar ? x0 : Math.min(Math.max(x0, ar.rect.x + 2 + w0 / 2), ar.rect.x + ar.rect.w - 2 - w0 / 2);
|
|
803
|
+
const at = (dx, dy, compact) => {
|
|
804
|
+
const box = tagBox(ctx, x + dx, y + dy, look.label, compact, look.fit), foot = tagFootprint(ctx, box, look.badge, compact);
|
|
805
|
+
if (covered(foot)) return null;
|
|
806
|
+
if (!force && touches(foot)) return null;
|
|
807
|
+
// Every place tried keeps within the area's sides, a slide's too (#4376 review): none there, hover or focus.
|
|
808
|
+
if (!force && ar && (box.x < ar.rect.x || box.x + box.w > ar.rect.x + ar.rect.w)) return null;
|
|
809
|
+
sk.drawTag(ctx, x + dx, y + dy, look, env, compact);
|
|
810
|
+
tags.push(box); taken.push(foot);
|
|
811
|
+
return box;
|
|
812
|
+
};
|
|
813
|
+
for (const [dy, compact] of tries) { const b = at(0, dy, compact); if (b) return b; }
|
|
814
|
+
const [dy0, c0] = tries[0], b0 = tagFootprint(ctx, tagBox(ctx, x, y + dy0, look.label, c0, look.fit), look.badge, c0);
|
|
815
|
+
for (const o of keep.filter((k) => overlaps(b0, k))) {
|
|
816
|
+
for (const dx of [o.x - (b0.x + b0.w) - 2, o.x + o.w - b0.x + 2]) if (Math.abs(dx) <= b0.w) { const b = at(dx, dy0, c0); if (b) return b; }
|
|
817
|
+
}
|
|
818
|
+
return null;
|
|
819
|
+
};
|
|
820
|
+
const FULL_TRIES = [[0, false], [TAG_ROW, false], [0, true], [COMPACT_ROW, true]];
|
|
821
|
+
const tagOrder = people.filter((q) => !(live.hidden.has(q.look.name) && q.look.name !== heldName) && tagged(q))
|
|
822
|
+
.map((q, i) => ({ q, i, rank: pinned(q) ? 0 : q.at.walking ? 2 : 1 })).sort((x, y) => x.rank - y.rank || x.i - y.i);
|
|
823
|
+
for (const { q, rank } of tagOrder) place(q.at.x, q.at.y, tagLook(q), FULL_TRIES, rank === 0);
|
|
824
|
+
// The callers' tags in that mode (above), as the tags are placed: the box scaled about where they stand so it reads at
|
|
825
|
+
// its full size, never under an open card, clear of the kept-clear controls and of each other (there, else a row
|
|
826
|
+
// lower), registered (bubbles keep off it); their level left out. None clear: left to their chip in the row.
|
|
827
|
+
if (beaconOn) for (const q of people) {
|
|
828
|
+
if (!CALLING.has(q.look.state) || live.hidden.has(q.look.name) || offView(q.at)) continue;
|
|
829
|
+
const k = callerScale, look = { ...q.look, badge: null }, sc = (b) => ({ x: q.at.x + (b.x - q.at.x) * k, y: q.at.y + (b.y - q.at.y) * k, w: b.w * k, h: b.h * k });
|
|
830
|
+
for (const dy of [0, TAG_ROW]) {
|
|
831
|
+
const box = sc(tagBox(ctx, q.at.x, q.at.y + dy, look.label, false, look.fit));
|
|
832
|
+
if (covered(box) || touches(box)) continue;
|
|
833
|
+
ctx.save(); ctx.transform(k, 0, 0, k, q.at.x * (1 - k), q.at.y * (1 - k));
|
|
834
|
+
sk.drawTag(ctx, q.at.x, q.at.y + dy, look, env, false);
|
|
835
|
+
ctx.restore();
|
|
836
|
+
tags.push(box); taken.push(box);
|
|
837
|
+
break;
|
|
838
|
+
}
|
|
448
839
|
}
|
|
449
840
|
// A furniture item's own name (#2574: an NPC drawn as furniture), tagged like a person; none on a tile too small to read.
|
|
450
841
|
// #2698: an item hiding its people carries their tags too, in one row at its tag point (its own first; each keeps
|
|
@@ -452,26 +843,22 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
|
|
|
452
843
|
// kept on the scene (`heldTags`): hitPart hits each person on theirs, past the picture's edge too (#2699 review).
|
|
453
844
|
const held = [];
|
|
454
845
|
for (const f of furniture) {
|
|
455
|
-
const on = people.filter((q) => live.hidden.get(q.look.name) === f.id);
|
|
846
|
+
const on = people.filter((q) => live.hidden.get(q.look.name) === f.id && q.look.name !== heldName);
|
|
456
847
|
if (!on.length) {
|
|
457
|
-
if (!tagsOff && f.label)
|
|
458
|
-
const nl = npcLook(p, f), box = tagBox(ctx, f.x, f.y, nl.label);
|
|
459
|
-
sk.drawTag(ctx, f.x, f.y, nl, env); tags.push(box); taken.push(tagFootprint(ctx, box, nl.badge));
|
|
460
|
-
}
|
|
848
|
+
if (!tagsOff && f.label) place(f.x, f.y, npcLook(p, f), [[0, false], [TAG_ROW, false]]);
|
|
461
849
|
continue;
|
|
462
850
|
}
|
|
463
851
|
const order = new Map((f.activeFor || []).map((n, i) => [n, i]));
|
|
464
852
|
on.sort((x, y) => (order.get(x.look.name) ?? 0) - (order.get(y.look.name) ?? 0));
|
|
465
|
-
const row = tagRow(ctx, f.x, f.y, [...(f.label ? [npcLook(p, f)] : []), ...on.map(
|
|
853
|
+
const row = tagRow(ctx, f.x, f.y, [...(f.label ? [npcLook(p, f)] : []), ...on.map(tagLook)]);
|
|
466
854
|
const top = f.sprite ? Math.min(f.y - 50, stripBox(f.activeSprite || f.sprite, f.x, f.y).y + 2) : f.y - 50;
|
|
467
855
|
for (const [i, r] of row.entries()) {
|
|
468
856
|
const q = f.label ? on[i - 1] : on[i];
|
|
469
857
|
if (q) speakers.push({ look: q.look, x: r.x + 10, y: top, area: q.d.area });
|
|
470
858
|
if (q ? !tagged(q) : tagsOff) continue;
|
|
471
|
-
|
|
472
|
-
const box =
|
|
473
|
-
|
|
474
|
-
if (q) held.push({ name: q.look.name, id: f.id, box });
|
|
859
|
+
// The row stays one row (each keeps its place): drawn there, covering nothing else's, or left to hover.
|
|
860
|
+
const box = place(r.x, f.y, r.look, [[0, false]], !!q && pinned(q));
|
|
861
|
+
if (q && box) held.push({ name: q.look.name, id: f.id, box });
|
|
475
862
|
}
|
|
476
863
|
}
|
|
477
864
|
p.heldTags = held;
|
|
@@ -480,16 +867,10 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
|
|
|
480
867
|
// neighbour's tag goes a row lower (COMPACT_ROW) rather than out, so a row of people reads as two staggered rows.
|
|
481
868
|
if (!tagsOff) for (const q of people) {
|
|
482
869
|
if (live.hidden.has(q.look.name) || !crowded(q)) continue;
|
|
483
|
-
|
|
484
|
-
const box = tagBox(ctx, q.at.x, q.at.y + dy, q.look.label, true), foot = tagFootprint(ctx, box, q.look.badge, true);
|
|
485
|
-
if (touches(foot)) continue;
|
|
486
|
-
sk.drawTag(ctx, q.at.x, q.at.y + dy, q.look, env, true);
|
|
487
|
-
tags.push(box); taken.push(foot);
|
|
488
|
-
break;
|
|
489
|
-
}
|
|
870
|
+
place(q.at.x, q.at.y, q.look, [[0, true], [COMPACT_ROW, true]]);
|
|
490
871
|
}
|
|
491
872
|
} else {
|
|
492
|
-
for (const d of p.desks) { const look = p.looks.get(d.key);
|
|
873
|
+
for (const d of p.desks) { const look = p.looks.get(d.key); drawPerson(ctx, sk, d, actPosed(p, look), ms, env, d.x + d.w - 14, d.y + 14, readScale); speakers.push({ look, x: d.x + 58, y: d.y + 12, area: p.roomOf.get(d.key) ?? null }); }
|
|
493
874
|
blit(p.layers.front);
|
|
494
875
|
// Tags left out of the layer: the hovered desk's front again, with its tag.
|
|
495
876
|
const hd = tagsOff && hot ? p.desks.find((d) => d.key === hot) : null;
|
|
@@ -512,24 +893,113 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
|
|
|
512
893
|
}
|
|
513
894
|
ctx.restore();
|
|
514
895
|
}
|
|
896
|
+
// M-3293: a pat or a feed — a few hearts rising over the head (the palette's danger red, the text font: no new art)
|
|
897
|
+
// and their words in a bubble, while it lasts.
|
|
898
|
+
const t0 = now(), reacting = ms && p.reacts && p.reacts.size && pruneReactions(p.reacts, t0) ? p.reacts : null;
|
|
899
|
+
if (reacting) {
|
|
900
|
+
ctx.save();
|
|
901
|
+
ctx.fillStyle = env.pal.danger; ctx.font = "700 11px system-ui, sans-serif"; ctx.textAlign = "center"; ctx.textBaseline = "bottom";
|
|
902
|
+
for (const sp of speakers) {
|
|
903
|
+
const ra = reacting.has(sp.look.name) ? reactionAt(reacting.get(sp.look.name), t0, p.lang) : null;
|
|
904
|
+
if (ra) for (const h of ra.hearts) { ctx.globalAlpha = h.alpha; ctx.fillText("♥", sp.x + h.dx, sp.y + h.dy); }
|
|
905
|
+
}
|
|
906
|
+
ctx.restore();
|
|
907
|
+
}
|
|
515
908
|
// Speech bubbles: a short line for the state, now and then (typed out; whole at once when still), placed so no two
|
|
516
909
|
// overlap (placeBubbles; #2431).
|
|
517
|
-
const bubbles = [];
|
|
518
|
-
|
|
910
|
+
const bubbles = [], rp = p.reply, tSaid = Date.now(), replies = [];
|
|
911
|
+
// M-3743: the part of the scene on screen (the canvas, in this part's units, 8 bitmap px in): a bubble stays inside it,
|
|
912
|
+
// its tail still at the speaker (bubbleBox's `fit`; a speaker near an edge — a rider along the map's rim — had its
|
|
913
|
+
// bubble cut off). All offices: the whole canvas too (the bubbles are drawn after every tile, unclipped).
|
|
914
|
+
const cw = ctx.canvas && ctx.canvas.width, chh = ctx.canvas && ctx.canvas.height, edge = 8 / a;
|
|
915
|
+
const fit = cw > 0 && chh > 0 ? { l: -ox / a + edge, r: (cw - ox) / a - edge, t: -oy / a + edge, b: (chh - oy) / a - edge } : null;
|
|
916
|
+
for (let sp of speakers) {
|
|
519
917
|
if (sp.look.dim || sp.look.pose === "away") continue;
|
|
918
|
+
// Talk "Over their head": a live reply, in full (wrapped), in place of the state's line.
|
|
919
|
+
const said = rp ? rp.chat.recent(sp.look.name, tSaid) : null;
|
|
920
|
+
if (said) { replies.push({ sp, said }); continue; }
|
|
520
921
|
const says = sp.look.night ? "paused" : sp.look.state; // asleep at night: its "Zzz…" lines
|
|
521
922
|
// What an agent says itself (office_set, #2578): whole, kept over the area's thinning like a call.
|
|
522
|
-
const act = p.acts && p.acts.get(sp.look.name),
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
923
|
+
const act = p.acts && p.acts.get(sp.look.name), ra = reacting && reacting.has(sp.look.name) ? reactionAt(reacting.get(sp.look.name), t0, p.lang) : null;
|
|
924
|
+
// M-3293: a pat's or a feed's words first — the pack's own for it ("pat" / "feed" in its bubbles: theirs, their
|
|
925
|
+
// set's, the pack's), one picked by when it happened, else the page's.
|
|
926
|
+
const packSays = ra ? linesFor(reacting.get(sp.look.name).kind, p.lang, sk.pack, null, sp.look.name) : [];
|
|
927
|
+
const raSays = ra ? (packSays.length ? packSays[Math.floor(reacting.get(sp.look.name).t0) % packSays.length] : ra.say) : null;
|
|
928
|
+
const own = raSays ? raSays : actLive(act, says, Date.now(), p.actSeen) && act.say ? act.say : null;
|
|
929
|
+
const sc = !own && p.snacks && ms > 0 ? p.snacks.scatterOf(sp.look.name, t0) : null;
|
|
930
|
+
const scText = sc ? scatterWords(p.lang) : null;
|
|
931
|
+
const b = own ? { text: own, shown: [...own].length }
|
|
932
|
+
: scText ? { text: scText, shown: [...scText].length }
|
|
933
|
+
: bubbleAt(sp.look.name, says, ms, linesFor(says, p.lang, sk.pack, p.lines, sp.look.name)); // #3681: theirs, their set's, the pack's
|
|
934
|
+
// M-3533 R2c (Lumen): a room's own characters stand taller than the style's figures; their bubble stays inside the
|
|
935
|
+
// area's box, as a figure's does (the Fleet's own office is unchanged).
|
|
936
|
+
const ar = b && sk.ownCharacters && p.zones && sp.area != null ? p.L.areas && p.L.areas[sp.area] : null;
|
|
937
|
+
if (ar && ar.rect) { const bx = bubbleBox(ctx, sp.x, sp.y, b.text, 0, false, fit), min = ar.rect.y + BUBBLE_IN_AREA; if (bx.y < min) sp = { ...sp, y: sp.y + (min - bx.y) }; }
|
|
938
|
+
if (b) bubbles.push({ key: sp.look.name, area: sp.area, state: sp.look.state, calling: CALLING.has(sp.look.state), rank: own ? 0 : scText ? 1 : bubbleRank(sp.look.state), shown: b.shown, ...(raSays ? { keep: true } : {}),
|
|
939
|
+
box: bubbleBox(ctx, sp.x, sp.y, b.text, 0, false, fit), ...(CALLING.has(sp.look.state) ? { flipBox: bubbleBox(ctx, sp.x, sp.y, b.text, 0, true, fit) } : {}), tail: { x: sp.x, y: sp.y }, sp, b,
|
|
940
|
+
boxAt: ((at) => (dy, flip) => bubbleBox(ctx, at.x, at.y, b.text, -dy, flip, fit))(sp) });
|
|
526
941
|
}
|
|
527
942
|
// A crowded area speaks less (thinBubbles: calls, then work, a few at most); no bubble covers a name tag. `defer`
|
|
528
943
|
// (All offices): drawn after every tile, unclipped, so a bubble at a tile's edge is whole.
|
|
529
|
-
|
|
530
|
-
|
|
944
|
+
// M-3648: an area's name blocks chatter; a call may cover it (placeBubbles' `soft`): a name never keeps a call out.
|
|
945
|
+
// M-3722: and 3 px of air off a name, not just its plate (a call beside 求救區 touched its corner). A number here, not an
|
|
946
|
+
// import: a page still holding the older fleet-office-zones.js keeps linking (it just ignores it).
|
|
947
|
+
const placed = placeBubbles(thinBubbles(bubbles, p.zones ? p.L.over : null), 22, tags, titleBoxes, 3);
|
|
948
|
+
// M-3533 R2c: and after placing (which lifts a bubble clear of another), a room character's bubble still stays in its area.
|
|
949
|
+
const inArea = (sp, text, dy, flip) => {
|
|
950
|
+
const ar = sk.ownCharacters && p.zones && sp.area != null ? p.L.areas && p.L.areas[sp.area] : null;
|
|
951
|
+
if (!ar || !ar.rect || !dy) return dy;
|
|
952
|
+
const over = ar.rect.y + BUBBLE_IN_AREA - bubbleBox(ctx, sp.x, sp.y, text, -dy, flip, fit).y;
|
|
953
|
+
return over > 0 ? Math.max(0, dy - over) : dy;
|
|
954
|
+
};
|
|
955
|
+
// The box a tail covers: the skin's own (from its foot to the speaker, M-3743), else the strip under the speaker (an older skin).
|
|
956
|
+
const tailOf = (sp, box) => box.tail || (box.below ? { x: sp.x - 1, y: sp.y, w: 9, h: Math.max(0, box.y - sp.y) } : { x: sp.x - 1, y: box.y + box.h, w: 9, h: Math.max(0, sp.y - (box.y + box.h)) });
|
|
957
|
+
// M-3743 (#4474 review): checked again where each is drawn (kept on screen, and in its area), in placing order: none over
|
|
958
|
+
// another's box or tail, or a name tag. A page still holding an older fleet-office-zones.js places `box` moved by dy (it
|
|
959
|
+
// knows no boxAt), and two boxes kept on screen could meet; with the current one this keeps every bubble it placed.
|
|
960
|
+
const shown = [], held = [...tags];
|
|
961
|
+
for (const it of placed) {
|
|
962
|
+
const flip = it.flip || false, dy = inArea(it.sp, it.b.text, it.dy, flip), box = bubbleBox(ctx, it.sp.x, it.sp.y, it.b.text, -dy, flip, fit), tl = tailOf(it.sp, box);
|
|
963
|
+
if (held.some((o) => overlaps(o, box) || overlaps(o, tl))) continue;
|
|
964
|
+
held.push(box, tl); shown.push({ ...it, dy, flip });
|
|
965
|
+
}
|
|
966
|
+
const say = () => { T(); const tails = []; for (const { sp, b, dy, flip } of shown) {
|
|
967
|
+
const text = [...b.text].slice(0, b.shown).join("");
|
|
968
|
+
sk.drawBubble(ctx, sp.x, sp.y, text, env, -dy, flip, fit);
|
|
969
|
+
if (text) tails.push(tailOf(sp, bubbleBox(ctx, sp.x, sp.y, text, -dy, flip, fit)));
|
|
970
|
+
if (bubbleHits && text) {
|
|
971
|
+
const box = bubbleBox(ctx, sp.x, sp.y, text, -dy, flip, fit);
|
|
972
|
+
bubbleHits.push({ name: sp.look.name, box: { x: ox + box.x * a, y: oy + box.y * a, w: box.w * a, h: box.h * a } });
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
// M-3722: a bubble keeps its box off an area's name (placeBubbles); a tail that still crosses one has the name written
|
|
976
|
+
// again over it (as over a figure standing on it, M-3539), so the name always reads whole.
|
|
977
|
+
if (sk.drawAreaTitle) for (const { ar, box } of titleDraws) if (tails.some((t) => overlaps(t, box))) sk.drawAreaTitle(ctx, ar, env);
|
|
978
|
+
const bl = sk.pack && sk.pack.dialogBox ? sk.pack.dialogBox.bubble : null;
|
|
979
|
+
const im = bl && bl.frame && typeof sk.picture === "function" ? sk.picture(bl.frame, () => {}) : null;
|
|
980
|
+
for (const { sp, said } of replies) {
|
|
981
|
+
// Typed out from its page's start, at the reading mode's pace; ▼ once whole; Auto / Fast: it goes on by itself.
|
|
982
|
+
const cps = rp.pace(rp.read).cps, n = ms > 0 ? Math.floor(((tSaid - (said.pageAt ?? said.at)) * cps) / 1000) : Infinity;
|
|
983
|
+
// #4406: never smaller than its own size on the page — zoomed out (a phone's whole office at 30 %), it is drawn at
|
|
984
|
+
// 1 CSS px a unit about its tail, so the words stay readable; zoomed in, as the map.
|
|
985
|
+
const u = Math.max(1, (rp.ratio || 1) / a);
|
|
986
|
+
// And kept on screen: the canvas's visible width in this part's units, into the bubble's own (scaled about its tail).
|
|
987
|
+
const vl = -ox / a, vr = ((ctx.canvas && ctx.canvas.width) || Infinity) / a - ox / a, m = 6 / u;
|
|
988
|
+
const vt = -oy / a, vb = ((ctx.canvas && ctx.canvas.height) || Infinity) / a - oy / a;
|
|
989
|
+
const fit = Number.isFinite(vr) ? { l: sp.x + (vl - sp.x) / u + m, r: sp.x + (vr - sp.x) / u - m,
|
|
990
|
+
...(Number.isFinite(vb) ? { t: sp.y + (vt - sp.y) / u + m, b: sp.y + (vb - sp.y) / u - m } : {}) } : null;
|
|
991
|
+
ctx.save(); ctx.translate(sp.x, sp.y); ctx.scale(u, u); ctx.translate(-sp.x, -sp.y);
|
|
992
|
+
const b0 = rp.draw(ctx, sp.x, sp.y, sp.look.label || sp.look.name, said.text, ms > 0 ? tSaid - said.at : 0, rp.style(bl, env), im ? { im, slice: bl.slice || 6, k: sk.pack.scale || 2 } : null,
|
|
993
|
+
{ page: said.page, n }, fit);
|
|
994
|
+
ctx.restore();
|
|
995
|
+
const box = { ...b0, x: sp.x + (b0.x - sp.x) * u, y: sp.y + (b0.y - sp.y) * u, w: b0.w * u, h: b0.h * u };
|
|
996
|
+
said.pages = box.pages;
|
|
997
|
+
if (n >= box.len && !said.whole) { said.whole = true; said.wholeAt = tSaid; }
|
|
998
|
+
if (said.whole && tSaid - said.wholeAt >= rp.pace(rp.read, box.len).wait) rp.chat.advance(sp.look.name);
|
|
999
|
+
if (bubbleHits) bubbleHits.push({ name: sp.look.name, reply: true, box: { x: ox + box.x * a, y: oy + box.y * a, w: box.w * a, h: box.h * a } });
|
|
1000
|
+
} };
|
|
531
1001
|
if (defer) defer.push(say); else say();
|
|
532
|
-
return walking || up.length > 0 || p.flights.size() > 0 || post.some((it) => it.t > 0) || rising.length > 0;
|
|
1002
|
+
return replies.length > 0 || carsOn || walking || up.length > 0 || p.flights.size() > 0 || post.some((it) => it.t > 0) || rising.length > 0 || !!reacting || (!!p.snacks && p.snacks.active(t0)) || !!(p.snackDrop && p.snackDrop.current) || !!(p.hold && p.hold.held());
|
|
533
1003
|
}
|
|
534
1004
|
/**
|
|
535
1005
|
* #2661: an NPC's name tag (a furniture item's label) — with the title a pack pins on it (`levels.fixed` by its id),
|
|
@@ -626,16 +1096,49 @@ export function OfficeKey({ pal }) {
|
|
|
626
1096
|
* `assetImage(url)` how (the share's, which waits out a 429, #2662; none: the loader's own);
|
|
627
1097
|
* `opening` the office it opens on (the share's), instead of the one this browser chose last; #2861: `talk` the share's
|
|
628
1098
|
* conversations (its /state's: who heard or answered a person, when — never what was said), instead of the stream's.
|
|
1099
|
+
* M-3533 R1, a Hub room's office (hub-room-office.js), on the Fleet dashboard's own origin too: `oneOffice` its one office
|
|
1100
|
+
* (no office picker or carousel); `readOnly` no editing or sharing whatever the session; `stream` false: never this
|
|
1101
|
+
* page's own stream (the fleet's offices, acts and skins); `storage` where this browser's choices are kept (not the
|
|
1102
|
+
* Fleet office's); `cardRows(name)` a card's rows instead of the office's (the room's: owner, introduction); `words(node)`
|
|
1103
|
+
* a person's state and activity in the page's own words ({ state, now }: the room's member list's), instead of the Fleet's;
|
|
1104
|
+
* `foldBar` (with `onMore`): no options row over the scene on a desk either — the options open in the sheet from a button
|
|
1105
|
+
* in the zoom stack (a Hub room's office: the scene right under the room's header, M-3533 #4370);
|
|
1106
|
+
* `cardAction(name)` a card's main action ({ label, title, run }: the room's "@ it"), or null; `cardName(name)` a card's
|
|
1107
|
+
* title instead of the person's name (the room's: the agent's own, without the owner its scene label carries); `officesKey` read the offices
|
|
1108
|
+
* again when it changes (a page with no stream: the room's office when an agent joins, leaves or is renamed); M-3533 R2b:
|
|
1109
|
+
* `cardPhoto(name)` the src of a card's identity-card picture (the room's), or null: the figure.
|
|
629
1110
|
*/
|
|
630
|
-
|
|
631
|
-
const
|
|
1111
|
+
function ensureDialogueStyle() {
|
|
1112
|
+
const doc = globalThis.document;
|
|
1113
|
+
if (!doc?.head || doc.querySelector('link[data-office-dialogue-css="1"]')) return;
|
|
1114
|
+
const link = doc.createElement("link"); link.rel = "stylesheet";
|
|
1115
|
+
link.href = assetUrl("/assets/office-dialogue.css");
|
|
1116
|
+
link.setAttribute("data-office-dialogue-css", "1"); doc.head.appendChild(link);
|
|
1117
|
+
}
|
|
1118
|
+
export function Office({ view: given, traffic, q = "", lease, onOpen, assetUrl, assetImage, opening, talk, chatUi = null, more = false, onMore = null, live = null, onLive = null,
|
|
1119
|
+
oneOffice = false, readOnly = false, stream = true, storage = undefined, cardRows = null, words = null, cardAction = null, cardName = null, officesKey = undefined, foldBar = false, cardPhoto = null, characters = null }) {
|
|
1120
|
+
// M-3253: on a phone the page above (fleet-canvas.js) puts a ⋯ in its bar: `more` is that sheet open, `onMore(open)`;
|
|
1121
|
+
// `live` / `onLive` its Live toggle, which moves into the sheet. Without one (a share link's page) the bar stays.
|
|
1122
|
+
useLayoutEffect(ensureDialogueStyle, []);
|
|
1123
|
+
const phone = useOfficePhone(), compact = phone && typeof onMore === "function", folded = compact || (foldBar && typeof onMore === "function");
|
|
1124
|
+
const store = useMemo(() => createOfficeStore({ ...(lease ? { fetch: (path, o) => lease.fetch(path, o) } : {}), ...(storage ? { storage } : {}) }), [lease, storage]);
|
|
1125
|
+
const streamOn = () => (stream === false ? null : appStore.get().streamOn);
|
|
1126
|
+
const stateOf = (node) => (words ? words(node).state : stateWords(node));
|
|
1127
|
+
const nowOf = (node) => (words ? words(node).now : caption(officePose(node.state), node.state));
|
|
632
1128
|
const [stored, setStored] = useState([]);
|
|
633
1129
|
const [storedRev, setStoredRev] = useState(null); // the rev the list was read at (a save sends it)
|
|
634
1130
|
const [canEdit, setCanEdit] = useState(false); // an admin session (never a guest or the public link)
|
|
635
1131
|
const [canShare, setCanShare] = useState(false); // #2636: an admin session, here or over the public link
|
|
636
1132
|
const [editing, setEditing] = useState(false);
|
|
637
|
-
|
|
1133
|
+
// Never picked here: All offices, the map of every office (one click enters one, unremembered; Back returns) — the
|
|
1134
|
+
// whole fleet while fewer than two are stored. A pick from the switcher is kept per device, as before.
|
|
1135
|
+
const [choice, setChoice] = useState(() => opening ?? store.choice(ALL_ID));
|
|
638
1136
|
const [filter, setFilter] = useState(() => store.filter());
|
|
1137
|
+
// #4010: the carousel's offices and interval (per browser); the slide index and playing are this visit only.
|
|
1138
|
+
const [carSaved, setCarSaved] = useState(() => store.carousel());
|
|
1139
|
+
const [carIndex, setCarIndex] = useState(0);
|
|
1140
|
+
const [carPlaying, setCarPlaying] = useState(true);
|
|
1141
|
+
const [carMenu, setCarMenu] = useState(false);
|
|
639
1142
|
// #2716: the whole-fleet office's style — the host's (for everyone) and this browser's own pick. An admin sees the
|
|
640
1143
|
// host's (their own pick only while the host keeps none) and picks for everyone; anyone else's own pick, else the host's.
|
|
641
1144
|
const [hostStyle, setHostStyle] = useState(undefined); // undefined: not read yet; null: none kept
|
|
@@ -654,6 +1157,11 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
654
1157
|
const [styleErr, setStyleErr] = useState("");
|
|
655
1158
|
const style = canEdit ? hostStyle ?? ownStyle ?? "cozy" : ownStyle ?? hostStyle ?? "cozy";
|
|
656
1159
|
const [hideAsleep, setHideAsleep] = useState(() => store.hideAsleep());
|
|
1160
|
+
const [namesOff, setNamesOff] = useState(() => store.namesOff());
|
|
1161
|
+
const [miniOff, setMiniOff] = useState(() => store.miniOff());
|
|
1162
|
+
// The names this browser gives people: each node's nickname replaced here, so the tags, the card and the dialogue follow.
|
|
1163
|
+
const [renames, setRenames] = useState(() => store.renames());
|
|
1164
|
+
const view = useMemo(() => renamedView(given, renames), [given, renames]);
|
|
657
1165
|
// Bedtime (#2568), when it is on here: the idle sleep from NIGHT.FROM to NIGHT.TO on this device's clock (read every NIGHT.TICK).
|
|
658
1166
|
const [nightOn, setNightOn] = useState(() => store.nightOn());
|
|
659
1167
|
const [keyOpen, setKeyOpen] = useState(() => store.keyOpen());
|
|
@@ -661,14 +1169,34 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
661
1169
|
// conversations; the avatars read for it; what it last said for a screen reader. `dlgRef`: what draw() reads (it runs
|
|
662
1170
|
// from the loop, outside a render); `dlgShown`: the box as last drawn (its clicks).
|
|
663
1171
|
const [dialogueOn, setDialogueOn] = useState(() => store.dialogueOn());
|
|
1172
|
+
// Talking from here (fleet-office-talk.js, `chatUi`: the dashboard's only, never a share link): how (per browser) and
|
|
1173
|
+
// to whom; `chat` the conversations every way shows.
|
|
1174
|
+
const [talkMode, setTalkMode] = useState(() => store.talkMode());
|
|
1175
|
+
const [talkTo, setTalkTo] = useState(null);
|
|
1176
|
+
const [readMode, setReadMode] = useState(() => (chatUi ? chatUi.readModeOf(store.talkRead()) : "click"));
|
|
1177
|
+
const chat = useMemo(() => (chatUi ? chatUi.createTalk() : null), [chatUi]);
|
|
1178
|
+
// #4406: the Dialogue-box talk shows the dialogue's conversations, so they run while it is picked — without ticking
|
|
1179
|
+
// Dialogue for the person (their own choice, kept as they left it when they pick another way to talk).
|
|
1180
|
+
const boxTalk = !!chat && talk === undefined && typeof onOpen === "function" && chatUi.talkModeOf(talkMode) === "box";
|
|
1181
|
+
const dlgOn = dialogueOn || boxTalk;
|
|
1182
|
+
const replyRef = useRef(null);
|
|
664
1183
|
const dlg = useMemo(createDialogue, []);
|
|
665
1184
|
const faces = useMemo(() => createFaces(), []);
|
|
666
1185
|
const [dlgSay, setDlgSay] = useState("");
|
|
1186
|
+
const [dlgVisible, setDlgVisible] = useState(false);
|
|
1187
|
+
const dlgVisibleRef = useRef(false);
|
|
1188
|
+
const showDialogueDock = (visible) => {
|
|
1189
|
+
if (dlgVisibleRef.current !== visible) { dlgVisibleRef.current = visible; setDlgVisible(visible); }
|
|
1190
|
+
};
|
|
1191
|
+
const dialogueCanvasRef = useRef(null);
|
|
667
1192
|
const [dlgHot, setDlgHot] = useState(false);
|
|
668
1193
|
const dlgRef = useRef(null), dlgShown = useRef(null), dlgLines = useRef(new Map()), talkSeen = useRef(new Set());
|
|
669
1194
|
const [nightNow, setNightNow] = useState(() => isNight());
|
|
670
1195
|
useEffect(() => { if (!nightOn) return undefined; setNightNow(isNight()); const h = setInterval(() => setNightNow(isNight()), NIGHT.TICK); return () => clearInterval(h); }, [nightOn]);
|
|
671
1196
|
const night = nightOn && nightNow;
|
|
1197
|
+
// M-3293: "Drag and pat" here (per device, on by default); in force only where playAllowed says (below).
|
|
1198
|
+
const [playOn, setPlayOn] = useState(() => store.playOn());
|
|
1199
|
+
const [, setTellRev] = useState(0); // M-3293: the card's Tell box redrawn when ticked
|
|
672
1200
|
const [lobbyOn, setLobbyOn] = useState(() => store.lobbyTile()); // #2554: All offices' lobby tile
|
|
673
1201
|
const [packs, setPacks] = useState([]); // the skin packs the host keeps: [{ id, name, sha }]
|
|
674
1202
|
const [packSkins, setPackSkins] = useState(() => new Map()); // id@sha → a loaded skin, or null (not a pack)
|
|
@@ -688,13 +1216,39 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
688
1216
|
// back there when it closes); the card's element and where it points (placed every frame: it follows them).
|
|
689
1217
|
const [card, setCard] = useState(null);
|
|
690
1218
|
const cardFrom = useRef(null), cardEl = useRef(null), cardDesk = useRef(null);
|
|
1219
|
+
// M-3633: how much of the stage a bottom-sheet card covers (px from its foot); the scene is kept in the rest.
|
|
1220
|
+
const sheetCover = useRef(0);
|
|
691
1221
|
const stageRef = useRef(null), canvasRef = useRef(null), tipRef = useRef(null), lastType = useRef("mouse");
|
|
692
1222
|
// Fullscreen: null, "native" (the Fullscreen API) or "immersive" (the CSS cover); per visit, never kept.
|
|
693
1223
|
const ooRef = useRef(null), [fs, setFs] = useState(null), fsRef = useRef(null), fsAsked = useRef(false), fsTarget = useRef(null);
|
|
694
1224
|
fsRef.current = fs;
|
|
695
1225
|
const flights = useMemo(() => createFlights(), []);
|
|
696
1226
|
const walkers = useMemo(() => createWalkers(), []);
|
|
1227
|
+
const riders = useMemo(() => createRiders(), []);
|
|
697
1228
|
const seatsRef = useRef(new Map()); // the zones layout's last seats: kept where they can be
|
|
1229
|
+
const seatPrefsRef = useRef({}), seatKeyRef = useRef(""), seatDropRef = useRef(null);
|
|
1230
|
+
const placedRef = useRef(null); // M-3539: the office and style the walkers were last placed for
|
|
1231
|
+
// M-3539: the phone's zone chips scroll sideways when they do not fit (English); a fade at the side there is more
|
|
1232
|
+
// (data-more-left / data-more-right) says so.
|
|
1233
|
+
const pillsRef = useRef(null);
|
|
1234
|
+
// M-3665 (leader's check): the zoomed-out name row scrolls sideways; while there is more, its edge fades (as the pills).
|
|
1235
|
+
const desksRef = useRef(null);
|
|
1236
|
+
const desksCue = () => {
|
|
1237
|
+
const e = desksRef.current;
|
|
1238
|
+
if (!e || typeof e.toggleAttribute !== "function") return;
|
|
1239
|
+
const more = e.scrollWidth - e.clientWidth;
|
|
1240
|
+
e.toggleAttribute("data-more-left", more > 1 && e.scrollLeft > 1);
|
|
1241
|
+
e.toggleAttribute("data-more-right", more > 1 && e.scrollLeft < more - 1);
|
|
1242
|
+
};
|
|
1243
|
+
const pillsCue = () => {
|
|
1244
|
+
const e = pillsRef.current;
|
|
1245
|
+
if (!e || typeof e.toggleAttribute !== "function") return;
|
|
1246
|
+
const more = e.scrollWidth - e.clientWidth;
|
|
1247
|
+
e.toggleAttribute("data-more-left", more > 1 && e.scrollLeft > 1);
|
|
1248
|
+
e.toggleAttribute("data-more-right", more > 1 && e.scrollLeft < more - 1);
|
|
1249
|
+
};
|
|
1250
|
+
useLayoutEffect(pillsCue);
|
|
1251
|
+
const [seatRev, setSeatRev] = useState(0);
|
|
698
1252
|
// #2554: All offices' tiles keep their own: seats (by tile and style), walkers and flights (by tile); and the items
|
|
699
1253
|
// flying between tiles.
|
|
700
1254
|
const tileSeats = useRef(new Map()), tileWalkers = useRef(new Map()), tileFlights = useRef(new Map());
|
|
@@ -740,10 +1294,10 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
740
1294
|
if (!lease) return undefined;
|
|
741
1295
|
const read = async () => { const at = ask(); const d = await store.offices(); if (lease.current()) adopt(d, at); };
|
|
742
1296
|
void read();
|
|
743
|
-
const sub =
|
|
1297
|
+
const sub = streamOn();
|
|
744
1298
|
const off = sub ? lease.hold(sub("offices", () => { void read(); })) : null;
|
|
745
1299
|
return () => { if (off) off(); };
|
|
746
|
-
}, [lease, store]);
|
|
1300
|
+
}, [lease, store, officesKey]);
|
|
747
1301
|
// #2578: what agents do here by their own hand (office_set) — on opening, then as the stream brings it.
|
|
748
1302
|
// A read a newer one or the stream overtook is dropped (it is older: review — an opening read answered after the one
|
|
749
1303
|
// the stream's return began brought a cleared act back); read again when the stream comes back, and — with no live
|
|
@@ -776,7 +1330,7 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
776
1330
|
let heard = 0; // reads begun and events heard: the newest wins
|
|
777
1331
|
const read = async () => { const at = ++heard, d = await store.acts(); if (lease.current() && d && at === heard) setActs(d); };
|
|
778
1332
|
void read();
|
|
779
|
-
const sub =
|
|
1333
|
+
const sub = streamOn();
|
|
780
1334
|
const polled = () => globalThis.document?.body?.dataset?.webTransport === "poll" || appStore.get().connection === "polling";
|
|
781
1335
|
const offs = sub ? [lease.hold(sub("office_acts", (d) => { heard++; if (d && Array.isArray(d.acts)) setActs(actsOk(d.acts, d.now)); else void read(); })),
|
|
782
1336
|
lease.hold(sub("connection", (c) => { if (c === "live") void read(); }))] : [];
|
|
@@ -797,8 +1351,8 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
797
1351
|
if (who) setDlgSay(to("dlgSays", ...words(who)));
|
|
798
1352
|
};
|
|
799
1353
|
useEffect(() => {
|
|
800
|
-
if (!
|
|
801
|
-
const sub =
|
|
1354
|
+
if (!dlgOn || talk !== undefined) return undefined;
|
|
1355
|
+
const sub = streamOn();
|
|
802
1356
|
if (!sub) return undefined;
|
|
803
1357
|
let skew = 0;
|
|
804
1358
|
const seen = new Set();
|
|
@@ -817,9 +1371,9 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
817
1371
|
const hold = (off) => (lease ? lease.hold(off) : off);
|
|
818
1372
|
const offs = [hold(sub("clock", (d) => { if (d && typeof d.now === "number") skew = d.now - Date.now(); })), hold(sub("message", take))];
|
|
819
1373
|
return () => { for (const off of offs) if (typeof off === "function") off(); };
|
|
820
|
-
}, [
|
|
1374
|
+
}, [dlgOn, lease, talk === undefined]);
|
|
821
1375
|
useEffect(() => {
|
|
822
|
-
if (!
|
|
1376
|
+
if (!dlgOn || !talk) return;
|
|
823
1377
|
let changed = false;
|
|
824
1378
|
for (const x of talkOf(talk)) {
|
|
825
1379
|
const k = `${x.instance}|${x.kind}|${x.at}`;
|
|
@@ -832,13 +1386,13 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
832
1386
|
sayFor(x.instance, (who) => (x.kind === "heard" ? [to("dlgSomeone"), to("dlgHeardShare", nodeText(who.node).primary)] : [nodeText(who.node).primary, to("dlgAnsweredShare")]));
|
|
833
1387
|
}
|
|
834
1388
|
if (changed) dlgWake();
|
|
835
|
-
}, [
|
|
1389
|
+
}, [dlgOn, talk]);
|
|
836
1390
|
// What is over goes (an answer after its fade, a conversation never answered); the box is drawn again meanwhile.
|
|
837
1391
|
useEffect(() => {
|
|
838
|
-
if (!
|
|
839
|
-
const h = setInterval(() => { if (dlg.sweep(now(), still) || dlg.size()) dlgWake(); }, 1000);
|
|
1392
|
+
if (!dlgOn) return undefined;
|
|
1393
|
+
const h = setInterval(() => { if (dlg.sweep(now(), still, !!(dlgRef.current && dlgRef.current.vn)) || dlg.size()) dlgWake(); }, 1000);
|
|
840
1394
|
return () => clearInterval(h);
|
|
841
|
-
}, [
|
|
1395
|
+
}, [dlgOn]);
|
|
842
1396
|
const toggleDialogue = () => {
|
|
843
1397
|
const v = !dialogueOn;
|
|
844
1398
|
store.saveDialogueOn(v); setDialogueOn(v);
|
|
@@ -850,7 +1404,7 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
850
1404
|
if (!lease) return undefined;
|
|
851
1405
|
const read = async () => { const d = await store.skins(); if (lease.current() && d) setPacks(d.packs); };
|
|
852
1406
|
void read();
|
|
853
|
-
const sub =
|
|
1407
|
+
const sub = streamOn();
|
|
854
1408
|
const off = sub ? lease.hold(sub("office_skins", () => { void read(); })) : null;
|
|
855
1409
|
return () => { if (off) off(); };
|
|
856
1410
|
}, [lease, store]);
|
|
@@ -859,11 +1413,10 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
859
1413
|
// session's here or over the public link (the host asks again too); never a guest's or a read-only one's.
|
|
860
1414
|
useEffect(() => {
|
|
861
1415
|
const body = globalThis.document?.body;
|
|
862
|
-
if (!body || body.dataset.tier === "guest") return undefined;
|
|
863
|
-
const overLink = body.dataset.publicLink === "1";
|
|
1416
|
+
if (readOnly || !body || body.dataset.tier === "guest") return undefined;
|
|
864
1417
|
let live = true;
|
|
865
1418
|
const auth = globalThis.AgendAuth;
|
|
866
|
-
if (auth && typeof auth.canWrite === "function") Promise.resolve(auth.canWrite()).then((v) => { if (live) { setCanEdit(v === true
|
|
1419
|
+
if (auth && typeof auth.canWrite === "function") Promise.resolve(auth.canWrite()).then((v) => { if (live) { setCanEdit(v === true); setCanShare(v === true); } }, () => {});
|
|
867
1420
|
return () => { live = false; };
|
|
868
1421
|
}, []);
|
|
869
1422
|
// The stage's width (the grid wraps at it), and the theme (the tokens the canvas reads).
|
|
@@ -895,11 +1448,30 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
895
1448
|
const size = { w: width, h: stageH > 0 ? stageH : SIZE0.h };
|
|
896
1449
|
// The canvas bitmap's px per CSS px: the device's, unless the bitmap would be too big to paint (backingScale). Zoom
|
|
897
1450
|
// snaps to whole numbers of these (fleet-office-view.js), so a pixel-level view maps a logical unit onto whole pixels.
|
|
898
|
-
|
|
1451
|
+
// At most 2 px per CSS px: a 3x phone screen would paint 2.25x the pixels every frame for little visible gain.
|
|
1452
|
+
const ratio = backingScale(size.w, size.h, Math.min(2, dpr));
|
|
899
1453
|
|
|
900
1454
|
// #2554: All offices — chosen, and at least two offices stored (else the whole fleet, as an office gone is).
|
|
901
1455
|
const overview = choice === ALL_ID && overviewOk(stored);
|
|
902
|
-
|
|
1456
|
+
// #4010: Carousel — chosen on the signed-in dashboard, at least two stored; the ticked list may be shorter (then
|
|
1457
|
+
// the one left is shown still, or the whole fleet with none). Playing starts on enter; the timer is a timeout so a
|
|
1458
|
+
// Next or an interval change resets it.
|
|
1459
|
+
const carouselPick = opening == null && choice === CAROUSEL_ID && carouselOk(stored);
|
|
1460
|
+
const carIds = carouselPick ? carouselIdsOk(carSaved ? carSaved.ids : null, stored) : [];
|
|
1461
|
+
const carousel = carouselPick && carIds.length >= 2;
|
|
1462
|
+
useEffect(() => { if (!carouselPick) setCarMenu(false); }, [carouselPick]);
|
|
1463
|
+
const slideId = carouselPick && carIds.length ? carIds[((carIndex % carIds.length) + carIds.length) % carIds.length] : null;
|
|
1464
|
+
const custom = slideId ? stored.find((o) => o.id === slideId) || null
|
|
1465
|
+
: (choice !== AUTO_ID && !overview ? stored.find((o) => o.id === choice) || null : null);
|
|
1466
|
+
const carouselAct = useRef({ on: false, act: () => {} });
|
|
1467
|
+
const stepCar = (dir) => { if (!carIds.length) return; setCarIndex((i) => (dir > 0 ? nextIndex(i, carIds.length) : prevIndex(i, carIds.length))); };
|
|
1468
|
+
carouselAct.current = { on: carousel, act: (kind) => { if (kind === "pause") setCarPlaying((p) => !p); else if (kind === "next") stepCar(1); else if (kind === "prev") stepCar(-1); } };
|
|
1469
|
+
useEffect(() => {
|
|
1470
|
+
if (!carousel || !carPlaying) return undefined;
|
|
1471
|
+
const ms = intervalOk(carSaved && carSaved.interval) * 1000;
|
|
1472
|
+
const t = setTimeout(() => stepCar(1), ms);
|
|
1473
|
+
return () => clearTimeout(t);
|
|
1474
|
+
}, [carousel, carPlaying, carSaved && carSaved.interval, carIndex, carIds.join("|")]);
|
|
903
1475
|
// The style: a built-in one, or an uploaded pack once it is loaded (until then, and when it is not one, Desks).
|
|
904
1476
|
const wanted = custom ? custom.skin : style;
|
|
905
1477
|
// A kept pack wins its id: one kept as "cozy" before it was built in (#2631) is still the style of the offices naming it.
|
|
@@ -941,21 +1513,50 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
941
1513
|
if (zones && layout && !layoutStale) return { skin: { ...baseSkin, pack: layout.draft }, ignored: false };
|
|
942
1514
|
return withOverrides(baseSkin, zones, custom);
|
|
943
1515
|
}, [baseSkin, zones, custom, layout, layoutStale]);
|
|
944
|
-
|
|
1516
|
+
// M-3533 R2c: a Hub room office's agents in their own characters (`characters`: { sets, images }), over its style.
|
|
1517
|
+
const skin = useMemo(() => (characters ? withCharacters(placed.skin, characters.sets, characters.images) : placed.skin), [placed.skin, characters]);
|
|
945
1518
|
// While Edit layout is open: a faint figure on every seat, in the pose its area is for (#2558), so a seat is placed by
|
|
946
1519
|
// what will stand, sit or lie there, not by a dot.
|
|
947
1520
|
const ghosts = zones && !!layout && !layoutStale;
|
|
1521
|
+
const shared = talk !== undefined || typeof onOpen !== "function";
|
|
1522
|
+
const tmode = chat && !shared ? chatUi.talkModeOf(talkMode) : "window";
|
|
1523
|
+
useEffect(() => {
|
|
1524
|
+
if (!chat || tmode === "window") return undefined;
|
|
1525
|
+
const sub = appStore.get().streamOn, hold = (off) => (lease ? lease.hold(off) : off);
|
|
1526
|
+
const off = sub ? hold(sub("message", chat.take)) : null;
|
|
1527
|
+
const quiet = chat.subscribe(() => { if (still && scene.current) draw(0); else loop.current?.wake(); });
|
|
1528
|
+
return () => { if (typeof off === "function") off(); quiet(); };
|
|
1529
|
+
}, [chat, tmode, lease]);
|
|
1530
|
+
const pickTalkMode = (v) => {
|
|
1531
|
+
store.saveTalkMode(v); setTalkMode(v);
|
|
1532
|
+
if (v === "window") setTalkTo(null);
|
|
1533
|
+
};
|
|
1534
|
+
// What a view and per-device seat choices are kept for: the office and its style (All offices: its own key).
|
|
1535
|
+
const officeKey = overview ? `${ALL_ID}@tiles` : `${custom ? custom.id : AUTO_ID}@${baseSkin.id}`;
|
|
948
1536
|
const keep = (n) => !(hideAsleep && ASLEEP.has(n.state));
|
|
949
1537
|
const single = useMemo(() => {
|
|
950
1538
|
if (overview) return { rooms: [], width: 1, height: 1 }; // All offices: the tiles below
|
|
951
1539
|
const all = custom ? membersOf(custom, view) : [...new Map(officeRooms(view, filter).flatMap((r) => r.nodes).map((n) => [n.name, n])).values()];
|
|
952
1540
|
const nodes = all.filter(keep);
|
|
953
|
-
if (zones) {
|
|
1541
|
+
if (zones) {
|
|
1542
|
+
const skKey = shared ? "" : officeKey;
|
|
1543
|
+
// M-3533 (#4370): the seats given restart when the office or its style changes — on a shared page too (a room's
|
|
1544
|
+
// office, a share link), whose per-device seat choices are not kept (skKey ""), so a style with more seats is not
|
|
1545
|
+
// drawn with the old one's overflow spots.
|
|
1546
|
+
if (seatKeyRef.current !== officeKey) {
|
|
1547
|
+
seatKeyRef.current = officeKey;
|
|
1548
|
+
seatsRef.current = new Map();
|
|
1549
|
+
seatPrefsRef.current = skKey ? store.seats(skKey) : {};
|
|
1550
|
+
}
|
|
1551
|
+
const z = zonesLayout(skin.pack, nodes, seatsRef.current, { night, seatPrefs: skKey ? seatPrefsRef.current : null });
|
|
1552
|
+
seatsRef.current = z.seats;
|
|
1553
|
+
return z;
|
|
1554
|
+
}
|
|
954
1555
|
// The desks wrap at the stage's width at the scale they open on (desksK: a pixel level near one CSS px a unit).
|
|
955
1556
|
const deskW = Math.max(240, Math.floor(width / desksK(ratio)));
|
|
956
1557
|
if (!custom) return autoLayout(officeRooms(view, filter).map((r) => (hideAsleep ? { ...r, nodes: r.nodes.filter(keep) } : r)), { width: deskW });
|
|
957
1558
|
return officeScene(custom, nodes, skin, false, deskW);
|
|
958
|
-
}, [overview, view, filter, custom, width, ratio, skin, hideAsleep, night]);
|
|
1559
|
+
}, [overview, view, filter, custom, width, ratio, skin, hideAsleep, night, seatRev, officeKey, shared]);
|
|
959
1560
|
// ── #2554: All offices' tiles — each stored office (then the lobby: whoever is in no office) laid out as its own view
|
|
960
1561
|
// lays it out, in its own style (desks wrap at a cell's width), with its own seats, walkers and flights ──
|
|
961
1562
|
const lobbyAll = useMemo(() => (overview ? lobbyNodes(stored, view) : []), [overview, stored, view]);
|
|
@@ -998,23 +1599,81 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
998
1599
|
const wander = zones && !overview && !still && !layout;
|
|
999
1600
|
// #3685: who sits where on a visit, kept between ticks (the layout is rebuilt on every state change; the style's
|
|
1000
1601
|
// seats are not): someone who turns idle later never moves a visitor already there. A new style starts afresh.
|
|
1602
|
+
// M-3286: the office's "Idle people stay in their own area" (Edit offices): strolls stay in the area, no visits.
|
|
1603
|
+
const ownArea = !!custom && custom.stayInArea === true;
|
|
1001
1604
|
const visitMemo = useMemo(() => ({ claims: new Map(), idle: null }), [skin]);
|
|
1605
|
+
// M-3293: play — never on a share link's page (no onOpen there, or its own `talk`), with reduced motion, in All
|
|
1606
|
+
// offices, the carousel or Edit layout. `hold`: the person picked up (carried where the pointer is, walked back from
|
|
1607
|
+
// where they are dropped, or seated on another seat in their area: M-3445 #4266/#4267); `reacts`: pats and feeds showing.
|
|
1608
|
+
const play = playAllowed({ on: playOn, still, zones, overview, layout: !!layout, shared }) && !carouselPick;
|
|
1609
|
+
// M-3547 / M-3556: off only for reduced motion — one line under Drag and pat in Display options says so (no override).
|
|
1610
|
+
const playStillOff = playOffForMotion({ on: playOn, still, zones, overview, layout: !!layout, shared }) && !carouselPick;
|
|
1611
|
+
const hold = useMemo(() => createHold(), []), reacts = useRef(new Map()), walkNow = useRef(null), holdTimer = useRef(null);
|
|
1612
|
+
// #4504: the card's pose preview — { name, pose, t0 } while one is picked (this viewer's own, never stored or sent).
|
|
1613
|
+
const preview = useRef(null), [, setPreviewRev] = useState(0);
|
|
1614
|
+
// M-3432 (#4255): custom snacks from the active skin pack (client-local, only when play is enabled).
|
|
1615
|
+
const snacks = useMemo(() => createSnacks(), []);
|
|
1616
|
+
const snackDragCtrl = useMemo(() => createSnackDrag(), []);
|
|
1617
|
+
const packSnacks = useMemo(() => (skin && skin.pack && Array.isArray(skin.pack.snacks) ? skin.pack.snacks : []), [skin]);
|
|
1618
|
+
const snacksById = useMemo(() => new Map(packSnacks.map((s) => [s.id, s])), [packSnacks]);
|
|
1619
|
+
const showSnacks = play && packSnacks.length > 0;
|
|
1620
|
+
const [armedSnack, setArmedSnack] = useState(null);
|
|
1621
|
+
const [snackDrag, setSnackDrag] = useState(null);
|
|
1622
|
+
const snackDropRef = useRef(null), snackGhostRef = useRef(null), snackGhostPosRef = useRef(null), snackTrayRef = useRef(null), snackSwallowRef = useRef(false);
|
|
1623
|
+
const snackCtxRef = useRef({ showSnacks: false, officeKey: "", styleKey: "" });
|
|
1624
|
+
const onSnackClaim = (winner) => {
|
|
1625
|
+
reacts.current.set(winner, { kind: "feed", t0: now() });
|
|
1626
|
+
if (store.tellOn(winner)) void store.tell(winner, "feed");
|
|
1627
|
+
loop.current?.wake();
|
|
1628
|
+
};
|
|
1629
|
+
useEffect(() => { if (!play) { const wasHeld = !!hold.held(); snackDragCtrl.retire(); hold.cancel(); seatDropRef.current = null; reacts.current.clear(); snacks.clear(); snackDropRef.current = null; setArmedSnack(null); setSnackDrag(null); if (wasHeld) walkNow.current?.(); } }, [play]);
|
|
1630
|
+
useEffect(() => { if (!showSnacks) { snackDragCtrl.retire(); snackDropRef.current = null; setArmedSnack(null); setSnackDrag(null); } }, [showSnacks]);
|
|
1631
|
+
useEffect(() => () => { snackDragCtrl.retire(); }, []);
|
|
1002
1632
|
useEffect(() => {
|
|
1003
1633
|
if (!zones || overview) return undefined;
|
|
1004
1634
|
const go = () => {
|
|
1005
|
-
const t = now(), to = walkTargets(desksOf(L), L, t, wander, skin.pack.furniture, night, visitMemo);
|
|
1635
|
+
const t = now(), to = walkTargets(desksOf(L), L, t, wander, skin.pack.furniture, night, visitMemo, ownArea);
|
|
1006
1636
|
// An act's walk; not someone in bed for the night (#2568: bedtime wins, as for mail).
|
|
1007
1637
|
for (const d of desksOf(L)) { const a = actsHere.get(d.node.name), at = !d.night && actLive(a, d.node.state, Date.now(), actSeen.current) ? actTarget(a, L, walkers, t) : null; if (at) to.set(d.node.name, at); }
|
|
1008
1638
|
for (const [name, at] of mail.targets(L, t)) to.set(name, at);
|
|
1009
|
-
|
|
1639
|
+
// M-3539: a new office or style (a room's office reads its style after it opens) puts everyone at their place at
|
|
1640
|
+
// once: walking there from the old one's seats drew the asleep standing in the help desk for seconds.
|
|
1641
|
+
const placed = `${officeKey}\n${skin.id}`, fresh = placedRef.current !== placed;
|
|
1642
|
+
placedRef.current = placed;
|
|
1643
|
+
// A pack's vehicles: who wants to ride walks to the platform, boards when it stops there, gets off at a stop; a
|
|
1644
|
+
// caller gets off at once. Riders are set down where they are when their vehicle goes (fresh: the sync does).
|
|
1645
|
+
const vehicles = skin.pack.vehicles || [];
|
|
1646
|
+
let boarding = [];
|
|
1647
|
+
if (fresh) riders.clear();
|
|
1648
|
+
if (vehicles.length) {
|
|
1649
|
+
const byId = new Map(vehicles.map((v) => [v.id, v])), wall = Date.now(), here = desksOf(L);
|
|
1650
|
+
// An act's ride first; else (no other act going) a worker's seat on a vehicle while working (#4503).
|
|
1651
|
+
const wants = new Map(here.map((d) => {
|
|
1652
|
+
const { name, state } = d.node, a = actsHere.get(name);
|
|
1653
|
+
return [name, d.night ? null : rideLive(a, state, wall) ? a.ride : actLive(a, state, wall, actSeen.current) ? null : workVehicleOf(vehicles, name, state)];
|
|
1654
|
+
}));
|
|
1655
|
+
const r = riders.step({ wants, vehicles: byId, wall, posOf: (n) => walkers.at(n, t), homeOf: (n) => (here.find((d) => d.node.name === n) || {}).seat || null,
|
|
1656
|
+
sinceOf: (n) => { const a = actsHere.get(n); return a && a.ride && typeof a.since === "number" ? a.since : null; },
|
|
1657
|
+
urgent: (n) => { const d = here.find((x) => x.node.name === n); return !!d && CALLING.has(d.node.state); } });
|
|
1658
|
+
for (const [name, at] of r.targets) to.set(name, at);
|
|
1659
|
+
boarding = r.board.map((b) => { const v = byId.get(b.vehicle); return [b.name, () => seatAt(v, vehicleAt(v, Date.now()), b.seat)]; });
|
|
1660
|
+
for (const a of r.alight) walkers.place(a.name, a.at);
|
|
1661
|
+
} else for (const n of riders.clear()) { const p = walkers.at(n, t); if (p) walkers.place(n, p); }
|
|
1662
|
+
for (const [name, at] of snacks.targets(t)) to.set(name, at);
|
|
1663
|
+
const held = hold.held(); // M-3293: carried: where the pointer is, no walk
|
|
1664
|
+
if (held) to.set(held.name, held.at);
|
|
1665
|
+
cardStay(to, cardDesk.current, held, walkers, t); // their card is open: no walk, unless calling
|
|
1666
|
+
walkers.sync(to, t, L, still, fresh);
|
|
1667
|
+
for (const [name, seat] of boarding) walkers.ride(name, seat);
|
|
1010
1668
|
// Reduced motion has no loop: drawn again here, or an act's walk (set after the scene was drawn) never shows.
|
|
1011
1669
|
if (still) { if (scene.current && !globalThis.document?.hidden) draw(0); } else loop.current?.wake();
|
|
1012
1670
|
};
|
|
1013
1671
|
go();
|
|
1672
|
+
walkNow.current = go;
|
|
1014
1673
|
if (still) return undefined;
|
|
1015
1674
|
const h = setInterval(go, WANDER.TICK);
|
|
1016
1675
|
return () => clearInterval(h);
|
|
1017
|
-
}, [L, wander, mail, skin, night, actsHere, visitMemo]);
|
|
1676
|
+
}, [L, wander, mail, skin, night, actsHere, visitMemo, ownArea, riders]);
|
|
1018
1677
|
// …and in each tile on a zones style; the traffic within a tile is its own, between tiles the overview's.
|
|
1019
1678
|
useEffect(() => {
|
|
1020
1679
|
for (const tl of tiles) if (tl.zones) tl.walkers.sync(new Map(desksOf(tl.L).map((d) => [d.node.name, d.seat])), now(), tl.L, still);
|
|
@@ -1034,8 +1693,8 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1034
1693
|
const touched = useRef(false), fitted = useRef(false), drag = useRef(gestureState());
|
|
1035
1694
|
const miniViewRef = useRef(null), miniRef = useRef(null), overlayEl = useRef(null), tipDeskRef = useRef(null), pctRef = useRef(null);
|
|
1036
1695
|
const labelEls = useRef(new Map()); // #2554: the tiles' labels (tile key → element)
|
|
1037
|
-
|
|
1038
|
-
|
|
1696
|
+
snackCtxRef.current = { showSnacks, officeKey, styleKey };
|
|
1697
|
+
useEffect(() => { snackDragCtrl.retire(); hold.cancel(); seatDropRef.current = null; snacks.clear(); snackDropRef.current = null; setArmedSnack(null); setSnackDrag(null); }, [officeKey, styleKey]);
|
|
1039
1698
|
const keyRef = useRef(officeKey), saveTimer = useRef(0);
|
|
1040
1699
|
// The fit mode (Fit: contain; Fill: cover), kept per office and style like the view.
|
|
1041
1700
|
const [fitRev, setFitRev] = useState(0);
|
|
@@ -1068,22 +1727,65 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1068
1727
|
*/
|
|
1069
1728
|
const placeCard = () => {
|
|
1070
1729
|
const el = cardEl.current, c = cardDesk.current;
|
|
1071
|
-
if (!el || !c || !el.style
|
|
1730
|
+
if (!el || !c || !el.style) return;
|
|
1731
|
+
if (el.classList?.contains("sheet")) { el.style.removeProperty("max-height"); liftOverSheet(el, c); return; }
|
|
1072
1732
|
const v = view0(), sz = sizeRef.current;
|
|
1073
1733
|
const w = c.walks ? walkers.at(c.name, now()) : null;
|
|
1074
1734
|
const pt = w ? { x: w.x, y: w.y - 52, r: 16 } : { x: c.box.x + c.box.w / 2, y: c.box.y, r: (c.box.w / 2) * v.k };
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1735
|
+
// Its whole height (a card held shorter below an area's name scrolls: its content's height, not the box's).
|
|
1736
|
+
const sc = (typeof el.querySelector === "function" && el.querySelector(".oo-card-body")) || el;
|
|
1737
|
+
const natural = sc.scrollHeight ? sc.scrollHeight + ((el.offsetHeight || 0) - (sc.clientHeight || 0)) : 0;
|
|
1738
|
+
const p = toScreen(v, pt.x, pt.y), cw = el.offsetWidth || 320, ch = natural || el.offsetHeight || 260, gap = (c.skin?.pack?.card?.layout?.gap ?? 12) + pt.r;
|
|
1739
|
+
// M-3633: clear of the areas' names — where the Office writes each one (areaTitleBox, a few px around it), else, on a
|
|
1740
|
+
// pack's own picture, the corner a name painted there takes.
|
|
1741
|
+
// The scene's own layout and skin (the draw loop's: this runs in it, where the render's may be an older one).
|
|
1742
|
+
const sc0 = scene.current, part = sc0 && !sc0.overview ? sc0.part : null, sk0 = part && part.skin;
|
|
1743
|
+
const titled = !!(sk0 && sk0.areaTitleBox && sc0.ctx && sc0.env);
|
|
1744
|
+
const avoid = part && part.zones && part.L ? Object.values(part.L.areas || {}).map((ar) => {
|
|
1745
|
+
const b = titled ? sk0.areaTitleBox(sc0.ctx, ar, sc0.env) : null;
|
|
1746
|
+
const r = b ? { x: b.x - 4, y: b.y - 4, w: b.w + 8, h: b.h + 8 } : { x: ar.rect.x, y: ar.rect.y, w: Math.min(ar.rect.w, AREA_LABEL.w), h: Math.min(ar.rect.h, AREA_LABEL.h) };
|
|
1747
|
+
const q = toScreen(v, r.x, r.y);
|
|
1748
|
+
return { x: q.x, y: q.y, w: r.w * v.k, h: r.h * v.k };
|
|
1749
|
+
}) : [];
|
|
1750
|
+
const { x, y, maxH } = cardSpot({ px: p.x, py: p.y, gap, cw, ch, w: sz.w, h: sz.h, avoid });
|
|
1751
|
+
if (maxH) el.style.setProperty("max-height", `${Math.round(maxH)}px`); else el.style.removeProperty("max-height");
|
|
1080
1752
|
el.style.setProperty("transform", `translate(${Math.round(x)}px, ${Math.round(y)}px)`);
|
|
1081
1753
|
};
|
|
1754
|
+
/**
|
|
1755
|
+
* M-3633: a phone's bottom-sheet card covers the stage's foot. The scene is kept in the rest (setView's clampPan is
|
|
1756
|
+
* given the uncovered height: a scene smaller than it is centred there), and the person is brought above the sheet —
|
|
1757
|
+
* once each time the sheet's height changes, so a pan of their own is left alone. It closes: the whole stage again.
|
|
1758
|
+
*/
|
|
1759
|
+
const visSize = () => { const z = sizeRef.current || size; return { w: z.w, h: Math.max(1, z.h - sheetCover.current) }; };
|
|
1760
|
+
const liftOverSheet = (el, c) => {
|
|
1761
|
+
const st = stageRef.current;
|
|
1762
|
+
if (!st || typeof st.getBoundingClientRect !== "function" || typeof el.getBoundingClientRect !== "function") return;
|
|
1763
|
+
const cover = Math.max(0, Math.round(st.getBoundingClientRect().bottom - el.getBoundingClientRect().top));
|
|
1764
|
+
if (cover === sheetCover.current) return;
|
|
1765
|
+
sheetCover.current = cover;
|
|
1766
|
+
// The scene's current layout (this runs in the draw loop, where the render's `L` may be an older one).
|
|
1767
|
+
const LL = (scene.current && !scene.current.overview && scene.current.part && scene.current.part.L) || L;
|
|
1768
|
+
const v = view0(), w = c.walks ? walkers.at(c.name, now()) : null;
|
|
1769
|
+
const p = toScreen(v, w ? w.x : c.box.x + c.box.w / 2, w ? w.y : c.box.y + c.box.h), room = (sizeRef.current || size).h - cover - 16;
|
|
1770
|
+
vp.current = clampPan({ ...v, y: v.y - Math.max(0, p.y - room) }, LL.width, LL.height, visSize());
|
|
1771
|
+
apply();
|
|
1772
|
+
};
|
|
1773
|
+
const unliftSheet = () => {
|
|
1774
|
+
if (!sheetCover.current) return;
|
|
1775
|
+
sheetCover.current = 0;
|
|
1776
|
+
vp.current = clampPan(view0(), L.width, L.height, size);
|
|
1777
|
+
apply();
|
|
1778
|
+
};
|
|
1082
1779
|
/**
|
|
1083
1780
|
* Put the view on everything that shows it beside the canvas: the overview's frame (the part of the scene in view;
|
|
1084
1781
|
* the whole view on its data-k/x/y), the zoom's percentage, the overlay, the tooltip.
|
|
1085
1782
|
*/
|
|
1086
1783
|
const mark = () => {
|
|
1784
|
+
// M-3665: too far out to read the name tags (TAG_READ_K) in one office, the stage says so: the people's names then
|
|
1785
|
+
// show as a row of chips over its foot (the CSS: a phone's whole office, or a desk zoomed out), each opening their card.
|
|
1786
|
+
// #4466 Hide names (data-names-off on the same element): the row keeps only the callers, as the tags do.
|
|
1787
|
+
if (ooRef.current && typeof ooRef.current.toggleAttribute === "function") ooRef.current.toggleAttribute("data-tags-off", !overview && view0().k < TAG_READ_K);
|
|
1788
|
+
desksCue();
|
|
1087
1789
|
const v = view0(), m = miniViewRef.current;
|
|
1088
1790
|
if (m) {
|
|
1089
1791
|
const f = miniFrame(v, size, L.width, L.height);
|
|
@@ -1127,7 +1829,7 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1127
1829
|
* fit (a resize fits it again).
|
|
1128
1830
|
*/
|
|
1129
1831
|
const setView = (v, user = true, fit = false) => {
|
|
1130
|
-
vp.current = clampPan(v, L.width, L.height,
|
|
1832
|
+
vp.current = clampPan(v, L.width, L.height, visSize());
|
|
1131
1833
|
fitted.current = fit;
|
|
1132
1834
|
apply();
|
|
1133
1835
|
if (!user) return;
|
|
@@ -1140,11 +1842,13 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1140
1842
|
* under the zoom controls at the side.
|
|
1141
1843
|
*/
|
|
1142
1844
|
const fitL = (mode) => fitScene(L.width, L.height, size, mode, overview && mode !== "cover" ? FIT_PAD : 0);
|
|
1845
|
+
/** #4405: this scene's zoom floor — lower than OK_MIN for a pack's big canvas (or All offices), so − reaches its Fit. */
|
|
1846
|
+
const kLo = minK(L.width, L.height);
|
|
1143
1847
|
/** The view an office opens on: its kept one (a kept fit: fitted to this size), else its opening; and whether a fit. */
|
|
1144
1848
|
const openView = () => {
|
|
1145
1849
|
const kept = store.view(officeKey);
|
|
1146
1850
|
if (kept && kept.fit) return { v: fitL(fitMode), fit: true };
|
|
1147
|
-
if (kept) return { v: viewFromSaved(kept, size), fit: false };
|
|
1851
|
+
if (kept) return { v: viewFromSaved(kept, size, kLo), fit: false };
|
|
1148
1852
|
const fitted0 = zones || overview; // All offices opens whole, as a zones scene
|
|
1149
1853
|
return { v: overview ? fitL(fitMode) : openingView(L.width, L.height, size, ratio, fitted0, fitMode), fit: fitted0 };
|
|
1150
1854
|
};
|
|
@@ -1165,7 +1869,7 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1165
1869
|
else if (!touched.current) reopen();
|
|
1166
1870
|
else { const v = vp.current, cx = (was.w / 2 - v.x) / v.k, cy = (was.h / 2 - v.y) / v.k; vp.current = { k: v.k, x: size.w / 2 - cx * v.k, y: size.h / 2 - cy * v.k }; }
|
|
1167
1871
|
} else if (fitted.current) vp.current = fitL(fitMode); // the scene's size changed
|
|
1168
|
-
vp.current = clampPan(view0(), L.width, L.height,
|
|
1872
|
+
vp.current = clampPan(view0(), L.width, L.height, visSize());
|
|
1169
1873
|
raw.current = vp.current.k;
|
|
1170
1874
|
}, [officeKey, size.w, size.h, ratio, L.width, L.height]);
|
|
1171
1875
|
useEffect(() => () => flushSave(), []);
|
|
@@ -1177,8 +1881,9 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1177
1881
|
store.saveFitMode(officeKey, next); setFitRev((n) => n + 1);
|
|
1178
1882
|
fit(next);
|
|
1179
1883
|
};
|
|
1884
|
+
useEffect(() => { if (!miniOff) mark(); }, [miniOff]); // shown again: placed on the view at once
|
|
1180
1885
|
/** + / −: the next pixel level about the stage's middle. */
|
|
1181
|
-
const zoomStep = (dir) => { const v = view0(), k = stepK(v.k, dir, ratio); raw.current = k; setView(zoomTo(v, k, size.w / 2, size.h / 2)); };
|
|
1886
|
+
const zoomStep = (dir) => { const v = view0(), k = stepK(v.k, dir, ratio, kLo); raw.current = k; setView(zoomTo(v, k, size.w / 2, size.h / 2)); };
|
|
1182
1887
|
/** Bring a box (logical units) into view, unchanged when it already is. */
|
|
1183
1888
|
const show = (b) => {
|
|
1184
1889
|
const v = view0(), p = toScreen(v, b.x, b.y);
|
|
@@ -1227,8 +1932,16 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1227
1932
|
const key = (e) => {
|
|
1228
1933
|
if (e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
1229
1934
|
if (e.key === "Escape") { if (fsRef.current === "immersive") { e.preventDefault(); exitFs(); } return; }
|
|
1935
|
+
const tg = e.target;
|
|
1936
|
+
// #4010: carousel keys at document level so a TV remote works without the canvas focused. Not while a field,
|
|
1937
|
+
// button or link is focused (Space/arrows stay with that control) or over Edit offices / Edit layout.
|
|
1938
|
+
const ck = carouselAct.current;
|
|
1939
|
+
if (ck.on && !carouselHeld(tg) && !editingRef.current && !layoutRef.current) {
|
|
1940
|
+
const a = carouselKey(e);
|
|
1941
|
+
if (a) { e.preventDefault(); ck.act(a); return; }
|
|
1942
|
+
}
|
|
1230
1943
|
if (e.key !== "f" && e.key !== "F") return;
|
|
1231
|
-
const el = ooRef.current
|
|
1944
|
+
const el = ooRef.current;
|
|
1232
1945
|
// Only here: from inside the view, or with nothing focused (never while typing, nor over Edit offices' dialog).
|
|
1233
1946
|
if (!el || typing(tg) || editingRef.current || !(tg === d.body || tg === d.documentElement || tg === d || (tg && el.contains(tg)))) return;
|
|
1234
1947
|
e.preventDefault();
|
|
@@ -1253,12 +1966,21 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1253
1966
|
return () => root.classList.remove("oo-immersive");
|
|
1254
1967
|
}, [fs]);
|
|
1255
1968
|
/** A desk opens its chat: out of fullscreen first (the chat is beside the view, or instead of it). */
|
|
1256
|
-
const open = (name) => {
|
|
1969
|
+
const open = (name) => {
|
|
1970
|
+
if (!onOpen) return;
|
|
1971
|
+
if (tmode !== "window") { setTalkTo(name); return; }
|
|
1972
|
+
if (fsRef.current) exitFs();
|
|
1973
|
+
onOpen(name);
|
|
1974
|
+
};
|
|
1975
|
+
/** The whole chat (the pop-up), from a talk in the Office. */
|
|
1976
|
+
const openFull = () => { if (!onOpen || !talkTo) return; if (fsRef.current) exitFs(); onOpen(talkTo); };
|
|
1257
1977
|
|
|
1258
1978
|
// ── Drawing: the back and front layers are pictures of the scene at the view's resolution (remade when the office
|
|
1259
1979
|
// or the zoom changes, never on a pan); each frame draws the matte, the layers, the people and the items in the air ──
|
|
1260
1980
|
const scene = useRef(null);
|
|
1261
1981
|
const loop = useRef(null);
|
|
1982
|
+
const clipClocks = useRef(null);
|
|
1983
|
+
if (!clipClocks.current) clipClocks.current = createClipClocks();
|
|
1262
1984
|
// The matte around the scene: the pack's own, else its background's edge (sampled once), else the skin's (tokens);
|
|
1263
1985
|
// All offices: the dashboard's background (each tile is its own scene).
|
|
1264
1986
|
const matte = overview ? pal.bg : (skin.pack && skin.pack.matte) || sampledMatte(skin.backdrop) || (skin.matte ? skin.matte({ pal, mode }) : pal.bg);
|
|
@@ -1274,30 +1996,55 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1274
1996
|
cv.style.setProperty("width", `${BW / ratio}px`);
|
|
1275
1997
|
cv.style.setProperty("height", `${BH / ratio}px`);
|
|
1276
1998
|
const env = { pal, mode, labels: { lobby: to("lobbyRoom"), closed: to("closed"), areas: { desks: to("area_desks"), lounge: to("area_lounge"), alert: to("area_alert"), nap: to("area_nap") } } };
|
|
1277
|
-
const
|
|
1999
|
+
const maxPackFps = overview
|
|
2000
|
+
? Math.max(0, ...tiles.map((tl) => packMaxFps(tl.skin && tl.skin.pack)))
|
|
2001
|
+
: packMaxFps(skin && skin.pack);
|
|
2002
|
+
const fps = Math.max(FPS, Math.min(30, Math.ceil(maxPackFps)));
|
|
2003
|
+
const base = { ctx, ratio, BW, BH, matte, env, fps, dirty: true, namesOff };
|
|
1278
2004
|
if (overview) {
|
|
1279
2005
|
// Each tile a scene of its own, where the overview puts it (arranged.tiles, in the same order).
|
|
1280
2006
|
const parts = tiles.map((tl, i) => ({ ...partOf(tl.L, tileLooks[i], tl.skin, tl.zones, tl.walkers, tl.flights), night, key: tl.key, prefix: tl.prefix, tile: arranged.tiles[i], ups: ups.current, levelsOn: !!(lv && lv.enabled), levels: wordsOf(tl.skin) }));
|
|
1281
2007
|
scene.current = { ...base, overview: true, parts, lay: arranged };
|
|
1282
2008
|
} else {
|
|
1283
|
-
scene.current = { ...base, overview: false, part: { ...partOf(L, looks, skin, zones, walkers, flights), ghosts, night, mail, acts: actsHere, actSeen: actSeen.current, ups: ups.current, levelsOn: !!(lv && lv.enabled), levels: wordsOf(skin)
|
|
2009
|
+
scene.current = { ...base, overview: false, part: { ...partOf(L, looks, skin, zones, walkers, flights), ghosts, night, mail, acts: actsHere, actSeen: actSeen.current, ups: ups.current, levelsOn: !!(lv && lv.enabled), levels: wordsOf(skin), reacts: reacts.current, preview, riding: riders.riding, waitingFor: riders.waitingFor,
|
|
2010
|
+
hold: play ? hold : null, seatDrop: seatDropRef,
|
|
2011
|
+
snacks: play ? snacks : null, snacksById, ownArea, snackDrop: snackDropRef, onSnackClaim, onSnacksChanged: () => walkNow.current?.() } };
|
|
1284
2012
|
}
|
|
1285
2013
|
if (still) draw(0); else loop.current?.wake();
|
|
1286
|
-
}, [L, looks, skin, pal, size.w, size.h, ratio, matte, overview, tiles, tileLooks, arranged, ghosts, night, mail, actsHere, lv, wordsOf]);
|
|
2014
|
+
}, [L, looks, skin, pal, size.w, size.h, ratio, matte, overview, tiles, tileLooks, arranged, ghosts, night, mail, actsHere, lv, wordsOf, play, snacksById, ownArea, namesOff]);
|
|
1287
2015
|
|
|
1288
2016
|
/** One frame at `ms` (0: still); whether anything is moving (in the air, or someone walking). */
|
|
1289
2017
|
function draw(ms) {
|
|
1290
2018
|
const s = scene.current;
|
|
1291
2019
|
if (!s) return false;
|
|
1292
2020
|
placeCard();
|
|
1293
|
-
const { ctx, BW, BH, env }
|
|
2021
|
+
const { ctx, BW, BH } = s, env = { ...s.env, ratio: s.ratio }; // ratio: drawPart's CSS zoom is a / ratio (Prism #4423)
|
|
2022
|
+
s.bubbleHits = [];
|
|
2023
|
+
const seenClips = ms > 0 ? new Set() : null;
|
|
2024
|
+
const clocked = (prefix) => (seenClips
|
|
2025
|
+
? { ...env, clock: (k, st, t) => { const fk = `${prefix}${k}`; seenClips.add(fk); return clipClocks.current.elapsed(fk, st, t); } }
|
|
2026
|
+
: env);
|
|
1294
2027
|
// The view in bitmap px: a logical unit is `a` px (a whole number at a pixel level), the origin on a whole px.
|
|
1295
2028
|
const v = view0(), a = v.k * s.ratio, ox = Math.round(v.x * s.ratio), oy = Math.round(v.y * s.ratio);
|
|
1296
2029
|
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
1297
2030
|
ctx.clearRect(0, 0, BW, BH);
|
|
1298
2031
|
ctx.fillStyle = s.matte; ctx.fillRect(0, 0, BW, BH);
|
|
1299
2032
|
ctx.imageSmoothingEnabled = false;
|
|
1300
|
-
|
|
2033
|
+
for (const p of s.overview ? s.parts : [s.part]) p.reply = replyRef.current ? { ...replyRef.current, ratio: s.ratio } : null;
|
|
2034
|
+
if (!s.overview) {
|
|
2035
|
+
// #4379 review: an open card (beside its person, or a bottom sheet) covers part of the scene: a name tag under it is
|
|
2036
|
+
// left out whole, never a fragment showing past its edge. Its box in bitmap px, as the canvas lies on the page.
|
|
2037
|
+
const cardNow = cardEl.current, cvNow = canvasRef.current;
|
|
2038
|
+
if (cardNow && cvNow && typeof cardNow.getBoundingClientRect === "function" && typeof cvNow.getBoundingClientRect === "function") {
|
|
2039
|
+
const r = cardNow.getBoundingClientRect(), c = cvNow.getBoundingClientRect();
|
|
2040
|
+
s.part.cover = r.width > 0 && r.height > 0 ? { x: (r.left - c.left) * s.ratio, y: (r.top - c.top) * s.ratio, w: r.width * s.ratio, h: r.height * s.ratio } : null;
|
|
2041
|
+
} else s.part.cover = null;
|
|
2042
|
+
const e0 = clocked(""), kc = keepClearOf(canvasRef.current, v);
|
|
2043
|
+
// M-3665 (too far out to read: no tags) and #4466 (Hide names: callers keep theirs), as the All-offices tiles do.
|
|
2044
|
+
const moved = drawPart(ctx, s.part, a, ox, oy, ms, still, tipNow.current, kc.length ? { ...e0, keepClear: kc } : e0, v.k < TAG_READ_K || (s.namesOff ? "names" : false), null, s.bubbleHits);
|
|
2045
|
+
if (seenClips) clipClocks.current.prune(seenClips);
|
|
2046
|
+
return drawDialogue(ctx, s, ms) || moved;
|
|
2047
|
+
}
|
|
1301
2048
|
// All offices: each tile on screen drawn as its own view, scaled into it and clipped to it; one off screen is not
|
|
1302
2049
|
// drawn (its flights still land). Then a frame round each tile, and the items flying between tiles.
|
|
1303
2050
|
const hot = tipNow.current, on = new Set(visibleTiles(s.lay, v, sizeRef.current).map((tt) => tt.key)), said = [];
|
|
@@ -1309,7 +2056,7 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1309
2056
|
ctx.save();
|
|
1310
2057
|
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
1311
2058
|
ctx.beginPath(); ctx.rect(tx, ty, tw, th); ctx.clip();
|
|
1312
|
-
if (drawPart(ctx, p, a * tt.s, tx, ty, ms, still, hot && hot.startsWith(p.prefix) ? hot.slice(p.prefix.length) : null,
|
|
2059
|
+
if (drawPart(ctx, p, a * tt.s, tx, ty, ms, still, hot && hot.startsWith(p.prefix) ? hot.slice(p.prefix.length) : null, clocked(p.prefix), v.k * tt.s < TAG_MIN_K || (s.namesOff ? "names" : false), said, s.bubbleHits)) moving = true;
|
|
1313
2060
|
ctx.restore();
|
|
1314
2061
|
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
1315
2062
|
ctx.strokeStyle = env.pal.border; ctx.lineWidth = 1;
|
|
@@ -1319,11 +2066,13 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1319
2066
|
const up = still ? [] : cross.frame(ms, s.parts);
|
|
1320
2067
|
// Each drawn by its sender's tile's skin (#2562: their own prop, else that pack's for its kind), at that tile's scale;
|
|
1321
2068
|
// a sender in no tile drawn: the built-in item, in overview units.
|
|
2069
|
+
const crossEnv = clocked("x:");
|
|
1322
2070
|
for (const it of up) {
|
|
1323
2071
|
const from = senderTile(s.parts, it.from);
|
|
1324
|
-
if (from) { ctx.setTransform(a * from.tile.s, 0, 0, a * from.tile.s, ox, oy); from.skin.drawProp(ctx, { ...it, x: it.x / from.tile.s, y: it.y / from.tile.s }, ms,
|
|
1325
|
-
else { ctx.setTransform(a, 0, 0, a, ox, oy); skinFor("pixel").drawProp(ctx, it, ms,
|
|
2072
|
+
if (from) { ctx.setTransform(a * from.tile.s, 0, 0, a * from.tile.s, ox, oy); from.skin.drawProp(ctx, { ...it, x: it.x / from.tile.s, y: it.y / from.tile.s }, ms, crossEnv); }
|
|
2073
|
+
else { ctx.setTransform(a, 0, 0, a, ox, oy); skinFor("pixel").drawProp(ctx, it, ms, crossEnv); }
|
|
1326
2074
|
}
|
|
2075
|
+
if (seenClips) clipClocks.current.prune(seenClips);
|
|
1327
2076
|
return drawDialogue(ctx, s, ms) || moving || up.length > 0 || cross.size() > 0;
|
|
1328
2077
|
}
|
|
1329
2078
|
/**
|
|
@@ -1331,15 +2080,26 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1331
2080
|
* awake (pickFront), with their faces (the pack's portraits; else the agent's avatar, else initials), the speaker's
|
|
1332
2081
|
* words typed out, the agent's line while it works and "+N". Nothing at all while it is off. Whether it moves.
|
|
1333
2082
|
*/
|
|
1334
|
-
function drawDialogue(
|
|
2083
|
+
function drawDialogue(_mapCtx, s, ms) {
|
|
1335
2084
|
const d = dlgRef.current;
|
|
1336
|
-
if (!d) { dlgShown.current = null; return false; }
|
|
2085
|
+
if (!d) { dlgShown.current = null; showDialogueDock(false); return false; }
|
|
1337
2086
|
const t = ms > 0 ? ms : now();
|
|
1338
2087
|
const { front, more } = pickFront(dlg.list(), (n) => d.who.has(n), (n) => d.who.get(n).look?.pose === "paused");
|
|
1339
|
-
if (!front) { dlgShown.current = null; return false; }
|
|
1340
|
-
const who = d.who.get(front.instance), node = who.node
|
|
2088
|
+
if (!front) { dlgShown.current = null; showDialogueDock(false); return false; }
|
|
2089
|
+
const who = d.who.get(front.instance), node = who.node;
|
|
1341
2090
|
const stage = stageOf(front, t, node.state === "working", still);
|
|
1342
|
-
|
|
2091
|
+
// Talk "Dialogue box" (d.vn) keeps an answer until it is clicked away in its own box (TalkStage); the dock is not drawn then.
|
|
2092
|
+
if (stage.done && !d.vn) { dlgShown.current = null; showDialogueDock(false); return false; }
|
|
2093
|
+
showDialogueDock(true);
|
|
2094
|
+
const cv = dialogueCanvasRef.current;
|
|
2095
|
+
if (!cv) return false; // layout commit mounts the dock, then its effect paints even with reduced motion
|
|
2096
|
+
const dw = cv.clientWidth || sizeRef.current.w, dh = cv.clientHeight || (phone ? 160 : 180), L0 = boxLayout(dw, dh);
|
|
2097
|
+
const BW = Math.max(1, Math.floor(dw * s.ratio)), BH = Math.max(1, Math.floor(dh * s.ratio));
|
|
2098
|
+
if (cv.width !== BW) cv.width = BW;
|
|
2099
|
+
if (cv.height !== BH) cv.height = BH;
|
|
2100
|
+
const ctx = cv.getContext("2d");
|
|
2101
|
+
if (!ctx) return false;
|
|
2102
|
+
ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.clearRect(0, 0, BW, BH);
|
|
1343
2103
|
const skinOf = who.skin, pack = skinOf && skinOf.pack;
|
|
1344
2104
|
const pic = (src) => (src && skinOf && typeof skinOf.picture === "function" ? skinOf.picture(src, dlgWake) : null);
|
|
1345
2105
|
const agentName = nodeText(node).primary;
|
|
@@ -1377,27 +2137,39 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1377
2137
|
dlgShown.current = { L, stage, key: who.key, name: front.instance };
|
|
1378
2138
|
const frameSrc = pack && pack.dialogBox && pack.dialogBox.frame, frameIm = frameSrc ? pic(frameSrc) : null;
|
|
1379
2139
|
return drawBox(ctx, {
|
|
1380
|
-
|
|
2140
|
+
// A short landscape dock keeps the name and words; decorative faces need headroom above the box.
|
|
2141
|
+
L, stage, left: dh >= 144 ? personFace() : null, right: dh < 144 || stage.phase === "heard" ? null : agentFace(),
|
|
1381
2142
|
name: answered ? agentName : front.person ? front.person.name || to("dlgSomeone") : to("dlgSomeone"),
|
|
1382
2143
|
lines, status: status ? `${agentName} · ${status}` : null, more,
|
|
1383
2144
|
colours: boxColours(pack && pack.dialogBox, s.env.pal), frame: frameIm ? { im: frameIm, slice: pack.dialogBox.slice || 8, k: pack.scale || 2 } : null,
|
|
1384
2145
|
}, t, { ...s.env, still });
|
|
1385
2146
|
}
|
|
2147
|
+
// A newly mounted dock must paint even when reduced motion leaves the map loop asleep.
|
|
2148
|
+
useLayoutEffect(() => {
|
|
2149
|
+
if (!dlgOn || !dlgVisible) return;
|
|
2150
|
+
if (scene.current) drawDialogue(scene.current.ctx, scene.current, still ? 0 : now());
|
|
2151
|
+
if (!still) loop.current?.wake();
|
|
2152
|
+
}, [dlgOn, dlgVisible, dlgSay, width, phone, ratio]);
|
|
2153
|
+
|
|
1386
2154
|
// The loop: drawing only when the frame (FPS) changed or something is in the air; stopped while the tab is hidden,
|
|
1387
|
-
// gone with the view. Office review: while something walks or flies,
|
|
2155
|
+
// gone with the view. Office review: while something walks or flies, a frame every display frame up to AIR_FPS (the
|
|
1388
2156
|
// motion is smooth); when nothing moves, the poses change at most FPS times a second, so the loop sleeps (a timer)
|
|
1389
2157
|
// until the next frame's start instead of waking at the display's rate only to find nothing to draw.
|
|
1390
2158
|
useEffect(() => {
|
|
1391
2159
|
if (still || typeof requestAnimationFrame !== "function") return undefined;
|
|
1392
|
-
let raf = 0, timer = 0, last = -1, air = true, gone = false;
|
|
2160
|
+
let raf = 0, timer = 0, last = -1, lastFps = FPS, air = true, gone = false, drawnAt = -Infinity;
|
|
1393
2161
|
const tick = () => {
|
|
1394
2162
|
raf = 0;
|
|
1395
2163
|
if (gone || globalThis.document?.hidden || !scene.current) return;
|
|
1396
|
-
const
|
|
1397
|
-
|
|
2164
|
+
const fps = scene.current.fps || FPS;
|
|
2165
|
+
const ms = now(), frame = Math.floor((ms / 1000) * fps); // the clock the trips started on
|
|
2166
|
+
const due = air && ms - drawnAt >= 1000 / AIR_FPS - 4; // a 60/120 Hz screen: every 2nd/4th frame
|
|
2167
|
+
if (scene.current.dirty || frame !== last || fps !== lastFps || due) { scene.current.dirty = false; last = frame; lastFps = fps; drawnAt = ms; air = draw(ms); }
|
|
1398
2168
|
if (air) { raf = requestAnimationFrame(tick); return; }
|
|
1399
|
-
const wait = Math.max(1, Math.ceil(((frame + 1) * 1000) /
|
|
1400
|
-
|
|
2169
|
+
const wait = Math.max(1, Math.ceil(((frame + 1) * 1000) / fps - ms)); // until the next frame starts
|
|
2170
|
+
if (fps > FPS && wait <= 16) { raf = requestAnimationFrame(tick); return; }
|
|
2171
|
+
const sleep = fps > FPS ? Math.max(1, wait - 14) : wait;
|
|
2172
|
+
timer = setTimeout(() => { timer = 0; if (!gone && !raf) raf = requestAnimationFrame(tick); }, sleep);
|
|
1401
2173
|
};
|
|
1402
2174
|
const wake = () => {
|
|
1403
2175
|
air = true;
|
|
@@ -1435,9 +2207,39 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1435
2207
|
area: tl.zones ? areaName(d.area) : roomOf(tl.L, d), skin: tl.skin, look: lk && lk.get(d.key) })) : []; })
|
|
1436
2208
|
: desksOf(L).map((d) => ({ key: d.key, node: d.node, box: d, office: null, dot: zones ? d.seat : { x: d.x + d.w / 2, y: d.y + d.h / 2 },
|
|
1437
2209
|
area: zones ? areaName(d.area) : roomOf(L, d), skin, look: looks.get(d.key) }));
|
|
2210
|
+
// The name row's fade (desksCue) follows who is in it and how wide the stage is, as well as the zoom (mark).
|
|
2211
|
+
useEffect(() => { desksCue(); }, [people.length, size.w, namesOff]);
|
|
1438
2212
|
// #2861: who the dialogue box may speak for — everyone drawn here (All offices: the first tile they are in), with what
|
|
1439
2213
|
// draws them; null while it is off (draw() then draws nothing of it).
|
|
1440
|
-
|
|
2214
|
+
replyRef.current = tmode === "bubble" ? { chat, draw: chatUi.drawReply, style: chatUi.replyStyle, pace: chatUi.readPace, read: readMode } : null;
|
|
2215
|
+
const talkWho = talkTo ? people.find((d) => d.node && d.node.name === talkTo) || null : null;
|
|
2216
|
+
const talkLabel = talkWho ? nodeText(talkWho.node).primary : talkTo;
|
|
2217
|
+
const sidePanel = tmode === "panel" && !!talkTo;
|
|
2218
|
+
/** Talk "Dialogue box": what the box on the scene shows now (fleet-office-talk.js TalkStage), or null. */
|
|
2219
|
+
const stagePeek = () => {
|
|
2220
|
+
const d = dlgRef.current;
|
|
2221
|
+
const pf = d ? pickFront(dlg.list(), (n) => d.who.has(n), (n) => d.who.get(n).look?.pose === "paused") : { front: null, more: 0 };
|
|
2222
|
+
const conv = pf.front, name = conv ? conv.instance : talkTo;
|
|
2223
|
+
if (!name) return null;
|
|
2224
|
+
const who = d ? d.who.get(name) : null, node = who ? who.node : (people.find((x) => x.node && x.node.name === name) || {}).node;
|
|
2225
|
+
if (!node) return null;
|
|
2226
|
+
const sk = (who && who.skin) || skin, pack = sk && sk.pack, act = actsHere && actsHere.get(name);
|
|
2227
|
+
const pic = (src) => { const im = src && sk && typeof sk.picture === "function" ? sk.picture(src, () => {}) : null; return im && im.src ? im.src : null; };
|
|
2228
|
+
return {
|
|
2229
|
+
name, label: nodeText(node).primary, conv, more: pf.more,
|
|
2230
|
+
status: node.state === "working" ? (actLive(act, node.state, Date.now(), null) && act.say ? act.say : to("dlgWorking")) : null,
|
|
2231
|
+
portrait: pack ? pic(portraitSrc(pack, { agent: name, state: node.state })) : null,
|
|
2232
|
+
colours: (pack && pack.dialogBox) || null,
|
|
2233
|
+
};
|
|
2234
|
+
};
|
|
2235
|
+
const stageOps = {
|
|
2236
|
+
now, skip: () => skipTalk(), target: (n) => { if (talkTo !== n) setTalkTo(n); },
|
|
2237
|
+
drop: (instance) => { dlg.drop(instance); dlgWake(); },
|
|
2238
|
+
};
|
|
2239
|
+
// The dialogue box is the talk only as itself (or beside the pop-up): never under the side panel or the head bubble.
|
|
2240
|
+
const dockShown = dlgOn && dlgVisible && tmode === "window";
|
|
2241
|
+
dlgRef.current = dlgOn ? {
|
|
2242
|
+
vn: tmode === "box", read: readMode,
|
|
1441
2243
|
who: new Map(people.filter((d) => d.node && d.node.name).reverse().map((d) => [d.node.name, { key: d.key, node: d.node, look: d.look, skin: d.skin || skin }])),
|
|
1442
2244
|
acts: actsHere, share: talk !== undefined,
|
|
1443
2245
|
} : null;
|
|
@@ -1467,30 +2269,121 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1467
2269
|
return d ? { key: p.prefix + d.key, node: d.node } : null;
|
|
1468
2270
|
};
|
|
1469
2271
|
const g = gestures(drag.current, { el: () => stageRef.current, pan: (dx, dy) => { const v = view0(); setView({ ...v, x: v.x + dx, y: v.y + dy }); },
|
|
1470
|
-
pinch: (from, to) => { raw.current = Math.min(OK_MAX, Math.max(
|
|
2272
|
+
pinch: (from, to) => { raw.current = Math.min(OK_MAX, Math.max(kLo, raw.current * (to.dist / from.dist))); setView(pinchOffice(view0(), from, to, raw.current, kLo)); } });
|
|
1471
2273
|
/** Where a drag pans: the canvas, and Edit layout's overlay off its handles (the controls, the bar and the list: never). */
|
|
1472
2274
|
const onScene = (el) => !!el && (el === canvasRef.current || (typeof el.closest === "function" && !!el.closest(".ol-svg") && !el.closest(".ol-handle")));
|
|
2275
|
+
/** M-3293 / M-3445: update the floor-level seat drop targets while carrying `h` ({ name, at }). */
|
|
2276
|
+
const updateSeatDrop = (h) => {
|
|
2277
|
+
if (!h || !zones || !skin || !skin.pack) { seatDropRef.current = null; return; }
|
|
2278
|
+
const ds = desksOf(L);
|
|
2279
|
+
seatDropRef.current = {
|
|
2280
|
+
name: h.name,
|
|
2281
|
+
targets: seatDropTargets(skin.pack, ds, h.name),
|
|
2282
|
+
hover: findSeatDropTarget(skin.pack, ds, h.name, h.at),
|
|
2283
|
+
};
|
|
2284
|
+
};
|
|
2285
|
+
/** M-3293 / M-3445: someone picked up — enters `dragged` pose under the pointer, highlights valid seats in their area. */
|
|
2286
|
+
const pickedUp = (pointerId) => {
|
|
2287
|
+
const h = hold.held();
|
|
2288
|
+
if (!h) return;
|
|
2289
|
+
// Captured only now: a press that stays a click must reach the canvas (its card), which a capture would take away.
|
|
2290
|
+
try { stageRef.current.setPointerCapture(pointerId); } catch { /* gone */ }
|
|
2291
|
+
snacks.cancel(h.name);
|
|
2292
|
+
updateSeatDrop(h);
|
|
2293
|
+
walkers.place(h.name, h.at); drag.current.swallow = true;
|
|
2294
|
+
setTip(null); setCard(null); loop.current?.wake();
|
|
2295
|
+
};
|
|
1473
2296
|
const onDown = (e) => {
|
|
1474
2297
|
lastType.current = e.pointerType || "mouse";
|
|
1475
2298
|
if (!onScene(e.target)) return;
|
|
2299
|
+
// M-3293: a press on a person may pick them up — a mouse once it moves (no pan then), a touch once held still
|
|
2300
|
+
// (LONG_MS; a finger that moves first pans, as before).
|
|
2301
|
+
if (play && e.isPrimary !== false && !(e.pointerType === "mouse" && e.button !== 0)) {
|
|
2302
|
+
const d = deskOf(e), w = pointOf(e);
|
|
2303
|
+
const st = d && d.node && d.node.i && w ? hold.down(e.pointerId, e.pointerType || "mouse", w.x, w.y, now(), d.node.name, e.clientX, e.clientY) : hold.down(e.pointerId, "mouse", 0, 0, 0, null);
|
|
2304
|
+
if (st === "maybe") return; // no pan: a click (their card), or a pick-up once it moves
|
|
2305
|
+
if (st === "press") { const id = e.pointerId; clearTimeout(holdTimer.current); holdTimer.current = setTimeout(() => { if (hold.tick(now()) === "held") pickedUp(id); }, PLAY.LONG_MS); }
|
|
2306
|
+
}
|
|
1476
2307
|
g.down(e);
|
|
1477
2308
|
if (drag.current.pts.size === 2) raw.current = view0().k; // a pinch starts from the zoom shown
|
|
1478
2309
|
};
|
|
2310
|
+
/** M-3293 / M-3445: while a press may pick someone up it is theirs (no pan); once held it carries them; a finger that moved first pans. */
|
|
2311
|
+
const onStageMove = (e) => {
|
|
2312
|
+
if (hold.state()) {
|
|
2313
|
+
const w = pointOf(e), was = hold.state();
|
|
2314
|
+
const st = w ? hold.move(e.pointerId, w.x, w.y, now(), e.clientX, e.clientY) : hold.state();
|
|
2315
|
+
if (st === "held") {
|
|
2316
|
+
if (was !== "held") pickedUp(e.pointerId);
|
|
2317
|
+
else { const h = hold.held(); updateSeatDrop(h); walkers.place(h.name, h.at); loop.current?.wake(); }
|
|
2318
|
+
return;
|
|
2319
|
+
}
|
|
2320
|
+
if (st === "maybe" || st === "press") return;
|
|
2321
|
+
if (st === "pan") { clearTimeout(holdTimer.current); hold.cancel(); seatDropRef.current = null; }
|
|
2322
|
+
}
|
|
2323
|
+
g.move(e);
|
|
2324
|
+
};
|
|
2325
|
+
/** M-3445 (#4266): settle a dragged character onto a valid seat in their area (or clamp/walk back to their seat). */
|
|
2326
|
+
const finishHoldDrop = (r, commitSeat) => {
|
|
2327
|
+
seatDropRef.current = null;
|
|
2328
|
+
if (!r) return;
|
|
2329
|
+
const ds = desksOf(L);
|
|
2330
|
+
const target = commitSeat && zones && skin && skin.pack ? findSeatDropTarget(skin.pack, ds, r.name, r.at) : null;
|
|
2331
|
+
if (target) {
|
|
2332
|
+
if (!target.current) {
|
|
2333
|
+
const res = applySeatDrop({ pack: skin.pack, desks: ds, seats: seatsRef.current, prefs: seatPrefsRef.current, name: r.name, target });
|
|
2334
|
+
seatsRef.current = res.seats;
|
|
2335
|
+
seatPrefsRef.current = res.prefs;
|
|
2336
|
+
if (!shared) store.saveSeats(officeKey, res.prefs);
|
|
2337
|
+
if (res.swapped) {
|
|
2338
|
+
const occPos = walkers.at(res.swapped.name, now()) || { x: target.x, y: target.y };
|
|
2339
|
+
if (ownArea && !routeStaysInArea(occPos, res.swapped.seat, L, target.area, null)) {
|
|
2340
|
+
walkers.place(res.swapped.name, res.swapped.seat);
|
|
2341
|
+
}
|
|
2342
|
+
}
|
|
2343
|
+
walkers.place(r.name, { x: target.x, y: target.y });
|
|
2344
|
+
setSeatRev((n) => n + 1);
|
|
2345
|
+
} else {
|
|
2346
|
+
walkers.place(r.name, { x: target.x, y: target.y });
|
|
2347
|
+
walkNow.current?.();
|
|
2348
|
+
}
|
|
2349
|
+
} else {
|
|
2350
|
+
const d = ds.find((x) => x && x.node && x.node.name === r.name);
|
|
2351
|
+
const landAt = ownArea && d ? clampDropForArea(r.at, d.seat, L, d.area) : r.at;
|
|
2352
|
+
walkers.place(r.name, landAt);
|
|
2353
|
+
walkNow.current?.();
|
|
2354
|
+
}
|
|
2355
|
+
loop.current?.wake();
|
|
2356
|
+
};
|
|
2357
|
+
const onStageUp = (e) => {
|
|
2358
|
+
clearTimeout(holdTimer.current);
|
|
2359
|
+
const r = hold.up(e.pointerId);
|
|
2360
|
+
if (r) { finishHoldDrop(r, true); drag.current.swallow = true; setTimeout(() => { if (!drag.current.pts.size) drag.current.swallow = false; }, 0); }
|
|
2361
|
+
g.up(e);
|
|
2362
|
+
};
|
|
2363
|
+
const onStageCancel = (e) => { clearTimeout(holdTimer.current); const r = hold.up(e.pointerId); finishHoldDrop(r, false); g.up(e); };
|
|
1479
2364
|
const onWheel = (e) => {
|
|
1480
2365
|
if (!onScene(e.target) && !(typeof e.target?.closest === "function" && e.target.closest(".ol-handle, .oo-tile-label"))) return;
|
|
1481
2366
|
e.preventDefault();
|
|
1482
2367
|
const r = stageRef.current.getBoundingClientRect(), v = view0();
|
|
1483
|
-
raw.current = Math.min(OK_MAX, Math.max(
|
|
1484
|
-
if (raw.current !== v.k) setView(zoomOffice(v, raw.current, e.clientX - r.left, e.clientY - r.top));
|
|
2368
|
+
raw.current = Math.min(OK_MAX, Math.max(kLo, raw.current * wheelFactor(e)));
|
|
2369
|
+
if (raw.current !== v.k) setView(zoomOffice(v, raw.current, e.clientX - r.left, e.clientY - r.top, kLo));
|
|
1485
2370
|
};
|
|
1486
2371
|
const onKeyDown = (e) => {
|
|
1487
2372
|
if (e.defaultPrevented) return; // Edit layout's handles move with the arrows
|
|
2373
|
+
if (e.key === "Escape" && hold.held()) {
|
|
2374
|
+
e.preventDefault();
|
|
2375
|
+
clearTimeout(holdTimer.current);
|
|
2376
|
+
const h = hold.held();
|
|
2377
|
+
hold.cancel();
|
|
2378
|
+
finishHoldDrop(h, false);
|
|
2379
|
+
return;
|
|
2380
|
+
}
|
|
1488
2381
|
const tag = e.target && e.target.tagName;
|
|
1489
2382
|
if (tag === "INPUT" || tag === "SELECT" || tag === "TEXTAREA") return;
|
|
1490
2383
|
const z = zoomKey(e);
|
|
1491
2384
|
if (z) { e.preventDefault(); if (z === "fit") fit(); else zoomStep(z === "in" ? 1 : -1); return; }
|
|
1492
2385
|
const dir = PAN_KEYS[e.key];
|
|
1493
|
-
if (dir && e.target === canvasRef.current && !e.altKey && !e.ctrlKey && !e.metaKey) { e.preventDefault(); const v = view0(); setView({ ...v, x: v.x - dir[0] * 80, y: v.y - dir[1] * 80 }); }
|
|
2386
|
+
if (dir && e.target === canvasRef.current && !carousel && !e.altKey && !e.ctrlKey && !e.metaKey) { e.preventDefault(); const v = view0(); setView({ ...v, x: v.x - dir[0] * 80, y: v.y - dir[1] * 80 }); }
|
|
1494
2387
|
};
|
|
1495
2388
|
// The keyboard's way through: a desk in the list, or a handle of Edit layout, is brought into view when focused.
|
|
1496
2389
|
const onFocusIn = (e) => {
|
|
@@ -1504,12 +2397,32 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1504
2397
|
};
|
|
1505
2398
|
/** #2861: the dialogue box under a pointer event ({ key, name }: its agent), or null. */
|
|
1506
2399
|
const dlgAt = (e) => {
|
|
1507
|
-
const b = dlgShown.current, r =
|
|
2400
|
+
const b = dlgShown.current, r = dialogueCanvasRef.current ? dialogueCanvasRef.current.getBoundingClientRect() : null;
|
|
1508
2401
|
return b && r && onBox(b.L, b.stage, e.clientX - r.left, e.clientY - r.top) ? b : null;
|
|
1509
2402
|
};
|
|
2403
|
+
// Use the painted prefix and final displaced position, including bubbles outside an overview tile.
|
|
2404
|
+
const bubbleAtEvent = (e) => {
|
|
2405
|
+
// An armed snack owns map taps until the existing placement/feed action consumes it.
|
|
2406
|
+
if (shared || !onOpen || showSnacks && armedSnack) return null;
|
|
2407
|
+
const s = scene.current, r = canvasRef.current?.getBoundingClientRect();
|
|
2408
|
+
if (!s || !r) return null;
|
|
2409
|
+
const hit = officeBubbleAt(s.bubbleHits || [], (e.clientX - r.left) * s.ratio, (e.clientY - r.top) * s.ratio, lastType.current === "touch" ? 44 * s.ratio : 0);
|
|
2410
|
+
return hit && people.some(d => d.node.i && d.node.name === hit.name) ? hit : null;
|
|
2411
|
+
};
|
|
2412
|
+
const openDialogue = (e) => {
|
|
2413
|
+
if (shared || !onOpen || !dlgShown.current || e.detail > 1) return;
|
|
2414
|
+
if (e.type === "keydown") {
|
|
2415
|
+
if (e.repeat || e.key !== "Enter" && e.key !== " ") return;
|
|
2416
|
+
e.preventDefault();
|
|
2417
|
+
}
|
|
2418
|
+
setCard(null); open(dlgShown.current.name);
|
|
2419
|
+
};
|
|
2420
|
+
/** Skip (the reading controls): every reply in the box, or over the heads, goes now. */
|
|
2421
|
+
const skipTalk = () => { if (tmode === "box") dlg.skip(); else if (chat) chat.skipAll(); dlgWake(); };
|
|
2422
|
+
const pickRead = (v) => { store.saveTalkRead(v); setReadMode(v); dlgWake(); };
|
|
1510
2423
|
const onMove = (e) => {
|
|
1511
|
-
if (e.pointerType === "touch" || g.busy()) return;
|
|
1512
|
-
const onDlg = !!dlgAt(e);
|
|
2424
|
+
if (e.pointerType === "touch" || g.busy() || snackDrag || snackDropRef.current) return;
|
|
2425
|
+
const onDlg = !!dlgAt(e) || !!bubbleAtEvent(e);
|
|
1513
2426
|
if (onDlg !== dlgHot) setDlgHot(onDlg);
|
|
1514
2427
|
const d = onDlg ? null : deskOf(e); const key = d ? d.key : null; if (key !== tip) setTip(key);
|
|
1515
2428
|
};
|
|
@@ -1523,19 +2436,176 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1523
2436
|
};
|
|
1524
2437
|
// #2661: a click (or a tap) on a person opens their card; on the same person again, or off everyone, closes it; on
|
|
1525
2438
|
// someone else, switches to theirs. A double-click skips the card and opens the chat.
|
|
2439
|
+
/** M-3253: a tap that hits nobody: the person within TAP_R CSS px of it (one office; All offices' tiles keep the exact hit). */
|
|
2440
|
+
const nearOf = (e) => {
|
|
2441
|
+
const w = pointOf(e);
|
|
2442
|
+
if (!w || overview) return null;
|
|
2443
|
+
const at = now();
|
|
2444
|
+
const list = people.filter((d) => d.node && d.node.i).map((d) => {
|
|
2445
|
+
const wk = zones ? walkers.at(d.node.name, at) : null;
|
|
2446
|
+
return { key: d.key, node: d.node, x: wk ? wk.x : d.box.x + d.box.w / 2, y: wk ? wk.y - 32 : d.box.y + d.box.h / 2 };
|
|
2447
|
+
});
|
|
2448
|
+
return nearestPerson(list, w.x, w.y, TAP_R / Math.max(kLo, view0().k));
|
|
2449
|
+
};
|
|
2450
|
+
/** M-3432 (#4255): feed an awake person a snack (plays eat animation + hearts + feed bubble + optional Tell). */
|
|
2451
|
+
const feedPerson = (name, snack, at) => {
|
|
2452
|
+
const t = now();
|
|
2453
|
+
snacks.feed(name, snack, { x: at.x, y: at.y, t, charEatStrip: skin.eatStrip ? skin.eatStrip(name) : null });
|
|
2454
|
+
reacts.current.set(name, { kind: "feed", t0: t });
|
|
2455
|
+
if (store.tellOn(name)) void store.tell(name, "feed");
|
|
2456
|
+
walkNow.current?.();
|
|
2457
|
+
loop.current?.wake();
|
|
2458
|
+
};
|
|
2459
|
+
/** M-3432 (#4255): drop a snack on the floor so nearby idle characters race to it. */
|
|
2460
|
+
const placeSnackAt = (snack, at) => {
|
|
2461
|
+
const t = now();
|
|
2462
|
+
const hidden = scene.current && scene.current.part ? furnitureAt(scene.current.part, t).hidden : null;
|
|
2463
|
+
snacks.place(snack, at, t, { desks: desksOf(L), walkers, hidden, ownArea, areas: L.areas, graph: L });
|
|
2464
|
+
walkNow.current?.();
|
|
2465
|
+
loop.current?.wake();
|
|
2466
|
+
};
|
|
2467
|
+
/** M-3432 (#4255): classify a pointer position while dragging a snack (awake person → feed, floor → place, tray/asleep/outside → cancel). */
|
|
2468
|
+
const snackTargetOf = (e) => {
|
|
2469
|
+
const tray = snackTrayRef.current;
|
|
2470
|
+
if (tray && typeof tray.getBoundingClientRect === "function") {
|
|
2471
|
+
const tr = tray.getBoundingClientRect();
|
|
2472
|
+
if (e.clientX >= tr.left && e.clientX <= tr.right && e.clientY >= tr.top && e.clientY <= tr.bottom) return null;
|
|
2473
|
+
}
|
|
2474
|
+
const st = stageRef.current;
|
|
2475
|
+
if (st && typeof st.getBoundingClientRect === "function") {
|
|
2476
|
+
const sr = st.getBoundingClientRect();
|
|
2477
|
+
if (e.clientX < sr.left || e.clientX > sr.right || e.clientY < sr.top || e.clientY > sr.bottom) return null;
|
|
2478
|
+
}
|
|
2479
|
+
const d = deskOf(e) || (e.pointerType === "touch" ? nearOf(e) : null);
|
|
2480
|
+
if (d && d.node && d.node.i) {
|
|
2481
|
+
if (ASLEEP.has(d.node.state) || d.night) return null;
|
|
2482
|
+
const at = (zones && walkers.at(d.node.name, now())) || d.seat || { x: d.x + d.w / 2, y: d.y + d.h };
|
|
2483
|
+
return { kind: "feed", name: d.node.name, label: nodeText(d.node).primary, x: at.x, y: at.y };
|
|
2484
|
+
}
|
|
2485
|
+
const w = pointOf(e);
|
|
2486
|
+
if (!w || w.x < 0 || w.x > L.width || w.y < 0 || w.y > L.height) return null;
|
|
2487
|
+
return { kind: "place", x: w.x, y: w.y };
|
|
2488
|
+
};
|
|
2489
|
+
/** M-3432 (#4255): drag a snack from the tray onto a character or empty floor; a short tap is left to onClick (tap-to-arm). */
|
|
2490
|
+
const onSnackDown = (snack, e) => {
|
|
2491
|
+
if (!showSnacks || e.isPrimary === false || (e.pointerType === "mouse" && e.button !== 0)) return;
|
|
2492
|
+
e.stopPropagation();
|
|
2493
|
+
const startOffice = officeKey, startStyle = styleKey;
|
|
2494
|
+
let lastKey = "";
|
|
2495
|
+
const moveGhost = (cx, cy) => {
|
|
2496
|
+
const sr = stageRef.current ? stageRef.current.getBoundingClientRect() : null;
|
|
2497
|
+
if (!sr) return;
|
|
2498
|
+
const gx = Math.round(cx - sr.left + 12), gy = Math.round(cy - sr.top - 40);
|
|
2499
|
+
snackGhostPosRef.current = { x: gx, y: gy };
|
|
2500
|
+
const gh = snackGhostRef.current;
|
|
2501
|
+
if (gh && gh.style) gh.style.setProperty("transform", `translate(${gx}px, ${gy}px)`);
|
|
2502
|
+
};
|
|
2503
|
+
const swallowClick = () => {
|
|
2504
|
+
snackSwallowRef.current = true;
|
|
2505
|
+
setTimeout(() => { snackSwallowRef.current = false; }, 0);
|
|
2506
|
+
};
|
|
2507
|
+
snackDragCtrl.start({
|
|
2508
|
+
pid: e.pointerId,
|
|
2509
|
+
sx: e.clientX,
|
|
2510
|
+
sy: e.clientY,
|
|
2511
|
+
slop: PLAY.SLOP,
|
|
2512
|
+
onMove: (ev, { starting }) => {
|
|
2513
|
+
if (starting) { setCard(null); setTip(null); }
|
|
2514
|
+
ev.preventDefault();
|
|
2515
|
+
if (tipNow.current) setTip(null);
|
|
2516
|
+
moveGhost(ev.clientX, ev.clientY);
|
|
2517
|
+
const drop = snackTargetOf(ev);
|
|
2518
|
+
snackDropRef.current = drop;
|
|
2519
|
+
const k = drop ? `${drop.kind}:${drop.name || ""}` : "";
|
|
2520
|
+
if (starting || k !== lastKey) {
|
|
2521
|
+
lastKey = k;
|
|
2522
|
+
setSnackDrag({ snack, kind: drop ? drop.kind : null, label: drop && drop.kind === "feed" ? drop.label : "" });
|
|
2523
|
+
}
|
|
2524
|
+
loop.current?.wake();
|
|
2525
|
+
return drop;
|
|
2526
|
+
},
|
|
2527
|
+
onCommit: (drop) => {
|
|
2528
|
+
snackDropRef.current = null;
|
|
2529
|
+
setSnackDrag(null);
|
|
2530
|
+
swallowClick();
|
|
2531
|
+
const cur = snackCtxRef.current;
|
|
2532
|
+
if (cur.showSnacks && cur.officeKey === startOffice && cur.styleKey === startStyle) {
|
|
2533
|
+
if (drop.kind === "feed") feedPerson(drop.name, snack, { x: drop.x, y: drop.y });
|
|
2534
|
+
else if (drop.kind === "place") placeSnackAt(snack, { x: drop.x, y: drop.y });
|
|
2535
|
+
setArmedSnack(null);
|
|
2536
|
+
}
|
|
2537
|
+
loop.current?.wake();
|
|
2538
|
+
},
|
|
2539
|
+
onCancel: ({ dragging }) => {
|
|
2540
|
+
snackDropRef.current = null;
|
|
2541
|
+
setSnackDrag(null);
|
|
2542
|
+
if (dragging) swallowClick();
|
|
2543
|
+
loop.current?.wake();
|
|
2544
|
+
},
|
|
2545
|
+
});
|
|
2546
|
+
};
|
|
2547
|
+
useEffect(() => {
|
|
2548
|
+
if (!armedSnack) return undefined;
|
|
2549
|
+
const onEsc = (e) => { if (e.key === "Escape" && !e.defaultPrevented) { e.preventDefault(); setArmedSnack(null); } };
|
|
2550
|
+
globalThis.document?.addEventListener?.("keydown", onEsc, true);
|
|
2551
|
+
return () => globalThis.document?.removeEventListener?.("keydown", onEsc, true);
|
|
2552
|
+
}, [armedSnack]);
|
|
2553
|
+
const paintSnackIcon = (st, pxSize = 28) => (cv) => {
|
|
2554
|
+
const g = cv && typeof cv.getContext === "function" ? cv.getContext("2d") : null;
|
|
2555
|
+
if (!g || !st || !skin || typeof skin.drawSnackIcon !== "function") return;
|
|
2556
|
+
const r = deviceRatio(), S = pxSize;
|
|
2557
|
+
if (cv.width !== Math.round(S * r) || cv.height !== Math.round(S * r)) { cv.width = Math.round(S * r); cv.height = Math.round(S * r); }
|
|
2558
|
+
g.setTransform(r, 0, 0, r, 0, 0); g.clearRect(0, 0, S, S);
|
|
2559
|
+
skin.drawSnackIcon(g, st, S);
|
|
2560
|
+
};
|
|
1526
2561
|
const onClick = (e) => {
|
|
1527
2562
|
const box = dlgAt(e);
|
|
2563
|
+
const bubble = bubbleAtEvent(e);
|
|
2564
|
+
if (bubble && bubble.reply && chat) { if (talkTo !== bubble.name) setTalkTo(bubble.name); chat.advance(bubble.name); return; }
|
|
2565
|
+
if ((box || bubble) && !shared && onOpen) {
|
|
2566
|
+
if (!(e.detail > 1)) { setCard(null); open((box || bubble).name); }
|
|
2567
|
+
return;
|
|
2568
|
+
}
|
|
1528
2569
|
if (box) { focusPerson(box.key); return; }
|
|
1529
|
-
|
|
1530
|
-
|
|
2570
|
+
if (showSnacks && armedSnack) {
|
|
2571
|
+
const snack = snacksById.get(armedSnack);
|
|
2572
|
+
if (snack) {
|
|
2573
|
+
const hit = deskOf(e) || (lastType.current === "touch" ? nearOf(e) : null);
|
|
2574
|
+
if (hit && hit.node && hit.node.i) {
|
|
2575
|
+
if (!ASLEEP.has(hit.node.state) && !hit.night) {
|
|
2576
|
+
const at = (zones && walkers.at(hit.node.name, now())) || hit.seat || { x: hit.x + hit.w / 2, y: hit.y + hit.h };
|
|
2577
|
+
feedPerson(hit.node.name, snack, at);
|
|
2578
|
+
}
|
|
2579
|
+
setArmedSnack(null);
|
|
2580
|
+
return;
|
|
2581
|
+
}
|
|
2582
|
+
const w = pointOf(e);
|
|
2583
|
+
if (w && w.x >= 0 && w.x <= L.width && w.y >= 0 && w.y <= L.height) {
|
|
2584
|
+
placeSnackAt(snack, w);
|
|
2585
|
+
setArmedSnack(null);
|
|
2586
|
+
return;
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2589
|
+
}
|
|
2590
|
+
const d = deskOf(e) || (lastType.current === "touch" ? nearOf(e) : null);
|
|
2591
|
+
if (!d || !d.node.i) { if (enterTile(e)) return; setTip(null); setCard(null); return; }
|
|
1531
2592
|
if (lastType.current === "touch") setTip(null);
|
|
1532
2593
|
cardFrom.current = null;
|
|
1533
2594
|
setCard((cur) => (cur === d.key ? null : d.key));
|
|
1534
2595
|
};
|
|
1535
|
-
|
|
2596
|
+
/** All offices: a click on a tile (off its people) enters that office for this visit; the lobby is no office. */
|
|
2597
|
+
const enterTile = (e) => {
|
|
2598
|
+
const s = scene.current, w = pointOf(e);
|
|
2599
|
+
if (!overview || !s || !s.overview || !w || deskOf(e)) return false;
|
|
2600
|
+
const tt = tileAt(s.lay, w.x, w.y) || labelAt(s.lay, w.x, w.y), tl = tt ? tiles.find((x) => x.key === tt.key) : null;
|
|
2601
|
+
if (!tl || tl.lobby) return false;
|
|
2602
|
+
setCard(null); pick(tl.key, false);
|
|
2603
|
+
return true;
|
|
2604
|
+
};
|
|
2605
|
+
// All offices: a double-click on a tile (off its people) opens that office, as one click does.
|
|
1536
2606
|
const onDblClick = (e) => {
|
|
1537
2607
|
const box = dlgAt(e);
|
|
1538
|
-
if (box
|
|
2608
|
+
if (box || bubbleAtEvent(e)) return; // the first click already opened it
|
|
1539
2609
|
const s = scene.current, w = pointOf(e), hit = deskOf(e);
|
|
1540
2610
|
if (hit && hit.node.i) { setCard(null); open(hit.node.name); return; } // #2661: a person's chat, past the card
|
|
1541
2611
|
if (!overview || !s || !s.overview || !w || hit) return;
|
|
@@ -1549,8 +2619,9 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1549
2619
|
|
|
1550
2620
|
const auto = !custom && !overview;
|
|
1551
2621
|
// Edit layout: an admin, a stored office, a zones style (built in, or a pack loaded here); not while the offices'
|
|
1552
|
-
// editor is open, nor a second session (nor in All offices: custom is null there
|
|
1553
|
-
|
|
2622
|
+
// editor is open, nor a second session (nor in All offices: custom is null there; nor in the carousel: the slide is
|
|
2623
|
+
// a stored office but Edit waits).
|
|
2624
|
+
const canLayout = canEdit && storedRev !== null && !!custom && zones && !loading && baseSkin.id === custom.skin && !editing && !layout && !carouselPick;
|
|
1554
2625
|
const openLayout = () => {
|
|
1555
2626
|
setLayout({ id: ++layoutSeq.current, officeId: custom.id, skin: custom.skin, pack: styleKey, base: baseSkin.pack, start: skin.pack, draft: skin.pack, rev: storedRev, list: stored });
|
|
1556
2627
|
setTip(null);
|
|
@@ -1583,13 +2654,40 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1583
2654
|
const teamValue = (opts.find((o) => o.team === f.team) || opts[0]).value;
|
|
1584
2655
|
const setF = (next) => { const v = filterOk(next); store.saveFilter(v); setFilter(v); };
|
|
1585
2656
|
// While Edit layout is open the office stays (its picker is disabled; this is the guard behind it).
|
|
1586
|
-
|
|
2657
|
+
/** The switcher's pick (kept per device); `keep` false: a tile entered from All offices, for this visit only. */
|
|
2658
|
+
const pick = (id, keep = true) => {
|
|
2659
|
+
if (layoutRef.current) return;
|
|
2660
|
+
if (id === CAROUSEL_ID) {
|
|
2661
|
+
const cur = store.carousel();
|
|
2662
|
+
const ids = carouselIdsOk(cur ? cur.ids : null, stored);
|
|
2663
|
+
const next = { ids: ids.length ? ids : stored.map((o) => o.id), interval: intervalOk(cur && cur.interval) };
|
|
2664
|
+
store.saveCarousel(next); setCarSaved(next); setCarIndex(0); setCarPlaying(true);
|
|
2665
|
+
}
|
|
2666
|
+
if (keep) store.saveChoice(id);
|
|
2667
|
+
setChoice(id); setTip(null);
|
|
2668
|
+
};
|
|
2669
|
+
const setCarIds = (ids) => {
|
|
2670
|
+
const next = { ids, interval: intervalOk(carSaved && carSaved.interval) };
|
|
2671
|
+
store.saveCarousel(next); setCarSaved(next);
|
|
2672
|
+
};
|
|
2673
|
+
const toggleCarId = (id) => {
|
|
2674
|
+
const have = new Set(carIds);
|
|
2675
|
+
if (have.has(id)) have.delete(id); else have.add(id);
|
|
2676
|
+
setCarIds(stored.map((o) => o.id).filter((x) => have.has(x)));
|
|
2677
|
+
};
|
|
2678
|
+
const setCarInterval = (n) => {
|
|
2679
|
+
const next = { ids: carSaved && Array.isArray(carSaved.ids) ? carSaved.ids : carIds, interval: intervalOk(n) };
|
|
2680
|
+
store.saveCarousel(next); setCarSaved(next);
|
|
2681
|
+
};
|
|
1587
2682
|
const everyone = useMemo(() => { const m = new Map(); for (const n of [...view.top, ...view.teams.flatMap((tm) => tm.nodes), ...view.rest.nodes]) if (!m.has(n.name)) m.set(n.name, n); return [...m.values()]; }, [view]);
|
|
1588
2683
|
const tipText = tipDesk ? nodeText(tipDesk.node) : null;
|
|
1589
2684
|
// #2661: the card's person (gone from the office, filtered out or the office changed: it closes).
|
|
1590
2685
|
const cardOf = card ? people.find((d) => d.key === card && d.node.i) || null : null;
|
|
1591
|
-
cardDesk.current = cardOf ? { name: cardOf.node.name, box: cardOf.box, walks: zones && !overview } : null;
|
|
2686
|
+
cardDesk.current = cardOf ? { name: cardOf.node.name, state: cardOf.node.state, box: cardOf.box, walks: zones && !overview, skin: cardOf.skin } : null;
|
|
1592
2687
|
useEffect(() => { if (card && !cardOf) setCard(null); }, [card, !!cardOf]);
|
|
2688
|
+
useEffect(() => { walkNow.current?.(); }, [cardOf ? cardOf.node.name : null]); // stop there now; walk again once it closes
|
|
2689
|
+
// A preview ends with its card, or when the card turns to someone else.
|
|
2690
|
+
useEffect(() => { if (preview.current && (!cardOf || preview.current.name !== cardOf.node.name)) { preview.current = null; setPreviewRev((x) => x + 1); loop.current?.wake(); } }, [cardOf ? cardOf.node.name : null]);
|
|
1593
2691
|
const closeCard = () => {
|
|
1594
2692
|
setCard(null);
|
|
1595
2693
|
const from = cardFrom.current; cardFrom.current = null;
|
|
@@ -1621,14 +2719,15 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1621
2719
|
setView(centreOn({ ...v, k }, size, at.x, at.y));
|
|
1622
2720
|
};
|
|
1623
2721
|
/** The card's picture: the person's idle frame in the office's style (pack strip or built-in figure). */
|
|
1624
|
-
const drawAvatar = (cv) => {
|
|
2722
|
+
const drawAvatar = (cv, sizePx = 56) => {
|
|
1625
2723
|
const s = scene.current, c = cardOf;
|
|
1626
2724
|
const g = cv && cv.getContext ? cv.getContext("2d") : null;
|
|
1627
2725
|
if (!g || !c || !s || !c.skin || !c.look) return;
|
|
1628
|
-
const r = deviceRatio(), W = 56;
|
|
1629
|
-
if (cv.width !== W * r) { cv.width = W * r; cv.height = W * r; }
|
|
2726
|
+
const r = deviceRatio(), W = Number(sizePx) || 56;
|
|
2727
|
+
if (cv.width !== Math.round(W * r) || cv.height !== Math.round(W * r)) { cv.width = Math.round(W * r); cv.height = Math.round(W * r); }
|
|
1630
2728
|
g.setTransform(1, 0, 0, 1, 0, 0); g.clearRect(0, 0, cv.width, cv.height); g.imageSmoothingEnabled = false;
|
|
1631
|
-
|
|
2729
|
+
// The card's avatar: the set's still `stand` when it has one (poseStrip falls back to idle).
|
|
2730
|
+
const look = { ...c.look, pose: "stand", dim: false, match: false, badge: null, notag: true, free: true, work: 0, sign: null };
|
|
1632
2731
|
const at = { x: 0, y: 0 }, b = c.skin.charBox ? c.skin.charBox(look, at) : null, box = b || { x: -16, y: -48, w: 32, h: 48 };
|
|
1633
2732
|
const k = Math.min((W - 8) / box.w, (W - 8) / box.h) * r;
|
|
1634
2733
|
g.setTransform(k, 0, 0, k, (W * r) / 2 - (box.x + box.w / 2) * k, (W * r) / 2 - (box.y + box.h / 2) * k);
|
|
@@ -1639,97 +2738,272 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1639
2738
|
const miniRects = overview ? arranged.tiles.map((tt) => ({ key: tt.key, x: tt.x, y: tt.y, w: tt.w, h: tt.h }))
|
|
1640
2739
|
: zones ? Object.values(L.areas || {}).map((a) => ({ key: a.name, ...a.rect })) : L.rooms.map((r) => ({ key: r.key, x: r.x, y: r.y, w: r.w, h: r.h }));
|
|
1641
2740
|
const dotR = Math.max(L.width, L.height) / 90;
|
|
1642
|
-
// The switcher: the whole fleet, All offices (two or more stored), each stored office.
|
|
1643
|
-
const officeSelect = (cls) => html`<select class=${`tb-select ${cls}`} value=${layout ? layout.officeId : overview ? ALL_ID : custom ? custom.id : AUTO_ID} disabled=${!!layout}
|
|
2741
|
+
// The switcher: the whole fleet, All offices (two or more stored), Carousel (two or more, signed-in), each stored office.
|
|
2742
|
+
const officeSelect = (cls) => html`<select class=${`tb-select ${cls}`} value=${layout ? layout.officeId : overview ? ALL_ID : carouselPick ? CAROUSEL_ID : custom ? custom.id : AUTO_ID} disabled=${!!layout}
|
|
1644
2743
|
aria-label=${to("office")} onChange=${(e) => pick(e.target.value)}>
|
|
1645
2744
|
<option value=${AUTO_ID}>${to("allOffice")}</option>
|
|
1646
2745
|
${overviewOk(stored) ? html`<option value=${ALL_ID}>${to("allOffices")}</option>` : null}
|
|
2746
|
+
${opening == null && carouselOk(stored) ? html`<option value=${CAROUSEL_ID}>${to("carousel")}</option>` : null}
|
|
1647
2747
|
${stored.map((o) => html`<option key=${o.id} value=${o.id}>${o.name}</option>`)}
|
|
1648
2748
|
</select>`;
|
|
1649
|
-
|
|
1650
|
-
<
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
2749
|
+
const carChrome = () => !carousel ? null : html`<button type="button" class="btn btn-sm oo-car-pause" onClick=${() => setCarPlaying((p) => !p)}>${to(carPlaying ? "pause" : "resume")}</button>
|
|
2750
|
+
<button type="button" class="btn btn-sm oo-car-next" onClick=${() => stepCar(1)}>${to("next")}</button>
|
|
2751
|
+
<span class="muted oo-car-now">${custom ? custom.name : ""} · ${to(carPlaying ? "playing" : "paused")}</span>`;
|
|
2752
|
+
// M-3253: the zone pills (a phone, one office on a zones style): the whole office, or an area at ZONE_K, centred.
|
|
2753
|
+
const zoneList = compact && zones && !overview && !layout ? Object.entries(L.areas || {}).map(([key, a]) => ({ key, rect: a.rect,
|
|
2754
|
+
n: people.filter((d) => d.area === areaName(key)).length })).filter((z) => z.rect && z.n > 0) : [];
|
|
2755
|
+
const toZone = (z) => { const v = view0(); raw.current = ZONE_K; setView(centreOn({ ...v, k: ZONE_K }, size, z.rect.x + z.rect.w / 2, z.rect.y + z.rect.h / 2)); };
|
|
2756
|
+
const closeMore = () => onMore && onMore(false);
|
|
2757
|
+
// M-3556: Display options (style, the toggles, the key) in a dropdown on a desk — non-modal, like Members: the office
|
|
2758
|
+
// stays in view, so a tick shows at once; a click elsewhere or Esc closes it. The Fleet office opens it from ⚙ in its
|
|
2759
|
+
// bar (open here); a Hub room's office (foldBar) from the gear in the zoom stack, open as its page says (`more`).
|
|
2760
|
+
const roomGear = folded && !compact;
|
|
2761
|
+
const [displayOpen, setDisplayOpen] = useState(false);
|
|
2762
|
+
const dispOpen = roomGear ? !!more : displayOpen;
|
|
2763
|
+
const setDisp = (v) => (roomGear ? onMore(v) : setDisplayOpen(v));
|
|
2764
|
+
const displayRef = useRef(null);
|
|
2765
|
+
useEffect(() => {
|
|
2766
|
+
if (!dispOpen) return undefined;
|
|
2767
|
+
const away = (e) => { if (displayRef.current && !displayRef.current.contains(e.target)) setDisp(false); };
|
|
2768
|
+
// Esc from inside it hands focus back to its button (as the sheet did), so the keyboard is not left on nothing.
|
|
2769
|
+
const esc = (e) => {
|
|
2770
|
+
if (e.key !== "Escape") return;
|
|
2771
|
+
const box = displayRef.current, back = !!box && typeof box.contains === "function" && box.contains(globalThis.document?.activeElement);
|
|
2772
|
+
setDisp(false);
|
|
2773
|
+
if (back) box.querySelector("button")?.focus?.();
|
|
2774
|
+
};
|
|
2775
|
+
document.addEventListener("pointerdown", away); document.addEventListener("keydown", esc);
|
|
2776
|
+
return () => { document.removeEventListener("pointerdown", away); document.removeEventListener("keydown", esc); };
|
|
2777
|
+
}, [dispOpen]);
|
|
2778
|
+
// M-3556: the phone sheet is taller than a phone: while more is below its fold, its foot fades (data-more on the body).
|
|
2779
|
+
useEffect(() => {
|
|
2780
|
+
if (!compact || !more) return undefined;
|
|
2781
|
+
const el = globalThis.document?.querySelector?.(".oo-sheet .dlg-body");
|
|
2782
|
+
if (!el || typeof el.addEventListener !== "function") return undefined;
|
|
2783
|
+
const upd = () => { const below = el.scrollTop + el.clientHeight < el.scrollHeight - 2; if (below) el.setAttribute("data-more", ""); else el.removeAttribute("data-more"); };
|
|
2784
|
+
const raf = globalThis.requestAnimationFrame ? globalThis.requestAnimationFrame(upd) : (upd(), 0);
|
|
2785
|
+
el.addEventListener("scroll", upd, { passive: true }); globalThis.addEventListener?.("resize", upd);
|
|
2786
|
+
// Its content can change while it is open (another office, All offices' lobby tile, a note): re-measure then too
|
|
2787
|
+
// (Prism #3556 r3 P3).
|
|
2788
|
+
const RO = globalThis.ResizeObserver, ro = typeof RO === "function" ? new RO(upd) : null;
|
|
2789
|
+
if (ro) { ro.observe(el); for (const c of el.children || []) ro.observe(c); }
|
|
2790
|
+
return () => { globalThis.cancelAnimationFrame?.(raf); el.removeEventListener("scroll", upd); globalThis.removeEventListener?.("resize", upd); ro?.disconnect(); };
|
|
2791
|
+
}, [compact, more]);
|
|
2792
|
+
// In the sheet: Edit offices and Edit layout open their own editors (outside it): the sheet closes after their click.
|
|
2793
|
+
const sheetClick = (e) => { if (typeof e.target?.closest === "function" && e.target.closest(".oo-edit, .oo-layout")) closeMore(); };
|
|
2794
|
+
const tile = (icon, label, fn, cls, pressed) => html`<button type="button" class=${`oo-sheet-tile ${cls}`} aria-pressed=${pressed === undefined ? undefined : pressed ? "true" : "false"}
|
|
2795
|
+
onClick=${fn}><${Icon} name=${icon} size=${20} /><span>${label}</span></button>`;
|
|
2796
|
+
// M-3556: the bar in three groups — scope (which office, whom: left of the desk's one row), the display options (behind
|
|
2797
|
+
// ⚙) and the actions (right). A phone's ⋯ sheet lists all three in that order.
|
|
2798
|
+
const scopeItems = html`
|
|
2799
|
+
${custom && !carouselPick && opening == null && !layout && overviewOk(stored) ? html`<button type="button" class="btn btn-sm oo-back-all" onClick=${() => pick(ALL_ID)}>${to("backAll")}</button>` : null}
|
|
2800
|
+
${oneOffice ? null : html`<label class="oo-pick"><span class="oo-pick-label">${to("office")}</span>${officeSelect("oo-office")}</label>`}
|
|
1657
2801
|
${auto ? html`<label class="oo-pick"><span class="oo-pick-label">${to("show")}</span>
|
|
1658
|
-
<select class="tb-select" value=${teamValue} onChange=${(e) => { const o = opts.find((x) => x.value === e.target.value); setF({ ...f, team: o ? o.team : "" }); }}>
|
|
2802
|
+
<select class="tb-select oo-team" value=${teamValue} onChange=${(e) => { const o = opts.find((x) => x.value === e.target.value); setF({ ...f, team: o ? o.team : "" }); }}>
|
|
1659
2803
|
${opts.map((o) => html`<option key=${o.value} value=${o.value}>${o.label}</option>`)}
|
|
1660
2804
|
</select></label>
|
|
1661
2805
|
<${People} nodes=${everyone} pinned=${f.pinned} onChange=${(pinned) => setF({ ...f, pinned })} />` : null}
|
|
2806
|
+
${carouselPick ? html`<div class="oo-carousel">
|
|
2807
|
+
<${CarouselOffices} stored=${stored} carIds=${carIds} open=${carMenu} onOpen=${setCarMenu} onToggle=${toggleCarId}
|
|
2808
|
+
onAll=${() => setCarIds(stored.map((o) => o.id))} onNone=${() => setCarIds([])} />
|
|
2809
|
+
<label class="oo-pick"><span class="oo-pick-label">${to("interval")}</span>
|
|
2810
|
+
<select class="tb-select oo-car-interval" value=${String(intervalOk(carSaved && carSaved.interval))} onChange=${(e) => setCarInterval(Number(e.target.value))}>
|
|
2811
|
+
${INTERVALS.map((n) => html`<option key=${n} value=${n}>${n < 60 ? to("intervalSec", n) : to("intervalMin", n / 60)}</option>`)}
|
|
2812
|
+
</select></label>
|
|
2813
|
+
${carChrome()}
|
|
2814
|
+
</div>` : null}
|
|
2815
|
+
${custom && baseSkin.id !== custom.skin && !loading ? html`<span class="muted oo-note">${to("skinUnknown", styleName(custom.skin))}</span>` : null}
|
|
2816
|
+
${placed.ignored ? html`<span class="muted oo-note">${to("layoutIgnored")}</span>` : null}
|
|
2817
|
+
${L.unseated ? html`<span class="muted oo-note">${to("unseated", L.unseated)}</span>` : null}
|
|
2818
|
+
`;
|
|
2819
|
+
const optionItems = html`
|
|
2820
|
+
${auto ? html`<label class="oo-pick"><span class="oo-pick-label">${to("styleLabel")}</span>
|
|
2821
|
+
<select class="tb-select oo-style" value=${STYLES.includes(style) || packs.some((pk) => pk.id === style) ? style : skin.id} title=${to(canEdit ? "styleForAll" : "styleHere")} onChange=${(e) => pickStyle(e.target.value)}>
|
|
2822
|
+
${styles.map((id) => html`<option key=${id} value=${id}>${to(`style_${id}`)}</option>`)}
|
|
2823
|
+
${packs.map((pk) => html`<option key=${`pack:${pk.id}`} value=${pk.id}>${pk.name}</option>`)}
|
|
2824
|
+
</select></label>` : null}
|
|
1662
2825
|
<label class="check oo-hide-asleep"><input type="checkbox" checked=${hideAsleep} onChange=${() => { const v = !hideAsleep; store.saveHideAsleep(v); setHideAsleep(v); setTip(null); }} /><span>${to("hideAsleep")}</span></label>
|
|
2826
|
+
<label class="check oo-hide-names"><input type="checkbox" checked=${namesOff} onChange=${() => { const v = !namesOff; store.saveNamesOff(v); setNamesOff(v); }} /><span>${to("hideNames")}</span></label>
|
|
2827
|
+
<label class="check oo-hide-mini"><input type="checkbox" checked=${miniOff} onChange=${() => { const v = !miniOff; store.saveMiniOff(v); setMiniOff(v); }} /><span>${to("hideMini")}</span></label>
|
|
2828
|
+
${zones && !overview && !shared ? html`<label class="check oo-play"><input type="checkbox" checked=${playOn && !still} disabled=${still}
|
|
2829
|
+
onChange=${() => { const v = !playOn; store.savePlayOn(v); setPlayOn(v); }} /><span>${to("playOn")}</span>${playStillOff ? html`<span class="muted oo-note oo-play-still">${to("playMotionOff")}</span>` : null}</label>` : null}
|
|
1663
2830
|
${zones || overview ? html`<label class="check oo-night"><input type="checkbox" checked=${nightOn} onChange=${() => { const v = !nightOn; store.saveNightOn(v); setNightOn(v); }} /><span>${to("nightOn")}</span></label>` : null}
|
|
1664
2831
|
<label class="check oo-dialogue" title=${to("dialogueTitle")}><input type="checkbox" checked=${dialogueOn} onChange=${toggleDialogue} /><span>${to("dialogue")}</span></label>
|
|
2832
|
+
${chat && !shared ? html`<label class="oo-pick oo-talk-pick" title=${chatUi.talkWord("modeTitle")}><span class="oo-pick-label">${chatUi.talkWord("mode")}</span>
|
|
2833
|
+
<select class="tb-select oo-talk-mode" value=${tmode} onChange=${(e) => pickTalkMode(e.target.value)}>
|
|
2834
|
+
${chatUi.TALK_MODES.map((m) => html`<option key=${m} value=${m}>${chatUi.talkWord(m)}</option>`)}
|
|
2835
|
+
</select></label>` : null}
|
|
1665
2836
|
${overview ? html`<label class="check oo-lobby-tile" title=${lobbyAll.length ? undefined : to("lobbyEveryone")}><input type="checkbox" checked=${lobbyOn && lobbyAll.length > 0}
|
|
1666
2837
|
disabled=${!lobbyAll.length} onChange=${() => { const v = !lobbyOn; store.saveLobbyTile(v); setLobbyOn(v); setTip(null); }} /><span>${to("lobbyTile")}</span></label>
|
|
1667
2838
|
${lobbyAll.length ? null : html`<span class="muted oo-note oo-lobby-none">${to("lobbyEveryone")}</span>`}` : null}
|
|
1668
|
-
${
|
|
1669
|
-
|
|
2839
|
+
${traffic ? html`<label class="check oo-key-tick" title=${to("keyTitle")}><input type="checkbox" checked=${keyOpen}
|
|
2840
|
+
onChange=${() => { const v = !keyOpen; store.saveKeyOpen(v); setKeyOpen(v); }} /><span>${to("key")}</span></label>` : null}
|
|
1670
2841
|
${styleErr && auto ? html`<span class="note oo-note oo-style-err" role="status">${styleErr}</span>` : null}
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
${
|
|
1674
|
-
|
|
1675
|
-
title=${overview ? to("overviewNoEdit") : undefined}>${t("orge.edit")}</button>` : null}
|
|
2842
|
+
`;
|
|
2843
|
+
const actionItems = html`
|
|
2844
|
+
${canEdit && storedRev !== null ? html`<button type="button" class="btn btn-sm oo-edit" onClick=${() => { if (!overview && !carouselPick) setEditing(true); }} disabled=${!!layout || overview || carouselPick}
|
|
2845
|
+
title=${overview || carouselPick ? to(carouselPick ? "carouselNoEdit" : "overviewNoEdit") : undefined}>${t("orge.edit")}</button>` : null}
|
|
1676
2846
|
${canLayout ? html`<button type="button" class="btn btn-sm oo-layout" onClick=${openLayout}>${t("orgl.edit")}</button>` : null}
|
|
1677
2847
|
${canShare ? html`<${ShareButton} offices=${stored} current=${overview ? "all" : custom ? custom.id : null} disabled=${!!layout}
|
|
1678
2848
|
get=${lease ? (path, o) => lease.fetch(path, o) : undefined} />` : null}
|
|
1679
|
-
|
|
2849
|
+
`;
|
|
2850
|
+
// The sheet: a "Display options" heading over the options (a Hub room's too), a rule before the actions (a room has none).
|
|
2851
|
+
const hasActions = (canEdit && storedRev !== null) || canLayout || canShare;
|
|
2852
|
+
const barItems = html`${scopeItems}<h3 class="oo-sheet-h">${to("display")}</h3>${optionItems}
|
|
2853
|
+
${hasActions ? html`<hr class="oo-sheet-rule" />` : null}${actionItems}`;
|
|
2854
|
+
// A room's dropdown hangs from the zoom stack's top, inside the stage (which clips): it is never taller than the
|
|
2855
|
+
// stage's room below its top (Prism #3556 P2: a 340 px stage); a longer list scrolls.
|
|
2856
|
+
// The bar's dropdown hangs below the bar: never past the window's bottom either (#4466: a longer list, a short window).
|
|
2857
|
+
const fitPop = (el) => {
|
|
2858
|
+
if (!el || typeof el.getBoundingClientRect !== "function") return;
|
|
2859
|
+
if (!roomGear) {
|
|
2860
|
+
const vh = globalThis.innerHeight;
|
|
2861
|
+
if (vh > 0) el.style.maxHeight = `${Math.min(popMaxHeight(vh, el.getBoundingClientRect().top), Math.floor(vh * 0.7), 480)}px`;
|
|
2862
|
+
return;
|
|
2863
|
+
}
|
|
2864
|
+
if (!stageRef.current) return;
|
|
2865
|
+
const st = stageRef.current.getBoundingClientRect(), top = el.getBoundingClientRect().top;
|
|
2866
|
+
if (st && st.height > 0) el.style.maxHeight = `${popMaxHeight(st.bottom, top)}px`;
|
|
2867
|
+
};
|
|
2868
|
+
const displayMenu = (opener) => html`<div class=${`oo-display${roomGear ? " oo-display-zoom" : ""}`} ref=${displayRef}>${opener}
|
|
2869
|
+
${dispOpen ? html`<div class="oo-display-pop" role="group" aria-label=${to("display")} ref=${fitPop}><h3 class="oo-display-h">${to("display")}</h3>
|
|
2870
|
+
<div class="oo-bar oo-display-list">${optionItems}</div></div>` : null}</div>`;
|
|
2871
|
+
return html`<div class=${`oo${fs ? ` fs ${fs}` : ""}${compact ? " phone" : ""}${dockShown ? " has-dialogue" : ""}${sidePanel && !phone ? " ot-side" : ""}`} ref=${ooRef}
|
|
2872
|
+
data-names-off=${namesOff ? "" : undefined}>
|
|
2873
|
+
${folded ? null : html`<div class="oo-bar oo-bar-row">
|
|
2874
|
+
<div class="oo-bar-scope">${scopeItems}</div>
|
|
2875
|
+
<div class="oo-bar-actions">${actionItems}
|
|
2876
|
+
${displayMenu(html`<button type="button" class=${`btn btn-sm oo-display-btn${dispOpen ? " on" : ""}`} aria-expanded=${dispOpen ? "true" : "false"}
|
|
2877
|
+
onClick=${() => setDisp(!dispOpen)}><${Icon} name="settings" size=${14} /><span>${to("display")}</span></button>`)}
|
|
2878
|
+
</div>
|
|
2879
|
+
</div>`}
|
|
2880
|
+
${compact && more ? html`<${Dialog} title=${to("office")} cls="oo-sheet" onClose=${closeMore}>
|
|
2881
|
+
${compact ? html`<div class="oo-sheet-tiles">
|
|
2882
|
+
${tile("fitwidth", to("fit"), () => { closeMore(); fit(); }, "oo-sheet-fit")}
|
|
2883
|
+
${tile("fitwidth", to("fill"), toggleFill, "oo-sheet-fill", fitMode === "cover")}
|
|
2884
|
+
${tile("fullscreen", to("fullscreen"), () => { closeMore(); enterFs(); }, "oo-sheet-fs")}
|
|
2885
|
+
</div>` : null}
|
|
2886
|
+
${typeof onLive === "function" ? html`<label class="check oo-sheet-live"><input type="checkbox" checked=${!!live} onChange=${() => onLive(!live)} /><span>${to("live")}</span></label>` : null}
|
|
2887
|
+
<div class="oo-bar oo-sheet-bar" onClick=${sheetClick}>${barItems}</div>
|
|
2888
|
+
</${Dialog}>` : null}
|
|
1680
2889
|
${traffic && keyOpen ? html`<${OfficeKey} pal=${pal} />` : null}
|
|
1681
|
-
${editing && !overview ? html`<${OfficeEditor} offices=${stored} rev=${storedRev} view=${view} store=${store} packs=${packs}
|
|
2890
|
+
${editing && !overview && !carouselPick ? html`<${OfficeEditor} offices=${stored} rev=${storedRev} view=${view} store=${store} packs=${packs}
|
|
1682
2891
|
ask=${ask} current=${() => shown.current} onSaved=${adopt} onClose=${() => setEditing(false)} />` : null}
|
|
1683
2892
|
${overview || people.length || L.rooms.length ? null : html`<p class="note oo-empty">${to("nobody")} ${auto && (f.team || f.pinned.length) ? html`<button type="button" class="btn btn-sm" onClick=${() => setF({ team: "", pinned: [] })}>${to("everyone")}</button>` : null}</p>`}
|
|
1684
|
-
<div class=${`oo-stage${layout ? " editing" : ""}`} ref=${stageRef} onPointerDown=${onDown} onPointerMove=${
|
|
2893
|
+
<div class=${`oo-stage${layout ? " editing" : ""}`} ref=${stageRef} onPointerDown=${onDown} onPointerMove=${onStageMove} onPointerUp=${onStageUp} onPointerCancel=${onStageCancel}
|
|
1685
2894
|
onWheel=${onWheel} onKeyDown=${onKeyDown} onFocusIn=${onFocusIn} onClickCapture=${g.clickCapture}>
|
|
1686
|
-
${
|
|
1687
|
-
<canvas ref=${canvasRef} class=${`oo-canvas${(tipDesk && tipDesk.node.i) || dlgHot ? " hot" : ""}`} role="application" tabindex="0" aria-label=${to(overview ? "labelAll" : "label")}
|
|
2895
|
+
${dlgOn ? html`<div class="sr-only oo-dialogue-live" aria-live="polite">${dlgSay}</div>` : null}
|
|
2896
|
+
<canvas ref=${canvasRef} class=${`oo-canvas${(tipDesk && tipDesk.node.i) || dlgHot ? " hot" : ""}`} role="application" tabindex="0" aria-label=${to(carouselPick ? "labelCarousel" : overview ? "labelAll" : "label")}
|
|
1688
2897
|
onPointerMove=${onMove} onPointerLeave=${() => setTip(null)} onClick=${onClick} ondblclick=${onDblClick}></canvas>
|
|
2898
|
+
${tmode === "box" ? html`<${chatUi.TalkStage} peek=${stagePeek} ops=${stageOps} talk=${chat} read=${readMode} onRead=${pickRead} phone=${phone} still=${still}
|
|
2899
|
+
onFull=${openFull} onClose=${() => { dlg.skip(); setTalkTo(null); dlgWake(); }} />` : null}
|
|
1689
2900
|
${overview ? tiles.map((tl) => {
|
|
1690
2901
|
const text = to("tileLabel", tl.name, tl.count), at = (el) => { if (el) labelEls.current.set(tl.key, el); else labelEls.current.delete(tl.key); };
|
|
1691
2902
|
return tl.lobby ? html`<span key=${tl.key} ref=${at} class="oo-tile-label lobby">${text}</span>`
|
|
1692
2903
|
: html`<button key=${tl.key} ref=${at} type="button" class="oo-tile-label" data-office=${tl.key} title=${to("openOffice", tl.name)} aria-label=${to("openOffice", tl.name)}
|
|
1693
|
-
onClick=${() => pick(tl.key)}>${text}</button>`;
|
|
2904
|
+
onClick=${() => pick(tl.key, false)}>${text}</button>`;
|
|
1694
2905
|
}) : null}
|
|
1695
2906
|
${layout ? html`<${LayoutEditor} key=${layout.id} base=${layout.base} start=${layout.start} place=${placeOverlay} dock=${!fs} members=${layoutMembers}
|
|
1696
2907
|
stale=${layoutStale ? t("orgl.stale") : ""} onChange=${onDraft} onSave=${saveLayout} onClose=${closeLayout} />` : null}
|
|
1697
2908
|
${tipText && tip !== card ? html`<div ref=${tipRef} class="oo-tip" role="tooltip">
|
|
1698
2909
|
<strong>${tipText.primary}</strong>${tipText.secondary ? html` <span class="muted mono">${tipText.secondary}</span>` : null}
|
|
1699
|
-
<div>${tipText.sub}</div
|
|
2910
|
+
<div>${words ? stateOf(tipDesk.node) : tipText.sub}</div>${nowOf(tipDesk.node) ? html`<div class="muted">${nowOf(tipDesk.node)}</div>` : null}
|
|
1700
2911
|
${tipDesk.office ? html`<div class="muted oo-tip-office">${tipDesk.office}</div>` : null}
|
|
1701
2912
|
</div>` : null}
|
|
1702
2913
|
${cardOf ? html`<${OfficeCard} key=${cardOf.key}
|
|
1703
|
-
model=${cardModel({ node: cardOf.node, lv, levels: wordsOf(cardOf.skin), share: !onOpen,
|
|
1704
|
-
state:
|
|
2914
|
+
model=${cardModel({ node: cardOf.node, lv, levels: wordsOf(cardOf.skin), share: !onOpen, rows: cardRows ? cardRows(cardOf.node.name) : null, display: cardName ? cardName(cardOf.node.name) : "",
|
|
2915
|
+
state: stateOf(cardOf.node), now: nowOf(cardOf.node),
|
|
1705
2916
|
where: [cardOf.office || (custom ? custom.name : to("allOffice")), cardOf.area].filter(Boolean).join(" · ") })}
|
|
1706
|
-
avatar=${drawAvatar} sheet=${size.w < SHEET_W} place=${(el) => { cardEl.current = el; placeCard();
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
2917
|
+
avatar=${drawAvatar} sheet=${phone || size.w < SHEET_W} place=${(el) => { const was = cardEl.current; cardEl.current = el; if (!el || !el.classList?.contains("sheet")) unliftSheet(); placeCard();
|
|
2918
|
+
// #4379 review: the tags it covers (or uncovers) are judged at the next frame; a still scene draws one now.
|
|
2919
|
+
if (was !== el && scene.current) { scene.current.dirty = true; const go = () => (still ? draw(0) : loop.current?.wake()); if (typeof requestAnimationFrame === "function") requestAnimationFrame(go); else go(); } }}
|
|
2920
|
+
onChat=${onOpen ? () => { const n = cardOf.node.name; setCard(null); open(n); } : null} onFind=${findCard} onClose=${closeCard}
|
|
2921
|
+
rename=${onOpen && !readOnly ? { value: renames[cardOf.node.name] || "", save: (v) => setRenames(store.saveRename(cardOf.node.name, v)) } : null}
|
|
2922
|
+
onReact=${play ? (kind) => {
|
|
2923
|
+
const n = cardOf.node.name;
|
|
2924
|
+
if (kind === "feed" && !ASLEEP.has(cardOf.node.state) && !cardOf.box.night) {
|
|
2925
|
+
const sn = (armedSnack && snacksById.get(armedSnack)) || packSnacks[0] || null;
|
|
2926
|
+
if (sn || (skin.eatStrip && skin.eatStrip(n))) {
|
|
2927
|
+
const at = (zones && walkers.at(n, now())) || cardOf.box.seat || { x: cardOf.box.x + cardOf.box.w / 2, y: cardOf.box.y + cardOf.box.h };
|
|
2928
|
+
snacks.feed(n, sn, { x: at.x, y: at.y, t: now(), charEatStrip: skin.eatStrip ? skin.eatStrip(n) : null });
|
|
2929
|
+
walkNow.current?.();
|
|
2930
|
+
}
|
|
2931
|
+
}
|
|
2932
|
+
// A pat with the set's `pat` strip lasts one full pass of it (never shorter than the hearts).
|
|
2933
|
+
const t0 = now(), patSt = kind === "pat" && skin.patStrip ? skin.patStrip(n) : null;
|
|
2934
|
+
reacts.current.set(n, { kind, t0, ...(patSt ? { until: t0 + Math.max(PLAY.REACT_MS, stripDurationMs(patSt)) } : {}) });
|
|
2935
|
+
loop.current?.wake(); if (store.tellOn(n)) void store.tell(n, kind);
|
|
2936
|
+
} : null}
|
|
2937
|
+
preview=${zones && !overview && skin && skin.pack ? {
|
|
2938
|
+
poses: PREVIEW_POSES,
|
|
2939
|
+
pose: preview.current && preview.current.name === cardOf.node.name ? preview.current.pose : "",
|
|
2940
|
+
set: (pose) => { preview.current = pose ? { name: cardOf.node.name, pose, t0: now() } : null; setPreviewRev((x) => x + 1); loop.current?.wake(); },
|
|
2941
|
+
replay: () => { if (preview.current) { preview.current = { ...preview.current, t0: now() }; loop.current?.wake(); } },
|
|
2942
|
+
} : null}
|
|
2943
|
+
tell=${play ? { on: store.tellOn(cardOf.node.name), set: (v) => { store.saveTell(cardOf.node.name, v); setTellRev((x) => x + 1); } } : null}
|
|
2944
|
+
packCard=${cardOf.skin?.pack?.card || null}
|
|
2945
|
+
picture=${typeof cardOf.skin?.picture === "function" ? cardOf.skin.picture : null}
|
|
2946
|
+
portrait=${cardOf.skin?.pack ? portraitSrc(cardOf.skin.pack, { agent: cardOf.node.name, state: cardOf.node.state }) : null}
|
|
2947
|
+
packScale=${cardOf.skin?.pack?.scale || 2} action=${cardAction ? cardAction(cardOf.node.name) : null}
|
|
2948
|
+
photo=${cardPhoto ? cardPhoto(cardOf.node.name) : null} />` : null}
|
|
2949
|
+
<ul class="oo-desks" ref=${desksRef} onScroll=${desksCue} aria-label=${to("desks")}>${people.map((d) => {
|
|
2950
|
+
const nt = nodeText(d.node), cap = nowOf(d.node), where = d.office ? ` · ${d.office}` : "";
|
|
2951
|
+
const full = words ? `${nt.primary} — ${stateOf(d.node)}` : nt.full;
|
|
2952
|
+
return html`<li key=${d.key} data-call=${CALLING.has(d.node.state) ? "" : undefined}>${d.node.i
|
|
2953
|
+
? html`<button type="button" class="oo-desk" data-name=${d.node.name} data-key=${d.key} data-slot=${Number.isInteger(d.box?.slot) ? d.box.slot : undefined} aria-label=${`${full}${where}${cap ? ` · ${cap}` : ""}.`} aria-haspopup="dialog"
|
|
1712
2954
|
onFocus=${() => setTip(d.key)} onBlur=${() => setTip(null)} onClick=${() => { cardFrom.current = d.key; setCard((cur) => (cur === d.key ? null : d.key)); }}>${nt.primary}</button>`
|
|
1713
|
-
: html`<span class="oo-desk" data-name=${d.node.name} data-key=${d.key}>${
|
|
2955
|
+
: html`<span class="oo-desk" data-name=${d.node.name} data-key=${d.key}>${full}</span>`}</li>`;
|
|
1714
2956
|
})}</ul>
|
|
1715
|
-
<div class="oc-zoom oo-zoom" role="group" aria-label=${
|
|
2957
|
+
<div class="oc-zoom oo-zoom" role="group" aria-label=${to("view")}>
|
|
1716
2958
|
<output ref=${pctRef} class="oo-zoom-pct"></output>
|
|
1717
|
-
<button type="button" class="icon-btn oo-zoom-in" aria-label=${
|
|
1718
|
-
<button type="button" class="icon-btn oo-zoom-out" aria-label=${
|
|
2959
|
+
<button type="button" class="icon-btn oo-zoom-in" aria-label=${to("zoomIn")} title=${to("zoomIn")} onClick=${() => zoomStep(1)}><${Icon} name="plus" size=${16} /></button>
|
|
2960
|
+
<button type="button" class="icon-btn oo-zoom-out" aria-label=${to("zoomOut")} title=${to("zoomOut")} onClick=${() => zoomStep(-1)}><${Icon} name="minus" size=${16} /></button>
|
|
1719
2961
|
<button type="button" class="icon-btn oo-fit" aria-label=${to("fit")} title=${to("fit")} onClick=${() => fit()}><${Icon} name="fitwidth" size=${16} /></button>
|
|
1720
2962
|
<button type="button" class=${`icon-btn oo-fill${fitMode === "cover" ? " on" : ""}`} aria-pressed=${fitMode === "cover" ? "true" : "false"} aria-label=${to("fillTitle")}
|
|
1721
2963
|
title=${to("fillTitle")} onClick=${toggleFill}>${to("fill")}</button>
|
|
1722
2964
|
<button type="button" class="icon-btn oo-fs" aria-label=${to(fs ? "exitFullscreen" : "fullscreen")} title=${to(fs ? "exitFullscreen" : "fullscreen")} onClick=${toggleFs}><${Icon} name=${fs ? "fullscreenexit" : "fullscreen"} size=${16} /></button>
|
|
2965
|
+
${roomGear ? displayMenu(html`<button type="button" class=${`icon-btn oo-options${dispOpen ? " on" : ""}`} aria-expanded=${dispOpen ? "true" : "false"} aria-label=${to("display")} title=${to("display")} onClick=${() => setDisp(!dispOpen)}><${Icon} name="settings" size=${16} /></button>`) : null}
|
|
1723
2966
|
</div>
|
|
1724
|
-
${
|
|
1725
|
-
|
|
2967
|
+
${showSnacks ? html`<div ref=${snackTrayRef} class="oo-snacks" role="toolbar" aria-label=${to("snacks")}>
|
|
2968
|
+
${packSnacks.map((sn) => {
|
|
2969
|
+
const lb = snackLabel(sn, lang());
|
|
2970
|
+
return html`<button key=${sn.id} type="button" class="icon-btn oo-snack" data-snack=${sn.id}
|
|
2971
|
+
aria-label=${to("snackArm", lb)} title=${lb} aria-pressed=${armedSnack === sn.id ? "true" : "false"}
|
|
2972
|
+
onPointerDown=${(e) => onSnackDown(sn, e)}
|
|
2973
|
+
onClick=${(e) => { e.stopPropagation(); if (snackSwallowRef.current) return; setArmedSnack((cur) => (cur === sn.id ? null : sn.id)); }}>
|
|
2974
|
+
<canvas class="oo-snack-icon" width="28" height="28" aria-hidden="true" ref=${paintSnackIcon(sn.sprite, 28)}></canvas>
|
|
2975
|
+
</button>`;
|
|
2976
|
+
})}
|
|
2977
|
+
</div>` : null}
|
|
2978
|
+
${snackDrag ? html`<div class="oo-snack-ghost" aria-hidden="true" ref=${(el) => {
|
|
2979
|
+
snackGhostRef.current = el;
|
|
2980
|
+
if (el && el.style && snackGhostPosRef.current) el.style.setProperty("transform", `translate(${snackGhostPosRef.current.x}px, ${snackGhostPosRef.current.y}px)`);
|
|
2981
|
+
}}>
|
|
2982
|
+
<canvas class="oo-snack-icon" width="28" height="28" ref=${paintSnackIcon(snackDrag.snack.sprite, 28)}></canvas>
|
|
2983
|
+
${snackDrag.kind === "feed" ? html`<span class="oo-snack-hint">${to("snackFeed", snackDrag.label)}</span>`
|
|
2984
|
+
: snackDrag.kind === "place" ? html`<span class="oo-snack-hint">${to("snackPlace")}</span>` : null}
|
|
2985
|
+
</div>` : null}
|
|
2986
|
+
${fs ? html`<div class="oo-fs-bar">${oneOffice ? null : officeSelect("oo-fs-office")}${carChrome()}</div>` : null}
|
|
2987
|
+
${miniOff ? null : html`<svg ref=${miniRef} class="oc-mini oo-mini" viewBox=${`0 0 ${Math.max(1, L.width)} ${Math.max(1, L.height)}`} aria-hidden="true" onClick=${onMini}>
|
|
1726
2988
|
<title>${to("overview")}</title>
|
|
1727
2989
|
<rect class="oo-mini-matte" x=${-L.width} y=${-L.height} width=${L.width * 3} height=${L.height * 3} fill=${matte} />
|
|
1728
2990
|
<rect class="oo-mini-scene" x="0" y="0" width=${L.width} height=${L.height} />
|
|
1729
2991
|
${miniRects.map((r) => html`<rect key=${r.key} class="oo-mini-room" x=${r.x} y=${r.y} width=${r.w} height=${r.h} />`)}
|
|
1730
2992
|
${people.map((d) => html`<circle key=${d.key} class=${`oo-mini-dot st-${d.node.state}${q && hits(d.node, q) ? " match" : ""}`} cx=${d.dot.x} cy=${d.dot.y} r=${dotR} />`)}
|
|
1731
2993
|
<rect ref=${miniViewRef} class="oc-mini-view oo-mini-view" />
|
|
1732
|
-
</svg
|
|
2994
|
+
</svg>`}
|
|
1733
2995
|
</div>
|
|
2996
|
+
${zoneList.length ? html`<div class="oo-zone-pills" role="group" aria-label=${to("zones")} ref=${pillsRef} onScroll=${pillsCue}>
|
|
2997
|
+
<button type="button" class="btn btn-sm oo-zone-all" onClick=${() => fit()}>${to("zoneAll")}</button>
|
|
2998
|
+
${zoneList.map((z) => html`<button key=${z.key} type="button" class="btn btn-sm oo-zone" data-area=${z.key} onClick=${() => toZone(z)}>${to("zoneN", areaName(z.key), z.n)}</button>`)}
|
|
2999
|
+
</div>` : null}
|
|
3000
|
+
${dockShown ? html`<canvas class="oo-dialogue-canvas" ref=${dialogueCanvasRef}
|
|
3001
|
+
role=${onOpen && !shared ? "button" : "img"} tabindex=${onOpen && !shared ? "0" : null}
|
|
3002
|
+
aria-label=${onOpen && !shared ? to("dlgOpenChat") : dlgSay} title=${onOpen && !shared ? to("dlgOpenChat") : null}
|
|
3003
|
+
onClick=${openDialogue} onKeyDown=${openDialogue}></canvas>` : null}
|
|
3004
|
+
${tmode === "bubble" ? html`<${chatUi.TalkBar} talk=${chat} name=${talkTo} label=${talkLabel} onFull=${openFull}
|
|
3005
|
+
read=${readMode} onRead=${pickRead} onSkip=${skipTalk} />` : null}
|
|
3006
|
+
${sidePanel ? html`<${chatUi.TalkPanel} talk=${chat} name=${talkTo} label=${talkLabel} state=${talkWho ? talkWho.node.state : null} stateLabel=${talkWho ? stateOf(talkWho.node) : null} sheet=${phone}
|
|
3007
|
+
onClose=${() => setTalkTo(null)} onFull=${openFull} top=${stageRef.current ? stageRef.current.offsetTop : null} />` : null}
|
|
1734
3008
|
</div>`;
|
|
1735
3009
|
}
|