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.
- package/dist/cli.cjs +3 -3
- package/dist/server.cjs +15 -7
- package/dist/viewer/ArtboardLayout-CEMDFlf8.js +4 -0
- package/dist/viewer/{Canvas-BGsWPJ-x.js → Canvas-rA-WWhK0.js} +1 -1
- package/dist/viewer/{PreviewLayout-C8gcd1VB.js → PreviewLayout-D1TSafCI.js} +2 -2
- package/dist/viewer/index.js +2 -2
- package/dist/viewer/preview.html +2 -2
- package/dist/viewer/preview.js +1 -1
- package/dist/viewer/view-D7nULBen.js +1 -0
- package/dist/viewer-lib/{Canvas-CNqEckLj.js → Canvas-OcYUm3tP.js} +1 -1
- package/dist/viewer-lib/{PreviewView-BD64tt21.js → PreviewView-Clnb4pmR.js} +55 -45
- package/dist/viewer-lib/core.js +2 -2
- package/dist/viewer-lib/index.js +1259 -1229
- package/dist/viewer-lib/types/src/viewer/hooks/useBoardTiers.d.ts +2 -1
- package/dist/viewer-lib/types/src/viewer/layouts/PhoneArtboard.d.ts +2 -1
- package/dist/viewer-lib/types/src/viewer/lib/board-tiers.d.ts +5 -3
- package/dist/viewer-lib/types/src/viewer/lib/hover-dwell.d.ts +1 -1
- package/dist/viewer-lib/types/src/viewer/lib/live-limit.d.ts +33 -0
- package/dist/viewer-lib/types/src/viewer/lib/tier-controller.d.ts +1 -0
- package/package.json +1 -1
- package/dist/viewer/ArtboardLayout-1sSly5VR.js +0 -4
- package/dist/viewer/view-V7XcFKme.js +0 -1
|
@@ -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[];
|
|
@@ -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;
|