first commit

This commit is contained in:
2026-03-10 16:18:05 +00:00
commit 11f9c069b5
31635 changed files with 3187747 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
import { LinkToOptions } from '../global-state/routing';
export declare function emitDomSetParams(params?: Record<string, undefined | string | number | (string | number)[]>): boolean;
export declare function emitDomDismiss(count?: number): boolean;
export declare function emitDomGoBack(): boolean;
export declare function emitDomDismissAll(): boolean;
export declare function emitDomLinkEvent(href: string, options: LinkToOptions): boolean;
//# sourceMappingURL=emitDomEvent.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"emitDomEvent.d.ts","sourceRoot":"","sources":["../../src/domComponents/emitDomEvent.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAWxD,wBAAgB,gBAAgB,CAC9B,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAM,WAG/E;AAED,wBAAgB,cAAc,CAAC,KAAK,CAAC,EAAE,MAAM,WAE5C;AAED,wBAAgB,aAAa,YAE5B;AAED,wBAAgB,iBAAiB,YAEhC;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,WAEpE"}

View File

@@ -0,0 +1,32 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.emitDomSetParams = emitDomSetParams;
exports.emitDomDismiss = emitDomDismiss;
exports.emitDomGoBack = emitDomGoBack;
exports.emitDomDismissAll = emitDomDismissAll;
exports.emitDomLinkEvent = emitDomLinkEvent;
const events_1 = require("./events");
function emitDomEvent(type, data = {}) {
// @ts-expect-error: ReactNativeWebView is a global variable injected by the WebView
if (typeof $$EXPO_INITIAL_PROPS !== 'undefined' && typeof ReactNativeWebView !== 'undefined') {
window.ReactNativeWebView.postMessage(JSON.stringify({ type, data }));
return true;
}
return false;
}
function emitDomSetParams(params = {}) {
return emitDomEvent(events_1.ROUTER_SET_PARAMS_TYPE, { params });
}
function emitDomDismiss(count) {
return emitDomEvent(events_1.ROUTER_DISMISS_TYPE, { count });
}
function emitDomGoBack() {
return emitDomEvent(events_1.ROUTER_BACK_TYPE);
}
function emitDomDismissAll() {
return emitDomEvent(events_1.ROUTER_DISMISS_ALL_TYPE);
}
function emitDomLinkEvent(href, options) {
return emitDomEvent(events_1.ROUTER_LINK_TYPE, { href, options });
}
//# sourceMappingURL=emitDomEvent.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"emitDomEvent.js","sourceRoot":"","sources":["../../src/domComponents/emitDomEvent.ts"],"names":[],"mappings":";;AAkBA,4CAIC;AAED,wCAEC;AAED,sCAEC;AAED,8CAEC;AAED,4CAEC;AAtCD,qCAMkB;AAGlB,SAAS,YAAY,CAAC,IAAY,EAAE,OAAY,EAAE;IAChD,oFAAoF;IACpF,IAAI,OAAO,oBAAoB,KAAK,WAAW,IAAI,OAAO,kBAAkB,KAAK,WAAW,EAAE,CAAC;QAC5F,MAAc,CAAC,kBAAkB,CAAC,WAAW,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;QAC/E,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAgB,gBAAgB,CAC9B,SAA4E,EAAE;IAE9E,OAAO,YAAY,CAAC,+BAAsB,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;AAC1D,CAAC;AAED,SAAgB,cAAc,CAAC,KAAc;IAC3C,OAAO,YAAY,CAAC,4BAAmB,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;AACtD,CAAC;AAED,SAAgB,aAAa;IAC3B,OAAO,YAAY,CAAC,yBAAgB,CAAC,CAAC;AACxC,CAAC;AAED,SAAgB,iBAAiB;IAC/B,OAAO,YAAY,CAAC,gCAAuB,CAAC,CAAC;AAC/C,CAAC;AAED,SAAgB,gBAAgB,CAAC,IAAY,EAAE,OAAsB;IACnE,OAAO,YAAY,CAAC,yBAAgB,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import {\n ROUTER_SET_PARAMS_TYPE,\n ROUTER_DISMISS_TYPE,\n ROUTER_BACK_TYPE,\n ROUTER_DISMISS_ALL_TYPE,\n ROUTER_LINK_TYPE,\n} from './events';\nimport { LinkToOptions } from '../global-state/routing';\n\nfunction emitDomEvent(type: string, data: any = {}) {\n // @ts-expect-error: ReactNativeWebView is a global variable injected by the WebView\n if (typeof $$EXPO_INITIAL_PROPS !== 'undefined' && typeof ReactNativeWebView !== 'undefined') {\n (window as any).ReactNativeWebView.postMessage(JSON.stringify({ type, data }));\n return true;\n }\n return false;\n}\n\nexport function emitDomSetParams(\n params: Record<string, undefined | string | number | (string | number)[]> = {}\n) {\n return emitDomEvent(ROUTER_SET_PARAMS_TYPE, { params });\n}\n\nexport function emitDomDismiss(count?: number) {\n return emitDomEvent(ROUTER_DISMISS_TYPE, { count });\n}\n\nexport function emitDomGoBack() {\n return emitDomEvent(ROUTER_BACK_TYPE);\n}\n\nexport function emitDomDismissAll() {\n return emitDomEvent(ROUTER_DISMISS_ALL_TYPE);\n}\n\nexport function emitDomLinkEvent(href: string, options: LinkToOptions) {\n return emitDomEvent(ROUTER_LINK_TYPE, { href, options });\n}\n"]}

