@buoy-gg/shared-ui 7.0.21 → 7.0.23
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 +39 -16
- package/lib/commonjs/dataViewer/JsonStringNotice.js +59 -0
- package/lib/commonjs/dataViewer/ThemedSplitView.js +20 -1
- package/lib/commonjs/dataViewer/TimestampDeltaBar.js +96 -0
- package/lib/commonjs/dataViewer/index.js +52 -0
- package/lib/commonjs/dataViewer/jsonStringValue.js +94 -0
- package/lib/commonjs/dataViewer/timestampDiff.js +146 -0
- package/lib/commonjs/hooks/safe-area-impl.js +1 -1
- package/lib/commonjs/index.js +64 -1
- package/lib/commonjs/license/FeatureGate.js +43 -10
- package/lib/commonjs/license/FreeAccountPrompt.js +181 -0
- package/lib/commonjs/license/index.js +57 -42
- package/lib/commonjs/license/licenseModule.js +99 -0
- package/lib/commonjs/license/tierLimits.js +165 -0
- package/lib/commonjs/ui/backgrounds/BackgroundSwitcher.js +180 -0
- package/lib/commonjs/ui/backgrounds/README.md +115 -0
- package/lib/commonjs/ui/backgrounds/ToolBackground.js +74 -0
- package/lib/commonjs/ui/backgrounds/backgroundStore.js +116 -0
- package/lib/commonjs/ui/backgrounds/index.js +70 -0
- package/lib/commonjs/ui/backgrounds/primitives.js +333 -0
- package/lib/commonjs/ui/backgrounds/registry.js +112 -0
- package/lib/commonjs/ui/backgrounds/rng.js +72 -0
- package/lib/commonjs/ui/backgrounds/types.js +1 -0
- package/lib/commonjs/ui/backgrounds/variants/deepField.js +351 -0
- package/lib/commonjs/ui/backgrounds/variants/lattice.js +579 -0
- package/lib/commonjs/ui/backgrounds/variants/starfield.js +210 -0
- package/lib/commonjs/ui/index.js +15 -3
- package/lib/commonjs/utils/devServer.js +62 -0
- package/lib/commonjs/utils/index.js +13 -0
- package/lib/commonjs/utils/renderCaptureRegistry.js +32 -3
- package/lib/commonjs/utils/safeExpoRouter.js +27 -2
- package/lib/module/JsModal.js +39 -16
- package/lib/module/dataViewer/JsonStringNotice.js +54 -0
- package/lib/module/dataViewer/ThemedSplitView.js +20 -1
- package/lib/module/dataViewer/TimestampDeltaBar.js +91 -0
- package/lib/module/dataViewer/index.js +4 -0
- package/lib/module/dataViewer/jsonStringValue.js +89 -0
- package/lib/module/dataViewer/timestampDiff.js +139 -0
- package/lib/module/hooks/safe-area-impl.js +1 -1
- package/lib/module/index.js +5 -3
- package/lib/module/license/FeatureGate.js +43 -10
- package/lib/module/license/FreeAccountPrompt.js +176 -0
- package/lib/module/license/index.js +5 -40
- package/lib/module/license/licenseModule.js +92 -0
- package/lib/module/license/tierLimits.js +158 -0
- package/lib/module/ui/backgrounds/BackgroundSwitcher.js +176 -0
- package/lib/module/ui/backgrounds/README.md +115 -0
- package/lib/module/ui/backgrounds/ToolBackground.js +70 -0
- package/lib/module/ui/backgrounds/backgroundStore.js +111 -0
- package/lib/module/ui/backgrounds/index.js +9 -0
- package/lib/module/ui/backgrounds/primitives.js +328 -0
- package/lib/module/ui/backgrounds/registry.js +105 -0
- package/lib/module/ui/backgrounds/rng.js +65 -0
- package/lib/module/ui/backgrounds/types.js +1 -0
- package/lib/module/ui/backgrounds/variants/deepField.js +347 -0
- package/lib/module/ui/backgrounds/variants/lattice.js +575 -0
- package/lib/module/ui/backgrounds/variants/starfield.js +206 -0
- package/lib/module/ui/index.js +3 -0
- package/lib/module/utils/devServer.js +58 -0
- package/lib/module/utils/index.js +2 -1
- package/lib/module/utils/renderCaptureRegistry.js +32 -3
- package/lib/module/utils/safeExpoRouter.js +26 -2
- package/lib/typescript/commonjs/JsModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/JsonStringNotice.d.ts +6 -0
- package/lib/typescript/commonjs/dataViewer/JsonStringNotice.d.ts.map +1 -0
- package/lib/typescript/commonjs/dataViewer/ThemedSplitView.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/TimestampDeltaBar.d.ts +7 -0
- package/lib/typescript/commonjs/dataViewer/TimestampDeltaBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/dataViewer/index.d.ts +6 -0
- package/lib/typescript/commonjs/dataViewer/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/jsonStringValue.d.ts +25 -0
- package/lib/typescript/commonjs/dataViewer/jsonStringValue.d.ts.map +1 -0
- package/lib/typescript/commonjs/dataViewer/timestampDiff.d.ts +55 -0
- package/lib/typescript/commonjs/dataViewer/timestampDiff.d.ts.map +1 -0
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/commonjs/index.d.ts +4 -3
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/FeatureGate.d.ts +19 -3
- package/lib/typescript/commonjs/license/FeatureGate.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/FreeAccountPrompt.d.ts +23 -0
- package/lib/typescript/commonjs/license/FreeAccountPrompt.d.ts.map +1 -0
- package/lib/typescript/commonjs/license/index.d.ts +6 -15
- package/lib/typescript/commonjs/license/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/licenseModule.d.ts +55 -0
- package/lib/typescript/commonjs/license/licenseModule.d.ts.map +1 -0
- package/lib/typescript/commonjs/license/tierLimits.d.ts +143 -0
- package/lib/typescript/commonjs/license/tierLimits.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/BackgroundSwitcher.d.ts +13 -0
- package/lib/typescript/commonjs/ui/backgrounds/BackgroundSwitcher.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/ToolBackground.d.ts +30 -0
- package/lib/typescript/commonjs/ui/backgrounds/ToolBackground.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/backgroundStore.d.ts +43 -0
- package/lib/typescript/commonjs/ui/backgrounds/backgroundStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/index.d.ts +7 -0
- package/lib/typescript/commonjs/ui/backgrounds/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/primitives.d.ts +106 -0
- package/lib/typescript/commonjs/ui/backgrounds/primitives.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/registry.d.ts +28 -0
- package/lib/typescript/commonjs/ui/backgrounds/registry.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/rng.d.ts +27 -0
- package/lib/typescript/commonjs/ui/backgrounds/rng.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/types.d.ts +14 -0
- package/lib/typescript/commonjs/ui/backgrounds/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/deepField.d.ts +65 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/deepField.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/lattice.d.ts +33 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/lattice.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/starfield.d.ts +12 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/starfield.d.ts.map +1 -0
- 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/utils/devServer.d.ts +24 -0
- package/lib/typescript/commonjs/utils/devServer.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/index.d.ts +3 -2
- package/lib/typescript/commonjs/utils/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/renderCaptureRegistry.d.ts +52 -2
- package/lib/typescript/commonjs/utils/renderCaptureRegistry.d.ts.map +1 -1
- package/lib/typescript/commonjs/utils/safeExpoRouter.d.ts +23 -0
- package/lib/typescript/commonjs/utils/safeExpoRouter.d.ts.map +1 -1
- package/lib/typescript/module/JsModal.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/JsonStringNotice.d.ts +6 -0
- package/lib/typescript/module/dataViewer/JsonStringNotice.d.ts.map +1 -0
- package/lib/typescript/module/dataViewer/ThemedSplitView.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/TimestampDeltaBar.d.ts +7 -0
- package/lib/typescript/module/dataViewer/TimestampDeltaBar.d.ts.map +1 -0
- package/lib/typescript/module/dataViewer/index.d.ts +6 -0
- package/lib/typescript/module/dataViewer/index.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/jsonStringValue.d.ts +25 -0
- package/lib/typescript/module/dataViewer/jsonStringValue.d.ts.map +1 -0
- package/lib/typescript/module/dataViewer/timestampDiff.d.ts +55 -0
- package/lib/typescript/module/dataViewer/timestampDiff.d.ts.map +1 -0
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/index.d.ts +4 -3
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/license/FeatureGate.d.ts +19 -3
- package/lib/typescript/module/license/FeatureGate.d.ts.map +1 -1
- package/lib/typescript/module/license/FreeAccountPrompt.d.ts +23 -0
- package/lib/typescript/module/license/FreeAccountPrompt.d.ts.map +1 -0
- package/lib/typescript/module/license/index.d.ts +6 -15
- package/lib/typescript/module/license/index.d.ts.map +1 -1
- package/lib/typescript/module/license/licenseModule.d.ts +55 -0
- package/lib/typescript/module/license/licenseModule.d.ts.map +1 -0
- package/lib/typescript/module/license/tierLimits.d.ts +143 -0
- package/lib/typescript/module/license/tierLimits.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/BackgroundSwitcher.d.ts +13 -0
- package/lib/typescript/module/ui/backgrounds/BackgroundSwitcher.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/ToolBackground.d.ts +30 -0
- package/lib/typescript/module/ui/backgrounds/ToolBackground.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/backgroundStore.d.ts +43 -0
- package/lib/typescript/module/ui/backgrounds/backgroundStore.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/index.d.ts +7 -0
- package/lib/typescript/module/ui/backgrounds/index.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/primitives.d.ts +106 -0
- package/lib/typescript/module/ui/backgrounds/primitives.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/registry.d.ts +28 -0
- package/lib/typescript/module/ui/backgrounds/registry.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/rng.d.ts +27 -0
- package/lib/typescript/module/ui/backgrounds/rng.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/types.d.ts +14 -0
- package/lib/typescript/module/ui/backgrounds/types.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/variants/deepField.d.ts +65 -0
- package/lib/typescript/module/ui/backgrounds/variants/deepField.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/variants/lattice.d.ts +33 -0
- package/lib/typescript/module/ui/backgrounds/variants/lattice.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/variants/starfield.d.ts +12 -0
- package/lib/typescript/module/ui/backgrounds/variants/starfield.d.ts.map +1 -0
- 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/utils/devServer.d.ts +24 -0
- package/lib/typescript/module/utils/devServer.d.ts.map +1 -0
- package/lib/typescript/module/utils/index.d.ts +3 -2
- package/lib/typescript/module/utils/index.d.ts.map +1 -1
- package/lib/typescript/module/utils/renderCaptureRegistry.d.ts +52 -2
- package/lib/typescript/module/utils/renderCaptureRegistry.d.ts.map +1 -1
- package/lib/typescript/module/utils/safeExpoRouter.d.ts +23 -0
- package/lib/typescript/module/utils/safeExpoRouter.d.ts.map +1 -1
- package/package.json +4 -4
- package/scripts/detect-safe-area.js +1 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Starfield — the RN-primitive port of the Everlights parallax-drift starfield.
|
|
5
|
+
*
|
|
6
|
+
* The original is a GPU-instanced Skia `<Atlas>` with a per-star worklet; Buoy
|
|
7
|
+
* can't depend on Skia, so the depth continuum is quantised into five discrete
|
|
8
|
+
* bands. Each band is one rasterized layer of dots sliding at its own speed —
|
|
9
|
+
* five native-driven loops instead of 160 per-frame transforms — and the eye
|
|
10
|
+
* reads five parallax speeds as depth just as well as it reads a continuum.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { memo } from "react";
|
|
14
|
+
import { Animated, View } from "react-native";
|
|
15
|
+
import { absoluteFill } from "../../../utils/absoluteFill.js";
|
|
16
|
+
import { Base, RadialGlow, RasterLayer, useLoop, usePulse } from "../primitives.js";
|
|
17
|
+
import { scatter, withAlpha } from "../rng.js";
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
|
+
/**
|
|
20
|
+
* Depth bands, far → near. `z` drives both size and speed (drift/sec at z=1 is
|
|
21
|
+
* 0.016 of the width, matching the original), `count` thins out as stars get
|
|
22
|
+
* closer so the fast, big ones stay sparse.
|
|
23
|
+
*/
|
|
24
|
+
const BANDS = [
|
|
25
|
+
// dia is the star's core in px; halo is how many core-widths the bloom
|
|
26
|
+
// spreads (0 = no bloom, which is what keeps the far bands cheap).
|
|
27
|
+
{
|
|
28
|
+
z: 1.0,
|
|
29
|
+
count: 38,
|
|
30
|
+
dia: 1.4,
|
|
31
|
+
halo: 0,
|
|
32
|
+
color: "#7C93B5",
|
|
33
|
+
alpha: 0.55
|
|
34
|
+
}, {
|
|
35
|
+
z: 0.78,
|
|
36
|
+
count: 26,
|
|
37
|
+
dia: 1.9,
|
|
38
|
+
halo: 0,
|
|
39
|
+
color: "#A6BBD8",
|
|
40
|
+
alpha: 0.65
|
|
41
|
+
}, {
|
|
42
|
+
z: 0.6,
|
|
43
|
+
count: 18,
|
|
44
|
+
dia: 2.4,
|
|
45
|
+
halo: 0,
|
|
46
|
+
color: "#C9D9F0",
|
|
47
|
+
alpha: 0.8
|
|
48
|
+
}, {
|
|
49
|
+
z: 0.45,
|
|
50
|
+
count: 11,
|
|
51
|
+
dia: 3.1,
|
|
52
|
+
halo: 0,
|
|
53
|
+
color: "#E4EEFC",
|
|
54
|
+
alpha: 0.92
|
|
55
|
+
},
|
|
56
|
+
// Only the closest band gets a bloom: 6 stars x 3 extra discs is 36 views,
|
|
57
|
+
// and it is the entire difference between "dots" and "stars".
|
|
58
|
+
{
|
|
59
|
+
z: 0.3,
|
|
60
|
+
count: 6,
|
|
61
|
+
dia: 4.2,
|
|
62
|
+
halo: 4.4,
|
|
63
|
+
color: "#FFFFFF",
|
|
64
|
+
alpha: 1
|
|
65
|
+
}];
|
|
66
|
+
const DRIFT = 0.016; // fraction of width travelled per second at z=1
|
|
67
|
+
|
|
68
|
+
/** Pre-scattered x/y per band, generated once at module load. */
|
|
69
|
+
const BAND_TABLES = BANDS.map((b, i) => ({
|
|
70
|
+
xs: scatter(0x5747 + i * 977, b.count),
|
|
71
|
+
ys: scatter(0x91c3 + i * 613, b.count)
|
|
72
|
+
}));
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The bloom around a close star. Three nested discs rather than a `RadialGlow`,
|
|
76
|
+
* because this one is drawn per star and lives INSIDE the band layer — which is
|
|
77
|
+
* the point: the halo travels with its star instead of sitting still while the
|
|
78
|
+
* star drifts off it.
|
|
79
|
+
*/
|
|
80
|
+
function haloDiscs(cx, cy, core, spread, color, key) {
|
|
81
|
+
const out = [];
|
|
82
|
+
const steps = [{
|
|
83
|
+
mul: spread,
|
|
84
|
+
alpha: 0.05
|
|
85
|
+
}, {
|
|
86
|
+
mul: spread * 0.62,
|
|
87
|
+
alpha: 0.09
|
|
88
|
+
}, {
|
|
89
|
+
mul: spread * 0.34,
|
|
90
|
+
alpha: 0.16
|
|
91
|
+
}];
|
|
92
|
+
for (let i = 0; i < steps.length; i++) {
|
|
93
|
+
const d = core * steps[i].mul;
|
|
94
|
+
out.push(/*#__PURE__*/_jsx(View, {
|
|
95
|
+
style: {
|
|
96
|
+
position: "absolute",
|
|
97
|
+
left: cx - d / 2,
|
|
98
|
+
top: cy - d / 2,
|
|
99
|
+
width: d,
|
|
100
|
+
height: d,
|
|
101
|
+
borderRadius: d / 2,
|
|
102
|
+
backgroundColor: withAlpha(color, steps[i].alpha)
|
|
103
|
+
}
|
|
104
|
+
}, `${key}-h${i}`));
|
|
105
|
+
}
|
|
106
|
+
return out;
|
|
107
|
+
}
|
|
108
|
+
const StarBand = /*#__PURE__*/memo(function StarBand({
|
|
109
|
+
index,
|
|
110
|
+
width,
|
|
111
|
+
height,
|
|
112
|
+
animated
|
|
113
|
+
}) {
|
|
114
|
+
const band = BANDS[index];
|
|
115
|
+
const table = BAND_TABLES[index];
|
|
116
|
+
// One full width of travel takes z / DRIFT seconds — nearer (smaller z) is
|
|
117
|
+
// faster, which is the whole parallax effect.
|
|
118
|
+
const drift = useLoop(band.z / DRIFT * 1000, animated);
|
|
119
|
+
const translateX = drift.interpolate({
|
|
120
|
+
inputRange: [0, 1],
|
|
121
|
+
outputRange: [0, -width]
|
|
122
|
+
});
|
|
123
|
+
const dots = [];
|
|
124
|
+
for (let i = 0; i < band.count; i++) {
|
|
125
|
+
const x = table.xs[i] * width;
|
|
126
|
+
const y = table.ys[i] * height;
|
|
127
|
+
// Each star is drawn twice, one width apart, so the layer tiles seamlessly
|
|
128
|
+
// when the loop snaps back to 0.
|
|
129
|
+
for (let copy = 0; copy < 2; copy++) {
|
|
130
|
+
const cx = x + copy * width;
|
|
131
|
+
const key = `${i}-${copy}`;
|
|
132
|
+
if (band.halo > 0) {
|
|
133
|
+
dots.push(...haloDiscs(cx, y, band.dia, band.halo, band.color, key));
|
|
134
|
+
}
|
|
135
|
+
dots.push(/*#__PURE__*/_jsx(View, {
|
|
136
|
+
style: {
|
|
137
|
+
position: "absolute",
|
|
138
|
+
left: cx - band.dia / 2,
|
|
139
|
+
top: y - band.dia / 2,
|
|
140
|
+
width: band.dia,
|
|
141
|
+
height: band.dia,
|
|
142
|
+
borderRadius: band.dia / 2,
|
|
143
|
+
backgroundColor: withAlpha(band.color, band.alpha)
|
|
144
|
+
}
|
|
145
|
+
}, key));
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
return /*#__PURE__*/_jsx(Animated.View, {
|
|
149
|
+
style: [{
|
|
150
|
+
position: "absolute",
|
|
151
|
+
left: 0,
|
|
152
|
+
top: 0,
|
|
153
|
+
width: width * 2,
|
|
154
|
+
height
|
|
155
|
+
}, {
|
|
156
|
+
transform: [{
|
|
157
|
+
translateX
|
|
158
|
+
}]
|
|
159
|
+
}],
|
|
160
|
+
pointerEvents: "none",
|
|
161
|
+
children: /*#__PURE__*/_jsx(RasterLayer, {
|
|
162
|
+
style: {
|
|
163
|
+
width: width * 2,
|
|
164
|
+
height
|
|
165
|
+
},
|
|
166
|
+
children: dots
|
|
167
|
+
})
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
export const Starfield = /*#__PURE__*/memo(function Starfield(props) {
|
|
171
|
+
// A single slow breath over the whole field. One node, and it's what stops
|
|
172
|
+
// the sky looking like a printed dot pattern now that the per-star twinkle
|
|
173
|
+
// from the Skia original isn't affordable.
|
|
174
|
+
const shimmer = usePulse(5200, props.animated);
|
|
175
|
+
const opacity = shimmer.interpolate({
|
|
176
|
+
inputRange: [0, 1],
|
|
177
|
+
outputRange: [0.82, 1]
|
|
178
|
+
});
|
|
179
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
180
|
+
style: absoluteFill,
|
|
181
|
+
pointerEvents: "none",
|
|
182
|
+
children: [/*#__PURE__*/_jsx(Base, {
|
|
183
|
+
color: "#05060A"
|
|
184
|
+
}), /*#__PURE__*/_jsx(RadialGlow, {
|
|
185
|
+
size: props.width * 1.6,
|
|
186
|
+
color: "#1E3A8A",
|
|
187
|
+
alpha: 0.2,
|
|
188
|
+
rings: 8,
|
|
189
|
+
falloff: 2,
|
|
190
|
+
style: {
|
|
191
|
+
position: "absolute",
|
|
192
|
+
left: -props.width * 0.3,
|
|
193
|
+
top: -props.width * 0.9
|
|
194
|
+
}
|
|
195
|
+
}), /*#__PURE__*/_jsx(Animated.View, {
|
|
196
|
+
style: [absoluteFill, {
|
|
197
|
+
opacity
|
|
198
|
+
}],
|
|
199
|
+
pointerEvents: "none",
|
|
200
|
+
children: BANDS.map((_, i) => /*#__PURE__*/_jsx(StarBand, {
|
|
201
|
+
index: i,
|
|
202
|
+
...props
|
|
203
|
+
}, i))
|
|
204
|
+
})]
|
|
205
|
+
});
|
|
206
|
+
});
|
package/lib/module/ui/index.js
CHANGED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* devServer
|
|
5
|
+
*
|
|
6
|
+
* Origin of the Metro/Expo dev server that served this bundle, e.g.
|
|
7
|
+
* `http://192.168.1.20:8081`.
|
|
8
|
+
*
|
|
9
|
+
* Why a remote driver wants it: reloading the app normally runs IN the app
|
|
10
|
+
* (`DevSettings.reload()`), which is exactly what stops working when the app
|
|
11
|
+
* has crashed — a fatal render error unmounts the tree, so no JS action can be
|
|
12
|
+
* answered and the one command that would recover the app is unreachable. The
|
|
13
|
+
* dev server's message socket reloads through the NATIVE side instead (it is
|
|
14
|
+
* what the `r` key and the redbox's Reload button use), so a driver that knows
|
|
15
|
+
* this origin can recover an app that can no longer help itself.
|
|
16
|
+
*
|
|
17
|
+
* Reported once, while the app is healthy, so it is already known by the time
|
|
18
|
+
* it's needed.
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
const ORIGIN_RE = /^(https?:\/\/[^/]+)/;
|
|
22
|
+
|
|
23
|
+
/** Bundle URL this JS realm was loaded from, or null off React Native. */
|
|
24
|
+
function scriptURL() {
|
|
25
|
+
try {
|
|
26
|
+
// Requires stay lexically inside try{} so Metro treats them as optional —
|
|
27
|
+
// react-native-web has neither path and falls through to null.
|
|
28
|
+
const NativeSourceCode =
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
30
|
+
require("react-native/Libraries/NativeModules/specs/NativeSourceCode").default;
|
|
31
|
+
const url = NativeSourceCode?.getConstants?.().scriptURL;
|
|
32
|
+
if (url) return url;
|
|
33
|
+
} catch {
|
|
34
|
+
// RN internals moved, or old architecture — try NativeModules below.
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
// eslint-disable-next-line @typescript-eslint/no-var-requires
|
|
38
|
+
const {
|
|
39
|
+
NativeModules
|
|
40
|
+
} = require("react-native");
|
|
41
|
+
const url = NativeModules?.SourceCode?.getConstants?.().scriptURL ?? NativeModules?.SourceCode?.scriptURL;
|
|
42
|
+
if (url) return url;
|
|
43
|
+
} catch {
|
|
44
|
+
// not React Native
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* `http://host:port` of the dev server, or null in production / on web (a
|
|
51
|
+
* release bundle's scriptURL is a `file://` path, which has no origin worth
|
|
52
|
+
* reporting).
|
|
53
|
+
*/
|
|
54
|
+
export function getDevServerOrigin() {
|
|
55
|
+
const url = scriptURL();
|
|
56
|
+
if (!url || !/^https?:\/\//.test(url)) return null;
|
|
57
|
+
return url.match(ORIGIN_RE)?.[1] ?? null;
|
|
58
|
+
}
|
|
@@ -12,6 +12,7 @@ export { setRenderCaptureProvider, getRenderCaptureProvider } from "./renderCapt
|
|
|
12
12
|
export { registerStateSnapshotProvider, getStateSnapshotProviders, getStateSnapshotProvider, subscribeToStateSnapshotProviders } from "./stateSnapshotRegistry.js";
|
|
13
13
|
export { serialize as superJsonSerialize, deserialize as superJsonDeserialize } from "./minimalSuperJSON.js";
|
|
14
14
|
export { reloadApp, scheduleReloadApp, resolveReloadStrategy, REMOTE_RELOAD_DELAY_MS } from "./reloadApp.js";
|
|
15
|
+
export { getDevServerOrigin } from "./devServer.js";
|
|
15
16
|
export { Subscribable } from "./subscribable.js";
|
|
16
17
|
export { subscriberCountNotifier, subscribeToSubscriberCountChanges, notifySubscriberCountChange } from "./subscriberCountNotifier.js";
|
|
17
|
-
export { useSafeRouter, useSafePathname, useSafeSegments, useSafeGlobalSearchParams, getSafeRouter, getSafeCurrentPathname, isExpoRouterAvailable } from "./safeExpoRouter.js";
|
|
18
|
+
export { useSafeRouter, useSafePathname, useSafeSegments, useSafeGlobalSearchParams, getSafeRouter, getSafeCurrentPathname, getSafeCurrentRoute, isExpoRouterAvailable } from "./safeExpoRouter.js";
|
|
@@ -10,16 +10,45 @@
|
|
|
10
10
|
* `installReaFpsGetter`.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* Why a component rendered, counted across a capture window.
|
|
15
|
+
*
|
|
16
|
+
* The split between `props` and `propsUnstable` is the one that matters in
|
|
17
|
+
* practice. Both mean "my props changed", but they send you to different
|
|
18
|
+
* files: `props` is a genuine update (a value differs) and belongs to the
|
|
19
|
+
* component; `propsUnstable` means the values are equal and only the
|
|
20
|
+
* IDENTITY changed — a fresh arrow or object literal handed down by the
|
|
21
|
+
* parent every render — and the fix is always upstream. Reporting that as
|
|
22
|
+
* plain "props" is technically true and sends people into the wrong file,
|
|
23
|
+
* which is why it gets its own bucket.
|
|
24
|
+
*/
|
|
25
|
+
|
|
13
26
|
/** One component's aggregated renders across a capture window. */
|
|
14
27
|
|
|
15
28
|
/** Result of a capture window (one benchmark recording). */
|
|
16
29
|
|
|
17
|
-
|
|
30
|
+
/**
|
|
31
|
+
* The provider lives on a global, NOT in module scope.
|
|
32
|
+
*
|
|
33
|
+
* Package managers routinely give each @buoy-gg/* package its own nested copy
|
|
34
|
+
* of shared-ui — observed in the wild with ten identical 7.0.21 copies and
|
|
35
|
+
* nothing hoisted, simply because shared-ui was nobody's direct dependency.
|
|
36
|
+
* Module-scoped state means highlight-updates registers into its copy and
|
|
37
|
+
* perf-monitor reads a different one, so capture silently produces nothing:
|
|
38
|
+
* no error, no warning, just `renderCommits: null` in every report.
|
|
39
|
+
*
|
|
40
|
+
* A global key survives duplicate module instances. Same reasoning as
|
|
41
|
+
* external-sync's crash-flush registry.
|
|
42
|
+
*/
|
|
43
|
+
const PROVIDER_KEY = "__buoyRenderCaptureProvider";
|
|
44
|
+
function providerHost() {
|
|
45
|
+
return globalThis;
|
|
46
|
+
}
|
|
18
47
|
|
|
19
48
|
/** Register (or clear with null) the active provider. Last registration wins. */
|
|
20
49
|
export function setRenderCaptureProvider(p) {
|
|
21
|
-
|
|
50
|
+
providerHost()[PROVIDER_KEY] = p;
|
|
22
51
|
}
|
|
23
52
|
export function getRenderCaptureProvider() {
|
|
24
|
-
return
|
|
53
|
+
return providerHost()[PROVIDER_KEY] ?? null;
|
|
25
54
|
}
|
|
@@ -174,6 +174,7 @@ export function getSafeRouter() {
|
|
|
174
174
|
// path the require throws and the imperative fallback simply disables (callers
|
|
175
175
|
// degrade to route-events history). expo-router's store exposes getRouteInfo(),
|
|
176
176
|
// which returns the live pathname even before any navigation is recorded.
|
|
177
|
+
|
|
177
178
|
let routerStore;
|
|
178
179
|
function getRouterStore() {
|
|
179
180
|
if (routerStore !== undefined) return routerStore;
|
|
@@ -195,12 +196,35 @@ function getRouterStore() {
|
|
|
195
196
|
* can't be reached.
|
|
196
197
|
*/
|
|
197
198
|
export function getSafeCurrentPathname() {
|
|
199
|
+
return getSafeCurrentRoute()?.pathname ?? null;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/** A route location that can be re-visited later via {@link getSafeRouter}. */
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* The current route as a re-visitable location, read imperatively from
|
|
206
|
+
* expo-router's store.
|
|
207
|
+
*
|
|
208
|
+
* Like {@link getSafeCurrentPathname} this works before any navigation has
|
|
209
|
+
* been recorded (cold start on the initial route), and returns null when
|
|
210
|
+
* expo-router isn't available or the store can't be reached.
|
|
211
|
+
*/
|
|
212
|
+
export function getSafeCurrentRoute() {
|
|
198
213
|
if (!checkExpoRouterAvailability()) {
|
|
199
214
|
return null;
|
|
200
215
|
}
|
|
201
216
|
try {
|
|
202
|
-
const
|
|
203
|
-
|
|
217
|
+
const info = getRouterStore()?.getRouteInfo?.();
|
|
218
|
+
const pathname = info?.pathname;
|
|
219
|
+
if (typeof pathname !== "string" || pathname.length === 0) return null;
|
|
220
|
+
const withParams = info?.pathnameWithParams;
|
|
221
|
+
return {
|
|
222
|
+
pathname,
|
|
223
|
+
href: typeof withParams === "string" && withParams.length > 0 ? withParams : pathname,
|
|
224
|
+
...(Array.isArray(info?.segments) ? {
|
|
225
|
+
segments: info.segments
|
|
226
|
+
} : {})
|
|
227
|
+
};
|
|
204
228
|
} catch (error) {
|
|
205
229
|
return null;
|
|
206
230
|
}
|
|
@@ -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;AA8FtB,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;AAEnD,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,kBAAkB,CAAC,EAAE;QAAE,KAAK,EAAE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O,MAAM,gBAAgB;aAIlB,OAAO;WACT,SAAS;EAoBhB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemedSplitView.d.ts","sourceRoot":"","sources":["../../../../src/dataViewer/ThemedSplitView.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ThemedSplitView.d.ts","sourceRoot":"","sources":["../../../../src/dataViewer/ThemedSplitView.tsx"],"names":[],"mappings":"AAuCA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEzC,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,cAAc,CAAC;AAE7E,sEAAsE;AACtE,MAAM,WAAW,WAAW;IAC1B,eAAe,EAAE,OAAO,CAAC;IACzB,eAAe,EAAE,OAAO,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,aAAa,EAAE,iBAAiB,CAAC;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,OAAO,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,OAAO,EAAE,CAAC;IACvB,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAaD,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,OAAyB,EACzB,aAAqB,EACrB,aAAoB,GACrB,EAAE,oBAAoB,+BAsNtB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DiffTheme } from "./diffThemes";
|
|
2
|
+
import type { TimestampDelta } from "./timestampDiff";
|
|
3
|
+
export declare const TimestampDeltaBar: import("react").NamedExoticComponent<{
|
|
4
|
+
deltas: TimestampDelta[];
|
|
5
|
+
theme: DiffTheme;
|
|
6
|
+
}>;
|
|
7
|
+
//# sourceMappingURL=TimestampDeltaBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimestampDeltaBar.d.ts","sourceRoot":"","sources":["../../../../src/dataViewer/TimestampDeltaBar.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,eAAO,MAAM,iBAAiB;YAIpB,cAAc,EAAE;WACjB,SAAS;EAsChB,CAAC"}
|
|
@@ -19,6 +19,12 @@ export { SplitDiffViewer } from "./SplitDiffViewer";
|
|
|
19
19
|
export type { SplitDiffViewerProps, SplitDiffViewerOptions } from "./SplitDiffViewer";
|
|
20
20
|
export { DiffSummary } from "./DiffSummary";
|
|
21
21
|
export type { DiffSummaryProps } from "./DiffSummary";
|
|
22
|
+
export { TimestampDeltaBar } from "./TimestampDeltaBar";
|
|
23
|
+
export { JsonStringNotice } from "./JsonStringNotice";
|
|
24
|
+
export { decodeJsonStringPair, parseJsonContainer } from "./jsonStringValue";
|
|
25
|
+
export type { DecodedJsonPair } from "./jsonStringValue";
|
|
26
|
+
export { detectTimestamp, describeTimestampDeltas, formatDuration, formatInstant, } from "./timestampDiff";
|
|
27
|
+
export type { DetectedTimestamp, TimestampDelta, TimestampKind, } from "./timestampDiff";
|
|
22
28
|
export { computeLineDiff, DiffType, ABSENT_VALUE, isAbsent, type LineDiffInfo, type WordDiff, type DiffComputeOptions, } from "./lineDiff";
|
|
23
29
|
export { diffThemes, gitClassicTheme, devToolsDefaultTheme, type DiffTheme, type DiffThemeKey, } from "./diffThemes";
|
|
24
30
|
export { objectDiff, boundedDeepEqual, toDiffable, jsonLikelyLargerThan, type ObjectDiffOptions, type ObjectDiffResult, } from "./objectDiff";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/dataViewer/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C;;;;GAIG;AACH,YAAY,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAIlE,OAAO,EACL,WAAW,EACX,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,MAAM,GACZ,MAAM,WAAW,CAAC;AAInB,OAAO,EACL,cAAc,EACd,aAAa,EACb,UAAU,EACV,SAAS,EACT,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,iBAAiB,GACvB,MAAM,eAAe,CAAC;AAIvB,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,KAAK,sBAAsB,GAC5B,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,kBAAkB,EAClB,KAAK,uBAAuB,GAC7B,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/dataViewer/index.ts"],"names":[],"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E,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,YAAY,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,eAAe,EACf,uBAAuB,EACvB,cAAc,EACd,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,iBAAiB,EACjB,cAAc,EACd,aAAa,GACd,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,eAAe,EACf,QAAQ,EACR,YAAY,EACZ,QAAQ,EACR,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,kBAAkB,GACxB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,UAAU,EACV,eAAe,EACf,oBAAoB,EACpB,KAAK,SAAS,EACd,KAAK,YAAY,GAClB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,UAAU,EACV,gBAAgB,EAChB,UAAU,EACV,oBAAoB,EACpB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,cAAc,CAAC;AAGtB,OAAO,EACL,eAAe,EACf,KAAK,WAAW,EAChB,KAAK,iBAAiB,GACvB,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse a string that encodes a JSON object or array. Returns a wrapper so a
|
|
3
|
+
* successfully decoded `null`-ish payload is still distinguishable from "not
|
|
4
|
+
* decodable" (the prefix check makes that unreachable today, but callers
|
|
5
|
+
* shouldn't have to know that).
|
|
6
|
+
*/
|
|
7
|
+
export declare function parseJsonContainer(value: unknown): {
|
|
8
|
+
value: unknown;
|
|
9
|
+
} | null;
|
|
10
|
+
export interface DecodedJsonPair {
|
|
11
|
+
left: unknown;
|
|
12
|
+
right: unknown;
|
|
13
|
+
/** True when the pair was unwrapped and the UI must say so. */
|
|
14
|
+
decoded: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Decode both sides of a diff when they are JSON-encoded containers.
|
|
18
|
+
*
|
|
19
|
+
* One side alone is decoded ONLY when the other side is missing entirely
|
|
20
|
+
* (a key being added or removed). A JSON string on one side and an ordinary
|
|
21
|
+
* value on the other is a change of shape, and decoding just one half would
|
|
22
|
+
* present it as something it isn't.
|
|
23
|
+
*/
|
|
24
|
+
export declare function decodeJsonStringPair(left: unknown, right: unknown): DecodedJsonPair;
|
|
25
|
+
//# sourceMappingURL=jsonStringValue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jsonStringValue.d.ts","sourceRoot":"","sources":["../../../../src/dataViewer/jsonStringValue.ts"],"names":[],"mappings":"AAsBA;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAa5E;AAED,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,+DAA+D;IAC/D,OAAO,EAAE,OAAO,CAAC;CAClB;AAOD;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,IAAI,EAAE,OAAO,EACb,KAAK,EAAE,OAAO,GACb,eAAe,CAcjB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Timestamp detection for diff views.
|
|
3
|
+
*
|
|
4
|
+
* `1787085897165 → 1787012175875` is unreadable. It is also the single most
|
|
5
|
+
* common diff in a devtool: `lastSyncTimestamp`, `expiresAt`, `updatedAt`,
|
|
6
|
+
* every cache stamp. This turns that pair into "20h 29m earlier" plus both
|
|
7
|
+
* instants spelled out, WITHOUT hiding the raw values — a devtool that
|
|
8
|
+
* silently reinterprets what is stored is worse than one that says nothing.
|
|
9
|
+
*
|
|
10
|
+
* DETECTION IS DELIBERATELY NARROW, because the failure mode is confidently
|
|
11
|
+
* mislabelling an id or a counter as a date:
|
|
12
|
+
* - Epoch milliseconds only in [2001-09-09, 2100), i.e. 13 digits.
|
|
13
|
+
* - Epoch seconds only in the same window, i.e. 10 digits.
|
|
14
|
+
* The two ranges cannot overlap, so a value is never ambiguous.
|
|
15
|
+
* - ISO 8601 strings that both match the shape AND parse.
|
|
16
|
+
* - BOTH sides must be the same kind. An ISO string against an epoch number
|
|
17
|
+
* is a representation change, not a time delta, and reporting a gap there
|
|
18
|
+
* would bury the more interesting fact.
|
|
19
|
+
*/
|
|
20
|
+
/** Units we recognize. A pair must agree on one of them. */
|
|
21
|
+
export type TimestampKind = "epoch-ms" | "epoch-s" | "iso";
|
|
22
|
+
export interface DetectedTimestamp {
|
|
23
|
+
kind: TimestampKind;
|
|
24
|
+
epochMs: number;
|
|
25
|
+
}
|
|
26
|
+
export interface TimestampDelta {
|
|
27
|
+
/** Object key this pair came from; absent when the value itself is a time. */
|
|
28
|
+
path?: string;
|
|
29
|
+
kind: TimestampKind;
|
|
30
|
+
/** Signed: new − old. Negative means the new value is earlier. */
|
|
31
|
+
deltaMs: number;
|
|
32
|
+
/** "20h 29m earlier" · "4s later" · "same instant". */
|
|
33
|
+
deltaLabel: string;
|
|
34
|
+
/** Both sides as local wall-clock, e.g. "2026-08-18 18:31:37". */
|
|
35
|
+
fromLabel: string;
|
|
36
|
+
toLabel: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Read one value as an instant, or null when it isn't confidently a time.
|
|
40
|
+
* Numeric strings count: storage backends hand back everything as strings.
|
|
41
|
+
*/
|
|
42
|
+
export declare function detectTimestamp(value: unknown): DetectedTimestamp | null;
|
|
43
|
+
/** Local wall-clock, fixed format — a devtool wants it sortable, not chatty. */
|
|
44
|
+
export declare function formatInstant(epochMs: number): string;
|
|
45
|
+
/** Coarsest two units that still carry the magnitude: "3d 4h", "5m 30s". */
|
|
46
|
+
export declare function formatDuration(ms: number): string;
|
|
47
|
+
/**
|
|
48
|
+
* Every timestamp pair worth explaining in a diff of these two values.
|
|
49
|
+
*
|
|
50
|
+
* Scalars give at most one entry. Plain objects are inspected ONE level deep
|
|
51
|
+
* — enough for the `{ updatedAt, expiresAt }` shape that dominates, without
|
|
52
|
+
* walking a whole document to hunt for dates.
|
|
53
|
+
*/
|
|
54
|
+
export declare function describeTimestampDeltas(oldValue: unknown, newValue: unknown): TimestampDelta[];
|
|
55
|
+
//# sourceMappingURL=timestampDiff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timestampDiff.d.ts","sourceRoot":"","sources":["../../../../src/dataViewer/timestampDiff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,4DAA4D;AAC5D,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,SAAS,GAAG,KAAK,CAAC;AAE3D,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,8EAA8E;IAC9E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,aAAa,CAAC;IACpB,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAoBD;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,iBAAiB,GAAG,IAAI,CAcxE;AAMD,gFAAgF;AAChF,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAMrD;AAED,4EAA4E;AAC5E,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAejD;AAqCD;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,OAAO,EACjB,QAAQ,EAAE,OAAO,GAChB,cAAc,EAAE,CAgBlB"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export * from "./ui";
|
|
2
2
|
export * from "./stores";
|
|
3
3
|
export * from "./sync/wireBudget";
|
|
4
|
-
export { absoluteFill, displayValue, parseDisplayValue, getSafeAreaInsets, persistentStorage, isUsingPersistentStorage, getStorageBackendType, safeStringify, getValueType, isPrimitive, isJsonSerializable, isValidJson, getConstructorName, isEmpty, getValueSize, parseValue, formatValue, getTypeColor, truncateText, flattenObject, formatPath, loadOptionalModule, getCachedOptionalModule, setRenderCaptureProvider, getRenderCaptureProvider, type RenderCaptureProvider, type RenderCaptureSummary, type RenderCaptureTopComponent, registerStateSnapshotProvider, getStateSnapshotProviders, getStateSnapshotProvider, subscribeToStateSnapshotProviders, type StateSnapshotProvider, type StateSnapshotProviderStatus, type StateSnapshotCapture, type StateSnapshotRestoreResult, type StateSnapshotPreview, type StateSnapshotPreviewItem, type StateSnapshotPreviewVerdict, superJsonSerialize, superJsonDeserialize, type SuperJSONResult, reloadApp, scheduleReloadApp, resolveReloadStrategy, REMOTE_RELOAD_DELAY_MS, type ReloadStrategy, type ResolvedReloadStrategy, Subscribable, type SubscribableListener, subscriberCountNotifier, subscribeToSubscriberCountChanges, notifySubscriberCountChange, useSafeRouter, useSafePathname, useSafeSegments, useSafeGlobalSearchParams, getSafeRouter, getSafeCurrentPathname, isExpoRouterAvailable, } from "./utils";
|
|
4
|
+
export { absoluteFill, displayValue, parseDisplayValue, getSafeAreaInsets, persistentStorage, isUsingPersistentStorage, getStorageBackendType, safeStringify, getValueType, isPrimitive, isJsonSerializable, isValidJson, getConstructorName, isEmpty, getValueSize, parseValue, formatValue, getTypeColor, truncateText, flattenObject, formatPath, loadOptionalModule, getCachedOptionalModule, setRenderCaptureProvider, getRenderCaptureProvider, type RenderCaptureProvider, type RenderCaptureSummary, type RenderCaptureTopComponent, type RenderCauseCounts, registerStateSnapshotProvider, getStateSnapshotProviders, getStateSnapshotProvider, subscribeToStateSnapshotProviders, type StateSnapshotProvider, type StateSnapshotProviderStatus, type StateSnapshotCapture, type StateSnapshotRestoreResult, type StateSnapshotPreview, type StateSnapshotPreviewItem, type StateSnapshotPreviewVerdict, superJsonSerialize, superJsonDeserialize, type SuperJSONResult, reloadApp, scheduleReloadApp, resolveReloadStrategy, REMOTE_RELOAD_DELAY_MS, type ReloadStrategy, type ResolvedReloadStrategy, getDevServerOrigin, Subscribable, type SubscribableListener, subscriberCountNotifier, subscribeToSubscriberCountChanges, notifySubscriberCountChange, useSafeRouter, useSafePathname, useSafeSegments, useSafeGlobalSearchParams, getSafeRouter, getSafeCurrentPathname, getSafeCurrentRoute, isExpoRouterAvailable, } from "./utils";
|
|
5
|
+
export type { SafeRouteLocation } from "./utils";
|
|
5
6
|
export * from "./utils/formatting";
|
|
6
7
|
export * from "./utils/time";
|
|
7
8
|
export { isPlainObject as isPlainObjectUtil } from "./utils/typeHelpers";
|
|
@@ -28,6 +29,6 @@ export type { Environment } from "./types/types";
|
|
|
28
29
|
export { normalizeEnvironment } from "./types/types";
|
|
29
30
|
export { HintsProvider, useHintsDisabled, useHintsContext } from "./context";
|
|
30
31
|
export * from "./history";
|
|
31
|
-
export { FeatureGate, UpgradePrompt, useFeatureGate, ProFeatureBanner, UpgradeModal, LicenseEntryModal, ProBadge, ProUpgradeModal, getUseIsPro, getUseLicense } from "./license";
|
|
32
|
-
export type { FeatureGateProps, ProFeatureBannerProps, UpgradeModalProps, LicenseEntryModalProps, ProUpgradeModalProps } from "./license";
|
|
32
|
+
export { FeatureGate, UpgradePrompt, useFeatureGate, ProFeatureBanner, UpgradeModal, LicenseEntryModal, ProBadge, ProUpgradeModal, FreeAccountPrompt, LOGIN_COMMAND, getUseIsPro, getUseLicense, getUseTier, TIER_LIMITS, useLimit, resolveEffectiveTier, freeKeyRaises } from "./license";
|
|
33
|
+
export type { FeatureGateProps, ProFeatureBannerProps, UpgradeModalProps, LicenseEntryModalProps, ProUpgradeModalProps, FreeAccountPromptProps, BuoyTier, TierLimitKey } from "./license";
|
|
33
34
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,MAAM,CAAC;AAGrB,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAGlC,OAAO,EAEL,YAAY,EAEZ,YAAY,EACZ,iBAAiB,EAEjB,iBAAiB,EAEjB,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EAErB,aAAa,EAEb,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,YAAY,EAEZ,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,EAEV,kBAAkB,EAClB,uBAAuB,EAEvB,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AACA,cAAc,MAAM,CAAC;AAGrB,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAGlC,OAAO,EAEL,YAAY,EAEZ,YAAY,EACZ,iBAAiB,EAEjB,iBAAiB,EAEjB,iBAAiB,EACjB,wBAAwB,EACxB,qBAAqB,EAErB,aAAa,EAEb,YAAY,EACZ,WAAW,EACX,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,YAAY,EAEZ,UAAU,EACV,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,UAAU,EAEV,kBAAkB,EAClB,uBAAuB,EAEvB,wBAAwB,EACxB,wBAAwB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,iBAAiB,EAEtB,6BAA6B,EAC7B,yBAAyB,EACzB,wBAAwB,EACxB,iCAAiC,EACjC,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,oBAAoB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6
|
import React, { ReactNode } from "react";
|
|
7
|
+
import { type TierLimitKey } from "./tierLimits";
|
|
7
8
|
import type { ProAccessReason } from "@buoy-gg/license";
|
|
8
9
|
export declare const WEEKEND_PASS_LABEL = "WEEKEND PASS";
|
|
9
10
|
/**
|
|
@@ -24,8 +25,10 @@ export interface ProUpgradeModalProps {
|
|
|
24
25
|
visible: boolean;
|
|
25
26
|
onClose: () => void;
|
|
26
27
|
featureName?: string;
|
|
28
|
+
/** See {@link UpgradeModalProps.limitKey}. */
|
|
29
|
+
limitKey?: TierLimitKey;
|
|
27
30
|
}
|
|
28
|
-
export declare const ProUpgradeModal: ({ visible, onClose, featureName, }: ProUpgradeModalProps) => React.JSX.Element;
|
|
31
|
+
export declare const ProUpgradeModal: ({ visible, onClose, featureName, limitKey, }: ProUpgradeModalProps) => React.JSX.Element;
|
|
29
32
|
export interface FeatureGateProps {
|
|
30
33
|
/**
|
|
31
34
|
* Content to render when user has Pro access
|
|
@@ -55,10 +58,12 @@ export interface FeatureGateProps {
|
|
|
55
58
|
* Default upgrade prompt shown when user doesn't have Pro access
|
|
56
59
|
* Opens LicenseEntryModal when clicked (unless custom onUpgradePress provided)
|
|
57
60
|
*/
|
|
58
|
-
export declare const UpgradePrompt: ({ featureName, onUpgradePress, compact, }: {
|
|
61
|
+
export declare const UpgradePrompt: ({ featureName, onUpgradePress, compact, limitKey, }: {
|
|
59
62
|
featureName?: string;
|
|
60
63
|
onUpgradePress?: () => void;
|
|
61
64
|
compact?: boolean;
|
|
65
|
+
/** See {@link UpgradeModalProps.limitKey}. */
|
|
66
|
+
limitKey?: TierLimitKey;
|
|
62
67
|
}) => React.JSX.Element;
|
|
63
68
|
/**
|
|
64
69
|
* Wraps content that requires Pro license.
|
|
@@ -131,6 +136,17 @@ export interface UpgradeModalProps {
|
|
|
131
136
|
* List of Pro benefits to highlight
|
|
132
137
|
*/
|
|
133
138
|
benefits?: string[];
|
|
139
|
+
/**
|
|
140
|
+
* The tier limit the user just hit, if this upsell is about a limit rather
|
|
141
|
+
* than a Pro-exclusive feature.
|
|
142
|
+
*
|
|
143
|
+
* Supplying it is what lets an anonymous user be offered a FREE key instead
|
|
144
|
+
* of a paid upgrade — but only when a free key would genuinely raise that
|
|
145
|
+
* limit. Omit it for Pro-only features (copy, state editing, storage
|
|
146
|
+
* mutations, navigation): those are locked for free users too, so promising
|
|
147
|
+
* a free key would be a lie.
|
|
148
|
+
*/
|
|
149
|
+
limitKey?: TierLimitKey;
|
|
134
150
|
}
|
|
135
|
-
export declare const UpgradeModal: ({ visible, onClose, featureName, description, benefits, }: UpgradeModalProps) => React.JSX.Element | null;
|
|
151
|
+
export declare const UpgradeModal: ({ visible, onClose, featureName, description, benefits, limitKey, }: UpgradeModalProps) => React.JSX.Element | null;
|
|
136
152
|
//# sourceMappingURL=FeatureGate.d.ts.map
|