ryugi-artifacts 1.44.2 → 1.45.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.
@@ -2,7 +2,7 @@ import { type BoardSpec } from '../../shared/types';
2
2
  import { type BoardRender } from '../lib/board-tiers';
3
3
  import { type SnapshotStore } from '../lib/snapshot-store';
4
4
  import type { View } from '../lib/view';
5
- export declare function useBoardTiers({ artifact, boards, versions, pending, view, scaling, viewport, pinned, hovered, hoverPromotes, persistable, store: provided, }: {
5
+ export declare function useBoardTiers({ artifact, boards, versions, pending, view, scaling, viewport, pinned, hovered, hoverPromotes, persistable, preview, store: provided, }: {
6
6
  artifact: string;
7
7
  boards: [string, BoardSpec][];
8
8
  versions: Record<string, number>;
@@ -17,6 +17,7 @@ export declare function useBoardTiers({ artifact, boards, versions, pending, vie
17
17
  hovered: string | null;
18
18
  hoverPromotes: boolean;
19
19
  persistable: (id: string) => boolean;
20
+ preview?: boolean;
20
21
  store?: SnapshotStore;
21
22
  }): {
22
23
  renders: Map<string, BoardRender>;
@@ -13,8 +13,9 @@ interface Props {
13
13
  live?: boolean;
14
14
  loaded: boolean;
15
15
  pending: string[];
16
+ tiers?: boolean;
16
17
  versions: Record<string, number>;
17
18
  warnings: string[];
18
19
  }
19
- export declare function PhoneArtboard({ id, canvas, layout, warnings, pending, contentBase, versions, live, loaded, agent, comments, actions, }: Props): import("react").JSX.Element;
20
+ export declare function PhoneArtboard({ id, artifact, canvas, layout, warnings, pending, contentBase, versions, live, loaded, agent, comments, actions, tiers: tiered, }: Props): import("react").JSX.Element;
20
21
  export {};
@@ -3,7 +3,6 @@ export declare const SNAPSHOT_SCALES: readonly [0.125, 0.25, 0.5, 1, 2];
3
3
  export type SnapshotScale = (typeof SNAPSHOT_SCALES)[number];
4
4
  export type BoardTier = 'live' | 'snapshot' | 'placeholder' | 'empty';
5
5
  export declare const LIVE_MIN_ZOOM = 0.4;
6
- export declare const LIVE_MAX = 8;
7
6
  export declare const WARM_MIN_WIDTH = 120;
8
7
  export interface TierBoard {
9
8
  h: number;
@@ -15,8 +14,10 @@ export interface TierBoard {
15
14
  export interface TierInput {
16
15
  boards: TierBoard[];
17
16
  hovered?: string | null;
17
+ limit?: number;
18
18
  pinned: ReadonlySet<string>;
19
19
  snapshots: ReadonlySet<string>;
20
+ untilSnapshot?: boolean;
20
21
  view: View;
21
22
  viewport: {
22
23
  width: number;
@@ -31,8 +32,9 @@ export interface BoardRender {
31
32
  tier: BoardTier;
32
33
  }
33
34
  export declare const snapshotScale: (k: number, dpr: number) => SnapshotScale;
34
- export declare function chooseTiers({ boards, view, viewport, pinned, snapshots, hovered, }: TierInput): Map<string, BoardTier>;
35
+ export declare function chooseTiers({ boards, view, viewport, pinned, snapshots, hovered, limit, untilSnapshot, }: TierInput): Map<string, BoardTier>;
35
36
  export declare function visibleRenders({ boards, view, viewport, }: Pick<TierInput, 'boards' | 'view' | 'viewport'>): Map<string, BoardRender>;
36
- export declare function boardsToWarm({ boards, view, viewport, snapshots, skip, }: Pick<TierInput, 'boards' | 'view' | 'viewport' | 'snapshots'> & {
37
+ export declare function boardsToWarm({ boards, view, viewport, snapshots, skip, minWidth, }: Pick<TierInput, 'boards' | 'view' | 'viewport' | 'snapshots'> & {
38
+ minWidth?: number;
37
39
  skip: ReadonlySet<string>;
38
40
  }): string[];
@@ -1,4 +1,4 @@
1
- export declare const HOVER_DWELL_MS = 600;
1
+ export declare const HOVER_DWELL_MS = 150;
2
2
  interface Point {
3
3
  x: number;
4
4
  y: number;
@@ -0,0 +1,33 @@
1
+ export declare const LIVE_LIMIT_MIN = 8;
2
+ export declare const LIVE_LIMIT_MAX = 32;
3
+ export declare const DEFAULT_LIVE_LIMIT = 24;
4
+ export declare const REFERENCE_VIEWPORT: {
5
+ readonly width: 1440;
6
+ readonly height: 900;
7
+ };
8
+ export interface DeviceProfile {
9
+ cores?: number;
10
+ memoryGB?: number;
11
+ }
12
+ export interface LiveLimitInput {
13
+ device?: DeviceProfile;
14
+ viewport: {
15
+ width: number;
16
+ height: number;
17
+ };
18
+ }
19
+ /**
20
+ * How many live board frames the viewer may mount.
21
+ *
22
+ * Measured on the real viewer (headless Chrome, DPR 1): a static board costs
23
+ * ~0.3 MB of JS heap and ~0.02 s of main-thread time to mount, then no idle
24
+ * CPU; a 32-frame page holds ~10 MB of heap and ~0.8 s of task time. Raster
25
+ * surfaces are 2-4 MB per frame at DPR 1, so Retina screens are the upper
26
+ * bound. The old fixed 8 assumed 50-80 MB per frame, which is not what the
27
+ * snapshots-and-tiers viewer does.
28
+ *
29
+ * The budget scales with the screen (a larger viewport keeps more boards
30
+ * mostly visible) and with the device (low-memory or few-core machines keep
31
+ * the old conservative 8).
32
+ */
33
+ export declare function liveLimit({ device, viewport }: LiveLimitInput): number;
@@ -2,6 +2,7 @@ import { type BoardTier, type TierInput } from './board-tiers';
2
2
  export interface ControllerInput extends TierInput {
3
3
  hovered: string | null;
4
4
  hoverPromotes: boolean;
5
+ maxMounting?: number;
5
6
  scaling: boolean;
6
7
  warm?: readonly string[];
7
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ryugi-artifacts",
3
- "version": "1.44.2",
3
+ "version": "1.45.0",
4
4
  "description": "Server and viewer for the Ryugi artifacts app",
5
5
  "repository": {
6
6
  "type": "git",