@proton-app/renderer 0.0.1 → 0.0.2
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/dist/index.d.ts +1 -1
- package/dist/index.js +7 -1
- package/dist/router.d.ts +3 -3
- package/dist/router.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare function mountApp(app: React.ReactNode): void;
|
|
2
2
|
export * from "./router";
|
package/dist/index.js
CHANGED
|
@@ -14,5 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
|
|
17
|
+
exports.mountApp = mountApp;
|
|
18
|
+
const client_1 = require("react-dom/client");
|
|
19
|
+
function mountApp(app) {
|
|
20
|
+
const element = document.getElementById("root");
|
|
21
|
+
const root = (0, client_1.createRoot)(element);
|
|
22
|
+
root.render(app);
|
|
23
|
+
}
|
|
18
24
|
__exportStar(require("./router"), exports);
|
package/dist/router.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { ReactNode
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
2
|
type RouterConfig = Record<string, {
|
|
3
3
|
layout: ReactNode;
|
|
4
|
-
routes:
|
|
4
|
+
routes: Record<string, Record<string, ReactNode>>;
|
|
5
5
|
}>;
|
|
6
6
|
export declare const AppRouter: ({ config }: {
|
|
7
7
|
config: RouterConfig;
|
|
8
|
-
}) => JSX.Element;
|
|
8
|
+
}) => import("react").JSX.Element;
|
|
9
9
|
export {};
|
package/dist/router.js
CHANGED
|
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AppRouter = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_router_dom_1 = require("react-router-dom");
|
|
6
|
-
const AppRouter = ({ config }) => ((0, jsx_runtime_1.jsx)(react_router_dom_1.HashRouter, { children: (0, jsx_runtime_1.jsx)(react_router_dom_1.Routes, { children: Object.entries(config).map(([name, { layout, routes }]) => ((0, jsx_runtime_1.jsx)(react_router_dom_1.Route, { element: layout, children: routes.map(
|
|
6
|
+
const AppRouter = ({ config }) => ((0, jsx_runtime_1.jsx)(react_router_dom_1.HashRouter, { children: (0, jsx_runtime_1.jsx)(react_router_dom_1.Routes, { children: Object.entries(config).map(([name, { layout, routes }]) => ((0, jsx_runtime_1.jsx)(react_router_dom_1.Route, { element: layout, children: Object.entries(routes).map(([path, subroutes]) => ((0, jsx_runtime_1.jsx)(react_router_dom_1.Route, { path: path, children: Object.entries(subroutes).map(([subpath, content]) => ((0, jsx_runtime_1.jsx)(react_router_dom_1.Route, { index: subpath === "root", path: subpath !== "root" ? `/${subpath}` : undefined, element: content }, subpath))) }, path))) }, name))) }) }));
|
|
7
7
|
exports.AppRouter = AppRouter;
|