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