one 1.23.1 → 1.24.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.
- package/dist/cjs/__tests__/polyfills-mobile.test.cjs +58 -0
- package/dist/cjs/__tests__/polyfills-mobile.test.native.js +106 -0
- package/dist/cjs/__tests__/polyfills-mobile.test.native.js.map +1 -0
- package/dist/cjs/headless/__tests__/useStack.test.cjs +79 -0
- package/dist/cjs/headless/__tests__/useStack.test.native.js +85 -0
- package/dist/cjs/headless/__tests__/useStack.test.native.js.map +1 -0
- package/dist/cjs/headless/useStack.cjs +2 -1
- package/dist/cjs/headless/useStack.native.js +2 -1
- package/dist/cjs/headless/useStack.native.js.map +1 -1
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/layouts/Stack.cjs +12 -9
- package/dist/cjs/layouts/Stack.native.js +13 -10
- package/dist/cjs/layouts/Stack.native.js.map +1 -1
- package/dist/cjs/layouts/stack-utils/StackScreen.cjs +6 -3
- package/dist/cjs/layouts/stack-utils/StackScreen.native.js +7 -4
- package/dist/cjs/layouts/stack-utils/StackScreen.native.js.map +1 -1
- package/dist/cjs/layouts/stack-utils/StackToolbar.cjs +124 -0
- package/dist/cjs/layouts/stack-utils/StackToolbar.native.js +129 -0
- package/dist/cjs/layouts/stack-utils/StackToolbar.native.js.map +1 -0
- package/dist/cjs/layouts/stack-utils/StackToolbar.shared.cjs +57 -0
- package/dist/cjs/layouts/stack-utils/StackToolbar.shared.native.js +61 -0
- package/dist/cjs/layouts/stack-utils/StackToolbar.shared.native.js.map +1 -0
- package/dist/cjs/layouts/stack-utils/StackToolbar.types.cjs +18 -0
- package/dist/cjs/layouts/stack-utils/StackToolbar.types.native.js +21 -0
- package/dist/cjs/layouts/stack-utils/StackToolbar.types.native.js.map +1 -0
- package/dist/cjs/layouts/stack-utils/StackToolbarImplementation.cjs +39 -0
- package/dist/cjs/layouts/stack-utils/StackToolbarImplementation.native.js +41 -0
- package/dist/cjs/layouts/stack-utils/StackToolbarImplementation.native.js.map +1 -0
- package/dist/cjs/layouts/stack-utils/__tests__/StackToolbar.test.cjs +66 -0
- package/dist/cjs/layouts/stack-utils/__tests__/StackToolbar.test.native.js +99 -0
- package/dist/cjs/layouts/stack-utils/__tests__/StackToolbar.test.native.js.map +1 -0
- package/dist/cjs/layouts/stack-utils/index.cjs +2 -0
- package/dist/cjs/layouts/stack-utils/index.native.js +2 -0
- package/dist/cjs/layouts/stack-utils/index.native.js.map +1 -1
- package/dist/cjs/metro-config/buildOneMetroResolverOverrides.cjs +9 -3
- package/dist/cjs/metro-config/buildOneMetroResolverOverrides.native.js +9 -4
- package/dist/cjs/metro-config/buildOneMetroResolverOverrides.native.js.map +1 -1
- package/dist/cjs/metro-config/buildOneMetroResolverOverrides.test.cjs +84 -0
- package/dist/cjs/metro-config/buildOneMetroResolverOverrides.test.native.js +91 -0
- package/dist/cjs/metro-config/buildOneMetroResolverOverrides.test.native.js.map +1 -0
- package/dist/cjs/polyfills-mobile.cjs +1 -0
- package/dist/cjs/polyfills-mobile.native.js +1 -0
- package/dist/cjs/polyfills-mobile.native.js.map +1 -1
- package/dist/cjs/router/router.native.js.map +1 -1
- package/dist/cjs/router/useInitializeOneRouter.cjs +2 -2
- package/dist/cjs/router/useInitializeOneRouter.native.js +2 -2
- package/dist/cjs/router/useInitializeOneRouter.native.js.map +1 -1
- package/dist/cjs/router/useInitializeOneRouter.preview-lifecycle.test.cjs +1 -1
- package/dist/cjs/router/useInitializeOneRouter.preview-lifecycle.test.native.js +1 -1
- package/dist/cjs/router/useInitializeOneRouter.preview-lifecycle.test.native.js.map +1 -1
- package/dist/cjs/stack-toolbar-implementation.cjs +30 -0
- package/dist/cjs/stack-toolbar-implementation.native.js +33 -0
- package/dist/cjs/stack-toolbar-implementation.native.js.map +1 -0
- package/dist/esm/__tests__/polyfills-mobile.test.mjs +35 -0
- package/dist/esm/__tests__/polyfills-mobile.test.mjs.map +1 -0
- package/dist/esm/__tests__/polyfills-mobile.test.native.js +80 -0
- package/dist/esm/__tests__/polyfills-mobile.test.native.js.map +1 -0
- package/dist/esm/createApp.native.js +1 -0
- package/dist/esm/createApp.native.js.map +1 -1
- package/dist/esm/headless/__tests__/useStack.test.mjs +56 -0
- package/dist/esm/headless/__tests__/useStack.test.mjs.map +1 -0
- package/dist/esm/headless/__tests__/useStack.test.native.js +59 -0
- package/dist/esm/headless/__tests__/useStack.test.native.js.map +1 -0
- package/dist/esm/headless/useStack.mjs +2 -1
- package/dist/esm/headless/useStack.mjs.map +1 -1
- package/dist/esm/headless/useStack.native.js +2 -1
- package/dist/esm/headless/useStack.native.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/layouts/Stack.mjs +13 -10
- package/dist/esm/layouts/Stack.mjs.map +1 -1
- package/dist/esm/layouts/Stack.native.js +14 -11
- package/dist/esm/layouts/Stack.native.js.map +1 -1
- package/dist/esm/layouts/stack-utils/StackScreen.mjs +6 -3
- package/dist/esm/layouts/stack-utils/StackScreen.mjs.map +1 -1
- package/dist/esm/layouts/stack-utils/StackScreen.native.js +7 -4
- package/dist/esm/layouts/stack-utils/StackScreen.native.js.map +1 -1
- package/dist/esm/layouts/stack-utils/StackToolbar.mjs +89 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.mjs.map +1 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.native.js +92 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.native.js.map +1 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.shared.mjs +31 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.shared.mjs.map +1 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.shared.native.js +32 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.shared.native.js.map +1 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.types.mjs +2 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.types.mjs.map +1 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.types.native.js +2 -0
- package/dist/esm/layouts/stack-utils/StackToolbar.types.native.js.map +1 -0
- package/dist/esm/layouts/stack-utils/StackToolbarImplementation.mjs +12 -0
- package/dist/esm/layouts/stack-utils/StackToolbarImplementation.mjs.map +1 -0
- package/dist/esm/layouts/stack-utils/StackToolbarImplementation.native.js +12 -0
- package/dist/esm/layouts/stack-utils/StackToolbarImplementation.native.js.map +1 -0
- package/dist/esm/layouts/stack-utils/__tests__/StackToolbar.test.mjs +67 -0
- package/dist/esm/layouts/stack-utils/__tests__/StackToolbar.test.mjs.map +1 -0
- package/dist/esm/layouts/stack-utils/__tests__/StackToolbar.test.native.js +73 -0
- package/dist/esm/layouts/stack-utils/__tests__/StackToolbar.test.native.js.map +1 -0
- package/dist/esm/layouts/stack-utils/index.mjs +2 -1
- package/dist/esm/layouts/stack-utils/index.mjs.map +1 -1
- package/dist/esm/layouts/stack-utils/index.native.js +2 -1
- package/dist/esm/layouts/stack-utils/index.native.js.map +1 -1
- package/dist/esm/metro-config/buildOneMetroResolverOverrides.mjs +9 -3
- package/dist/esm/metro-config/buildOneMetroResolverOverrides.mjs.map +1 -1
- package/dist/esm/metro-config/buildOneMetroResolverOverrides.native.js +9 -4
- package/dist/esm/metro-config/buildOneMetroResolverOverrides.native.js.map +1 -1
- package/dist/esm/metro-config/buildOneMetroResolverOverrides.test.mjs +61 -0
- package/dist/esm/metro-config/buildOneMetroResolverOverrides.test.mjs.map +1 -0
- package/dist/esm/metro-config/buildOneMetroResolverOverrides.test.native.js +65 -0
- package/dist/esm/metro-config/buildOneMetroResolverOverrides.test.native.js.map +1 -0
- package/dist/esm/polyfills-mobile.mjs +4 -0
- package/dist/esm/polyfills-mobile.mjs.map +1 -1
- package/dist/esm/polyfills-mobile.native.js +4 -0
- package/dist/esm/polyfills-mobile.native.js.map +1 -1
- package/dist/esm/router/useInitializeOneRouter.mjs +1 -1
- package/dist/esm/router/useInitializeOneRouter.mjs.map +1 -1
- package/dist/esm/router/useInitializeOneRouter.native.js +1 -1
- package/dist/esm/router/useInitializeOneRouter.preview-lifecycle.test.mjs +1 -1
- package/dist/esm/router/useInitializeOneRouter.preview-lifecycle.test.mjs.map +1 -1
- package/dist/esm/router/useInitializeOneRouter.preview-lifecycle.test.native.js +1 -1
- package/dist/esm/router/useInitializeOneRouter.preview-lifecycle.test.native.js.map +1 -1
- package/dist/esm/stack-toolbar-implementation.mjs +3 -0
- package/dist/esm/stack-toolbar-implementation.mjs.map +1 -0
- package/dist/esm/stack-toolbar-implementation.native.js +3 -0
- package/dist/esm/stack-toolbar-implementation.native.js.map +1 -0
- package/package.json +33 -21
- package/src/__tests__/polyfills-mobile.test.ts +37 -0
- package/src/headless/__tests__/useStack.test.tsx +54 -0
- package/src/headless/types.ts +2 -1
- package/src/headless/useStack.ts +2 -1
- package/src/index.ts +12 -0
- package/src/layouts/Stack.tsx +33 -8
- package/src/layouts/stack-utils/README.md +1 -0
- package/src/layouts/stack-utils/StackScreen.tsx +26 -5
- package/src/layouts/stack-utils/StackToolbar.shared.ts +44 -0
- package/src/layouts/stack-utils/StackToolbar.tsx +134 -0
- package/src/layouts/stack-utils/StackToolbar.types.ts +100 -0
- package/src/layouts/stack-utils/StackToolbarImplementation.tsx +39 -0
- package/src/layouts/stack-utils/__tests__/StackToolbar.test.tsx +70 -0
- package/src/layouts/stack-utils/index.tsx +17 -0
- package/src/metro-config/buildOneMetroResolverOverrides.test.ts +88 -0
- package/src/metro-config/buildOneMetroResolverOverrides.ts +20 -8
- package/src/polyfills-mobile.ts +5 -0
- package/src/router/router.ts +5 -5
- package/src/router/useInitializeOneRouter.preview-lifecycle.test.ts +1 -1
- package/src/router/useInitializeOneRouter.ts +2 -2
- package/src/stack-toolbar-implementation.ts +8 -0
- package/types/headless/types.d.ts +4 -1
- package/types/headless/types.d.ts.map +1 -1
- package/types/headless/useStack.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/layouts/Stack.d.ts +12 -0
- package/types/layouts/Stack.d.ts.map +1 -1
- package/types/layouts/stack-utils/StackScreen.d.ts +2 -1
- package/types/layouts/stack-utils/StackScreen.d.ts.map +1 -1
- package/types/layouts/stack-utils/StackToolbar.d.ts +28 -0
- package/types/layouts/stack-utils/StackToolbar.d.ts.map +1 -0
- package/types/layouts/stack-utils/StackToolbar.shared.d.ts +5 -0
- package/types/layouts/stack-utils/StackToolbar.shared.d.ts.map +1 -0
- package/types/layouts/stack-utils/StackToolbar.types.d.ts +83 -0
- package/types/layouts/stack-utils/StackToolbar.types.d.ts.map +1 -0
- package/types/layouts/stack-utils/StackToolbarImplementation.d.ts +12 -0
- package/types/layouts/stack-utils/StackToolbarImplementation.d.ts.map +1 -0
- package/types/layouts/stack-utils/index.d.ts +3 -1
- package/types/layouts/stack-utils/index.d.ts.map +1 -1
- package/types/metro-config/buildOneMetroResolverOverrides.d.ts +2 -1
- package/types/metro-config/buildOneMetroResolverOverrides.d.ts.map +1 -1
- package/types/metro-config/buildOneMetroResolverOverrides.test.d.ts +2 -0
- package/types/metro-config/buildOneMetroResolverOverrides.test.d.ts.map +1 -0
- package/types/polyfills-mobile.d.ts +1 -0
- package/types/polyfills-mobile.d.ts.map +1 -1
- package/types/router/router.d.ts +1 -1
- package/types/router/router.d.ts.map +1 -1
- package/types/stack-toolbar-implementation.d.ts +3 -0
- package/types/stack-toolbar-implementation.d.ts.map +1 -0
- package/types/ui/TabContext.d.ts +2 -10
- package/types/ui/TabContext.d.ts.map +1 -1
- package/types/ui/TabRouter.d.ts.map +1 -1
- package/types/ui/Tabs.shared.d.ts +1 -1
- package/types/ui/Tabs.shared.d.ts.map +1 -1
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import { describe, expect, it } from "vitest";
|
|
3
|
+
import { buildOneMetroResolverOverrides } from "./buildOneMetroResolverOverrides.native.js";
|
|
4
|
+
describe("buildOneMetroResolverOverrides", function () {
|
|
5
|
+
it("resolves every react-native-worklets import from the app root", function () {
|
|
6
|
+
var _config_resolver;
|
|
7
|
+
var projectRoot = path.resolve(__dirname, "../../");
|
|
8
|
+
var nestedOrigin = path.join(projectRoot, "node_modules/react-native-reanimated/src/index.ts");
|
|
9
|
+
var resolvedOrigins = [];
|
|
10
|
+
var config = buildOneMetroResolverOverrides({
|
|
11
|
+
projectRoot
|
|
12
|
+
})({
|
|
13
|
+
resolver: {
|
|
14
|
+
resolveRequest: function (context, moduleName, _platform) {
|
|
15
|
+
resolvedOrigins.push(`${moduleName}:${context.originModulePath}`);
|
|
16
|
+
return {
|
|
17
|
+
type: "sourceFile",
|
|
18
|
+
filePath: moduleName
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
var resolveRequest = (_config_resolver = config.resolver) === null || _config_resolver === void 0 ? void 0 : _config_resolver.resolveRequest;
|
|
24
|
+
if (!resolveRequest) {
|
|
25
|
+
throw new Error("expected a Metro resolver override");
|
|
26
|
+
}
|
|
27
|
+
resolveRequest({
|
|
28
|
+
originModulePath: nestedOrigin
|
|
29
|
+
}, "react-native-worklets", "ios");
|
|
30
|
+
resolveRequest({
|
|
31
|
+
originModulePath: nestedOrigin
|
|
32
|
+
}, "react-native-worklets/package.json", "ios");
|
|
33
|
+
resolveRequest({
|
|
34
|
+
originModulePath: nestedOrigin
|
|
35
|
+
}, "react-native-safe-area-context", "ios");
|
|
36
|
+
expect(resolvedOrigins).toEqual([`react-native-worklets:${path.join(projectRoot, "package.json")}`, `react-native-worklets/package.json:${path.join(projectRoot, "package.json")}`, `react-native-safe-area-context:${nestedOrigin}`]);
|
|
37
|
+
});
|
|
38
|
+
it("keeps the compiled react-native-svg native entry point", function () {
|
|
39
|
+
var _config_resolver;
|
|
40
|
+
var projectRoot = path.resolve(__dirname, "../../");
|
|
41
|
+
var config = buildOneMetroResolverOverrides({
|
|
42
|
+
projectRoot
|
|
43
|
+
})({
|
|
44
|
+
resolver: {
|
|
45
|
+
resolveRequest: function (_context, moduleName, _platform) {
|
|
46
|
+
return {
|
|
47
|
+
type: "sourceFile",
|
|
48
|
+
filePath: path.join(projectRoot, "node_modules", moduleName, "src", "index.ts")
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
var resolveRequest = (_config_resolver = config.resolver) === null || _config_resolver === void 0 ? void 0 : _config_resolver.resolveRequest;
|
|
54
|
+
if (!resolveRequest) {
|
|
55
|
+
throw new Error("expected a Metro resolver override");
|
|
56
|
+
}
|
|
57
|
+
expect(resolveRequest({
|
|
58
|
+
originModulePath: path.join(projectRoot, "app.tsx")
|
|
59
|
+
}, "react-native-svg", "ios")).toEqual({
|
|
60
|
+
type: "sourceFile",
|
|
61
|
+
filePath: path.join(projectRoot, "node_modules", "react-native-svg", "lib", "commonjs", "index.js")
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
//# sourceMappingURL=buildOneMetroResolverOverrides.test.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["path","describe","expect","it","buildOneMetroResolverOverrides","_config_resolver","projectRoot","resolve","__dirname","nestedOrigin","join","resolvedOrigins","config","resolver","resolveRequest","context","moduleName","_platform","push","originModulePath","type","filePath","Error","toEqual","_context"],"sources":["../../../src/metro-config/buildOneMetroResolverOverrides.test.ts"],"sourcesContent":[null],"mappings":"AAAA,OAAOA,IAAA,MAAU;AACjB,SAASC,QAAA,EAAUC,MAAA,EAAQC,EAAA,QAAU;AACrC,SAASC,8BAAA,QAAsC;AAE/CH,QAAA,CAAS,kCAAkC,YAAM;EAC/CE,EAAA,CAAG,iEAAiE,YAAM;IACxE,IAAAE,gBAAoB;IACpB,IAAAC,WAAM,GAAAN,IAAe,CAAAO,OAAK,CAAAC,SAAA;IAAA,IACxBC,YAAA,GAAAT,IAAA,CAAAU,IAAA,CAAAJ,WAAA;IAAA,IACAK,eAAA;IACF,IAAAC,MAAA,GAAAR,8BAAA;MACAE;IACA;MACEO,QAAA,EAAU;QACRC,cAAA,EAAgB,SAAAA,CACdC,OACA,EAAAC,UACA,EAAAC,SACG;UACHN,eAAA,CAAgBO,IAAA,CAAK,GAAGF,UAAU,IAAID,OAAA,CAAQI,gBAAgB,EAAE;UAChE,OAAO;YACTC,IAAA;YACFC,QAAA,EAAAL;UACD;QACD;MAEA;IACE;IACF,IAAAF,cAAA,IAAAT,gBAAA,GAAAO,MAAA,CAAAC,QAAA,cAAAR,gBAAA,uBAAAA,gBAAA,CAAAS,cAAA;IAEA,KAAAA,cAAiB;MACjB,UAAAQ,KAAA;IAAA;IACmCR,cACjC;MACAK,gBAAA,EAAAV;IACF;IACAK,cAAA;MACEK,gBAAE,EAAAV;IAA+B,GACjC;IAAAK,cACA;MACFK,gBAAA,EAAAV;IAEA,mCAAgC;IAAAP,MAC9B,CAAAS,eAAA,EAAAY,OAAyB,CAAK,CAC9B,yBAAAvB,IAAA,CAAAU,IAAA,CAAAJ,WAA2C,EAAK,cAAa,KAC7D,sCAAkCN,IAAA,CAAAU,IAAY,CAAAJ,WAAA,qBAC/C,kCAAAG,YAAA,GACF;EAED;EACEN,EAAA,yDAAoD;IACpD,IAAAE,gBAAe;IAAgD,IAC7DC,WAAU,GAAAN,IAAA,CAAAO,OAAA,CAAAC,SAAA;IAAA,IACRI,MAAA,GAAAR,8BAGE;MACIE;IACE;MACwEO,QAChF;QACFC,cAAA,WAAAA,CAAAU,QAAA,EAAAR,UAAA,EAAAC,SAAA;UACD;YACKG,IAAA,cAAiB;YAElBC,QAAA,EAAArB,IAAgB,CAAAU,IAAA,CAAAJ,WAAA,kBAAAU,UAAA;UACnB;QACF;MAEA;IAAA,EACE;IAAA,IACEF,cAAE,IAAAT,gBAA4B,GAAAO,MAAa,CAAAC,QAAS,MAAE,QAAAR,gBAAA,uBAAAA,gBAAA,CAAAS,cAAA;IAAA,IACtD,CAAAA,cAAA;MAAA,MACA,IAAAQ,KAAA;IAAA;IAEJpB,MAAE,CAAAY,cAAQ;MACRK,gBAAM,EAAAnB,IAAA,CAAAU,IAAA,CAAAJ,WAAA;IAAA,GACN,kBAAe,UAAAiB,OAAA;MAAAH,IACb;MAAAC,QACA,EAAArB,IAAA,CAAAU,IAAA,CAAAJ,WAAA;IAAA;EACA;AACA","ignoreList":[]}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import "web-streams-polyfill/polyfill/es5";
|
|
1
2
|
import { TextDecoder as TextDecoderPolyfill } from "@bacons/text-decoder";
|
|
2
3
|
import structuredClone from "@ungap/structured-clone";
|
|
4
|
+
import "@azure/core-asynciterator-polyfill";
|
|
5
|
+
import "core-js/actual/url";
|
|
6
|
+
import "core-js/actual/url-search-params";
|
|
3
7
|
import { promiseWithResolvers } from "./utils/promiseWithResolvers.mjs";
|
|
4
8
|
globalThis["global"] = globalThis;
|
|
5
9
|
globalThis["TextDecoder"] ||= TextDecoderPolyfill;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TextDecoder","TextDecoderPolyfill","structuredClone","promiseWithResolvers","globalThis","setTimeout","Promise","withResolvers"],"sources":["../../src/polyfills-mobile.ts"],"sourcesContent":[null],"mappings":"AAQA,SAASA,WAAA,IAAeC,mBAAA,QAA2B;AAMnD,OAAOC,eAAA,MAAqB;
|
|
1
|
+
{"version":3,"names":["TextDecoder","TextDecoderPolyfill","structuredClone","promiseWithResolvers","globalThis","setTimeout","Promise","withResolvers"],"sources":["../../src/polyfills-mobile.ts"],"sourcesContent":[null],"mappings":"AAQA,OAAO;AAKP,SAASA,WAAA,IAAeC,mBAAA,QAA2B;AAMnD,OAAOC,eAAA,MAAqB;AAU5B,OAAO;AAIP,OAAO;AACP,OAAO;AAWP,SAASC,oBAAA,QAA4B;AA1CrCC,UAAA,CAAW,QAAQ,IAAIA,UAAA;AAYvBA,UAAA,CAAW,aAAa,MAAMH,mBAAA;AAM9BG,UAAA,CAAW,iBAAiB,MAAMF,eAAA;AAIlCE,UAAA,CAAW,uBAAuB,MAAMC,UAAA;AAsBxCC,OAAA,CAAQC,aAAA,KAAkBD,OAAA,CAAQC,aAAA,GAAgBJ,oBAAA","ignoreList":[]}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
|
+
import "web-streams-polyfill/polyfill/es5";
|
|
1
2
|
import { TextDecoder as TextDecoderPolyfill } from "@bacons/text-decoder";
|
|
2
3
|
import structuredClone from "@ungap/structured-clone";
|
|
4
|
+
import "@azure/core-asynciterator-polyfill";
|
|
5
|
+
import "core-js/actual/url";
|
|
6
|
+
import "core-js/actual/url-search-params";
|
|
3
7
|
import { promiseWithResolvers } from "./utils/promiseWithResolvers.native.js";
|
|
4
8
|
var _globalThis;
|
|
5
9
|
var _TextDecoder;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["TextDecoder","TextDecoderPolyfill","structuredClone","promiseWithResolvers","_globalThis","_TextDecoder","_globalThis1","_structuredClone","_globalThis2"],"sources":["../../src/polyfills-mobile.ts"],"sourcesContent":[null],"mappings":"AAQA,SAASA,WAAA,IAAeC,mBAAA,QAA2B;AAMnD,OAAOC,eAAA,MAAqB;
|
|
1
|
+
{"version":3,"names":["TextDecoder","TextDecoderPolyfill","structuredClone","promiseWithResolvers","_globalThis","_TextDecoder","_globalThis1","_structuredClone","_globalThis2"],"sources":["../../src/polyfills-mobile.ts"],"sourcesContent":[null],"mappings":"AAQA,OAAO;AAKP,SAASA,WAAA,IAAeC,mBAAA,QAA2B;AAMnD,OAAOC,eAAA,MAAqB;AAU5B,OAAO;AAIP,OAAO;AACP,OAAO;AAWP,SAASC,oBAAA,QAA4B;AA1CrC,IAAAC,WAAW;AAYX,IAAAC,YAAW;AAMX,IAAAC,YAAW;AAIX,IAAAC,gBAAW;AAsBX,IAAAC,YAAQ","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useNavigationContainerRef } from "@react-navigation/
|
|
1
|
+
import { useNavigationContainerRef } from "@react-navigation/core";
|
|
2
2
|
import { resetLoaderState } from "../useLoader.mjs";
|
|
3
3
|
import * as routerStore from "./router.mjs";
|
|
4
4
|
import { initialize } from "./router.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useNavigationContainerRef","resetLoaderState","routerStore","initialize","getSSRInitialState","ensureBaseLinkingConfig","initVersion","lastInitVersion","ssrRouteTreeContext","useInitializeOneRouter","context","initialLocation","linking","navigationRef","window","routeNode","initialState","rootComponent","contexts","globalThis","Map","prepareForSSRRender","resetState"],"sources":["../../../src/router/useInitializeOneRouter.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,yBAAA,QAAiC;AAC1C,SAASC,gBAAA,QAAwB;AAGjC,YAAYC,WAAA,MAAiB;AAC7B,SAASC,UAAA,QAAkB;AAC3B,SAASC,kBAAA,EAAoBC,uBAAA,QAA+B;AAI5D,IAAIC,WAAA,GAAc;AAClB,IAAIC,eAAA,GAAkB;AAMtB,IAAIC,mBAAA,GAA+C;AAE5C,SAASC,uBACdC,OAAA,EACAC,eAAA,EACAC,OAAA,EACA;EACA,MAAMC,aAAA,GAAgBb,yBAAA,
|
|
1
|
+
{"version":3,"names":["useNavigationContainerRef","resetLoaderState","routerStore","initialize","getSSRInitialState","ensureBaseLinkingConfig","initVersion","lastInitVersion","ssrRouteTreeContext","useInitializeOneRouter","context","initialLocation","linking","navigationRef","window","routeNode","initialState","rootComponent","contexts","globalThis","Map","prepareForSSRRender","resetState"],"sources":["../../../src/router/useInitializeOneRouter.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,yBAAA,QAAiC;AAC1C,SAASC,gBAAA,QAAwB;AAGjC,YAAYC,WAAA,MAAiB;AAC7B,SAASC,UAAA,QAAkB;AAC3B,SAASC,kBAAA,EAAoBC,uBAAA,QAA+B;AAI5D,IAAIC,WAAA,GAAc;AAClB,IAAIC,eAAA,GAAkB;AAMtB,IAAIC,mBAAA,GAA+C;AAE5C,SAASC,uBACdC,OAAA,EACAC,eAAA,EACAC,OAAA,EACA;EACA,MAAMC,aAAA,GAAgBb,yBAAA,CAAyD;EAG/E,IAAI,OAAOc,MAAA,KAAW,aAAa;IACjC,IAAIN,mBAAA,KAAwBE,OAAA,EAAS;MAEnCP,UAAA,CAAWO,OAAA,EAASG,aAAA,EAAeF,eAAA,EAAiBC,OAAO;MAC3DJ,mBAAA,GAAsBE,OAAA;MAEtBL,uBAAA,CAAwBH,WAAA,CAAYa,SAAA,EAAWH,OAAO;IACxD;IAGA,MAAMI,YAAA,GAAeL,eAAA,GACjBP,kBAAA,CAAmBF,WAAA,CAAYa,SAAA,EAAWJ,eAAA,EAAiBC,OAAO,IAClEV,WAAA,CAAYc,YAAA;IAGhB,OAAO;MACLC,aAAA,EAAef,WAAA,CAAYe,aAAA;MAC3BJ,aAAA;MACAG;IACF;EACF;EAGA,IAAIT,eAAA,KAAoBD,WAAA,IAAeJ,WAAA,CAAYW,aAAA,KAAkBA,aAAA,EAAe;IAElF,MAAMK,QAAA,GAAW;IACjBC,UAAA,CAAWD,QAAQ,IAAI,mBAAIE,GAAA,CAAgC;IAE3DjB,UAAA,CAAWO,OAAA,EAASG,aAAA,EAAeF,eAAA,EAAiBC,OAAO;IAC3DL,eAAA,GAAkBD,WAAA;EACpB;EAEA,OAAOJ,WAAA;AACT;AAGO,SAASmB,oBAAA,EAAsB;EACpCf,WAAA;AACF;AAKO,SAASgB,WAAA,EAAa;EAC3BD,mBAAA,CAAoB;EACpBpB,gBAAA,CAAiB;AACnB;AAEAkB,UAAA,CAAW,kBAAkB,IAAIG,UAAA","ignoreList":[]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useNavigationContainerRef } from "@react-navigation/
|
|
1
|
+
import { useNavigationContainerRef } from "@react-navigation/core";
|
|
2
2
|
import { resetLoaderState } from "../useLoader.native.js";
|
|
3
3
|
import * as routerStore from "./router.native.js";
|
|
4
4
|
import { initialize } from "./router.native.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["beforeEach","expect","test","vi","useInitializeOneRouter","probe","hoisted","navigationRef","current","routerNavigationRef","initialize","fn","_context","Object","defineProperty","globalThis","configurable","value","mock","useNavigationContainerRef","resetLoaderState","routeNode","rootComponent","initialState","ensureBaseLinkingConfig","getSSRInitialState","mockClear","context","assign","routeContext","_id","Error","keys","resolve","id","firstRef","URL","nextRef","nextLocation","toHaveBeenLastCalledWith"],"sources":["../../../src/router/useInitializeOneRouter.preview-lifecycle.test.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,UAAA,EAAYC,MAAA,EAAQC,IAAA,EAAMC,EAAA,QAAU;AAwC7C,SAASC,sBAAA,QAA8B;AArCvC,MAAMC,KAAA,GAAQF,EAAA,CAAGG,OAAA,CAId,OAAO;EACRC,aAAA,EAAe;IAAEC,OAAA,EAAS;EAAK;EAC/BC,mBAAA,EAAqB;EACrBC,UAAA,EAAYP,EAAA,CAAGQ,EAAA,CAAG,CAACC,QAAA,EAAmBL,aAAA,KAAqC;IACzEF,KAAA,CAAMI,mBAAA,GAAsBF,aAAA;EAC9B,CAAC;AACH,EAAE;AAEFJ,EAAA,CAAGG,OAAA,CAAQ,MAAM;EACfO,MAAA,CAAOC,cAAA,CAAeC,UAAA,EAAY,UAAU;IAAEC,YAAA,EAAc;IAAMC,KAAA,EAAO,CAAC;EAAE,CAAC;AAC/E,CAAC;AAEDd,EAAA,CAAGe,IAAA,CAAK,
|
|
1
|
+
{"version":3,"names":["beforeEach","expect","test","vi","useInitializeOneRouter","probe","hoisted","navigationRef","current","routerNavigationRef","initialize","fn","_context","Object","defineProperty","globalThis","configurable","value","mock","useNavigationContainerRef","resetLoaderState","routeNode","rootComponent","initialState","ensureBaseLinkingConfig","getSSRInitialState","mockClear","context","assign","routeContext","_id","Error","keys","resolve","id","firstRef","URL","nextRef","nextLocation","toHaveBeenLastCalledWith"],"sources":["../../../src/router/useInitializeOneRouter.preview-lifecycle.test.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,UAAA,EAAYC,MAAA,EAAQC,IAAA,EAAMC,EAAA,QAAU;AAwC7C,SAASC,sBAAA,QAA8B;AArCvC,MAAMC,KAAA,GAAQF,EAAA,CAAGG,OAAA,CAId,OAAO;EACRC,aAAA,EAAe;IAAEC,OAAA,EAAS;EAAK;EAC/BC,mBAAA,EAAqB;EACrBC,UAAA,EAAYP,EAAA,CAAGQ,EAAA,CAAG,CAACC,QAAA,EAAmBL,aAAA,KAAqC;IACzEF,KAAA,CAAMI,mBAAA,GAAsBF,aAAA;EAC9B,CAAC;AACH,EAAE;AAEFJ,EAAA,CAAGG,OAAA,CAAQ,MAAM;EACfO,MAAA,CAAOC,cAAA,CAAeC,UAAA,EAAY,UAAU;IAAEC,YAAA,EAAc;IAAMC,KAAA,EAAO,CAAC;EAAE,CAAC;AAC/E,CAAC;AAEDd,EAAA,CAAGe,IAAA,CAAK,0BAA0B,OAAO;EACvCC,yBAAA,EAA2BA,CAAA,KAAMd,KAAA,CAAME;AACzC,EAAE;AAEFJ,EAAA,CAAGe,IAAA,CAAK,gBAAgB,OAAO;EAAEE,gBAAA,EAAkBjB,EAAA,CAAGQ,EAAA,CAAG;AAAE,EAAE;AAE7DR,EAAA,CAAGe,IAAA,CAAK,YAAY,OAAO;EACzBR,UAAA,EAAYL,KAAA,CAAMK,UAAA;EAClB,IAAIH,cAAA,EAAgB;IAClB,OAAOF,KAAA,CAAMI,mBAAA;EACf;EACAY,SAAA,EAAW;EACXC,aAAA,EAAe;EACfC,YAAA,EAAc;AAChB,EAAE;AAEFpB,EAAA,CAAGe,IAAA,CAAK,mBAAmB,OAAO;EAChCM,uBAAA,EAAyBrB,EAAA,CAAGQ,EAAA,CAAG;EAC/Bc,kBAAA,EAAoBtB,EAAA,CAAGQ,EAAA,CAAG;AAC5B,EAAE;AAIFX,UAAA,CAAW,MAAM;EACfK,KAAA,CAAMK,UAAA,CAAWgB,SAAA,CAAU;AAC7B,CAAC;AAEDxB,IAAA,CAAK,iEAAiE,MAAM;EAC1E,MAAMyB,OAAA,GAA4Bd,MAAA,CAAOe,MAAA,CACvC,SAASC,aAAgBC,GAAA,EAAgB;IACvC,MAAM,IAAIC,KAAA,CAAM,8CAA8C;EAChE,GACA;IACEC,IAAA,EAAMA,CAAA,KAAM,EAAC;IACbC,OAAA,EAAUC,EAAA,IAAeA,EAAA;IACzBA,EAAA,EAAI;EACN,CACF;EACA,MAAMC,QAAA,GAAW;IAAE3B,OAAA,EAAS;EAAK;EACjCH,KAAA,CAAME,aAAA,GAAgB4B,QAAA;EACtB/B,sBAAA,CAAuBuB,OAAA,EAAS,IAAIS,GAAA,CAAI,uBAAuB,CAAC;EAEhE,MAAMC,OAAA,GAAU;IAAE7B,OAAA,EAAS;EAAK;EAChC,MAAM8B,YAAA,GAAe,IAAIF,GAAA,CAAI,gCAAgC;EAC7D/B,KAAA,CAAME,aAAA,GAAgB8B,OAAA;EACtBjC,sBAAA,CAAuBuB,OAAA,EAASW,YAAY;EAE5CrC,MAAA,CAAOI,KAAA,CAAMK,UAAU,EAAE6B,wBAAA,CACvBZ,OAAA,EACAU,OAAA,EACAC,YAAA,EACA,MACF;AACF,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["beforeEach","expect","test","vi","useInitializeOneRouter","probe","hoisted","navigationRef","current","routerNavigationRef","initialize","fn","_context","Object","defineProperty","globalThis","configurable","value","mock","useNavigationContainerRef","resetLoaderState","routeNode","rootComponent","initialState","ensureBaseLinkingConfig","getSSRInitialState","mockClear","context","assign","routeContext","_id","Error","keys"],"sources":["../../../src/router/useInitializeOneRouter.preview-lifecycle.test.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,UAAA,EAAYC,MAAA,EAAQC,IAAA,EAAMC,EAAA,QAAU;AAwC7C,SAASC,sBAAA,QAA8B;AArCvC,IAAAC,KAAM,GAAAF,EAAQ,CAAAG,OAAG,aAIP;EACR;IACAC,aAAA;MACAC,OAAA,EAAY;IACV;IACDC,mBAAA;IACDC,UAAA,EAAAP,EAAA,CAAAQ,EAAA,WAAAC,QAAA,EAAAL,aAAA;MAECF,KAAQ,CAAAI,mBAAM,GAAAF,aAAA;IACf;EACD;AAED;
|
|
1
|
+
{"version":3,"names":["beforeEach","expect","test","vi","useInitializeOneRouter","probe","hoisted","navigationRef","current","routerNavigationRef","initialize","fn","_context","Object","defineProperty","globalThis","configurable","value","mock","useNavigationContainerRef","resetLoaderState","routeNode","rootComponent","initialState","ensureBaseLinkingConfig","getSSRInitialState","mockClear","context","assign","routeContext","_id","Error","keys"],"sources":["../../../src/router/useInitializeOneRouter.preview-lifecycle.test.ts"],"sourcesContent":[null],"mappings":"AAAA,SAASA,UAAA,EAAYC,MAAA,EAAQC,IAAA,EAAMC,EAAA,QAAU;AAwC7C,SAASC,sBAAA,QAA8B;AArCvC,IAAAC,KAAM,GAAAF,EAAQ,CAAAG,OAAG,aAIP;EACR;IACAC,aAAA;MACAC,OAAA,EAAY;IACV;IACDC,mBAAA;IACDC,UAAA,EAAAP,EAAA,CAAAQ,EAAA,WAAAC,QAAA,EAAAL,aAAA;MAECF,KAAQ,CAAAI,mBAAM,GAAAF,aAAA;IACf;EACD;AAED;AAAyCJ,EACvC,CAAAG,OAAA;EACAO,MAAA,CAAAC,cAAA,CAAAC,UAAA;IAECC,YAAK;IAELC,KAAK;EACN;AAAkB,EAClB;AACEd,EAAA,CAAAe,IAAA,yBAAa;EACf;IACAC,yBAAW,WAAAA,CAAA;MACX,OAAAd,KAAe,CAAAE,aAAA;IACf;EACA;AAEF;AAAkCJ,EAChC,CAAAe,IAAA,6BAA+B;EAC/B;IACAE,gBAAA,EAAAjB,EAAA,CAAAQ,EAAA;EAIF;AACE;AACFR,EAAC,CAAAe,IAAA;EAED,OAAK;IACHR,UAAM,EAAAL,KAA4B,CAAAK,UAAO;IACvC,IAAAH,aAASA,CAAA;MACP,OAAMF,KAAI,CAAAI,mBAAM;IAClB;IACAY,SAAA;IAAAC,aACQ,EAAO;IAAAC,YACH,OAAe;EAAA;AACrB;AACNpB,EACF,CAAAe,IAAA;EACA,OAAM;IACNM,uBAAsB,EAAArB,EAAA,CAAAQ,EAAA;IACtBc,kBAAA,EAAAtB,EAAuB,CAAAQ,EAAA;EAEvB;AACA;AACAX,UAAM;EACNK,KAAA,CAAAK,UAAA,CAAAgB,SAAuB;AAEvB;AAAyBxB,IACvB;EAAA,IACAyB,OAAA,GAAAd,MAAA,CAAAe,MAAA,UAAAC,aAAAC,GAAA;IACA,UAAAC,KAAA;EAAA,GACA;IACFC,IAAA,WAAAA,CAAA;MACD","ignoreList":[]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { STACK_TOOLBAR_CHILD, getStackToolbarImplementation, registerStackToolbarImplementation } from "./layouts/stack-utils/StackToolbarImplementation.mjs";
|
|
2
|
+
export { STACK_TOOLBAR_CHILD, getStackToolbarImplementation, registerStackToolbarImplementation };
|
|
3
|
+
//# sourceMappingURL=stack-toolbar-implementation.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["STACK_TOOLBAR_CHILD","getStackToolbarImplementation","registerStackToolbarImplementation"],"sources":["../../src/stack-toolbar-implementation.ts"],"sourcesContent":[null],"mappings":"AAAA,SACEA,mBAAA,EACAC,6BAAA,EACAC,kCAAA,QAGK","ignoreList":[]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { STACK_TOOLBAR_CHILD, getStackToolbarImplementation, registerStackToolbarImplementation } from "./layouts/stack-utils/StackToolbarImplementation.native.js";
|
|
2
|
+
export { STACK_TOOLBAR_CHILD, getStackToolbarImplementation, registerStackToolbarImplementation };
|
|
3
|
+
//# sourceMappingURL=stack-toolbar-implementation.native.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["STACK_TOOLBAR_CHILD","getStackToolbarImplementation","registerStackToolbarImplementation"],"sources":["../../src/stack-toolbar-implementation.ts"],"sourcesContent":[null],"mappings":"AAAA,SAAAA,mBAAA,EAAAC,6BAAA,EAAAC,kCAAA;AAAA,SAEEF,mBAAA,EACAC,6BAAA,EAAAC,kCAGK","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "one",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.24.1",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"setup.mjs",
|
|
7
|
-
"setup.js"
|
|
7
|
+
"setup.js",
|
|
8
|
+
"**/polyfills-mobile.*",
|
|
9
|
+
"web-streams-polyfill/polyfill/es5",
|
|
10
|
+
"@azure/core-asynciterator-polyfill",
|
|
11
|
+
"core-js/actual/url",
|
|
12
|
+
"core-js/actual/url-search-params"
|
|
8
13
|
],
|
|
9
14
|
"type": "module",
|
|
10
15
|
"exports": {
|
|
@@ -125,6 +130,12 @@
|
|
|
125
130
|
"import": "./dist/esm/headless.mjs",
|
|
126
131
|
"require": "./dist/cjs/headless.cjs"
|
|
127
132
|
},
|
|
133
|
+
"./stack-toolbar-implementation": {
|
|
134
|
+
"react-native": "./dist/esm/stack-toolbar-implementation.native.js",
|
|
135
|
+
"types": "./types/stack-toolbar-implementation.d.ts",
|
|
136
|
+
"import": "./dist/esm/stack-toolbar-implementation.mjs",
|
|
137
|
+
"require": "./dist/cjs/stack-toolbar-implementation.cjs"
|
|
138
|
+
},
|
|
128
139
|
"./headless-server": {
|
|
129
140
|
"types": "./types/headless-server.d.ts",
|
|
130
141
|
"import": "./dist/esm/headless-server.mjs",
|
|
@@ -176,34 +187,34 @@
|
|
|
176
187
|
"@bacons/text-decoder": "^0.0.0",
|
|
177
188
|
"@radix-ui/react-slot": "^1.0.2",
|
|
178
189
|
"@react-native-masked-view/masked-view": "^0.3.2",
|
|
179
|
-
"@react-navigation/bottom-tabs": "~7.
|
|
180
|
-
"@react-navigation/native-stack": "~7.
|
|
181
|
-
"@react-navigation/routers": "~7.
|
|
190
|
+
"@react-navigation/bottom-tabs": "~7.18.16",
|
|
191
|
+
"@react-navigation/native-stack": "~7.18.8",
|
|
192
|
+
"@react-navigation/routers": "~7.6.4",
|
|
182
193
|
"@cloudflare/vite-plugin": "^1.33.1",
|
|
183
194
|
"@swc/core": "^1.14.0",
|
|
184
195
|
"@ungap/structured-clone": "^1.2.0",
|
|
185
|
-
"@vxrn/color-scheme": "1.
|
|
186
|
-
"@vxrn/compiler": "1.
|
|
187
|
-
"@vxrn/resolve": "1.
|
|
188
|
-
"@vxrn/tslib-lite": "1.
|
|
189
|
-
"@vxrn/use-isomorphic-layout-effect": "1.
|
|
190
|
-
"@vxrn/vite-plugin-metro": "1.
|
|
196
|
+
"@vxrn/color-scheme": "1.24.1",
|
|
197
|
+
"@vxrn/compiler": "1.24.1",
|
|
198
|
+
"@vxrn/resolve": "1.24.1",
|
|
199
|
+
"@vxrn/tslib-lite": "1.24.1",
|
|
200
|
+
"@vxrn/use-isomorphic-layout-effect": "1.24.1",
|
|
201
|
+
"@vxrn/vite-plugin-metro": "1.24.1",
|
|
191
202
|
"babel-dead-code-elimination": "1.0.10",
|
|
192
203
|
"babel-plugin-module-resolver": "^5.0.2",
|
|
193
204
|
"babel-preset-expo": "~57.0.5",
|
|
194
205
|
"citty": "^0.1.6",
|
|
195
206
|
"core-js": "^3.38.1",
|
|
196
|
-
"create-vxrn": "1.
|
|
207
|
+
"create-vxrn": "1.24.1",
|
|
197
208
|
"escape-string-regexp": "^5.0.0",
|
|
198
|
-
"expo-linking": "~57.0.
|
|
199
|
-
"expo-modules-core": "~57.0.
|
|
209
|
+
"expo-linking": "~57.0.5",
|
|
210
|
+
"expo-modules-core": "~57.0.10",
|
|
200
211
|
"fast-deep-equal": "^3.1.3",
|
|
201
212
|
"fast-glob": "^3.3.3",
|
|
202
213
|
"fs-extra": "^11.2.0",
|
|
203
214
|
"hono": "^4.12.8",
|
|
204
215
|
"lightningcss": "^1.30.1",
|
|
205
216
|
"micromatch": "^4.0.8",
|
|
206
|
-
"nanoid": "^3.3.
|
|
217
|
+
"nanoid": "^3.3.18",
|
|
207
218
|
"oxc-parser": "^0.112.0",
|
|
208
219
|
"perfect-debounce": "^1.0.0",
|
|
209
220
|
"picocolors": "^1.0.0",
|
|
@@ -213,14 +224,15 @@
|
|
|
213
224
|
"tsconfig-paths": "^4",
|
|
214
225
|
"use-latest-callback": "^0.2.3",
|
|
215
226
|
"vite": "^8.1.0",
|
|
216
|
-
"vxrn": "1.
|
|
227
|
+
"vxrn": "1.24.1",
|
|
228
|
+
"web-streams-polyfill": "^4.3.0",
|
|
217
229
|
"ws": "^8.21.0",
|
|
218
230
|
"xxhashjs": "^0.2.2"
|
|
219
231
|
},
|
|
220
232
|
"peerDependencies": {
|
|
221
233
|
"@bottom-tabs/react-navigation": ">=0.9.0",
|
|
222
|
-
"@react-navigation/drawer": "~7.
|
|
223
|
-
"@react-navigation/native": "~7.
|
|
234
|
+
"@react-navigation/drawer": "~7.13.8",
|
|
235
|
+
"@react-navigation/native": "~7.3.16",
|
|
224
236
|
"react": "^19.2.3",
|
|
225
237
|
"react-dom": "^19.2.3",
|
|
226
238
|
"react-native": "0.86.2",
|
|
@@ -259,9 +271,9 @@
|
|
|
259
271
|
}
|
|
260
272
|
},
|
|
261
273
|
"devDependencies": {
|
|
262
|
-
"@react-navigation/core": "
|
|
263
|
-
"@react-navigation/drawer": "~7.
|
|
264
|
-
"@react-navigation/native": "~7.
|
|
274
|
+
"@react-navigation/core": "~7.21.12",
|
|
275
|
+
"@react-navigation/drawer": "~7.13.8",
|
|
276
|
+
"@react-navigation/native": "~7.3.16",
|
|
265
277
|
"@tamagui/build": "2.6.2",
|
|
266
278
|
"react-native-gesture-handler": "~2.32.0",
|
|
267
279
|
"react-native-reanimated": "~4.5.1",
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
|
|
3
|
+
describe('mobile polyfills', () => {
|
|
4
|
+
it('installs working web streams globals when the runtime has none', async () => {
|
|
5
|
+
const originals = ['ReadableStream', 'WritableStream', 'TransformStream'].map(
|
|
6
|
+
(name) => [name, Object.getOwnPropertyDescriptor(globalThis, name)] as const
|
|
7
|
+
)
|
|
8
|
+
for (const [name] of originals) {
|
|
9
|
+
Reflect.deleteProperty(globalThis, name)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
try {
|
|
13
|
+
await import('../polyfills-mobile')
|
|
14
|
+
|
|
15
|
+
const stream = new globalThis.ReadableStream<Uint8Array>({
|
|
16
|
+
start(controller) {
|
|
17
|
+
controller.enqueue(new TextEncoder().encode('hello'))
|
|
18
|
+
controller.close()
|
|
19
|
+
},
|
|
20
|
+
})
|
|
21
|
+
const reader = stream.getReader()
|
|
22
|
+
const { value, done } = await reader.read()
|
|
23
|
+
|
|
24
|
+
expect(done).toBe(false)
|
|
25
|
+
expect(new TextDecoder().decode(value)).toBe('hello')
|
|
26
|
+
expect(typeof globalThis.WritableStream).toBe('function')
|
|
27
|
+
expect(typeof globalThis.TransformStream).toBe('function')
|
|
28
|
+
} finally {
|
|
29
|
+
for (const [name, descriptor] of originals) {
|
|
30
|
+
Reflect.deleteProperty(globalThis, name)
|
|
31
|
+
if (descriptor) {
|
|
32
|
+
Object.defineProperty(globalThis, name, descriptor)
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
})
|
|
37
|
+
})
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
import TestRenderer, { act } from 'react-test-renderer'
|
|
3
|
+
import { describe, expect, it } from 'vitest'
|
|
4
|
+
|
|
5
|
+
import { appendStackToolbarConfig } from '../../layouts/stack-utils/StackToolbar.shared'
|
|
6
|
+
import { StackStateProvider, useStack, type HeadlessStackDescriptors } from '../useStack'
|
|
7
|
+
|
|
8
|
+
describe('StackStateProvider', () => {
|
|
9
|
+
it('hands toolbar config to headless implementations', () => {
|
|
10
|
+
let options: Record<string, any> | undefined
|
|
11
|
+
|
|
12
|
+
function Capture() {
|
|
13
|
+
options = useStack().focused.options
|
|
14
|
+
return null
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
const state = {
|
|
18
|
+
stale: false as const,
|
|
19
|
+
type: 'stack' as const,
|
|
20
|
+
key: 'stack-key',
|
|
21
|
+
index: 0,
|
|
22
|
+
routeNames: ['index'],
|
|
23
|
+
routes: [{ key: 'index-key', name: 'index' }],
|
|
24
|
+
preloadedRoutes: [],
|
|
25
|
+
}
|
|
26
|
+
const descriptors: HeadlessStackDescriptors = {
|
|
27
|
+
'index-key': {
|
|
28
|
+
options: appendStackToolbarConfig(
|
|
29
|
+
{ title: 'Inbox' },
|
|
30
|
+
{ placement: 'right', children: 'Share' }
|
|
31
|
+
),
|
|
32
|
+
render: () => <div>Inbox</div>,
|
|
33
|
+
},
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
act(() => {
|
|
37
|
+
TestRenderer.create(
|
|
38
|
+
<StackStateProvider state={state} descriptors={descriptors}>
|
|
39
|
+
<Capture />
|
|
40
|
+
</StackStateProvider>
|
|
41
|
+
)
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
expect(options).toMatchObject({
|
|
45
|
+
title: 'Inbox',
|
|
46
|
+
toolbar: {
|
|
47
|
+
right: {
|
|
48
|
+
placement: 'right',
|
|
49
|
+
children: 'Share',
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
})
|
|
53
|
+
})
|
|
54
|
+
})
|
package/src/headless/types.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ComponentType, ReactElement, ReactNode } from 'react'
|
|
2
|
+
import type { StackToolbarConfig } from '../layouts/stack-utils/StackToolbar.types'
|
|
2
3
|
|
|
3
4
|
// shared contract for headless web navigators. see plans/headless-navigators.md
|
|
4
5
|
|
|
@@ -10,7 +11,7 @@ export type ScreenEntry = {
|
|
|
10
11
|
isFocused: boolean
|
|
11
12
|
keepMounted: boolean
|
|
12
13
|
// compiled options: semantic keys plus opaque passthrough of preset keys
|
|
13
|
-
options: Record<string, any>
|
|
14
|
+
options: Record<string, any> & { toolbar?: StackToolbarConfig }
|
|
14
15
|
// lazy: rendering it mounts the route (descriptor.render underneath)
|
|
15
16
|
element: ReactElement
|
|
16
17
|
}
|
package/src/headless/useStack.ts
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
|
|
14
14
|
import type { UseStackResult } from './types'
|
|
15
15
|
import { getPathFromState } from '../fork/getPathFromState'
|
|
16
|
+
import { exposeStackToolbarConfig } from '../layouts/stack-utils/StackToolbar.shared'
|
|
16
17
|
import { getResolvedLinking } from '../router/linkingConfig'
|
|
17
18
|
|
|
18
19
|
export type HeadlessStackDescriptors = Record<
|
|
@@ -39,7 +40,7 @@ export function StackStateProvider({
|
|
|
39
40
|
const value = useMemo<UseStackResult>(() => {
|
|
40
41
|
const screens = state.routes.map((route, index) => {
|
|
41
42
|
const descriptor = descriptors[route.key]!
|
|
42
|
-
const options = descriptor.options
|
|
43
|
+
const options = exposeStackToolbarConfig(descriptor.options)
|
|
43
44
|
const href = (linking?.getPathFromState ?? getPathFromState)(
|
|
44
45
|
{ ...state, index },
|
|
45
46
|
linking?.config
|
package/src/index.ts
CHANGED
|
@@ -105,6 +105,18 @@ export type {
|
|
|
105
105
|
StackHeaderTitleProps,
|
|
106
106
|
StackScreenOptions,
|
|
107
107
|
StackScreenProps,
|
|
108
|
+
StackToolbarBadgeProps,
|
|
109
|
+
StackToolbarButtonProps,
|
|
110
|
+
StackToolbarConfig,
|
|
111
|
+
StackToolbarIconProps,
|
|
112
|
+
StackToolbarLabelProps,
|
|
113
|
+
StackToolbarMenuActionProps,
|
|
114
|
+
StackToolbarMenuProps,
|
|
115
|
+
StackToolbarPlacement,
|
|
116
|
+
StackToolbarProps,
|
|
117
|
+
StackToolbarSearchBarSlotProps,
|
|
118
|
+
StackToolbarSpacerProps,
|
|
119
|
+
StackToolbarViewProps,
|
|
108
120
|
} from './layouts/stack-utils'
|
|
109
121
|
export { useTabs } from './headless/useTabs'
|
|
110
122
|
export { useDrawer } from './headless/useDrawer'
|
package/src/layouts/Stack.tsx
CHANGED
|
@@ -14,9 +14,14 @@ import {
|
|
|
14
14
|
StackHeaderComponent,
|
|
15
15
|
StackHeaderSearchBar,
|
|
16
16
|
StackScreen,
|
|
17
|
+
StackToolbar,
|
|
17
18
|
type StackScreenProps,
|
|
18
19
|
} from './stack-utils'
|
|
19
20
|
import { withLayoutContext } from './withLayoutContext'
|
|
21
|
+
import {
|
|
22
|
+
getStackToolbarImplementation,
|
|
23
|
+
type StackToolbarImplementation,
|
|
24
|
+
} from './stack-utils/StackToolbarImplementation'
|
|
20
25
|
|
|
21
26
|
const NativeStackNavigator = createStackNavigator().Navigator
|
|
22
27
|
|
|
@@ -31,12 +36,19 @@ const RNStack = withLayoutContext<
|
|
|
31
36
|
* Pre-process children to convert StackScreen (with Header children) to Screen (with options).
|
|
32
37
|
* This allows the Header Composition API to work in layout files.
|
|
33
38
|
*/
|
|
34
|
-
function mapChildren(
|
|
39
|
+
function mapChildren(
|
|
40
|
+
children: React.ReactNode,
|
|
41
|
+
toolbarImplementation: StackToolbarImplementation | null
|
|
42
|
+
): React.ReactNode {
|
|
35
43
|
return Children.toArray(children)
|
|
36
44
|
.map((child, index) => {
|
|
37
45
|
if (isChildOfType(child, StackScreen)) {
|
|
38
46
|
// convert StackScreen to Screen with options extracted from Header children
|
|
39
|
-
const options = appendScreenStackPropsToOptions(
|
|
47
|
+
const options = appendScreenStackPropsToOptions(
|
|
48
|
+
{},
|
|
49
|
+
child.props,
|
|
50
|
+
toolbarImplementation
|
|
51
|
+
)
|
|
40
52
|
const { children: _, ...rest } = child.props
|
|
41
53
|
return <Screen key={child.props.name ?? index} {...rest} options={options} />
|
|
42
54
|
}
|
|
@@ -46,7 +58,7 @@ function mapChildren(children: React.ReactNode): React.ReactNode {
|
|
|
46
58
|
return React.cloneElement(
|
|
47
59
|
child,
|
|
48
60
|
{ key: `protected-${index}` },
|
|
49
|
-
mapChildren(child.props.children)
|
|
61
|
+
mapChildren(child.props.children, toolbarImplementation)
|
|
50
62
|
)
|
|
51
63
|
}
|
|
52
64
|
|
|
@@ -71,6 +83,7 @@ function mapChildren(children: React.ReactNode): React.ReactNode {
|
|
|
71
83
|
const StackWithComposition = React.forwardRef<unknown, ComponentProps<typeof RNStack>>(
|
|
72
84
|
(props, ref) => {
|
|
73
85
|
const { children, screenOptions, ...rest } = props
|
|
86
|
+
const toolbarImplementation = getStackToolbarImplementation()
|
|
74
87
|
|
|
75
88
|
// extract Stack.Header from children for screenOptions
|
|
76
89
|
const screenOptionsWithHeader = useMemo(() => {
|
|
@@ -84,19 +97,30 @@ const StackWithComposition = React.forwardRef<unknown, ComponentProps<typeof RNS
|
|
|
84
97
|
if (typeof screenOptions === 'function') {
|
|
85
98
|
return (...args: Parameters<typeof screenOptions>) => {
|
|
86
99
|
const opts = screenOptions(...args)
|
|
87
|
-
return appendScreenStackPropsToOptions(
|
|
100
|
+
return appendScreenStackPropsToOptions(
|
|
101
|
+
opts,
|
|
102
|
+
headerProps,
|
|
103
|
+
toolbarImplementation
|
|
104
|
+
)
|
|
88
105
|
}
|
|
89
106
|
}
|
|
90
|
-
return appendScreenStackPropsToOptions(
|
|
107
|
+
return appendScreenStackPropsToOptions(
|
|
108
|
+
screenOptions,
|
|
109
|
+
headerProps,
|
|
110
|
+
toolbarImplementation
|
|
111
|
+
)
|
|
91
112
|
}
|
|
92
|
-
return appendScreenStackPropsToOptions({}, headerProps)
|
|
113
|
+
return appendScreenStackPropsToOptions({}, headerProps, toolbarImplementation)
|
|
93
114
|
}
|
|
94
115
|
|
|
95
116
|
return screenOptions
|
|
96
|
-
}, [children, screenOptions])
|
|
117
|
+
}, [children, screenOptions, toolbarImplementation])
|
|
97
118
|
|
|
98
119
|
// pre-process children to convert StackScreen to Screen
|
|
99
|
-
const processedChildren = useMemo(
|
|
120
|
+
const processedChildren = useMemo(
|
|
121
|
+
() => mapChildren(children, toolbarImplementation),
|
|
122
|
+
[children, toolbarImplementation]
|
|
123
|
+
)
|
|
100
124
|
const navigatorProps = useMemo(() => getStackNavigatorProps(children), [children])
|
|
101
125
|
|
|
102
126
|
return (
|
|
@@ -119,6 +143,7 @@ export const Stack = Object.assign(StackWithComposition, {
|
|
|
119
143
|
Header: StackHeader,
|
|
120
144
|
Protected,
|
|
121
145
|
SearchBar: StackHeaderSearchBar,
|
|
146
|
+
Toolbar: StackToolbar,
|
|
122
147
|
})
|
|
123
148
|
|
|
124
149
|
export default Stack
|
|
@@ -25,6 +25,7 @@ import { Stack } from 'one'
|
|
|
25
25
|
| `Stack.Header.Right` | Custom right header content |
|
|
26
26
|
| `Stack.Header.BackButton` | Back button configuration |
|
|
27
27
|
| `Stack.Header.SearchBar` | Search bar configuration |
|
|
28
|
+
| `Stack.Toolbar` | Native iOS header and bottom toolbar items |
|
|
28
29
|
|
|
29
30
|
## Basic Usage
|
|
30
31
|
|
|
@@ -9,6 +9,15 @@ import {
|
|
|
9
9
|
appendStackHeaderPropsToOptions,
|
|
10
10
|
type StackHeaderProps,
|
|
11
11
|
} from './StackHeaderComponent'
|
|
12
|
+
import {
|
|
13
|
+
StackToolbar,
|
|
14
|
+
appendStackToolbarPropsToOptions,
|
|
15
|
+
type StackToolbarProps,
|
|
16
|
+
} from './StackToolbar'
|
|
17
|
+
import {
|
|
18
|
+
getStackToolbarImplementation,
|
|
19
|
+
type StackToolbarImplementation,
|
|
20
|
+
} from './StackToolbarImplementation'
|
|
12
21
|
import { Screen } from '../../views/Screen'
|
|
13
22
|
|
|
14
23
|
export type StackScreenOptions = Omit<NativeStackNavigationOptions, 'presentation'> & {
|
|
@@ -47,12 +56,17 @@ export interface StackScreenProps extends PropsWithChildren {
|
|
|
47
56
|
* ```
|
|
48
57
|
*/
|
|
49
58
|
export function StackScreen({ children, options, ...rest }: StackScreenProps) {
|
|
59
|
+
const toolbarImplementation = getStackToolbarImplementation()
|
|
50
60
|
const updatedOptions = useMemo(
|
|
51
61
|
() =>
|
|
52
|
-
appendScreenStackPropsToOptions(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
62
|
+
appendScreenStackPropsToOptions(
|
|
63
|
+
options ?? {},
|
|
64
|
+
{
|
|
65
|
+
children,
|
|
66
|
+
},
|
|
67
|
+
toolbarImplementation
|
|
68
|
+
),
|
|
69
|
+
[options, children, toolbarImplementation]
|
|
56
70
|
)
|
|
57
71
|
return <Screen {...rest} options={updatedOptions as NativeStackNavigationOptions} />
|
|
58
72
|
}
|
|
@@ -101,7 +115,8 @@ export function validateStackPresentation(
|
|
|
101
115
|
|
|
102
116
|
export function appendScreenStackPropsToOptions(
|
|
103
117
|
options: StackScreenOptions,
|
|
104
|
-
props: StackScreenProps
|
|
118
|
+
props: StackScreenProps,
|
|
119
|
+
toolbarImplementation?: StackToolbarImplementation | null
|
|
105
120
|
): StackScreenOptions {
|
|
106
121
|
let updatedOptions: StackScreenOptions = { ...options, ...props.options }
|
|
107
122
|
|
|
@@ -114,6 +129,12 @@ export function appendScreenStackPropsToOptions(
|
|
|
114
129
|
options as NativeStackNavigationOptions,
|
|
115
130
|
child.props as StackHeaderProps
|
|
116
131
|
) as StackScreenOptions
|
|
132
|
+
} else if (child.type === StackToolbar) {
|
|
133
|
+
return appendStackToolbarPropsToOptions(
|
|
134
|
+
options as NativeStackNavigationOptions,
|
|
135
|
+
child.props as StackToolbarProps,
|
|
136
|
+
toolbarImplementation
|
|
137
|
+
) as StackScreenOptions
|
|
117
138
|
} else {
|
|
118
139
|
console.warn(
|
|
119
140
|
`Warning: Unknown child element passed to Stack.Screen: ${(child.type as { name: string }).name ?? child.type}`
|