@symbiote-native/engine 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -11
- package/build/accessibility-props.d.ts +19 -0
- package/build/accessibility-props.js +209 -0
- package/build/action-sheet-ios/index.js +4 -1
- package/build/animated/animations/composition.js +3 -1
- package/build/animated/animations/spring-config.js +4 -1
- package/build/animated/animations/spring.js +23 -9
- package/build/animated/animations/timing.js +3 -2
- package/build/animated/bezier.js +2 -1
- package/build/animated/color.js +4 -2
- package/build/animated/event.js +7 -3
- package/build/animated/graph.js +8 -3
- package/build/animated/index.d.ts +2 -2
- package/build/animated/index.js +2 -2
- package/build/animated/interpolation.js +7 -2
- package/build/animated/mock.js +1 -1
- package/build/animated/native/native-animated.js +1 -1
- package/build/animated/operators.js +27 -6
- package/build/animated/props.js +1 -1
- package/build/animated/rgba.js +18 -3
- package/build/animated/style.js +13 -3
- package/build/animated/value-xy.d.ts +8 -5
- package/build/animated/value-xy.js +4 -1
- package/build/app-registry/index.d.ts +1 -0
- package/build/app-registry/index.js +15 -5
- package/build/appearance/index.js +4 -1
- package/build/commit.d.ts +35 -0
- package/build/commit.js +613 -74
- package/build/debug.js +10 -4
- package/build/events/index.js +142 -88
- package/build/fabric-props.js +171 -11
- package/build/fabric.d.ts +10 -3
- package/build/fabric.js +11 -2
- package/build/host-behavior.d.ts +47 -0
- package/build/host-behavior.js +262 -0
- package/build/host-instance/index.d.ts +2 -10
- package/build/host-instance/index.js +13 -46
- package/build/image-loader.js +3 -2
- package/build/index.d.ts +24 -17
- package/build/index.js +27 -13
- package/build/interaction-manager/index.js +2 -1
- package/build/layout-animation/index.js +12 -4
- package/build/native-events.js +2 -1
- package/build/native-modules/index.js +3 -1
- package/build/node.d.ts +121 -2
- package/build/node.js +623 -41
- package/build/pan-responder/index.js +20 -9
- package/build/permissions-android/index.js +3 -1
- package/build/platform/index.android.d.ts +1 -1
- package/build/platform/index.android.js +1 -1
- package/build/platform/index.ios.d.ts +1 -1
- package/build/platform-color/index.js +3 -1
- package/build/post-commit.d.ts +1 -0
- package/build/post-commit.js +6 -0
- package/build/process-background-image/index.js +30 -9
- package/build/process-filter.js +11 -4
- package/build/registry.js +10 -2
- package/build/report-error.js +4 -1
- package/build/share/index.android.js +1 -1
- package/build/share/index.ios.js +1 -1
- package/build/status-bar/index.android.js +3 -4
- package/build/status-bar/index.ios.js +1 -1
- package/build/style-registry/index.d.ts +11 -2
- package/build/style-registry/index.js +223 -169
- package/build/style-registry/scope.d.ts +15 -1
- package/build/style-registry/scope.js +29 -27
- package/build/styles.d.ts +11 -1
- package/build/surface.d.ts +1 -1
- package/build/surface.js +8 -0
- package/build/tags.d.ts +1 -0
- package/build/tags.js +31 -1
- package/build/touch-history.js +9 -2
- package/build/vibration/index.ios.js +1 -1
- package/build/view-config.js +20 -2
- package/package.json +12 -2
|
@@ -17,7 +17,9 @@ const SINGLE_TOUCH_COUNT = 1;
|
|
|
17
17
|
// onShouldBlockNativeResponder defaults to true (RN: block native by default).
|
|
18
18
|
const DEFAULT_BLOCK_NATIVE_RESPONDER = true;
|
|
19
19
|
function toFiniteNumber(value) {
|
|
20
|
-
return typeof value === 'number' && Number.isFinite(value)
|
|
20
|
+
return typeof value === 'number' && Number.isFinite(value)
|
|
21
|
+
? value
|
|
22
|
+
: undefined;
|
|
21
23
|
}
|
|
22
24
|
// Pull one touch out of an untyped array element, skipping anything that does not
|
|
23
25
|
// carry numeric pageX/pageY. `timestamp` falls back to 0 when absent so a touch
|
|
@@ -196,7 +198,7 @@ function initializeGestureState(gestureState) {
|
|
|
196
198
|
// The timestamp this frame advances to: the touch-history clock when shared attached a
|
|
197
199
|
// store, else the most recent of the live touches (headless direct-call path).
|
|
198
200
|
function frameTimestampOf(event, touches) {
|
|
199
|
-
return touchHistoryOf(event)?.mostRecentTimeStamp ?? mostRecentTimestamp(touches);
|
|
201
|
+
return (touchHistoryOf(event)?.mostRecentTimeStamp ?? mostRecentTimestamp(touches));
|
|
200
202
|
}
|
|
201
203
|
// Advance the gesture for a move frame. With a touch-history store (the device / shared
|
|
202
204
|
// path) this defers to RN's accumulate-per-moved-touch math; without one it falls back to
|
|
@@ -275,7 +277,8 @@ const PanResponder = {
|
|
|
275
277
|
// Skip a duplicate dispatch of the same frame: when two touches change at
|
|
276
278
|
// once the responder system fires twice, but the geometry was already
|
|
277
279
|
// folded in on the first call.
|
|
278
|
-
if (gestureState._accountsForMovesUpTo ===
|
|
280
|
+
if (gestureState._accountsForMovesUpTo ===
|
|
281
|
+
frameTimestampOf(event, touches)) {
|
|
279
282
|
return false;
|
|
280
283
|
}
|
|
281
284
|
updateGestureStateOnMove(gestureState, event, touches);
|
|
@@ -288,14 +291,19 @@ const PanResponder = {
|
|
|
288
291
|
const touches = readTouches(event);
|
|
289
292
|
const touchHistory = touchHistoryOf(event);
|
|
290
293
|
// x0/y0 is the non-cumulative centroid at grant time (RN: currentCentroid).
|
|
291
|
-
gestureState.x0 = touchHistory
|
|
292
|
-
|
|
294
|
+
gestureState.x0 = touchHistory
|
|
295
|
+
? currentCentroidXAll(touchHistory)
|
|
296
|
+
: centroidX(touches);
|
|
297
|
+
gestureState.y0 = touchHistory
|
|
298
|
+
? currentCentroidYAll(touchHistory)
|
|
299
|
+
: centroidY(touches);
|
|
293
300
|
gestureState.dx = 0;
|
|
294
301
|
gestureState.dy = 0;
|
|
295
302
|
// The grant frame is already accounted for, so the first move's velocity
|
|
296
303
|
// is measured from here, not from time 0.
|
|
297
304
|
gestureState._accountsForMovesUpTo = frameTimestampOf(event, touches);
|
|
298
|
-
gestureState.numberActiveTouches =
|
|
305
|
+
gestureState.numberActiveTouches =
|
|
306
|
+
touchHistory?.numberActiveTouches ?? touches.length;
|
|
299
307
|
config.onPanResponderGrant?.(event, gestureState);
|
|
300
308
|
return config.onShouldBlockNativeResponder === undefined
|
|
301
309
|
? DEFAULT_BLOCK_NATIVE_RESPONDER
|
|
@@ -306,13 +314,15 @@ const PanResponder = {
|
|
|
306
314
|
},
|
|
307
315
|
onResponderStart(event) {
|
|
308
316
|
gestureState.numberActiveTouches =
|
|
309
|
-
touchHistoryOf(event)?.numberActiveTouches ??
|
|
317
|
+
touchHistoryOf(event)?.numberActiveTouches ??
|
|
318
|
+
readTouches(event).length;
|
|
310
319
|
config.onPanResponderStart?.(event, gestureState);
|
|
311
320
|
},
|
|
312
321
|
onResponderMove(event) {
|
|
313
322
|
const touches = readTouches(event);
|
|
314
323
|
// Same duplicate-frame guard as the capture path.
|
|
315
|
-
if (gestureState._accountsForMovesUpTo ===
|
|
324
|
+
if (gestureState._accountsForMovesUpTo ===
|
|
325
|
+
frameTimestampOf(event, touches)) {
|
|
316
326
|
return;
|
|
317
327
|
}
|
|
318
328
|
updateGestureStateOnMove(gestureState, event, touches);
|
|
@@ -320,7 +330,8 @@ const PanResponder = {
|
|
|
320
330
|
},
|
|
321
331
|
onResponderEnd(event) {
|
|
322
332
|
gestureState.numberActiveTouches =
|
|
323
|
-
touchHistoryOf(event)?.numberActiveTouches ??
|
|
333
|
+
touchHistoryOf(event)?.numberActiveTouches ??
|
|
334
|
+
readTouches(event).length;
|
|
324
335
|
config.onPanResponderEnd?.(event, gestureState);
|
|
325
336
|
},
|
|
326
337
|
onResponderRelease(event) {
|
|
@@ -84,7 +84,9 @@ export const PERMISSIONS = Object.freeze({
|
|
|
84
84
|
// string is passed through as a IPermissionStatus only when it matches; otherwise
|
|
85
85
|
// we fall back to DENIED: a runtime guard at the trust boundary, not an `as`.
|
|
86
86
|
function toPermissionStatus(value) {
|
|
87
|
-
if (value === RESULTS.GRANTED ||
|
|
87
|
+
if (value === RESULTS.GRANTED ||
|
|
88
|
+
value === RESULTS.DENIED ||
|
|
89
|
+
value === RESULTS.NEVER_ASK_AGAIN) {
|
|
88
90
|
return value;
|
|
89
91
|
}
|
|
90
92
|
return RESULTS.DENIED;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IPlatformStatic } from './shared';
|
|
2
|
-
export type { IPlatformOSType, IPlatformSelectSpec, IPlatformStatic } from './shared';
|
|
2
|
+
export type { IPlatformOSType, IPlatformSelectSpec, IPlatformStatic, } from './shared';
|
|
3
3
|
export interface IPlatformConstantsAndroid {
|
|
4
4
|
isTesting: boolean;
|
|
5
5
|
isDisableAnimations?: boolean;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// from the PlatformConstants native module (RN spec NativePlatformConstantsAndroid.js,
|
|
4
4
|
// a different payload from iOS). Metro picks this on an Android host. The module name is
|
|
5
5
|
// the same 'PlatformConstants'; only the shape differs.
|
|
6
|
-
import { createConstantsResolver } from './shared.js';
|
|
6
|
+
import { createConstantsResolver, } from './shared.js';
|
|
7
7
|
// The filename already selected this host: 'android' is a literal, not a probe.
|
|
8
8
|
const OS_ANDROID = 'android';
|
|
9
9
|
// RN reads isTV off the uiMode constant.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type IPlatformStatic } from './shared';
|
|
2
|
-
export type { IPlatformOSType, IPlatformSelectSpec, IPlatformStatic } from './shared';
|
|
2
|
+
export type { IPlatformOSType, IPlatformSelectSpec, IPlatformStatic, } from './shared';
|
|
3
3
|
export interface IPlatformConstantsIOS {
|
|
4
4
|
forceTouchAvailable: boolean;
|
|
5
5
|
interfaceIdiom: string;
|
|
@@ -21,7 +21,9 @@ export function DynamicColorIOS(tuple) {
|
|
|
21
21
|
// True for the opaque objects above: the color seam uses this to route them
|
|
22
22
|
// through the platform processor alongside CSS-string colors.
|
|
23
23
|
export function isOpaqueColorValue(value) {
|
|
24
|
-
return typeof value === 'object' &&
|
|
24
|
+
return (typeof value === 'object' &&
|
|
25
|
+
value !== null &&
|
|
26
|
+
('semantic' in value || 'dynamic' in value));
|
|
25
27
|
}
|
|
26
28
|
// Color props must reach Fabric as platform ints, not CSS strings. Fabric's C++ color
|
|
27
29
|
// parser silently drops strings. The actual conversion (processColor) is RN-platform-specific,
|
package/build/post-commit.d.ts
CHANGED
package/build/post-commit.js
CHANGED
|
@@ -10,6 +10,12 @@ const hooks = new Set();
|
|
|
10
10
|
export function registerPostCommit(hook) {
|
|
11
11
|
hooks.add(hook);
|
|
12
12
|
}
|
|
13
|
+
// The counterpart, needed the moment a hook belongs to something with a lifetime (a screen, a
|
|
14
|
+
// component) rather than to the process. Without it a mounted-and-gone consumer keeps running
|
|
15
|
+
// after every commit forever, holding its whole closure alive.
|
|
16
|
+
export function unregisterPostCommit(hook) {
|
|
17
|
+
hooks.delete(hook);
|
|
18
|
+
}
|
|
13
19
|
export function runPostCommitHooks() {
|
|
14
20
|
for (const hook of hooks)
|
|
15
21
|
hook();
|
|
@@ -15,16 +15,23 @@ const COLOR_STOP_PARTS_REGEX = /\S+\([^)]*\)|\S+/g;
|
|
|
15
15
|
const WHITESPACE_NORMALIZE_REGEX = /\s+/g;
|
|
16
16
|
const LINEAR_GRADIENT_DIRECTION_REGEX = /^to\s+(?:top|bottom|left|right)(?:\s+(?:top|bottom|left|right))?/i;
|
|
17
17
|
const LINEAR_GRADIENT_ANGLE_UNIT_REGEX = /^([+-]?\d*\.?\d+)(deg|grad|rad|turn)$/i;
|
|
18
|
-
const LINEAR_GRADIENT_DEFAULT_DIRECTION = {
|
|
18
|
+
const LINEAR_GRADIENT_DEFAULT_DIRECTION = {
|
|
19
|
+
type: 'angle',
|
|
20
|
+
value: 180,
|
|
21
|
+
};
|
|
19
22
|
const DEFAULT_RADIAL_SHAPE = 'ellipse';
|
|
20
23
|
const DEFAULT_RADIAL_SIZE = 'farthest-corner';
|
|
21
|
-
const DEFAULT_RADIAL_POSITION = {
|
|
24
|
+
const DEFAULT_RADIAL_POSITION = {
|
|
25
|
+
top: '50%',
|
|
26
|
+
left: '50%',
|
|
27
|
+
};
|
|
22
28
|
function isStringOrNumber(value) {
|
|
23
29
|
return typeof value === 'string' || typeof value === 'number';
|
|
24
30
|
}
|
|
25
31
|
// A color-stop position is a plain px number or a percentage string; anything else is invalid.
|
|
26
32
|
function isPositionValue(value) {
|
|
27
|
-
return typeof value === 'number' ||
|
|
33
|
+
return (typeof value === 'number' ||
|
|
34
|
+
(typeof value === 'string' && value.endsWith('%')));
|
|
28
35
|
}
|
|
29
36
|
// A gradient color may already be a platform int (array form) or a CSS string/PlatformColor
|
|
30
37
|
// object needing processColor; mirrors process-box-shadow's processShadowColor.
|
|
@@ -63,7 +70,9 @@ function getAngleInDegrees(angle) {
|
|
|
63
70
|
}
|
|
64
71
|
}
|
|
65
72
|
function getDirectionForKeyword(direction) {
|
|
66
|
-
const normalized = direction
|
|
73
|
+
const normalized = direction
|
|
74
|
+
.replace(WHITESPACE_NORMALIZE_REGEX, ' ')
|
|
75
|
+
.toLowerCase();
|
|
67
76
|
switch (normalized) {
|
|
68
77
|
case 'to top':
|
|
69
78
|
return { type: 'angle', value: 0 };
|
|
@@ -106,7 +115,9 @@ function resolveRadialSize(value) {
|
|
|
106
115
|
value === 'farthest-corner') {
|
|
107
116
|
return value;
|
|
108
117
|
}
|
|
109
|
-
if (isRecord(value) &&
|
|
118
|
+
if (isRecord(value) &&
|
|
119
|
+
isStringOrNumber(value.x) &&
|
|
120
|
+
isStringOrNumber(value.y)) {
|
|
110
121
|
return { x: value.x, y: value.y };
|
|
111
122
|
}
|
|
112
123
|
return null;
|
|
@@ -129,7 +140,9 @@ function processColorStopsArray(rawColorStops) {
|
|
|
129
140
|
return null;
|
|
130
141
|
const positions = rawStop.positions;
|
|
131
142
|
// Color transition hint syntax (`red, 20%, blue`): a position with no color of its own.
|
|
132
|
-
if (rawStop.color == null &&
|
|
143
|
+
if (rawStop.color == null &&
|
|
144
|
+
Array.isArray(positions) &&
|
|
145
|
+
positions.length === 1) {
|
|
133
146
|
const position = positions[0];
|
|
134
147
|
if (!isPositionValue(position))
|
|
135
148
|
return null;
|
|
@@ -205,7 +218,13 @@ function processBackgroundImageArray(rawList) {
|
|
|
205
218
|
const position = isRadialPositionValue(rawBgImage.position)
|
|
206
219
|
? rawBgImage.position
|
|
207
220
|
: DEFAULT_RADIAL_POSITION;
|
|
208
|
-
result.push({
|
|
221
|
+
result.push({
|
|
222
|
+
type: 'radial-gradient',
|
|
223
|
+
shape,
|
|
224
|
+
size,
|
|
225
|
+
position,
|
|
226
|
+
colorStops,
|
|
227
|
+
});
|
|
209
228
|
}
|
|
210
229
|
}
|
|
211
230
|
return result;
|
|
@@ -365,11 +384,13 @@ function parseRadialGradientPositionTokens(tokens) {
|
|
|
365
384
|
const token2 = t2.toLowerCase().trim();
|
|
366
385
|
const horizontalPositions = ['left', 'center', 'right'];
|
|
367
386
|
const verticalPositions = ['top', 'center', 'bottom'];
|
|
368
|
-
if (horizontalPositions.includes(token1) &&
|
|
387
|
+
if (horizontalPositions.includes(token1) &&
|
|
388
|
+
verticalPositions.includes(token2)) {
|
|
369
389
|
left = token1 === 'left' ? '0%' : token1 === 'center' ? '50%' : '100%';
|
|
370
390
|
top = token2 === 'top' ? '0%' : token2 === 'center' ? '50%' : '100%';
|
|
371
391
|
}
|
|
372
|
-
else if (verticalPositions.includes(token1) &&
|
|
392
|
+
else if (verticalPositions.includes(token1) &&
|
|
393
|
+
horizontalPositions.includes(token2)) {
|
|
373
394
|
left = token2 === 'left' ? '0%' : token2 === 'center' ? '50%' : '100%';
|
|
374
395
|
top = token1 === 'top' ? '0%' : token1 === 'center' ? '50%' : '100%';
|
|
375
396
|
}
|
package/build/process-filter.js
CHANGED
|
@@ -74,7 +74,9 @@ export function processFilter(filter) {
|
|
|
74
74
|
for (const filterFunction of filter) {
|
|
75
75
|
const [filterName, filterValue] = Object.entries(filterFunction)[0];
|
|
76
76
|
if (filterName === 'dropShadow') {
|
|
77
|
-
const dropShadow = isDropShadowValue(filterValue)
|
|
77
|
+
const dropShadow = isDropShadowValue(filterValue)
|
|
78
|
+
? parseDropShadow(filterValue)
|
|
79
|
+
: null;
|
|
78
80
|
if (dropShadow == null) {
|
|
79
81
|
dlog(`processFilter reject: invalid dropShadow in array`);
|
|
80
82
|
return [];
|
|
@@ -154,7 +156,9 @@ function getFilterAmount(filterName, filterArgs) {
|
|
|
154
156
|
if (unit !== 'deg' && unit !== 'rad') {
|
|
155
157
|
return undefined;
|
|
156
158
|
}
|
|
157
|
-
return unit === 'rad'
|
|
159
|
+
return unit === 'rad'
|
|
160
|
+
? RADIANS_TO_DEGREES * filterArgAsNumber
|
|
161
|
+
: filterArgAsNumber;
|
|
158
162
|
// blur takes any non-negative CSS length that is not a percent; RN only has DIPs.
|
|
159
163
|
case 'blur':
|
|
160
164
|
if ((unit != null && unit !== 'px') || filterArgAsNumber < 0) {
|
|
@@ -169,7 +173,8 @@ function getFilterAmount(filterName, filterArgs) {
|
|
|
169
173
|
case 'opacity':
|
|
170
174
|
case 'saturate':
|
|
171
175
|
case 'sepia':
|
|
172
|
-
if ((unit != null && unit !== '%' && unit !== 'px') ||
|
|
176
|
+
if ((unit != null && unit !== '%' && unit !== 'px') ||
|
|
177
|
+
filterArgAsNumber < 0) {
|
|
173
178
|
return undefined;
|
|
174
179
|
}
|
|
175
180
|
return unit === '%' ? filterArgAsNumber / 100 : filterArgAsNumber;
|
|
@@ -179,7 +184,9 @@ function getFilterAmount(filterName, filterArgs) {
|
|
|
179
184
|
}
|
|
180
185
|
// RN processFilter.js:188-256.
|
|
181
186
|
function parseDropShadow(rawDropShadow) {
|
|
182
|
-
const dropShadow = typeof rawDropShadow === 'string'
|
|
187
|
+
const dropShadow = typeof rawDropShadow === 'string'
|
|
188
|
+
? parseDropShadowString(rawDropShadow)
|
|
189
|
+
: rawDropShadow;
|
|
183
190
|
if (dropShadow == null) {
|
|
184
191
|
return null;
|
|
185
192
|
}
|
package/build/registry.js
CHANGED
|
@@ -19,7 +19,11 @@
|
|
|
19
19
|
// NOT in that set derives. The list never grows with the community; it grows only
|
|
20
20
|
// when we add a core primitive of our own.
|
|
21
21
|
import { isRecord } from './type-guards.js';
|
|
22
|
-
const EMPTY = {
|
|
22
|
+
const EMPTY = {
|
|
23
|
+
listeners: new Set(),
|
|
24
|
+
byRaw: new Map(),
|
|
25
|
+
processors: new Map(),
|
|
26
|
+
};
|
|
23
27
|
// OUR own primitives: the finite set shared hand-tunes (view-config events,
|
|
24
28
|
// commit COLOR_PROPS). The source is never consulted for these, so they can't
|
|
25
29
|
// drift. Everything else derives. This list grows only when WE add a core
|
|
@@ -81,7 +85,11 @@ function deriveFromConfig(config, into) {
|
|
|
81
85
|
for (const raw in directEventTypes) {
|
|
82
86
|
const registrationName = directEventTypes[raw]?.registrationName;
|
|
83
87
|
if (typeof registrationName === 'string') {
|
|
84
|
-
addEvent(into, {
|
|
88
|
+
addEvent(into, {
|
|
89
|
+
raw,
|
|
90
|
+
listener: splitListener(registrationName),
|
|
91
|
+
direct: true,
|
|
92
|
+
});
|
|
85
93
|
}
|
|
86
94
|
}
|
|
87
95
|
}
|
package/build/report-error.js
CHANGED
|
@@ -42,7 +42,10 @@ export function reportUncaughtError(value, info) {
|
|
|
42
42
|
// ReactFiberErrorDialog sets exactly the same pair, in a try/catch because a frozen or
|
|
43
43
|
// sealed error still deserves to be reported, just without the frames.
|
|
44
44
|
try {
|
|
45
|
-
Object.assign(error, {
|
|
45
|
+
Object.assign(error, {
|
|
46
|
+
componentStack: info.componentStack,
|
|
47
|
+
isComponentError: true,
|
|
48
|
+
});
|
|
46
49
|
}
|
|
47
50
|
catch {
|
|
48
51
|
// Reported below regardless.
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
// name, so it is only proven on a real Android host (a bridgeless resolution log there).
|
|
10
10
|
import { dlog } from '../debug.js';
|
|
11
11
|
import { getNativeModule } from '../native-modules/index.js';
|
|
12
|
-
import { validateContent, shareActions, SHARED_ACTION, DISMISSED_ACTION } from './shared.js';
|
|
12
|
+
import { validateContent, shareActions, SHARED_ACTION, DISMISSED_ACTION, } from './shared.js';
|
|
13
13
|
const SHARE_MODULE = 'ShareModule';
|
|
14
14
|
// ShareModule.share resolves an untyped value at the native boundary; narrow it before
|
|
15
15
|
// reading `action` (no `as`).
|
package/build/share/index.ios.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { dlog } from '../debug.js';
|
|
8
8
|
import { getNativeModule } from '../native-modules/index.js';
|
|
9
9
|
import { ACTION_SHEET_MANAGER, } from '../action-sheet-ios/index.js';
|
|
10
|
-
import { validateContent, shareActions, SHARED_ACTION, DISMISSED_ACTION } from './shared.js';
|
|
10
|
+
import { validateContent, shareActions, SHARED_ACTION, DISMISSED_ACTION, } from './shared.js';
|
|
11
11
|
export const Share = {
|
|
12
12
|
...shareActions,
|
|
13
13
|
// Open the iOS share sheet for `content`. Resolves with the user's action
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import { getNativeModule } from '../native-modules/index.js';
|
|
13
13
|
import { dlog } from '../debug.js';
|
|
14
14
|
import { processColor } from '../platform-color/index.js';
|
|
15
|
-
import { STATUS_BAR_MANAGER } from './shared.js';
|
|
15
|
+
import { STATUS_BAR_MANAGER, } from './shared.js';
|
|
16
16
|
// processColor returns `unknown` (its result is platform-dependent); narrow to the
|
|
17
17
|
// number Fabric/native expects, like RN's invariant before setColor. A non-number
|
|
18
18
|
// (null for an unparseable color, headless identity passthrough of a string) is dropped.
|
|
@@ -31,7 +31,7 @@ function applyBackgroundColor(manager, color, animated) {
|
|
|
31
31
|
// single-arg Android setters. The adapter calls this from its declarative component's effect,
|
|
32
32
|
// on mount and on every prop change.
|
|
33
33
|
export function applyStatusBarProps(props) {
|
|
34
|
-
const { barStyle, hidden, animated = false, backgroundColor, translucent } = props;
|
|
34
|
+
const { barStyle, hidden, animated = false, backgroundColor, translucent, } = props;
|
|
35
35
|
const manager = getNativeModule(STATUS_BAR_MANAGER);
|
|
36
36
|
if (manager === null) {
|
|
37
37
|
dlog('StatusBar android: StatusBarManager not resolvable — skipping');
|
|
@@ -77,6 +77,5 @@ export const statusBarImperative = {
|
|
|
77
77
|
// constant is absent (older RN, or a fake that doesn't define getConstants). Read lazily
|
|
78
78
|
// so nothing touches native at import time.
|
|
79
79
|
export function statusBarCurrentHeight() {
|
|
80
|
-
return getNativeModule(STATUS_BAR_MANAGER)?.getConstants?.()
|
|
81
|
-
.HEIGHT;
|
|
80
|
+
return getNativeModule(STATUS_BAR_MANAGER)?.getConstants?.().HEIGHT;
|
|
82
81
|
}
|
|
@@ -21,7 +21,7 @@ import { STATUS_BAR_MANAGER, STATIC_HIDE_TRANSITION, hideTransition, } from './s
|
|
|
21
21
|
// (deepest/last wins); we direct-apply a single component's props, which is correct for one
|
|
22
22
|
// StatusBar and a fine first cut.
|
|
23
23
|
export function applyStatusBarProps(props) {
|
|
24
|
-
const { barStyle, hidden, animated = false, networkActivityIndicatorVisible } = props;
|
|
24
|
+
const { barStyle, hidden, animated = false, networkActivityIndicatorVisible, } = props;
|
|
25
25
|
const manager = getNativeModule(STATUS_BAR_MANAGER);
|
|
26
26
|
if (manager === null) {
|
|
27
27
|
dlog('StatusBar: StatusBarManager not resolvable via __turboModuleProxy — skipping');
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import type { IViewStyle, ITextStyle } from '../styles';
|
|
2
2
|
type IResolvedStyle = Partial<IViewStyle & ITextStyle>;
|
|
3
3
|
export type IClassNameValue = string | IResolvedStyle | Array<string | IResolvedStyle> | undefined | null;
|
|
4
|
-
export
|
|
4
|
+
export interface IStyleRule {
|
|
5
|
+
/** Class names AS AUTHORED / as renamed by the scoping pass. No normalization. */
|
|
6
|
+
readonly tokens: readonly string[];
|
|
7
|
+
readonly specificity: readonly [number, number, number];
|
|
8
|
+
/** Source order within its file; the registry adds a per-registration epoch on top. */
|
|
9
|
+
readonly order: number;
|
|
10
|
+
readonly style: IResolvedStyle;
|
|
11
|
+
}
|
|
12
|
+
export declare function registerRules(rules: readonly IStyleRule[]): void;
|
|
5
13
|
export declare function clearGlobalStyles(): void;
|
|
6
14
|
export declare function isClassNameValue(value: unknown): value is IClassNameValue;
|
|
15
|
+
export declare function canonicalClassName(className: IClassNameValue): IClassNameValue;
|
|
7
16
|
export declare function resolveClassName(className: IClassNameValue): IResolvedStyle;
|
|
8
|
-
export declare function
|
|
17
|
+
export declare function resolveActiveClassName(className: IClassNameValue): IResolvedStyle;
|
|
9
18
|
export {};
|