@backmatter/studio 0.0.18 → 0.0.20

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.
Files changed (41) hide show
  1. package/dist/chunks/{UiKitApp-DkuQBiQZ.js → UiKitApp-C269OA8v.js} +528 -481
  2. package/dist/chunks/{WorkspaceRoutes-DVvb3N-V.js → WorkspaceRoutes-B4B5jjje.js} +24376 -23915
  3. package/dist/chunks/{dashboard-B4FITg6c.js → dashboard-DeNgythd.js} +586 -565
  4. package/dist/chunks/{index-CegtXnEI.js → index-7-TtXaMq.js} +104 -104
  5. package/dist/dashboard.js +2 -2
  6. package/dist/index.js +166 -159
  7. package/dist/site-widget.css +25 -6
  8. package/dist/site-widget.js +6925 -6840
  9. package/dist/studio.css +171 -36
  10. package/package.json +2 -2
  11. package/src/api.ts +48 -1
  12. package/src/chat/ChatMessage.tsx +4 -4
  13. package/src/chat/ChatProvider.tsx +6 -0
  14. package/src/chat/chat-helpers.ts +54 -2
  15. package/src/chrome/CommandPalette.tsx +3 -3
  16. package/src/chrome/ContentExplorerSidebar.tsx +421 -74
  17. package/src/chrome/WorkspaceStatusBar.tsx +24 -24
  18. package/src/chrome/commit-error.ts +48 -60
  19. package/src/chrome/commit-failure.tsx +2 -2
  20. package/src/chrome/content-path-tree.ts +4 -0
  21. package/src/chrome/explorer-row-menu.ts +28 -0
  22. package/src/chrome/folder-create-context.ts +14 -0
  23. package/src/chrome/use-publish-check.ts +75 -0
  24. package/src/fields/FieldControl.tsx +173 -62
  25. package/src/pages/BlocksList.tsx +38 -3
  26. package/src/pages/DocEditorPage.tsx +47 -64
  27. package/src/pages/EmbedPublishPage.tsx +13 -5
  28. package/src/pages/GithubConnectPage.tsx +1 -1
  29. package/src/pages/LoginPage.tsx +67 -5
  30. package/src/pages/MediaFieldInput.tsx +155 -63
  31. package/src/pages/MediaGalleryPage.tsx +56 -3
  32. package/src/pages/PreviewAddress.tsx +30 -0
  33. package/src/pages/WorkspaceHomePage.tsx +1 -1
  34. package/src/pages/ui-kit/colors.tsx +2 -0
  35. package/src/pages/ui-kit/fields.tsx +60 -0
  36. package/src/styles/themes.ts +2 -0
  37. package/src/styles/tokens.stylex.ts +1 -0
  38. package/src/ui/Button.tsx +14 -0
  39. package/src/ui/Field.tsx +12 -1
  40. package/src/ui/Input.tsx +191 -97
  41. package/src/ui/popup.ts +13 -6
@@ -11,6 +11,12 @@ import { Text } from "../ui/Text";
11
11
 
12
12
  const hover = "@media (hover: hover)";
13
13
 
