rvlib-shipkit 2.12.0 → 2.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +75 -21
- package/README.md +1 -1
- package/package.json +4 -2
- package/src/agent-time/store.ts +2 -2
- package/src/assets/run-assets.ts +2 -2
- package/src/assets/server/studio-server.ts +27 -23
- package/src/check.ts +4 -4
- package/src/checks/SK001-package-json-shape.check.ts +8 -4
- package/src/checks/SK002-contracts-fulfillness.check.ts +2 -2
- package/src/checks/SK003-claude-md-shape.check.ts +20 -13
- package/src/checks/SK004-gitignore-policy.check.ts +45 -6
- package/src/checks/SK005-rvlib-versions.check.ts +2 -2
- package/src/checks/SK006-npm-publish-safety.check.ts +3 -3
- package/src/checks/SK007-github-visibility.check.ts +2 -2
- package/src/checks/SK008-reviewer-agent.check.ts +3 -3
- package/src/checks/SK010-undeclared-unit.check.ts +2 -2
- package/src/checks/SK011-sibling-unit-ranges.check.ts +2 -2
- package/src/checks/SK012-config-barrel-import.check.ts +2 -2
- package/src/checks/SK013-one-way-in-policy.check.ts +2 -2
- package/src/checks/SK015-nested-repo.check.ts +3 -3
- package/src/checks/SK016-legacy-check-shapes.check.ts +2 -2
- package/src/checks/SK017-vscode-hub-task.check.ts +2 -2
- package/src/checks/SK018-test-files-run.check.ts +2 -2
- package/src/checks/SK019-tests-run-in-units.check.ts +2 -2
- package/src/checks/SK020-self-spawning-check.check.ts +2 -2
- package/src/checks/SK022-machine-runs-the-pin.check.ts +2 -2
- package/src/checks/SK024-identity-colors.check.ts +1 -1
- package/src/checks/SK025-release-drift.check.ts +2 -2
- package/src/checks/SK026-asks-autoclose.check.ts +2 -2
- package/src/checks/SK027-agent-wiki-links.check.ts +8 -2
- package/src/checks/SK028-readme.check.ts +2 -2
- package/src/checks/SK029-explicit-check-files.check.ts +3 -3
- package/src/checks/SK030-cache-audit.check.ts +7 -5
- package/src/checks/SK031-trace-audit.check.ts +7 -7
- package/src/checks/SK032-ignored-inputs.check.ts +3 -3
- package/src/checks/SK033-global-contribution.check.ts +11 -4
- package/src/checks/SK034-commit-gates-armed.check.ts +2 -2
- package/src/checks/SK035-public-clean.check.ts +46 -0
- package/src/checks/SK036-draft-media-size.check.ts +28 -0
- package/src/checks/SK037-keyword-additions.check.ts +43 -0
- package/src/cli/cmd_Backup.ts +152 -0
- package/src/cli/cmd_Ci.ts +8 -11
- package/src/cli/cmd_Commands.ts +4 -4
- package/src/cli/cmd_ConfigKeys.ts +2 -2
- package/src/cli/cmd_Drill.ts +145 -0
- package/src/cli/cmd_Home.ts +50 -3
- package/src/cli/cmd_Init.ts +1 -1
- package/src/cli/cmd_Media.ts +10 -8
- package/src/cli/cmd_Mv.ts +14 -7
- package/src/cli/cmd_Review.ts +6 -4
- package/src/cli/cmd_Shot.ts +5 -2
- package/src/cli/cmd_Smoke.ts +5 -2
- package/src/cli/cmd_Social.ts +226 -0
- package/src/cli/cmd_Sound.ts +1 -1
- package/src/cli/cmd_Start.ts +1 -1
- package/src/cli/cmd_Time.ts +1 -1
- package/src/cli/cmd_TraceAudit.ts +6 -6
- package/src/cli/cmd_Trailer.ts +7 -4
- package/src/cli/cmd_Veille.ts +173 -0
- package/src/cli/cmd_When.ts +2 -2
- package/src/cli/family-pages.ts +19 -16
- package/src/cli/registry.ts +13 -2
- package/src/cli.ts +5 -2
- package/src/collections/actions.ts +1 -49
- package/src/collections/checks.ts +2 -1
- package/src/collections/collection-types.ts +12 -3
- package/src/collections/providers.ts +4 -4
- package/src/collections/review.ts +3 -2
- package/src/collections/tests.ts +19 -8
- package/src/comfy/comfy-panel.ts +2 -2
- package/src/contracts/apply-contracts.ts +1 -3
- package/src/contracts/contract-manifests.ts +2 -3
- package/src/contracts/contract-types.ts +0 -1
- package/src/contracts/contracts-engine.ts +0 -3
- package/src/contracts/manifests/discord.contract.ts +1 -1
- package/src/contracts/manifests/identity.contract.ts +1 -1
- package/src/contracts/manifests/itch.contract.ts +1 -1
- package/src/contracts/manifests/steam.contract.ts +1 -1
- package/src/core/agent-dir-at.ts +12 -0
- package/src/core/agent-dir.ts +16 -0
- package/src/core/app-icon.ts +9 -3
- package/src/core/budget.ts +1 -1
- package/src/core/bun-builtins.ts +2 -2
- package/src/core/canonical-scripts.ts +2 -2
- package/src/core/discover-checks.ts +38 -6
- package/src/core/fix-scope.ts +4 -2
- package/src/core/floor-resolve.ts +68 -48
- package/src/core/floor.ts +9 -0
- package/src/core/git-root.ts +24 -0
- package/src/core/global-contribution.ts +4 -1
- package/src/core/ignored-block.ts +1 -1
- package/src/core/ignored-inputs.ts +3 -2
- package/src/core/last-good.ts +3 -1
- package/src/core/layout.ts +8 -0
- package/src/core/log-stamp.ts +36 -0
- package/src/core/loop-watch.ts +93 -0
- package/src/core/machine-link.ts +134 -0
- package/src/core/memory-watch.ts +41 -0
- package/src/core/motherhome.ts +2 -2
- package/src/core/one-way-in-policy.ts +34 -26
- package/src/core/run-ci.ts +9 -11
- package/src/core/run-fixers.ts +9 -9
- package/src/core/runs-matrix.ts +1 -1
- package/src/core/slots.ts +30 -0
- package/src/core/trace-audit.ts +50 -9
- package/src/core/tree-rev.ts +60 -0
- package/src/core/unit-files.ts +42 -0
- package/src/drill/render.ts +140 -0
- package/src/drill/run.ts +269 -0
- package/src/fleet/scan-fleet.ts +6 -5
- package/src/home/daemon-jobs.ts +201 -0
- package/src/home/global-context.ts +44 -8
- package/src/home/gui-app/ShipkitGui.swift +91 -2
- package/src/home/home-routes.ts +22 -15
- package/src/home/hubs.ts +10 -3
- package/src/home/inbox-shape.ts +54 -5
- package/src/home/inbox.ts +17 -2
- package/src/home/lib-watch.ts +10 -3
- package/src/home/machine-stores.ts +15 -29
- package/src/home/pm-config.ts +4 -1
- package/src/home/pm-inputs.ts +2 -0
- package/src/home/resources.ts +7 -2
- package/src/home/run-daemon.ts +15 -18
- package/src/home/run-pm.ts +3 -1
- package/src/home/serve-daemon.ts +4 -3
- package/src/home/serve-web.ts +104 -1
- package/src/hooks/commit-message.ts +29 -20
- package/src/hooks/hook-gates.ts +1 -1
- package/src/hooks/leak-guard.ts +69 -9
- package/src/hooks/run-hooks.ts +18 -22
- package/src/identities/identities.ts +334 -0
- package/src/identities/machine-route.ts +126 -0
- package/src/identities/machine.ts +62 -0
- package/src/init-repo.ts +3 -3
- package/src/ledger/check-stats.ts +10 -9
- package/src/ledger/gate-checks.ts +32 -1
- package/src/ledger/record-kept.ts +112 -0
- package/src/ledger/repo-view.ts +10 -0
- package/src/ledger/run-log.ts +17 -12
- package/src/ledger/run-timeline.ts +8 -4
- package/src/ledger/store.ts +7 -0
- package/src/ledger/suite-log.ts +17 -13
- package/src/media-kinds.ts +3 -2
- package/src/media-store/backup/daemon.ts +73 -0
- package/src/media-store/backup/keys.ts +25 -0
- package/src/media-store/backup/manifest.ts +193 -0
- package/src/media-store/backup/restore.ts +192 -0
- package/src/media-store/backup/run.ts +278 -0
- package/src/media-store/backup/secret.ts +86 -0
- package/src/media-store/backup/snapshot.ts +64 -0
- package/src/media-store/backup/sources.ts +199 -0
- package/src/media-store/content.ts +1 -1
- package/src/media-store/daemon.ts +56 -70
- package/src/media-store/db.ts +1 -1
- package/src/media-store/fact.ts +1 -1
- package/src/media-store/hand.ts +1 -1
- package/src/media-store/kind.ts +1 -1
- package/src/media-store/purge.ts +1 -1
- package/src/media-store/put.ts +5 -3
- package/src/media-store/remote.ts +1 -1
- package/src/media-store/space.ts +24 -5
- package/src/mv/mv-md.ts +63 -22
- package/src/pages/forward.ts +35 -0
- package/src/pages/frame-client.ts +118 -0
- package/src/pages/routes.ts +29 -0
- package/src/pages/unit.ts +92 -0
- package/src/plan/planner.ts +12 -0
- package/src/plan/repo-source.ts +19 -5
- package/src/reflect/transcript.ts +35 -10
- package/src/release/public-clean.ts +319 -0
- package/src/release/published-here.ts +22 -0
- package/src/release/run-bump.ts +3 -2
- package/src/release/run-release.ts +7 -4
- package/src/repo-config.ts +71 -13
- package/src/review/anim.ts +1 -1
- package/src/review/auto.ts +1 -1
- package/src/review/cells.ts +15 -1
- package/src/review/format.ts +2 -2
- package/src/review/http.ts +16 -2
- package/src/review/marks.ts +1 -1
- package/src/review/media-kind.ts +1 -1
- package/src/review/media-read.ts +1 -1
- package/src/review/model.ts +27 -6
- package/src/review/notes.ts +125 -0
- package/src/review/previews.ts +1 -1
- package/src/review/project.ts +7 -39
- package/src/review/role.ts +1 -1
- package/src/review/routes.ts +18 -14
- package/src/review/store.ts +42 -2
- package/src/review/threads.ts +1 -1
- package/src/review/trailer-desk.ts +3 -3
- package/src/review/trailer-media.ts +8 -5
- package/src/review/trailer-model.ts +1 -1
- package/src/review/trailer-routes.ts +1 -1
- package/src/review/trailer-shots.ts +22 -5
- package/src/review/unit.ts +2 -2
- package/src/scaffold/files/agent-handoff.md +3 -0
- package/src/scaffold/files/agent-index.md +4 -12
- package/src/scaffold/files/tsconfig.json +1 -1
- package/src/scaffold/project-scaffold.ts +6 -5
- package/src/serve/embed.ts +2 -2
- package/src/serve/hub-app/check-words.ts +1 -1
- package/src/serve/hub-app/col-card.tsx +3 -17
- package/src/serve/hub-app/col-tables-view.tsx +2 -1
- package/src/serve/hub-app/cols-svc.ts +0 -13
- package/src/serve/hub-app/dock-st.ts +4 -2
- package/src/serve/hub-app/dock-view.tsx +2 -0
- package/src/serve/hub-app/frames-st.ts +35 -0
- package/src/serve/hub-app/hash-route.ts +64 -1
- package/src/serve/hub-app/home-st.ts +32 -8
- package/src/serve/hub-app/home-strip.css +9 -1
- package/src/serve/hub-app/home-strip.tsx +7 -6
- package/src/serve/hub-app/home.html +5 -0
- package/src/serve/hub-app/hub-app.tsx +51 -7
- package/src/serve/hub-app/hub.css +29 -11
- package/src/serve/hub-app/icons.tsx +16 -1
- package/src/serve/hub-app/identities-st.ts +210 -0
- package/src/serve/hub-app/identities-view.tsx +353 -0
- package/src/serve/hub-app/identities.css +48 -0
- package/src/serve/hub-app/identity-address.ts +52 -0
- package/src/serve/hub-app/inbox-st.ts +60 -7
- package/src/serve/hub-app/inbox-view.tsx +49 -7
- package/src/serve/hub-app/inbox.css +12 -1
- package/src/serve/hub-app/index.html +3 -0
- package/src/serve/hub-app/kept-cols.tsx +30 -0
- package/src/serve/hub-app/keys.ts +10 -2
- package/src/serve/hub-app/list-walk.ts +89 -0
- package/src/serve/hub-app/machine-st.ts +12 -0
- package/src/serve/hub-app/media-svc.ts +1 -1
- package/src/serve/hub-app/media-view.tsx +2 -1
- package/src/serve/hub-app/pages-frames.tsx +134 -0
- package/src/serve/hub-app/pages-svc.ts +111 -0
- package/src/serve/hub-app/palette-st.ts +18 -3
- package/src/serve/hub-app/palette-view.tsx +9 -2
- package/src/serve/hub-app/planned-view.tsx +2 -1
- package/src/serve/hub-app/project-list.css +18 -14
- package/src/serve/hub-app/project-list.tsx +88 -49
- package/src/serve/hub-app/projects-svc.ts +33 -3
- package/src/serve/hub-app/repo-sections.ts +19 -2
- package/src/serve/hub-app/repo-st.ts +76 -20
- package/src/serve/hub-app/review/review-board.tsx +1 -1
- package/src/serve/hub-app/review/review-cells.tsx +6 -5
- package/src/serve/hub-app/review/review-kit.ts +30 -7
- package/src/serve/hub-app/review/review-page.tsx +6 -5
- package/src/serve/hub-app/review/review-st.ts +34 -15
- package/src/serve/hub-app/review/review-thread.tsx +63 -14
- package/src/serve/hub-app/review/review-views.tsx +133 -51
- package/src/serve/hub-app/review/thread-st.ts +80 -37
- package/src/serve/hub-app/review/trailer-page.tsx +7 -5
- package/src/serve/hub-app/review/trailer-st.ts +1 -1
- package/src/serve/hub-app/review.css +26 -9
- package/src/serve/hub-app/site/site-part.tsx +173 -0
- package/src/serve/hub-app/site/site-st.ts +157 -0
- package/src/serve/hub-app/site.css +35 -0
- package/src/serve/hub-app/social/calendar.tsx +182 -0
- package/src/serve/hub-app/social/comms-page.tsx +330 -0
- package/src/serve/hub-app/social/kit.tsx +244 -0
- package/src/serve/hub-app/social/post-card.tsx +456 -0
- package/src/serve/hub-app/social/problems.tsx +60 -0
- package/src/serve/hub-app/social/social-model.ts +154 -0
- package/src/serve/hub-app/social/social-page.tsx +681 -0
- package/src/serve/hub-app/social/social-st.ts +1014 -0
- package/src/serve/hub-app/social.css +289 -0
- package/src/serve/hub-app/stores/stores-page.tsx +312 -0
- package/src/serve/hub-app/stores/stores-st.ts +286 -0
- package/src/serve/hub-app/stores.css +54 -0
- package/src/serve/hub-app/timeline-geometry.ts +1 -1
- package/src/serve/hub-app/timeline-view.tsx +3 -2
- package/src/serve/hub-app/tree-build.ts +6 -0
- package/src/serve/hub-app/tree-row.tsx +27 -4
- package/src/serve/hub-app/tree-svc.ts +18 -49
- package/src/serve/hub-app/veille/veille-page.tsx +515 -0
- package/src/serve/hub-app/veille/veille-st.ts +443 -0
- package/src/serve/hub-app/veille.css +84 -0
- package/src/serve/hub-runtime.ts +20 -11
- package/src/serve/project-gutter-route.ts +44 -12
- package/src/serve/run-lanes.ts +7 -4
- package/src/serve/same-origin.ts +1 -1
- package/src/serve/serve-hub.ts +20 -12
- package/src/serve/tracked-watch.ts +24 -3
- package/src/serve/warm-cell.ts +5 -1
- package/src/shipkit-files.ts +15 -4
- package/src/shipkit.ts +0 -1
- package/src/shot/box.ts +160 -0
- package/src/shot/browser-slot.ts +74 -0
- package/src/shot/client.ts +42 -7
- package/src/shot/clip-encoder.ts +108 -24
- package/src/shot/film-box.ts +292 -0
- package/src/shot/shooter.ts +71 -17
- package/src/shot/shot-ask.ts +10 -2
- package/src/shot/stepped-clip.ts +5 -4
- package/src/site/desk.ts +242 -0
- package/src/site/routes.ts +66 -0
- package/src/site/unit.ts +62 -0
- package/src/social/brands.ts +22 -0
- package/src/social/card-drafts.ts +24 -0
- package/src/social/compose.ts +97 -0
- package/src/social/desk-index.ts +123 -0
- package/src/social/desk-wire.ts +64 -0
- package/src/social/drafts.ts +183 -0
- package/src/social/house.ts +24 -0
- package/src/social/load.ts +332 -0
- package/src/social/md.ts +70 -0
- package/src/social/media-facts.ts +53 -0
- package/src/social/media-kind.ts +189 -0
- package/src/social/media-limit.ts +42 -0
- package/src/social/media-of.ts +30 -0
- package/src/social/migrate.ts +123 -0
- package/src/social/open.ts +17 -0
- package/src/social/post-url.ts +158 -0
- package/src/social/presence.ts +332 -0
- package/src/social/public-read.ts +53 -0
- package/src/social/publish/bluesky.ts +168 -0
- package/src/social/publish/discord.ts +76 -0
- package/src/social/publish/index.ts +24 -0
- package/src/social/publish/secret.ts +13 -0
- package/src/social/push.ts +37 -0
- package/src/social/richtext.ts +37 -0
- package/src/social/routes.ts +186 -0
- package/src/social/stats.ts +134 -0
- package/src/social/text.ts +267 -0
- package/src/social/tracker-route.ts +39 -0
- package/src/social/tracker.ts +255 -0
- package/src/social/unit.ts +53 -0
- package/src/social/writes.ts +130 -0
- package/src/start-repo.ts +14 -9
- package/src/stores/collection.ts +27 -0
- package/src/stores/desk.ts +336 -0
- package/src/stores/model.ts +187 -0
- package/src/stores/routes.ts +126 -0
- package/src/stores/unit.ts +57 -0
- package/src/suite/calibrate.ts +127 -0
- package/src/suite/core-counters.ts +91 -0
- package/src/suite/judge-suites.ts +95 -35
- package/src/suite/suite-cli.ts +44 -10
- package/src/suite/suite-cpu-preload.ts +34 -9
- package/src/trace/tracer.ts +12 -5
- package/src/trailer/adapter.ts +5 -1
- package/src/trailer/build.ts +45 -12
- package/src/trailer/ffmpeg.ts +11 -0
- package/src/trailer/footage.ts +30 -13
- package/src/trailer/grammar.ts +18 -2
- package/src/trailer/graph.ts +28 -6
- package/src/trailer/holes.ts +1 -1
- package/src/trailer/passage.ts +18 -6
- package/src/trailer/plan.ts +74 -3
- package/src/trailer/prune.ts +1 -1
- package/src/trailer/states.ts +1 -1
- package/src/trailer/stitch.ts +67 -26
- package/src/trailer/url.ts +1 -1
- package/src/trailer/versions.ts +24 -0
- package/src/trailer/words.ts +1 -1
- package/src/ts/gate-typecheck.ts +32 -0
- package/src/ts/typecheck-cli.ts +9 -11
- package/src/tui/run-tui.ts +1 -1
- package/src/tui/tui-app.tsx +0 -1
- package/src/tui/tui-store.ts +1 -1
- package/src/veille/asks.ts +155 -0
- package/src/veille/auto.ts +31 -0
- package/src/veille/batch.ts +27 -0
- package/src/veille/chrome.ts +127 -0
- package/src/veille/collection.ts +28 -0
- package/src/veille/desk.ts +242 -0
- package/src/veille/identity.ts +80 -0
- package/src/veille/import.ts +68 -0
- package/src/veille/log.ts +183 -0
- package/src/veille/platforms.ts +118 -0
- package/src/veille/reads.ts +66 -0
- package/src/veille/replied.ts +110 -0
- package/src/veille/routes.ts +185 -0
- package/src/veille/service.ts +81 -0
- package/src/veille/watch.ts +116 -0
- package/src/veille/worth.ts +46 -0
- package/src/wiki/scan-md.ts +18 -0
- package/src/collections/posts.ts +0 -142
- package/src/contracts/manifests/social.contract.ts +0 -20
- package/src/scaffold/files/agent-coding.md +0 -35
- package/src/ts/typecheck-cache.ts +0 -11
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
// a repo's trailer page (`#page:trailer`, wiki
|
|
1
|
+
// a repo's trailer page (`#page:trailer`, wiki tools/trailer/index.md, Frame notes): the cuts on the left, the player over
|
|
2
2
|
// its timeline and its shot cards in the middle, the notes on the right. A note pins a frame of the render on screen
|
|
3
3
|
// and becomes an item of the review store. On a phone the three stacked
|
|
4
4
|
import { observer } from 'mobx-react-lite'
|
|
5
5
|
import { Fragment, useEffect, useRef, useState, type ReactNode } from 'react'
|
|
6
|
-
import {
|
|
6
|
+
import { Panel, Separator } from 'react-resizable-panels'
|
|
7
|
+
import { KeptCols } from '../kept-cols.tsx'
|
|
7
8
|
import { AutoText } from '../auto-text.tsx'
|
|
8
9
|
import { clock, cutsByRecent, shotAt, type CutInfo, type TrailerNote } from '../../../review/trailer-model.ts'
|
|
9
10
|
import { editorHref } from '../check-words.ts'
|
|
@@ -14,6 +15,7 @@ import { PANEL, PhoneTop } from './review-page.tsx'
|
|
|
14
15
|
import { ClipSound } from './review-views.tsx'
|
|
15
16
|
import { hueOf, ShotCards, TrailerTimeline } from './trailer-timeline.tsx'
|
|
16
17
|
import { captionText, type PlacedNote, type TrailerSt } from './trailer-st.ts'
|
|
18
|
+
import { Caret } from '../icons.tsx'
|
|
17
19
|
|
|
18
20
|
export const TrailerPage = observer(({ app }: { app: RepoSt }) => {
|
|
19
21
|
const tr = app.trailer
|
|
@@ -31,7 +33,7 @@ export const TrailerPage = observer(({ app }: { app: RepoSt }) => {
|
|
|
31
33
|
</div>
|
|
32
34
|
)
|
|
33
35
|
return (
|
|
34
|
-
<
|
|
36
|
+
<KeptCols id="trailer">
|
|
35
37
|
<Panel id="trailer-cuts" defaultSize="15%" minSize={190} className="rv-pane" style={PANEL}>
|
|
36
38
|
<div className="rv-scroll"><CutList tr={tr} /></div>
|
|
37
39
|
</Panel>
|
|
@@ -43,7 +45,7 @@ export const TrailerPage = observer(({ app }: { app: RepoSt }) => {
|
|
|
43
45
|
<Panel id="trailer-notes" defaultSize="28%" minSize={300} className="rv-pane" style={PANEL}>
|
|
44
46
|
<NotesColumn tr={tr} />
|
|
45
47
|
</Panel>
|
|
46
|
-
</
|
|
48
|
+
</KeptCols>
|
|
47
49
|
)
|
|
48
50
|
})
|
|
49
51
|
|
|
@@ -251,7 +253,7 @@ const Montage = observer(({ tr }: { tr: TrailerSt }) => {
|
|
|
251
253
|
const m = tr.montage
|
|
252
254
|
return (
|
|
253
255
|
<div className="tr-montage">
|
|
254
|
-
<button className="ghost" onClick={() => void tr.toggleMontage()}
|
|
256
|
+
<button className="ghost" onClick={() => void tr.toggleMontage()}><Caret open={tr.montageOpen} /> montage</button>
|
|
255
257
|
{tr.montageOpen ? (m == null ? <span className="spin" /> : m.md == null ? <div className="rv-dim">This render has no montage page.</div> : <div className="md tr-montagebody" dangerouslySetInnerHTML={{ __html: renderMd(m.md) }} />) : null}
|
|
256
258
|
</div>
|
|
257
259
|
)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// a repo's trailer page as state (wiki
|
|
1
|
+
// a repo's trailer page as state (wiki tools/trailer/index.md, Frame notes): a cut's render on a clip clock, its montage as a
|
|
2
2
|
// timeline, the owner's notes on its frames. The render on screen is a kept version: a new render never swaps under
|
|
3
3
|
// him, the page offers it. The desk is read while the page shows, every 3 s
|
|
4
4
|
import { makeAutoObservable, observableRef, reaction, runInAction } from 'mobx'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* the review page and the trailer page (hub-app/review/):
|
|
1
|
+
/* the review page and the trailer page (hub-app/review/): a project's review and trailer tabs on the hub's tokens.
|
|
2
2
|
A status, a reaction, a note state and a section each set --tone or --hue, and the parts read it, so no rule here
|
|
3
3
|
writes a colour (tests/hub-css-invariants.test.ts) */
|
|
4
4
|
.st-pending{--tone:var(--blue)}
|
|
@@ -100,9 +100,13 @@
|
|
|
100
100
|
.rv-meta > button.on{border-color:var(--accent);color:var(--ink)}
|
|
101
101
|
.rv-copyid{flex:none;display:inline-flex;align-items:center;padding:var(--s0);color:var(--dim)}
|
|
102
102
|
.rv-copyid:hover{color:var(--ink)}
|
|
103
|
+
.rv-postbox{display:flex;align-items:flex-start;gap:var(--s2);margin-top:var(--s1)}
|
|
104
|
+
.rv-postbox textarea{flex:1;min-width:0}
|
|
103
105
|
.rv-toast{position:fixed;left:50%;bottom:var(--s4);transform:translateX(-50%);z-index:40;max-width:calc(100% - 2 * var(--s4));padding:var(--s1) var(--s3);border-radius:6px;border:1px solid var(--line);background:var(--panel);color:var(--ink);font-size:12.5px;box-shadow:0 6px 20px var(--shadow)}
|
|
104
106
|
.rv-threadbody{position:relative;flex:1;min-height:0;display:flex}
|
|
105
|
-
|
|
107
|
+
/* a sticky row inside sticks under the scroller's top padding, and the cells scroll through that band above it:
|
|
108
|
+
--stick pulls it up to the edge, by the same var(--s3) */
|
|
109
|
+
.rv-cells{--stick:calc(-1 * var(--s3));position:relative;flex:1;min-width:0;overflow-y:auto;display:flex;flex-direction:column;gap:var(--s3);padding:var(--s3) var(--s4) var(--s4)}
|
|
106
110
|
.rv-day{display:flex;align-items:center;gap:var(--s2);margin-top:var(--s2);font-size:10.5px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:var(--dim)}
|
|
107
111
|
.rv-day::before,.rv-day::after{content:'';flex:1;border-top:1px solid var(--line)}
|
|
108
112
|
.rv-events{display:flex;flex-direction:column;gap:var(--s0)}
|
|
@@ -208,15 +212,16 @@
|
|
|
208
212
|
.rv-view[class*=' re-']{border-color:color-mix(in srgb,var(--tone) 55%,var(--line))}
|
|
209
213
|
.rv-view.active{border-color:color-mix(in srgb,var(--accent) 55%,var(--line))}
|
|
210
214
|
/* one sticky row per view: its label, its title, the owner's verdict on it, the tools; it stays at the top while the view scrolls */
|
|
211
|
-
.rv-viewhead{position:sticky;top:0;z-index:4;display:flex;flex-wrap:wrap;gap:var(--s1) var(--s2);align-items:center;padding:var(--s2) var(--s3) var(--s2) var(--s1);border-bottom:1px solid var(--line);border-radius:7px 7px 0 0;background:color-mix(in srgb,var(--panel2) 70%,var(--bg));box-shadow:0 2px 6px var(--shadow)}
|
|
215
|
+
.rv-viewhead{position:sticky;top:var(--stick,0);z-index:4;display:flex;flex-wrap:wrap;gap:var(--s1) var(--s2);align-items:center;padding:var(--s2) var(--s3) var(--s2) var(--s1);border-bottom:1px solid var(--line);border-radius:7px 7px 0 0;background:color-mix(in srgb,var(--panel2) 70%,var(--bg));box-shadow:0 2px 6px var(--shadow)}
|
|
212
216
|
.rv-view.folded .rv-viewhead{border-bottom:0;border-radius:4px 7px 7px 4px}
|
|
213
217
|
.rv-viewn{flex:none;font:800 18px/30px ui-monospace,Menlo,monospace;padding:0 var(--s3);border-radius:6px;color:var(--bg);background:var(--ink)}
|
|
214
218
|
.rv-viewname{margin:0;min-width:0;font-size:16px;line-height:1.3;font-weight:700;color:var(--ink);cursor:pointer}
|
|
215
219
|
.rv-kind{flex:none;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.07em;color:var(--dim);border:1px solid var(--line);border-radius:10px;padding:0 var(--s2);line-height:18px}
|
|
216
220
|
.rv-viewbody{padding:var(--s3)}
|
|
217
221
|
.rv-viewnote{margin-top:var(--s2);font-size:13px;color:var(--ink)}
|
|
218
|
-
|
|
219
|
-
.rv-
|
|
222
|
+
/* above the view, under its head: what was said on it and his word, read and written before the image */
|
|
223
|
+
.rv-viewnotes{display:flex;flex-direction:column;gap:var(--s1);padding:var(--s3) var(--s3) 0}
|
|
224
|
+
.rv-view.folded .rv-viewnotes{padding:var(--s2) var(--s3) var(--s3)}
|
|
220
225
|
.rv-said{display:flex;gap:var(--s2);align-items:baseline;padding:var(--s1) var(--s2);font-size:13px;line-height:1.4;border-radius:6px;border-left:3px solid var(--tone,var(--k4));background:color-mix(in srgb,var(--tone,var(--k4)) 8%,transparent)}
|
|
221
226
|
.rv-said.rect{--tone:var(--k4)}
|
|
222
227
|
.rv-saidmark{flex:none;font-weight:800;color:var(--tone,var(--k4));white-space:nowrap}
|
|
@@ -234,6 +239,8 @@ span.rv-react{display:inline-block;border:1px solid;border-radius:4px}
|
|
|
234
239
|
/* the frame's box: what sits over the frame free of its clip (the note box) shares its size */
|
|
235
240
|
.rv-framebox{position:relative;width:100%}
|
|
236
241
|
.rv-over{position:absolute;inset:0;z-index:4;pointer-events:none}
|
|
242
|
+
/* an open note box rises over the sticky rows (each view's head at 4), so the next view's verdict row never cuts it */
|
|
243
|
+
.rv-over:has(.rv-note){z-index:5}
|
|
237
244
|
.rv-frame{position:relative;width:100%;max-width:100%;border-radius:4px;border:1px solid var(--line);overflow:hidden;
|
|
238
245
|
background:repeating-conic-gradient(var(--chk1) 0 25%,var(--chk2) 0 50%) 0 0/16px 16px}
|
|
239
246
|
.rv-frame.swipe{cursor:ew-resize;touch-action:none}
|
|
@@ -247,6 +254,8 @@ span.rv-react{display:inline-block;border:1px solid;border-radius:4px}
|
|
|
247
254
|
.rv-marks.draw{cursor:crosshair}
|
|
248
255
|
.rv-marks.pick{cursor:pointer}
|
|
249
256
|
.rv-markimg,.rv-video{display:block;width:100%;height:100%;pointer-events:none}
|
|
257
|
+
/* the changes of a pair: the after's changed pixels on its faded self, drawn in place of the image */
|
|
258
|
+
.rv-diff{display:block;width:100%;height:100%;pointer-events:none}
|
|
250
259
|
.rv-rings{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
|
|
251
260
|
.rv-ring{fill:none;stroke:var(--warn);stroke-width:3}
|
|
252
261
|
.rv-ringshade{fill:none;stroke:var(--solid);stroke-opacity:.35;stroke-width:7}
|
|
@@ -260,12 +269,16 @@ span.rv-react{display:inline-block;border:1px solid;border-radius:4px}
|
|
|
260
269
|
.rv-rect.sent .rv-rectn{background:var(--k4)}
|
|
261
270
|
.rv-drag{position:absolute;border:2px dashed var(--warn)}
|
|
262
271
|
/* the picked rectangle's note box, in the picked rectangle's blue: under it, or over it (clearing its number) */
|
|
263
|
-
.rv-note{position:absolute;left:clamp(0px,var(--nx),calc(100% - min(300px,100%)));width:min(300px,100%);pointer-events:auto;display:flex;gap:var(--s1);align-items:flex-start;
|
|
272
|
+
.rv-note{position:absolute;left:clamp(0px,var(--nx),calc(100% - min(300px,100%)));width:min(300px,100%);pointer-events:auto;display:flex;flex-wrap:wrap;gap:var(--s1);align-items:flex-start;
|
|
264
273
|
padding:var(--s1);border-radius:6px;border:2px solid var(--blue);background:var(--panel);box-shadow:0 2px 10px var(--shadow)}
|
|
265
274
|
.rv-note.below{margin-top:var(--s1)}
|
|
266
275
|
.rv-note.above{margin-bottom:var(--s4)}
|
|
267
276
|
.rv-noten{flex:none;padding:0 var(--s1);border-radius:3px;background:var(--blue);color:var(--bg);font-size:11px;font-weight:800;line-height:18px;white-space:nowrap}
|
|
268
277
|
.rv-note textarea{flex:1;min-width:0}
|
|
278
|
+
/* the side the rectangle marks, beside its number: after keeps the blue, before turns to the warn tone so a wrong side shows */
|
|
279
|
+
.rv-noten.before{background:var(--warn)}
|
|
280
|
+
/* the view's OK, Fix and No again, on their own row under the words */
|
|
281
|
+
.rv-notereacts{flex:1 1 100%;display:flex;justify-content:flex-end}
|
|
269
282
|
.rv-downloads{display:flex;gap:var(--s2);justify-content:flex-end;margin-top:var(--s1)}
|
|
270
283
|
.rv-dl{font-size:11.5px;text-decoration:none}
|
|
271
284
|
.rv-gallery{display:flex;flex-wrap:wrap;gap:var(--s2);align-items:flex-start}
|
|
@@ -295,7 +308,7 @@ span.rv-react{display:inline-block;border:1px solid;border-radius:4px}
|
|
|
295
308
|
.rv-opt.picked{--tone:var(--ok);border-color:var(--tone);border-left-color:var(--tone);background:color-mix(in srgb,var(--tone) 9%,var(--bg))}
|
|
296
309
|
.rv-optrow{display:flex;flex-wrap:wrap;gap:var(--s1) var(--s2);align-items:center;min-height:36px}
|
|
297
310
|
.rv-optn{flex:none;font:800 16px/28px ui-monospace,Menlo,monospace;padding:0 8px;border-radius:5px;color:var(--bg);background:var(--ink)}
|
|
298
|
-
.rv-opt.unfolded > .rv-optrow{position:sticky;top:0;z-index:4;margin:calc(-1 * var(--s1)) calc(-1 * var(--s2)) 0;padding:var(--s1) var(--s2);border-radius:7px 7px 0 0;background:var(--bg);box-shadow:0 2px 6px var(--shadow)}
|
|
311
|
+
.rv-opt.unfolded > .rv-optrow{position:sticky;top:var(--stick,0);z-index:4;margin:calc(-1 * var(--s1)) calc(-1 * var(--s2)) 0;padding:var(--s1) var(--s2);border-radius:7px 7px 0 0;background:var(--bg);box-shadow:0 2px 6px var(--shadow)}
|
|
299
312
|
.rv-optplay{flex:none;width:32px;height:28px;padding:0;font-size:13px}
|
|
300
313
|
.rv-optplay.on{color:var(--bg);background:var(--accent);border-color:var(--accent)}
|
|
301
314
|
.rv-optlabel{flex:0 1 auto;min-width:48px;max-width:30%;font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
|
|
@@ -332,6 +345,10 @@ span.rv-pick{display:inline-block;border:1px solid;border-radius:4px;font-size:1
|
|
|
332
345
|
.rv-outbadge.rect{--tone:var(--warn)}
|
|
333
346
|
.rv-outbadge.rect.on{--tone:var(--blue)}
|
|
334
347
|
.rv-x{flex:none;padding:0 var(--s1);border:0}
|
|
348
|
+
/* a seg's icon button (fold every cell, unfold every cell): the icon centred, the row's height kept */
|
|
349
|
+
.rv-iconbtn{display:inline-flex;align-items:center;justify-content:center;padding:0 var(--s2)}
|
|
350
|
+
.rv-fold{flex:none;padding:0 var(--s2);font-size:11px;text-transform:none;letter-spacing:0;color:var(--dim)}
|
|
351
|
+
.rv-fold:hover{color:var(--ink)}
|
|
335
352
|
|
|
336
353
|
/* ── the phone: the page covers the hub's panes, one pane at a time, the verdicts under the thumb ── */
|
|
337
354
|
.rv-phone,.tr-phone{position:fixed;inset:0;z-index:30;background:var(--bg)}
|
|
@@ -347,7 +364,7 @@ span.rv-pick{display:inline-block;border:1px solid;border-radius:4px;font-size:1
|
|
|
347
364
|
.rv-phone .rv-cbody{padding:var(--s2)}
|
|
348
365
|
.rv-phone .rv-chead .rv-copyid{display:none}
|
|
349
366
|
.rv-phone .rv-viewbody{padding:var(--s1)}
|
|
350
|
-
.rv-phone .rv-viewnotes{padding:
|
|
367
|
+
.rv-phone .rv-viewnotes{padding:var(--s2) var(--s1) 0}
|
|
351
368
|
.rv-phone .rv-viewname{font-size:15px}
|
|
352
369
|
.rv-phone .rv-composer{padding:var(--s2)}
|
|
353
370
|
.rv-phone .rv-acts .sp{display:none}
|
|
@@ -501,7 +518,7 @@ span.rv-pick{display:inline-block;border:1px solid;border-radius:4px;font-size:1
|
|
|
501
518
|
.rv-c.k-version > .rv-cbody{padding:0}
|
|
502
519
|
.rv-vgrid{display:grid;grid-template-columns:52px minmax(0,1fr)}
|
|
503
520
|
.rv-gut{border-right:1px solid color-mix(in srgb,var(--who) 35%,var(--line));border-radius:0 0 0 9px;background:color-mix(in srgb,var(--who) 12%,var(--panel2))}
|
|
504
|
-
.rv-gutlabel{position:sticky;top:0;display:block;padding:var(--s2) 0;text-align:center;font:800 19px/1.2 ui-monospace,Menlo,monospace;color:var(--who)}
|
|
521
|
+
.rv-gutlabel{position:sticky;top:var(--stick,0);display:block;padding:var(--s2) 0;text-align:center;font:800 19px/1.2 ui-monospace,Menlo,monospace;color:var(--who)}
|
|
505
522
|
.rv-vmain{min-width:0;display:flex;flex-direction:column;gap:var(--s3);padding:var(--s3)}
|
|
506
523
|
.rv-phone .rv-vgrid{grid-template-columns:30px minmax(0,1fr)}
|
|
507
524
|
.rv-phone .rv-gutlabel{font-size:12.5px}
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
// the identity view's site section (wiki tools/shipkit/site.md, The section): the facts (the address and whether it
|
|
2
|
+
// answers, the repo that builds it, its Site account), then the desk its repo's site unit gives: the pages on the left,
|
|
3
|
+
// the one picked live from the local preview in the middle, what is online, what changed since and the deploy on the right
|
|
4
|
+
import { observer } from 'mobx-react-lite'
|
|
5
|
+
import { useEffect, type MouseEvent } from 'react'
|
|
6
|
+
import type { MachineIdentity } from '../../../identities/machine-route.ts'
|
|
7
|
+
import type { HomeSt } from '../home-st.ts'
|
|
8
|
+
import { plainClick, repoPage } from '../home-st.ts'
|
|
9
|
+
import { identityAddress } from '../identity-address.ts'
|
|
10
|
+
import { siteStOf, type SitePage, type SiteSt } from './site-st.ts'
|
|
11
|
+
|
|
12
|
+
const when = (iso: string): string => new Date(iso).toLocaleString('en-GB', { dateStyle: 'medium', timeStyle: 'short' })
|
|
13
|
+
|
|
14
|
+
const inPlace = (run: () => void) => (e: MouseEvent): void => {
|
|
15
|
+
if (!plainClick(e)) return
|
|
16
|
+
e.preventDefault()
|
|
17
|
+
run()
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const SitePart = observer(({ app, i }: { app: HomeSt; i: MachineIdentity }) => {
|
|
21
|
+
const s = siteStOf(app, i.id)
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
s.start()
|
|
24
|
+
return () => s.stop()
|
|
25
|
+
}, [s])
|
|
26
|
+
const a = s.answer
|
|
27
|
+
return (
|
|
28
|
+
<div className="idpage site">
|
|
29
|
+
<div className="so-colin">
|
|
30
|
+
<h2 className="so-h so-big">{i.name} <span className="rv-dim so-light">· the site</span></h2>
|
|
31
|
+
<Facts app={app} i={i} s={s} />
|
|
32
|
+
{s.loadError != null ? <div className="hnote">{s.loadError}</div> : null}
|
|
33
|
+
{a?.error != null ? <div className="hnote">{a.error}</div> : null}
|
|
34
|
+
{a?.missing != null ? <div className="site-missing">{a.missing}</div> : null}
|
|
35
|
+
{a == null && s.loadError == null ? <div className="iddim"><span className="spin" />reading the site…</div> : null}
|
|
36
|
+
</div>
|
|
37
|
+
{a?.desk != null ? <Desk s={s} /> : null}
|
|
38
|
+
</div>
|
|
39
|
+
)
|
|
40
|
+
})
|
|
41
|
+
|
|
42
|
+
const Facts = observer(({ app, i, s }: { app: HomeSt; i: MachineIdentity; s: SiteSt }) => {
|
|
43
|
+
const a = s.answer
|
|
44
|
+
const account = i.accounts.find((x) => x.id === 'site')
|
|
45
|
+
const online = a?.online
|
|
46
|
+
const repo = a?.repo
|
|
47
|
+
return (
|
|
48
|
+
<dl className="idfacts">
|
|
49
|
+
<dt>address</dt>
|
|
50
|
+
<dd>
|
|
51
|
+
{i.site === '' ? <span className="iddim">none named (site: in identity.md)</span> : <a href={i.site} target="_blank" rel="noreferrer">{i.site} ↗</a>}
|
|
52
|
+
{online == null ? null : (
|
|
53
|
+
<span className={`site-online${online.status != null && online.status < 400 ? ' up' : ''}`} title={`asked ${when(online.at)}`}>
|
|
54
|
+
{online.status == null ? 'no answer' : online.status < 400 ? `answers (${online.status})` : `answers ${online.status}`}
|
|
55
|
+
</span>
|
|
56
|
+
)}
|
|
57
|
+
</dd>
|
|
58
|
+
<dt>built by</dt>
|
|
59
|
+
<dd>
|
|
60
|
+
{i.siteRepo === '' ? <span className="iddim">no repo named (siteRepo: in identity.md)</span>
|
|
61
|
+
: repo?.house ? <a href={repoPage(i.siteRepo)} onClick={inPlace(() => app.select(i.siteRepo))}>{i.siteRepo}</a>
|
|
62
|
+
: <span>{i.siteRepo} <span className="iddim">{repo?.path != null ? `(${repo.path.replace(/^\/Users\/[^/]+/, '~')}, not a house repo)` : '(not on this disk)'}</span></span>}
|
|
63
|
+
</dd>
|
|
64
|
+
{account == null ? null : (
|
|
65
|
+
<>
|
|
66
|
+
<dt>account</dt>
|
|
67
|
+
<dd>
|
|
68
|
+
<a href={identityAddress({ id: i.id, part: 'site', place: null })} onClick={inPlace(() => app.openIdentity({ id: i.id, part: 'site', place: null }))}>
|
|
69
|
+
its Site account, {account.live === '' ? 'to create' : 'online'}
|
|
70
|
+
</a>
|
|
71
|
+
</dd>
|
|
72
|
+
</>
|
|
73
|
+
)}
|
|
74
|
+
</dl>
|
|
75
|
+
)
|
|
76
|
+
})
|
|
77
|
+
|
|
78
|
+
const Desk = observer(({ s }: { s: SiteSt }) => (
|
|
79
|
+
<div className="site-desk">
|
|
80
|
+
<Pages s={s} />
|
|
81
|
+
<Preview s={s} />
|
|
82
|
+
<State s={s} />
|
|
83
|
+
</div>
|
|
84
|
+
))
|
|
85
|
+
|
|
86
|
+
/** ↑ ↓ walk the pages while the list holds the focus; the identity list's own walk (on the document) never sees them */
|
|
87
|
+
const Pages = observer(({ s }: { s: SiteSt }) => (
|
|
88
|
+
<nav className="site-pages" tabIndex={0} aria-label="the pages of the site" onKeyDown={(e) => {
|
|
89
|
+
const d = e.key === 'ArrowDown' ? 1 : e.key === 'ArrowUp' ? -1 : 0
|
|
90
|
+
if (d === 0 || e.metaKey || e.ctrlKey || e.altKey) return
|
|
91
|
+
e.preventDefault()
|
|
92
|
+
e.stopPropagation()
|
|
93
|
+
s.move(d)
|
|
94
|
+
}}>
|
|
95
|
+
{s.pages.map((p) => <PageRow key={p.path} s={s} p={p} />)}
|
|
96
|
+
</nav>
|
|
97
|
+
))
|
|
98
|
+
|
|
99
|
+
const PageRow = observer(({ s, p }: { s: SiteSt; p: SitePage }) => {
|
|
100
|
+
const on = s.current?.path === p.path
|
|
101
|
+
const post = /^\/[^/]+\/.+/.test(p.path)
|
|
102
|
+
const changed = s.changed(p)
|
|
103
|
+
return (
|
|
104
|
+
<button className={`site-page${on ? ' on' : ''}${post ? ' sub' : ''}`} onClick={() => s.pick(p.path)}>
|
|
105
|
+
<i className={`site-dot${changed ? ' changed' : ''}`} title={changed ? 'changed since the deploy' : undefined} />
|
|
106
|
+
<span className="site-ptext">
|
|
107
|
+
<b>{p.title}</b>
|
|
108
|
+
<span className="iddim">{p.path}{p.draft ? ' · draft' : ''}</span>
|
|
109
|
+
</span>
|
|
110
|
+
</button>
|
|
111
|
+
)
|
|
112
|
+
})
|
|
113
|
+
|
|
114
|
+
const Preview = observer(({ s }: { s: SiteSt }) => {
|
|
115
|
+
const page = s.current
|
|
116
|
+
const preview = s.answer?.desk?.preview
|
|
117
|
+
return (
|
|
118
|
+
<div className="site-preview">
|
|
119
|
+
<div className="site-bar">
|
|
120
|
+
<b className="so-ellip">{page?.title ?? ''}</b>
|
|
121
|
+
<span className="site-switch" role="group" aria-label="the preview's width">
|
|
122
|
+
<button className={s.phone ? 'ghost' : 'on'} onClick={() => s.setPhone(false)}>desktop</button>
|
|
123
|
+
<button className={s.phone ? 'on' : 'ghost'} onClick={() => s.setPhone(true)}>phone</button>
|
|
124
|
+
</span>
|
|
125
|
+
{s.src != null ? <a className="site-open" href={s.src} target="_blank" rel="noreferrer">open ↗</a> : null}
|
|
126
|
+
</div>
|
|
127
|
+
{preview == null ? <div className="rv-empty">the site unit names no local preview</div>
|
|
128
|
+
: s.previewError != null ? <div className="hnote">{s.previewError}</div>
|
|
129
|
+
: s.src != null ? (
|
|
130
|
+
<div className={`site-frame${s.phone ? ' phone' : ''}`}>
|
|
131
|
+
<iframe key={s.src} src={s.src} title={page?.title} />
|
|
132
|
+
</div>
|
|
133
|
+
) : <div className="rv-empty"><span className="spin" />{s.starting ? `the preview starts (${preview.url})…` : 'reading…'}</div>}
|
|
134
|
+
</div>
|
|
135
|
+
)
|
|
136
|
+
})
|
|
137
|
+
|
|
138
|
+
const State = observer(({ s }: { s: SiteSt }) => {
|
|
139
|
+
const d = s.answer?.desk
|
|
140
|
+
if (d == null) return null
|
|
141
|
+
const titleOf = (path: string): string => (path === '*' ? 'Every page (code, styles, pictures, accounts)' : (s.pages.find((x) => x.path === path)?.title ?? path))
|
|
142
|
+
const since = d.dated?.since ?? 0
|
|
143
|
+
return (
|
|
144
|
+
<div className="site-state">
|
|
145
|
+
<section>
|
|
146
|
+
<b className="site-h">online</b>
|
|
147
|
+
{d.deployed != null ? (
|
|
148
|
+
<>
|
|
149
|
+
<span>{when(d.deployed.at)}</span>
|
|
150
|
+
<span className="iddim">commit {d.deployed.commit.slice(0, 10)} · {d.deployed.source === 'record' ? 'its deploy record' : 'read on Cloudflare Pages'}</span>
|
|
151
|
+
</>
|
|
152
|
+
) : <span className="iddim">no deploy known</span>}
|
|
153
|
+
</section>
|
|
154
|
+
<section>
|
|
155
|
+
<b className="site-h">changed since</b>
|
|
156
|
+
{since > 0 ? <span>{since} {d.dated?.words} since</span> : null}
|
|
157
|
+
{d.deployed != null && d.changes.length === 0 && since === 0 ? <span className="iddim">nothing: the site online is up to date</span> : null}
|
|
158
|
+
{d.changes.map((c) => (
|
|
159
|
+
<span key={c.path} title={c.files.join('\n')}>
|
|
160
|
+
{c.path === '*' ? <b>{titleOf(c.path)}</b> : <a href="#" onClick={(e) => { e.preventDefault(); s.pick(c.path) }}>{titleOf(c.path)}</a>}
|
|
161
|
+
<span className="iddim"> · {c.files.length} file{c.files.length === 1 ? '' : 's'}</span>
|
|
162
|
+
</span>
|
|
163
|
+
))}
|
|
164
|
+
</section>
|
|
165
|
+
{d.deploy == null ? <span className="iddim">the site unit names no deploy</span> : (
|
|
166
|
+
<button className="site-deploy" disabled={s.deploying || d.deploying} onClick={() => void s.deploy()} title={d.deploy.about ?? undefined}>
|
|
167
|
+
{s.deploying || d.deploying ? <><span className="spin" />deploying…</> : 'Deploy'}
|
|
168
|
+
</button>
|
|
169
|
+
)}
|
|
170
|
+
{s.log !== null ? <pre className="site-log">{s.log || '…'}</pre> : null}
|
|
171
|
+
</div>
|
|
172
|
+
)
|
|
173
|
+
})
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
// an identity's site desk as state (wiki tools/shipkit/site.md, The section): its answer read from the home daemon,
|
|
2
|
+
// the page picked and the width of its preview (kept in the browser), the preview started when down, the deploy he
|
|
3
|
+
// presses with its log as it streams. Read when the section opens, when the window comes back, and after a deploy
|
|
4
|
+
import { makeAutoObservable, observableRef, runInAction } from 'mobx'
|
|
5
|
+
import type { SiteAnswer, SitePage } from '../../../site/desk.ts'
|
|
6
|
+
import type { HomeSt } from '../home-st.ts'
|
|
7
|
+
import { reach } from '../reach.ts'
|
|
8
|
+
import { postJson } from '../review/review-kit.ts'
|
|
9
|
+
|
|
10
|
+
export type { SiteAnswer, SitePage }
|
|
11
|
+
|
|
12
|
+
const KEPT = 'hub:site:'
|
|
13
|
+
const ADDRESS_LEFT = /^https?:\/\/(www\.)?/
|
|
14
|
+
|
|
15
|
+
export class SiteSt {
|
|
16
|
+
answer: SiteAnswer | null = null
|
|
17
|
+
loadError: string | null = null
|
|
18
|
+
/** the page picked, by its path; null the first */
|
|
19
|
+
page: string | null = null
|
|
20
|
+
phone = false
|
|
21
|
+
starting = false
|
|
22
|
+
previewError: string | null = null
|
|
23
|
+
/** the deploy's log as it streams; null before any */
|
|
24
|
+
log: string | null = null
|
|
25
|
+
deploying = false
|
|
26
|
+
private started = 0
|
|
27
|
+
|
|
28
|
+
constructor(readonly id: string) {
|
|
29
|
+
try {
|
|
30
|
+
const k = JSON.parse(localStorage.getItem(KEPT + id) ?? '{}') as { page?: string; phone?: boolean }
|
|
31
|
+
this.page = k.page ?? null
|
|
32
|
+
this.phone = k.phone === true
|
|
33
|
+
} catch {
|
|
34
|
+
// no storage, or a broken entry: the first page at the desktop's width
|
|
35
|
+
}
|
|
36
|
+
makeAutoObservable<this, 'started' | 'onBack'>(this, { id: false, started: false, onBack: false, answer: observableRef })
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
get pages(): SitePage[] {
|
|
40
|
+
return this.answer?.desk?.pages ?? []
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
get current(): SitePage | null {
|
|
44
|
+
return this.pages.find((p) => p.path === this.page) ?? this.pages[0] ?? null
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** the frame's address: the preview's url and the page's path; null while the preview does not answer */
|
|
48
|
+
get src(): string | null {
|
|
49
|
+
const p = this.answer?.desk?.preview
|
|
50
|
+
return p?.up && this.current ? `${p.url.replace(/\/$/, '')}${this.current.path}` : null
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
get shortAddress(): string {
|
|
54
|
+
return (this.answer?.address ?? '').replace(ADDRESS_LEFT, '').replace(/\/$/, '')
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** a page touched since the deploy: by its own files, or by a file every page reads */
|
|
58
|
+
changed(p: SitePage): boolean {
|
|
59
|
+
return (this.answer?.desk?.changes ?? []).some((c) => c.path === p.path || c.path === '*')
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
private keep(): void {
|
|
63
|
+
try {
|
|
64
|
+
localStorage.setItem(KEPT + this.id, JSON.stringify({ page: this.page, phone: this.phone }))
|
|
65
|
+
} catch {
|
|
66
|
+
// no storage: the pick lasts for this page
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
pick(path: string): void {
|
|
71
|
+
this.page = path
|
|
72
|
+
this.keep()
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
move(delta: number): void {
|
|
76
|
+
const i = Math.max(0, this.pages.findIndex((p) => p.path === this.current?.path))
|
|
77
|
+
const next = this.pages[Math.max(0, Math.min(this.pages.length - 1, i + delta))]
|
|
78
|
+
if (next) this.pick(next.path)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
setPhone(on: boolean): void {
|
|
82
|
+
this.phone = on
|
|
83
|
+
this.keep()
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** the section shows: read it, start the preview when down, and read again when the window comes back */
|
|
87
|
+
start(): void {
|
|
88
|
+
if (this.started++ === 0) window.addEventListener('focus', this.onBack)
|
|
89
|
+
void this.open()
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
stop(): void {
|
|
93
|
+
if (--this.started === 0) window.removeEventListener('focus', this.onBack)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
private readonly onBack = (): void => void this.load()
|
|
97
|
+
|
|
98
|
+
async load(): Promise<void> {
|
|
99
|
+
try {
|
|
100
|
+
const r = await reach(`/api/home/sites/${encodeURIComponent(this.id)}`, { cache: 'no-store' })
|
|
101
|
+
const body = (await r.json()) as SiteAnswer & { error?: string }
|
|
102
|
+
if (!r.ok) throw new Error(body.error ?? `HTTP ${r.status}`)
|
|
103
|
+
runInAction(() => {
|
|
104
|
+
this.answer = body
|
|
105
|
+
this.loadError = null
|
|
106
|
+
})
|
|
107
|
+
} catch (e) {
|
|
108
|
+
runInAction(() => (this.loadError = (e as Error).message))
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
private async open(): Promise<void> {
|
|
113
|
+
await this.load()
|
|
114
|
+
const p = this.answer?.desk?.preview
|
|
115
|
+
if (p == null || p.up || this.starting) return
|
|
116
|
+
this.starting = true
|
|
117
|
+
try {
|
|
118
|
+
await postJson(`/api/home/sites/${encodeURIComponent(this.id)}/preview`, {})
|
|
119
|
+
runInAction(() => (this.previewError = null))
|
|
120
|
+
await this.load()
|
|
121
|
+
} catch (e) {
|
|
122
|
+
runInAction(() => (this.previewError = (e as Error).message))
|
|
123
|
+
} finally {
|
|
124
|
+
runInAction(() => (this.starting = false))
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** the unit's deploy, asked first, its log read as it streams */
|
|
129
|
+
async deploy(): Promise<void> {
|
|
130
|
+
const about = this.answer?.desk?.deploy?.about
|
|
131
|
+
if (this.deploying || !confirm(`Deploy the site online (${this.shortAddress})${about ? `, ${about}` : ''}?`)) return
|
|
132
|
+
this.deploying = true
|
|
133
|
+
this.log = ''
|
|
134
|
+
try {
|
|
135
|
+
const r = await reach(`/api/home/sites/${encodeURIComponent(this.id)}/deploy`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: '{}' })
|
|
136
|
+
if (!r.ok || r.body == null) throw new Error(((await r.json().catch(() => ({}))) as { error?: string }).error ?? `HTTP ${r.status}`)
|
|
137
|
+
const dec = new TextDecoder()
|
|
138
|
+
for await (const chunk of r.body) runInAction(() => (this.log += dec.decode(chunk as Uint8Array, { stream: true })))
|
|
139
|
+
} catch (e) {
|
|
140
|
+
runInAction(() => (this.log += `\n${(e as Error).message}\n`))
|
|
141
|
+
} finally {
|
|
142
|
+
runInAction(() => (this.deploying = false))
|
|
143
|
+
void this.load()
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const kept = new WeakMap<HomeSt, Map<string, SiteSt>>()
|
|
149
|
+
|
|
150
|
+
/** the desk of an identity's site, one per identity for the life of the page */
|
|
151
|
+
export function siteStOf(app: HomeSt, id: string): SiteSt {
|
|
152
|
+
let m = kept.get(app)
|
|
153
|
+
if (m == null) kept.set(app, (m = new Map()))
|
|
154
|
+
let s = m.get(id)
|
|
155
|
+
if (s == null) m.set(id, (s = new SiteSt(id)))
|
|
156
|
+
return s
|
|
157
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* an identity's site section (site/site-part.tsx): the facts on top, then three columns, the pages, the preview
|
|
2
|
+
framed at the desktop's width or a phone's, the state with the deploy; the columns fill the panel's height */
|
|
3
|
+
.idpage.site{height:100%;gap:0}
|
|
4
|
+
.site-online{margin-left:var(--s2);font-size:11.5px;color:var(--red)}
|
|
5
|
+
.site-online.up{color:var(--ok)}
|
|
6
|
+
.site-missing{padding:var(--s2) var(--s3);border-radius:6px;background:var(--panel2);font-size:12.5px;color:var(--dim)}
|
|
7
|
+
.site-desk{flex:1;min-height:420px;display:grid;grid-template-columns:minmax(170px,220px) 1fr minmax(200px,260px);border-top:1px solid var(--line)}
|
|
8
|
+
.site-pages{display:flex;flex-direction:column;gap:var(--s0);padding:var(--s2);overflow-y:auto;border-right:1px solid var(--line);outline:none}
|
|
9
|
+
.site-page{display:flex;align-items:center;gap:var(--s2);padding:var(--s1) var(--s2);border:0;border-radius:6px;background:none;color:var(--ink);text-align:left;cursor:pointer;min-width:0}
|
|
10
|
+
.site-page.sub{padding-left:var(--s4)}
|
|
11
|
+
.site-page:hover{background:var(--panel2)}
|
|
12
|
+
.site-page.on{background:var(--sel);box-shadow:inset 3px 0 0 var(--idc,var(--accent))}
|
|
13
|
+
.site-ptext{display:flex;flex-direction:column;min-width:0}
|
|
14
|
+
.site-ptext b{font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
15
|
+
.site-page.sub .site-ptext b{font-weight:500}
|
|
16
|
+
.site-ptext .iddim{font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
17
|
+
.site-dot{flex:none;width:7px;height:7px;border-radius:50%}
|
|
18
|
+
.site-dot.changed{background:var(--warn)}
|
|
19
|
+
.site-preview{display:flex;flex-direction:column;min-width:0;min-height:0;background:var(--panel2)}
|
|
20
|
+
.site-bar{display:flex;align-items:center;gap:var(--s2);padding:var(--s1) var(--s2);border-bottom:1px solid var(--line);font-size:12.5px}
|
|
21
|
+
.site-bar b{flex:1;min-width:0}
|
|
22
|
+
.site-switch{display:flex;gap:2px}
|
|
23
|
+
.site-switch button{font-size:11.5px;padding:var(--s0) var(--s2)}
|
|
24
|
+
.site-switch button.on{background:var(--sel);color:var(--ink)}
|
|
25
|
+
.site-open{font-size:12px;color:var(--accent);text-decoration:none}
|
|
26
|
+
.site-frame{flex:1;min-height:0;display:flex;justify-content:center}
|
|
27
|
+
.site-frame iframe{flex:1;border:0;width:100%;height:100%}
|
|
28
|
+
.site-frame.phone{padding:var(--s2)}
|
|
29
|
+
.site-frame.phone iframe{flex:none;width:390px;border-radius:12px;box-shadow:0 4px 24px var(--shadow)}
|
|
30
|
+
.site-state{display:flex;flex-direction:column;gap:var(--s3);padding:var(--s3);overflow-y:auto;border-left:1px solid var(--line);font-size:12.5px}
|
|
31
|
+
.site-state section{display:flex;flex-direction:column;gap:var(--s1)}
|
|
32
|
+
.site-state a{color:var(--accent);text-decoration:none}
|
|
33
|
+
.site-h{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--dim)}
|
|
34
|
+
.site-deploy{align-self:flex-start;padding:var(--s1) var(--s3);font-weight:600}
|
|
35
|
+
.site-log{margin:0;max-height:360px;overflow:auto;font-size:11px;white-space:pre-wrap;background:var(--panel2);padding:var(--s2);border-radius:6px}
|