@oxy.so/bloom 23.8.0 → 23.8.1

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 (117) hide show
  1. package/android/src/main/java/so/oxy/bloom/AvatarLoops.kt +293 -0
  2. package/android/src/main/java/so/oxy/bloom/AvatarSurface.kt +351 -0
  3. package/android/src/main/java/so/oxy/bloom/BloomPackage.kt +1 -1
  4. package/docs/agent-avatar.mdx +77 -1
  5. package/docs/no-nativewind.mdx +3 -1
  6. package/docs/task-catalog.json +1 -1
  7. package/docs/task-catalog.mdx +1 -1
  8. package/docs/theme.mdx +21 -0
  9. package/lib/commonjs/agent-avatar/VectorCharacterAvatar.js +267 -111
  10. package/lib/commonjs/agent-avatar/VectorCharacterAvatar.js.map +1 -1
  11. package/lib/commonjs/agent-avatar/VectorNativeSurface.js +75 -0
  12. package/lib/commonjs/agent-avatar/VectorNativeSurface.js.map +1 -0
  13. package/lib/commonjs/agent-avatar/vector-loop.js +161 -0
  14. package/lib/commonjs/agent-avatar/vector-loop.js.map +1 -0
  15. package/lib/commonjs/agent-avatar/vector-visibility.js +4 -1
  16. package/lib/commonjs/agent-avatar/vector-visibility.js.map +1 -1
  17. package/lib/commonjs/blur/BlurIsland.js +112 -118
  18. package/lib/commonjs/blur/BlurIsland.js.map +1 -1
  19. package/lib/commonjs/button/Button.js +12 -22
  20. package/lib/commonjs/button/Button.js.map +1 -1
  21. package/lib/commonjs/button/GroupBase.js +35 -50
  22. package/lib/commonjs/button/GroupBase.js.map +1 -1
  23. package/lib/commonjs/floating/lens/lens-frame.js +286 -0
  24. package/lib/commonjs/floating/lens/lens-frame.js.map +1 -0
  25. package/lib/commonjs/floating/lens/lens-material.js +1 -1
  26. package/lib/commonjs/page-header/PageHeader.js +24 -15
  27. package/lib/commonjs/page-header/PageHeader.js.map +1 -1
  28. package/lib/commonjs/panel-routing/expo-router/StackScene.js +1 -0
  29. package/lib/commonjs/panel-routing/expo-router/StackScene.js.map +1 -1
  30. package/lib/commonjs/surface/Surface.js +64 -193
  31. package/lib/commonjs/surface/Surface.js.map +1 -1
  32. package/lib/commonjs/tab-bar/TabBarBase.js +18 -15
  33. package/lib/commonjs/tab-bar/TabBarBase.js.map +1 -1
  34. package/lib/module/agent-avatar/VectorCharacterAvatar.js +268 -112
  35. package/lib/module/agent-avatar/VectorCharacterAvatar.js.map +1 -1
  36. package/lib/module/agent-avatar/VectorNativeSurface.js +66 -0
  37. package/lib/module/agent-avatar/VectorNativeSurface.js.map +1 -0
  38. package/lib/module/agent-avatar/vector-loop.js +150 -0
  39. package/lib/module/agent-avatar/vector-loop.js.map +1 -0
  40. package/lib/module/agent-avatar/vector-visibility.js +3 -1
  41. package/lib/module/agent-avatar/vector-visibility.js.map +1 -1
  42. package/lib/module/blur/BlurIsland.js +112 -116
  43. package/lib/module/blur/BlurIsland.js.map +1 -1
  44. package/lib/module/button/Button.js +13 -23
  45. package/lib/module/button/Button.js.map +1 -1
  46. package/lib/module/button/GroupBase.js +37 -52
  47. package/lib/module/button/GroupBase.js.map +1 -1
  48. package/lib/module/floating/lens/lens-frame.js +282 -0
  49. package/lib/module/floating/lens/lens-frame.js.map +1 -0
  50. package/lib/module/floating/lens/lens-material.js +1 -1
  51. package/lib/module/page-header/PageHeader.js +24 -15
  52. package/lib/module/page-header/PageHeader.js.map +1 -1
  53. package/lib/module/panel-routing/expo-router/StackScene.js +1 -0
  54. package/lib/module/panel-routing/expo-router/StackScene.js.map +1 -1
  55. package/lib/module/surface/Surface.js +65 -194
  56. package/lib/module/surface/Surface.js.map +1 -1
  57. package/lib/module/tab-bar/TabBarBase.js +18 -15
  58. package/lib/module/tab-bar/TabBarBase.js.map +1 -1
  59. package/lib/typescript/commonjs/agent-avatar/VectorCharacterAvatar.d.ts.map +1 -1
  60. package/lib/typescript/commonjs/agent-avatar/VectorNativeSurface.d.ts +75 -0
  61. package/lib/typescript/commonjs/agent-avatar/VectorNativeSurface.d.ts.map +1 -0
  62. package/lib/typescript/commonjs/agent-avatar/vector-loop.d.ts +93 -0
  63. package/lib/typescript/commonjs/agent-avatar/vector-loop.d.ts.map +1 -0
  64. package/lib/typescript/commonjs/agent-avatar/vector-visibility.d.ts +2 -0
  65. package/lib/typescript/commonjs/agent-avatar/vector-visibility.d.ts.map +1 -1
  66. package/lib/typescript/commonjs/blur/BlurIsland.d.ts +1 -1
  67. package/lib/typescript/commonjs/blur/BlurIsland.d.ts.map +1 -1
  68. package/lib/typescript/commonjs/button/Button.d.ts.map +1 -1
  69. package/lib/typescript/commonjs/button/GroupBase.d.ts.map +1 -1
  70. package/lib/typescript/commonjs/floating/lens/lens-frame.d.ts +52 -0
  71. package/lib/typescript/commonjs/floating/lens/lens-frame.d.ts.map +1 -0
  72. package/lib/typescript/commonjs/floating/lens/lens-material.d.ts +1 -1
  73. package/lib/typescript/commonjs/page-header/PageHeader.d.ts.map +1 -1
  74. package/lib/typescript/commonjs/panel-routing/expo-router/StackScene.d.ts.map +1 -1
  75. package/lib/typescript/commonjs/surface/Surface.d.ts.map +1 -1
  76. package/lib/typescript/commonjs/tab-bar/TabBarBase.d.ts.map +1 -1
  77. package/lib/typescript/module/agent-avatar/VectorCharacterAvatar.d.ts.map +1 -1
  78. package/lib/typescript/module/agent-avatar/VectorNativeSurface.d.ts +75 -0
  79. package/lib/typescript/module/agent-avatar/VectorNativeSurface.d.ts.map +1 -0
  80. package/lib/typescript/module/agent-avatar/vector-loop.d.ts +93 -0
  81. package/lib/typescript/module/agent-avatar/vector-loop.d.ts.map +1 -0
  82. package/lib/typescript/module/agent-avatar/vector-visibility.d.ts +2 -0
  83. package/lib/typescript/module/agent-avatar/vector-visibility.d.ts.map +1 -1
  84. package/lib/typescript/module/blur/BlurIsland.d.ts +1 -1
  85. package/lib/typescript/module/blur/BlurIsland.d.ts.map +1 -1
  86. package/lib/typescript/module/button/Button.d.ts.map +1 -1
  87. package/lib/typescript/module/button/GroupBase.d.ts.map +1 -1
  88. package/lib/typescript/module/floating/lens/lens-frame.d.ts +52 -0
  89. package/lib/typescript/module/floating/lens/lens-frame.d.ts.map +1 -0
  90. package/lib/typescript/module/floating/lens/lens-material.d.ts +1 -1
  91. package/lib/typescript/module/page-header/PageHeader.d.ts.map +1 -1
  92. package/lib/typescript/module/panel-routing/expo-router/StackScene.d.ts.map +1 -1
  93. package/lib/typescript/module/surface/Surface.d.ts.map +1 -1
  94. package/lib/typescript/module/tab-bar/TabBarBase.d.ts.map +1 -1
  95. package/package.json +1 -1
  96. package/src/agent-avatar/VectorCharacterAvatar.tsx +327 -120
  97. package/src/agent-avatar/VectorNativeSurface.tsx +117 -0
  98. package/src/agent-avatar/vector-loop.ts +213 -0
  99. package/src/agent-avatar/vector-visibility.ts +3 -1
  100. package/src/blur/BlurIsland.tsx +16 -14
  101. package/src/button/Button.tsx +19 -36
  102. package/src/button/GroupBase.tsx +42 -56
  103. package/src/floating/lens/lens-frame.tsx +195 -0
  104. package/src/floating/lens/lens-material.ts +1 -1
  105. package/src/page-header/PageHeader.tsx +26 -13
  106. package/src/panel-routing/expo-router/StackScene.tsx +9 -0
  107. package/src/surface/Surface.tsx +13 -28
  108. package/src/tab-bar/TabBarBase.tsx +13 -8
  109. package/lib/commonjs/floating/lens/lens-button-host.js +0 -218
  110. package/lib/commonjs/floating/lens/lens-button-host.js.map +0 -1
  111. package/lib/module/floating/lens/lens-button-host.js +0 -214
  112. package/lib/module/floating/lens/lens-button-host.js.map +0 -1
  113. package/lib/typescript/commonjs/floating/lens/lens-button-host.d.ts +0 -34
  114. package/lib/typescript/commonjs/floating/lens/lens-button-host.d.ts.map +0 -1
  115. package/lib/typescript/module/floating/lens/lens-button-host.d.ts +0 -34
  116. package/lib/typescript/module/floating/lens/lens-button-host.d.ts.map +0 -1
  117. package/src/floating/lens/lens-button-host.tsx +0 -148