14
+ const legal = {
15
+ terms: "https://backmatter.app/legal/terms",
16
+ privacy: "https://backmatter.app/legal/privacy",
17
+ dpa: "https://backmatter.app/legal/dpa",
18
+ } as const;
19
+
14
20
  export function LoginPage() {
15
21
  const [params] = useSearchParams();
16
22
  const [error, setError] = useState<string | null>(null);
@@ -22,6 +28,8 @@ export function LoginPage() {
22
28
  const [password, setPassword] = useState("");
23
29
  const [name, setName] = useState("");
24
30
  const [mode, setMode] = useState<"signin" | "signup">("signin");
31
+ const [accepted, setAccepted] = useState(false);
32
+ const signupBlocked = mode === "signup" && !accepted;
25
33
 
26
34
  useEffect(() => {
27
35
  void fetchAuthConfig()
@@ -95,6 +103,26 @@ export function LoginPage() {
95
103
  <div {...stylex.props(styles.actions)}>
96
104
  {error ? <Text tone="danger">{error}</Text> : null}
97
105
  {notice ? <Text tone="muted">{notice}</Text> : null}
106
+ <p {...stylex.props(styles.legal)}>
107
+ By continuing you agree to the{" "}
108
+ <a href={legal.terms} {...stylex.props(styles.legalLink)}>Terms</a> and the{" "}
109
+ <a href={legal.dpa} {...stylex.props(styles.legalLink)}>Data Processing Agreement</a>,
110
+ and you acknowledge the{" "}
111
+ <a href={legal.privacy} {...stylex.props(styles.legalLink)}>Privacy policy</a>.
112
+ A consumer who asks us to start the service now loses the 14-day right of withdrawal
113
+ once it has begun.
114
+ </p>
115
+ {mode === "signup" ? (
116
+ <label {...stylex.props(styles.accept)}>
117
+ <input
118
+ type="checkbox"
119
+ checked={accepted}
120
+ onChange={(event) => setAccepted(event.target.checked)}
121
+ {...stylex.props(styles.checkbox)}
122
+ />
123
+ <span>I agree, and I ask Backmatter to start the service now.</span>
124
+ </label>
125
+ ) : null}
98
126
  <form onSubmit={(e) => void onPassword(e)} {...stylex.props(styles.form)}>
99
127
  {mode === "signup" ? (
100
128
  <input
@@ -125,15 +153,19 @@ export function LoginPage() {
125
153
  autoComplete={mode === "signup" ? "new-password" : "current-password"}
126
154
  {...stylex.props(styles.field)}
127
155
  />
128
- <button type="submit" disabled={busy} {...stylex.props(styles.cta, busy && styles.ctaDisabled)}>
156
+ <button
157
+ type="submit"
158
+ disabled={busy || signupBlocked}
159
+ {...stylex.props(styles.cta, (busy || signupBlocked) && styles.ctaDisabled)}
160
+ >
129
161
  {mode === "signup" ? "Create account" : "Sign in"}
130
162
  </button>
131
163
  </form>
132
164
  <button
133
165
  type="button"
134
- disabled={busy || !email}
166
+ disabled={busy || !email || signupBlocked}
135
167
  onClick={() => void onMagicLink()}
136
- {...stylex.props(styles.secondary, (busy || !email) && styles.ctaDisabled)}
168
+ {...stylex.props(styles.secondary, (busy || !email || signupBlocked) && styles.ctaDisabled)}
137
169
  >
138
170
  Email me a magic link
139
171
  </button>
@@ -147,9 +179,9 @@ export function LoginPage() {
147
179
  </button>
148
180
  <button
149
181
  type="button"
150
- disabled={busy || github !== true}
182
+ disabled={busy || github !== true || signupBlocked}
151
183
  onClick={() => void onGithub()}
152
- {...stylex.props(styles.cta, (busy || github !== true) && styles.ctaDisabled)}
184
+ {...stylex.props(styles.cta, (busy || github !== true || signupBlocked) && styles.ctaDisabled)}
153
185
  >
154
186
  <GithubIcon size={18} />
155
187
  Continue with GitHub
@@ -332,4 +364,34 @@ const styles = stylex.create({
332
364
  fontSize: type.sm,
333
365
  color: colors.textMuted,
334
366
  },
367
+ legal: {
368
+ margin: 0,
369
+ fontSize: type.sm,
370
+ lineHeight: 1.5,
371
+ color: colors.textMuted,
372
+ textAlign: "left",
373
+ },
374
+ legalLink: {
375
+ color: colors.text,
376
+ textUnderlineOffset: "2px",
377
+ },
378
+ accept: {
379
+ display: "flex",
380
+ width: "100%",
381
+ gap: space.sm,
382
+ alignItems: "flex-start",
383
+ minHeight: "44px",
384
+ textAlign: "left",
385
+ fontSize: type.sm,
386
+ lineHeight: 1.5,
387
+ color: colors.text,
388
+ cursor: "pointer",
389
+ },
390
+ checkbox: {
391
+ width: "18px",
392
+ height: "18px",
393
+ marginTop: "2px",
394
+ flexShrink: 0,
395
+ accentColor: "#fafafa",
396
+ },
335
397
  });
@@ -1,5 +1,5 @@
1
1
  // packages/studio/src/pages/MediaFieldInput.tsx
2
- import { useCallback, useEffect, useRef, useState, type DragEvent } from "react";
2
+ import { useCallback, useEffect, useRef, useState, type DragEvent, type KeyboardEvent } from "react";
3
3
  import { Dialog } from "@base-ui/react/dialog";
4
4
  import { mediaIdFromUrl, mediaVariantUrl } from "@backmatter/core";
5
5
  import * as stylex from "@stylexjs/stylex";
@@ -61,6 +61,9 @@ export function MediaFieldInput({
61
61
  const [notAdded, setNotAdded] = useState(0);
62
62
  const [pending, setPending] = useState<PendingUpload[]>([]);
63
63
  const dragFrom = useRef<number | null>(null);
64
+ const [dropIndex, setDropIndex] = useState<number | null>(null);
65
+ const focusIndex = useRef<number | null>(null);
66
+ const gridRef = useRef<HTMLDivElement>(null);
64
67
  const valueRef = useRef(value);
65
68
  valueRef.current = value;
66
69
  const onChangeRef = useRef(onChange);
@@ -171,12 +174,34 @@ export function MediaFieldInput({
171
174
  event.preventDefault();
172
175
  const from = dragFrom.current;
173
176
  dragFrom.current = null;
177
+ setDropIndex(null);
174
178
  if (from === null || from === toIndex) return;
175
179
  write(moveMediaUrl(savedUrls, from, toIndex));
176
180
  },
177
181
  [savedUrls, write],
178
182
  );
179
183
 
184
+ const onThumbKeyDown = useCallback(
185
+ (index: number, event: KeyboardEvent) => {
186
+ if (!event.altKey) return;
187
+ const step = event.key === "ArrowLeft" ? -1 : event.key === "ArrowRight" ? 1 : 0;
188
+ const to = index + step;
189
+ if (step === 0 || to < 0 || to >= savedUrls.length) return;
190
+ event.preventDefault();
191
+ if (to >= GALLERY_PER_ROW) setExpanded(true);
192
+ focusIndex.current = to;
193
+ write(moveMediaUrl(savedUrls, index, to));
194
+ },
195
+ [savedUrls, write],
196
+ );
197
+
198
+ useEffect(() => {
199
+ const index = focusIndex.current;
200
+ if (index === null) return;
201
+ focusIndex.current = null;
202
+ gridRef.current?.querySelectorAll<HTMLElement>("[data-media-thumb]")[index]?.focus();
203
+ });
204
+
180
205
  const note = notAddedMessage(notAdded);
181
206
  const messages = [...rejections, ...(note ? [note] : [])];
182
207
 
@@ -224,23 +249,39 @@ export function MediaFieldInput({
224
249
  >
225
250
  {multiple && showThumb ? (
226
251
  <div {...stylex.props(styles.galleryStack)}>
227
- <div data-media-grid {...stylex.props(styles.galleryGrid)}>
252
+ <div ref={gridRef} data-media-grid {...stylex.props(styles.galleryGrid)}>
228
253
  {galleryUrls.map((url, index) => {
229
254
  const thumb = thumbForUrl(url);
230
255
  return (
231
256
  <div
232
257
  key={`${url}-${index}`}
233
258
  data-media-thumb
259
+ role="group"
260
+ aria-label={`Image ${index + 1} of ${savedUrls.length}`}
261
+ aria-keyshortcuts={readOnly ? undefined : "Alt+ArrowLeft Alt+ArrowRight"}
262
+ tabIndex={readOnly ? undefined : 0}
234
263
  draggable={!readOnly}
235
- {...stylex.props(styles.thumbWrap)}
264
+ {...stylex.props(
265
+ styles.thumbWrap,
266
+ !readOnly && styles.thumbMovable,
267
+ dropIndex === index && styles.thumbDropTarget,
268
+ )}
269
+ onKeyDown={readOnly ? undefined : (event) => onThumbKeyDown(index, event)}
236
270
  onDragStart={() => {
237
271
  dragFrom.current = index;
238
272
  }}
239
- onDragOver={(event) => event.preventDefault()}
273
+ onDragEnd={() => {
274
+ dragFrom.current = null;
275
+ setDropIndex(null);
276
+ }}
277
+ onDragOver={(event) => {
278
+ event.preventDefault();
279
+ if (dragFrom.current !== null && dropIndex !== index) setDropIndex(index);
280
+ }}
240
281
  onDrop={(event) => onThumbDrop(index, event)}
241
282
  >
242
283
  {thumb ? (
243
- <img src={thumb} alt="" {...stylex.props(styles.galleryTile)} />
284
+ <img src={thumb} alt="" draggable={false} {...stylex.props(styles.galleryTile)} />
244
285
  ) : (
245
286
  <div {...stylex.props(styles.galleryTile, styles.moreEmpty)} />
246
287
  )}
@@ -251,7 +292,7 @@ export function MediaFieldInput({
251
292
  {...stylex.props(styles.galleryRemove)}
252
293
  onClick={() => removeAt(index)}
253
294
  >
254
- ×
295
+ <CloseIcon />
255
296
  </button>
256
297
  )}
257
298
  </div>
@@ -262,31 +303,25 @@ export function MediaFieldInput({
262
303
  <img src={item.previewUrl} alt="" {...stylex.props(styles.galleryTile, styles.pending)} />
263
304
  </div>
264
305
  ))}
306
+ {readOnly ? null : (
307
+ <button
308
+ type="button"
309
+ aria-label="Add images"
310
+ {...stylex.props(styles.galleryTile, styles.addTile)}
311
+ onClick={openModal}
312
+ >
313
+ <PlusIcon />
314
+ </button>
315
+ )}
265
316
  </div>
266
- {hiddenCount > 0 || !readOnly ? (
267
- <div {...stylex.props(styles.galleryFooter)}>
268
- {hiddenCount > 0 ? (
269
- <button
270
- type="button"
271
- {...stylex.props(styles.showMore)}
272
- onClick={() => setExpanded((current) => !current)}
273
- >
274
- {expanded ? "Show less" : "Show more"}
275
- </button>
276
- ) : (
277
- <span />
278
- )}
279
- {readOnly ? null : (
280
- <button
281
- type="button"
282
- aria-label="Edit image"
283
- {...stylex.props(styles.iconBtn)}
284
- onClick={openModal}
285
- >
286
- <PencilIcon />
287
- </button>
288
- )}
289
- </div>
317
+ {hiddenCount > 0 ? (
318
+ <button
319
+ type="button"
320
+ {...stylex.props(styles.showMore)}
321
+ onClick={() => setExpanded((current) => !current)}
322
+ >
323
+ {expanded ? "Show less" : `Show ${hiddenCount} more`}
324
+ </button>
290
325
  ) : null}
291
326
  </div>
292
327
  ) : multiple && pending[0] ? (
@@ -472,6 +507,14 @@ function PencilIcon() {
472
507
  );
473
508
  }
474
509
 
510
+ function PlusIcon() {
511
+ return (
512
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden>
513
+ <path d="M8 3.5V12.5M3.5 8H12.5" stroke="currentColor" strokeWidth="1.25" strokeLinecap="round" />
514
+ </svg>
515
+ );
516
+ }
517
+
475
518
  function CloseIcon() {
476
519
  return (
477
520
  <svg width="16" height="16" viewBox="0 0 16 16" fill="none" aria-hidden>
@@ -480,11 +523,6 @@ function CloseIcon() {
480
523
  );
481
524
  }
482
525
 
483
- const fade = stylex.keyframes({
484
- from: { opacity: 0 },
485
- to: { opacity: 1 },
486
- });
487
-
488
526
  const styles = stylex.create({
489
527
  stack: {
490
528
  display: "flex",
@@ -506,44 +544,67 @@ const styles = stylex.create({
506
544
  galleryStack: {
507
545
  display: "flex",
508
546
  flexDirection: "column",
509
- gap: space.xs,
510
- width: "fit-content",
511
- maxWidth: "100%",
547
+ gap: space.sm,
548
+ width: "100%",
512
549
  },
513
550
  galleryGrid: {
514
551
  display: "grid",
515
- gridTemplateColumns: "repeat(4, 48px)",
516
- gap: "4px",
552
+ gridTemplateColumns: "repeat(auto-fill, 72px)",
553
+ gap: space.sm,
517
554
  },
518
555
  galleryTile: {
519
- width: "48px",
520
- height: "48px",
556
+ display: "block",
557
+ width: "72px",
558
+ height: "72px",
521
559
  objectFit: "cover",
522
- borderRadius: radius.sm,
560
+ borderRadius: radius.md,
523
561
  backgroundColor: colors.bgPanel,
524
562
  },
525
563
  galleryRemove: {
526
564
  position: "absolute",
527
- top: 2,
528
- right: 2,
529
- width: "14px",
530
- height: "14px",
565
+ top: space.xs,
566
+ right: space.xs,
567
+ display: "flex",
568
+ alignItems: "center",
569
+ justifyContent: "center",
570
+ width: "22px",
571
+ height: "22px",
531
572
  padding: 0,
532
- borderWidth: 0,
573
+ borderWidth: 1,
574
+ borderStyle: "solid",
575
+ borderColor: "rgba(255, 255, 255, 0.6)",
533
576
  borderRadius: "999px",
534
- backgroundColor: colors.overlay,
535
- color: colors.textInverse,
577
+ backgroundColor: "rgba(24, 24, 27, 0.85)",
578
+ color: "#fafafa",
536
579
  cursor: "pointer",
537
- fontSize: type.xs,
538
- lineHeight: 1,
580
+ opacity: {
581
+ default: "var(--remove-opacity, 0)",
582
+ ":focus-visible": 1,
583
+ },
584
+ transitionProperty: "opacity",
585
+ transitionDuration: "120ms",
539
586
  },
540
- galleryFooter: {
587
+ addTile: {
541
588
  display: "flex",
542
589
  alignItems: "center",
543
- justifyContent: "space-between",
544
- gap: space.sm,
590
+ justifyContent: "center",
591
+ boxSizing: "border-box",
592
+ padding: 0,
593
+ borderWidth: 1,
594
+ borderStyle: "dashed",
595
+ borderColor: colors.border,
596
+ backgroundColor: "transparent",
597
+ color: colors.textMuted,
598
+ cursor: "pointer",
599
+ [hover]: {
600
+ ":hover": {
601
+ backgroundColor: colors.bgHover,
602
+ color: colors.text,
603
+ },
604
+ },
545
605
  },
546
606
  showMore: {
607
+ alignSelf: "flex-start",
547
608
  padding: 0,
548
609
  borderWidth: 0,
549
610
  backgroundColor: "transparent",
@@ -563,6 +624,30 @@ const styles = stylex.create({
563
624
  },
564
625
  thumbWrap: {
565
626
  position: "relative",
627
+ borderRadius: radius.md,
628
+ "--remove-opacity": {
629
+ default: 0,
630
+ ":hover": 1,
631
+ ":focus-within": 1,
632
+ "@media (hover: none)": 1,
633
+ },
634
+ outlineOffset: 2,
635
+ ":focus-visible": {
636
+ outlineWidth: 2,
637
+ outlineStyle: "solid",
638
+ outlineColor: colors.focus,
639
+ },
640
+ },
641
+ thumbMovable: {
642
+ cursor: "grab",
643
+ ":active": {
644
+ cursor: "grabbing",
645
+ },
646
+ },
647
+ thumbDropTarget: {
648
+ outlineWidth: 2,
649
+ outlineStyle: "dashed",
650
+ outlineColor: colors.focus,
566
651
  },
567
652
  thumb: {
568
653
  width: "4.5rem",
@@ -675,10 +760,11 @@ const styles = stylex.create({
675
760
  zIndex: z.overlay,
676
761
  backgroundColor: colors.overlay,
677
762
  backdropFilter: "blur(8px)",
678
- animationName: fade,
679
- animationDuration: "120ms",
763
+ transitionProperty: "opacity",
764
+ transitionDuration: "160ms",
765
+ transitionTimingFunction: "ease-out",
680
766
  "@media (prefers-reduced-motion: reduce)": {
681
- animationDuration: "0ms",
767
+ transitionDuration: "0ms",
682
768
  },
683
769
  },
684
770
  backdropHidden: {
@@ -686,20 +772,26 @@ const styles = stylex.create({
686
772
  },
687
773
  popup: {
688
774
  position: "fixed",
689
- top: "8vh",
690
- left: "50%",
775
+ inset: "clamp(12px, 3vw, 32px)",
691
776
  zIndex: z.palette,
692
- transform: "translateX(-50%)",
693
- width: "min(960px, calc(100vw - 32px))",
694
- height: "min(720px, 80vh)",
695
777
  display: "flex",
696
778
  flexDirection: "column",
697
779
  backgroundColor: colors.bgSurface,
698
780
  borderRadius: radius.md,
781
+ boxShadow: "0 24px 64px rgba(0, 0, 0, 0.35)",
699
782
  overflow: "hidden",
783
+ outline: "none",
784
+ transformOrigin: "center",
785
+ transitionProperty: "opacity, transform",
786
+ transitionDuration: "160ms",
787
+ transitionTimingFunction: "cubic-bezier(0.2, 0, 0, 1)",
788
+ "@media (prefers-reduced-motion: reduce)": {
789
+ transitionDuration: "0ms",
790
+ },
700
791
  },
701
792
  popupHidden: {
702
793
  opacity: 0,
794
+ transform: "scale(0.98)",
703
795
  },
704
796
  title: {
705
797
  margin: 0,
@@ -39,6 +39,7 @@ import {
39
39
  import { MediaLightbox } from "./MediaLightbox";
40
40
 
41
41
  const CELL = 168;
42
+ const hover = "@media (hover: hover)";
42
43
 
43
44
  export function MediaGalleryPage({
44
45
  pick = false,
@@ -403,6 +404,7 @@ export function MediaGalleryPage({
403
404
  <div {...stylex.props(styles.search)}>
404
405
  <Input
405
406
  aria-label="Search media"
407
+ data-no-ring={pick ? "" : undefined}
406
408
  placeholder="Search"
407
409
  value={draft}
408
410
  onChange={(event) => setDraft(event.target.value)}
@@ -488,10 +490,11 @@ export function MediaGalleryPage({
488
490
  : !pick && !sharedId && cell.item.id === selectedId
489
491
  }
490
492
  canDelete={canDelete}
493
+ onUnpick={onToggleUrl ? () => onToggleUrl(cell.item.url) : undefined}
491
494
  onOpen={() => {
492
495
  setSelectedId(null);
493
496
  if (onToggleUrl) {
494
- onToggleUrl(cell.item.url);
497
+ if (!pickedUrls?.includes(cell.item.url)) onToggleUrl(cell.item.url);
495
498
  return;
496
499
  }
497
500
  if (pick) {
@@ -555,6 +558,7 @@ function MediaHit({
555
558
  canDelete,
556
559
  onOpen,
557
560
  onDelete,
561
+ onUnpick,
558
562
  }: {
559
563
  item: CatalogMedia;
560
564
  menu: boolean;
@@ -562,18 +566,41 @@ function MediaHit({
562
566
  canDelete: boolean;
563
567
  onOpen: () => void;
564
568
  onDelete: () => void;
569
+ onUnpick?: () => void;
565
570
  }) {
566
571
  const image = (
567
572
  <button
568
573
  type="button"
569
574
  aria-current={selected ? "true" : undefined}
570
- {...stylex.props(styles.hit, !menu && styles.placed, selected && styles.selected)}
575
+ {...stylex.props(
576
+ styles.hit,
577
+ !menu && styles.placed,
578
+ selected && styles.selected,
579
+ selected && onUnpick && styles.picked,
580
+ )}
571
581
  onClick={onOpen}
572
582
  >
573
583
  <img src={item.thumbUrl} alt={item.alt?.trim() || item.filename} {...stylex.props(styles.image)} />
574
584
  </button>
575
585
  );
576
- if (!menu) return image;
586
+ if (!menu) {
587
+ if (!selected || !onUnpick) return image;
588
+ return (
589
+ <>
590
+ {image}
591
+ <button
592
+ type="button"
593
+ aria-label={`Remove ${item.filename} from selection`}
594
+ {...stylex.props(styles.unpick)}
595
+ onClick={onUnpick}
596
+ >
597
+ <svg width="14" height="14" viewBox="0 0 16 16" fill="none" aria-hidden>
598
+ <path d="M4.5 4.5 11.5 11.5M11.5 4.5 4.5 11.5" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" />
599
+ </svg>
600
+ </button>
601
+ </>
602
+ );
603
+ }
577
604
  return (
578
605
  <ContextMenu.Root>
579
606
  <ContextMenu.Trigger className={cx(styles.menuHit)}>{image}</ContextMenu.Trigger>
@@ -750,6 +777,32 @@ const styles = stylex.create({
750
777
  outlineColor: colors.focus,
751
778
  outlineOffset: 3,
752
779
  },
780
+ picked: {
781
+ cursor: "default",
782
+ },
783
+ unpick: {
784
+ position: "absolute",
785
+ top: "12px",
786
+ right: "12px",
787
+ display: "flex",
788
+ alignItems: "center",
789
+ justifyContent: "center",
790
+ width: "26px",
791
+ height: "26px",
792
+ padding: 0,
793
+ borderWidth: 1,
794
+ borderStyle: "solid",
795
+ borderColor: "rgba(255, 255, 255, 0.6)",
796
+ borderRadius: "999px",
797
+ backgroundColor: "rgba(24, 24, 27, 0.85)",
798
+ color: "#fafafa",
799
+ cursor: "pointer",
800
+ [hover]: {
801
+ ":hover": {
802
+ backgroundColor: "rgba(24, 24, 27, 1)",
803
+ },
804
+ },
805
+ },
753
806
  menuHit: {
754
807
  position: "absolute",
755
808
  inset: space.sm,
@@ -24,6 +24,7 @@ export function PreviewAddress({
24
24
  onPath,
25
25
  onReload,
26
26
  onOpen,
27
+ liveHref,
27
28
  }: {
28
29
  path: string;
29
30
  enabled: boolean;
@@ -33,6 +34,8 @@ export function PreviewAddress({
33
34
  onPath: (path: string) => void;
34
35
  onReload: () => void;
35
36
  onOpen: () => void;
37
+ /** Committed page on the public site. Absent when this model has no route. */
38
+ liveHref?: string | null;
36
39
  }) {
37
40
  const [query, setQuery] = useState<string | null>(null);
38
41
  const [open, setOpen] = useState(false);
@@ -175,6 +178,11 @@ export function PreviewAddress({
175
178
  >
176
179
  <IconArrowUpRight size={14} ariaHidden />
177
180
  </button>
181
+ {liveHref ? (
182
+ <a href={liveHref} target="_blank" rel="noreferrer" {...stylex.props(styles.liveLink)}>
183
+ View live
184
+ </a>
185
+ ) : null}
178
186
  </div>
179
187
  );
180
188
  }
@@ -237,6 +245,28 @@ const styles = stylex.create({
237
245
  routeItem: {
238
246
  fontFamily: type.mono,
239
247
  },
248
+ liveLink: {
249
+ display: "inline-flex",
250
+ alignItems: "center",
251
+ flexShrink: 0,
252
+ height: "28px",
253
+ paddingInline: space.sm,
254
+ borderRadius: radius.sm,
255
+ color: {
256
+ default: colors.textMuted,
257
+ [hover]: { default: colors.textMuted, ":hover": colors.text },
258
+ },
259
+ fontSize: type.xs,
260
+ fontWeight: 500,
261
+ whiteSpace: "nowrap",
262
+ textDecoration: "none",
263
+ ":focus-visible": {
264
+ outlineWidth: 2,
265
+ outlineStyle: "solid",
266
+ outlineColor: colors.focus,
267
+ outlineOffset: 1,
268
+ },
269
+ },
240
270
  iconButton: {
241
271
  display: "inline-flex",
242
272
  alignItems: "center",
@@ -82,7 +82,7 @@ function UncommittedCard({ summary }: { summary: HomeSummary }) {
82
82
  return (
83
83
  <section {...stylex.props(styles.card, styles.span)}>
84
84
  <Text size="sm" tone="muted" weight="medium">
85
- Uncommitted
85
+ Unpublished
86
86
  </Text>
87
87
  <p {...stylex.props(styles.value)}>{summary.uncommitted}</p>
88
88
  <Text size="sm" tone={summary.conflicts > 0 ? "danger" : "muted"}>
@@ -54,6 +54,7 @@ const styles = stylex.create({
54
54
  bgPanel: { backgroundColor: colors.bgPanel },
55
55
  bgPanelInset: { backgroundColor: colors.bgPanelInset },
56
56
  bgSurface: { backgroundColor: colors.bgSurface },
57
+ bgRaised: { backgroundColor: colors.bgRaised },
57
58
  bgHover: { backgroundColor: colors.bgHover },
58
59
  bgActive: { backgroundColor: colors.bgActive },
59
60
  bgInput: { backgroundColor: colors.bgInput },
@@ -77,6 +78,7 @@ const SWATCHES = [
77
78
  ["bgPanel", styles.bgPanel],
78
79
  ["bgPanelInset", styles.bgPanelInset],
79
80
  ["bgSurface", styles.bgSurface],
81
+ ["bgRaised", styles.bgRaised],
80
82
  ["bgHover", styles.bgHover],
81
83
  ["bgActive", styles.bgActive],
82
84
  ["bgInput", styles.bgInput],