@marver-design/marver 0.30.1 → 0.32.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 +70 -0
- package/README.md +12 -8
- package/dist/{anchor-check-Bv4o-R2T.mjs → anchor-check-DZtX13ly.mjs} +1 -1
- package/dist/{board-tree-BXR8dw4b.mjs → board-tree-DGj0HhEE.mjs} +6 -2
- package/dist/{boards-EH2onUXM.mjs → boards-Cim1GTKc.mjs} +32 -2
- package/dist/{boards-BeWtjGUM.mjs → boards-jHmEPLV7.mjs} +7 -7
- package/dist/{build-zWGXSzly.mjs → build-D2dHEWX-.mjs} +14 -17
- package/dist/{capture-DEtM4qm5.mjs → capture-HaS-1or8.mjs} +1 -1
- package/dist/cli.mjs +38 -20
- package/dist/{collab-BEAcXrBb.mjs → collab-D2NcrOB8.mjs} +53 -14
- package/dist/comment-actions-Bxf9Ld4g.mjs +351 -0
- package/dist/{comments-XNhMmSSu.mjs → comments-ocvsnt2j.mjs} +85 -10
- package/dist/config-B0YcFtqS.mjs +510 -0
- package/dist/{context-BUnFiyA3.mjs → context-Cj2TcC0H.mjs} +3 -3
- package/dist/{daemon-CChgWJNq.mjs → daemon-D6TrdgMi.mjs} +268 -28
- package/dist/deep-link-DYtuT740.mjs +163 -0
- package/dist/{dev-DOgIITpT.mjs → dev-DMQYbw-2.mjs} +23 -16
- package/dist/devices-uJZ2inMq.mjs +155 -0
- package/dist/{events-CLH4ijKP.mjs → events-Dieo1482.mjs} +49 -4
- package/dist/{init-CYlFaRzG.mjs → init-BgusplYn.mjs} +40 -10
- package/dist/{jam-Cj5gBvwD.mjs → jam-CkuLL8A8.mjs} +1 -1
- package/dist/{link-BFFRgrMt.mjs → link-aZq5cExV.mjs} +54 -7
- package/dist/{logo-CXY-1yrn.mjs → logo-C9s7-Cy9.mjs} +89 -66
- package/dist/{ls-NqmePKOf.mjs → ls-DGVIW-Io.mjs} +1 -1
- package/dist/{manifest-DPZ3WNg_.mjs → manifest-CK8Qh4Nq.mjs} +255 -13
- package/dist/{marks-BnNANic9.mjs → marks-C8oX8kbE.mjs} +3 -3
- package/dist/{marks-DBp3h1Mc.mjs → marks-Dt-5JXCp.mjs} +18 -5
- package/dist/{marver-id-gate-vBLb_Icb.mjs → marver-id-gate-BAeuMeaU.mjs} +11 -7
- package/dist/md-B9_13Q0R.mjs +105 -0
- package/dist/notes-CRAX4wgk.mjs +148 -0
- package/dist/own-C8Mq0Hnf.mjs +128 -0
- package/dist/pdf-Cf9GIoIM.mjs +2299 -0
- package/dist/pdf-HB0prF75.mjs +117 -0
- package/dist/{perf-6MOTHxay.mjs → perf-9ZEF5KLO.mjs} +5 -5
- package/dist/{perf-BCxAo0IS.mjs → perf-BA_NDarr.mjs} +2 -1
- package/dist/{plugin-CFWBcAba.mjs → plugin-DesQP9L5.mjs} +565 -107
- package/dist/{poster-DPPpQiva.mjs → poster-Bb6WraCA.mjs} +1 -1
- package/dist/{profile-B1FKOM1e.mjs → profile-cdmSer1k.mjs} +1 -1
- package/dist/{publish-bakes-_Zx8crP3.mjs → publish-bakes-EjMmukJB.mjs} +3 -3
- package/dist/{queue-DeSQm24g.mjs → queue-BLLfdlDw.mjs} +156 -11
- package/dist/{recover-mDUVsnPd.mjs → recover-B3dmatx4.mjs} +2 -2
- package/dist/{serve-DQv3Ti6X.mjs → serve-kcF6-H8V.mjs} +4 -4
- package/dist/{session-VDJfXEEm.mjs → session-DBF-nQvq.mjs} +29 -3
- package/dist/{share-Bu_kuOKL.mjs → share-CS2mg27O.mjs} +1 -1
- package/dist/{shot-d4h_hJi9.mjs → shot-Bjt2MQe3.mjs} +4 -4
- package/dist/{shot-DBWN8hPP.mjs → shot-BuUCG46-.mjs} +1 -1
- package/dist/show-DhmiUu01.mjs +101 -0
- package/dist/{sizes-wjXDev3b.mjs → sizes-BckcL4Zz.mjs} +1 -1
- package/dist/{slots-Dn4Onb0V.mjs → slots-BOcfIqxy.mjs} +15 -3
- package/dist/{summary-Y8MY1Wuc.mjs → summary-cPmRDGpX.mjs} +1 -1
- package/dist/{sync-CMozOwZ0.mjs → sync-BNWwh8OF.mjs} +205 -7
- package/dist/{work-DJxH7cCX.mjs → work-B4tydWnf.mjs} +38 -2
- package/dist/{work-BYWD_1Zf.mjs → work-CzIXp7n1.mjs} +3 -3
- package/docs/app.md +143 -6
- package/docs/boards-and-folders.md +41 -7
- package/docs/jam-session.md +5 -0
- package/docs/live-jam.md +9 -0
- package/docs/pdf.md +108 -0
- package/docs/publish.md +9 -9
- package/docs/sharing.md +11 -0
- package/docs/slides.md +11 -1
- package/package.json +3 -1
- package/src/client/content/index.tsx +4 -2
- package/src/client/frame-host/main.tsx +3 -0
- package/src/client/shell/App.tsx +71 -24
- package/src/client/shell/BoardList.tsx +16 -7
- package/src/client/shell/Comments.tsx +77 -16
- package/src/client/shell/Play.tsx +104 -27
- package/src/client/shell/Toolbar.tsx +4 -3
- package/src/client/shell/app-bridge.ts +40 -5
- package/src/client/shell/canvas/Canvas.tsx +30 -8
- package/src/client/shell/canvas/FrameNode.tsx +3 -1
- package/src/client/shell/canvas/ctl.ts +16 -0
- package/src/client/shell/commands.ts +20 -0
- package/src/client/shell/comments-store.ts +81 -2
- package/src/client/shell/devices.tsx +42 -0
- package/src/client/shell/goto.ts +56 -9
- package/src/client/shell/icons.tsx +11 -4
- package/src/client/shell/immersive.ts +123 -0
- package/src/client/shell/inset.ts +29 -3
- package/src/client/shell/jam-lines.ts +5 -3
- package/src/client/shell/jam-panel.tsx +17 -5
- package/src/client/shell/marks-ui.tsx +54 -0
- package/src/client/shell/notes.ts +21 -0
- package/src/client/shell/pdf-export.tsx +154 -0
- package/src/client/shell/pdf-notes.ts +20 -0
- package/src/client/shell/recorder-signals.ts +5 -2
- package/src/client/shell/show.ts +250 -0
- package/src/client/shell/store.ts +23 -38
- package/src/client/shell/styles.css +68 -6
- package/src/shared/app-api.ts +90 -4
- package/src/shared/auto-place.ts +32 -0
- package/src/shared/board-tree.ts +3 -0
- package/src/shared/board-types.ts +6 -2
- package/src/shared/deep-link.ts +212 -0
- package/src/shared/devices.ts +89 -0
- package/src/shared/events.ts +48 -5
- package/src/shared/export-plan.ts +98 -0
- package/src/shared/immersive.ts +13 -0
- package/src/shared/perf-records.ts +1 -1
- package/templates/AGENTS-embedded.md +76 -12
- package/templates/AGENTS-studio.md +76 -12
- package/templates/instructions/boards.md +6 -5
- package/templates/instructions/configure.md +32 -2
- package/templates/instructions/iterate.md +8 -0
- package/templates/instructions/jam.md +9 -0
- package/templates/instructions/publish.md +14 -4
- package/templates/instructions/review.md +4 -0
- package/templates/instructions/slides.md +67 -1
- package/templates/instructions/welcome.md +9 -5
- package/templates/playbooks/publish-canvas/PLAYBOOK.md +1 -1
- package/dist/config-BezZTiov.mjs +0 -182
package/docs/live-jam.md
CHANGED
|
@@ -251,6 +251,15 @@ The larger caution is unchanged and worth stating plainly: `marver dev` imports
|
|
|
251
251
|
`design/config.ts`, so running a dev server in a repo you do not trust is already running
|
|
252
252
|
that repo's code. Live Jam adds no new hole to that; it does not make it safe.
|
|
253
253
|
|
|
254
|
+
### A deleted comment (0.31)
|
|
255
|
+
|
|
256
|
+
Delete one of your messages and Jam lets go of it: a request still queued drops it (a card left with no
|
|
257
|
+
request is dropped), and a run that has not been handed to the agent yet - a card is "working" while its
|
|
258
|
+
pictures are taken - has the message taken out of its packet, per message, history included; a frozen packet
|
|
259
|
+
recovered after a restart is rebuilt the same way. Work already handed to an agent cannot unread it: a
|
|
260
|
+
deleted message it read is in that run's context, though its reply never quotes it back. `marver comments
|
|
261
|
+
list` and the context the agent reads never show a deleted message's words.
|
|
262
|
+
|
|
254
263
|
## Provenance
|
|
255
264
|
|
|
256
265
|
Every jam reply is stamped with who acted: your dev user, the harness that ran, and the
|
package/docs/pdf.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Deck PDFs
|
|
2
|
+
|
|
3
|
+
`npx marver pdf <board>` turns a board into a PDF: one page per slide, exactly what the stage shows, with real text you
|
|
4
|
+
can search and copy, vector shapes, and links that click. The running `marver dev` makes it with your own Chrome, so
|
|
5
|
+
what prints is the frame your agent built - fonts, images, charts and all.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npx marver pdf pitch # design/exports/pitch.pdf
|
|
9
|
+
npx marver pdf pitch --notes # design/exports/pitch-notes.pdf - a handout with the speaker notes
|
|
10
|
+
npx marver pdf pitch --theme dark --out ~/Desktop/pitch.pdf
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
On the canvas: **Export PDF** in a board's menu (right-click it in the sidebar), and the export button in slides and
|
|
14
|
+
present mode's toolbar, which prints in the theme the stage shows. A notice shows the page it is on, with Cancel; the
|
|
15
|
+
file downloads when it is done. In the Mac app, **File > Export PDF…** does the same for the open board and asks where
|
|
16
|
+
to save it. App 1.0.1 has no save panel for it: there the notice keeps the finished PDF and offers **Download**, since
|
|
17
|
+
that app drops a download its window did not start while in front. The canvas exports with the
|
|
18
|
+
defaults: the handout (`--notes`), `--paper`, `--raster`, `--vector`, `--keep-going` and `--out` are the command's.
|
|
19
|
+
|
|
20
|
+
## What goes in the PDF
|
|
21
|
+
|
|
22
|
+
- **A slides board** (its publish row plays it as slides) prints its deck: its `slide: true` frames in reading order -
|
|
23
|
+
top to bottom, then left to right - each once, as slides mode plays them. The publish row decides, not the mode you
|
|
24
|
+
are in: a board with no such row prints as any other board below, even from slides mode's export button. A board's
|
|
25
|
+
own type (`"type": "deck"` in its JSON) does not decide it either.
|
|
26
|
+
- **Any other board** prints its frames in the board's order, as Play walks them, html frames included. A slide frame
|
|
27
|
+
is its stage size on any board; any other frame is printed at the device Play shows it at - the viewport whose width
|
|
28
|
+
is its node's on the board, else the frame's own viewport, else the first - at that viewport's height.
|
|
29
|
+
- **Each page is the slide's own size** (1280×720 is 13.33 × 7.5 in), margins zero. A slide taller than its stage is
|
|
30
|
+
cut where the stage cuts it, and the report names it *clipped*.
|
|
31
|
+
- **The finished slide.** Entrances show their end state (the PDF is never "playing"), animations are stopped where
|
|
32
|
+
they end - an infinite one at its first pose, so a spinning mark rests upright - and a video shows its first frame.
|
|
33
|
+
Motion driven by your own `requestAnimationFrame` code cannot be stopped from outside: it prints as it is two frames
|
|
34
|
+
after the slide settles.
|
|
35
|
+
- **Screen styles, not print styles.** `@media print` and Tailwind's `print:` are ignored: the page is the slide you see.
|
|
36
|
+
- **Images at full resolution.** Every image is printed from its original file, never the downscaled copy the canvas
|
|
37
|
+
shows while you zoom.
|
|
38
|
+
- **Bookmarks** - one per page, named by the frame's title - and the PDF's title (the board's), author (the canvas's
|
|
39
|
+
name) and creator (`Marver x.y.z`).
|
|
40
|
+
- **Theme**: `--theme` when you give one, else the theme pinned on the frame's node, else the frame's own, else light.
|
|
41
|
+
|
|
42
|
+
## Effects Chrome cannot print
|
|
43
|
+
|
|
44
|
+
Some CSS effects come out wrong when Chrome prints: a frosted-glass `backdrop-filter` prints transparent, a `filter`,
|
|
45
|
+
`mix-blend-mode` or a CSS `mask` prints as a grey box, a large soft `box-shadow` prints as a hard grey rectangle, and a
|
|
46
|
+
`<canvas>` or `<video>` may print blank. (A `filter` that is only `drop-shadow()` prints right, and is left as it is.)
|
|
47
|
+
Marver fixes each one element by element, and checks its own work:
|
|
48
|
+
|
|
49
|
+
- **Glass** keeps its children live (text, links, icons stay vector and selectable); only the blurred backdrop behind it
|
|
50
|
+
becomes a picture, taken at 3x (lowered for a large slide so one picture stays under 16 megapixels: 2.75x at
|
|
51
|
+
1920×1080, 1x at 4096×4096).
|
|
52
|
+
- **A filtered, blended or masked box, a canvas, a video** becomes a 3x picture of itself, including the shadow or blur
|
|
53
|
+
that spills past its edge; any link inside it stays clickable.
|
|
54
|
+
- **A large soft shadow** is redrawn as a stack of sharp vector shadows that follows the blur's falloff - no picture
|
|
55
|
+
at all.
|
|
56
|
+
- **An effect on the page itself** (a filter or blend on `body` or `html`) has nothing to be patched into: that page is
|
|
57
|
+
printed as a 3x picture, and the report says why. So is an effect under a rotation or a skew.
|
|
58
|
+
|
|
59
|
+
Then the fixed page is compared with the unfixed screenshot, taken before anything was prepared for print. A fix that
|
|
60
|
+
changes more than 1 % of its own area, or anything outside it, is thrown away and that page is printed as a 3x picture
|
|
61
|
+
instead (*raster*). Every printed page is also rasterised (macOS `sips`) and compared with the screen - pixel by pixel,
|
|
62
|
+
allowing only the edge differences two renderers make, and area by area - which catches anything that only goes wrong
|
|
63
|
+
in print: such a page becomes a picture too. Where there is no rasteriser (not on a Mac), the report says *screen-certified only*.
|
|
64
|
+
|
|
65
|
+
`--raster` prints every page as a picture at that same scale (no vector text). `--vector` fixes nothing: every page exactly as Chrome
|
|
66
|
+
prints it (a page whose print differs from the screen is named, and kept).
|
|
67
|
+
|
|
68
|
+
## The report
|
|
69
|
+
|
|
70
|
+
```
|
|
71
|
+
design/exports/mark-ii.pdf - 32 pages, 2.7 MB, 17.8 s
|
|
72
|
+
patched: mark-ii/12-chat (::after mix-blend-mode: soft-light; mask-image), mark-ii/17b-navigation-views (backdrop-filter; box-shadow)
|
|
73
|
+
every page print-certified (rasterised and compared with the screen)
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Each kind of slide that needs a look is named: **skipped** (a frame the manifest no longer lists, or a non-slide frame
|
|
77
|
+
on a slides board), **failed**, **patched** (and with what), **raster** (and why), **unsettled** (still loading images or
|
|
78
|
+
charts after 10 s - printed anyway), **clipped**, **spilled** (Chrome made more than one page; the first is kept),
|
|
79
|
+
**changed while printing** (its source changed while it rendered and again on the second try, or the frame left the
|
|
80
|
+
board), and with `--vector` **printed differently from the screen** (kept as Chrome printed it). The last line says
|
|
81
|
+
whether every page was print-certified, or screen-certified only. `--json` prints all of it, slide by slide, with the
|
|
82
|
+
file's absolute path.
|
|
83
|
+
|
|
84
|
+
A slide that fails to render fails the export - a PDF is never handed over with a page missing. `--keep-going` prints
|
|
85
|
+
the rest and leaves the failed page blank, named in the report. The command then exits 1, though the PDF is written.
|
|
86
|
+
|
|
87
|
+
## The handout (`--notes`)
|
|
88
|
+
|
|
89
|
+
`--notes` prints a handout instead: each slide's picture, its title, and its notes (the frame's `.note.md`, rendered as
|
|
90
|
+
Markdown at 11 pt or more) - "No notes" where there are none. Long notes continue on the next page. Letter landscape by
|
|
91
|
+
default, `--paper a4` for A4. Page numbers in the footer, a bookmark per slide. The slides in a handout are pictures:
|
|
92
|
+
the deck PDF is the one you search.
|
|
93
|
+
|
|
94
|
+
## What it does not do
|
|
95
|
+
|
|
96
|
+
- **Not a tagged (accessible) PDF**: the pages are merged with pdf-lib, which keeps each page but not Chrome's structure
|
|
97
|
+
tree. The handout, printed as one document, is tagged.
|
|
98
|
+
- **Links between slides** (`data-goto`) do not carry over; `https:` and `mailto:` links do.
|
|
99
|
+
- **Published canvases** cannot export: the build has no browser. Export from `marver dev`.
|
|
100
|
+
- A CJK character may copy out of the PDF as its compatibility form (a Kangxi radical) - how Chrome's font subsets map
|
|
101
|
+
it; it displays and prints right.
|
|
102
|
+
|
|
103
|
+
## Limits
|
|
104
|
+
|
|
105
|
+
One PDF at a time per canvas (a second is refused, naming the one running). 300 pages at most, a page side of 4096 CSS
|
|
106
|
+
px at most, 15 minutes, 500 MB. The job's folder (`design/.local/pdf/`) keeps only the finished file, for an hour, and
|
|
107
|
+
is emptied when `marver dev` starts. `marver init` keeps `design/exports/` out of git. The Mac app saves a PDF of 200 MB
|
|
108
|
+
at most; a larger one says "not saved (too-large)": export it with `npx marver pdf`.
|
package/docs/publish.md
CHANGED
|
@@ -251,14 +251,14 @@ mention from the page metadata, the sign-in screens included).
|
|
|
251
251
|
|
|
252
252
|
### Name the canvas
|
|
253
253
|
|
|
254
|
-
`
|
|
255
|
-
labels the brand pill,
|
|
256
|
-
canvas emits, so site analytics can tell which
|
|
257
|
-
falls back to your `package.json` name and the
|
|
258
|
-
directory name - which inside a container is usually `app`, so
|
|
259
|
-
containerised canvas reports as one campaign.
|
|
260
|
-
|
|
261
|
-
Your logo - `share.logo`, else the first of `design/logo.svg|png`, `public/logo.svg|png`
|
|
254
|
+
`name: "Your App"` in `design/config.ts` (`share: { name }` still works; `name` wins). That
|
|
255
|
+
name titles the gate, labels the brand pill, names the canvas in the Mac app, and becomes
|
|
256
|
+
`utm_campaign` on every powered-by link the canvas emits, so site analytics can tell which
|
|
257
|
+
canvas sent a visitor. Unset, the gate falls back to your `package.json` name and the
|
|
258
|
+
canvas shell to the root directory name - which inside a container is usually `app`, so
|
|
259
|
+
every unnamed containerised canvas reports as one campaign.
|
|
260
|
+
|
|
261
|
+
Your logo - `logo` in the config, else `share.logo`, else the first of `design/logo.svg|png`, `public/logo.svg|png`
|
|
262
262
|
and `public/favicon.svg|png|ico` - ships with the build. The gate shows it, and since
|
|
263
263
|
0.29 it is the only tab icon of the canvas and the gate, so a browser tab (and the Mac
|
|
264
264
|
app's tab for a shared canvas) wears it rather than Marver's mark. With no logo, the tab
|
|
@@ -283,7 +283,7 @@ Deploy. The repo itself is the deployable - nothing to export, nothing to sync.
|
|
|
283
283
|
FROM node:22-slim
|
|
284
284
|
RUN apt-get update && apt-get install -y --no-install-recommends chromium fonts-liberation \
|
|
285
285
|
&& rm -rf /var/lib/apt/lists/* # the browser `marver build` compiles the glass textures with
|
|
286
|
-
WORKDIR /app # set
|
|
286
|
+
WORKDIR /app # set name in design/config.ts - the fallback name is this directory
|
|
287
287
|
COPY . .
|
|
288
288
|
RUN npm ci && npx marver build # as root in a container: marver adds Chrome's --no-sandbox itself
|
|
289
289
|
ENV PORT=8080
|
package/docs/sharing.md
CHANGED
|
@@ -276,6 +276,17 @@ board". Note the gate's own entry check short-circuits step 1 for the owner - th
|
|
|
276
276
|
owner is always admitted so the canvas can be administered - which is the one
|
|
277
277
|
place the blocklist does not have the last word.
|
|
278
278
|
|
|
279
|
+
### What `comment` lets a person do with a thread
|
|
280
|
+
|
|
281
|
+
Anyone with `comment` on a board may write, reply, react, and **resolve or reopen any thread** on it - not only
|
|
282
|
+
their own. Editing and deleting a message stays its author's: the canvas compares the address of whoever wrote
|
|
283
|
+
the original comment or reply with the signed-in account's (0.31 adds delete; a deleted message's replies stay,
|
|
284
|
+
under "Comment deleted"). A canvas older than 0.31 takes no deletes: a delete made on your machine waits there,
|
|
285
|
+
held back by `marver dev`'s sync, until the canvas is upgraded, and its shell offers no Delete. Connected under a new
|
|
286
|
+
address, an edit or delete of a comment the old address wrote (or anything still signed with the old address) stays on
|
|
287
|
+
your machine - the canvas would refuse it - and `marver comments sync` says so ("1 edit kept local: its comment was
|
|
288
|
+
written under another account"); everything else still syncs.
|
|
289
|
+
|
|
279
290
|
## Mail, mentions, and the bell (v1.1)
|
|
280
291
|
|
|
281
292
|
Sharing's mail rides one relay at the identity service, and the canvas can only
|
package/docs/slides.md
CHANGED
|
@@ -59,7 +59,8 @@ Press `p` on a board whose publish row says slides and you get slides mode:
|
|
|
59
59
|
the stage scaled to the window, the standard prototype toolbars (with
|
|
60
60
|
`chrome: full`, the default), arrows / Space / click to advance, `d` cycles
|
|
61
61
|
the theme, and two views of the stage: Slide (fit to the window, room for
|
|
62
|
-
the chrome) and Fill window (edge to edge).
|
|
62
|
+
the chrome) and Fill window (edge to edge). `h` hides the chrome; in the Mac app (1.2) it hides the tab
|
|
63
|
+
strip too and the stage grows into the window ([Hide UI in play](app.md#hide-ui-in-play)). Publish it with:
|
|
63
64
|
|
|
64
65
|
```json
|
|
65
66
|
{ "boards": { "pitch": { "max": "comment", "type": "slides",
|
|
@@ -79,6 +80,15 @@ the chrome) and Fill window (edge to edge). Publish it with:
|
|
|
79
80
|
|
|
80
81
|
Viewers land straight in the deck; the URL survives refresh and back.
|
|
81
82
|
|
|
83
|
+
## A deck as a PDF
|
|
84
|
+
|
|
85
|
+
`npx marver pdf <board>` writes `design/exports/<board>.pdf`: one page per slide in the deck's order, vector text and
|
|
86
|
+
shapes, links that click, a bookmark per slide. The deck's order needs the board's publish row above (`"type": "slides"`
|
|
87
|
+
or `"open": "slides"`); without it the PDF prints every frame, in the board's order. **Export PDF** in the board's menu and in slides mode's toolbar do the
|
|
88
|
+
same from the canvas, and `--notes` prints a handout with each slide's notes. Glass, filters, blends, masks and large
|
|
89
|
+
soft shadows - the effects Chrome prints wrong - are fixed slide by slide and checked against the screen. See
|
|
90
|
+
[Deck PDFs](pdf.md).
|
|
91
|
+
|
|
82
92
|
## Motion
|
|
83
93
|
|
|
84
94
|
Motion is yours to write. While a deck plays, the stage puts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marver-design/marver",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "The agent-native design canvas. A design/ folder, one command, a canvas of live frames built from your repo's real components - comment @marver and your own coding agent does the work. The tool ships no AI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
"magic-string": "^0.30.21",
|
|
54
54
|
"marked": "^16.0.0",
|
|
55
55
|
"mermaid": "^11.6.0",
|
|
56
|
+
"pdf-lib": "1.17.1",
|
|
56
57
|
"react-zoom-pan-pinch": "^3.6.1",
|
|
57
58
|
"roughjs": "^4.6.6",
|
|
58
59
|
"vite": "~8.2.1",
|
|
@@ -68,6 +69,7 @@
|
|
|
68
69
|
"@types/react": "^19.0.0",
|
|
69
70
|
"@types/react-dom": "^19.0.0",
|
|
70
71
|
"@types/ws": "^8.18.2",
|
|
72
|
+
"pdfjs-dist": "4.10.38",
|
|
71
73
|
"tsdown": "^0.22.0",
|
|
72
74
|
"typescript": "^5.7.0",
|
|
73
75
|
"vitest": "^3.0.0"
|
|
@@ -168,10 +168,12 @@ export function Img({ src, caption, alt, h }: { src: string; caption?: string; a
|
|
|
168
168
|
// and a bitmap decoded for the frame's own box would blur there - the plain <img> keeps
|
|
169
169
|
// its full resolution. A slide frame is marked on <html> (data-mv-slide) before it renders.
|
|
170
170
|
const inSlide = useInSlide() || (typeof document !== 'undefined' && document.documentElement.hasAttribute('data-mv-slide'))
|
|
171
|
+
// a deck PDF's render (frame host `export=1`, spec 31 #5): the original image, loaded now - never an LOD bucket
|
|
172
|
+
const exporting = typeof document !== 'undefined' && document.documentElement.hasAttribute('data-mv-export')
|
|
171
173
|
// LOD: paint the image on a <canvas> decoded to its on-screen size (never the full 17MB bitmap), and
|
|
172
174
|
// re-pick resolution only when the canvas settles after a zoom. See img-lod.ts. Falls back to a plain
|
|
173
175
|
// <img> where createImageBitmap/bitmaprenderer isn't available (correctness over the optimization).
|
|
174
|
-
const lodOn = lodSupported && !inSlide
|
|
176
|
+
const lodOn = lodSupported && !inSlide && !exporting
|
|
175
177
|
useEffect(() => {
|
|
176
178
|
if (!url || err || !lodOn || !canvasRef.current) return
|
|
177
179
|
return registerLodImage(canvasRef.current, url)
|
|
@@ -196,7 +198,7 @@ export function Img({ src, caption, alt, h }: { src: string; caption?: string; a
|
|
|
196
198
|
<figure className="mv-block mv-img">
|
|
197
199
|
{lodOn
|
|
198
200
|
? <canvas ref={canvasRef} className="mv-img-el" role="img" aria-label={alt ?? caption ?? ''} style={style} />
|
|
199
|
-
: <img className="mv-img-el" src={url} alt={alt ?? caption ?? ''} loading=
|
|
201
|
+
: <img className="mv-img-el" src={url} alt={alt ?? caption ?? ''} loading={exporting ? 'eager' : 'lazy'} style={style} onError={() => setErr(true)} />}
|
|
200
202
|
{caption && <figcaption>{caption}</figcaption>}
|
|
201
203
|
</figure>
|
|
202
204
|
)
|
|
@@ -21,6 +21,9 @@ const theme = params.get('theme') ?? 'light'
|
|
|
21
21
|
// data attribute). The bridge applies the same pair on sh:set-theme.
|
|
22
22
|
document.documentElement.dataset.theme = theme
|
|
23
23
|
document.documentElement.classList.toggle('dark', theme === 'dark')
|
|
24
|
+
// a deck PDF's render (spec 31 #5): `export=1` says so on the document - Img decodes every image from its original
|
|
25
|
+
// (no LOD canvas, nothing bucketed or capped at dpr 2), on any board, slide or not
|
|
26
|
+
if (params.get('export') === '1') document.documentElement.setAttribute('data-mv-export', '')
|
|
24
27
|
|
|
25
28
|
const post = (msg: Record<string, unknown>) => { if (window.parent !== window) window.parent.postMessage(msg, '*') }
|
|
26
29
|
// this document's id, set by the bridge (imported first, above) before anything is posted - and the URL revision the
|
package/src/client/shell/App.tsx
CHANGED
|
@@ -16,24 +16,29 @@ import { Tip } from './Tip.tsx'
|
|
|
16
16
|
import { PKG, ROUTE } from '../const.ts'
|
|
17
17
|
import { api, resumed, scoped, useLink } from './api.ts'
|
|
18
18
|
import { animateLayout, Canvas, canvasCtl } from './canvas/Canvas.tsx'
|
|
19
|
+
import { bootCancelled } from './canvas/ctl.ts'
|
|
19
20
|
import { frameByWindow, fromLiveDocument } from './canvas/frame-registry.ts'
|
|
20
21
|
import { recorder } from './recorder.ts'
|
|
21
22
|
import { perfSeams } from './recorder-seams.ts'
|
|
22
23
|
import { takeNavToken } from './recorder-reloads.ts'
|
|
23
24
|
import { cmd, endAfterFrames, endOnCamera, endOnLoad, endOnStage, foldsIntoSave, keysOf, shellReload, type CmdHandle, type CmdOpts } from './commands.ts'
|
|
24
25
|
import { enterFocus, enterPlay, enterSlides, playCtl, PlayOverlay } from './Play.tsx'
|
|
26
|
+
import { PdfNotice } from './pdf-export.tsx'
|
|
25
27
|
import { bootHash, linkTargets, parseHash, retargetBoot, UNPLACED, writeHash } from './hash.ts'
|
|
26
28
|
import { isLegacyLink, landLegacy } from './legacy-links.ts'
|
|
27
|
-
import { CaretIcon, CheckIcon, ColumnsIcon, FrameRectIcon, ImagesSquareIcon, IntentGlyph, MoonIcon, PanelFilledIcon, PanelHollowIcon, ParallelogramDuoIcon, ParallelogramFillIcon, PencilSimpleIcon, PlayIcon, PlusIcon, SignpostIcon, SlideFrameIcon, SunIcon, VariantsIcon, XIcon
|
|
29
|
+
import { CaretIcon, CheckIcon, CheckSquareOffsetIcon, ColumnsIcon, FrameRectIcon, ImagesSquareIcon, IntentGlyph, MoonIcon, PanelFilledIcon, PanelHollowIcon, ParallelogramDuoIcon, ParallelogramFillIcon, PencilSimpleIcon, PlayIcon, PlusIcon, SignpostIcon, SlideFrameIcon, SunIcon, VariantsIcon, XIcon } from './icons.tsx'
|
|
30
|
+
import { deviceIcon, deviceLabel } from './devices.tsx'
|
|
28
31
|
import { ALL_SCENES, humanize as slugLabel, readTitle } from '../../shared/board-tree.ts'
|
|
29
|
-
import { CommentsController, parkThread, revealThread } from './Comments.tsx'
|
|
32
|
+
import { cardSelectAll, CommentsController, parkThread, revealThread } from './Comments.tsx'
|
|
30
33
|
import { poweredByUrl } from '../../shared/utm.ts'
|
|
31
34
|
import { avatarFallback, NO_COMMENTS_HERE, useComments } from './comments-store.ts'
|
|
32
|
-
import { goTo, isLatest, navigated, revealFrame, switchFor } from './goto.ts'
|
|
35
|
+
import { goTo, isLatest, navigated, navigatedByHand, navNow, revealFrame, switchFor, watchHands } from './goto.ts'
|
|
36
|
+
import { bootSettled, dismissShow, goNow, showTarget, useShowNotice } from './show.ts'
|
|
37
|
+
import { newerVersion } from '../../shared/deep-link.ts'
|
|
33
38
|
import { useNotes } from './notes.ts'
|
|
34
39
|
import { contentOnly } from '../../shared/frames.ts'
|
|
35
40
|
import { nextToLook } from '../../shared/marks.ts'
|
|
36
|
-
import { asksNow, Bubble, MarkedRow, markSeenFrom, useRollup, useSeenOnScreen } from './marks-ui.tsx'
|
|
41
|
+
import { asksNow, Bubble, MarkedRow, markSeenFrom, resolveAllFrom, useRollup, useSeenOnScreen } from './marks-ui.tsx'
|
|
37
42
|
import { CommentButton, DevicePicker, HideUIButton, LaserButton, Popover, ThemePicker, toggleHideUI, usePopover } from './Toolbar.tsx'
|
|
38
43
|
|
|
39
44
|
const commentsStore = () => useComments.getState()
|
|
@@ -190,9 +195,9 @@ function SelectionBar() {
|
|
|
190
195
|
{Object.entries(CONFIG.viewports).map(([name, vp], vi) => {
|
|
191
196
|
const active = node.w === vp.width
|
|
192
197
|
return (
|
|
193
|
-
<Tip key={name} label={<><b>{
|
|
194
|
-
<button className={active ? 'on' : 'icon'} onClick={() => applyDevice(name)}>
|
|
195
|
-
{deviceIcon(name, 15)}{active && <span>{
|
|
198
|
+
<Tip key={name} label={<><b>{deviceLabel(name)}</b><span>{vp.width} × {vp.height}</span><span className="k">{vi + 1}</span></>}>
|
|
199
|
+
<button className={active ? 'on' : 'icon'} onClick={() => applyDevice(name)} aria-label={deviceLabel(name)}>
|
|
200
|
+
{deviceIcon(name, 15)}{active && <span>{deviceLabel(name)}</span>}
|
|
196
201
|
</button>
|
|
197
202
|
</Tip>
|
|
198
203
|
)
|
|
@@ -259,7 +264,7 @@ function DeviceMenu() {
|
|
|
259
264
|
const active = scoped
|
|
260
265
|
? entries.find(([, vp]) => selNodes.length > 0 && selNodes.every((n) => n.w === vp.width))?.[0] ?? null
|
|
261
266
|
: deviceView
|
|
262
|
-
const hint = scoped ? `${selection.length} selected` : deviceView ?
|
|
267
|
+
const hint = scoped ? `${selection.length} selected` : deviceView ? deviceLabel(deviceView) : `keys 1-${entries.length}`
|
|
263
268
|
return <DevicePicker value={active} onSelect={pick} includeDefault hint={hint} />
|
|
264
269
|
}
|
|
265
270
|
|
|
@@ -274,7 +279,8 @@ function UpdatePill() {
|
|
|
274
279
|
api('update')
|
|
275
280
|
.then((r) => (r.ok ? r.json() : null))
|
|
276
281
|
.then((u) => {
|
|
277
|
-
|
|
282
|
+
// spec 31 E4: the endpoint answers whatever the registry said - the pill only for a strictly newer release
|
|
283
|
+
if (u?.latest && newerVersion(u.latest, u.current) && localStorage.getItem(scoped('mv-update-seen')) !== u.latest) setLatest(u.latest)
|
|
278
284
|
})
|
|
279
285
|
.catch(() => { /* dev server gone or endpoint absent - stay quiet */ })
|
|
280
286
|
}, [])
|
|
@@ -304,6 +310,22 @@ function UpdatePill() {
|
|
|
304
310
|
)
|
|
305
311
|
}
|
|
306
312
|
|
|
313
|
+
/** `marver show` over unsent words (spec 31 D3): the tab did not move - Go moves it, × leaves it be. */
|
|
314
|
+
function ShowNotice() {
|
|
315
|
+
const notice = useShowNotice((s) => s.notice)
|
|
316
|
+
// in Play too: a draft typed there keeps the canvas where it is, and the notice says why (it sits over Play)
|
|
317
|
+
if (!notice) return null
|
|
318
|
+
return (
|
|
319
|
+
<div className="sh-update sh-show-notice" role="status">
|
|
320
|
+
<span>Your agent wants to show you <b>{notice.title}</b></span>
|
|
321
|
+
<button className="cmd" onClick={() => { const h = cmd('show-go', { via: 'click', in: 'shell' }); void goNow().then((r) => { if (r !== 'shown') h.cancel() }) }}><code>Go</code></button>
|
|
322
|
+
<Tip side="top" label="Stay here">
|
|
323
|
+
<button className="x" onClick={() => { cmd('show-dismiss', { via: 'click', in: 'shell' }); dismissShow() }}><XIcon size={13} /></button>
|
|
324
|
+
</Tip>
|
|
325
|
+
</div>
|
|
326
|
+
)
|
|
327
|
+
}
|
|
328
|
+
|
|
307
329
|
const ZOOMS = [2, 1.5, 1, 0.5, 0.25, 0.1]
|
|
308
330
|
|
|
309
331
|
/** Zoom preset dropdown on the percentage readout. */
|
|
@@ -318,15 +340,15 @@ function ZoomMenu() {
|
|
|
318
340
|
</Tip>
|
|
319
341
|
<Popover pop={pop}>
|
|
320
342
|
{ZOOMS.map((z) => (
|
|
321
|
-
<button key={z} onClick={() => go(() => { cmd('zoom-to', { via: 'click', in: 'pill' }); canvasCtl.zoomTo(z) })}>
|
|
343
|
+
<button key={z} onClick={() => go(() => { cmd('zoom-to', { via: 'click', in: 'pill' }); navigatedByHand(); canvasCtl.zoomTo(z) })}>
|
|
322
344
|
<span>{z * 100}%</span>
|
|
323
345
|
{z === 1 && <kbd>⇧0</kbd>}
|
|
324
346
|
{Math.abs(scale - z) < 0.03 && <CheckIcon size={13} className="chk" />}
|
|
325
347
|
</button>
|
|
326
348
|
))}
|
|
327
349
|
<i className="div" />
|
|
328
|
-
<button onClick={() => go(() => { cmd('fit-all', { via: 'click', in: 'pill' }); canvasCtl.fitAll() })}><span>Fit all</span><kbd>⇧1</kbd></button>
|
|
329
|
-
<button onClick={() => go(() => { const h = cmd('fit-selection', { via: 'click', in: 'pill' }); const k = useStore.getState().selection; if (k.length) canvasCtl.fitNodes(k); else h.noop('no-selection') })}>
|
|
350
|
+
<button onClick={() => go(() => { cmd('fit-all', { via: 'click', in: 'pill' }); navigatedByHand(); canvasCtl.fitAll() })}><span>Fit all</span><kbd>⇧1</kbd></button>
|
|
351
|
+
<button onClick={() => go(() => { const h = cmd('fit-selection', { via: 'click', in: 'pill' }); const k = useStore.getState().selection; navigatedByHand(); if (k.length) canvasCtl.fitNodes(k); else h.noop('no-selection') })}>
|
|
330
352
|
<span>Fit selection</span><kbd>⇧2</kbd>
|
|
331
353
|
</button>
|
|
332
354
|
</Popover>
|
|
@@ -445,8 +467,8 @@ export function App() {
|
|
|
445
467
|
else if (resumed?.outcome === 'gone') toast(BOARD_GONE)
|
|
446
468
|
urlReady.current = true
|
|
447
469
|
// a link naming frames on a board with NO nodes: the canvas's boot fit never runs (it waits
|
|
448
|
-
// for the first frame) - follow the frame to where it lives from here
|
|
449
|
-
if (ok && bootHash.f?.length && !bootHash.focus && !useStore.getState().nodes.length) void revealFrame(bootHash.f[0])
|
|
470
|
+
// for the first frame) - follow the frame to where it lives from here, under the boot's own navigation
|
|
471
|
+
if (ok && bootHash.f?.length && !bootHash.focus && !useStore.getState().nodes.length) void revealFrame(bootHash.f[0], navNow(), () => !bootCancelled())
|
|
450
472
|
if (ok && bootHash.focus) {
|
|
451
473
|
// a frame deep link forces focus for that visit, over every other rule
|
|
452
474
|
// (01-sharing §6.1 step 3) - the stage mounts any manifest frame, so no
|
|
@@ -463,6 +485,9 @@ export function App() {
|
|
|
463
485
|
else if (mode === 'focus') enterFocus()
|
|
464
486
|
else if (mode === 'slides') enterSlides()
|
|
465
487
|
}
|
|
488
|
+
// a show that came during the boot applies once it settled - loaded or failed, its mode (focus, play, slides)
|
|
489
|
+
// entered first, so nothing of the boot lands after it (spec 31 D3)
|
|
490
|
+
bootSettled(ok)
|
|
466
491
|
}
|
|
467
492
|
void start()
|
|
468
493
|
}, [])
|
|
@@ -629,10 +654,15 @@ export function App() {
|
|
|
629
654
|
}
|
|
630
655
|
}, [])
|
|
631
656
|
|
|
657
|
+
// every input of the person's: a show or app link still loading gives way to it (spec 31 D3, goto.ts watchHands)
|
|
658
|
+
useEffect(() => watchHands(), [])
|
|
659
|
+
|
|
632
660
|
// live updates from the dev server (source-served shell has import.meta.hot)
|
|
633
661
|
useEffect(() => {
|
|
634
662
|
if (!import.meta.hot) return
|
|
635
663
|
import.meta.hot.on('sh:manifest', (m: any) => applyManifest(m))
|
|
664
|
+
// `marver show` (spec 31 D3): the place an agent shows the human - moved to, or a notice over unsent words
|
|
665
|
+
import.meta.hot.on('sh:show', (m: any) => { void showTarget(m, 'server') })
|
|
636
666
|
// a brief's title or description changed with the frames intact: relabel, never re-key
|
|
637
667
|
import.meta.hot.on('sh:scenes', (m: any) => useStore.getState().setScenes(m?.scenes))
|
|
638
668
|
// Live Jam presence: the daemon broadcasts the set of frames Marver is editing.
|
|
@@ -695,7 +725,8 @@ export function App() {
|
|
|
695
725
|
perfSeams.frameMessage.emit(nodeKey, data)
|
|
696
726
|
// Jam (spec 27): a capture's trail, handshake, probes and flushes; a key the shell owns
|
|
697
727
|
if (onFrameMessage(nodeKey, data)) return
|
|
698
|
-
|
|
728
|
+
// a key the frame forwards: the person's, so a show or link still loading gives way (spec 31 D3)
|
|
729
|
+
if (data.type === 'sh:key') { if (typeof data.key === 'string') { navigatedByHand(); jamKey({ key: data.key, shift: !!data.shift, alt: !!data.alt, meta: !!data.meta, ctrl: !!data.ctrl }, 'frame') } return }
|
|
699
730
|
|
|
700
731
|
if (data.type === 'sh:ready') {
|
|
701
732
|
// a WindowProxy survives navigation, so a ready queued by a SUPERSEDED document (one the
|
|
@@ -819,7 +850,9 @@ export function App() {
|
|
|
819
850
|
const how = (k = e.key): CmdOpts => ({ via: 'key', in: 'shell', keys: keysOf(e, k) })
|
|
820
851
|
if ((e.metaKey || e.ctrlKey) && e.key === '\\') { e.preventDefault(); cmd('panel', how()); togglePanel(); return }
|
|
821
852
|
if ((e.metaKey || e.ctrlKey) && e.key === '/') { e.preventDefault(); cmd('toolbar', how()); setPillOpen((o) => !o); return }
|
|
822
|
-
|
|
853
|
+
// ⌘A in a comment card selects its words, not every frame (spec 31 C.1)
|
|
854
|
+
if ((e.metaKey || e.ctrlKey) && e.key === 'a' && cardSelectAll()) { e.preventDefault(); cmd('thread-select-all', how()); return }
|
|
855
|
+
if ((e.metaKey || e.ctrlKey) && e.key === 'a') { e.preventDefault(); cmd('select-all', how()); navigatedByHand(); s.selectAll(); return }
|
|
823
856
|
if (e.metaKey || e.ctrlKey) return
|
|
824
857
|
if (e.key === 'Escape') {
|
|
825
858
|
const c = commentsStore()
|
|
@@ -827,7 +860,7 @@ export function App() {
|
|
|
827
860
|
if (c.commentMode || c.active || c.draft) { h.step('comments-off'); c.setMode(false); c.setActive(null); c.setDraft(null) }
|
|
828
861
|
else if (s.laser) { h.step('laser-off'); s.setLaser(false) } // Escape also exits laser mode (parity with comment)
|
|
829
862
|
else if (s.interact) { h.step('interact-off'); setInteract(null) }
|
|
830
|
-
else { h.step('deselect'); select(null) }
|
|
863
|
+
else { h.step('deselect'); navigatedByHand(); select(null) }
|
|
831
864
|
endAfterFrames(h)
|
|
832
865
|
}
|
|
833
866
|
// a slides board PLAYS as slides even when its landing is the canvas -
|
|
@@ -869,7 +902,8 @@ export function App() {
|
|
|
869
902
|
const from = s.selection.length ? s.nodes.find((n) => n.key === s.selection[s.selection.length - 1])?.frame ?? null : null
|
|
870
903
|
const id = nextToLook(s.marks, asksNow(), [...new Set(live.map((n) => n.frame))], from)
|
|
871
904
|
const n = id ? live.find((x) => x.frame === id) : null
|
|
872
|
-
|
|
905
|
+
// a person's navigation: a show still waiting or loading gives way (spec 31 D3)
|
|
906
|
+
if (n) { navigated(); s.select(n.key); canvasCtl.fitNode(n.key) } else { h.noop('nothing-new'); toast('nothing new on this board') }
|
|
873
907
|
return
|
|
874
908
|
}
|
|
875
909
|
if (e.key === 'n' && !e.shiftKey) { cmd('notes', how()); const visible = document.querySelectorAll('.sh-notes:not(.off)').length > 0; useNotes.getState().toggleAll(visible); toast(visible ? 'notes hidden' : 'notes shown'); return }
|
|
@@ -911,9 +945,10 @@ export function App() {
|
|
|
911
945
|
s.setTheme(CONFIG.themes[(CONFIG.themes.indexOf(s.viewTheme) + 1) % CONFIG.themes.length])
|
|
912
946
|
}
|
|
913
947
|
}
|
|
914
|
-
|
|
915
|
-
if (e.shiftKey && e.code === '
|
|
916
|
-
if (e.shiftKey && e.code === '
|
|
948
|
+
// a person's camera (spec 31 D3): a show or link still loading gives way
|
|
949
|
+
if (e.shiftKey && e.code === 'Digit0') { cmd('zoom-100', how('0')); navigatedByHand(); canvasCtl.zoom100() }
|
|
950
|
+
if (e.shiftKey && e.code === 'Digit1') { cmd('fit-all', how('1')); navigatedByHand(); canvasCtl.fitAll() }
|
|
951
|
+
if (e.shiftKey && e.code === 'Digit2') { const h = cmd('fit-selection', how('2')); navigatedByHand(); if (s.selection.length) canvasCtl.fitNodes(s.selection); else h.noop('no-selection') }
|
|
917
952
|
// plain digits: 0 = default, 1..n = devices. Scoped to the selection when one
|
|
918
953
|
// exists, board-wide otherwise. Every path tidies - presets never scramble layout.
|
|
919
954
|
if (!e.shiftKey && /^Digit[0-9]$/.test(e.code)) {
|
|
@@ -1026,11 +1061,14 @@ export function App() {
|
|
|
1026
1061
|
? `board: ${useStore.getState().board} · scene: ${sc.name} (design/scenes/${sc.name}/)`
|
|
1027
1062
|
: `board: ${useStore.getState().board} · scene: (root)`, 'path copied', cmd('copy-path', { via: 'context', in: 'shell' })),
|
|
1028
1063
|
}, ...(!PUBLISHED && sc.name ? [{ label: 'Rename', icon: <PencilSimpleIcon size={15} />, onClick: () => setSceneNaming(sc.name) }] : []),
|
|
1029
|
-
...(!PUBLISHED ? [{ label: 'Mark all as seen', icon: <CheckIcon size={15} />, onClick: () => markSeenFrom({ via: 'context', in: 'shell' }, frames.filter((f) => f.scene === sc.name).map((f) => f.id)) }] : [])
|
|
1064
|
+
...(!PUBLISHED ? [{ label: 'Mark all as seen', icon: <CheckIcon size={15} />, onClick: () => markSeenFrom({ via: 'context', in: 'shell' }, frames.filter((f) => f.scene === sc.name).map((f) => f.id)) }] : []),
|
|
1065
|
+
// ...and Resolve all comments on that scene's frames (spec 31 B.1) - the root scene's ('') too
|
|
1066
|
+
...(!PUBLISHED ? [{ label: 'Resolve all comments', icon: <CheckSquareOffsetIcon size={15} />, onClick: () => void resolveAllFrom({ via: 'context', in: 'shell' }, { scene: sc.name }) }] : [])])}
|
|
1030
1067
|
onPick={() => {
|
|
1031
1068
|
const keys = nodes.filter((n) => frames.some((f) => f.scene === sc.name && f.id === n.frame) && !n.missing).map((n) => n.key)
|
|
1032
1069
|
cmd('scene-pick', { via: 'click', in: 'shell', frames: keys.length })
|
|
1033
1070
|
if (!keys.length) return
|
|
1071
|
+
navigated() // a person's navigation: a show still waiting or loading gives way (spec 31 D3)
|
|
1034
1072
|
useStore.getState().selectMany(keys)
|
|
1035
1073
|
canvasCtl.fitNodes(keys)
|
|
1036
1074
|
}}>
|
|
@@ -1058,6 +1096,7 @@ export function App() {
|
|
|
1058
1096
|
const n = nodeFor(id)
|
|
1059
1097
|
if (!n) return
|
|
1060
1098
|
cmd('frame-pick', { via: 'click', in: 'shell', frame: id })
|
|
1099
|
+
navigated() // a person's navigation: a show still waiting or loading gives way (spec 31 D3)
|
|
1061
1100
|
select(n.key, shift)
|
|
1062
1101
|
if (!shift) canvasCtl.fitNode(n.key)
|
|
1063
1102
|
}
|
|
@@ -1087,7 +1126,7 @@ export function App() {
|
|
|
1087
1126
|
rows.push(
|
|
1088
1127
|
<div key={`g:${f.variantGroup}`} className={`sub vgroup${allOn ? ' on' : ''}${held ? ' held' : ''}`}
|
|
1089
1128
|
title="Select all variants"
|
|
1090
|
-
onClick={() => { cmd('group-fit', { via: 'click', in: 'shell', frames: memberKeys.length }); useStore.getState().selectMany(memberKeys); canvasCtl.fitNodes(memberKeys) }}>
|
|
1129
|
+
onClick={() => { cmd('group-fit', { via: 'click', in: 'shell', frames: memberKeys.length }); navigated(); useStore.getState().selectMany(memberKeys); canvasCtl.fitNodes(memberKeys) }}>
|
|
1091
1130
|
<VariantsIcon size={13} className="iicon" />
|
|
1092
1131
|
<span className="glabel">{rel}</span>
|
|
1093
1132
|
</div>,
|
|
@@ -1176,6 +1215,7 @@ export function App() {
|
|
|
1176
1215
|
: CONFIG.noTheme && !contentOnly(manifest?.frames ?? []) && <div className="sh-banner">no theme configured - frames render unstyled. Create design/theme.css importing your app's stylesheet (or set theme in design/config.ts)</div>}
|
|
1177
1216
|
{stopped && <StoppedBanner />}
|
|
1178
1217
|
<UpdatePill />
|
|
1218
|
+
<ShowNotice />
|
|
1179
1219
|
|
|
1180
1220
|
{/* Jam V2 (spec 27): the lane, the focus panel, the notes card, the recording ring */}
|
|
1181
1221
|
{!PUBLISHED && <JamSurface sidebarRight={panelOpen ? 236 + 2 * 10 : 10} />}
|
|
@@ -1316,7 +1356,13 @@ function JamToasts({ toasts }: { toasts: import('./store.ts').Toast[] }) {
|
|
|
1316
1356
|
const newest = jams[jams.length - 1]
|
|
1317
1357
|
return (
|
|
1318
1358
|
<div className="sh-toasts">
|
|
1319
|
-
|
|
1359
|
+
<PdfNotice />
|
|
1360
|
+
{/* the last two - and a notice with an action (Undo) stays among them while it lasts */}
|
|
1361
|
+
{(() => { const act = plain.filter((t) => t.action).slice(-1); return [...plain.filter((t) => !t.action).slice(act.length ? -1 : -2), ...act].sort((a, b) => a.id - b.id) })().map((t) => (
|
|
1362
|
+
<div key={t.id} className="sh-toast" data-toast={t.action?.id}><CheckIcon size={12} /> {t.text}
|
|
1363
|
+
{t.action && <button className="sh-toast-act" onClick={() => { const a = t.action!; useStore.getState().dropToast(t.id); a.run() }}>{t.action.label}</button>}
|
|
1364
|
+
</div>
|
|
1365
|
+
))}
|
|
1320
1366
|
{expanded && jams.length > 2 && (
|
|
1321
1367
|
<div className="sh-jam-list">
|
|
1322
1368
|
<div className="sh-jam-listhead">
|
|
@@ -1354,6 +1400,7 @@ function JamAvatar({ author }: { author: { name?: string; avatar?: string; id?:
|
|
|
1354
1400
|
* note's origin board and retry while its comments load. Dismiss only on success: a
|
|
1355
1401
|
* cross-board note must never be a destructive no-op. */
|
|
1356
1402
|
async function viewNote(note: import('./store.ts').JamNote, dismiss: () => void, h: CmdHandle) {
|
|
1403
|
+
navigatedByHand() // the person chose View (spec 31 D3): a show or link still loading gives way
|
|
1357
1404
|
if (revealThread(note.threadId)) { h.done(); dismiss(); return }
|
|
1358
1405
|
const s = useStore.getState()
|
|
1359
1406
|
// a navigation: a link still finding its board gives way to it - and it to a newer one, wherever this one has got to
|
|
@@ -9,11 +9,12 @@ import { PHASE_LABEL, STATUS_LABEL } from '../../shared/status.ts'
|
|
|
9
9
|
import { canvasCtl } from './canvas/Canvas.tsx'
|
|
10
10
|
import { isLatest, navigated, switchFor } from './goto.ts'
|
|
11
11
|
import { rollup } from '../../shared/marks.ts'
|
|
12
|
-
import { Bubble, markSeenFrom, useAsks } from './marks-ui.tsx'
|
|
12
|
+
import { Bubble, markSeenFrom, resolveAllFrom, useAsks, type ResolveScope } from './marks-ui.tsx'
|
|
13
|
+
import { exportPdf } from './pdf-export.tsx'
|
|
13
14
|
import { Tip } from './Tip.tsx'
|
|
14
15
|
import { copyToClipboard, type MenuItem, type MenuOpener } from './ContextMenu.tsx'
|
|
15
16
|
import { cmd, keysOf, withCmd, withCmds, type CmdHandle, type CmdOpts } from './commands.ts'
|
|
16
|
-
import { ArrowLineUpIcon, CardsIcon, CheckIcon, FolderIcon, FrameCornersIcon, FolderMinusIcon, FolderOpenIcon, FolderPlusIcon, PencilSimpleIcon, SignpostIcon } from './icons.tsx'
|
|
17
|
+
import { ArrowLineUpIcon, CardsIcon, CheckIcon, CheckSquareOffsetIcon, FolderIcon, FrameCornersIcon, FolderMinusIcon, FolderOpenIcon, FolderPlusIcon, PencilSimpleIcon, SignpostIcon, ExportIcon } from './icons.tsx'
|
|
17
18
|
import {
|
|
18
19
|
applyDrop, boardsIn, createFolder, deleteFolder, depthOf, folderEntries, folderIn, folderOf, foldersIn, holdsFolders, humanize, INDENT, isOwnSlot, labelOf, listIn, moveBoard, moveFolderToRoot, newFolderSlot, parentOf, readTitle,
|
|
19
20
|
resolveDrop, retitleFolder, rootIndex, slugFor,
|
|
@@ -80,7 +81,11 @@ export function BoardList({ onMenu }: { onMenu: MenuOpener }) {
|
|
|
80
81
|
const marks = useStore((s) => s.marks)
|
|
81
82
|
const asks = useAsks()
|
|
82
83
|
const framesOf = (boards: string[]) => boards.flatMap((b) => marks?.boards[b] ?? [])
|
|
83
|
-
|
|
84
|
+
// Mark all as seen, and beside it Resolve all comments (spec 31 B.1) - for what the row stands for: a board, a folder
|
|
85
|
+
const seeAll = (boards: string[], scope: ResolveScope): MenuItem[] => (!PUBLISHED ? [
|
|
86
|
+
{ label: 'Mark all as seen', icon: <CheckIcon size={15} />, onClick: () => markSeenFrom({ via: 'context', in: 'shell' }, framesOf(boards)) },
|
|
87
|
+
{ label: 'Resolve all comments', icon: <CheckSquareOffsetIcon size={15} />, onClick: () => void resolveAllFrom({ via: 'context', in: 'shell', ...('board' in scope ? { board: scope.board } : {}) }, scope) },
|
|
88
|
+
] : []) // board slug → type and status (spec 20)
|
|
84
89
|
const label = (n: string) => labelOf(n, titles[n]) // a board's label; a folder's is labelOf(name, item.title)
|
|
85
90
|
const [tree, setTree] = useState<TreeItem[]>([])
|
|
86
91
|
const [read, setRead] = useState(false) // the first tree read has answered
|
|
@@ -420,7 +425,7 @@ export function BoardList({ onMenu }: { onMenu: MenuOpener }) {
|
|
|
420
425
|
} catch (e) { h.fail('api'); throw e }
|
|
421
426
|
}
|
|
422
427
|
const boardMenu = (n: string, parent: string | null): MenuItem[] => {
|
|
423
|
-
const items: MenuItem[] = [{ label: 'Copy path', icon: <SignpostIcon size={15} />, onClick: () => copyToClipboard(`board: ${n}`, 'path copied', cmd('copy-path', { via: 'context', in: 'shell', board: n })) }, ...seeAll([n])]
|
|
428
|
+
const items: MenuItem[] = [{ label: 'Copy path', icon: <SignpostIcon size={15} />, onClick: () => copyToClipboard(`board: ${n}`, 'path copied', cmd('copy-path', { via: 'context', in: 'shell', board: n })) }, ...seeAll([n], { board: n })]
|
|
424
429
|
if (PUBLISHED) return items
|
|
425
430
|
// a feature or project board: its status first, as Linear puts it - the picker opens in place
|
|
426
431
|
const m = useStore.getState().boardMeta[n]
|
|
@@ -429,6 +434,8 @@ export function BoardList({ onMenu }: { onMenu: MenuOpener }) {
|
|
|
429
434
|
panel: (close) => <StatusPicker board={n} meta={m} close={close} onPick={setStatus} />,
|
|
430
435
|
})
|
|
431
436
|
items.push({ label: 'Rename', icon: <PencilSimpleIcon size={15} />, onClick: () => setNaming({ kind: 'board', name: n }) })
|
|
437
|
+
// spec 31: the board printed, one page per slide (a present board's frames at the size Play shows them)
|
|
438
|
+
items.push({ label: 'Export PDF', icon: <ExportIcon size={15} />, onClick: () => void exportPdf(n, {}, { via: 'context', in: 'shell' }) })
|
|
432
439
|
// the new folder takes the board's own slot at its own level (a sub-folder inside a top-level
|
|
433
440
|
// folder; right after its sub-folder when it sits in one - that level holds no folders)
|
|
434
441
|
items.push({ label: 'Move to new folder', icon: <FolderPlusIcon size={15} />, onClick: () => { const at = newFolderSlot(treeRef.current, n); newFolderAt(at.index, n, at.parent) } })
|
|
@@ -443,7 +450,7 @@ export function BoardList({ onMenu }: { onMenu: MenuOpener }) {
|
|
|
443
450
|
const folderMenu = (f: string, boards: string[], parent: string | null): MenuItem[] => {
|
|
444
451
|
const items: MenuItem[] = [{ label: 'Copy path', icon: <SignpostIcon size={15} />, onClick: () => copyToClipboard(`folder: ${f}${parent ? ` (in ${parent})` : ''} (boards: ${boards.join(', ') || 'none'})`, 'path copied', cmd('copy-path', { via: 'context', in: 'shell' })) }]
|
|
445
452
|
if (PUBLISHED) return items
|
|
446
|
-
items.push({ label: 'Rename', icon: <PencilSimpleIcon size={15} />, onClick: () => setNaming({ kind: 'folder', name: f }) }, ...seeAll(boards))
|
|
453
|
+
items.push({ label: 'Rename', icon: <PencilSimpleIcon size={15} />, onClick: () => setNaming({ kind: 'folder', name: f }) }, ...seeAll(boards, { folder: f }))
|
|
447
454
|
// two levels: a top-level folder can hold folders; a sub-folder can leave its parent
|
|
448
455
|
if (!parent) items.push({ label: 'New folder inside', icon: <FolderPlusIcon size={15} />, onClick: () => newFolderAt(listIn(treeRef.current, f)?.length ?? 0, undefined, f) })
|
|
449
456
|
else items.push({ label: 'Move to top level', icon: <ArrowLineUpIcon size={15} />, onClick: () => mutate((t) => {
|
|
@@ -618,8 +625,10 @@ export function BoardList({ onMenu }: { onMenu: MenuOpener }) {
|
|
|
618
625
|
<span>{labelOf(f, it.title)}</span>
|
|
619
626
|
{(() => {
|
|
620
627
|
// a closed folder's one slot rolls up what it hides: a question first, else a blue count
|
|
621
|
-
|
|
622
|
-
|
|
628
|
+
// spec 31 B.7: closed, its number is its asks only - new is a blue dot, never a count; open, its board count
|
|
629
|
+
if (open) return <small>{boards.length}</small>
|
|
630
|
+
const r = rollup(marks, asks, framesOf(boards))
|
|
631
|
+
return r.asks ? <Bubble n={r.asks} /> : r.fresh ? <i className="mk-slot"><i className="mk-dot" data-mark="new" aria-label="new inside" /></i> : null
|
|
623
632
|
})()}
|
|
624
633
|
</button>,
|
|
625
634
|
)
|