View File

@@ -0,0 +1,6 @@
export declare const ROUTER_LINK_TYPE = "$$router_link";
export declare const ROUTER_DISMISS_ALL_TYPE = "$$router_dismissAll";
export declare const ROUTER_DISMISS_TYPE = "$$router_dismiss";
export declare const ROUTER_BACK_TYPE = "$$router_goBack";
export declare const ROUTER_SET_PARAMS_TYPE = "$$router_setParams";
//# sourceMappingURL=events.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/domComponents/events.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,kBAAkB,CAAC;AAChD,eAAO,MAAM,uBAAuB,wBAAwB,CAAC;AAC7D,eAAO,MAAM,mBAAmB,qBAAqB,CAAC;AACtD,eAAO,MAAM,gBAAgB,oBAAoB,CAAC;AAClD,eAAO,MAAM,sBAAsB,uBAAuB,CAAC"}

View File

@@ -0,0 +1,9 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ROUTER_SET_PARAMS_TYPE = exports.ROUTER_BACK_TYPE = exports.ROUTER_DISMISS_TYPE = exports.ROUTER_DISMISS_ALL_TYPE = exports.ROUTER_LINK_TYPE = void 0;
exports.ROUTER_LINK_TYPE = '$$router_link';
exports.ROUTER_DISMISS_ALL_TYPE = '$$router_dismissAll';
exports.ROUTER_DISMISS_TYPE = '$$router_dismiss';
exports.ROUTER_BACK_TYPE = '$$router_goBack';
exports.ROUTER_SET_PARAMS_TYPE = '$$router_setParams';
//# sourceMappingURL=events.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/domComponents/events.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG,eAAe,CAAC;AACnC,QAAA,uBAAuB,GAAG,qBAAqB,CAAC;AAChD,QAAA,mBAAmB,GAAG,kBAAkB,CAAC;AACzC,QAAA,gBAAgB,GAAG,iBAAiB,CAAC;AACrC,QAAA,sBAAsB,GAAG,oBAAoB,CAAC","sourcesContent":["export const ROUTER_LINK_TYPE = '$$router_link';\nexport const ROUTER_DISMISS_ALL_TYPE = '$$router_dismissAll';\nexport const ROUTER_DISMISS_TYPE = '$$router_dismiss';\nexport const ROUTER_BACK_TYPE = '$$router_goBack';\nexport const ROUTER_SET_PARAMS_TYPE = '$$router_setParams';\n"]}

View File