@@ -1,214 +0,0 @@
1
- "use strict";
2
-
3
- import { c as _c } from "react/compiler-runtime";
4
- /**
5
- * The native lens material for a control: the lens base (see `@oxy.so/bloom-lens`), the same
6
- * lens a menu grows out of. It draws the fill (the lens, tinted), springs under the finger and runs on the
7
- * UI thread; the control inside only draws its content and handles the press.
8
- */
9
- import { Children, useMemo } from 'react';
10
- import { StyleSheet } from 'react-native';
11
- import { useTheme } from "../../theme/use-theme.js";
12
- import { LENS_FROST } from "./lens-frost.js";
13
- import { LENS_FILL_TINT } from "./lens-tint.js";
14
- import { useLensAvailable } from "./lens-material.js";
15
- import { getNativeLens } from "./native-lens.js";
16
-
17
- /** The style keys that place a control among its siblings: they belong to the lens host. */
18
- import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
19
- const PLACEMENT_KEYS = ['position', 'top', 'right', 'bottom', 'left', 'start', 'end', 'zIndex', 'alignSelf', 'flex', 'flexGrow', 'flexShrink', 'flexBasis', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginHorizontal', 'marginVertical', 'marginStart', 'marginEnd'];
20
-
21
- /**
22
- * Splits a control's style in two: where it sits (the host's) and what it looks like and how big
23
- * it is (the control's). Size stays with both so the host and the control are the same box.
24
- */
25
- export function splitLensStyle(style) {
26
- const flat = StyleSheet.flatten(style) ?? {};
27
- const {
28
- position,
29
- top,
30
- right,
31
- bottom,
32
- left,
33
- start,
34
- end,
35
- zIndex,
36
- alignSelf
37
- } = flat;
38
- const {
39
- flex,
40
- flexGrow,
41
- flexShrink,
42
- flexBasis
43
- } = flat;
44
- const {
45
- margin,
46
- marginTop,
47
- marginRight,
48
- marginBottom,
49
- marginLeft
50
- } = flat;
51
- const {
52
- marginHorizontal,
53
- marginVertical,
54
- marginStart,
55
- marginEnd
56
- } = flat;
57
- const {
58
- width,
59
- height,
60
- minWidth,
61
- minHeight,
62
- maxWidth,
63
- maxHeight
64
- } = flat;
65
- const host = {
66
- position,
67
- top,
68
- right,
69
- bottom,
70
- left,
71
- start,
72
- end,
73
- zIndex,
74
- alignSelf,
75
- flex,
76
- flexGrow,
77
- flexShrink,
78
- flexBasis,
79
- margin,
80
- marginTop,
81
- marginRight,
82
- marginBottom,
83
- marginLeft,
84
- marginHorizontal,
85
- marginVertical,
86
- marginStart,
87
- marginEnd,
88
- // Size stays with both, so the host and the control are the same box.
89
- width,
90
- height,
91
- minWidth,
92
- minHeight,
93
- maxWidth,
94
- maxHeight
95
- };
96
- const control = {
97
- ...flat
98
- };
99
- for (const key of PLACEMENT_KEYS) delete control[key];
100
- return {
101
- host: definedOnly(host),
102
- control
103
- };
104
- }
105
- function definedOnly(style) {
106
- return Object.fromEntries(Object.entries(style).filter(([, value]) => value !== undefined));
107
- }
108
- export function LensButtonHost(t0) {
109
- const $ = _c(21);
110
- const {
111
- tint,
112
- radius,
113
- jelly,
114
- restBackdrop,
115
- style,
116
- children
117
- } = t0;
118
- const native = useLensAvailable() ? getNativeLens() : null;
119
- const dark = useTheme().isDark;
120
- let t1;
121
- if ($[0] !== tint) {
122
- t1 = tint ? {
123
- tintColor: tint,
124
- tintOpacity: LENS_FILL_TINT
125
- } : null;
126
- $[0] = tint;
127
- $[1] = t1;
128
- } else {
129
- t1 = $[1];
130
- }
131
- let t2;
132
- if ($[2] !== jelly) {
133
- t2 = jelly === undefined ? null : {
134
- jelly
135
- };
136
- $[2] = jelly;
137
- $[3] = t2;
138
- } else {
139
- t2 = $[3];
140
- }
141
- let t3;
142
- if ($[4] !== t1 || $[5] !== t2) {
143
- t3 = {
144
- blur: LENS_FROST.control,
145
- ...t1,
146
- ...t2
147
- };
148
- $[4] = t1;
149
- $[5] = t2;
150
- $[6] = t3;
151
- } else {
152
- t3 = $[6];
153
- }
154
- const config = t3;
155
- if (!native) {
156
- let t4;
157
- if ($[7] !== children) {
158
- t4 = Children.only(children);
159
- $[7] = children;
160
- $[8] = t4;
161
- } else {
162
- t4 = $[8];
163
- }
164
- let t5;
165
- if ($[9] !== t4) {
166
- t5 = /*#__PURE__*/_jsx(_Fragment, {
167
- children: t4
168
- });
169
- $[9] = t4;
170
- $[10] = t5;
171
- } else {
172
- t5 = $[10];
173
- }
174
- return t5;
175
- }
176
- const {
177
- LensBase
178
- } = native;
179
- const t4 = dark ? "dark" : "light";
180
- let t5;
181
- if ($[11] !== style) {
182
- t5 = [HOST, style];
183
- $[11] = style;
184
- $[12] = t5;
185
- } else {
186
- t5 = $[12];
187
- }
188
- let t6;
189
- if ($[13] !== LensBase || $[14] !== children || $[15] !== config || $[16] !== radius || $[17] !== restBackdrop || $[18] !== t4 || $[19] !== t5) {
190
- t6 = /*#__PURE__*/_jsx(LensBase, {
191
- colorScheme: t4,
192
- cornerRadius: radius,
193
- config: config,
194
- restBackdrop: restBackdrop,
195
- style: t5,
196
- children: children
197
- });
198
- $[13] = LensBase;
199
- $[14] = children;
200
- $[15] = config;
201
- $[16] = radius;
202
- $[17] = restBackdrop;
203
- $[18] = t4;
204
- $[19] = t5;
205
- $[20] = t6;
206
- } else {
207
- t6 = $[20];
208
- }
209
- return t6;
210
- }
211
- const HOST = {
212
- alignSelf: 'flex-start'
213
- };
214
- //# sourceMappingURL=lens-button-host.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["Children","useMemo","StyleSheet","useTheme","LENS_FROST","LENS_FILL_TINT","useLensAvailable","getNativeLens","Fragment","_Fragment","jsx","_jsx","PLACEMENT_KEYS","splitLensStyle","style","flat","flatten","position","top","right","bottom","left","start","end","zIndex","alignSelf","flex","flexGrow","flexShrink","flexBasis","margin","marginTop","marginRight","marginBottom","marginLeft","marginHorizontal","marginVertical","marginStart","marginEnd","width","height","minWidth","minHeight","maxWidth","maxHeight","host","control","key","definedOnly","Object","fromEntries","entries","filter","value","undefined","LensButtonHost","t0","$","_c","tint","radius","jelly","restBackdrop","children","native","dark","isDark","t1","tintColor","tintOpacity","t2","t3","blur","config","t4","only","t5","LensBase","HOST","t6","colorScheme"],"sourceRoot":"../../../../src","sources":["floating/lens/lens-button-host.tsx"],"mappings":";;;AAAA;AACA;AACA;AACA;AACA;AACA,SAASA,QAAQ,EAAkBC,OAAO,QAAQ,OAAO;AACzD,SAASC,UAAU,QAAwC,c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MAAAU,EAAA,GAAAT,IAAI,GAAJ,MAAuB,GAAvB,OAAuB;EAAA,IAAAW,EAAA;EAAA,IAAAnB,CAAA,SAAA3C,KAAA;IAI7B8D,EAAA,IAACE,IAAI,EAAEhE,KAAK,CAAC;IAAA2C,CAAA,OAAA3C,KAAA;IAAA2C,CAAA,OAAAmB,EAAA;EAAA;IAAAA,EAAA,GAAAnB,CAAA;EAAA;EAAA,IAAAsB,EAAA;EAAA,IAAAtB,CAAA,SAAAoB,QAAA,IAAApB,CAAA,SAAAM,QAAA,IAAAN,CAAA,SAAAgB,MAAA,IAAAhB,CAAA,SAAAG,MAAA,IAAAH,CAAA,SAAAK,YAAA,IAAAL,CAAA,SAAAiB,EAAA,IAAAjB,CAAA,SAAAmB,EAAA;IALtBG,EAAA,gBAAApE,IAAA,CAACkE,QAAQ;MACMG,WAAuB,EAAvBN,EAAuB;MACtBd,YAAM,EAANA,MAAM;MACZa,MAAM,EAANA,MAAM;MACAX,YAAY,EAAZA,YAAY;MACnBhD,KAAa,EAAb8D,EAAa;MAAAb,QAAA,EAEnBA;IAAQ,CACD,CAAC;IAAAN,CAAA,OAAAoB,QAAA;IAAApB,CAAA,OAAAM,QAAA;IAAAN,CAAA,OAAAgB,MAAA;IAAAhB,CAAA,OAAAG,MAAA;IAAAH,CAAA,OAAAK,YAAA;IAAAL,CAAA,OAAAiB,EAAA;IAAAjB,CAAA,OAAAmB,EAAA;IAAAnB,CAAA,OAAAsB,EAAA;EAAA;IAAAA,EAAA,GAAAtB,CAAA;EAAA;EAAA,OARXsB,EAQW;AAAA;AAIf,MAAMD,IAAI,GAAG;EAAErD,SAAS,EAAE;AAAa,CAAU","ignoreList":[]}
@@ -1,34 +0,0 @@
1
- /**
2
- * The native lens material for a control: the lens base (see `@oxy.so/bloom-lens`), the same
3
- * lens a menu grows out of. It draws the fill (the lens, tinted), springs under the finger and runs on the
4
- * UI thread; the control inside only draws its content and handles the press.
5
- */
6
- import { type ReactNode } from 'react';
7
- import { type StyleProp, type ViewStyle } from 'react-native';
8
- /**
9
- * Splits a control's style in two: where it sits (the host's) and what it looks like and how big
10
- * it is (the control's). Size stays with both so the host and the control are the same box.
11
- */
12
- export declare function splitLensStyle(style: StyleProp<ViewStyle>): {
13
- host: ViewStyle;
14
- control: ViewStyle;
15
- };
16
- interface LensButtonHostProps {
17
- /** `#rrggbb` or `rgb(...)`; omitted, the lens stays neutral. */
18
- tint?: string;
19
- /** The corner radius in dp; omitted, the shape is a capsule. */
20
- radius?: number;
21
- /** How far the press and the drag deform the lens, a multiplier of the engine's own (1). */
22
- jelly?: number;
23
- /**
24
- * The colour the control sits on, for a lens drawn in its place in the page (a control in a
25
- * scroll, never in a floating region): it samples this fill, not the window, and shares one still
26
- * with every control that looks the same.
27
- */
28
- restBackdrop?: string;
29
- style?: ViewStyle;
30
- children: ReactNode;
31
- }
32
- export declare function LensButtonHost({ tint, radius, jelly, restBackdrop, style, children, }: LensButtonHostProps): import("react").JSX.Element;
33
- export {};
34
- //# sourceMappingURL=lens-button-host.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lens-button-host.d.ts","sourceRoot":"","sources":["../../../../../src/floating/lens/lens-button-host.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAY,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAkC1E;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG;IAC3D,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,SAAS,CAAC;CACpB,CAyCA;AAMD,UAAU,mBAAmB;IAC3B,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4FAA4F;IAC5F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,MAAM,EACN,KAAK,EACL,YAAY,EACZ,KAAK,EACL,QAAQ,GACT,EAAE,mBAAmB,+BA2BrB"}
@@ -1,34 +0,0 @@
1
- /**
2
- * The native lens material for a control: the lens base (see `@oxy.so/bloom-lens`), the same
3
- * lens a menu grows out of. It draws the fill (the lens, tinted), springs under the finger and runs on the
4
- * UI thread; the control inside only draws its content and handles the press.
5
- */
6
- import { type ReactNode } from 'react';
7
- import { type StyleProp, type ViewStyle } from 'react-native';
8
- /**
9
- * Splits a control's style in two: where it sits (the host's) and what it looks like and how big
10
- * it is (the control's). Size stays with both so the host and the control are the same box.
11
- */
12
- export declare function splitLensStyle(style: StyleProp<ViewStyle>): {
13
- host: ViewStyle;
14
- control: ViewStyle;
15
- };
16
- interface LensButtonHostProps {
17
- /** `#rrggbb` or `rgb(...)`; omitted, the lens stays neutral. */
18
- tint?: string;
19
- /** The corner radius in dp; omitted, the shape is a capsule. */
20
- radius?: number;
21
- /** How far the press and the drag deform the lens, a multiplier of the engine's own (1). */
22
- jelly?: number;
23
- /**
24
- * The colour the control sits on, for a lens drawn in its place in the page (a control in a
25
- * scroll, never in a floating region): it samples this fill, not the window, and shares one still
26
- * with every control that looks the same.
27
- */
28
- restBackdrop?: string;
29
- style?: ViewStyle;
30
- children: ReactNode;
31
- }
32
- export declare function LensButtonHost({ tint, radius, jelly, restBackdrop, style, children, }: LensButtonHostProps): import("react").JSX.Element;
33
- export {};
34
- //# sourceMappingURL=lens-button-host.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lens-button-host.d.ts","sourceRoot":"","sources":["../../../../../src/floating/lens/lens-button-host.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAY,KAAK,SAAS,EAAW,MAAM,OAAO,CAAC;AAC1D,OAAO,EAAc,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAkC1E;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,GAAG;IAC3D,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,SAAS,CAAC;CACpB,CAyCA;AAMD,UAAU,mBAAmB;IAC3B,gEAAgE;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4FAA4F;IAC5F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,MAAM,EACN,KAAK,EACL,YAAY,EACZ,KAAK,EACL,QAAQ,GACT,EAAE,mBAAmB,+BA2BrB"}
@@ -1,148 +0,0 @@
1
- /**
2
- * The native lens material for a control: the lens base (see `@oxy.so/bloom-lens`), the same
3
- * lens a menu grows out of. It draws the fill (the lens, tinted), springs under the finger and runs on the
4
- * UI thread; the control inside only draws its content and handles the press.
5
- */
6
- import { Children, type ReactNode, useMemo } from 'react';
7
- import { StyleSheet, type StyleProp, type ViewStyle } from 'react-native';
8
-
9
- import { useTheme } from '../../theme/use-theme';
10
- import { LENS_FROST } from './lens-frost';
11
- import { LENS_FILL_TINT } from './lens-tint';
12
- import { useLensAvailable } from './lens-material';
13
- import { getNativeLens } from './native-lens';
14
-
15
- /** The style keys that place a control among its siblings: they belong to the lens host. */
16
- const PLACEMENT_KEYS = [
17
- 'position',
18
- 'top',
19
- 'right',
20
- 'bottom',
21
- 'left',
22
- 'start',
23
- 'end',
24
- 'zIndex',
25
- 'alignSelf',
26
- 'flex',
27
- 'flexGrow',
28
- 'flexShrink',
29
- 'flexBasis',
30
- 'margin',
31
- 'marginTop',
32
- 'marginRight',
33
- 'marginBottom',
34
- 'marginLeft',
35
- 'marginHorizontal',
36
- 'marginVertical',
37
- 'marginStart',
38
- 'marginEnd',
39
- ] as const;
40
-
41
- /**
42
- * Splits a control's style in two: where it sits (the host's) and what it looks like and how big
43
- * it is (the control's). Size stays with both so the host and the control are the same box.
44
- */
45
- export function splitLensStyle(style: StyleProp<ViewStyle>): {
46
- host: ViewStyle;
47
- control: ViewStyle;
48
- } {
49
- const flat = StyleSheet.flatten(style) ?? {};
50
- const { position, top, right, bottom, left, start, end, zIndex, alignSelf } = flat;
51
- const { flex, flexGrow, flexShrink, flexBasis } = flat;
52
- const { margin, marginTop, marginRight, marginBottom, marginLeft } = flat;
53
- const { marginHorizontal, marginVertical, marginStart, marginEnd } = flat;
54
- const { width, height, minWidth, minHeight, maxWidth, maxHeight } = flat;
55
- const host: ViewStyle = {
56
- position,
57
- top,
58
- right,
59
- bottom,
60
- left,
61
- start,
62
- end,
63
- zIndex,
64
- alignSelf,
65
- flex,
66
- flexGrow,
67
- flexShrink,
68
- flexBasis,
69
- margin,
70
- marginTop,
71
- marginRight,
72
- marginBottom,
73
- marginLeft,
74
- marginHorizontal,
75
- marginVertical,
76
- marginStart,
77
- marginEnd,
78
- // Size stays with both, so the host and the control are the same box.
79
- width,
80
- height,
81
- minWidth,
82
- minHeight,
83
- maxWidth,
84
- maxHeight,
85
- };
86
- const control: ViewStyle = { ...flat };
87
- for (const key of PLACEMENT_KEYS) delete control[key];
88
- return { host: definedOnly(host), control };
89
- }
90
-
91
- function definedOnly(style: ViewStyle): ViewStyle {
92
- return Object.fromEntries(Object.entries(style).filter(([, value]) => value !== undefined));
93
- }
94
-
95
- interface LensButtonHostProps {
96
- /** `#rrggbb` or `rgb(...)`; omitted, the lens stays neutral. */
97
- tint?: string;
98
- /** The corner radius in dp; omitted, the shape is a capsule. */
99
- radius?: number;
100
- /** How far the press and the drag deform the lens, a multiplier of the engine's own (1). */
101
- jelly?: number;
102
- /**
103
- * The colour the control sits on, for a lens drawn in its place in the page (a control in a
104
- * scroll, never in a floating region): it samples this fill, not the window, and shares one still
105
- * with every control that looks the same.
106
- */
107
- restBackdrop?: string;
108
- style?: ViewStyle;
109
- children: ReactNode;
110
- }
111
-
112
- export function LensButtonHost({
113
- tint,
114
- radius,
115
- jelly,
116
- restBackdrop,
117
- style,
118
- children,
119
- }: LensButtonHostProps) {
120
- const native = useLensAvailable() ? getNativeLens() : null;
121
- const dark = useTheme().isDark;
122
- // The same lens keeps the same config, so a render that changes nothing sends the engine nothing.
123
- const config = useMemo(
124
- () => ({
125
- blur: LENS_FROST.control,
126
- ...(tint ? { tintColor: tint, tintOpacity: LENS_FILL_TINT } : null),
127
- ...(jelly === undefined ? null : { jelly }),
128
- }),
129
- [tint, jelly],
130
- );
131
- if (!native) return <>{Children.only(children)}</>;
132
- const { LensBase } = native;
133
- // The one lens base (the upstream app's lens trigger): what it holds draws no lens of its own,
134
- // and a menu opened from inside it grows out of it.
135
- return (
136
- <LensBase
137
- colorScheme={dark ? 'dark' : 'light'}
138
- cornerRadius={radius}
139
- config={config}
140
- restBackdrop={restBackdrop}
141
- style={[HOST, style]}
142
- >
143
- {children}
144
- </LensBase>
145
- );
146
- }
147
-
148
- const HOST = { alignSelf: 'flex-start' } as const;