@buoy-gg/shared-ui 7.0.22 → 7.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (154) hide show
  1. package/lib/commonjs/JsModal.js +39 -16
  2. package/lib/commonjs/dataViewer/JsonStringNotice.js +59 -0
  3. package/lib/commonjs/dataViewer/ThemedSplitView.js +20 -1
  4. package/lib/commonjs/dataViewer/TimestampDeltaBar.js +96 -0
  5. package/lib/commonjs/dataViewer/index.js +52 -0
  6. package/lib/commonjs/dataViewer/jsonStringValue.js +94 -0
  7. package/lib/commonjs/dataViewer/timestampDiff.js +146 -0
  8. package/lib/commonjs/hooks/safe-area-impl.js +1 -1
  9. package/lib/commonjs/index.js +50 -1
  10. package/lib/commonjs/license/FeatureGate.js +43 -10
  11. package/lib/commonjs/license/FreeAccountPrompt.js +181 -0
  12. package/lib/commonjs/license/index.js +57 -42
  13. package/lib/commonjs/license/licenseModule.js +99 -0
  14. package/lib/commonjs/license/tierLimits.js +165 -0
  15. package/lib/commonjs/ui/backgrounds/BackgroundSwitcher.js +180 -0
  16. package/lib/commonjs/ui/backgrounds/README.md +115 -0
  17. package/lib/commonjs/ui/backgrounds/ToolBackground.js +74 -0
  18. package/lib/commonjs/ui/backgrounds/backgroundStore.js +116 -0
  19. package/lib/commonjs/ui/backgrounds/index.js +70 -0
  20. package/lib/commonjs/ui/backgrounds/primitives.js +333 -0
  21. package/lib/commonjs/ui/backgrounds/registry.js +112 -0
  22. package/lib/commonjs/ui/backgrounds/rng.js +72 -0
  23. package/lib/commonjs/ui/backgrounds/types.js +1 -0
  24. package/lib/commonjs/ui/backgrounds/variants/deepField.js +351 -0
  25. package/lib/commonjs/ui/backgrounds/variants/lattice.js +579 -0
  26. package/lib/commonjs/ui/backgrounds/variants/starfield.js +210 -0
  27. package/lib/commonjs/ui/index.js +15 -3
  28. package/lib/module/JsModal.js +39 -16
  29. package/lib/module/dataViewer/JsonStringNotice.js +54 -0
  30. package/lib/module/dataViewer/ThemedSplitView.js +20 -1
  31. package/lib/module/dataViewer/TimestampDeltaBar.js +91 -0
  32. package/lib/module/dataViewer/index.js +4 -0
  33. package/lib/module/dataViewer/jsonStringValue.js +89 -0
  34. package/lib/module/dataViewer/timestampDiff.js +139 -0
  35. package/lib/module/hooks/safe-area-impl.js +1 -1
  36. package/lib/module/index.js +1 -1
  37. package/lib/module/license/FeatureGate.js +43 -10
  38. package/lib/module/license/FreeAccountPrompt.js +176 -0
  39. package/lib/module/license/index.js +5 -40
  40. package/lib/module/license/licenseModule.js +92 -0
  41. package/lib/module/license/tierLimits.js +158 -0
  42. package/lib/module/ui/backgrounds/BackgroundSwitcher.js +176 -0
  43. package/lib/module/ui/backgrounds/README.md +115 -0
  44. package/lib/module/ui/backgrounds/ToolBackground.js +70 -0
  45. package/lib/module/ui/backgrounds/backgroundStore.js +111 -0
  46. package/lib/module/ui/backgrounds/index.js +9 -0
  47. package/lib/module/ui/backgrounds/primitives.js +328 -0
  48. package/lib/module/ui/backgrounds/registry.js +105 -0
  49. package/lib/module/ui/backgrounds/rng.js +65 -0
  50. package/lib/module/ui/backgrounds/types.js +1 -0
  51. package/lib/module/ui/backgrounds/variants/deepField.js +347 -0
  52. package/lib/module/ui/backgrounds/variants/lattice.js +575 -0
  53. package/lib/module/ui/backgrounds/variants/starfield.js +206 -0
  54. package/lib/module/ui/index.js +3 -0
  55. package/lib/typescript/commonjs/JsModal.d.ts.map +1 -1
  56. package/lib/typescript/commonjs/dataViewer/JsonStringNotice.d.ts +6 -0
  57. package/lib/typescript/commonjs/dataViewer/JsonStringNotice.d.ts.map +1 -0
  58. package/lib/typescript/commonjs/dataViewer/ThemedSplitView.d.ts.map +1 -1
  59. package/lib/typescript/commonjs/dataViewer/TimestampDeltaBar.d.ts +7 -0
  60. package/lib/typescript/commonjs/dataViewer/TimestampDeltaBar.d.ts.map +1 -0
  61. package/lib/typescript/commonjs/dataViewer/index.d.ts +6 -0
  62. package/lib/typescript/commonjs/dataViewer/index.d.ts.map +1 -1
  63. package/lib/typescript/commonjs/dataViewer/jsonStringValue.d.ts +25 -0
  64. package/lib/typescript/commonjs/dataViewer/jsonStringValue.d.ts.map +1 -0
  65. package/lib/typescript/commonjs/dataViewer/timestampDiff.d.ts +55 -0
  66. package/lib/typescript/commonjs/dataViewer/timestampDiff.d.ts.map +1 -0
  67. package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
  68. package/lib/typescript/commonjs/index.d.ts +2 -2
  69. package/lib/typescript/commonjs/index.d.ts.map +1 -1
  70. package/lib/typescript/commonjs/license/FeatureGate.d.ts +19 -3
  71. package/lib/typescript/commonjs/license/FeatureGate.d.ts.map +1 -1
  72. package/lib/typescript/commonjs/license/FreeAccountPrompt.d.ts +23 -0
  73. package/lib/typescript/commonjs/license/FreeAccountPrompt.d.ts.map +1 -0
  74. package/lib/typescript/commonjs/license/index.d.ts +6 -15
  75. package/lib/typescript/commonjs/license/index.d.ts.map +1 -1
  76. package/lib/typescript/commonjs/license/licenseModule.d.ts +55 -0
  77. package/lib/typescript/commonjs/license/licenseModule.d.ts.map +1 -0
  78. package/lib/typescript/commonjs/license/tierLimits.d.ts +143 -0
  79. package/lib/typescript/commonjs/license/tierLimits.d.ts.map +1 -0
  80. package/lib/typescript/commonjs/ui/backgrounds/BackgroundSwitcher.d.ts +13 -0
  81. package/lib/typescript/commonjs/ui/backgrounds/BackgroundSwitcher.d.ts.map +1 -0
  82. package/lib/typescript/commonjs/ui/backgrounds/ToolBackground.d.ts +30 -0
  83. package/lib/typescript/commonjs/ui/backgrounds/ToolBackground.d.ts.map +1 -0
  84. package/lib/typescript/commonjs/ui/backgrounds/backgroundStore.d.ts +43 -0
  85. package/lib/typescript/commonjs/ui/backgrounds/backgroundStore.d.ts.map +1 -0
  86. package/lib/typescript/commonjs/ui/backgrounds/index.d.ts +7 -0
  87. package/lib/typescript/commonjs/ui/backgrounds/index.d.ts.map +1 -0
  88. package/lib/typescript/commonjs/ui/backgrounds/primitives.d.ts +106 -0
  89. package/lib/typescript/commonjs/ui/backgrounds/primitives.d.ts.map +1 -0
  90. package/lib/typescript/commonjs/ui/backgrounds/registry.d.ts +28 -0
  91. package/lib/typescript/commonjs/ui/backgrounds/registry.d.ts.map +1 -0
  92. package/lib/typescript/commonjs/ui/backgrounds/rng.d.ts +27 -0
  93. package/lib/typescript/commonjs/ui/backgrounds/rng.d.ts.map +1 -0
  94. package/lib/typescript/commonjs/ui/backgrounds/types.d.ts +14 -0
  95. package/lib/typescript/commonjs/ui/backgrounds/types.d.ts.map +1 -0
  96. package/lib/typescript/commonjs/ui/backgrounds/variants/deepField.d.ts +65 -0
  97. package/lib/typescript/commonjs/ui/backgrounds/variants/deepField.d.ts.map +1 -0
  98. package/lib/typescript/commonjs/ui/backgrounds/variants/lattice.d.ts +33 -0
  99. package/lib/typescript/commonjs/ui/backgrounds/variants/lattice.d.ts.map +1 -0
  100. package/lib/typescript/commonjs/ui/backgrounds/variants/starfield.d.ts +12 -0
  101. package/lib/typescript/commonjs/ui/backgrounds/variants/starfield.d.ts.map +1 -0
  102. package/lib/typescript/commonjs/ui/index.d.ts +1 -0
  103. package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
  104. package/lib/typescript/module/JsModal.d.ts.map +1 -1
  105. package/lib/typescript/module/dataViewer/JsonStringNotice.d.ts +6 -0
  106. package/lib/typescript/module/dataViewer/JsonStringNotice.d.ts.map +1 -0
  107. package/lib/typescript/module/dataViewer/ThemedSplitView.d.ts.map +1 -1
  108. package/lib/typescript/module/dataViewer/TimestampDeltaBar.d.ts +7 -0
  109. package/lib/typescript/module/dataViewer/TimestampDeltaBar.d.ts.map +1 -0
  110. package/lib/typescript/module/dataViewer/index.d.ts +6 -0
  111. package/lib/typescript/module/dataViewer/index.d.ts.map +1 -1
  112. package/lib/typescript/module/dataViewer/jsonStringValue.d.ts +25 -0
  113. package/lib/typescript/module/dataViewer/jsonStringValue.d.ts.map +1 -0
  114. package/lib/typescript/module/dataViewer/timestampDiff.d.ts +55 -0
  115. package/lib/typescript/module/dataViewer/timestampDiff.d.ts.map +1 -0
  116. package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
  117. package/lib/typescript/module/index.d.ts +2 -2
  118. package/lib/typescript/module/index.d.ts.map +1 -1
  119. package/lib/typescript/module/license/FeatureGate.d.ts +19 -3
  120. package/lib/typescript/module/license/FeatureGate.d.ts.map +1 -1
  121. package/lib/typescript/module/license/FreeAccountPrompt.d.ts +23 -0
  122. package/lib/typescript/module/license/FreeAccountPrompt.d.ts.map +1 -0
  123. package/lib/typescript/module/license/index.d.ts +6 -15
  124. package/lib/typescript/module/license/index.d.ts.map +1 -1
  125. package/lib/typescript/module/license/licenseModule.d.ts +55 -0
  126. package/lib/typescript/module/license/licenseModule.d.ts.map +1 -0
  127. package/lib/typescript/module/license/tierLimits.d.ts +143 -0
  128. package/lib/typescript/module/license/tierLimits.d.ts.map +1 -0
  129. package/lib/typescript/module/ui/backgrounds/BackgroundSwitcher.d.ts +13 -0
  130. package/lib/typescript/module/ui/backgrounds/BackgroundSwitcher.d.ts.map +1 -0
  131. package/lib/typescript/module/ui/backgrounds/ToolBackground.d.ts +30 -0
  132. package/lib/typescript/module/ui/backgrounds/ToolBackground.d.ts.map +1 -0
  133. package/lib/typescript/module/ui/backgrounds/backgroundStore.d.ts +43 -0
  134. package/lib/typescript/module/ui/backgrounds/backgroundStore.d.ts.map +1 -0
  135. package/lib/typescript/module/ui/backgrounds/index.d.ts +7 -0
  136. package/lib/typescript/module/ui/backgrounds/index.d.ts.map +1 -0
  137. package/lib/typescript/module/ui/backgrounds/primitives.d.ts +106 -0
  138. package/lib/typescript/module/ui/backgrounds/primitives.d.ts.map +1 -0
  139. package/lib/typescript/module/ui/backgrounds/registry.d.ts +28 -0
  140. package/lib/typescript/module/ui/backgrounds/registry.d.ts.map +1 -0
  141. package/lib/typescript/module/ui/backgrounds/rng.d.ts +27 -0
  142. package/lib/typescript/module/ui/backgrounds/rng.d.ts.map +1 -0
  143. package/lib/typescript/module/ui/backgrounds/types.d.ts +14 -0
  144. package/lib/typescript/module/ui/backgrounds/types.d.ts.map +1 -0
  145. package/lib/typescript/module/ui/backgrounds/variants/deepField.d.ts +65 -0
  146. package/lib/typescript/module/ui/backgrounds/variants/deepField.d.ts.map +1 -0
  147. package/lib/typescript/module/ui/backgrounds/variants/lattice.d.ts +33 -0
  148. package/lib/typescript/module/ui/backgrounds/variants/lattice.d.ts.map +1 -0
  149. package/lib/typescript/module/ui/backgrounds/variants/starfield.d.ts +12 -0
  150. package/lib/typescript/module/ui/backgrounds/variants/starfield.d.ts.map +1 -0
  151. package/lib/typescript/module/ui/index.d.ts +1 -0
  152. package/lib/typescript/module/ui/index.d.ts.map +1 -1
  153. package/package.json +4 -4
  154. package/scripts/detect-safe-area.js +0 -20
