@puredesktop/puredesktop-ui-bridge 2.1.4 → 2.1.7

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 (183) hide show
  1. package/package.json +19 -1
  2. package/src/agents/runtime/mapAgentSnapshot.test.ts +1 -3
  3. package/src/agents/runtime/mapAgentSnapshot.ts +8 -4
  4. package/src/agents/runtime/mergeUsageTurn.ts +1 -2
  5. package/src/agents/runtime/pendingToolCalls.test.ts +1 -3
  6. package/src/agents/runtime/unresolvedToolCalls.ts +1 -2
  7. package/src/bridge/agentModelTiers.ts +9 -4
  8. package/src/bridge/agents.mjs +3 -1
  9. package/src/bridge/calendarDraftIntent.ts +12 -4
  10. package/src/bridge/calendarInviteIntent.ts +18 -5
  11. package/src/bridge/client.mjs +45 -45
  12. package/src/bridge/dialog.d.mts +8 -8
  13. package/src/bridge/dialog.mjs +40 -40
  14. package/src/bridge/dialog.test.ts +73 -73
  15. package/src/bridge/fs.d.mts +41 -41
  16. package/src/bridge/fs.mjs +56 -56
  17. package/src/bridge/fs.test.ts +83 -83
  18. package/src/bridge/fs.ts +28 -28
  19. package/src/bridge/googleAuth.ts +3 -1
  20. package/src/bridge/methods.d.mts +6 -0
  21. package/src/bridge/methods.mjs +7 -0
  22. package/src/bridge/network.d.mts +17 -17
  23. package/src/bridge/network.mjs +22 -22
  24. package/src/bridge/pureRender/base.css +324 -76
  25. package/src/bridge/pureRender/compiler.ts +1 -1
  26. package/src/bridge/pureRender/document.test.ts +2 -2
  27. package/src/bridge/pureRender/extraction.test.ts +24 -12
  28. package/src/bridge/pureRender/extraction.ts +10 -7
  29. package/src/bridge/pureRender/flow.css +17 -3
  30. package/src/bridge/pureRender/normalize.ts +28 -26
  31. package/src/bridge/pureRender/presets.ts +7 -7
  32. package/src/bridge/pureRender/profiles/book.css +122 -19
  33. package/src/bridge/pureRender/profiles/manuscript.css +57 -11
  34. package/src/bridge/pureRender/profiles/writer.css +48 -10
  35. package/src/bridge/pureRender/reset.css +20 -5
  36. package/src/bridge/pureRender/theme.ts +37 -9
  37. package/src/bridge/pureRender/tokens/default.css +45 -33
  38. package/src/bridge/react/usePlatformAgentRunLiveState.tsx +4 -1
  39. package/src/bridge/react/usePlatformAgentSessionDrive.tsx +13 -4
  40. package/src/bridge/screenAnnotation.test.ts +4 -1
  41. package/src/bridge/screenAnnotation.ts +6 -2
  42. package/src/bridge/storage.d.mts +26 -24
  43. package/src/bridge/storage.mjs +18 -18
  44. package/src/bridge/storage.test.ts +45 -45
  45. package/src/bridge/types.ts +62 -58
  46. package/src/bridge/window.d.mts +3 -1
  47. package/src/bridge/workspace.d.mts +7 -0
  48. package/src/bridge/workspace.mjs +8 -0
  49. package/src/bridge/workspace.ts +1 -0
  50. package/src/commitments/commitments.test.ts +10 -3
  51. package/src/commitments/commitments.ts +18 -4
  52. package/src/components/accessibility/AccessibilityReviewDialog.tsx +7 -2
  53. package/src/components/accessibility/accessibilityReview.test.ts +11 -4
  54. package/src/components/accessibility/accessibilityReview.ts +18 -10
  55. package/src/components/agent-feedback/ScreenAnnotationAgentDialog.tsx +9 -2
  56. package/src/components/agents/AgentContextUsageBar.tsx +5 -3
  57. package/src/components/agents/AgentDrawerPanel.test.tsx +15 -3
  58. package/src/components/agents/AgentMessageBubble.tsx +1 -3
  59. package/src/components/agents/AgentQuestionPromptList.tsx +3 -3
  60. package/src/components/agents/AgentToolApprovalActions.tsx +1 -3
  61. package/src/components/agents/agentPanelStyles.ts +1 -3
  62. package/src/components/agents/agentToolDisplay.ts +4 -1
  63. package/src/components/assets/asset-library/AssetLibraryDialog.tsx +2 -0
  64. package/src/components/assets/asset-library/AssetLibraryWorkspace.tsx +2 -0
  65. package/src/components/assets/asset-library/detail/AssetLibraryDetailHeader.test.tsx +40 -0
  66. package/src/components/assets/asset-library/detail/AssetLibraryDetailHeader.tsx +7 -3
  67. package/src/components/assets/asset-library/detail/AssetLibraryDetailPreview.tsx +8 -8
  68. package/src/components/assets/asset-library/hooks/useAssetLibraryDialog.ts +13 -2
  69. package/src/components/assets/asset-library/hooks/useAssetLibraryMutations.ts +18 -1
  70. package/src/components/assets/asset-library/sidebar/AssetLibraryListRow.tsx +9 -6
  71. package/src/components/assets/asset-library/sidebar/AssetLibrarySidebarToolbar.tsx +3 -1
  72. package/src/components/assets/asset-library/sidebar/AssetListThumbnail.tsx +1 -1
  73. package/src/components/assets/asset-library/types.ts +6 -0
  74. package/src/components/chrome/OverlayActionCapsule.tsx +2 -2
  75. package/src/components/chrome/PanelTabStrip.tsx +3 -2
  76. package/src/components/chrome/PureAppWordmark.tsx +15 -15
  77. package/src/components/chrome/WorkspaceTabStrip.tsx +19 -14
  78. package/src/components/chrome/documentChromePolicy.test.ts +34 -0
  79. package/src/components/chrome/documentChromePolicy.ts +15 -0
  80. package/src/components/chrome/index.ts +4 -0
  81. package/src/components/chrome/workspaceTabTypes.ts +2 -0
  82. package/src/components/common/buttons/Button.tsx +60 -10
  83. package/src/components/common/buttons/ChoiceChip.tsx +2 -2
  84. package/src/components/common/buttons/IconButton.tsx +26 -0
  85. package/src/components/common/buttons/SegmentedControl.tsx +23 -7
  86. package/src/components/common/canvas/CanvasElementFrame.tsx +37 -28
  87. package/src/components/common/canvas/canvasGeometry.test.ts +4 -5
  88. package/src/components/common/canvas/canvasGeometry.ts +1 -4
  89. package/src/components/common/canvas/useCanvasDragResize.test.tsx +10 -10
  90. package/src/components/common/canvas/useCanvasDragResize.ts +1 -4
  91. package/src/components/common/cards/OpenReviewCard.tsx +6 -6
  92. package/src/components/common/chat/ChatBox.test.tsx +9 -1
  93. package/src/components/common/chat/ChatBox.tsx +3 -4
  94. package/src/components/common/chat/ChatMarkdown.tsx +1 -1
  95. package/src/components/common/chat/ChatModelMenu.tsx +1 -1
  96. package/src/components/common/chat/ChatThinkingIndicator.tsx +1 -1
  97. package/src/components/common/chat/ChatThread.tsx +2 -1
  98. package/src/components/common/chat/ChatToolRow.tsx +2 -2
  99. package/src/components/common/chat/ChatUserBubble.tsx +1 -1
  100. package/src/components/common/connections/ConnectionSetup.tsx +6 -6
  101. package/src/components/common/containers/AppFrame.test.tsx +37 -36
  102. package/src/components/common/containers/AppFrame.tsx +15 -0
  103. package/src/components/common/containers/AppHeader.tsx +6 -3
  104. package/src/components/common/containers/SurfacePanel.tsx +1 -0
  105. package/src/components/common/containers/useOpacityPresence.ts +10 -15
  106. package/src/components/common/context/ContextSelector.tsx +10 -10
  107. package/src/components/common/desk/CreationDesk.tsx +23 -11
  108. package/src/components/common/desk/DailyBrief.tsx +18 -7
  109. package/src/components/common/desk/DeskCard.tsx +11 -6
  110. package/src/components/common/dropdown/MenuButtonDropdown.tsx +58 -6
  111. package/src/components/common/dropdown/MenuDropdownItem.tsx +23 -3
  112. package/src/components/common/dropdown/MenuPanel.tsx +8 -8
  113. package/src/components/common/dropdown/SelectMenu.tsx +8 -3
  114. package/src/components/common/dropdown/menuTypes.ts +2 -1
  115. package/src/components/common/evidence/StructuredEvidenceView.tsx +9 -5
  116. package/src/components/common/feedback/Badge.tsx +19 -5
  117. package/src/components/common/feedback/CapabilityPills.tsx +1 -1
  118. package/src/components/common/feedback/InfoHint.tsx +2 -2
  119. package/src/components/common/feedback/PlatformChip.tsx +9 -9
  120. package/src/components/common/feedback/QuietPill.tsx +5 -8
  121. package/src/components/common/feedback/WorkProgressPanel.tsx +14 -14
  122. package/src/components/common/files/FileTable.tsx +8 -2
  123. package/src/components/common/inputs/Checkbox.tsx +1 -1
  124. package/src/components/common/inputs/EditableSecretField.tsx +1 -3
  125. package/src/components/common/inputs/InlineComposer.tsx +2 -2
  126. package/src/components/common/inputs/PaletteDropdown.tsx +33 -23
  127. package/src/components/common/inputs/SurfacePalettePicker.tsx +1 -1
  128. package/src/components/common/inputs/ToggleSwitch.tsx +2 -2
  129. package/src/components/common/inputs/WorkspacePicker.tsx +3 -3
  130. package/src/components/common/lists/listRowStyles.ts +4 -2
  131. package/src/components/common/lists/quiet-ledger/index.ts +1 -4
  132. package/src/components/common/lists/reorderable/DragHandle.tsx +1 -1
  133. package/src/components/common/lists/reorderable/ReorderableSections.tsx +2 -1
  134. package/src/components/common/media/ImageReferencePicker.tsx +22 -14
  135. package/src/components/common/narrative/NarrativeMention.tsx +15 -9
  136. package/src/components/common/navigation/NavigationCardRow.tsx +2 -2
  137. package/src/components/common/navigation/UnderlineTabs.tsx +1 -0
  138. package/src/components/common/overlays/Modal.tsx +52 -3
  139. package/src/components/common/overlays/ObjectActionStrip.tsx +2 -2
  140. package/src/components/common/people/AutoUpdateReviewList.tsx +2 -2
  141. package/src/components/common/people/EntityList.tsx +7 -3
  142. package/src/components/common/people/EntityPortrait.tsx +6 -1
  143. package/src/components/common/people/LinkedDossierList.tsx +3 -1
  144. package/src/components/common/people/RelationshipMap.tsx +3 -9
  145. package/src/components/common/research/EvidenceDossier.tsx +24 -20
  146. package/src/components/common/tiles/CatalogCard.tsx +1 -1
  147. package/src/components/credentials/CredentialsPanel.tsx +2 -6
  148. package/src/components/data/DataChart.tsx +119 -94
  149. package/src/components/data/dataTable.ts +4 -1
  150. package/src/components/editor/DocumentAppChrome.tsx +172 -0
  151. package/src/components/editor/EditorCommentPromptDialog.tsx +1 -1
  152. package/src/components/editor/EditorLinkPromptDialog.tsx +1 -1
  153. package/src/components/print-design/PrintDesignPanel.test.tsx +8 -6
  154. package/src/components/print-design/PrintDesignPanel.tsx +18 -25
  155. package/src/components/proofing/PagedProofDialog.tsx +17 -4
  156. package/src/editor/EditorViewModeToggle.tsx +6 -2
  157. package/src/editor/index.ts +6 -0
  158. package/src/theme/ThemeProvider.tsx +5 -2
  159. package/src/theme/appAccents.test.ts +51 -0
  160. package/src/theme/appAccents.ts +151 -88
  161. package/src/theme/appIdentityCss.mjs +256 -0
  162. package/src/theme/appIdentityCss.ts +256 -0
  163. package/src/theme/composePlatformTheme.test.ts +43 -14
  164. package/src/theme/platformFont.d.mts +2 -2
  165. package/src/theme/platformFont.mjs +4 -3
  166. package/src/theme/reportsShellChromeSelectors.ts +14 -132
  167. package/src/theme/surfaceCss.mjs +37 -0
  168. package/src/theme/surfaceCss.ts +37 -0
  169. package/src/theme/surfacePalettes.ts +120 -79
  170. package/src/theme/surfaceRoleSelectors.ts +135 -71
  171. package/src/theme/themes/dark.ts +44 -43
  172. package/src/theme/themes/light.ts +40 -38
  173. package/src/theme/themes/palette.ts +32 -30
  174. package/src/theme/themes/shared.ts +17 -17
  175. package/src/theme/utils/GlobalStyles.ts +10 -6
  176. package/src/theme/utils/appFrameDocumentStyles.mjs +6 -1
  177. package/src/theme/utils/cssVariables.ts +169 -0
  178. package/src/writing/DraftAssistantDialog.tsx +85 -85
  179. package/src/writing/WritingStyleManager.tsx +6 -3
  180. package/src/writing/draftTextWithAgent.ts +47 -50
  181. package/src/writing/styleStore.ts +4 -3
  182. package/src/writing/writingStyle.test.ts +8 -2
  183. package/src/writing/writingStyle.ts +19 -8
