piral-core 1.3.0-beta.6062 → 1.3.0-beta.6067
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/esm/components/PiralRoutes.js +20 -15
- package/esm/components/PiralRoutes.js.map +1 -1
- package/esm/modules/element.d.ts +7 -0
- package/esm/modules/element.js +11 -0
- package/esm/modules/element.js.map +1 -1
- package/esm/types/state.d.ts +6 -1
- package/lib/components/PiralRoutes.js +20 -15
- package/lib/components/PiralRoutes.js.map +1 -1
- package/lib/modules/element.d.ts +7 -0
- package/lib/modules/element.js +11 -0
- package/lib/modules/element.js.map +1 -1
- package/lib/types/state.d.ts +6 -1
- package/package.json +4 -4
- package/src/components/PiralRoutes.tsx +30 -15
- package/src/modules/element.ts +18 -0
- package/src/types/api.ts +1 -1
- package/src/types/state.ts +8 -1
|
@@ -3,23 +3,28 @@ import * as React from 'react';
|
|
|
3
3
|
import { useGlobalState } from '../hooks';
|
|
4
4
|
import { createRouteMatcher } from '../utils';
|
|
5
5
|
import { useRouteFilter } from '../../app.codegen';
|
|
6
|
-
function
|
|
6
|
+
function useShellRoutes() {
|
|
7
7
|
const routes = useGlobalState((s) => s.routes);
|
|
8
|
+
return React.useMemo(() => Object.entries(routes).map(([path, Component]) => ({
|
|
9
|
+
path,
|
|
10
|
+
Component,
|
|
11
|
+
meta: (Component === null || Component === void 0 ? void 0 : Component.meta) || {},
|
|
12
|
+
matcher: createRouteMatcher(path),
|
|
13
|
+
})), [routes]);
|
|
14
|
+
}
|
|
15
|
+
function usePiletRoutes() {
|
|
8
16
|
const pages = useGlobalState((s) => s.registry.pages);
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
matcher: createRouteMatcher(path),
|
|
21
|
-
})),
|
|
22
|
-
]);
|
|
17
|
+
return React.useMemo(() => Object.entries(pages).map(([path, entry]) => ({
|
|
18
|
+
path,
|
|
19
|
+
Component: entry.component,
|
|
20
|
+
meta: entry.meta,
|
|
21
|
+
matcher: createRouteMatcher(path),
|
|
22
|
+
})), [pages]);
|
|
23
|
+
}
|
|
24
|
+
function useRoutes() {
|
|
25
|
+
const shellRoutes = useShellRoutes();
|
|
26
|
+
const piletRoutes = usePiletRoutes();
|
|
27
|
+
return useRouteFilter([...shellRoutes, ...piletRoutes]);
|
|
23
28
|
}
|
|
24
29
|
/**
|
|
25
30
|
* The component for defining the exclusive routes to be used.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PiralRoutes.js","sourceRoot":"","sources":["../../src/components/PiralRoutes.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"PiralRoutes.js","sourceRoot":"","sources":["../../src/components/PiralRoutes.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAG9C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,SAAS,cAAc;IACrB,MAAM,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAC/C,OAAO,KAAK,CAAC,OAAO,CAClB,GAAG,EAAE,CACH,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,CAAC;QACjD,IAAI;QACJ,SAAS;QACT,IAAI,EAAE,CAAA,SAAS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,6 +4,13 @@ export interface Updatable {
|
|
|
4
4
|
}
|
|
5
5
|
declare global {
|
|
6
6
|
interface Window {
|
|
7
|
+
/**
|
|
8
|
+
* Assigns content in form a ReactChild to be rendered later
|
|
9
|
+
* from a foreign container / element in an piral-content
|
|
10
|
+
* child.
|
|
11
|
+
* @param cid The ID of the piral-content node.
|
|
12
|
+
* @param content The ReactChild to be rendered.
|
|
13
|
+
*/
|
|
7
14
|
assignContent(cid: string, content: any): void;
|
|
8
15
|
}
|
|
9
16
|
}
|
package/esm/modules/element.js
CHANGED
|
@@ -153,11 +153,22 @@ if (typeof window !== 'undefined' && 'customElements' in window) {
|
|
|
153
153
|
* This is a virtual element to render children defined in React / by Piral in other
|
|
154
154
|
* frameworks.
|
|
155
155
|
*
|
|
156
|
+
* Internally, you can use the assignContent function to populate the content to be
|
|
157
|
+
* rendered once the element is attached / mounted in the DOM.
|
|
158
|
+
*
|
|
156
159
|
* Usage:
|
|
157
160
|
*
|
|
158
161
|
* ```
|
|
159
162
|
* <piral-content cid="123"></piral-content>
|
|
160
163
|
* ```
|
|
164
|
+
*
|
|
165
|
+
* where you'd
|
|
166
|
+
*
|
|
167
|
+
* ```
|
|
168
|
+
* window.assignContent("123", myReactContent)
|
|
169
|
+
* ```
|
|
170
|
+
*
|
|
171
|
+
* beforehand.
|
|
161
172
|
*/
|
|
162
173
|
class PiralContent extends HTMLElement {
|
|
163
174
|
constructor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element.js","sourceRoot":"","sources":["../../src/modules/element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,EACL,YAAY,EACZ,IAAI,EACJ,eAAe,EACf,WAAW,EACX,eAAe,EACf,UAAU,EACV,aAAa,EACb,QAAQ,EACR,MAAM,EACN,WAAW,GACZ,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"element.js","sourceRoot":"","sources":["../../src/modules/element.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AAE,EAAE;QACtC,YAAY,CAAC,kBAAkB,CAAC,GAAG,CAAC,GAAG,OAAO,CAAC;IACjD,CAAC,CAAC;IAEF,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;CAClD;AAED,MAAM,UAAU,aAAa,CAC3B,OAA2B,EAC3B,OAAiC,EACjC,KAAU;IAEV,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;QACjC,IAAI,CAAC,EAAE,EAAE,MAAM,CAAC,GAAG,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,CAAC,CAAC;QACvE,MAAM,MAAM,GAAG,yBAAyB,CAAC;QACzC,MAAM,OAAO,GAAG,CAAC,EAAe,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;QACvD,MAAM,OAAO,GAAe,GAAG,EAAE;YAC/B,OAAO,CAAC,UAAU,CAAC,EAAE,EAAE,MAAM,CAAC,CAAC;YAC/B,OAAO,CAAC,mBAAmB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC/C,CAAC,CAAC;QACF,MAAM,MAAM,GAAc,CAAC,QAAQ,EAAE,EAAE;YACrC,CAAC,EAAE,EAAE,MAAM,CAAC,GAAG,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC,CAAC;QACxF,CAAC,CAAC;QACF,OAAO,CAAC,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC1C,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KAC1B;IAED,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;AACtB,CAAC"}
|
package/esm/types/state.d.ts
CHANGED
|
@@ -150,7 +150,12 @@ export interface GlobalState extends PiralCustomState {
|
|
|
150
150
|
/**
|
|
151
151
|
* The used (exact) application routes.
|
|
152
152
|
*/
|
|
153
|
-
routes: Dict<ComponentType<RouteComponentProps<any
|
|
153
|
+
routes: Dict<ComponentType<RouteComponentProps<any>> & {
|
|
154
|
+
/**
|
|
155
|
+
* The optional meta data registered with the page.
|
|
156
|
+
*/
|
|
157
|
+
meta?: PiralPageMeta;
|
|
158
|
+
}>;
|
|
154
159
|
/**
|
|
155
160
|
* The current provider.
|
|
156
161
|
*/
|
|
@@ -6,23 +6,28 @@ const React = require("react");
|
|
|
6
6
|
const hooks_1 = require("../hooks");
|
|
7
7
|
const utils_1 = require("../utils");
|
|
8
8
|
const app_codegen_1 = require("../../app.codegen");
|
|
9
|
-
function
|
|
9
|
+
function useShellRoutes() {
|
|
10
10
|
const routes = (0, hooks_1.useGlobalState)((s) => s.routes);
|
|
11
|
+
return React.useMemo(() => Object.entries(routes).map(([path, Component]) => ({
|
|
12
|
+
path,
|
|
13
|
+
Component,
|
|
14
|
+
meta: (Component === null || Component === void 0 ? void 0 : Component.meta) || {},
|
|
15
|
+
matcher: (0, utils_1.createRouteMatcher)(path),
|
|
16
|
+
})), [routes]);
|
|
17
|
+
}
|
|
18
|
+
function usePiletRoutes() {
|
|
11
19
|
const pages = (0, hooks_1.useGlobalState)((s) => s.registry.pages);
|
|
12
|
-
return (
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
matcher: (0, utils_1.createRouteMatcher)(path),
|
|
24
|
-
})),
|
|
25
|
-
]);
|
|
20
|
+
return React.useMemo(() => Object.entries(pages).map(([path, entry]) => ({
|
|
21
|
+
path,
|
|
22
|
+
Component: entry.component,
|
|
23
|
+
meta: entry.meta,
|
|
24
|
+
matcher: (0, utils_1.createRouteMatcher)(path),
|
|
25
|
+
})), [pages]);
|
|
26
|
+
}
|
|
27
|
+
function useRoutes() {
|
|
28
|
+
const shellRoutes = useShellRoutes();
|
|
29
|
+
const piletRoutes = usePiletRoutes();
|
|
30
|
+
return (0, app_codegen_1.useRouteFilter)([...shellRoutes, ...piletRoutes]);
|
|
26
31
|
}
|
|
27
32
|
/**
|
|
28
33
|
* The component for defining the exclusive routes to be used.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PiralRoutes.js","sourceRoot":"","sources":["../../src/components/PiralRoutes.tsx"],"names":[],"mappings":";;;;AAAA,+BAA+B;AAE/B,oCAA0C;AAC1C,oCAA8C;
|
|
1
|
+
{"version":3,"file":"PiralRoutes.js","sourceRoot":"","sources":["../../src/components/PiralRoutes.tsx"],"names":[],"mappings":";;;;AAAA,+BAA+B;AAE/B,oCAA0C;AAC1C,oCAA8C;AAG9C,mDAAmD;AAEnD,SAAS,cAAc;IACrB,MAAM,MAAM,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;IAC/C,OAAO,KAAK,CAAC,OAAO,CAClB,GAAG,EAAE,CACH,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,EAAE,CAAC,CAAC;QACjD,IAAI;QACJ,SAAS;QACT,IAAI,EAAE,CAAA,SAAS,aAAT,SAAS,uBAAT,SAAS,CAAE,IAAI,KAAI,EAAE;QAC3B,OAAO,EAAE,IAAA,0BAAkB,EAAC,IAAI,CAAC;KAClC,CAAC,CAAC,EACL,CAAC,MAAM,CAAC,CACT,CAAC;AACJ,CAAC;AAED,SAAS,cAAc;IACrB,MAAM,KAAK,GAAG,IAAA,sBAAc,EAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,OAAO,KAAK,CAAC,OAAO,CAClB,GAAG,EAAE,CACH,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC;QAC5C,IAAI;QACJ,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,IAAI,EAAE,KAAK,CAAC,IAAI;QAChB,OAAO,EAAE,IAAA,0BAAkB,EAAC,IAAI,CAAC;KAClC,CAAC,CAAC,EACL,CAAC,KAAK,CAAC,CACR,CAAC;AACJ,CAAC;AAED,SAAS,SAAS;IAChB,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,MAAM,WAAW,GAAG,cAAc,EAAE,CAAC;IACrC,OAAO,IAAA,4BAAc,EAAC,CAAC,GAAG,WAAW,EAAE,GAAG,WAAW,CAAC,CAAC,CAAC;AAC1D,CAAC;AAgBD;;GAEG;AACI,MAAM,WAAW,GAA0B,CAAC,EAAmC,EAAE,EAAE;QAAvC,EAAE,QAAQ,EAAE,WAAW,OAAY,EAAP,KAAK,sBAAjC,2BAAmC,CAAF;IAClF,MAAM,KAAK,GAAG,SAAS,EAAE,CAAC;IAC1B,OAAO,oBAAC,WAAW,kBAAC,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,IAAM,KAAK,EAAI,CAAC;AACtE,CAAC,CAAC;AAHW,QAAA,WAAW,eAGtB;AACF,mBAAW,CAAC,WAAW,GAAG,QAAQ,CAAC"}
|
package/lib/modules/element.d.ts
CHANGED
|
@@ -4,6 +4,13 @@ export interface Updatable {
|
|
|
4
4
|
}
|
|
5
5
|
declare global {
|
|
6
6
|
interface Window {
|
|
7
|
+
/**
|
|
8
|
+
* Assigns content in form a ReactChild to be rendered later
|
|
9
|
+
* from a foreign container / element in an piral-content
|
|
10
|
+
* child.
|
|
11
|
+
* @param cid The ID of the piral-content node.
|
|
12
|
+
* @param content The ReactChild to be rendered.
|
|
13
|
+
*/
|
|
7
14
|
assignContent(cid: string, content: any): void;
|
|
8
15
|
}
|
|
9
16
|
}
|
package/lib/modules/element.js
CHANGED
|
@@ -156,11 +156,22 @@ if (typeof window !== 'undefined' && 'customElements' in window) {
|
|
|
156
156
|
* This is a virtual element to render children defined in React / by Piral in other
|
|
157
157
|
* frameworks.
|
|
158
158
|
*
|
|
159
|
+
* Internally, you can use the assignContent function to populate the content to be
|
|
160
|
+
* rendered once the element is attached / mounted in the DOM.
|
|
161
|
+
*
|
|
159
162
|
* Usage:
|
|
160
163
|
*
|
|
161
164
|
* ```
|
|
162
165
|
* <piral-content cid="123"></piral-content>
|
|
163
166
|
* ```
|
|
167
|
+
*
|
|
168
|
+
* where you'd
|
|
169
|
+
*
|
|
170
|
+
* ```
|
|
171
|
+
* window.assignContent("123", myReactContent)
|
|
172
|
+
* ```
|
|
173
|
+
*
|
|
174
|
+
* beforehand.
|
|
164
175
|
*/
|
|
165
176
|
class PiralContent extends HTMLElement {
|
|
166
177
|
constructor() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element.js","sourceRoot":"","sources":["../../src/modules/element.ts"],"names":[],"mappings":";;;AAAA,8CAA8C;AAE9C,oCAWkB;
|
|
1
|
+
{"version":3,"file":"element.js","sourceRoot":"","sources":["../../src/modules/element.ts"],"names":[],"mappings":";;;AAAA,8CAA8C;AAE9C,oCAWkB;AAmBlB,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,gBAAgB,IAAI,MAAM,EAAE;IAC/D;;;;;;;;;OASG;IACH,MAAM,cAAe,SAAQ,WAAW;QAAxC;;YACE,YAAO,GAAe,YAAI,CAAC;YAC3B,WAAM,GAAc,YAAI,CAAC;YAEzB,UAAK,GAAG;gBACN,IAAI,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC;gBAC/B,gBAAgB,EAAE,OAAO,IAAI,CAAC,YAAY,CAAC,oBAAoB,CAAC,KAAK,QAAQ;gBAC7E,MAAM,EAAE,IAAA,oBAAY,EAAC,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;gBACjD,KAAK,EAAE,SAAS;gBAChB,KAAK,EAAE,SAAS;gBAChB,MAAM,EAAE,SAAS;gBACjB,QAAQ,EAAE,IAAA,uBAAe,EA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AC,QAAQ,EAAE,EAAE;YACrC,CAAC,EAAE,EAAE,MAAM,CAAC,GAAG,IAAA,uBAAe,EAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,0BAAa,EAAE,QAAQ,CAAC,CAAC;QACxF,CAAC,CAAC;QACF,OAAO,CAAC,gBAAgB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC1C,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KAC1B;IAED,OAAO,CAAC,YAAI,EAAE,YAAI,CAAC,CAAC;AACtB,CAAC;AArBD,sCAqBC"}
|
package/lib/types/state.d.ts
CHANGED
|
@@ -150,7 +150,12 @@ export interface GlobalState extends PiralCustomState {
|
|
|
150
150
|
/**
|
|
151
151
|
* The used (exact) application routes.
|
|
152
152
|
*/
|
|
153
|
-
routes: Dict<ComponentType<RouteComponentProps<any
|
|
153
|
+
routes: Dict<ComponentType<RouteComponentProps<any>> & {
|
|
154
|
+
/**
|
|
155
|
+
* The optional meta data registered with the page.
|
|
156
|
+
*/
|
|
157
|
+
meta?: PiralPageMeta;
|
|
158
|
+
}>;
|
|
154
159
|
/**
|
|
155
160
|
* The current provider.
|
|
156
161
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-core",
|
|
3
|
-
"version": "1.3.0-beta.
|
|
3
|
+
"version": "1.3.0-beta.6067",
|
|
4
4
|
"description": "The core library for creating a Piral instance.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"portal",
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
75
|
"path-to-regexp": "^1.8.0",
|
|
76
|
-
"piral-base": "1.3.0-beta.
|
|
77
|
-
"piral-debug-utils": "1.3.0-beta.
|
|
76
|
+
"piral-base": "1.3.0-beta.6067",
|
|
77
|
+
"piral-debug-utils": "1.3.0-beta.6067",
|
|
78
78
|
"zustand": "^3.0.0"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"react-router-dom",
|
|
95
95
|
"tslib"
|
|
96
96
|
],
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "c437ea6f768be65c65b5c7251ca6e0bc9f83a4f7"
|
|
98
98
|
}
|
|
@@ -3,26 +3,41 @@ import { RouteComponentProps, SwitchProps } from 'react-router';
|
|
|
3
3
|
import { useGlobalState } from '../hooks';
|
|
4
4
|
import { createRouteMatcher } from '../utils';
|
|
5
5
|
import { RouteSwitchProps } from '../types';
|
|
6
|
+
|
|
6
7
|
import { useRouteFilter } from '../../app.codegen';
|
|
7
8
|
|
|
8
|
-
function
|
|
9
|
+
function useShellRoutes() {
|
|
9
10
|
const routes = useGlobalState((s) => s.routes);
|
|
11
|
+
return React.useMemo(
|
|
12
|
+
() =>
|
|
13
|
+
Object.entries(routes).map(([path, Component]) => ({
|
|
14
|
+
path,
|
|
15
|
+
Component,
|
|
16
|
+
meta: Component?.meta || {},
|
|
17
|
+
matcher: createRouteMatcher(path),
|
|
18
|
+
})),
|
|
19
|
+
[routes],
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function usePiletRoutes() {
|
|
10
24
|
const pages = useGlobalState((s) => s.registry.pages);
|
|
25
|
+
return React.useMemo(
|
|
26
|
+
() =>
|
|
27
|
+
Object.entries(pages).map(([path, entry]) => ({
|
|
28
|
+
path,
|
|
29
|
+
Component: entry.component,
|
|
30
|
+
meta: entry.meta,
|
|
31
|
+
matcher: createRouteMatcher(path),
|
|
32
|
+
})),
|
|
33
|
+
[pages],
|
|
34
|
+
);
|
|
35
|
+
}
|
|
11
36
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
meta: {},
|
|
17
|
-
matcher: createRouteMatcher(path),
|
|
18
|
-
})),
|
|
19
|
-
...Object.entries(pages).map(([path, entry]) => ({
|
|
20
|
-
path,
|
|
21
|
-
Component: entry.component,
|
|
22
|
-
meta: entry.meta,
|
|
23
|
-
matcher: createRouteMatcher(path),
|
|
24
|
-
})),
|
|
25
|
-
]);
|
|
37
|
+
function useRoutes() {
|
|
38
|
+
const shellRoutes = useShellRoutes();
|
|
39
|
+
const piletRoutes = usePiletRoutes();
|
|
40
|
+
return useRouteFilter([...shellRoutes, ...piletRoutes]);
|
|
26
41
|
}
|
|
27
42
|
|
|
28
43
|
/**
|
package/src/modules/element.ts
CHANGED
|
@@ -19,6 +19,13 @@ export interface Updatable {
|
|
|
19
19
|
|
|
20
20
|
declare global {
|
|
21
21
|
interface Window {
|
|
22
|
+
/**
|
|
23
|
+
* Assigns content in form a ReactChild to be rendered later
|
|
24
|
+
* from a foreign container / element in an piral-content
|
|
25
|
+
* child.
|
|
26
|
+
* @param cid The ID of the piral-content node.
|
|
27
|
+
* @param content The ReactChild to be rendered.
|
|
28
|
+
*/
|
|
22
29
|
assignContent(cid: string, content: any): void;
|
|
23
30
|
}
|
|
24
31
|
}
|
|
@@ -198,12 +205,23 @@ if (typeof window !== 'undefined' && 'customElements' in window) {
|
|
|
198
205
|
/**
|
|
199
206
|
* This is a virtual element to render children defined in React / by Piral in other
|
|
200
207
|
* frameworks.
|
|
208
|
+
*
|
|
209
|
+
* Internally, you can use the assignContent function to populate the content to be
|
|
210
|
+
* rendered once the element is attached / mounted in the DOM.
|
|
201
211
|
*
|
|
202
212
|
* Usage:
|
|
203
213
|
*
|
|
204
214
|
* ```
|
|
205
215
|
* <piral-content cid="123"></piral-content>
|
|
206
216
|
* ```
|
|
217
|
+
*
|
|
218
|
+
* where you'd
|
|
219
|
+
*
|
|
220
|
+
* ```
|
|
221
|
+
* window.assignContent("123", myReactContent)
|
|
222
|
+
* ```
|
|
223
|
+
*
|
|
224
|
+
* beforehand.
|
|
207
225
|
*/
|
|
208
226
|
class PiralContent extends HTMLElement {
|
|
209
227
|
dispose: Disposable = noop;
|
package/src/types/api.ts
CHANGED
|
@@ -11,7 +11,7 @@ import type {
|
|
|
11
11
|
PiletLoadingStrategy,
|
|
12
12
|
} from 'piral-base';
|
|
13
13
|
import type {} from 'piral-debug-utils';
|
|
14
|
-
import type { PiletCustomApi
|
|
14
|
+
import type { PiletCustomApi } from './custom';
|
|
15
15
|
import type { AnyComponent, PiralPageMeta } from './components';
|
|
16
16
|
import type { ExtensionParams, ExtensionSlotProps, PiralExtensionSlotMap } from './extension';
|
|
17
17
|
import type { SharedData, DataStoreOptions } from './data';
|
package/src/types/state.ts
CHANGED
|
@@ -182,7 +182,14 @@ export interface GlobalState extends PiralCustomState {
|
|
|
182
182
|
/**
|
|
183
183
|
* The used (exact) application routes.
|
|
184
184
|
*/
|
|
185
|
-
routes: Dict<
|
|
185
|
+
routes: Dict<
|
|
186
|
+
ComponentType<RouteComponentProps<any>> & {
|
|
187
|
+
/**
|
|
188
|
+
* The optional meta data registered with the page.
|
|
189
|
+
*/
|
|
190
|
+
meta?: PiralPageMeta;
|
|
191
|
+
}
|
|
192
|
+
>;
|
|
186
193
|
/**
|
|
187
194
|
* The current provider.
|
|
188
195
|
*/
|