@@ -0,0 +1,106 @@
1
+ /**
2
+ * Drawing + animation primitives for the tool backgrounds.
3
+ *
4
+ * HARD CONSTRAINT: Buoy's packages peer-depend on nothing but `react` and
5
+ * `react-native`. No Skia, no Reanimated, no SVG, no gradient library — a
6
+ * devtool cannot force a native dependency into someone's app. So every
7
+ * background here is built out of plain `View`s plus `Animated`, and the
8
+ * gradients/glows below are *faked* by stacking translucent layers.
9
+ *
10
+ * That sounds expensive. It isn't, because of two rules every preset follows:
11
+ *
12
+ * 1. **Every animation is native-driven.** `useNativeDriver: true` on a
13
+ * looping `Animated.timing` means the whole loop is handed to the UI thread
14
+ * once and never touches JS again — no per-frame callback, no re-render, no
15
+ * bridge traffic while it runs. A preset animates a handful of *layers*
16
+ * (transform on one parent view), never per-particle.
17
+ *
18
+ * 2. **Every static layer is rasterized.** `shouldRasterizeIOS` /
19
+ * `renderToHardwareTextureAndroid` turn a layer of 40 dots into a single
20
+ * cached GPU texture, so sliding it is one composite — the same cost as
21
+ * sliding one view. See `RasterLayer`.
22
+ *
23
+ * The result: a preset costs a one-time mount of static views and then ~0
24
+ * JS-thread work per frame. See `packages/shared/src/ui/backgrounds/README.md`.
25
+ */
26
+ import { Animated, type ViewStyle } from "react-native";
27
+ /**
28
+ * A native-driven 0→1 loop.
29
+ *
30
+ * The returned value is only ever consumed by `interpolate` inside an
31
+ * `Animated.View` style, so React never re-renders while it runs. The loop is
32
+ * stopped when the app backgrounds (a background animation is pure battery
33
+ * burn) and restarted on foreground.
34
+ */
35
+ export declare function useLoop(durationMs: number, enabled?: boolean): Animated.Value;
36
+ /**
37
+ * A native-driven 0→1→0 breathe, for glows that pulse rather than travel.
38
+ * Same no-JS-per-frame guarantee as `useLoop`.
39
+ */
40
+ export declare function usePulse(durationMs: number, enabled?: boolean): Animated.Value;
41
+ /**
42
+ * A layer whose children are static and should be flattened into one GPU
43
+ * texture. Wrap anything that gets translated/scaled as a whole — this is what
44
+ * makes a 40-dot star band cost the same to move as a single view.
45
+ */
46
+ export declare const RasterLayer: import("react").NamedExoticComponent<{
47
+ style?: ViewStyle | ViewStyle[];
48
+ /**
49
+ * Off turns this into a plain `View`. Rasterizing is a win for a small,
50
+ * busy layer and a LOSS for a large one — the offscreen buffer has to be
51
+ * allocated and blitted every frame it moves. Presets with big travelling
52
+ * layers should measure both ways rather than assume.
53
+ */
54
+ raster?: boolean;
55
+ children: React.ReactNode;
56
+ }>;
57
+ /**
58
+ * Fake radial gradient: concentric rounded views, each a constant per-ring
59
+ * alpha, with radii shrinking on a curve. Alpha compositing of N equal layers
60
+ * gives `1 - (1-a)^N` at the centre, so `a` is solved from the requested peak
61
+ * alpha and the falloff comes from the radius curve.
62
+ *
63
+ * 8 rings is the sweet spot on a dark surface — below that you can see banding,
64
+ * above it you're paying for views nobody can distinguish.
65
+ */
66
+ export declare const RadialGlow: import("react").NamedExoticComponent<{
67
+ size: number;
68
+ color: string;
69
+ /** Peak (centre) alpha. */
70
+ alpha?: number;
71
+ rings?: number;
72
+ /** >1 concentrates the light in the middle; 1 is a linear cone. */
73
+ falloff?: number;
74
+ style?: ViewStyle;
75
+ }>;
76
+ /**
77
+ * Fake linear gradient: `bands` stacked strips with linearly interpolated
78
+ * alpha. Used for scrims (keep text readable over a busy field) and for
79
+ * horizon glows. 12–16 bands is invisible as banding at these alphas.
80
+ */
81
+ export declare const LinearFade: import("react").NamedExoticComponent<{
82
+ color: string;
83
+ /** Alpha at the start edge. */
84
+ from?: number;
85
+ /** Alpha at the end edge. */
86
+ to?: number;
87
+ bands?: number;
88
+ direction?: "down" | "up" | "left" | "right";
89
+ style?: ViewStyle;
90
+ }>;
91
+ /**
92
+ * Edge darkening. Four `LinearFade`s rather than a real radial vignette —
93
+ * cheaper, and at these alphas the corners read as round anyway.
94
+ */
95
+ export declare const Vignette: import("react").NamedExoticComponent<{
96
+ color?: string;
97
+ alpha?: number;
98
+ /** Fraction of each edge the fade covers. */
99
+ spread?: number;
100
+ }>;
101
+ /** Flat wash used as the base coat under every preset. */
102
+ export declare const Base: import("react").NamedExoticComponent<{
103
+ color: string;
104
+ }>;
105
+ export declare const hairline: number;
106
+ //# sourceMappingURL=primitives.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"primitives.d.ts","sourceRoot":"","sources":["../../../../../src/ui/backgrounds/primitives.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAGH,OAAO,EACL,QAAQ,EAMR,KAAK,SAAS,EACf,MAAM,cAAc,CAAC;AAQtB;;;;;;;GAOG;AACH,wBAAgB,OAAO,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,UAAO,GAAG,QAAQ,CAAC,KAAK,CAsC1E;AAED;;;GAGG;AACH,wBAAgB,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,UAAO,GAAG,QAAQ,CAAC,KAAK,CA6C3E;AAMD;;;;GAIG;AACH,eAAO,MAAM,WAAW;YAKd,SAAS,GAAG,SAAS,EAAE;IAC/B;;;;;OAKG;aACM,OAAO;cACN,KAAK,CAAC,SAAS;EAezB,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,UAAU;UAQf,MAAM;WACL,MAAM;IACb,2BAA2B;YACnB,MAAM;YACN,MAAM;IACd,mEAAmE;cACzD,MAAM;YACR,SAAS;EA+BjB,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,UAAU;WAQd,MAAM;IACb,+BAA+B;WACxB,MAAM;IACb,6BAA6B;SACxB,MAAM;YACH,MAAM;gBACF,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,OAAO;YACpC,SAAS;EAuCjB,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,QAAQ;YAKX,MAAM;YACN,MAAM;IACd,6CAA6C;aACpC,MAAM;EAqBf,CAAC;AAEH,0DAA0D;AAC1D,eAAO,MAAM,IAAI;WAA0C,MAAM;EAO/D,CAAC;AAEH,eAAO,MAAM,QAAQ,QAA2B,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * The catalogue. Adding a preset means adding one entry here — the switcher,
3
+ * the persisted selection and every tool surface read from this list.
4
+ *
5
+ * `nodes` and `views` are not decoration: they are the number of native
6
+ * animated nodes the preset runs and the rough count of static views it mounts,
7
+ * so the switcher can show what each look costs while you compare them. Keep
8
+ * them honest.
9
+ */
10
+ import type { ComponentType } from "react";
11
+ import type { BackgroundId, BackgroundVariantProps } from "./types";
12
+ export interface BackgroundPreset {
13
+ id: BackgroundId;
14
+ label: string;
15
+ /** One line, shown under the name in the switcher. */
16
+ blurb: string;
17
+ /** Animated nodes running while visible (all native-driven). */
18
+ nodes: number;
19
+ /** Approximate static views mounted once, at a 380×620 surface. */
20
+ views: number;
21
+ Component: ComponentType<BackgroundVariantProps> | null;
22
+ }
23
+ export declare const BACKGROUND_PRESETS: BackgroundPreset[];
24
+ export declare const DEFAULT_BACKGROUND: BackgroundId;
25
+ export declare function presetIndex(id: BackgroundId): number;
26
+ export declare function presetAt(index: number): BackgroundPreset;
27
+ export declare function getPreset(id: BackgroundId): BackgroundPreset;
28
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../../src/ui/backgrounds/registry.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAa3C,OAAO,KAAK,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEpE,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,YAAY,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,aAAa,CAAC,sBAAsB,CAAC,GAAG,IAAI,CAAC;CACzD;AAED,eAAO,MAAM,kBAAkB,EAAE,gBAAgB,EAyFhD,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,YAAwB,CAAC;AAE1D,wBAAgB,WAAW,CAAC,EAAE,EAAE,YAAY,GAAG,MAAM,CAGpD;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,CAGxD;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,YAAY,GAAG,gBAAgB,CAE5D"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Deterministic scatter tables for the tool backgrounds.
3
+ *
4
+ * Every preset needs a pile of "random" positions, sizes and phases. Those are
5
+ * generated ONCE at module load from a fixed seed and frozen, so:
6
+ * - the same seed always paints the same field (screenshots are stable, and
7
+ * two tools showing the same background look identical),
8
+ * - no allocation happens on mount or on any re-render — the presets only
9
+ * read these arrays.
10
+ *
11
+ * Ported from the seeded field in the Everlights starfield (mulberry32).
12
+ */
13
+ export declare function mulberry32(seed: number): () => number;
14
+ /** `count` numbers in [0,1) from `seed`. */
15
+ export declare function scatter(seed: number, count: number): number[];
16
+ /** `#RRGGBB` (or `#RGB`) + alpha 0..1 → `rgba(...)`. */
17
+ export declare function withAlpha(hex: string, alpha: number): string;
18
+ /**
19
+ * `hex` at `alpha` composited over an opaque `base`, returned as an OPAQUE
20
+ * colour.
21
+ *
22
+ * Over a known backdrop this is pixel-identical to drawing the translucent
23
+ * colour — the GPU just doesn't have to blend it. Only valid where nothing
24
+ * else sits between the layer and `base`.
25
+ */
26
+ export declare function flattenOver(hex: string, alpha: number, base: string): string;
27
+ //# sourceMappingURL=rng.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rng.d.ts","sourceRoot":"","sources":["../../../../../src/ui/backgrounds/rng.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,MAAM,CAOrD;AAED,4CAA4C;AAC5C,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAK7D;AAED,wDAAwD;AACxD,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAS5D;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAY5E"}
@@ -0,0 +1,14 @@
1
+ /** Shared contract for every background preset. */
2
+ export interface BackgroundVariantProps {
3
+ /** Measured surface size, in px. Presets are only mounted once this is > 0. */
4
+ width: number;
5
+ height: number;
6
+ /**
7
+ * False → paint the field but start no loops. Set when the user turns motion
8
+ * off, so a preset degrades to its (still good-looking) static form instead
9
+ * of disappearing.
10
+ */
11
+ animated: boolean;
12
+ }
13
+ export type BackgroundId = "off" | "starfield" | "deepfield" | "hexmesh" | "isogrid" | "crosshatch" | "perfboard" | "halftone" | "waffle" | "instrument" | "radar";
14
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/ui/backgrounds/types.ts"],"names":[],"mappings":"AAAA,mDAAmD;AACnD,MAAM,WAAW,sBAAsB;IACrC,+EAA+E;IAC/E,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,YAAY,GACpB,KAAK,GACL,WAAW,GACX,WAAW,GACX,SAAS,GACT,SAAS,GACT,YAAY,GACZ,WAAW,GACX,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,OAAO,CAAC"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Deep Field — a faithful port of the Everlights `ParallaxDriftBackground`.
3
+ *
4
+ * The sibling `Starfield` preset is a cheap approximation of the same idea: 99
5
+ * stars quantised into five depth bands. This one reproduces the original's
6
+ * field exactly — same seed, same generator call order, same 160 stars, same
7
+ * `z = zNear + zSpan·√rnd()` far-plane bias, same sizes, brightnesses, palette
8
+ * and drift. Drop the constants below into the Skia version and you get the
9
+ * same sky.
10
+ *
11
+ * WHAT COULDN'T COME ACROSS 1:1, and what was done instead:
12
+ *
13
+ * - **Continuous per-star speed.** The original runs a worklet per star, so
14
+ * every one of the 160 drifts at its own `drift/z`. Here a distinct speed
15
+ * means a distinct animated node, so SPEED (and only speed) is quantised
16
+ * into 18 bands — banded uniformly in 1/z, which is what speed is
17
+ * proportional to, so the steps are even. Size, brightness, colour and
18
+ * twinkle phase all stay per-star and exact, and those are the properties
19
+ * the eye actually reads as depth.
20
+ *
21
+ * - **The soft bulb sprite.** The original bakes one 64px sprite (blurred halo
22
+ * at r=6/α.30 over a blurred core at r=4/α1) and stamps it at `dia`. That is
23
+ * why stars stay fine points even at dia=20 — the lit core is only ~13% of
24
+ * the stamp. There is no blur primitive here, so each star is a small solid
25
+ * core at that same 13%, and the nearer ones get one or two concentric
26
+ * discs standing in for the halo. Far stars end up a single ~1px dot, which
27
+ * is what the sprite renders them as anyway.
28
+ *
29
+ * - **Additive blending.** `blendMode="plus"` becomes ordinary alpha
30
+ * compositing. Over a near-black base the two agree except where stars
31
+ * overlap, which at this density is rare.
32
+ *
33
+ * It costs roughly twice the cheap Starfield — see `registry.tsx` — which is
34
+ * the whole reason both are in the catalogue.
35
+ */
36
+ import type { BackgroundVariantProps } from "../types";
37
+ /** How the ±8% brightness wobble is applied. */
38
+ export type TwinkleMode = "group" | "fused" | "off";
39
+ /** How many concentric discs stand in for the sprite's blurred halo. */
40
+ export type HaloMode = "full" | "flat" | "none";
41
+ export interface DeepFieldTuning {
42
+ /** How finely per-star speed is quantised. Shipping default: 18. */
43
+ bandCount?: number;
44
+ /** Rasterize each travelling band layer. */
45
+ raster?: boolean;
46
+ twinkle?: TwinkleMode;
47
+ halo?: HaloMode;
48
+ /** Flatten every star against the backdrop so nothing has to alpha-blend. */
49
+ opaque?: boolean;
50
+ /** Off mounts the field but never moves it — separates existing from moving. */
51
+ drift?: boolean;
52
+ /**
53
+ * How many stars to build. 160 is the shipping field; anything else is a
54
+ * benchmarking scale, not the Everlights sky.
55
+ */
56
+ starCount?: number;
57
+ }
58
+ /**
59
+ * The tunable body. `DeepField` below is this with the shipping defaults; the
60
+ * bench route (`example-dev-build/app/bg-bench.tsx`) drives the knobs so every
61
+ * measured variant is this exact code, not a copy of it.
62
+ */
63
+ export declare const DeepFieldTunable: import("react").NamedExoticComponent<BackgroundVariantProps & DeepFieldTuning>;
64
+ export declare const DeepField: import("react").NamedExoticComponent<BackgroundVariantProps>;
65
+ //# sourceMappingURL=deepField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"deepField.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/backgrounds/variants/deepField.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAOH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AA8BvD,gDAAgD;AAChD,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,CAAC;AACpD,wEAAwE;AACxE,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAgOhD,MAAM,WAAW,eAAe;IAC9B,oEAAoE;IACpE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4CAA4C;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,gFAAgF;IAChF,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,gFA+D3B,CAAC;AAEH,eAAO,MAAM,SAAS,8DAEpB,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * The lattice family — quiet technical geometry.
3
+ *
4
+ * All eight share one register, set by Hex Mesh: a near-black base, one soft
5
+ * off-centre glow for depth, a rasterized hairline pattern at low alpha, a slow
6
+ * breath, and a vignette. They read as instrument panels and drafting paper
7
+ * rather than scenery, which is what keeps them legible under dense tool UI —
8
+ * the pattern never competes with the text on top of it.
9
+ *
10
+ * Cost follows from that: the geometry is static, so it rasterizes into ONE
11
+ * texture and the only animated node is the shared breath. See
12
+ * `../README.md` for the contract.
13
+ */
14
+ import type { BackgroundVariantProps } from "../types";
15
+ /**
16
+ * Squares rotated 45°, odd rows offset by half a step. RN has no polygon
17
+ * primitive, so this is the honest way to get a technical mesh out of bordered
18
+ * views; at this scale it reads the same as a hex grid.
19
+ */
20
+ export declare const HexMesh: import("react").NamedExoticComponent<BackgroundVariantProps>;
21
+ export declare const IsoGrid: import("react").NamedExoticComponent<BackgroundVariantProps>;
22
+ export declare const Crosshatch: import("react").NamedExoticComponent<BackgroundVariantProps>;
23
+ export declare const PerfBoard: import("react").NamedExoticComponent<BackgroundVariantProps>;
24
+ /**
25
+ * The only preset in the family with a gradient in it, and it's made of dot
26
+ * SIZE rather than colour: dots swell toward the light and shrink away from it.
27
+ * Cheaper than a real gradient and it survives any background colour.
28
+ */
29
+ export declare const Halftone: import("react").NamedExoticComponent<BackgroundVariantProps>;
30
+ export declare const Waffle: import("react").NamedExoticComponent<BackgroundVariantProps>;
31
+ export declare const Instrument: import("react").NamedExoticComponent<BackgroundVariantProps>;
32
+ export declare const Radar: import("react").NamedExoticComponent<BackgroundVariantProps>;
33
+ //# sourceMappingURL=lattice.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lattice.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/backgrounds/variants/lattice.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAOH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AA6HvD;;;;GAIG;AACH,eAAO,MAAM,OAAO,8DAgClB,CAAC;AAMH,eAAO,MAAM,OAAO,8DAWlB,CAAC;AAMH,eAAO,MAAM,UAAU,8DAQrB,CAAC;AAQH,eAAO,MAAM,SAAS,8DAgCpB,CAAC;AAQH;;;;GAIG;AACH,eAAO,MAAM,QAAQ,8DAkCnB,CAAC;AAQH,eAAO,MAAM,MAAM,8DA6BjB,CAAC;AAMH,eAAO,MAAM,UAAU,8DAgDrB,CAAC;AAmEH,eAAO,MAAM,KAAK,8DAmEhB,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Starfield — the RN-primitive port of the Everlights parallax-drift starfield.
3
+ *
4
+ * The original is a GPU-instanced Skia `<Atlas>` with a per-star worklet; Buoy
5
+ * can't depend on Skia, so the depth continuum is quantised into five discrete
6
+ * bands. Each band is one rasterized layer of dots sliding at its own speed —
7
+ * five native-driven loops instead of 160 per-frame transforms — and the eye
8
+ * reads five parallax speeds as depth just as well as it reads a continuum.
9
+ */
10
+ import type { BackgroundVariantProps } from "../types";
11
+ export declare const Starfield: import("react").NamedExoticComponent<BackgroundVariantProps>;
12
+ //# sourceMappingURL=starfield.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"starfield.d.ts","sourceRoot":"","sources":["../../../../../../src/ui/backgrounds/variants/starfield.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAsHvD,eAAO,MAAM,SAAS,8DAyBpB,CAAC"}
@@ -1,4 +1,5 @@
1
1
  export * from "./components";
