swico 0.9.0-beta4 → 0.9.0-beta6
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/package.json
CHANGED
package/src/index.react.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ export declare const Link: FC<{
|
|
|
11
11
|
}>;
|
|
12
12
|
export { Outlet } from 'react-router-dom';
|
|
13
13
|
export { useLocation, useNav } from './template/react/react-hooks';
|
|
14
|
-
export { history } from './mock-history';
|
|
14
|
+
export { history, Router } from './mock-history';
|
|
15
15
|
export interface DefineSwicoConfigType {
|
|
16
16
|
(env: 'base', config: CustomConfigType['base']): any;
|
|
17
17
|
(env: 'dev', config: CustomConfigType['dev']): any;
|
package/src/index.react.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.defineGlobal = exports.defineConfig = exports.history = exports.useNav = exports.useLocation = exports.Outlet = exports.Link = void 0;
|
|
6
|
+
exports.defineGlobal = exports.defineConfig = exports.Router = exports.history = exports.useNav = exports.useLocation = exports.Outlet = exports.Link = void 0;
|
|
7
7
|
var react_router_dom_1 = require("react-router-dom");
|
|
8
8
|
var react_1 = __importDefault(require("react"));
|
|
9
9
|
var Link = function (_a) {
|
|
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "useLocation", { enumerable: true, get: function
|
|
|
18
18
|
Object.defineProperty(exports, "useNav", { enumerable: true, get: function () { return react_hooks_1.useNav; } });
|
|
19
19
|
var mock_history_1 = require("./mock-history");
|
|
20
20
|
Object.defineProperty(exports, "history", { enumerable: true, get: function () { return mock_history_1.history; } });
|
|
21
|
+
Object.defineProperty(exports, "Router", { enumerable: true, get: function () { return mock_history_1.Router; } });
|
|
21
22
|
var defineConfig = function (env, config) { return config; };
|
|
22
23
|
exports.defineConfig = defineConfig;
|
|
23
24
|
var defineGlobal = function (config) {
|
package/src/mock-history.d.ts
CHANGED
package/src/mock-history.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { SwicoHistoryType } from '../../../typings/global-type';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
export declare const Router:
|
|
2
|
+
import React, { ReactNode } from 'react';
|
|
3
|
+
export declare const Router: React.FC<{
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}>;
|
|
4
6
|
export declare const compareURLPatterns: (urlPatternWithValues: string, urlPatternWithParams: string) => boolean;
|
|
5
7
|
export declare const interpolatePath: (pathTemplate: string, params: Record<string, any>) => string;
|
|
6
8
|
export declare const formatAncPath: (ancPath: string) => string;
|
|
@@ -10,7 +10,8 @@ var routes_1 = __importDefault(require("./routes"));
|
|
|
10
10
|
var config_1 = require("./config");
|
|
11
11
|
var react_router_dom_1 = require("react-router-dom");
|
|
12
12
|
var react_1 = __importDefault(require("react"));
|
|
13
|
-
var Router = function (
|
|
13
|
+
var Router = function (_a) {
|
|
14
|
+
var children = _a.children;
|
|
14
15
|
return react_1.default.createElement(react_router_dom_1.unstable_HistoryRouter, { basename: config_1.routerBase, history: getOriHistory(config_1.routerType) }, children);
|
|
15
16
|
};
|
|
16
17
|
exports.Router = Router;
|