@buoy-gg/shared-ui 7.0.32 → 7.0.33
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/lib/commonjs/JsModal.js +13 -6
- package/lib/commonjs/hooks/safe-area-impl.js +1 -1
- package/lib/commonjs/storage/devToolsStorageKeys.js +12 -0
- package/lib/commonjs/ui/components/EmptyState.js +10 -2
- package/lib/commonjs/ui/components/ToolEmptyState.js +154 -0
- package/lib/commonjs/ui/components/WindowControls.js +8 -5
- package/lib/commonjs/ui/components/index.js +13 -0
- package/lib/commonjs/ui/index.js +12 -0
- package/lib/commonjs/ui/otto/OttoSprite.js +510 -0
- package/lib/commonjs/ui/otto/index.js +38 -0
- package/lib/commonjs/ui/otto/ottoEngine.js +2734 -0
- package/lib/commonjs/ui/otto/ottoSheet.js +191 -0
- package/lib/module/JsModal.js +13 -6
- package/lib/module/hooks/safe-area-impl.js +1 -1
- package/lib/module/storage/devToolsStorageKeys.js +12 -0
- package/lib/module/ui/components/EmptyState.js +10 -2
- package/lib/module/ui/components/ToolEmptyState.js +149 -0
- package/lib/module/ui/components/WindowControls.js +8 -5
- package/lib/module/ui/components/index.js +3 -0
- package/lib/module/ui/index.js +4 -1
- package/lib/module/ui/otto/OttoSprite.js +496 -0
- package/lib/module/ui/otto/index.js +20 -0
- package/lib/module/ui/otto/ottoEngine.js +2726 -0
- package/lib/module/ui/otto/ottoSheet.js +180 -0
- package/lib/typescript/commonjs/JsModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/commonjs/storage/devToolsStorageKeys.d.ts +12 -0
- package/lib/typescript/commonjs/storage/devToolsStorageKeys.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/EmptyState.d.ts +14 -1
- package/lib/typescript/commonjs/ui/components/EmptyState.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ToolEmptyState.d.ts +113 -0
- package/lib/typescript/commonjs/ui/components/ToolEmptyState.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/WindowControls.d.ts +7 -1
- package/lib/typescript/commonjs/ui/components/WindowControls.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/index.d.ts +2 -0
- package/lib/typescript/commonjs/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +1 -0
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/otto/OttoSprite.d.ts +103 -0
- package/lib/typescript/commonjs/ui/otto/OttoSprite.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/otto/index.d.ts +19 -0
- package/lib/typescript/commonjs/ui/otto/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/otto/ottoEngine.d.ts +2205 -0
- package/lib/typescript/commonjs/ui/otto/ottoEngine.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/otto/ottoSheet.d.ts +73 -0
- package/lib/typescript/commonjs/ui/otto/ottoSheet.d.ts.map +1 -0
- package/lib/typescript/module/JsModal.d.ts.map +1 -1
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/storage/devToolsStorageKeys.d.ts +12 -0
- package/lib/typescript/module/storage/devToolsStorageKeys.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/EmptyState.d.ts +14 -1
- package/lib/typescript/module/ui/components/EmptyState.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ToolEmptyState.d.ts +113 -0
- package/lib/typescript/module/ui/components/ToolEmptyState.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/WindowControls.d.ts +7 -1
- package/lib/typescript/module/ui/components/WindowControls.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/index.d.ts +2 -0
- package/lib/typescript/module/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +1 -0
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/otto/OttoSprite.d.ts +103 -0
- package/lib/typescript/module/ui/otto/OttoSprite.d.ts.map +1 -0
- package/lib/typescript/module/ui/otto/index.d.ts +19 -0
- package/lib/typescript/module/ui/otto/index.d.ts.map +1 -0
- package/lib/typescript/module/ui/otto/ottoEngine.d.ts +2205 -0
- package/lib/typescript/module/ui/otto/ottoEngine.d.ts.map +1 -0
- package/lib/typescript/module/ui/otto/ottoSheet.d.ts +73 -0
- package/lib/typescript/module/ui/otto/ottoSheet.d.ts.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Otto's precomputed animation.
|
|
5
|
+
*
|
|
6
|
+
* Every state is a short loop (48 ticks at most). This module renders that
|
|
7
|
+
* loop once, splits it into a BODY layer and a 7-frame WATER layer (they
|
|
8
|
+
* composite back pixel-for-pixel: compose() only paints water into empty
|
|
9
|
+
* cells and blanks a submerged body below the waterline), dedupes the
|
|
10
|
+
* frames, and turns each distinct frame into merged rectangles. The shipping
|
|
11
|
+
* <Otto/> mounts those rectangles ONCE as a strip of static Views and slides
|
|
12
|
+
* a window over the strip on the UI thread.
|
|
13
|
+
*
|
|
14
|
+
* Why: the buoy-optimize rounds in OTTO_PERF_PLAN.md showed that any renderer
|
|
15
|
+
* re-creating Views per tick pegs the JS thread (5 FPS at 34 sprites, dropped
|
|
16
|
+
* UI frames even at 1 sprite), while "mount once, move a window natively"
|
|
17
|
+
* costs nothing per tick and keeps moving while JS is blocked.
|
|
18
|
+
*
|
|
19
|
+
* Everything here is pure `react-native`-free TypeScript, cached per state.
|
|
20
|
+
*/
|
|
21
|
+
import { OTTO_GRID, OTTO_PALETTE, ottoWaterRows, renderOttoFrame } from "./ottoEngine.js";
|
|
22
|
+
export const CELLS = OTTO_GRID * OTTO_GRID;
|
|
23
|
+
export const WATER_ROW0 = 13;
|
|
24
|
+
export const WATER_ROWS = OTTO_GRID - WATER_ROW0;
|
|
25
|
+
export const WATER_CELLS = WATER_ROWS * OTTO_GRID;
|
|
26
|
+
/** The wave is a function of floor(t/2) mod 7. */
|
|
27
|
+
export const WATER_FRAMES = 7;
|
|
28
|
+
export const TRANSPARENT = "transparent";
|
|
29
|
+
/** Longest state cycle in ticks (idle and sleep are 48). */
|
|
30
|
+
export const MAX_PERIOD = 48;
|
|
31
|
+
export function gridKey(grid) {
|
|
32
|
+
return grid.map(r => r.join("")).join("|");
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Flat 256 colours, row-major, `transparent` for empty cells. */
|
|
36
|
+
export function flatColors(grid) {
|
|
37
|
+
const out = new Array(CELLS);
|
|
38
|
+
for (let y = 0; y < OTTO_GRID; y++) {
|
|
39
|
+
const row = grid[y];
|
|
40
|
+
for (let x = 0; x < OTTO_GRID; x++) out[y * OTTO_GRID + x] = OTTO_PALETTE[row[x]] ?? TRANSPARENT;
|
|
41
|
+
}
|
|
42
|
+
return out;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// ---------------------------------------------------------------- cycle ---
|
|
46
|
+
|
|
47
|
+
const cycleCache = new Map();
|
|
48
|
+
export function ottoCycle(state, keyline) {
|
|
49
|
+
const cacheKey = `${state}|${keyline ? 1 : 0}`;
|
|
50
|
+
const hit = cycleCache.get(cacheKey);
|
|
51
|
+
if (hit) return hit;
|
|
52
|
+
const keys = [];
|
|
53
|
+
const grids = [];
|
|
54
|
+
for (let t = 0; t < MAX_PERIOD * 2; t++) {
|
|
55
|
+
const g = renderOttoFrame(state, t, {
|
|
56
|
+
water: false,
|
|
57
|
+
keyline
|
|
58
|
+
});
|
|
59
|
+
grids.push(g);
|
|
60
|
+
keys.push(gridKey(g));
|
|
61
|
+
}
|
|
62
|
+
let period = MAX_PERIOD;
|
|
63
|
+
for (let P = 1; P <= MAX_PERIOD; P++) {
|
|
64
|
+
let ok = true;
|
|
65
|
+
for (let t = 0; t < MAX_PERIOD; t++) {
|
|
66
|
+
if (keys[t] !== keys[t + P]) {
|
|
67
|
+
ok = false;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (ok) {
|
|
72
|
+
period = P;
|
|
73
|
+
break;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
const body = grids.slice(0, period).map(flatColors);
|
|
77
|
+
const water = [];
|
|
78
|
+
for (let w = 0; w < WATER_FRAMES; w++) {
|
|
79
|
+
const flat = [];
|
|
80
|
+
for (const row of ottoWaterRows(w * 2)) for (const k of row) flat.push(OTTO_PALETTE[k] ?? TRANSPARENT);
|
|
81
|
+
water.push(flat);
|
|
82
|
+
}
|
|
83
|
+
const cycle = {
|
|
84
|
+
period,
|
|
85
|
+
body,
|
|
86
|
+
water
|
|
87
|
+
};
|
|
88
|
+
cycleCache.set(cacheKey, cycle);
|
|
89
|
+
return cycle;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Frame indexes for a cycle at local tick `t`. */
|
|
93
|
+
export function cycleIndexes(t, period) {
|
|
94
|
+
const local = Math.max(0, t);
|
|
95
|
+
return {
|
|
96
|
+
bi: local % period,
|
|
97
|
+
wi: Math.floor(local / 2) % WATER_FRAMES
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// ---------------------------------------------------------------- rects ---
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Same-colour runs per row, then runs merged with the identical run directly
|
|
105
|
+
* below them — roughly a third fewer Views than row runs alone. Covers
|
|
106
|
+
* exactly the non-transparent cells, never overlaps (proved offline over
|
|
107
|
+
* every frame of every state).
|
|
108
|
+
*/
|
|
109
|
+
export function rectsOf(colors, cols, rows) {
|
|
110
|
+
const open = [];
|
|
111
|
+
const done = [];
|
|
112
|
+
for (let y = 0; y < rows; y++) {
|
|
113
|
+
const rowRuns = [];
|
|
114
|
+
let x = 0;
|
|
115
|
+
while (x < cols) {
|
|
116
|
+
const color = colors[y * cols + x];
|
|
117
|
+
let w = 1;
|
|
118
|
+
while (x + w < cols && colors[y * cols + x + w] === color) w++;
|
|
119
|
+
if (color !== TRANSPARENT) rowRuns.push({
|
|
120
|
+
x,
|
|
121
|
+
y,
|
|
122
|
+
w,
|
|
123
|
+
h: 1,
|
|
124
|
+
color
|
|
125
|
+
});
|
|
126
|
+
x += w;
|
|
127
|
+
}
|
|
128
|
+
const next = [];
|
|
129
|
+
for (const r of rowRuns) {
|
|
130
|
+
const above = open.find(o => o.x === r.x && o.w === r.w && o.color === r.color && o.y + o.h === r.y);
|
|
131
|
+
if (above) {
|
|
132
|
+
above.h += 1;
|
|
133
|
+
next.push(above);
|
|
134
|
+
} else {
|
|
135
|
+
next.push(r);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
for (const o of open) if (!next.includes(o)) done.push(o);
|
|
139
|
+
open.length = 0;
|
|
140
|
+
open.push(...next);
|
|
141
|
+
}
|
|
142
|
+
done.push(...open);
|
|
143
|
+
return done;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// ---------------------------------------------------------------- sheets --
|
|
147
|
+
|
|
148
|
+
/** One layer as a strip of distinct frames, and which frame each tick shows. */
|
|
149
|
+
|
|
150
|
+
const sheetCache = new Map();
|
|
151
|
+
function stripOf(frames, cols, rows) {
|
|
152
|
+
const keys = frames.map(f => f.join(","));
|
|
153
|
+
const indexOf = new Map();
|
|
154
|
+
const distinct = [];
|
|
155
|
+
keys.forEach((k, i) => {
|
|
156
|
+
if (!indexOf.has(k)) {
|
|
157
|
+
indexOf.set(k, distinct.length);
|
|
158
|
+
distinct.push(rectsOf(frames[i], cols, rows));
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
return {
|
|
162
|
+
colOf: keys.map(k => indexOf.get(k) ?? 0),
|
|
163
|
+
frames: distinct
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/** Both layers of a state as strips of rectangles. Pure; cached per state. */
|
|
168
|
+
export function ottoSheets(state, keyline) {
|
|
169
|
+
const key = `${state}|${keyline ? 1 : 0}`;
|
|
170
|
+
const hit = sheetCache.get(key);
|
|
171
|
+
if (hit) return hit;
|
|
172
|
+
const cycle = ottoCycle(state, keyline);
|
|
173
|
+
const built = {
|
|
174
|
+
period: cycle.period,
|
|
175
|
+
body: stripOf(cycle.body, OTTO_GRID, OTTO_GRID),
|
|
176
|
+
water: stripOf(cycle.water, OTTO_GRID, WATER_ROWS)
|
|
177
|
+
};
|
|
178
|
+
sheetCache.set(key, built);
|
|
179
|
+
return built;
|
|
180
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JsModal.d.ts","sourceRoot":"","sources":["../../../src/JsModal.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAUL,SAAS,EAEV,MAAM,OAAO,CAAC;AACf,OAAO,EAML,QAAQ,EAGR,SAAS,EAEV,MAAM,cAAc,CAAC;AAyHtB,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;AAEnD;;;;;;;GAOG;AACH,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,OAAO,CAAC;AAE/C,UAAU,YAAY;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAED,UAAU,YAAY;IACpB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,OAAO,CAAC,EAAE,SAAS,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,kBAAk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CAAC,EAAE,OAAO,CAAC;IACrB,iDAAiD;IACjD,OAAO,CAAC,EAAE,YAAY,CAAC;CACxB;AAoyDD,eAAO,MAAM,OAAO,oDAAyB,CAAC"}
|
|
@@ -245,6 +245,18 @@ export declare const devToolsStorageKeys: {
|
|
|
245
245
|
/** Copy/export settings */
|
|
246
246
|
readonly copySettings: () => "@react_buoy_events_copy_settings";
|
|
247
247
|
};
|
|
248
|
+
/**
|
|
249
|
+
* Desktop/MCP sync identity
|
|
250
|
+
*/
|
|
251
|
+
readonly sync: {
|
|
252
|
+
readonly root: () => "@react_buoy_sync";
|
|
253
|
+
/**
|
|
254
|
+
* The per-install id minted the first time this app dials the broker.
|
|
255
|
+
* It is what makes two devices on the same build register as two
|
|
256
|
+
* devices — see core's deviceIdentity.ts.
|
|
257
|
+
*/
|
|
258
|
+
readonly deviceId: () => "@react_buoy_sync_device_id";
|
|
259
|
+
};
|
|
248
260
|
};
|
|
249
261
|
/**
|
|
250
262
|
* Check if a storage key belongs to dev tools
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"devToolsStorageKeys.d.ts","sourceRoot":"","sources":["../../../../src/storage/devToolsStorageKeys.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB;IAC9B;;OAEG;;IAGH;;OAEG;;;;;;;IASH;;OAEG;;;;;;;;IAUH;;;;;;;;;;OAUG;8BACc,MAAM;;QAInB,kEAAkE;;;QAGlE,iCAAiC;sBACnB,MAAM;;IAIxB;;OAEG;;;;;;QAQD,kDAAkD;;QAElD,gCAAgC;;QAGhC,gCAAgC;;;IAKlC;;OAEG;;;QAGD,mCAAmC;;QAEnC,qEAAqE;;;IAIvE;;OAEG;;;;;IAOH;;OAEG;;;;;;;IAQH;;OAEG;;;;;;;IASH;;OAEG;;;;;;;;;;;;;;IAuBH;;;;OAIG;;;;;IAOH;;;;;OAKG;;;;;;;IAQH;;OAEG;;;;;;;;;;;IAiBH;;OAEG;;;;;;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OAAO,CA0BzD;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAE9D;AAED;;;GAGG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,EAAE,CAsBpD"}
|
|
@@ -1,6 +1,19 @@
|
|
|
1
1
|
import { ViewStyle } from "react-native";
|
|
2
2
|
import { LucideIcon } from "../../icons";
|
|
3
|
+
import { type OttoState } from "../otto";
|
|
3
4
|
interface EmptyStateProps {
|
|
5
|
+
/**
|
|
6
|
+
* Show Otto instead of an icon, in this state.
|
|
7
|
+
*
|
|
8
|
+
* Pick the state whose `OTTO_USES` sentence is literally what this empty
|
|
9
|
+
* state is saying — `fishing` for "capture is on, nothing caught yet",
|
|
10
|
+
* `empty` for a genuinely empty list, `sad` for a search that matched
|
|
11
|
+
* nothing. A mascot in the wrong state is worse than none, because this is
|
|
12
|
+
* a debugging tool and the state reads as a status.
|
|
13
|
+
*
|
|
14
|
+
* Opt-in: with no `otto`, this renders exactly as it always has.
|
|
15
|
+
*/
|
|
16
|
+
otto?: OttoState;
|
|
4
17
|
/** Primary message to display */
|
|
5
18
|
title: string;
|
|
6
19
|
/** Optional secondary/description message */
|
|
@@ -24,7 +37,7 @@ interface EmptyStateProps {
|
|
|
24
37
|
/**
|
|
25
38
|
* Reusable empty state component for consistent empty/no-data displays
|
|
26
39
|
*/
|
|
27
|
-
export declare function EmptyState({ title, description, icon: Icon, iconSize, iconColor, action, variant, style, }: EmptyStateProps): import("react").JSX.Element;
|
|
40
|
+
export declare function EmptyState({ otto, title, description, icon: Icon, iconSize, iconColor, action, variant, style, }: EmptyStateProps): import("react").JSX.Element;
|
|
28
41
|
/**
|
|
29
42
|
* Pre-configured empty state for no data scenarios
|
|
30
43
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"EmptyState.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/EmptyState.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,UAAU,eAAe;IACvB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,iCAAiC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0BAA0B;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6BAA6B;IAC7B,MAAM,CAAC,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,MAAM,IAAI,CAAC;KACrB,CAAC;IACF,6BAA6B;IAC7B,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,CAAC;IACzC,6BAA6B;IAC7B,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,KAAK,EACL,WAAW,EACX,IAAI,EAAE,IAAI,EACV,QAAa,EACb,SAAoC,EACpC,MAAM,EACN,OAAmB,EACnB,KAAK,GACN,EAAE,eAAe,+BAsCjB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,gCAO/B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,gCAOlC;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,EACxC,UAAU,GACX,EAAE;IACD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,+BAWA"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one "nothing here" panel, for every tool that shows a list.
|
|
3
|
+
*
|
|
4
|
+
* WHY THIS EXISTS
|
|
5
|
+
*
|
|
6
|
+
* Every capture tool — network, events, highlight-updates, storage, zustand,
|
|
7
|
+
* redux, jotai, console — renders the same panel with the same four causes and
|
|
8
|
+
* different nouns. Written out per tool, that produced four copies of the same
|
|
9
|
+
* layout (each of which had to be re-inset by hand the first time a sentence
|
|
10
|
+
* was longer than "No events yet"), and four independent guesses at the
|
|
11
|
+
* PRECEDENCE between those causes. The guesses disagreed, and the disagreements
|
|
12
|
+
* were bugs:
|
|
13
|
+
*
|
|
14
|
+
* - A search that matched nothing showed "Enable tracking to start
|
|
15
|
+
* capturing" — pointing at a toggle that was already on.
|
|
16
|
+
* - Turning every source chip off showed "Events will appear here as they
|
|
17
|
+
* occur" — inviting you to go generate events that were already in the
|
|
18
|
+
* store, behind your own filter.
|
|
19
|
+
* - Typing into a search box while the store was empty produced no
|
|
20
|
+
* acknowledgement of the query at all, which reads as a dead search box.
|
|
21
|
+
*
|
|
22
|
+
* So the precedence lives here, once, and each tool supplies only what is
|
|
23
|
+
* genuinely its own: the noun, and what "switched on but waiting" looks like
|
|
24
|
+
* for it (network fishes, events listens, the highlighter stares).
|
|
25
|
+
*
|
|
26
|
+
* SPLIT IN TWO ON PURPOSE
|
|
27
|
+
*
|
|
28
|
+
* `resolveListEmptyState` is a pure function returning `{ otto, title,
|
|
29
|
+
* message }`, and `ToolEmptyState` renders that object. Tools with a cause
|
|
30
|
+
* nobody else has — storage's "no issues found" (which is a PASS, not a
|
|
31
|
+
* failure), zustand's unregistered store — resolve the common cases and
|
|
32
|
+
* substitute their own, or skip the resolver and hand the shell a literal.
|
|
33
|
+
* Adding a mascot to every tool at once is then one edit in this file, which is
|
|
34
|
+
* also what makes the Flutter and Swift ports one component to mirror instead
|
|
35
|
+
* of eight.
|
|
36
|
+
*/
|
|
37
|
+
import { type ViewStyle } from "react-native";
|
|
38
|
+
import { type OttoState } from "../otto";
|
|
39
|
+
/** What a "nothing here" panel says. */
|
|
40
|
+
export interface ToolEmptyContent {
|
|
41
|
+
/**
|
|
42
|
+
* Otto's state. It must be TRUE of the branch that chose it — this is a
|
|
43
|
+
* debugging tool, and a mascot in the wrong state reads as a status. See
|
|
44
|
+
* `OTTO_USES` in the engine for what each one claims.
|
|
45
|
+
*/
|
|
46
|
+
otto: OttoState;
|
|
47
|
+
title: string;
|
|
48
|
+
message: string;
|
|
49
|
+
}
|
|
50
|
+
export interface ToolEmptyStateProps extends ToolEmptyContent {
|
|
51
|
+
/**
|
|
52
|
+
* Base testID. Renders `${testID}` on the container, `${testID}-title` and
|
|
53
|
+
* `${testID}-text` on the two lines — the shape the existing e2e suites
|
|
54
|
+
* already select on.
|
|
55
|
+
*/
|
|
56
|
+
testID?: string;
|
|
57
|
+
style?: ViewStyle;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The panel itself: Otto, a heading, a sentence. Nothing else — this only ever
|
|
61
|
+
* renders where the alternative is a blank body, so it has no actions and no
|
|
62
|
+
* decoration to compete with the list it stands in for.
|
|
63
|
+
*/
|
|
64
|
+
export declare function ToolEmptyState({ otto, title, message, testID, style, }: ToolEmptyStateProps): import("react").JSX.Element;
|
|
65
|
+
export interface ListEmptyFacts {
|
|
66
|
+
/**
|
|
67
|
+
* Plural noun for what the list holds — "requests", "events", "components",
|
|
68
|
+
* "changes", "keys". Used in the generated sentences.
|
|
69
|
+
*/
|
|
70
|
+
subject: string;
|
|
71
|
+
/**
|
|
72
|
+
* Past participle for how they got here: "captured" (default), "tracked",
|
|
73
|
+
* "registered". Reads as "None of the 176 tracked components match".
|
|
74
|
+
*/
|
|
75
|
+
verb?: string;
|
|
76
|
+
/**
|
|
77
|
+
* The live search box. A non-empty query ALWAYS wins: whatever else is
|
|
78
|
+
* wrong, the user just typed something and is watching for it to land, and
|
|
79
|
+
* a panel that answers with anything else reads as a search box that does
|
|
80
|
+
* nothing. Never gate this on there being something to match.
|
|
81
|
+
*/
|
|
82
|
+
search?: string;
|
|
83
|
+
/**
|
|
84
|
+
* How many items exist BEFORE the user's own search and filters — the
|
|
85
|
+
* denominator that separates "your filter hid it" from "nothing happened".
|
|
86
|
+
* Leave undefined and both of those collapse into `waiting`/`paused`.
|
|
87
|
+
*/
|
|
88
|
+
total?: number;
|
|
89
|
+
/**
|
|
90
|
+
* The tool's capture/tracking switch. `false` selects `paused`; leave it
|
|
91
|
+
* undefined for tools that have no such switch.
|
|
92
|
+
*/
|
|
93
|
+
capturing?: boolean;
|
|
94
|
+
/** Otto + copy for "switched on, nothing has arrived yet". */
|
|
95
|
+
waiting: ToolEmptyContent;
|
|
96
|
+
/** Copy for "switched off". Otto defaults to `paused`. */
|
|
97
|
+
paused?: Partial<ToolEmptyContent>;
|
|
98
|
+
/**
|
|
99
|
+
* A harder blocker to name in the search branch's body instead of the
|
|
100
|
+
* generated sentence — "Every source chip is off, so there is nothing to
|
|
101
|
+
* search." Clearing the query would not help, and saying "clear the search
|
|
102
|
+
* to see them" when it would not is the lie this exists to prevent.
|
|
103
|
+
*/
|
|
104
|
+
blocked?: string;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Which "nothing here" this is, in the order the facts answer the question.
|
|
108
|
+
*
|
|
109
|
+
* A typed query first (see `search`), then the user's filters, then the
|
|
110
|
+
* capture switch, then the honest "nothing yet".
|
|
111
|
+
*/
|
|
112
|
+
export declare function resolveListEmptyState(facts: ListEmptyFacts): ToolEmptyContent;
|
|
113
|
+
//# sourceMappingURL=ToolEmptyState.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolEmptyState.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/ToolEmptyState.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAA0B,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAG/C,wCAAwC;AACxC,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,IAAI,EAAE,SAAS,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mBAAoB,SAAQ,gBAAgB;IAC3D;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,KAAK,EACL,OAAO,EACP,MAAM,EACN,KAAK,GACN,EAAE,mBAAmB,+BAmBrB;AAED,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,8DAA8D;IAC9D,OAAO,EAAE,gBAAgB,CAAC;IAC1B,0DAA0D;IAC1D,MAAM,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACnC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,cAAc,GAAG,gBAAgB,CAmD7E"}
|
|
@@ -15,12 +15,18 @@ interface WindowControlsProps {
|
|
|
15
15
|
mode?: ModalMode;
|
|
16
16
|
/** Host modal's chrome variant — "night" restyles the expanded popover. */
|
|
17
17
|
variant?: ModalVariant;
|
|
18
|
+
/**
|
|
19
|
+
* Start with the big-button popover open and never auto-dismiss it.
|
|
20
|
+
* For galleries / parity sheets that need the expanded state to sit still
|
|
21
|
+
* for a screenshot; a real modal never sets this.
|
|
22
|
+
*/
|
|
23
|
+
defaultExpanded?: boolean;
|
|
18
24
|
}
|
|
19
25
|
/**
|
|
20
26
|
* iPad-style expandable window controls.
|
|
21
27
|
* Default: small macOS-style colored dots. On tap, expands to reveal
|
|
22
28
|
* large, easy-to-press buttons. Auto-dismisses after timeout or tap outside.
|
|
23
29
|
*/
|
|
24
|
-
export declare function WindowControls({ onClose, onMinimize, onToggleMode, mode, variant, }: WindowControlsProps): import("react").JSX.Element;
|
|
30
|
+
export declare function WindowControls({ onClose, onMinimize, onToggleMode, mode, variant, defaultExpanded, }: WindowControlsProps): import("react").JSX.Element;
|
|
25
31
|
export {};
|
|
26
32
|
//# sourceMappingURL=WindowControls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WindowControls.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/WindowControls.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAe7D;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,QAE3D;AAMD,UAAU,mBAAmB;IAC3B,+BAA+B;IAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,sFAAsF;IACtF,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,2EAA2E;IAC3E,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"WindowControls.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/WindowControls.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAe7D;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,OAAO,QAE3D;AAMD,UAAU,mBAAmB;IAC3B,+BAA+B;IAC/B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;IACxB,sFAAsF;IACtF,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,2EAA2E;IAC3E,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,2EAA2E;IAC3E,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AA+BD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,UAAU,EACV,YAAY,EACZ,IAAI,EACJ,OAAiB,EACjB,eAAe,GAChB,EAAE,mBAAmB,+BAwDrB"}
|
|
@@ -24,6 +24,8 @@ export { DevToolsCard, DEVTOOLS_CARD_CONSTANTS } from "./DevToolsCard";
|
|
|
24
24
|
export type { DevToolsCardProps } from "./DevToolsCard";
|
|
25
25
|
export { HeaderSearchButton } from "./HeaderSearchButton";
|
|
26
26
|
export { EmptyState, NoDataEmptyState, NoResultsEmptyState, NoSearchResultsEmptyState, } from "./EmptyState";
|
|
27
|
+
export { ToolEmptyState, resolveListEmptyState } from "./ToolEmptyState";
|
|
28
|
+
export type { ToolEmptyContent, ToolEmptyStateProps, ListEmptyFacts, } from "./ToolEmptyState";
|
|
27
29
|
export { StatusIndicator } from "./StatusIndicator";
|
|
28
30
|
export { TimeDisplay } from "./TimeDisplay";
|
|
29
31
|
export { DetailView } from "./DetailView";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ui/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cA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AAC7B,OAAO,EAAE,cAAc,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG/D,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,YAAY,EACZ,UAAU,EACV,gBAAgB,GACjB,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,sBAAsB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/index.ts"],"names":[],"mappings":"AAGA,cAAc,cAAc,CAAC;AAG7B,cAAc,eAAe,CAAC;AAG9B,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAG1E,cAAc,UAAU,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/index.ts"],"names":[],"mappings":"AAGA,cAAc,cAAc,CAAC;AAG7B,cAAc,eAAe,CAAC;AAG9B,OAAO,EAAE,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAG1E,cAAc,UAAU,CAAC;AAGzB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import type { StyleProp, ViewStyle } from "react-native";
|
|
2
|
+
import { Animated } from "react-native";
|
|
3
|
+
import { type OttoRenderOptions, type OttoState } from "./ottoEngine";
|
|
4
|
+
import { WATER_FRAMES } from "./ottoSheet";
|
|
5
|
+
/**
|
|
6
|
+
* The tick span every layer of a state loops over. It is a common multiple of
|
|
7
|
+
* the body cycle and the anchor cycle, so a prop held in Otto's hand and the
|
|
8
|
+
* hand itself repeat together.
|
|
9
|
+
*/
|
|
10
|
+
export declare function motionUnits(state: OttoState, keyline?: boolean): number;
|
|
11
|
+
export interface OttoPixelsProps {
|
|
12
|
+
/** A 16×16 grid of palette keys, from `renderOttoFrame`. */
|
|
13
|
+
grid: string[][];
|
|
14
|
+
/** Size of one sprite pixel in points. */
|
|
15
|
+
pixelSize: number;
|
|
16
|
+
style?: StyleProp<ViewStyle>;
|
|
17
|
+
}
|
|
18
|
+
/** Pure renderer: a frame → coloured run Views. Fine for stills; costly per tick. */
|
|
19
|
+
export declare function OttoPixels({ grid, pixelSize, style }: OttoPixelsProps): import("react").JSX.Element;
|
|
20
|
+
export interface OttoStillProps extends OttoRenderOptions {
|
|
21
|
+
/** Default `static`: the base pose, for favicons and stills. */
|
|
22
|
+
state?: OttoState;
|
|
23
|
+
pixelSize?: number;
|
|
24
|
+
style?: StyleProp<ViewStyle>;
|
|
25
|
+
}
|
|
26
|
+
/** Frame 0 of a state, no clock — safe on screens that must not re-render. */
|
|
27
|
+
export declare function OttoStill({ state, pixelSize, water, keyline, style }: OttoStillProps): import("react").JSX.Element;
|
|
28
|
+
/**
|
|
29
|
+
* Walks the demo reel: which state plays now. One React state change per
|
|
30
|
+
* schedule entry (every few seconds), nothing per tick.
|
|
31
|
+
*/
|
|
32
|
+
export declare function useOttoReel(enabled: boolean, tickMs?: number, active?: boolean): OttoState;
|
|
33
|
+
export interface StepOffset {
|
|
34
|
+
x: number;
|
|
35
|
+
y: number;
|
|
36
|
+
}
|
|
37
|
+
/** A style that moves a view through offsets in lock-step with Otto's clock. */
|
|
38
|
+
export type StepMotionStyle = Animated.WithAnimatedObject<ViewStyle> | ViewStyle;
|
|
39
|
+
/**
|
|
40
|
+
* The layer the clock moves.
|
|
41
|
+
*
|
|
42
|
+
* On native this has to be an `Animated.View` — it carries interpolated
|
|
43
|
+
* values. On web the motion is a COMPILED CSS class (see `webStepStyle`), and
|
|
44
|
+
* `Animated.View` flattens its style prop into a fresh object, which loses the
|
|
45
|
+
* identity react-native-web looks the compiled rules up by; the keyframes are
|
|
46
|
+
* then silently dropped and the sprite sits on frame 0. So the web path takes
|
|
47
|
+
* a plain View, which passes the class straight through.
|
|
48
|
+
*/
|
|
49
|
+
declare const OttoMotionView: typeof Animated.View;
|
|
50
|
+
export { OttoMotionView };
|
|
51
|
+
export interface OttoAnchorMotion {
|
|
52
|
+
/** Spread onto an `Animated.View` holding the prop. */
|
|
53
|
+
style: StepMotionStyle;
|
|
54
|
+
/** Draw the prop over Otto (true) or behind the arms (false). */
|
|
55
|
+
over: boolean;
|
|
56
|
+
/** The prop's resting cell, for layout before motion applies. */
|
|
57
|
+
origin: StepOffset;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Move a prop in lock-step with Otto's hands. `OTTO_ANCHORS[state]` publishes
|
|
61
|
+
* where the hand is each tick; this turns that into the same kind of clocked
|
|
62
|
+
* style the sprite itself uses, on the same timebase, so the two can't drift.
|
|
63
|
+
*
|
|
64
|
+
* Returns `null` for a state that has no anchor.
|
|
65
|
+
*/
|
|
66
|
+
export declare function useOttoAnchorMotion(state: OttoState, pixelSize: number, tickMs?: number, active?: boolean, keyline?: boolean): OttoAnchorMotion | null;
|
|
67
|
+
export interface OttoProps extends OttoRenderOptions {
|
|
68
|
+
/** A named state, or `reel` to play the demo schedule. */
|
|
69
|
+
state: OttoState | "reel";
|
|
70
|
+
/** Size of one sprite pixel in points. Default 8 (the mockup's default). */
|
|
71
|
+
pixelSize?: number;
|
|
72
|
+
/** Tick period in ms. Default 140 (the mockup's default). */
|
|
73
|
+
tickMs?: number;
|
|
74
|
+
/** false = frozen at frame 0 with the clock off. */
|
|
75
|
+
active?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Mount the animated strips in the SAME commit instead of after the
|
|
78
|
+
* interaction settles. Default false — see `Otto` for why.
|
|
79
|
+
*/
|
|
80
|
+
eager?: boolean;
|
|
81
|
+
style?: StyleProp<ViewStyle>;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The shipping sprite.
|
|
85
|
+
*
|
|
86
|
+
* Mounting is deferred on purpose. The strips are ~500 static Views for a
|
|
87
|
+
* typical state, and creating those is native COMMIT cost: measured at 128 ms
|
|
88
|
+
* for one sprite, against 28 ms for a still. A mascot almost always appears
|
|
89
|
+
* while something else is animating (a panel opening, a list settling), and
|
|
90
|
+
* 128 ms of commit dropped into that is a visible hitch.
|
|
91
|
+
*
|
|
92
|
+
* So the first commit paints `OttoStill` — frame 0, ~36 Views, the exact
|
|
93
|
+
* pixels the animation starts on — and the strips mount once the interaction
|
|
94
|
+
* has settled (an idle callback). Nothing pops, because the still IS frame 0.
|
|
95
|
+
* Pass `eager` when the sprite is the thing the user is waiting for.
|
|
96
|
+
*
|
|
97
|
+
* The two layers are siblings that each gate themselves with `return null`
|
|
98
|
+
* rather than a ternary swap, so this component's child slots never change
|
|
99
|
+
* shape (Fabric view-index safety).
|
|
100
|
+
*/
|
|
101
|
+
export declare function Otto({ state, pixelSize, water, keyline, tickMs, active, eager, style, }: OttoProps): import("react").JSX.Element;
|
|
102
|
+
export { WATER_FRAMES };
|
|
103
|
+
//# sourceMappingURL=OttoSprite.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OttoSprite.d.ts","sourceRoot":"","sources":["../../../../../src/ui/otto/OttoSpr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AAC,SAAS,CAAC,GAAG,SAAS,CAAC;AAIjF;;;;;;;;;GASG;AACH,QAAA,MAAM,cAAc,EAAsC,OAAO,QAAQ,CAAC,IAAI,CAAC;AAE/E,OAAO,EAAE,cAAc,EAAE,CAAC;AAwH1B,MAAM,WAAW,gBAAgB;IAC/B,uDAAuD;IACvD,KAAK,EAAE,eAAe,CAAC;IACvB,iEAAiE;IACjE,IAAI,EAAE,OAAO,CAAC;IACd,iEAAiE;IACjE,MAAM,EAAE,UAAU,CAAC;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,SAAS,EAChB,SAAS,EAAE,MAAM,EACjB,MAAM,SAAM,EACZ,MAAM,UAAO,EACb,OAAO,UAAO,GACb,gBAAgB,GAAG,IAAI,CAgBzB;AAID,MAAM,WAAW,SAAU,SAAQ,iBAAiB;IAClD,0DAA0D;IAC1D,KAAK,EAAE,SAAS,GAAG,MAAM,CAAC;IAC1B,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,SAAa,EACb,KAAY,EACZ,OAAc,EACd,MAAY,EACZ,MAAa,EACb,KAAa,EACb,KAAK,GACN,EAAE,SAAS,+BAyCX;AAoID,OAAO,EAAE,YAAY,EAAE,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Otto — the Buoy mascot, as a shared UI primitive.
|
|
3
|
+
*
|
|
4
|
+
* One 16×16 pixel character with a state per product moment. `OTTO_USES` says
|
|
5
|
+
* what each state is for; place him only where the alternative is nothing
|
|
6
|
+
* (empty bodies, waiting states) and only in states that are actually true.
|
|
7
|
+
* See OTTO_PLACEMENT_PLAN.md.
|
|
8
|
+
*
|
|
9
|
+
* The renderer is core-RN only (no Reanimated, no expo-image), so it runs in
|
|
10
|
+
* Expo, in a bare RN CLI host, and on react-native-web. See OTTO_PERF_PLAN.md
|
|
11
|
+
* for the measurements behind that.
|
|
12
|
+
*
|
|
13
|
+
* This is the ONE copy. The example app's review page and the website's lab
|
|
14
|
+
* re-export from here rather than keeping forks.
|
|
15
|
+
*/
|
|
16
|
+
export * from "./ottoEngine";
|
|
17
|
+
export * from "./ottoSheet";
|
|
18
|
+
export * from "./OttoSprite";
|
|
19
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/ui/otto/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC"}
|