2
+ export * from "./backgrounds";
2
3
  export { toolTheme, type ToolTheme } from "./toolTheme";
3
4
  export { CyberpunkSectionButton } from "./console/CyberpunkSectionButton";
4
5
  export * from "./gameUI";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/ui/index.ts"],"names":[],"mappings":"AAGA,cAAc,cAAc,CAAC;AAG7B,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@buoy-gg/shared-ui",
3
- "version": "7.0.22",
3
+ "version": "7.0.24",
4
4
  "description": "Shared UI components, hooks, and utilities",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -136,10 +136,10 @@
136
136
  ],
137
137
  "sideEffects": false,
138
138
  "dependencies": {
139
- "@buoy-gg/floating-tools-core": "^7.0.22"
139
+ "@buoy-gg/floating-tools-core": "^7.0.24"
140
140
  },
141
141
  "peerDependencies": {
142
- "@buoy-gg/license": "7.0.22",
142
+ "@buoy-gg/license": "7.0.24",
143
143
  "@react-native-clipboard/clipboard": "*",
144
144
  "expo-clipboard": "*",
145
145
  "expo-file-system": "*",
@@ -167,7 +167,7 @@
167
167
  "expo-clipboard": "~7.1.5",
168
168
  "react-native-safe-area-context": "^5.6.2",
169
169
  "typescript": "~5.8.3",
170
- "@buoy-gg/license": "^7.0.22"
170
+ "@buoy-gg/license": "^7.0.24"
171
171
  },
