@songsid/agend 2.4.0-beta.2 → 2.4.0-beta.20
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-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 +88 -7
- 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/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 +505 -13
- package/dist/fleet-manager.js +3157 -263
- 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 +71 -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 +332 -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 +63 -0
- package/dist/general-knowledge/skills/web-appearance/SKILL.md +29 -3
- package/dist/general-knowledge/skills/web-dashboard/SKILL.md +211 -40
- 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/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 +16 -0
- package/dist/hub/client.js +135 -12
- package/dist/hub/client.js.map +1 -1
- package/dist/hub/compose/member.d.ts +46 -5
- package/dist/hub/compose/member.js +344 -28
- package/dist/hub/compose/member.js.map +1 -1
- package/dist/hub/compose/server.d.ts +23 -0
- package/dist/hub/compose/server.js +128 -16
- package/dist/hub/compose/server.js.map +1 -1
- 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 +12 -0
- package/dist/hub/http/compose.js +633 -45
- package/dist/hub/http/compose.js.map +1 -1
- package/dist/hub/http/core.js +32 -2
- package/dist/hub/http/core.js.map +1 -1
- package/dist/hub/http/deps.d.ts +19 -0
- package/dist/hub/http/schema.js +44 -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 +1 -1
- 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/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 +134 -0
- package/dist/hub/member/room-post.js +267 -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 +1 -1
- package/dist/hub/policy.js +2 -0
- package/dist/hub/policy.js.map +1 -1
- package/dist/hub/protocol.d.ts +1101 -5
- package/dist/hub/protocol.js +111 -14
- 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 +5 -0
- package/dist/hub/representative.js +6 -1
- 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 +47 -10
- package/dist/hub/rooms/agents.js +344 -32
- 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 +10 -2
- package/dist/hub/rooms/direct-view.js +4 -4
- 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 +114 -0
- package/dist/hub/rooms/office.js +71 -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 +341 -6
- package/dist/hub/rooms/service.js +1022 -47
- package/dist/hub/rooms/service.js.map +1 -1
- package/dist/hub/rooms/types.d.ts +43 -4
- package/dist/hub/rooms.d.ts +13 -2
- package/dist/hub/rooms.js +97 -22
- 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 +148 -7
- package/dist/hub/server.js.map +1 -1
- package/dist/hub/session-directory-transition.d.ts +2 -1
- package/dist/hub/session-directory-transition.js +10 -3
- package/dist/hub/session-directory-transition.js.map +1 -1
- package/dist/hub/sessions.d.ts +1 -1
- package/dist/hub/sessions.js +26 -4
- 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-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 +167 -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-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 +283 -32
- 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 +36 -2
- package/dist/needs-you.js +16 -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 +24 -4
- package/dist/outbound-handlers.js +115 -11
- package/dist/outbound-handlers.js.map +1 -1
- package/dist/outbound-schemas.d.ts +30 -0
- package/dist/outbound-schemas.js +42 -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 +31 -0
- package/dist/task-board-tool.js +31 -0
- 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 +3 -0
- 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 +19 -7
- package/dist/ui/fleet-office-card.js +431 -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.js +3 -3
- package/dist/ui/fleet-office-editor.js +6 -1
- package/dist/ui/fleet-office-model.js +2 -1
- package/dist/ui/fleet-office-pack.d.ts +68 -1
- package/dist/ui/fleet-office-pack.js +418 -20
- package/dist/ui/fleet-office-play.js +491 -0
- package/dist/ui/fleet-office-skin.js +249 -33
- package/dist/ui/fleet-office-store.js +78 -2
- package/dist/ui/fleet-office-zones.js +132 -27
- package/dist/ui/fleet-office.js +993 -130
- 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 +99 -9
- 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-view.js +180 -40
- package/dist/ui/fleet-task-work.js +2 -2
- package/dist/ui/fleet-tasks.js +258 -130
- 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-strings.js +11 -3
- package/dist/ui/hub-client.js +120 -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 +166 -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 +161 -18
- 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 +127 -17
- 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 +202 -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 +5 -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 +86 -7
- package/dist/ui/hub-room-thread.js +436 -60
- package/dist/ui/hub-room-unread.js +2 -1
- 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 +418 -123
- package/dist/ui/panel-log.js +4 -4
- package/dist/ui/panel-needs.js +50 -22
- 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 +1005 -259
- 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 +31 -10
- 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 +118 -3
- package/dist/ui/shared/hub-roles.css +99 -0
- package/dist/ui/shared/hub-rooms-u2.css +95 -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 +12 -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 +408 -10
- 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 +57 -6
- package/dist/web-api.js +1021 -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 +7 -2
- package/dist/web-office-skins.js +42 -16
- package/dist/web-office-skins.js.map +1 -1
- package/dist/web-office-store.d.ts +2 -0
- package/dist/web-office-store.js +15 -3
- 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, 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 } 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
90
|
import { OK_MAX, OK_MIN, clampPan, desksK, 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,7 +102,7 @@ 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",
|
|
@@ -101,11 +111,20 @@ register("orgo", {
|
|
|
101
111
|
key: "Key", keyTitle: "What the items carried between desks are", keyLabel: "Carried between desks",
|
|
102
112
|
keyTask: "Folder: a task", keySend: "Envelope: a message", keyReport: "Paper: a report", keyBroadcast: "Horn: a broadcast",
|
|
103
113
|
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",
|
|
114
|
+
carousel: "Carousel…", labelCarousel: "Carousel: each chosen office fills the screen in turn. Space pauses; ← and → step; F is fullscreen.",
|
|
115
|
+
carouselNoEdit: "Leave the carousel to edit offices or a layout", pause: "Pause", resume: "Play", next: "Next",
|
|
116
|
+
playing: "Playing", paused: "Paused", interval: "Interval", intervalSec: "{0} s", intervalMin: "{0} min",
|
|
117
|
+
officesInCarousel: "Offices in the carousel",
|
|
118
|
+
officesCount: "Carousel {0}/{1} offices ▾", selectAll: "Select all", selectNone: "Select none",
|
|
104
119
|
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}",
|
|
120
|
+
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
121
|
dlgBox: "Dialogue: {0}. Click for their card, double-click for their chat.",
|
|
122
|
+
zones: "Go to an area", zoneAll: "Whole office", zoneN: "{0} {1}",
|
|
123
|
+
snacks: "Snacks", snackFeed: "Feed {0}", snackPlace: "Place here",
|
|
124
|
+
snackArm: "{0}: drag onto someone to feed, or onto the floor to place; click to select",
|
|
107
125
|
},
|
|
108
126
|
"zh-TW": {
|
|
127
|
+
display: "顯示選項", playMotionOff: "已關閉:系統開了「減少動態效果」",
|
|
109
128
|
label: "辦公室:每個 team 是一間房間,每個 Agent 一張桌子;General 和未加入 team 的 Agent 在大廳。拖曳平移;滾輪、雙指、+ 和 − 縮放,0 顯示整個場景,F 切換全螢幕。",
|
|
110
129
|
office: "辦公室", allOffice: "整個 fleet", show: "顯示", allTeams: "所有 team", lobby: "大廳(General、未加入 team)", lobbyRoom: "大廳",
|
|
111
130
|
people: "成員", peopleN: "成員({0})", findPerson: "尋找成員", everyone: "顯示全部", nobody: "沒有符合這個篩選的成員。",
|
|
@@ -115,7 +134,7 @@ register("orgo", {
|
|
|
115
134
|
b_working: "處理中|打字中…|快好了|專心中|再測一次", b_idle: "喝茶中|隨時可以開工|伸個懶腰|有事找我嗎?",
|
|
116
135
|
b_paused: "Zzz…|晚點回來", b_stopped: "下班了|Zzz…", b_needs: "需要你!|有個問題|在這裡!",
|
|
117
136
|
b_crashed: "糟糕,當掉了|救命!", b_stuck: "嗯,卡住了?|還在想…",
|
|
118
|
-
hideAsleep: "隱藏暫停與停止的成員", nightOn: "0–6 點就寢:閒著的人去睡", layoutIgnored: "它儲存的配置不適用這個風格:以風格本身的配置顯示。",
|
|
137
|
+
options: "辦公室選項", hideAsleep: "隱藏暫停與停止的成員", nightOn: "0–6 點就寢:閒著的人去睡", playOn: "拖曳與摸頭", playStill: "開啟「減少動態效果」時關閉", layoutIgnored: "它儲存的配置不適用這個風格:以風格本身的配置顯示。",
|
|
119
138
|
styleForAll: "整個 fleet 的風格,所有人共用:每台裝置與分享連結都一樣", styleHere: "這個瀏覽器裡整個 fleet 的風格",
|
|
120
139
|
styleFailed: "風格沒有替所有人儲存({0})。", styleBusy: "變更太頻繁,請一分鐘後再試。",
|
|
121
140
|
fit: "顯示整個辦公室", overview: "總覽:點一下移到那裡", fullscreen: "全螢幕", exitFullscreen: "結束全螢幕",
|
|
@@ -124,18 +143,57 @@ register("orgo", {
|
|
|
124
143
|
key: "圖例", keyTitle: "桌子之間傳遞的物品代表什麼", keyLabel: "桌子之間傳遞的物品",
|
|
125
144
|
keyTask: "資料夾:任務", keySend: "信封:訊息", keyReport: "紙張:回報", keyBroadcast: "喇叭:廣播",
|
|
126
145
|
tileLabel: "{0}({1})", openOffice: "開啟辦公室「{0}」", lobbyTile: "大廳格(不在任何辦公室)", lobbyEveryone: "每個成員都已在某間辦公室", overviewNoEdit: "請先選一間辦公室,再編輯辦公室或配置",
|
|
146
|
+
carousel: "輪播…", labelCarousel: "輪播:每間勾選的辦公室輪流佔滿畫面。空白鍵暫停;← 與 → 切換;F 切換全螢幕。",
|
|
147
|
+
carouselNoEdit: "請先離開輪播,再編輯辦公室或配置", pause: "暫停", resume: "播放", next: "下一間",
|
|
148
|
+
playing: "播放中", paused: "已暫停", interval: "間隔", intervalSec: "{0} 秒", intervalMin: "{0} 分鐘",
|
|
149
|
+
officesInCarousel: "輪播的辦公室",
|
|
150
|
+
officesCount: "輪播 {0}/{1} 間 ▾", selectAll: "全選", selectNone: "全不選",
|
|
127
151
|
dialogue: "對話框", dialogueTitle: "有人傳訊息給這裡的成員時,在下方的對話框顯示訊息與回覆(只限這個瀏覽器)",
|
|
128
|
-
dlgWorking: "處理中…", dlgSomeone: "有人", dlgHeardShare: "傳了一則訊息給 {0}。", dlgAnsweredShare: "已回覆。", dlgFile: "(傳了一個檔案)", dlgSays: "{0}:{1}",
|
|
152
|
+
dlgOpenChat: "在新視窗開啟這個 Agent 的聊天", dlgWorking: "處理中…", dlgSomeone: "有人", dlgHeardShare: "傳了一則訊息給 {0}。", dlgAnsweredShare: "已回覆。", dlgFile: "(傳了一個檔案)", dlgSays: "{0}:{1}",
|
|
129
153
|
dlgBox: "對話框:{0}。點一下看資料卡,點兩下開啟聊天。",
|
|
154
|
+
zones: "移到區域", zoneAll: "總覽", zoneN: "{0} {1}",
|
|
155
|
+
snacks: "零食", snackFeed: "餵給 {0}", snackPlace: "放在這裡",
|
|
156
|
+
snackArm: "{0}:拖到成員身上餵食,或放到空地讓閒置成員過來搶;點一下可選取",
|
|
130
157
|
},
|
|
131
158
|
});
|
|
132
159
|
const to = (k, ...v) => t(`orgo.${k}`, ...v);
|
|
160
|
+
/**
|
|
161
|
+
* #4010 follow-up: the carousel's offices as one n/m button, not inline checkboxes (those wrap the bar at ~10).
|
|
162
|
+
* Esc and a click outside close it; Select all / Select none sit above the scrollable list.
|
|
163
|
+
*/
|
|
164
|
+
function CarouselOffices({ stored, carIds, open, onOpen, onToggle, onAll, onNone }) {
|
|
165
|
+
const wrap = useRef(null);
|
|
166
|
+
useEffect(() => {
|
|
167
|
+
if (!open) return undefined;
|
|
168
|
+
const doc = globalThis.document;
|
|
169
|
+
const key = (e) => { if (e.key === "Escape") { e.preventDefault(); e.stopPropagation(); onOpen(false); } };
|
|
170
|
+
const press = (e) => { if (wrap.current && !wrap.current.contains(e.target)) onOpen(false); };
|
|
171
|
+
doc?.addEventListener?.("keydown", key, true);
|
|
172
|
+
doc?.addEventListener?.("pointerdown", press, true);
|
|
173
|
+
return () => { doc?.removeEventListener?.("keydown", key, true); doc?.removeEventListener?.("pointerdown", press, true); };
|
|
174
|
+
}, [open]);
|
|
175
|
+
const n = carIds.length, m = stored.length;
|
|
176
|
+
return html`<div class="oo-car-pick" ref=${wrap}>
|
|
177
|
+
<button type="button" class="btn btn-sm oo-car-offices" aria-haspopup="true" aria-expanded=${open ? "true" : "false"}
|
|
178
|
+
aria-label=${to("officesInCarousel")} onClick=${() => onOpen(!open)}>${to("officesCount", n, m)}</button>
|
|
179
|
+
${open ? html`<div class="oo-car-menu" role="group" aria-label=${to("officesInCarousel")}>
|
|
180
|
+
<div class="oo-car-menu-acts">
|
|
181
|
+
<button type="button" class="btn btn-sm oo-car-all" onClick=${onAll}>${to("selectAll")}</button>
|
|
182
|
+
<button type="button" class="btn btn-sm oo-car-none" onClick=${onNone}>${to("selectNone")}</button>
|
|
183
|
+
</div>
|
|
184
|
+
<div class="oo-carousel-offices">${stored.map((o) => html`<label key=${o.id} class="check"><input type="checkbox" checked=${carIds.includes(o.id)}
|
|
185
|
+
onChange=${() => onToggle(o.id)} /><span>${o.name}</span></label>`)}</div>
|
|
186
|
+
</div>` : null}
|
|
187
|
+
</div>`;
|
|
188
|
+
}
|
|
133
189
|
const CAPTION = { working: "capWorking", idle: "capIdle", paused: "capPaused", needs: "capNeeds", walk: "capIdle", away: "capAway" };
|
|
134
190
|
/** States whose pose is shared but whose words are their own (a queued instance is not asleep). */
|
|
135
191
|
const CAPTION_OF_STATE = { starting: "capStarting", queued: "capQueued" };
|
|
136
192
|
/** What a pose says in words (the tooltip, the desk list); `state`, when its words differ from its pose's. */
|
|
137
193
|
export const caption = (pose, state) => to(CAPTION_OF_STATE[state] || CAPTION[pose] || "capIdle");
|
|
138
194
|
|
|
195
|
+
/** M-3556: the most a dropdown starting at `top` may be tall to end `margin` px above `bottom` (never under `min`). */
|
|
196
|
+
export const popMaxHeight = (bottom, top, margin = 8, min = 96) => Math.max(min, Math.floor(bottom - top - margin));
|
|
139
197
|
const reducedMotion = () => typeof matchMedia === "function" && matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
140
198
|
/** The device's ratio (CSS px → device px), kept sane. */
|
|
141
199
|
const deviceRatio = () => Math.max(0.5, Math.min(4, Number(globalThis.devicePixelRatio) || 1));
|
|
@@ -145,6 +203,26 @@ const SIZE0 = { w: 960, h: 600 };
|
|
|
145
203
|
const FIT_PAD = 60;
|
|
146
204
|
/** #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
205
|
const COMPACT_ROW = 12;
|
|
206
|
+
/** 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). */
|
|
207
|
+
const TAG_ROW = 16;
|
|
208
|
+
/** 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. */
|
|
209
|
+
const KEEP_CLEAR = ".oo-zoom, .oo-mini, .oo-stage > .oo-zone-pills";
|
|
210
|
+
/** 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. */
|
|
211
|
+
export function keepClearOf(cv, v) {
|
|
212
|
+
const root = cv && typeof cv.closest === "function" ? cv.closest(".oo") : null;
|
|
213
|
+
if (!root || typeof cv.getBoundingClientRect !== "function" || !(v.k > 0)) return [];
|
|
214
|
+
const c = cv.getBoundingClientRect(), out = [];
|
|
215
|
+
for (const el of root.querySelectorAll(KEEP_CLEAR)) {
|
|
216
|
+
const r = el.getBoundingClientRect();
|
|
217
|
+
if (!r.width || !r.height || r.right <= c.left || r.left >= c.right || r.bottom <= c.top || r.top >= c.bottom) continue;
|
|
218
|
+
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 });
|
|
219
|
+
}
|
|
220
|
+
return out;
|
|
221
|
+
}
|
|
222
|
+
/** Whether two boxes ({ x, y, w, h }) overlap. */
|
|
223
|
+
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;
|
|
224
|
+
/** M-3539: the box a person's figure covers where they are now (the skin's own, else the built-in figure's). */
|
|
225
|
+
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
226
|
/** #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
227
|
export const TAG_MIN_K = 0.75;
|
|
150
228
|
const PAN_KEYS = { ArrowLeft: [-1, 0], ArrowRight: [1, 0], ArrowUp: [0, -1], ArrowDown: [0, 1] };
|
|
@@ -176,6 +254,33 @@ const UP_MS = 1800;
|
|
|
176
254
|
const FIND_K = 2;
|
|
177
255
|
/** #2661: below this stage width (CSS px) the card is a bottom sheet. */
|
|
178
256
|
const SHEET_W = 560;
|
|
257
|
+
/**
|
|
258
|
+
* M-3253 (Argon's phone review): the Office's phone layout — a phone's width (the shell's), or a phone turned sideways (a
|
|
259
|
+
* coarse pointer in a short window: an iPhone's 956 × 440 is wider than 899 px). There the Office's tools are one ⋯ sheet,
|
|
260
|
+
* zone pills jump to a readable zoom, a tap near a person picks them, and their card is a bottom sheet.
|
|
261
|
+
*/
|
|
262
|
+
export const OFFICE_PHONE_Q = "(max-width: 899px), (pointer: coarse) and (max-height: 500px) and (max-width: 1023px)";
|
|
263
|
+
export function useOfficePhone() {
|
|
264
|
+
const read = () => { try { return typeof matchMedia === "function" && matchMedia(OFFICE_PHONE_Q).matches; } catch { return false; } };
|
|
265
|
+
const [on, setOn] = useState(read);
|
|
266
|
+
useEffect(() => {
|
|
267
|
+
if (typeof matchMedia !== "function") return undefined;
|
|
268
|
+
const mq = matchMedia(OFFICE_PHONE_Q), changed = () => setOn(!!mq.matches);
|
|
269
|
+
changed(); mq.addEventListener?.("change", changed);
|
|
270
|
+
return () => mq.removeEventListener?.("change", changed);
|
|
271
|
+
}, []);
|
|
272
|
+
return on;
|
|
273
|
+
}
|
|
274
|
+
/** 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. */
|
|
275
|
+
export const TAP_R = 22;
|
|
276
|
+
/** M-3253: a zone pill's zoom (CSS px a logical unit): the name tags at their own size. */
|
|
277
|
+
export const ZONE_K = 1;
|
|
278
|
+
/** M-3253: of `list` ({ x, y } in logical units), the one nearest (x, y) within `r` logical units, or null. */
|
|
279
|
+
export function nearestPerson(list, x, y, r) {
|
|
280
|
+
let best = null, bestD = r * r;
|
|
281
|
+
for (const it of list) { const d = (it.x - x) ** 2 + (it.y - y) ** 2; if (d <= bestD) { bestD = d; best = it; } }
|
|
282
|
+
return best;
|
|
283
|
+
}
|
|
179
284
|
/** How often the picture can change when nothing is in the air (the poses loop at 4 fps; a bubble types faster). */
|
|
180
285
|
const FPS = 12;
|
|
181
286
|
const STYLES = BUILT_IN_SKINS;
|
|
@@ -220,7 +325,7 @@ function looksOf(L, work, q, mode, zones, badge = () => null) {
|
|
|
220
325
|
// At night (#2568) the idle are drawn asleep (their state stays idle: the tooltip and the list say so).
|
|
221
326
|
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
327
|
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) }];
|
|
328
|
+
badge: badge(n.name), fit: n.i && n.i.tag_fit && typeof n.i.tag_fit === "object" ? n.i.tag_fit : null }];
|
|
224
329
|
}));
|
|
225
330
|
}
|
|
226
331
|
/** A stored office's own layout on a zones style (its overrides); `ignored`: they do not fit this style. */
|
|
@@ -283,7 +388,7 @@ const hidingBox = (f) => {
|
|
|
283
388
|
/** #2698: name tags in one row centred on (x, y) — each { look, x } (its centre), TAG_GAP apart. */
|
|
284
389
|
const TAG_GAP = 4;
|
|
285
390
|
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);
|
|
391
|
+
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
392
|
let left = x - total / 2;
|
|
288
393
|
return looks.map((look, i) => { const cx = Math.round(left + ws[i] / 2); left += ws[i] + TAG_GAP; return { look, x: cx }; });
|
|
289
394
|
}
|
|
@@ -377,12 +482,26 @@ function paintLayers(p, env, ls, tagsOff = false) {
|
|
|
377
482
|
});
|
|
378
483
|
return { ls, tagsOff, back, front };
|
|
379
484
|
}
|
|
485
|
+
/** Final painted bubbles, topmost first; touch adds a 44 CSS-pixel target without changing the drawing. */
|
|
486
|
+
export function officeBubbleAt(hits, x, y, minSize = 0) {
|
|
487
|
+
const reversed = [...hits].reverse();
|
|
488
|
+
const exact = reversed.find(({ box: b }) => x >= b.x && y >= b.y && x <= b.x + b.w && y <= b.y + b.h);
|
|
489
|
+
if (exact || !minSize) return exact || null;
|
|
490
|
+
let nearest = null, distance = Infinity;
|
|
491
|
+
for (const hit of reversed) {
|
|
492
|
+
const b = hit.box, dx = x - b.x - b.w / 2, dy = y - b.y - b.h / 2;
|
|
493
|
+
if (Math.abs(dx) <= Math.max(minSize, b.w) / 2 && Math.abs(dy) <= Math.max(minSize, b.h) / 2 && dx * dx + dy * dy < distance) {
|
|
494
|
+
nearest = hit; distance = dx * dx + dy * dy;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
return nearest;
|
|
498
|
+
}
|
|
380
499
|
/**
|
|
381
500
|
* 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
501
|
* hovered (its name tag shows even in a crowd); `tagsOff` (#2554: a tile too small to read them): the name tags show
|
|
383
502
|
* only for the one hovered and the Find box's matches. Whether anything in it is moving (in the air, or someone walking).
|
|
384
503
|
*/
|
|
385
|
-
export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false, defer = null) {
|
|
504
|
+
export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false, defer = null, bubbleHits = null) {
|
|
386
505
|
const sk = p.skin;
|
|
387
506
|
const ls = layerScale(a, p.L.width, p.L.height);
|
|
388
507
|
if (!p.layers || p.layers.ls !== ls || p.layers.tagsOff !== tagsOff) p.layers = paintLayers(p, env, ls, tagsOff);
|
|
@@ -390,7 +509,7 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
|
|
|
390
509
|
const blit = (c) => { if (!c) return; ctx.setTransform(a / ls, 0, 0, a / ls, ox, oy); ctx.drawImage(c, 0, 0); T(); };
|
|
391
510
|
blit(p.layers.back);
|
|
392
511
|
T();
|
|
393
|
-
const speakers = [], tags = [];
|
|
512
|
+
const speakers = [], tags = [], titleBoxes = []; // M-3539: the area names bubbles keep off too
|
|
394
513
|
const up = still ? [] : p.flights.frame(ms, p.L);
|
|
395
514
|
// Mail from another office (#2564): flying in at the door, or on the floor until its person picks it up.
|
|
396
515
|
const post = still || !p.mail || !p.zones ? [] : p.mail.frame(ms > 0 ? ms : now(), p.L, p.walkers);
|
|
@@ -400,6 +519,18 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
|
|
|
400
519
|
// y (a tie: the item first, the person in front); furniture over them; things in the air; the pack's foreground
|
|
401
520
|
// (door frames, pillars, table fronts); then what must stay readable: crowd counts and name tags (bubbles below).
|
|
402
521
|
const t = ms > 0 ? ms : now(), live = furnitureAt(p, t);
|
|
522
|
+
const draggedHeld = p.hold ? p.hold.held() : null;
|
|
523
|
+
const heldName = draggedHeld ? draggedHeld.name : null;
|
|
524
|
+
if (!still && ms > 0 && p.snacks) {
|
|
525
|
+
const snackHidden = heldName ? new Map(live.hidden).set(heldName, "__held__") : live.hidden;
|
|
526
|
+
const changed = p.snacks.step(t, {
|
|
527
|
+
desks: p.desks, walkers: p.walkers, hidden: snackHidden, ownArea: !!p.ownArea,
|
|
528
|
+
areas: p.L.areas, graph: p.L, snacksById: p.snacksById,
|
|
529
|
+
charEatOf: (n) => (sk.eatStrip ? sk.eatStrip(n) : null),
|
|
530
|
+
onClaim: p.onSnackClaim,
|
|
531
|
+
});
|
|
532
|
+
if (changed && typeof p.onSnacksChanged === "function") p.onSnacksChanged();
|
|
533
|
+
}
|
|
403
534
|
const people = p.desks.map((d) => {
|
|
404
535
|
const at = p.walkers.at(d.node.name, t) || { ...d.seat, walking: false };
|
|
405
536
|
if (at.walking) walking = true;
|
|
@@ -407,57 +538,170 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
|
|
|
407
538
|
}).sort((x, y) => x.at.y - y.at.y);
|
|
408
539
|
const furniture = strollFurniture(p.night ? nightFurniture(sk.pack.furniture) : sk.pack.furniture, (k) => p.walkers.at(k, t));
|
|
409
540
|
if (furniture.some((f) => f.walking)) walking = true;
|
|
410
|
-
const
|
|
541
|
+
const placedSnacks = p.snacks ? p.snacks.placedList() : [];
|
|
542
|
+
const band = [...furniture.filter((f) => f.depth === "y").map((f) => ({ y: f.y, k: 0, f })),
|
|
543
|
+
...placedSnacks.map((sn) => ({ y: sn.y, k: 0.5, sn })),
|
|
544
|
+
...people.map((q) => ({ y: q.at.y, k: 1, p: q })),
|
|
411
545
|
...(p.ghosts ? ghostsOf(sk.pack, people).map((g) => ({ y: g.y, k: 1, g })) : []),
|
|
412
546
|
// #2665: by day, each item's night place too (at night the items are there already).
|
|
413
547
|
...(p.ghosts && !p.night ? nightGhostsOf(sk.pack).map((n) => ({ y: n.y, k: 1, n })) : [])]
|
|
414
548
|
.sort((x, y) => x.y - y.y || x.k - y.k);
|
|
549
|
+
// M-3432 (#4255) & M-3445 (#4266): draw drop-target rings above the floor layer only, never over furniture or characters.
|
|
550
|
+
const drop = p.snackDrop && p.snackDrop.current;
|
|
551
|
+
if (drop && drop.kind === "place") {
|
|
552
|
+
ctx.save();
|
|
553
|
+
ctx.fillStyle = "rgba(0, 0, 0, 0.16)";
|
|
554
|
+
ctx.beginPath(); ctx.ellipse(drop.x, drop.y, 16, 7, 0, 0, Math.PI * 2); ctx.fill();
|
|
555
|
+
ctx.strokeStyle = env.pal.accent; ctx.lineWidth = 1.5; ctx.setLineDash([4, 3]);
|
|
556
|
+
ctx.beginPath(); ctx.ellipse(drop.x, drop.y, 16, 7, 0, 0, Math.PI * 2); ctx.stroke();
|
|
557
|
+
ctx.restore();
|
|
558
|
+
} else if (drop && drop.kind === "feed") {
|
|
559
|
+
const target = people.find((q) => q.look.name === drop.name && !live.hidden.has(q.look.name));
|
|
560
|
+
if (target) {
|
|
561
|
+
ctx.save();
|
|
562
|
+
ctx.fillStyle = env.pal.accentDim;
|
|
563
|
+
ctx.beginPath(); ctx.ellipse(target.at.x, target.at.y, 24, 10, 0, 0, Math.PI * 2); ctx.fill();
|
|
564
|
+
ctx.strokeStyle = env.pal.accent; ctx.lineWidth = 2;
|
|
565
|
+
ctx.beginPath(); ctx.ellipse(target.at.x, target.at.y, 24, 10, 0, 0, Math.PI * 2); ctx.stroke();
|
|
566
|
+
ctx.restore();
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
const seatDrop = heldName && p.seatDrop ? p.seatDrop.current : null;
|
|
570
|
+
if (seatDrop && seatDrop.name === heldName && Array.isArray(seatDrop.targets)) {
|
|
571
|
+
for (const st of seatDrop.targets) {
|
|
572
|
+
if (st.current) continue;
|
|
573
|
+
const isHover = !!seatDrop.hover && seatDrop.hover.area === st.area && seatDrop.hover.slot === st.slot;
|
|
574
|
+
ctx.save();
|
|
575
|
+
if (isHover) {
|
|
576
|
+
ctx.fillStyle = env.pal.accentDim;
|
|
577
|
+
ctx.beginPath(); ctx.ellipse(st.x, st.y, 26, 11, 0, 0, Math.PI * 2); ctx.fill();
|
|
578
|
+
ctx.strokeStyle = "rgba(0, 0, 0, 0.38)"; ctx.lineWidth = 4.5;
|
|
579
|
+
ctx.beginPath(); ctx.ellipse(st.x, st.y, 26, 11, 0, 0, Math.PI * 2); ctx.stroke();
|
|
580
|
+
ctx.strokeStyle = env.pal.accent; ctx.lineWidth = 2.5;
|
|
581
|
+
ctx.beginPath(); ctx.ellipse(st.x, st.y, 26, 11, 0, 0, Math.PI * 2); ctx.stroke();
|
|
582
|
+
} else {
|
|
583
|
+
ctx.globalAlpha = 0.9;
|
|
584
|
+
ctx.fillStyle = env.pal.accentDim;
|
|
585
|
+
ctx.beginPath(); ctx.ellipse(st.x, st.y, 22, 10, 0, 0, Math.PI * 2); ctx.fill();
|
|
586
|
+
ctx.strokeStyle = "rgba(0, 0, 0, 0.35)"; ctx.lineWidth = 3.5;
|
|
587
|
+
ctx.beginPath(); ctx.ellipse(st.x, st.y, 22, 10, 0, 0, Math.PI * 2); ctx.stroke();
|
|
588
|
+
ctx.strokeStyle = env.pal.accent; ctx.lineWidth = 2; ctx.setLineDash([5, 3]);
|
|
589
|
+
ctx.beginPath(); ctx.ellipse(st.x, st.y, 22, 10, 0, 0, Math.PI * 2); ctx.stroke();
|
|
590
|
+
}
|
|
591
|
+
ctx.restore();
|
|
592
|
+
}
|
|
593
|
+
}
|
|
415
594
|
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
595
|
for (const it of post) if (it.t === 0) sk.drawProp(ctx, it, ms, env); // a letter on the floor: under the people
|
|
417
|
-
|
|
596
|
+
let heldPerson = null;
|
|
597
|
+
for (const { f, p: q, g, n, sn } of band) {
|
|
418
598
|
if (f) { sk.drawFurniture(ctx, f, f.asleep || live.active.has(f.id), ms, env); continue; }
|
|
599
|
+
if (sn) {
|
|
600
|
+
const sdef = p.snacksById && p.snacksById.get(sn.snackId);
|
|
601
|
+
if (sdef && sk.drawSnack) {
|
|
602
|
+
ctx.save();
|
|
603
|
+
ctx.fillStyle = "rgba(0, 0, 0, 0.22)";
|
|
604
|
+
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();
|
|
605
|
+
ctx.restore();
|
|
606
|
+
sk.drawSnack(ctx, sdef.sprite, ms, sn.x, sn.y, env, `sn:${sn.id}`);
|
|
607
|
+
}
|
|
608
|
+
continue;
|
|
609
|
+
}
|
|
419
610
|
if (n) { ctx.save(); ctx.globalAlpha = GHOST_ALPHA; sk.drawFurniture(ctx, n, true, 0, env); ctx.restore(); continue; }
|
|
420
611
|
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; }
|
|
612
|
+
if (heldName && q.look.name === heldName) { heldPerson = q; continue; } // M-3445 (#4267): drawn lifted on top below
|
|
421
613
|
if (live.hidden.has(q.look.name)) continue; // #2698: drawn as the item (never while walking)
|
|
422
614
|
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.
|
|
615
|
+
// 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
616
|
const posed = actPosed(p, q.look);
|
|
425
|
-
const
|
|
617
|
+
const eating = !q.at.walking && p.snacks && ms > 0 ? p.snacks.eatingOf(q.look.name, t) : null;
|
|
618
|
+
const canEat = !!eating && !CALLING.has(q.look.state) && !ASLEEP.has(q.look.state) && !q.look.night;
|
|
619
|
+
const look = q.at.walking ? { ...q.look, pose: "walk", heading: q.at.heading }
|
|
620
|
+
: canEat ? { ...posed, pose: "eat", basePose: posed.pose } : posed;
|
|
426
621
|
sk.drawCharacter(ctx, box, look, ms, env);
|
|
427
|
-
if (
|
|
622
|
+
if (canEat && eating.snackId && p.snacksById && sk.drawSnack) {
|
|
623
|
+
const sdef = p.snacksById.get(eating.snackId);
|
|
624
|
+
if (sdef && sdef.eat) sk.drawSnack(ctx, sdef.eat, Math.max(0, t - eating.t0), q.at.x, q.at.y, env);
|
|
625
|
+
}
|
|
626
|
+
if (!q.at.walking || (p.snacks && ms > 0 && p.snacks.scatterOf(q.look.name, t))) {
|
|
627
|
+
speakers.push({ look: q.look, ...speakerAt(sk, look, q.at), area: q.d.area });
|
|
628
|
+
}
|
|
428
629
|
}
|
|
429
630
|
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);
|
|
631
|
+
// M-3445 (#4267): the character currently being dragged renders lifted above furniture and other characters in its `dragged` pose.
|
|
632
|
+
if (heldPerson) {
|
|
633
|
+
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 } };
|
|
634
|
+
const posed = actPosed(p, heldPerson.look);
|
|
635
|
+
sk.drawCharacter(ctx, box, { ...posed, pose: "dragged", basePose: posed.pose }, ms, env);
|
|
636
|
+
}
|
|
430
637
|
for (const it of up) sk.drawProp(ctx, it, ms, env);
|
|
431
638
|
for (const it of post) if (it.t > 0) sk.drawProp(ctx, it, ms, env);
|
|
432
639
|
if (sk.drawForeground) sk.drawForeground(ctx, p.L, env);
|
|
433
640
|
// Who found no spot in an area: a count in its corner (never over its name).
|
|
434
641
|
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
|
-
|
|
642
|
+
// M-3539: an area's name a figure stands on is written again over the people (休息區 under a crowd's heads).
|
|
643
|
+
const titles = sk.areaTitleBox ? Object.values(p.L.areas || {}).map((ar) => ({ ar, box: sk.areaTitleBox(ctx, ar, env) })) : [];
|
|
644
|
+
if (sk.drawAreaTitle) for (const { ar, box } of titles) {
|
|
645
|
+
if (people.some((q) => !live.hidden.has(q.look.name) && overlaps(figureBox(sk, q), box))) sk.drawAreaTitle(ctx, ar, env);
|
|
646
|
+
}
|
|
647
|
+
// Name tags never cover each other, an area's name or what the page keeps clear over the scene (`env.keepClear`:
|
|
648
|
+
// the zoom control, M-3539). In an area over capacity (#2513: a crowd's full tags covered each other) everyone keeps
|
|
649
|
+
// a compact tag (#2860: in Cozy, the default, most of a fleet is in a crowd, and hover-only hid names and levels).
|
|
650
|
+
// The full tags go first: the one hovered or found, then the people at their place, then those walking (a stroll
|
|
651
|
+
// passes others' tags, M-3539); each where it is, else a row lower, else compact (there, then a row lower); one
|
|
652
|
+
// 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
653
|
const over = p.L.over || new Set();
|
|
439
|
-
const
|
|
440
|
-
const
|
|
654
|
+
const pinned = (q) => q.d.key === hot || !!q.look.match;
|
|
655
|
+
const crowded = (q) => over.has(q.d.area) && !pinned(q);
|
|
656
|
+
const tagged = (q) => pinned(q) || !(tagsOff || over.has(q.d.area));
|
|
657
|
+
const keep = [...titles.map((x) => x.box), ...(env.keepClear || [])];
|
|
658
|
+
titleBoxes.push(...titles.map((x) => x.box));
|
|
441
659
|
const taken = [];
|
|
442
|
-
const touches = (b) => taken.some((o) => b
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
660
|
+
const touches = (b) => taken.some((o) => overlaps(b, o)) || keep.some((o) => overlaps(b, o));
|
|
661
|
+
// Under an open card (`p.cover`, bitmap px; #4379 review): no tag, its level badge included, rather than a piece of one
|
|
662
|
+
// past the card's edge — a forced one (hovered, found) too.
|
|
663
|
+
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;
|
|
664
|
+
const covered = (b) => !!cv && overlaps(b, cv);
|
|
665
|
+
/**
|
|
666
|
+
* Draws `look`'s tag at (x, y) at the first of `tries` ([dy, compact]) clear of the others; `force`: at the first.
|
|
667
|
+
* None clear: slid sideways just past what it would touch of `keep` (an area's name, the minimap: never another
|
|
668
|
+
* tag), at most its own width, at its place — so a name beside the minimap reads instead of going (leader's check).
|
|
669
|
+
*/
|
|
670
|
+
const place = (x0, y, look, tries, force = false) => {
|
|
671
|
+
// M-3539: a tag stays within the sides of the area its person stands in (a wide name at a lounge's first column
|
|
672
|
+
// poked past its edge): moved in by what it would stick out.
|
|
673
|
+
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);
|
|
674
|
+
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);
|
|
675
|
+
const at = (dx, dy, compact) => {
|
|
676
|
+
const box = tagBox(ctx, x + dx, y + dy, look.label, compact, look.fit), foot = tagFootprint(ctx, box, look.badge, compact);
|
|
677
|
+
if (covered(foot)) return null;
|
|
678
|
+
if (!force && touches(foot)) return null;
|
|
679
|
+
// Every place tried keeps within the area's sides, a slide's too (#4376 review): none there, hover or focus.
|
|
680
|
+
if (!force && ar && (box.x < ar.rect.x || box.x + box.w > ar.rect.x + ar.rect.w)) return null;
|
|
681
|
+
sk.drawTag(ctx, x + dx, y + dy, look, env, compact);
|
|
682
|
+
tags.push(box); taken.push(foot);
|
|
683
|
+
return box;
|
|
684
|
+
};
|
|
685
|
+
for (const [dy, compact] of tries) { const b = at(0, dy, compact); if (b) return b; }
|
|
686
|
+
const [dy0, c0] = tries[0], b0 = tagFootprint(ctx, tagBox(ctx, x, y + dy0, look.label, c0, look.fit), look.badge, c0);
|
|
687
|
+
for (const o of keep.filter((k) => overlaps(b0, k))) {
|
|
688
|
+
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; }
|
|
689
|
+
}
|
|
690
|
+
return null;
|
|
691
|
+
};
|
|
692
|
+
const FULL_TRIES = [[0, false], [TAG_ROW, false], [0, true], [COMPACT_ROW, true]];
|
|
693
|
+
const tagOrder = people.filter((q) => !(live.hidden.has(q.look.name) && q.look.name !== heldName) && tagged(q))
|
|
694
|
+
.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);
|
|
695
|
+
for (const { q, rank } of tagOrder) place(q.at.x, q.at.y, q.look, FULL_TRIES, rank === 0);
|
|
449
696
|
// 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
697
|
// #2698: an item hiding its people carries their tags too, in one row at its tag point (its own first; each keeps
|
|
451
698
|
// its place in the row while another's tag is left out), and their bubbles, over its picture. The tags drawn are
|
|
452
699
|
// kept on the scene (`heldTags`): hitPart hits each person on theirs, past the picture's edge too (#2699 review).
|
|
453
700
|
const held = [];
|
|
454
701
|
for (const f of furniture) {
|
|
455
|
-
const on = people.filter((q) => live.hidden.get(q.look.name) === f.id);
|
|
702
|
+
const on = people.filter((q) => live.hidden.get(q.look.name) === f.id && q.look.name !== heldName);
|
|
456
703
|
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
|
-
}
|
|
704
|
+
if (!tagsOff && f.label) place(f.x, f.y, npcLook(p, f), [[0, false], [TAG_ROW, false]]);
|
|
461
705
|
continue;
|
|
462
706
|
}
|
|
463
707
|
const order = new Map((f.activeFor || []).map((n, i) => [n, i]));
|
|
@@ -468,10 +712,9 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
|
|
|
468
712
|
const q = f.label ? on[i - 1] : on[i];
|
|
469
713
|
if (q) speakers.push({ look: q.look, x: r.x + 10, y: top, area: q.d.area });
|
|
470
714
|
if (q ? !tagged(q) : tagsOff) continue;
|
|
471
|
-
|
|
472
|
-
const box =
|
|
473
|
-
|
|
474
|
-
if (q) held.push({ name: q.look.name, id: f.id, box });
|
|
715
|
+
// The row stays one row (each keeps its place): drawn there, covering nothing else's, or left to hover.
|
|
716
|
+
const box = place(r.x, f.y, r.look, [[0, false]], !!q && pinned(q));
|
|
717
|
+
if (q && box) held.push({ name: q.look.name, id: f.id, box });
|
|
475
718
|
}
|
|
476
719
|
}
|
|
477
720
|
p.heldTags = held;
|
|
@@ -480,13 +723,7 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
|
|
|
480
723
|
// neighbour's tag goes a row lower (COMPACT_ROW) rather than out, so a row of people reads as two staggered rows.
|
|
481
724
|
if (!tagsOff) for (const q of people) {
|
|
482
725
|
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
|
-
}
|
|
726
|
+
place(q.at.x, q.at.y, q.look, [[0, true], [COMPACT_ROW, true]]);
|
|
490
727
|
}
|
|
491
728
|
} else {
|
|
492
729
|
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,6 +749,18 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
|
|
|
512
749
|
}
|
|
513
750
|
ctx.restore();
|
|
514
751
|
}
|
|
752
|
+
// 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)
|
|
753
|
+
// and their words in a bubble, while it lasts.
|
|
754
|
+
const t0 = now(), reacting = ms && p.reacts && p.reacts.size && pruneReactions(p.reacts, t0) ? p.reacts : null;
|
|
755
|
+
if (reacting) {
|
|
756
|
+
ctx.save();
|
|
757
|
+
ctx.fillStyle = env.pal.danger; ctx.font = "700 11px system-ui, sans-serif"; ctx.textAlign = "center"; ctx.textBaseline = "bottom";
|
|
758
|
+
for (const sp of speakers) {
|
|
759
|
+
const ra = reacting.has(sp.look.name) ? reactionAt(reacting.get(sp.look.name), t0, p.lang) : null;
|
|
760
|
+
if (ra) for (const h of ra.hearts) { ctx.globalAlpha = h.alpha; ctx.fillText("♥", sp.x + h.dx, sp.y + h.dy); }
|
|
761
|
+
}
|
|
762
|
+
ctx.restore();
|
|
763
|
+
}
|
|
515
764
|
// Speech bubbles: a short line for the state, now and then (typed out; whole at once when still), placed so no two
|
|
516
765
|
// overlap (placeBubbles; #2431).
|
|
517
766
|
const bubbles = [];
|
|
@@ -519,17 +768,33 @@ export function drawPart(ctx, p, a, ox, oy, ms, still, hot, env, tagsOff = false
|
|
|
519
768
|
if (sp.look.dim || sp.look.pose === "away") continue;
|
|
520
769
|
const says = sp.look.night ? "paused" : sp.look.state; // asleep at night: its "Zzz…" lines
|
|
521
770
|
// 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
|
-
|
|
771
|
+
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;
|
|
772
|
+
// M-3293: a pat's or a feed's words first — the pack's own for it ("pat" / "feed" in its bubbles: theirs, their
|
|
773
|
+
// set's, the pack's), one picked by when it happened, else the page's.
|
|
774
|
+
const packSays = ra ? linesFor(reacting.get(sp.look.name).kind, p.lang, sk.pack, null, sp.look.name) : [];
|
|
775
|
+
const raSays = ra ? (packSays.length ? packSays[Math.floor(reacting.get(sp.look.name).t0) % packSays.length] : ra.say) : null;
|
|
776
|
+
const own = raSays ? raSays : actLive(act, says, Date.now(), p.actSeen) && act.say ? act.say : null;
|
|
777
|
+
const sc = !own && p.snacks && ms > 0 ? p.snacks.scatterOf(sp.look.name, t0) : null;
|
|
778
|
+
const scText = sc ? scatterWords(p.lang) : null;
|
|
779
|
+
const b = own ? { text: own, shown: [...own].length }
|
|
780
|
+
: scText ? { text: scText, shown: [...scText].length }
|
|
781
|
+
: 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
|
|
782
|
+
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
783
|
box: bubbleBox(ctx, sp.x, sp.y, b.text), tail: { x: sp.x, y: sp.y }, sp, b });
|
|
526
784
|
}
|
|
527
785
|
// A crowded area speaks less (thinBubbles: calls, then work, a few at most); no bubble covers a name tag. `defer`
|
|
528
786
|
// (All offices): drawn after every tile, unclipped, so a bubble at a tile's edge is whole.
|
|
529
|
-
const placed = placeBubbles(thinBubbles(bubbles, p.zones ? p.L.over : null), 22, tags);
|
|
530
|
-
const say = () => { T(); for (const { sp, b, dy } of placed)
|
|
787
|
+
const placed = placeBubbles(thinBubbles(bubbles, p.zones ? p.L.over : null), 22, titleBoxes.length ? [...tags, ...titleBoxes] : tags);
|
|
788
|
+
const say = () => { T(); for (const { sp, b, dy } of placed) {
|
|
789
|
+
const text = [...b.text].slice(0, b.shown).join("");
|
|
790
|
+
sk.drawBubble(ctx, sp.x, sp.y, text, env, -dy);
|
|
791
|
+
if (bubbleHits && text) {
|
|
792
|
+
const box = bubbleBox(ctx, sp.x, sp.y, text, -dy);
|
|
793
|
+
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 } });
|
|
794
|
+
}
|
|
795
|
+
} };
|
|
531
796
|
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;
|
|
797
|
+
return 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
798
|
}
|
|
534
799
|
/**
|
|
535
800
|
* #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,9 +891,34 @@ export function OfficeKey({ pal }) {
|
|
|
626
891
|
* `assetImage(url)` how (the share's, which waits out a 429, #2662; none: the loader's own);
|
|
627
892
|
* `opening` the office it opens on (the share's), instead of the one this browser chose last; #2861: `talk` the share's
|
|
628
893
|
* conversations (its /state's: who heard or answered a person, when — never what was said), instead of the stream's.
|
|
894
|
+
* M-3533 R1, a Hub room's office (hub-room-office.js), on the Fleet dashboard's own origin too: `oneOffice` its one office
|
|
895
|
+
* (no office picker or carousel); `readOnly` no editing or sharing whatever the session; `stream` false: never this
|
|
896
|
+
* page's own stream (the fleet's offices, acts and skins); `storage` where this browser's choices are kept (not the
|
|
897
|
+
* Fleet office's); `cardRows(name)` a card's rows instead of the office's (the room's: owner, introduction); `words(node)`
|
|
898
|
+
* 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;
|
|
899
|
+
* `foldBar` (with `onMore`): no options row over the scene on a desk either — the options open in the sheet from a button
|
|
900
|
+
* in the zoom stack (a Hub room's office: the scene right under the room's header, M-3533 #4370);
|
|
901
|
+
* `cardAction(name)` a card's main action ({ label, title, run }: the room's "@ it"), or null; `cardName(name)` a card's
|
|
902
|
+
* 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
|
|
903
|
+
* again when it changes (a page with no stream: the room's office when an agent joins, leaves or is renamed).
|
|
629
904
|
*/
|
|
630
|
-
|
|
631
|
-
const
|
|
905
|
+
function ensureDialogueStyle() {
|
|
906
|
+
const doc = globalThis.document;
|
|
907
|
+
if (!doc?.head || doc.querySelector('link[data-office-dialogue-css="1"]')) return;
|
|
908
|
+
const link = doc.createElement("link"); link.rel = "stylesheet";
|
|
909
|
+
link.href = assetUrl("/assets/office-dialogue.css");
|
|
910
|
+
link.setAttribute("data-office-dialogue-css", "1"); doc.head.appendChild(link);
|
|
911
|
+
}
|
|
912
|
+
export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetImage, opening, talk, more = false, onMore = null, live = null, onLive = null,
|
|
913
|
+
oneOffice = false, readOnly = false, stream = true, storage = undefined, cardRows = null, words = null, cardAction = null, cardName = null, officesKey = undefined, foldBar = false }) {
|
|
914
|
+
// M-3253: on a phone the page above (fleet-canvas.js) puts a ⋯ in its bar: `more` is that sheet open, `onMore(open)`;
|
|
915
|
+
// `live` / `onLive` its Live toggle, which moves into the sheet. Without one (a share link's page) the bar stays.
|
|
916
|
+
useLayoutEffect(ensureDialogueStyle, []);
|
|
917
|
+
const phone = useOfficePhone(), compact = phone && typeof onMore === "function", folded = compact || (foldBar && typeof onMore === "function");
|
|
918
|
+
const store = useMemo(() => createOfficeStore({ ...(lease ? { fetch: (path, o) => lease.fetch(path, o) } : {}), ...(storage ? { storage } : {}) }), [lease, storage]);
|
|
919
|
+
const streamOn = () => (stream === false ? null : appStore.get().streamOn);
|
|
920
|
+
const stateOf = (node) => (words ? words(node).state : stateWords(node));
|
|
921
|
+
const nowOf = (node) => (words ? words(node).now : caption(officePose(node.state), node.state));
|
|
632
922
|
const [stored, setStored] = useState([]);
|
|
633
923
|
const [storedRev, setStoredRev] = useState(null); // the rev the list was read at (a save sends it)
|
|
634
924
|
const [canEdit, setCanEdit] = useState(false); // an admin session (never a guest or the public link)
|
|
@@ -636,6 +926,11 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
636
926
|
const [editing, setEditing] = useState(false);
|
|
637
927
|
const [choice, setChoice] = useState(() => opening ?? store.choice());
|
|
638
928
|
const [filter, setFilter] = useState(() => store.filter());
|
|
929
|
+
// #4010: the carousel's offices and interval (per browser); the slide index and playing are this visit only.
|
|
930
|
+
const [carSaved, setCarSaved] = useState(() => store.carousel());
|
|
931
|
+
const [carIndex, setCarIndex] = useState(0);
|
|
932
|
+
const [carPlaying, setCarPlaying] = useState(true);
|
|
933
|
+
const [carMenu, setCarMenu] = useState(false);
|
|
639
934
|
// #2716: the whole-fleet office's style — the host's (for everyone) and this browser's own pick. An admin sees the
|
|
640
935
|
// 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
936
|
const [hostStyle, setHostStyle] = useState(undefined); // undefined: not read yet; null: none kept
|
|
@@ -664,11 +959,20 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
664
959
|
const dlg = useMemo(createDialogue, []);
|
|
665
960
|
const faces = useMemo(() => createFaces(), []);
|
|
666
961
|
const [dlgSay, setDlgSay] = useState("");
|
|
962
|
+
const [dlgVisible, setDlgVisible] = useState(false);
|
|
963
|
+
const dlgVisibleRef = useRef(false);
|
|
964
|
+
const showDialogueDock = (visible) => {
|
|
965
|
+
if (dlgVisibleRef.current !== visible) { dlgVisibleRef.current = visible; setDlgVisible(visible); }
|
|
966
|
+
};
|
|
967
|
+
const dialogueCanvasRef = useRef(null);
|
|
667
968
|
const [dlgHot, setDlgHot] = useState(false);
|
|
668
969
|
const dlgRef = useRef(null), dlgShown = useRef(null), dlgLines = useRef(new Map()), talkSeen = useRef(new Set());
|
|
669
970
|
const [nightNow, setNightNow] = useState(() => isNight());
|
|
670
971
|
useEffect(() => { if (!nightOn) return undefined; setNightNow(isNight()); const h = setInterval(() => setNightNow(isNight()), NIGHT.TICK); return () => clearInterval(h); }, [nightOn]);
|
|
671
972
|
const night = nightOn && nightNow;
|
|
973
|
+
// M-3293: "Drag and pat" here (per device, on by default); in force only where playAllowed says (below).
|
|
974
|
+
const [playOn, setPlayOn] = useState(() => store.playOn());
|
|
975
|
+
const [, setTellRev] = useState(0); // M-3293: the card's Tell box redrawn when ticked
|
|
672
976
|
const [lobbyOn, setLobbyOn] = useState(() => store.lobbyTile()); // #2554: All offices' lobby tile
|
|
673
977
|
const [packs, setPacks] = useState([]); // the skin packs the host keeps: [{ id, name, sha }]
|
|
674
978
|
const [packSkins, setPackSkins] = useState(() => new Map()); // id@sha → a loaded skin, or null (not a pack)
|
|
@@ -695,6 +999,20 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
695
999
|
const flights = useMemo(() => createFlights(), []);
|
|
696
1000
|
const walkers = useMemo(() => createWalkers(), []);
|
|
697
1001
|
const seatsRef = useRef(new Map()); // the zones layout's last seats: kept where they can be
|
|
1002
|
+
const seatPrefsRef = useRef({}), seatKeyRef = useRef(""), seatDropRef = useRef(null);
|
|
1003
|
+
const placedRef = useRef(null); // M-3539: the office and style the walkers were last placed for
|
|
1004
|
+
// M-3539: the phone's zone chips scroll sideways when they do not fit (English); a fade at the side there is more
|
|
1005
|
+
// (data-more-left / data-more-right) says so.
|
|
1006
|
+
const pillsRef = useRef(null);
|
|
1007
|
+
const pillsCue = () => {
|
|
1008
|
+
const e = pillsRef.current;
|
|
1009
|
+
if (!e || typeof e.toggleAttribute !== "function") return;
|
|
1010
|
+
const more = e.scrollWidth - e.clientWidth;
|
|
1011
|
+
e.toggleAttribute("data-more-left", more > 1 && e.scrollLeft > 1);
|
|
1012
|
+
e.toggleAttribute("data-more-right", more > 1 && e.scrollLeft < more - 1);
|
|
1013
|
+
};
|
|
1014
|
+
useLayoutEffect(pillsCue);
|
|
1015
|
+
const [seatRev, setSeatRev] = useState(0);
|
|
698
1016
|
// #2554: All offices' tiles keep their own: seats (by tile and style), walkers and flights (by tile); and the items
|
|
699
1017
|
// flying between tiles.
|
|
700
1018
|
const tileSeats = useRef(new Map()), tileWalkers = useRef(new Map()), tileFlights = useRef(new Map());
|
|
@@ -740,10 +1058,10 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
740
1058
|
if (!lease) return undefined;
|
|
741
1059
|
const read = async () => { const at = ask(); const d = await store.offices(); if (lease.current()) adopt(d, at); };
|
|
742
1060
|
void read();
|
|
743
|
-
const sub =
|
|
1061
|
+
const sub = streamOn();
|
|
744
1062
|
const off = sub ? lease.hold(sub("offices", () => { void read(); })) : null;
|
|
745
1063
|
return () => { if (off) off(); };
|
|
746
|
-
}, [lease, store]);
|
|
1064
|
+
}, [lease, store, officesKey]);
|
|
747
1065
|
// #2578: what agents do here by their own hand (office_set) — on opening, then as the stream brings it.
|
|
748
1066
|
// A read a newer one or the stream overtook is dropped (it is older: review — an opening read answered after the one
|
|
749
1067
|
// the stream's return began brought a cleared act back); read again when the stream comes back, and — with no live
|
|
@@ -776,7 +1094,7 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
776
1094
|
let heard = 0; // reads begun and events heard: the newest wins
|
|
777
1095
|
const read = async () => { const at = ++heard, d = await store.acts(); if (lease.current() && d && at === heard) setActs(d); };
|
|
778
1096
|
void read();
|
|
779
|
-
const sub =
|
|
1097
|
+
const sub = streamOn();
|
|
780
1098
|
const polled = () => globalThis.document?.body?.dataset?.webTransport === "poll" || appStore.get().connection === "polling";
|
|
781
1099
|
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
1100
|
lease.hold(sub("connection", (c) => { if (c === "live") void read(); }))] : [];
|
|
@@ -798,7 +1116,7 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
798
1116
|
};
|
|
799
1117
|
useEffect(() => {
|
|
800
1118
|
if (!dialogueOn || talk !== undefined) return undefined;
|
|
801
|
-
const sub =
|
|
1119
|
+
const sub = streamOn();
|
|
802
1120
|
if (!sub) return undefined;
|
|
803
1121
|
let skew = 0;
|
|
804
1122
|
const seen = new Set();
|
|
@@ -850,7 +1168,7 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
850
1168
|
if (!lease) return undefined;
|
|
851
1169
|
const read = async () => { const d = await store.skins(); if (lease.current() && d) setPacks(d.packs); };
|
|
852
1170
|
void read();
|
|
853
|
-
const sub =
|
|
1171
|
+
const sub = streamOn();
|
|
854
1172
|
const off = sub ? lease.hold(sub("office_skins", () => { void read(); })) : null;
|
|
855
1173
|
return () => { if (off) off(); };
|
|
856
1174
|
}, [lease, store]);
|
|
@@ -859,11 +1177,10 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
859
1177
|
// session's here or over the public link (the host asks again too); never a guest's or a read-only one's.
|
|
860
1178
|
useEffect(() => {
|
|
861
1179
|
const body = globalThis.document?.body;
|
|
862
|
-
if (!body || body.dataset.tier === "guest") return undefined;
|
|
863
|
-
const overLink = body.dataset.publicLink === "1";
|
|
1180
|
+
if (readOnly || !body || body.dataset.tier === "guest") return undefined;
|
|
864
1181
|
let live = true;
|
|
865
1182
|
const auth = globalThis.AgendAuth;
|
|
866
|
-
if (auth && typeof auth.canWrite === "function") Promise.resolve(auth.canWrite()).then((v) => { if (live) { setCanEdit(v === true
|
|
1183
|
+
if (auth && typeof auth.canWrite === "function") Promise.resolve(auth.canWrite()).then((v) => { if (live) { setCanEdit(v === true); setCanShare(v === true); } }, () => {});
|
|
867
1184
|
return () => { live = false; };
|
|
868
1185
|
}, []);
|
|
869
1186
|
// The stage's width (the grid wraps at it), and the theme (the tokens the canvas reads).
|
|
@@ -899,7 +1216,25 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
899
1216
|
|
|
900
1217
|
// #2554: All offices — chosen, and at least two offices stored (else the whole fleet, as an office gone is).
|
|
901
1218
|
const overview = choice === ALL_ID && overviewOk(stored);
|
|
902
|
-
|
|
1219
|
+
// #4010: Carousel — chosen on the signed-in dashboard, at least two stored; the ticked list may be shorter (then
|
|
1220
|
+
// the one left is shown still, or the whole fleet with none). Playing starts on enter; the timer is a timeout so a
|
|
1221
|
+
// Next or an interval change resets it.
|
|
1222
|
+
const carouselPick = opening == null && choice === CAROUSEL_ID && carouselOk(stored);
|
|
1223
|
+
const carIds = carouselPick ? carouselIdsOk(carSaved ? carSaved.ids : null, stored) : [];
|
|
1224
|
+
const carousel = carouselPick && carIds.length >= 2;
|
|
1225
|
+
useEffect(() => { if (!carouselPick) setCarMenu(false); }, [carouselPick]);
|
|
1226
|
+
const slideId = carouselPick && carIds.length ? carIds[((carIndex % carIds.length) + carIds.length) % carIds.length] : null;
|
|
1227
|
+
const custom = slideId ? stored.find((o) => o.id === slideId) || null
|
|
1228
|
+
: (choice !== AUTO_ID && !overview ? stored.find((o) => o.id === choice) || null : null);
|
|
1229
|
+
const carouselAct = useRef({ on: false, act: () => {} });
|
|
1230
|
+
const stepCar = (dir) => { if (!carIds.length) return; setCarIndex((i) => (dir > 0 ? nextIndex(i, carIds.length) : prevIndex(i, carIds.length))); };
|
|
1231
|
+
carouselAct.current = { on: carousel, act: (kind) => { if (kind === "pause") setCarPlaying((p) => !p); else if (kind === "next") stepCar(1); else if (kind === "prev") stepCar(-1); } };
|
|
1232
|
+
useEffect(() => {
|
|
1233
|
+
if (!carousel || !carPlaying) return undefined;
|
|
1234
|
+
const ms = intervalOk(carSaved && carSaved.interval) * 1000;
|
|
1235
|
+
const t = setTimeout(() => stepCar(1), ms);
|
|
1236
|
+
return () => clearTimeout(t);
|
|
1237
|
+
}, [carousel, carPlaying, carSaved && carSaved.interval, carIndex, carIds.join("|")]);
|
|
903
1238
|
// The style: a built-in one, or an uploaded pack once it is loaded (until then, and when it is not one, Desks).
|
|
904
1239
|
const wanted = custom ? custom.skin : style;
|
|
905
1240
|
// 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 +1280,33 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
945
1280
|
// 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
1281
|
// what will stand, sit or lie there, not by a dot.
|
|
947
1282
|
const ghosts = zones && !!layout && !layoutStale;
|
|
1283
|
+
const shared = talk !== undefined || typeof onOpen !== "function";
|
|
1284
|
+
// What a view and per-device seat choices are kept for: the office and its style (All offices: its own key).
|
|
1285
|
+
const officeKey = overview ? `${ALL_ID}@tiles` : `${custom ? custom.id : AUTO_ID}@${baseSkin.id}`;
|
|
948
1286
|
const keep = (n) => !(hideAsleep && ASLEEP.has(n.state));
|
|
949
1287
|
const single = useMemo(() => {
|
|
950
1288
|
if (overview) return { rooms: [], width: 1, height: 1 }; // All offices: the tiles below
|
|
951
1289
|
const all = custom ? membersOf(custom, view) : [...new Map(officeRooms(view, filter).flatMap((r) => r.nodes).map((n) => [n.name, n])).values()];
|
|
952
1290
|
const nodes = all.filter(keep);
|
|
953
|
-
if (zones) {
|
|
1291
|
+
if (zones) {
|
|
1292
|
+
const skKey = shared ? "" : officeKey;
|
|
1293
|
+
// M-3533 (#4370): the seats given restart when the office or its style changes — on a shared page too (a room's
|
|
1294
|
+
// office, a share link), whose per-device seat choices are not kept (skKey ""), so a style with more seats is not
|
|
1295
|
+
// drawn with the old one's overflow spots.
|
|
1296
|
+
if (seatKeyRef.current !== officeKey) {
|
|
1297
|
+
seatKeyRef.current = officeKey;
|
|
1298
|
+
seatsRef.current = new Map();
|
|
1299
|
+
seatPrefsRef.current = skKey ? store.seats(skKey) : {};
|
|
1300
|
+
}
|
|
1301
|
+
const z = zonesLayout(skin.pack, nodes, seatsRef.current, { night, seatPrefs: skKey ? seatPrefsRef.current : null });
|
|
1302
|
+
seatsRef.current = z.seats;
|
|
1303
|
+
return z;
|
|
1304
|
+
}
|
|
954
1305
|
// 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
1306
|
const deskW = Math.max(240, Math.floor(width / desksK(ratio)));
|
|
956
1307
|
if (!custom) return autoLayout(officeRooms(view, filter).map((r) => (hideAsleep ? { ...r, nodes: r.nodes.filter(keep) } : r)), { width: deskW });
|
|
957
1308
|
return officeScene(custom, nodes, skin, false, deskW);
|
|
958
|
-
}, [overview, view, filter, custom, width, ratio, skin, hideAsleep, night]);
|
|
1309
|
+
}, [overview, view, filter, custom, width, ratio, skin, hideAsleep, night, seatRev, officeKey, shared]);
|
|
959
1310
|
// ── #2554: All offices' tiles — each stored office (then the lobby: whoever is in no office) laid out as its own view
|
|
960
1311
|
// lays it out, in its own style (desks wrap at a cell's width), with its own seats, walkers and flights ──
|
|
961
1312
|
const lobbyAll = useMemo(() => (overview ? lobbyNodes(stored, view) : []), [overview, stored, view]);
|
|
@@ -998,23 +1349,58 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
998
1349
|
const wander = zones && !overview && !still && !layout;
|
|
999
1350
|
// #3685: who sits where on a visit, kept between ticks (the layout is rebuilt on every state change; the style's
|
|
1000
1351
|
// seats are not): someone who turns idle later never moves a visitor already there. A new style starts afresh.
|
|
1352
|
+
// M-3286: the office's "Idle people stay in their own area" (Edit offices): strolls stay in the area, no visits.
|
|
1353
|
+
const ownArea = !!custom && custom.stayInArea === true;
|
|
1001
1354
|
const visitMemo = useMemo(() => ({ claims: new Map(), idle: null }), [skin]);
|
|
1355
|
+
// M-3293: play — never on a share link's page (no onOpen there, or its own `talk`), with reduced motion, in All
|
|
1356
|
+
// offices, the carousel or Edit layout. `hold`: the person picked up (carried where the pointer is, walked back from
|
|
1357
|
+
// where they are dropped, or seated on another seat in their area: M-3445 #4266/#4267); `reacts`: pats and feeds showing.
|
|
1358
|
+
const play = playAllowed({ on: playOn, still, zones, overview, layout: !!layout, shared }) && !carouselPick;
|
|
1359
|
+
// M-3547 / M-3556: off only for reduced motion — one line under Drag and pat in Display options says so (no override).
|
|
1360
|
+
const playStillOff = playOffForMotion({ on: playOn, still, zones, overview, layout: !!layout, shared }) && !carouselPick;
|
|
1361
|
+
const hold = useMemo(() => createHold(), []), reacts = useRef(new Map()), walkNow = useRef(null), holdTimer = useRef(null);
|
|
1362
|
+
// M-3432 (#4255): custom snacks from the active skin pack (client-local, only when play is enabled).
|
|
1363
|
+
const snacks = useMemo(() => createSnacks(), []);
|
|
1364
|
+
const snackDragCtrl = useMemo(() => createSnackDrag(), []);
|
|
1365
|
+
const packSnacks = useMemo(() => (skin && skin.pack && Array.isArray(skin.pack.snacks) ? skin.pack.snacks : []), [skin]);
|
|
1366
|
+
const snacksById = useMemo(() => new Map(packSnacks.map((s) => [s.id, s])), [packSnacks]);
|
|
1367
|
+
const showSnacks = play && packSnacks.length > 0;
|
|
1368
|
+
const [armedSnack, setArmedSnack] = useState(null);
|
|
1369
|
+
const [snackDrag, setSnackDrag] = useState(null);
|
|
1370
|
+
const snackDropRef = useRef(null), snackGhostRef = useRef(null), snackGhostPosRef = useRef(null), snackTrayRef = useRef(null), snackSwallowRef = useRef(false);
|
|
1371
|
+
const snackCtxRef = useRef({ showSnacks: false, officeKey: "", styleKey: "" });
|
|
1372
|
+
const onSnackClaim = (winner) => {
|
|
1373
|
+
reacts.current.set(winner, { kind: "feed", t0: now() });
|
|
1374
|
+
if (store.tellOn(winner)) void store.tell(winner, "feed");
|
|
1375
|
+
loop.current?.wake();
|
|
1376
|
+
};
|
|
1377
|
+
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]);
|
|
1378
|
+
useEffect(() => { if (!showSnacks) { snackDragCtrl.retire(); snackDropRef.current = null; setArmedSnack(null); setSnackDrag(null); } }, [showSnacks]);
|
|
1379
|
+
useEffect(() => () => { snackDragCtrl.retire(); }, []);
|
|
1002
1380
|
useEffect(() => {
|
|
1003
1381
|
if (!zones || overview) return undefined;
|
|
1004
1382
|
const go = () => {
|
|
1005
|
-
const t = now(), to = walkTargets(desksOf(L), L, t, wander, skin.pack.furniture, night, visitMemo);
|
|
1383
|
+
const t = now(), to = walkTargets(desksOf(L), L, t, wander, skin.pack.furniture, night, visitMemo, ownArea);
|
|
1006
1384
|
// An act's walk; not someone in bed for the night (#2568: bedtime wins, as for mail).
|
|
1007
1385
|
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
1386
|
for (const [name, at] of mail.targets(L, t)) to.set(name, at);
|
|
1009
|
-
|
|
1387
|
+
for (const [name, at] of snacks.targets(t)) to.set(name, at);
|
|
1388
|
+
const held = hold.held(); // M-3293: carried: where the pointer is, no walk
|
|
1389
|
+
if (held) to.set(held.name, held.at);
|
|
1390
|
+
// M-3539: a new office or style (a room's office reads its style after it opens) puts everyone at their place at
|
|
1391
|
+
// once: walking there from the old one's seats drew the asleep standing in the help desk for seconds.
|
|
1392
|
+
const placed = `${officeKey}\n${skin.id}`, fresh = placedRef.current !== placed;
|
|
1393
|
+
placedRef.current = placed;
|
|
1394
|
+
walkers.sync(to, t, L, still, fresh);
|
|
1010
1395
|
// Reduced motion has no loop: drawn again here, or an act's walk (set after the scene was drawn) never shows.
|
|
1011
1396
|
if (still) { if (scene.current && !globalThis.document?.hidden) draw(0); } else loop.current?.wake();
|
|
1012
1397
|
};
|
|
1013
1398
|
go();
|
|
1399
|
+
walkNow.current = go;
|
|
1014
1400
|
if (still) return undefined;
|
|
1015
1401
|
const h = setInterval(go, WANDER.TICK);
|
|
1016
1402
|
return () => clearInterval(h);
|
|
1017
|
-
}, [L, wander, mail, skin, night, actsHere, visitMemo]);
|
|
1403
|
+
}, [L, wander, mail, skin, night, actsHere, visitMemo, ownArea]);
|
|
1018
1404
|
// …and in each tile on a zones style; the traffic within a tile is its own, between tiles the overview's.
|
|
1019
1405
|
useEffect(() => {
|
|
1020
1406
|
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 +1420,8 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1034
1420
|
const touched = useRef(false), fitted = useRef(false), drag = useRef(gestureState());
|
|
1035
1421
|
const miniViewRef = useRef(null), miniRef = useRef(null), overlayEl = useRef(null), tipDeskRef = useRef(null), pctRef = useRef(null);
|
|
1036
1422
|
const labelEls = useRef(new Map()); // #2554: the tiles' labels (tile key → element)
|
|
1037
|
-
|
|
1038
|
-
|
|
1423
|
+
snackCtxRef.current = { showSnacks, officeKey, styleKey };
|
|
1424
|
+
useEffect(() => { snackDragCtrl.retire(); hold.cancel(); seatDropRef.current = null; snacks.clear(); snackDropRef.current = null; setArmedSnack(null); setSnackDrag(null); }, [officeKey, styleKey]);
|
|
1039
1425
|
const keyRef = useRef(officeKey), saveTimer = useRef(0);
|
|
1040
1426
|
// The fit mode (Fit: contain; Fill: cover), kept per office and style like the view.
|
|
1041
1427
|
const [fitRev, setFitRev] = useState(0);
|
|
@@ -1072,7 +1458,7 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1072
1458
|
const v = view0(), sz = sizeRef.current;
|
|
1073
1459
|
const w = c.walks ? walkers.at(c.name, now()) : null;
|
|
1074
1460
|
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 = 12 + (w ? pt.r : pt.r);
|
|
1461
|
+
const p = toScreen(v, pt.x, pt.y), cw = el.offsetWidth || 320, ch = el.offsetHeight || 260, gap = 12 + (w ? pt.r : pt.r);
|
|
1076
1462
|
let x = p.x + gap;
|
|
1077
1463
|
if (x + cw > sz.w - 8) x = p.x - gap - cw;
|
|
1078
1464
|
x = Math.max(8, Math.min(x, sz.w - cw - 8));
|
|
@@ -1227,8 +1613,16 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1227
1613
|
const key = (e) => {
|
|
1228
1614
|
if (e.defaultPrevented || e.altKey || e.ctrlKey || e.metaKey) return;
|
|
1229
1615
|
if (e.key === "Escape") { if (fsRef.current === "immersive") { e.preventDefault(); exitFs(); } return; }
|
|
1616
|
+
const tg = e.target;
|
|
1617
|
+
// #4010: carousel keys at document level so a TV remote works without the canvas focused. Not while a field,
|
|
1618
|
+
// button or link is focused (Space/arrows stay with that control) or over Edit offices / Edit layout.
|
|
1619
|
+
const ck = carouselAct.current;
|
|
1620
|
+
if (ck.on && !carouselHeld(tg) && !editingRef.current && !layoutRef.current) {
|
|
1621
|
+
const a = carouselKey(e);
|
|
1622
|
+
if (a) { e.preventDefault(); ck.act(a); return; }
|
|
1623
|
+
}
|
|
1230
1624
|
if (e.key !== "f" && e.key !== "F") return;
|
|
1231
|
-
const el = ooRef.current
|
|
1625
|
+
const el = ooRef.current;
|
|
1232
1626
|
// Only here: from inside the view, or with nothing focused (never while typing, nor over Edit offices' dialog).
|
|
1233
1627
|
if (!el || typing(tg) || editingRef.current || !(tg === d.body || tg === d.documentElement || tg === d || (tg && el.contains(tg)))) return;
|
|
1234
1628
|
e.preventDefault();
|
|
@@ -1259,6 +1653,8 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1259
1653
|
// or the zoom changes, never on a pan); each frame draws the matte, the layers, the people and the items in the air ──
|
|
1260
1654
|
const scene = useRef(null);
|
|
1261
1655
|
const loop = useRef(null);
|
|
1656
|
+
const clipClocks = useRef(null);
|
|
1657
|
+
if (!clipClocks.current) clipClocks.current = createClipClocks();
|
|
1262
1658
|
// The matte around the scene: the pack's own, else its background's edge (sampled once), else the skin's (tokens);
|
|
1263
1659
|
// All offices: the dashboard's background (each tile is its own scene).
|
|
1264
1660
|
const matte = overview ? pal.bg : (skin.pack && skin.pack.matte) || sampledMatte(skin.backdrop) || (skin.matte ? skin.matte({ pal, mode }) : pal.bg);
|
|
@@ -1274,16 +1670,22 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1274
1670
|
cv.style.setProperty("width", `${BW / ratio}px`);
|
|
1275
1671
|
cv.style.setProperty("height", `${BH / ratio}px`);
|
|
1276
1672
|
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
|
|
1673
|
+
const maxPackFps = overview
|
|
1674
|
+
? Math.max(0, ...tiles.map((tl) => packMaxFps(tl.skin && tl.skin.pack)))
|
|
1675
|
+
: packMaxFps(skin && skin.pack);
|
|
1676
|
+
const fps = Math.max(FPS, Math.min(30, Math.ceil(maxPackFps)));
|
|
1677
|
+
const base = { ctx, ratio, BW, BH, matte, env, fps, dirty: true };
|
|
1278
1678
|
if (overview) {
|
|
1279
1679
|
// Each tile a scene of its own, where the overview puts it (arranged.tiles, in the same order).
|
|
1280
1680
|
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
1681
|
scene.current = { ...base, overview: true, parts, lay: arranged };
|
|
1282
1682
|
} 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)
|
|
1683
|
+
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,
|
|
1684
|
+
hold: play ? hold : null, seatDrop: seatDropRef,
|
|
1685
|
+
snacks: play ? snacks : null, snacksById, ownArea, snackDrop: snackDropRef, onSnackClaim, onSnacksChanged: () => walkNow.current?.() } };
|
|
1284
1686
|
}
|
|
1285
1687
|
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]);
|
|
1688
|
+
}, [L, looks, skin, pal, size.w, size.h, ratio, matte, overview, tiles, tileLooks, arranged, ghosts, night, mail, actsHere, lv, wordsOf, play, snacksById, ownArea]);
|
|
1287
1689
|
|
|
1288
1690
|
/** One frame at `ms` (0: still); whether anything is moving (in the air, or someone walking). */
|
|
1289
1691
|
function draw(ms) {
|
|
@@ -1291,13 +1693,30 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1291
1693
|
if (!s) return false;
|
|
1292
1694
|
placeCard();
|
|
1293
1695
|
const { ctx, BW, BH, env } = s;
|
|
1696
|
+
s.bubbleHits = [];
|
|
1697
|
+
const seenClips = ms > 0 ? new Set() : null;
|
|
1698
|
+
const clocked = (prefix) => (seenClips
|
|
1699
|
+
? { ...env, clock: (k, st, t) => { const fk = `${prefix}${k}`; seenClips.add(fk); return clipClocks.current.elapsed(fk, st, t); } }
|
|
1700
|
+
: env);
|
|
1294
1701
|
// 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
1702
|
const v = view0(), a = v.k * s.ratio, ox = Math.round(v.x * s.ratio), oy = Math.round(v.y * s.ratio);
|
|
1296
1703
|
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
1297
1704
|
ctx.clearRect(0, 0, BW, BH);
|
|
1298
1705
|
ctx.fillStyle = s.matte; ctx.fillRect(0, 0, BW, BH);
|
|
1299
1706
|
ctx.imageSmoothingEnabled = false;
|
|
1300
|
-
if (!s.overview) {
|
|
1707
|
+
if (!s.overview) {
|
|
1708
|
+
// #4379 review: an open card (beside its person, or a bottom sheet) covers part of the scene: a name tag under it is
|
|
1709
|
+
// left out whole, never a fragment showing past its edge. Its box in bitmap px, as the canvas lies on the page.
|
|
1710
|
+
const cardNow = cardEl.current, cvNow = canvasRef.current;
|
|
1711
|
+
if (cardNow && cvNow && typeof cardNow.getBoundingClientRect === "function" && typeof cvNow.getBoundingClientRect === "function") {
|
|
1712
|
+
const r = cardNow.getBoundingClientRect(), c = cvNow.getBoundingClientRect();
|
|
1713
|
+
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;
|
|
1714
|
+
} else s.part.cover = null;
|
|
1715
|
+
const e0 = clocked(""), kc = keepClearOf(canvasRef.current, v);
|
|
1716
|
+
const moved = drawPart(ctx, s.part, a, ox, oy, ms, still, tipNow.current, kc.length ? { ...e0, keepClear: kc } : e0, false, null, s.bubbleHits);
|
|
1717
|
+
if (seenClips) clipClocks.current.prune(seenClips);
|
|
1718
|
+
return drawDialogue(ctx, s, ms) || moved;
|
|
1719
|
+
}
|
|
1301
1720
|
// All offices: each tile on screen drawn as its own view, scaled into it and clipped to it; one off screen is not
|
|
1302
1721
|
// drawn (its flights still land). Then a frame round each tile, and the items flying between tiles.
|
|
1303
1722
|
const hot = tipNow.current, on = new Set(visibleTiles(s.lay, v, sizeRef.current).map((tt) => tt.key)), said = [];
|
|
@@ -1309,7 +1728,7 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1309
1728
|
ctx.save();
|
|
1310
1729
|
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
1311
1730
|
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,
|
|
1731
|
+
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
1732
|
ctx.restore();
|
|
1314
1733
|
ctx.setTransform(1, 0, 0, 1, 0, 0);
|
|
1315
1734
|
ctx.strokeStyle = env.pal.border; ctx.lineWidth = 1;
|
|
@@ -1319,11 +1738,13 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1319
1738
|
const up = still ? [] : cross.frame(ms, s.parts);
|
|
1320
1739
|
// 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
1740
|
// a sender in no tile drawn: the built-in item, in overview units.
|
|
1741
|
+
const crossEnv = clocked("x:");
|
|
1322
1742
|
for (const it of up) {
|
|
1323
1743
|
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,
|
|
1744
|
+
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); }
|
|
1745
|
+
else { ctx.setTransform(a, 0, 0, a, ox, oy); skinFor("pixel").drawProp(ctx, it, ms, crossEnv); }
|
|
1326
1746
|
}
|
|
1747
|
+
if (seenClips) clipClocks.current.prune(seenClips);
|
|
1327
1748
|
return drawDialogue(ctx, s, ms) || moving || up.length > 0 || cross.size() > 0;
|
|
1328
1749
|
}
|
|
1329
1750
|
/**
|
|
@@ -1331,15 +1752,25 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1331
1752
|
* awake (pickFront), with their faces (the pack's portraits; else the agent's avatar, else initials), the speaker's
|
|
1332
1753
|
* words typed out, the agent's line while it works and "+N". Nothing at all while it is off. Whether it moves.
|
|
1333
1754
|
*/
|
|
1334
|
-
function drawDialogue(
|
|
1755
|
+
function drawDialogue(_mapCtx, s, ms) {
|
|
1335
1756
|
const d = dlgRef.current;
|
|
1336
|
-
if (!d) { dlgShown.current = null; return false; }
|
|
1757
|
+
if (!d) { dlgShown.current = null; showDialogueDock(false); return false; }
|
|
1337
1758
|
const t = ms > 0 ? ms : now();
|
|
1338
1759
|
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
|
|
1760
|
+
if (!front) { dlgShown.current = null; showDialogueDock(false); return false; }
|
|
1761
|
+
const who = d.who.get(front.instance), node = who.node;
|
|
1341
1762
|
const stage = stageOf(front, t, node.state === "working", still);
|
|
1342
|
-
if (stage.done) { dlgShown.current = null; return false; }
|
|
1763
|
+
if (stage.done) { dlgShown.current = null; showDialogueDock(false); return false; }
|
|
1764
|
+
showDialogueDock(true);
|
|
1765
|
+
const cv = dialogueCanvasRef.current;
|
|
1766
|
+
if (!cv) return false; // layout commit mounts the dock, then its effect paints even with reduced motion
|
|
1767
|
+
const dw = cv.clientWidth || sizeRef.current.w, dh = cv.clientHeight || (phone ? 160 : 180), L0 = boxLayout(dw, dh);
|
|
1768
|
+
const BW = Math.max(1, Math.floor(dw * s.ratio)), BH = Math.max(1, Math.floor(dh * s.ratio));
|
|
1769
|
+
if (cv.width !== BW) cv.width = BW;
|
|
1770
|
+
if (cv.height !== BH) cv.height = BH;
|
|
1771
|
+
const ctx = cv.getContext("2d");
|
|
1772
|
+
if (!ctx) return false;
|
|
1773
|
+
ctx.setTransform(1, 0, 0, 1, 0, 0); ctx.clearRect(0, 0, BW, BH);
|
|
1343
1774
|
const skinOf = who.skin, pack = skinOf && skinOf.pack;
|
|
1344
1775
|
const pic = (src) => (src && skinOf && typeof skinOf.picture === "function" ? skinOf.picture(src, dlgWake) : null);
|
|
1345
1776
|
const agentName = nodeText(node).primary;
|
|
@@ -1377,27 +1808,38 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1377
1808
|
dlgShown.current = { L, stage, key: who.key, name: front.instance };
|
|
1378
1809
|
const frameSrc = pack && pack.dialogBox && pack.dialogBox.frame, frameIm = frameSrc ? pic(frameSrc) : null;
|
|
1379
1810
|
return drawBox(ctx, {
|
|
1380
|
-
|
|
1811
|
+
// A short landscape dock keeps the name and words; decorative faces need headroom above the box.
|
|
1812
|
+
L, stage, left: dh >= 144 ? personFace() : null, right: dh < 144 || stage.phase === "heard" ? null : agentFace(),
|
|
1381
1813
|
name: answered ? agentName : front.person ? front.person.name || to("dlgSomeone") : to("dlgSomeone"),
|
|
1382
1814
|
lines, status: status ? `${agentName} · ${status}` : null, more,
|
|
1383
1815
|
colours: boxColours(pack && pack.dialogBox, s.env.pal), frame: frameIm ? { im: frameIm, slice: pack.dialogBox.slice || 8, k: pack.scale || 2 } : null,
|
|
1384
1816
|
}, t, { ...s.env, still });
|
|
1385
1817
|
}
|
|
1818
|
+
// A newly mounted dock must paint even when reduced motion leaves the map loop asleep.
|
|
1819
|
+
useLayoutEffect(() => {
|
|
1820
|
+
if (!dialogueOn || !dlgVisible) return;
|
|
1821
|
+
if (scene.current) drawDialogue(scene.current.ctx, scene.current, still ? 0 : now());
|
|
1822
|
+
if (!still) loop.current?.wake();
|
|
1823
|
+
}, [dialogueOn, dlgVisible, dlgSay, width, phone, ratio]);
|
|
1824
|
+
|
|
1386
1825
|
// The loop: drawing only when the frame (FPS) changed or something is in the air; stopped while the tab is hidden,
|
|
1387
1826
|
// gone with the view. Office review: while something walks or flies, one requestAnimationFrame per display frame (the
|
|
1388
1827
|
// motion is smooth); when nothing moves, the poses change at most FPS times a second, so the loop sleeps (a timer)
|
|
1389
1828
|
// until the next frame's start instead of waking at the display's rate only to find nothing to draw.
|
|
1390
1829
|
useEffect(() => {
|
|
1391
1830
|
if (still || typeof requestAnimationFrame !== "function") return undefined;
|
|
1392
|
-
let raf = 0, timer = 0, last = -1, air = true, gone = false;
|
|
1831
|
+
let raf = 0, timer = 0, last = -1, lastFps = FPS, air = true, gone = false;
|
|
1393
1832
|
const tick = () => {
|
|
1394
1833
|
raf = 0;
|
|
1395
1834
|
if (gone || globalThis.document?.hidden || !scene.current) return;
|
|
1396
|
-
const
|
|
1397
|
-
|
|
1835
|
+
const fps = scene.current.fps || FPS;
|
|
1836
|
+
const ms = now(), frame = Math.floor((ms / 1000) * fps); // the clock the trips started on
|
|
1837
|
+
if (scene.current.dirty || frame !== last || fps !== lastFps || air) { scene.current.dirty = false; last = frame; lastFps = fps; air = draw(ms); }
|
|
1398
1838
|
if (air) { raf = requestAnimationFrame(tick); return; }
|
|
1399
|
-
const wait = Math.max(1, Math.ceil(((frame + 1) * 1000) /
|
|
1400
|
-
|
|
1839
|
+
const wait = Math.max(1, Math.ceil(((frame + 1) * 1000) / fps - ms)); // until the next frame starts
|
|
1840
|
+
if (fps > FPS && wait <= 16) { raf = requestAnimationFrame(tick); return; }
|
|
1841
|
+
const sleep = fps > FPS ? Math.max(1, wait - 14) : wait;
|
|
1842
|
+
timer = setTimeout(() => { timer = 0; if (!gone && !raf) raf = requestAnimationFrame(tick); }, sleep);
|
|
1401
1843
|
};
|
|
1402
1844
|
const wake = () => {
|
|
1403
1845
|
air = true;
|
|
@@ -1470,12 +1912,95 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1470
1912
|
pinch: (from, to) => { raw.current = Math.min(OK_MAX, Math.max(OK_MIN, raw.current * (to.dist / from.dist))); setView(pinchOffice(view0(), from, to, raw.current)); } });
|
|
1471
1913
|
/** Where a drag pans: the canvas, and Edit layout's overlay off its handles (the controls, the bar and the list: never). */
|
|
1472
1914
|
const onScene = (el) => !!el && (el === canvasRef.current || (typeof el.closest === "function" && !!el.closest(".ol-svg") && !el.closest(".ol-handle")));
|
|
1915
|
+
/** M-3293 / M-3445: update the floor-level seat drop targets while carrying `h` ({ name, at }). */
|
|
1916
|
+
const updateSeatDrop = (h) => {
|
|
1917
|
+
if (!h || !zones || !skin || !skin.pack) { seatDropRef.current = null; return; }
|
|
1918
|
+
const ds = desksOf(L);
|
|
1919
|
+
seatDropRef.current = {
|
|
1920
|
+
name: h.name,
|
|
1921
|
+
targets: seatDropTargets(skin.pack, ds, h.name),
|
|
1922
|
+
hover: findSeatDropTarget(skin.pack, ds, h.name, h.at),
|
|
1923
|
+
};
|
|
1924
|
+
};
|
|
1925
|
+
/** M-3293 / M-3445: someone picked up — enters `dragged` pose under the pointer, highlights valid seats in their area. */
|
|
1926
|
+
const pickedUp = (pointerId) => {
|
|
1927
|
+
const h = hold.held();
|
|
1928
|
+
if (!h) return;
|
|
1929
|
+
// Captured only now: a press that stays a click must reach the canvas (its card), which a capture would take away.
|
|
1930
|
+
try { stageRef.current.setPointerCapture(pointerId); } catch { /* gone */ }
|
|
1931
|
+
snacks.cancel(h.name);
|
|
1932
|
+
updateSeatDrop(h);
|
|
1933
|
+
walkers.place(h.name, h.at); drag.current.swallow = true;
|
|
1934
|
+
setTip(null); setCard(null); loop.current?.wake();
|
|
1935
|
+
};
|
|
1473
1936
|
const onDown = (e) => {
|
|
1474
1937
|
lastType.current = e.pointerType || "mouse";
|
|
1475
1938
|
if (!onScene(e.target)) return;
|
|
1939
|
+
// M-3293: a press on a person may pick them up — a mouse once it moves (no pan then), a touch once held still
|
|
1940
|
+
// (LONG_MS; a finger that moves first pans, as before).
|
|
1941
|
+
if (play && e.isPrimary !== false && !(e.pointerType === "mouse" && e.button !== 0)) {
|
|
1942
|
+
const d = deskOf(e), w = pointOf(e);
|
|
1943
|
+
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);
|
|
1944
|
+
if (st === "maybe") return; // no pan: a click (their card), or a pick-up once it moves
|
|
1945
|
+
if (st === "press") { const id = e.pointerId; clearTimeout(holdTimer.current); holdTimer.current = setTimeout(() => { if (hold.tick(now()) === "held") pickedUp(id); }, PLAY.LONG_MS); }
|
|
1946
|
+
}
|
|
1476
1947
|
g.down(e);
|
|
1477
1948
|
if (drag.current.pts.size === 2) raw.current = view0().k; // a pinch starts from the zoom shown
|
|
1478
1949
|
};
|
|
1950
|
+
/** 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. */
|
|
1951
|
+
const onStageMove = (e) => {
|
|
1952
|
+
if (hold.state()) {
|
|
1953
|
+
const w = pointOf(e), was = hold.state();
|
|
1954
|
+
const st = w ? hold.move(e.pointerId, w.x, w.y, now(), e.clientX, e.clientY) : hold.state();
|
|
1955
|
+
if (st === "held") {
|
|
1956
|
+
if (was !== "held") pickedUp(e.pointerId);
|
|
1957
|
+
else { const h = hold.held(); updateSeatDrop(h); walkers.place(h.name, h.at); loop.current?.wake(); }
|
|
1958
|
+
return;
|
|
1959
|
+
}
|
|
1960
|
+
if (st === "maybe" || st === "press") return;
|
|
1961
|
+
if (st === "pan") { clearTimeout(holdTimer.current); hold.cancel(); seatDropRef.current = null; }
|
|
1962
|
+
}
|
|
1963
|
+
g.move(e);
|
|
1964
|
+
};
|
|
1965
|
+
/** M-3445 (#4266): settle a dragged character onto a valid seat in their area (or clamp/walk back to their seat). */
|
|
1966
|
+
const finishHoldDrop = (r, commitSeat) => {
|
|
1967
|
+
seatDropRef.current = null;
|
|
1968
|
+
if (!r) return;
|
|
1969
|
+
const ds = desksOf(L);
|
|
1970
|
+
const target = commitSeat && zones && skin && skin.pack ? findSeatDropTarget(skin.pack, ds, r.name, r.at) : null;
|
|
1971
|
+
if (target) {
|
|
1972
|
+
if (!target.current) {
|
|
1973
|
+
const res = applySeatDrop({ pack: skin.pack, desks: ds, seats: seatsRef.current, prefs: seatPrefsRef.current, name: r.name, target });
|
|
1974
|
+
seatsRef.current = res.seats;
|
|
1975
|
+
seatPrefsRef.current = res.prefs;
|
|
1976
|
+
if (!shared) store.saveSeats(officeKey, res.prefs);
|
|
1977
|
+
if (res.swapped) {
|
|
1978
|
+
const occPos = walkers.at(res.swapped.name, now()) || { x: target.x, y: target.y };
|
|
1979
|
+
if (ownArea && !routeStaysInArea(occPos, res.swapped.seat, L, target.area, null)) {
|
|
1980
|
+
walkers.place(res.swapped.name, res.swapped.seat);
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
walkers.place(r.name, { x: target.x, y: target.y });
|
|
1984
|
+
setSeatRev((n) => n + 1);
|
|
1985
|
+
} else {
|
|
1986
|
+
walkers.place(r.name, { x: target.x, y: target.y });
|
|
1987
|
+
walkNow.current?.();
|
|
1988
|
+
}
|
|
1989
|
+
} else {
|
|
1990
|
+
const d = ds.find((x) => x && x.node && x.node.name === r.name);
|
|
1991
|
+
const landAt = ownArea && d ? clampDropForArea(r.at, d.seat, L, d.area) : r.at;
|
|
1992
|
+
walkers.place(r.name, landAt);
|
|
1993
|
+
walkNow.current?.();
|
|
1994
|
+
}
|
|
1995
|
+
loop.current?.wake();
|
|
1996
|
+
};
|
|
1997
|
+
const onStageUp = (e) => {
|
|
1998
|
+
clearTimeout(holdTimer.current);
|
|
1999
|
+
const r = hold.up(e.pointerId);
|
|
2000
|
+
if (r) { finishHoldDrop(r, true); drag.current.swallow = true; setTimeout(() => { if (!drag.current.pts.size) drag.current.swallow = false; }, 0); }
|
|
2001
|
+
g.up(e);
|
|
2002
|
+
};
|
|
2003
|
+
const onStageCancel = (e) => { clearTimeout(holdTimer.current); const r = hold.up(e.pointerId); finishHoldDrop(r, false); g.up(e); };
|
|
1479
2004
|
const onWheel = (e) => {
|
|
1480
2005
|
if (!onScene(e.target) && !(typeof e.target?.closest === "function" && e.target.closest(".ol-handle, .oo-tile-label"))) return;
|
|
1481
2006
|
e.preventDefault();
|
|
@@ -1485,12 +2010,20 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1485
2010
|
};
|
|
1486
2011
|
const onKeyDown = (e) => {
|
|
1487
2012
|
if (e.defaultPrevented) return; // Edit layout's handles move with the arrows
|
|
2013
|
+
if (e.key === "Escape" && hold.held()) {
|
|
2014
|
+
e.preventDefault();
|
|
2015
|
+
clearTimeout(holdTimer.current);
|
|
2016
|
+
const h = hold.held();
|
|
2017
|
+
hold.cancel();
|
|
2018
|
+
finishHoldDrop(h, false);
|
|
2019
|
+
return;
|
|
2020
|
+
}
|
|
1488
2021
|
const tag = e.target && e.target.tagName;
|
|
1489
2022
|
if (tag === "INPUT" || tag === "SELECT" || tag === "TEXTAREA") return;
|
|
1490
2023
|
const z = zoomKey(e);
|
|
1491
2024
|
if (z) { e.preventDefault(); if (z === "fit") fit(); else zoomStep(z === "in" ? 1 : -1); return; }
|
|
1492
2025
|
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 }); }
|
|
2026
|
+
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
2027
|
};
|
|
1495
2028
|
// The keyboard's way through: a desk in the list, or a handle of Edit layout, is brought into view when focused.
|
|
1496
2029
|
const onFocusIn = (e) => {
|
|
@@ -1504,12 +2037,29 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1504
2037
|
};
|
|
1505
2038
|
/** #2861: the dialogue box under a pointer event ({ key, name }: its agent), or null. */
|
|
1506
2039
|
const dlgAt = (e) => {
|
|
1507
|
-
const b = dlgShown.current, r =
|
|
2040
|
+
const b = dlgShown.current, r = dialogueCanvasRef.current ? dialogueCanvasRef.current.getBoundingClientRect() : null;
|
|
1508
2041
|
return b && r && onBox(b.L, b.stage, e.clientX - r.left, e.clientY - r.top) ? b : null;
|
|
1509
2042
|
};
|
|
2043
|
+
// Use the painted prefix and final displaced position, including bubbles outside an overview tile.
|
|
2044
|
+
const bubbleAtEvent = (e) => {
|
|
2045
|
+
// An armed snack owns map taps until the existing placement/feed action consumes it.
|
|
2046
|
+
if (shared || !onOpen || showSnacks && armedSnack) return null;
|
|
2047
|
+
const s = scene.current, r = canvasRef.current?.getBoundingClientRect();
|
|
2048
|
+
if (!s || !r) return null;
|
|
2049
|
+
const hit = officeBubbleAt(s.bubbleHits || [], (e.clientX - r.left) * s.ratio, (e.clientY - r.top) * s.ratio, lastType.current === "touch" ? 44 * s.ratio : 0);
|
|
2050
|
+
return hit && people.some(d => d.node.i && d.node.name === hit.name) ? hit : null;
|
|
2051
|
+
};
|
|
2052
|
+
const openDialogue = (e) => {
|
|
2053
|
+
if (shared || !onOpen || !dlgShown.current || e.detail > 1) return;
|
|
2054
|
+
if (e.type === "keydown") {
|
|
2055
|
+
if (e.repeat || e.key !== "Enter" && e.key !== " ") return;
|
|
2056
|
+
e.preventDefault();
|
|
2057
|
+
}
|
|
2058
|
+
setCard(null); open(dlgShown.current.name);
|
|
2059
|
+
};
|
|
1510
2060
|
const onMove = (e) => {
|
|
1511
|
-
if (e.pointerType === "touch" || g.busy()) return;
|
|
1512
|
-
const onDlg = !!dlgAt(e);
|
|
2061
|
+
if (e.pointerType === "touch" || g.busy() || snackDrag || snackDropRef.current) return;
|
|
2062
|
+
const onDlg = !!dlgAt(e) || !!bubbleAtEvent(e);
|
|
1513
2063
|
if (onDlg !== dlgHot) setDlgHot(onDlg);
|
|
1514
2064
|
const d = onDlg ? null : deskOf(e); const key = d ? d.key : null; if (key !== tip) setTip(key);
|
|
1515
2065
|
};
|
|
@@ -1523,10 +2073,157 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1523
2073
|
};
|
|
1524
2074
|
// #2661: a click (or a tap) on a person opens their card; on the same person again, or off everyone, closes it; on
|
|
1525
2075
|
// someone else, switches to theirs. A double-click skips the card and opens the chat.
|
|
2076
|
+
/** 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). */
|
|
2077
|
+
const nearOf = (e) => {
|
|
2078
|
+
const w = pointOf(e);
|
|
2079
|
+
if (!w || overview) return null;
|
|
2080
|
+
const at = now();
|
|
2081
|
+
const list = people.filter((d) => d.node && d.node.i).map((d) => {
|
|
2082
|
+
const wk = zones ? walkers.at(d.node.name, at) : null;
|
|
2083
|
+
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 };
|
|
2084
|
+
});
|
|
2085
|
+
return nearestPerson(list, w.x, w.y, TAP_R / Math.max(OK_MIN, view0().k));
|
|
2086
|
+
};
|
|
2087
|
+
/** M-3432 (#4255): feed an awake person a snack (plays eat animation + hearts + feed bubble + optional Tell). */
|
|
2088
|
+
const feedPerson = (name, snack, at) => {
|
|
2089
|
+
const t = now();
|
|
2090
|
+
snacks.feed(name, snack, { x: at.x, y: at.y, t, charEatStrip: skin.eatStrip ? skin.eatStrip(name) : null });
|
|
2091
|
+
reacts.current.set(name, { kind: "feed", t0: t });
|
|
2092
|
+
if (store.tellOn(name)) void store.tell(name, "feed");
|
|
2093
|
+
walkNow.current?.();
|
|
2094
|
+
loop.current?.wake();
|
|
2095
|
+
};
|
|
2096
|
+
/** M-3432 (#4255): drop a snack on the floor so nearby idle characters race to it. */
|
|
2097
|
+
const placeSnackAt = (snack, at) => {
|
|
2098
|
+
const t = now();
|
|
2099
|
+
const hidden = scene.current && scene.current.part ? furnitureAt(scene.current.part, t).hidden : null;
|
|
2100
|
+
snacks.place(snack, at, t, { desks: desksOf(L), walkers, hidden, ownArea, areas: L.areas, graph: L });
|
|
2101
|
+
walkNow.current?.();
|
|
2102
|
+
loop.current?.wake();
|
|
2103
|
+
};
|
|
2104
|
+
/** M-3432 (#4255): classify a pointer position while dragging a snack (awake person → feed, floor → place, tray/asleep/outside → cancel). */
|
|
2105
|
+
const snackTargetOf = (e) => {
|
|
2106
|
+
const tray = snackTrayRef.current;
|
|
2107
|
+
if (tray && typeof tray.getBoundingClientRect === "function") {
|
|
2108
|
+
const tr = tray.getBoundingClientRect();
|
|
2109
|
+
if (e.clientX >= tr.left && e.clientX <= tr.right && e.clientY >= tr.top && e.clientY <= tr.bottom) return null;
|
|
2110
|
+
}
|
|
2111
|
+
const st = stageRef.current;
|
|
2112
|
+
if (st && typeof st.getBoundingClientRect === "function") {
|
|
2113
|
+
const sr = st.getBoundingClientRect();
|
|
2114
|
+
if (e.clientX < sr.left || e.clientX > sr.right || e.clientY < sr.top || e.clientY > sr.bottom) return null;
|
|
2115
|
+
}
|
|
2116
|
+
const d = deskOf(e) || (e.pointerType === "touch" ? nearOf(e) : null);
|
|
2117
|
+
if (d && d.node && d.node.i) {
|
|
2118
|
+
if (ASLEEP.has(d.node.state) || d.night) return null;
|
|
2119
|
+
const at = (zones && walkers.at(d.node.name, now())) || d.seat || { x: d.x + d.w / 2, y: d.y + d.h };
|
|
2120
|
+
return { kind: "feed", name: d.node.name, label: nodeText(d.node).primary, x: at.x, y: at.y };
|
|
2121
|
+
}
|
|
2122
|
+
const w = pointOf(e);
|
|
2123
|
+
if (!w || w.x < 0 || w.x > L.width || w.y < 0 || w.y > L.height) return null;
|
|
2124
|
+
return { kind: "place", x: w.x, y: w.y };
|
|
2125
|
+
};
|
|
2126
|
+
/** 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). */
|
|
2127
|
+
const onSnackDown = (snack, e) => {
|
|
2128
|
+
if (!showSnacks || e.isPrimary === false || (e.pointerType === "mouse" && e.button !== 0)) return;
|
|
2129
|
+
e.stopPropagation();
|
|
2130
|
+
const startOffice = officeKey, startStyle = styleKey;
|
|
2131
|
+
let lastKey = "";
|
|
2132
|
+
const moveGhost = (cx, cy) => {
|
|
2133
|
+
const sr = stageRef.current ? stageRef.current.getBoundingClientRect() : null;
|
|
2134
|
+
if (!sr) return;
|
|
2135
|
+
const gx = Math.round(cx - sr.left + 12), gy = Math.round(cy - sr.top - 40);
|
|
2136
|
+
snackGhostPosRef.current = { x: gx, y: gy };
|
|
2137
|
+
const gh = snackGhostRef.current;
|
|
2138
|
+
if (gh && gh.style) gh.style.setProperty("transform", `translate(${gx}px, ${gy}px)`);
|
|
2139
|
+
};
|
|
2140
|
+
const swallowClick = () => {
|
|
2141
|
+
snackSwallowRef.current = true;
|
|
2142
|
+
setTimeout(() => { snackSwallowRef.current = false; }, 0);
|
|
2143
|
+
};
|
|
2144
|
+
snackDragCtrl.start({
|
|
2145
|
+
pid: e.pointerId,
|
|
2146
|
+
sx: e.clientX,
|
|
2147
|
+
sy: e.clientY,
|
|
2148
|
+
slop: PLAY.SLOP,
|
|
2149
|
+
onMove: (ev, { starting }) => {
|
|
2150
|
+
if (starting) { setCard(null); setTip(null); }
|
|
2151
|
+
ev.preventDefault();
|
|
2152
|
+
if (tipNow.current) setTip(null);
|
|
2153
|
+
moveGhost(ev.clientX, ev.clientY);
|
|
2154
|
+
const drop = snackTargetOf(ev);
|
|
2155
|
+
snackDropRef.current = drop;
|
|
2156
|
+
const k = drop ? `${drop.kind}:${drop.name || ""}` : "";
|
|
2157
|
+
if (starting || k !== lastKey) {
|
|
2158
|
+
lastKey = k;
|
|
2159
|
+
setSnackDrag({ snack, kind: drop ? drop.kind : null, label: drop && drop.kind === "feed" ? drop.label : "" });
|
|
2160
|
+
}
|
|
2161
|
+
loop.current?.wake();
|
|
2162
|
+
return drop;
|
|
2163
|
+
},
|
|
2164
|
+
onCommit: (drop) => {
|
|
2165
|
+
snackDropRef.current = null;
|
|
2166
|
+
setSnackDrag(null);
|
|
2167
|
+
swallowClick();
|
|
2168
|
+
const cur = snackCtxRef.current;
|
|
2169
|
+
if (cur.showSnacks && cur.officeKey === startOffice && cur.styleKey === startStyle) {
|
|
2170
|
+
if (drop.kind === "feed") feedPerson(drop.name, snack, { x: drop.x, y: drop.y });
|
|
2171
|
+
else if (drop.kind === "place") placeSnackAt(snack, { x: drop.x, y: drop.y });
|
|
2172
|
+
setArmedSnack(null);
|
|
2173
|
+
}
|
|
2174
|
+
loop.current?.wake();
|
|
2175
|
+
},
|
|
2176
|
+
onCancel: ({ dragging }) => {
|
|
2177
|
+
snackDropRef.current = null;
|
|
2178
|
+
setSnackDrag(null);
|
|
2179
|
+
if (dragging) swallowClick();
|
|
2180
|
+
loop.current?.wake();
|
|
2181
|
+
},
|
|
2182
|
+
});
|
|
2183
|
+
};
|
|
2184
|
+
useEffect(() => {
|
|
2185
|
+
if (!armedSnack) return undefined;
|
|
2186
|
+
const onEsc = (e) => { if (e.key === "Escape" && !e.defaultPrevented) { e.preventDefault(); setArmedSnack(null); } };
|
|
2187
|
+
globalThis.document?.addEventListener?.("keydown", onEsc, true);
|
|
2188
|
+
return () => globalThis.document?.removeEventListener?.("keydown", onEsc, true);
|
|
2189
|
+
}, [armedSnack]);
|
|
2190
|
+
const paintSnackIcon = (st, pxSize = 28) => (cv) => {
|
|
2191
|
+
const g = cv && typeof cv.getContext === "function" ? cv.getContext("2d") : null;
|
|
2192
|
+
if (!g || !st || !skin || typeof skin.drawSnackIcon !== "function") return;
|
|
2193
|
+
const r = deviceRatio(), S = pxSize;
|
|
2194
|
+
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); }
|
|
2195
|
+
g.setTransform(r, 0, 0, r, 0, 0); g.clearRect(0, 0, S, S);
|
|
2196
|
+
skin.drawSnackIcon(g, st, S);
|
|
2197
|
+
};
|
|
1526
2198
|
const onClick = (e) => {
|
|
1527
2199
|
const box = dlgAt(e);
|
|
2200
|
+
const bubble = bubbleAtEvent(e);
|
|
2201
|
+
if ((box || bubble) && !shared && onOpen) {
|
|
2202
|
+
if (!(e.detail > 1)) { setCard(null); open((box || bubble).name); }
|
|
2203
|
+
return;
|
|
2204
|
+
}
|
|
1528
2205
|
if (box) { focusPerson(box.key); return; }
|
|
1529
|
-
|
|
2206
|
+
if (showSnacks && armedSnack) {
|
|
2207
|
+
const snack = snacksById.get(armedSnack);
|
|
2208
|
+
if (snack) {
|
|
2209
|
+
const hit = deskOf(e) || (lastType.current === "touch" ? nearOf(e) : null);
|
|
2210
|
+
if (hit && hit.node && hit.node.i) {
|
|
2211
|
+
if (!ASLEEP.has(hit.node.state) && !hit.night) {
|
|
2212
|
+
const at = (zones && walkers.at(hit.node.name, now())) || hit.seat || { x: hit.x + hit.w / 2, y: hit.y + hit.h };
|
|
2213
|
+
feedPerson(hit.node.name, snack, at);
|
|
2214
|
+
}
|
|
2215
|
+
setArmedSnack(null);
|
|
2216
|
+
return;
|
|
2217
|
+
}
|
|
2218
|
+
const w = pointOf(e);
|
|
2219
|
+
if (w && w.x >= 0 && w.x <= L.width && w.y >= 0 && w.y <= L.height) {
|
|
2220
|
+
placeSnackAt(snack, w);
|
|
2221
|
+
setArmedSnack(null);
|
|
2222
|
+
return;
|
|
2223
|
+
}
|
|
2224
|
+
}
|
|
2225
|
+
}
|
|
2226
|
+
const d = deskOf(e) || (lastType.current === "touch" ? nearOf(e) : null);
|
|
1530
2227
|
if (!d || !d.node.i) { setTip(null); setCard(null); return; }
|
|
1531
2228
|
if (lastType.current === "touch") setTip(null);
|
|
1532
2229
|
cardFrom.current = null;
|
|
@@ -1535,7 +2232,7 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1535
2232
|
// All offices: a double-click on a tile (off its people) opens that office; the lobby is no office.
|
|
1536
2233
|
const onDblClick = (e) => {
|
|
1537
2234
|
const box = dlgAt(e);
|
|
1538
|
-
if (box
|
|
2235
|
+
if (box || bubbleAtEvent(e)) return; // the first click already opened it
|
|
1539
2236
|
const s = scene.current, w = pointOf(e), hit = deskOf(e);
|
|
1540
2237
|
if (hit && hit.node.i) { setCard(null); open(hit.node.name); return; } // #2661: a person's chat, past the card
|
|
1541
2238
|
if (!overview || !s || !s.overview || !w || hit) return;
|
|
@@ -1549,8 +2246,9 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1549
2246
|
|
|
1550
2247
|
const auto = !custom && !overview;
|
|
1551
2248
|
// 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
|
-
|
|
2249
|
+
// editor is open, nor a second session (nor in All offices: custom is null there; nor in the carousel: the slide is
|
|
2250
|
+
// a stored office but Edit waits).
|
|
2251
|
+
const canLayout = canEdit && storedRev !== null && !!custom && zones && !loading && baseSkin.id === custom.skin && !editing && !layout && !carouselPick;
|
|
1554
2252
|
const openLayout = () => {
|
|
1555
2253
|
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
2254
|
setTip(null);
|
|
@@ -1583,7 +2281,29 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1583
2281
|
const teamValue = (opts.find((o) => o.team === f.team) || opts[0]).value;
|
|
1584
2282
|
const setF = (next) => { const v = filterOk(next); store.saveFilter(v); setFilter(v); };
|
|
1585
2283
|
// While Edit layout is open the office stays (its picker is disabled; this is the guard behind it).
|
|
1586
|
-
const pick = (id) => {
|
|
2284
|
+
const pick = (id) => {
|
|
2285
|
+
if (layoutRef.current) return;
|
|
2286
|
+
if (id === CAROUSEL_ID) {
|
|
2287
|
+
const cur = store.carousel();
|
|
2288
|
+
const ids = carouselIdsOk(cur ? cur.ids : null, stored);
|
|
2289
|
+
const next = { ids: ids.length ? ids : stored.map((o) => o.id), interval: intervalOk(cur && cur.interval) };
|
|
2290
|
+
store.saveCarousel(next); setCarSaved(next); setCarIndex(0); setCarPlaying(true);
|
|
2291
|
+
}
|
|
2292
|
+
store.saveChoice(id); setChoice(id); setTip(null);
|
|
2293
|
+
};
|
|
2294
|
+
const setCarIds = (ids) => {
|
|
2295
|
+
const next = { ids, interval: intervalOk(carSaved && carSaved.interval) };
|
|
2296
|
+
store.saveCarousel(next); setCarSaved(next);
|
|
2297
|
+
};
|
|
2298
|
+
const toggleCarId = (id) => {
|
|
2299
|
+
const have = new Set(carIds);
|
|
2300
|
+
if (have.has(id)) have.delete(id); else have.add(id);
|
|
2301
|
+
setCarIds(stored.map((o) => o.id).filter((x) => have.has(x)));
|
|
2302
|
+
};
|
|
2303
|
+
const setCarInterval = (n) => {
|
|
2304
|
+
const next = { ids: carSaved && Array.isArray(carSaved.ids) ? carSaved.ids : carIds, interval: intervalOk(n) };
|
|
2305
|
+
store.saveCarousel(next); setCarSaved(next);
|
|
2306
|
+
};
|
|
1587
2307
|
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
2308
|
const tipText = tipDesk ? nodeText(tipDesk.node) : null;
|
|
1589
2309
|
// #2661: the card's person (gone from the office, filtered out or the office changed: it closes).
|
|
@@ -1621,12 +2341,12 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1621
2341
|
setView(centreOn({ ...v, k }, size, at.x, at.y));
|
|
1622
2342
|
};
|
|
1623
2343
|
/** The card's picture: the person's idle frame in the office's style (pack strip or built-in figure). */
|
|
1624
|
-
const drawAvatar = (cv) => {
|
|
2344
|
+
const drawAvatar = (cv, sizePx = 56) => {
|
|
1625
2345
|
const s = scene.current, c = cardOf;
|
|
1626
2346
|
const g = cv && cv.getContext ? cv.getContext("2d") : null;
|
|
1627
2347
|
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; }
|
|
2348
|
+
const r = deviceRatio(), W = Number(sizePx) || 56;
|
|
2349
|
+
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
2350
|
g.setTransform(1, 0, 0, 1, 0, 0); g.clearRect(0, 0, cv.width, cv.height); g.imageSmoothingEnabled = false;
|
|
1631
2351
|
const look = { ...c.look, pose: "idle", dim: false, match: false, badge: null, notag: true, free: true, work: 0, sign: null };
|
|
1632
2352
|
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 };
|
|
@@ -1639,52 +2359,147 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1639
2359
|
const miniRects = overview ? arranged.tiles.map((tt) => ({ key: tt.key, x: tt.x, y: tt.y, w: tt.w, h: tt.h }))
|
|
1640
2360
|
: 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
2361
|
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}
|
|
2362
|
+
// The switcher: the whole fleet, All offices (two or more stored), Carousel (two or more, signed-in), each stored office.
|
|
2363
|
+
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
2364
|
aria-label=${to("office")} onChange=${(e) => pick(e.target.value)}>
|
|
1645
2365
|
<option value=${AUTO_ID}>${to("allOffice")}</option>
|
|
1646
2366
|
${overviewOk(stored) ? html`<option value=${ALL_ID}>${to("allOffices")}</option>` : null}
|
|
2367
|
+
${opening == null && carouselOk(stored) ? html`<option value=${CAROUSEL_ID}>${to("carousel")}</option>` : null}
|
|
1647
2368
|
${stored.map((o) => html`<option key=${o.id} value=${o.id}>${o.name}</option>`)}
|
|
1648
2369
|
</select>`;
|
|
1649
|
-
|
|
1650
|
-
<
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
2370
|
+
const carChrome = () => !carousel ? null : html`<button type="button" class="btn btn-sm oo-car-pause" onClick=${() => setCarPlaying((p) => !p)}>${to(carPlaying ? "pause" : "resume")}</button>
|
|
2371
|
+
<button type="button" class="btn btn-sm oo-car-next" onClick=${() => stepCar(1)}>${to("next")}</button>
|
|
2372
|
+
<span class="muted oo-car-now">${custom ? custom.name : ""} · ${to(carPlaying ? "playing" : "paused")}</span>`;
|
|
2373
|
+
// M-3253: the zone pills (a phone, one office on a zones style): the whole office, or an area at ZONE_K, centred.
|
|
2374
|
+
const zoneList = compact && zones && !overview && !layout ? Object.entries(L.areas || {}).map(([key, a]) => ({ key, rect: a.rect,
|
|
2375
|
+
n: people.filter((d) => d.area === areaName(key)).length })).filter((z) => z.rect && z.n > 0) : [];
|
|
2376
|
+
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)); };
|
|
2377
|
+
const closeMore = () => onMore && onMore(false);
|
|
2378
|
+
// M-3556: Display options (style, the toggles, the key) in a dropdown on a desk — non-modal, like Members: the office
|
|
2379
|
+
// stays in view, so a tick shows at once; a click elsewhere or Esc closes it. The Fleet office opens it from ⚙ in its
|
|
2380
|
+
// bar (open here); a Hub room's office (foldBar) from the gear in the zoom stack, open as its page says (`more`).
|
|
2381
|
+
const roomGear = folded && !compact;
|
|
2382
|
+
const [displayOpen, setDisplayOpen] = useState(false);
|
|
2383
|
+
const dispOpen = roomGear ? !!more : displayOpen;
|
|
2384
|
+
const setDisp = (v) => (roomGear ? onMore(v) : setDisplayOpen(v));
|
|
2385
|
+
const displayRef = useRef(null);
|
|
2386
|
+
useEffect(() => {
|
|
2387
|
+
if (!dispOpen) return undefined;
|
|
2388
|
+
const away = (e) => { if (displayRef.current && !displayRef.current.contains(e.target)) setDisp(false); };
|
|
2389
|
+
// Esc from inside it hands focus back to its button (as the sheet did), so the keyboard is not left on nothing.
|
|
2390
|
+
const esc = (e) => {
|
|
2391
|
+
if (e.key !== "Escape") return;
|
|
2392
|
+
const box = displayRef.current, back = !!box && typeof box.contains === "function" && box.contains(globalThis.document?.activeElement);
|
|
2393
|
+
setDisp(false);
|
|
2394
|
+
if (back) box.querySelector("button")?.focus?.();
|
|
2395
|
+
};
|
|
2396
|
+
document.addEventListener("pointerdown", away); document.addEventListener("keydown", esc);
|
|
2397
|
+
return () => { document.removeEventListener("pointerdown", away); document.removeEventListener("keydown", esc); };
|
|
2398
|
+
}, [dispOpen]);
|
|
2399
|
+
// M-3556: the phone sheet is taller than a phone: while more is below its fold, its foot fades (data-more on the body).
|
|
2400
|
+
useEffect(() => {
|
|
2401
|
+
if (!compact || !more) return undefined;
|
|
2402
|
+
const el = globalThis.document?.querySelector?.(".oo-sheet .dlg-body");
|
|
2403
|
+
if (!el || typeof el.addEventListener !== "function") return undefined;
|
|
2404
|
+
const upd = () => { const below = el.scrollTop + el.clientHeight < el.scrollHeight - 2; if (below) el.setAttribute("data-more", ""); else el.removeAttribute("data-more"); };
|
|
2405
|
+
const raf = globalThis.requestAnimationFrame ? globalThis.requestAnimationFrame(upd) : (upd(), 0);
|
|
2406
|
+
el.addEventListener("scroll", upd, { passive: true }); globalThis.addEventListener?.("resize", upd);
|
|
2407
|
+
// Its content can change while it is open (another office, All offices' lobby tile, a note): re-measure then too
|
|
2408
|
+
// (Prism #3556 r3 P3).
|
|
2409
|
+
const RO = globalThis.ResizeObserver, ro = typeof RO === "function" ? new RO(upd) : null;
|
|
2410
|
+
if (ro) { ro.observe(el); for (const c of el.children || []) ro.observe(c); }
|
|
2411
|
+
return () => { globalThis.cancelAnimationFrame?.(raf); el.removeEventListener("scroll", upd); globalThis.removeEventListener?.("resize", upd); ro?.disconnect(); };
|
|
2412
|
+
}, [compact, more]);
|
|
2413
|
+
// In the sheet: Edit offices and Edit layout open their own editors (outside it): the sheet closes after their click.
|
|
2414
|
+
const sheetClick = (e) => { if (typeof e.target?.closest === "function" && e.target.closest(".oo-edit, .oo-layout")) closeMore(); };
|
|
2415
|
+
const tile = (icon, label, fn, cls, pressed) => html`<button type="button" class=${`oo-sheet-tile ${cls}`} aria-pressed=${pressed === undefined ? undefined : pressed ? "true" : "false"}
|
|
2416
|
+
onClick=${fn}><${Icon} name=${icon} size=${20} /><span>${label}</span></button>`;
|
|
2417
|
+
// M-3556: the bar in three groups — scope (which office, whom: left of the desk's one row), the display options (behind
|
|
2418
|
+
// ⚙) and the actions (right). A phone's ⋯ sheet lists all three in that order.
|
|
2419
|
+
const scopeItems = html`
|
|
2420
|
+
${oneOffice ? null : html`<label class="oo-pick"><span class="oo-pick-label">${to("office")}</span>${officeSelect("oo-office")}</label>`}
|
|
1657
2421
|
${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 : "" }); }}>
|
|
2422
|
+
<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
2423
|
${opts.map((o) => html`<option key=${o.value} value=${o.value}>${o.label}</option>`)}
|
|
1660
2424
|
</select></label>
|
|
1661
2425
|
<${People} nodes=${everyone} pinned=${f.pinned} onChange=${(pinned) => setF({ ...f, pinned })} />` : null}
|
|
2426
|
+
${carouselPick ? html`<div class="oo-carousel">
|
|
2427
|
+
<${CarouselOffices} stored=${stored} carIds=${carIds} open=${carMenu} onOpen=${setCarMenu} onToggle=${toggleCarId}
|
|
2428
|
+
onAll=${() => setCarIds(stored.map((o) => o.id))} onNone=${() => setCarIds([])} />
|
|
2429
|
+
<label class="oo-pick"><span class="oo-pick-label">${to("interval")}</span>
|
|
2430
|
+
<select class="tb-select oo-car-interval" value=${String(intervalOk(carSaved && carSaved.interval))} onChange=${(e) => setCarInterval(Number(e.target.value))}>
|
|
2431
|
+
${INTERVALS.map((n) => html`<option key=${n} value=${n}>${n < 60 ? to("intervalSec", n) : to("intervalMin", n / 60)}</option>`)}
|
|
2432
|
+
</select></label>
|
|
2433
|
+
${carChrome()}
|
|
2434
|
+
</div>` : null}
|
|
2435
|
+
${custom && baseSkin.id !== custom.skin && !loading ? html`<span class="muted oo-note">${to("skinUnknown", styleName(custom.skin))}</span>` : null}
|
|
2436
|
+
${placed.ignored ? html`<span class="muted oo-note">${to("layoutIgnored")}</span>` : null}
|
|
2437
|
+
${L.unseated ? html`<span class="muted oo-note">${to("unseated", L.unseated)}</span>` : null}
|
|
2438
|
+
`;
|
|
2439
|
+
const optionItems = html`
|
|
2440
|
+
${auto ? html`<label class="oo-pick"><span class="oo-pick-label">${to("styleLabel")}</span>
|
|
2441
|
+
<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)}>
|
|
2442
|
+
${styles.map((id) => html`<option key=${id} value=${id}>${to(`style_${id}`)}</option>`)}
|
|
2443
|
+
${packs.map((pk) => html`<option key=${`pack:${pk.id}`} value=${pk.id}>${pk.name}</option>`)}
|
|
2444
|
+
</select></label>` : null}
|
|
1662
2445
|
<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>
|
|
2446
|
+
${zones && !overview && !shared ? html`<label class="check oo-play"><input type="checkbox" checked=${playOn && !still} disabled=${still}
|
|
2447
|
+
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
2448
|
${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
2449
|
<label class="check oo-dialogue" title=${to("dialogueTitle")}><input type="checkbox" checked=${dialogueOn} onChange=${toggleDialogue} /><span>${to("dialogue")}</span></label>
|
|
1665
2450
|
${overview ? html`<label class="check oo-lobby-tile" title=${lobbyAll.length ? undefined : to("lobbyEveryone")}><input type="checkbox" checked=${lobbyOn && lobbyAll.length > 0}
|
|
1666
2451
|
disabled=${!lobbyAll.length} onChange=${() => { const v = !lobbyOn; store.saveLobbyTile(v); setLobbyOn(v); setTip(null); }} /><span>${to("lobbyTile")}</span></label>
|
|
1667
2452
|
${lobbyAll.length ? null : html`<span class="muted oo-note oo-lobby-none">${to("lobbyEveryone")}</span>`}` : null}
|
|
1668
|
-
${
|
|
1669
|
-
|
|
2453
|
+
${traffic ? html`<label class="check oo-key-tick" title=${to("keyTitle")}><input type="checkbox" checked=${keyOpen}
|
|
2454
|
+
onChange=${() => { const v = !keyOpen; store.saveKeyOpen(v); setKeyOpen(v); }} /><span>${to("key")}</span></label>` : null}
|
|
1670
2455
|
${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}
|
|
2456
|
+
`;
|
|
2457
|
+
const actionItems = html`
|
|
2458
|
+
${canEdit && storedRev !== null ? html`<button type="button" class="btn btn-sm oo-edit" onClick=${() => { if (!overview && !carouselPick) setEditing(true); }} disabled=${!!layout || overview || carouselPick}
|
|
2459
|
+
title=${overview || carouselPick ? to(carouselPick ? "carouselNoEdit" : "overviewNoEdit") : undefined}>${t("orge.edit")}</button>` : null}
|
|
1676
2460
|
${canLayout ? html`<button type="button" class="btn btn-sm oo-layout" onClick=${openLayout}>${t("orgl.edit")}</button>` : null}
|
|
1677
2461
|
${canShare ? html`<${ShareButton} offices=${stored} current=${overview ? "all" : custom ? custom.id : null} disabled=${!!layout}
|
|
1678
2462
|
get=${lease ? (path, o) => lease.fetch(path, o) : undefined} />` : null}
|
|
1679
|
-
|
|
2463
|
+
`;
|
|
2464
|
+
// The sheet: a "Display options" heading over the options (a Hub room's too), a rule before the actions (a room has none).
|
|
2465
|
+
const hasActions = (canEdit && storedRev !== null) || canLayout || canShare;
|
|
2466
|
+
const barItems = html`${scopeItems}<h3 class="oo-sheet-h">${to("display")}</h3>${optionItems}
|
|
2467
|
+
${hasActions ? html`<hr class="oo-sheet-rule" />` : null}${actionItems}`;
|
|
2468
|
+
// A room's dropdown hangs from the zoom stack's top, inside the stage (which clips): it is never taller than the
|
|
2469
|
+
// stage's room below its top (Prism #3556 P2: a 340 px stage); a longer list scrolls.
|
|
2470
|
+
const fitPop = (el) => {
|
|
2471
|
+
if (!el || !roomGear || !stageRef.current || typeof el.getBoundingClientRect !== "function") return;
|
|
2472
|
+
const st = stageRef.current.getBoundingClientRect(), top = el.getBoundingClientRect().top;
|
|
2473
|
+
if (st && st.height > 0) el.style.maxHeight = `${popMaxHeight(st.bottom, top)}px`;
|
|
2474
|
+
};
|
|
2475
|
+
const displayMenu = (opener) => html`<div class=${`oo-display${roomGear ? " oo-display-zoom" : ""}`} ref=${displayRef}>${opener}
|
|
2476
|
+
${dispOpen ? html`<div class="oo-display-pop" role="group" aria-label=${to("display")} ref=${fitPop}><h3 class="oo-display-h">${to("display")}</h3>
|
|
2477
|
+
<div class="oo-bar oo-display-list">${optionItems}</div></div>` : null}</div>`;
|
|
2478
|
+
return html`<div class=${`oo${fs ? ` fs ${fs}` : ""}${compact ? " phone" : ""}${dlgVisible ? " has-dialogue" : ""}`} ref=${ooRef}>
|
|
2479
|
+
${folded ? null : html`<div class="oo-bar oo-bar-row">
|
|
2480
|
+
<div class="oo-bar-scope">${scopeItems}</div>
|
|
2481
|
+
<div class="oo-bar-actions">${actionItems}
|
|
2482
|
+
${displayMenu(html`<button type="button" class=${`btn btn-sm oo-display-btn${dispOpen ? " on" : ""}`} aria-expanded=${dispOpen ? "true" : "false"}
|
|
2483
|
+
onClick=${() => setDisp(!dispOpen)}><${Icon} name="settings" size=${14} /><span>${to("display")}</span></button>`)}
|
|
2484
|
+
</div>
|
|
2485
|
+
</div>`}
|
|
2486
|
+
${compact && more ? html`<${Dialog} title=${to("office")} cls="oo-sheet" onClose=${closeMore}>
|
|
2487
|
+
${compact ? html`<div class="oo-sheet-tiles">
|
|
2488
|
+
${tile("fitwidth", to("fit"), () => { closeMore(); fit(); }, "oo-sheet-fit")}
|
|
2489
|
+
${tile("fitwidth", to("fill"), toggleFill, "oo-sheet-fill", fitMode === "cover")}
|
|
2490
|
+
${tile("fullscreen", to("fullscreen"), () => { closeMore(); enterFs(); }, "oo-sheet-fs")}
|
|
2491
|
+
</div>` : null}
|
|
2492
|
+
${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}
|
|
2493
|
+
<div class="oo-bar oo-sheet-bar" onClick=${sheetClick}>${barItems}</div>
|
|
2494
|
+
</${Dialog}>` : null}
|
|
1680
2495
|
${traffic && keyOpen ? html`<${OfficeKey} pal=${pal} />` : null}
|
|
1681
|
-
${editing && !overview ? html`<${OfficeEditor} offices=${stored} rev=${storedRev} view=${view} store=${store} packs=${packs}
|
|
2496
|
+
${editing && !overview && !carouselPick ? html`<${OfficeEditor} offices=${stored} rev=${storedRev} view=${view} store=${store} packs=${packs}
|
|
1682
2497
|
ask=${ask} current=${() => shown.current} onSaved=${adopt} onClose=${() => setEditing(false)} />` : null}
|
|
1683
2498
|
${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=${
|
|
2499
|
+
<div class=${`oo-stage${layout ? " editing" : ""}`} ref=${stageRef} onPointerDown=${onDown} onPointerMove=${onStageMove} onPointerUp=${onStageUp} onPointerCancel=${onStageCancel}
|
|
1685
2500
|
onWheel=${onWheel} onKeyDown=${onKeyDown} onFocusIn=${onFocusIn} onClickCapture=${g.clickCapture}>
|
|
1686
2501
|
${dialogueOn ? html`<div class="sr-only oo-dialogue-live" aria-live="polite">${dlgSay}</div>` : null}
|
|
1687
|
-
<canvas ref=${canvasRef} class=${`oo-canvas${(tipDesk && tipDesk.node.i) || dlgHot ? " hot" : ""}`} role="application" tabindex="0" aria-label=${to(overview ? "labelAll" : "label")}
|
|
2502
|
+
<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
2503
|
onPointerMove=${onMove} onPointerLeave=${() => setTip(null)} onClick=${onClick} ondblclick=${onDblClick}></canvas>
|
|
1689
2504
|
${overview ? tiles.map((tl) => {
|
|
1690
2505
|
const text = to("tileLabel", tl.name, tl.count), at = (el) => { if (el) labelEls.current.set(tl.key, el); else labelEls.current.delete(tl.key); };
|
|
@@ -1696,21 +2511,41 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1696
2511
|
stale=${layoutStale ? t("orgl.stale") : ""} onChange=${onDraft} onSave=${saveLayout} onClose=${closeLayout} />` : null}
|
|
1697
2512
|
${tipText && tip !== card ? html`<div ref=${tipRef} class="oo-tip" role="tooltip">
|
|
1698
2513
|
<strong>${tipText.primary}</strong>${tipText.secondary ? html` <span class="muted mono">${tipText.secondary}</span>` : null}
|
|
1699
|
-
<div>${tipText.sub}</div
|
|
2514
|
+
<div>${words ? stateOf(tipDesk.node) : tipText.sub}</div>${nowOf(tipDesk.node) ? html`<div class="muted">${nowOf(tipDesk.node)}</div>` : null}
|
|
1700
2515
|
${tipDesk.office ? html`<div class="muted oo-tip-office">${tipDesk.office}</div>` : null}
|
|
1701
2516
|
</div>` : null}
|
|
1702
2517
|
${cardOf ? html`<${OfficeCard} key=${cardOf.key}
|
|
1703
|
-
model=${cardModel({ node: cardOf.node, lv, levels: wordsOf(cardOf.skin), share: !onOpen,
|
|
1704
|
-
state:
|
|
2518
|
+
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) : "",
|
|
2519
|
+
state: stateOf(cardOf.node), now: nowOf(cardOf.node),
|
|
1705
2520
|
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
|
-
|
|
2521
|
+
avatar=${drawAvatar} sheet=${phone || size.w < SHEET_W} place=${(el) => { const was = cardEl.current; cardEl.current = el; placeCard();
|
|
2522
|
+
// #4379 review: the tags it covers (or uncovers) are judged at the next frame; a still scene draws one now.
|
|
2523
|
+
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(); } }}
|
|
2524
|
+
onChat=${onOpen ? () => { const n = cardOf.node.name; setCard(null); open(n); } : null} onFind=${findCard} onClose=${closeCard}
|
|
2525
|
+
onReact=${play ? (kind) => {
|
|
2526
|
+
const n = cardOf.node.name;
|
|
2527
|
+
if (kind === "feed" && !ASLEEP.has(cardOf.node.state) && !cardOf.box.night) {
|
|
2528
|
+
const sn = (armedSnack && snacksById.get(armedSnack)) || packSnacks[0] || null;
|
|
2529
|
+
if (sn || (skin.eatStrip && skin.eatStrip(n))) {
|
|
2530
|
+
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 };
|
|
2531
|
+
snacks.feed(n, sn, { x: at.x, y: at.y, t: now(), charEatStrip: skin.eatStrip ? skin.eatStrip(n) : null });
|
|
2532
|
+
walkNow.current?.();
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
reacts.current.set(n, { kind, t0: now() }); loop.current?.wake(); if (store.tellOn(n)) void store.tell(n, kind);
|
|
2536
|
+
} : null}
|
|
2537
|
+
tell=${play ? { on: store.tellOn(cardOf.node.name), set: (v) => { store.saveTell(cardOf.node.name, v); setTellRev((x) => x + 1); } } : null}
|
|
2538
|
+
packCard=${cardOf.skin?.pack?.card || null}
|
|
2539
|
+
picture=${typeof cardOf.skin?.picture === "function" ? cardOf.skin.picture : null}
|
|
2540
|
+
portrait=${cardOf.skin?.pack ? portraitSrc(cardOf.skin.pack, { agent: cardOf.node.name, state: cardOf.node.state }) : null}
|
|
2541
|
+
packScale=${cardOf.skin?.pack?.scale || 2} action=${cardAction ? cardAction(cardOf.node.name) : null} />` : null}
|
|
1708
2542
|
<ul class="oo-desks" aria-label=${to("desks")}>${people.map((d) => {
|
|
1709
|
-
const nt = nodeText(d.node), cap =
|
|
2543
|
+
const nt = nodeText(d.node), cap = nowOf(d.node), where = d.office ? ` · ${d.office}` : "";
|
|
2544
|
+
const full = words ? `${nt.primary} — ${stateOf(d.node)}` : nt.full;
|
|
1710
2545
|
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=${`${
|
|
2546
|
+
? 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
2547
|
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}>${
|
|
2548
|
+
: html`<span class="oo-desk" data-name=${d.node.name} data-key=${d.key}>${full}</span>`}</li>`;
|
|
1714
2549
|
})}</ul>
|
|
1715
2550
|
<div class="oc-zoom oo-zoom" role="group" aria-label=${t("orgc.view")}>
|
|
1716
2551
|
<output ref=${pctRef} class="oo-zoom-pct"></output>
|
|
@@ -1720,8 +2555,28 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1720
2555
|
<button type="button" class=${`icon-btn oo-fill${fitMode === "cover" ? " on" : ""}`} aria-pressed=${fitMode === "cover" ? "true" : "false"} aria-label=${to("fillTitle")}
|
|
1721
2556
|
title=${to("fillTitle")} onClick=${toggleFill}>${to("fill")}</button>
|
|
1722
2557
|
<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>
|
|
2558
|
+
${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
2559
|
</div>
|
|
1724
|
-
${
|
|
2560
|
+
${showSnacks ? html`<div ref=${snackTrayRef} class="oo-snacks" role="toolbar" aria-label=${to("snacks")}>
|
|
2561
|
+
${packSnacks.map((sn) => {
|
|
2562
|
+
const lb = snackLabel(sn, lang());
|
|
2563
|
+
return html`<button key=${sn.id} type="button" class="icon-btn oo-snack" data-snack=${sn.id}
|
|
2564
|
+
aria-label=${to("snackArm", lb)} title=${lb} aria-pressed=${armedSnack === sn.id ? "true" : "false"}
|
|
2565
|
+
onPointerDown=${(e) => onSnackDown(sn, e)}
|
|
2566
|
+
onClick=${(e) => { e.stopPropagation(); if (snackSwallowRef.current) return; setArmedSnack((cur) => (cur === sn.id ? null : sn.id)); }}>
|
|
2567
|
+
<canvas class="oo-snack-icon" width="28" height="28" aria-hidden="true" ref=${paintSnackIcon(sn.sprite, 28)}></canvas>
|
|
2568
|
+
</button>`;
|
|
2569
|
+
})}
|
|
2570
|
+
</div>` : null}
|
|
2571
|
+
${snackDrag ? html`<div class="oo-snack-ghost" aria-hidden="true" ref=${(el) => {
|
|
2572
|
+
snackGhostRef.current = el;
|
|
2573
|
+
if (el && el.style && snackGhostPosRef.current) el.style.setProperty("transform", `translate(${snackGhostPosRef.current.x}px, ${snackGhostPosRef.current.y}px)`);
|
|
2574
|
+
}}>
|
|
2575
|
+
<canvas class="oo-snack-icon" width="28" height="28" ref=${paintSnackIcon(snackDrag.snack.sprite, 28)}></canvas>
|
|
2576
|
+
${snackDrag.kind === "feed" ? html`<span class="oo-snack-hint">${to("snackFeed", snackDrag.label)}</span>`
|
|
2577
|
+
: snackDrag.kind === "place" ? html`<span class="oo-snack-hint">${to("snackPlace")}</span>` : null}
|
|
2578
|
+
</div>` : null}
|
|
2579
|
+
${fs ? html`<div class="oo-fs-bar">${oneOffice ? null : officeSelect("oo-fs-office")}${carChrome()}</div>` : null}
|
|
1725
2580
|
<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
2581
|
<title>${to("overview")}</title>
|
|
1727
2582
|
<rect class="oo-mini-matte" x=${-L.width} y=${-L.height} width=${L.width * 3} height=${L.height * 3} fill=${matte} />
|
|
@@ -1731,5 +2586,13 @@ export function Office({ view, traffic, q = "", lease, onOpen, assetUrl, assetIm
|
|
|
1731
2586
|
<rect ref=${miniViewRef} class="oc-mini-view oo-mini-view" />
|
|
1732
2587
|
</svg>
|
|
1733
2588
|
</div>
|
|
2589
|
+
${zoneList.length ? html`<div class="oo-zone-pills" role="group" aria-label=${to("zones")} ref=${pillsRef} onScroll=${pillsCue}>
|
|
2590
|
+
<button type="button" class="btn btn-sm oo-zone-all" onClick=${() => fit()}>${to("zoneAll")}</button>
|
|
2591
|
+
${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>`)}
|
|
2592
|
+
</div>` : null}
|
|
2593
|
+
${dialogueOn && dlgVisible ? html`<canvas class="oo-dialogue-canvas" ref=${dialogueCanvasRef}
|
|
2594
|
+
role=${onOpen && !shared ? "button" : "img"} tabindex=${onOpen && !shared ? "0" : null}
|
|
2595
|
+
aria-label=${onOpen && !shared ? to("dlgOpenChat") : dlgSay} title=${onOpen && !shared ? to("dlgOpenChat") : null}
|
|
2596
|
+
onClick=${openDialogue} onKeyDown=${openDialogue}></canvas>` : null}
|
|
1734
2597
|
</div>`;
|
|
1735
2598
|
}
|