vitest-native 0.3.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/CHANGELOG.md +72 -0
- package/README.md +240 -11
- package/dist/chunk-CZWwpsFl.cjs +43 -0
- package/dist/{index-CJqS-y_M.d.cts → index-CJIhukN_.d.mts} +58 -4
- package/dist/{index-h4vpIkQO.d.mts → index-DEB7OFaJ.d.cts} +60 -2
- package/dist/index.cjs +252 -21
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +248 -18
- package/dist/jest-compat/interop.mjs +30 -0
- package/dist/jest-compat/jest-globals.d.mts +3 -0
- package/dist/jest-compat/jest-globals.mjs +9 -0
- package/dist/jest-compat/noop.d.mts +3 -0
- package/dist/jest-compat/noop.mjs +7 -0
- package/dist/jest-compat/setup.d.mts +3 -0
- package/dist/jest-compat/setup.mjs +41 -0
- package/dist/jest-compat.cjs +109 -0
- package/dist/jest-compat.d.cts +38 -0
- package/dist/jest-compat.d.mts +38 -0
- package/dist/jest-compat.mjs +104 -0
- package/dist/matchers.cjs +69 -0
- package/dist/matchers.d.cts +51 -0
- package/dist/matchers.d.mts +51 -0
- package/dist/matchers.mjs +66 -0
- package/dist/native/boundary.mjs +225 -0
- package/dist/native/globals.mjs +112 -0
- package/dist/native/hooks.mjs +85 -0
- package/dist/native/loader.mjs +123 -0
- package/dist/native/match.mjs +9 -0
- package/dist/native/reset.mjs +170 -0
- package/dist/native/resolve.mjs +22 -0
- package/dist/native/runner.mjs +18 -0
- package/dist/native/setup.mjs +134 -0
- package/dist/native/transform.mjs +79 -0
- package/dist/native/worker.mjs +96 -0
- package/dist/pool-B4mWN3N5.cjs +60 -0
- package/dist/pool-oPTZiSXU.mjs +58 -0
- package/dist/{preset-map-DxU6UgYS.cjs → preset-map-C3jxnkiX.cjs} +5 -1
- package/dist/{preset-map-BTpoNH3G.mjs → preset-map-OJm5IWuL.mjs} +5 -1
- package/dist/{presets-B-spxZz7.cjs → presets-2I68Ipyl.cjs} +437 -41
- package/dist/{presets-DvrcfEPz.mjs → presets-DOGXQzYT.mjs} +401 -6
- package/dist/presets.cjs +5 -1
- package/dist/presets.d.cts +2 -2
- package/dist/presets.d.mts +2 -2
- package/dist/presets.mjs +2 -2
- package/dist/setup.cjs +263 -115
- package/dist/setup.mjs +259 -112
- package/docs/migrating-from-jest.md +123 -0
- package/docs/migrating-from-vitest-react-native.md +109 -0
- package/package.json +65 -9
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
import { t as __exportAll } from "./chunk-CjcI7cDX.mjs";
|
|
2
|
+
import { createRequire } from "node:module";
|
|
3
|
+
import path from "node:path";
|
|
2
4
|
import { vi } from "vitest";
|
|
3
|
-
import React from "react";
|
|
5
|
+
import React, { useState } from "react";
|
|
4
6
|
//#region src/presets/reanimated.ts
|
|
7
|
+
/**
|
|
8
|
+
* Resolve the *active* React Native module — the mock under `engine: 'mock'`
|
|
9
|
+
* (intercepted by the CJS bridge) or real RN under `engine: 'native'` (served by
|
|
10
|
+
* the Node loader hooks). Cached. Lets the reanimated mock's `Animated.View`
|
|
11
|
+
* &co. wrap whichever RN component set is live, so the preset is engine-agnostic.
|
|
12
|
+
*/
|
|
13
|
+
let _rnCache = null;
|
|
14
|
+
function getRN() {
|
|
15
|
+
if (_rnCache) return _rnCache;
|
|
16
|
+
try {
|
|
17
|
+
_rnCache = createRequire(path.join(process.env.VITEST_NATIVE_PROJECT_ROOT || process.cwd(), "package.json"))("react-native");
|
|
18
|
+
} catch {
|
|
19
|
+
_rnCache = {};
|
|
20
|
+
}
|
|
21
|
+
return _rnCache;
|
|
22
|
+
}
|
|
5
23
|
function reanimated() {
|
|
6
24
|
return {
|
|
7
25
|
name: "reanimated",
|
|
@@ -26,6 +44,14 @@ function reanimated() {
|
|
|
26
44
|
"runOnJS",
|
|
27
45
|
"runOnUI",
|
|
28
46
|
"createAnimatedComponent",
|
|
47
|
+
"addWhitelistedUIProps",
|
|
48
|
+
"addWhitelistedNativeProps",
|
|
49
|
+
"configureProps",
|
|
50
|
+
"View",
|
|
51
|
+
"Text",
|
|
52
|
+
"Image",
|
|
53
|
+
"ScrollView",
|
|
54
|
+
"FlatList",
|
|
29
55
|
"Easing",
|
|
30
56
|
"FadeIn",
|
|
31
57
|
"FadeOut",
|
|
@@ -189,6 +215,9 @@ function reanimated() {
|
|
|
189
215
|
function runOnUI(fn) {
|
|
190
216
|
return fn;
|
|
191
217
|
}
|
|
218
|
+
function addWhitelistedUIProps(_props) {}
|
|
219
|
+
function addWhitelistedNativeProps(_props) {}
|
|
220
|
+
function configureProps() {}
|
|
192
221
|
function createAnimatedComponent(component) {
|
|
193
222
|
const Animated = React.forwardRef((props, ref) => {
|
|
194
223
|
return React.createElement(component, {
|
|
@@ -199,6 +228,23 @@ function reanimated() {
|
|
|
199
228
|
Animated.displayName = `Animated(${component.displayName || component.name || "Component"})`;
|
|
200
229
|
return Animated;
|
|
201
230
|
}
|
|
231
|
+
function makeAnimatedHost(name) {
|
|
232
|
+
const Comp = React.forwardRef((props, ref) => {
|
|
233
|
+
const Base = getRN()[name];
|
|
234
|
+
if (!Base) throw new Error(`[vitest-native] reanimated preset: react-native '${name}' is unavailable`);
|
|
235
|
+
return React.createElement(Base, {
|
|
236
|
+
...props,
|
|
237
|
+
ref
|
|
238
|
+
});
|
|
239
|
+
});
|
|
240
|
+
Comp.displayName = `Animated.${name}`;
|
|
241
|
+
return Comp;
|
|
242
|
+
}
|
|
243
|
+
const View = makeAnimatedHost("View");
|
|
244
|
+
const Text = makeAnimatedHost("Text");
|
|
245
|
+
const Image = makeAnimatedHost("Image");
|
|
246
|
+
const ScrollView = makeAnimatedHost("ScrollView");
|
|
247
|
+
const FlatList = makeAnimatedHost("FlatList");
|
|
202
248
|
function createLayoutAnim() {
|
|
203
249
|
const obj = {};
|
|
204
250
|
obj.duration = vi.fn().mockReturnValue(obj);
|
|
@@ -218,7 +264,25 @@ function reanimated() {
|
|
|
218
264
|
return obj;
|
|
219
265
|
}
|
|
220
266
|
return {
|
|
221
|
-
default: {
|
|
267
|
+
default: {
|
|
268
|
+
createAnimatedComponent,
|
|
269
|
+
View,
|
|
270
|
+
Text,
|
|
271
|
+
Image,
|
|
272
|
+
ScrollView,
|
|
273
|
+
FlatList,
|
|
274
|
+
addWhitelistedUIProps,
|
|
275
|
+
addWhitelistedNativeProps,
|
|
276
|
+
configureProps
|
|
277
|
+
},
|
|
278
|
+
addWhitelistedUIProps,
|
|
279
|
+
addWhitelistedNativeProps,
|
|
280
|
+
configureProps,
|
|
281
|
+
View,
|
|
282
|
+
Text,
|
|
283
|
+
Image,
|
|
284
|
+
ScrollView,
|
|
285
|
+
FlatList,
|
|
222
286
|
useSharedValue,
|
|
223
287
|
useAnimatedStyle,
|
|
224
288
|
useAnimatedProps,
|
|
@@ -345,6 +409,40 @@ function reanimated() {
|
|
|
345
409
|
};
|
|
346
410
|
}
|
|
347
411
|
//#endregion
|
|
412
|
+
//#region src/mocks/components/pressableHost.ts
|
|
413
|
+
function buildPressableHostProps(props, ref) {
|
|
414
|
+
const { disabled, accessibilityState, onPress, onPressIn, onPressOut, onLongPress, ...rest } = props;
|
|
415
|
+
const mergedA11yState = disabled || accessibilityState ? {
|
|
416
|
+
...accessibilityState,
|
|
417
|
+
...disabled ? { disabled: true } : {}
|
|
418
|
+
} : void 0;
|
|
419
|
+
return {
|
|
420
|
+
accessible: true,
|
|
421
|
+
...disabled ? {} : {
|
|
422
|
+
onStartShouldSetResponder: () => true,
|
|
423
|
+
onResponderGrant: (e) => onPressIn?.(e),
|
|
424
|
+
onResponderRelease: (e) => {
|
|
425
|
+
onPress?.(e);
|
|
426
|
+
onPressOut?.(e);
|
|
427
|
+
},
|
|
428
|
+
onPress,
|
|
429
|
+
onPressIn,
|
|
430
|
+
onPressOut,
|
|
431
|
+
onLongPress
|
|
432
|
+
},
|
|
433
|
+
...rest,
|
|
434
|
+
...mergedA11yState ? { accessibilityState: mergedA11yState } : {},
|
|
435
|
+
ref
|
|
436
|
+
};
|
|
437
|
+
}
|
|
438
|
+
//#endregion
|
|
439
|
+
//#region src/mocks/components/Pressable.ts
|
|
440
|
+
function createPressableMock() {
|
|
441
|
+
const Pressable = React.forwardRef((props, ref) => React.createElement("Pressable", buildPressableHostProps(props, ref)));
|
|
442
|
+
Pressable.displayName = "Pressable";
|
|
443
|
+
return Pressable;
|
|
444
|
+
}
|
|
445
|
+
//#endregion
|
|
348
446
|
//#region src/presets/gesture-handler.ts
|
|
349
447
|
function gestureHandler() {
|
|
350
448
|
return {
|
|
@@ -372,7 +470,13 @@ function gestureHandler() {
|
|
|
372
470
|
"TouchableOpacity",
|
|
373
471
|
"TouchableHighlight",
|
|
374
472
|
"TouchableWithoutFeedback",
|
|
375
|
-
"TouchableNativeFeedback"
|
|
473
|
+
"TouchableNativeFeedback",
|
|
474
|
+
"Pressable",
|
|
475
|
+
"RectButton",
|
|
476
|
+
"BaseButton",
|
|
477
|
+
"BorderlessButton",
|
|
478
|
+
"RawButton",
|
|
479
|
+
"PureNativeButton"
|
|
376
480
|
],
|
|
377
481
|
factory: () => {
|
|
378
482
|
const State = {
|
|
@@ -490,7 +594,13 @@ function gestureHandler() {
|
|
|
490
594
|
TouchableOpacity: createGestureHandler("GH-TouchableOpacity"),
|
|
491
595
|
TouchableHighlight: createGestureHandler("GH-TouchableHighlight"),
|
|
492
596
|
TouchableWithoutFeedback: createGestureHandler("GH-TouchableWithoutFeedback"),
|
|
493
|
-
TouchableNativeFeedback: createGestureHandler("GH-TouchableNativeFeedback")
|
|
597
|
+
TouchableNativeFeedback: createGestureHandler("GH-TouchableNativeFeedback"),
|
|
598
|
+
Pressable: createPressableMock(),
|
|
599
|
+
RectButton: createGestureHandler("RectButton"),
|
|
600
|
+
BaseButton: createGestureHandler("BaseButton"),
|
|
601
|
+
BorderlessButton: createGestureHandler("BorderlessButton"),
|
|
602
|
+
RawButton: createGestureHandler("RawButton"),
|
|
603
|
+
PureNativeButton: createGestureHandler("PureNativeButton")
|
|
494
604
|
};
|
|
495
605
|
}
|
|
496
606
|
} }
|
|
@@ -1344,15 +1454,300 @@ function expo() {
|
|
|
1344
1454
|
};
|
|
1345
1455
|
}
|
|
1346
1456
|
//#endregion
|
|
1457
|
+
//#region src/presets/device-info.ts
|
|
1458
|
+
const STRINGS = {
|
|
1459
|
+
getBrand: "Apple",
|
|
1460
|
+
getModel: "iPhone",
|
|
1461
|
+
getDeviceId: "iPhone14,2",
|
|
1462
|
+
getSystemName: "iOS",
|
|
1463
|
+
getSystemVersion: "17.0",
|
|
1464
|
+
getVersion: "1.0.0",
|
|
1465
|
+
getReadableVersion: "1.0.0.1",
|
|
1466
|
+
getBuildNumber: "1",
|
|
1467
|
+
getBundleId: "com.example.app",
|
|
1468
|
+
getApplicationName: "Example",
|
|
1469
|
+
getDeviceName: "iPhone",
|
|
1470
|
+
getUniqueId: "mock-unique-id",
|
|
1471
|
+
getInstallReferrer: "",
|
|
1472
|
+
getDeviceType: "Handset",
|
|
1473
|
+
getUserAgent: "vitest-native",
|
|
1474
|
+
getCarrier: "",
|
|
1475
|
+
getManufacturer: "Apple"
|
|
1476
|
+
};
|
|
1477
|
+
const BOOLEANS = {
|
|
1478
|
+
hasNotch: true,
|
|
1479
|
+
hasDynamicIsland: false,
|
|
1480
|
+
isTablet: false,
|
|
1481
|
+
isEmulator: false,
|
|
1482
|
+
isPinOrFingerprintSet: false,
|
|
1483
|
+
isCameraPresent: true,
|
|
1484
|
+
isLandscape: false,
|
|
1485
|
+
isLowBatteryLevel: false,
|
|
1486
|
+
isHeadphonesConnected: false
|
|
1487
|
+
};
|
|
1488
|
+
const NUMBERS = {
|
|
1489
|
+
getFontScale: 1,
|
|
1490
|
+
getBatteryLevel: 1,
|
|
1491
|
+
getTotalMemory: 4e9,
|
|
1492
|
+
getUsedMemory: 1e9,
|
|
1493
|
+
getApiLevel: 33
|
|
1494
|
+
};
|
|
1495
|
+
function deviceInfo() {
|
|
1496
|
+
const exports = [
|
|
1497
|
+
...Object.keys(STRINGS),
|
|
1498
|
+
...Object.keys(BOOLEANS),
|
|
1499
|
+
...Object.keys(NUMBERS),
|
|
1500
|
+
...Object.keys(STRINGS).map((k) => k + "Sync"),
|
|
1501
|
+
...Object.keys(BOOLEANS).map((k) => k + "Sync"),
|
|
1502
|
+
...Object.keys(NUMBERS).map((k) => k + "Sync")
|
|
1503
|
+
];
|
|
1504
|
+
return {
|
|
1505
|
+
name: "deviceInfo",
|
|
1506
|
+
modules: { "react-native-device-info": {
|
|
1507
|
+
exports,
|
|
1508
|
+
factory: () => {
|
|
1509
|
+
const api = {};
|
|
1510
|
+
for (const [k, v] of Object.entries({
|
|
1511
|
+
...STRINGS,
|
|
1512
|
+
...BOOLEANS,
|
|
1513
|
+
...NUMBERS
|
|
1514
|
+
})) {
|
|
1515
|
+
api[k] = () => Promise.resolve(v);
|
|
1516
|
+
api[k + "Sync"] = () => v;
|
|
1517
|
+
}
|
|
1518
|
+
for (const k of [
|
|
1519
|
+
"hasNotch",
|
|
1520
|
+
"hasDynamicIsland",
|
|
1521
|
+
"isTablet",
|
|
1522
|
+
"getDeviceType"
|
|
1523
|
+
]) {
|
|
1524
|
+
const src = {
|
|
1525
|
+
...STRINGS,
|
|
1526
|
+
...BOOLEANS
|
|
1527
|
+
};
|
|
1528
|
+
api[k] = () => src[k];
|
|
1529
|
+
}
|
|
1530
|
+
api.getUniqueIdSync = () => STRINGS.getUniqueId;
|
|
1531
|
+
return {
|
|
1532
|
+
__esModule: true,
|
|
1533
|
+
default: api,
|
|
1534
|
+
...api
|
|
1535
|
+
};
|
|
1536
|
+
}
|
|
1537
|
+
} }
|
|
1538
|
+
};
|
|
1539
|
+
}
|
|
1540
|
+
//#endregion
|
|
1541
|
+
//#region src/presets/mmkv.ts
|
|
1542
|
+
function mmkv() {
|
|
1543
|
+
return {
|
|
1544
|
+
name: "mmkv",
|
|
1545
|
+
modules: { "react-native-mmkv": {
|
|
1546
|
+
exports: [
|
|
1547
|
+
"MMKV",
|
|
1548
|
+
"createMMKV",
|
|
1549
|
+
"useMMKV",
|
|
1550
|
+
"useMMKVString",
|
|
1551
|
+
"useMMKVNumber",
|
|
1552
|
+
"useMMKVBoolean",
|
|
1553
|
+
"useMMKVObject",
|
|
1554
|
+
"useMMKVBuffer",
|
|
1555
|
+
"useMMKVListener",
|
|
1556
|
+
"Mode"
|
|
1557
|
+
],
|
|
1558
|
+
factory: () => {
|
|
1559
|
+
class MMKV {
|
|
1560
|
+
_store = /* @__PURE__ */ new Map();
|
|
1561
|
+
set(key, value) {
|
|
1562
|
+
this._store.set(key, value);
|
|
1563
|
+
}
|
|
1564
|
+
getString(key) {
|
|
1565
|
+
const v = this._store.get(key);
|
|
1566
|
+
return typeof v === "string" ? v : void 0;
|
|
1567
|
+
}
|
|
1568
|
+
getNumber(key) {
|
|
1569
|
+
const v = this._store.get(key);
|
|
1570
|
+
return typeof v === "number" ? v : void 0;
|
|
1571
|
+
}
|
|
1572
|
+
getBoolean(key) {
|
|
1573
|
+
const v = this._store.get(key);
|
|
1574
|
+
return typeof v === "boolean" ? v : void 0;
|
|
1575
|
+
}
|
|
1576
|
+
getBuffer(key) {
|
|
1577
|
+
const v = this._store.get(key);
|
|
1578
|
+
return v instanceof Uint8Array ? v : void 0;
|
|
1579
|
+
}
|
|
1580
|
+
contains(key) {
|
|
1581
|
+
return this._store.has(key);
|
|
1582
|
+
}
|
|
1583
|
+
delete(key) {
|
|
1584
|
+
this._store.delete(key);
|
|
1585
|
+
}
|
|
1586
|
+
getAllKeys() {
|
|
1587
|
+
return [...this._store.keys()];
|
|
1588
|
+
}
|
|
1589
|
+
clearAll() {
|
|
1590
|
+
this._store.clear();
|
|
1591
|
+
}
|
|
1592
|
+
recrypt() {}
|
|
1593
|
+
addOnValueChangedListener() {
|
|
1594
|
+
return { remove() {} };
|
|
1595
|
+
}
|
|
1596
|
+
}
|
|
1597
|
+
const shared = new MMKV();
|
|
1598
|
+
const createMMKV = () => new MMKV();
|
|
1599
|
+
const useMMKV = () => shared;
|
|
1600
|
+
function makeHook(get) {
|
|
1601
|
+
return (key, instance) => {
|
|
1602
|
+
const m = instance ?? shared;
|
|
1603
|
+
const [value, setValue] = useState(get(m, key));
|
|
1604
|
+
const set = (v) => {
|
|
1605
|
+
if (v === void 0) m.delete(key);
|
|
1606
|
+
else m.set(key, v);
|
|
1607
|
+
setValue(v);
|
|
1608
|
+
};
|
|
1609
|
+
return [value, set];
|
|
1610
|
+
};
|
|
1611
|
+
}
|
|
1612
|
+
return {
|
|
1613
|
+
__esModule: true,
|
|
1614
|
+
MMKV,
|
|
1615
|
+
createMMKV,
|
|
1616
|
+
useMMKV,
|
|
1617
|
+
useMMKVString: makeHook((m, k) => m.getString(k)),
|
|
1618
|
+
useMMKVNumber: makeHook((m, k) => m.getNumber(k)),
|
|
1619
|
+
useMMKVBoolean: makeHook((m, k) => m.getBoolean(k)),
|
|
1620
|
+
useMMKVBuffer: makeHook((m, k) => m.getBuffer(k)),
|
|
1621
|
+
useMMKVObject: (key, instance) => {
|
|
1622
|
+
const m = instance ?? shared;
|
|
1623
|
+
const raw = m.getString(key);
|
|
1624
|
+
const [value, setValue] = useState(raw ? JSON.parse(raw) : void 0);
|
|
1625
|
+
const set = (v) => {
|
|
1626
|
+
if (v === void 0) m.delete(key);
|
|
1627
|
+
else m.set(key, JSON.stringify(v));
|
|
1628
|
+
setValue(v);
|
|
1629
|
+
};
|
|
1630
|
+
return [value, set];
|
|
1631
|
+
},
|
|
1632
|
+
useMMKVListener: () => ({ remove() {} }),
|
|
1633
|
+
Mode: {
|
|
1634
|
+
SINGLE_PROCESS: 0,
|
|
1635
|
+
MULTI_PROCESS: 1
|
|
1636
|
+
}
|
|
1637
|
+
};
|
|
1638
|
+
}
|
|
1639
|
+
} }
|
|
1640
|
+
};
|
|
1641
|
+
}
|
|
1642
|
+
//#endregion
|
|
1643
|
+
//#region src/presets/svg.ts
|
|
1644
|
+
const SVG_COMPONENTS = [
|
|
1645
|
+
"Svg",
|
|
1646
|
+
"Circle",
|
|
1647
|
+
"Ellipse",
|
|
1648
|
+
"G",
|
|
1649
|
+
"Text",
|
|
1650
|
+
"TSpan",
|
|
1651
|
+
"TextPath",
|
|
1652
|
+
"Path",
|
|
1653
|
+
"Polygon",
|
|
1654
|
+
"Polyline",
|
|
1655
|
+
"Line",
|
|
1656
|
+
"Rect",
|
|
1657
|
+
"Use",
|
|
1658
|
+
"Image",
|
|
1659
|
+
"Symbol",
|
|
1660
|
+
"Defs",
|
|
1661
|
+
"LinearGradient",
|
|
1662
|
+
"RadialGradient",
|
|
1663
|
+
"Stop",
|
|
1664
|
+
"ClipPath",
|
|
1665
|
+
"Pattern",
|
|
1666
|
+
"Mask",
|
|
1667
|
+
"Marker",
|
|
1668
|
+
"ForeignObject",
|
|
1669
|
+
"FeBlend",
|
|
1670
|
+
"FeColorMatrix",
|
|
1671
|
+
"FeGaussianBlur",
|
|
1672
|
+
"FeMerge",
|
|
1673
|
+
"FeOffset"
|
|
1674
|
+
];
|
|
1675
|
+
function svg() {
|
|
1676
|
+
return {
|
|
1677
|
+
name: "svg",
|
|
1678
|
+
modules: { "react-native-svg": {
|
|
1679
|
+
exports: [
|
|
1680
|
+
...SVG_COMPONENTS,
|
|
1681
|
+
"SvgXml",
|
|
1682
|
+
"SvgUri",
|
|
1683
|
+
"SvgCss",
|
|
1684
|
+
"SvgCssUri"
|
|
1685
|
+
],
|
|
1686
|
+
factory: () => {
|
|
1687
|
+
const make = (name) => {
|
|
1688
|
+
const C = React.forwardRef((props, ref) => React.createElement(name, {
|
|
1689
|
+
...props,
|
|
1690
|
+
ref
|
|
1691
|
+
}, props.children));
|
|
1692
|
+
C.displayName = name;
|
|
1693
|
+
return C;
|
|
1694
|
+
};
|
|
1695
|
+
const out = { __esModule: true };
|
|
1696
|
+
for (const name of SVG_COMPONENTS) out[name] = make(name);
|
|
1697
|
+
out.SvgXml = make("SvgXml");
|
|
1698
|
+
out.SvgUri = make("SvgUri");
|
|
1699
|
+
out.SvgCss = make("SvgCss");
|
|
1700
|
+
out.SvgCssUri = make("SvgCssUri");
|
|
1701
|
+
out.default = out.Svg;
|
|
1702
|
+
return out;
|
|
1703
|
+
}
|
|
1704
|
+
} }
|
|
1705
|
+
};
|
|
1706
|
+
}
|
|
1707
|
+
//#endregion
|
|
1708
|
+
//#region src/presets/webview.ts
|
|
1709
|
+
function webview() {
|
|
1710
|
+
return {
|
|
1711
|
+
name: "webview",
|
|
1712
|
+
modules: { "react-native-webview": {
|
|
1713
|
+
exports: ["WebView"],
|
|
1714
|
+
factory: () => {
|
|
1715
|
+
const WebView = React.forwardRef((props, ref) => {
|
|
1716
|
+
React.useImperativeHandle(ref, () => ({
|
|
1717
|
+
reload: () => {},
|
|
1718
|
+
stopLoading: () => {},
|
|
1719
|
+
goBack: () => {},
|
|
1720
|
+
goForward: () => {},
|
|
1721
|
+
injectJavaScript: () => {},
|
|
1722
|
+
postMessage: () => {},
|
|
1723
|
+
clearCache: () => {}
|
|
1724
|
+
}));
|
|
1725
|
+
return React.createElement("WebView", props, props.children);
|
|
1726
|
+
});
|
|
1727
|
+
WebView.displayName = "WebView";
|
|
1728
|
+
return {
|
|
1729
|
+
__esModule: true,
|
|
1730
|
+
default: WebView,
|
|
1731
|
+
WebView
|
|
1732
|
+
};
|
|
1733
|
+
}
|
|
1734
|
+
} }
|
|
1735
|
+
};
|
|
1736
|
+
}
|
|
1737
|
+
//#endregion
|
|
1347
1738
|
//#region src/presets/index.ts
|
|
1348
1739
|
var presets_exports = /* @__PURE__ */ __exportAll({
|
|
1349
1740
|
asyncStorage: () => asyncStorage,
|
|
1741
|
+
deviceInfo: () => deviceInfo,
|
|
1350
1742
|
expo: () => expo,
|
|
1351
1743
|
gestureHandler: () => gestureHandler,
|
|
1744
|
+
mmkv: () => mmkv,
|
|
1352
1745
|
navigation: () => navigation,
|
|
1353
1746
|
reanimated: () => reanimated,
|
|
1354
1747
|
safeAreaContext: () => safeAreaContext,
|
|
1355
|
-
screens: () => screens
|
|
1748
|
+
screens: () => screens,
|
|
1749
|
+
svg: () => svg,
|
|
1750
|
+
webview: () => webview
|
|
1356
1751
|
});
|
|
1357
1752
|
//#endregion
|
|
1358
|
-
export {
|
|
1753
|
+
export { deviceInfo as a, asyncStorage as c, gestureHandler as d, createPressableMock as f, mmkv as i, navigation as l, reanimated as m, webview as n, expo as o, buildPressableHostProps as p, svg as r, screens as s, presets_exports as t, safeAreaContext as u };
|
package/dist/presets.cjs
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_presets = require("./presets-
|
|
2
|
+
const require_presets = require("./presets-2I68Ipyl.cjs");
|
|
3
3
|
exports.asyncStorage = require_presets.asyncStorage;
|
|
4
|
+
exports.deviceInfo = require_presets.deviceInfo;
|
|
4
5
|
exports.expo = require_presets.expo;
|
|
5
6
|
exports.gestureHandler = require_presets.gestureHandler;
|
|
7
|
+
exports.mmkv = require_presets.mmkv;
|
|
6
8
|
exports.navigation = require_presets.navigation;
|
|
7
9
|
exports.reanimated = require_presets.reanimated;
|
|
8
10
|
exports.safeAreaContext = require_presets.safeAreaContext;
|
|
9
11
|
exports.screens = require_presets.screens;
|
|
12
|
+
exports.svg = require_presets.svg;
|
|
13
|
+
exports.webview = require_presets.webview;
|
package/dist/presets.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { asyncStorage, expo, gestureHandler, navigation, reanimated, safeAreaContext, screens };
|
|
1
|
+
import { a as deviceInfo, c as asyncStorage, d as gestureHandler, f as reanimated, i as mmkv, l as navigation, n as webview, o as expo, r as svg, s as screens, u as safeAreaContext } from "./index-DEB7OFaJ.cjs";
|
|
2
|
+
export { asyncStorage, deviceInfo, expo, gestureHandler, mmkv, navigation, reanimated, safeAreaContext, screens, svg, webview };
|
package/dist/presets.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { asyncStorage, expo, gestureHandler, navigation, reanimated, safeAreaContext, screens };
|
|
1
|
+
import { a as deviceInfo, c as asyncStorage, d as gestureHandler, f as reanimated, i as mmkv, l as navigation, n as webview, o as expo, r as svg, s as screens, u as safeAreaContext } from "./index-CJIhukN_.mjs";
|
|
2
|
+
export { asyncStorage, deviceInfo, expo, gestureHandler, mmkv, navigation, reanimated, safeAreaContext, screens, svg, webview };
|
package/dist/presets.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
export { asyncStorage, expo, gestureHandler, navigation, reanimated, safeAreaContext, screens };
|
|
1
|
+
import { a as deviceInfo, c as asyncStorage, d as gestureHandler, i as mmkv, l as navigation, m as reanimated, n as webview, o as expo, r as svg, s as screens, u as safeAreaContext } from "./presets-DOGXQzYT.mjs";
|
|
2
|
+
export { asyncStorage, deviceInfo, expo, gestureHandler, mmkv, navigation, reanimated, safeAreaContext, screens, svg, webview };
|