@rork-ai/toolkit-sdk 0.2.36 → 0.2.38
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/lib/module/agent.js +1 -1
- package/lib/module/agent.js.map +1 -1
- package/lib/module/dev/sdk53/index.js +0 -1
- package/lib/module/dev/sdk53/index.js.map +1 -1
- package/lib/module/dev/sdk54/index.js +0 -1
- package/lib/module/dev/sdk54/index.js.map +1 -1
- package/lib/module/metro/index.js +25 -3
- package/lib/module/metro/index.js.map +1 -1
- package/lib/module/metro/transformer.js +9 -10
- package/lib/module/metro/transformer.js.map +1 -1
- package/lib/module/polyfills/alert.web.js +1 -3
- package/lib/module/polyfills/alert.web.js.map +1 -1
- package/lib/module/{polyfills.js → polyfills/fetch.js} +1 -1
- package/lib/module/polyfills/fetch.js.map +1 -0
- package/lib/module/polyfills/fetch.web.js +4 -0
- package/lib/module/polyfills/{alert.js.map → fetch.web.js.map} +1 -1
- package/lib/module/polyfills/haptics.web.js +0 -1
- package/lib/module/polyfills/haptics.web.js.map +1 -1
- package/lib/module/polyfills/maps.web.js +37 -0
- package/lib/module/polyfills/maps.web.js.map +1 -0
- package/lib/module/polyfills/refresh-control-component.js +155 -0
- package/lib/module/polyfills/refresh-control-component.js.map +1 -0
- package/lib/typescript/src/agent.d.ts +1 -1
- package/lib/typescript/src/agent.d.ts.map +1 -1
- package/lib/typescript/src/dev/sdk53/index.d.ts +0 -1
- package/lib/typescript/src/dev/sdk53/index.d.ts.map +1 -1
- package/lib/typescript/src/dev/sdk54/index.d.ts +0 -1
- package/lib/typescript/src/dev/sdk54/index.d.ts.map +1 -1
- package/lib/typescript/src/polyfills/alert.web.d.ts +2 -1
- package/lib/typescript/src/polyfills/alert.web.d.ts.map +1 -1
- package/lib/typescript/src/polyfills/fetch.d.ts +2 -0
- package/lib/typescript/src/polyfills/fetch.d.ts.map +1 -0
- package/lib/typescript/src/polyfills/fetch.web.d.ts +2 -0
- package/lib/typescript/src/polyfills/fetch.web.d.ts.map +1 -0
- package/lib/typescript/src/polyfills/haptics.web.d.ts.map +1 -1
- package/lib/typescript/src/polyfills/maps.web.d.ts +7 -0
- package/lib/typescript/src/polyfills/maps.web.d.ts.map +1 -0
- package/lib/typescript/src/polyfills/refresh-control-component.d.ts +9 -0
- package/lib/typescript/src/polyfills/refresh-control-component.d.ts.map +1 -0
- package/package.json +5 -13
- package/src/agent.ts +1 -1
- package/src/dev/sdk53/index.tsx +0 -2
- package/src/dev/sdk54/index.tsx +0 -2
- package/src/metro/index.js +35 -2
- package/src/metro/transformer.js +14 -11
- package/src/polyfills/alert.web.ts +1 -3
- package/src/polyfills/haptics.web.ts +0 -6
- package/src/polyfills/maps.web.tsx +42 -0
- package/src/polyfills/refresh-control-component.tsx +215 -0
- package/lib/module/polyfills/alert.js +0 -4
- package/lib/module/polyfills.js.map +0 -1
- package/lib/module/polyfills.web.js +0 -4
- package/lib/module/polyfills.web.js.map +0 -1
- package/lib/typescript/src/polyfills/alert.d.ts +0 -2
- package/lib/typescript/src/polyfills/alert.d.ts.map +0 -1
- package/lib/typescript/src/polyfills.d.ts +0 -2
- package/lib/typescript/src/polyfills.d.ts.map +0 -1
- package/lib/typescript/src/polyfills.web.d.ts +0 -2
- package/lib/typescript/src/polyfills.web.d.ts.map +0 -1
- package/src/polyfills/alert.ts +0 -1
- /package/src/{polyfills.ts → polyfills/fetch.ts} +0 -0
- /package/src/{polyfills.web.ts → polyfills/fetch.web.ts} +0 -0
package/lib/module/agent.js
CHANGED
|
@@ -6,7 +6,7 @@ import { fetch as expoFetch } from "expo/fetch";
|
|
|
6
6
|
import { useCallback, useMemo } from "react";
|
|
7
7
|
import * as z from "zod/v4";
|
|
8
8
|
import { BASE_URL, withBaseUrl } from "./api.js";
|
|
9
|
-
import "./polyfills";
|
|
9
|
+
import "./polyfills/fetch";
|
|
10
10
|
import { getPostHogClient } from "./analytics.js";
|
|
11
11
|
const AGENT_URL = withBaseUrl("/agent/chat");
|
|
12
12
|
export function createRorkTool(tool) {
|
package/lib/module/agent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["useChat","DefaultChatTransport","lastAssistantMessageIsCompleteWithToolCalls","fetch","expoFetch","useCallback","useMemo","z","BASE_URL","withBaseUrl","getPostHogClient","AGENT_URL","createRorkTool","tool","generateObject","params","capture","GENERATE_OBJECT_URL","URL","toString","result","method","body","JSON","stringify","messages","schema","toJSONSchema","data","json","parse","object","generateText","GENERATE_TEXT_URL","role","content","completion","useRorkAgent","options","addToolResult","rest","sendAutomaticallyWhen","transport","api","toolsEntries","Object","entries","tools","map","name","description","jsonSchema","zodSchema","fromEntries","onToolCall","toolCall","toolName","Error","dynamic","execute","input","toolCallId","output","m","parts","p","type","startsWith","toolPart","replace","undefined","filter","sendMessage","message","text"],"sourceRoot":"../../src","sources":["agent.ts"],"mappings":";;AAAA,SAASA,OAAO,QAA6B,eAAe;AAC5D,SACEC,oBAAoB,EACpBC,2CAA2C,QAGtC,IAAI;AACX,SAASC,KAAK,IAAIC,SAAS,QAAQ,YAAY;AAC/C,SAASC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAC5C,OAAO,KAAKC,CAAC,MAAM,QAAQ;AAE3B,SAASC,QAAQ,EAAEC,WAAW,QAAQ,UAAO;AAE7C,OAAO,
|
|
1
|
+
{"version":3,"names":["useChat","DefaultChatTransport","lastAssistantMessageIsCompleteWithToolCalls","fetch","expoFetch","useCallback","useMemo","z","BASE_URL","withBaseUrl","getPostHogClient","AGENT_URL","createRorkTool","tool","generateObject","params","capture","GENERATE_OBJECT_URL","URL","toString","result","method","body","JSON","stringify","messages","schema","toJSONSchema","data","json","parse","object","generateText","GENERATE_TEXT_URL","role","content","completion","useRorkAgent","options","addToolResult","rest","sendAutomaticallyWhen","transport","api","toolsEntries","Object","entries","tools","map","name","description","jsonSchema","zodSchema","fromEntries","onToolCall","toolCall","toolName","Error","dynamic","execute","input","toolCallId","output","m","parts","p","type","startsWith","toolPart","replace","undefined","filter","sendMessage","message","text"],"sourceRoot":"../../src","sources":["agent.ts"],"mappings":";;AAAA,SAASA,OAAO,QAA6B,eAAe;AAC5D,SACEC,oBAAoB,EACpBC,2CAA2C,QAGtC,IAAI;AACX,SAASC,KAAK,IAAIC,SAAS,QAAQ,YAAY;AAC/C,SAASC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAC5C,OAAO,KAAKC,CAAC,MAAM,QAAQ;AAE3B,SAASC,QAAQ,EAAEC,WAAW,QAAQ,UAAO;AAE7C,OAAO,mBAAmB;AAE1B,SAASC,gBAAgB,QAAQ,gBAAa;AAE9C,MAAMC,SAAS,GAAGF,WAAW,CAAC,aAAa,CAAC;AAQ5C,OAAO,SAASG,cAAcA,CAAsBC,IAAa,EAAW;EAC1E,OAAOA,IAAI;AACb;AAOA;AACA;AACA;AACA;;AAEA,OAAO,eAAeC,cAAcA,CAAsBC,MAGzD,EAAuB;EACtBL,gBAAgB,CAAC,CAAC,EAAEM,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAAC,CAAC;EACvD,MAAMC,mBAAmB,GAAG,IAAIC,GAAG,CAAC,aAAa,EAAEV,QAAQ,CAAC,CAACW,QAAQ,CAAC,CAAC;EACvE,MAAMC,MAAM,GAAG,MAAMjB,KAAK,CAACc,mBAAmB,EAAE;IAC9CI,MAAM,EAAE,MAAM;IACdC,IAAI,EAAEC,IAAI,CAACC,SAAS,CAAC;MACnBC,QAAQ,EAAEV,MAAM,CAACU,QAAQ;MACzBC,MAAM,EAAEnB,CAAC,CAACoB,YAAY,CAACZ,MAAM,CAACW,MAAM;IACtC,CAAC;EACH,CAAC,CAAC;EAEF,MAAME,IAAI,GAAG,MAAMR,MAAM,CAACS,IAAI,CAAC,CAAC;EAEhC,OAAOd,MAAM,CAACW,MAAM,CAACI,KAAK,CAACF,IAAI,CAACG,MAAM,CAAC;AACzC;AAEA,OAAO,eAAeC,YAAYA,CAChCjB,MAAiE,EAChD;EACjBL,gBAAgB,CAA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QAEA,OAAOc,SAAS;MAClB,CAAC,CAAC,CACDC,MAAM,CAAEN,CAAC,IAAKA,CAAC,KAAKK,SAAS,CAAC;MAEjC,OAAO;QAAE,GAAGP,CAAC;QAAEC;MAAM,CAAC;IACxB,CAAC,CAAC;EACJ,CAAC,EAAE,CAACxB,IAAI,CAACf,QAAQ,CAAC,CAAC;EAEnB,MAAM+C,WAAW,GAAGnE,WAAW,CAC5BoE,OAAwD,IAAK;IAC5D/D,gBAAgB,CAAC,CAAC,EAAEM,OAAO,CAAC,6BAA6B,EAAE,CAAC,CAAC,CAAC;IAC9D,IAAI,OAAOyD,OAAO,KAAK,QAAQ,EAAE;MAC/BjC,IAAI,CAACgC,WAAW,CAAC;QACfE,IAAI,EAAED;MACR,CAAC,CAAC;IACJ,CAAC,MAAM;MACLjC,IAAI,CAACgC,WAAW,CAACC,OAAO,CAAC;IAC3B;EACF,CAAC,EACD,CAACjC,IAAI,CACP,CAAC;EAED,OAAO;IACL,GAAGA,IAAI;IACPgC,WAAW;IACX/C,QAAQ;IACRc;EACF,CAAC;AACH","ignoreList":[]}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { RorkErrorBoundary } from "../error-boundary.js";
|
|
4
4
|
import { RorkSafeInsets } from "../safe-insets-content";
|
|
5
5
|
import { BundleInspector } from "./inspector";
|
|
6
|
-
import "../../polyfills/alert";
|
|
7
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
7
|
export function RorkDevWrapper({
|
|
9
8
|
children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RorkErrorBoundary","RorkSafeInsets","BundleInspector","jsx","_jsx","RorkDevWrapper","children"],"sourceRoot":"../../../../src","sources":["dev/sdk53/index.tsx"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,sBAAmB;AACrD,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,eAAe,QAAQ,aAAa;
|
|
1
|
+
{"version":3,"names":["RorkErrorBoundary","RorkSafeInsets","BundleInspector","jsx","_jsx","RorkDevWrapper","children"],"sourceRoot":"../../../../src","sources":["dev/sdk53/index.tsx"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,sBAAmB;AACrD,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,eAAe,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE9C,OAAO,SAASC,cAAcA,CAAC;EAAEC;AAAwC,CAAC,EAAE;EAC1E,oBACEF,IAAA,CAACJ,iBAAiB;IAAAM,QAAA,eAChBF,IAAA,CAACF,eAAe;MAAAI,QAAA,eACdF,IAAA,CAACH,cAAc;QAAAK,QAAA,EAAEA;MAAQ,CAAiB;IAAC,CAC5B;EAAC,CACD,CAAC;AAExB","ignoreList":[]}
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import { RorkErrorBoundary } from "../error-boundary.js";
|
|
4
4
|
import { RorkSafeInsets } from "../safe-insets-content";
|
|
5
5
|
import { BundleInspector } from "./inspector";
|
|
6
|
-
import "../../polyfills/alert";
|
|
7
6
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
7
|
export function RorkDevWrapper({
|
|
9
8
|
children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RorkErrorBoundary","RorkSafeInsets","BundleInspector","jsx","_jsx","RorkDevWrapper","children"],"sourceRoot":"../../../../src","sources":["dev/sdk54/index.tsx"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,sBAAmB;AACrD,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,eAAe,QAAQ,aAAa;
|
|
1
|
+
{"version":3,"names":["RorkErrorBoundary","RorkSafeInsets","BundleInspector","jsx","_jsx","RorkDevWrapper","children"],"sourceRoot":"../../../../src","sources":["dev/sdk54/index.tsx"],"mappings":";;AAAA,SAASA,iBAAiB,QAAQ,sBAAmB;AACrD,SAASC,cAAc,QAAQ,wBAAwB;AACvD,SAASC,eAAe,QAAQ,aAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE9C,OAAO,SAASC,cAAcA,CAAC;EAAEC;AAAwC,CAAC,EAAE;EAC1E,oBACEF,IAAA,CAACJ,iBAAiB;IAAAM,QAAA,eAChBF,IAAA,CAACF,eAAe;MAAAI,QAAA,eACdF,IAAA,CAACH,cAAc;QAAAK,QAAA,EAAEA;MAAQ,CAAiB;IAAC,CAC5B;EAAC,CACD,CAAC;AAExB","ignoreList":[]}
|
|
@@ -28,12 +28,34 @@ function withRorkMetro(config) {
|
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
//
|
|
31
|
+
// Redirect react-native-maps to our web polyfill on web platform
|
|
32
|
+
if (moduleName === "react-native-maps" && platform === "web") {
|
|
33
|
+
return {
|
|
34
|
+
filePath: path.resolve(libPath, "polyfills/maps.web.js"),
|
|
35
|
+
type: "sourceFile"
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// Redirect react-native to our web polyfill on web platform
|
|
40
|
+
// This replaces RefreshControl with our web implementation
|
|
41
|
+
if (moduleName === "react-native-web/dist/exports/RefreshControl" && platform === "web") {
|
|
42
|
+
return {
|
|
43
|
+
filePath: path.resolve(libPath, "polyfills/refresh-control-component.js"),
|
|
44
|
+
type: "sourceFile"
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Redirect react-native to our web polyfill on web platform
|
|
49
|
+
// This replaces RefreshControl with our web implementation
|
|
50
|
+
if (moduleName === "react-native-web/dist/exports/Alert" && platform === "web") {
|
|
51
|
+
return {
|
|
52
|
+
filePath: path.resolve(libPath, "polyfills/alert.web.js"),
|
|
53
|
+
type: "sourceFile"
|
|
54
|
+
};
|
|
55
|
+
}
|
|
32
56
|
if (originalResolveRequest) {
|
|
33
57
|
return originalResolveRequest(context, moduleName, platform);
|
|
34
58
|
}
|
|
35
|
-
|
|
36
|
-
// Fall back to default resolution
|
|
37
59
|
return context.resolveRequest(context, moduleName, platform);
|
|
38
60
|
}
|
|
39
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["path","require","libPath","resolve","__dirname","withRorkMetro","config","originalResolveRequest","resolver","resolveRequest","transformer","babelTransformerPath","context","moduleName","platform","filePath","type","module","exports"],"sourceRoot":"../../../src","sources":["metro/index.js"],"mappings":";;AAAA,MAAMA,IAAI,GAAGC,OAAO,CAAC,MAAM,CAAC;;AAE5B;AACA;AACA;AACA;AACA;;AAEA,MAAMC,OAAO,GAAGF,IAAI,CAACG,OAAO,CAACC,SAAS,EAAE,mBAAmB,CAAC;AAE5D,SAASC,aAAaA,CAACC,MAAM,EAAE;EAC7B,MAAMC,sBAAsB,GAAGD,MAAM,CAACE,QAAQ,EAAEC,cAAc;EAE9D,OAAO;IACL,GAAGH,MAAM;IACTI,WAAW,EAAE;MACX,GAAGJ,MAAM,CAACI,WAAW;MACrBC,oBAAoB,EAAEV,OAAO,CAACE,OAAO,CACnC,wCACF;IACF,CAAC;IACDK,QAAQ,EAAE;MACR,GAAGF,MAAM,CAACE,QAAQ;MAClBC,cAAc,EAAEA,CAACG,OAAO,EAAEC,UAAU,EAAEC,QAAQ,KAAK;QACjD;QACA,IAAID,UAAU,KAAK,cAAc,IAAIC,QAAQ,KAAK,KAAK,EAAE;UACvD,OAAO;YACLC,QAAQ,EAAEf,IAAI,CAACG,OAAO,CAACD,OAAO,EAAE,0BAA0B,CAAC;YAC3Dc,IAAI,EAAE;UACR,CAAC;QACH;;QAEA;QACA,IAAIT,sBAAsB,EAAE;UAC1B,OAAOA,sBAAsB,CAACK,OAAO,EAAEC,UAAU,EAAEC,QAAQ,CAAC;QAC9D
|
|
1
|
+
{"version":3,"names":["path","require","libPath","resolve","__dirname","withRorkMetro","config","originalResolveRequest","resolver","resolveRequest","transformer","babelTransformerPath","context","moduleName","platform","filePath","type","module","exports"],"sourceRoot":"../../../src","sources":["metro/index.js"],"mappings":";;AAAA,MAAMA,IAAI,GAAGC,OAAO,CAAC,MAAM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QACH;QAEA,IAAIT,sBAAsB,EAAE;UAC1B,OAAOA,sBAAsB,CAACK,OAAO,EAAEC,UAAU,EAAEC,QAAQ,CAAC;QAC9D;QAEA,OAAOF,OAAO,CAACH,cAAc,CAACG,OAAO,EAAEC,UAAU,EAAEC,QAAQ,CAAC;MAC9D;IACF;EACF,CAAC;AACH;AAEAG,MAAM,CAACC,OAAO,GAAG;EAAEb;AAAc,CAAC","ignoreList":[]}
|
|
@@ -10,20 +10,19 @@ const path = require("path");
|
|
|
10
10
|
const upstreamTransformer = require("@expo/metro-config/babel-transformer");
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
|
-
* Detects the Expo SDK version from package
|
|
13
|
+
* Detects the Expo SDK version from the installed expo package
|
|
14
|
+
* This approach works with all package managers (npm, yarn, pnpm)
|
|
14
15
|
*/
|
|
15
16
|
function detectExpoVersion() {
|
|
16
17
|
try {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
const
|
|
21
|
-
const version =
|
|
18
|
+
// Read version from installed expo package (works with pnpm, npm, yarn)
|
|
19
|
+
const expoPackagePath = path.join(process.cwd(), "node_modules", "expo", "package.json");
|
|
20
|
+
if (fs.existsSync(expoPackagePath)) {
|
|
21
|
+
const expoPackage = JSON.parse(fs.readFileSync(expoPackagePath, "utf8"));
|
|
22
|
+
const version = expoPackage.version;
|
|
22
23
|
if (version) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (cleanVersion.startsWith("54.")) return "54";
|
|
26
|
-
if (cleanVersion.startsWith("53.")) return "53";
|
|
24
|
+
if (version.startsWith("54.")) return "54";
|
|
25
|
+
if (version.startsWith("53.")) return "53";
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
28
|
} catch {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["fs","require","path","upstreamTransformer","detectExpoVersion","
|
|
1
|
+
{"version":3,"names":["fs","require","path","upstreamTransformer","detectExpoVersion","expoPackagePath","join","process","cwd","existsSync","expoPackage","JSON","parse","readFileSync","version","startsWith","isRootLayout","filename","includes","wrapLayoutWithProviders","src","environment","defaultExportPattern","match","originalFunctionName","transformed","replace","wrappers","devImport","push","import","name","wrapper","wrappedComponent","newDefaultExport","transform","props","options","dev","env","NODE_ENV","transformedSrc","module","exports"],"sourceRoot":"../../../src","sources":["metro/transformer.js"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,MAAMA,EAAE,GAAGC,OAAO,CAAC,IAAI,CAAC;AACxB,MAAMC,IAAI,GAAGD,OAAO,CAAC,MAAM,CAAC;AAE5B,MAAME,mBAAmB,GAAGF,OAAO,CAAC,sCAAsC,CAAC;;AAE3E;AACA;AACA;AACA;AACA,SAASG,iBAAiBA,CAAA,EAAG;EAC3B,IAAI;IACF;IACA,MAAMC,eAAe,GAAGH,IAAI,CAACI,IAAI,CAC/BC,OAAO,CAACC,GAAG,CAAC,CAAC,EACb,cAAc,EACd,MAAM,EACN,cACF,CAAC;IACD,IAAIR,EAAE,CAACS,UAAU,CAACJ,eAAe,CAAC,EAAE;MAClC,MAAMK,WAAW,GAAGC,IAAI,CAACC,KAAK,CAACZ,EAAE,CAACa,YAAY,CAACR,eAAe,EAAE,MAAM,CAAC,CAAC;MACxE,MAAMS,OAAO,GAAGJ,WAAW,CAACI,OAAO;MACnC,IAAIA,OAAO,EAAE;QACX,IAAIA,OAAO,CAACC,UAAU,CAAC,KAAK,CAAC,EAAE,OAAO,IAAI;QAC1C,IAAID,OAAO,CAACC,UAAU,CAAC,KAAK,CAAC,EAAE,OAAO,IAAI;MAC5C;IACF;EACF,CAAC,CAAC,MAAM;IACN;EAAA;EAEF,OAAO,IAAI;AACb;;AAEA;AACA;AACA;AACA,SAASC,YAAYA,CAACC,QAAQ,EAAE;EAC9B,OACE,CAACA,QAAQ,CAACC,QAAQ,CAAC,iBAAiB,CAAC,IACnCD,QAAQ,CAACC,QAAQ,CAAC,gBAAgB,CAAC,KACrC,CAACD,QAAQ,CAACC,QAAQ,CAAC,OA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gB;AACtB;AACA;AACA,CAAC;EAECR,WAAW,GAAGA,WAAW,GAAG,IAAI,GAAGS,gBAAgB;EAEnD,OAAOT,WAAW;AACpB;AAEA,eAAeU,SAASA,CAACC,KAAK,EAAE;EAC9B,MAAMf,WAAW,GACde,KAAK,CAACC,OAAO,EAAEC,GAAG,IAAI/B,OAAO,CAACgC,GAAG,CAACC,QAAQ,KAAK,aAAa,GACzD,aAAa,GACb,YAAY;EAElB,IAAIxB,YAAY,CAACoB,KAAK,CAACnB,QAAQ,CAAC,EAAE;IAChC,MAAMwB,cAAc,GAAGtB,uBAAuB,CAACiB,KAAK,CAAChB,GAAG,EAAEC,WAAW,CAAC;IACtE,OAAOlB,mBAAmB,CAACgC,SAAS,CAAC;MAAE,GAAGC,KAAK;MAAEhB,GAAG,EAAEqB;IAAe,CAAC,CAAC;EACzE;EAEA,OAAOtC,mBAAmB,CAACgC,SAAS,CAACC,KAAK,CAAC;AAC7C;AAEAM,MAAM,CAACC,OAAO,GAAG;EAAER;AAAU,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AlertNew"
|
|
1
|
+
{"version":3,"names":["AlertNew"],"sourceRoot":"../../../src","sources":["polyfills/alert.web.ts"],"mappings":";;AAAA,OAAOA,QAAQ,MAAM,kCAAkC;AAEvD,eAAeA,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["TextDecoderStream","TextEncoderStream","structuredClone","polyfillGlobal","globalThis","console","log"],"sourceRoot":"../../../src","sources":["polyfills/fetch.ts"],"mappings":";;AAAA,SACEA,iBAAiB,EACjBC,iBAAiB,QACZ,kCAAkC;AACzC,OAAOC,eAAe,MAAM,yBAAyB;AACrD;AACA,SAASC,cAAc,QAAQ,oDAAoD;AAEnF,IAAI,EAAE,iBAAiB,IAAIC,UAAU,CAAC,EAAE;EACtCC,OAAO,CAACC,GAAG,CAAC,6BAA6B,CAAC;EAC1CH,cAAc,CAAC,iBAAiB,EAAE,MAAMD,eAAe,CAAC;AAC1D;AACAC,cAAc,CAAC,mBAAmB,EAAE,MAAMF,iBAAiB,CAAC;AAC5DE,cAAc,CAAC,mBAAmB,EAAE,MAAMH,iBAAiB,CAAC;AAE5D","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["polyfills/
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["polyfills/fetch.web.ts"],"mappings":";;AAAA","ignoreList":[]}
|
|
@@ -31,7 +31,6 @@ const vibrationPatterns = {
|
|
|
31
31
|
selection: [50]
|
|
32
32
|
};
|
|
33
33
|
function isVibrationAvailable() {
|
|
34
|
-
console.log("isVibrationAvailable", typeof window !== "undefined" && "navigator" in window && "vibrate" in navigator);
|
|
35
34
|
return typeof window !== "undefined" && "navigator" in window && "vibrate" in navigator;
|
|
36
35
|
}
|
|
37
36
|
export async function selectionAsync() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NotificationFeedbackType","ImpactFeedbackStyle","vibrationPatterns","Success","Warning","Error","Light","Medium","Heavy","Soft","Rigid","selection","isVibrationAvailable","
|
|
1
|
+
{"version":3,"names":["NotificationFeedbackType","ImpactFeedbackStyle","vibrationPatterns","Success","Warning","Error","Light","Medium","Heavy","Soft","Rigid","selection","isVibrationAvailable","window","navigator","selectionAsync","vibrate","notificationAsync","type","impactAsync","style"],"sourceRoot":"../../../src","sources":["polyfills/haptics.web.ts"],"mappings":";;AAAA;AACA;AACA;AACA;;AAEA,WAAYA,wBAAwB,0BAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAxBA,wBAAwB;EAAA,OAAxBA,wBAAwB;AAAA;AAMpC,WAAYC,mBAAmB,0BAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAnBA,mBAAmB;EAAA,OAAn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,CAAC,CAAC,EAAE;IAC3B;EACF;EACAE,SAAS,CAACE,OAAO,CAACd,iBAAiB,CAACkB,KAAK,CAAC,CAAC;AAC7C","ignoreList":[]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
import WebMapView, * as WebMaps from "@teovilla/react-native-web-maps";
|
|
5
|
+
import React from "react";
|
|
6
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
7
|
+
export const PROVIDER_GOOGLE = "google";
|
|
8
|
+
export const PROVIDER_DEFAULT = undefined;
|
|
9
|
+
const GOOGLE_MAPS_API_KEY = process.env.EXPO_PUBLIC_GOOGLE_MAPS_API_KEY;
|
|
10
|
+
const MapView = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
11
|
+
return /*#__PURE__*/_jsx(WebMapView, {
|
|
12
|
+
ref: ref,
|
|
13
|
+
googleMapsApiKey: GOOGLE_MAPS_API_KEY,
|
|
14
|
+
...props,
|
|
15
|
+
provider: PROVIDER_GOOGLE
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
MapView.displayName = "MapView";
|
|
19
|
+
Object.assign(MapView, {
|
|
20
|
+
...WebMaps,
|
|
21
|
+
PROVIDER_GOOGLE,
|
|
22
|
+
PROVIDER_DEFAULT
|
|
23
|
+
});
|
|
24
|
+
export const {
|
|
25
|
+
Marker,
|
|
26
|
+
Callout,
|
|
27
|
+
Polyline,
|
|
28
|
+
Polygon,
|
|
29
|
+
Circle,
|
|
30
|
+
Overlay,
|
|
31
|
+
Heatmap,
|
|
32
|
+
UrlTile,
|
|
33
|
+
WMSTile,
|
|
34
|
+
LocalTile
|
|
35
|
+
} = WebMaps;
|
|
36
|
+
export default MapView;
|
|
37
|
+
//# sourceMappingURL=maps.web.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["WebMapView","WebMaps","React","jsx","_jsx","PROVIDER_GOOGLE","PROVIDER_DEFAULT","undefined","GOOGLE_MAPS_API_KEY","process","env","EXPO_PUBLIC_GOOGLE_MAPS_API_KEY","MapView","forwardRef","props","ref","googleMapsApiKey","provider","displayName","Object","assign","Marker","Callout","Polyline","Polygon","Circle","Overlay","Heatmap","UrlTile","WMSTile","LocalTile"],"sourceRoot":"../../../src","sources":["polyfills/maps.web.tsx"],"mappings":";;AAAA;AACA,OAAOA,UAAU,EAAE,KAAKC,OAAO,MAAM,iCAAiC;AACtE,OAAOC,KAAK,MAAM,OAAO;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE1B,OAAO,MAAMC,eAAe,GAAG,QAAQ;AACvC,OAAO,MAAMC,gBAAgB,GAAGC,SAAS;AAEzC,MAAMC,mBAAmB,GAAGC,OAAO,CAACC,GAAG,CAACC,+BAA+B;AAEvE,MAAMC,OAAO,gBAAGV,KAAK,CAACW,UAAU,CAAC,CAACC,KAAK,EAAEC,GAAG,KAAK;EAC/C,oBACEX,IAAA,CAACJ,UAAU;IACTe,GAAG,EAAEA,GAAI;IACTC,gBAAgB,EAAER,mBAAoB;IAAA,GAClCM,KAAK;IACTG,QAAQ,EAAEZ;EAAgB,CAC3B,CAAC;AAEN,CAAC,CAAC;AAEFO,OAAO,CAACM,WAAW,GAAG,SAAS;AAE/BC,MAAM,CAACC,MAAM,CAACR,OAAO,EAAE;EACrB,GAAGX,OAAO;EACVI,eAAe;EACfC;AACF,CAAC,CAAC;AAEF,OAAO,MAAM;EACXe,MAAM;EACNC,OAAO;EACPC,QAAQ;EACRC,OAAO;EACPC,MAAM;EACNC,OAAO;EACPC,OAAO;EACPC,OAAO;EACPC,OAAO;EACPC;AACF,CAAC,GAAG7B,OAAO;AAEX,eAAeW,OAAO","ignoreList":[]}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
// @ts-nocheck
|
|
4
|
+
import React, { useCallback, useEffect, useMemo, useRef } from "react";
|
|
5
|
+
// Import from react-native-web directly to avoid infinite loop
|
|
6
|
+
// (metro redirects "react-native" to our polyfill on web)
|
|
7
|
+
import { ActivityIndicator, Animated, PanResponder, View } from "react-native-web";
|
|
8
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
|
+
export default function WebRefreshControl({
|
|
10
|
+
refreshing,
|
|
11
|
+
tintColor,
|
|
12
|
+
colors,
|
|
13
|
+
style,
|
|
14
|
+
progressViewOffset,
|
|
15
|
+
children,
|
|
16
|
+
onRefresh,
|
|
17
|
+
enabled
|
|
18
|
+
}) {
|
|
19
|
+
const onRefreshRef = useRef(onRefresh);
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
onRefreshRef.current = onRefresh;
|
|
22
|
+
}, [onRefresh]);
|
|
23
|
+
const enabledRef = useRef(enabled);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
enabledRef.current = enabled;
|
|
26
|
+
}, [enabled]);
|
|
27
|
+
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
|
+
const containerRef = useRef(null);
|
|
30
|
+
const pullPosReachedState = useRef(0);
|
|
31
|
+
const pullDownSwipeMargin = useRef(new Animated.Value(0));
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
Animated.timing(pullDownSwipeMargin.current, {
|
|
34
|
+
toValue: refreshing ? 50 : 0,
|
|
35
|
+
duration: 350,
|
|
36
|
+
useNativeDriver: false
|
|
37
|
+
}).start();
|
|
38
|
+
if (refreshing) {
|
|
39
|
+
pullPosReachedState.current = 0;
|
|
40
|
+
}
|
|
41
|
+
}, [refreshing]);
|
|
42
|
+
const onPanResponderFinish = useCallback(() => {
|
|
43
|
+
if (pullPosReachedState.current && onRefreshRef.current) {
|
|
44
|
+
onRefreshRef.current();
|
|
45
|
+
}
|
|
46
|
+
if (!pullPosReachedState.current) {
|
|
47
|
+
Animated.timing(pullDownSwipeMargin.current, {
|
|
48
|
+
toValue: 0,
|
|
49
|
+
duration: 350,
|
|
50
|
+
useNativeDriver: false
|
|
51
|
+
}).start();
|
|
52
|
+
}
|
|
53
|
+
}, []);
|
|
54
|
+
const panResponder = useRef(PanResponder.create({
|
|
55
|
+
onStartShouldSetPanResponder: () => false,
|
|
56
|
+
onStartShouldSetPanResponderCapture: () => false,
|
|
57
|
+
onMoveShouldSetPanResponder: (_, gestureState) => {
|
|
58
|
+
if (!containerRef.current) return false;
|
|
59
|
+
// React 19 fix: use direct DOM traversal instead of findNodeHandle
|
|
60
|
+
const scrollContainer = containerRef.current?.firstChild;
|
|
61
|
+
if (!scrollContainer) return false;
|
|
62
|
+
return scrollContainer.scrollTop === 0 && Math.abs(gestureState.dy) > Math.abs(gestureState.dx) * 2 && Math.abs(gestureState.vy) > Math.abs(gestureState.vx) * 2.5;
|
|
63
|
+
},
|
|
64
|
+
onMoveShouldSetPanResponderCapture: () => false,
|
|
65
|
+
onPanResponderMove: (_, gestureState) => {
|
|
66
|
+
if (enabledRef.current !== undefined && !enabledRef.current) return;
|
|
67
|
+
const adjustedDy = gestureState.dy <= 0 ? 0 : gestureState.dy * 150 / (gestureState.dy + 120); // Diminishing returns function
|
|
68
|
+
pullDownSwipeMargin.current.setValue(adjustedDy);
|
|
69
|
+
const newValue = adjustedDy > 45 ? 1 : 0;
|
|
70
|
+
if (newValue !== pullPosReachedState.current) {
|
|
71
|
+
pullPosReachedState.current = newValue;
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
onPanResponderTerminationRequest: () => true,
|
|
75
|
+
onPanResponderRelease: onPanResponderFinish,
|
|
76
|
+
onPanResponderTerminate: onPanResponderFinish
|
|
77
|
+
}));
|
|
78
|
+
const refreshIndicatorColor = useMemo(() => tintColor ? tintColor : colors && colors.length ? colors[0] : null, [colors, tintColor]);
|
|
79
|
+
const containerStyle = useMemo(() => [style,
|
|
80
|
+
// @ts-ignore - overflowY is valid on web
|
|
81
|
+
{
|
|
82
|
+
overflowY: "hidden",
|
|
83
|
+
overflow: "hidden",
|
|
84
|
+
paddingTop: progressViewOffset
|
|
85
|
+
}], [progressViewOffset, style]);
|
|
86
|
+
const indicatorTransformStyle = useMemo(() => ({
|
|
87
|
+
alignSelf: "center",
|
|
88
|
+
justifyContent: "center",
|
|
89
|
+
alignItems: "center",
|
|
90
|
+
marginTop: -40,
|
|
91
|
+
height: 40,
|
|
92
|
+
transform: [{
|
|
93
|
+
translateY: pullDownSwipeMargin.current
|
|
94
|
+
}]
|
|
95
|
+
}), []);
|
|
96
|
+
|
|
97
|
+
// This is messing with react-native-web's internal implementation
|
|
98
|
+
// Will probably break if anything changes on their end
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
100
|
+
const AnimatedContentContainer = useMemo(() => {
|
|
101
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
102
|
+
const childElement = children;
|
|
103
|
+
if (!childElement?.props?.children?.type) return null;
|
|
104
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
105
|
+
return withAnimated(childProps => /*#__PURE__*/React.createElement(childElement.props.children.type, childProps));
|
|
106
|
+
}, [children]);
|
|
107
|
+
|
|
108
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
109
|
+
const childElement = children;
|
|
110
|
+
const newContentContainerStyle = useMemo(() => [childElement?.props?.children?.props?.style, {
|
|
111
|
+
transform: [{
|
|
112
|
+
translateY: pullDownSwipeMargin.current
|
|
113
|
+
}]
|
|
114
|
+
}], [childElement?.props?.children?.props?.style]);
|
|
115
|
+
if (!childElement || !AnimatedContentContainer) {
|
|
116
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
117
|
+
children: children
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
const newChildren = /*#__PURE__*/React.cloneElement(childElement, {}, /*#__PURE__*/_jsxs(_Fragment, {
|
|
121
|
+
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
122
|
+
style: indicatorTransformStyle,
|
|
123
|
+
children: /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
124
|
+
color: refreshIndicatorColor || "#999999",
|
|
125
|
+
size: "small"
|
|
126
|
+
})
|
|
127
|
+
}), /*#__PURE__*/_jsx(AnimatedContentContainer, {
|
|
128
|
+
...childElement.props.children.props,
|
|
129
|
+
style: newContentContainerStyle
|
|
130
|
+
})]
|
|
131
|
+
}));
|
|
132
|
+
return /*#__PURE__*/_jsx(View, {
|
|
133
|
+
ref: containerRef,
|
|
134
|
+
style: containerStyle,
|
|
135
|
+
...panResponder.current.panHandlers,
|
|
136
|
+
children: newChildren
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
141
|
+
function withAnimated(WrappedComponent) {
|
|
142
|
+
const displayName = WrappedComponent.displayName || WrappedComponent.name || "Component";
|
|
143
|
+
|
|
144
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
145
|
+
class WithAnimated extends React.Component {
|
|
146
|
+
static displayName = `WithAnimated(${displayName})`;
|
|
147
|
+
render() {
|
|
148
|
+
return /*#__PURE__*/_jsx(WrappedComponent, {
|
|
149
|
+
...this.props
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return Animated.createAnimatedComponent(WithAnimated);
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=refresh-control-component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useCallback","useEffect","useMemo","useRef","ActivityIndicator","Animated","PanResponder","View","Fragment","_Fragment","jsx","_jsx","jsxs","_jsxs","WebRefreshControl","refreshing","tintColor","colors","style","progressViewOffset","children","onRefresh","enabled","onRefreshRef","current","enabledRef","containerRef","pullPosReachedState","pullDownSwipeMargin","Value","timing","toValue","duration","useNativeDriver","start","onPanResponderFinish","panResponder","create","onStartShouldSetPanResponder","onStartShouldSetPanResponderCapture","onMoveShouldSetPanResponder","_","gestureState","scrollContainer","firstChild","scrollTop","Math","abs","dy","dx","vy","vx","onMoveShouldSetPanResponderCapture","onPanResponderMove","undefined","adjustedDy","setValue","newValue","onPanResponderTerminationRequest","onPanResponderRelease","onPanResponderTerminate","refreshIndicatorColor","length","containerStyle","overflowY","overflow","paddingTop","indicatorTransformStyle","alignSelf","justifyContent","alignItems","marginTop","height","transform","translateY","AnimatedContentContainer","childElement","props","type","withAnimated","childProps","createElement","newContentContainerStyle","newChildren","cloneElement","color","size","ref","panHandlers","WrappedComponent","displayName","name","WithAnimated","Component","render","createAnimatedComponent"],"sourceRoot":"../../../src","sources":["polyfills/refresh-control-component.tsx"],"mappings":";;AAAA;AACA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ,OAAO;AACtE;AACA;AACA,SACEC,iBAAiB,EACjBC,QAAQ,EACRC,YAAY,EACZC,IAAI,QAMC,kBAAkB;AAAC,SAAAC,QAAA,IAAAC,SAAA,EAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAO1B,eAAe,SAASC,iBAAiBA,CAAC;EACxCC,UAAU;EACVC,SAAS;EACTC,MAAM;EACNC,KAAK;EACLC,kBAAkB;EAClBC,QAAQ;EACRC,SAAS;EACTC;AACsB,CAAC,EAAE;EACzB,MAAMC,YAAY,GAAGpB,MAAM,CAACkB,SAAS,CAAC;EACtCpB,SAAS,CAAC,MAAM;IACdsB,YAAY,CAACC,OAAO,GAAGH,SAAS;EAClC,CAAC,EAAE,CAACA,SAAS,CAAC,CAAC;EACf,MAAMI,UAAU,GAAGtB,MAAM,CAACmB,OAAO,CAAC;EAClCrB,SAAS,CAAC,MAAM;IACdwB,UAAU,CAACD,OAAO,GAAGF,OAAO;EAC9B,CAAC,EAAE,CAACA,OAAO,CAAC,CAAC;;EAEb;EACA,MAAMI,YAAY,GAAGvB,MAAM,CAAM,IAAI,CAAC;EACtC,MAAMwB,mBAAmB,GAAGxB,MAAM,CAAC,CAAC,CAAC;EACrC,MAAMyB,m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version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,IAAI,CAAC;AAGZ,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAI5B,OAAO,
|
|
1
|
+
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../src/agent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,cAAc,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAIL,KAAK,SAAS,EACf,MAAM,IAAI,CAAC;AAGZ,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAI5B,OAAO,mBAAmB,CAAC;AAM3B,KAAK,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,OAAO,IAAI;IAC3C,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,CAAC,CAAC;IACb,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;CAC3D,CAAC;AAEF,wBAAgB,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,CAE1E;AAED,KAAK,QAAQ,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAC/C,KAAK,SAAS,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAClD,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,CAAC,QAAQ,GAAG,SAAS,CAAC,EAAE,CAAA;CAAE,CAAC;AAChF,KAAK,gBAAgB,GAAG;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,EAAE,CAAA;CAAE,CAAC;AAO5E,wBAAsB,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE;IAChE,QAAQ,EAAE,CAAC,WAAW,GAAG,gBAAgB,CAAC,EAAE,CAAC;IAC7C,MAAM,EAAE,CAAC,CAAC;CACX,GAAG,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CActB;AAED,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,GAAG;IAAE,QAAQ,EAAE,CAAC,WAAW,GAAG,gBAAgB,CAAC,EAAE,CAAA;CAAE,GAChE,OAAO,CAAC,MAAM,CAAC,CAejB;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,EACpE,OAAO,EAAE,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC,GAAG;IACtD,KAAK,EAAE,CAAC,CAAC;CACV;2BAyEW,MAAM,GAAG,UAAU;;;;;;;;;;;;;;;;;;+EAAyB,CAAC,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAoB69+I,GAAI,SAAS,CAAC;iBAAqB,CAAC;;0BAA0J,CAAC;;;;;;;;;;;;;;;EADxt/I"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/dev/sdk53/index.tsx"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/dev/sdk53/index.tsx"],"names":[],"mappings":"AAIA,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAQzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/dev/sdk54/index.tsx"],"names":[],"mappings":"AAIA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/dev/sdk54/index.tsx"],"names":[],"mappings":"AAIA,wBAAgB,cAAc,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,2CAQzE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alert.web.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/alert.web.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"alert.web.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/alert.web.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,kCAAkC,CAAC;AAExD,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/fetch.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch.web.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/fetch.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC"}
|
|
@@ -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;AA2BD,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAKpD;AAED,wBAAsB,iBAAiB,CACrC,IAAI,GAAE,wBAA2D,GAChE,OAAO,CAAC,IAAI,CAAC,CAKf;AAED,wBAAsB,WAAW,CAC/B,KAAK,GAAE,mBAAgD,GACtD,OAAO,CAAC,IAAI,CAAC,CAKf"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const PROVIDER_GOOGLE = "google";
|
|
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;
|
|
7
|
+
//# sourceMappingURL=maps.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maps.web.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/maps.web.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,eAAe,WAAW,CAAC;AACxC,eAAO,MAAM,gBAAgB,WAAY,CAAC;AAI1C,QAAA,MAAM,OAAO,+DASX,CAAC;AAUH,eAAO,MACL,MAAM,OACN,OAAO,OACP,QAAQ,OACR,OAAO,OACP,MAAM,OACN,OAAO,OACP,OAAO,OACP,OAAO,OACP,OAAO,OACP,SAAS,KACA,CAAC;AAEZ,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { type RefreshControlProps, type StyleProp, type ViewStyle } from "react-native-web";
|
|
3
|
+
interface WebRefreshControlProps extends Omit<RefreshControlProps, "style"> {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
style?: StyleProp<ViewStyle>;
|
|
6
|
+
}
|
|
7
|
+
export default function WebRefreshControl({ refreshing, tintColor, colors, style, progressViewOffset, children, onRefresh, enabled, }: WebRefreshControlProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=refresh-control-component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh-control-component.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/refresh-control-component.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAGvE,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,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAC9B;AAED,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,2CAqKxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rork-ai/toolkit-sdk",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.38",
|
|
4
4
|
"description": "toolkit-sdk",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -73,27 +73,16 @@
|
|
|
73
73
|
"@eslint/js": "^9.35.0",
|
|
74
74
|
"@react-native/babel-preset": "0.81.1",
|
|
75
75
|
"@react-native/eslint-config": "^0.81.1",
|
|
76
|
-
"@tanstack/react-query": "5.90.10",
|
|
77
76
|
"@types/jest": "^29.5.14",
|
|
78
77
|
"@types/react": "19.1.11",
|
|
79
78
|
"@types/ungap__structured-clone": "^1.2.0",
|
|
80
79
|
"eslint": "^9.35.0",
|
|
81
80
|
"eslint-config-prettier": "^10.1.8",
|
|
82
81
|
"eslint-plugin-prettier": "^5.5.4",
|
|
83
|
-
"expo": "54.0.8",
|
|
84
|
-
"expo-blur": "15.0.7",
|
|
85
|
-
"expo-router": "6.0.14",
|
|
86
|
-
"expo-web-browser": "15.0.9",
|
|
87
|
-
"expo-modules-core": "3.0.16",
|
|
88
82
|
"jest": "^29.7.0",
|
|
89
|
-
"lucide-react-native": "0.544.0",
|
|
90
83
|
"prettier": "3.6.2",
|
|
91
|
-
"react": "19.1.0",
|
|
92
|
-
"react-native": "0.81.4",
|
|
93
84
|
"react-native-builder-bob": "^0.40.13",
|
|
94
|
-
"
|
|
95
|
-
"typescript": "5.9.3",
|
|
96
|
-
"zod": "4.1.12"
|
|
85
|
+
"typescript": "5.9.3"
|
|
97
86
|
},
|
|
98
87
|
"peerDependencies": {
|
|
99
88
|
"@tanstack/react-query": "*",
|
|
@@ -103,8 +92,10 @@
|
|
|
103
92
|
"expo-router": "*",
|
|
104
93
|
"expo-web-browser": "*",
|
|
105
94
|
"lucide-react-native": "*",
|
|
95
|
+
"react": "*",
|
|
106
96
|
"react-native": "*",
|
|
107
97
|
"react-native-safe-area-context": "*",
|
|
98
|
+
"react-native-web": "*",
|
|
108
99
|
"zod": "^4"
|
|
109
100
|
},
|
|
110
101
|
"workspaces": [
|
|
@@ -151,6 +142,7 @@
|
|
|
151
142
|
"@ai-sdk/react": "^2.0.89",
|
|
152
143
|
"@blazejkustra/react-native-alert": "^1.0.0",
|
|
153
144
|
"@stardazed/streams-text-encoding": "^1.0.2",
|
|
145
|
+
"@teovilla/react-native-web-maps": "^0.9.5",
|
|
154
146
|
"@ungap/structured-clone": "^1.3.0",
|
|
155
147
|
"ai": "5.0.93",
|
|
156
148
|
"posthog-react-native": "4.13.0"
|
package/src/agent.ts
CHANGED
package/src/dev/sdk53/index.tsx
CHANGED
|
@@ -2,8 +2,6 @@ import { RorkErrorBoundary } from "../error-boundary";
|
|
|
2
2
|
import { RorkSafeInsets } from "../safe-insets-content";
|
|
3
3
|
import { BundleInspector } from "./inspector";
|
|
4
4
|
|
|
5
|
-
import "../../polyfills/alert";
|
|
6
|
-
|
|
7
5
|
export function RorkDevWrapper({ children }: { children: React.ReactNode }) {
|
|
8
6
|
return (
|
|
9
7
|
<RorkErrorBoundary>
|
package/src/dev/sdk54/index.tsx
CHANGED
|
@@ -2,8 +2,6 @@ import { RorkErrorBoundary } from "../error-boundary";
|
|
|
2
2
|
import { RorkSafeInsets } from "../safe-insets-content";
|
|
3
3
|
import { BundleInspector } from "./inspector";
|
|
4
4
|
|
|
5
|
-
import "../../polyfills/alert";
|
|
6
|
-
|
|
7
5
|
export function RorkDevWrapper({ children }: { children: React.ReactNode }) {
|
|
8
6
|
return (
|
|
9
7
|
<RorkErrorBoundary>
|
package/src/metro/index.js
CHANGED
|
@@ -30,12 +30,45 @@ function withRorkMetro(config) {
|
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
//
|
|
33
|
+
// Redirect react-native-maps to our web polyfill on web platform
|
|
34
|
+
if (moduleName === "react-native-maps" && platform === "web") {
|
|
35
|
+
return {
|
|
36
|
+
filePath: path.resolve(libPath, "polyfills/maps.web.js"),
|
|
37
|
+
type: "sourceFile",
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Redirect react-native to our web polyfill on web platform
|
|
42
|
+
// This replaces RefreshControl with our web implementation
|
|
43
|
+
if (
|
|
44
|
+
moduleName === "react-native-web/dist/exports/RefreshControl" &&
|
|
45
|
+
platform === "web"
|
|
46
|
+
) {
|
|
47
|
+
return {
|
|
48
|
+
filePath: path.resolve(
|
|
49
|
+
libPath,
|
|
50
|
+
"polyfills/refresh-control-component.js",
|
|
51
|
+
),
|
|
52
|
+
type: "sourceFile",
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// Redirect react-native to our web polyfill on web platform
|
|
57
|
+
// This replaces RefreshControl with our web implementation
|
|
58
|
+
if (
|
|
59
|
+
moduleName === "react-native-web/dist/exports/Alert" &&
|
|
60
|
+
platform === "web"
|
|
61
|
+
) {
|
|
62
|
+
return {
|
|
63
|
+
filePath: path.resolve(libPath, "polyfills/alert.web.js"),
|
|
64
|
+
type: "sourceFile",
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
34
68
|
if (originalResolveRequest) {
|
|
35
69
|
return originalResolveRequest(context, moduleName, platform);
|
|
36
70
|
}
|
|
37
71
|
|
|
38
|
-
// Fall back to default resolution
|
|
39
72
|
return context.resolveRequest(context, moduleName, platform);
|
|
40
73
|
},
|
|
41
74
|
},
|
package/src/metro/transformer.js
CHANGED
|
@@ -9,21 +9,24 @@ const path = require("path");
|
|
|
9
9
|
const upstreamTransformer = require("@expo/metro-config/babel-transformer");
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
* Detects the Expo SDK version from package
|
|
12
|
+
* Detects the Expo SDK version from the installed expo package
|
|
13
|
+
* This approach works with all package managers (npm, yarn, pnpm)
|
|
13
14
|
*/
|
|
14
15
|
function detectExpoVersion() {
|
|
15
16
|
try {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
// Read version from installed expo package (works with pnpm, npm, yarn)
|
|
18
|
+
const expoPackagePath = path.join(
|
|
19
|
+
process.cwd(),
|
|
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;
|
|
22
27
|
if (version) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (cleanVersion.startsWith("54.")) return "54";
|
|
26
|
-
if (cleanVersion.startsWith("53.")) return "53";
|
|
28
|
+
if (version.startsWith("54.")) return "54";
|
|
29
|
+
if (version.startsWith("53.")) return "53";
|
|
27
30
|
}
|
|
28
31
|
}
|
|
29
32
|
} catch {
|
|
@@ -35,12 +35,6 @@ const vibrationPatterns: Record<
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
function isVibrationAvailable(): boolean {
|
|
38
|
-
console.log(
|
|
39
|
-
"isVibrationAvailable",
|
|
40
|
-
typeof window !== "undefined" &&
|
|
41
|
-
"navigator" in window &&
|
|
42
|
-
"vibrate" in navigator,
|
|
43
|
-
);
|
|
44
38
|
return (
|
|
45
39
|
typeof window !== "undefined" &&
|
|
46
40
|
"navigator" in window &&
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import WebMapView, * as WebMaps from "@teovilla/react-native-web-maps";
|
|
3
|
+
import React from "react";
|
|
4
|
+
|
|
5
|
+
export const PROVIDER_GOOGLE = "google";
|
|
6
|
+
export const PROVIDER_DEFAULT = undefined;
|
|
7
|
+
|
|
8
|
+
const GOOGLE_MAPS_API_KEY = process.env.EXPO_PUBLIC_GOOGLE_MAPS_API_KEY;
|
|
9
|
+
|
|
10
|
+
const MapView = React.forwardRef((props, ref) => {
|
|
11
|
+
return (
|
|
12
|
+
<WebMapView
|
|
13
|
+
ref={ref}
|
|
14
|
+
googleMapsApiKey={GOOGLE_MAPS_API_KEY}
|
|
15
|
+
{...props}
|
|
16
|
+
provider={PROVIDER_GOOGLE}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
MapView.displayName = "MapView";
|
|
22
|
+
|
|
23
|
+
Object.assign(MapView, {
|
|
24
|
+
...WebMaps,
|
|
25
|
+
PROVIDER_GOOGLE,
|
|
26
|
+
PROVIDER_DEFAULT,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const {
|
|
30
|
+
Marker,
|
|
31
|
+
Callout,
|
|
32
|
+
Polyline,
|
|
33
|
+
Polygon,
|
|
34
|
+
Circle,
|
|
35
|
+
Overlay,
|
|
36
|
+
Heatmap,
|
|
37
|
+
UrlTile,
|
|
38
|
+
WMSTile,
|
|
39
|
+
LocalTile,
|
|
40
|
+
} = WebMaps;
|
|
41
|
+
|
|
42
|
+
export default MapView;
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useRef } from "react";
|
|
3
|
+
// Import from react-native-web directly to avoid infinite loop
|
|
4
|
+
// (metro redirects "react-native" to our polyfill on web)
|
|
5
|
+
import {
|
|
6
|
+
ActivityIndicator,
|
|
7
|
+
Animated,
|
|
8
|
+
PanResponder,
|
|
9
|
+
View,
|
|
10
|
+
type GestureResponderEvent,
|
|
11
|
+
type PanResponderGestureState,
|
|
12
|
+
type RefreshControlProps,
|
|
13
|
+
type StyleProp,
|
|
14
|
+
type ViewStyle,
|
|
15
|
+
} from "react-native-web";
|
|
16
|
+
|
|
17
|
+
interface WebRefreshControlProps extends Omit<RefreshControlProps, "style"> {
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
style?: StyleProp<ViewStyle>;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export default function WebRefreshControl({
|
|
23
|
+
refreshing,
|
|
24
|
+
tintColor,
|
|
25
|
+
colors,
|
|
26
|
+
style,
|
|
27
|
+
progressViewOffset,
|
|
28
|
+
children,
|
|
29
|
+
onRefresh,
|
|
30
|
+
enabled,
|
|
31
|
+
}: WebRefreshControlProps) {
|
|
32
|
+
const onRefreshRef = useRef(onRefresh);
|
|
33
|
+
useEffect(() => {
|
|
34
|
+
onRefreshRef.current = onRefresh;
|
|
35
|
+
}, [onRefresh]);
|
|
36
|
+
const enabledRef = useRef(enabled);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
enabledRef.current = enabled;
|
|
39
|
+
}, [enabled]);
|
|
40
|
+
|
|
41
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
42
|
+
const containerRef = useRef<any>(null);
|
|
43
|
+
const pullPosReachedState = useRef(0);
|
|
44
|
+
const pullDownSwipeMargin = useRef(new Animated.Value(0));
|
|
45
|
+
|
|
46
|
+
useEffect(() => {
|
|
47
|
+
Animated.timing(pullDownSwipeMargin.current, {
|
|
48
|
+
toValue: refreshing ? 50 : 0,
|
|
49
|
+
duration: 350,
|
|
50
|
+
useNativeDriver: false,
|
|
51
|
+
}).start();
|
|
52
|
+
if (refreshing) {
|
|
53
|
+
pullPosReachedState.current = 0;
|
|
54
|
+
}
|
|
55
|
+
}, [refreshing]);
|
|
56
|
+
|
|
57
|
+
const onPanResponderFinish = useCallback(() => {
|
|
58
|
+
if (pullPosReachedState.current && onRefreshRef.current) {
|
|
59
|
+
onRefreshRef.current();
|
|
60
|
+
}
|
|
61
|
+
if (!pullPosReachedState.current) {
|
|
62
|
+
Animated.timing(pullDownSwipeMargin.current, {
|
|
63
|
+
toValue: 0,
|
|
64
|
+
duration: 350,
|
|
65
|
+
useNativeDriver: false,
|
|
66
|
+
}).start();
|
|
67
|
+
}
|
|
68
|
+
}, []);
|
|
69
|
+
|
|
70
|
+
const panResponder = useRef(
|
|
71
|
+
PanResponder.create({
|
|
72
|
+
onStartShouldSetPanResponder: () => false,
|
|
73
|
+
onStartShouldSetPanResponderCapture: () => false,
|
|
74
|
+
onMoveShouldSetPanResponder: (
|
|
75
|
+
_: GestureResponderEvent,
|
|
76
|
+
gestureState: PanResponderGestureState,
|
|
77
|
+
) => {
|
|
78
|
+
if (!containerRef.current) return false;
|
|
79
|
+
// React 19 fix: use direct DOM traversal instead of findNodeHandle
|
|
80
|
+
const scrollContainer = (containerRef.current as unknown as HTMLElement)
|
|
81
|
+
?.firstChild as HTMLElement | null;
|
|
82
|
+
if (!scrollContainer) return false;
|
|
83
|
+
return (
|
|
84
|
+
scrollContainer.scrollTop === 0 &&
|
|
85
|
+
Math.abs(gestureState.dy) > Math.abs(gestureState.dx) * 2 &&
|
|
86
|
+
Math.abs(gestureState.vy) > Math.abs(gestureState.vx) * 2.5
|
|
87
|
+
);
|
|
88
|
+
},
|
|
89
|
+
onMoveShouldSetPanResponderCapture: () => false,
|
|
90
|
+
onPanResponderMove: (
|
|
91
|
+
_: GestureResponderEvent,
|
|
92
|
+
gestureState: PanResponderGestureState,
|
|
93
|
+
) => {
|
|
94
|
+
if (enabledRef.current !== undefined && !enabledRef.current) return;
|
|
95
|
+
|
|
96
|
+
const adjustedDy =
|
|
97
|
+
gestureState.dy <= 0
|
|
98
|
+
? 0
|
|
99
|
+
: (gestureState.dy * 150) / (gestureState.dy + 120); // Diminishing returns function
|
|
100
|
+
pullDownSwipeMargin.current.setValue(adjustedDy);
|
|
101
|
+
const newValue = adjustedDy > 45 ? 1 : 0;
|
|
102
|
+
if (newValue !== pullPosReachedState.current) {
|
|
103
|
+
pullPosReachedState.current = newValue;
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
onPanResponderTerminationRequest: () => true,
|
|
107
|
+
onPanResponderRelease: onPanResponderFinish,
|
|
108
|
+
onPanResponderTerminate: onPanResponderFinish,
|
|
109
|
+
}),
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
const refreshIndicatorColor = useMemo(
|
|
113
|
+
() => (tintColor ? tintColor : colors && colors.length ? colors[0] : null),
|
|
114
|
+
[colors, tintColor],
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
const containerStyle = useMemo(
|
|
118
|
+
(): StyleProp<ViewStyle> => [
|
|
119
|
+
style,
|
|
120
|
+
// @ts-ignore - overflowY is valid on web
|
|
121
|
+
{
|
|
122
|
+
overflowY: "hidden",
|
|
123
|
+
overflow: "hidden",
|
|
124
|
+
paddingTop: progressViewOffset,
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
[progressViewOffset, style],
|
|
128
|
+
);
|
|
129
|
+
|
|
130
|
+
const indicatorTransformStyle = useMemo(
|
|
131
|
+
() => ({
|
|
132
|
+
alignSelf: "center" as const,
|
|
133
|
+
justifyContent: "center" as const,
|
|
134
|
+
alignItems: "center" as const,
|
|
135
|
+
marginTop: -40,
|
|
136
|
+
height: 40,
|
|
137
|
+
transform: [{ translateY: pullDownSwipeMargin.current }],
|
|
138
|
+
}),
|
|
139
|
+
[],
|
|
140
|
+
);
|
|
141
|
+
|
|
142
|
+
// This is messing with react-native-web's internal implementation
|
|
143
|
+
// Will probably break if anything changes on their end
|
|
144
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
145
|
+
const AnimatedContentContainer =
|
|
146
|
+
useMemo((): React.ComponentType<any> | null => {
|
|
147
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
148
|
+
const childElement = children as React.ReactElement<any>;
|
|
149
|
+
if (!childElement?.props?.children?.type) return null;
|
|
150
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
151
|
+
return withAnimated((childProps: any) =>
|
|
152
|
+
React.createElement(childElement.props.children.type, childProps),
|
|
153
|
+
);
|
|
154
|
+
}, [children]);
|
|
155
|
+
|
|
156
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
157
|
+
const childElement = children as React.ReactElement<any>;
|
|
158
|
+
const newContentContainerStyle = useMemo(
|
|
159
|
+
() => [
|
|
160
|
+
childElement?.props?.children?.props?.style,
|
|
161
|
+
{ transform: [{ translateY: pullDownSwipeMargin.current }] },
|
|
162
|
+
],
|
|
163
|
+
[childElement?.props?.children?.props?.style],
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
if (!childElement || !AnimatedContentContainer) {
|
|
167
|
+
return <>{children}</>;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
const newChildren = React.cloneElement(
|
|
171
|
+
childElement,
|
|
172
|
+
{},
|
|
173
|
+
<>
|
|
174
|
+
<Animated.View style={indicatorTransformStyle}>
|
|
175
|
+
<ActivityIndicator
|
|
176
|
+
color={refreshIndicatorColor || "#999999"}
|
|
177
|
+
size="small"
|
|
178
|
+
/>
|
|
179
|
+
</Animated.View>
|
|
180
|
+
<AnimatedContentContainer
|
|
181
|
+
{...childElement.props.children.props}
|
|
182
|
+
style={newContentContainerStyle}
|
|
183
|
+
/>
|
|
184
|
+
</>,
|
|
185
|
+
);
|
|
186
|
+
|
|
187
|
+
return (
|
|
188
|
+
<View
|
|
189
|
+
ref={containerRef}
|
|
190
|
+
style={containerStyle}
|
|
191
|
+
{...panResponder.current.panHandlers}
|
|
192
|
+
>
|
|
193
|
+
{newChildren}
|
|
194
|
+
</View>
|
|
195
|
+
);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
199
|
+
function withAnimated(
|
|
200
|
+
WrappedComponent: React.ComponentType<any>,
|
|
201
|
+
): React.ComponentType<any> {
|
|
202
|
+
const displayName =
|
|
203
|
+
WrappedComponent.displayName || WrappedComponent.name || "Component";
|
|
204
|
+
|
|
205
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
206
|
+
class WithAnimated extends React.Component<any> {
|
|
207
|
+
static displayName = `WithAnimated(${displayName})`;
|
|
208
|
+
|
|
209
|
+
render() {
|
|
210
|
+
return <WrappedComponent {...this.props} />;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
return Animated.createAnimatedComponent(WithAnimated);
|
|
215
|
+
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["TextDecoderStream","TextEncoderStream","structuredClone","polyfillGlobal","globalThis","console","log"],"sourceRoot":"../../src","sources":["polyfills.ts"],"mappings":";;AAAA,SACEA,iBAAiB,EACjBC,iBAAiB,QACZ,kCAAkC;AACzC,OAAOC,eAAe,MAAM,yBAAyB;AACrD;AACA,SAASC,cAAc,QAAQ,oDAAoD;AAEnF,IAAI,EAAE,iBAAiB,IAAIC,UAAU,CAAC,EAAE;EACtCC,OAAO,CAACC,GAAG,CAAC,6BAA6B,CAAC;EAC1CH,cAAc,CAAC,iBAAiB,EAAE,MAAMD,eAAe,CAAC;AAC1D;AACAC,cAAc,CAAC,mBAAmB,EAAE,MAAMF,iBAAiB,CAAC;AAC5DE,cAAc,CAAC,mBAAmB,EAAE,MAAMH,iBAAiB,CAAC;AAE5D","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../src","sources":["polyfills.web.ts"],"mappings":";;AAAA","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../../../src/polyfills/alert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"polyfills.d.ts","sourceRoot":"","sources":["../../../src/polyfills.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"polyfills.web.d.ts","sourceRoot":"","sources":["../../../src/polyfills.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC"}
|
package/src/polyfills/alert.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
File without changes
|
|
File without changes
|