@@ -53,11 +53,11 @@ export interface DataChartBlock {
53
53
  chartType?: DataChartType
54
54
  }
55
55
 
56
- const INK = '#2e3338'
57
- const MUTED = '#757e8a'
58
- const FAINT = '#a5adb8'
59
- const GRID = '#e5e9ee'
60
- const AXIS = '#8d96a2'
56
+ const INK = '#1c1a17'
57
+ const MUTED = '#6b665e'
58
+ const FAINT = '#a8a299'
59
+ const GRID = '#e7e4dd'
60
+ const AXIS = '#8f897f'
61
61
 
62
62
  function valueLabel(value: DataCellValue): string {
63
63
  return value === null ? '' : String(value)
@@ -166,10 +166,14 @@ function chartRowsForView({
166
166
  const existing = groups.get(label)
167
167
  if (existing) {
168
168
  hasRepeatedGroup = true
169
- for (const key of yKeys) existing[key] = numeric(existing[key]) + numeric(row[key])
169
+ for (const key of yKeys)
170
+ existing[key] = numeric(existing[key]) + numeric(row[key])
170
171
  continue
171
172
  }
172
- const groupedRow: Record<string, DataCellValue> = { ...row, [groupKey]: label }
173
+ const groupedRow: Record<string, DataCellValue> = {
174
+ ...row,
175
+ [groupKey]: label,
176
+ }
173
177
  for (const key of yKeys) groupedRow[key] = numeric(row[key])
174
178
  groups.set(label, groupedRow)
175
179
  }
@@ -280,19 +284,22 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
280
284
  histogramDomain[0] === histogramDomain[1]
281
285
  ? 1
282
286
  : (histogramDomain[1] - histogramDomain[0]) / histogramBinCount
283
- const histogramBins = Array.from({ length: histogramBinCount }, (_, index) => {
284
- const start = (histogramDomain[0] ?? 0) + histogramStep * index
285
- const end =
286
- index === histogramBinCount - 1
287
- ? histogramDomain[1] ?? start
288
- : start + histogramStep
289
- const count = histogramValues.filter(value =>
290
- index === histogramBinCount - 1
291
- ? value >= start && value <= end
292
- : value >= start && value < end,
293
- ).length
294
- return { start, end, count }
295
- })
287
+ const histogramBins = Array.from(
288
+ { length: histogramBinCount },
289
+ (_, index) => {
290
+ const start = (histogramDomain[0] ?? 0) + histogramStep * index
291
+ const end =
292
+ index === histogramBinCount - 1
293
+ ? histogramDomain[1] ?? start
294
+ : start + histogramStep
295
+ const count = histogramValues.filter(value =>
296
+ index === histogramBinCount - 1
297
+ ? value >= start && value <= end
298
+ : value >= start && value < end,
299
+ ).length
300
+ return { start, end, count }
301
+ },
302
+ )
296
303
  const histogramY = scaleLinear()
297
304
  .domain([0, max(histogramBins, bin => bin.count) ?? 1])
298
305
  .nice()
@@ -317,8 +324,7 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
317
324
  ): item is {
318
325
  label: string
319
326
  stats: NonNullable<ReturnType<typeof quartiles>>
320
- } =>
321
- item.stats !== null,
327
+ } => item.stats !== null,
322
328
  )