172
172
  "react-native-builder-bob": {
173
173
  "source": "src",
@@ -30,26 +30,6 @@ const OUTPUT_FILE = path.join(__dirname, "..", "src", "hooks", "safe-area-impl.t
30
30
  // Check for explicit fallback override (used during publishing)
31
31
  const forceFallback = process.env.REACT_BUOY_FALLBACK === "1";
32
32
 
33
- // In the monorepo this file is CHECKED IN, so rewriting it on every postinstall
34
- // dirtied the working tree with a change nobody made — which is how it ended up
35
- // committed by accident twice (see `chore: regenerated safe-area state from
36
- // release install` and the revert that followed).
37
- //
38
- // Skipping here is safe because the committed variant is what monorepo builds
39
- // and the example apps want, and it costs nothing: the publish path below still
40
- // regenerates. detect-clipboard.js already guards itself the same way.
41
- //
42
- // The `forceFallback` exemption is load-bearing — prepublishOnly runs this with
43
- // REACT_BUOY_FALLBACK=1, and skipping THAT would publish the native variant,
44
- // whose static `react-native-safe-area-context` import breaks every consumer
45
- // that doesn't have the package. That is the exact failure this script exists
46
- // to prevent.
47
- if (!forceFallback && fs.existsSync(path.join(__dirname, "..", "src"))) {
48
- console.log(
49
- "[@buoy/shared-ui] Safe area: skipping postinstall (workspace mode — src/ is checked in)"
50
- );
51
- process.exit(0);
52
- }
53
33
 
54
34
  /**
55
35
  * Find the monorepo/project root by looking for pnpm-workspace.yaml or package.json with workspaces