@songsid/agend 2.4.0-beta.2 → 2.4.0-beta.21
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/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/agent-cli-instructions.md +17 -7
- package/dist/agent-cli.js +163 -51
- package/dist/agent-cli.js.map +1 -1
- package/dist/agent-endpoint.d.ts +4 -1
- package/dist/agent-endpoint.js +47 -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-token-header.d.ts +1 -1
- package/dist/agent-token-header.js +1 -1
- package/dist/agent-whats-new.js +15 -0
- package/dist/agent-whats-new.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 +10 -0
- package/dist/auth-api.js +81 -4
- 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 +11 -1
- package/dist/authority/web-authority.js +11 -1
- 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 +84 -9
- 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 +24 -7
- package/dist/backend/claude-code.js +206 -29
- package/dist/backend/claude-code.js.map +1 -1
- 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/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/credential-profile.js +1 -1
- package/dist/backend/credential-profile.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.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 +29 -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/channel/adapters/discord.d.ts +10 -0
- package/dist/channel/adapters/discord.js +35 -0
- package/dist/channel/adapters/discord.js.map +1 -1
- package/dist/channel/adapters/telegram.d.ts +2 -0
- package/dist/channel/adapters/telegram.js +6 -1
- package/dist/channel/adapters/telegram.js.map +1 -1
- package/dist/channel/mcp-server.js +36 -4
- package/dist/channel/mcp-server.js.map +1 -1
- package/dist/channel/mcp-tools.d.ts +27 -1
- package/dist/channel/mcp-tools.js +91 -8
- package/dist/channel/mcp-tools.js.map +1 -1
- package/dist/channel/tool-router.d.ts +4 -0
- package/dist/channel/tool-router.js +50 -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/cli-audited.js +24 -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 +8 -0
- 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 +52 -2
- package/dist/config-validator.js.map +1 -1
- package/dist/config.js +15 -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 +88 -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 +101 -0
- package/dist/contact-auth-service.js.map +1 -0
- package/dist/contact-auth-store.d.ts +86 -0
- package/dist/contact-auth-store.js +372 -0
- package/dist/contact-auth-store.js.map +1 -0
- package/dist/contact-auth-types.d.ts +198 -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 +47 -0
- package/dist/contact-change-proposals.js +131 -0
- package/dist/contact-change-proposals.js.map +1 -0
- package/dist/daemon.d.ts +98 -3
- package/dist/daemon.js +673 -59
- 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 +15 -8
- package/dist/dashboard-permissions.js +25 -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 +6 -6
- package/dist/delivery-outbox.js +19 -25
- 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/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 +13 -1
- package/dist/event-log.js +41 -1
- package/dist/event-log.js.map +1 -1
- package/dist/fleet-context.d.ts +1 -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-manager.d.ts +530 -14
- package/dist/fleet-manager.js +3323 -266
- package/dist/fleet-manager.js.map +1 -1
- package/dist/fleet-windows-runtime.d.ts +2 -2
- package/dist/fleet-windows-runtime.js +13 -4
- 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/concepts/SKILL.md +72 -4
- package/dist/general-knowledge/skills/credential-profiles/SKILL.md +23 -1
- package/dist/general-knowledge/skills/cross-instance-messaging/SKILL.md +52 -0
- package/dist/general-knowledge/skills/fleet-config/SKILL.md +21 -1
- package/dist/general-knowledge/skills/fleet-health/SKILL.md +18 -0
- package/dist/general-knowledge/skills/hub/SKILL.md +369 -27
- package/dist/general-knowledge/skills/instance-lifecycle/SKILL.md +5 -1
- 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 +67 -0
- package/dist/general-knowledge/skills/web-appearance/SKILL.md +29 -3
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +224 -43
- package/dist/general-knowledge/skills/worker-collaboration/SKILL.md +6 -0
- 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 +1 -0
- package/dist/general-role.js.map +1 -1
- package/dist/host-memory.d.ts +3 -0
- 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 +121 -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 +129 -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 +147 -0
- package/dist/hub/agent-pictures-model.js +64 -0
- package/dist/hub/agent-pictures-model.js.map +1 -0
- package/dist/hub/agent-pictures.d.ts +52 -0
- package/dist/hub/agent-pictures.js +202 -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 +89 -17
- package/dist/hub/catalog.js.map +1 -1
- package/dist/hub/client.d.ts +18 -0
- package/dist/hub/client.js +149 -12
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +56 -7
- package/dist/hub/compose/member.js +371 -31
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +24 -0
- package/dist/hub/compose/server.js +130 -16
- 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 +5 -2
- package/dist/hub/directory/directory.js.map +1 -1
- package/dist/hub/directory/types.d.ts +5 -1
- 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 +282 -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 +80 -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 +14 -0
- package/dist/hub/http/compose.js +771 -47
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/core.d.ts +9 -1
- package/dist/hub/http/core.js +53 -3
- package/dist/hub/http/core.js.map +1 -1
- package/dist/hub/http/deps.d.ts +19 -0
- package/dist/hub/http/schema.js +50 -1
- package/dist/hub/http/schema.js.map +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 +3 -1
- package/dist/hub/join/service.js +7 -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 +43 -0
- package/dist/hub/member/agent-pictures.js +125 -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 +78 -5
- package/dist/hub/member/room-ask.js +337 -26
- package/dist/hub/member/room-ask.js.map +1 -1
- 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 +44 -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 +46 -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 +135 -0
- package/dist/hub/member/room-post.js +311 -0
- package/dist/hub/member/room-post.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 +92 -0
- package/dist/hub/member/updates.js +316 -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 +62 -7
- package/dist/hub/policy.js.map +1 -1
- package/dist/hub/protocol.d.ts +1274 -56
- package/dist/hub/protocol.js +123 -16
- 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/quota.js +3 -1
- package/dist/hub/quota.js.map +1 -1
- 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 +211 -0
- package/dist/hub/recommendations.js.map +1 -0
- package/dist/hub/representative.d.ts +33 -0
- package/dist/hub/representative.js +132 -12
- 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 +144 -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 +12 -0
- package/dist/hub/roles/authority.js +39 -3
- 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 +3 -0
- package/dist/hub/roles/clock.js +1 -1
- 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-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 +7 -2
- 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 +25 -0
- package/dist/hub/roles/model.js +9 -3
- 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/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-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-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/rooms/agents.d.ts +49 -10
- package/dist/hub/rooms/agents.js +356 -33
- package/dist/hub/rooms/agents.js.map +1 -1
- 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 +25 -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/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 +123 -0
- package/dist/hub/rooms/office.js +79 -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 +14 -0
- package/dist/hub/rooms/schema.js +52 -0
- package/dist/hub/rooms/schema.js.map +1 -1
- package/dist/hub/rooms/service.d.ts +373 -7
- package/dist/hub/rooms/service.js +1056 -47
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +46 -4
- package/dist/hub/rooms.d.ts +22 -2
- package/dist/hub/rooms.js +193 -47
- 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/server.d.ts +8 -1
- package/dist/hub/server.js +165 -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-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 +2 -2
- package/dist/hub/sessions.js +39 -11
- 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 +1 -1
- 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/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/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 +173 -5
- 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 +11 -0
- package/dist/hub-contact-windows.js +56 -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 +14 -0
- package/dist/hub-picture-reduce.js +49 -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 +11 -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.js +8 -0
- package/dist/human-delivery-receipts.js.map +1 -1
- package/dist/instance-config-impact.js +5 -2
- package/dist/instance-config-impact.js.map +1 -1
- package/dist/instance-lifecycle.d.ts +21 -1
- package/dist/instance-lifecycle.js +55 -14
- 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 +35 -1
- package/dist/instructions.js +63 -33
- package/dist/instructions.js.map +1 -1
- package/dist/locale.d.ts +2 -0
- package/dist/locale.js +373 -34
- 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/memory-guidance.d.ts +5 -0
- package/dist/memory-guidance.js +14 -0
- package/dist/memory-guidance.js.map +1 -0
- 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-mcp.d.ts +2 -0
- package/dist/native-mcp.js +23 -11
- 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.js +3 -2
- package/dist/native-pane-lifecycle.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 +4 -0
- package/dist/needs-you-hub.js +17 -2
- package/dist/needs-you-hub.js.map +1 -1
- package/dist/needs-you.d.ts +40 -2
- package/dist/needs-you.js +18 -0
- package/dist/needs-you.js.map +1 -1
- package/dist/office-share-page.js +4 -4
- package/dist/office-share-page.js.map +1 -1
- package/dist/outbound-handlers.d.ts +28 -4
- package/dist/outbound-handlers.js +150 -13
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +32 -0
- package/dist/outbound-schemas.js +44 -25
- package/dist/outbound-schemas.js.map +1 -1
- package/dist/pane-port.d.ts +2 -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/profile-signins.d.ts +1 -0
- package/dist/profile-signins.js +3 -1
- package/dist/profile-signins.js.map +1 -1
- package/dist/public-web-gateway.d.ts +20 -0
- package/dist/public-web-gateway.js +232 -9
- package/dist/public-web-gateway.js.map +1 -1
- package/dist/public-web-link.d.ts +21 -2
- package/dist/public-web-link.js +22 -2
- 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/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 +1 -0
- package/dist/remote-card-prompt.js +2 -2
- package/dist/remote-card-prompt.js.map +1 -1
- package/dist/reply-dedup.js +3 -1
- package/dist/reply-dedup.js.map +1 -1
- 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/restart-progress.d.ts +6 -0
- package/dist/restart-progress.js +5 -0
- package/dist/restart-progress.js.map +1 -1
- 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 +18 -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 +28 -0
- package/dist/runtime-client-store.js.map +1 -1
- package/dist/runtime-client.d.ts +4 -0
- package/dist/runtime-client.js +33 -10
- package/dist/runtime-client.js.map +1 -1
- package/dist/runtime-coordinator.d.ts +4 -2
- package/dist/runtime-coordinator.js +33 -6
- 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-mcp.js +7 -3
- 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-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 +2 -0
- package/dist/scheduler/db.js +2 -0
- package/dist/scheduler/db.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.js +3 -0
- package/dist/scheduler/task-board-text.js.map +1 -1
- package/dist/scheduler/task-board.d.ts +199 -3
- package/dist/scheduler/task-board.js +492 -7
- package/dist/scheduler/task-board.js.map +1 -1
- package/dist/settings-api.d.ts +36 -1
- package/dist/settings-api.js +525 -96
- package/dist/settings-api.js.map +1 -1
- package/dist/settings-baseline.d.ts +4 -0
- package/dist/settings-baseline.js +7 -5
- package/dist/settings-baseline.js.map +1 -1
- package/dist/settings-change.js +47 -7
- package/dist/settings-change.js.map +1 -1
- package/dist/settings-effect.d.ts +7 -0
- package/dist/settings-effect.js +80 -5
- package/dist/settings-effect.js.map +1 -1
- package/dist/settings-http-confirmation.js +18 -44
- 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/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/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-board-tool.d.ts +48 -0
- package/dist/task-board-tool.js +89 -6
- package/dist/task-board-tool.js.map +1 -1
- package/dist/task-board-waker.d.ts +23 -30
- package/dist/task-board-waker.js +136 -97
- package/dist/task-board-waker.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.js +5 -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/topic-commands.d.ts +7 -1
- package/dist/topic-commands.js +103 -91
- package/dist/topic-commands.js.map +1 -1
- package/dist/transcript-monitor.d.ts +1 -0
- package/dist/transcript-monitor.js +18 -0
- package/dist/transcript-monitor.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/turn-reply-guard.d.ts +2 -2
- package/dist/turn-reply-guard.js +3 -3
- package/dist/turn-reply-guard.js.map +1 -1
- package/dist/types.d.ts +37 -2
- package/dist/ui/accounts-keepalive.js +2 -1
- package/dist/ui/accounts-view.js +18 -9
- package/dist/ui/agent-details-settings.js +9 -7
- package/dist/ui/agent-export-dialog.js +4 -3
- package/dist/ui/agent-export-strings.js +4 -4
- package/dist/ui/agent-page-strings.js +18 -0
- package/dist/ui/backend-signin.js +94 -23
- package/dist/ui/chat-activity-groups.js +42 -9
- package/dist/ui/chat-activity.js +22 -3
- 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 +106 -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 +178 -16
- 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 +123 -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 +256 -0
- package/dist/ui/contact-authorizations.js +139 -0
- package/dist/ui/contact-grant-editor.js +50 -0
- package/dist/ui/contact-needs.js +100 -0
- package/dist/ui/contact-permissions.js +251 -0
- package/dist/ui/contact-ticket-badge.js +54 -0
- package/dist/ui/contact-tool-groups.js +39 -0
- package/dist/ui/fleet-canvas.js +20 -7
- package/dist/ui/fleet-office-card.js +446 -41
- 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 +6 -1
- package/dist/ui/fleet-office-layout.js +13 -13
- 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 +81 -4
- package/dist/ui/fleet-office-pack.js +514 -48
- package/dist/ui/fleet-office-play.js +498 -0
- package/dist/ui/fleet-office-skin.js +268 -38
- package/dist/ui/fleet-office-store.js +88 -3
- package/dist/ui/fleet-office-talk.js +423 -0
- package/dist/ui/fleet-office-view.js +26 -17
- package/dist/ui/fleet-office-zones.js +151 -38
- package/dist/ui/fleet-office.js +1147 -155
- package/dist/ui/fleet-route.js +44 -6
- package/dist/ui/fleet-task-activity.js +362 -0
- package/dist/ui/fleet-task-card.js +317 -314
- package/dist/ui/fleet-task-common.js +100 -10
- package/dist/ui/fleet-task-create.js +67 -0
- package/dist/ui/fleet-task-edit.js +204 -0
- package/dist/ui/fleet-task-follow.js +123 -0
- package/dist/ui/fleet-task-menu.js +1 -1
- package/dist/ui/fleet-task-owner.js +252 -0
- package/dist/ui/fleet-task-run.js +257 -0
- package/dist/ui/fleet-task-sort.js +88 -0
- package/dist/ui/fleet-task-view.js +209 -40
- package/dist/ui/fleet-task-work.js +2 -2
- package/dist/ui/fleet-tasks.js +294 -134
- 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 +189 -0
- package/dist/ui/hub-admin-rooms.js +1 -1
- package/dist/ui/hub-agent-copy.js +8 -2
- package/dist/ui/hub-agent-intro.js +35 -0
- package/dist/ui/hub-ai-apps-strings.js +6 -0
- package/dist/ui/hub-ai-apps.js +84 -0
- package/dist/ui/hub-attachments.js +81 -3
- package/dist/ui/hub-chat-store.js +4 -3
- package/dist/ui/hub-chat-strings.js +13 -3
- package/dist/ui/hub-client.js +123 -12
- package/dist/ui/hub-directory-editor-strings.js +2 -2
- package/dist/ui/hub-directory-editor.js +1 -0
- 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-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 +169 -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 +7 -2
- package/dist/ui/hub-quota.js +2 -1
- package/dist/ui/hub-role-audit.js +39 -0
- package/dist/ui/hub-role-forms.js +99 -0
- package/dist/ui/hub-role-notices.js +11 -0
- package/dist/ui/hub-role-view.js +86 -0
- package/dist/ui/hub-roles-strings.js +440 -0
- package/dist/ui/hub-roles.js +83 -0
- package/dist/ui/hub-room-agent-strings.js +28 -0
- package/dist/ui/hub-room-composer.js +183 -20
- package/dist/ui/hub-room-list.js +6 -4
- package/dist/ui/hub-room-members-strings.js +11 -4
- package/dist/ui/hub-room-members.js +132 -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 +161 -0
- package/dist/ui/hub-room-office.js +203 -0
- package/dist/ui/hub-room-owner-requests-strings.js +114 -0
- package/dist/ui/hub-room-owner-requests.js +264 -0
- package/dist/ui/hub-room-pins.js +43 -0
- package/dist/ui/hub-room-presence.js +14 -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.js +79 -4
- 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 +510 -65
- 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 +19 -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/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 +7 -5
- 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 +2 -2
- package/dist/ui/office-share-page.js +5 -1
- package/dist/ui/panel-chat.js +578 -78
- package/dist/ui/panel-details.js +22 -1
- package/dist/ui/panel-fleet.js +49 -14
- package/dist/ui/panel-hub.js +459 -129
- package/dist/ui/panel-log.js +4 -4
- package/dist/ui/panel-needs.js +78 -24
- package/dist/ui/panel-notices.js +4 -1
- package/dist/ui/panel-runtimes.js +2 -1
- package/dist/ui/panel-settings.js +111 -51
- 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/runtime-commands.d.ts +2 -2
- package/dist/ui/runtime-commands.js +7 -4
- package/dist/ui/search-dialog.js +8 -1
- package/dist/ui/settings-access-overview.js +5 -4
- package/dist/ui/settings-appearance.js +13 -11
- 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 +57 -15
- 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-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.js +2 -1
- package/dist/ui/settings-hub-updates.js +67 -0
- package/dist/ui/settings-hub.js +35 -7
- package/dist/ui/settings-layout.js +17 -14
- package/dist/ui/settings-model.js +9 -5
- package/dist/ui/settings-quota-notice.js +3 -3
- package/dist/ui/settings-registry.js +27 -5
- package/dist/ui/settings-shared-strings.js +24 -0
- package/dist/ui/settings-shared.js +62 -14
- package/dist/ui/settings-strings.js +15 -6
- package/dist/ui/settings-update.js +11 -5
- package/dist/ui/settings-web-authority.js +7 -5
- package/dist/ui/shared/access-overview.css +1 -1
- package/dist/ui/shared/accounts-keepalive.css +1 -1
- package/dist/ui/shared/accounts.css +9 -5
- package/dist/ui/shared/agent-sheet.js +120 -0
- package/dist/ui/shared/agent-widget.js +1 -2
- package/dist/ui/shared/app-i18n.js +10 -2
- package/dist/ui/shared/app-nav.js +9 -5
- package/dist/ui/shared/app-prefs.js +9 -3
- package/dist/ui/shared/app-route.js +5 -3
- package/dist/ui/shared/app-shell.js +202 -34
- package/dist/ui/shared/app-store.js +7 -3
- package/dist/ui/shared/app-stream.js +8 -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 +90 -8
- package/dist/ui/shared/app.css +1089 -262
- package/dist/ui/shared/app.js +12 -3
- 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 +36 -11
- 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 +32 -11
- package/dist/ui/shared/chat-table-select.js +175 -0
- package/dist/ui/shared/chat-thread.js +175 -29
- package/dist/ui/shared/chat-work-bar.css +118 -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/hub-ai-apps.css +12 -0
- package/dist/ui/shared/hub-chat.css +117 -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.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 +166 -19
- package/dist/ui/shared/jump-idle.js +36 -0
- package/dist/ui/shared/loading.css +1 -1
- package/dist/ui/shared/model-picker.css +32 -4
- 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 +50 -20
- package/dist/ui/shared/preview-popout.css +11 -0
- 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 +505 -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 +300 -10
- package/dist/ui/shared/ui-confirm.js +5 -2
- package/dist/ui/shared/ui-icons.js +2 -0
- package/dist/ui/shared/ui-menu.js +17 -11
- package/dist/ui/shared/ui-states.js +3 -2
- package/dist/ui/shared/ui-toast.js +4 -4
- package/dist/ui/shared/usage-dialog.js +88 -17
- package/dist/ui/shared/view-history.js +2 -1
- package/dist/ui/shared/view-strings.js +28 -4
- package/dist/ui/shared/web-authorize.js +3 -3
- package/dist/ui/signin.html +4 -2
- package/dist/ui/structured-signin.js +64 -12
- package/dist/ui/subagent-row.js +3 -2
- package/dist/ui/trigger-complete.js +71 -0
- package/dist/ui/usage-pool.js +2 -1
- package/dist/ui/web-terminal/terminal.css +1 -1
- package/dist/ui/workspace-panel.js +6 -4
- package/dist/update-dispatch.d.ts +8 -1
- package/dist/update-dispatch.js +16 -1
- package/dist/update-dispatch.js.map +1 -1
- package/dist/update-idle.d.ts +65 -0
- package/dist/update-idle.js +190 -0
- package/dist/update-idle.js.map +1 -0
- package/dist/update-launch.d.ts +1 -1
- package/dist/update-launch.js +9 -2
- package/dist/update-launch.js.map +1 -1
- package/dist/usage/i18n-keys.d.ts +1 -1
- package/dist/usage/i18n-keys.js +2 -2
- 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 +1 -0
- package/dist/usage/providers.js +20 -7
- package/dist/usage/providers.js.map +1 -1
- package/dist/usage/quota-history.d.ts +1 -1
- package/dist/usage/usage-api.js +5 -2
- package/dist/usage/usage-api.js.map +1 -1
- package/dist/view-api.js +1 -1
- package/dist/view-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 +62 -6
- package/dist/web-api.js +1050 -212
- 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 +128 -2
- package/dist/web-chat-history.js +320 -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.js +3 -3
- package/dist/web-icons.js.map +1 -1
- package/dist/web-login.d.ts +7 -0
- package/dist/web-login.js +8 -1
- package/dist/web-login.js.map +1 -1
- package/dist/web-mentions.d.ts +2 -0
- package/dist/web-mentions.js +20 -0
- 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-skins.d.ts +14 -3
- package/dist/web-office-skins.js +66 -21
- 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-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 +24 -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 +24 -3
- package/dist/web-settings-patch.js +57 -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 +15 -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-cli-api.d.ts +10 -7
- package/dist/windows-cli-api.js +13 -12
- package/dist/windows-cli-api.js.map +1 -1
- package/dist/windows-cli-worker.d.ts +10 -0
- package/dist/windows-cli-worker.js +109 -14
- package/dist/windows-cli-worker.js.map +1 -1
- package/dist/windows-cli.d.ts +10 -1
- package/dist/windows-cli.js +47 -13
- 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/workflow-templates/default.md +4 -6
- package/launcher/agend-install.cjs +48 -7
- package/package.json +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";
|
|
@@ -66,23 +72,27 @@ 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
74
|
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 { CALLING, activeFurniture, bubbleAt, hiddenBy, bubbleRank, NIGHT, WANDER, createMail, createWalkers, isNight, linesFor, npcKey, personAt, placeBubbles, thinBubbles, walkTargets, zonesLayout } from "./fleet-office-zones.js";
|
|
75
|
+
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
76
|
import { actsOk, createOfficeStore } from "./fleet-office-store.js";
|
|
71
77
|
import { badgeOf, fixedOf, mergeLevels } from "./fleet-office-levels.js";
|
|
72
78
|
import { OfficeCard, cardModel } from "./fleet-office-card.js";
|
|
79
|
+
import { PLAY, applySeatDrop, patLook, clampDropForArea, createHold, createSnackDrag, createSnacks, findSeatDropTarget, playAllowed, playOffForMotion, pruneReactions, reactionAt, scatterWords, seatDropTargets } from "./fleet-office-play.js";
|
|
73
80
|
import { POLL_MS } from "./fleet-traffic.js";
|
|
74
81
|
import { OfficeEditor, officeForSave } from "./fleet-office-editor.js";
|
|
75
82
|
import { LayoutEditor, handlesOf } from "./fleet-office-layout.js";
|
|
76
83
|
import { ShareButton } from "./office-share-dialog.js";
|
|
84
|
+
import { Dialog } from "/assets/ui-dialog.js";
|
|
77
85
|
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";
|
|
86
|
+
import { applyOverrides, createClipClocks, fitNight, fitSeatFor, packMaxFps, snackLabel, stripBox, stripDurationMs } from "./fleet-office-pack.js";
|
|
79
87
|
import { ALL_ID, LOBBY_TILE, OV, createCrossFlights, cropToRooms, fromTile, inTile, labelAt, lobbyNodes, overviewOk, tileAt, tileBox, tileLayout, visibleTiles } from "./fleet-office-overview.js";
|
|
88
|
+
import { CAROUSEL_ID, INTERVALS, carouselHeld, carouselIdsOk, carouselKey, carouselOk, intervalOk, nextIndex, prevIndex } from "./fleet-office-carousel.js";
|
|
80
89
|
import { centreOn, gestureState, gestures, miniPoint, toScreen, toWorld, wheelFactor, zoomKey, zoomTo } from "./fleet-canvas-view.js";
|
|
81
|
-
import { OK_MAX,
|
|
90
|
+
import { OK_MAX, clampPan, desksK, minK, edgeMatte, edgeStrips, fitScene, layerScale, miniBox, miniFrame, openingView, pinchOffice, savedOf, stepK, viewFromSaved,
|
|
82
91
|
wholeInView, zoomLabel, zoomOffice } from "./fleet-office-view.js";
|
|
83
92
|
|
|
84
93
|
register("orgo", {
|
|
85
94
|
en: {
|
|
95
|
+
display: "Display options", playMotionOff: "Off: your system asks for reduced motion",
|
|
86
96
|
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
97
|
office: "Office", allOffice: "Whole fleet", show: "Show", allTeams: "All teams", lobby: "Lobby (General, no team)", lobbyRoom: "Lobby",
|
|
88
98
|
people: "People", peopleN: "People ({0})", findPerson: "Find a person", everyone: "Show everyone", nobody: "No one here matches this filter.",
|
|
@@ -92,20 +102,30 @@ register("orgo", {
|
|
|
92
102
|
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
103
|
b_paused: "Zzz…|Back later", b_stopped: "Off duty|Zzz…", b_needs: "Need you!|A question for you|Over here!",
|
|
94
104
|
b_crashed: "Ouch, crashed|Help!", b_stuck: "Hmm, stuck?|Still thinking…",
|
|
95
|
-
hideAsleep: "Hide paused and stopped", nightOn: "Bedtime 0–6:
|
|
105
|
+
options: "Office options", hideAsleep: "Hide paused and stopped", 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
106
|
styleForAll: "The whole fleet's style, for everyone: every device and share link", styleHere: "The whole fleet's style in this browser",
|
|
97
107
|
styleFailed: "The style was not saved for everyone ({0}).", styleBusy: "Too many changes. Try again in a minute.",
|
|
98
108
|
fit: "Fit the office", overview: "Overview: click to move there", fullscreen: "Fullscreen", exitFullscreen: "Exit fullscreen",
|
|
99
109
|
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
|
+
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.",
|
|
111
|
+
backAll: "← All offices",
|
|
101
112
|
key: "Key", keyTitle: "What the items carried between desks are", keyLabel: "Carried between desks",
|
|
102
113
|
keyTask: "Folder: a task", keySend: "Envelope: a message", keyReport: "Paper: a report", keyBroadcast: "Horn: a broadcast",
|
|
103
114
|
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",
|
|
115
|
+
carousel: "Carousel…", labelCarousel: "Carousel: each chosen office fills the screen in turn. Space pauses; ← and → step; F is fullscreen.",
|
|
116
|
+
carouselNoEdit: "Leave the carousel to edit offices or a layout", pause: "Pause", resume: "Play", next: "Next",
|
|
117
|
+
playing: "Playing", paused: "Paused", interval: "Interval", intervalSec: "{0} s", intervalMin: "{0} min",
|
|
118
|
+
officesInCarousel: "Offices in the carousel",
|
|
119
|
+
officesCount: "Carousel {0}/{1} offices ▾", selectAll: "Select all", selectNone: "Select none",
|
|
104
120
|
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}",
|
|
121
|
+
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
122
|
dlgBox: "Dialogue: {0}. Click for their card, double-click for their chat.",
|
|
123
|
+
zones: "Go to an area", zoneAll: "Whole office", zoneN: "{0} {1}",
|
|
124
|
+
snacks: "Snacks", snackFeed: "Feed {0}", snackPlace: "Place here",
|
|
125
|
+
snackArm: "{0}: drag onto someone to feed, or onto the floor to place; click to select",
|
|
107
126
|
},
|
|
108
127
|
"zh-TW": {
|
|
128
|
+
display: "顯示選項", playMotionOff: "已關閉:系統開了「減少動態效果」",
|
|
109
129
|
label: "辦公室:每個 team 是一間房間,每個 Agent 一張桌子;General 和未加入 team 的 Agent 在大廳。拖曳平移;滾輪、雙指、+ 和 − 縮放,0 顯示整個場景,F 切換全螢幕。",
|
|
110
130
|
office: "辦公室", allOffice: "整個 fleet", show: "顯示", allTeams: "所有 team", lobby: "大廳(General、未加入 team)", lobbyRoom: "大廳",
|
|
111
131
|
people: "成員", peopleN: "成員({0})", findPerson: "尋找成員", everyone: "顯示全部", nobody: "沒有符合這個篩選的成員。",
|
|
@@ -115,27 +135,67 @@ register("orgo", {
|
|
|
115
135
|
b_working: "處理中|打字中…|快好了|專心中|再測一次", b_idle: "喝茶中|隨時可以開工|伸個懶腰|有事找我嗎?",
|
|
116
136
|
b_paused: "Zzz…|晚點回來", b_stopped: "下班了|Zzz…", b_needs: "需要你!|有個問題|在這裡!",
|
|
117
137
|
b_crashed: "糟糕,當掉了|救命!", b_stuck: "嗯,卡住了?|還在想…",
|
|
118
|
-
hideAsleep: "隱藏暫停與停止的成員", nightOn: "0–6 點就寢:閒著的人去睡", layoutIgnored: "它儲存的配置不適用這個風格:以風格本身的配置顯示。",
|
|
138
|
+
options: "辦公室選項", hideAsleep: "隱藏暫停與停止的成員", nightOn: "0–6 點就寢:閒著的人去睡", playOn: "拖曳與摸頭", playStill: "開啟「減少動態效果」時關閉", layoutIgnored: "它儲存的配置不適用這個風格:以風格本身的配置顯示。",
|
|
119
139
|
styleForAll: "整個 fleet 的風格,所有人共用:每台裝置與分享連結都一樣", styleHere: "這個瀏覽器裡整個 fleet 的風格",
|
|
120
140
|
styleFailed: "風格沒有替所有人儲存({0})。", styleBusy: "變更太頻繁,請一分鐘後再試。",
|
|
121
141
|
fit: "顯示整個辦公室", overview: "總覽:點一下移到那裡", fullscreen: "全螢幕", exitFullscreen: "結束全螢幕",
|
|
122
142
|
fill: "填滿", fillTitle: "填滿整個面板(超出的部分會被裁切,拖曳即可看到)", zoomLevel: "縮放 {0}",
|
|
123
|
-
allOffices: "所有辦公室", labelAll: "所有辦公室:每間辦公室是一格,以它自己的風格顯示。拖曳平移;滾輪、雙指、+ 和 − 縮放,0 顯示全部,F
|
|
143
|
+
allOffices: "所有辦公室", labelAll: "所有辦公室:每間辦公室是一格,以它自己的風格顯示。拖曳平移;滾輪、雙指、+ 和 − 縮放,0 顯示全部,F 切換全螢幕。點一格即可開啟那間辦公室。",
|
|
144
|
+
backAll: "← 返回全域",
|
|
124
145
|
key: "圖例", keyTitle: "桌子之間傳遞的物品代表什麼", keyLabel: "桌子之間傳遞的物品",
|
|
125
146
|
keyTask: "資料夾:任務", keySend: "信封:訊息", keyReport: "紙張:回報", keyBroadcast: "喇叭:廣播",
|
|
126
147
|
tileLabel: "{0}({1})", openOffice: "開啟辦公室「{0}」", lobbyTile: "大廳格(不在任何辦公室)", lobbyEveryone: "每個成員都已在某間辦公室", overviewNoEdit: "請先選一間辦公室,再編輯辦公室或配置",
|
|
148
|
+
carousel: "輪播…", labelCarousel: "輪播:每間勾選的辦公室輪流佔滿畫面。空白鍵暫停;← 與 → 切換;F 切換全螢幕。",
|
|
149
|
+
carouselNoEdit: "請先離開輪播,再編輯辦公室或配置", pause: "暫停", resume: "播放", next: "下一間",
|
|
150
|
+
playing: "播放中", paused: "已暫停", interval: "間隔", intervalSec: "{0} 秒", intervalMin: "{0} 分鐘",
|
|
151
|
+
officesInCarousel: "輪播的辦公室",
|
|
152
|
+
officesCount: "輪播 {0}/{1} 間 ▾", selectAll: "全選", selectNone: "全不選",
|
|
127
153
|
dialogue: "對話框", dialogueTitle: "有人傳訊息給這裡的成員時,在下方的對話框顯示訊息與回覆(只限這個瀏覽器)",
|
|
128
|
-
dlgWorking: "處理中…", dlgSomeone: "有人", dlgHeardShare: "傳了一則訊息給 {0}。", dlgAnsweredShare: "已回覆。", dlgFile: "(傳了一個檔案)", dlgSays: "{0}:{1}",
|
|
154
|
+
dlgOpenChat: "在新視窗開啟這個 Agent 的聊天", dlgWorking: "處理中…", dlgSomeone: "有人", dlgHeardShare: "傳了一則訊息給 {0}。", dlgAnsweredShare: "已回覆。", dlgFile: "(傳了一個檔案)", dlgSays: "{0}:{1}",
|
|
129
155
|
dlgBox: "對話框:{0}。點一下看資料卡,點兩下開啟聊天。",
|
|
156
|
+
zones: "移到區域", zoneAll: "總覽", zoneN: "{0} {1}",
|
|
157
|
+
snacks: "零食", snackFeed: "餵給 {0}", snackPlace: "放在這裡",
|
|
158
|
+
snackArm: "{0}:拖到成員身上餵食,或放到空地讓閒置成員過來搶;點一下可選取",
|
|
130
159
|
},
|
|
131
160
|
});
|
|
132
161
|
const to = (k, ...v) => t(`orgo.${k}`, ...v);
|
|
162
|
+
/**
|
|
163
|
+
* #4010 follow-up: the carousel's offices as one n/m button, not inline checkboxes (those wrap the bar at ~10).
|
|
164
|
+
* Esc and a click outside close it; Select all / Select none sit above the scrollable list.
|
|
165
|
+
*/
|
|
166
|
+
function CarouselOffices({ stored, carIds, open, onOpen, onToggle, onAll, onNone }) {
|
|
167
|
+
const wrap = useRef(null);
|
|
168
|
+
useEffect(() => {
|
|
169
|
+
if (!open) return undefined;
|
|
170
|
+
const doc = globalThis.document;
|
|
171
|
+
const key = (e) => { if (e.key === "Escape") { e.preventDefault(); e.stopPropagation(); onOpen(false); } };
|
|
172
|
+
const press = (e) => { if (wrap.current && !wrap.current.contains(e.target)) onOpen(false); };
|
|
173
|
+
doc?.addEventListener?.("keydown", key, true);
|
|
174
|
+
doc?.addEventListener?.("pointerdown", press, true);
|
|
175
|
+
return () => { doc?.removeEventListener?.("keydown", key, true); doc?.removeEventListener?.("pointerdown", press, true); };
|
|
176
|
+
}, [open]);
|
|
177
|
+
const n = carIds.length, m = stored.length;
|
|
178
|
+
return html`<div class="oo-car-pick" ref=${wrap}>
|
|
179
|
+
<button type="button" class="btn btn-sm oo-car-offices" aria-haspopup="true" aria-expanded=${open ? "true" : "false"}
|
|
180
|
+
aria-label=${to("officesInCarousel")} onClick=${() => onOpen(!open)}>${to("officesCount", n, m)}</button>
|
|
181
|
+
${open ? html`<div class="oo-car-menu" role="group" aria-label=${to("officesInCarousel")}>
|
|
182
|
+
<div class="oo-car-menu-acts">
|
|
183
|
+
<button type="button" class="btn btn-sm oo-car-all" onClick=${onAll}>${to("selectAll")}</button>
|
|
184
|
+
<button type="button" class="btn btn-sm oo-car-none" onClick=${onNone}>${to("selectNone")}</button>
|
|
185
|
+
</div>
|
|
186
|
+
<div class="oo-carousel-offices">${stored.map((o) => html`<label key=${o.id} class="check"><input type="checkbox" checked=${carIds.includes(o.id)}
|
|
187
|
+
onChange=${() => onToggle(o.id)} /><span>${o.name}</span></label>`)}</div>
|
|
188
|
+
</div>` : null}
|
|
189
|
+
</div>`;
|
|
190
|
+
}
|
|
133
191
|
const CAPTION = { working: "capWorking", idle: "capIdle", paused: "capPaused", needs: "capNeeds", walk: "capIdle", away: "capAway" };
|
|
134
192
|
/** States whose pose is shared but whose words are their own (a queued instance is not asleep). */
|
|
135
193
|
const CAPTION_OF_STATE = { starting: "capStarting", queued: "capQueued" };
|
|
136
194
|
/** What a pose says in words (the tooltip, the desk list); `state`, when its words differ from its pose's. */
|
|
137
195
|
export const caption = (pose, state) => to(CAPTION_OF_STATE[state] || CAPTION[pose] || "capIdle");
|
|
138
196
|
|
|
197
|
+
/** M-3556: the most a dropdown starting at `top` may be tall to end `margin` px above `bottom` (never under `min`). */
|
|
198
|
+
export const popMaxHeight = (bottom, top, margin = 8, min = 96) => Math.max(min, Math.floor(bottom - top - margin));
|
|
139
199
|
const reducedMotion = () => typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
140
200
|
/** The device's ratio (CSS px → device px), kept sane. */
|
|
141
201
|
const deviceRatio = () => Math.max(0.5, Math.min(4, Number(globalThis.devicePixelRatio) || 1));
|
|
@@ -145,6 +205,26 @@ const SIZE0 = { w: 960, h: 600 };
|
|
|
145
205
|
const FIT_PAD = 60;
|
|
146
206
|
/** #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
207
|
const COMPACT_ROW = 12;
|
|
208
|
+
/** 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). */
|
|
209
|
+
const TAG_ROW = 16;
|
|
210
|
+
/** 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. */
|
|
211
|
+
const KEEP_CLEAR = ".oo-zoom, .oo-mini, .oo-stage > .oo-zone-pills";
|
|
212
|
+
/** 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. */
|
|
213
|
+
export function keepClearOf(cv, v) {
|
|
214
|
+
const root = cv && typeof cv.closest === "function" ? cv.closest(".oo") : null;
|
|
215
|
+
if (!root || typeof cv.getBoundingClientRect !== "function" || !(v.k > 0)) return [];
|
|
216
|
+
const c = cv.getBoundingClientRect(), out = [];
|
|
217
|
+
for (const el of root.querySelectorAll(KEEP_CLEAR)) {
|
|
218
|
+
const r = el.getBoundingClientRect();
|
|
219
|
+
if (!r.width || !r.height || r.right <= c.left || r.left >= c.right || r.bottom <= c.top || r.top >= c.bottom) continue;
|
|
220
|
+
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 });
|
|
221
|
+
}
|
|
222
|
+
return out;
|
|
223
|
+
}
|
|
224
|
+
/** Whether two boxes ({ x, y, w, h }) overlap. */
|
|
225
|
+
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;
|
|
226
|
+
/** M-3539: the box a person's figure covers where they are now (the skin's own, else the built-in figure's). */
|
|
227
|
+
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
228
|
/** #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
229
|
export const TAG_MIN_K = 0.75;
|
|
150
230
|
const PAN_KEYS = { ArrowLeft: [-1, 0], ArrowRight: [1, 0], ArrowUp: [0, -1], ArrowDown: [0, 1] };
|
|
@@ -176,6 +256,33 @@ const UP_MS = 1800;
|
|
|
176
256
|
const FIND_K = 2;
|
|
177
257
|
/** #2661: below this stage width (CSS px) the card is a bottom sheet. */
|
|
178
258
|
const SHEET_W = 560;
|
|
259
|
+
/**
|
|
260
|
+
* M-3253 (Argon's phone review): the Office's phone layout — a phone's width (the shell's), or a phone turned sideways (a
|
|
261
|
+
* coarse pointer in a short window: an iPhone's 956 × 440 is wider than 899 px). There the Office's tools are one ⋯ sheet,
|
|
262
|
+
* zone pills jump to a readable zoom, a tap near a person picks them, and their card is a bottom sheet.
|
|
263
|
+
*/
|
|
264
|
+
export const OFFICE_PHONE_Q = "(max-width: 899px), (pointer: coarse) and (max-height: 500px) and (max-width: 1023px)";
|
|
265
|
+
export function useOfficePhone() {
|
|
266
|
+
const read = () => { try { return typeof matchMedia === "function" && matchMedia(OFFICE_PHONE_Q).matches; } catch { return false; } };
|
|
267
|
+
const [on, setOn] = useState(read);
|
|
268
|
+
useEffect(() => {
|
|
269
|
+
if (typeof matchMedia !== "function") return undefined;
|
|
270
|
+
const mq = matchMedia(OFFICE_PHONE_Q), changed = () => setOn(!!mq.matches);
|
|
271
|
+
changed(); mq.addEventListener?.("change", changed);
|
|
272
|
+
return () => mq.removeEventListener?.("change", changed);
|
|
273
|
+
}, []);
|
|
274
|
+
return on;
|
|
275
|
+
}
|
|
276
|
+
/** 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. */
|
|
277
|
+
export const TAP_R = 22;
|
|
278
|
+
/** M-3253: a zone pill's zoom (CSS px a logical unit): the name tags at their own size. */
|
|
279
|
+
export const ZONE_K = 1;
|
|
280
|
+
/** M-3253: of `list` ({ x, y } in logical units), the one nearest (x, y) within `r` logical units, or null. */
|
|
281
|
+
export function nearestPerson(list, x, y, r) {
|
|
282
|
+
let best = null, bestD = r * r;
|
|
283
|
+
for (const it of list) { const d = (it.x - x) ** 2 + (it.y - y) ** 2; if (d <= bestD) { bestD = d; best = it; } }
|
|
284
|
+
return best;
|
|
285
|
+
}
|
|
179
286
|
/** How often the picture can change when nothing is in the air (the poses loop at 4 fps; a bubble types faster). */
|
|
180
287
|
const FPS = 12;
|
|
181
288
|
const STYLES = BUILT_IN_SKINS;
|
|
@@ -220,7 +327,7 @@ function looksOf(L, work, q, mode, zones, badge = () => null) {
|
|
|
220
327
|
// At night (#2568) the idle are drawn asleep (their state stays idle: the tooltip and the list say so).
|
|
221
328
|
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
329
|
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) }];
|
|
330
|
+
badge: badge(n.name), fit: n.i && n.i.tag_fit && typeof n.i.tag_fit === "object" ? n.i.tag_fit : null }];
|
|
224
331
|
}));
|
|
225
332
|
}
|
|
226
333
|
/** A stored office's own layout on a zones style (its overrides); `ignored`: they do not fit this style. */
|
|
@@ -283,7 +390,7 @@ const hidingBox = (f) => {
|
|
|
283
390
|
/** #2698: name tags in one row centred on (x, y) — each { look, x } (its centre), TAG_GAP apart. */
|
|
284
391
|
const TAG_GAP = 4;
|
|
285
392
|
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);
|
|
393
|
+
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
394
|
let left = x - total / 2;
|
|
288
395
|
return looks.map((look, i) => { const cx = Math.round(left + ws[i] / 2); left += ws[i] + TAG_GAP; return { look, x: cx }; });
|
|
289
396
|
}
|
|
@@ -377,12 +484,26 @@ function paintLayers(p, env, ls, tagsOff = false) {
|
|
|
377
484
|
});
|
|
378
485
|
return { ls, tagsOff, back, front };
|
|
379
486
|
}
|
|
487
|
+
/** Final painted bubbles, topmost first; touch adds a 44 CSS-pixel target without changing the drawing. */
|
|
488
|
+
export function officeBubbleAt(hits, x, y, minSize = 0) {
|
|
489
|
+
const reversed = [...hits].reverse();
|
|
490
|
+
const exact = reversed.find(({ box: b }) => x >= b.x && y >= b.y && x <= b.x + b.w && y <= b.y + b.h);
|
|
491
|
+
if (exact || !minSize) return exact || null;
|
|
492
|
+
let nearest = null, distance = Infinity;
|
|
493
|
+
for (const hit of reversed) {
|
|
494
|
+
const b = hit.box, dx = x - b.x - b.w / 2, dy = y - b.y - b.h / 2;
|
|
495
|
+
if (Math.abs(dx) <= Math.max(minSize, b.w) / 2 && Math.abs(dy) <= Math.max(minSize, b.h) / 2 && dx * dx + dy * dy < distance) {
|
|
496
|
+
nearest = hit; distance = dx * dx + dy * dy;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
return nearest;
|
|
500
|
+
}
|
|
380
501
|
/**
|
|
381
502
|
* 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
503
|
* hovered (its name tag shows even in a crowd); `tagsOff` (#2554: a tile too small to read them): the name tags show
|
|
383
504
|
* only for the one hovered and the Find box's matches. Whether anything in it is moving (in the air, or someone walking).
|
|
384
505
|
*/
|
|
385
|
-
export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false, defer = null) {
|
|
506
|
+
export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false, defer = null, bubbleHits = null) {
|
|
386
507
|
const sk = p.skin;
|
|
387
508
|
const ls = layerScale(a, p.L.width, p.L.height);
|
|
388
509
|
if (!p.layers || p.layers.ls !== ls || p.layers.tagsOff !== tagsOff) p.layers = paintLayers(p, env, ls, tagsOff);
|
|
@@ -390,7 +511,7 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
|
|
|
390
511
|
const blit = (c) => { if (!c) return; ctx.setTransform(a / ls, 0, 0, a / ls, ox, oy); ctx.drawImage(c, 0, 0); T(); };
|
|
391
512
|
blit(p.layers.back);
|
|
392
513
|
T();
|
|
393
|
-
const speakers = [], tags = [];
|
|
514
|
+
const speakers = [], tags = [], titleBoxes = []; // M-3539: the area names bubbles keep off too
|
|
394
515
|
const up = still ? [] : p.flights.frame(ms, p.L);
|
|
395
516
|
// Mail from another office (#2564): flying in at the door, or on the floor until its person picks it up.
|
|
396
517
|
const post = still || !p.mail || !p.zones ? [] : p.mail.frame(ms > 0 ? ms : now(), p.L, p.walkers);
|
|
@@ -400,6 +521,18 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
|
|
|
400
521
|
// y (a tie: the item first, the person in front); furniture over them; things in the air; the pack's foreground
|
|
401
522
|
// (door frames, pillars, table fronts); then what must stay readable: crowd counts and name tags (bubbles below).
|
|
402
523
|
const t = ms > 0 ? ms : now(), live = furnitureAt(p, t);
|
|
524
|
+
const draggedHeld = p.hold ? p.hold.held() : null;
|
|
525
|
+
const heldName = draggedHeld ? draggedHeld.name : null;
|
|
526
|
+
if (!still && ms > 0 && p.snacks) {
|
|
527
|
+
const snackHidden = heldName ? new Map(live.hidden).set(heldName, "__held__") : live.hidden;
|
|
528
|
+
const changed = p.snacks.step(t, {
|
|
529
|
+
desks: p.desks, walkers: p.walkers, hidden: snackHidden, ownArea: !!p.ownArea,
|
|
530
|
+
areas: p.L.areas, graph: p.L, snacksById: p.snacksById,
|
|
531
|
+
charEatOf: (n) => (sk.eatStrip ? sk.eatStrip(n) : null),
|
|
532
|
+
onClaim: p.onSnackClaim,
|
|
533
|
+
});
|
|
534
|
+
if (changed && typeof p.onSnacksChanged === "function") p.onSnacksChanged();
|
|
535
|
+
}
|
|
403
536
|
const people = p.desks.map((d) => {
|
|
404
537
|
const at = p.walkers.at(d.node.name, t) || { ...d.seat, walking: false };
|
|
405
538
|
if (at.walking) walking = true;
|
|
@@ -407,57 +540,174 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
|
|
|
407
540
|
}).sort((x, y) => x.at.y - y.at.y);
|
|
408
541
|
const furniture = strollFurniture(p.night ? nightFurniture(sk.pack.furniture) : sk.pack.furniture, (k) => p.walkers.at(k, t));
|
|
409
542
|
if (furniture.some((f) => f.walking)) walking = true;
|
|
410
|
-
const
|
|
543
|
+
const placedSnacks = p.snacks ? p.snacks.placedList() : [];
|
|
544
|
+
const band = [...furniture.filter((f) => f.depth === "y").map((f) => ({ y: f.y, k: 0, f })),
|
|
545
|
+
...placedSnacks.map((sn) => ({ y: sn.y, k: 0.5, sn })),
|
|
546
|
+
...people.map((q) => ({ y: q.at.y, k: 1, p: q })),
|
|
411
547
|
...(p.ghosts ? ghostsOf(sk.pack, people).map((g) => ({ y: g.y, k: 1, g })) : []),
|
|
412
548
|
// #2665: by day, each item's night place too (at night the items are there already).
|
|
413
549
|
...(p.ghosts && !p.night ? nightGhostsOf(sk.pack).map((n) => ({ y: n.y, k: 1, n })) : [])]
|
|
414
550
|
.sort((x, y) => x.y - y.y || x.k - y.k);
|
|
551
|
+
// M-3432 (#4255) & M-3445 (#4266): draw drop-target rings above the floor layer only, never over furniture or characters.
|
|
552
|
+
const drop = p.snackDrop && p.snackDrop.current;
|
|
553
|
+
if (drop && drop.kind === "place") {
|
|
554
|
+
ctx.save();
|
|
555
|
+
ctx.fillStyle = "rgba(0, 0, 0, 0.16)";
|
|
556
|
+
ctx.beginPath(); ctx.ellipse(drop.x, drop.y, 16, 7, 0, 0, Math.PI * 2); ctx.fill();
|
|
557
|
+
ctx.strokeStyle = env.pal.accent; ctx.lineWidth = 1.5; ctx.setLineDash([4, 3]);
|
|
558
|
+
ctx.beginPath(); ctx.ellipse(drop.x, drop.y, 16, 7, 0, 0, Math.PI * 2); ctx.stroke();
|
|
559
|
+
ctx.restore();
|
|
560
|
+
} else if (drop && drop.kind === "feed") {
|
|
561
|
+
const target = people.find((q) => q.look.name === drop.name && !live.hidden.has(q.look.name));
|
|
562
|
+
if (target) {
|
|
563
|
+
ctx.save();
|
|
564
|
+
ctx.fillStyle = env.pal.accentDim;
|
|
565
|
+
ctx.beginPath(); ctx.ellipse(target.at.x, target.at.y, 24, 10, 0, 0, Math.PI * 2); ctx.fill();
|
|
566
|
+
ctx.strokeStyle = env.pal.accent; ctx.lineWidth = 2;
|
|
567
|
+
ctx.beginPath(); ctx.ellipse(target.at.x, target.at.y, 24, 10, 0, 0, Math.PI * 2); ctx.stroke();
|
|
568
|
+
ctx.restore();
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
const seatDrop = heldName && p.seatDrop ? p.seatDrop.current : null;
|
|
572
|
+
if (seatDrop && seatDrop.name === heldName && Array.isArray(seatDrop.targets)) {
|
|
573
|
+
for (const st of seatDrop.targets) {
|
|
574
|
+
if (st.current) continue;
|
|
575
|
+
const isHover = !!seatDrop.hover && seatDrop.hover.area === st.area && seatDrop.hover.slot === st.slot;
|
|
576
|
+
ctx.save();
|
|
577
|
+
if (isHover) {
|
|
578
|
+
ctx.fillStyle = env.pal.accentDim;
|
|
579
|
+
ctx.beginPath(); ctx.ellipse(st.x, st.y, 26, 11, 0, 0, Math.PI * 2); ctx.fill();
|
|
580
|
+
ctx.strokeStyle = "rgba(0, 0, 0, 0.38)"; ctx.lineWidth = 4.5;
|
|
581
|
+
ctx.beginPath(); ctx.ellipse(st.x, st.y, 26, 11, 0, 0, Math.PI * 2); ctx.stroke();
|
|
582
|
+
ctx.strokeStyle = env.pal.accent; ctx.lineWidth = 2.5;
|
|
583
|
+
ctx.beginPath(); ctx.ellipse(st.x, st.y, 26, 11, 0, 0, Math.PI * 2); ctx.stroke();
|
|
584
|
+
} else {
|
|
585
|
+
ctx.globalAlpha = 0.9;
|
|
586
|
+
ctx.fillStyle = env.pal.accentDim;
|
|
587
|
+
ctx.beginPath(); ctx.ellipse(st.x, st.y, 22, 10, 0, 0, Math.PI * 2); ctx.fill();
|
|
588
|
+
ctx.strokeStyle = "rgba(0, 0, 0, 0.35)"; ctx.lineWidth = 3.5;
|
|
589
|
+
ctx.beginPath(); ctx.ellipse(st.x, st.y, 22, 10, 0, 0, Math.PI * 2); ctx.stroke();
|
|
590
|
+
ctx.strokeStyle = env.pal.accent; ctx.lineWidth = 2; ctx.setLineDash([5, 3]);
|
|
591
|
+
ctx.beginPath(); ctx.ellipse(st.x, st.y, 22, 10, 0, 0, Math.PI * 2); ctx.stroke();
|
|
592
|
+
}
|
|
593
|
+
ctx.restore();
|
|
594
|
+
}
|
|
595
|
+
}
|
|
415
596
|
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
597
|
for (const it of post) if (it.t === 0) sk.drawProp(ctx, it, ms, env); // a letter on the floor: under the people
|
|
417
|
-
|
|
598
|
+
let heldPerson = null;
|
|
599
|
+
for (const { f, p: q, g, n, sn } of band) {
|
|
418
600
|
if (f) { sk.drawFurniture(ctx, f, f.asleep || live.active.has(f.id), ms, env); continue; }
|
|
601
|
+
if (sn) {
|
|
602
|
+
const sdef = p.snacksById && p.snacksById.get(sn.snackId);
|
|
603
|
+
if (sdef && sk.drawSnack) {
|
|
604
|
+
ctx.save();
|
|
605
|
+
ctx.fillStyle = "rgba(0, 0, 0, 0.22)";
|
|
606
|
+
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();
|
|
607
|
+
ctx.restore();
|
|
608
|
+
sk.drawSnack(ctx, sdef.sprite, ms, sn.x, sn.y, env, `sn:${sn.id}`);
|
|
609
|
+
}
|
|
610
|
+
continue;
|
|
611
|
+
}
|
|
419
612
|
if (n) { ctx.save(); ctx.globalAlpha = GHOST_ALPHA; sk.drawFurniture(ctx, n, true, 0, env); ctx.restore(); continue; }
|
|
420
613
|
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; }
|
|
614
|
+
if (heldName && q.look.name === heldName) { heldPerson = q; continue; } // M-3445 (#4267): drawn lifted on top below
|
|
421
615
|
if (live.hidden.has(q.look.name)) continue; // #2698: drawn as the item (never while walking)
|
|
422
616
|
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.
|
|
617
|
+
// 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
618
|
const posed = actPosed(p, q.look);
|
|
425
|
-
const
|
|
619
|
+
const eating = !q.at.walking && p.snacks && ms > 0 ? p.snacks.eatingOf(q.look.name, t) : null;
|
|
620
|
+
const canEat = !!eating && !CALLING.has(q.look.state) && !ASLEEP.has(q.look.state) && !q.look.night;
|
|
621
|
+
// 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.
|
|
622
|
+
const canPat = !q.at.walking && !canEat && ms > 0 && !!p.reacts && !CALLING.has(q.look.state) && !ASLEEP.has(q.look.state) && !q.look.night;
|
|
623
|
+
const patted = canPat ? patLook(posed, p.reacts.get(q.look.name), t) : null;
|
|
624
|
+
const look = q.at.walking ? { ...q.look, pose: "walk", heading: q.at.heading }
|
|
625
|
+
: canEat ? { ...posed, pose: "eat", basePose: posed.pose }
|
|
626
|
+
: patted || posed;
|
|
426
627
|
sk.drawCharacter(ctx, box, look, ms, env);
|
|
427
|
-
if (
|
|
628
|
+
if (canEat && eating.snackId && p.snacksById && sk.drawSnack) {
|
|
629
|
+
const sdef = p.snacksById.get(eating.snackId);
|
|
630
|
+
if (sdef && sdef.eat) sk.drawSnack(ctx, sdef.eat, Math.max(0, t - eating.t0), q.at.x, q.at.y, env);
|
|
631
|
+
}
|
|
632
|
+
if (!q.at.walking || (p.snacks && ms > 0 && p.snacks.scatterOf(q.look.name, t))) {
|
|
633
|
+
speakers.push({ look: q.look, ...speakerAt(sk, look, q.at), area: q.d.area });
|
|
634
|
+
}
|
|
428
635
|
}
|
|
429
636
|
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);
|
|
637
|
+
// M-3445 (#4267): the character currently being dragged renders lifted above furniture and other characters in its `dragged` pose.
|
|
638
|
+
if (heldPerson) {
|
|
639
|
+
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 } };
|
|
640
|
+
const posed = actPosed(p, heldPerson.look);
|
|
641
|
+
sk.drawCharacter(ctx, box, { ...posed, pose: "dragged", basePose: posed.pose }, ms, env);
|
|
642
|
+
}
|
|
430
643
|
for (const it of up) sk.drawProp(ctx, it, ms, env);
|
|
431
644
|
for (const it of post) if (it.t > 0) sk.drawProp(ctx, it, ms, env);
|
|
432
645
|
if (sk.drawForeground) sk.drawForeground(ctx, p.L, env);
|
|
433
646
|
// Who found no spot in an area: a count in its corner (never over its name).
|
|
434
647
|
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
|
-
|
|
648
|
+
// M-3539: an area's name a figure stands on is written again over the people (休息區 under a crowd's heads).
|
|
649
|
+
const titles = sk.areaTitleBox ? Object.values(p.L.areas || {}).map((ar) => ({ ar, box: sk.areaTitleBox(ctx, ar, env) })) : [];
|
|
650
|
+
if (sk.drawAreaTitle) for (const { ar, box } of titles) {
|
|
651
|
+
if (people.some((q) => !live.hidden.has(q.look.name) && overlaps(figureBox(sk, q), box))) sk.drawAreaTitle(ctx, ar, env);
|
|
652
|
+
}
|
|
653
|
+
// Name tags never cover each other, an area's name or what the page keeps clear over the scene (`env.keepClear`:
|
|
654
|
+
// the zoom control, M-3539). In an area over capacity (#2513: a crowd's full tags covered each other) everyone keeps
|
|
655
|
+
// a compact tag (#2860: in Cozy, the default, most of a fleet is in a crowd, and hover-only hid names and levels).
|
|
656
|
+
// The full tags go first: the one hovered or found, then the people at their place, then those walking (a stroll
|
|
657
|
+
// passes others' tags, M-3539); each where it is, else a row lower, else compact (there, then a row lower); one
|
|
658
|
+
// 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
659
|
const over = p.L.over || new Set();
|
|
439
|
-
const
|
|
440
|
-
const
|
|
660
|
+
const pinned = (q) => q.d.key === hot || !!q.look.match;
|
|
661
|
+
const crowded = (q) => over.has(q.d.area) && !pinned(q);
|
|
662
|
+
const tagged = (q) => pinned(q) || !(tagsOff || over.has(q.d.area));
|
|
663
|
+
const keep = [...titles.map((x) => x.box), ...(env.keepClear || [])];
|
|
664
|
+
titleBoxes.push(...titles.map((x) => x.box));
|
|
441
665
|
const taken = [];
|
|
442
|
-
const touches = (b) => taken.some((o) => b
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
666
|
+
const touches = (b) => taken.some((o) => overlaps(b, o)) || keep.some((o) => overlaps(b, o));
|
|
667
|
+
// Under an open card (`p.cover`, bitmap px; #4379 review): no tag, its level badge included, rather than a piece of one
|
|
668
|
+
// past the card's edge — a forced one (hovered, found) too.
|
|
669
|
+
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;
|
|
670
|
+
const covered = (b) => !!cv && overlaps(b, cv);
|
|
671
|
+
/**
|
|
672
|
+
* Draws `look`'s tag at (x, y) at the first of `tries` ([dy, compact]) clear of the others; `force`: at the first.
|
|
673
|
+
* None clear: slid sideways just past what it would touch of `keep` (an area's name, the minimap: never another
|
|
674
|
+
* tag), at most its own width, at its place — so a name beside the minimap reads instead of going (leader's check).
|
|
675
|
+
*/
|
|
676
|
+
const place = (x0, y, look, tries, force = false) => {
|
|
677
|
+
// M-3539: a tag stays within the sides of the area its person stands in (a wide name at a lounge's first column
|
|
678
|
+
// poked past its edge): moved in by what it would stick out.
|
|
679
|
+
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);
|
|
680
|
+
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);
|
|
681
|
+
const at = (dx, dy, compact) => {
|
|
682
|
+
const box = tagBox(ctx, x + dx, y + dy, look.label, compact, look.fit), foot = tagFootprint(ctx, box, look.badge, compact);
|
|
683
|
+
if (covered(foot)) return null;
|
|
684
|
+
if (!force && touches(foot)) return null;
|
|
685
|
+
// Every place tried keeps within the area's sides, a slide's too (#4376 review): none there, hover or focus.
|
|
686
|
+
if (!force && ar && (box.x < ar.rect.x || box.x + box.w > ar.rect.x + ar.rect.w)) return null;
|
|
687
|
+
sk.drawTag(ctx, x + dx, y + dy, look, env, compact);
|
|
688
|
+
tags.push(box); taken.push(foot);
|
|
689
|
+
return box;
|
|
690
|
+
};
|
|
691
|
+
for (const [dy, compact] of tries) { const b = at(0, dy, compact); if (b) return b; }
|
|
692
|
+
const [dy0, c0] = tries[0], b0 = tagFootprint(ctx, tagBox(ctx, x, y + dy0, look.label, c0, look.fit), look.badge, c0);
|
|
693
|
+
for (const o of keep.filter((k) => overlaps(b0, k))) {
|
|
694
|
+
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; }
|
|
695
|
+
}
|
|
696
|
+
return null;
|
|
697
|
+
};
|
|
698
|
+
const FULL_TRIES = [[0, false], [TAG_ROW, false], [0, true], [COMPACT_ROW, true]];
|
|
699
|
+
const tagOrder = people.filter((q) => !(live.hidden.has(q.look.name) && q.look.name !== heldName) && tagged(q))
|
|
700
|
+
.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);
|
|
701
|
+
for (const { q, rank } of tagOrder) place(q.at.x, q.at.y, q.look, FULL_TRIES, rank === 0);
|
|
449
702
|
// 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
703
|
// #2698: an item hiding its people carries their tags too, in one row at its tag point (its own first; each keeps
|
|
451
704
|
// its place in the row while another's tag is left out), and their bubbles, over its picture. The tags drawn are
|
|
452
705
|
// kept on the scene (`heldTags`): hitPart hits each person on theirs, past the picture's edge too (#2699 review).
|
|
453
706
|
const held = [];
|
|
454
707
|
for (const f of furniture) {
|
|
455
|
-
const on = people.filter((q) => live.hidden.get(q.look.name) === f.id);
|
|
708
|
+
const on = people.filter((q) => live.hidden.get(q.look.name) === f.id && q.look.name !== heldName);
|
|
456
709
|
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
|
-
}
|
|
710
|
+
if (!tagsOff && f.label) place(f.x, f.y, npcLook(p, f), [[0, false], [TAG_ROW, false]]);
|
|
461
711
|
continue;
|
|
462
712
|
}
|
|
463
713
|
const order = new Map((f.activeFor || []).map((n, i) => [n, i]));
|
|
@@ -468,10 +718,9 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
|
|
|
468
718
|
const q = f.label ? on[i - 1] : on[i];
|
|
469
719
|
if (q) speakers.push({ look: q.look, x: r.x + 10, y: top, area: q.d.area });
|
|
470
720
|
if (q ? !tagged(q) : tagsOff) continue;
|
|
471
|
-
|
|
472
|
-
const box =
|
|
473
|
-
|
|
474
|
-
if (q) held.push({ name: q.look.name, id: f.id, box });
|
|
721
|
+
// The row stays one row (each keeps its place): drawn there, covering nothing else's, or left to hover.
|
|
722
|
+
const box = place(r.x, f.y, r.look, [[0, false]], !!q && pinned(q));
|
|
723
|
+
if (q && box) held.push({ name: q.look.name, id: f.id, box });
|
|
475
724
|
}
|
|
476
725
|
}
|
|
477
726
|
p.heldTags = held;
|
|
@@ -480,13 +729,7 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
|
|
|
480
729
|
// neighbour's tag goes a row lower (COMPACT_ROW) rather than out, so a row of people reads as two staggered rows.
|
|
481
730
|
if (!tagsOff) for (const q of people) {
|
|
482
731
|
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
|
-
}
|
|
732
|
+
place(q.at.x, q.at.y, q.look, [[0, true], [COMPACT_ROW, true]]);
|
|
490
733
|
}
|
|
491
734
|
} else {
|
|
492
735
|
for (const d of p.desks) { const look = p.looks.get(d.key); sk.drawCharacter(ctx, d, actPosed(p, look), ms, env); speakers.push({ look, x: d.x + 58, y: d.y + 12, area: p.roomOf.get(d.key) ?? null }); }
|
|
@@ -512,24 +755,79 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
|
|
|
512
755
|
}
|
|
513
756
|
ctx.restore();
|
|
514
757
|
}
|
|
758
|
+
// 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)
|
|
759
|
+
// and their words in a bubble, while it lasts.
|
|
760
|
+
const t0 = now(), reacting = ms && p.reacts && p.reacts.size && pruneReactions(p.reacts, t0) ? p.reacts : null;
|
|
761
|
+
if (reacting) {
|
|
762
|
+
ctx.save();
|
|
763
|
+
ctx.fillStyle = env.pal.danger; ctx.font = "700 11px system-ui, sans-serif"; ctx.textAlign = "center"; ctx.textBaseline = "bottom";
|
|
764
|
+
for (const sp of speakers) {
|
|
765
|
+
const ra = reacting.has(sp.look.name) ? reactionAt(reacting.get(sp.look.name), t0, p.lang) : null;
|
|
766
|
+
if (ra) for (const h of ra.hearts) { ctx.globalAlpha = h.alpha; ctx.fillText("♥", sp.x + h.dx, sp.y + h.dy); }
|
|
767
|
+
}
|
|
768
|
+
ctx.restore();
|
|
769
|
+
}
|
|
515
770
|
// Speech bubbles: a short line for the state, now and then (typed out; whole at once when still), placed so no two
|
|
516
771
|
// overlap (placeBubbles; #2431).
|
|
517
|
-
const bubbles = [];
|
|
772
|
+
const bubbles = [], rp = p.reply, tSaid = Date.now(), replies = [];
|
|
518
773
|
for (const sp of speakers) {
|
|
519
774
|
if (sp.look.dim || sp.look.pose === "away") continue;
|
|
775
|
+
// Talk "Over their head": a live reply, in full (wrapped), in place of the state's line.
|
|
776
|
+
const said = rp ? rp.chat.recent(sp.look.name, tSaid) : null;
|
|
777
|
+
if (said) { replies.push({ sp, said }); continue; }
|
|
520
778
|
const says = sp.look.night ? "paused" : sp.look.state; // asleep at night: its "Zzz…" lines
|
|
521
779
|
// 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
|
-
|
|
780
|
+
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;
|
|
781
|
+
// M-3293: a pat's or a feed's words first — the pack's own for it ("pat" / "feed" in its bubbles: theirs, their
|
|
782
|
+
// set's, the pack's), one picked by when it happened, else the page's.
|
|
783
|
+
const packSays = ra ? linesFor(reacting.get(sp.look.name).kind, p.lang, sk.pack, null, sp.look.name) : [];
|
|
784
|
+
const raSays = ra ? (packSays.length ? packSays[Math.floor(reacting.get(sp.look.name).t0) % packSays.length] : ra.say) : null;
|
|
785
|
+
const own = raSays ? raSays : actLive(act, says, Date.now(), p.actSeen) && act.say ? act.say : null;
|
|
786
|
+
const sc = !own && p.snacks && ms > 0 ? p.snacks.scatterOf(sp.look.name, t0) : null;
|
|
787
|
+
const scText = sc ? scatterWords(p.lang) : null;
|
|
788
|
+
const b = own ? { text: own, shown: [...own].length }
|
|
789
|
+
: scText ? { text: scText, shown: [...scText].length }
|
|
790
|
+
: 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
|
|
791
|
+
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 } : {}),
|
|
525
792
|
box: bubbleBox(ctx, sp.x, sp.y, b.text), tail: { x: sp.x, y: sp.y }, sp, b });
|
|
526
793
|
}
|
|
527
794
|
// A crowded area speaks less (thinBubbles: calls, then work, a few at most); no bubble covers a name tag. `defer`
|
|
528
795
|
// (All offices): drawn after every tile, unclipped, so a bubble at a tile's edge is whole.
|
|
529
|
-
|
|
530
|
-
const
|
|
796
|
+
// M-3648: an area's name blocks chatter; a call may cover it (placeBubbles' `soft`): a name never keeps a call out.
|
|
797
|
+
const placed = placeBubbles(thinBubbles(bubbles, p.zones ? p.L.over : null), 22, tags, titleBoxes);
|
|
798
|
+
const say = () => { T(); for (const { sp, b, dy } of placed) {
|
|
799
|
+
const text = [...b.text].slice(0, b.shown).join("");
|
|
800
|
+
sk.drawBubble(ctx, sp.x, sp.y, text, env, -dy);
|
|
801
|
+
if (bubbleHits && text) {
|
|
802
|
+
const box = bubbleBox(ctx, sp.x, sp.y, text, -dy);
|
|
803
|
+
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 } });
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
const bl = sk.pack && sk.pack.dialogBox ? sk.pack.dialogBox.bubble : null;
|
|
807
|
+
const im = bl && bl.frame && typeof sk.picture === "function" ? sk.picture(bl.frame, () => {}) : null;
|
|
808
|
+
for (const { sp, said } of replies) {
|
|
809
|
+
// Typed out from its page's start, at the reading mode's pace; ▼ once whole; Auto / Fast: it goes on by itself.
|
|
810
|
+
const cps = rp.pace(rp.read).cps, n = ms > 0 ? Math.floor(((tSaid - (said.pageAt ?? said.at)) * cps) / 1000) : Infinity;
|
|
811
|
+
// #4406: never smaller than its own size on the page — zoomed out (a phone's whole office at 30 %), it is drawn at
|
|
812
|
+
// 1 CSS px a unit about its tail, so the words stay readable; zoomed in, as the map.
|
|
813
|
+
const u = Math.max(1, (rp.ratio || 1) / a);
|
|
814
|
+
// And kept on screen: the canvas's visible width in this part's units, into the bubble's own (scaled about its tail).
|
|
815
|
+
const vl = -ox / a, vr = ((ctx.canvas && ctx.canvas.width) || Infinity) / a - ox / a, m = 6 / u;
|
|
816
|
+
const vt = -oy / a, vb = ((ctx.canvas && ctx.canvas.height) || Infinity) / a - oy / a;
|
|
817
|
+
const fit = Number.isFinite(vr) ? { l: sp.x + (vl - sp.x) / u + m, r: sp.x + (vr - sp.x) / u - m,
|
|
818
|
+
...(Number.isFinite(vb) ? { t: sp.y + (vt - sp.y) / u + m, b: sp.y + (vb - sp.y) / u - m } : {}) } : null;
|
|
819
|
+
ctx.save(); ctx.translate(sp.x, sp.y); ctx.scale(u, u); ctx.translate(-sp.x, -sp.y);
|
|
820
|
+
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,
|
|
821
|
+
{ page: said.page, n }, fit);
|
|
822
|
+
ctx.restore();
|
|
823
|
+
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 };
|
|
824
|
+
said.pages = box.pages;
|
|
825
|
+
if (n >= box.len && !said.whole) { said.whole = true; said.wholeAt = tSaid; }
|
|
826
|
+
if (said.whole && tSaid - said.wholeAt >= rp.pace(rp.read, box.len).wait) rp.chat.advance(sp.look.name);
|
|
827
|
+
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 } });
|
|
828
|
+
} };
|
|
531
829
|
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;
|
|
830
|
+
return replies.length > 0 || 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
831
|
}
|
|
534
832
|
/**
|
|
535
833
|
* #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 +924,49 @@ export function OfficeKey({ pal }) {
|
|
|
626
924
|
* `assetImage(url)` how (the share's, which waits out a 429, #2662; none: the loader's own);
|
|
627
925
|
* `opening` the office it opens on (the share's), instead of the one this browser chose last; #2861: `talk` the share's
|
|
628
926
|
* conversations (its /state's: who heard or answered a person, when — never what was said), instead of the stream's.
|
|
927
|
+
* M-3533 R1, a Hub room's office (hub-room-office.js), on the Fleet dashboard's own origin too: `oneOffice` its one office
|
|
928
|
+
* (no office picker or carousel); `readOnly` no editing or sharing whatever the session; `stream` false: never this
|
|
929
|
+
* page's own stream (the fleet's offices, acts and skins); `storage` where this browser's choices are kept (not the
|
|
930
|
+
* Fleet office's); `cardRows(name)` a card's rows instead of the office's (the room's: owner, introduction); `words(node)`
|
|
931
|
+
* 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;
|
|
932
|
+
* `foldBar` (with `onMore`): no options row over the scene on a desk either — the options open in the sheet from a button
|
|
933
|
+
* in the zoom stack (a Hub room's office: the scene right under the room's header, M-3533 #4370);
|
|
934
|
+
* `cardAction(name)` a card's main action ({ label, title, run }: the room's "@ it"), or null; `cardName(name)` a card's
|
|
935
|
+
* 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
|
|
936
|
+
* again when it changes (a page with no stream: the room's office when an agent joins, leaves or is renamed); M-3533 R2b:
|
|
937
|
+
* `cardPhoto(name)` the src of a card's identity-card picture (the room's), or null: the figure.
|
|
629
938
|
*/
|
|
630
|
-
|
|
631
|
-
const
|
|
939
|
+
function ensureDialogueStyle() {
|
|
940
|
+
const doc = globalThis.document;
|
|
941
|
+
if (!doc?.head || doc.querySelector('link[data-office-dialogue-css="1"]')) return;
|
|
942
|
+
const link = doc.createElement("link"); link.rel = "stylesheet";
|
|
943
|
+
link.href = assetUrl("/assets/office-dialogue.css");
|
|
944
|
+
link.setAttribute("data-office-dialogue-css", "1"); doc.head.appendChild(link);
|
|
945
|
+
}
|
|
946
|
+
export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetImage, opening, talk, chatUi = null, more = false, onMore = null, live = null, onLive = null,
|
|
947
|
+
oneOffice = false, readOnly = false, stream = true, storage = undefined, cardRows = null, words = null, cardAction = null, cardName = null, officesKey = undefined, foldBar = false, cardPhoto = null }) {
|
|
948
|
+
// M-3253: on a phone the page above (fleet-canvas.js) puts a ⋯ in its bar: `more` is that sheet open, `onMore(open)`;
|
|
949
|
+
// `live` / `onLive` its Live toggle, which moves into the sheet. Without one (a share link's page) the bar stays.
|
|
950
|
+
useLayoutEffect(ensureDialogueStyle, []);
|
|
951
|
+
const phone = useOfficePhone(), compact = phone && typeof onMore === "function", folded = compact || (foldBar && typeof onMore === "function");
|
|
952
|
+
const store = useMemo(() => createOfficeStore({ ...(lease ? { fetch: (path, o) => lease.fetch(path, o) } : {}), ...(storage ? { storage } : {}) }), [lease, storage]);
|
|
953
|
+
const streamOn = () => (stream === false ? null : appStore.get().streamOn);
|
|
954
|
+
const stateOf = (node) => (words ? words(node).state : stateWords(node));
|
|
955
|
+
const nowOf = (node) => (words ? words(node).now : caption(officePose(node.state), node.state));
|
|
632
956
|
const [stored, setStored] = useState([]);
|
|
633
957
|
const [storedRev, setStoredRev] = useState(null); // the rev the list was read at (a save sends it)
|
|
634
958
|
const [canEdit, setCanEdit] = useState(false); // an admin session (never a guest or the public link)
|
|
635
959
|
const [canShare, setCanShare] = useState(false); // #2636: an admin session, here or over the public link
|
|
636
960
|
const [editing, setEditing] = useState(false);
|
|
637
|
-
|
|
961
|
+
// Never picked here: All offices, the map of every office (one click enters one, unremembered; Back returns) — the
|
|
962
|
+
// whole fleet while fewer than two are stored. A pick from the switcher is kept per device, as before.
|
|
963
|
+
const [choice, setChoice] = useState(() => opening ?? store.choice(ALL_ID));
|
|
638
964
|
const [filter, setFilter] = useState(() => store.filter());
|
|
965
|
+
// #4010: the carousel's offices and interval (per browser); the slide index and playing are this visit only.
|
|
966
|
+
const [carSaved, setCarSaved] = useState(() => store.carousel());
|
|
967
|
+
const [carIndex, setCarIndex] = useState(0);
|
|
968
|
+
const [carPlaying, setCarPlaying] = useState(true);
|
|
969
|
+
const [carMenu, setCarMenu] = useState(false);
|
|
639
970
|
// #2716: the whole-fleet office's style — the host's (for everyone) and this browser's own pick. An admin sees the
|
|
640
971
|
// 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
972
|
const [hostStyle, setHostStyle] = useState(undefined); // undefined: not read yet; null: none kept
|
|
@@ -661,14 +992,34 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
661
992
|
// conversations; the avatars read for it; what it last said for a screen reader. `dlgRef`: what draw() reads (it runs
|
|
662
993
|
// from the loop, outside a render); `dlgShown`: the box as last drawn (its clicks).
|
|
663
994
|
const [dialogueOn, setDialogueOn] = useState(() => store.dialogueOn());
|
|
995
|
+
// Talking from here (fleet-office-talk.js, `chatUi`: the dashboard's only, never a share link): how (per browser) and
|
|
996
|
+
// to whom; `chat` the conversations every way shows.
|
|
997
|
+
const [talkMode, setTalkMode] = useState(() => store.talkMode());
|
|
998
|
+
const [talkTo, setTalkTo] = useState(null);
|
|
999
|
+
const [readMode, setReadMode] = useState(() => (chatUi ? chatUi.readModeOf(store.talkRead()) : "click"));
|
|
1000
|
+
const chat = useMemo(() => (chatUi ? chatUi.createTalk() : null), [chatUi]);
|
|
1001
|
+
// #4406: the Dialogue-box talk shows the dialogue's conversations, so they run while it is picked — without ticking
|
|
1002
|
+
// Dialogue for the person (their own choice, kept as they left it when they pick another way to talk).
|
|
1003
|
+
const boxTalk = !!chat && talk === undefined && typeof onOpen === "function" && chatUi.talkModeOf(talkMode) === "box";
|
|
1004
|
+
const dlgOn = dialogueOn || boxTalk;
|
|
1005
|
+
const replyRef = useRef(null);
|
|
664
1006
|
const dlg = useMemo(createDialogue, []);
|
|
665
1007
|
const faces = useMemo(() => createFaces(), []);
|
|
666
1008
|
const [dlgSay, setDlgSay] = useState("");
|
|
1009
|
+
const [dlgVisible, setDlgVisible] = useState(false);
|
|
1010
|
+
const dlgVisibleRef = useRef(false);
|
|
1011
|
+
const showDialogueDock = (visible) => {
|
|
1012
|
+
if (dlgVisibleRef.current !== visible) { dlgVisibleRef.current = visible; setDlgVisible(visible); }
|
|
1013
|
+
};
|
|
1014
|
+
const dialogueCanvasRef = useRef(null);
|
|
667
1015
|
const [dlgHot, setDlgHot] = useState(false);
|
|
668
1016
|
const dlgRef = useRef(null), dlgShown = useRef(null), dlgLines = useRef(new Map()), talkSeen = useRef(new Set());
|
|
669
1017
|
const [nightNow, setNightNow] = useState(() => isNight());
|
|
670
1018
|
useEffect(() => { if (!nightOn) return undefined; setNightNow(isNight()); const h = setInterval(() => setNightNow(isNight()), NIGHT.TICK); return () => clearInterval(h); }, [nightOn]);
|
|
671
1019
|
const night = nightOn && nightNow;
|
|
1020
|
+
// M-3293: "Drag and pat" here (per device, on by default); in force only where playAllowed says (below).
|
|
1021
|
+
const [playOn, setPlayOn] = useState(() => store.playOn());
|
|
1022
|
+
const [, setTellRev] = useState(0); // M-3293: the card's Tell box redrawn when ticked
|
|
672
1023
|
const [lobbyOn, setLobbyOn] = useState(() => store.lobbyTile()); // #2554: All offices' lobby tile
|
|
673
1024
|
const [packs, setPacks] = useState([]); // the skin packs the host keeps: [{ id, name, sha }]
|
|
674
1025
|
const [packSkins, setPackSkins] = useState(() => new Map()); // id@sha → a loaded skin, or null (not a pack)
|
|
@@ -695,6 +1046,20 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
695
1046
|
const flights = useMemo(() => createFlights(), []);
|
|
696
1047
|
const walkers = useMemo(() => createWalkers(), []);
|
|
697
1048
|
const seatsRef = useRef(new Map()); // the zones layout's last seats: kept where they can be
|
|
1049
|
+
const seatPrefsRef = useRef({}), seatKeyRef = useRef(""), seatDropRef = useRef(null);
|
|
1050
|
+
const placedRef = useRef(null); // M-3539: the office and style the walkers were last placed for
|
|
1051
|
+
// M-3539: the phone's zone chips scroll sideways when they do not fit (English); a fade at the side there is more
|
|
1052
|
+
// (data-more-left / data-more-right) says so.
|
|
1053
|
+
const pillsRef = useRef(null);
|
|
1054
|
+
const pillsCue = () => {
|
|
1055
|
+
const e = pillsRef.current;
|
|
1056
|
+
if (!e || typeof e.toggleAttribute !== "function") return;
|
|
1057
|
+
const more = e.scrollWidth - e.clientWidth;
|
|
1058
|
+
e.toggleAttribute("data-more-left", more > 1 && e.scrollLeft > 1);
|
|
1059
|
+
e.toggleAttribute("data-more-right", more > 1 && e.scrollLeft < more - 1);
|
|
1060
|
+
};
|
|
1061
|
+
useLayoutEffect(pillsCue);
|
|
1062
|
+
const [seatRev, setSeatRev] = useState(0);
|
|
698
1063
|
// #2554: All offices' tiles keep their own: seats (by tile and style), walkers and flights (by tile); and the items
|
|
699
1064
|
// flying between tiles.
|
|
700
1065
|
const tileSeats = useRef(new Map()), tileWalkers = useRef(new Map()), tileFlights = useRef(new Map());
|
|
@@ -740,10 +1105,10 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
740
1105
|
if (!lease) return undefined;
|
|
741
1106
|
const read = async () => { const at = ask(); const d = await store.offices(); if (lease.current()) adopt(d, at); };
|
|
742
1107
|
void read();
|
|
743
|
-
const sub =
|
|
1108
|
+
const sub = streamOn();
|
|
744
1109
|
const off = sub ? lease.hold(sub("offices", () => { void read(); })) : null;
|
|
745
1110
|
return () => { if (off) off(); };
|
|
746
|
-
}, [lease, store]);
|
|
1111
|
+
}, [lease, store, officesKey]);
|
|
747
1112
|
// #2578: what agents do here by their own hand (office_set) — on opening, then as the stream brings it.
|
|
748
1113
|
// A read a newer one or the stream overtook is dropped (it is older: review — an opening read answered after the one
|
|
749
1114
|
// the stream's return began brought a cleared act back); read again when the stream comes back, and — with no live
|
|
@@ -776,7 +1141,7 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
776
1141
|
let heard = 0; // reads begun and events heard: the newest wins
|
|
777
1142
|
const read = async () => { const at = ++heard, d = await store.acts(); if (lease.current() && d && at === heard) setActs(d); };
|
|
778
1143
|
void read();
|
|
779
|
-
const sub =
|
|
1144
|
+
const sub = streamOn();
|
|
780
1145
|
const polled = () => globalThis.document?.body?.dataset?.webTransport === "poll" || appStore.get().connection === "polling";
|
|
781
1146
|
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
1147
|
lease.hold(sub("connection", (c) => { if (c === "live") void read(); }))] : [];
|
|
@@ -797,8 +1162,8 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
797
1162
|
if (who) setDlgSay(to("dlgSays", ...words(who)));
|
|
798
1163
|
};
|
|
799
1164
|
useEffect(() => {
|
|
800
|
-
if (!
|
|
801
|
-
const sub =
|
|
1165
|
+
if (!dlgOn || talk !== undefined) return undefined;
|
|
1166
|
+
const sub = streamOn();
|
|
802
1167
|
if (!sub) return undefined;
|
|
803
1168
|
let skew = 0;
|
|
804
1169
|
const seen = new Set();
|
|
@@ -817,9 +1182,9 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
817
1182
|
const hold = (off) => (lease ? lease.hold(off) : off);
|
|
818
1183
|
const offs = [hold(sub("clock", (d) => { if (d && typeof d.now === "number") skew = d.now - Date.now(); })), hold(sub("message", take))];
|
|
819
1184
|
return () => { for (const off of offs) if (typeof off === "function") off(); };
|
|
820
|
-
}, [
|
|
1185
|
+
}, [dlgOn, lease, talk === undefined]);
|
|
821
1186
|
useEffect(() => {
|
|
822
|
-
if (!
|
|
1187
|
+
if (!dlgOn || !talk) return;
|
|
823
1188
|
let changed = false;
|
|
824
1189
|
for (const x of talkOf(talk)) {
|
|
825
1190
|
const k = `${x.instance}|${x.kind}|${x.at}`;
|
|
@@ -832,13 +1197,13 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
832
1197
|
sayFor(x.instance, (who) => (x.kind === "heard" ? [to("dlgSomeone"), to("dlgHeardShare", nodeText(who.node).primary)] : [nodeText(who.node).primary, to("dlgAnsweredShare")]));
|
|
833
1198
|
}
|
|
834
1199
|
if (changed) dlgWake();
|
|
835
|
-
}, [
|
|
1200
|
+
}, [dlgOn, talk]);
|
|
836
1201
|
// What is over goes (an answer after its fade, a conversation never answered); the box is drawn again meanwhile.
|
|
837
1202
|
useEffect(() => {
|
|
838
|
-
if (!
|
|
839
|
-
const h = setInterval(() => { if (dlg.sweep(now(), still) || dlg.size()) dlgWake(); }, 1000);
|
|
1203
|
+
if (!dlgOn) return undefined;
|
|
1204
|
+
const h = setInterval(() => { if (dlg.sweep(now(), still, !!(dlgRef.current && dlgRef.current.vn)) || dlg.size()) dlgWake(); }, 1000);
|
|
840
1205
|
return () => clearInterval(h);
|
|
841
|
-
}, [
|
|
1206
|
+
}, [dlgOn]);
|
|
842
1207
|
const toggleDialogue = () => {
|
|
843
1208
|
const v = !dialogueOn;
|
|
844
1209
|
store.saveDialogueOn(v); setDialogueOn(v);
|
|
@@ -850,7 +1215,7 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
850
1215
|
if (!lease) return undefined;
|
|
851
1216
|
const read = async () => { const d = await store.skins(); if (lease.current() && d) setPacks(d.packs); };
|
|
852
1217
|
void read();
|
|
853
|
-
const sub =
|
|
1218
|
+
const sub = streamOn();
|
|
854
1219
|
const off = sub ? lease.hold(sub("office_skins", () => { void read(); })) : null;
|
|
855
1220
|
return () => { if (off) off(); };
|
|
856
1221
|
}, [lease, store]);
|
|
@@ -859,11 +1224,10 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
859
1224
|
// session's here or over the public link (the host asks again too); never a guest's or a read-only one's.
|
|
860
1225
|
useEffect(() => {
|
|
861
1226
|
const body = globalThis.document?.body;
|
|
862
|
-
if (!body || body.dataset.tier === "guest") return undefined;
|
|
863
|
-
const overLink = body.dataset.publicLink === "1";
|
|
1227
|
+
if (readOnly || !body || body.dataset.tier === "guest") return undefined;
|
|
864
1228
|
let live = true;
|
|
865
1229
|
const auth = globalThis.AgendAuth;
|
|
866
|
-
if (auth && typeof auth.canWrite === "function") Promise.resolve(auth.canWrite()).then((v) => { if (live) { setCanEdit(v === true
|
|
1230
|
+
if (auth && typeof auth.canWrite === "function") Promise.resolve(auth.canWrite()).then((v) => { if (live) { setCanEdit(v === true); setCanShare(v === true); } }, () => {});
|
|
867
1231
|
return () => { live = false; };
|
|
868
1232
|
}, []);
|
|
869
1233
|
// The stage's width (the grid wraps at it), and the theme (the tokens the canvas reads).
|
|
@@ -899,7 +1263,25 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
899
1263
|
|
|
900
1264
|
// #2554: All offices — chosen, and at least two offices stored (else the whole fleet, as an office gone is).
|
|
901
1265
|
const overview = choice === ALL_ID && overviewOk(stored);
|
|
902
|
-
|
|
1266
|
+
// #4010: Carousel — chosen on the signed-in dashboard, at least two stored; the ticked list may be shorter (then
|
|
1267
|
+
// the one left is shown still, or the whole fleet with none). Playing starts on enter; the timer is a timeout so a
|
|
1268
|
+
// Next or an interval change resets it.
|
|
1269
|
+
const carouselPick = opening == null && choice === CAROUSEL_ID && carouselOk(stored);
|
|
1270
|
+
const carIds = carouselPick ? carouselIdsOk(carSaved ? carSaved.ids : null, stored) : [];
|
|
1271
|
+
const carousel = carouselPick && carIds.length >= 2;
|
|
1272
|
+
useEffect(() => { if (!carouselPick) setCarMenu(false); }, [carouselPick]);
|
|
1273
|
+
const slideId = carouselPick && carIds.length ? carIds[((carIndex % carIds.length) + carIds.length) % carIds.length] : null;
|
|
1274
|
+
const custom = slideId ? stored.find((o) => o.id === slideId) || null
|
|
1275
|
+
: (choice !== AUTO_ID && !overview ? stored.find((o) => o.id === choice) || null : null);
|
|
1276
|
+
const carouselAct = useRef({ on: false, act: () => {} });
|
|
1277
|
+
const stepCar = (dir) => { if (!carIds.length) return; setCarIndex((i) => (dir > 0 ? nextIndex(i, carIds.length) : prevIndex(i, carIds.length))); };
|
|
1278
|
+
carouselAct.current = { on: carousel, act: (kind) => { if (kind === "pause") setCarPlaying((p) => !p); else if (kind === "next") stepCar(1); else if (kind === "prev") stepCar(-1); } };
|
|
1279
|
+
useEffect(() => {
|
|
1280
|
+
if (!carousel || !carPlaying) return undefined;
|
|
1281
|
+
const ms = intervalOk(carSaved && carSaved.interval) * 1000;
|
|
1282
|
+
const t = setTimeout(() => stepCar(1), ms);
|
|
1283
|
+
return () => clearTimeout(t);
|
|
1284
|
+
}, [carousel, carPlaying, carSaved && carSaved.interval, carIndex, carIds.join("|")]);
|
|
903
1285
|
// The style: a built-in one, or an uploaded pack once it is loaded (until then, and when it is not one, Desks).
|
|
904
1286
|
const wanted = custom ? custom.skin : style;
|
|
905
1287
|
// 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.
|
|
@@ -945,17 +1327,45 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
945
1327
|
// 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
1328
|
// what will stand, sit or lie there, not by a dot.
|
|
947
1329
|
const ghosts = zones && !!layout && !layoutStale;
|
|
1330
|
+
const shared = talk !== undefined || typeof onOpen !== "function";
|
|
1331
|
+
const tmode = chat && !shared ? chatUi.talkModeOf(talkMode) : "window";
|
|
1332
|
+
useEffect(() => {
|
|
1333
|
+
if (!chat || tmode === "window") return undefined;
|
|
1334
|
+
const sub = appStore.get().streamOn, hold = (off) => (lease ? lease.hold(off) : off);
|
|
1335
|
+
const off = sub ? hold(sub("message", chat.take)) : null;
|
|
1336
|
+
const quiet = chat.subscribe(() => { if (still && scene.current) draw(0); else loop.current?.wake(); });
|
|
1337
|
+
return () => { if (typeof off === "function") off(); quiet(); };
|
|
1338
|
+
}, [chat, tmode, lease]);
|
|
1339
|
+
const pickTalkMode = (v) => {
|
|
1340
|
+
store.saveTalkMode(v); setTalkMode(v);
|
|
1341
|
+
if (v === "window") setTalkTo(null);
|
|
1342
|
+
};
|
|
1343
|
+
// What a view and per-device seat choices are kept for: the office and its style (All offices: its own key).
|
|
1344
|
+
const officeKey = overview ? `${ALL_ID}@tiles` : `${custom ? custom.id : AUTO_ID}@${baseSkin.id}`;
|
|
948
1345
|
const keep = (n) => !(hideAsleep && ASLEEP.has(n.state));
|
|
949
1346
|
const single = useMemo(() => {
|
|
950
1347
|
if (overview) return { rooms: [], width: 1, height: 1 }; // All offices: the tiles below
|
|
951
1348
|
const all = custom ? membersOf(custom, view) : [...new Map(officeRooms(view, filter).flatMap((r) => r.nodes).map((n) => [n.name, n])).values()];
|
|
952
1349
|
const nodes = all.filter(keep);
|
|
953
|
-
if (zones) {
|
|
1350
|
+
if (zones) {
|
|
1351
|
+
const skKey = shared ? "" : officeKey;
|
|
1352
|
+
// M-3533 (#4370): the seats given restart when the office or its style changes — on a shared page too (a room's
|
|
1353
|
+
// office, a share link), whose per-device seat choices are not kept (skKey ""), so a style with more seats is not
|
|
1354
|
+
// drawn with the old one's overflow spots.
|
|
1355
|
+
if (seatKeyRef.current !== officeKey) {
|
|
1356
|
+
seatKeyRef.current = officeKey;
|
|
1357
|
+
seatsRef.current = new Map();
|
|
1358
|
+
seatPrefsRef.current = skKey ? store.seats(skKey) : {};
|
|
1359
|
+
}
|
|
1360
|
+
const z = zonesLayout(skin.pack, nodes, seatsRef.current, { night, seatPrefs: skKey ? seatPrefsRef.current : null });
|
|
1361
|
+
seatsRef.current = z.seats;
|
|
1362
|
+
return z;
|
|
1363
|
+
}
|
|
954
1364
|
// 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
1365
|
const deskW = Math.max(240, Math.floor(width / desksK(ratio)));
|
|
956
1366
|
if (!custom) return autoLayout(officeRooms(view, filter).map((r) => (hideAsleep ? { ...r, nodes: r.nodes.filter(keep) } : r)), { width: deskW });
|
|
957
1367
|
return officeScene(custom, nodes, skin, false, deskW);
|
|
958
|
-
}, [overview, view, filter, custom, width, ratio, skin, hideAsleep, night]);
|
|
1368
|
+
}, [overview, view, filter, custom, width, ratio, skin, hideAsleep, night, seatRev, officeKey, shared]);
|
|
959
1369
|
// ── #2554: All offices' tiles — each stored office (then the lobby: whoever is in no office) laid out as its own view
|
|
960
1370
|
// lays it out, in its own style (desks wrap at a cell's width), with its own seats, walkers and flights ──
|
|
961
1371
|
const lobbyAll = useMemo(() => (overview ? lobbyNodes(stored, view) : []), [overview, stored, view]);
|
|
@@ -998,23 +1408,58 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
998
1408
|
const wander = zones && !overview && !still && !layout;
|
|
999
1409
|
// #3685: who sits where on a visit, kept between ticks (the layout is rebuilt on every state change; the style's
|
|
1000
1410
|
// seats are not): someone who turns idle later never moves a visitor already there. A new style starts afresh.
|
|
1411
|
+
// M-3286: the office's "Idle people stay in their own area" (Edit offices): strolls stay in the area, no visits.
|
|
1412
|
+
const ownArea = !!custom && custom.stayInArea === true;
|
|
1001
1413
|
const visitMemo = useMemo(() => ({ claims: new Map(), idle: null }), [skin]);
|
|
1414
|
+
// M-3293: play — never on a share link's page (no onOpen there, or its own `talk`), with reduced motion, in All
|
|
1415
|
+
// offices, the carousel or Edit layout. `hold`: the person picked up (carried where the pointer is, walked back from
|
|
1416
|
+
// where they are dropped, or seated on another seat in their area: M-3445 #4266/#4267); `reacts`: pats and feeds showing.
|
|
1417
|
+
const play = playAllowed({ on: playOn, still, zones, overview, layout: !!layout, shared }) && !carouselPick;
|
|
1418
|
+
// M-3547 / M-3556: off only for reduced motion — one line under Drag and pat in Display options says so (no override).
|
|
1419
|
+
const playStillOff = playOffForMotion({ on: playOn, still, zones, overview, layout: !!layout, shared }) && !carouselPick;
|
|
1420
|
+
const hold = useMemo(() => createHold(), []), reacts = useRef(new Map()), walkNow = useRef(null), holdTimer = useRef(null);
|
|
1421
|
+
// M-3432 (#4255): custom snacks from the active skin pack (client-local, only when play is enabled).
|
|
1422
|
+
const snacks = useMemo(() => createSnacks(), []);
|
|
1423
|
+
const snackDragCtrl = useMemo(() => createSnackDrag(), []);
|
|
1424
|
+
const packSnacks = useMemo(() => (skin && skin.pack && Array.isArray(skin.pack.snacks) ? skin.pack.snacks : []), [skin]);
|
|
1425
|
+
const snacksById = useMemo(() => new Map(packSnacks.map((s) => [s.id, s])), [packSnacks]);
|
|
1426
|
+
const showSnacks = play && packSnacks.length > 0;
|
|
1427
|
+
const [armedSnack, setArmedSnack] = useState(null);
|
|
1428
|
+
const [snackDrag, setSnackDrag] = useState(null);
|
|
1429
|
+
const snackDropRef = useRef(null), snackGhostRef = useRef(null), snackGhostPosRef = useRef(null), snackTrayRef = useRef(null), snackSwallowRef = useRef(false);
|
|
1430
|
+
const snackCtxRef = useRef({ showSnacks: false, officeKey: "", styleKey: "" });
|
|
1431
|
+
const onSnackClaim = (winner) => {
|
|
1432
|
+
reacts.current.set(winner, { kind: "feed", t0: now() });
|
|
1433
|
+
if (store.tellOn(winner)) void store.tell(winner, "feed");
|
|
1434
|
+
loop.current?.wake();
|
|
1435
|
+
};
|
|
1436
|
+
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]);
|
|
1437
|
+
useEffect(() => { if (!showSnacks) { snackDragCtrl.retire(); snackDropRef.current = null; setArmedSnack(null); setSnackDrag(null); } }, [showSnacks]);
|
|
1438
|
+
useEffect(() => () => { snackDragCtrl.retire(); }, []);
|
|
1002
1439
|
useEffect(() => {
|
|
1003
1440
|
if (!zones || overview) return undefined;
|
|
1004
1441
|
const go = () => {
|
|
1005
|
-
const t = now(), to = walkTargets(desksOf(L), L, t, wander, skin.pack.furniture, night, visitMemo);
|
|
1442
|
+
const t = now(), to = walkTargets(desksOf(L), L, t, wander, skin.pack.furniture, night, visitMemo, ownArea);
|
|
1006
1443
|
// An act's walk; not someone in bed for the night (#2568: bedtime wins, as for mail).
|
|
1007
1444
|
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
1445
|
for (const [name, at] of mail.targets(L, t)) to.set(name, at);
|
|
1009
|
-
|
|
1446
|
+
for (const [name, at] of snacks.targets(t)) to.set(name, at);
|
|
1447
|
+
const held = hold.held(); // M-3293: carried: where the pointer is, no walk
|
|
1448
|
+
if (held) to.set(held.name, held.at);
|
|
1449
|
+
// M-3539: a new office or style (a room's office reads its style after it opens) puts everyone at their place at
|
|
1450
|
+
// once: walking there from the old one's seats drew the asleep standing in the help desk for seconds.
|
|
1451
|
+
const placed = `${officeKey}\n${skin.id}`, fresh = placedRef.current !== placed;
|
|
1452
|
+
placedRef.current = placed;
|
|
1453
|
+
walkers.sync(to, t, L, still, fresh);
|
|
1010
1454
|
// Reduced motion has no loop: drawn again here, or an act's walk (set after the scene was drawn) never shows.
|
|
1011
1455
|
if (still) { if (scene.current && !globalThis.document?.hidden) draw(0); } else loop.current?.wake();
|
|
1012
1456
|
};
|
|
1013
1457
|
go();
|
|
1458
|
+
walkNow.current = go;
|
|
1014
1459
|
if (still) return undefined;
|
|
1015
1460
|
const h = setInterval(go, WANDER.TICK);
|
|
1016
1461
|
return () => clearInterval(h);
|
|
1017
|
-
}, [L, wander, mail, skin, night, actsHere, visitMemo]);
|
|
1462
|
+
}, [L, wander, mail, skin, night, actsHere, visitMemo, ownArea]);
|
|
1018
1463
|
// …and in each tile on a zones style; the traffic within a tile is its own, between tiles the overview's.
|
|
1019
1464
|
useEffect(() => {
|
|
1020
1465
|
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 +1479,8 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1034
1479
|
const touched = useRef(false), fitted = useRef(false), drag = useRef(gestureState());
|
|
1035
1480
|
const miniViewRef = useRef(null), miniRef = useRef(null), overlayEl = useRef(null), tipDeskRef = useRef(null), pctRef = useRef(null);
|
|
1036
1481
|
const labelEls = useRef(new Map()); // #2554: the tiles' labels (tile key → element)
|
|
1037
|
-
|
|
1038
|
-
|
|
1482
|
+
snackCtxRef.current = { showSnacks, officeKey, styleKey };
|
|
1483
|
+
useEffect(() => { snackDragCtrl.retire(); hold.cancel(); seatDropRef.current = null; snacks.clear(); snackDropRef.current = null; setArmedSnack(null); setSnackDrag(null); }, [officeKey, styleKey]);
|
|
1039
1484
|
const keyRef = useRef(officeKey), saveTimer = useRef(0);
|
|
1040
1485
|
// The fit mode (Fit: contain; Fill: cover), kept per office and style like the view.
|
|
1041
1486
|
const [fitRev, setFitRev] = useState(0);
|
|
@@ -1072,7 +1517,7 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1072
1517
|
const v = view0(), sz = sizeRef.current;
|
|
1073
1518
|
const w = c.walks ? walkers.at(c.name, now()) : null;
|
|
1074
1519
|
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
|
-
const p = toScreen(v, pt.x, pt.y), cw = 320, ch = el.offsetHeight || 260, gap =
|
|
1520
|
+
const p = toScreen(v, pt.x, pt.y), cw = el.offsetWidth || 320, ch = el.offsetHeight || 260, gap = (c.skin?.pack?.card?.layout?.gap ?? 12) + pt.r;
|
|
1076
1521
|
let x = p.x + gap;
|
|
1077
1522
|
if (x + cw > sz.w - 8) x = p.x - gap - cw;
|
|
1078
1523
|
x = Math.max(8, Math.min(x, sz.w - cw - 8));
|
|
@@ -1140,11 +1585,13 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1140
1585
|
* under the zoom controls at the side.
|
|
1141
1586
|
*/
|
|
1142
1587
|
const fitL = (mode) => fitScene(L.width, L.height, size, mode, overview && mode !== "cover" ? FIT_PAD : 0);
|
|
1588
|
+
/** #4405: this scene's zoom floor — lower than OK_MIN for a pack's big canvas (or All offices), so − reaches its Fit. */
|
|
1589
|
+
const kLo = minK(L.width, L.height);
|
|
1143
1590
|
/** The view an office opens on: its kept one (a kept fit: fitted to this size), else its opening; and whether a fit. */
|
|
1144
1591
|
const openView = () => {
|
|
1145
1592
|
const kept = store.view(officeKey);
|
|
1146
1593
|
if (kept && kept.fit) return { v: fitL(fitMode), fit: true };
|
|
1147
|
-
if (kept) return { v: viewFromSaved(kept, size), fit: false };
|
|
1594
|
+
if (kept) return { v: viewFromSaved(kept, size, kLo), fit: false };
|
|
1148
1595
|
const fitted0 = zones || overview; // All offices opens whole, as a zones scene
|
|
1149
1596
|
return { v: overview ? fitL(fitMode) : openingView(L.width, L.height, size, ratio, fitted0, fitMode), fit: fitted0 };
|
|
1150
1597
|
};
|
|
@@ -1178,7 +1625,7 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1178
1625
|
fit(next);
|
|
1179
1626
|
};
|
|
1180
1627
|
/** + / −: 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)); };
|
|
1628
|
+
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
1629
|
/** Bring a box (logical units) into view, unchanged when it already is. */
|
|
1183
1630
|
const show = (b) => {
|
|
1184
1631
|
const v = view0(), p = toScreen(v, b.x, b.y);
|
|
@@ -1227,8 +1674,16 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1227
1674
|
const key = (e) => {
|
|
1228
1675
|
if (e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
1229
1676
|
if (e.key === "Escape") { if (fsRef.current === "immersive") { e.preventDefault(); exitFs(); } return; }
|
|
1677
|
+
const tg = e.target;
|
|
1678
|
+
// #4010: carousel keys at document level so a TV remote works without the canvas focused. Not while a field,
|
|
1679
|
+
// button or link is focused (Space/arrows stay with that control) or over Edit offices / Edit layout.
|
|
1680
|
+
const ck = carouselAct.current;
|
|
1681
|
+
if (ck.on && !carouselHeld(tg) && !editingRef.current && !layoutRef.current) {
|
|
1682
|
+
const a = carouselKey(e);
|
|
1683
|
+
if (a) { e.preventDefault(); ck.act(a); return; }
|
|
1684
|
+
}
|
|
1230
1685
|
if (e.key !== "f" && e.key !== "F") return;
|
|
1231
|
-
const el = ooRef.current
|
|
1686
|
+
const el = ooRef.current;
|
|
1232
1687
|
// Only here: from inside the view, or with nothing focused (never while typing, nor over Edit offices' dialog).
|
|
1233
1688
|
if (!el || typing(tg) || editingRef.current || !(tg === d.body || tg === d.documentElement || tg === d || (tg && el.contains(tg)))) return;
|
|
1234
1689
|
e.preventDefault();
|
|
@@ -1253,12 +1708,21 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1253
1708
|
return () => root.classList.remove("oo-immersive");
|
|
1254
1709
|
}, [fs]);
|
|
1255
1710
|
/** A desk opens its chat: out of fullscreen first (the chat is beside the view, or instead of it). */
|
|
1256
|
-
const open = (name) => {
|
|
1711
|
+
const open = (name) => {
|
|
1712
|
+
if (!onOpen) return;
|
|
1713
|
+
if (tmode !== "window") { setTalkTo(name); return; }
|
|
1714
|
+
if (fsRef.current) exitFs();
|
|
1715
|
+
onOpen(name);
|
|
1716
|
+
};
|
|
1717
|
+
/** The whole chat (the pop-up), from a talk in the Office. */
|
|
1718
|
+
const openFull = () => { if (!onOpen || !talkTo) return; if (fsRef.current) exitFs(); onOpen(talkTo); };
|
|
1257
1719
|
|
|
1258
1720
|
// ── Drawing: the back and front layers are pictures of the scene at the view's resolution (remade when the office
|
|
1259
1721
|
// or the zoom changes, never on a pan); each frame draws the matte, the layers, the people and the items in the air ──
|
|
1260
1722
|
const scene = useRef(null);
|
|
1261
1723
|
const loop = useRef(null);
|
|
1724
|
+
const clipClocks = useRef(null);
|
|
1725
|
+
if (!clipClocks.current) clipClocks.current = createClipClocks();
|
|
1262
1726
|
// The matte around the scene: the pack's own, else its background's edge (sampled once), else the skin's (tokens);
|
|
1263
1727
|
// All offices: the dashboard's background (each tile is its own scene).
|
|
1264
1728
|
const matte = overview ? pal.bg : (skin.pack && skin.pack.matte) || sampledMatte(skin.backdrop) || (skin.matte ? skin.matte({ pal, mode }) : pal.bg);
|
|
@@ -1274,16 +1738,22 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1274
1738
|
cv.style.setProperty("width", `${BW / ratio}px`);
|
|
1275
1739
|
cv.style.setProperty("height", `${BH / ratio}px`);
|
|
1276
1740
|
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
|
|
1741
|
+
const maxPackFps = overview
|
|
1742
|
+
? Math.max(0, ...tiles.map((tl) => packMaxFps(tl.skin && tl.skin.pack)))
|
|
1743
|
+
: packMaxFps(skin && skin.pack);
|
|
1744
|
+
const fps = Math.max(FPS, Math.min(30, Math.ceil(maxPackFps)));
|
|
1745
|
+
const base = { ctx, ratio, BW, BH, matte, env, fps, dirty: true };
|
|
1278
1746
|
if (overview) {
|
|
1279
1747
|
// Each tile a scene of its own, where the overview puts it (arranged.tiles, in the same order).
|
|
1280
1748
|
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
1749
|
scene.current = { ...base, overview: true, parts, lay: arranged };
|
|
1282
1750
|
} 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)
|
|
1751
|
+
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,
|
|
1752
|
+
hold: play ? hold : null, seatDrop: seatDropRef,
|
|
1753
|
+
snacks: play ? snacks : null, snacksById, ownArea, snackDrop: snackDropRef, onSnackClaim, onSnacksChanged: () => walkNow.current?.() } };
|
|
1284
1754
|
}
|
|
1285
1755
|
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]);
|
|
1756
|
+
}, [L, looks, skin, pal, size.w, size.h, ratio, matte, overview, tiles, tileLooks, arranged, ghosts, night, mail, actsHere, lv, wordsOf, play, snacksById, ownArea]);
|
|
1287
1757
|
|
|
1288
1758
|
/** One frame at `ms` (0: still); whether anything is moving (in the air, or someone walking). */
|
|
1289
1759
|
function draw(ms) {
|
|
@@ -1291,13 +1761,31 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1291
1761
|
if (!s) return false;
|
|
1292
1762
|
placeCard();
|
|
1293
1763
|
const { ctx, BW, BH, env } = s;
|
|
1764
|
+
s.bubbleHits = [];
|
|
1765
|
+
const seenClips = ms > 0 ? new Set() : null;
|
|
1766
|
+
const clocked = (prefix) => (seenClips
|
|
1767
|
+
? { ...env, clock: (k, st, t) => { const fk = `${prefix}${k}`; seenClips.add(fk); return clipClocks.current.elapsed(fk, st, t); } }
|
|
1768
|
+
: env);
|
|
1294
1769
|
// 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
1770
|
const v = view0(), a = v.k * s.ratio, ox = Math.round(v.x * s.ratio), oy = Math.round(v.y * s.ratio);
|
|
1296
1771
|
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
1297
1772
|
ctx.clearRect(0, 0, BW, BH);
|
|
1298
1773
|
ctx.fillStyle = s.matte; ctx.fillRect(0, 0, BW, BH);
|
|
1299
1774
|
ctx.imageSmoothingEnabled = false;
|
|
1300
|
-
|
|
1775
|
+
for (const p of s.overview ? s.parts : [s.part]) p.reply = replyRef.current ? { ...replyRef.current, ratio: s.ratio } : null;
|
|
1776
|
+
if (!s.overview) {
|
|
1777
|
+
// #4379 review: an open card (beside its person, or a bottom sheet) covers part of the scene: a name tag under it is
|
|
1778
|
+
// left out whole, never a fragment showing past its edge. Its box in bitmap px, as the canvas lies on the page.
|
|
1779
|
+
const cardNow = cardEl.current, cvNow = canvasRef.current;
|
|
1780
|
+
if (cardNow && cvNow && typeof cardNow.getBoundingClientRect === "function" && typeof cvNow.getBoundingClientRect === "function") {
|
|
1781
|
+
const r = cardNow.getBoundingClientRect(), c = cvNow.getBoundingClientRect();
|
|
1782
|
+
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;
|
|
1783
|
+
} else s.part.cover = null;
|
|
1784
|
+
const e0 = clocked(""), kc = keepClearOf(canvasRef.current, v);
|
|
1785
|
+
const moved = drawPart(ctx, s.part, a, ox, oy, ms, still, tipNow.current, kc.length ? { ...e0, keepClear: kc } : e0, false, null, s.bubbleHits);
|
|
1786
|
+
if (seenClips) clipClocks.current.prune(seenClips);
|
|
1787
|
+
return drawDialogue(ctx, s, ms) || moved;
|
|
1788
|
+
}
|
|
1301
1789
|
// All offices: each tile on screen drawn as its own view, scaled into it and clipped to it; one off screen is not
|
|
1302
1790
|
// drawn (its flights still land). Then a frame round each tile, and the items flying between tiles.
|
|
1303
1791
|
const hot = tipNow.current, on = new Set(visibleTiles(s.lay, v, sizeRef.current).map((tt) => tt.key)), said = [];
|
|
@@ -1309,7 +1797,7 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1309
1797
|
ctx.save();
|
|
1310
1798
|
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
1311
1799
|
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,
|
|
1800
|
+
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, said, s.bubbleHits)) moving = true;
|
|
1313
1801
|
ctx.restore();
|
|
1314
1802
|
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
1315
1803
|
ctx.strokeStyle = env.pal.border; ctx.lineWidth = 1;
|
|
@@ -1319,11 +1807,13 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1319
1807
|
const up = still ? [] : cross.frame(ms, s.parts);
|
|
1320
1808
|
// 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
1809
|
// a sender in no tile drawn: the built-in item, in overview units.
|
|
1810
|
+
const crossEnv = clocked("x:");
|
|
1322
1811
|
for (const it of up) {
|
|
1323
1812
|
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,
|
|
1813
|
+
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); }
|
|
1814
|
+
else { ctx.setTransform(a, 0, 0, a, ox, oy); skinFor("pixel").drawProp(ctx, it, ms, crossEnv); }
|
|
1326
1815
|
}
|
|
1816
|
+
if (seenClips) clipClocks.current.prune(seenClips);
|
|
1327
1817
|
return drawDialogue(ctx, s, ms) || moving || up.length > 0 || cross.size() > 0;
|
|
1328
1818
|
}
|
|
1329
1819
|
/**
|
|
@@ -1331,15 +1821,26 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1331
1821
|
* awake (pickFront), with their faces (the pack's portraits; else the agent's avatar, else initials), the speaker's
|
|
1332
1822
|
* words typed out, the agent's line while it works and "+N". Nothing at all while it is off. Whether it moves.
|
|
1333
1823
|
*/
|
|
1334
|
-
function drawDialogue(
|
|
1824
|
+
function drawDialogue(_mapCtx, s, ms) {
|
|
1335
1825
|
const d = dlgRef.current;
|
|
1336
|
-
if (!d) { dlgShown.current = null; return false; }
|
|
1826
|
+
if (!d) { dlgShown.current = null; showDialogueDock(false); return false; }
|
|
1337
1827
|
const t = ms > 0 ? ms : now();
|
|
1338
1828
|
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
|
|
1829
|
+
if (!front) { dlgShown.current = null; showDialogueDock(false); return false; }
|
|
1830
|
+
const who = d.who.get(front.instance), node = who.node;
|
|
1341
1831
|
const stage = stageOf(front, t, node.state === "working", still);
|
|
1342
|
-
|
|
1832
|
+
// Talk "Dialogue box" (d.vn) keeps an answer until it is clicked away in its own box (TalkStage); the dock is not drawn then.
|
|
1833
|
+
if (stage.done && !d.vn) { dlgShown.current = null; showDialogueDock(false); return false; }
|
|
1834
|
+
showDialogueDock(true);
|
|
1835
|
+
const cv = dialogueCanvasRef.current;
|
|
1836
|
+
if (!cv) return false; // layout commit mounts the dock, then its effect paints even with reduced motion
|
|
1837
|
+
const dw = cv.clientWidth || sizeRef.current.w, dh = cv.clientHeight || (phone ? 160 : 180), L0 = boxLayout(dw, dh);
|
|
1838
|
+
const BW = Math.max(1, Math.floor(dw * s.ratio)), BH = Math.max(1, Math.floor(dh * s.ratio));
|
|
1839
|
+
if (cv.width !== BW) cv.width = BW;
|
|
1840
|
+
if (cv.height !== BH) cv.height = BH;
|
|
1841
|
+
const ctx = cv.getContext("2d");
|
|
1842
|
+
if (!ctx) return false;
|
|
1843
|
+
ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.clearRect(0, 0, BW, BH);
|
|
1343
1844
|
const skinOf = who.skin, pack = skinOf && skinOf.pack;
|
|
1344
1845
|
const pic = (src) => (src && skinOf && typeof skinOf.picture === "function" ? skinOf.picture(src, dlgWake) : null);
|
|
1345
1846
|
const agentName = nodeText(node).primary;
|
|
@@ -1377,27 +1878,38 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1377
1878
|
dlgShown.current = { L, stage, key: who.key, name: front.instance };
|
|
1378
1879
|
const frameSrc = pack && pack.dialogBox && pack.dialogBox.frame, frameIm = frameSrc ? pic(frameSrc) : null;
|
|
1379
1880
|
return drawBox(ctx, {
|
|
1380
|
-
|
|
1881
|
+
// A short landscape dock keeps the name and words; decorative faces need headroom above the box.
|
|
1882
|
+
L, stage, left: dh >= 144 ? personFace() : null, right: dh < 144 || stage.phase === "heard" ? null : agentFace(),
|
|
1381
1883
|
name: answered ? agentName : front.person ? front.person.name || to("dlgSomeone") : to("dlgSomeone"),
|
|
1382
1884
|
lines, status: status ? `${agentName} · ${status}` : null, more,
|
|
1383
1885
|
colours: boxColours(pack && pack.dialogBox, s.env.pal), frame: frameIm ? { im: frameIm, slice: pack.dialogBox.slice || 8, k: pack.scale || 2 } : null,
|
|
1384
1886
|
}, t, { ...s.env, still });
|
|
1385
1887
|
}
|
|
1888
|
+
// A newly mounted dock must paint even when reduced motion leaves the map loop asleep.
|
|
1889
|
+
useLayoutEffect(() => {
|
|
1890
|
+
if (!dlgOn || !dlgVisible) return;
|
|
1891
|
+
if (scene.current) drawDialogue(scene.current.ctx, scene.current, still ? 0 : now());
|
|
1892
|
+
if (!still) loop.current?.wake();
|
|
1893
|
+
}, [dlgOn, dlgVisible, dlgSay, width, phone, ratio]);
|
|
1894
|
+
|
|
1386
1895
|
// The loop: drawing only when the frame (FPS) changed or something is in the air; stopped while the tab is hidden,
|
|
1387
1896
|
// gone with the view. Office review: while something walks or flies, one requestAnimationFrame per display frame (the
|
|
1388
1897
|
// motion is smooth); when nothing moves, the poses change at most FPS times a second, so the loop sleeps (a timer)
|
|
1389
1898
|
// until the next frame's start instead of waking at the display's rate only to find nothing to draw.
|
|
1390
1899
|
useEffect(() => {
|
|
1391
1900
|
if (still || typeof requestAnimationFrame !== "function") return undefined;
|
|
1392
|
-
let raf = 0, timer = 0, last = -1, air = true, gone = false;
|
|
1901
|
+
let raf = 0, timer = 0, last = -1, lastFps = FPS, air = true, gone = false;
|
|
1393
1902
|
const tick = () => {
|
|
1394
1903
|
raf = 0;
|
|
1395
1904
|
if (gone || globalThis.document?.hidden || !scene.current) return;
|
|
1396
|
-
const
|
|
1397
|
-
|
|
1905
|
+
const fps = scene.current.fps || FPS;
|
|
1906
|
+
const ms = now(), frame = Math.floor((ms / 1000) * fps); // the clock the trips started on
|
|
1907
|
+
if (scene.current.dirty || frame !== last || fps !== lastFps || air) { scene.current.dirty = false; last = frame; lastFps = fps; air = draw(ms); }
|
|
1398
1908
|
if (air) { raf = requestAnimationFrame(tick); return; }
|
|
1399
|
-
const wait = Math.max(1, Math.ceil(((frame + 1) * 1000) /
|
|
1400
|
-
|
|
1909
|
+
const wait = Math.max(1, Math.ceil(((frame + 1) * 1000) / fps - ms)); // until the next frame starts
|
|
1910
|
+
if (fps > FPS && wait <= 16) { raf = requestAnimationFrame(tick); return; }
|
|
1911
|
+
const sleep = fps > FPS ? Math.max(1, wait - 14) : wait;
|
|
1912
|
+
timer = setTimeout(() => { timer = 0; if (!gone && !raf) raf = requestAnimationFrame(tick); }, sleep);
|
|
1401
1913
|
};
|
|
1402
1914
|
const wake = () => {
|
|
1403
1915
|
air = true;
|
|
@@ -1437,7 +1949,35 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1437
1949
|
area: zones ? areaName(d.area) : roomOf(L, d), skin, look: looks.get(d.key) }));
|
|
1438
1950
|
// #2861: who the dialogue box may speak for — everyone drawn here (All offices: the first tile they are in), with what
|
|
1439
1951
|
// draws them; null while it is off (draw() then draws nothing of it).
|
|
1440
|
-
|
|
1952
|
+
replyRef.current = tmode === "bubble" ? { chat, draw: chatUi.drawReply, style: chatUi.replyStyle, pace: chatUi.readPace, read: readMode } : null;
|
|
1953
|
+
const talkWho = talkTo ? people.find((d) => d.node && d.node.name === talkTo) || null : null;
|
|
1954
|
+
const talkLabel = talkWho ? nodeText(talkWho.node).primary : talkTo;
|
|
1955
|
+
const sidePanel = tmode === "panel" && !!talkTo;
|
|
1956
|
+
/** Talk "Dialogue box": what the box on the scene shows now (fleet-office-talk.js TalkStage), or null. */
|
|
1957
|
+
const stagePeek = () => {
|
|
1958
|
+
const d = dlgRef.current;
|
|
1959
|
+
const pf = d ? pickFront(dlg.list(), (n) => d.who.has(n), (n) => d.who.get(n).look?.pose === "paused") : { front: null, more: 0 };
|
|
1960
|
+
const conv = pf.front, name = conv ? conv.instance : talkTo;
|
|
1961
|
+
if (!name) return null;
|
|
1962
|
+
const who = d ? d.who.get(name) : null, node = who ? who.node : (people.find((x) => x.node && x.node.name === name) || {}).node;
|
|
1963
|
+
if (!node) return null;
|
|
1964
|
+
const sk = (who && who.skin) || skin, pack = sk && sk.pack, act = actsHere && actsHere.get(name);
|
|
1965
|
+
const pic = (src) => { const im = src && sk && typeof sk.picture === "function" ? sk.picture(src, () => {}) : null; return im && im.src ? im.src : null; };
|
|
1966
|
+
return {
|
|
1967
|
+
name, label: nodeText(node).primary, conv, more: pf.more,
|
|
1968
|
+
status: node.state === "working" ? (actLive(act, node.state, Date.now(), null) && act.say ? act.say : to("dlgWorking")) : null,
|
|
1969
|
+
portrait: pack ? pic(portraitSrc(pack, { agent: name, state: node.state })) : null,
|
|
1970
|
+
colours: (pack && pack.dialogBox) || null,
|
|
1971
|
+
};
|
|
1972
|
+
};
|
|
1973
|
+
const stageOps = {
|
|
1974
|
+
now, skip: () => skipTalk(), target: (n) => { if (talkTo !== n) setTalkTo(n); },
|
|
1975
|
+
drop: (instance) => { dlg.drop(instance); dlgWake(); },
|
|
1976
|
+
};
|
|
1977
|
+
// The dialogue box is the talk only as itself (or beside the pop-up): never under the side panel or the head bubble.
|
|
1978
|
+
const dockShown = dlgOn && dlgVisible && tmode === "window";
|
|
1979
|
+
dlgRef.current = dlgOn ? {
|
|
1980
|
+
vn: tmode === "box", read: readMode,
|
|
1441
1981
|
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
1982
|
acts: actsHere, share: talk !== undefined,
|
|
1443
1983
|
} : null;
|
|
@@ -1467,30 +2007,121 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1467
2007
|
return d ? { key: p.prefix + d.key, node: d.node } : null;
|
|
1468
2008
|
};
|
|
1469
2009
|
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(
|
|
2010
|
+
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
2011
|
/** Where a drag pans: the canvas, and Edit layout's overlay off its handles (the controls, the bar and the list: never). */
|
|
1472
2012
|
const onScene = (el) => !!el && (el === canvasRef.current || (typeof el.closest === "function" && !!el.closest(".ol-svg") && !el.closest(".ol-handle")));
|
|
2013
|
+
/** M-3293 / M-3445: update the floor-level seat drop targets while carrying `h` ({ name, at }). */
|
|
2014
|
+
const updateSeatDrop = (h) => {
|
|
2015
|
+
if (!h || !zones || !skin || !skin.pack) { seatDropRef.current = null; return; }
|
|
2016
|
+
const ds = desksOf(L);
|
|
2017
|
+
seatDropRef.current = {
|
|
2018
|
+
name: h.name,
|
|
2019
|
+
targets: seatDropTargets(skin.pack, ds, h.name),
|
|
2020
|
+
hover: findSeatDropTarget(skin.pack, ds, h.name, h.at),
|
|
2021
|
+
};
|
|
2022
|
+
};
|
|
2023
|
+
/** M-3293 / M-3445: someone picked up — enters `dragged` pose under the pointer, highlights valid seats in their area. */
|
|
2024
|
+
const pickedUp = (pointerId) => {
|
|
2025
|
+
const h = hold.held();
|
|
2026
|
+
if (!h) return;
|
|
2027
|
+
// Captured only now: a press that stays a click must reach the canvas (its card), which a capture would take away.
|
|
2028
|
+
try { stageRef.current.setPointerCapture(pointerId); } catch { /* gone */ }
|
|
2029
|
+
snacks.cancel(h.name);
|
|
2030
|
+
updateSeatDrop(h);
|
|
2031
|
+
walkers.place(h.name, h.at); drag.current.swallow = true;
|
|
2032
|
+
setTip(null); setCard(null); loop.current?.wake();
|
|
2033
|
+
};
|
|
1473
2034
|
const onDown = (e) => {
|
|
1474
2035
|
lastType.current = e.pointerType || "mouse";
|
|
1475
2036
|
if (!onScene(e.target)) return;
|
|
2037
|
+
// M-3293: a press on a person may pick them up — a mouse once it moves (no pan then), a touch once held still
|
|
2038
|
+
// (LONG_MS; a finger that moves first pans, as before).
|
|
2039
|
+
if (play && e.isPrimary !== false && !(e.pointerType === "mouse" && e.button !== 0)) {
|
|
2040
|
+
const d = deskOf(e), w = pointOf(e);
|
|
2041
|
+
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);
|
|
2042
|
+
if (st === "maybe") return; // no pan: a click (their card), or a pick-up once it moves
|
|
2043
|
+
if (st === "press") { const id = e.pointerId; clearTimeout(holdTimer.current); holdTimer.current = setTimeout(() => { if (hold.tick(now()) === "held") pickedUp(id); }, PLAY.LONG_MS); }
|
|
2044
|
+
}
|
|
1476
2045
|
g.down(e);
|
|
1477
2046
|
if (drag.current.pts.size === 2) raw.current = view0().k; // a pinch starts from the zoom shown
|
|
1478
2047
|
};
|
|
2048
|
+
/** 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. */
|
|
2049
|
+
const onStageMove = (e) => {
|
|
2050
|
+
if (hold.state()) {
|
|
2051
|
+
const w = pointOf(e), was = hold.state();
|
|
2052
|
+
const st = w ? hold.move(e.pointerId, w.x, w.y, now(), e.clientX, e.clientY) : hold.state();
|
|
2053
|
+
if (st === "held") {
|
|
2054
|
+
if (was !== "held") pickedUp(e.pointerId);
|
|
2055
|
+
else { const h = hold.held(); updateSeatDrop(h); walkers.place(h.name, h.at); loop.current?.wake(); }
|
|
2056
|
+
return;
|
|
2057
|
+
}
|
|
2058
|
+
if (st === "maybe" || st === "press") return;
|
|
2059
|
+
if (st === "pan") { clearTimeout(holdTimer.current); hold.cancel(); seatDropRef.current = null; }
|
|
2060
|
+
}
|
|
2061
|
+
g.move(e);
|
|
2062
|
+
};
|
|
2063
|
+
/** M-3445 (#4266): settle a dragged character onto a valid seat in their area (or clamp/walk back to their seat). */
|
|
2064
|
+
const finishHoldDrop = (r, commitSeat) => {
|
|
2065
|
+
seatDropRef.current = null;
|
|
2066
|
+
if (!r) return;
|
|
2067
|
+
const ds = desksOf(L);
|
|
2068
|
+
const target = commitSeat && zones && skin && skin.pack ? findSeatDropTarget(skin.pack, ds, r.name, r.at) : null;
|
|
2069
|
+
if (target) {
|
|
2070
|
+
if (!target.current) {
|
|
2071
|
+
const res = applySeatDrop({ pack: skin.pack, desks: ds, seats: seatsRef.current, prefs: seatPrefsRef.current, name: r.name, target });
|
|
2072
|
+
seatsRef.current = res.seats;
|
|
2073
|
+
seatPrefsRef.current = res.prefs;
|
|
2074
|
+
if (!shared) store.saveSeats(officeKey, res.prefs);
|
|
2075
|
+
if (res.swapped) {
|
|
2076
|
+
const occPos = walkers.at(res.swapped.name, now()) || { x: target.x, y: target.y };
|
|
2077
|
+
if (ownArea && !routeStaysInArea(occPos, res.swapped.seat, L, target.area, null)) {
|
|
2078
|
+
walkers.place(res.swapped.name, res.swapped.seat);
|
|
2079
|
+
}
|
|
2080
|
+
}
|
|
2081
|
+
walkers.place(r.name, { x: target.x, y: target.y });
|
|
2082
|
+
setSeatRev((n) => n + 1);
|
|
2083
|
+
} else {
|
|
2084
|
+
walkers.place(r.name, { x: target.x, y: target.y });
|
|
2085
|
+
walkNow.current?.();
|
|
2086
|
+
}
|
|
2087
|
+
} else {
|
|
2088
|
+
const d = ds.find((x) => x && x.node && x.node.name === r.name);
|
|
2089
|
+
const landAt = ownArea && d ? clampDropForArea(r.at, d.seat, L, d.area) : r.at;
|
|
2090
|
+
walkers.place(r.name, landAt);
|
|
2091
|
+
walkNow.current?.();
|
|
2092
|
+
}
|
|
2093
|
+
loop.current?.wake();
|
|
2094
|
+
};
|
|
2095
|
+
const onStageUp = (e) => {
|
|
2096
|
+
clearTimeout(holdTimer.current);
|
|
2097
|
+
const r = hold.up(e.pointerId);
|
|
2098
|
+
if (r) { finishHoldDrop(r, true); drag.current.swallow = true; setTimeout(() => { if (!drag.current.pts.size) drag.current.swallow = false; }, 0); }
|
|
2099
|
+
g.up(e);
|
|
2100
|
+
};
|
|
2101
|
+
const onStageCancel = (e) => { clearTimeout(holdTimer.current); const r = hold.up(e.pointerId); finishHoldDrop(r, false); g.up(e); };
|
|
1479
2102
|
const onWheel = (e) => {
|
|
1480
2103
|
if (!onScene(e.target) && !(typeof e.target?.closest === "function" && e.target.closest(".ol-handle, .oo-tile-label"))) return;
|
|
1481
2104
|
e.preventDefault();
|
|
1482
2105
|
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));
|
|
2106
|
+
raw.current = Math.min(OK_MAX, Math.max(kLo, raw.current * wheelFactor(e)));
|
|
2107
|
+
if (raw.current !== v.k) setView(zoomOffice(v, raw.current, e.clientX - r.left, e.clientY - r.top, kLo));
|
|
1485
2108
|
};
|
|
1486
2109
|
const onKeyDown = (e) => {
|
|
1487
2110
|
if (e.defaultPrevented) return; // Edit layout's handles move with the arrows
|
|
2111
|
+
if (e.key === "Escape" && hold.held()) {
|
|
2112
|
+
e.preventDefault();
|
|
2113
|
+
clearTimeout(holdTimer.current);
|
|
2114
|
+
const h = hold.held();
|
|
2115
|
+
hold.cancel();
|
|
2116
|
+
finishHoldDrop(h, false);
|
|
2117
|
+
return;
|
|
2118
|
+
}
|
|
1488
2119
|
const tag = e.target && e.target.tagName;
|
|
1489
2120
|
if (tag === "INPUT" || tag === "SELECT" || tag === "TEXTAREA") return;
|
|
1490
2121
|
const z = zoomKey(e);
|
|
1491
2122
|
if (z) { e.preventDefault(); if (z === "fit") fit(); else zoomStep(z === "in" ? 1 : -1); return; }
|
|
1492
2123
|
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 }); }
|
|
2124
|
+
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
2125
|
};
|
|
1495
2126
|
// The keyboard's way through: a desk in the list, or a handle of Edit layout, is brought into view when focused.
|
|
1496
2127
|
const onFocusIn = (e) => {
|
|
@@ -1504,12 +2135,32 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1504
2135
|
};
|
|
1505
2136
|
/** #2861: the dialogue box under a pointer event ({ key, name }: its agent), or null. */
|
|
1506
2137
|
const dlgAt = (e) => {
|
|
1507
|
-
const b = dlgShown.current, r =
|
|
2138
|
+
const b = dlgShown.current, r = dialogueCanvasRef.current ? dialogueCanvasRef.current.getBoundingClientRect() : null;
|
|
1508
2139
|
return b && r && onBox(b.L, b.stage, e.clientX - r.left, e.clientY - r.top) ? b : null;
|
|
1509
2140
|
};
|
|
2141
|
+
// Use the painted prefix and final displaced position, including bubbles outside an overview tile.
|
|
2142
|
+
const bubbleAtEvent = (e) => {
|
|
2143
|
+
// An armed snack owns map taps until the existing placement/feed action consumes it.
|
|
2144
|
+
if (shared || !onOpen || showSnacks && armedSnack) return null;
|
|
2145
|
+
const s = scene.current, r = canvasRef.current?.getBoundingClientRect();
|
|
2146
|
+
if (!s || !r) return null;
|
|
2147
|
+
const hit = officeBubbleAt(s.bubbleHits || [], (e.clientX - r.left) * s.ratio, (e.clientY - r.top) * s.ratio, lastType.current === "touch" ? 44 * s.ratio : 0);
|
|
2148
|
+
return hit && people.some(d => d.node.i && d.node.name === hit.name) ? hit : null;
|
|
2149
|
+
};
|
|
2150
|
+
const openDialogue = (e) => {
|
|
2151
|
+
if (shared || !onOpen || !dlgShown.current || e.detail > 1) return;
|
|
2152
|
+
if (e.type === "keydown") {
|
|
2153
|
+
if (e.repeat || e.key !== "Enter" && e.key !== " ") return;
|
|
2154
|
+
e.preventDefault();
|
|
2155
|
+
}
|
|
2156
|
+
setCard(null); open(dlgShown.current.name);
|
|
2157
|
+
};
|
|
2158
|
+
/** Skip (the reading controls): every reply in the box, or over the heads, goes now. */
|
|
2159
|
+
const skipTalk = () => { if (tmode === "box") dlg.skip(); else if (chat) chat.skipAll(); dlgWake(); };
|
|
2160
|
+
const pickRead = (v) => { store.saveTalkRead(v); setReadMode(v); dlgWake(); };
|
|
1510
2161
|
const onMove = (e) => {
|
|
1511
|
-
if (e.pointerType === "touch" || g.busy()) return;
|
|
1512
|
-
const onDlg = !!dlgAt(e);
|
|
2162
|
+
if (e.pointerType === "touch" || g.busy() || snackDrag || snackDropRef.current) return;
|
|
2163
|
+
const onDlg = !!dlgAt(e) || !!bubbleAtEvent(e);
|
|
1513
2164
|
if (onDlg !== dlgHot) setDlgHot(onDlg);
|
|
1514
2165
|
const d = onDlg ? null : deskOf(e); const key = d ? d.key : null; if (key !== tip) setTip(key);
|
|
1515
2166
|
};
|
|
@@ -1523,19 +2174,176 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1523
2174
|
};
|
|
1524
2175
|
// #2661: a click (or a tap) on a person opens their card; on the same person again, or off everyone, closes it; on
|
|
1525
2176
|
// someone else, switches to theirs. A double-click skips the card and opens the chat.
|
|
2177
|
+
/** 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). */
|
|
2178
|
+
const nearOf = (e) => {
|
|
2179
|
+
const w = pointOf(e);
|
|
2180
|
+
if (!w || overview) return null;
|
|
2181
|
+
const at = now();
|
|
2182
|
+
const list = people.filter((d) => d.node && d.node.i).map((d) => {
|
|
2183
|
+
const wk = zones ? walkers.at(d.node.name, at) : null;
|
|
2184
|
+
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 };
|
|
2185
|
+
});
|
|
2186
|
+
return nearestPerson(list, w.x, w.y, TAP_R / Math.max(kLo, view0().k));
|
|
2187
|
+
};
|
|
2188
|
+
/** M-3432 (#4255): feed an awake person a snack (plays eat animation + hearts + feed bubble + optional Tell). */
|
|
2189
|
+
const feedPerson = (name, snack, at) => {
|
|
2190
|
+
const t = now();
|
|
2191
|
+
snacks.feed(name, snack, { x: at.x, y: at.y, t, charEatStrip: skin.eatStrip ? skin.eatStrip(name) : null });
|
|
2192
|
+
reacts.current.set(name, { kind: "feed", t0: t });
|
|
2193
|
+
if (store.tellOn(name)) void store.tell(name, "feed");
|
|
2194
|
+
walkNow.current?.();
|
|
2195
|
+
loop.current?.wake();
|
|
2196
|
+
};
|
|
2197
|
+
/** M-3432 (#4255): drop a snack on the floor so nearby idle characters race to it. */
|
|
2198
|
+
const placeSnackAt = (snack, at) => {
|
|
2199
|
+
const t = now();
|
|
2200
|
+
const hidden = scene.current && scene.current.part ? furnitureAt(scene.current.part, t).hidden : null;
|
|
2201
|
+
snacks.place(snack, at, t, { desks: desksOf(L), walkers, hidden, ownArea, areas: L.areas, graph: L });
|
|
2202
|
+
walkNow.current?.();
|
|
2203
|
+
loop.current?.wake();
|
|
2204
|
+
};
|
|
2205
|
+
/** M-3432 (#4255): classify a pointer position while dragging a snack (awake person → feed, floor → place, tray/asleep/outside → cancel). */
|
|
2206
|
+
const snackTargetOf = (e) => {
|
|
2207
|
+
const tray = snackTrayRef.current;
|
|
2208
|
+
if (tray && typeof tray.getBoundingClientRect === "function") {
|
|
2209
|
+
const tr = tray.getBoundingClientRect();
|
|
2210
|
+
if (e.clientX >= tr.left && e.clientX <= tr.right && e.clientY >= tr.top && e.clientY <= tr.bottom) return null;
|
|
2211
|
+
}
|
|
2212
|
+
const st = stageRef.current;
|
|
2213
|
+
if (st && typeof st.getBoundingClientRect === "function") {
|
|
2214
|
+
const sr = st.getBoundingClientRect();
|
|
2215
|
+
if (e.clientX < sr.left || e.clientX > sr.right || e.clientY < sr.top || e.clientY > sr.bottom) return null;
|
|
2216
|
+
}
|
|
2217
|
+
const d = deskOf(e) || (e.pointerType === "touch" ? nearOf(e) : null);
|
|
2218
|
+
if (d && d.node && d.node.i) {
|
|
2219
|
+
if (ASLEEP.has(d.node.state) || d.night) return null;
|
|
2220
|
+
const at = (zones && walkers.at(d.node.name, now())) || d.seat || { x: d.x + d.w / 2, y: d.y + d.h };
|
|
2221
|
+
return { kind: "feed", name: d.node.name, label: nodeText(d.node).primary, x: at.x, y: at.y };
|
|
2222
|
+
}
|
|
2223
|
+
const w = pointOf(e);
|
|
2224
|
+
if (!w || w.x < 0 || w.x > L.width || w.y < 0 || w.y > L.height) return null;
|
|
2225
|
+
return { kind: "place", x: w.x, y: w.y };
|
|
2226
|
+
};
|
|
2227
|
+
/** 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). */
|
|
2228
|
+
const onSnackDown = (snack, e) => {
|
|
2229
|
+
if (!showSnacks || e.isPrimary === false || (e.pointerType === "mouse" && e.button !== 0)) return;
|
|
2230
|
+
e.stopPropagation();
|
|
2231
|
+
const startOffice = officeKey, startStyle = styleKey;
|
|
2232
|
+
let lastKey = "";
|
|
2233
|
+
const moveGhost = (cx, cy) => {
|
|
2234
|
+
const sr = stageRef.current ? stageRef.current.getBoundingClientRect() : null;
|
|
2235
|
+
if (!sr) return;
|
|
2236
|
+
const gx = Math.round(cx - sr.left + 12), gy = Math.round(cy - sr.top - 40);
|
|
2237
|
+
snackGhostPosRef.current = { x: gx, y: gy };
|
|
2238
|
+
const gh = snackGhostRef.current;
|
|
2239
|
+
if (gh && gh.style) gh.style.setProperty("transform", `translate(${gx}px, ${gy}px)`);
|
|
2240
|
+
};
|
|
2241
|
+
const swallowClick = () => {
|
|
2242
|
+
snackSwallowRef.current = true;
|
|
2243
|
+
setTimeout(() => { snackSwallowRef.current = false; }, 0);
|
|
2244
|
+
};
|
|
2245
|
+
snackDragCtrl.start({
|
|
2246
|
+
pid: e.pointerId,
|
|
2247
|
+
sx: e.clientX,
|
|
2248
|
+
sy: e.clientY,
|
|
2249
|
+
slop: PLAY.SLOP,
|
|
2250
|
+
onMove: (ev, { starting }) => {
|
|
2251
|
+
if (starting) { setCard(null); setTip(null); }
|
|
2252
|
+
ev.preventDefault();
|
|
2253
|
+
if (tipNow.current) setTip(null);
|
|
2254
|
+
moveGhost(ev.clientX, ev.clientY);
|
|
2255
|
+
const drop = snackTargetOf(ev);
|
|
2256
|
+
snackDropRef.current = drop;
|
|
2257
|
+
const k = drop ? `${drop.kind}:${drop.name || ""}` : "";
|
|
2258
|
+
if (starting || k !== lastKey) {
|
|
2259
|
+
lastKey = k;
|
|
2260
|
+
setSnackDrag({ snack, kind: drop ? drop.kind : null, label: drop && drop.kind === "feed" ? drop.label : "" });
|
|
2261
|
+
}
|
|
2262
|
+
loop.current?.wake();
|
|
2263
|
+
return drop;
|
|
2264
|
+
},
|
|
2265
|
+
onCommit: (drop) => {
|
|
2266
|
+
snackDropRef.current = null;
|
|
2267
|
+
setSnackDrag(null);
|
|
2268
|
+
swallowClick();
|
|
2269
|
+
const cur = snackCtxRef.current;
|
|
2270
|
+
if (cur.showSnacks && cur.officeKey === startOffice && cur.styleKey === startStyle) {
|
|
2271
|
+
if (drop.kind === "feed") feedPerson(drop.name, snack, { x: drop.x, y: drop.y });
|
|
2272
|
+
else if (drop.kind === "place") placeSnackAt(snack, { x: drop.x, y: drop.y });
|
|
2273
|
+
setArmedSnack(null);
|
|
2274
|
+
}
|
|
2275
|
+
loop.current?.wake();
|
|
2276
|
+
},
|
|
2277
|
+
onCancel: ({ dragging }) => {
|
|
2278
|
+
snackDropRef.current = null;
|
|
2279
|
+
setSnackDrag(null);
|
|
2280
|
+
if (dragging) swallowClick();
|
|
2281
|
+
loop.current?.wake();
|
|
2282
|
+
},
|
|
2283
|
+
});
|
|
2284
|
+
};
|
|
2285
|
+
useEffect(() => {
|
|
2286
|
+
if (!armedSnack) return undefined;
|
|
2287
|
+
const onEsc = (e) => { if (e.key === "Escape" && !e.defaultPrevented) { e.preventDefault(); setArmedSnack(null); } };
|
|
2288
|
+
globalThis.document?.addEventListener?.("keydown", onEsc, true);
|
|
2289
|
+
return () => globalThis.document?.removeEventListener?.("keydown", onEsc, true);
|
|
2290
|
+
}, [armedSnack]);
|
|
2291
|
+
const paintSnackIcon = (st, pxSize = 28) => (cv) => {
|
|
2292
|
+
const g = cv && typeof cv.getContext === "function" ? cv.getContext("2d") : null;
|
|
2293
|
+
if (!g || !st || !skin || typeof skin.drawSnackIcon !== "function") return;
|
|
2294
|
+
const r = deviceRatio(), S = pxSize;
|
|
2295
|
+
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); }
|
|
2296
|
+
g.setTransform(r, 0, 0, r, 0, 0); g.clearRect(0, 0, S, S);
|
|
2297
|
+
skin.drawSnackIcon(g, st, S);
|
|
2298
|
+
};
|
|
1526
2299
|
const onClick = (e) => {
|
|
1527
2300
|
const box = dlgAt(e);
|
|
2301
|
+
const bubble = bubbleAtEvent(e);
|
|
2302
|
+
if (bubble && bubble.reply && chat) { if (talkTo !== bubble.name) setTalkTo(bubble.name); chat.advance(bubble.name); return; }
|
|
2303
|
+
if ((box || bubble) && !shared && onOpen) {
|
|
2304
|
+
if (!(e.detail > 1)) { setCard(null); open((box || bubble).name); }
|
|
2305
|
+
return;
|
|
2306
|
+
}
|
|
1528
2307
|
if (box) { focusPerson(box.key); return; }
|
|
1529
|
-
|
|
1530
|
-
|
|
2308
|
+
if (showSnacks && armedSnack) {
|
|
2309
|
+
const snack = snacksById.get(armedSnack);
|
|
2310
|
+
if (snack) {
|
|
2311
|
+
const hit = deskOf(e) || (lastType.current === "touch" ? nearOf(e) : null);
|
|
2312
|
+
if (hit && hit.node && hit.node.i) {
|
|
2313
|
+
if (!ASLEEP.has(hit.node.state) && !hit.night) {
|
|
2314
|
+
const at = (zones && walkers.at(hit.node.name, now())) || hit.seat || { x: hit.x + hit.w / 2, y: hit.y + hit.h };
|
|
2315
|
+
feedPerson(hit.node.name, snack, at);
|
|
2316
|
+
}
|
|
2317
|
+
setArmedSnack(null);
|
|
2318
|
+
return;
|
|
2319
|
+
}
|
|
2320
|
+
const w = pointOf(e);
|
|
2321
|
+
if (w && w.x >= 0 && w.x <= L.width && w.y >= 0 && w.y <= L.height) {
|
|
2322
|
+
placeSnackAt(snack, w);
|
|
2323
|
+
setArmedSnack(null);
|
|
2324
|
+
return;
|
|
2325
|
+
}
|
|
2326
|
+
}
|
|
2327
|
+
}
|
|
2328
|
+
const d = deskOf(e) || (lastType.current === "touch" ? nearOf(e) : null);
|
|
2329
|
+
if (!d || !d.node.i) { if (enterTile(e)) return; setTip(null); setCard(null); return; }
|
|
1531
2330
|
if (lastType.current === "touch") setTip(null);
|
|
1532
2331
|
cardFrom.current = null;
|
|
1533
2332
|
setCard((cur) => (cur === d.key ? null : d.key));
|
|
1534
2333
|
};
|
|
1535
|
-
|
|
2334
|
+
/** All offices: a click on a tile (off its people) enters that office for this visit; the lobby is no office. */
|
|
2335
|
+
const enterTile = (e) => {
|
|
2336
|
+
const s = scene.current, w = pointOf(e);
|
|
2337
|
+
if (!overview || !s || !s.overview || !w || deskOf(e)) return false;
|
|
2338
|
+
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;
|
|
2339
|
+
if (!tl || tl.lobby) return false;
|
|
2340
|
+
setCard(null); pick(tl.key, false);
|
|
2341
|
+
return true;
|
|
2342
|
+
};
|
|
2343
|
+
// All offices: a double-click on a tile (off its people) opens that office, as one click does.
|
|
1536
2344
|
const onDblClick = (e) => {
|
|
1537
2345
|
const box = dlgAt(e);
|
|
1538
|
-
if (box
|
|
2346
|
+
if (box || bubbleAtEvent(e)) return; // the first click already opened it
|
|
1539
2347
|
const s = scene.current, w = pointOf(e), hit = deskOf(e);
|
|
1540
2348
|
if (hit && hit.node.i) { setCard(null); open(hit.node.name); return; } // #2661: a person's chat, past the card
|
|
1541
2349
|
if (!overview || !s || !s.overview || !w || hit) return;
|
|
@@ -1549,8 +2357,9 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1549
2357
|
|
|
1550
2358
|
const auto = !custom && !overview;
|
|
1551
2359
|
// 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
|
-
|
|
2360
|
+
// editor is open, nor a second session (nor in All offices: custom is null there; nor in the carousel: the slide is
|
|
2361
|
+
// a stored office but Edit waits).
|
|
2362
|
+
const canLayout = canEdit && storedRev !== null && !!custom && zones && !loading && baseSkin.id === custom.skin && !editing && !layout && !carouselPick;
|
|
1554
2363
|
const openLayout = () => {
|
|
1555
2364
|
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
2365
|
setTip(null);
|
|
@@ -1583,12 +2392,36 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1583
2392
|
const teamValue = (opts.find((o) => o.team === f.team) || opts[0]).value;
|
|
1584
2393
|
const setF = (next) => { const v = filterOk(next); store.saveFilter(v); setFilter(v); };
|
|
1585
2394
|
// While Edit layout is open the office stays (its picker is disabled; this is the guard behind it).
|
|
1586
|
-
|
|
2395
|
+
/** The switcher's pick (kept per device); `keep` false: a tile entered from All offices, for this visit only. */
|
|
2396
|
+
const pick = (id, keep = true) => {
|
|
2397
|
+
if (layoutRef.current) return;
|
|
2398
|
+
if (id === CAROUSEL_ID) {
|
|
2399
|
+
const cur = store.carousel();
|
|
2400
|
+
const ids = carouselIdsOk(cur ? cur.ids : null, stored);
|
|
2401
|
+
const next = { ids: ids.length ? ids : stored.map((o) => o.id), interval: intervalOk(cur && cur.interval) };
|
|
2402
|
+
store.saveCarousel(next); setCarSaved(next); setCarIndex(0); setCarPlaying(true);
|
|
2403
|
+
}
|
|
2404
|
+
if (keep) store.saveChoice(id);
|
|
2405
|
+
setChoice(id); setTip(null);
|
|
2406
|
+
};
|
|
2407
|
+
const setCarIds = (ids) => {
|
|
2408
|
+
const next = { ids, interval: intervalOk(carSaved && carSaved.interval) };
|
|
2409
|
+
store.saveCarousel(next); setCarSaved(next);
|
|
2410
|
+
};
|
|
2411
|
+
const toggleCarId = (id) => {
|
|
2412
|
+
const have = new Set(carIds);
|
|
2413
|
+
if (have.has(id)) have.delete(id); else have.add(id);
|
|
2414
|
+
setCarIds(stored.map((o) => o.id).filter((x) => have.has(x)));
|
|
2415
|
+
};
|
|
2416
|
+
const setCarInterval = (n) => {
|
|
2417
|
+
const next = { ids: carSaved && Array.isArray(carSaved.ids) ? carSaved.ids : carIds, interval: intervalOk(n) };
|
|
2418
|
+
store.saveCarousel(next); setCarSaved(next);
|
|
2419
|
+
};
|
|
1587
2420
|
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
2421
|
const tipText = tipDesk ? nodeText(tipDesk.node) : null;
|
|
1589
2422
|
// #2661: the card's person (gone from the office, filtered out or the office changed: it closes).
|
|
1590
2423
|
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;
|
|
2424
|
+
cardDesk.current = cardOf ? { name: cardOf.node.name, box: cardOf.box, walks: zones && !overview, skin: cardOf.skin } : null;
|
|
1592
2425
|
useEffect(() => { if (card && !cardOf) setCard(null); }, [card, !!cardOf]);
|
|
1593
2426
|
const closeCard = () => {
|
|
1594
2427
|
setCard(null);
|
|
@@ -1621,14 +2454,15 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1621
2454
|
setView(centreOn({ ...v, k }, size, at.x, at.y));
|
|
1622
2455
|
};
|
|
1623
2456
|
/** The card's picture: the person's idle frame in the office's style (pack strip or built-in figure). */
|
|
1624
|
-
const drawAvatar = (cv) => {
|
|
2457
|
+
const drawAvatar = (cv, sizePx = 56) => {
|
|
1625
2458
|
const s = scene.current, c = cardOf;
|
|
1626
2459
|
const g = cv && cv.getContext ? cv.getContext("2d") : null;
|
|
1627
2460
|
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; }
|
|
2461
|
+
const r = deviceRatio(), W = Number(sizePx) || 56;
|
|
2462
|
+
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
2463
|
g.setTransform(1, 0, 0, 1, 0, 0); g.clearRect(0, 0, cv.width, cv.height); g.imageSmoothingEnabled = false;
|
|
1631
|
-
|
|
2464
|
+
// The card's avatar: the set's still `stand` when it has one (poseStrip falls back to idle).
|
|
2465
|
+
const look = { ...c.look, pose: "stand", dim: false, match: false, badge: null, notag: true, free: true, work: 0, sign: null };
|
|
1632
2466
|
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
2467
|
const k = Math.min((W - 8) / box.w, (W - 8) / box.h) * r;
|
|
1634
2468
|
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,78 +2473,204 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1639
2473
|
const miniRects = overview ? arranged.tiles.map((tt) => ({ key: tt.key, x: tt.x, y: tt.y, w: tt.w, h: tt.h }))
|
|
1640
2474
|
: 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
2475
|
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}
|
|
2476
|
+
// The switcher: the whole fleet, All offices (two or more stored), Carousel (two or more, signed-in), each stored office.
|
|
2477
|
+
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
2478
|
aria-label=${to("office")} onChange=${(e) => pick(e.target.value)}>
|
|
1645
2479
|
<option value=${AUTO_ID}>${to("allOffice")}</option>
|
|
1646
2480
|
${overviewOk(stored) ? html`<option value=${ALL_ID}>${to("allOffices")}</option>` : null}
|
|
2481
|
+
${opening == null && carouselOk(stored) ? html`<option value=${CAROUSEL_ID}>${to("carousel")}</option>` : null}
|
|
1647
2482
|
${stored.map((o) => html`<option key=${o.id} value=${o.id}>${o.name}</option>`)}
|
|
1648
2483
|
</select>`;
|
|
1649
|
-
|
|
1650
|
-
<
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
2484
|
+
const carChrome = () => !carousel ? null : html`<button type="button" class="btn btn-sm oo-car-pause" onClick=${() => setCarPlaying((p) => !p)}>${to(carPlaying ? "pause" : "resume")}</button>
|
|
2485
|
+
<button type="button" class="btn btn-sm oo-car-next" onClick=${() => stepCar(1)}>${to("next")}</button>
|
|
2486
|
+
<span class="muted oo-car-now">${custom ? custom.name : ""} · ${to(carPlaying ? "playing" : "paused")}</span>`;
|
|
2487
|
+
// M-3253: the zone pills (a phone, one office on a zones style): the whole office, or an area at ZONE_K, centred.
|
|
2488
|
+
const zoneList = compact && zones && !overview && !layout ? Object.entries(L.areas || {}).map(([key, a]) => ({ key, rect: a.rect,
|
|
2489
|
+
n: people.filter((d) => d.area === areaName(key)).length })).filter((z) => z.rect && z.n > 0) : [];
|
|
2490
|
+
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)); };
|
|
2491
|
+
const closeMore = () => onMore && onMore(false);
|
|
2492
|
+
// M-3556: Display options (style, the toggles, the key) in a dropdown on a desk — non-modal, like Members: the office
|
|
2493
|
+
// stays in view, so a tick shows at once; a click elsewhere or Esc closes it. The Fleet office opens it from ⚙ in its
|
|
2494
|
+
// bar (open here); a Hub room's office (foldBar) from the gear in the zoom stack, open as its page says (`more`).
|
|
2495
|
+
const roomGear = folded && !compact;
|
|
2496
|
+
const [displayOpen, setDisplayOpen] = useState(false);
|
|
2497
|
+
const dispOpen = roomGear ? !!more : displayOpen;
|
|
2498
|
+
const setDisp = (v) => (roomGear ? onMore(v) : setDisplayOpen(v));
|
|
2499
|
+
const displayRef = useRef(null);
|
|
2500
|
+
useEffect(() => {
|
|
2501
|
+
if (!dispOpen) return undefined;
|
|
2502
|
+
const away = (e) => { if (displayRef.current && !displayRef.current.contains(e.target)) setDisp(false); };
|
|
2503
|
+
// Esc from inside it hands focus back to its button (as the sheet did), so the keyboard is not left on nothing.
|
|
2504
|
+
const esc = (e) => {
|
|
2505
|
+
if (e.key !== "Escape") return;
|
|
2506
|
+
const box = displayRef.current, back = !!box && typeof box.contains === "function" && box.contains(globalThis.document?.activeElement);
|
|
2507
|
+
setDisp(false);
|
|
2508
|
+
if (back) box.querySelector("button")?.focus?.();
|
|
2509
|
+
};
|
|
2510
|
+
document.addEventListener("pointerdown", away); document.addEventListener("keydown", esc);
|
|
2511
|
+
return () => { document.removeEventListener("pointerdown", away); document.removeEventListener("keydown", esc); };
|
|
2512
|
+
}, [dispOpen]);
|
|
2513
|
+
// M-3556: the phone sheet is taller than a phone: while more is below its fold, its foot fades (data-more on the body).
|
|
2514
|
+
useEffect(() => {
|
|
2515
|
+
if (!compact || !more) return undefined;
|
|
2516
|
+
const el = globalThis.document?.querySelector?.(".oo-sheet .dlg-body");
|
|
2517
|
+
if (!el || typeof el.addEventListener !== "function") return undefined;
|
|
2518
|
+
const upd = () => { const below = el.scrollTop + el.clientHeight < el.scrollHeight - 2; if (below) el.setAttribute("data-more", ""); else el.removeAttribute("data-more"); };
|
|
2519
|
+
const raf = globalThis.requestAnimationFrame ? globalThis.requestAnimationFrame(upd) : (upd(), 0);
|
|
2520
|
+
el.addEventListener("scroll", upd, { passive: true }); globalThis.addEventListener?.("resize", upd);
|
|
2521
|
+
// Its content can change while it is open (another office, All offices' lobby tile, a note): re-measure then too
|
|
2522
|
+
// (Prism #3556 r3 P3).
|
|
2523
|
+
const RO = globalThis.ResizeObserver, ro = typeof RO === "function" ? new RO(upd) : null;
|
|
2524
|
+
if (ro) { ro.observe(el); for (const c of el.children || []) ro.observe(c); }
|
|
2525
|
+
return () => { globalThis.cancelAnimationFrame?.(raf); el.removeEventListener("scroll", upd); globalThis.removeEventListener?.("resize", upd); ro?.disconnect(); };
|
|
2526
|
+
}, [compact, more]);
|
|
2527
|
+
// In the sheet: Edit offices and Edit layout open their own editors (outside it): the sheet closes after their click.
|
|
2528
|
+
const sheetClick = (e) => { if (typeof e.target?.closest === "function" && e.target.closest(".oo-edit, .oo-layout")) closeMore(); };
|
|
2529
|
+
const tile = (icon, label, fn, cls, pressed) => html`<button type="button" class=${`oo-sheet-tile ${cls}`} aria-pressed=${pressed === undefined ? undefined : pressed ? "true" : "false"}
|
|
2530
|
+
onClick=${fn}><${Icon} name=${icon} size=${20} /><span>${label}</span></button>`;
|
|
2531
|
+
// M-3556: the bar in three groups — scope (which office, whom: left of the desk's one row), the display options (behind
|
|
2532
|
+
// ⚙) and the actions (right). A phone's ⋯ sheet lists all three in that order.
|
|
2533
|
+
const scopeItems = html`
|
|
2534
|
+
${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}
|
|
2535
|
+
${oneOffice ? null : html`<label class="oo-pick"><span class="oo-pick-label">${to("office")}</span>${officeSelect("oo-office")}</label>`}
|
|
1657
2536
|
${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 : "" }); }}>
|
|
2537
|
+
<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
2538
|
${opts.map((o) => html`<option key=${o.value} value=${o.value}>${o.label}</option>`)}
|
|
1660
2539
|
</select></label>
|
|
1661
2540
|
<${People} nodes=${everyone} pinned=${f.pinned} onChange=${(pinned) => setF({ ...f, pinned })} />` : null}
|
|
2541
|
+
${carouselPick ? html`<div class="oo-carousel">
|
|
2542
|
+
<${CarouselOffices} stored=${stored} carIds=${carIds} open=${carMenu} onOpen=${setCarMenu} onToggle=${toggleCarId}
|
|
2543
|
+
onAll=${() => setCarIds(stored.map((o) => o.id))} onNone=${() => setCarIds([])} />
|
|
2544
|
+
<label class="oo-pick"><span class="oo-pick-label">${to("interval")}</span>
|
|
2545
|
+
<select class="tb-select oo-car-interval" value=${String(intervalOk(carSaved && carSaved.interval))} onChange=${(e) => setCarInterval(Number(e.target.value))}>
|
|
2546
|
+
${INTERVALS.map((n) => html`<option key=${n} value=${n}>${n < 60 ? to("intervalSec", n) : to("intervalMin", n / 60)}</option>`)}
|
|
2547
|
+
</select></label>
|
|
2548
|
+
${carChrome()}
|
|
2549
|
+
</div>` : null}
|
|
2550
|
+
${custom && baseSkin.id !== custom.skin && !loading ? html`<span class="muted oo-note">${to("skinUnknown", styleName(custom.skin))}</span>` : null}
|
|
2551
|
+
${placed.ignored ? html`<span class="muted oo-note">${to("layoutIgnored")}</span>` : null}
|
|
2552
|
+
${L.unseated ? html`<span class="muted oo-note">${to("unseated", L.unseated)}</span>` : null}
|
|
2553
|
+
`;
|
|
2554
|
+
const optionItems = html`
|
|
2555
|
+
${auto ? html`<label class="oo-pick"><span class="oo-pick-label">${to("styleLabel")}</span>
|
|
2556
|
+
<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)}>
|
|
2557
|
+
${styles.map((id) => html`<option key=${id} value=${id}>${to(`style_${id}`)}</option>`)}
|
|
2558
|
+
${packs.map((pk) => html`<option key=${`pack:${pk.id}`} value=${pk.id}>${pk.name}</option>`)}
|
|
2559
|
+
</select></label>` : null}
|
|
1662
2560
|
<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>
|
|
2561
|
+
${zones && !overview && !shared ? html`<label class="check oo-play"><input type="checkbox" checked=${playOn && !still} disabled=${still}
|
|
2562
|
+
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
2563
|
${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
2564
|
<label class="check oo-dialogue" title=${to("dialogueTitle")}><input type="checkbox" checked=${dialogueOn} onChange=${toggleDialogue} /><span>${to("dialogue")}</span></label>
|
|
2565
|
+
${chat && !shared ? html`<label class="oo-pick oo-talk-pick" title=${chatUi.talkWord("modeTitle")}><span class="oo-pick-label">${chatUi.talkWord("mode")}</span>
|
|
2566
|
+
<select class="tb-select oo-talk-mode" value=${tmode} onChange=${(e) => pickTalkMode(e.target.value)}>
|
|
2567
|
+
${chatUi.TALK_MODES.map((m) => html`<option key=${m} value=${m}>${chatUi.talkWord(m)}</option>`)}
|
|
2568
|
+
</select></label>` : null}
|
|
1665
2569
|
${overview ? html`<label class="check oo-lobby-tile" title=${lobbyAll.length ? undefined : to("lobbyEveryone")}><input type="checkbox" checked=${lobbyOn && lobbyAll.length > 0}
|
|
1666
2570
|
disabled=${!lobbyAll.length} onChange=${() => { const v = !lobbyOn; store.saveLobbyTile(v); setLobbyOn(v); setTip(null); }} /><span>${to("lobbyTile")}</span></label>
|
|
1667
2571
|
${lobbyAll.length ? null : html`<span class="muted oo-note oo-lobby-none">${to("lobbyEveryone")}</span>`}` : null}
|
|
1668
|
-
${
|
|
1669
|
-
|
|
2572
|
+
${traffic ? html`<label class="check oo-key-tick" title=${to("keyTitle")}><input type="checkbox" checked=${keyOpen}
|
|
2573
|
+
onChange=${() => { const v = !keyOpen; store.saveKeyOpen(v); setKeyOpen(v); }} /><span>${to("key")}</span></label>` : null}
|
|
1670
2574
|
${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}
|
|
2575
|
+
`;
|
|
2576
|
+
const actionItems = html`
|
|
2577
|
+
${canEdit && storedRev !== null ? html`<button type="button" class="btn btn-sm oo-edit" onClick=${() => { if (!overview && !carouselPick) setEditing(true); }} disabled=${!!layout || overview || carouselPick}
|
|
2578
|
+
title=${overview || carouselPick ? to(carouselPick ? "carouselNoEdit" : "overviewNoEdit") : undefined}>${t("orge.edit")}</button>` : null}
|
|
1676
2579
|
${canLayout ? html`<button type="button" class="btn btn-sm oo-layout" onClick=${openLayout}>${t("orgl.edit")}</button>` : null}
|
|
1677
2580
|
${canShare ? html`<${ShareButton} offices=${stored} current=${overview ? "all" : custom ? custom.id : null} disabled=${!!layout}
|
|
1678
2581
|
get=${lease ? (path, o) => lease.fetch(path, o) : undefined} />` : null}
|
|
1679
|
-
|
|
2582
|
+
`;
|
|
2583
|
+
// The sheet: a "Display options" heading over the options (a Hub room's too), a rule before the actions (a room has none).
|
|
2584
|
+
const hasActions = (canEdit && storedRev !== null) || canLayout || canShare;
|
|
2585
|
+
const barItems = html`${scopeItems}<h3 class="oo-sheet-h">${to("display")}</h3>${optionItems}
|
|
2586
|
+
${hasActions ? html`<hr class="oo-sheet-rule" />` : null}${actionItems}`;
|
|
2587
|
+
// A room's dropdown hangs from the zoom stack's top, inside the stage (which clips): it is never taller than the
|
|
2588
|
+
// stage's room below its top (Prism #3556 P2: a 340 px stage); a longer list scrolls.
|
|
2589
|
+
const fitPop = (el) => {
|
|
2590
|
+
if (!el || !roomGear || !stageRef.current || typeof el.getBoundingClientRect !== "function") return;
|
|
2591
|
+
const st = stageRef.current.getBoundingClientRect(), top = el.getBoundingClientRect().top;
|
|
2592
|
+
if (st && st.height > 0) el.style.maxHeight = `${popMaxHeight(st.bottom, top)}px`;
|
|
2593
|
+
};
|
|
2594
|
+
const displayMenu = (opener) => html`<div class=${`oo-display${roomGear ? " oo-display-zoom" : ""}`} ref=${displayRef}>${opener}
|
|
2595
|
+
${dispOpen ? html`<div class="oo-display-pop" role="group" aria-label=${to("display")} ref=${fitPop}><h3 class="oo-display-h">${to("display")}</h3>
|
|
2596
|
+
<div class="oo-bar oo-display-list">${optionItems}</div></div>` : null}</div>`;
|
|
2597
|
+
return html`<div class=${`oo${fs ? ` fs ${fs}` : ""}${compact ? " phone" : ""}${dockShown ? " has-dialogue" : ""}${sidePanel && !phone ? " ot-side" : ""}`} ref=${ooRef}>
|
|
2598
|
+
${folded ? null : html`<div class="oo-bar oo-bar-row">
|
|
2599
|
+
<div class="oo-bar-scope">${scopeItems}</div>
|
|
2600
|
+
<div class="oo-bar-actions">${actionItems}
|
|
2601
|
+
${displayMenu(html`<button type="button" class=${`btn btn-sm oo-display-btn${dispOpen ? " on" : ""}`} aria-expanded=${dispOpen ? "true" : "false"}
|
|
2602
|
+
onClick=${() => setDisp(!dispOpen)}><${Icon} name="settings" size=${14} /><span>${to("display")}</span></button>`)}
|
|
2603
|
+
</div>
|
|
2604
|
+
</div>`}
|
|
2605
|
+
${compact && more ? html`<${Dialog} title=${to("office")} cls="oo-sheet" onClose=${closeMore}>
|
|
2606
|
+
${compact ? html`<div class="oo-sheet-tiles">
|
|
2607
|
+
${tile("fitwidth", to("fit"), () => { closeMore(); fit(); }, "oo-sheet-fit")}
|
|
2608
|
+
${tile("fitwidth", to("fill"), toggleFill, "oo-sheet-fill", fitMode === "cover")}
|
|
2609
|
+
${tile("fullscreen", to("fullscreen"), () => { closeMore(); enterFs(); }, "oo-sheet-fs")}
|
|
2610
|
+
</div>` : null}
|
|
2611
|
+
${typeof onLive === "function" ? html`<label class="check oo-sheet-live"><input type="checkbox" checked=${!!live} onChange=${() => onLive(!live)} /><span>${t("orgc.live")}</span></label>` : null}
|
|
2612
|
+
<div class="oo-bar oo-sheet-bar" onClick=${sheetClick}>${barItems}</div>
|
|
2613
|
+
</${Dialog}>` : null}
|
|
1680
2614
|
${traffic && keyOpen ? html`<${OfficeKey} pal=${pal} />` : null}
|
|
1681
|
-
${editing && !overview ? html`<${OfficeEditor} offices=${stored} rev=${storedRev} view=${view} store=${store} packs=${packs}
|
|
2615
|
+
${editing && !overview && !carouselPick ? html`<${OfficeEditor} offices=${stored} rev=${storedRev} view=${view} store=${store} packs=${packs}
|
|
1682
2616
|
ask=${ask} current=${() => shown.current} onSaved=${adopt} onClose=${() => setEditing(false)} />` : null}
|
|
1683
2617
|
${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=${
|
|
2618
|
+
<div class=${`oo-stage${layout ? " editing" : ""}`} ref=${stageRef} onPointerDown=${onDown} onPointerMove=${onStageMove} onPointerUp=${onStageUp} onPointerCancel=${onStageCancel}
|
|
1685
2619
|
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")}
|
|
2620
|
+
${dlgOn ? html`<div class="sr-only oo-dialogue-live" aria-live="polite">${dlgSay}</div>` : null}
|
|
2621
|
+
<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
2622
|
onPointerMove=${onMove} onPointerLeave=${() => setTip(null)} onClick=${onClick} ondblclick=${onDblClick}></canvas>
|
|
2623
|
+
${tmode === "box" ? html`<${chatUi.TalkStage} peek=${stagePeek} ops=${stageOps} talk=${chat} read=${readMode} onRead=${pickRead} phone=${phone} still=${still}
|
|
2624
|
+
onFull=${openFull} onClose=${() => { dlg.skip(); setTalkTo(null); dlgWake(); }} />` : null}
|
|
1689
2625
|
${overview ? tiles.map((tl) => {
|
|
1690
2626
|
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
2627
|
return tl.lobby ? html`<span key=${tl.key} ref=${at} class="oo-tile-label lobby">${text}</span>`
|
|
1692
2628
|
: 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>`;
|
|
2629
|
+
onClick=${() => pick(tl.key, false)}>${text}</button>`;
|
|
1694
2630
|
}) : null}
|
|
1695
2631
|
${layout ? html`<${LayoutEditor} key=${layout.id} base=${layout.base} start=${layout.start} place=${placeOverlay} dock=${!fs} members=${layoutMembers}
|
|
1696
2632
|
stale=${layoutStale ? t("orgl.stale") : ""} onChange=${onDraft} onSave=${saveLayout} onClose=${closeLayout} />` : null}
|
|
1697
2633
|
${tipText && tip !== card ? html`<div ref=${tipRef} class="oo-tip" role="tooltip">
|
|
1698
2634
|
<strong>${tipText.primary}</strong>${tipText.secondary ? html` <span class="muted mono">${tipText.secondary}</span>` : null}
|
|
1699
|
-
<div>${tipText.sub}</div
|
|
2635
|
+
<div>${words ? stateOf(tipDesk.node) : tipText.sub}</div>${nowOf(tipDesk.node) ? html`<div class="muted">${nowOf(tipDesk.node)}</div>` : null}
|
|
1700
2636
|
${tipDesk.office ? html`<div class="muted oo-tip-office">${tipDesk.office}</div>` : null}
|
|
1701
2637
|
</div>` : null}
|
|
1702
2638
|
${cardOf ? html`<${OfficeCard} key=${cardOf.key}
|
|
1703
|
-
model=${cardModel({ node: cardOf.node, lv, levels: wordsOf(cardOf.skin), share: !onOpen,
|
|
1704
|
-
state:
|
|
2639
|
+
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) : "",
|
|
2640
|
+
state: stateOf(cardOf.node), now: nowOf(cardOf.node),
|
|
1705
2641
|
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
|
-
|
|
2642
|
+
avatar=${drawAvatar} sheet=${phone || size.w < SHEET_W} place=${(el) => { const was = cardEl.current; cardEl.current = el; placeCard();
|
|
2643
|
+
// #4379 review: the tags it covers (or uncovers) are judged at the next frame; a still scene draws one now.
|
|
2644
|
+
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(); } }}
|
|
2645
|
+
onChat=${onOpen ? () => { const n = cardOf.node.name; setCard(null); open(n); } : null} onFind=${findCard} onClose=${closeCard}
|
|
2646
|
+
onReact=${play ? (kind) => {
|
|
2647
|
+
const n = cardOf.node.name;
|
|
2648
|
+
if (kind === "feed" && !ASLEEP.has(cardOf.node.state) && !cardOf.box.night) {
|
|
2649
|
+
const sn = (armedSnack && snacksById.get(armedSnack)) || packSnacks[0] || null;
|
|
2650
|
+
if (sn || (skin.eatStrip && skin.eatStrip(n))) {
|
|
2651
|
+
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 };
|
|
2652
|
+
snacks.feed(n, sn, { x: at.x, y: at.y, t: now(), charEatStrip: skin.eatStrip ? skin.eatStrip(n) : null });
|
|
2653
|
+
walkNow.current?.();
|
|
2654
|
+
}
|
|
2655
|
+
}
|
|
2656
|
+
// A pat with the set's `pat` strip lasts one full pass of it (never shorter than the hearts).
|
|
2657
|
+
const t0 = now(), patSt = kind === "pat" && skin.patStrip ? skin.patStrip(n) : null;
|
|
2658
|
+
reacts.current.set(n, { kind, t0, ...(patSt ? { until: t0 + Math.max(PLAY.REACT_MS, stripDurationMs(patSt)) } : {}) });
|
|
2659
|
+
loop.current?.wake(); if (store.tellOn(n)) void store.tell(n, kind);
|
|
2660
|
+
} : null}
|
|
2661
|
+
tell=${play ? { on: store.tellOn(cardOf.node.name), set: (v) => { store.saveTell(cardOf.node.name, v); setTellRev((x) => x + 1); } } : null}
|
|
2662
|
+
packCard=${cardOf.skin?.pack?.card || null}
|
|
2663
|
+
picture=${typeof cardOf.skin?.picture === "function" ? cardOf.skin.picture : null}
|
|
2664
|
+
portrait=${cardOf.skin?.pack ? portraitSrc(cardOf.skin.pack, { agent: cardOf.node.name, state: cardOf.node.state }) : null}
|
|
2665
|
+
packScale=${cardOf.skin?.pack?.scale || 2} action=${cardAction ? cardAction(cardOf.node.name) : null}
|
|
2666
|
+
photo=${cardPhoto ? cardPhoto(cardOf.node.name) : null} />` : null}
|
|
1708
2667
|
<ul class="oo-desks" aria-label=${to("desks")}>${people.map((d) => {
|
|
1709
|
-
const nt = nodeText(d.node), cap =
|
|
2668
|
+
const nt = nodeText(d.node), cap = nowOf(d.node), where = d.office ? ` · ${d.office}` : "";
|
|
2669
|
+
const full = words ? `${nt.primary} — ${stateOf(d.node)}` : nt.full;
|
|
1710
2670
|
return html`<li key=${d.key}>${d.node.i
|
|
1711
|
-
? html`<button type="button" class="oo-desk" data-name=${d.node.name} data-key=${d.key} aria-label=${`${
|
|
2671
|
+
? 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
2672
|
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}>${
|
|
2673
|
+
: html`<span class="oo-desk" data-name=${d.node.name} data-key=${d.key}>${full}</span>`}</li>`;
|
|
1714
2674
|
})}</ul>
|
|
1715
2675
|
<div class="oc-zoom oo-zoom" role="group" aria-label=${t("orgc.view")}>
|
|
1716
2676
|
<output ref=${pctRef} class="oo-zoom-pct"></output>
|
|
@@ -1720,8 +2680,28 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1720
2680
|
<button type="button" class=${`icon-btn oo-fill${fitMode === "cover" ? " on" : ""}`} aria-pressed=${fitMode === "cover" ? "true" : "false"} aria-label=${to("fillTitle")}
|
|
1721
2681
|
title=${to("fillTitle")} onClick=${toggleFill}>${to("fill")}</button>
|
|
1722
2682
|
<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>
|
|
2683
|
+
${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
2684
|
</div>
|
|
1724
|
-
${
|
|
2685
|
+
${showSnacks ? html`<div ref=${snackTrayRef} class="oo-snacks" role="toolbar" aria-label=${to("snacks")}>
|
|
2686
|
+
${packSnacks.map((sn) => {
|
|
2687
|
+
const lb = snackLabel(sn, lang());
|
|
2688
|
+
return html`<button key=${sn.id} type="button" class="icon-btn oo-snack" data-snack=${sn.id}
|
|
2689
|
+
aria-label=${to("snackArm", lb)} title=${lb} aria-pressed=${armedSnack === sn.id ? "true" : "false"}
|
|
2690
|
+
onPointerDown=${(e) => onSnackDown(sn, e)}
|
|
2691
|
+
onClick=${(e) => { e.stopPropagation(); if (snackSwallowRef.current) return; setArmedSnack((cur) => (cur === sn.id ? null : sn.id)); }}>
|
|
2692
|
+
<canvas class="oo-snack-icon" width="28" height="28" aria-hidden="true" ref=${paintSnackIcon(sn.sprite, 28)}></canvas>
|
|
2693
|
+
</button>`;
|
|
2694
|
+
})}
|
|
2695
|
+
</div>` : null}
|
|
2696
|
+
${snackDrag ? html`<div class="oo-snack-ghost" aria-hidden="true" ref=${(el) => {
|
|
2697
|
+
snackGhostRef.current = el;
|
|
2698
|
+
if (el && el.style && snackGhostPosRef.current) el.style.setProperty("transform", `translate(${snackGhostPosRef.current.x}px, ${snackGhostPosRef.current.y}px)`);
|
|
2699
|
+
}}>
|
|
2700
|
+
<canvas class="oo-snack-icon" width="28" height="28" ref=${paintSnackIcon(snackDrag.snack.sprite, 28)}></canvas>
|
|
2701
|
+
${snackDrag.kind === "feed" ? html`<span class="oo-snack-hint">${to("snackFeed", snackDrag.label)}</span>`
|
|
2702
|
+
: snackDrag.kind === "place" ? html`<span class="oo-snack-hint">${to("snackPlace")}</span>` : null}
|
|
2703
|
+
</div>` : null}
|
|
2704
|
+
${fs ? html`<div class="oo-fs-bar">${oneOffice ? null : officeSelect("oo-fs-office")}${carChrome()}</div>` : null}
|
|
1725
2705
|
<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
2706
|
<title>${to("overview")}</title>
|
|
1727
2707
|
<rect class="oo-mini-matte" x=${-L.width} y=${-L.height} width=${L.width * 3} height=${L.height * 3} fill=${matte} />
|
|
@@ -1731,5 +2711,17 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1731
2711
|
<rect ref=${miniViewRef} class="oc-mini-view oo-mini-view" />
|
|
1732
2712
|
</svg>
|
|
1733
2713
|
</div>
|
|
2714
|
+
${zoneList.length ? html`<div class="oo-zone-pills" role="group" aria-label=${to("zones")} ref=${pillsRef} onScroll=${pillsCue}>
|
|
2715
|
+
<button type="button" class="btn btn-sm oo-zone-all" onClick=${() => fit()}>${to("zoneAll")}</button>
|
|
2716
|
+
${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>`)}
|
|
2717
|
+
</div>` : null}
|
|
2718
|
+
${dockShown ? html`<canvas class="oo-dialogue-canvas" ref=${dialogueCanvasRef}
|
|
2719
|
+
role=${onOpen && !shared ? "button" : "img"} tabindex=${onOpen && !shared ? "0" : null}
|
|
2720
|
+
aria-label=${onOpen && !shared ? to("dlgOpenChat") : dlgSay} title=${onOpen && !shared ? to("dlgOpenChat") : null}
|
|
2721
|
+
onClick=${openDialogue} onKeyDown=${openDialogue}></canvas>` : null}
|
|
2722
|
+
${tmode === "bubble" ? html`<${chatUi.TalkBar} talk=${chat} name=${talkTo} label=${talkLabel} onFull=${openFull}
|
|
2723
|
+
read=${readMode} onRead=${pickRead} onSkip=${skipTalk} />` : null}
|
|
2724
|
+
${sidePanel ? html`<${chatUi.TalkPanel} talk=${chat} name=${talkTo} label=${talkLabel} state=${talkWho ? talkWho.node.state : null} stateLabel=${talkWho ? stateOf(talkWho.node) : null} sheet=${phone}
|
|
2725
|
+
onClose=${() => setTalkTo(null)} onFull=${openFull} top=${stageRef.current ? stageRef.current.offsetTop : null} />` : null}
|
|
1734
2726
|
</div>`;
|
|
1735
2727
|
}
|