323
329
  const boxY = scaleLinear()
324
330
  .domain([
@@ -380,7 +386,7 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
380
386
  x={margin.left}
381
387
  y={26}
382
388
  fill={INK}
383
- fontFamily="Source Sans 3, system-ui, sans-serif"
389
+ fontFamily="Archivo, system-ui, sans-serif"
384
390
  fontSize="18"
385
391
  fontWeight="700"
386
392
  >
@@ -390,7 +396,7 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
390
396
  x={margin.left}
391
397
  y={44}
392
398
  fill={MUTED}
393
- fontFamily="Source Sans 3, system-ui, sans-serif"
399
+ fontFamily="Archivo, system-ui, sans-serif"
394
400
  fontSize="11"
395
401
  fontWeight="600"
396
402
  >
@@ -400,7 +406,12 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
400
406
  {showInlineLegend ? (
401
407
  <g transform={`translate(${Math.max(0, innerWidth - 168)},-30)`}>
402
408
  {yKeys.slice(0, 4).map((key, index) => (
403
- <g key={key} transform={`translate(${(index % 2) * 84},${Math.floor(index / 2) * 16})`}>
409
+ <g
410
+ key={key}
411
+ transform={`translate(${(index % 2) * 84},${
412
+ Math.floor(index / 2) * 16
413
+ })`}
414
+ >
404
415
  <line
405
416
  x1={0}
406
417
  x2={14}
@@ -414,7 +425,7 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
414
425
  x={20}
415
426
  y={4}
416
427
  fill={MUTED}
417
- fontFamily="Source Sans 3, system-ui, sans-serif"
428
+ fontFamily="Archivo, system-ui, sans-serif"
418
429
  fontSize="10"
419
430
  fontWeight="700"
420
431
  >
@@ -440,7 +451,7 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
440
451
  textAnchor="middle"
441
452
  y={-4}
442
453
  fill={INK}
443
- fontFamily="Source Sans 3, system-ui, sans-serif"
454
+ fontFamily="Archivo, system-ui, sans-serif"
444
455
  fontSize="22"
445
456
  fontWeight="800"
446
457
  >
@@ -450,7 +461,7 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
450
461
  textAnchor="middle"
451
462
  y={17}
452
463
  fill={MUTED}
453
- fontFamily="Source Sans 3, system-ui, sans-serif"
464
+ fontFamily="Archivo, system-ui, sans-serif"
454
465
  fontSize="11"
455
466
  fontWeight="700"
456
467
  >
@@ -475,7 +486,7 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
475
486
  x={16}
476
487
  y={4}
477
488
  fill={INK}
478
- fontFamily="Source Sans 3, system-ui, sans-serif"
489
+ fontFamily="Archivo, system-ui, sans-serif"
479
490
  fontSize="12"
480
491
  fontWeight="700"
481
492
  >
@@ -486,7 +497,7 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
486
497
  y={4}
487
498
  textAnchor="end"
488
499
  fill={MUTED}
489
- fontFamily="Source Sans 3, system-ui, sans-serif"
500
+ fontFamily="Archivo, system-ui, sans-serif"
490
501
  fontSize="11"
491
502
  fontWeight="700"
492
503
  >
@@ -515,7 +526,7 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
515
526
  y={4}
516
527
  textAnchor="end"
517
528
  fill={MUTED}
518
- fontFamily="Source Sans 3, system-ui, sans-serif"
529
+ fontFamily="Archivo, system-ui, sans-serif"
519
530
  fontSize="11"
520
531
  fontWeight="600"
521
532
  >
@@ -550,7 +561,7 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
550
561
  x={0}
551
562
  y={rowY + 4}
552
563
  fill={INK}
553
- fontFamily="Source Sans 3, system-ui, sans-serif"
564
+ fontFamily="Archivo, system-ui, sans-serif"
554
565
  fontSize="12"
555
566
  fontWeight="700"
556
567
  >
@@ -576,7 +587,7 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
576
587
  x={180 + lollipopX(value)}
577
588
  y={rowY + 4}
578
589
  fill={MUTED}
579
- fontFamily="Source Sans 3, system-ui, sans-serif"
590
+ fontFamily="Archivo, system-ui, sans-serif"
580
591
  fontSize="11"
581
592
  fontWeight="700"
582
593
  >
@@ -598,7 +609,7 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
598
609
  x={0}
599
610
  y={rowY + 4}
600
611
  fill={INK}
601
- fontFamily="Source Sans 3, system-ui, sans-serif"
612
+ fontFamily="Archivo, system-ui, sans-serif"
602
613
  fontSize="11"
603
614
  fontWeight="700"
604
615
  >
@@ -617,7 +628,7 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
617
628
  x={Math.min(innerWidth - 28, 188 + barWidth)}
618
629
  y={rowY + 4}
619
630
  fill={MUTED}
620
- fontFamily="Source Sans 3, system-ui, sans-serif"
631
+ fontFamily="Archivo, system-ui, sans-serif"
621
632
  fontSize="10"
622
633
  fontWeight="700"
623
634
  >
@@ -646,7 +657,7 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
646
657
  y={innerHeight + 24}
647
658
  textAnchor="middle"
648
659
  fill={FAINT}
649
- fontFamily="Source Sans 3, system-ui, sans-serif"
660
+ fontFamily="Archivo, system-ui, sans-serif"
650
661
  fontSize="10"
651
662
  fontWeight="700"
652
663
  >
@@ -675,7 +686,10 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
675
686
  x={x}
676
687
  y={boxY(item.stats.q3)}
677
688
  width={boxX.bandwidth()}
678
- height={Math.max(2, boxY(item.stats.q1) - boxY(item.stats.q3))}
689
+ height={Math.max(
690
+ 2,
691
+ boxY(item.stats.q1) - boxY(item.stats.q3),
692
+ )}
679
693
  rx={5}
680
694
  fill={color}
681
695
  opacity={0.22}
@@ -695,7 +709,7 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
695
709
  y={innerHeight + 24}
696
710
  textAnchor="middle"
697
711
  fill={FAINT}
698
- fontFamily="Source Sans 3, system-ui, sans-serif"
712
+ fontFamily="Archivo, system-ui, sans-serif"
699
713
  fontSize="10"
700
714
  fontWeight="700"
701
715
  >
@@ -708,8 +722,10 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
708
722
  {chartType === 'heatmap'
709
723
  ? heatmapRows.flatMap(rowLabel =>
710
724
  heatmapColumns.map(columnLabel => {
711
- const value = heatmapValues.get(`${columnLabel}::${rowLabel}`) ?? 0
712
- const opacity = heatmapMax > 0 ? 0.12 + (value / heatmapMax) * 0.72 : 0.12
725
+ const value =
726
+ heatmapValues.get(`${columnLabel}::${rowLabel}`) ?? 0
727
+ const opacity =
728
+ heatmapMax > 0 ? 0.12 + (value / heatmapMax) * 0.72 : 0.12
713
729
  return (
714
730
  <g key={`${columnLabel}-${rowLabel}`}>
715
731
  <rect
@@ -723,11 +739,18 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
723
739
  />
724
740
  {heatmapX.bandwidth() > 46 && heatmapY.bandwidth() > 24 ? (
725
741
  <text
726
- x={(heatmapX(columnLabel) ?? 0) + heatmapX.bandwidth() / 2}
727
- y={(heatmapY(rowLabel) ?? 0) + heatmapY.bandwidth() / 2 + 4}
742
+ x={
743
+ (heatmapX(columnLabel) ?? 0) +
744
+ heatmapX.bandwidth() / 2
745
+ }
746
+ y={
747
+ (heatmapY(rowLabel) ?? 0) +
748
+ heatmapY.bandwidth() / 2 +
749
+ 4
750
+ }
728
751
  textAnchor="middle"
729
752
  fill={INK}
730
- fontFamily="Source Sans 3, system-ui, sans-serif"
753
+ fontFamily="Archivo, system-ui, sans-serif"
731
754
  fontSize="10"
732
755
  fontWeight="700"
733
756
  >
@@ -747,7 +770,7 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
747
770
  y={innerHeight + 24}
748
771
  textAnchor="middle"
749
772
  fill={FAINT}
750
- fontFamily="Source Sans 3, system-ui, sans-serif"
773
+ fontFamily="Archivo, system-ui, sans-serif"
751
774
  fontSize="10"
752
775
  fontWeight="700"
753
776
  >
@@ -763,7 +786,7 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
763
786
  y={(heatmapY(rowLabel) ?? 0) + heatmapY.bandwidth() / 2 + 4}
764
787
  textAnchor="end"
765
788
  fill={MUTED}
766
- fontFamily="Source Sans 3, system-ui, sans-serif"
789
+ fontFamily="Archivo, system-ui, sans-serif"
767
790
  fontSize="10"
768
791
  fontWeight="700"
769
792
  >
@@ -826,56 +849,58 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
826
849
  chartType === 'heatmap' ||
827
850
  chartType === 'stackedBar'
828
851
  ? null
829
- : (chartType === 'bubble' ? yKeys.slice(0, 1) : yKeys).map((key, index) => {
830
- const path = line<Record<string, DataCellValue>>()
831
- .x((_, rowIndex) => pointX(String(rowIndex)) ?? 0)
832
- .y(row => y(numeric(row[key])))(rows)
833
- const areaPath = area<Record<string, DataCellValue>>()
834
- .x((_, rowIndex) => pointX(String(rowIndex)) ?? 0)
835
- .y0(zeroY)
836
- .y1(row => y(numeric(row[key])))(rows)
837
- const color = colors[index % colors.length]
838
- return (
839
- <g key={key}>
840
- {chartType === 'area' ? (
841
- <path d={areaPath ?? ''} fill={color} opacity={0.18} />
842
- ) : null}
843
- {chartType !== 'scatter' && chartType !== 'bubble' ? (
844
- <path
845
- d={path ?? ''}
846
- fill="none"
847
- stroke={color}
848
- strokeWidth={2.2}
849
- />
850
- ) : null}
851
- {rows.map((row, rowIndex) => (
852
- <g key={`${key}-${rowIndex}-${valueLabel(row[xKey])}`}>
853
- <circle
854
- cx={pointX(String(rowIndex)) ?? 0}
855
- cy={y(numeric(row[key]))}
856
- r={
857
- chartType === 'bubble'
858
- ? bubbleSize(numeric(row[bubbleKey]))
859
- : chartType === 'scatter'
860
- ? 4
861
- : rowIndex === rows.length - 1
862
- ? 3.8
863
- : 2.7
864
- }
865
- fill={chartType === 'area' ? '#fff' : color}
852
+ : (chartType === 'bubble' ? yKeys.slice(0, 1) : yKeys).map(
853
+ (key, index) => {
854
+ const path = line<Record<string, DataCellValue>>()
855
+ .x((_, rowIndex) => pointX(String(rowIndex)) ?? 0)
856
+ .y(row => y(numeric(row[key])))(rows)
857
+ const areaPath = area<Record<string, DataCellValue>>()
858
+ .x((_, rowIndex) => pointX(String(rowIndex)) ?? 0)
859
+ .y0(zeroY)
860
+ .y1(row => y(numeric(row[key])))(rows)
861
+ const color = colors[index % colors.length]
862
+ return (
863
+ <g key={key}>
864
+ {chartType === 'area' ? (
865
+ <path d={areaPath ?? ''} fill={color} opacity={0.18} />
866
+ ) : null}
867
+ {chartType !== 'scatter' && chartType !== 'bubble' ? (
868
+ <path
869
+ d={path ?? ''}
870
+ fill="none"
866
871
  stroke={color}
867
- strokeWidth={chartType === 'area' ? 1.8 : 0}
868
- opacity={
869
- chartType === 'line' && rowIndex !== rows.length - 1
870
- ? 0.82
871
- : 1
872
- }
872
+ strokeWidth={2.2}
873
873
  />
874
- </g>
875
- ))}
876
- </g>
877
- )
878
- })}
874
+ ) : null}
875
+ {rows.map((row, rowIndex) => (
876
+ <g key={`${key}-${rowIndex}-${valueLabel(row[xKey])}`}>
877
+ <circle
878
+ cx={pointX(String(rowIndex)) ?? 0}
879
+ cy={y(numeric(row[key]))}
880
+ r={
881
+ chartType === 'bubble'
882
+ ? bubbleSize(numeric(row[bubbleKey]))
883
+ : chartType === 'scatter'
884
+ ? 4
885
+ : rowIndex === rows.length - 1
886
+ ? 3.8
887
+ : 2.7
888
+ }
889
+ fill={chartType === 'area' ? '#fff' : color}
890
+ stroke={color}
891
+ strokeWidth={chartType === 'area' ? 1.8 : 0}
892
+ opacity={
893
+ chartType === 'line' && rowIndex !== rows.length - 1
894
+ ? 0.82
895
+ : 1
896
+ }
897
+ />
898
+ </g>
899
+ ))}
900
+ </g>
901
+ )
902
+ },
903
+ )}
879
904
  {chartType !== 'donut' &&
880
905
  chartType !== 'lollipop' &&
881
906
  chartType !== 'horizontalBar' &&
@@ -898,7 +923,7 @@ export function DataChart({ block, view, table, palette }: DataChartProps) {
898
923
  y={innerHeight + 25}
899
924
  textAnchor="middle"
900
925
  fill={FAINT}
901
- fontFamily="Source Sans 3, system-ui, sans-serif"
926
+ fontFamily="Archivo, system-ui, sans-serif"
902
927
  fontSize="11"
903
928
  fontWeight="600"
904
929
  >
@@ -45,7 +45,10 @@ function normalizeRows(rows: Record<string, unknown>[]): DataChartTable {
45
45
  return { columns, rows: normalizedRows }
46
46
  }
47
47
 
48
- export function parseDataTable(text: string, format: DataFormat): DataChartTable {
48
+ export function parseDataTable(
49
+ text: string,
50
+ format: DataFormat,
51
+ ): DataChartTable {
49
52
  const trimmed = text.trim()
50
53
  if (!trimmed) return { columns: [], rows: [] }
51
54
 
@@ -0,0 +1,172 @@
1
+ import { useEffect, useState, type ReactElement, type ReactNode } from 'react'
2
+ import { styled } from 'styled-components'
3
+ import { Button } from '../common/buttons/Button.js'
4
+ import { APP_HEADER_ACTIONS_PORTAL_ID } from '../common/containers/AppHeader.js'
5
+ import { ToolbarActionDivider } from '../../editor/index.js'
6
+
7
+ export function useDocumentAppHeaderActionsHost(): HTMLElement | null {
8
+ const [host, setHost] = useState<HTMLElement | null>(null)
9
+
10
+ useEffect(() => {
11
+ let timeout = 0
12
+ const syncHeaderActionsHost = (): void => {
13
+ const nextHost = document.getElementById(APP_HEADER_ACTIONS_PORTAL_ID)
14
+ if (nextHost) nextHost.dataset.layout = 'document-tools'
15
+ setHost(nextHost)
16
+ if (!nextHost) timeout = window.setTimeout(syncHeaderActionsHost, 100)
17
+ }
18
+ syncHeaderActionsHost()
19
+ return () => {
20
+ window.clearTimeout(timeout)
21
+ const currentHost = document.getElementById(APP_HEADER_ACTIONS_PORTAL_ID)
22
+ if (currentHost?.dataset.layout === 'document-tools')
23
+ delete currentHost.dataset.layout
24
+ }
25
+ }, [])
26
+
27
+ return host
28
+ }
29
+
30
+ export const DocumentAppHeaderBar = styled.div`
31
+ display: flex;
32
+ align-items: center;
33
+ gap: 8px;
34
+ width: 100%;
35
+ min-width: 0;
36
+ min-height: 34px;
37
+ overflow: hidden;
38
+ background: var(--pure-chrome-wordmark-bar, #fbfbfc);
39
+ `
40
+
41
+ export const DocumentAppHeaderDivider = styled(ToolbarActionDivider)`
42
+ flex: 0 0 auto;
43
+ `
44
+
45
+ export const DocumentAppTitleTab = styled.button`
46
+ position: relative;
47
+ display: inline-flex;
48
+ flex: 0 1 clamp(220px, 28vw, 420px);
49
+ align-self: stretch;
50
+ align-items: center;
51
+ gap: 14px;
52
+ min-width: 180px;
53
+ overflow: hidden;
54
+ color: var(--pure-chrome-ink, var(--platform-colors-text));
55
+ font-family: var(--platform-typography-font-family-serif, Georgia, serif);
56
+ font-size: 16.5px;
57
+ font-weight: 500;
58
+ line-height: 1.2;
59
+ border: 0;
60
+ padding: 0;
61
+ background: transparent;
62
+ cursor: default;
63
+ text-overflow: ellipsis;
64
+ white-space: nowrap;
65
+
66
+ `
67
+
68
+ export const DocumentAppViewTabButton = styled(Button).attrs({
69
+ variant: 'text' as const,
70
+ size: 'sm' as const,
71
+ })`
72
+ color: var(--pure-chrome-tertiary, #8a857c);
73
+ font-size: 13px;
74
+ font-weight: 400;
75
+
76
+ &:hover:not(:disabled) {
77
+ color: var(--pure-chrome-ink, #1c1a17);
78
+ text-decoration: none;
79
+ }
80
+ `
81
+
82
+ export const DocumentAppTitleText = styled.span`
83
+ position: relative;
84
+ display: inline-flex;
85
+ align-self: stretch;
86
+ align-items: center;
87
+ min-width: 0;
88
+ overflow: hidden;
89
+ text-overflow: ellipsis;
90
+ white-space: nowrap;
91
+
92
+ &::after {
93
+ position: absolute;
94
+ right: 0;
95
+ bottom: 0;
96
+ left: 0;
97
+ height: 1px;
98
+ background: var(--pure-chrome-accent-green, #1f9d57);
99
+ content: '';
100
+ }
101
+ `
102
+
103
+ export const DocumentAppTitleMeta = styled.span`
104
+ flex: 0 0 auto;
105
+ color: var(--pure-chrome-faint, var(--platform-colors-text-tertiary));
106
+ font-family: var(
107
+ --platform-typography-font-family-mono,
108
+ 'JetBrains Mono',
109
+ monospace
110
+ );
111
+ font-size: 13px;
112
+ font-weight: 400;
113
+ line-height: 1.2;
114
+ `
115
+
116
+ export const DocumentAppViewTabs = styled.div`
117
+ display: inline-flex;
118
+ flex: 0 0 auto;
119
+ align-items: center;
120
+ gap: 16px;
121
+ min-width: 0;
122
+ `
123
+
124
+ export const DocumentAppActions = styled.div`
125
+ display: flex;
126
+ flex: 1 1 auto;
127
+ align-items: center;
128
+ justify-content: flex-end;
129
+ gap: 14px;
130
+ min-width: 0;
131
+ overflow: hidden;
132
+ `
133
+
134
+ export const DocumentAppActionGroup = styled.div`
135
+ display: inline-flex;
136
+ flex: 0 1 auto;
137
+ align-items: center;
138
+ gap: 2px;
139
+ min-width: 0;
140
+ `
141
+
142
+ export const DocumentAppSaveStatus = styled.span`
143
+ flex: 0 0 auto;
144
+ color: var(--pure-chrome-faint, var(--platform-colors-text-tertiary));
145
+ font-family: var(
146
+ --platform-typography-font-family-mono,
147
+ 'JetBrains Mono',
148
+ monospace
149
+ );
150
+ font-size: 12px;
151
+ line-height: 1.2;
152
+ white-space: nowrap;
153
+ `
154
+
155
+ export function DocumentAppHeaderTitle({
156
+ title,
157
+ meta,
158
+ }: {
159
+ title: ReactNode
160
+ meta?: ReactNode
161
+ }): ReactElement {
162
+ return (
163
+ <DocumentAppTitleTab
164
+ type="button"
165
+ aria-selected="true"
166
+ title={typeof title === 'string' ? title : undefined}
167
+ >
168
+ <DocumentAppTitleText>{title}</DocumentAppTitleText>
169
+ {meta ? <DocumentAppTitleMeta>{meta}</DocumentAppTitleMeta> : null}
170
+ </DocumentAppTitleTab>
171
+ )
172
+ }
@@ -91,7 +91,7 @@ const StyledPopover = styled.div`
91
91
  width: min(360px, calc(100vw - 32px));
92
92
  transform: translateX(-50%);
93
93
  border: 1px solid rgb(from var(--platform-colors-border) r g b / 0.92);
94
- border-radius: 10px;
94
+ border-radius: var(--platform-radius-md, 0px);
95
95
  background: var(--platform-colors-surface);
96
96
  box-shadow: 0 18px 44px rgb(from var(--platform-colors-text) r g b / 0.16);
97
97
  color: var(--platform-colors-text);
@@ -52,7 +52,7 @@ const StyledLinkInput = styled(BareInput)`
52
52
  height: 32px;
53
53
  padding: 0 var(--platform-spacing-sm);
54
54
  border: 1px solid var(--platform-colors-border);
55
- border-radius: 4px;
55
+ border-radius: var(--platform-radius-sm, 0px);
56
56
  background: var(--platform-colors-surface);
57
57
  color: var(--platform-colors-text);
58
58
  font-size: var(--platform-typography-font-size-sm);
@@ -118,13 +118,15 @@ describe('PrintDesignPanel', () => {
118
118
 
119
119
  expect(container.textContent).toContain('Design - PDF Typesetter')
120
120
  expect(container.textContent).toContain('Export PDF')
121
- expect(container.querySelector('[aria-label="Print design"]')).not.toBeNull()
121
+ expect(
122
+ container.querySelector('[aria-label="Print design"]'),
123
+ ).not.toBeNull()
122
124
  expect(
123
125
  container.querySelector('[aria-label="Close print design"]'),
124
126
  ).not.toBeNull()
125
- expect(container.textContent?.match(/Design - PDF Typesetter/g)).toHaveLength(
126
- 1,
127
- )
127
+ expect(
128
+ container.textContent?.match(/Design - PDF Typesetter/g),
129
+ ).toHaveLength(1)
128
130
  expect(document.head.textContent).toMatch(/width:\s*100vw/)
129
131
  expect(document.head.textContent).toMatch(/height:\s*100vh/)
130
132
  expect(document.head.textContent).toMatch(/border-radius:\s*0/)
@@ -808,9 +810,9 @@ describe('PrintDesignPanel', () => {
808
810
  measure: '32rem',
809
811
  lead: 1.6,
810
812
  fonts: expect.objectContaining({
811
- display: '"Source Sans 3", system-ui, sans-serif',
813
+ display: '"Archivo", system-ui, sans-serif',
812
814
  serif: '"Source Serif 4", Georgia, serif',
813
- sans: '"Source Sans 3", system-ui, sans-serif',
815
+ sans: '"Archivo", system-ui, sans-serif',
814
816
  }),
815
817
  }),
816
818
  setting: expect.objectContaining({