@@ -0,0 +1,2 @@
export declare function useDomComponentNavigation(): void;
//# sourceMappingURL=useDomComponentNavigation.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"useDomComponentNavigation.d.ts","sourceRoot":"","sources":["../../src/domComponents/useDomComponentNavigation.ts"],"names":[],"mappings":"AAYA,wBAAgB,yBAAyB,SAyBxC"}

View File

@@ -0,0 +1,37 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.useDomComponentNavigation = useDomComponentNavigation;
const global_1 = require("expo/dom/global");
const react_1 = __importDefault(require("react"));
const events_1 = require("./events");
const routing_1 = require("../global-state/routing");
function useDomComponentNavigation() {
react_1.default.useEffect(() => {
if (process.env.EXPO_OS === 'web') {
return () => { };
}
return (0, global_1.addGlobalDomEventListener)(({ type, data }) => {
switch (type) {
case events_1.ROUTER_LINK_TYPE:
(0, routing_1.linkTo)(data.href, data.options);
break;
case events_1.ROUTER_DISMISS_ALL_TYPE:
(0, routing_1.dismissAll)();
break;
case events_1.ROUTER_DISMISS_TYPE:
(0, routing_1.dismiss)(data.count);
break;
case events_1.ROUTER_BACK_TYPE:
(0, routing_1.goBack)();
break;
case events_1.ROUTER_SET_PARAMS_TYPE:
(0, routing_1.setParams)(data.params);
break;
}
});
}, []);
}
//# sourceMappingURL=useDomComponentNavigation.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"useDomComponentNavigation.js","sourceRoot":"","sources":["../../src/domComponents/useDomComponentNavigation.ts"],"names":[],"mappings":";;;;;AAYA,8DAyBC;AArCD,4CAA4D;AAC5D,kDAA0B;AAE1B,qCAMkB;AAClB,qDAAyF;AAEzF,SAAgB,yBAAyB;IACvC,eAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,KAAK,KAAK,EAAE,CAAC;YAClC,OAAO,GAAG,EAAE,GAAE,CAAC,CAAC;QAClB,CAAC;QACD,OAAO,IAAA,kCAAyB,EAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,EAAE;YACvD,QAAQ,IAAI,EAAE,CAAC;gBACb,KAAK,yBAAgB;oBACnB,IAAA,gBAAM,EAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;oBAChC,MAAM;gBACR,KAAK,gCAAuB;oBAC1B,IAAA,oBAAU,GAAE,CAAC;oBACb,MAAM;gBACR,KAAK,4BAAmB;oBACtB,IAAA,iBAAO,EAAC,IAAI,CAAC,KAAK,CAAC,CAAC;oBACpB,MAAM;gBACR,KAAK,yBAAgB;oBACnB,IAAA,gBAAM,GAAE,CAAC;oBACT,MAAM;gBACR,KAAK,+BAAsB;oBACzB,IAAA,mBAAS,EAAC,IAAI,CAAC,MAAM,CAAC,CAAC;oBACvB,MAAM;YACV,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC","sourcesContent":["import { addGlobalDomEventListener } from 'expo/dom/global';\nimport React from 'react';\n\nimport {\n ROUTER_LINK_TYPE,\n ROUTER_DISMISS_ALL_TYPE,\n ROUTER_DISMISS_TYPE,\n ROUTER_BACK_TYPE,\n ROUTER_SET_PARAMS_TYPE,\n} from './events';\nimport { dismiss, dismissAll, goBack, linkTo, setParams } from '../global-state/routing';\n\nexport function useDomComponentNavigation() {\n React.useEffect(() => {\n if (process.env.EXPO_OS === 'web') {\n return () => {};\n }\n return addGlobalDomEventListener<any>(({ type, data }) => {\n switch (type) {\n case ROUTER_LINK_TYPE:\n linkTo(data.href, data.options);\n break;\n case ROUTER_DISMISS_ALL_TYPE:\n dismissAll();\n break;\n case ROUTER_DISMISS_TYPE:\n dismiss(data.count);\n break;\n case ROUTER_BACK_TYPE:\n goBack();\n break;\n case ROUTER_SET_PARAMS_TYPE:\n setParams(data.params);\n break;\n }\n });\n }, []);\n}\n"]}