rvlib-shipkit 2.29.0 → 2.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -1
- package/package.json +2 -1
- package/src/advisors/app-graph.ts +1 -1
- package/src/advisors/expose.ts +5 -1
- package/src/advisors/r2.ts +7 -9
- package/src/advisors/routes.ts +29 -2
- package/src/advisors/scan.ts +11 -0
- package/src/agent-time/accounts-usage.ts +8 -0
- package/src/agent-time/claude-sessions.ts +32 -0
- package/src/agent-time/hooks.ts +1 -1
- package/src/agent-time/live.ts +5 -2
- package/src/agent-time/registry.ts +186 -89
- package/src/agent-time/store.ts +6 -4
- package/src/asks/ask-doc.ts +2 -2
- package/src/asks/ask-store.ts +22 -7
- package/src/check.ts +9 -1
- package/src/checks/SK001-package-json-shape.check.ts +1 -0
- package/src/checks/SK003-claude-md-shape.check.ts +1 -0
- package/src/checks/SK004-gitignore-policy.check.ts +12 -6
- package/src/checks/SK008-reviewer-agent.check.ts +4 -7
- package/src/checks/SK013-one-way-in-policy.check.ts +1 -0
- package/src/checks/SK017-vscode-hub-task.check.ts +1 -0
- package/src/checks/SK024-identity-colors.check.ts +1 -1
- package/src/checks/SK027-agent-wiki-links.check.ts +2 -1
- package/src/checks/SK033-global-contribution.check.ts +1 -0
- package/src/checks/SK034-commit-gates-armed.check.ts +1 -0
- package/src/checks/SK039-vscode-watch-generated.check.ts +1 -0
- package/src/checks/SK049-thread-answers-hook.check.ts +9 -5
- package/src/checks/SK050-retired-commands.check.ts +1 -0
- package/src/checks/SK051-no-formatter.check.ts +1 -0
- package/src/cli/channel-run.ts +17 -0
- package/src/cli/cmd_Advisors.ts +28 -7
- package/src/cli/cmd_Asks.ts +2 -2
- package/src/cli/cmd_Backup.ts +5 -1
- package/src/cli/cmd_CacheAudit.ts +1 -1
- package/src/cli/cmd_Channel.ts +43 -0
- package/src/cli/cmd_GlobalProcesses.ts +1 -0
- package/src/cli/cmd_Home.ts +12 -5
- package/src/cli/cmd_Hooks.ts +1 -1
- package/src/cli/cmd_Hq.ts +43 -0
- package/src/cli/cmd_Lanes.ts +15 -3
- package/src/cli/cmd_Media.ts +8 -3
- package/src/cli/cmd_Orchestrator.ts +253 -84
- package/src/cli/cmd_OrchestratorRole.ts +163 -0
- package/src/cli/cmd_Review.ts +142 -165
- package/src/cli/cmd_Secret.ts +44 -14
- package/src/cli/cmd_Shot.ts +2 -4
- package/src/cli/cmd_Sound.ts +1 -0
- package/src/cli/cmd_Urls.ts +3 -3
- package/src/cli/inbox-hook-run.ts +109 -0
- package/src/cli/registry.ts +6 -2
- package/src/cli/review-here.ts +136 -0
- package/src/cli.ts +45 -14
- package/src/collections/actions.ts +5 -4
- package/src/collections/checks.ts +5 -0
- package/src/collections/collection-types.ts +4 -3
- package/src/collections/pings.ts +4 -1
- package/src/collections/providers.ts +6 -4
- package/src/collections/tests.ts +7 -4
- package/src/core/app-icon-frame.ts +62 -0
- package/src/core/app-icon.ts +179 -17
- package/src/core/archived.ts +10 -7
- package/src/core/check-ctx.ts +38 -4
- package/src/core/check-pass.ts +7 -0
- package/src/core/foreign.ts +87 -0
- package/src/core/gui-color.ts +75 -0
- package/src/core/hub-theme.ts +1 -3
- package/src/core/layout.ts +3 -0
- package/src/core/machine-commit.ts +9 -1
- package/src/core/one-lib.ts +2 -1
- package/src/core/one-way-in-policy.ts +17 -12
- package/src/core/owner-word-policy.ts +123 -0
- package/src/core/panel-shades.ts +140 -0
- package/src/core/repo-gui-color.ts +16 -0
- package/src/core/role-policy.ts +17 -0
- package/src/core/scope.ts +6 -3
- package/src/core/tmux-policy.ts +264 -0
- package/src/core/unit-icon.ts +43 -0
- package/src/fleet/push-fleet.ts +2 -0
- package/src/fleet/scan-fleet.ts +3 -0
- package/src/gate/cache-audit.ts +7 -1
- package/src/gate/gate-checks.ts +14 -9
- package/src/gate/run-fix.ts +30 -5
- package/src/gate/run-fixers.ts +8 -3
- package/src/home/activity-shape.ts +2 -0
- package/src/home/activity.ts +2 -1
- package/src/home/daemon-guard.ts +20 -2
- package/src/home/daemon-jobs.ts +26 -18
- package/src/home/gui-app/ShipkitGui.swift +2012 -144
- package/src/home/gui-app/icon.svg +8 -0
- package/src/home/gui-app.ts +94 -30
- package/src/home/home-routes.ts +53 -9
- package/src/home/home-start.ts +27 -3
- package/src/home/inbox-shape.ts +7 -3
- package/src/home/log-follow.ts +117 -0
- package/src/home/machine-fold.ts +1 -1
- package/src/home/open-app.ts +9 -3
- package/src/home/page-build.ts +5 -1
- package/src/home/page-held.ts +1 -1
- package/src/home/pm-config.ts +0 -8
- package/src/home/pm.ts +62 -5
- package/src/home/process-apps.ts +70 -23
- package/src/home/process-rows.ts +16 -1
- package/src/home/push-sources.ts +18 -13
- package/src/home/resources.ts +16 -7
- package/src/home/run-daemon.ts +4 -1
- package/src/home/run-pm.ts +1 -1
- package/src/home/serve-daemon.ts +13 -4
- package/src/home/serve-web.ts +141 -17
- package/src/home/space-page.ts +3 -3
- package/src/home/space-route.ts +2 -2
- package/src/home/supervise.ts +2 -1
- package/src/home/vault-page.ts +2 -1
- package/src/home/web-places.ts +239 -0
- package/src/home/widgets.ts +16 -2
- package/src/hooks/commit-message.ts +11 -9
- package/src/hooks/one-way-in-guard.ts +145 -68
- package/src/hooks/run-hooks.ts +15 -5
- package/src/hooks/shared-file.ts +273 -83
- package/src/hooks/shell-writes.ts +620 -0
- package/src/hooks/write-log.ts +149 -0
- package/src/hq/door-route.ts +63 -7
- package/src/hq/door.ts +45 -12
- package/src/hq/history-send.ts +3 -1
- package/src/hq/hq-db.ts +10 -3
- package/src/hq/hq-local.ts +24 -5
- package/src/hq/hq-routes.ts +3 -1
- package/src/hq/hq-store.ts +9 -3
- package/src/hq/kinds/index.ts +2 -1
- package/src/hq/kinds/kind.ts +9 -4
- package/src/hq/kinds/presence-rule.ts +56 -0
- package/src/hq/kinds/presence.ts +210 -0
- package/src/hq/kinds/report.ts +8 -5
- package/src/hq/lead-order.ts +68 -0
- package/src/hq/outbox.ts +7 -0
- package/src/hq/replica.ts +5 -7
- package/src/hq/report-facts.ts +14 -7
- package/src/hq/report.ts +47 -2
- package/src/hq/switch.ts +1 -0
- package/src/hq/terminal-hop.ts +64 -0
- package/src/hq/thread-sync.ts +13 -6
- package/src/http/door-forward.ts +10 -12
- package/src/http/door-names.ts +9 -0
- package/src/http/hop-caller.ts +23 -0
- package/src/http/hop-names.ts +14 -0
- package/src/http/loopback-serve.ts +28 -6
- package/src/http/owner-word.ts +128 -0
- package/src/http/same-origin.ts +12 -0
- package/src/{serve → http}/secret-gate.ts +3 -3
- package/src/ledger/run-log.ts +25 -1
- package/src/media-store/backup/sources.ts +53 -6
- package/src/media-store/backup/thread-copy.ts +9 -5
- package/src/media-store/copy/config.ts +10 -9
- package/src/media-store/daemon.ts +5 -2
- package/src/media-store/put.ts +3 -0
- package/src/media-store/space.ts +14 -16
- package/src/media-store/upload.ts +4 -0
- package/src/messages/collection.ts +2 -2
- package/src/messages/model.ts +6 -1
- package/src/messages/routes.ts +3 -0
- package/src/orchestrator/brief.md +8 -6
- package/src/orchestrator/channel-declare.ts +58 -0
- package/src/orchestrator/channel.ts +226 -0
- package/src/orchestrator/guards.ts +12 -3
- package/src/orchestrator/host.ts +35 -0
- package/src/orchestrator/lead-shape.ts +86 -0
- package/src/orchestrator/now.ts +88 -0
- package/src/orchestrator/phone.ts +4 -1
- package/src/orchestrator/places-file.ts +38 -0
- package/src/orchestrator/places-look.ts +180 -0
- package/src/orchestrator/places-shape.ts +151 -0
- package/src/orchestrator/places.ts +50 -0
- package/src/orchestrator/presence-shape.ts +13 -2
- package/src/orchestrator/presence.ts +26 -15
- package/src/orchestrator/push.ts +5 -10
- package/src/orchestrator/role-shape.ts +270 -0
- package/src/orchestrator/role.ts +242 -0
- package/src/orchestrator/routes.ts +136 -31
- package/src/orchestrator/sessions-shape.ts +78 -0
- package/src/orchestrator/sessions.ts +86 -0
- package/src/orchestrator/share.ts +71 -0
- package/src/orchestrator/start-notice.ts +61 -0
- package/src/orchestrator/start.ts +137 -0
- package/src/orchestrator/started.ts +55 -0
- package/src/orchestrator/stuck.ts +196 -0
- package/src/orchestrator/unheard.ts +18 -7
- package/src/pages/frame-client.ts +44 -6
- package/src/problems/failure-words.ts +80 -0
- package/src/release/run-bump.ts +26 -5
- package/src/release/run-release.ts +34 -14
- package/src/repo-config.ts +37 -9
- package/src/review/aside-at.ts +19 -0
- package/src/review/band.ts +3 -3
- package/src/review/doc-save.ts +1 -1
- package/src/review/inbox-hook.ts +12 -4
- package/src/review/inbox-read.ts +20 -7
- package/src/review/instruction-guards.ts +137 -0
- package/src/review/instructions.ts +14 -2
- package/src/review/item-db.ts +52 -2
- package/src/review/mentions.ts +6 -4
- package/src/review/model.ts +3 -2
- package/src/review/parties.ts +88 -19
- package/src/review/push.ts +32 -15
- package/src/review/routes.ts +12 -4
- package/src/review/secret-route.ts +5 -5
- package/src/review/snooze.ts +1 -16
- package/src/review/store-parties.ts +4 -2
- package/src/review/take-back.ts +2 -1
- package/src/review/threads.ts +13 -2
- package/src/review/unit.ts +3 -2
- package/src/review/view-layout.ts +8 -1
- package/src/review/watchers.ts +25 -4
- package/src/secrets/key-pair.ts +14 -0
- package/src/secrets/lapse.ts +3 -3
- package/src/secrets/manager.ts +5 -1
- package/src/secrets/name-template.ts +83 -0
- package/src/secrets/name.ts +3 -0
- package/src/secrets/read.ts +10 -6
- package/src/secrets/secrets-view.ts +299 -0
- package/src/secrets/who-reads.ts +2 -1
- package/src/serve/frame-part.ts +49 -0
- package/src/serve/hub-app/accounts-line.tsx +33 -45
- package/src/serve/hub-app/activity-st.ts +6 -5
- package/src/serve/hub-app/activity-view.tsx +10 -9
- package/src/serve/hub-app/advice-box.tsx +6 -5
- package/src/serve/hub-app/advisor-app.tsx +2 -0
- package/src/serve/hub-app/advisor-face.tsx +3 -2
- package/src/serve/hub-app/advisor.html +1 -0
- package/src/serve/hub-app/advisors-view.tsx +52 -10
- package/src/serve/hub-app/advisors.css +4 -0
- package/src/serve/hub-app/app-bridge.ts +31 -5
- package/src/serve/hub-app/asked-page.ts +24 -0
- package/src/serve/hub-app/asks-page.tsx +10 -6
- package/src/serve/hub-app/auto-text.tsx +7 -5
- package/src/serve/hub-app/card-head.tsx +3 -2
- package/src/serve/hub-app/check-view.tsx +10 -9
- package/src/serve/hub-app/checks-svc.ts +96 -32
- package/src/serve/hub-app/clock-svc.ts +24 -8
- package/src/serve/hub-app/code-copy.ts +1 -1
- package/src/serve/hub-app/col-card.tsx +2 -1
- package/src/serve/hub-app/col-list-page.tsx +12 -6
- package/src/serve/hub-app/col-list-st.ts +12 -2
- package/src/serve/hub-app/col-tables-view.tsx +8 -44
- package/src/serve/hub-app/col-tables.ts +0 -14
- package/src/serve/hub-app/cols-svc.ts +6 -12
- package/src/serve/hub-app/columns.ts +94 -0
- package/src/serve/hub-app/comfy-view.tsx +8 -7
- package/src/serve/hub-app/commands/commands-page.tsx +4 -3
- package/src/serve/hub-app/commands/commands-st.ts +2 -2
- package/src/serve/hub-app/controls.css +69 -23
- package/src/serve/hub-app/cycle-button.tsx +2 -1
- package/src/serve/hub-app/database-st.ts +1 -1
- package/src/serve/hub-app/database-view.tsx +4 -2
- package/src/serve/hub-app/deaf.tsx +27 -0
- package/src/serve/hub-app/dock-st.ts +21 -16
- package/src/serve/hub-app/dock-view.tsx +19 -12
- package/src/serve/hub-app/empty-section.tsx +30 -0
- package/src/serve/hub-app/entry-bar.css +1 -1
- package/src/serve/hub-app/entry-bar.tsx +11 -6
- package/src/serve/hub-app/entry-list.css +32 -0
- package/src/serve/hub-app/entry-list.tsx +123 -0
- package/src/serve/hub-app/entry-pick.ts +1 -1
- package/src/serve/hub-app/entry-sections.ts +140 -0
- package/src/serve/hub-app/event-stream-reader.ts +56 -0
- package/src/serve/hub-app/floating.tsx +68 -14
- package/src/serve/hub-app/geometry-view.tsx +3 -2
- package/src/serve/hub-app/git-view.tsx +3 -2
- package/src/serve/hub-app/hash-route.ts +14 -2
- package/src/serve/hub-app/header-bar.tsx +53 -36
- package/src/serve/hub-app/home-st.ts +131 -14
- package/src/serve/hub-app/home-strip.css +24 -13
- package/src/serve/hub-app/home-strip.tsx +131 -66
- package/src/serve/hub-app/home.html +5 -0
- package/src/serve/hub-app/hub-app.tsx +94 -102
- package/src/serve/hub-app/hub.css +61 -94
- package/src/serve/hub-app/icons.tsx +16 -0
- package/src/serve/hub-app/identities-st.ts +19 -54
- package/src/serve/hub-app/identities-view.tsx +25 -24
- package/src/serve/hub-app/identity-address.ts +2 -2
- package/src/serve/hub-app/in-sight.ts +10 -0
- package/src/serve/hub-app/inbox-st.ts +20 -2
- package/src/serve/hub-app/inbox-view.tsx +16 -9
- package/src/serve/hub-app/inbox.css +1 -0
- package/src/serve/hub-app/index.html +5 -0
- package/src/serve/hub-app/insights-view.tsx +6 -5
- package/src/serve/hub-app/instructions.css +4 -1
- package/src/serve/hub-app/kept-cols.tsx +83 -20
- package/src/serve/hub-app/kept-width.tsx +76 -0
- package/src/serve/hub-app/keys.ts +116 -38
- package/src/serve/hub-app/layout-st.ts +109 -99
- package/src/serve/hub-app/lightbox-zoom.css +36 -0
- package/src/serve/hub-app/list-filter.tsx +15 -6
- package/src/serve/hub-app/list-head.tsx +29 -0
- package/src/serve/hub-app/list-row.ts +8 -0
- package/src/serve/hub-app/list-walk.ts +26 -105
- package/src/serve/hub-app/live-socket.ts +274 -0
- package/src/serve/hub-app/live-sources.ts +189 -0
- package/src/serve/hub-app/live-svc.ts +2 -2
- package/src/serve/hub-app/machine-st.ts +75 -14
- package/src/serve/hub-app/main-panel.css +211 -0
- package/src/serve/hub-app/main-panel.tsx +259 -0
- package/src/serve/hub-app/md.ts +4 -4
- package/src/serve/hub-app/media-svc.ts +5 -5
- package/src/serve/hub-app/media-view.tsx +13 -12
- package/src/serve/hub-app/messages/messages-page.tsx +8 -7
- package/src/serve/hub-app/messages/messages-st.ts +5 -2
- package/src/serve/hub-app/new-thread-st.ts +170 -0
- package/src/serve/hub-app/new-thread.tsx +133 -107
- package/src/serve/hub-app/orchestrator-line.tsx +115 -45
- package/src/serve/hub-app/orchestrator-places.tsx +86 -0
- package/src/serve/hub-app/orchestrator.css +57 -5
- package/src/serve/hub-app/page-keys.ts +107 -68
- package/src/serve/hub-app/page-reload.ts +46 -6
- package/src/serve/hub-app/pages-frames.tsx +40 -3
- package/src/serve/hub-app/pages-svc.ts +3 -1
- package/src/serve/hub-app/palette-st.ts +198 -43
- package/src/serve/hub-app/palette-view.tsx +32 -8
- package/src/serve/hub-app/panel-head-action.tsx +39 -0
- package/src/serve/hub-app/panel-head.tsx +70 -0
- package/src/serve/hub-app/panel-repo.ts +42 -0
- package/src/serve/hub-app/panel-source.ts +195 -0
- package/src/serve/hub-app/panel-tint.css +6 -0
- package/src/serve/hub-app/panel-tint.ts +23 -0
- package/src/serve/hub-app/panel-walk.ts +107 -0
- package/src/serve/hub-app/pill-row.tsx +2 -1
- package/src/serve/hub-app/place-path.ts +4 -0
- package/src/serve/hub-app/places-svc.ts +75 -0
- package/src/serve/hub-app/plan-view.tsx +3 -2
- package/src/serve/hub-app/polled.ts +11 -1
- package/src/serve/hub-app/presence-st.ts +66 -32
- package/src/serve/hub-app/processes-view.tsx +2 -2
- package/src/serve/hub-app/project-bar.tsx +116 -0
- package/src/serve/hub-app/project-list.css +20 -173
- package/src/serve/hub-app/project-list.tsx +30 -298
- package/src/serve/hub-app/projects-svc.ts +59 -32
- package/src/serve/hub-app/push-sign.tsx +2 -1
- package/src/serve/hub-app/push-svc.ts +86 -69
- package/src/serve/hub-app/quiet-st.ts +5 -3
- package/src/serve/hub-app/rail-groups.ts +144 -0
- package/src/serve/hub-app/reader-chips.tsx +2 -1
- package/src/serve/hub-app/recordings-st.ts +2 -1
- package/src/serve/hub-app/recordings-view.tsx +19 -47
- package/src/serve/hub-app/recordings.css +0 -2
- package/src/serve/hub-app/reflections-page.tsx +10 -6
- package/src/serve/hub-app/releases/releases-page.tsx +6 -5
- package/src/serve/hub-app/repo-sections.ts +127 -38
- package/src/serve/hub-app/repo-st.ts +57 -36
- package/src/serve/hub-app/review/advisor-bar.tsx +3 -2
- package/src/serve/hub-app/review/ask-proof.tsx +79 -0
- package/src/serve/hub-app/review/attach-view.tsx +11 -10
- package/src/serve/hub-app/review/box-view.ts +479 -0
- package/src/serve/hub-app/review/box-zoom.tsx +70 -0
- package/src/serve/hub-app/review/diff-view.tsx +3 -2
- package/src/serve/hub-app/review/doc-body.tsx +2 -1
- package/src/serve/hub-app/review/dock.tsx +3 -2
- package/src/serve/hub-app/review/draft-body.tsx +4 -3
- package/src/serve/hub-app/review/faces.tsx +0 -8
- package/src/serve/hub-app/review/group-block.tsx +8 -7
- package/src/serve/hub-app/review/heard-line.tsx +4 -3
- package/src/serve/hub-app/review/instructions-view.tsx +3 -2
- package/src/serve/hub-app/review/item-verdict.tsx +40 -40
- package/src/serve/hub-app/review/kind-states.tsx +5 -4
- package/src/serve/hub-app/review/kit.tsx +24 -4
- package/src/serve/hub-app/review/lane-bar.tsx +30 -28
- package/src/serve/hub-app/review/lightbox.tsx +6 -4
- package/src/serve/hub-app/review/live-bar.tsx +7 -6
- package/src/serve/hub-app/review/live-view.tsx +6 -5
- package/src/serve/hub-app/review/object-card.tsx +2 -1
- package/src/serve/hub-app/review/object-panel.tsx +11 -10
- package/src/serve/hub-app/review/pano-view.tsx +3 -2
- package/src/serve/hub-app/review/question-views.tsx +6 -5
- package/src/serve/hub-app/review/review-cells.tsx +21 -20
- package/src/serve/hub-app/review/review-host.ts +3 -0
- package/src/serve/hub-app/review/review-kit.ts +7 -5
- package/src/serve/hub-app/review/review-list.tsx +98 -52
- package/src/serve/hub-app/review/review-page.tsx +3 -3
- package/src/serve/hub-app/review/review-st.ts +70 -14
- package/src/serve/hub-app/review/review-thread.tsx +234 -138
- package/src/serve/hub-app/review/review-views.tsx +166 -191
- package/src/serve/hub-app/review/space3d.tsx +17 -9
- package/src/serve/hub-app/review/thread-close.tsx +24 -32
- package/src/serve/hub-app/review/thread-st.ts +39 -25
- package/src/serve/hub-app/review/trailer-body.tsx +5 -4
- package/src/serve/hub-app/review/trailer-page.tsx +18 -16
- package/src/serve/hub-app/review/trailer-st.ts +3 -2
- package/src/serve/hub-app/review/trailer-timeline.tsx +10 -9
- package/src/serve/hub-app/review/trailer-voices.tsx +29 -28
- package/src/serve/hub-app/review.css +159 -42
- package/src/serve/hub-app/row-acts.tsx +126 -0
- package/src/serve/hub-app/row-face.tsx +29 -0
- package/src/serve/hub-app/running-rows.tsx +142 -0
- package/src/serve/hub-app/running-st.ts +110 -0
- package/src/serve/hub-app/search-view.tsx +3 -2
- package/src/serve/hub-app/secrets-page.tsx +290 -0
- package/src/serve/hub-app/secrets-st.ts +181 -0
- package/src/serve/hub-app/secrets.css +65 -0
- package/src/serve/hub-app/section-head.tsx +3 -2
- package/src/serve/hub-app/session-chips.tsx +55 -0
- package/src/serve/hub-app/shell.ts +56 -0
- package/src/serve/hub-app/site/site-part.tsx +6 -5
- package/src/serve/hub-app/site/site-st.ts +0 -6
- package/src/serve/hub-app/site.css +0 -1
- package/src/serve/hub-app/social/calendar.tsx +7 -6
- package/src/serve/hub-app/social/comms-page.tsx +29 -26
- package/src/serve/hub-app/social/group-editor.tsx +2 -1
- package/src/serve/hub-app/social/kit.tsx +12 -11
- package/src/serve/hub-app/social/next-release.tsx +3 -2
- package/src/serve/hub-app/social/post-card.tsx +21 -20
- package/src/serve/hub-app/social/post-page.tsx +2 -1
- package/src/serve/hub-app/social/problems.tsx +3 -2
- package/src/serve/hub-app/social/social-page.tsx +29 -27
- package/src/serve/hub-app/social/social-st.ts +4 -2
- package/src/serve/hub-app/social/stage-popup.tsx +11 -10
- package/src/serve/hub-app/social.css +7 -5
- package/src/serve/hub-app/source-acts.ts +79 -0
- package/src/serve/hub-app/source-page.tsx +17 -0
- package/src/serve/hub-app/space-view.tsx +5 -4
- package/src/serve/hub-app/stores/stores-page.tsx +21 -19
- package/src/serve/hub-app/stores/stores-st.ts +1 -1
- package/src/serve/hub-app/stores.css +1 -1
- package/src/serve/hub-app/terminal-history-st.ts +112 -0
- package/src/serve/hub-app/terminal-keys.ts +79 -0
- package/src/serve/hub-app/terminal-lib.ts +110 -0
- package/src/serve/hub-app/terminal-links.ts +55 -0
- package/src/serve/hub-app/terminal-list-st.ts +304 -0
- package/src/serve/hub-app/terminal-log-st.ts +242 -0
- package/src/serve/hub-app/terminal-out.ts +135 -0
- package/src/serve/hub-app/terminal-pages.tsx +115 -0
- package/src/serve/hub-app/terminal-panel.tsx +60 -9
- package/src/serve/hub-app/terminal-sources.tsx +335 -0
- package/src/serve/hub-app/terminal-st.ts +447 -167
- package/src/serve/hub-app/terminal-stream.ts +233 -0
- package/src/serve/hub-app/terminal-tab.tsx +64 -0
- package/src/serve/hub-app/terminal-widths.ts +30 -0
- package/src/serve/hub-app/terminal.css +50 -4
- package/src/serve/hub-app/test-view.tsx +5 -3
- package/src/serve/hub-app/tests-view.tsx +16 -15
- package/src/serve/hub-app/theme-st.ts +5 -0
- package/src/serve/hub-app/thread-row.tsx +39 -31
- package/src/serve/hub-app/time-ago.tsx +3 -2
- package/src/serve/hub-app/time-view.tsx +2 -1
- package/src/serve/hub-app/time.css +1 -1
- package/src/serve/hub-app/timeline-chart.tsx +5 -4
- package/src/serve/hub-app/timeline-view.tsx +10 -9
- package/src/serve/hub-app/tips.ts +247 -0
- package/src/serve/hub-app/tree-build.ts +40 -8
- package/src/serve/hub-app/tree-svc.ts +167 -134
- package/src/serve/hub-app/unit-icons.ts +26 -0
- package/src/serve/hub-app/url-address.ts +154 -0
- package/src/serve/hub-app/url-faces.ts +88 -0
- package/src/serve/hub-app/url-forms.tsx +183 -0
- package/src/serve/hub-app/urls-svc.ts +167 -5
- package/src/serve/hub-app/urls-view.tsx +56 -20
- package/src/serve/hub-app/urls.css +26 -0
- package/src/serve/hub-app/vault-view.tsx +5 -4
- package/src/serve/hub-app/veille/veille-page.tsx +34 -33
- package/src/serve/hub-app/veille/veille-st.ts +6 -3
- package/src/serve/hub-app/view-layout.css +3 -3
- package/src/serve/hub-app/when-view.tsx +5 -4
- package/src/serve/hub-app/wikis-view.tsx +6 -5
- package/src/serve/hub-app/words.tsx +9 -2
- package/src/serve/hub-runtime.ts +3 -2
- package/src/serve/orchestrator-host.ts +58 -0
- package/src/serve/page-live.ts +147 -0
- package/src/serve/project-gutter-route.ts +63 -2
- package/src/serve/read-worker.ts +7 -2
- package/src/serve/runs-stamp.ts +33 -0
- package/src/serve/secrets-read.ts +156 -0
- package/src/serve/serve-hub.ts +71 -22
- package/src/serve/terminal-claudes.ts +185 -0
- package/src/serve/terminal-guard.ts +10 -5
- package/src/serve/terminal-host.ts +517 -0
- package/src/serve/terminal-record.ts +104 -0
- package/src/serve/terminal-route.ts +466 -103
- package/src/serve/terminal-shells.ts +3 -0
- package/src/serve/terminal-watch.ts +102 -0
- package/src/shipkit-files.ts +9 -4
- package/src/shot/client.ts +4 -9
- package/src/shot/shooter.ts +2 -4
- package/src/shot/shot-ask.ts +2 -7
- package/src/shot/shot-theme.ts +6 -17
- package/src/social/routes.ts +2 -2
- package/src/social/writes.ts +3 -0
- package/src/suite/test-units.ts +6 -2
- package/src/trailer/sound/eleven.ts +1 -0
- package/src/urls/added.ts +111 -0
- package/src/urls/icons.ts +294 -0
- package/src/urls/places.ts +139 -0
- package/src/urls/routes.ts +17 -7
- package/src/urls/rows.ts +48 -15
- package/src/urls/unit.ts +57 -3
- package/src/urls/write-routes.ts +207 -0
- package/src/vault/vault-destroy.ts +2 -1
- package/src/vault/vault-import.ts +4 -11
- package/src/vault/vault-restore.ts +3 -2
- package/src/veille/chrome.ts +18 -3
- package/src/veille/identity.ts +6 -0
- package/src/view3d/cam.ts +30 -46
- package/src/view3d/lib.ts +20 -2
- package/src/view3d/viewer.ts +62 -88
- package/src/wiki/agent-paths.ts +2 -1
- package/src/orchestrator/deliver.ts +0 -81
- package/src/orchestrator/drill.ts +0 -129
- package/src/orchestrator/keeper.ts +0 -332
- package/src/orchestrator/pm.ts +0 -20
- package/src/orchestrator/state.ts +0 -92
- package/src/orchestrator/switch.ts +0 -86
- package/src/orchestrator/tmux.ts +0 -82
- package/src/serve/hub-app/rail-fly.tsx +0 -95
- package/src/serve/hub-app/side-lists.ts +0 -72
- package/src/serve/hub-app/sidebar.tsx +0 -62
- package/src/serve/hub-app/tree-row.tsx +0 -125
|
@@ -5,15 +5,17 @@
|
|
|
5
5
|
// and keeps the frame's time. A choice, or views that each play alone, read as option rows, each image and clip full
|
|
6
6
|
// under its row
|
|
7
7
|
import { observer } from 'mobx-react-lite'
|
|
8
|
-
import { useEffect, useMemo, useRef, useState, type ReactNode } from 'react'
|
|
8
|
+
import { useEffect, useLayoutEffect, useMemo, useRef, useState, type CSSProperties, type ReactNode } from 'react'
|
|
9
9
|
import { createPortal } from 'react-dom'
|
|
10
10
|
import type { VersionCell } from '../../../review/cells.ts'
|
|
11
11
|
import { isChoice, isGallery, isPair, onFrame, SCENE_WORDS, STARS, STATUS_LABEL, thumbFileOf, tileName, viewFilesOf, viewName, viewTag, type GalleryTile, type GalleryView, type Item, type MediaView, type Rect, type ReviewClip, type ReviewMark, type ReviewStatus, type ReviewView, type Side } from '../../../review/model.ts'
|
|
12
12
|
import { AutoText } from '../auto-text.tsx'
|
|
13
13
|
import type { ClipSt } from './clip-st.ts'
|
|
14
14
|
import { boxReaction, FIT_ROOM, keepFocus, Key, PAIR_NAMES, PLACE_TIPS, REACTIONS, secs, SIDE_LABEL } from './kit.tsx'
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
15
|
+
import { BoxView } from './box-view.ts'
|
|
16
|
+
import { BoxViewCtx, BoxZoomBar, useBoxView, ZoomMap } from './box-zoom.tsx'
|
|
17
|
+
import { TILE_H, type Zoom } from './review-kit.ts'
|
|
18
|
+
import { fillWidth, formOf, LAYOUT, sizeOf, TILE_ASPECT, type Size, type ViewForm } from '../../../review/view-layout.ts'
|
|
17
19
|
import { COMPARE_MODES, drawnSide, type CompareMode, type CompareSt, type PairSide, type ReviewSt } from './review-st.ts'
|
|
18
20
|
import { TILE_FILTERS, viewDom, viewKind, type SaidNote, type ThreadSt, type TileFilter } from './thread-st.ts'
|
|
19
21
|
import { Caret, Icon, ICON } from '../icons.tsx'
|
|
@@ -25,6 +27,7 @@ import { LiveBody } from './live-view.tsx'
|
|
|
25
27
|
import { SceneBody } from './scene-view.tsx'
|
|
26
28
|
import { Words } from '../words.tsx'
|
|
27
29
|
import { soleSpot } from '../../../review/one-block.ts'
|
|
30
|
+
import { tip } from '../tips.ts'
|
|
28
31
|
|
|
29
32
|
export const toneClass = (s: string | undefined): string => (s ? ` re-${s}` : '')
|
|
30
33
|
|
|
@@ -75,7 +78,7 @@ export const VersionViews = observer(({ ver }: { ver: Ver }) => {
|
|
|
75
78
|
<div className="rv-views">
|
|
76
79
|
{options ? (
|
|
77
80
|
<div className="rv-viewsbar">
|
|
78
|
-
<span className="seg"
|
|
81
|
+
<span className="seg" {...tip('the options as thin rows, one below the other, or every view full')}>
|
|
79
82
|
<button className={rows ? 'on' : ''} onMouseDown={keepFocus} onClick={() => thread.setFull(item.id, false)}>rows</button>
|
|
80
83
|
<button className={rows ? '' : 'on'} onMouseDown={keepFocus} onClick={() => thread.setFull(item.id, true)}>full</button>
|
|
81
84
|
</span>
|
|
@@ -106,7 +109,7 @@ export const ViewCell = observer(({ ver, v: live, i, frames, noted = true, boxed
|
|
|
106
109
|
const body = gone.length > 0 ? <Gone files={gone} />
|
|
107
110
|
: media?.live && rv.can('live') && 'image' in media.files ? <LiveBody live={media.live} label={media.label} shotSrc={rv.fitUrl(cell.id, media.files.image, cell.item.wip)} size={media.size} shot={<MediaBody ver={ver} v={media} i={i} zoom="fit" boxed />} />
|
|
108
111
|
: isGallery(v) ? <GalleryThumbs ver={ver} v={v} view={i} />
|
|
109
|
-
: <MediaBody ver={ver} v={v} i={i} zoom=
|
|
112
|
+
: <MediaBody ver={ver} v={v} i={i} zoom="fit" boxed />
|
|
110
113
|
return (
|
|
111
114
|
<section className={`rv-view boxed${toneClass(shown?.status)}`} data-check="lightbox-view" data-view={i}>
|
|
112
115
|
{frames ? <FrameSlider thread={thread} frames={frames} /> : null}
|
|
@@ -130,7 +133,7 @@ export const ViewCell = observer(({ ver, v: live, i, frames, noted = true, boxed
|
|
|
130
133
|
<ViewTools ver={ver} v={v} i={i} tag={caption ? null : tag} />
|
|
131
134
|
</div>
|
|
132
135
|
{caption ? (
|
|
133
|
-
<div className="rv-viewcap"
|
|
136
|
+
<div className="rv-viewcap" {...tip(`view ${tag}`)}>
|
|
134
137
|
<span className="rv-viewn">{tag}</span>
|
|
135
138
|
{v.label ? <b className="rv-viewname">{v.label}</b> : null}
|
|
136
139
|
{v.label.toLowerCase() === viewKind(v, false).toLowerCase() ? null : <span className="rv-dim">{viewKind(v, false)}</span>}
|
|
@@ -172,7 +175,7 @@ const ViewBody = observer(({ ver, v, i, form, size }: { ver: Ver; v: ReviewView;
|
|
|
172
175
|
/** a still in the thread a click opens in the lightbox: the media of a tile or a thumb, its word and « open » on it
|
|
173
176
|
* (« 360° · open »), ▶ on a clip's poster */
|
|
174
177
|
const Still = ({ src, word, open, fit, play = false }: { src: string; word: string | null; open: () => void; fit: 'cover' | 'contain'; play?: boolean }) => (
|
|
175
|
-
<button type="button" className={`rv-still ${fit}`} data-check="view-still"
|
|
178
|
+
<button type="button" className={`rv-still ${fit}`} data-check="view-still" {...tip(word ? `open the ${word} in the lightbox` : 'open it in the lightbox')} onMouseDown={keepFocus} onClick={open}>
|
|
176
179
|
<img src={src} alt="" loading="lazy" decoding="async" draggable={false} />
|
|
177
180
|
{play ? <span className="rv-stillplay" aria-hidden>▶</span> : null}
|
|
178
181
|
{word ? <span className="rv-stillopen">{word} · open</span> : null}
|
|
@@ -187,11 +190,10 @@ const Peek = observer(({ ver, v, i, size, before, after }: { ver: Ver; v: MediaV
|
|
|
187
190
|
const item = itemOf(ver)
|
|
188
191
|
const [peek, setPeek] = useState(false)
|
|
189
192
|
const touch = useRef(false)
|
|
190
|
-
const
|
|
191
|
-
const style = size === 'fill' ? { aspectRatio: `${v.size.w} / ${v.size.h}`, width: `min(100%, calc(var(--preview-h) * ${ratio}))` } : undefined
|
|
193
|
+
const style = size === 'fill' ? { aspectRatio: `${v.size.w} / ${v.size.h}`, width: fillWidth(v.size) } : undefined
|
|
192
194
|
const a = v.clip ? rv.fitUrl(item.id, v.clip.poster, item.wip) : rv.fitUrl(item.id, after, item.wip)
|
|
193
195
|
return (
|
|
194
|
-
<button type="button" className={`rv-peek${peek ? ' on' : ''}`} data-check="view-still" style={style}
|
|
196
|
+
<button type="button" className={`rv-peek${peek ? ' on' : ''}`} data-check="view-still" style={style} {...tip('the after; the pointer on it shows the before: open it to see both side by side, judge it, draw on it')}
|
|
195
197
|
onPointerDown={(e) => (touch.current = e.pointerType === 'touch')}
|
|
196
198
|
onMouseDown={keepFocus}
|
|
197
199
|
onClick={() => (touch.current ? setPeek(!peek) : ver.thread.openBox(ver.cell.id, i))}>
|
|
@@ -217,8 +219,8 @@ const ViewTools = observer(({ ver, v, i, tag }: { ver: Ver; v: ReviewView; i: nu
|
|
|
217
219
|
const opens = LAYOUT[formOf(v)].opens !== null && !isGallery(v)
|
|
218
220
|
return (
|
|
219
221
|
<span className="rv-viewtools">
|
|
220
|
-
{tag ? <span className="rv-viewn"
|
|
221
|
-
{opens ? <button className="ghost rv-iconbtn" data-check="view-open"
|
|
222
|
+
{tag ? <span className="rv-viewn" {...tip(`view ${tag}`)}>{tag}</span> : null}
|
|
223
|
+
{opens ? <button className="ghost rv-iconbtn" data-check="view-open" {...tip('open it whole in the lightbox')} aria-label="open it in the lightbox" onMouseDown={keepFocus} onClick={() => ver.thread.openBox(ver.cell.id, i)}>⤢</button> : null}
|
|
222
224
|
{!isGallery(v) && isPair(v.files) && !v.clip && !v.audio ? <AnimPanel app={rv} item={item} /> : null}
|
|
223
225
|
{isGallery(v) && rv.phone.on ? null : <StageButtons ver={ver} v={v} i={i} />}
|
|
224
226
|
{isGallery(v) ? (rv.phone.on ? null : <GalleryMenu ver={ver} v={v} />) : files.length > 0 && !v.audio ? (
|
|
@@ -240,7 +242,7 @@ const StageButtons = observer(({ ver, v, i, tile = 0 }: { ver: Ver; v: ReviewVie
|
|
|
240
242
|
const at = `${item.id}#${i}`
|
|
241
243
|
const icon = <Icon d={ICON.stage} />
|
|
242
244
|
if (isGallery(v) || !isPair(v.files))
|
|
243
|
-
return <button className="ghost rv-iconbtn rv-stagebtn"
|
|
245
|
+
return <button className="ghost rv-iconbtn rv-stagebtn" {...tip(isGallery(v) ? 'stage this image of the gallery as a post' : 'stage this media as a post: a draft in comms, never posted')} aria-label="stage as a post" onMouseDown={keepFocus} onClick={() => rv.openStage(isGallery(v) ? `${at}/${tile}` : at)}>{icon}</button>
|
|
244
246
|
const entries: [string, string][] = [[`${at}.after`, 'the after'], [`${at}.before`, 'the before'], ...(v.clip ? [] : [[`${at}.wipe`, 'a wipe from before to after'] as [string, string]])]
|
|
245
247
|
return (
|
|
246
248
|
<Pop className="ghost rv-iconbtn rv-stagebtn" aria-label="stage as a post" title="stage as a post: a draft in comms, never posted" label={icon} placement="bottom-end">
|
|
@@ -272,13 +274,13 @@ const ViewNotes = observer(({ ver, i }: { ver: Ver; i: number }) => {
|
|
|
272
274
|
) : null}
|
|
273
275
|
{draft.map(([r, k]) => (
|
|
274
276
|
<div key={`d${k}`} className={`rv-outrow${thread.rect === k ? ' on' : ''}`}>
|
|
275
|
-
<button className={`rv-outbadge rect${thread.rect === k ? ' on' : ''}`}
|
|
277
|
+
<button className={`rv-outbadge rect${thread.rect === k ? ' on' : ''}`} {...tip(r.t !== undefined ? 'go to this moment and open the note' : 'open the note on the image')} onMouseDown={keepFocus} onClick={() => thread.pickRect(k, true)}>
|
|
276
278
|
{k + 1}{r.side ? ` ${SIDE_LABEL[r.side]}` : ''}{r.t !== undefined ? ` · ${secs(r.t)}` : ''}{r.tile !== undefined ? ` ${tileWhere(views[i], r.tile) ?? ''}` : ''}
|
|
277
279
|
</button>
|
|
278
|
-
<button className="rv-outtext ghost"
|
|
280
|
+
<button className="rv-outtext ghost" {...tip('open the note on the image')} onMouseDown={keepFocus} onClick={() => thread.pickRect(k, true)}>
|
|
279
281
|
{r.comment.trim() ? r.comment : <i className="rv-dim">no word yet</i>}
|
|
280
282
|
</button>
|
|
281
|
-
<button className="ghost rv-x"
|
|
283
|
+
<button className="ghost rv-x" {...tip('delete this note')} aria-label="delete this note" onClick={() => thread.removeRect(k)}>✕</button>
|
|
282
284
|
</div>
|
|
283
285
|
))}
|
|
284
286
|
</div>
|
|
@@ -339,31 +341,31 @@ const OptionRow = observer(({ ver, v, i }: { ver: Ver; v: ReviewView; i: number
|
|
|
339
341
|
<div className="rv-optrow">
|
|
340
342
|
<span className="rv-optn">{viewTag(cell.n, i)}</span>
|
|
341
343
|
{c && clock2 ? (
|
|
342
|
-
<button className={`rv-optplay${c.paused ? '' : ' on'}`}
|
|
344
|
+
<button className={`rv-optplay${c.paused ? '' : ' on'}`} {...tip(`${c.paused ? 'play' : 'pause'}${ver.live ? ` (${i + 1})` : ''}`)} onMouseDown={keepFocus} onClick={() => thread.listen(id, i)}>
|
|
343
345
|
{c.paused ? '▶' : '❚❚'}
|
|
344
346
|
</button>
|
|
345
347
|
) : null}
|
|
346
|
-
<b className="rv-optlabel"
|
|
347
|
-
{choice && item.agentPick === i ? <span className="rv-mypick"
|
|
348
|
+
<b className="rv-optlabel" {...tip(viewName(v, i))}>{viewName(v, i)}</b>
|
|
349
|
+
{choice && item.agentPick === i ? <span className="rv-mypick" {...tip('the option the agent suggests; your pick is your own')}>my pick</span> : null}
|
|
348
350
|
{c && playable?.clip && !unfolded ? (
|
|
349
|
-
<span className="rv-optthumb" style={{ aspectRatio: `${playable.size.w} / ${playable.size.h}` }} onClick={() => thread.toggleRow(item, i)}
|
|
351
|
+
<span className="rv-optthumb" style={{ aspectRatio: `${playable.size.w} / ${playable.size.h}` }} onClick={() => thread.toggleRow(item, i)} {...tip('the full view')}>
|
|
350
352
|
<ClipVideo clip={c} src={rv.fitUrl(id, file, item.wip)} poster={rv.thumbUrl(id, playable.clip.poster)} loop={false} />
|
|
351
353
|
</span>
|
|
352
354
|
) : null}
|
|
353
355
|
{c && playable && clock2 ? (
|
|
354
356
|
<Strip clip={c} duration={duration} wave={playable.audio ? rv.fileUrl(id, playable.audio.wave) : undefined} />
|
|
355
357
|
) : unfolded || c ? <span className="sp" /> : (
|
|
356
|
-
<span className="rv-optthumb img" onClick={() => thread.toggleRow(item, i)}
|
|
358
|
+
<span className="rv-optthumb img" onClick={() => thread.toggleRow(item, i)} {...tip('the full view')}><img src={rv.thumbUrl(id, thumbFileOf(v))} alt="" draggable={false} loading="lazy" /></span>
|
|
357
359
|
)}
|
|
358
360
|
{c && clock2 ? <span className="rv-mono rv-opttime">{clock(c.time)} / {clock(duration)}</span> : null}
|
|
359
361
|
<span className="rv-optacts">
|
|
360
362
|
{choice ? <Stars ver={ver} view={i} given={reaction?.stars} /> : reaction?.status ? <SentReaction status={reaction.status} /> : null}
|
|
361
363
|
{playable?.clip || !playable ? (
|
|
362
|
-
<button className={unfolded ? 'on' : ''}
|
|
364
|
+
<button className={unfolded ? 'on' : ''} {...tip(unfolded ? 'fold it back to its row' : 'show it full under its row')} onMouseDown={keepFocus} onClick={() => thread.toggleRow(item, i)}><Caret v open={unfolded} /> {unfolded ? 'fold' : 'show'}</button>
|
|
363
365
|
) : null}
|
|
364
|
-
{playable?.audio ? <a className="rv-dl" href={rv.fileUrl(id, file)} download={`${id}-${file}`}
|
|
366
|
+
{playable?.audio ? <a className="rv-dl" href={rv.fileUrl(id, file)} download={`${id}-${file}`} {...tip('download the sound')}>⤓</a> : null}
|
|
365
367
|
{choice && takes(ver) ? (
|
|
366
|
-
<button className={`rv-pick${picked ? ' on' : ''}`}
|
|
368
|
+
<button className={`rv-pick${picked ? ' on' : ''}`} {...tip(held ? 'your pick: click again to take it back, the version waits for you again' : 'pick this one: it is your answer', held ? null : 'P')} disabled={thread.busy} onClick={() => mark(ver, () => void thread.choose(i))}>
|
|
367
369
|
{picked ? '✓ picked' : 'pick'}
|
|
368
370
|
{held ? <span className="rv-undo" aria-label="click again to take it back"> ↺</span> : null}
|
|
369
371
|
</button>
|
|
@@ -408,7 +410,7 @@ const Stars = observer(({ ver, view, tile, given }: { ver: Ver; view: number; ti
|
|
|
408
410
|
const live = takes(ver)
|
|
409
411
|
const n = given ?? 0
|
|
410
412
|
return (
|
|
411
|
-
<span className="rv-stars"
|
|
413
|
+
<span className="rv-stars" {...tip(live ? (tile === undefined ? `your score (⇧1 to ⇧${STARS} on the row playing)` : `your score (1 to ${STARS} with the pointer on the tile)`) : 'your score')}>
|
|
412
414
|
{Array.from({ length: STARS }, (_, k) => (
|
|
413
415
|
<button key={k} className={k < n ? 'on' : ''} disabled={!live} aria-label={`${k + 1} of ${STARS}`} onMouseDown={keepFocus} onClick={() => mark(ver, () => thread.setStars(view, k + 1, tile))}>{k < n ? '★' : '☆'}</button>
|
|
414
416
|
))}
|
|
@@ -467,9 +469,9 @@ const FrameSlider = observer(({ thread, frames }: { thread: ThreadSt; frames: Ga
|
|
|
467
469
|
const go = (f: number): void => thread.setFrame(f >= last ? null : Math.max(0, f))
|
|
468
470
|
return (
|
|
469
471
|
<div className="rv-frames">
|
|
470
|
-
<button
|
|
472
|
+
<button {...tip('the frame before')} disabled={at === 0} onMouseDown={keepFocus} onClick={() => go(at - 1)}>‹</button>
|
|
471
473
|
<input type="range" min={0} max={last} step={1} value={at} aria-label="the draft's frames" onChange={(e) => go(Number(e.currentTarget.value))} onMouseUp={(e) => e.currentTarget.blur()} />
|
|
472
|
-
<button
|
|
474
|
+
<button {...tip('the frame after')} disabled={at === last} onMouseDown={keepFocus} onClick={() => go(at + 1)}>›</button>
|
|
473
475
|
<span className="rv-dim rv-small">{at === last ? 'now' : (frames.gallery[at]?.label ?? `frame ${at + 1}`)}</span>
|
|
474
476
|
</div>
|
|
475
477
|
)
|
|
@@ -481,11 +483,11 @@ const FrameSlider = observer(({ thread, frames }: { thread: ThreadSt; frames: Ga
|
|
|
481
483
|
export const ReactionToggles = observer(({ ver, view, tile, post, small, keys, said, verdict = false }: { ver: Ver; view: number; tile?: number; post?: string; small?: boolean; keys?: boolean; said?: (status: ReviewStatus) => void; verdict?: boolean }) => {
|
|
482
484
|
const { thread } = ver
|
|
483
485
|
const cur = verdict ? thread.chosenOn(ver.cell.id) : ver.claim ? undefined : thread.reactionOf(view, tile, post)?.status
|
|
484
|
-
const
|
|
486
|
+
const says = (o: (typeof REACTIONS)[number]): string => (post !== undefined ? (PLACE_TIPS[o.status] ?? o.tip) : o.tip)
|
|
485
487
|
return (
|
|
486
488
|
<span className="rv-reacts">
|
|
487
489
|
{REACTIONS.map((o) => (
|
|
488
|
-
<button key={o.status}
|
|
490
|
+
<button key={o.status} {...tip(says(o), keys ? o.key : null)} className={`rv-react re-${o.status}${small ? '' : ' big'}${cur === o.status ? ' on' : ''}${cur && cur !== o.status ? ' off' : ''}`}
|
|
489
491
|
onMouseDown={keepFocus} onClick={() => {
|
|
490
492
|
mark(ver, () => (verdict ? void thread.submit(o.status) : thread.react(view, tile, o.status, post)))
|
|
491
493
|
if (cur !== o.status) said?.(o.status)
|
|
@@ -550,17 +552,17 @@ const Thumb = observer(({ ver, view, t, k, big }: { ver: Ver; view: number; t: G
|
|
|
550
552
|
const marked = o !== undefined || !!r?.stars || !!r?.picked || notes > 0
|
|
551
553
|
return (
|
|
552
554
|
<button type="button" className={`rv-gtile${r?.picked ? ' picked' : ''}${toneClass(r?.status)}`} data-check="gallery-tile" data-tile={k}
|
|
553
|
-
|
|
555
|
+
{...tip(`${t.label}: open it large to rate it and draw on it${live ? ' (1 to 5 score it here)' : ''}`)}
|
|
554
556
|
onMouseDown={keepFocus} onClick={() => thread.openBox(cell.id, view, k)}
|
|
555
557
|
onMouseEnter={live ? () => thread.setHoverTile({ view, tile: k }) : undefined} onMouseLeave={live ? () => thread.setHoverTile(null) : undefined}>
|
|
556
558
|
<span className="rv-gtileimg">
|
|
557
559
|
<img src={src} alt="" loading="lazy" decoding="async" draggable={false} />
|
|
558
560
|
{marked ? (
|
|
559
561
|
<span className="rv-gmarks">
|
|
560
|
-
{o ? <span className="rv-gmark tone"
|
|
561
|
-
{r?.stars ? <span className="rv-gmark star"
|
|
562
|
-
{r?.picked ? <span className="rv-gmark kept"
|
|
563
|
-
{notes > 0 ? <span className="rv-gmark note"
|
|
562
|
+
{o ? <span className="rv-gmark tone" {...tip(o.label)}>{o.glyph}</span> : null}
|
|
563
|
+
{r?.stars ? <span className="rv-gmark star" {...tip(`${r.stars} of ${STARS}`)}>★{r.stars}</span> : null}
|
|
564
|
+
{r?.picked ? <span className="rv-gmark kept" {...tip('kept for its row')}>✓ kept</span> : null}
|
|
565
|
+
{notes > 0 ? <span className="rv-gmark note" {...tip('your notes drawn on it, a draft')}>⬚ {notes}</span> : null}
|
|
564
566
|
</span>
|
|
565
567
|
) : null}
|
|
566
568
|
</span>
|
|
@@ -582,7 +584,7 @@ const GalleryCount = observer(({ ver, v, view, shown }: { ver: Ver; v: GalleryVi
|
|
|
582
584
|
<b>{v.gallery.length} images</b>
|
|
583
585
|
<span className="rv-dim">{marked === 0 ? 'none marked yet' : `${marked} marked`}</span>
|
|
584
586
|
{thread.tileFilter !== 'all' ? (
|
|
585
|
-
<button className="rv-chip on"
|
|
587
|
+
<button className="rv-chip on" {...tip('show every image')} onMouseDown={keepFocus} onClick={() => thread.setTileFilter('all')}>
|
|
586
588
|
{TILE_FILTER_LABEL[thread.tileFilter]}: {shown} ✕
|
|
587
589
|
</button>
|
|
588
590
|
) : null}
|
|
@@ -597,7 +599,7 @@ const GalleryMenu = observer(({ ver, v }: { ver: Ver; v: GalleryView }) => {
|
|
|
597
599
|
<Pop className="ghost rv-iconbtn rv-gallerymenu" popClass="fpop rv-gallerypop" placement="bottom-end" aria-label="how the images show" title="how the images show: their size, the small sizes, the befores" label="⋯">
|
|
598
600
|
{() => (
|
|
599
601
|
<div className="rv-gallerypopbody">
|
|
600
|
-
<label className="rv-tilesize"
|
|
602
|
+
<label className="rv-tilesize" {...tip('the size of every thumbnail of every gallery, kept for this repo')}>
|
|
601
603
|
size
|
|
602
604
|
<input type="range" min={TILE_H.min} max={TILE_H.max} step={10} value={rv.tileH} onChange={(e) => rv.setTileH(Number(e.target.value))} />
|
|
603
605
|
</label>
|
|
@@ -613,8 +615,8 @@ const GalleryLook = observer(({ ver, v }: { ver: Ver; v: GalleryView }) => {
|
|
|
613
615
|
const { rv, thread } = ver
|
|
614
616
|
return (
|
|
615
617
|
<span className="rv-gallerylook">
|
|
616
|
-
{v.gallery.some((t) => t.before) ? <button className={`rv-chip${thread.beforeAll ? ' on' : ''}`}
|
|
617
|
-
<button className={`rv-chip${rv.tileSmall ? ' on' : ''}`}
|
|
618
|
+
{v.gallery.some((t) => t.before) ? <button className={`rv-chip${thread.beforeAll ? ' on' : ''}`} {...tip('every image shows its before')} onMouseDown={keepFocus} onClick={() => thread.toggleBeforeAll()}>before</button> : null}
|
|
619
|
+
<button className={`rv-chip${rv.tileSmall ? ' on' : ''}`} {...tip('each image also at 16, 32 and 64 px')} onMouseDown={keepFocus} onClick={() => rv.toggleTileSmall()}>real size</button>
|
|
618
620
|
</span>
|
|
619
621
|
)
|
|
620
622
|
})
|
|
@@ -644,41 +646,36 @@ const SMALL_SIZES = [16, 32, 64] as const
|
|
|
644
646
|
/** an image at the small sizes an icon lives at, on a checkerboard */
|
|
645
647
|
const SmallSizes = ({ src }: { src: string }) => (
|
|
646
648
|
<span className="rv-tilesmall">
|
|
647
|
-
{SMALL_SIZES.map((px) => <img key={px} src={src} alt="" width={px} height={px}
|
|
649
|
+
{SMALL_SIZES.map((px) => <img key={px} src={src} alt="" width={px} height={px} {...tip(`${px} px`)} draggable={false} loading="lazy" />)}
|
|
648
650
|
</span>
|
|
649
651
|
)
|
|
650
652
|
|
|
651
653
|
/** what sits under a gallery image in the lightbox: its stars and keep, and the small sizes when shown */
|
|
652
654
|
const tileUnder = (rv: ReviewSt): number => 44 + (rv.tileSmall ? 84 : 0)
|
|
653
655
|
|
|
654
|
-
/** a gallery image large in the lightbox,
|
|
655
|
-
*
|
|
656
|
-
* stars, keep on a row of variants. OK, Fix, No are the lightbox bar's */
|
|
656
|
+
/** a gallery image large in the lightbox, whole in the stage's room (--fit-h, review.css, less what sits under it)
|
|
657
|
+
* until the lightbox's view sizes it (box-view.ts): its image (its before while flipped or peeked), a drag circles a
|
|
658
|
+
* spot; under it the small sizes, its stars, keep on a row of variants. OK, Fix, No are the lightbox bar's */
|
|
657
659
|
const BoxTile = observer(({ ver, v, view, t, k }: { ver: Ver; v: GalleryView; view: number; t: GalleryTile; k: number }) => {
|
|
658
660
|
const { rv, thread, cell } = ver
|
|
659
661
|
const id = itemOf(ver).id
|
|
660
662
|
const r = thread.reactionShown(cell, view, k)
|
|
661
663
|
const live = takes(ver)
|
|
662
664
|
const file = t.before && thread.showsBefore(view, k) ? t.before : t.file
|
|
663
|
-
const
|
|
664
|
-
const
|
|
665
|
-
const
|
|
666
|
-
const wide = z === 'width'
|
|
667
|
-
const under = tileUnder(rv)
|
|
668
|
-
// « fit »: the lightbox's stage (--fit-h, review.css) less what sits under the image
|
|
669
|
-
const style = scale ? { width: `${t.size.w * scale}px`, aspectRatio: aspect } : wide ? { width: '100%', aspectRatio: aspect } : { width: `min(100%, calc((var(--fit-h, 100vh - ${FIT_ROOM}px) - ${under}px) * ${t.size.w / t.size.h}))`, aspectRatio: aspect }
|
|
670
|
-
const scroll = scale || wide ? { overflow: 'auto', maxHeight: `calc(var(--fit-h) - ${under}px)` } : undefined
|
|
665
|
+
const zoom = useBoxView()
|
|
666
|
+
const room = `(var(--fit-h, 100vh - ${FIT_ROOM}px) - ${tileUnder(rv)}px)`
|
|
667
|
+
const style = { width: `min(100%, calc(${room} * ${t.size.w / t.size.h}))`, aspectRatio: `${t.size.w} / ${t.size.h}`, '--port-h': `calc(${room})` } as CSSProperties
|
|
671
668
|
// past « fit » the full file, so its own pixels show
|
|
672
|
-
const src =
|
|
669
|
+
const src = zoom?.full ? rv.fileUrl(id, file) : rv.fitUrl(id, file)
|
|
673
670
|
return (
|
|
674
671
|
<div className={`rv-tile big${r?.picked ? ' picked' : ''}${toneClass(r?.status)}`}
|
|
675
672
|
onMouseEnter={live ? () => thread.setHoverTile({ view, tile: k }) : undefined} onMouseLeave={live ? () => thread.setHoverTile(null) : undefined}>
|
|
676
|
-
<div className="rv-tilestage"
|
|
677
|
-
<div className="rv-tileimg rv-zoomface" data-cols={1}
|
|
673
|
+
<div className="rv-tilestage">
|
|
674
|
+
<div className="rv-tileimg rv-zoomface rv-zoomport" data-cols={1} {...tip(live ? 'drag to circle a spot' : undefined)} style={style}>
|
|
678
675
|
<Marks ver={ver} src={src} side={undefined} view={view} tile={k} />
|
|
679
676
|
{ver.live ? <div className="rv-over"><RectNote ver={ver} view={view} sides={[undefined]} tile={k} /></div> : null}
|
|
680
677
|
{t.before ? (
|
|
681
|
-
<span className={`rv-beforechip${file === t.before ? ' on' : ''}`}
|
|
678
|
+
<span className={`rv-beforechip${file === t.before ? ' on' : ''}`} {...tip('the pointer here shows the before')} onClick={(e) => e.stopPropagation()}
|
|
682
679
|
onMouseEnter={() => thread.setPeekTile(view, k)} onMouseLeave={() => thread.setPeekTile(view, null)}>before</span>
|
|
683
680
|
) : null}
|
|
684
681
|
</div>
|
|
@@ -687,7 +684,7 @@ const BoxTile = observer(({ ver, v, view, t, k }: { ver: Ver; v: GalleryView; vi
|
|
|
687
684
|
<div className="rv-tileunder">
|
|
688
685
|
{live || r?.stars ? <Stars ver={ver} view={view} tile={k} given={r?.stars} /> : null}
|
|
689
686
|
{t.group && (live || r?.picked) ? (
|
|
690
|
-
<button className={`rv-chip rv-keep${r?.picked ? ' on' : ''}`} disabled={!live}
|
|
687
|
+
<button className={`rv-chip rv-keep${r?.picked ? ' on' : ''}`} disabled={!live} {...tip(`keep this one for ${t.group}: one a row`)} onMouseDown={keepFocus}
|
|
691
688
|
onClick={() => mark(ver, () => thread.pickTile(view, k, t.group ?? '', v.gallery))}>{r?.picked ? '✓ kept' : `keep for ${t.group}`}</button>
|
|
692
689
|
) : null}
|
|
693
690
|
</div>
|
|
@@ -695,11 +692,12 @@ const BoxTile = observer(({ ver, v, view, t, k }: { ver: Ver; v: GalleryView; vi
|
|
|
695
692
|
)
|
|
696
693
|
})
|
|
697
694
|
|
|
698
|
-
/** one media view: a single image or clip, or the pair in the compare component
|
|
699
|
-
*
|
|
700
|
-
*
|
|
701
|
-
const MediaBody = observer(({ ver, v, i, zoom, boxed = false }: { ver: Ver; v: MediaView; i: number; zoom: Zoom
|
|
695
|
+
/** one media view: a single image or clip, or the pair in the compare component, fitted to the column, or in the
|
|
696
|
+
* lightbox (`boxed`) to the stage's room. `.rv-zoomface` holds `data-cols` images side by side and the room a frame
|
|
697
|
+
* takes (--port-h) once the lightbox's view shows the picture larger (box-view.ts, lightbox-zoom.css) */
|
|
698
|
+
const MediaBody = observer(({ ver, v, i, zoom, boxed = false }: { ver: Ver; v: MediaView; i: number; zoom: Zoom; boxed?: boolean }) => {
|
|
702
699
|
const { rv, thread } = ver
|
|
700
|
+
const view = useBoxView()
|
|
703
701
|
const item = itemOf(ver)
|
|
704
702
|
const id = item.id
|
|
705
703
|
if (v.audio) return <SoundBody ver={ver} v={v} saves={!boxed} />
|
|
@@ -709,8 +707,6 @@ const MediaBody = observer(({ ver, v, i, zoom, boxed = false }: { ver: Ver; v: M
|
|
|
709
707
|
const f = v.files
|
|
710
708
|
const ratio = v.size.w / v.size.h
|
|
711
709
|
const aspect = `${v.size.w} / ${v.size.h}`
|
|
712
|
-
const wide = zoom === 'width'
|
|
713
|
-
const scale = zoom === 'fit' || zoom === 'preview' || wide ? null : Number(zoom)
|
|
714
710
|
const room = FIT_ROOM + (v.clip ? 40 : 0)
|
|
715
711
|
const c = rv.compare
|
|
716
712
|
const mode = c.modeFor(v.clip !== undefined)
|
|
@@ -718,23 +714,21 @@ const MediaBody = observer(({ ver, v, i, zoom, boxed = false }: { ver: Ver; v: M
|
|
|
718
714
|
const under = (isPair(v.files) && !rv.phone.on ? 26 : 0) + (v.clip ? 44 : 0) + (isPair(v.files) && mode === 'swipe' ? 22 : 0)
|
|
719
715
|
// the height a view fits in: a preview's, the lightbox's, or the column's
|
|
720
716
|
const fitH = zoom === 'preview' ? 'var(--preview-h)' : boxed ? `(var(--fit-h) - ${under}px)` : `(100vh - ${room}px)`
|
|
717
|
+
const port = { '--port-h': `calc(${fitH})` }
|
|
721
718
|
// a clip always plays its fit url (its play copy keeps its size and frames), an image is the full file past « fit »
|
|
722
|
-
const src = (name: string): string => (
|
|
719
|
+
const src = (name: string): string => (view?.full && !v.clip ? rv.fileUrl(id, name, item.wip) : rv.fitUrl(id, name, item.wip))
|
|
723
720
|
// the page's clip keys reach the version his answer goes to: space when it is no pair, ← → when it has one view
|
|
724
721
|
const page = boxed && ver.cell.id === thread.target
|
|
725
722
|
const keys = boxed ? { play: page && !isPair(f), frames: page && item.views.length === 1 } : undefined
|
|
726
723
|
const bar = v.clip ? <ClipBar clip={thread.clipOf(id, i)} info={v.clip} use={() => ver.live && thread.setView(i)} keys={keys} /> : null
|
|
727
|
-
const scroll = scale || wide ? { overflow: 'auto', maxHeight: boxed ? `calc(var(--fit-h) - ${under}px)` : `calc(100vh - ${room}px)` } : undefined
|
|
728
724
|
if (!isPair(f)) {
|
|
729
725
|
const name = 'image' in f ? f.image : 'video' in f ? f.video : f.audio
|
|
730
726
|
return (
|
|
731
|
-
<div style={
|
|
732
|
-
<
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
{boxed ? null : <Downloads rv={rv} item={item} files={[{ file: name }]} />}
|
|
737
|
-
</div>
|
|
727
|
+
<div className="rv-zoomface" data-cols={1} style={{ width: zoom === 'preview' ? fillWidth(v.size) : `min(100%, calc(${fitH} * ${ratio}))`, margin: '0 auto', ...port } as CSSProperties}>
|
|
728
|
+
<Compare c={rv.compare} base={src(name)} mod={undefined} aspect={aspect} draw={(s) => <Marks ver={ver} src={s} side={undefined} view={i} />}
|
|
729
|
+
over={() => (ver.live ? <RectNote ver={ver} view={i} sides={[undefined]} /> : null)} />
|
|
730
|
+
{bar}
|
|
731
|
+
{boxed ? null : <Downloads rv={rv} item={item} files={[{ file: name }]} />}
|
|
738
732
|
</div>
|
|
739
733
|
)
|
|
740
734
|
}
|
|
@@ -744,24 +738,22 @@ const MediaBody = observer(({ ver, v, i, zoom, boxed = false }: { ver: Ver; v: M
|
|
|
744
738
|
if (rv.phone.on)
|
|
745
739
|
return (
|
|
746
740
|
<>
|
|
747
|
-
<PhonePair ver={ver} view={i} bar={bar} before={before} after={after} aspect={aspect} size={v.size}
|
|
741
|
+
<PhonePair ver={ver} view={i} bar={bar} before={before} after={after} aspect={aspect} size={v.size} fitH={boxed ? fitH : null} />
|
|
748
742
|
{saves}
|
|
749
743
|
</>
|
|
750
744
|
)
|
|
751
745
|
const cols = mode === 'side' ? 2 : 1
|
|
752
|
-
const fitW =
|
|
746
|
+
const fitW = `min(100%, calc(${fitH} * ${ratio * cols}))`
|
|
753
747
|
return (
|
|
754
748
|
<>
|
|
755
|
-
<div style={
|
|
756
|
-
<
|
|
757
|
-
<
|
|
758
|
-
|
|
759
|
-
over={(srcs) => (ver.live ? <RectNote ver={ver} view={i} sides={srcs.map((s) => drawnSide(mode, s === before ? 'before' : 'after'))} /> : null)} />
|
|
760
|
-
</div>
|
|
749
|
+
<div className="rv-pairgrid rv-zoomface" data-cols={cols} style={{ width: fitW, gridTemplateColumns: `repeat(${cols}, 1fr)`, ...port } as CSSProperties}>
|
|
750
|
+
<Compare c={c} mode={mode} base={before} mod={after} names={PAIR_NAMES} aspect={aspect}
|
|
751
|
+
draw={(s, face) => <Marks ver={ver} src={s} side={drawnSide(mode, s === before ? 'before' : 'after')} view={i} face={face} />}
|
|
752
|
+
over={(srcs) => (ver.live ? <RectNote ver={ver} view={i} sides={srcs.map((s) => drawnSide(mode, s === before ? 'before' : 'after'))} /> : null)} />
|
|
761
753
|
</div>
|
|
762
754
|
{bar ? <div style={{ width: fitW, margin: '0 auto' }}>{bar}</div> : null}
|
|
763
755
|
{saves ? <div style={{ width: fitW, margin: '0 auto' }}>{saves}</div> : null}
|
|
764
|
-
{mode === 'swipe' ? <div className="rv-dim rv-center">curtain: a drag moves the line; rectangles are drawn in the other modes</div> : null}
|
|
756
|
+
{mode === 'swipe' ? <div className="rv-dim rv-center">curtain: a drag moves the line{view?.on ? ' (hold the line itself: a drag elsewhere moves the picture)' : ''}; rectangles are drawn in the other modes</div> : null}
|
|
765
757
|
</>
|
|
766
758
|
)
|
|
767
759
|
})
|
|
@@ -772,44 +764,12 @@ const PreviewOf = observer(({ ver, v, i }: { ver: Ver; v: MediaView; i: number }
|
|
|
772
764
|
const { rv } = ver
|
|
773
765
|
const item = itemOf(ver)
|
|
774
766
|
return (
|
|
775
|
-
<button type="button" className="rv-viewpreview" data-check="view-still"
|
|
776
|
-
<img src={rv.fitUrl(item.id, thumbFileOf(v), item.wip)} alt="" loading="lazy" decoding="async" style={{ aspectRatio: `${v.size.w} / ${v.size.h}`, width:
|
|
767
|
+
<button type="button" className="rv-viewpreview" data-check="view-still" {...tip('open it whole: judge it, draw on it, save it')} onMouseDown={keepFocus} onClick={() => ver.thread.openBox(ver.cell.id, i)}>
|
|
768
|
+
<img src={rv.fitUrl(item.id, thumbFileOf(v), item.wip)} alt="" loading="lazy" decoding="async" style={{ aspectRatio: `${v.size.w} / ${v.size.h}`, width: fillWidth(v.size) }} />
|
|
777
769
|
</button>
|
|
778
770
|
)
|
|
779
771
|
})
|
|
780
772
|
|
|
781
|
-
/** the share of its own pixels a view is drawn at now, read off the page: what « fit » and « width » come to */
|
|
782
|
-
function shownScale(box: HTMLElement | null, size: { w: number } | null): number | null {
|
|
783
|
-
const face = box?.querySelector<HTMLElement>('.rv-zoomface')
|
|
784
|
-
if (face == null || size === null || !(size.w > 0)) return null
|
|
785
|
-
const cols = Number(face.dataset['cols'] ?? 1) || 1
|
|
786
|
-
const w = (face.getBoundingClientRect().width - 8 * (cols - 1)) / cols
|
|
787
|
-
return w > 0 ? w / size.w : null
|
|
788
|
-
}
|
|
789
|
-
|
|
790
|
-
const BOX_LABEL = { fit: 'Fit', width: 'Width' } as const
|
|
791
|
-
const BOX_TIP = { fit: 'the whole view in the window (0)', width: 'as wide as the window, it scrolls' } as const
|
|
792
|
-
|
|
793
|
-
/** the size of the view in the lightbox: whole, wide, its own pixels; a size the wheel or the keys gave shows as its
|
|
794
|
-
* percent; − and + step it. Kept for the repo */
|
|
795
|
-
const BoxZoomBar = observer(({ rv, step }: { rv: ReviewSt; step: (by: 1 | -1) => void }) => {
|
|
796
|
-
const z = rv.boxZoom
|
|
797
|
-
const free = typeof z === 'number' && !(BOX_ZOOM.picks as readonly number[]).includes(z)
|
|
798
|
-
return (
|
|
799
|
-
<span className="rv-boxzoom rv-keyed" title="the size of the view: ⌘ or ctrl with the wheel, a pinch, or + and −">
|
|
800
|
-
<span className="seg">
|
|
801
|
-
{(['fit', 'width'] as const).map((k) => (
|
|
802
|
-
<button key={k} className={z === k ? 'on' : ''} title={BOX_TIP[k]} onMouseDown={keepFocus} onClick={() => rv.setBoxZoom(k)}>{BOX_LABEL[k]}{k === 'fit' ? <Key k="0" /> : null}</button>
|
|
803
|
-
))}
|
|
804
|
-
{BOX_ZOOM.picks.map((n) => <button key={n} className={z === n ? 'on' : ''} title={`${n * 100} % of its own pixels`} onMouseDown={keepFocus} onClick={() => rv.setBoxZoom(n)}>{n * 100} %</button>)}
|
|
805
|
-
{free ? <button className="on" title="the size the wheel or the keys gave" onMouseDown={keepFocus}>{Math.round(z * 100)} %</button> : null}
|
|
806
|
-
</span>
|
|
807
|
-
<button className="ghost rv-keybtn" title="smaller (−)" aria-label="smaller" onMouseDown={keepFocus} onClick={() => step(-1)}><Key k="−" /><span className="rv-nokey">−</span></button>
|
|
808
|
-
<button className="ghost rv-keybtn" title="larger (+)" aria-label="larger" onMouseDown={keepFocus} onClick={() => step(1)}><Key k="+" /><span className="rv-nokey">+</span></button>
|
|
809
|
-
</span>
|
|
810
|
-
)
|
|
811
|
-
})
|
|
812
|
-
|
|
813
773
|
/** what the lightbox shows: the version and its view, and what that view takes (the steps, a pair's flip and compare
|
|
814
774
|
* modes, a size); null while it is shut */
|
|
815
775
|
function boxOf(rv: ReviewSt, thread: ThreadSt) {
|
|
@@ -832,28 +792,36 @@ function boxOf(rv: ReviewSt, thread: ThreadSt) {
|
|
|
832
792
|
// a view that is a gallery opens on its first image
|
|
833
793
|
const view = (to: number): void => thread.openBox(cell.id, to, isGallery(cell.item.views[to]!) ? 0 : undefined)
|
|
834
794
|
const step = (by: number): void => (tile ? thread.openBox(cell.id, b.view, order[(order.indexOf(tile.k) + by + order.length) % order.length]) : view((b.view + by + views) % views))
|
|
835
|
-
|
|
795
|
+
// the whole picture, small: the map of a view larger than its room
|
|
796
|
+
const whole = size === null ? null : rv.fitUrl(cell.id, tile ? tile.t.file : media !== null ? thumbFileOf(media) : '', cell.item.wip)
|
|
797
|
+
return { at: b.view, cell, v, media, views, ver, can, step, tile, size, whole }
|
|
836
798
|
}
|
|
837
799
|
|
|
838
|
-
/** a step of the lightbox's size from the size the view is drawn at now */
|
|
839
|
-
const resizeOf = (rv: ReviewSt, stage: { current: HTMLElement | null }, size: { w: number } | null) => (by: 1 | -1): void => rv.setBoxZoom(boxStep(shownScale(stage.current, size) ?? 1, by))
|
|
840
|
-
|
|
841
800
|
/** a key in the lightbox, true when it acted. Each acts only where its control shows: ← → the views, space a pair's
|
|
842
801
|
* before or after, V F R (or 1 2 3) OK Fix No on the view, 0 + − the size, Escape closes; V F R never reach the
|
|
843
|
-
* version's verdict from here
|
|
844
|
-
*
|
|
845
|
-
|
|
802
|
+
* version's verdict from here; ↑ ↓ stay here, the lightbox's own: they move a picture larger than its room, and so do
|
|
803
|
+
* ← → where they step nothing (one view, no clip). The page keeps the
|
|
804
|
+
* rest (D the compare mode, a clip's space, its ← → on a version of one view, A archives the thread). A text field
|
|
805
|
+
* (`field`) keeps every key but Escape */
|
|
806
|
+
export function boxKey(rv: ReviewSt, thread: ThreadSt, view: BoxView, e: Pick<KeyboardEvent, 'key' | 'metaKey' | 'ctrlKey' | 'altKey'>, field: boolean): boolean {
|
|
807
|
+
// ↑ ↓ are the lightbox's and never reach the page behind it. They are the view's
|
|
808
|
+
// (a 3D view goes forward and back, view3d/viewer.ts hears them itself)
|
|
809
|
+
const upDown = !e.metaKey && !e.ctrlKey && !e.altKey && !field && (e.key === 'ArrowUp' || e.key === 'ArrowDown')
|
|
846
810
|
// a kind's page takes every key but Escape: its own camera, its own walk
|
|
847
|
-
if (thread.boxed != null && 'states' in thread.boxed) return e.key === 'Escape' ? (thread.closeBox(), true) :
|
|
811
|
+
if (thread.boxed != null && 'states' in thread.boxed) return e.key === 'Escape' ? (thread.closeBox(), true) : upDown
|
|
848
812
|
const x = boxOf(rv, thread)
|
|
849
813
|
if (x == null || e.metaKey || e.ctrlKey || e.altKey || (field && e.key !== 'Escape')) return false
|
|
850
814
|
const { at, ver, can, step, tile } = x
|
|
851
815
|
const said = boxReaction(e.key)
|
|
852
816
|
if (e.key === 'Escape') thread.closeBox()
|
|
853
817
|
else if (can.step && (e.key === 'ArrowLeft' || e.key === 'ArrowRight')) step(e.key === 'ArrowLeft' ? -1 : 1)
|
|
818
|
+
else if (upDown) view.nudge(0, e.key === 'ArrowUp' ? -1 : 1)
|
|
819
|
+
else if (view.on && !x.media?.clip && (e.key === 'ArrowLeft' || e.key === 'ArrowRight')) view.nudge(e.key === 'ArrowLeft' ? -1 : 1, 0)
|
|
854
820
|
else if (can.pair && e.key === ' ') rv.compare.flip()
|
|
855
|
-
else if (can.size && e.key === '0')
|
|
856
|
-
|
|
821
|
+
else if (can.size && e.key === '0') {
|
|
822
|
+
rv.setBoxZoom('fit')
|
|
823
|
+
view.preset('fit')
|
|
824
|
+
} else if (can.size && (e.key === '+' || e.key === '=' || e.key === '-')) view.step(e.key === '-' ? -1 : 1)
|
|
857
825
|
else if (said != null) {
|
|
858
826
|
// a version of one view: O, F, N are the version's verdict
|
|
859
827
|
if (takes(ver)) mark(ver, () => (tile === undefined && oneSet(ver) ? void thread.submit(said) : thread.react(at, tile?.k, said)))
|
|
@@ -861,47 +829,39 @@ export function boxKey(rv: ReviewSt, thread: ThreadSt, stage: { current: HTMLEle
|
|
|
861
829
|
return true
|
|
862
830
|
}
|
|
863
831
|
|
|
864
|
-
/** the lightbox over the whole window (BoxFrame draws it), its
|
|
832
|
+
/** the lightbox over the whole window (BoxFrame draws it), its view of the picture (box-view.ts: the size, the place,
|
|
833
|
+
* the gestures on the stage) and its keys. Each view opens whole, then at the size the bar keeps */
|
|
865
834
|
export const ViewBox = observer(({ rv, thread }: { rv: ReviewSt; thread: ThreadSt }) => {
|
|
866
835
|
const stage = useRef<HTMLDivElement>(null)
|
|
836
|
+
const [view] = useState(() => new BoxView())
|
|
867
837
|
const x = boxOf(rv, thread)
|
|
868
|
-
|
|
869
|
-
const size = x?.size ?? null
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
838
|
+
// a phone sizes with the browser's own pinch
|
|
839
|
+
const size = rv.phone.on ? null : (x?.size ?? null)
|
|
840
|
+
const shows = x == null ? null : `${x.cell.id}#${x.at}/${x.tile?.k ?? ''}`
|
|
841
|
+
const w = size?.w
|
|
842
|
+
const h = size?.h
|
|
843
|
+
useLayoutEffect(() => {
|
|
873
844
|
const el = stage.current
|
|
874
|
-
if (el == null ||
|
|
875
|
-
const
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
if (face == null || from == null) return
|
|
880
|
-
e.preventDefault()
|
|
881
|
-
const was = face.getBoundingClientRect()
|
|
882
|
-
const fx = (e.clientX - was.left) / was.width
|
|
883
|
-
const fy = (e.clientY - was.top) / was.height
|
|
884
|
-
rv.setBoxZoom(boxStep(from, -e.deltaY / 100))
|
|
885
|
-
// once it is drawn at its new size, the point that was under the pointer is put back under it
|
|
886
|
-
requestAnimationFrame(() => {
|
|
887
|
-
const now = el.querySelector<HTMLElement>('.rv-zoomface')
|
|
888
|
-
const scroller = now?.parentElement
|
|
889
|
-
if (now == null || scroller == null) return
|
|
890
|
-
const is = now.getBoundingClientRect()
|
|
891
|
-
scroller.scrollLeft += is.left + fx * is.width - e.clientX
|
|
892
|
-
scroller.scrollTop += is.top + fy * is.height - e.clientY
|
|
893
|
-
})
|
|
845
|
+
if (el == null || shows === null) return
|
|
846
|
+
const off = view.attach(el)
|
|
847
|
+
// the note box beside a rectangle is placed again when its frame scrolls: a move of the view says so
|
|
848
|
+
view.onMoved = () => {
|
|
849
|
+
if (thread.rect !== null) el.dispatchEvent(new Event('scroll'))
|
|
894
850
|
}
|
|
895
|
-
|
|
896
|
-
return () =>
|
|
897
|
-
|
|
851
|
+
view.open(w === undefined || h === undefined ? null : { w, h }, rv.boxZoom)
|
|
852
|
+
return () => {
|
|
853
|
+
off()
|
|
854
|
+
view.onMoved = null
|
|
855
|
+
view.open(null, 'fit')
|
|
856
|
+
}
|
|
857
|
+
}, [shows, w, h, view, rv, thread])
|
|
898
858
|
// its keys come before the page's (capture): boxKey
|
|
899
859
|
const open = thread.boxed != null
|
|
900
860
|
useEffect(() => {
|
|
901
861
|
if (!open) return
|
|
902
862
|
const key = (e: KeyboardEvent): void => {
|
|
903
863
|
const field = (e.target as HTMLElement | null)?.closest?.('input, textarea, select, [contenteditable]') != null
|
|
904
|
-
if (!boxKey(rv, thread,
|
|
864
|
+
if (!boxKey(rv, thread, view, e, field)) return
|
|
905
865
|
e.preventDefault()
|
|
906
866
|
e.stopPropagation()
|
|
907
867
|
}
|
|
@@ -911,15 +871,16 @@ export const ViewBox = observer(({ rv, thread }: { rv: ReviewSt; thread: ThreadS
|
|
|
911
871
|
const b = thread.boxed
|
|
912
872
|
if (b != null && 'states' in b) return createPortal(<KindBox rv={rv} thread={thread} cell={b.cell} />, document.body)
|
|
913
873
|
if (x == null) return null
|
|
914
|
-
return createPortal(<BoxFrame rv={rv} thread={thread} stage={stage}
|
|
874
|
+
return createPortal(<BoxViewCtx.Provider value={rv.phone.on ? null : view}><BoxFrame rv={rv} thread={thread} stage={stage} view={view} /></BoxViewCtx.Provider>, document.body)
|
|
915
875
|
})
|
|
916
876
|
|
|
917
877
|
/** the lightbox: the view a preview opened, over the whole window. One bar on top reads as what he does, left to
|
|
918
878
|
* right: where he is (← → the version's views, the view's name, its tag, the thread), what he says of it (OK Fix No),
|
|
919
|
-
* how he looks at it (the compare modes, one side alone, the size, a gallery's filter and look), ✕.
|
|
920
|
-
* between, « fit » fitting that room (--fit-h, review.css)
|
|
921
|
-
* Every key is a chip on the control it triggers, shown only
|
|
922
|
-
|
|
879
|
+
* how he looks at it (the compare modes, one side alone, the size and what a drag does, a gallery's filter and look), ✕.
|
|
880
|
+
* The view takes the room between, « fit » fitting that room (--fit-h, review.css); larger, its map sits in a corner.
|
|
881
|
+
* One bar under it: his word on the view and its files. Every key is a chip on the control it triggers, shown only
|
|
882
|
+
* where the key acts */
|
|
883
|
+
export const BoxFrame = observer(({ rv, thread, stage, view }: { rv: ReviewSt; thread: ThreadSt; stage: React.RefObject<HTMLDivElement | null>; view: BoxView }) => {
|
|
923
884
|
const x = boxOf(rv, thread)
|
|
924
885
|
if (x == null) return null
|
|
925
886
|
const { at, cell, v, media, views, ver, can, step, tile } = x
|
|
@@ -929,37 +890,40 @@ export const BoxFrame = observer(({ rv, thread, stage }: { rv: ReviewSt; thread:
|
|
|
929
890
|
const files = filesOf(v)
|
|
930
891
|
const said = thread.saidOn(cell.id, at)
|
|
931
892
|
const tag = viewTag(cell.n, at)
|
|
893
|
+
// a drag draws a note's rectangle on a view that takes his notes, never under the curtain, whose drag is the line's
|
|
894
|
+
const draws = takes(ver) && !(can.pair && rv.compare.modeFor(media?.clip !== undefined) === 'swipe')
|
|
932
895
|
return (
|
|
933
896
|
<Lightbox
|
|
934
897
|
tone={toneClass(shown?.status)}
|
|
935
898
|
label={`view ${tag}: ${name}`}
|
|
936
899
|
close={() => thread.closeBox()}
|
|
937
900
|
stage={stage}
|
|
901
|
+
over={x.size !== null && x.whole !== null && !rv.phone.on ? <ZoomMap view={view} src={x.whole} size={x.size} /> : null}
|
|
938
902
|
top={<>
|
|
939
903
|
<span className="rv-boxwhere">
|
|
940
|
-
{can.step ? <button className="ghost rv-keybtn" data-check="lightbox-prev"
|
|
904
|
+
{can.step ? <button className="ghost rv-keybtn" data-check="lightbox-prev" {...tip(tile ? 'the image before' : 'the view before', '←')} aria-label="the one before" onMouseDown={keepFocus} onClick={() => step(-1)}><Key k="←" /><span className="rv-nokey">‹</span></button> : null}
|
|
941
905
|
<span className="rv-boxn rv-dim">{tile ? tile.order.indexOf(tile.k) + 1 : at + 1} of {tile ? tile.order.length : views}{tile && thread.tileFilter !== 'all' ? ` · ${TILE_FILTER_LABEL[thread.tileFilter]}` : ''}</span>
|
|
942
|
-
{can.step ? <button className="ghost rv-keybtn" data-check="lightbox-next"
|
|
943
|
-
<b className="rv-boxname"
|
|
906
|
+
{can.step ? <button className="ghost rv-keybtn" data-check="lightbox-next" {...tip(tile ? 'the image after' : 'the view after', '→')} aria-label="the one after" onMouseDown={keepFocus} onClick={() => step(1)}><Key k="→" /><span className="rv-nokey">›</span></button> : null}
|
|
907
|
+
<b className="rv-boxname" {...tip(name)}>{name}</b>
|
|
944
908
|
{tile ? (v.label ? <span className="rv-boxkind rv-dim">{v.label}</span> : null) : v.label && v.label.toLowerCase() !== kind.toLowerCase() ? <span className="rv-boxkind rv-dim">{kind}</span> : null}
|
|
945
|
-
<span className="rv-boxtag"
|
|
946
|
-
<span className="rv-boxtitle rv-dim"
|
|
909
|
+
<span className="rv-boxtag" {...tip(`view ${tag}`)}>{tag}</span>
|
|
910
|
+
<span className="rv-boxtitle rv-dim" {...tip(cell.item.title)}>{cell.item.title}</span>
|
|
947
911
|
</span>
|
|
948
912
|
{/* a version of one view: its keys and buttons here are the version's own verdict */}
|
|
949
913
|
{takes(ver) ? <ReactionToggles ver={ver} view={at} {...(tile ? { tile: tile.k } : {})} keys verdict={!tile && oneSet(ver)} /> : shown?.status ? <SentReaction status={shown.status} /> : null}
|
|
950
914
|
<span className="rv-boxlook">
|
|
951
|
-
{rv.phone.on && takes(ver) && (tile !== null || (media !== null && !media.clip && !media.audio && !media.scene)) ? <button className={rv.phone.draw ? 'primary' : ''}
|
|
915
|
+
{rv.phone.on && takes(ver) && (tile !== null || (media !== null && !media.clip && !media.audio && !media.scene)) ? <button className={rv.phone.draw ? 'primary' : ''} {...tip('a drag circles a spot instead of scrolling')} onClick={() => rv.phone.toggleDraw()}>Circle</button> : null}
|
|
952
916
|
{can.pair && rv.phone.on ? <PhoneSides rv={rv} /> : null}
|
|
953
917
|
{can.pair && !rv.phone.on ? <CompareModes c={rv.compare} clip={media?.clip !== undefined} keys /> : null}
|
|
954
918
|
{can.pair && !rv.phone.on ? <PairFlip c={rv.compare} /> : null}
|
|
955
|
-
{media?.marks && media.marks.length > 0 ? <button className={rv.marksOn ? 'primary' : ''}
|
|
919
|
+
{media?.marks && media.marks.length > 0 ? <button className={rv.marksOn ? 'primary' : ''} {...tip("the repo's own rings on the shot", 'M')} onMouseDown={keepFocus} onClick={() => rv.toggleMarks()}>marks<Key k="M" /></button> : null}
|
|
956
920
|
{/* a phone sizes with a pinch: the size control is the keyboard's and the wheel's */}
|
|
957
|
-
{can.size && !rv.phone.on ? <BoxZoomBar
|
|
921
|
+
{can.size && !rv.phone.on ? <BoxZoomBar view={view} pick={(k) => rv.setBoxZoom(k)} draws={draws} /> : null}
|
|
958
922
|
{isGallery(v) && tile?.t.view === undefined ? <GalleryTools ver={ver} v={v} /> : null}
|
|
959
923
|
</span>
|
|
960
924
|
</>}
|
|
961
925
|
foot={<>
|
|
962
|
-
{media?.note ? <span className="rv-boxnote rv-dim"
|
|
926
|
+
{media?.note ? <span className="rv-boxnote rv-dim" {...tip(media.note)}>{media.note}</span> : null}
|
|
963
927
|
{said.length > 0 ? <div className="rv-boxsaid">{said.map((s, k) => <SaidLine key={k} s={s} v={v} n={cell.n} />)}</div> : null}
|
|
964
928
|
{/* the owner's words on a fix go in the thread's reply box, under the lightbox: one click there */}
|
|
965
929
|
{takes(ver) && thread.replyOn !== null && thread.replyOn.to !== 'action' ? (
|
|
@@ -1016,20 +980,20 @@ const filesOf = (v: ReviewView): { file: string; label?: string }[] => {
|
|
|
1016
980
|
const Downloads = observer(({ rv, item, files }: { rv: ReviewSt; item: Item; files: readonly { file: string; label?: string }[] }) => (
|
|
1017
981
|
<div className="rv-downloads">
|
|
1018
982
|
{files.map(({ file, label }) => (
|
|
1019
|
-
<a key={file} className="rv-dl" href={rv.fileUrl(item.id, file, item.wip)} download={`${item.id}-${file}`}
|
|
983
|
+
<a key={file} className="rv-dl" href={rv.fileUrl(item.id, file, item.wip)} download={`${item.id}-${file}`} {...tip(`download ${file} at full size`)}>⤓ save {label ?? (file.split('.').pop() ?? 'file')}</a>
|
|
1020
984
|
))}
|
|
1021
985
|
{rv.can('publish') && files.map(({ file, label }) => {
|
|
1022
986
|
const s = rv.shared.get(`${item.id}/${file}`)
|
|
1023
987
|
return (
|
|
1024
988
|
<button key={`share-${file}`} className="rv-dl ghost" disabled={s === 'sending'} onClick={() => void rv.share(item.id, file)}
|
|
1025
|
-
|
|
989
|
+
{...tip(s && s !== 'sending' ? `copy again: ${s}` : `publish ${file} in the Space and copy its link: a permanent public url, anyone who has it downloads the file`)}>
|
|
1026
990
|
{s === 'sending' ? 'uploading…' : `🔗 ${label ? `link ${label}` : 'copy link'}`}
|
|
1027
991
|
</button>
|
|
1028
992
|
)
|
|
1029
993
|
})}
|
|
1030
994
|
{/* the Finder is on the desktop only: a phone has none */}
|
|
1031
995
|
{rv.phone.on || files[0] === undefined || !rv.can('reveal') ? null : (
|
|
1032
|
-
<button className="rv-dl ghost"
|
|
996
|
+
<button className="rv-dl ghost" {...tip(`open the version's folder in the Finder, ${files[0].file} selected`)} onClick={() => void rv.reveal(item.id, files[0]!.file)}>show in Finder</button>
|
|
1033
997
|
)}
|
|
1034
998
|
</div>
|
|
1035
999
|
))
|
|
@@ -1052,9 +1016,9 @@ const PhoneSides = observer(({ rv }: { rv: ReviewSt }) => {
|
|
|
1052
1016
|
return <span className="seg">{PAIR_SIDES.map((s) => <button key={s.value} className={side === s.value ? 'on' : ''} onClick={() => pick(s.value)}>{s.label}</button>)}</span>
|
|
1053
1017
|
})
|
|
1054
1018
|
|
|
1055
|
-
/** a pair on a phone: one side at a time full width, or the curtain
|
|
1056
|
-
*
|
|
1057
|
-
const PhonePair = observer(({ ver, view, bar, before, after, aspect, size,
|
|
1019
|
+
/** a pair on a phone: one side at a time full width, or the curtain. `fitH`: in the lightbox, the height it fits, its
|
|
1020
|
+
* sides chosen in the lightbox's bar */
|
|
1021
|
+
const PhonePair = observer(({ ver, view, bar, before, after, aspect, size, fitH }: {
|
|
1058
1022
|
ver: Ver
|
|
1059
1023
|
view: number
|
|
1060
1024
|
bar: ReactNode
|
|
@@ -1062,7 +1026,6 @@ const PhonePair = observer(({ ver, view, bar, before, after, aspect, size, scale
|
|
|
1062
1026
|
after: string
|
|
1063
1027
|
aspect: string
|
|
1064
1028
|
size: { w: number; h: number }
|
|
1065
|
-
scale: number | null
|
|
1066
1029
|
fitH: string | null
|
|
1067
1030
|
}) => {
|
|
1068
1031
|
const { rv } = ver
|
|
@@ -1074,8 +1037,8 @@ const PhonePair = observer(({ ver, view, bar, before, after, aspect, size, scale
|
|
|
1074
1037
|
return (
|
|
1075
1038
|
<div className="rv-phonepair">
|
|
1076
1039
|
{fitH ? null : <PhoneSides rv={rv} />}
|
|
1077
|
-
<div
|
|
1078
|
-
<div className={fitH ? 'rv-zoomface' : undefined} data-cols={fitH ? 1 : undefined} style={{ width:
|
|
1040
|
+
<div>
|
|
1041
|
+
<div className={fitH ? 'rv-zoomface' : undefined} data-cols={fitH ? 1 : undefined} style={{ width: fit, margin: '0 auto' }}>
|
|
1079
1042
|
{side === 'swipe' ? (
|
|
1080
1043
|
<Compare c={c} base={before} mod={after} names={PAIR_NAMES} aspect={aspect} draw={(s) => <Marks ver={ver} src={s} side={s === before ? 'before' : 'after'} view={view} />}
|
|
1081
1044
|
over={(srcs) => (ver.live ? <RectNote ver={ver} view={view} sides={srcs.map((s) => (s === before ? 'before' : 'after'))} /> : null)} />
|
|
@@ -1107,13 +1070,13 @@ const CompareModes = observer(({ c, clip, keys }: { c: CompareSt; clip: boolean;
|
|
|
1107
1070
|
<span className="seg">
|
|
1108
1071
|
{COMPARE_MODES.filter((m) => !(clip && m === 'diff')).map((m) => {
|
|
1109
1072
|
const o = MODES.find((x) => x.mode === m)!
|
|
1110
|
-
return <button key={m}
|
|
1073
|
+
return <button key={m} {...tip(`${o.tip} (D cycles, ⇧D back)`)} className={c.modeFor(clip) === m ? 'on' : ''} onMouseDown={keepFocus} onClick={() => c.setMode(m)}>{o.glyph}</button>
|
|
1111
1074
|
})}
|
|
1112
1075
|
</span>
|
|
1113
1076
|
{keys ? <Key k="D" /> : null}
|
|
1114
1077
|
</span>
|
|
1115
1078
|
{c.mode === 'onion' ? (
|
|
1116
|
-
<input className="rv-onion" type="range" min={0} max={1} step={0.05} value={c.opacity}
|
|
1079
|
+
<input className="rv-onion" type="range" min={0} max={1} step={0.05} value={c.opacity} {...tip(`after ${Math.round(c.opacity * 100)} %`)} onChange={(e) => c.setOpacity(Number(e.currentTarget.value))} />
|
|
1117
1080
|
) : null}
|
|
1118
1081
|
</span>
|
|
1119
1082
|
))
|
|
@@ -1123,7 +1086,7 @@ const PairFlip = observer(({ c }: { c: CompareSt }) => (
|
|
|
1123
1086
|
<span className="rv-keyed">
|
|
1124
1087
|
<span className="seg" role="group" aria-label="one side alone">
|
|
1125
1088
|
{(['before', 'after'] as const).map((side) => (
|
|
1126
|
-
<button key={side} className={c.shown === side ? 'on' : ''}
|
|
1089
|
+
<button key={side} className={c.shown === side ? 'on' : ''} {...tip(`the ${side} alone (space flips)`)} onMouseDown={keepFocus} onClick={() => c.show(side)}>{side}</button>
|
|
1127
1090
|
))}
|
|
1128
1091
|
</span>
|
|
1129
1092
|
<Key k="space" />
|
|
@@ -1257,9 +1220,13 @@ const Compare = observer(({ c, mode = c.mode, base, mod, names, aspect, draw, ov
|
|
|
1257
1220
|
* after green) and its name in a corner tag, both drawn over the image so nothing moves when it changes */
|
|
1258
1221
|
const Frame = ({ aspect, caption, modCap, swipe, onPeek, side, over, children }: { aspect: string; caption: ReactNode; modCap?: boolean; swipe?: CompareSt | undefined; onPeek?: (on: boolean) => void; side?: { tone: 'before' | 'after'; name: string }; over?: ReactNode; children: ReactNode }) => {
|
|
1259
1222
|
const frame = useRef<HTMLDivElement>(null)
|
|
1223
|
+
// in the lightbox the frame is a port on the picture: larger than its room, the picture moves under it (box-view.ts)
|
|
1224
|
+
const zoom = useBoxView()
|
|
1260
1225
|
const down = (e: React.PointerEvent): void => {
|
|
1261
1226
|
const el = frame.current
|
|
1262
1227
|
if (!swipe || !el || !e.isPrimary) return
|
|
1228
|
+
// a picture larger than its room: a drag moves it, the curtain's line is held by itself
|
|
1229
|
+
if (zoom?.on && !(e.target instanceof Element && e.target.closest('.rv-curtain'))) return
|
|
1263
1230
|
e.preventDefault()
|
|
1264
1231
|
const at = (x: number): void => {
|
|
1265
1232
|
const r = el.getBoundingClientRect()
|
|
@@ -1271,7 +1238,7 @@ const Frame = ({ aspect, caption, modCap, swipe, onPeek, side, over, children }:
|
|
|
1271
1238
|
return (
|
|
1272
1239
|
<div className="rv-cell">
|
|
1273
1240
|
<div className="rv-framebox">
|
|
1274
|
-
<div ref={frame} className={`rv-frame${swipe ? ' swipe' : ''}${side ? ` side-${side.tone}` : ''}`} style={{ aspectRatio: aspect }} onPointerDown={down}
|
|
1241
|
+
<div ref={frame} className={`rv-frame${zoom ? ' rv-zoomport' : ''}${swipe ? ' swipe' : ''}${side ? ` side-${side.tone}` : ''}`} style={{ aspectRatio: aspect }} onPointerDown={down}
|
|
1275
1242
|
onMouseEnter={() => onPeek?.(true)} onMouseLeave={() => onPeek?.(false)}>
|
|
1276
1243
|
{children}
|
|
1277
1244
|
</div>
|
|
@@ -1291,6 +1258,8 @@ export const pct = (r: { x: number; y: number; w: number; h: number }) => ({ lef
|
|
|
1291
1258
|
const clamp01 = (v: number): number => Math.max(0, Math.min(1, v))
|
|
1292
1259
|
/** a drag shorter than this, on either axis, is a click: it picks nothing */
|
|
1293
1260
|
const MIN_DRAG = 0.01
|
|
1261
|
+
/** and never more than this on the screen, in px: on a picture shown many times its size a hundredth of it is far */
|
|
1262
|
+
const MIN_DRAG_PX = 6
|
|
1294
1263
|
|
|
1295
1264
|
/** the drag that draws a rectangle on a picture, 0 to 1 over `el`: `show` the box while it moves (null once let go),
|
|
1296
1265
|
* `end` the rectangle, or null for a click. A version's views draw with it, and a trailer page's frame */
|
|
@@ -1315,7 +1284,8 @@ export function dragBox(e: { clientX: number; clientY: number }, el: Element, sh
|
|
|
1315
1284
|
// a second finger hands the gesture to the browser's pinch, which cancels this one: no rectangle, no tap
|
|
1316
1285
|
if (ev.type === 'pointercancel') return
|
|
1317
1286
|
const r = box(cur)
|
|
1318
|
-
|
|
1287
|
+
const b = el.getBoundingClientRect()
|
|
1288
|
+
end(r.w > Math.min(MIN_DRAG, MIN_DRAG_PX / b.width) && r.h > Math.min(MIN_DRAG, MIN_DRAG_PX / b.height) ? r : null)
|
|
1319
1289
|
}
|
|
1320
1290
|
window.addEventListener('pointermove', move)
|
|
1321
1291
|
window.addEventListener('pointerup', up)
|
|
@@ -1348,6 +1318,9 @@ const Marks = observer(({ ver, src, side, view, face, tile, onTap, alone, notes
|
|
|
1348
1318
|
const { rv, thread, cell } = ver
|
|
1349
1319
|
const el = useRef<HTMLDivElement>(null)
|
|
1350
1320
|
const [drag, setDrag] = useState<Corners | null>(null)
|
|
1321
|
+
// in the lightbox this is the layer the view sizes and moves: it takes the view again each time the page drew it
|
|
1322
|
+
const zoom = useBoxView()
|
|
1323
|
+
useLayoutEffect(() => zoom?.sync())
|
|
1351
1324
|
const phone = rv.phone
|
|
1352
1325
|
const any = itemOf(ver).views[view]
|
|
1353
1326
|
const shown = any && !isGallery(any) ? any : undefined
|
|
@@ -1371,6 +1344,7 @@ const Marks = observer(({ ver, src, side, view, face, tile, onTap, alone, notes
|
|
|
1371
1344
|
if (c && !c.paused) c.pause()
|
|
1372
1345
|
if (!el.current) return
|
|
1373
1346
|
dragBox(e, el.current, setDrag, (r) => {
|
|
1347
|
+
if (r) zoom?.drew()
|
|
1374
1348
|
if (r) thread.addRect(r, side, view, tile)
|
|
1375
1349
|
else if (onTap) onTap()
|
|
1376
1350
|
else thread.pickRect(null)
|
|
@@ -1382,7 +1356,7 @@ const Marks = observer(({ ver, src, side, view, face, tile, onTap, alone, notes
|
|
|
1382
1356
|
const rings = rv.marksOn ? (shown?.marks ?? []).filter((m) => m.side === side) : []
|
|
1383
1357
|
const live = drawing || (clock !== null && ver.live && !active)
|
|
1384
1358
|
return (
|
|
1385
|
-
<div ref={el} className={`rv-marks${clock && ver.live && !active ? ' pick' : drawing ? ' draw' : ''}`} onPointerDown={down} style={{ pointerEvents: live ? 'auto' : 'none', touchAction: drawing ? 'pinch-zoom' : undefined }}>
|
|
1359
|
+
<div ref={el} className={`rv-marks${zoom ? ' rv-zoomlayer' : ''}${clock && ver.live && !active ? ' pick' : drawing ? ' draw' : ''}`} onPointerDown={down} style={{ pointerEvents: live ? 'auto' : 'none', touchAction: drawing ? 'pinch-zoom' : undefined }}>
|
|
1386
1360
|
{face ?? (c ? <ClipVideo key={src} clip={c} src={src} poster={shown?.clip ? rv.fitUrl(cell.id, shown.clip.poster) : undefined} preload={ver.live ? 'auto' : 'none'} /> : <img src={src} alt="" draggable={false} className="rv-markimg" loading="lazy" decoding="async" />)}
|
|
1387
1361
|
{shown && rings.length > 0 ? <Rings marks={rings} w={shown.size.w} h={shown.size.h} /> : null}
|
|
1388
1362
|
{notes
|
|
@@ -1390,7 +1364,7 @@ const Marks = observer(({ ver, src, side, view, face, tile, onTap, alone, notes
|
|
|
1390
1364
|
const s = notes(r)
|
|
1391
1365
|
return s ? [<NoteRect key={`s${k}`} r={r} n={s.n} on={s.lit} sent />] : []
|
|
1392
1366
|
})
|
|
1393
|
-
: sent.map(({ r, n }, k) => <div key={`s${k}`} className={`rv-rect sent${onIts(r) ? '' : ' faint'}`} style={pct(r)}
|
|
1367
|
+
: sent.map(({ r, n }, k) => <div key={`s${k}`} className={`rv-rect sent${onIts(r) ? '' : ' faint'}`} style={pct(r)} {...tip(r.comment || `rectangle ${n}`)}><span className="rv-rectn">{n}</span></div>)}
|
|
1394
1368
|
{notes
|
|
1395
1369
|
? rects.flatMap(([r, i]) => {
|
|
1396
1370
|
const s = notes(r)
|
|
@@ -1406,7 +1380,7 @@ const Marks = observer(({ ver, src, side, view, face, tile, onTap, alone, notes
|
|
|
1406
1380
|
|
|
1407
1381
|
/** a note's rectangle as a host that shows notes by time draws it: solid, its number and its first words on its label */
|
|
1408
1382
|
export const NoteRect = ({ r, n, on, sent, pick }: { r: { x: number; y: number; w: number; h: number; comment: string }; n: number; on: boolean; sent?: boolean; pick?: () => void }) => (
|
|
1409
|
-
<div className={`rv-rect tr-noterect${on ? ' on' : ''}${sent ? ' was' : ''}`} style={{ ...pct(r), pointerEvents: pick ? 'auto' : 'none' }}
|
|
1383
|
+
<div className={`rv-rect tr-noterect${on ? ' on' : ''}${sent ? ' was' : ''}`} style={{ ...pct(r), pointerEvents: pick ? 'auto' : 'none' }} {...tip(r.comment || `note ${n}`)}
|
|
1410
1384
|
onPointerDown={pick ? (e) => { e.stopPropagation(); pick() } : undefined} onMouseDown={keepFocus}>
|
|
1411
1385
|
<span className="tr-notelabel"><b>{n}</b>{r.comment.trim() ? ` ${firstWords(r.comment)}` : ''}</span>
|
|
1412
1386
|
</div>
|
|
@@ -1426,7 +1400,7 @@ const Rings = ({ marks, w, h }: { marks: readonly ReviewMark[]; w: number; h: nu
|
|
|
1426
1400
|
|
|
1427
1401
|
/** a rectangle of his draft; on a clip, faint and dashed away from its frame, its time on its number */
|
|
1428
1402
|
const RectMark = ({ r, n, on, faint, at, pick }: { r: Rect; n: number; on: boolean; faint: boolean; at: string | undefined; pick: () => void }) => (
|
|
1429
|
-
<div className={`rv-rect${on ? ' on' : ''}${faint ? ' faint' : ''}`} style={{ ...pct(r), pointerEvents: 'auto' }}
|
|
1403
|
+
<div className={`rv-rect${on ? ' on' : ''}${faint ? ' faint' : ''}`} style={{ ...pct(r), pointerEvents: 'auto' }} {...tip(r.comment || `rectangle ${n}`)}
|
|
1430
1404
|
onPointerDown={(e) => { e.stopPropagation(); pick() }} onMouseDown={keepFocus}>
|
|
1431
1405
|
<span className="rv-rectn">{n}{at ? ` · ${at}` : ''}{!on && r.comment.trim() ? <span className="rv-rectword">{firstWords(r.comment)}</span> : null}</span>
|
|
1432
1406
|
</div>
|
|
@@ -1480,7 +1454,8 @@ const RectNote = observer(({ ver, view, sides, tile, notes }: { ver: Ver; view:
|
|
|
1480
1454
|
return {
|
|
1481
1455
|
contextElement: frame,
|
|
1482
1456
|
getBoundingClientRect: () => {
|
|
1483
|
-
|
|
1457
|
+
// in the lightbox the rectangle is on the picture's layer, which moves under its frame
|
|
1458
|
+
const b = (frame.parentElement?.querySelector('.rv-zoomlayer') ?? frame).getBoundingClientRect()
|
|
1484
1459
|
const left = b.left + x * b.width
|
|
1485
1460
|
const top = b.top + y * b.height
|
|
1486
1461
|
return { x: left, y: top, left, top, width: w * b.width, height: h * b.height, right: left + w * b.width, bottom: top + h * b.height }
|
|
@@ -1504,7 +1479,7 @@ const RectNote = observer(({ ver, view, sides, tile, notes }: { ver: Ver; view:
|
|
|
1504
1479
|
thread.pickRect(null)
|
|
1505
1480
|
}
|
|
1506
1481
|
}} />
|
|
1507
|
-
<button className="ghost rv-x"
|
|
1482
|
+
<button className="ghost rv-x" {...tip('delete this rectangle')} aria-label="delete this rectangle" onMouseDown={keepFocus} onClick={() => thread.removeRect(i)}>✕</button>
|
|
1508
1483
|
{notes || oneSet(ver) ? null : <span className="rv-notereacts"><ReactionToggles ver={ver} view={view} small /></span>}
|
|
1509
1484
|
</div>
|
|
1510
1485
|
</Popover>
|
|
@@ -1529,7 +1504,7 @@ const ClipVideo = ({ clip, src, poster, loop = true, preload = 'auto' }: { clip:
|
|
|
1529
1504
|
/** the sound button and the volume: a volume moved turns the sound on */
|
|
1530
1505
|
export const ClipSound = observer(({ clip, keyHint }: { clip: ClipSt; keyHint?: string }) => (
|
|
1531
1506
|
<span className="rv-sound">
|
|
1532
|
-
<button className={clip.sound ? 'primary' : ''}
|
|
1507
|
+
<button className={clip.sound ? 'primary' : ''} {...tip(`${clip.sound ? 'sound off' : 'sound on'}${keyHint ? ` (${keyHint})` : ''}`)} onMouseDown={keepFocus} onClick={() => clip.toggleSound()}>
|
|
1533
1508
|
{clip.sound ? '🔊' : '🔇'}
|
|
1534
1509
|
</button>
|
|
1535
1510
|
<input type="range" min={0} max={1} step={0.05} value={clip.sound ? clip.volume : 0} aria-label="volume" onChange={(e) => clip.setVolume(Number(e.currentTarget.value))}
|
|
@@ -1546,10 +1521,10 @@ const ClipBar = observer(({ clip, info, use, keys }: { clip: ClipSt; info: Revie
|
|
|
1546
1521
|
const step = keys?.frames ?? true
|
|
1547
1522
|
return (
|
|
1548
1523
|
<div className="rv-clipbar" onMouseDownCapture={use} onTouchStartCapture={use}>
|
|
1549
|
-
<button
|
|
1524
|
+
<button {...tip(`${clip.paused ? 'play' : 'pause'}${play ? ' (Space)' : ''}`)} onMouseDown={keepFocus} onClick={() => clip.toggle()}>{clip.paused ? '▶' : '❚❚'}{keys && play ? <Key k="space" /> : null}</button>
|
|
1550
1525
|
<ClipSound clip={clip} />
|
|
1551
|
-
<button
|
|
1552
|
-
<button
|
|
1526
|
+
<button {...tip(`frame back${step ? ' (←)' : ''}`)} onMouseDown={keepFocus} onClick={() => clip.step(-1)}>⏮{keys && step ? <Key k="←" /> : null}</button>
|
|
1527
|
+
<button {...tip(`frame on${step ? ' (→)' : ''}`)} onMouseDown={keepFocus} onClick={() => clip.step(1)}>⏭{keys && step ? <Key k="→" /> : null}</button>
|
|
1553
1528
|
<input className="rv-scrub" type="range" min={0} max={info.duration} step={1 / info.fps} value={Math.min(clip.time, info.duration)}
|
|
1554
1529
|
onChange={(e) => clip.seek(Number(e.currentTarget.value))} onMouseUp={(e) => e.currentTarget.blur()} />
|
|
1555
1530
|
<span className="rv-mono">{secs(clip.time)} · frame {clip.frameOf(clip.time) + 1}/{frames}</span>
|