@openwebf/react-router 0.2.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 +382 -0
- package/dist/index.d.ts +331 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +511 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +519 -0
- package/dist/index.js.map +1 -0
- package/dist/routes/Route.d.ts +45 -0
- package/dist/routes/Route.d.ts.map +1 -0
- package/dist/routes/Routes.d.ts +205 -0
- package/dist/routes/Routes.d.ts.map +1 -0
- package/dist/routes/index.d.ts +4 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/router.d.ts +79 -0
- package/dist/routes/router.d.ts.map +1 -0
- package/dist/routes/routerConfig.d.ts +147 -0
- package/dist/routes/routerConfig.d.ts.map +1 -0
- package/dist/routes/utils.d.ts +79 -0
- package/dist/routes/utils.d.ts.map +1 -0
- package/dist/utils/CreateComponent.d.ts +86 -0
- package/dist/utils/CreateComponent.d.ts.map +1 -0
- package/dist/utils/RouterLink.d.ts +18 -0
- package/dist/utils/RouterLink.d.ts.map +1 -0
- package/package.json +76 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EventHandler, FC, ReactNode, SyntheticEvent } from "react";
|
|
2
|
+
import { WebFElementWithMethods } from "@openwebf/react-core-ui";
|
|
3
|
+
export interface HybridRouterChangeEvent extends SyntheticEvent {
|
|
4
|
+
readonly state: any;
|
|
5
|
+
readonly kind: 'didPushNext' | 'didPush' | 'didPop' | 'didPupNext';
|
|
6
|
+
readonly path: string;
|
|
7
|
+
}
|
|
8
|
+
export type HybridRouterChangeEventHandler = EventHandler<HybridRouterChangeEvent>;
|
|
9
|
+
export interface WebFHybridRouterProps {
|
|
10
|
+
path: string;
|
|
11
|
+
onScreen?: HybridRouterChangeEventHandler;
|
|
12
|
+
offScreen?: HybridRouterChangeEventHandler;
|
|
13
|
+
children?: ReactNode;
|
|
14
|
+
}
|
|
15
|
+
export interface WebFRouterLinkElement extends WebFElementWithMethods<{}> {
|
|
16
|
+
}
|
|
17
|
+
export declare const WebFRouterLink: FC<WebFHybridRouterProps>;
|
|
18
|
+
//# sourceMappingURL=RouterLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RouterLink.d.ts","sourceRoot":"","sources":["../../src/utils/RouterLink.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,YAAY,EAAE,EAAE,EAAE,SAAS,EAAE,cAAc,EAAY,MAAM,OAAO,CAAC;AACrF,OAAO,EAAuB,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AAEtF,MAAM,WAAW,uBAAwB,SAAQ,cAAc;IAC7D,QAAQ,CAAC,KAAK,EAAE,GAAG,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,aAAa,GAAG,SAAS,GAAG,QAAQ,GAAG,YAAY,CAAC;IACnE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,8BAA8B,GAAG,YAAY,CAAC,uBAAuB,CAAC,CAAC;AAEnF,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,8BAA8B,CAAC;IAC1C,SAAS,CAAC,EAAE,8BAA8B,CAAC;IAC3C,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAGD,MAAM,WAAW,qBAAsB,SAAQ,sBAAsB,CAAC,EAAE,CAAC;CAAG;AA+B5E,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,qBAAqB,CAgBpD,CAAA"}
|
package/package.json
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@openwebf/react-router",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "React Router implementation for WebF using hybrid history API",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.esm.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"dist"
|
|
10
|
+
],
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.esm.js",
|
|
14
|
+
"require": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "rollup -c",
|
|
20
|
+
"watch": "rollup -c -w",
|
|
21
|
+
"test": "jest",
|
|
22
|
+
"lint": "eslint src --ext .ts,.tsx",
|
|
23
|
+
"type-check": "tsc --noEmit"
|
|
24
|
+
},
|
|
25
|
+
"repository": {
|
|
26
|
+
"type": "git",
|
|
27
|
+
"url": "https://github.com/openwebf/webf.git",
|
|
28
|
+
"directory": "packages/react-router"
|
|
29
|
+
},
|
|
30
|
+
"keywords": [
|
|
31
|
+
"webf",
|
|
32
|
+
"react",
|
|
33
|
+
"router",
|
|
34
|
+
"navigation",
|
|
35
|
+
"hybrid"
|
|
36
|
+
],
|
|
37
|
+
"author": "OpenWebF Team",
|
|
38
|
+
"license": "Apache-2.0",
|
|
39
|
+
"peerDependencies": {
|
|
40
|
+
"react": ">=16.8.0",
|
|
41
|
+
"react-dom": ">=16.8.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
45
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
46
|
+
"@rollup/plugin-typescript": "^11.1.5",
|
|
47
|
+
"@testing-library/react": "^14.1.2",
|
|
48
|
+
"@types/jest": "^29.5.10",
|
|
49
|
+
"@types/react": "^18.2.42",
|
|
50
|
+
"@types/react-dom": "^18.2.17",
|
|
51
|
+
"@typescript-eslint/eslint-plugin": "^6.13.2",
|
|
52
|
+
"@typescript-eslint/parser": "^6.13.2",
|
|
53
|
+
"eslint": "^8.55.0",
|
|
54
|
+
"eslint-config-prettier": "^9.1.0",
|
|
55
|
+
"eslint-plugin-react": "^7.33.2",
|
|
56
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
57
|
+
"jest": "^29.7.0",
|
|
58
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
59
|
+
"react": "^19.1.0",
|
|
60
|
+
"react-dom": "^19.1.0",
|
|
61
|
+
"rollup": "^4.6.1",
|
|
62
|
+
"rollup-plugin-dts": "^6.1.0",
|
|
63
|
+
"ts-jest": "^29.1.1",
|
|
64
|
+
"tslib": "^2.8.1",
|
|
65
|
+
"typescript": "^5.3.2"
|
|
66
|
+
},
|
|
67
|
+
"dependencies": {
|
|
68
|
+
"@openwebf/react-core-ui": "^0.2.1",
|
|
69
|
+
"@openwebf/webf-enterprise-typings": "^0.22.1",
|
|
70
|
+
"@types/event-emitter": "^0.3.5",
|
|
71
|
+
"@types/lodash-es": "^4.17.12",
|
|
72
|
+
"ahooks": "^3.8.5",
|
|
73
|
+
"event-emitter": "^0.3.5",
|
|
74
|
+
"lodash-es": "^4.17.21"
|
|
75
|
+
}
|
|
76
|
+
}
|