@rork-ai/toolkit-sdk 0.2.54 → 0.3.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 +7 -1
- package/lib/module/agent.js +73 -76
- package/lib/module/agent.js.map +1 -1
- package/lib/module/analytics-client.js +35 -0
- package/lib/module/analytics-client.js.map +1 -0
- package/lib/module/analytics-provider.js +29 -0
- package/lib/module/analytics-provider.js.map +1 -0
- package/lib/module/analytics.js +2 -59
- package/lib/module/analytics.js.map +1 -1
- package/lib/module/dev/error-boundary.js +38 -17
- package/lib/module/dev/error-boundary.js.map +1 -1
- package/lib/module/dev/safe-insets-content.web.js +6 -5
- package/lib/module/dev/safe-insets-content.web.js.map +1 -1
- package/lib/module/dev/sdk53/index.js.map +1 -1
- package/lib/module/dev/sdk53/inspector.js +71 -168
- package/lib/module/dev/sdk53/inspector.js.map +1 -1
- package/lib/module/dev/sdk53/inspector.web.js.map +1 -1
- package/lib/module/dev/sdk54/index.js.map +1 -1
- package/lib/module/dev/sdk54/inspector.js +71 -45
- package/lib/module/dev/sdk54/inspector.js.map +1 -1
- package/lib/module/dev/sdk54/inspector.web.js.map +1 -1
- package/lib/module/index.js +1 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/polyfills/fetch.js +6 -10
- package/lib/module/polyfills/fetch.js.map +1 -1
- package/lib/module/polyfills/haptics.web.js.map +1 -1
- package/lib/module/polyfills/maps.web-component.js +27 -0
- package/lib/module/polyfills/maps.web-component.js.map +1 -0
- package/lib/module/polyfills/maps.web-values.js +19 -0
- package/lib/module/polyfills/maps.web-values.js.map +1 -0
- package/lib/module/polyfills/maps.web.js +2 -34
- package/lib/module/polyfills/maps.web.js.map +1 -1
- package/lib/module/polyfills/refresh-control-component.js +48 -42
- package/lib/module/polyfills/refresh-control-component.js.map +1 -1
- package/lib/module/polyfills/secure-store.web.js.map +1 -1
- package/lib/typescript/src/agent.d.ts +34 -30
- package/lib/typescript/src/agent.d.ts.map +1 -1
- package/lib/typescript/src/analytics-client.d.ts +10 -0
- package/lib/typescript/src/analytics-client.d.ts.map +1 -0
- package/lib/typescript/src/analytics-provider.d.ts +3 -0
- package/lib/typescript/src/analytics-provider.d.ts.map +1 -0
- package/lib/typescript/src/analytics.d.ts +2 -6
- package/lib/typescript/src/analytics.d.ts.map +1 -1
- package/lib/typescript/src/dev/error-boundary.d.ts +6 -6
- package/lib/typescript/src/dev/error-boundary.d.ts.map +1 -1
- package/lib/typescript/src/dev/safe-insets-content.web.d.ts.map +1 -1
- package/lib/typescript/src/dev/sdk53/index.d.ts +2 -1
- package/lib/typescript/src/dev/sdk53/index.d.ts.map +1 -1
- package/lib/typescript/src/dev/sdk53/inspector.d.ts +23 -4
- package/lib/typescript/src/dev/sdk53/inspector.d.ts.map +1 -1
- package/lib/typescript/src/dev/sdk53/inspector.web.d.ts +2 -3
- package/lib/typescript/src/dev/sdk53/inspector.web.d.ts.map +1 -1
- package/lib/typescript/src/dev/sdk54/index.d.ts +2 -3
- package/lib/typescript/src/dev/sdk54/index.d.ts.map +1 -1
- package/lib/typescript/src/dev/sdk54/inspector.d.ts +23 -4
- package/lib/typescript/src/dev/sdk54/inspector.d.ts.map +1 -1
- package/lib/typescript/src/dev/sdk54/inspector.web.d.ts +2 -3
- package/lib/typescript/src/dev/sdk54/inspector.web.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +1 -2
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/polyfills/alert.web.d.ts.map +1 -1
- package/lib/typescript/src/polyfills/fetch.d.ts.map +1 -1
- package/lib/typescript/src/polyfills/haptics.web.d.ts.map +1 -1
- package/lib/typescript/src/polyfills/maps.web-component.d.ts +9 -0
- package/lib/typescript/src/polyfills/maps.web-component.d.ts.map +1 -0
- package/lib/typescript/src/polyfills/maps.web-values.d.ts +4 -0
- package/lib/typescript/src/polyfills/maps.web-values.d.ts.map +1 -0
- package/lib/typescript/src/polyfills/maps.web.d.ts +2 -6
- package/lib/typescript/src/polyfills/maps.web.d.ts.map +1 -1
- package/lib/typescript/src/polyfills/refresh-control-component.d.ts +2 -2
- package/lib/typescript/src/polyfills/refresh-control-component.d.ts.map +1 -1
- package/lib/typescript/src/polyfills/secure-store.web.d.ts.map +1 -1
- package/metro/index.js +15 -29
- package/metro/transformer.js +41 -46
- package/package.json +79 -92
- package/lib/module/api.js +0 -9
- package/lib/module/api.js.map +0 -1
- package/lib/module/bridge.js +0 -38
- package/lib/module/bridge.js.map +0 -1
- package/lib/module/integrations.js +0 -45
- package/lib/module/integrations.js.map +0 -1
- package/lib/typescript/src/api.d.ts +0 -3
- package/lib/typescript/src/api.d.ts.map +0 -1
- package/lib/typescript/src/bridge.d.ts +0 -5
- package/lib/typescript/src/bridge.d.ts.map +0 -1
- package/lib/typescript/src/integrations.d.ts +0 -18
- package/lib/typescript/src/integrations.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe-insets-content.web.d.ts","sourceRoot":"","sources":["../../../../src/dev/safe-insets-content.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"safe-insets-content.web.d.ts","sourceRoot":"","sources":["../../../../src/dev/safe-insets-content.web.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAWpE,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CAwC7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/dev/sdk53/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/dev/sdk53/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,2CAQnE"}
|
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
import { type EventSubscription } from "expo-modules-core";
|
|
2
2
|
import type { PropsWithChildren } from "react";
|
|
3
3
|
import type { ViewStyle } from "react-native";
|
|
4
|
-
import type { InspectorData
|
|
4
|
+
import type { InspectorData } from "react-native/Libraries/Renderer/shims/ReactNativeTypes";
|
|
5
|
+
type BridgeMessage = Record<string, unknown>;
|
|
6
|
+
type InspectorHierarchyEntry = Readonly<{
|
|
7
|
+
name?: string | null;
|
|
8
|
+
}>;
|
|
9
|
+
type TouchedViewDataAtPoint = Readonly<{
|
|
10
|
+
pointerY: number;
|
|
11
|
+
frame: Readonly<{
|
|
12
|
+
left: number;
|
|
13
|
+
top: number;
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
}>;
|
|
17
|
+
props: Readonly<{
|
|
18
|
+
style?: ViewStyle;
|
|
19
|
+
}>;
|
|
20
|
+
componentStack?: string;
|
|
21
|
+
hierarchy?: readonly InspectorHierarchyEntry[];
|
|
22
|
+
}>;
|
|
5
23
|
export type InspectedElementFrame = TouchedViewDataAtPoint["frame"];
|
|
6
24
|
export type InspectedElement = Readonly<{
|
|
7
25
|
frame: InspectedElementFrame;
|
|
@@ -13,11 +31,12 @@ export type BundleInspectorRef = {
|
|
|
13
31
|
};
|
|
14
32
|
export type BundleInspectorProps = PropsWithChildren<{}>;
|
|
15
33
|
export declare function isRorkSandbox(): boolean;
|
|
16
|
-
export declare function sendBridgeMessage(type: "inspector-element" | "merge-inspector-state" | "runtime-ready" | "runtime-error", data?:
|
|
17
|
-
export declare function addBridgeListener(listener: (data:
|
|
34
|
+
export declare function sendBridgeMessage(type: "inspector-element" | "merge-inspector-state" | "runtime-ready" | "runtime-error", data?: BridgeMessage): unknown;
|
|
35
|
+
export declare function addBridgeListener(listener: (data: BridgeMessage) => void): EventSubscription;
|
|
18
36
|
export declare function useBridge(): {
|
|
19
|
-
disableInspector: () => void;
|
|
20
37
|
inspectorEnabled: boolean;
|
|
38
|
+
disableInspector: () => void;
|
|
21
39
|
};
|
|
22
40
|
export declare function BundleInspector(props: BundleInspectorProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export {};
|
|
23
42
|
//# sourceMappingURL=inspector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspector.d.ts","sourceRoot":"","sources":["../../../../../src/dev/sdk53/inspector.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inspector.d.ts","sourceRoot":"","sources":["../../../../../src/dev/sdk53/inspector.tsx"],"names":[],"mappings":"AACA,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAQ9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wDAAwD,CAAC;AAqB5F,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE7C,KAAK,uBAAuB,GAAG,QAAQ,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAAC;AAElE,KAAK,sBAAsB,GAAG,QAAQ,CAAC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,QAAQ,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9E,KAAK,EAAE,QAAQ,CAAC;QAAE,KAAK,CAAC,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IACvC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,SAAS,uBAAuB,EAAE,CAAC;CAChD,CAAC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;AAEpE,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,KAAK,EAAE,qBAAqB,CAAC;IAC7B,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;AAE3D,MAAM,MAAM,kBAAkB,GAAG;IAAE,sBAAsB,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AACxE,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAC;AAuBzD,wBAAgB,aAAa,YAE5B;AAkBD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,mBAAmB,GAAG,uBAAuB,GAAG,eAAe,GAAG,eAAe,EACvF,IAAI,CAAC,EAAE,aAAa,WAOrB;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,GAAG,iBAAiB,CAa5F;AAED,wBAAgB,SAAS;;;EA6BxB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,2CAsH1D"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import type { PropsWithChildren } from "react";
|
|
2
|
+
export declare function BundleInspector({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
//# sourceMappingURL=inspector.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspector.web.d.ts","sourceRoot":"","sources":["../../../../../src/dev/sdk53/inspector.web.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"inspector.web.d.ts","sourceRoot":"","sources":["../../../../../src/dev/sdk53/inspector.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CAE9D"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import type { PropsWithChildren } from "react";
|
|
2
|
+
export declare function RorkDevWrapper({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/dev/sdk54/index.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/dev/sdk54/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAM/C,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CAQ7D"}
|
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
import { type EventSubscription } from "expo-modules-core";
|
|
2
2
|
import type { PropsWithChildren } from "react";
|
|
3
3
|
import type { ViewStyle } from "react-native";
|
|
4
|
-
import type { InspectorData
|
|
4
|
+
import type { InspectorData } from "react-native/Libraries/Renderer/shims/ReactNativeTypes";
|
|
5
|
+
type BridgeMessage = Record<string, unknown>;
|
|
6
|
+
type InspectorHierarchyEntry = Readonly<{
|
|
7
|
+
name?: string | null;
|
|
8
|
+
}>;
|
|
9
|
+
type TouchedViewDataAtPoint = Readonly<{
|
|
10
|
+
pointerY: number;
|
|
11
|
+
frame: Readonly<{
|
|
12
|
+
left: number;
|
|
13
|
+
top: number;
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
}>;
|
|
17
|
+
props: Readonly<{
|
|
18
|
+
style?: ViewStyle;
|
|
19
|
+
}>;
|
|
20
|
+
componentStack?: string;
|
|
21
|
+
hierarchy?: readonly InspectorHierarchyEntry[];
|
|
22
|
+
}>;
|
|
5
23
|
export type InspectedElementFrame = TouchedViewDataAtPoint["frame"];
|
|
6
24
|
export type InspectedElement = Readonly<{
|
|
7
25
|
frame: InspectedElementFrame;
|
|
@@ -13,11 +31,12 @@ export type BundleInspectorRef = {
|
|
|
13
31
|
};
|
|
14
32
|
export type BundleInspectorProps = PropsWithChildren<{}>;
|
|
15
33
|
export declare function isRorkSandbox(): boolean;
|
|
16
|
-
export declare function sendBridgeMessage(type: "inspector-element" | "merge-inspector-state" | "runtime-ready" | "runtime-error", data?:
|
|
17
|
-
export declare function addBridgeListener(listener: (data:
|
|
34
|
+
export declare function sendBridgeMessage(type: "inspector-element" | "merge-inspector-state" | "runtime-ready" | "runtime-error", data?: BridgeMessage): unknown;
|
|
35
|
+
export declare function addBridgeListener(listener: (data: BridgeMessage) => void): EventSubscription;
|
|
18
36
|
export declare function useBridge(): {
|
|
19
|
-
disableInspector: () => void;
|
|
20
37
|
inspectorEnabled: boolean;
|
|
38
|
+
disableInspector: () => void;
|
|
21
39
|
};
|
|
22
40
|
export declare function BundleInspector(props: BundleInspectorProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
export {};
|
|
23
42
|
//# sourceMappingURL=inspector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspector.d.ts","sourceRoot":"","sources":["../../../../../src/dev/sdk54/inspector.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"inspector.d.ts","sourceRoot":"","sources":["../../../../../src/dev/sdk54/inspector.tsx"],"names":[],"mappings":"AACA,OAAO,EAA+B,KAAK,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACxF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAQ9C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wDAAwD,CAAC;AAsB5F,KAAK,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE7C,KAAK,uBAAuB,GAAG,QAAQ,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CAAC;AAElE,KAAK,sBAAsB,GAAG,QAAQ,CAAC;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,QAAQ,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9E,KAAK,EAAE,QAAQ,CAAC;QAAE,KAAK,CAAC,EAAE,SAAS,CAAA;KAAE,CAAC,CAAC;IACvC,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,SAAS,uBAAuB,EAAE,CAAC;CAChD,CAAC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;AAEpE,MAAM,MAAM,gBAAgB,GAAG,QAAQ,CAAC;IACtC,KAAK,EAAE,qBAAqB,CAAC;IAC7B,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;AAE3D,MAAM,MAAM,kBAAkB,GAAG;IAAE,sBAAsB,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AACxE,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAAC,EAAE,CAAC,CAAC;AAuBzD,wBAAgB,aAAa,YAE5B;AAkBD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,mBAAmB,GAAG,uBAAuB,GAAG,eAAe,GAAG,eAAe,EACvF,IAAI,CAAC,EAAE,aAAa,WAOrB;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,aAAa,KAAK,IAAI,GAAG,iBAAiB,CAa5F;AAED,wBAAgB,SAAS;;;EA6BxB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,oBAAoB,2CAsH1D"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
}): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import type { PropsWithChildren } from "react";
|
|
2
|
+
export declare function BundleInspector({ children }: PropsWithChildren): import("react/jsx-runtime").JSX.Element;
|
|
4
3
|
//# sourceMappingURL=inspector.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspector.web.d.ts","sourceRoot":"","sources":["../../../../../src/dev/sdk54/inspector.web.tsx"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"inspector.web.d.ts","sourceRoot":"","sources":["../../../../../src/dev/sdk54/inspector.web.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,wBAAgB,eAAe,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CAE9D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.web.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/alert.web.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"alert.web.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/alert.web.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,kCAAkC,CAAC;eAEzC,QAAQ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/fetch.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/fetch.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"haptics.web.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/haptics.web.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,oBAAY,wBAAwB;IAClC,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB;AAED,oBAAY,mBAAmB;IAC7B,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;
|
|
1
|
+
{"version":3,"file":"haptics.web.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/haptics.web.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,oBAAY,wBAAwB;IAClC,OAAO,YAAY;IACnB,OAAO,YAAY;IACnB,KAAK,UAAU;CAChB;AAED,oBAAY,mBAAmB;IAC7B,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AAoBD,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAKpD;AAED,wBAAsB,iBAAiB,CACrC,IAAI,GAAE,wBAA2D,GAChE,OAAO,CAAC,IAAI,CAAC,CAKf;AAED,wBAAsB,WAAW,CAAC,KAAK,GAAE,mBAAgD,GAAG,OAAO,CAAC,IAAI,CAAC,CAKxG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maps.web-component.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/maps.web-component.tsx"],"names":[],"mappings":"AAQA,iBAAS,OAAO,CAAC,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE;;;CAAA,2CAEjC;kBAFQ,OAAO;;;eAYD,OAAO"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const PROVIDER_GOOGLE = "google";
|
|
2
|
+
export declare const PROVIDER_DEFAULT: undefined;
|
|
3
|
+
export declare const Marker: any, Callout: any, Polyline: any, Polygon: any, Circle: any, Overlay: any, Heatmap: any, UrlTile: any, WMSTile: any, LocalTile: any;
|
|
4
|
+
//# sourceMappingURL=maps.web-values.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maps.web-values.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/maps.web-values.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,WAAW,CAAC;AACxC,eAAO,MAAM,gBAAgB,WAAY,CAAC;AAE1C,eAAO,MAAQ,MAAM,OAAE,OAAO,OAAE,QAAQ,OAAE,OAAO,OAAE,MAAM,OAAE,OAAO,OAAE,OAAO,OAAE,OAAO,OAAE,OAAO,OAAE,SAAS,KAAY,CAAC"}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export declare const PROVIDER_DEFAULT: undefined;
|
|
4
|
-
declare const MapView: React.ForwardRefExoticComponent<React.RefAttributes<unknown>>;
|
|
5
|
-
export declare const Marker: any, Callout: any, Polyline: any, Polygon: any, Circle: any, Overlay: any, Heatmap: any, UrlTile: any, WMSTile: any, LocalTile: any;
|
|
6
|
-
export default MapView;
|
|
1
|
+
export { default } from "./maps.web-component";
|
|
2
|
+
export * from "./maps.web-values";
|
|
7
3
|
//# sourceMappingURL=maps.web.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"maps.web.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/maps.web.
|
|
1
|
+
{"version":3,"file":"maps.web.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/maps.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
2
|
import { type RefreshControlProps, type StyleProp, type ViewStyle } from "react-native-web";
|
|
3
3
|
interface WebRefreshControlProps extends Omit<RefreshControlProps, "style"> {
|
|
4
|
-
children?:
|
|
4
|
+
children?: ReactNode;
|
|
5
5
|
style?: StyleProp<ViewStyle>;
|
|
6
6
|
}
|
|
7
7
|
export default function WebRefreshControl({ refreshing, tintColor, colors, style, progressViewOffset, children, onRefresh, enabled, }: WebRefreshControlProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"refresh-control-component.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/refresh-control-component.tsx"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"refresh-control-component.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/refresh-control-component.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAA+B,SAAS,EAAE,MAAM,OAAO,CAAC;AAIpE,OAAO,EAOL,KAAK,mBAAmB,EACxB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,kBAAkB,CAAC;AAE1B,UAAU,sBAAuB,SAAQ,IAAI,CAAC,mBAAmB,EAAE,OAAO,CAAC;IACzE,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAKD,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,UAAU,EACV,SAAS,EACT,MAAM,EACN,KAAK,EACL,kBAAkB,EAClB,QAAQ,EACR,SAAS,EACT,OAAO,GACR,EAAE,sBAAsB,2CA8IxB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secure-store.web.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/secure-store.web.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAC;AACnD,eAAO,MACL,kBAAkB,UAClB,mCAAmC,UACnC,MAAM,UACN,kCAAkC,UAClC,uBAAuB,UACvB,aAAa,UACb,8BAA8B,QACV,CAAC;AAEvB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kBAAkB,CAAC,EAAE,6BAA6B,CAAC;CACpD,CAAC;AAmBF,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAYzD;AAED,wBAAsB,eAAe,
|
|
1
|
+
{"version":3,"file":"secure-store.web.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/secure-store.web.ts"],"names":[],"mappings":"AAYA,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAC;AACnD,eAAO,MACL,kBAAkB,UAClB,mCAAmC,UACnC,MAAM,UACN,kCAAkC,UAClC,uBAAuB,UACvB,aAAa,UACb,8BAA8B,QACV,CAAC;AAEvB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,kBAAkB,CAAC,EAAE,6BAA6B,CAAC;CACpD,CAAC;AAmBF,wBAAsB,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC,CAYzD;AAED,wBAAsB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,GAAE,kBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEnG;AAED,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,GAAE,kBAAuB,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAEzG;AAED,wBAAsB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,kBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAO/G;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,GAAE,kBAAuB,GAAG,IAAI,CAO3F;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,GAAE,kBAAuB,GAAG,MAAM,GAAG,IAAI,CAErF;AAED,wBAAgB,6BAA6B,IAAI,OAAO,CAEvD"}
|
package/metro/index.js
CHANGED
|
@@ -15,12 +15,19 @@ function withRorkMetro(config) {
|
|
|
15
15
|
...config,
|
|
16
16
|
transformer: {
|
|
17
17
|
...config.transformer,
|
|
18
|
-
babelTransformerPath: require.resolve(
|
|
19
|
-
"@rork-ai/toolkit-sdk/metro-transformer",
|
|
20
|
-
),
|
|
18
|
+
babelTransformerPath: require.resolve("@rork-ai/toolkit-sdk/metro-transformer"),
|
|
21
19
|
},
|
|
22
20
|
resolver: {
|
|
23
21
|
...config.resolver,
|
|
22
|
+
// Expo SDK 56+ neutralizes `useWatchman` to null and @expo/metro-file-map
|
|
23
|
+
// defaults null to false, so Metro silently switches to the Node fs.watch
|
|
24
|
+
// fallback watcher. That watcher exhausts inotify watches on large projects
|
|
25
|
+
// (Metro crashes with ENOSPC at startup) and ignores the watchman
|
|
26
|
+
// `rork-ai` defer-state lock below. Watchman is installed in Rork
|
|
27
|
+
// sandboxes; when it is unavailable (e.g. an exported project run
|
|
28
|
+
// locally), Metro's capability check falls back to the Node watcher on
|
|
29
|
+
// its own. `??` keeps an explicit `useWatchman: false` opt-out working.
|
|
30
|
+
useWatchman: config.resolver?.useWatchman ?? true,
|
|
24
31
|
extraNodeModules: {
|
|
25
32
|
// whenever some lib does `require("assert")`
|
|
26
33
|
// it will get this package
|
|
@@ -53,25 +60,16 @@ function withRorkMetro(config) {
|
|
|
53
60
|
|
|
54
61
|
// Redirect react-native to our web polyfill on web platform
|
|
55
62
|
// This replaces RefreshControl with our web implementation
|
|
56
|
-
if (
|
|
57
|
-
moduleName === "react-native-web/dist/exports/RefreshControl" &&
|
|
58
|
-
platform === "web"
|
|
59
|
-
) {
|
|
63
|
+
if (moduleName === "react-native-web/dist/exports/RefreshControl" && platform === "web") {
|
|
60
64
|
return {
|
|
61
|
-
filePath: path.resolve(
|
|
62
|
-
libPath,
|
|
63
|
-
"polyfills/refresh-control-component.js",
|
|
64
|
-
),
|
|
65
|
+
filePath: path.resolve(libPath, "polyfills/refresh-control-component.js"),
|
|
65
66
|
type: "sourceFile",
|
|
66
67
|
};
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
// Redirect react-native to our web polyfill on web platform
|
|
70
71
|
// This replaces RefreshControl with our web implementation
|
|
71
|
-
if (
|
|
72
|
-
moduleName === "react-native-web/dist/exports/Alert" &&
|
|
73
|
-
platform === "web"
|
|
74
|
-
) {
|
|
72
|
+
if (moduleName === "react-native-web/dist/exports/Alert" && platform === "web") {
|
|
75
73
|
return {
|
|
76
74
|
filePath: path.resolve(libPath, "polyfills/alert.web.js"),
|
|
77
75
|
type: "sourceFile",
|
|
@@ -87,22 +85,10 @@ function withRorkMetro(config) {
|
|
|
87
85
|
},
|
|
88
86
|
watcher: {
|
|
89
87
|
...config.watcher,
|
|
90
|
-
additionalExts: Array.from(
|
|
91
|
-
new Set([
|
|
92
|
-
...(config.watcher?.additionalExts ?? []),
|
|
93
|
-
"env",
|
|
94
|
-
"local",
|
|
95
|
-
"development",
|
|
96
|
-
]),
|
|
97
|
-
),
|
|
88
|
+
additionalExts: Array.from(new Set([...(config.watcher?.additionalExts ?? []), "env", "local", "development"])),
|
|
98
89
|
watchman: {
|
|
99
90
|
...config.watcher?.watchman,
|
|
100
|
-
deferStates: Array.from(
|
|
101
|
-
new Set([
|
|
102
|
-
...(config.watcher?.watchman?.deferStates ?? []),
|
|
103
|
-
"rork-ai",
|
|
104
|
-
]),
|
|
105
|
-
),
|
|
91
|
+
deferStates: Array.from(new Set([...(config.watcher?.watchman?.deferStates ?? []), "rork-ai"])),
|
|
106
92
|
},
|
|
107
93
|
},
|
|
108
94
|
};
|
package/metro/transformer.js
CHANGED
|
@@ -3,36 +3,40 @@
|
|
|
3
3
|
* Uses simple string transformations to inject wrappers
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
const fs = require("fs");
|
|
7
|
-
const
|
|
6
|
+
const fs = require("fs/promises");
|
|
7
|
+
const { createRequire } = require("module");
|
|
8
8
|
|
|
9
|
-
const
|
|
9
|
+
const DEV_ENTRY_POINTS = new Map([
|
|
10
|
+
["53", "v53"],
|
|
11
|
+
["54", "v54"],
|
|
12
|
+
["57", "v57"],
|
|
13
|
+
]);
|
|
14
|
+
|
|
15
|
+
const TOOLKIT_WEB_AUTH_SENTINEL = "rork_web_delegated_auth";
|
|
16
|
+
const TOOLKIT_SECRET_ACCESS_PATTERN =
|
|
17
|
+
/process\.env(?:\.EXPO_PUBLIC_RORK_TOOLKIT_SECRET_KEY|\[["']EXPO_PUBLIC_RORK_TOOLKIT_SECRET_KEY["']\])/g;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Native bundles retain the project secret until attestation ships. Expo web
|
|
21
|
+
* previews instead compile a truthy non-secret placeholder; the HTML bootstrap
|
|
22
|
+
* replaces it with a short-lived delegated token before network calls.
|
|
23
|
+
*/
|
|
24
|
+
function replaceToolkitSecretForWeb(src, platform) {
|
|
25
|
+
if (platform !== "web") return src;
|
|
26
|
+
return src.replace(TOOLKIT_SECRET_ACCESS_PATTERN, JSON.stringify(TOOLKIT_WEB_AUTH_SENTINEL));
|
|
27
|
+
}
|
|
10
28
|
|
|
11
29
|
/**
|
|
12
|
-
*
|
|
13
|
-
* This approach works with all package managers (npm, yarn, pnpm)
|
|
30
|
+
* Selects the dev wrapper for the project's installed Expo SDK.
|
|
14
31
|
*/
|
|
15
|
-
function
|
|
32
|
+
async function getDevEntryPoint(expoPackagePath) {
|
|
16
33
|
try {
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
"node_modules",
|
|
21
|
-
"expo",
|
|
22
|
-
"package.json",
|
|
23
|
-
);
|
|
24
|
-
if (fs.existsSync(expoPackagePath)) {
|
|
25
|
-
const expoPackage = JSON.parse(fs.readFileSync(expoPackagePath, "utf8"));
|
|
26
|
-
const version = expoPackage.version;
|
|
27
|
-
if (version) {
|
|
28
|
-
if (version.startsWith("54.")) return "54";
|
|
29
|
-
if (version.startsWith("53.")) return "53";
|
|
30
|
-
}
|
|
31
|
-
}
|
|
34
|
+
const expoPackage = JSON.parse(await fs.readFile(expoPackagePath, "utf8"));
|
|
35
|
+
const sdk = /^(\d+)\./.exec(expoPackage.version)?.[1];
|
|
36
|
+
return DEV_ENTRY_POINTS.get(sdk) ?? "v53";
|
|
32
37
|
} catch {
|
|
33
|
-
|
|
38
|
+
return "v53";
|
|
34
39
|
}
|
|
35
|
-
return null;
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
/**
|
|
@@ -40,16 +44,14 @@ function detectExpoVersion() {
|
|
|
40
44
|
*/
|
|
41
45
|
function isRootLayout(filename) {
|
|
42
46
|
return (
|
|
43
|
-
(filename.includes("app/_layout.tsx") ||
|
|
44
|
-
filename.includes("app/_layout.js")) &&
|
|
45
|
-
!filename.includes("app/(") // Exclude grouped layouts
|
|
47
|
+
(filename.includes("app/_layout.tsx") || filename.includes("app/_layout.js")) && !filename.includes("app/(") // Exclude grouped layouts
|
|
46
48
|
);
|
|
47
49
|
}
|
|
48
50
|
|
|
49
51
|
/**
|
|
50
52
|
* Wraps the layout component with Rork providers
|
|
51
53
|
*/
|
|
52
|
-
function wrapLayoutWithProviders(src, environment) {
|
|
54
|
+
async function wrapLayoutWithProviders(src, environment, expoPackagePath) {
|
|
53
55
|
// Find the default export function
|
|
54
56
|
const defaultExportPattern = /export\s+default\s+function\s+(\w+)/;
|
|
55
57
|
const match = src.match(defaultExportPattern);
|
|
@@ -61,24 +63,16 @@ function wrapLayoutWithProviders(src, environment) {
|
|
|
61
63
|
const originalFunctionName = match[1];
|
|
62
64
|
|
|
63
65
|
// Remove the default keyword from the original function
|
|
64
|
-
let transformed = src.replace(
|
|
65
|
-
defaultExportPattern,
|
|
66
|
-
`function ${originalFunctionName}`,
|
|
67
|
-
);
|
|
66
|
+
let transformed = src.replace(defaultExportPattern, `function ${originalFunctionName}`);
|
|
68
67
|
|
|
69
68
|
const wrappers = [];
|
|
70
69
|
|
|
71
70
|
// Add RorkDevWrapper for development environment
|
|
72
71
|
if (environment === "development") {
|
|
73
|
-
|
|
74
|
-
const version = detectExpoVersion() || "53";
|
|
75
|
-
const devImport =
|
|
76
|
-
version === "54"
|
|
77
|
-
? "import { RorkDevWrapper } from '@rork-ai/toolkit-sdk/v54';"
|
|
78
|
-
: "import { RorkDevWrapper } from '@rork-ai/toolkit-sdk/v53';";
|
|
72
|
+
const entryPoint = await getDevEntryPoint(expoPackagePath);
|
|
79
73
|
|
|
80
74
|
wrappers.push({
|
|
81
|
-
import:
|
|
75
|
+
import: `import { RorkDevWrapper } from '@rork-ai/toolkit-sdk/${entryPoint}';`,
|
|
82
76
|
name: "RorkDevWrapper",
|
|
83
77
|
});
|
|
84
78
|
}
|
|
@@ -115,18 +109,19 @@ export default function RorkRootLayoutWrapper() {
|
|
|
115
109
|
}
|
|
116
110
|
|
|
117
111
|
async function transform(props) {
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
112
|
+
const expoPackagePath = require.resolve("expo/package.json", {
|
|
113
|
+
paths: [props.options?.projectRoot ?? process.cwd()],
|
|
114
|
+
});
|
|
115
|
+
const upstreamTransformer = createRequire(expoPackagePath)("@expo/metro-config/babel-transformer");
|
|
116
|
+
const environment = (props.options?.dev ?? process.env.NODE_ENV === "development") ? "development" : "production";
|
|
117
|
+
const secretSafeSrc = replaceToolkitSecretForWeb(props.src, props.options?.platform);
|
|
122
118
|
|
|
123
119
|
if (isRootLayout(props.filename)) {
|
|
124
|
-
const transformedSrc = wrapLayoutWithProviders(
|
|
120
|
+
const transformedSrc = await wrapLayoutWithProviders(secretSafeSrc, environment, expoPackagePath);
|
|
125
121
|
return upstreamTransformer.transform({ ...props, src: transformedSrc });
|
|
126
122
|
}
|
|
127
123
|
|
|
128
|
-
return upstreamTransformer.transform(props);
|
|
124
|
+
return upstreamTransformer.transform({ ...props, src: secretSafeSrc });
|
|
129
125
|
}
|
|
130
126
|
|
|
131
|
-
module.exports = { transform };
|
|
132
|
-
|
|
127
|
+
module.exports = { replaceToolkitSecretForWeb, transform };
|