rvlib-shipkit 2.28.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 +75 -1
- package/package.json +11 -2
- package/src/advisors/acts.ts +277 -0
- package/src/advisors/advice.ts +384 -0
- package/src/advisors/advisor-view.ts +417 -0
- package/src/advisors/app-graph.ts +112 -0
- package/src/advisors/app.ts +75 -0
- package/src/advisors/door.ts +59 -0
- package/src/advisors/edge/api.ts +292 -0
- package/src/advisors/edge/bucket.ts +43 -0
- package/src/advisors/edge/certs.ts +20 -0
- package/src/advisors/edge/form.ts +45 -0
- package/src/advisors/edge/handler.ts +156 -0
- package/src/advisors/edge/jwt.ts +76 -0
- package/src/advisors/edge/shell.ts +27 -0
- package/src/advisors/edge/status.ts +12 -0
- package/src/advisors/edge/types.ts +137 -0
- package/src/advisors/edge/worker.ts +52 -0
- package/src/advisors/expose.ts +154 -0
- package/src/advisors/job.ts +35 -0
- package/src/advisors/owner-store.ts +226 -0
- package/src/advisors/photos.ts +182 -0
- package/src/advisors/project.ts +311 -0
- package/src/advisors/r2.ts +46 -0
- package/src/advisors/routes.ts +496 -0
- package/src/advisors/scan.ts +205 -0
- package/src/advisors/sync.ts +363 -0
- package/src/agent-time/accounts-usage-disk.ts +29 -0
- package/src/agent-time/accounts-usage.ts +105 -0
- package/src/agent-time/claude-sessions.ts +32 -0
- package/src/agent-time/hooks.ts +64 -27
- package/src/agent-time/lane-name.ts +7 -0
- package/src/agent-time/leads.ts +95 -0
- package/src/agent-time/live.ts +5 -2
- package/src/agent-time/registry.ts +248 -86
- package/src/agent-time/render.ts +35 -4
- package/src/agent-time/report-cache.ts +4 -8
- package/src/agent-time/report.ts +19 -1
- package/src/agent-time/store.ts +16 -20
- package/src/annex/snapshots.ts +3 -3
- package/src/annex/tidy.ts +10 -23
- package/src/asks/ask-after.ts +2 -1
- package/src/asks/ask-carry.ts +190 -0
- package/src/asks/ask-close.ts +72 -0
- package/src/asks/ask-doc.ts +42 -0
- package/src/asks/ask-migrate.ts +9 -9
- package/src/asks/ask-steps-fold.ts +71 -114
- package/src/asks/ask-store.ts +190 -58
- package/src/asks/ask-words-fold.ts +208 -0
- package/src/check.ts +9 -1
- package/src/checks/SK001-package-json-shape.check.ts +6 -7
- package/src/checks/SK003-claude-md-shape.check.ts +1 -0
- package/src/checks/SK004-gitignore-policy.check.ts +25 -19
- package/src/checks/SK008-reviewer-agent.check.ts +4 -7
- package/src/checks/SK010-undeclared-unit.check.ts +77 -64
- package/src/checks/SK013-one-way-in-policy.check.ts +21 -8
- 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 +47 -6
- package/src/checks/SK033-global-contribution.check.ts +2 -1
- package/src/checks/SK034-commit-gates-armed.check.ts +1 -0
- package/src/checks/SK036-draft-media-size.check.ts +5 -4
- package/src/checks/SK039-vscode-watch-generated.check.ts +2 -1
- package/src/checks/SK040-release-words.check.ts +39 -10
- package/src/checks/SK042-post-kinds.check.ts +2 -2
- package/src/checks/SK045-slow-hooks.check.ts +5 -2
- package/src/checks/SK049-thread-answers-hook.check.ts +11 -5
- package/src/checks/SK050-retired-commands.check.ts +1 -0
- package/src/checks/SK051-no-formatter.check.ts +486 -0
- package/src/cli/channel-run.ts +17 -0
- package/src/cli/cmd_Advisors.ts +357 -0
- package/src/cli/cmd_Annex.ts +10 -10
- package/src/cli/cmd_Asks.ts +113 -12
- package/src/cli/cmd_Backup.ts +12 -8
- package/src/cli/cmd_CacheAudit.ts +2 -2
- package/src/cli/cmd_Channel.ts +43 -0
- package/src/cli/cmd_Check.ts +3 -3
- package/src/cli/cmd_Checks.ts +1 -1
- package/src/cli/cmd_Ci.ts +15 -16
- package/src/cli/cmd_Db.ts +9 -9
- package/src/cli/cmd_FleetPush.ts +1 -1
- package/src/cli/cmd_GlobalProcesses.ts +1 -0
- package/src/cli/cmd_History.ts +2 -2
- package/src/cli/cmd_Home.ts +17 -11
- package/src/cli/cmd_Hooks.ts +14 -4
- package/src/cli/cmd_Hq.ts +73 -19
- package/src/cli/cmd_Keys.ts +1 -1
- package/src/cli/cmd_Lanes.ts +22 -4
- package/src/cli/cmd_Media.ts +67 -16
- package/src/cli/cmd_Orchestrator.ts +307 -0
- package/src/cli/cmd_OrchestratorRole.ts +163 -0
- package/src/cli/cmd_Rec.ts +5 -2
- package/src/cli/cmd_Reflect.ts +17 -3
- package/src/cli/cmd_Releases.ts +38 -38
- package/src/cli/cmd_Review.ts +760 -409
- package/src/cli/cmd_Secret.ts +44 -14
- package/src/cli/cmd_Shot.ts +12 -6
- package/src/cli/cmd_Social.ts +5 -4
- package/src/cli/cmd_SocialDrafts.ts +23 -10
- package/src/cli/cmd_Sound.ts +1 -0
- package/src/cli/cmd_Space.ts +1 -1
- package/src/cli/cmd_Start.ts +1 -1
- package/src/cli/cmd_ThreadKinds.ts +18 -11
- package/src/cli/cmd_ThreadReflect.ts +20 -12
- package/src/cli/cmd_ThreadSyncNeeds.ts +7 -7
- package/src/cli/cmd_Time.ts +2 -1
- package/src/cli/cmd_Tmp.ts +9 -8
- package/src/cli/cmd_TraceAudit.ts +1 -1
- package/src/cli/cmd_Trailer.ts +5 -5
- package/src/cli/cmd_Urls.ts +6 -6
- package/src/cli/cmd_Vault.ts +4 -4
- package/src/cli/cmd_When.ts +1 -1
- package/src/cli/cmd_Worktrees.ts +109 -0
- package/src/cli/inbox-hook-run.ts +109 -0
- package/src/cli/registry.ts +19 -4
- package/src/cli/review-here.ts +136 -0
- package/src/cli.ts +64 -25
- package/src/collections/actions.ts +7 -5
- package/src/collections/checks.ts +6 -1
- package/src/collections/collection-types.ts +20 -8
- package/src/collections/pings.ts +7 -1
- package/src/collections/providers.ts +21 -19
- package/src/collections/review.ts +25 -23
- package/src/collections/state-rules.ts +8 -7
- package/src/collections/tests.ts +7 -4
- package/src/comfy/comfy-panel.ts +2 -2
- package/src/commands/model.ts +1 -1
- package/src/commands/routes.ts +1 -1
- package/src/commands/runs.ts +1 -1
- package/src/core/app-icon-frame.ts +62 -0
- package/src/core/app-icon.ts +178 -22
- package/src/core/archived.ts +10 -7
- package/src/core/atomic-write.ts +36 -0
- package/src/core/budget.ts +16 -1
- package/src/core/bun-builtins.ts +7 -7
- package/src/core/canonical-scripts.ts +4 -6
- package/src/core/check-ctx.ts +54 -6
- package/src/core/check-pass.ts +7 -0
- package/src/core/day-stamp.ts +20 -0
- package/src/core/foreign.ts +87 -0
- package/src/core/git-bin.ts +10 -0
- package/src/core/git.ts +60 -16
- package/src/core/gui-color.ts +75 -0
- package/src/core/hard-reset.ts +1 -2
- package/src/core/history-files.ts +4 -8
- package/src/core/house-layout.ts +3 -0
- package/src/core/hub-theme.ts +14 -0
- package/src/core/identity.ts +1 -1
- package/src/core/in-base.ts +19 -0
- package/src/core/instance.ts +15 -5
- package/src/core/last-good.ts +42 -133
- package/src/core/layout.ts +4 -1
- package/src/core/load-probe.ts +4 -8
- package/src/core/locked-write.ts +117 -47
- package/src/core/loop-watch.ts +24 -3
- package/src/core/machine-commit.ts +9 -1
- package/src/core/machine-db.ts +54 -12
- package/src/core/machine-link.ts +1 -1
- package/src/core/memory-watch.ts +3 -2
- package/src/core/motherhome.ts +2 -1
- package/src/core/nearest.ts +23 -0
- package/src/core/on-loop.ts +57 -0
- package/src/core/one-lib.ts +2 -1
- package/src/core/one-way-in-policy.ts +43 -25
- package/src/core/owner-word-policy.ts +123 -0
- package/src/core/panel-shades.ts +140 -0
- package/src/core/raw-access.ts +9 -2
- package/src/core/reexec.ts +3 -5
- package/src/core/repo-gui-color.ts +16 -0
- package/src/core/repo-walk.ts +104 -0
- package/src/core/retention.ts +10 -12
- package/src/core/role-policy.ts +17 -0
- package/src/core/run-dirs.ts +45 -0
- package/src/core/runs-matrix.ts +1 -1
- package/src/core/scope.ts +6 -3
- package/src/core/slots.ts +2 -2
- package/src/core/slug.ts +33 -0
- package/src/core/spawn-timeout.ts +3 -1
- package/src/core/squircle.ts +0 -8
- package/src/core/throwaway-worktree.ts +21 -2
- package/src/core/tmux-policy.ts +264 -0
- package/src/core/unit-files.ts +4 -4
- package/src/core/unit-icon.ts +43 -0
- package/src/core/when-block.ts +4 -5
- package/src/core/when.ts +1 -3
- package/src/core/words.ts +33 -0
- package/src/fleet/push-fleet.ts +6 -11
- package/src/fleet/scan-fleet.ts +3 -0
- package/src/{core → gate}/cache-audit.ts +8 -2
- package/src/{core → gate}/check-runner.ts +24 -54
- package/src/{core → gate}/discover-checks.ts +5 -102
- package/src/{core → gate}/discover-legacy-checks.ts +3 -3
- package/src/{ledger → gate}/gate-checks.ts +19 -14
- package/src/gate/head-gate.ts +151 -0
- package/src/{core → gate}/job-follow.ts +1 -1
- package/src/{core → gate}/job-run.ts +3 -3
- package/src/{core → gate}/pre-commit-discovery.ts +2 -2
- package/src/{core → gate}/run-check.ts +7 -7
- package/src/{core → gate}/run-ci.ts +9 -9
- package/src/gate/run-fix.ts +198 -0
- package/src/{core → gate}/run-fixers.ts +22 -17
- package/src/{core → gate}/trace-audit.ts +8 -8
- package/src/home/activity-shape.ts +3 -1
- package/src/home/activity.ts +15 -12
- package/src/home/app-sign.ts +17 -9
- package/src/home/daemon-guard.ts +24 -0
- package/src/home/daemon-jobs.ts +66 -16
- package/src/home/database-words.ts +21 -27
- package/src/home/databases.ts +3 -3
- package/src/home/global-context.ts +2 -2
- package/src/home/global-units.ts +1 -1
- package/src/home/gui-app/ShipkitGui.swift +2129 -187
- package/src/home/gui-app/icon.svg +8 -0
- package/src/home/gui-app.ts +95 -31
- package/src/home/handover.ts +126 -0
- package/src/home/home-move.ts +29 -16
- package/src/home/home-paths.ts +30 -8
- package/src/home/home-routes.ts +120 -6
- package/src/home/home-start.ts +28 -4
- package/src/home/home-state.ts +12 -6
- package/src/home/hubs.ts +28 -5
- package/src/home/inbox-shape.ts +64 -37
- package/src/home/inbox.ts +2 -1
- package/src/home/lib-watch.ts +93 -74
- package/src/home/log-follow.ts +117 -0
- package/src/home/machine-fold.ts +47 -44
- package/src/home/machine-repair.ts +5 -6
- package/src/home/machine-stores.ts +3 -3
- package/src/home/machine-temp.ts +58 -67
- package/src/home/open-app.ts +9 -3
- package/src/home/page-build.ts +334 -0
- package/src/home/page-held.ts +338 -0
- package/src/home/pm-config.ts +2 -2
- package/src/home/pm.ts +96 -5
- package/src/home/process-apps.ts +73 -26
- package/src/home/process-rows.ts +16 -1
- package/src/home/push-sources.ts +137 -0
- package/src/home/resources.ts +16 -7
- package/src/home/run-daemon.ts +58 -5
- package/src/home/run-pm.ts +2 -1
- package/src/home/run-web.ts +11 -6
- package/src/home/search-shape.ts +54 -0
- package/src/home/search.ts +114 -0
- package/src/home/serve-daemon.ts +51 -20
- package/src/home/serve-web.ts +214 -149
- package/src/home/space-page.ts +10 -10
- package/src/home/space-route.ts +2 -2
- package/src/home/space-words.ts +11 -10
- package/src/home/supervise.ts +26 -1
- package/src/home/time-page-shape.ts +0 -13
- package/src/home/vault-page.ts +17 -16
- package/src/home/vault-reveal.ts +29 -0
- package/src/home/vault-words.ts +3 -3
- package/src/home/via-hub.ts +3 -4
- package/src/home/web-places.ts +239 -0
- package/src/home/widgets.ts +16 -2
- package/src/home/worktree-tidy.ts +236 -0
- package/src/hooks/commit-message.ts +11 -9
- package/src/hooks/edit-guard.ts +12 -0
- package/src/hooks/hook-gates.ts +2 -0
- package/src/hooks/leak-guard.ts +9 -3
- package/src/hooks/one-way-in-guard.ts +146 -61
- package/src/hooks/run-hooks.ts +70 -7
- package/src/hooks/shared-file.ts +364 -0
- package/src/hooks/shell-writes.ts +620 -0
- package/src/hooks/write-log.ts +149 -0
- package/src/{serve → house}/project-gutter.ts +5 -1
- package/src/hq/door-route.ts +64 -8
- package/src/hq/door.ts +47 -14
- package/src/hq/files-send.ts +5 -5
- package/src/hq/forgotten-log.ts +1 -1
- package/src/hq/history-check.ts +7 -6
- package/src/hq/history-send.ts +15 -15
- package/src/hq/hq-db.ts +11 -4
- package/src/hq/hq-local.ts +36 -15
- package/src/hq/hq-routes.ts +4 -2
- package/src/hq/hq-store.ts +13 -7
- package/src/hq/kinds/ask.ts +4 -3
- package/src/hq/kinds/index.ts +5 -4
- package/src/hq/kinds/{card-gone.ts → item-gone.ts} +24 -25
- package/src/hq/kinds/{card-msg.ts → item-msg.ts} +25 -27
- package/src/hq/kinds/{card.ts → item.ts} +31 -29
- package/src/hq/kinds/kind.ts +12 -4
- package/src/hq/kinds/media.ts +2 -3
- package/src/hq/kinds/presence-rule.ts +56 -0
- package/src/hq/kinds/presence.ts +210 -0
- package/src/hq/kinds/prompt.ts +2 -1
- package/src/hq/kinds/report.ts +8 -5
- package/src/hq/kinds/time-day.ts +5 -4
- package/src/hq/lead-order.ts +68 -0
- package/src/hq/ledger.ts +22 -22
- package/src/hq/machine-notes.ts +14 -15
- package/src/hq/outbox.ts +38 -22
- package/src/hq/replica.ts +5 -7
- package/src/hq/report-facts.ts +14 -7
- package/src/hq/report.ts +57 -14
- package/src/hq/switch.ts +21 -23
- package/src/hq/terminal-hop.ts +64 -0
- package/src/hq/{cards.ts → thread-sync.ts} +140 -105
- package/src/hq/vault-route.ts +1 -1
- package/src/{serve → http}/door-forward.ts +21 -16
- package/src/{serve → 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 +106 -0
- package/src/http/owner-word.ts +128 -0
- package/src/{serve → http}/same-origin.ts +15 -2
- package/src/{serve → http}/tailnet-caller.ts +5 -4
- package/src/identities/machine-route.ts +2 -2
- package/src/identities/shown.ts +2 -6
- package/src/ledger/check-table.ts +1 -1
- package/src/ledger/db.ts +1 -0
- package/src/ledger/git-key.ts +9 -3
- package/src/ledger/git-scan.ts +2 -2
- package/src/ledger/ledger.ts +6 -16
- package/src/ledger/run-log.ts +25 -1
- package/src/media-kinds.ts +4 -1
- package/src/media-store/backup/daemon.ts +3 -2
- package/src/media-store/backup/keys.ts +0 -3
- package/src/media-store/backup/manifest.ts +1 -1
- package/src/media-store/backup/prune.ts +15 -18
- package/src/media-store/backup/retention.ts +2 -2
- package/src/media-store/backup/run.ts +8 -27
- package/src/media-store/backup/sources.ts +63 -17
- package/src/media-store/backup/thread-copy.ts +16 -13
- package/src/media-store/backup/watch.ts +10 -6
- package/src/media-store/content.ts +3 -0
- package/src/media-store/copy/config.ts +10 -9
- package/src/media-store/copy/night.ts +4 -4
- package/src/media-store/daemon.ts +10 -6
- package/src/media-store/db.ts +10 -20
- package/src/media-store/forget-one.ts +247 -0
- package/src/media-store/forget.ts +23 -4
- package/src/media-store/hq-send.ts +5 -4
- package/src/media-store/purge.ts +2 -2
- package/src/media-store/put.ts +3 -0
- package/src/media-store/remote.ts +2 -2
- package/src/media-store/space-listing.ts +0 -5
- package/src/media-store/space.ts +15 -16
- package/src/media-store/tidy.ts +3 -3
- package/src/media-store/upload.ts +6 -2
- package/src/media-store/webp.ts +3 -3
- package/src/messages/collection.ts +2 -2
- package/src/messages/model.ts +6 -1
- package/src/messages/objects.ts +5 -3
- package/src/messages/routes.ts +3 -0
- package/src/messages/score.ts +1 -3
- package/src/messages/store-doc.ts +114 -0
- package/src/messages/verdicts.ts +6 -0
- package/src/messages/write.ts +3 -3
- package/src/mv/mv-md.ts +43 -12
- package/src/orchestrator/brief.md +31 -0
- package/src/orchestrator/channel-declare.ts +58 -0
- package/src/orchestrator/channel.ts +226 -0
- package/src/orchestrator/guards.ts +72 -0
- 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 +101 -0
- 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 +28 -0
- package/src/orchestrator/presence.ts +79 -0
- package/src/orchestrator/push.ts +97 -0
- package/src/orchestrator/role-shape.ts +270 -0
- package/src/orchestrator/role.ts +242 -0
- package/src/orchestrator/routes.ts +218 -0
- 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 +79 -0
- package/src/pages/frame-client.ts +44 -6
- package/src/pages/unit.ts +1 -1
- package/src/plan/repo-source.ts +1 -1
- package/src/problems/failure-words.ts +80 -0
- package/src/recordings/load.ts +1 -1
- package/src/recordings/model.ts +18 -10
- package/src/recordings/place.ts +3 -3
- package/src/recordings/recorder-app/Capture.swift +69 -21
- package/src/recordings/recorder-app/Editor.swift +214 -11
- package/src/recordings/recorder-app/main.swift +229 -47
- package/src/recordings/recorder-app.ts +1 -1
- package/src/recordings/routes.ts +11 -1
- package/src/recordings/take.ts +7 -5
- package/src/recordings/view.ts +6 -0
- package/src/reflect/prompt-corpus.ts +5 -3
- package/src/reflect/thread-words.ts +51 -0
- package/src/reflections/reflection-close.ts +123 -0
- package/src/reflections/reflection-doc.ts +59 -0
- package/src/reflections/reflection-place.ts +60 -0
- package/src/release/gate-checkout.ts +122 -20
- package/src/release/git-facts.ts +9 -8
- package/src/release/machine-words.ts +21 -3
- package/src/release/public-clean.ts +78 -19
- package/src/release/run-bump.ts +29 -10
- package/src/release/run-release.ts +76 -52
- package/src/releases/add.ts +33 -87
- package/src/releases/{from-card.ts → from-thread.ts} +47 -46
- package/src/releases/model.ts +207 -36
- package/src/releases/routes.ts +2 -2
- package/src/releases/shape.ts +184 -0
- package/src/releases/store.ts +10 -10
- package/src/repo-config.ts +46 -8
- package/src/review/anim.ts +7 -7
- package/src/review/answer-kinds.ts +39 -10
- package/src/review/aside-at.ts +19 -0
- package/src/review/auto.ts +3 -3
- package/src/review/band.ts +95 -3
- package/src/review/branch-hold.ts +12 -5
- package/src/review/cells.ts +169 -46
- package/src/review/doc-card.ts +41 -0
- package/src/review/doc-model.ts +100 -0
- package/src/review/doc-routes.ts +66 -0
- package/src/review/doc-save.ts +152 -0
- package/src/review/{draft-card.ts → draft-item.ts} +10 -7
- package/src/review/draft-model.ts +125 -17
- package/src/review/events.ts +5 -12
- package/src/review/file-tags.ts +52 -0
- package/src/review/format.ts +84 -41
- package/src/review/gone.ts +20 -20
- package/src/review/hand-over.ts +58 -0
- package/src/review/heard.ts +29 -0
- package/src/review/house-kind-defs.ts +34 -4
- package/src/review/http.ts +1 -1
- package/src/review/inbox-hook.ts +64 -10
- package/src/review/inbox-read.ts +54 -16
- package/src/review/instruction-guards.ts +137 -0
- package/src/review/instructions.ts +56 -2
- package/src/review/{card-db.ts → item-db.ts} +84 -32
- package/src/review/{card-rows.ts → item-rows.ts} +77 -50
- package/src/review/kind-still.ts +125 -0
- package/src/review/kinds.ts +46 -10
- package/src/review/lane-ask.ts +6 -2
- package/src/review/live-post.ts +107 -0
- package/src/review/live-view.ts +137 -0
- package/src/review/media-kind.ts +4 -4
- package/src/review/media-read.ts +4 -4
- package/src/review/media.ts +3 -5
- package/src/review/mentions.ts +102 -0
- package/src/review/model-moved.ts +76 -0
- package/src/review/model.ts +474 -151
- package/src/review/move.ts +59 -58
- package/src/review/need-address.ts +5 -5
- package/src/review/need-threads.ts +15 -57
- package/src/review/notes.ts +2 -1
- package/src/review/one-block.ts +64 -0
- package/src/review/owner-read.ts +41 -0
- package/src/review/owner-verdict.ts +3 -3
- package/src/review/parties.ts +172 -11
- package/src/review/paste.ts +4 -4
- package/src/review/phone-push.ts +137 -0
- package/src/review/previews.ts +16 -16
- package/src/review/project.ts +1 -1
- package/src/review/push.ts +286 -0
- package/src/review/referring.ts +26 -4
- package/src/review/reflection-object.ts +13 -18
- package/src/review/rev.ts +1 -1
- package/src/review/role.ts +3 -3
- package/src/review/routes.ts +124 -77
- package/src/review/search-index.ts +218 -0
- package/src/review/search-job.ts +40 -0
- package/src/review/search-ocr.ts +138 -0
- package/src/review/search-text.ts +129 -0
- package/src/review/secret-route.ts +45 -15
- package/src/review/settle.ts +67 -0
- package/src/review/snooze.ts +1 -16
- package/src/review/stage-routes.ts +15 -13
- package/src/review/{stage-card.ts → stage-thread.ts} +18 -17
- package/src/review/store-index.ts +49 -0
- package/src/review/store-parties.ts +22 -0
- package/src/review/store.ts +394 -214
- package/src/review/supersede.ts +23 -7
- package/src/review/take-back.ts +20 -6
- package/src/review/threads.ts +196 -64
- package/src/review/traces.ts +21 -33
- package/src/review/trailer-desk.ts +7 -7
- package/src/review/{trailer-card.ts → trailer-item.ts} +10 -10
- package/src/review/trailer-model.ts +4 -4
- package/src/review/trailer-notes.ts +2 -2
- package/src/review/trailer-routes.ts +5 -4
- package/src/review/trailer-shots.ts +3 -3
- package/src/review/unit.ts +71 -9
- package/src/review/uploads.ts +103 -0
- package/src/review/verdict-items.ts +2 -2
- package/src/review/verdict-write.ts +1 -1
- package/src/review/view-layout.ts +76 -0
- package/src/review/wait.ts +11 -5
- package/src/review/wakes.ts +115 -0
- package/src/review/watch-feed.ts +183 -0
- package/src/review/watchers.ts +48 -6
- package/src/rules/untrack-generated.ts +40 -39
- package/src/scaffold/files/bunfig.toml +1 -9
- package/src/scaffold/files/vscode-settings.json +1 -1
- package/src/scaffold/project-scaffold.ts +14 -10
- package/src/secrets/archive.ts +2 -1
- package/src/secrets/key-pair.ts +14 -0
- package/src/secrets/keychain-write.ts +11 -3
- package/src/secrets/lapse-mark.ts +8 -3
- package/src/secrets/lapse.ts +28 -17
- 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/security-line.ts +19 -0
- package/src/secrets/who-reads.ts +2 -1
- package/src/serve/embed.ts +1 -1
- package/src/serve/frame-part.ts +49 -0
- package/src/serve/house-runs.ts +1 -1
- package/src/serve/hub-app/accounts-line.tsx +55 -0
- package/src/serve/hub-app/activity-st.ts +50 -53
- package/src/serve/hub-app/activity-view.tsx +10 -9
- package/src/serve/hub-app/advice-box.tsx +67 -0
- package/src/serve/hub-app/advisor-app.tsx +48 -0
- package/src/serve/hub-app/advisor-face.tsx +30 -0
- package/src/serve/hub-app/advisor-host.ts +142 -0
- package/src/serve/hub-app/advisor.html +23 -0
- package/src/serve/hub-app/advisors-st.ts +261 -0
- package/src/serve/hub-app/advisors-view.tsx +311 -0
- package/src/serve/hub-app/advisors.css +61 -0
- package/src/serve/hub-app/app-bridge.ts +53 -24
- package/src/serve/hub-app/ask-steps-st.ts +60 -0
- package/src/serve/hub-app/ask-steps.tsx +23 -0
- package/src/serve/hub-app/asked-page.ts +24 -0
- package/src/serve/hub-app/asks-page.tsx +16 -9
- package/src/serve/hub-app/asks-st.ts +1 -4
- package/src/serve/hub-app/auto-text.tsx +110 -16
- 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 +41 -9
- package/src/serve/hub-app/code-copy.ts +173 -12
- package/src/serve/hub-app/col-card.tsx +15 -21
- package/src/serve/hub-app/col-list-page.tsx +14 -8
- package/src/serve/hub-app/col-list-st.ts +18 -3
- package/src/serve/hub-app/col-tables-view.tsx +8 -44
- package/src/serve/hub-app/col-tables.ts +14 -22
- package/src/serve/hub-app/cols-svc.ts +17 -13
- package/src/serve/hub-app/columns.ts +94 -0
- package/src/serve/hub-app/comfy-svc.ts +3 -2
- 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 +37 -27
- package/src/serve/hub-app/controls.css +80 -18
- package/src/serve/hub-app/cursor-spot.ts +81 -0
- package/src/serve/hub-app/cycle-button.tsx +2 -1
- package/src/serve/hub-app/database-st.ts +32 -27
- package/src/serve/hub-app/database-view.tsx +16 -14
- package/src/serve/hub-app/deaf.tsx +27 -0
- package/src/serve/hub-app/dock-st.ts +72 -26
- package/src/serve/hub-app/dock-view.tsx +32 -12
- package/src/serve/hub-app/editor/doc-editor-st.ts +223 -0
- package/src/serve/hub-app/editor/doc-editor.tsx +116 -0
- package/src/serve/hub-app/editor/doc-saved.tsx +26 -0
- package/src/serve/hub-app/editor/doc-slot.ts +66 -0
- package/src/serve/hub-app/editor.css +36 -0
- package/src/serve/hub-app/emoji-names.ts +1915 -0
- package/src/serve/hub-app/emoji.ts +133 -0
- 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 +217 -7
- package/src/serve/hub-app/geometry-view.tsx +3 -2
- package/src/serve/hub-app/git-st.ts +25 -19
- package/src/serve/hub-app/git-view.tsx +3 -2
- package/src/serve/hub-app/hash-route.ts +15 -3
- package/src/serve/hub-app/header-bar.tsx +53 -35
- package/src/serve/hub-app/held-keys.ts +25 -0
- package/src/serve/hub-app/home-st.ts +238 -23
- package/src/serve/hub-app/home-strip.css +24 -12
- package/src/serve/hub-app/home-strip.tsx +134 -66
- package/src/serve/hub-app/home.html +12 -0
- package/src/serve/hub-app/hub-app.tsx +123 -81
- package/src/serve/hub-app/hub.css +92 -89
- package/src/serve/hub-app/icons.tsx +26 -0
- package/src/serve/hub-app/identities-st.ts +53 -78
- package/src/serve/hub-app/identities-view.tsx +34 -30
- 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 +57 -11
- package/src/serve/hub-app/inbox-view.tsx +24 -12
- package/src/serve/hub-app/inbox.css +7 -3
- package/src/serve/hub-app/index.html +12 -0
- package/src/serve/hub-app/insights-st.ts +27 -19
- package/src/serve/hub-app/insights-view.tsx +6 -5
- package/src/serve/hub-app/instructions.css +13 -7
- package/src/serve/hub-app/kept-cols.tsx +83 -20
- package/src/serve/hub-app/kept-folds.ts +43 -0
- package/src/serve/hub-app/kept-width.tsx +76 -0
- package/src/serve/hub-app/keys.ts +122 -38
- package/src/serve/hub-app/later.tsx +1 -1
- package/src/serve/hub-app/layout-st.ts +118 -77
- 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-bar.css +12 -0
- 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 +12 -2
- package/src/serve/hub-app/machine-st.ts +105 -18
- package/src/serve/hub-app/machines-st.ts +40 -34
- package/src/serve/hub-app/machines-view.tsx +5 -5
- 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/markdown.css +81 -4
- package/src/serve/hub-app/md.ts +155 -9
- package/src/serve/hub-app/media-svc.ts +49 -16
- package/src/serve/hub-app/media-view.tsx +13 -12
- package/src/serve/hub-app/messages/messages-page.tsx +63 -18
- package/src/serve/hub-app/messages/messages-st.ts +29 -22
- package/src/serve/hub-app/new-thread-st.ts +170 -0
- package/src/serve/hub-app/new-thread.tsx +147 -0
- package/src/serve/hub-app/objects.css +1 -0
- package/src/serve/hub-app/orchestrator-line.tsx +174 -0
- package/src/serve/hub-app/orchestrator-places.tsx +86 -0
- package/src/serve/hub-app/orchestrator.css +89 -0
- package/src/serve/hub-app/page-keys.ts +111 -69
- package/src/serve/hub-app/page-reload.ts +151 -0
- package/src/serve/hub-app/pages-frames.tsx +42 -4
- package/src/serve/hub-app/pages-svc.ts +11 -4
- package/src/serve/hub-app/palette-st.ts +200 -40
- package/src/serve/hub-app/palette-view.tsx +32 -8
- package/src/serve/hub-app/pane-boundary.tsx +13 -0
- package/src/serve/hub-app/pane-errors.ts +2 -1
- 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/pano.css +20 -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 +4 -3
- package/src/serve/hub-app/planned-st.ts +30 -26
- package/src/serve/hub-app/planned-view.tsx +16 -9
- package/src/serve/hub-app/polled.ts +211 -0
- package/src/serve/hub-app/presence-st.ts +144 -0
- 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 +39 -149
- package/src/serve/hub-app/project-list.tsx +63 -344
- package/src/serve/hub-app/projects-svc.ts +166 -87
- package/src/serve/hub-app/push-sign.tsx +16 -0
- package/src/serve/hub-app/push-svc.ts +290 -0
- package/src/serve/hub-app/quiet-st.ts +61 -0
- package/src/serve/hub-app/rail-groups.ts +144 -0
- package/src/serve/hub-app/reach.ts +16 -0
- package/src/serve/hub-app/reader-chips.tsx +2 -1
- package/src/serve/hub-app/recordings-st.ts +171 -10
- package/src/serve/hub-app/recordings-take.ts +58 -0
- package/src/serve/hub-app/recordings-view.tsx +51 -72
- package/src/serve/hub-app/recordings.css +0 -2
- package/src/serve/hub-app/reflections-page.tsx +24 -8
- package/src/serve/hub-app/releases/releases-page.tsx +56 -22
- package/src/serve/hub-app/releases/releases-st.ts +39 -26
- package/src/serve/hub-app/releases.css +4 -0
- package/src/serve/hub-app/repo-sections.ts +143 -43
- package/src/serve/hub-app/repo-st.ts +91 -43
- package/src/serve/hub-app/review/advisor-bar.tsx +41 -0
- package/src/serve/hub-app/review/ask-proof.tsx +79 -0
- package/src/serve/hub-app/review/attach-st.ts +195 -0
- package/src/serve/hub-app/review/attach-view.tsx +261 -0
- 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/clip-st.ts +1 -1
- package/src/serve/hub-app/review/cta.tsx +11 -0
- package/src/serve/hub-app/review/diff-view.tsx +40 -37
- package/src/serve/hub-app/review/doc-body.tsx +110 -0
- package/src/serve/hub-app/review/dock.tsx +38 -23
- package/src/serve/hub-app/review/draft-body.tsx +236 -0
- package/src/serve/hub-app/review/faces.tsx +18 -0
- package/src/serve/hub-app/review/group-block.tsx +80 -49
- package/src/serve/hub-app/review/heard-line.tsx +32 -0
- package/src/serve/hub-app/review/instructions-view.tsx +58 -32
- package/src/serve/hub-app/review/item-verdict.tsx +99 -26
- package/src/serve/hub-app/review/kind-states.tsx +149 -76
- package/src/serve/hub-app/review/kind-view.tsx +22 -7
- package/src/serve/hub-app/review/kit.tsx +27 -31
- package/src/serve/hub-app/review/lane-bar.tsx +33 -31
- package/src/serve/hub-app/review/lightbox.tsx +18 -0
- package/src/serve/hub-app/review/line-window.ts +149 -0
- package/src/serve/hub-app/review/live-bar-st.ts +145 -0
- package/src/serve/hub-app/review/live-bar.tsx +127 -0
- package/src/serve/hub-app/review/live-view.tsx +105 -0
- package/src/serve/hub-app/review/mention-st.ts +85 -0
- package/src/serve/hub-app/review/mesh-view.tsx +9 -0
- package/src/serve/hub-app/review/object-card.tsx +2 -1
- package/src/serve/hub-app/review/object-panel.tsx +41 -22
- package/src/serve/hub-app/review/pano-gl.ts +145 -0
- package/src/serve/hub-app/review/pano-view.tsx +193 -0
- package/src/serve/hub-app/review/phone-top.tsx +16 -0
- package/src/serve/hub-app/review/pictures-st.ts +38 -0
- package/src/serve/hub-app/review/question-views.tsx +111 -108
- package/src/serve/hub-app/review/review-board.tsx +1 -1
- package/src/serve/hub-app/review/review-cells.tsx +175 -116
- package/src/serve/hub-app/review/review-host.ts +72 -0
- package/src/serve/hub-app/review/review-kit.ts +41 -24
- package/src/serve/hub-app/review/review-list.tsx +210 -61
- package/src/serve/hub-app/review/review-page.tsx +10 -21
- package/src/serve/hub-app/review/review-st.ts +307 -148
- package/src/serve/hub-app/review/review-thread.tsx +633 -224
- package/src/serve/hub-app/review/review-views.tsx +636 -570
- package/src/serve/hub-app/review/scene-view.tsx +26 -0
- package/src/serve/hub-app/review/secret-facts.ts +26 -0
- package/src/serve/hub-app/review/space3d.tsx +122 -0
- package/src/serve/hub-app/review/splat-view.tsx +9 -0
- package/src/serve/hub-app/review/superseded-runs.ts +76 -0
- package/src/serve/hub-app/review/thread-close.tsx +40 -38
- package/src/serve/hub-app/review/thread-control-st.ts +2 -1
- package/src/serve/hub-app/review/thread-st.ts +542 -158
- package/src/serve/hub-app/review/thread-views.ts +71 -0
- package/src/serve/hub-app/review/{trailer-card.tsx → trailer-body.tsx} +38 -37
- package/src/serve/hub-app/review/trailer-page.tsx +41 -41
- package/src/serve/hub-app/review/trailer-st.ts +41 -40
- package/src/serve/hub-app/review/trailer-timeline.tsx +32 -27
- package/src/serve/hub-app/review/trailer-voices.tsx +32 -30
- package/src/serve/hub-app/review.css +398 -169
- 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-st.ts +138 -0
- package/src/serve/hub-app/search-view.tsx +93 -0
- 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 +6 -4
- package/src/serve/hub-app/session-chips.tsx +55 -0
- package/src/serve/hub-app/shell-rows.ts +126 -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 +18 -29
- 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 +41 -35
- package/src/serve/hub-app/social/group-editor.tsx +45 -0
- package/src/serve/hub-app/social/kit.tsx +19 -57
- package/src/serve/hub-app/social/next-release.tsx +5 -4
- package/src/serve/hub-app/social/post-card.tsx +35 -70
- package/src/serve/hub-app/social/post-page.tsx +2 -1
- package/src/serve/hub-app/social/problems.tsx +8 -6
- package/src/serve/hub-app/social/social-page.tsx +32 -30
- package/src/serve/hub-app/social/social-st.ts +35 -86
- package/src/serve/hub-app/social/stage-popup.tsx +17 -16
- package/src/serve/hub-app/social/stage-st.ts +9 -9
- package/src/serve/hub-app/social.css +7 -13
- 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-st.ts +38 -48
- package/src/serve/hub-app/space-view.tsx +10 -9
- package/src/serve/hub-app/stores/stores-page.tsx +25 -23
- package/src/serve/hub-app/stores/stores-st.ts +20 -24
- 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-input.ts +12 -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 +91 -0
- package/src/serve/hub-app/terminal-sources.tsx +335 -0
- package/src/serve/hub-app/terminal-st.ts +696 -0
- 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 +61 -0
- package/src/serve/hub-app/test-view.tsx +5 -3
- package/src/serve/hub-app/tests-svc.ts +3 -2
- package/src/serve/hub-app/tests-view.tsx +16 -15
- package/src/serve/hub-app/theme-st.ts +6 -9
- package/src/serve/hub-app/thread-row.tsx +68 -25
- package/src/serve/hub-app/time-ago.tsx +41 -17
- package/src/serve/hub-app/time-st.ts +43 -27
- package/src/serve/hub-app/time-view.tsx +4 -3
- 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 +42 -10
- package/src/serve/hub-app/tree-svc.ts +168 -135
- 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 +172 -9
- 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-st.ts +32 -27
- package/src/serve/hub-app/vault-view.tsx +56 -4
- package/src/serve/hub-app/vault.css +2 -0
- package/src/serve/hub-app/veille/veille-page.tsx +38 -37
- package/src/serve/hub-app/veille/veille-st.ts +60 -50
- package/src/serve/hub-app/view-layout.css +90 -0
- package/src/serve/hub-app/waiting-svc.ts +2 -1
- package/src/serve/hub-app/when-view.tsx +5 -4
- package/src/serve/hub-app/wiki-st.ts +3 -2
- package/src/serve/hub-app/wikis-view.tsx +24 -20
- package/src/serve/hub-app/words.tsx +22 -0
- package/src/serve/hub-collections.ts +105 -0
- package/src/serve/hub-runtime.ts +68 -89
- package/src/serve/live-hop.ts +102 -0
- package/src/serve/orchestrator-host.ts +58 -0
- package/src/serve/other-repos.ts +1 -1
- package/src/serve/page-live.ts +147 -0
- package/src/serve/project-gutter-route.ts +116 -42
- package/src/serve/read-thread.ts +76 -0
- package/src/serve/read-worker.ts +58 -0
- package/src/serve/run-serve.ts +11 -7
- package/src/serve/runs-stamp.ts +33 -0
- package/src/serve/secrets-read.ts +156 -0
- package/src/serve/serve-hub.ts +168 -50
- package/src/serve/terminal-claudes.ts +185 -0
- package/src/serve/terminal-guard.ts +55 -0
- package/src/serve/terminal-host.ts +517 -0
- package/src/serve/terminal-record.ts +104 -0
- package/src/serve/terminal-route.ts +539 -0
- 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/shipkit.ts +8 -8
- package/src/shot/client.ts +27 -16
- package/src/shot/dom-clip.ts +30 -5
- package/src/shot/film-box.ts +23 -8
- package/src/shot/serve-shot.ts +16 -5
- package/src/shot/shooter.ts +70 -24
- package/src/shot/shot-ask.ts +12 -6
- package/src/shot/shot-guard.ts +53 -0
- package/src/shot/shot-theme.ts +59 -0
- package/src/shot/still-file.ts +60 -0
- package/src/site/desk.ts +4 -3
- package/src/social/compose.ts +13 -7
- package/src/social/cover.ts +4 -3
- package/src/social/desk-index.ts +2 -2
- package/src/social/draft-doc.ts +88 -0
- package/src/social/draft-versions.ts +80 -0
- package/src/social/drafts.ts +22 -4
- package/src/social/fit.ts +4 -3
- package/src/social/house.ts +1 -1
- package/src/social/import-drafts.ts +1 -1
- package/src/social/kinds.ts +1 -1
- package/src/social/load.ts +21 -13
- package/src/social/media-facts.ts +1 -19
- package/src/social/media-kind.ts +2 -2
- package/src/social/media-limit.ts +3 -18
- package/src/social/no-account.ts +38 -0
- package/src/social/post-sources.ts +4 -4
- package/src/social/post-text.ts +33 -13
- package/src/social/posts.ts +73 -18
- package/src/social/presence.ts +10 -8
- package/src/social/release-stage.ts +22 -22
- package/src/social/routes.ts +14 -32
- package/src/social/stage.ts +3 -3
- package/src/social/stats.ts +3 -4
- package/src/social/strip.ts +4 -6
- package/src/social/text.ts +2 -1
- package/src/social/{card-drafts.ts → thread-drafts.ts} +3 -3
- package/src/social/unit.ts +12 -3
- package/src/social/writes.ts +3 -6
- package/src/start-repo.ts +33 -13
- package/src/stores/desk.ts +1 -1
- package/src/suite/core-counters.ts +31 -3
- package/src/suite/judge-suites.ts +69 -47
- package/src/suite/select.ts +1 -27
- package/src/suite/suite-cli.ts +18 -8
- package/src/suite/suite-cpu-preload.ts +10 -6
- package/src/suite/test-units.ts +6 -2
- package/src/trace/tracer.ts +4 -5
- package/src/trailer/build.ts +30 -15
- package/src/trailer/ffmpeg.ts +90 -31
- package/src/trailer/fonts.ts +5 -6
- package/src/trailer/footage.ts +9 -3
- package/src/trailer/grammar.ts +2 -1
- package/src/trailer/graph.ts +12 -10
- package/src/trailer/load-unit.ts +1 -1
- package/src/trailer/passage.ts +4 -3
- package/src/trailer/prune.ts +4 -4
- package/src/trailer/score/sound.ts +3 -3
- package/src/trailer/shot-plan.ts +5 -5
- package/src/trailer/shot-state.ts +25 -31
- package/src/trailer/sound/eleven.ts +3 -1
- package/src/trailer/sound/gen.ts +3 -3
- package/src/trailer/sound/run.ts +76 -64
- package/src/trailer/sound/takes.ts +0 -3
- package/src/trailer/take-fault.ts +41 -0
- package/src/trailer/titles.ts +17 -13
- package/src/trailer/url.ts +1 -1
- package/src/trailer/vertical-draw.ts +7 -7
- package/src/trailer/vertical.ts +3 -3
- package/src/trailer/vocab.ts +3 -4
- package/src/ts/config.ts +60 -24
- package/src/ts/cycles.ts +3 -1
- package/src/ts/imports.ts +17 -3
- package/src/ts/rename.ts +6 -7
- package/src/ts/source-graph.ts +15 -9
- package/src/ts/workspaces.ts +26 -0
- package/src/tui/build-steps-panel.ts +3 -3
- package/src/tui/checks-panel.ts +2 -2
- package/src/urls/added.ts +111 -0
- package/src/urls/frame.ts +3 -3
- package/src/urls/icons.ts +294 -0
- package/src/urls/places.ts +139 -0
- package/src/urls/routes.ts +18 -8
- package/src/urls/rows.ts +49 -16
- package/src/urls/unit.ts +57 -3
- package/src/urls/write-routes.ts +207 -0
- package/src/vault/house-keys.ts +1 -1
- package/src/vault/vault-audit.ts +2 -3
- package/src/vault/vault-config.ts +6 -2
- package/src/vault/vault-destroy.ts +2 -1
- package/src/vault/vault-import.ts +4 -11
- package/src/vault/vault-restore.ts +6 -11
- package/src/vault/vault-serve.ts +47 -11
- package/src/vault/vault-snapshot.ts +5 -14
- package/src/veille/chrome.ts +18 -3
- package/src/veille/desk.ts +2 -2
- package/src/veille/identity.ts +6 -0
- package/src/veille/routes.ts +1 -1
- package/src/view3d/cam.ts +85 -0
- package/src/view3d/lib.ts +87 -0
- package/src/view3d/loop.ts +39 -0
- package/src/view3d/scene-cache.ts +62 -0
- package/src/view3d/viewer.ts +454 -0
- package/src/wiki/agent-paths.ts +56 -0
- package/src/wiki/run-wiki.ts +4 -1
- package/src/wiki/serve-graph.ts +2 -3
- package/src/core/run-fix.ts +0 -120
- package/src/home/hmr-keep.ts +0 -134
- package/src/serve/hub-app/review/draft-card.tsx +0 -163
- package/src/serve/hub-app/review/note-place.ts +0 -31
- 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 -100
- /package/src/{serve → http}/hub-port.ts +0 -0
- /package/src/{serve → http}/secret-gate.ts +0 -0
|
@@ -5,145 +5,244 @@
|
|
|
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, useLayoutEffect, 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
|
-
import { isChoice, isGallery, isPair, onFrame, 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'
|
|
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
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
14
|
+
import { boxReaction, FIT_ROOM, keepFocus, Key, PAIR_NAMES, PLACE_TIPS, REACTIONS, secs, SIDE_LABEL } from './kit.tsx'
|
|
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'
|
|
20
|
-
import { Pop } from '../floating.tsx'
|
|
22
|
+
import { Pop, Popover } from '../floating.tsx'
|
|
23
|
+
import { AnimPanel } from './kind-view.tsx'
|
|
24
|
+
import { KindBox, KindViewFrames } from './kind-states.tsx'
|
|
25
|
+
import { Lightbox } from './lightbox.tsx'
|
|
26
|
+
import { LiveBody } from './live-view.tsx'
|
|
27
|
+
import { SceneBody } from './scene-view.tsx'
|
|
28
|
+
import { Words } from '../words.tsx'
|
|
29
|
+
import { soleSpot } from '../../../review/one-block.ts'
|
|
30
|
+
import { tip } from '../tips.ts'
|
|
21
31
|
|
|
22
|
-
const ZOOM_LABEL: Record<Zoom, string> = { preview: 'Preview', fit: 'Fit', '1': '100 %', '1.5': '150 %', '2': '200 %' }
|
|
23
32
|
export const toneClass = (s: string | undefined): string => (s ? ` re-${s}` : '')
|
|
24
33
|
|
|
25
34
|
/** one version as its views draw it: `live` when his answer goes to it and it draws his draft; `claim` when it is the
|
|
26
35
|
* newest while his answer sits on an older version: it takes his marks, and the first one brings his answer here */
|
|
27
36
|
export interface Ver {
|
|
28
37
|
rv: ReviewSt
|
|
29
|
-
|
|
38
|
+
thread: ThreadSt
|
|
30
39
|
cell: VersionCell
|
|
31
40
|
live: boolean
|
|
32
41
|
claim: boolean
|
|
33
42
|
}
|
|
34
43
|
|
|
35
44
|
const itemOf = (ver: Ver): Item => ver.cell.item
|
|
36
|
-
/** the version takes his marks: OK, Fix, No, a rectangle, a word, a star, a pick
|
|
37
|
-
|
|
45
|
+
/** the version takes his marks: OK, Fix, No, a rectangle, a word, a star, a pick. An advisor's page takes none of
|
|
46
|
+
* them: their advice is a verdict's button and words (review-host.ts) */
|
|
47
|
+
export const takes = (ver: Ver): boolean => (ver.live || ver.claim) && ver.rv.can('rects')
|
|
48
|
+
/** the owner's verdict stands on the version he answers and no draft of his sits on it: each view reads its answer as one quiet
|
|
49
|
+
* line, and the controls to change it show on a hover of the view's head (a phone reopens the thread instead) */
|
|
50
|
+
export const decided = (ver: Ver): boolean => ver.live && ver.cell.status !== 'pending' && ver.cell.status !== 'wip' && !ver.thread.marked
|
|
51
|
+
/** a version of one view or one place where its verdict is drawn: that verdict is its one set, the spot's OK, Fix, No
|
|
52
|
+
* are not drawn again (review/one-block.ts soleSpot) */
|
|
53
|
+
export const oneSet = (ver: Ver): boolean => ver.live && soleSpot(ver.cell.item) !== null
|
|
38
54
|
/** a mark on a claiming version: his answer comes to it first, then the mark lands in its own draft */
|
|
39
55
|
export const mark = (ver: Ver, f: () => void): void => {
|
|
40
|
-
if (ver.claim) ver.
|
|
56
|
+
if (ver.claim) ver.thread.answerNewest()
|
|
41
57
|
f()
|
|
42
58
|
}
|
|
43
59
|
|
|
44
|
-
/** a version's views
|
|
60
|
+
/** a version's views, laid out by one table (review/view-layout.ts LAYOUT): a view alone at its form's size, several
|
|
61
|
+
* views as a grid of equal tiles that fills the row, a sound or a gallery across the whole row. A choice, or views
|
|
62
|
+
* that each play alone, read as option rows under « rows | full ». No head row on a view: its name is one small line
|
|
63
|
+
* under it, its tools float over it on a hover */
|
|
45
64
|
export const VersionViews = observer(({ ver }: { ver: Ver }) => {
|
|
46
|
-
const {
|
|
65
|
+
const { thread } = ver
|
|
47
66
|
const item = itemOf(ver)
|
|
48
67
|
const views = item.views
|
|
49
|
-
const rows =
|
|
50
|
-
|
|
51
|
-
// a draft card's history is no view of its own: its frames cycle in place over the live one
|
|
68
|
+
const rows = thread.rows(item)
|
|
69
|
+
// a draft version's history is no view of its own: its frames cycle in place over the live one
|
|
52
70
|
const history = item.wip ? views.find(isGallery) : undefined
|
|
53
71
|
// a view an agent's update holds draws in that update's cell, at its time in the thread
|
|
54
|
-
const owned =
|
|
72
|
+
const owned = thread.messageViewsOf(item.id)
|
|
55
73
|
if (views.length > 0 && views.every((_, i) => owned.has(i))) return null
|
|
56
|
-
const options = rows || (
|
|
74
|
+
const options = rows || (thread.full[item.id] === true)
|
|
75
|
+
const shown = views.flatMap((v, i) => (v === history || owned.has(i) ? [] : [{ v, i }]))
|
|
76
|
+
const tiles = shown.filter(({ v }) => sizeOf(item, v, shown.map((x) => x.v)) === 'tile').length
|
|
57
77
|
return (
|
|
58
78
|
<div className="rv-views">
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<span className="seg"
|
|
62
|
-
<button className={rows ? 'on' : ''} onMouseDown={keepFocus} onClick={() =>
|
|
63
|
-
<button className={rows ? '' : 'on'} onMouseDown={keepFocus} onClick={() =>
|
|
79
|
+
{options ? (
|
|
80
|
+
<div className="rv-viewsbar">
|
|
81
|
+
<span className="seg" {...tip('the options as thin rows, one below the other, or every view full')}>
|
|
82
|
+
<button className={rows ? 'on' : ''} onMouseDown={keepFocus} onClick={() => thread.setFull(item.id, false)}>rows</button>
|
|
83
|
+
<button className={rows ? '' : 'on'} onMouseDown={keepFocus} onClick={() => thread.setFull(item.id, true)}>full</button>
|
|
64
84
|
</span>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
<span className="sp" />
|
|
68
|
-
{views.some(isGallery) ? (
|
|
69
|
-
<label className="rv-tilesize" title="the size of every tile of every grid, kept for this repo">
|
|
70
|
-
tiles
|
|
71
|
-
<input type="range" min={TILE_H.min} max={TILE_H.max} step={10} value={rv.tileH} onChange={(e) => rv.setTileH(Number(e.target.value))} />
|
|
72
|
-
</label>
|
|
73
|
-
) : null}
|
|
74
|
-
{views.some((v) => !isGallery(v)) ? (
|
|
75
|
-
<span className="seg" title="the zoom of every view of every version">
|
|
76
|
-
{ZOOMS.map((z) => <button key={z} className={rv.zoom === z ? 'on' : ''} onMouseDown={keepFocus} onClick={() => rv.setZoom(z)}>{ZOOM_LABEL[z]}</button>)}
|
|
77
|
-
</span>
|
|
78
|
-
) : null}
|
|
79
|
-
</div>
|
|
85
|
+
</div>
|
|
86
|
+
) : null}
|
|
80
87
|
{rows ? (
|
|
81
|
-
<div className="rv-opts">{
|
|
88
|
+
<div className="rv-opts">{shown.map(({ v, i }) => <OptionRow key={i} ver={ver} v={v} i={i} />)}</div>
|
|
82
89
|
) : (
|
|
83
|
-
|
|
90
|
+
<div className={`rv-viewset${tiles > 1 ? ' tiles' : ''}`} data-views={shown.length}>
|
|
91
|
+
{shown.map(({ v, i }) => <ViewCell key={i} ver={ver} v={v} i={i} among={shown.map((x) => x.v)} {...(i === 0 && history && isGallery(history) ? { frames: history } : {})} />)}
|
|
92
|
+
</div>
|
|
84
93
|
)}
|
|
85
94
|
</div>
|
|
86
95
|
)
|
|
87
96
|
})
|
|
88
97
|
|
|
89
|
-
/** one view
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const
|
|
98
|
+
/** one view: in the thread its media at the size its form takes (LAYOUT), its name and number as one small line under
|
|
99
|
+
* it, its tools over it on a hover, what was said on it under; in the lightbox (`boxed`) its body alone */
|
|
100
|
+
export const ViewCell = observer(({ ver, v: live, i, frames, noted = true, boxed = false, among }: { ver: Ver; v: ReviewView; i: number; frames?: GalleryView; noted?: boolean; boxed?: boolean; among?: readonly ReviewView[] }) => {
|
|
101
|
+
const { rv, thread, cell } = ver
|
|
102
|
+
const past = frames && thread.frame !== null ? frames.gallery[thread.frame] : undefined
|
|
93
103
|
const v: ReviewView = past && !isGallery(live) ? { ...live, files: { image: past.file }, size: past.size } : live
|
|
94
104
|
const media = isGallery(v) ? null : v
|
|
95
|
-
const
|
|
96
|
-
// the lightbox draws the view at its own size (ViewBox holds the control), whatever the thread's zoom
|
|
97
|
-
const zoom: Zoom | BoxZoom = boxed ? rv.boxZoom : rv.zoom
|
|
98
|
-
const shown = card.reactionShown(cell, i)
|
|
99
|
-
const active = ver.live && card.view === i
|
|
105
|
+
const shown = thread.reactionShown(cell, i)
|
|
100
106
|
const gone = goneOf(ver, v)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
107
|
+
if (boxed) {
|
|
108
|
+
// the lightbox draws its own bars around the view (ViewBox): the cell is its body alone; a live page framed live
|
|
109
|
+
const body = gone.length > 0 ? <Gone files={gone} />
|
|
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 />} />
|
|
111
|
+
: isGallery(v) ? <GalleryThumbs ver={ver} v={v} view={i} />
|
|
112
|
+
: <MediaBody ver={ver} v={v} i={i} zoom="fit" boxed />
|
|
104
113
|
return (
|
|
105
|
-
<section className={`rv-view boxed${toneClass(shown?.status)}`}>
|
|
106
|
-
{frames ? <FrameSlider
|
|
114
|
+
<section className={`rv-view boxed${toneClass(shown?.status)}`} data-check="lightbox-view" data-view={i}>
|
|
115
|
+
{frames ? <FrameSlider thread={thread} frames={frames} /> : null}
|
|
107
116
|
{body}
|
|
108
117
|
</section>
|
|
109
118
|
)
|
|
119
|
+
}
|
|
120
|
+
const form = formOf(v)
|
|
121
|
+
const size = sizeOf(cell.item, v, among ?? [v])
|
|
122
|
+
const active = ver.live && thread.view === i
|
|
123
|
+
const many = (among?.length ?? 1) > 1
|
|
124
|
+
const tag = viewTag(cell.n, i)
|
|
125
|
+
// its name under it when it has one or shares the version; else its number floats with its tools
|
|
126
|
+
const caption = v.label || many
|
|
110
127
|
return (
|
|
111
|
-
<section id={viewDom(cell.id, i)} className={`rv-view${toneClass(shown?.status)}${active ? ' active' : ''}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
{
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
<div className="rv-viewbody">
|
|
127
|
-
{frames ? <FrameSlider card={card} frames={frames} /> : null}
|
|
128
|
-
{body}
|
|
129
|
-
{noted && media?.note ? <div className="rv-viewnote">{media.note}</div> : null}
|
|
128
|
+
<section id={viewDom(cell.id, i)} className={`rv-view f-${form} s-${size}${toneClass(shown?.status)}${active ? ' active' : ''}`} data-check="view-cell" data-view={i} data-form={form} data-size={size}
|
|
129
|
+
onMouseDownCapture={() => ver.live && thread.view !== i && thread.setView(i)}>
|
|
130
|
+
{frames ? <FrameSlider thread={thread} frames={frames} /> : null}
|
|
131
|
+
<div className="rv-viewmedia">
|
|
132
|
+
{gone.length > 0 ? <Gone files={gone} /> : <ViewBody ver={ver} v={v} i={i} form={form} size={size} />}
|
|
133
|
+
<ViewTools ver={ver} v={v} i={i} tag={caption ? null : tag} />
|
|
134
|
+
</div>
|
|
135
|
+
{caption ? (
|
|
136
|
+
<div className="rv-viewcap" {...tip(`view ${tag}`)}>
|
|
137
|
+
<span className="rv-viewn">{tag}</span>
|
|
138
|
+
{v.label ? <b className="rv-viewname">{v.label}</b> : null}
|
|
139
|
+
{v.label.toLowerCase() === viewKind(v, false).toLowerCase() ? null : <span className="rv-dim">{viewKind(v, false)}</span>}
|
|
140
|
+
{/* one verdict surface, the version's faces: a view's own OK, fix, no is the lightbox's; one said
|
|
141
|
+
there, or before, shows here as a quiet word */}
|
|
142
|
+
{shown?.status ? <SentReaction status={shown.status} /> : null}
|
|
130
143
|
</div>
|
|
131
|
-
) : null}
|
|
144
|
+
) : shown?.status ? <div className="rv-viewcap"><SentReaction status={shown.status} /></div> : null}
|
|
145
|
+
{noted && media?.note ? <Words text={media.note} className="rv-viewnote" /> : null}
|
|
146
|
+
<ViewNotes ver={ver} i={i} />
|
|
132
147
|
</section>
|
|
133
148
|
)
|
|
134
149
|
})
|
|
135
150
|
|
|
151
|
+
/** a view's media in the thread, by its form and its size (LAYOUT): an image, a pair that peeks at its before, a clip
|
|
152
|
+
* that plays alone or rests as its poster among others, a sound, a gallery, or the still of a view he looks around in */
|
|
153
|
+
const ViewBody = observer(({ ver, v, i, form, size }: { ver: Ver; v: ReviewView; i: number; form: ViewForm; size: Size }) => {
|
|
154
|
+
const { rv } = ver
|
|
155
|
+
const item = itemOf(ver)
|
|
156
|
+
const open = (): void => ver.thread.openBox(ver.cell.id, i)
|
|
157
|
+
if (isGallery(v)) return <GalleryThumbs ver={ver} v={v} view={i} />
|
|
158
|
+
const f = v.files
|
|
159
|
+
switch (form) {
|
|
160
|
+
case 'sound':
|
|
161
|
+
return <SoundBody ver={ver} v={v} />
|
|
162
|
+
case 'pair':
|
|
163
|
+
case 'clip-pair':
|
|
164
|
+
return isPair(f) ? <Peek ver={ver} v={v} i={i} size={size} before={f.before} after={f.after} /> : null
|
|
165
|
+
case 'clip':
|
|
166
|
+
return size === 'fill' ? <MediaBody ver={ver} v={v} i={i} zoom="preview" /> : <Still src={rv.fitUrl(item.id, thumbFileOf(v), item.wip)} word="clip" play open={open} fit="contain" />
|
|
167
|
+
case 'image':
|
|
168
|
+
return size === 'fill' ? <PreviewOf ver={ver} v={v} i={i} /> : <Still src={rv.fitUrl(item.id, thumbFileOf(v), item.wip)} word={null} open={open} fit="contain" />
|
|
169
|
+
default:
|
|
170
|
+
// a panorama, a splat, a mesh, a live page: its still at a tile's size, opened whole in the lightbox
|
|
171
|
+
return <Still src={rv.fitUrl(item.id, thumbFileOf(v), item.wip)} word={v.scene ? SCENE_WORDS[v.scene.kind] : 'live page'} open={open} fit="cover" />
|
|
172
|
+
}
|
|
173
|
+
})
|
|
174
|
+
|
|
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
|
|
176
|
+
* (« 360° · open »), ▶ on a clip's poster */
|
|
177
|
+
const Still = ({ src, word, open, fit, play = false }: { src: string; word: string | null; open: () => void; fit: 'cover' | 'contain'; play?: boolean }) => (
|
|
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}>
|
|
179
|
+
<img src={src} alt="" loading="lazy" decoding="async" draggable={false} />
|
|
180
|
+
{play ? <span className="rv-stillplay" aria-hidden>▶</span> : null}
|
|
181
|
+
{word ? <span className="rv-stillopen">{word} · open</span> : null}
|
|
182
|
+
</button>
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
/** a pair in the thread: its after; a hover cross fades to its before (PEEK_MS), « before » on it while it shows; a tap
|
|
186
|
+
* toggles them on touch, where « ⤢ » opens it. A click opens the lightbox, the only place the two stand side by side.
|
|
187
|
+
* A pair of clips does the same over its after's poster and its before's first frame */
|
|
188
|
+
const Peek = observer(({ ver, v, i, size, before, after }: { ver: Ver; v: MediaView; i: number; size: Size; before: string; after: string }) => {
|
|
189
|
+
const { rv } = ver
|
|
190
|
+
const item = itemOf(ver)
|
|
191
|
+
const [peek, setPeek] = useState(false)
|
|
192
|
+
const touch = useRef(false)
|
|
193
|
+
const style = size === 'fill' ? { aspectRatio: `${v.size.w} / ${v.size.h}`, width: fillWidth(v.size) } : undefined
|
|
194
|
+
const a = v.clip ? rv.fitUrl(item.id, v.clip.poster, item.wip) : rv.fitUrl(item.id, after, item.wip)
|
|
195
|
+
return (
|
|
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')}
|
|
197
|
+
onPointerDown={(e) => (touch.current = e.pointerType === 'touch')}
|
|
198
|
+
onMouseDown={keepFocus}
|
|
199
|
+
onClick={() => (touch.current ? setPeek(!peek) : ver.thread.openBox(ver.cell.id, i))}>
|
|
200
|
+
<img className="rv-peekafter" src={a} alt="the after" loading="lazy" decoding="async" draggable={false} />
|
|
201
|
+
{v.clip ? (
|
|
202
|
+
<video className="rv-peekbefore" src={`${rv.fitUrl(item.id, before, item.wip)}#t=0.1`} muted playsInline preload="metadata" aria-label="the before" />
|
|
203
|
+
) : (
|
|
204
|
+
<img className="rv-peekbefore" src={rv.fitUrl(item.id, before, item.wip)} alt="the before" loading="lazy" decoding="async" draggable={false} />
|
|
205
|
+
)}
|
|
206
|
+
<span className="rv-peektag before">before</span>
|
|
207
|
+
<span className="rv-peektag after">after</span>
|
|
208
|
+
{v.clip ? <span className="rv-stillplay" aria-hidden>▶</span> : null}
|
|
209
|
+
</button>
|
|
210
|
+
)
|
|
211
|
+
})
|
|
212
|
+
|
|
213
|
+
/** a view's tools, over its top right on a hover: its number when no line names it, ⤢ to open it whole, the animation
|
|
214
|
+
* of a pair, the stage, its files in « ⋯ »; a gallery's « ⋯ » holds its look */
|
|
215
|
+
const ViewTools = observer(({ ver, v, i, tag }: { ver: Ver; v: ReviewView; i: number; tag: string | null }) => {
|
|
216
|
+
const { rv } = ver
|
|
217
|
+
const item = itemOf(ver)
|
|
218
|
+
const files = isGallery(v) ? [] : filesOf(v)
|
|
219
|
+
const opens = LAYOUT[formOf(v)].opens !== null && !isGallery(v)
|
|
220
|
+
return (
|
|
221
|
+
<span className="rv-viewtools">
|
|
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}
|
|
224
|
+
{!isGallery(v) && isPair(v.files) && !v.clip && !v.audio ? <AnimPanel app={rv} item={item} /> : null}
|
|
225
|
+
{isGallery(v) && rv.phone.on ? null : <StageButtons ver={ver} v={v} i={i} />}
|
|
226
|
+
{isGallery(v) ? (rv.phone.on ? null : <GalleryMenu ver={ver} v={v} />) : files.length > 0 && !v.audio ? (
|
|
227
|
+
<Pop className="ghost rv-iconbtn rv-viewmenu" popClass="fpop rv-viewpop" placement="bottom-end" aria-label="its files" title="its files: save, copy a link" label="⋯">
|
|
228
|
+
{() => <Downloads rv={rv} item={item} files={files} />}
|
|
229
|
+
</Pop>
|
|
230
|
+
) : null}
|
|
231
|
+
</span>
|
|
232
|
+
)
|
|
233
|
+
})
|
|
234
|
+
|
|
136
235
|
/** the stage icon on a view: the stage popup on that media; a pair's icon opens a menu of its after, its before, and
|
|
137
236
|
* the wipe of two images; a gallery opens on its first tile, the popup's strip holding every other; a sound alone
|
|
138
237
|
* stages nothing */
|
|
139
|
-
const StageButtons = observer(({ ver, v, i }: { ver: Ver; v: ReviewView; i: number }) => {
|
|
238
|
+
const StageButtons = observer(({ ver, v, i, tile = 0 }: { ver: Ver; v: ReviewView; i: number; tile?: number }) => {
|
|
140
239
|
const { rv } = ver
|
|
141
240
|
const item = itemOf(ver)
|
|
142
|
-
if (item.origin.by !== 'agent' || v.audio) return null
|
|
241
|
+
if (item.origin.by !== 'agent' || v.audio || !rv.can('stage')) return null
|
|
143
242
|
const at = `${item.id}#${i}`
|
|
144
243
|
const icon = <Icon d={ICON.stage} />
|
|
145
244
|
if (isGallery(v) || !isPair(v.files))
|
|
146
|
-
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>
|
|
147
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]])]
|
|
148
247
|
return (
|
|
149
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">
|
|
@@ -157,14 +256,13 @@ const StageButtons = observer(({ ver, v, i }: { ver: Ver; v: ReviewView; i: numb
|
|
|
157
256
|
})
|
|
158
257
|
|
|
159
258
|
/** what was said on one view, above it: each answer's rectangles and reactions (a click shows the rectangle), then on
|
|
160
|
-
* the newest version his draft: each rectangle's word
|
|
161
|
-
const ViewNotes = observer(({ ver, i
|
|
162
|
-
const {
|
|
163
|
-
const said =
|
|
259
|
+
* the newest version his draft: each rectangle's word. His word on a view is a reply: a fix names it on the reply box */
|
|
260
|
+
const ViewNotes = observer(({ ver, i }: { ver: Ver; i: number }) => {
|
|
261
|
+
const { thread, cell } = ver
|
|
262
|
+
const said = thread.saidOn(cell.id, i)
|
|
164
263
|
const views = itemOf(ver).views
|
|
165
|
-
const draft = ver.live ?
|
|
166
|
-
|
|
167
|
-
if (said.length === 0 && draft.length === 0 && !(takes(ver) && word)) return null
|
|
264
|
+
const draft = ver.live ? thread.marks.rects.map((r, k) => [r, k] as const).filter(([r]) => (r.view ?? 0) === i) : []
|
|
265
|
+
if (said.length === 0 && draft.length === 0) return null
|
|
168
266
|
return (
|
|
169
267
|
<div className="rv-viewnotes">
|
|
170
268
|
{said.map((s, k) => <SaidLine key={k} s={s} v={views[i]} n={cell.n} />)}
|
|
@@ -175,20 +273,16 @@ const ViewNotes = observer(({ ver, i, gallery, word = true }: { ver: Ver; i: num
|
|
|
175
273
|
</div>
|
|
176
274
|
) : null}
|
|
177
275
|
{draft.map(([r, k]) => (
|
|
178
|
-
<div key={`d${k}`} className={`rv-outrow${
|
|
179
|
-
<button className={`rv-outbadge rect${
|
|
276
|
+
<div key={`d${k}`} className={`rv-outrow${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)}>
|
|
180
278
|
{k + 1}{r.side ? ` ${SIDE_LABEL[r.side]}` : ''}{r.t !== undefined ? ` · ${secs(r.t)}` : ''}{r.tile !== undefined ? ` ${tileWhere(views[i], r.tile) ?? ''}` : ''}
|
|
181
279
|
</button>
|
|
182
|
-
<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)}>
|
|
183
281
|
{r.comment.trim() ? r.comment : <i className="rv-dim">no word yet</i>}
|
|
184
282
|
</button>
|
|
185
|
-
<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>
|
|
186
284
|
</div>
|
|
187
285
|
))}
|
|
188
|
-
{takes(ver) && word ? (
|
|
189
|
-
<AutoText className="rv-word" placeholder={gallery ? 'a word on these images' : 'a word on this view'} value={reaction?.comment ?? ''}
|
|
190
|
-
onKeyDown={blurOnEscape} onText={(t) => mark(ver, () => card.setReactionComment(i, undefined, t))} />
|
|
191
|
-
) : null}
|
|
192
286
|
</div>
|
|
193
287
|
)
|
|
194
288
|
})
|
|
@@ -221,85 +315,79 @@ export const SentReaction = ({ status }: { status: string }) => {
|
|
|
221
315
|
}
|
|
222
316
|
|
|
223
317
|
/** one option of a choice, or one view of a group, as a row: its number, ▶ and the clock, its label, a strip that
|
|
224
|
-
* scrubs it, its stars and « pick » (a choice) or OK, fix, no (a group
|
|
225
|
-
* under it (an image or a clip shows it from the start). An older version's rows show what he
|
|
318
|
+
* scrubs it, its stars and « pick » (a choice) or OK, fix, no (a group; a fix is said in the reply box), ⤢ folds or
|
|
319
|
+
* unfolds the full view under it (an image or a clip shows it from the start). An older version's rows show what he
|
|
320
|
+
* gave them */
|
|
226
321
|
const OptionRow = observer(({ ver, v, i }: { ver: Ver; v: ReviewView; i: number }) => {
|
|
227
|
-
const { rv,
|
|
228
|
-
const [word, setWord] = useState(false)
|
|
322
|
+
const { rv, thread, cell } = ver
|
|
229
323
|
const item = itemOf(ver)
|
|
230
324
|
const id = item.id
|
|
231
325
|
const media = isGallery(v) ? null : v
|
|
232
326
|
const playable = media !== null && !isPair(media.files) && (media.clip !== undefined || media.audio !== undefined) ? media : null
|
|
233
|
-
const c = playable ?
|
|
234
|
-
const reaction =
|
|
327
|
+
const c = playable ? thread.clipOf(id, i) : null
|
|
328
|
+
const reaction = thread.reactionShown(cell, i)
|
|
235
329
|
const choice = isChoice(item)
|
|
236
|
-
const picked =
|
|
237
|
-
const held = takes(ver) &&
|
|
238
|
-
const unfolded =
|
|
330
|
+
const picked = thread.pickShown(cell) === i
|
|
331
|
+
const held = takes(ver) && thread.holdsPick(id, i)
|
|
332
|
+
const unfolded = thread.rowOpen(item, i)
|
|
239
333
|
const file = playable ? ('video' in playable.files ? playable.files.video : 'audio' in playable.files ? playable.files.audio : '') : ''
|
|
240
334
|
const duration = playable?.clip?.duration ?? playable?.audio?.duration ?? 0
|
|
241
|
-
const
|
|
242
|
-
const active = ver.live && card.view === i
|
|
335
|
+
const active = ver.live && thread.view === i
|
|
243
336
|
// an unfolded clip plays under its own bar: the row keeps no second clock
|
|
244
337
|
const clock2 = c !== null && !(unfolded && playable?.clip)
|
|
245
338
|
const gone = goneOf(ver, v)
|
|
246
339
|
return (
|
|
247
|
-
<div id={viewDom(cell.id, i)} className={`rv-opt${active ? ' active' : ''}${picked ? ' picked' : ''}${unfolded ? ' unfolded' : ''}${toneClass(reaction?.status)}`} onMouseDownCapture={() => ver.live &&
|
|
340
|
+
<div id={viewDom(cell.id, i)} className={`rv-opt${active ? ' active' : ''}${picked ? ' picked' : ''}${unfolded ? ' unfolded' : ''}${toneClass(reaction?.status)}`} onMouseDownCapture={() => ver.live && thread.view !== i && thread.setView(i)}>
|
|
248
341
|
<div className="rv-optrow">
|
|
249
342
|
<span className="rv-optn">{viewTag(cell.n, i)}</span>
|
|
250
343
|
{c && clock2 ? (
|
|
251
|
-
<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)}>
|
|
252
345
|
{c.paused ? '▶' : '❚❚'}
|
|
253
346
|
</button>
|
|
254
347
|
) : null}
|
|
255
|
-
<b className="rv-optlabel"
|
|
256
|
-
{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}
|
|
257
350
|
{c && playable?.clip && !unfolded ? (
|
|
258
|
-
<span className="rv-optthumb" style={{ aspectRatio: `${playable.size.w} / ${playable.size.h}` }} onClick={() =>
|
|
351
|
+
<span className="rv-optthumb" style={{ aspectRatio: `${playable.size.w} / ${playable.size.h}` }} onClick={() => thread.toggleRow(item, i)} {...tip('the full view')}>
|
|
259
352
|
<ClipVideo clip={c} src={rv.fitUrl(id, file, item.wip)} poster={rv.thumbUrl(id, playable.clip.poster)} loop={false} />
|
|
260
353
|
</span>
|
|
261
354
|
) : null}
|
|
262
355
|
{c && playable && clock2 ? (
|
|
263
356
|
<Strip clip={c} duration={duration} wave={playable.audio ? rv.fileUrl(id, playable.audio.wave) : undefined} />
|
|
264
357
|
) : unfolded || c ? <span className="sp" /> : (
|
|
265
|
-
<span className="rv-optthumb img" onClick={() =>
|
|
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>
|
|
266
359
|
)}
|
|
267
360
|
{c && clock2 ? <span className="rv-mono rv-opttime">{clock(c.time)} / {clock(duration)}</span> : null}
|
|
268
361
|
<span className="rv-optacts">
|
|
269
|
-
{choice ? <Stars ver={ver} view={i} given={reaction?.stars} /> :
|
|
270
|
-
{takes(ver) ? <button className={`rv-optword${showWord ? ' on' : ''}`} title="a word on this one" onMouseDown={keepFocus} onClick={() => setWord(!word)}>✎ word</button> : null}
|
|
362
|
+
{choice ? <Stars ver={ver} view={i} given={reaction?.stars} /> : reaction?.status ? <SentReaction status={reaction.status} /> : null}
|
|
271
363
|
{playable?.clip || !playable ? (
|
|
272
|
-
<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>
|
|
273
365
|
) : null}
|
|
274
|
-
{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}
|
|
275
367
|
{choice && takes(ver) ? (
|
|
276
|
-
<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))}>
|
|
277
369
|
{picked ? '✓ picked' : 'pick'}
|
|
278
370
|
{held ? <span className="rv-undo" aria-label="click again to take it back"> ↺</span> : null}
|
|
279
371
|
</button>
|
|
280
372
|
) : choice && picked ? <span className="rv-pick on">✓ picked</span> : null}
|
|
281
373
|
</span>
|
|
282
374
|
</div>
|
|
283
|
-
{media?.note ? <
|
|
284
|
-
{!ver.live && reaction?.comment ? <
|
|
285
|
-
{showWord ? (
|
|
286
|
-
<AutoText className="rv-word" placeholder="a word on this one" value={reaction?.comment ?? ''} autoFocus={word && !reaction?.comment}
|
|
287
|
-
onKeyDown={blurOnEscape} onText={(t) => mark(ver, () => card.setReactionComment(i, undefined, t))} />
|
|
288
|
-
) : null}
|
|
375
|
+
{media?.note ? <Words text={media.note} className="rv-optnote" /> : null}
|
|
376
|
+
{!ver.live && reaction?.comment ? <Words text={`« ${reaction.comment} »`} className="rv-optnote rv-saidtext" /> : null}
|
|
289
377
|
{c && playable?.audio ? <SoundEl clip={c} src={rv.fileUrl(id, file)} /> : null}
|
|
290
378
|
{unfolded ? (
|
|
291
379
|
<div className="rv-optbody">
|
|
292
|
-
{gone.length > 0 ? <Gone files={gone} /> :
|
|
380
|
+
{gone.length > 0 ? <Gone files={gone} /> : <ViewBody ver={ver} v={v} i={i} form={formOf(v)} size={LAYOUT[formOf(v)].alone} />}
|
|
293
381
|
</div>
|
|
294
382
|
) : null}
|
|
295
|
-
<ViewNotes ver={ver} i={i}
|
|
383
|
+
<ViewNotes ver={ver} i={i} />
|
|
296
384
|
</div>
|
|
297
385
|
)
|
|
298
386
|
})
|
|
299
387
|
|
|
300
388
|
/** the files of a view the store no longer holds */
|
|
301
389
|
const goneOf = (ver: Ver, v: ReviewView): string[] => {
|
|
302
|
-
const missing = ver.
|
|
390
|
+
const missing = ver.thread.data?.missing ?? []
|
|
303
391
|
if (missing.length === 0) return []
|
|
304
392
|
const id = itemOf(ver).id
|
|
305
393
|
return viewFilesOf({ ...itemOf(ver), views: [v] }).filter((n) => missing.includes(`${id}/${n}`))
|
|
@@ -318,13 +406,13 @@ const clock = (t: number): string => `${Math.floor(t / 60)}:${String(Math.floor(
|
|
|
318
406
|
|
|
319
407
|
/** an option's score: STARS stars, a click on the one given clears it; an older version's stars as he gave them */
|
|
320
408
|
const Stars = observer(({ ver, view, tile, given }: { ver: Ver; view: number; tile?: number; given: number | undefined }) => {
|
|
321
|
-
const {
|
|
409
|
+
const { thread } = ver
|
|
322
410
|
const live = takes(ver)
|
|
323
411
|
const n = given ?? 0
|
|
324
412
|
return (
|
|
325
|
-
<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')}>
|
|
326
414
|
{Array.from({ length: STARS }, (_, k) => (
|
|
327
|
-
<button key={k} className={k < n ? 'on' : ''} disabled={!live} aria-label={`${k + 1} of ${STARS}`} onMouseDown={keepFocus} onClick={() => mark(ver, () =>
|
|
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>
|
|
328
416
|
))}
|
|
329
417
|
</span>
|
|
330
418
|
)
|
|
@@ -374,33 +462,34 @@ const SoundEl = ({ clip, src }: { clip: ClipSt; src: string }) => {
|
|
|
374
462
|
return <audio ref={ref} src={src} preload="none" onEnded={() => clip.seek(0)} />
|
|
375
463
|
}
|
|
376
464
|
|
|
377
|
-
/** a draft
|
|
378
|
-
const FrameSlider = observer(({
|
|
465
|
+
/** a draft version's frames over its live view: a slider and two arrows cycle them in place, the live one at the right end */
|
|
466
|
+
const FrameSlider = observer(({ thread, frames }: { thread: ThreadSt; frames: GalleryView }) => {
|
|
379
467
|
const last = frames.gallery.length
|
|
380
|
-
const at =
|
|
381
|
-
const go = (f: number): void =>
|
|
468
|
+
const at = thread.frame ?? last
|
|
469
|
+
const go = (f: number): void => thread.setFrame(f >= last ? null : Math.max(0, f))
|
|
382
470
|
return (
|
|
383
471
|
<div className="rv-frames">
|
|
384
|
-
<button
|
|
472
|
+
<button {...tip('the frame before')} disabled={at === 0} onMouseDown={keepFocus} onClick={() => go(at - 1)}>‹</button>
|
|
385
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()} />
|
|
386
|
-
<button
|
|
474
|
+
<button {...tip('the frame after')} disabled={at === last} onMouseDown={keepFocus} onClick={() => go(at + 1)}>›</button>
|
|
387
475
|
<span className="rv-dim rv-small">{at === last ? 'now' : (frames.gallery[at]?.label ?? `frame ${at + 1}`)}</span>
|
|
388
476
|
</div>
|
|
389
477
|
)
|
|
390
478
|
})
|
|
391
479
|
|
|
392
|
-
/** the owner's reaction to one view or tile of the newest version, or to one message of a draft
|
|
393
|
-
* or no; a click on the chosen one clears it. `said` hears the reaction a click set
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
const
|
|
397
|
-
const
|
|
480
|
+
/** the owner's reaction to one view or tile of the newest version, or to one message of a draft version (`post`): OK, fix
|
|
481
|
+
* or no; a click on the chosen one clears it. `said` hears the reaction a click set. `verdict`: the three are the
|
|
482
|
+
* version's own verdict (a version of one view, in the lightbox) */
|
|
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 }) => {
|
|
484
|
+
const { thread } = ver
|
|
485
|
+
const cur = verdict ? thread.chosenOn(ver.cell.id) : ver.claim ? undefined : thread.reactionOf(view, tile, post)?.status
|
|
486
|
+
const says = (o: (typeof REACTIONS)[number]): string => (post !== undefined ? (PLACE_TIPS[o.status] ?? o.tip) : o.tip)
|
|
398
487
|
return (
|
|
399
488
|
<span className="rv-reacts">
|
|
400
489
|
{REACTIONS.map((o) => (
|
|
401
|
-
<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' : ''}`}
|
|
402
491
|
onMouseDown={keepFocus} onClick={() => {
|
|
403
|
-
mark(ver, () =>
|
|
492
|
+
mark(ver, () => (verdict ? void thread.submit(o.status) : thread.react(view, tile, o.status, post)))
|
|
404
493
|
if (cur !== o.status) said?.(o.status)
|
|
405
494
|
}}>
|
|
406
495
|
{o.glyph} {o.label}
|
|
@@ -411,224 +500,235 @@ export const ReactionToggles = observer(({ ver, view, tile, post, small, keys, s
|
|
|
411
500
|
)
|
|
412
501
|
})
|
|
413
502
|
|
|
414
|
-
/**
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
503
|
+
/** past this many images a gallery draws as a compact grid under its count, and the lightbox offers its filter */
|
|
504
|
+
export const GALLERY_LARGE = 12
|
|
505
|
+
/** a gallery tile's least width on a phone: two side by side in its column */
|
|
506
|
+
const PHONE_TILE = 120
|
|
507
|
+
|
|
508
|
+
/** a gallery's least tile width: the size set (a height, as a tile's frame is TILE_ASPECT wide), half of it past
|
|
509
|
+
* GALLERY_LARGE images, at most PHONE_TILE on a phone */
|
|
510
|
+
const tileMin = (rv: ReviewSt, large: boolean): number => Math.min(Math.round((large ? rv.tileH / 2 : rv.tileH) * TILE_ASPECT), rv.phone.on ? PHONE_TILE : Infinity)
|
|
511
|
+
|
|
512
|
+
/** a gallery in the thread, a chat's attachments: its images as equal tiles that fill the row, each named, nothing
|
|
513
|
+
* else (LAYOUT gallery). A click opens one in the lightbox, where it is rated, kept, drawn on and stepped through; the
|
|
514
|
+
* owner's marks show on the tile. Past GALLERY_LARGE images the tiles are half the size under its count; variants,
|
|
515
|
+
* one row per asset */
|
|
516
|
+
const GalleryThumbs = observer(({ ver, v, view }: { ver: Ver; v: GalleryView; view: number }) => {
|
|
517
|
+
const { rv, thread, cell } = ver
|
|
518
|
+
const large = v.gallery.length > GALLERY_LARGE
|
|
519
|
+
const shown = v.gallery.map((t, k) => ({ t, k })).filter(({ k }) => thread.tileShown(thread.reactionShown(cell, view, k)))
|
|
520
|
+
const min = tileMin(rv, large)
|
|
521
|
+
const grid = (xs: typeof shown): ReactNode => (
|
|
522
|
+
<div className="rv-gtiles" style={{ '--gmin': `${min}px` } as React.CSSProperties}>{xs.map(({ t, k }) => <Thumb key={k} ver={ver} view={view} t={t} k={k} big={min > TILE_H.thumb} />)}</div>
|
|
523
|
+
)
|
|
524
|
+
const rows = v.gallery.some((t) => t.group) ? [...new Set(shown.map(({ t }) => t.group ?? ''))] : null
|
|
427
525
|
return (
|
|
428
|
-
<div className=
|
|
429
|
-
{
|
|
430
|
-
{
|
|
431
|
-
?
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
))
|
|
439
|
-
: draw(tiles)}
|
|
526
|
+
<div className={`rv-gallerywrap${large ? ' large' : ''}`}>
|
|
527
|
+
{large || thread.tileFilter !== 'all' ? <GalleryCount ver={ver} v={v} view={view} shown={shown.length} /> : null}
|
|
528
|
+
{rows
|
|
529
|
+
? rows.map((g) => (
|
|
530
|
+
<div key={g} className="rv-galleryrow">
|
|
531
|
+
<div className="rv-rowlabel">{g || 'others'}</div>
|
|
532
|
+
{grid(shown.filter(({ t }) => (t.group ?? '') === g))}
|
|
533
|
+
</div>
|
|
534
|
+
))
|
|
535
|
+
: grid(shown)}
|
|
440
536
|
</div>
|
|
441
537
|
)
|
|
442
538
|
})
|
|
443
539
|
|
|
444
|
-
/**
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
const
|
|
450
|
-
const
|
|
451
|
-
const
|
|
540
|
+
/** one image of a gallery in the thread: an equal tile, the picture fit inside it, its name under it, and only once
|
|
541
|
+
* given the owner's marks (OK, fix or no as its tone and glyph, its stars, kept, the notes drawn on it). A click opens
|
|
542
|
+
* it in the lightbox; 1 to 5 score it under the pointer */
|
|
543
|
+
const Thumb = observer(({ ver, view, t, k, big }: { ver: Ver; view: number; t: GalleryTile; k: number; big: boolean }) => {
|
|
544
|
+
const { rv, thread, cell } = ver
|
|
545
|
+
const id = itemOf(ver).id
|
|
546
|
+
const r = thread.reactionShown(cell, view, k)
|
|
547
|
+
const live = takes(ver)
|
|
548
|
+
const file = t.before && thread.showsBefore(view, k) ? t.before : t.file
|
|
549
|
+
const src = big ? rv.fitUrl(id, file) : rv.thumbUrl(id, file)
|
|
550
|
+
const notes = ver.live ? thread.marks.rects.filter((x) => (x.view ?? 0) === view && x.tile === k).length : 0
|
|
551
|
+
const o = REACTIONS.find((x) => x.status === r?.status)
|
|
552
|
+
const marked = o !== undefined || !!r?.stars || !!r?.picked || notes > 0
|
|
452
553
|
return (
|
|
453
|
-
<
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
554
|
+
<button type="button" className={`rv-gtile${r?.picked ? ' picked' : ''}${toneClass(r?.status)}`} data-check="gallery-tile" data-tile={k}
|
|
555
|
+
{...tip(`${t.label}: open it large to rate it and draw on it${live ? ' (1 to 5 score it here)' : ''}`)}
|
|
556
|
+
onMouseDown={keepFocus} onClick={() => thread.openBox(cell.id, view, k)}
|
|
557
|
+
onMouseEnter={live ? () => thread.setHoverTile({ view, tile: k }) : undefined} onMouseLeave={live ? () => thread.setHoverTile(null) : undefined}>
|
|
558
|
+
<span className="rv-gtileimg">
|
|
559
|
+
<img src={src} alt="" loading="lazy" decoding="async" draggable={false} />
|
|
560
|
+
{marked ? (
|
|
561
|
+
<span className="rv-gmarks">
|
|
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}
|
|
566
|
+
</span>
|
|
567
|
+
) : null}
|
|
458
568
|
</span>
|
|
459
|
-
{
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
569
|
+
{rv.tileSmall ? <SmallSizes src={rv.thumbUrl(id, file)} /> : null}
|
|
570
|
+
<span className="rv-gname">{t.label}</span>
|
|
571
|
+
</button>
|
|
572
|
+
)
|
|
573
|
+
})
|
|
574
|
+
|
|
575
|
+
/** over a large or a filtered gallery: how many images, how many are marked, the filter shown with its way back to all */
|
|
576
|
+
const GalleryCount = observer(({ ver, v, view, shown }: { ver: Ver; v: GalleryView; view: number; shown: number }) => {
|
|
577
|
+
const { thread, cell } = ver
|
|
578
|
+
const marked = v.gallery.filter((_, k) => {
|
|
579
|
+
const r = thread.reactionShown(cell, view, k)
|
|
580
|
+
return !!(r?.stars || r?.status || r?.picked)
|
|
581
|
+
}).length
|
|
582
|
+
return (
|
|
583
|
+
<div className="rv-gallerycount">
|
|
584
|
+
<b>{v.gallery.length} images</b>
|
|
585
|
+
<span className="rv-dim">{marked === 0 ? 'none marked yet' : `${marked} marked`}</span>
|
|
586
|
+
{thread.tileFilter !== 'all' ? (
|
|
587
|
+
<button className="rv-chip on" {...tip('show every image')} onMouseDown={keepFocus} onClick={() => thread.setTileFilter('all')}>
|
|
588
|
+
{TILE_FILTER_LABEL[thread.tileFilter]}: {shown} ✕
|
|
589
|
+
</button>
|
|
465
590
|
) : null}
|
|
466
|
-
<span className="seg" role="group" aria-label="which tiles show">
|
|
467
|
-
{TILE_FILTERS.map((f) => (
|
|
468
|
-
<button key={f} className={card.tileFilter === f ? 'on' : ''} onMouseDown={keepFocus} onClick={() => card.setTileFilter(f)}>{TILE_FILTER_LABEL[f]}</button>
|
|
469
|
-
))}
|
|
470
|
-
</span>
|
|
471
|
-
{v.gallery.some((t) => t.before) ? <button className={`rv-chip${card.beforeAll ? ' on' : ''}`} title="every tile shows its before" onMouseDown={keepFocus} onClick={() => card.toggleBeforeAll()}>before</button> : null}
|
|
472
|
-
<button className={`rv-chip${rv.tileSmall ? ' on' : ''}`} title="each tile also at 16, 32 and 64 px" onMouseDown={keepFocus} onClick={() => rv.toggleTileSmall()}>real size</button>
|
|
473
591
|
</div>
|
|
474
592
|
)
|
|
475
593
|
})
|
|
476
594
|
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
595
|
+
/** a gallery's look, one quiet menu in its head: the size of every thumbnail (kept for the repo), and its look chips */
|
|
596
|
+
const GalleryMenu = observer(({ ver, v }: { ver: Ver; v: GalleryView }) => {
|
|
597
|
+
const { rv } = ver
|
|
598
|
+
return (
|
|
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="⋯">
|
|
600
|
+
{() => (
|
|
601
|
+
<div className="rv-gallerypopbody">
|
|
602
|
+
<label className="rv-tilesize" {...tip('the size of every thumbnail of every gallery, kept for this repo')}>
|
|
603
|
+
size
|
|
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))} />
|
|
605
|
+
</label>
|
|
606
|
+
<GalleryLook ver={ver} v={v} />
|
|
607
|
+
</div>
|
|
608
|
+
)}
|
|
609
|
+
</Pop>
|
|
610
|
+
)
|
|
611
|
+
})
|
|
483
612
|
|
|
484
|
-
/**
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
const GalleryTabs = observer(({ ver, v, view }: { ver: Ver; v: GalleryView; view: number }) => {
|
|
488
|
-
const { rv, card, cell } = ver
|
|
489
|
-
const id = itemOf(ver).id
|
|
490
|
-
const shown = v.gallery.map((t, k) => ({ t, k, r: card.reactionShown(cell, view, k) })).filter((x) => card.tileShown(x.r))
|
|
491
|
-
const at = shown.find((x) => x.k === card.galleryTab[view]) ?? shown[0]
|
|
492
|
-
if (at === undefined) return <div className="rv-dim rv-small">no image passes this filter</div>
|
|
493
|
-
const step = (by: number): void => {
|
|
494
|
-
const i = shown.indexOf(at)
|
|
495
|
-
card.setGalleryTab(view, shown[(i + by + shown.length) % shown.length]!.k)
|
|
496
|
-
}
|
|
497
|
-
const walk = (e: React.KeyboardEvent): void => {
|
|
498
|
-
if (e.key !== 'ArrowDown' && e.key !== 'ArrowUp') return
|
|
499
|
-
e.preventDefault()
|
|
500
|
-
e.stopPropagation()
|
|
501
|
-
step(e.key === 'ArrowDown' ? 1 : -1)
|
|
502
|
-
}
|
|
613
|
+
/** how a gallery's images look, in its menu and the lightbox's bar: every image at its before, each also at 16, 32 and 64 px */
|
|
614
|
+
const GalleryLook = observer(({ ver, v }: { ver: Ver; v: GalleryView }) => {
|
|
615
|
+
const { rv, thread } = ver
|
|
503
616
|
return (
|
|
504
|
-
<
|
|
505
|
-
<
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
{t.group && t.group !== shown[i - 1]?.t.group ? <div className="rv-gtabgroup">{t.group}</div> : null}
|
|
509
|
-
<button className={`rv-gtab${k === at.k ? ' on' : ''}${toneClass(r?.status)}`} aria-current={k === at.k} title={t.label} onClick={() => card.setGalleryTab(view, k)}>
|
|
510
|
-
<img src={rv.thumbUrl(id, t.file)} alt="" loading="lazy" draggable={false} />
|
|
511
|
-
<span className="rv-gtablabel">{t.label}</span>
|
|
512
|
-
<span className="rv-gtabmark">{r?.stars ? '★'.repeat(r.stars) : ''}{r?.picked ? ' ✓ kept' : ''}</span>
|
|
513
|
-
</button>
|
|
514
|
-
</div>
|
|
515
|
-
))}
|
|
516
|
-
</nav>
|
|
517
|
-
<div className="rv-gtabbody">
|
|
518
|
-
<Tile key={at.k} ver={ver} v={v} view={view} t={at.t} k={at.k} fill />
|
|
519
|
-
</div>
|
|
520
|
-
</div>
|
|
617
|
+
<span className="rv-gallerylook">
|
|
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>
|
|
620
|
+
</span>
|
|
521
621
|
)
|
|
522
622
|
})
|
|
523
623
|
|
|
524
|
-
|
|
624
|
+
/** the lightbox's tools on a gallery image: the filter its arrows follow (a large gallery, or one filtered), its look */
|
|
625
|
+
const GalleryTools = observer(({ ver, v }: { ver: Ver; v: GalleryView }) => {
|
|
626
|
+
const { thread } = ver
|
|
627
|
+
return (
|
|
628
|
+
<span className="rv-gallerytools">
|
|
629
|
+
{v.gallery.length > GALLERY_LARGE || thread.tileFilter !== 'all' ? (
|
|
630
|
+
<span className="seg" role="group" aria-label="which images the arrows step through">
|
|
631
|
+
{TILE_FILTERS.map((f) => (
|
|
632
|
+
<button key={f} className={thread.tileFilter === f ? 'on' : ''} onMouseDown={keepFocus} onClick={() => thread.setTileFilter(f)}>{TILE_FILTER_LABEL[f]}</button>
|
|
633
|
+
))}
|
|
634
|
+
</span>
|
|
635
|
+
) : null}
|
|
636
|
+
<GalleryLook ver={ver} v={v} />
|
|
637
|
+
</span>
|
|
638
|
+
)
|
|
639
|
+
})
|
|
525
640
|
|
|
526
|
-
|
|
527
|
-
* widest image it shows, as a share of its height */
|
|
528
|
-
const TILE_CHROME = 12
|
|
529
|
-
const TILE_MIN_W = 150
|
|
530
|
-
const TILE_WIDE = 1.6
|
|
531
|
-
/** what a large tile holds under its image: its label, its stars, OK Fix No and its word */
|
|
532
|
-
const TILE_UNDER = 128
|
|
641
|
+
const TILE_FILTER_LABEL: Record<TileFilter, string> = { all: 'all', unrated: 'unrated', low: 'under 3★', fix: 'fix or no' }
|
|
533
642
|
|
|
534
643
|
/** the small sizes an icon lives at */
|
|
535
644
|
const SMALL_SIZES = [16, 32, 64] as const
|
|
536
645
|
|
|
537
|
-
/**
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
646
|
+
/** an image at the small sizes an icon lives at, on a checkerboard */
|
|
647
|
+
const SmallSizes = ({ src }: { src: string }) => (
|
|
648
|
+
<span className="rv-tilesmall">
|
|
649
|
+
{SMALL_SIZES.map((px) => <img key={px} src={src} alt="" width={px} height={px} {...tip(`${px} px`)} draggable={false} loading="lazy" />)}
|
|
650
|
+
</span>
|
|
651
|
+
)
|
|
652
|
+
|
|
653
|
+
/** what sits under a gallery image in the lightbox: its stars and keep, and the small sizes when shown */
|
|
654
|
+
const tileUnder = (rv: ReviewSt): number => 44 + (rv.tileSmall ? 84 : 0)
|
|
655
|
+
|
|
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 */
|
|
659
|
+
const BoxTile = observer(({ ver, v, view, t, k }: { ver: Ver; v: GalleryView; view: number; t: GalleryTile; k: number }) => {
|
|
660
|
+
const { rv, thread, cell } = ver
|
|
542
661
|
const id = itemOf(ver).id
|
|
543
|
-
const r =
|
|
544
|
-
if (!boxed && !card.tileShown(r)) return null
|
|
662
|
+
const r = thread.reactionShown(cell, view, k)
|
|
545
663
|
const live = takes(ver)
|
|
546
|
-
const
|
|
547
|
-
const
|
|
548
|
-
|
|
549
|
-
const
|
|
550
|
-
|
|
551
|
-
const
|
|
552
|
-
const thumb = rv.thumbUrl(id, file)
|
|
553
|
-
const src = boxed || fill || h > TILE_H.thumb ? rv.fitUrl(id, file) : thumb
|
|
554
|
-
// a click shows the tile large in the lightbox, where ← → step through the gallery
|
|
555
|
-
const toggle = (): void => { if (!boxed) card.openBox(cell.id, view, k) }
|
|
556
|
-
const aspect = `${t.size.w} / ${t.size.h}`
|
|
557
|
-
// the height a fit takes: the column's, or the lightbox's stage (--fit-h, review.css), less what sits under the image
|
|
558
|
-
const screen = { width: `min(100%, calc((var(--fit-h, 100vh - ${FIT_ROOM - TILE_UNDER}px) - ${TILE_UNDER}px) * ${ratio}))`, aspectRatio: aspect }
|
|
559
|
-
const imgStyle = boxed ? screen : fill ? (rv.galleryFit === 'width' ? { width: '100%', aspectRatio: aspect } : screen) : { width: iw, height: ih }
|
|
560
|
-
const title = boxed ? (live ? 'drag to circle a spot' : undefined) : live ? 'drag to circle a spot, click to see it large' : 'click to see it large'
|
|
664
|
+
const file = t.before && thread.showsBefore(view, k) ? t.before : t.file
|
|
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
|
|
668
|
+
// past « fit » the full file, so its own pixels show
|
|
669
|
+
const src = zoom?.full ? rv.fileUrl(id, file) : rv.fitUrl(id, file)
|
|
561
670
|
return (
|
|
562
|
-
<div className={`rv-tile
|
|
563
|
-
onMouseEnter={live ? () =>
|
|
564
|
-
<div className="rv-
|
|
565
|
-
<
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
671
|
+
<div className={`rv-tile big${r?.picked ? ' picked' : ''}${toneClass(r?.status)}`}
|
|
672
|
+
onMouseEnter={live ? () => thread.setHoverTile({ view, tile: k }) : undefined} onMouseLeave={live ? () => thread.setHoverTile(null) : undefined}>
|
|
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}>
|
|
675
|
+
<Marks ver={ver} src={src} side={undefined} view={view} tile={k} />
|
|
676
|
+
{ver.live ? <div className="rv-over"><RectNote ver={ver} view={view} sides={[undefined]} tile={k} /></div> : null}
|
|
677
|
+
{t.before ? (
|
|
678
|
+
<span className={`rv-beforechip${file === t.before ? ' on' : ''}`} {...tip('the pointer here shows the before')} onClick={(e) => e.stopPropagation()}
|
|
679
|
+
onMouseEnter={() => thread.setPeekTile(view, k)} onMouseLeave={() => thread.setPeekTile(view, null)}>before</span>
|
|
680
|
+
) : null}
|
|
681
|
+
</div>
|
|
682
|
+
</div>
|
|
683
|
+
{rv.tileSmall ? <SmallSizes src={rv.thumbUrl(id, file)} /> : null}
|
|
684
|
+
<div className="rv-tileunder">
|
|
685
|
+
{live || r?.stars ? <Stars ver={ver} view={view} tile={k} given={r?.stars} /> : null}
|
|
686
|
+
{t.group && (live || r?.picked) ? (
|
|
687
|
+
<button className={`rv-chip rv-keep${r?.picked ? ' on' : ''}`} disabled={!live} {...tip(`keep this one for ${t.group}: one a row`)} onMouseDown={keepFocus}
|
|
688
|
+
onClick={() => mark(ver, () => thread.pickTile(view, k, t.group ?? '', v.gallery))}>{r?.picked ? '✓ kept' : `keep for ${t.group}`}</button>
|
|
570
689
|
) : null}
|
|
571
690
|
</div>
|
|
572
|
-
{rv.tileSmall ? (
|
|
573
|
-
<div className="rv-tilesmall">
|
|
574
|
-
{SMALL_SIZES.map((px) => <img key={px} src={thumb} alt="" width={px} height={px} title={`${px} px`} draggable={false} loading="lazy" />)}
|
|
575
|
-
</div>
|
|
576
|
-
) : null}
|
|
577
|
-
{boxed ? null : <div className="rv-tilelabel" title={t.label}>{t.label}</div>}
|
|
578
|
-
{live || r?.stars ? <Stars ver={ver} view={view} tile={k} given={r?.stars} /> : null}
|
|
579
|
-
{t.group && (live || r?.picked) ? (
|
|
580
|
-
<button className={`rv-chip rv-keep${r?.picked ? ' on' : ''}`} disabled={!live} title={`keep this one for ${t.group}: one a row`} onMouseDown={keepFocus}
|
|
581
|
-
onClick={() => mark(ver, () => card.pickTile(view, k, t.group ?? '', v.gallery))}>{r?.picked ? '✓ kept' : 'keep'}</button>
|
|
582
|
-
) : null}
|
|
583
|
-
{boxed ? null : live ? (
|
|
584
|
-
<>
|
|
585
|
-
<ReactionToggles ver={ver} view={view} tile={k} small />
|
|
586
|
-
<AutoText className="rv-word" placeholder="a word" value={r?.comment ?? ''} onKeyDown={blurOnEscape} onText={(t) => mark(ver, () => card.setReactionComment(view, k, t))} />
|
|
587
|
-
</>
|
|
588
|
-
) : r?.status ? <SentReaction status={r.status} /> : null}
|
|
589
691
|
</div>
|
|
590
692
|
)
|
|
591
693
|
})
|
|
592
694
|
|
|
593
|
-
/** one media view: a single image or clip, or the pair in the compare component
|
|
594
|
-
*
|
|
595
|
-
*
|
|
596
|
-
const MediaBody = observer(({ ver, v, i, zoom, boxed = false }: { ver: Ver; v: MediaView; i: number; zoom: Zoom
|
|
597
|
-
const { rv,
|
|
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 }) => {
|
|
699
|
+
const { rv, thread } = ver
|
|
700
|
+
const view = useBoxView()
|
|
598
701
|
const item = itemOf(ver)
|
|
599
702
|
const id = item.id
|
|
600
703
|
if (v.audio) return <SoundBody ver={ver} v={v} saves={!boxed} />
|
|
704
|
+
if (v.scene) return <SceneBody rv={rv} item={item} v={v} scene={v.scene} />
|
|
601
705
|
// a still at Preview is a preview a click opens in the lightbox, where it is judged and drawn on; a clip keeps its player
|
|
602
706
|
if (zoom === 'preview' && !v.clip) return <PreviewOf ver={ver} v={v} i={i} />
|
|
603
707
|
const f = v.files
|
|
604
708
|
const ratio = v.size.w / v.size.h
|
|
605
709
|
const aspect = `${v.size.w} / ${v.size.h}`
|
|
606
|
-
const wide = zoom === 'width'
|
|
607
|
-
const scale = zoom === 'fit' || zoom === 'preview' || wide ? null : Number(zoom)
|
|
608
710
|
const room = FIT_ROOM + (v.clip ? 40 : 0)
|
|
609
711
|
const c = rv.compare
|
|
610
712
|
const mode = c.modeFor(v.clip !== undefined)
|
|
611
713
|
// the lightbox's stage (--fit-h) less what sits under the image there: a pair's captions, the clip's bar, the curtain's line
|
|
612
714
|
const under = (isPair(v.files) && !rv.phone.on ? 26 : 0) + (v.clip ? 44 : 0) + (isPair(v.files) && mode === 'swipe' ? 22 : 0)
|
|
613
715
|
// the height a view fits in: a preview's, the lightbox's, or the column's
|
|
614
|
-
const fitH = zoom === 'preview' ?
|
|
716
|
+
const fitH = zoom === 'preview' ? 'var(--preview-h)' : boxed ? `(var(--fit-h) - ${under}px)` : `(100vh - ${room}px)`
|
|
717
|
+
const port = { '--port-h': `calc(${fitH})` }
|
|
615
718
|
// a clip always plays its fit url (its play copy keeps its size and frames), an image is the full file past « fit »
|
|
616
|
-
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))
|
|
617
720
|
// the page's clip keys reach the version his answer goes to: space when it is no pair, ← → when it has one view
|
|
618
|
-
const page = boxed && ver.cell.id ===
|
|
721
|
+
const page = boxed && ver.cell.id === thread.target
|
|
619
722
|
const keys = boxed ? { play: page && !isPair(f), frames: page && item.views.length === 1 } : undefined
|
|
620
|
-
const bar = v.clip ? <ClipBar clip={
|
|
621
|
-
const scroll = scale || wide ? { overflow: 'auto', maxHeight: boxed ? `calc(var(--fit-h) - ${under}px)` : `calc(100vh - ${room}px)` } : undefined
|
|
723
|
+
const bar = v.clip ? <ClipBar clip={thread.clipOf(id, i)} info={v.clip} use={() => ver.live && thread.setView(i)} keys={keys} /> : null
|
|
622
724
|
if (!isPair(f)) {
|
|
623
725
|
const name = 'image' in f ? f.image : 'video' in f ? f.video : f.audio
|
|
624
726
|
return (
|
|
625
|
-
<div style={
|
|
626
|
-
<
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
{boxed ? null : <Downloads rv={rv} item={item} files={[{ file: name }]} />}
|
|
631
|
-
</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 }]} />}
|
|
632
732
|
</div>
|
|
633
733
|
)
|
|
634
734
|
}
|
|
@@ -638,235 +738,209 @@ const MediaBody = observer(({ ver, v, i, zoom, boxed = false }: { ver: Ver; v: M
|
|
|
638
738
|
if (rv.phone.on)
|
|
639
739
|
return (
|
|
640
740
|
<>
|
|
641
|
-
<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} />
|
|
642
742
|
{saves}
|
|
643
743
|
</>
|
|
644
744
|
)
|
|
645
745
|
const cols = mode === 'side' ? 2 : 1
|
|
646
|
-
const fitW =
|
|
746
|
+
const fitW = `min(100%, calc(${fitH} * ${ratio * cols}))`
|
|
647
747
|
return (
|
|
648
748
|
<>
|
|
649
|
-
<div style={
|
|
650
|
-
<
|
|
651
|
-
<
|
|
652
|
-
|
|
653
|
-
over={(srcs) => (ver.live ? <RectNote ver={ver} view={i} sides={srcs.map((s) => drawnSide(mode, s === before ? 'before' : 'after'))} /> : null)} />
|
|
654
|
-
</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)} />
|
|
655
753
|
</div>
|
|
656
754
|
{bar ? <div style={{ width: fitW, margin: '0 auto' }}>{bar}</div> : null}
|
|
657
755
|
{saves ? <div style={{ width: fitW, margin: '0 auto' }}>{saves}</div> : null}
|
|
658
|
-
{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}
|
|
659
757
|
</>
|
|
660
758
|
)
|
|
661
759
|
})
|
|
662
760
|
|
|
663
|
-
/**
|
|
664
|
-
* lightbox on it */
|
|
761
|
+
/** an image that fills the column: as wide as the column lets it, at most --preview-h tall (view-layout.css); a click
|
|
762
|
+
* opens the lightbox on it */
|
|
665
763
|
const PreviewOf = observer(({ ver, v, i }: { ver: Ver; v: MediaView; i: number }) => {
|
|
666
764
|
const { rv } = ver
|
|
667
765
|
const item = itemOf(ver)
|
|
668
|
-
const f = v.files
|
|
669
|
-
const open = (): void => ver.card.openBox(ver.cell.id, i)
|
|
670
|
-
const aspect = { aspectRatio: `${v.size.w} / ${v.size.h}` }
|
|
671
|
-
if (isPair(f)) {
|
|
672
|
-
const before = rv.fitUrl(item.id, f.before, item.wip)
|
|
673
|
-
const after = rv.fitUrl(item.id, f.after, item.wip)
|
|
674
|
-
// one frame on a loop: the before, the changed pixels glowing, then the after (a still after alone when motion is reduced)
|
|
675
|
-
return (
|
|
676
|
-
<button type="button" className="rv-viewpreview" title="the before, what changed, the after: open it full to judge it, draw on it, save it" onMouseDown={keepFocus} onClick={open}>
|
|
677
|
-
<span className="rv-flip" style={{ ...aspect, width: `min(100%, calc(${PREVIEW_H}px * ${v.size.w / v.size.h}))` }}>
|
|
678
|
-
<img className="rv-flipbefore" src={before} alt="" loading="lazy" decoding="async" />
|
|
679
|
-
<img className="rv-flipafter" src={after} alt="" loading="lazy" decoding="async" />
|
|
680
|
-
<GlowCanvas base={before} mod={after} />
|
|
681
|
-
<span className="rv-fliptag before">before</span>
|
|
682
|
-
<span className="rv-fliptag after">after</span>
|
|
683
|
-
</span>
|
|
684
|
-
</button>
|
|
685
|
-
)
|
|
686
|
-
}
|
|
687
766
|
return (
|
|
688
|
-
<button type="button" className="rv-viewpreview"
|
|
689
|
-
<img src={rv.fitUrl(item.id, thumbFileOf(v), item.wip)} alt="" loading="lazy" decoding="async" style={
|
|
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) }} />
|
|
690
769
|
</button>
|
|
691
770
|
)
|
|
692
771
|
})
|
|
693
772
|
|
|
694
|
-
/** the share of its own pixels a view is drawn at now, read off the page: what « fit » and « width » come to */
|
|
695
|
-
function shownScale(box: HTMLElement | null, v: ReviewView | undefined): number | null {
|
|
696
|
-
const face = box?.querySelector<HTMLElement>('.rv-zoomface')
|
|
697
|
-
if (face == null || v === undefined || isGallery(v) || !(v.size.w > 0)) return null
|
|
698
|
-
const cols = Number(face.dataset['cols'] ?? 1) || 1
|
|
699
|
-
const w = (face.getBoundingClientRect().width - 8 * (cols - 1)) / cols
|
|
700
|
-
return w > 0 ? w / v.size.w : null
|
|
701
|
-
}
|
|
702
|
-
|
|
703
|
-
const BOX_LABEL = { fit: 'Fit', width: 'Width' } as const
|
|
704
|
-
const BOX_TIP = { fit: 'the whole view in the window (0)', width: 'as wide as the window, it scrolls' } as const
|
|
705
|
-
|
|
706
|
-
/** the size of the view in the lightbox: whole, wide, its own pixels; a size the wheel or the keys gave shows as its
|
|
707
|
-
* percent; − and + step it. Kept for the repo */
|
|
708
|
-
const BoxZoomBar = observer(({ rv, step }: { rv: ReviewSt; step: (by: 1 | -1) => void }) => {
|
|
709
|
-
const z = rv.boxZoom
|
|
710
|
-
const free = typeof z === 'number' && !(BOX_ZOOM.picks as readonly number[]).includes(z)
|
|
711
|
-
return (
|
|
712
|
-
<span className="rv-boxzoom rv-keyed" title="the size of the view: ⌘ or ctrl with the wheel, a pinch, or + and −">
|
|
713
|
-
<span className="seg">
|
|
714
|
-
{(['fit', 'width'] as const).map((k) => (
|
|
715
|
-
<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>
|
|
716
|
-
))}
|
|
717
|
-
{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>)}
|
|
718
|
-
{free ? <button className="on" title="the size the wheel or the keys gave" onMouseDown={keepFocus}>{Math.round(z * 100)} %</button> : null}
|
|
719
|
-
</span>
|
|
720
|
-
<button className="ghost rv-keybtn" title="smaller (−)" aria-label="smaller" onMouseDown={keepFocus} onClick={() => step(-1)}><Key k="−" /><span className="rv-nokey">−</span></button>
|
|
721
|
-
<button className="ghost rv-keybtn" title="larger (+)" aria-label="larger" onMouseDown={keepFocus} onClick={() => step(1)}><Key k="+" /><span className="rv-nokey">+</span></button>
|
|
722
|
-
</span>
|
|
723
|
-
)
|
|
724
|
-
})
|
|
725
|
-
|
|
726
773
|
/** what the lightbox shows: the version and its view, and what that view takes (the steps, a pair's flip and compare
|
|
727
774
|
* modes, a size); null while it is shut */
|
|
728
|
-
function boxOf(rv: ReviewSt,
|
|
729
|
-
const b =
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
775
|
+
function boxOf(rv: ReviewSt, thread: ThreadSt) {
|
|
776
|
+
const b = thread.boxed
|
|
777
|
+
// a kind's page framed live is KindBox's
|
|
778
|
+
if (b == null || 'states' in b) return null
|
|
779
|
+
const cell = thread.versionOf(b.cell)
|
|
780
|
+
const v = cell == null ? undefined : cell.item.views[b.view]
|
|
781
|
+
if (cell == null || v === undefined) return null
|
|
733
782
|
const media = isGallery(v) ? null : v
|
|
734
783
|
const views = cell.item.views.length
|
|
735
|
-
const ver: Ver = { rv,
|
|
736
|
-
// a gallery's
|
|
737
|
-
|
|
738
|
-
const
|
|
739
|
-
const
|
|
740
|
-
|
|
784
|
+
const ver: Ver = { rv, thread, cell, live: cell.id === thread.head?.id && thread.takesVerdict, claim: cell.id === thread.newest?.id && thread.claims }
|
|
785
|
+
// a gallery's image shown large: ← → step through the images the filter shows (the one shown stays among them), OK
|
|
786
|
+
// Fix No and the word are the image's
|
|
787
|
+
const order = isGallery(v) ? v.gallery.flatMap((_, k) => (k === b.tile || thread.tileShown(thread.reactionShown(cell, b.view, k)) ? [k] : [])) : []
|
|
788
|
+
const tile = isGallery(v) && b.tile !== undefined && v.gallery[b.tile] !== undefined ? { k: b.tile, t: v.gallery[b.tile]!, n: v.gallery.length, order } : null
|
|
789
|
+
// a still of a view of a kind's page opens that page live, a space or a live page fills the stage: no size of their own
|
|
790
|
+
const size = tile ? (tile.t.view !== undefined ? null : tile.t.size) : media !== null && !media.audio && !media.scene && !media.live ? media.size : null
|
|
791
|
+
const can = { step: tile ? order.length > 1 : views > 1, pair: media !== null && isPair(media.files) && !media.audio, size: size !== null }
|
|
792
|
+
// a view that is a gallery opens on its first image
|
|
793
|
+
const view = (to: number): void => thread.openBox(cell.id, to, isGallery(cell.item.views[to]!) ? 0 : undefined)
|
|
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))
|
|
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 }
|
|
741
798
|
}
|
|
742
799
|
|
|
743
|
-
/** a step of the lightbox's size from the size the view is drawn at now */
|
|
744
|
-
const resizeOf = (rv: ReviewSt, stage: { current: HTMLElement | null }, v: ReviewView) => (by: 1 | -1): void => rv.setBoxZoom(boxStep(shownScale(stage.current, v) ?? 1, by))
|
|
745
|
-
|
|
746
800
|
/** a key in the lightbox, true when it acted. Each acts only where its control shows: ← → the views, space a pair's
|
|
747
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
|
|
748
|
-
*
|
|
749
|
-
*
|
|
750
|
-
|
|
751
|
-
|
|
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')
|
|
810
|
+
// a kind's page takes every key but Escape: its own camera, its own walk
|
|
811
|
+
if (thread.boxed != null && 'states' in thread.boxed) return e.key === 'Escape' ? (thread.closeBox(), true) : upDown
|
|
812
|
+
const x = boxOf(rv, thread)
|
|
752
813
|
if (x == null || e.metaKey || e.ctrlKey || e.altKey || (field && e.key !== 'Escape')) return false
|
|
753
814
|
const { at, ver, can, step, tile } = x
|
|
754
815
|
const said = boxReaction(e.key)
|
|
755
|
-
if (e.key === 'Escape')
|
|
816
|
+
if (e.key === 'Escape') thread.closeBox()
|
|
756
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)
|
|
757
820
|
else if (can.pair && e.key === ' ') rv.compare.flip()
|
|
758
|
-
else if (can.size && e.key === '0')
|
|
759
|
-
|
|
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)
|
|
760
825
|
else if (said != null) {
|
|
761
|
-
|
|
826
|
+
// a version of one view: O, F, N are the version's verdict
|
|
827
|
+
if (takes(ver)) mark(ver, () => (tile === undefined && oneSet(ver) ? void thread.submit(said) : thread.react(at, tile?.k, said)))
|
|
762
828
|
} else return false
|
|
763
829
|
return true
|
|
764
830
|
}
|
|
765
831
|
|
|
766
|
-
/** the lightbox over the whole window (BoxFrame draws it), its
|
|
767
|
-
|
|
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 */
|
|
834
|
+
export const ViewBox = observer(({ rv, thread }: { rv: ReviewSt; thread: ThreadSt }) => {
|
|
768
835
|
const stage = useRef<HTMLDivElement>(null)
|
|
769
|
-
const
|
|
770
|
-
const
|
|
771
|
-
//
|
|
772
|
-
|
|
773
|
-
|
|
836
|
+
const [view] = useState(() => new BoxView())
|
|
837
|
+
const x = boxOf(rv, thread)
|
|
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(() => {
|
|
774
844
|
const el = stage.current
|
|
775
|
-
if (el == null ||
|
|
776
|
-
const
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
if (face == null || from == null) return
|
|
781
|
-
e.preventDefault()
|
|
782
|
-
const was = face.getBoundingClientRect()
|
|
783
|
-
const fx = (e.clientX - was.left) / was.width
|
|
784
|
-
const fy = (e.clientY - was.top) / was.height
|
|
785
|
-
rv.setBoxZoom(boxStep(from, -e.deltaY / 100))
|
|
786
|
-
// once it is drawn at its new size, the point that was under the pointer is put back under it
|
|
787
|
-
requestAnimationFrame(() => {
|
|
788
|
-
const now = el.querySelector<HTMLElement>('.rv-zoomface')
|
|
789
|
-
const scroller = now?.parentElement
|
|
790
|
-
if (now == null || scroller == null) return
|
|
791
|
-
const is = now.getBoundingClientRect()
|
|
792
|
-
scroller.scrollLeft += is.left + fx * is.width - e.clientX
|
|
793
|
-
scroller.scrollTop += is.top + fy * is.height - e.clientY
|
|
794
|
-
})
|
|
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'))
|
|
795
850
|
}
|
|
796
|
-
|
|
797
|
-
return () =>
|
|
798
|
-
|
|
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])
|
|
799
858
|
// its keys come before the page's (capture): boxKey
|
|
859
|
+
const open = thread.boxed != null
|
|
800
860
|
useEffect(() => {
|
|
801
|
-
if (
|
|
861
|
+
if (!open) return
|
|
802
862
|
const key = (e: KeyboardEvent): void => {
|
|
803
863
|
const field = (e.target as HTMLElement | null)?.closest?.('input, textarea, select, [contenteditable]') != null
|
|
804
|
-
if (!boxKey(rv,
|
|
864
|
+
if (!boxKey(rv, thread, view, e, field)) return
|
|
805
865
|
e.preventDefault()
|
|
806
866
|
e.stopPropagation()
|
|
807
867
|
}
|
|
808
868
|
window.addEventListener('keydown', key, true)
|
|
809
869
|
return () => window.removeEventListener('keydown', key, true)
|
|
810
870
|
})
|
|
871
|
+
const b = thread.boxed
|
|
872
|
+
if (b != null && 'states' in b) return createPortal(<KindBox rv={rv} thread={thread} cell={b.cell} />, document.body)
|
|
811
873
|
if (x == null) return null
|
|
812
|
-
return createPortal(<BoxFrame rv={rv}
|
|
874
|
+
return createPortal(<BoxViewCtx.Provider value={rv.phone.on ? null : view}><BoxFrame rv={rv} thread={thread} stage={stage} view={view} /></BoxViewCtx.Provider>, document.body)
|
|
813
875
|
})
|
|
814
876
|
|
|
815
877
|
/** the lightbox: the view a preview opened, over the whole window. One bar on top reads as what he does, left to
|
|
816
|
-
* right: where he is (← → the version's views, the view's name, its tag, the
|
|
817
|
-
* how he looks at it (the compare modes, one side alone, the size, a gallery's
|
|
818
|
-
* between, « fit » fitting that room (--fit-h, review.css)
|
|
819
|
-
* Every key is a chip on the control it triggers, shown only
|
|
820
|
-
|
|
821
|
-
|
|
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),
|
|
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 }) => {
|
|
884
|
+
const x = boxOf(rv, thread)
|
|
822
885
|
if (x == null) return null
|
|
823
886
|
const { at, cell, v, media, views, ver, can, step, tile } = x
|
|
824
|
-
const shown =
|
|
887
|
+
const shown = thread.reactionShown(cell, at, tile?.k)
|
|
825
888
|
const kind = viewKind(v, false)
|
|
826
889
|
const name = tile ? tile.t.label : v.label || kind
|
|
827
890
|
const files = filesOf(v)
|
|
828
|
-
const said =
|
|
891
|
+
const said = thread.saidOn(cell.id, at)
|
|
829
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')
|
|
830
895
|
return (
|
|
831
|
-
<
|
|
832
|
-
|
|
896
|
+
<Lightbox
|
|
897
|
+
tone={toneClass(shown?.status)}
|
|
898
|
+
label={`view ${tag}: ${name}`}
|
|
899
|
+
close={() => thread.closeBox()}
|
|
900
|
+
stage={stage}
|
|
901
|
+
over={x.size !== null && x.whole !== null && !rv.phone.on ? <ZoomMap view={view} src={x.whole} size={x.size} /> : null}
|
|
902
|
+
top={<>
|
|
833
903
|
<span className="rv-boxwhere">
|
|
834
|
-
{can.step ? <button className="ghost rv-keybtn"
|
|
835
|
-
<span className="rv-boxn rv-dim">{tile ? tile.k + 1 : at + 1} of {tile ? tile.
|
|
836
|
-
{can.step ? <button className="ghost rv-keybtn"
|
|
837
|
-
<b className="rv-boxname"
|
|
838
|
-
{v.label && v.label.toLowerCase() !== kind.toLowerCase() ? <span className="rv-boxkind rv-dim">{kind}</span> : null}
|
|
839
|
-
<span className="rv-boxtag"
|
|
840
|
-
<span className="rv-boxtitle rv-dim"
|
|
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}
|
|
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>
|
|
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>
|
|
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}
|
|
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>
|
|
841
911
|
</span>
|
|
842
|
-
{
|
|
912
|
+
{/* a version of one view: its keys and buttons here are the version's own verdict */}
|
|
913
|
+
{takes(ver) ? <ReactionToggles ver={ver} view={at} {...(tile ? { tile: tile.k } : {})} keys verdict={!tile && oneSet(ver)} /> : shown?.status ? <SentReaction status={shown.status} /> : null}
|
|
843
914
|
<span className="rv-boxlook">
|
|
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}
|
|
844
916
|
{can.pair && rv.phone.on ? <PhoneSides rv={rv} /> : null}
|
|
845
917
|
{can.pair && !rv.phone.on ? <CompareModes c={rv.compare} clip={media?.clip !== undefined} keys /> : null}
|
|
846
918
|
{can.pair && !rv.phone.on ? <PairFlip c={rv.compare} /> : null}
|
|
847
|
-
{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}
|
|
848
920
|
{/* a phone sizes with a pinch: the size control is the keyboard's and the wheel's */}
|
|
849
|
-
{can.size && !rv.phone.on ? <BoxZoomBar
|
|
850
|
-
{isGallery(v) &&
|
|
921
|
+
{can.size && !rv.phone.on ? <BoxZoomBar view={view} pick={(k) => rv.setBoxZoom(k)} draws={draws} /> : null}
|
|
922
|
+
{isGallery(v) && tile?.t.view === undefined ? <GalleryTools ver={ver} v={v} /> : null}
|
|
851
923
|
</span>
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
{tile && isGallery(v) ? <Tile ver={ver} v={v} view={at} t={tile.t} k={tile.k} boxed /> : <ViewCell ver={ver} v={v} i={at} boxed />}
|
|
856
|
-
</div>
|
|
857
|
-
<footer className="rv-boxbar rv-boxfoot">
|
|
858
|
-
{media?.note ? <span className="rv-boxnote rv-dim" title={media.note}>{media.note}</span> : null}
|
|
924
|
+
</>}
|
|
925
|
+
foot={<>
|
|
926
|
+
{media?.note ? <span className="rv-boxnote rv-dim" {...tip(media.note)}>{media.note}</span> : null}
|
|
859
927
|
{said.length > 0 ? <div className="rv-boxsaid">{said.map((s, k) => <SaidLine key={k} s={s} v={v} n={cell.n} />)}</div> : null}
|
|
860
|
-
{
|
|
861
|
-
|
|
862
|
-
|
|
928
|
+
{/* the owner's words on a fix go in the thread's reply box, under the lightbox: one click there */}
|
|
929
|
+
{takes(ver) && thread.replyOn !== null && thread.replyOn.to !== 'action' ? (
|
|
930
|
+
<span className="rv-boxfix">
|
|
931
|
+
<span className="rv-dim">fix on {thread.replyOn.label}: say what in the reply</span>
|
|
932
|
+
<button className="primary" onMouseDown={keepFocus} onClick={() => thread.closeBox()}>say it ↓</button>
|
|
933
|
+
</span>
|
|
863
934
|
) : <span className="sp" />}
|
|
864
935
|
<span className="rv-boxfiles">
|
|
865
936
|
{files.length > 0 ? <Downloads rv={rv} item={cell.item} files={files} /> : null}
|
|
866
|
-
<StageButtons ver={ver} v={v} i={at} />
|
|
937
|
+
<StageButtons ver={ver} v={v} i={at} tile={tile?.k} />
|
|
867
938
|
</span>
|
|
868
|
-
|
|
869
|
-
|
|
939
|
+
</>}
|
|
940
|
+
>
|
|
941
|
+
{tile && isGallery(v) && tile.t.view !== undefined && cell.item.states ? <KindViewFrames rv={rv} thread={thread} item={cell.item} view={tile.t.view} />
|
|
942
|
+
: tile && isGallery(v) ? <BoxTile ver={ver} v={v} view={at} t={tile.t} k={tile.k} /> : <ViewCell ver={ver} v={v} i={at} boxed />}
|
|
943
|
+
</Lightbox>
|
|
870
944
|
)
|
|
871
945
|
})
|
|
872
946
|
|
|
@@ -902,24 +976,24 @@ const filesOf = (v: ReviewView): { file: string; label?: string }[] => {
|
|
|
902
976
|
return isPair(f) ? [{ file: f.before, label: 'before' }, { file: f.after, label: 'after' }] : [{ file: 'image' in f ? f.image : 'video' in f ? f.video : f.audio }]
|
|
903
977
|
}
|
|
904
978
|
|
|
905
|
-
/** a view's files to save at full size, each under the
|
|
979
|
+
/** a view's files to save at full size, each under the item's id and its own name */
|
|
906
980
|
const Downloads = observer(({ rv, item, files }: { rv: ReviewSt; item: Item; files: readonly { file: string; label?: string }[] }) => (
|
|
907
981
|
<div className="rv-downloads">
|
|
908
982
|
{files.map(({ file, label }) => (
|
|
909
|
-
<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>
|
|
910
984
|
))}
|
|
911
|
-
{files.map(({ file, label }) => {
|
|
985
|
+
{rv.can('publish') && files.map(({ file, label }) => {
|
|
912
986
|
const s = rv.shared.get(`${item.id}/${file}`)
|
|
913
987
|
return (
|
|
914
988
|
<button key={`share-${file}`} className="rv-dl ghost" disabled={s === 'sending'} onClick={() => void rv.share(item.id, file)}
|
|
915
|
-
|
|
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`)}>
|
|
916
990
|
{s === 'sending' ? 'uploading…' : `🔗 ${label ? `link ${label}` : 'copy link'}`}
|
|
917
991
|
</button>
|
|
918
992
|
)
|
|
919
993
|
})}
|
|
920
994
|
{/* the Finder is on the desktop only: a phone has none */}
|
|
921
|
-
{rv.phone.on || files[0] === undefined ? null : (
|
|
922
|
-
<button className="rv-dl ghost"
|
|
995
|
+
{rv.phone.on || files[0] === undefined || !rv.can('reveal') ? null : (
|
|
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>
|
|
923
997
|
)}
|
|
924
998
|
</div>
|
|
925
999
|
))
|
|
@@ -942,9 +1016,9 @@ const PhoneSides = observer(({ rv }: { rv: ReviewSt }) => {
|
|
|
942
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>
|
|
943
1017
|
})
|
|
944
1018
|
|
|
945
|
-
/** a pair on a phone: one side at a time full width, or the curtain
|
|
946
|
-
*
|
|
947
|
-
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 }: {
|
|
948
1022
|
ver: Ver
|
|
949
1023
|
view: number
|
|
950
1024
|
bar: ReactNode
|
|
@@ -952,7 +1026,6 @@ const PhonePair = observer(({ ver, view, bar, before, after, aspect, size, scale
|
|
|
952
1026
|
after: string
|
|
953
1027
|
aspect: string
|
|
954
1028
|
size: { w: number; h: number }
|
|
955
|
-
scale: number | null
|
|
956
1029
|
fitH: string | null
|
|
957
1030
|
}) => {
|
|
958
1031
|
const { rv } = ver
|
|
@@ -964,8 +1037,8 @@ const PhonePair = observer(({ ver, view, bar, before, after, aspect, size, scale
|
|
|
964
1037
|
return (
|
|
965
1038
|
<div className="rv-phonepair">
|
|
966
1039
|
{fitH ? null : <PhoneSides rv={rv} />}
|
|
967
|
-
<div
|
|
968
|
-
<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' }}>
|
|
969
1042
|
{side === 'swipe' ? (
|
|
970
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} />}
|
|
971
1044
|
over={(srcs) => (ver.live ? <RectNote ver={ver} view={view} sides={srcs.map((s) => (s === before ? 'before' : 'after'))} /> : null)} />
|
|
@@ -997,13 +1070,13 @@ const CompareModes = observer(({ c, clip, keys }: { c: CompareSt; clip: boolean;
|
|
|
997
1070
|
<span className="seg">
|
|
998
1071
|
{COMPARE_MODES.filter((m) => !(clip && m === 'diff')).map((m) => {
|
|
999
1072
|
const o = MODES.find((x) => x.mode === m)!
|
|
1000
|
-
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>
|
|
1001
1074
|
})}
|
|
1002
1075
|
</span>
|
|
1003
1076
|
{keys ? <Key k="D" /> : null}
|
|
1004
1077
|
</span>
|
|
1005
1078
|
{c.mode === 'onion' ? (
|
|
1006
|
-
<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))} />
|
|
1007
1080
|
) : null}
|
|
1008
1081
|
</span>
|
|
1009
1082
|
))
|
|
@@ -1013,7 +1086,7 @@ const PairFlip = observer(({ c }: { c: CompareSt }) => (
|
|
|
1013
1086
|
<span className="rv-keyed">
|
|
1014
1087
|
<span className="seg" role="group" aria-label="one side alone">
|
|
1015
1088
|
{(['before', 'after'] as const).map((side) => (
|
|
1016
|
-
<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>
|
|
1017
1090
|
))}
|
|
1018
1091
|
</span>
|
|
1019
1092
|
<Key k="space" />
|
|
@@ -1091,27 +1164,6 @@ const DiffCanvas = ({ base, mod, say }: { base: string; mod: string; say: (share
|
|
|
1091
1164
|
return <canvas ref={ref} className="rv-diff" />
|
|
1092
1165
|
}
|
|
1093
1166
|
|
|
1094
|
-
/** the pixels that changed from `base` to `mod`, alone on a clear canvas (the rest transparent), for the preview's glow */
|
|
1095
|
-
const GlowCanvas = ({ base, mod }: { base: string; mod: string }) => {
|
|
1096
|
-
const ref = useRef<HTMLCanvasElement>(null)
|
|
1097
|
-
useEffect(() => {
|
|
1098
|
-
let gone = false
|
|
1099
|
-
void pixelsOf(base, mod, () => (gone ? null : ref.current)).then((px) => {
|
|
1100
|
-
if (px == null) return
|
|
1101
|
-
const { ctx, pa, out } = px
|
|
1102
|
-
const pb = out.data
|
|
1103
|
-
for (let i = 0; i < pb.length; i += 4) {
|
|
1104
|
-
const moved = Math.abs(pa[i]! - pb[i]!) + Math.abs(pa[i + 1]! - pb[i + 1]!) + Math.abs(pa[i + 2]! - pb[i + 2]!) > DIFF_NOISE
|
|
1105
|
-
pb[i + 3] = moved ? 255 : 0
|
|
1106
|
-
}
|
|
1107
|
-
ctx.putImageData(out, 0, 0)
|
|
1108
|
-
})
|
|
1109
|
-
return () => {
|
|
1110
|
-
gone = true
|
|
1111
|
-
}
|
|
1112
|
-
}, [base, mod])
|
|
1113
|
-
return <canvas ref={ref} className="rv-flipglow" aria-hidden="true" />
|
|
1114
|
-
}
|
|
1115
1167
|
|
|
1116
1168
|
/** follows the pointer until it is released */
|
|
1117
1169
|
function track(move: (e: PointerEvent) => void): void {
|
|
@@ -1168,9 +1220,13 @@ const Compare = observer(({ c, mode = c.mode, base, mod, names, aspect, draw, ov
|
|
|
1168
1220
|
* after green) and its name in a corner tag, both drawn over the image so nothing moves when it changes */
|
|
1169
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 }) => {
|
|
1170
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()
|
|
1171
1225
|
const down = (e: React.PointerEvent): void => {
|
|
1172
1226
|
const el = frame.current
|
|
1173
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
|
|
1174
1230
|
e.preventDefault()
|
|
1175
1231
|
const at = (x: number): void => {
|
|
1176
1232
|
const r = el.getBoundingClientRect()
|
|
@@ -1182,7 +1238,7 @@ const Frame = ({ aspect, caption, modCap, swipe, onPeek, side, over, children }:
|
|
|
1182
1238
|
return (
|
|
1183
1239
|
<div className="rv-cell">
|
|
1184
1240
|
<div className="rv-framebox">
|
|
1185
|
-
<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}
|
|
1186
1242
|
onMouseEnter={() => onPeek?.(true)} onMouseLeave={() => onPeek?.(false)}>
|
|
1187
1243
|
{children}
|
|
1188
1244
|
</div>
|
|
@@ -1202,9 +1258,11 @@ export const pct = (r: { x: number; y: number; w: number; h: number }) => ({ lef
|
|
|
1202
1258
|
const clamp01 = (v: number): number => Math.max(0, Math.min(1, v))
|
|
1203
1259
|
/** a drag shorter than this, on either axis, is a click: it picks nothing */
|
|
1204
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
|
|
1205
1263
|
|
|
1206
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),
|
|
1207
|
-
* `end` the rectangle, or null for a click. A
|
|
1265
|
+
* `end` the rectangle, or null for a click. A version's views draw with it, and a trailer page's frame */
|
|
1208
1266
|
export function dragBox(e: { clientX: number; clientY: number }, el: Element, show: (c: Corners | null) => void, end: (r: { x: number; y: number; w: number; h: number } | null) => void): void {
|
|
1209
1267
|
const at = (p: { clientX: number; clientY: number }): { x: number; y: number } => {
|
|
1210
1268
|
const b = el.getBoundingClientRect()
|
|
@@ -1226,7 +1284,8 @@ export function dragBox(e: { clientX: number; clientY: number }, el: Element, sh
|
|
|
1226
1284
|
// a second finger hands the gesture to the browser's pinch, which cancels this one: no rectangle, no tap
|
|
1227
1285
|
if (ev.type === 'pointercancel') return
|
|
1228
1286
|
const r = box(cur)
|
|
1229
|
-
|
|
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)
|
|
1230
1289
|
}
|
|
1231
1290
|
window.addEventListener('pointermove', move)
|
|
1232
1291
|
window.addEventListener('pointerup', up)
|
|
@@ -1239,7 +1298,7 @@ export const DragBox = ({ c }: { c: Corners | null }) => (c ? <div className="rv
|
|
|
1239
1298
|
/** what a host that shows notes by time says of each rectangle: hidden now (null), else its number and whether it is lit */
|
|
1240
1299
|
export type ShownNote = (r: Rect) => { n: number; lit: boolean } | null
|
|
1241
1300
|
|
|
1242
|
-
/** a picture another kind of view hosts (a trailer
|
|
1301
|
+
/** a picture another kind of view hosts (a trailer version's player): the regular frame and its rectangles over the host's
|
|
1243
1302
|
* own `face`, drawn and kept as on an image, the picked one's note box beside it. `notes` says which rectangles show
|
|
1244
1303
|
* now and their numbers */
|
|
1245
1304
|
export const HostedFrame = observer(({ ver, view, side, aspect, face, notes }: { ver: Ver; view: number; side: Side | undefined; aspect: string; face: ReactNode; notes: ShownNote }) => (
|
|
@@ -1252,18 +1311,21 @@ export const HostedFrame = observer(({ ver, view, side, aspect, face, notes }: {
|
|
|
1252
1311
|
* answer goes to his draft's, a drag drawing one (never in the curtain, whose drag moves the line). A clip view of
|
|
1253
1312
|
* that version that is not the active one loops on its own: a click makes it active. On a claiming version (the newest,
|
|
1254
1313
|
* his answer on an older one) a drag draws at once and brings his answer here. `face` takes the image's place (the
|
|
1255
|
-
* changes of a pair, a trailer
|
|
1256
|
-
* clock its frames stand on is the
|
|
1314
|
+
* changes of a pair, a trailer version's player); `alone`: one picture with no curtain over it, whatever its side. The
|
|
1315
|
+
* clock its frames stand on is the version's (`clockOf`): a clip's own, a trailer version's player's. `notes`: a host that
|
|
1257
1316
|
* shows its notes by time picks which rectangles show and numbers them, each with its first words */
|
|
1258
1317
|
const Marks = observer(({ ver, src, side, view, face, tile, onTap, alone, notes }: { ver: Ver; src: string; side: Side | undefined; view: number; face?: ReactNode; tile?: number; onTap?: () => void; alone?: boolean; notes?: ShownNote }) => {
|
|
1259
|
-
const { rv,
|
|
1318
|
+
const { rv, thread, cell } = ver
|
|
1260
1319
|
const el = useRef<HTMLDivElement>(null)
|
|
1261
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())
|
|
1262
1324
|
const phone = rv.phone
|
|
1263
1325
|
const any = itemOf(ver).views[view]
|
|
1264
1326
|
const shown = any && !isGallery(any) ? any : undefined
|
|
1265
|
-
const clock = tile === undefined ?
|
|
1266
|
-
const active =
|
|
1327
|
+
const clock = tile === undefined ? thread.clockOf(cell.id, view) : null
|
|
1328
|
+
const active = thread.view === view
|
|
1267
1329
|
const free = alone === true || side === undefined
|
|
1268
1330
|
const drawing = takes(ver) && (phone.on ? phone.draw && (free || phone.pair !== 'swipe' || rv.compare.mode !== 'swipe') : free || rv.compare.mode !== 'swipe')
|
|
1269
1331
|
const c = clock?.c ?? null
|
|
@@ -1271,29 +1333,30 @@ const Marks = observer(({ ver, src, side, view, face, tile, onTap, alone, notes
|
|
|
1271
1333
|
if (e.button !== 0 || !e.isPrimary) return
|
|
1272
1334
|
if (clock && ver.live && !active) {
|
|
1273
1335
|
e.preventDefault()
|
|
1274
|
-
|
|
1336
|
+
thread.setView(view)
|
|
1275
1337
|
return
|
|
1276
1338
|
}
|
|
1277
1339
|
if (!drawing) return
|
|
1278
1340
|
e.preventDefault()
|
|
1279
1341
|
e.stopPropagation()
|
|
1280
|
-
if (ver.claim)
|
|
1342
|
+
if (ver.claim) thread.answerNewest()
|
|
1281
1343
|
// he draws on the paused frame: the rectangle keeps its time
|
|
1282
1344
|
if (c && !c.paused) c.pause()
|
|
1283
1345
|
if (!el.current) return
|
|
1284
1346
|
dragBox(e, el.current, setDrag, (r) => {
|
|
1285
|
-
if (r)
|
|
1347
|
+
if (r) zoom?.drew()
|
|
1348
|
+
if (r) thread.addRect(r, side, view, tile)
|
|
1286
1349
|
else if (onTap) onTap()
|
|
1287
|
-
else
|
|
1350
|
+
else thread.pickRect(null)
|
|
1288
1351
|
})
|
|
1289
1352
|
}
|
|
1290
|
-
const rects = ver.live ?
|
|
1291
|
-
const sent =
|
|
1353
|
+
const rects = ver.live ? thread.marks.rects.map((r, i) => [r, i] as const).filter(([r]) => r.side === side && (r.view ?? 0) === view && r.tile === tile) : []
|
|
1354
|
+
const sent = thread.sentRects(cell.id, view, side, tile)
|
|
1292
1355
|
const onIts = (r: Rect): boolean => !clock || r.t === undefined || (clock.c.paused && onFrame(r.t, clock.c.time, clock.fps))
|
|
1293
1356
|
const rings = rv.marksOn ? (shown?.marks ?? []).filter((m) => m.side === side) : []
|
|
1294
1357
|
const live = drawing || (clock !== null && ver.live && !active)
|
|
1295
1358
|
return (
|
|
1296
|
-
<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 }}>
|
|
1297
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" />)}
|
|
1298
1361
|
{shown && rings.length > 0 ? <Rings marks={rings} w={shown.size.w} h={shown.size.h} /> : null}
|
|
1299
1362
|
{notes
|
|
@@ -1301,14 +1364,14 @@ const Marks = observer(({ ver, src, side, view, face, tile, onTap, alone, notes
|
|
|
1301
1364
|
const s = notes(r)
|
|
1302
1365
|
return s ? [<NoteRect key={`s${k}`} r={r} n={s.n} on={s.lit} sent />] : []
|
|
1303
1366
|
})
|
|
1304
|
-
: 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>)}
|
|
1305
1368
|
{notes
|
|
1306
1369
|
? rects.flatMap(([r, i]) => {
|
|
1307
1370
|
const s = notes(r)
|
|
1308
|
-
return s ? [<NoteRect key={i} r={r} n={s.n} on={s.lit ||
|
|
1371
|
+
return s ? [<NoteRect key={i} r={r} n={s.n} on={s.lit || thread.rect === i} pick={() => thread.pickRect(i, true)} />] : []
|
|
1309
1372
|
})
|
|
1310
1373
|
: rects.map(([r, i]) => (
|
|
1311
|
-
<RectMark key={i} r={r} n={i + 1} on={
|
|
1374
|
+
<RectMark key={i} r={r} n={i + 1} on={thread.rect === i} faint={!onIts(r)} at={clock && r.t !== undefined ? secs(r.t) : undefined} pick={() => thread.pickRect(i, true)} />
|
|
1312
1375
|
))}
|
|
1313
1376
|
<DragBox c={drag} />
|
|
1314
1377
|
</div>
|
|
@@ -1317,7 +1380,7 @@ const Marks = observer(({ ver, src, side, view, face, tile, onTap, alone, notes
|
|
|
1317
1380
|
|
|
1318
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 */
|
|
1319
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 }) => (
|
|
1320
|
-
<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}`)}
|
|
1321
1384
|
onPointerDown={pick ? (e) => { e.stopPropagation(); pick() } : undefined} onMouseDown={keepFocus}>
|
|
1322
1385
|
<span className="tr-notelabel"><b>{n}</b>{r.comment.trim() ? ` ${firstWords(r.comment)}` : ''}</span>
|
|
1323
1386
|
</div>
|
|
@@ -1337,7 +1400,7 @@ const Rings = ({ marks, w, h }: { marks: readonly ReviewMark[]; w: number; h: nu
|
|
|
1337
1400
|
|
|
1338
1401
|
/** a rectangle of his draft; on a clip, faint and dashed away from its frame, its time on its number */
|
|
1339
1402
|
const RectMark = ({ r, n, on, faint, at, pick }: { r: Rect; n: number; on: boolean; faint: boolean; at: string | undefined; pick: () => void }) => (
|
|
1340
|
-
<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}`)}
|
|
1341
1404
|
onPointerDown={(e) => { e.stopPropagation(); pick() }} onMouseDown={keepFocus}>
|
|
1342
1405
|
<span className="rv-rectn">{n}{at ? ` · ${at}` : ''}{!on && r.comment.trim() ? <span className="rv-rectword">{firstWords(r.comment)}</span> : null}</span>
|
|
1343
1406
|
</div>
|
|
@@ -1349,75 +1412,78 @@ const firstWords = (s: string): string => {
|
|
|
1349
1412
|
return w.length > 5 ? `${w.slice(0, 5).join(' ')}…` : w.join(' ')
|
|
1350
1413
|
}
|
|
1351
1414
|
|
|
1352
|
-
/** the picked rectangle's note box, beside it
|
|
1353
|
-
*
|
|
1354
|
-
* draft), Shift Enter is a new line; `sides` are the
|
|
1355
|
-
*
|
|
1356
|
-
* own). `notes`: a host that shows its notes by time (a trailer
|
|
1357
|
-
* and leaves OK, Fix and No to the verdict */
|
|
1415
|
+
/** the picked rectangle's note box, beside it and never over it, inside its frame where it fits (Popover: under it,
|
|
1416
|
+
* else over it, right of it, left of it), focused once drawn or clicked. Enter, Escape or a press anywhere outside
|
|
1417
|
+
* closes it (the rectangle and its words stay: each key writes the draft), Shift Enter is a new line; `sides` are the
|
|
1418
|
+
* sides the frame shows. Its tag names the side it marks (before or after), and a second row repeats the view's OK,
|
|
1419
|
+
* Fix and No under the hand that drew it (the lightbox's own). `notes`: a host that shows its notes by time (a trailer
|
|
1420
|
+
* version) numbers it, shows it only paused on its frame, and leaves OK, Fix and No to the verdict */
|
|
1358
1421
|
const RectNote = observer(({ ver, view, sides, tile, notes }: { ver: Ver; view: number; sides: readonly (Side | undefined)[]; tile?: number; notes?: ShownNote }) => {
|
|
1359
|
-
const {
|
|
1422
|
+
const { thread } = ver
|
|
1360
1423
|
const box = useRef<HTMLTextAreaElement | null>(null)
|
|
1361
|
-
|
|
1362
|
-
const [
|
|
1363
|
-
const i =
|
|
1364
|
-
const r = i === null ? undefined :
|
|
1424
|
+
// a mark in the frame, so the box knows the frame it floats over
|
|
1425
|
+
const [mark, setMark] = useState<HTMLSpanElement | null>(null)
|
|
1426
|
+
const i = thread.rect
|
|
1427
|
+
const r = i === null ? undefined : thread.marks.rects[i]
|
|
1365
1428
|
const shown = r && notes ? notes(r) : null
|
|
1366
|
-
const paused =
|
|
1429
|
+
const paused = thread.clockOf(thread.target ?? '', view)?.c.paused ?? true
|
|
1367
1430
|
const here = i !== null && r !== undefined && (r.view ?? 0) === view && sides.includes(r.side) && r.tile === tile && (!notes || (shown !== null && paused))
|
|
1368
|
-
const focus = here &&
|
|
1431
|
+
const focus = here && thread.noteFocus === i
|
|
1369
1432
|
useEffect(() => {
|
|
1370
1433
|
const t = box.current
|
|
1371
1434
|
if (!focus || t === null) return
|
|
1372
1435
|
// the cursor after the words, so a reopened note goes on where it stopped
|
|
1373
1436
|
t.focus()
|
|
1374
1437
|
t.setSelectionRange(t.value.length, t.value.length)
|
|
1375
|
-
|
|
1376
|
-
}, [focus,
|
|
1377
|
-
// the frame's size and its own, read before paint and again as either changes (a word wraps, the window moves)
|
|
1378
|
-
useLayoutEffect(() => {
|
|
1379
|
-
const n = el.current
|
|
1380
|
-
const f = n?.parentElement
|
|
1381
|
-
if (!n || !f) return
|
|
1382
|
-
const read = (): void => {
|
|
1383
|
-
const v = { fw: f.clientWidth, fh: f.clientHeight, nw: n.offsetWidth, nh: n.offsetHeight }
|
|
1384
|
-
setSize((s) => (s && s.fw === v.fw && s.fh === v.fh && s.nw === v.nw && s.nh === v.nh ? s : v))
|
|
1385
|
-
}
|
|
1386
|
-
read()
|
|
1387
|
-
const ro = new ResizeObserver(read)
|
|
1388
|
-
ro.observe(n)
|
|
1389
|
-
ro.observe(f)
|
|
1390
|
-
return () => ro.disconnect()
|
|
1391
|
-
}, [here])
|
|
1438
|
+
thread.noteFocused()
|
|
1439
|
+
}, [focus, thread])
|
|
1392
1440
|
// a press outside closes it, captured so a handler that stops it (a rectangle, the frame's drag) closes it too
|
|
1393
1441
|
useEffect(() => {
|
|
1394
1442
|
if (!here) return
|
|
1395
1443
|
const out = (e: PointerEvent): void => {
|
|
1396
|
-
if (!
|
|
1444
|
+
if (!(e.target as Element | null)?.closest?.('.rv-note')) thread.pickRect(null)
|
|
1397
1445
|
}
|
|
1398
1446
|
document.addEventListener('pointerdown', out, true)
|
|
1399
1447
|
return () => document.removeEventListener('pointerdown', out, true)
|
|
1400
|
-
}, [here,
|
|
1448
|
+
}, [here, thread])
|
|
1449
|
+
const frame = mark?.parentElement ?? null
|
|
1450
|
+
// the rectangle on the page, read again each time the box is placed: the frame scrolls and resizes under it
|
|
1451
|
+
const anchor = useMemo(() => {
|
|
1452
|
+
if (frame === null || r === undefined) return null
|
|
1453
|
+
const { x, y, w, h } = r
|
|
1454
|
+
return {
|
|
1455
|
+
contextElement: frame,
|
|
1456
|
+
getBoundingClientRect: () => {
|
|
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()
|
|
1459
|
+
const left = b.left + x * b.width
|
|
1460
|
+
const top = b.top + y * b.height
|
|
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 }
|
|
1462
|
+
},
|
|
1463
|
+
}
|
|
1464
|
+
}, [frame, r])
|
|
1401
1465
|
if (!here) return null
|
|
1402
|
-
const at = size ? notePlace({ x: r.x * size.fw, y: r.y * size.fh, w: r.w * size.fw, h: r.h * size.fh }, { w: size.fw, h: size.fh }, { w: size.nw, h: size.nh }) : null
|
|
1403
|
-
// until measured it waits unseen, still focusable, where it most often lands
|
|
1404
|
-
const place = at ? { left: at.left, top: at.top } : { left: `${r.x * 100}%`, top: `${(r.y + r.h) * 100}%`, opacity: 0 }
|
|
1405
1466
|
const n = shown?.n ?? i + 1
|
|
1406
1467
|
const side = notes ? undefined : r.side
|
|
1407
1468
|
return (
|
|
1408
|
-
|
|
1409
|
-
<span
|
|
1410
|
-
<
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1469
|
+
<>
|
|
1470
|
+
<span ref={setMark} hidden />
|
|
1471
|
+
<Popover open anchor={anchor} onClose={() => thread.pickRect(null)} outside={false} focus={false} className="rv-note" placement="bottom-start" fallbacks={['top-start', 'right-start', 'left-start']} {...(frame ? { boundary: frame } : {})}>
|
|
1472
|
+
<div className="rv-notebody" onPointerDown={(e) => e.stopPropagation()}>
|
|
1473
|
+
<span className={`rv-noten${side ? ` ${side}` : ''}`}>{n}{side ? ` · ${side}` : ''}{r.t !== undefined ? ` · ${secs(r.t)}` : ''}</span>
|
|
1474
|
+
<AutoText el={(t) => (box.current = t)} placeholder="what is wrong here · Enter closes" value={r.comment}
|
|
1475
|
+
onText={(t) => thread.setRectComment(i, t)}
|
|
1476
|
+
onKeyDown={(e) => {
|
|
1477
|
+
if ((e.key === 'Enter' && !e.shiftKey && !e.nativeEvent.isComposing) || e.key === 'Escape') {
|
|
1478
|
+
e.preventDefault()
|
|
1479
|
+
thread.pickRect(null)
|
|
1480
|
+
}
|
|
1481
|
+
}} />
|
|
1482
|
+
<button className="ghost rv-x" {...tip('delete this rectangle')} aria-label="delete this rectangle" onMouseDown={keepFocus} onClick={() => thread.removeRect(i)}>✕</button>
|
|
1483
|
+
{notes || oneSet(ver) ? null : <span className="rv-notereacts"><ReactionToggles ver={ver} view={view} small /></span>}
|
|
1484
|
+
</div>
|
|
1485
|
+
</Popover>
|
|
1486
|
+
</>
|
|
1421
1487
|
)
|
|
1422
1488
|
})
|
|
1423
1489
|
|
|
@@ -1438,7 +1504,7 @@ const ClipVideo = ({ clip, src, poster, loop = true, preload = 'auto' }: { clip:
|
|
|
1438
1504
|
/** the sound button and the volume: a volume moved turns the sound on */
|
|
1439
1505
|
export const ClipSound = observer(({ clip, keyHint }: { clip: ClipSt; keyHint?: string }) => (
|
|
1440
1506
|
<span className="rv-sound">
|
|
1441
|
-
<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()}>
|
|
1442
1508
|
{clip.sound ? '🔊' : '🔇'}
|
|
1443
1509
|
</button>
|
|
1444
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))}
|
|
@@ -1447,7 +1513,7 @@ export const ClipSound = observer(({ clip, keyHint }: { clip: ClipSt; keyHint?:
|
|
|
1447
1513
|
))
|
|
1448
1514
|
|
|
1449
1515
|
/** under a clip: play or pause, one frame back or on, the scrubber, the time and the frame. `keys`: in the lightbox,
|
|
1450
|
-
* which of its keys reach the clip there (space flips a pair, ← → step the views of a
|
|
1516
|
+
* which of its keys reach the clip there (space flips a pair, ← → step the views of a version that has several), each
|
|
1451
1517
|
* shown on its button */
|
|
1452
1518
|
const ClipBar = observer(({ clip, info, use, keys }: { clip: ClipSt; info: ReviewClip; use: () => void; keys?: { play: boolean; frames: boolean } | undefined }) => {
|
|
1453
1519
|
const frames = Math.max(1, Math.round(info.duration * info.fps))
|
|
@@ -1455,10 +1521,10 @@ const ClipBar = observer(({ clip, info, use, keys }: { clip: ClipSt; info: Revie
|
|
|
1455
1521
|
const step = keys?.frames ?? true
|
|
1456
1522
|
return (
|
|
1457
1523
|
<div className="rv-clipbar" onMouseDownCapture={use} onTouchStartCapture={use}>
|
|
1458
|
-
<button
|
|
1524
|
+
<button {...tip(`${clip.paused ? 'play' : 'pause'}${play ? ' (Space)' : ''}`)} onMouseDown={keepFocus} onClick={() => clip.toggle()}>{clip.paused ? '▶' : '❚❚'}{keys && play ? <Key k="space" /> : null}</button>
|
|
1459
1525
|
<ClipSound clip={clip} />
|
|
1460
|
-
<button
|
|
1461
|
-
<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>
|
|
1462
1528
|
<input className="rv-scrub" type="range" min={0} max={info.duration} step={1 / info.fps} value={Math.min(clip.time, info.duration)}
|
|
1463
1529
|
onChange={(e) => clip.seek(Number(e.currentTarget.value))} onMouseUp={(e) => e.currentTarget.blur()} />
|
|
1464
1530
|
<span className="rv-mono">{secs(clip.time)} · frame {clip.frameOf(clip.time) + 1}/{frames}</span>
|