rasengan 1.0.0-beta.6 → 1.0.0-beta.7
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/lib/routing/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CustomLink } from "./components/index.js";
|
|
2
|
+
export type { Metadata } from "./types.js";
|
|
2
3
|
export { defineRouteLayout, defineRoutePage, defineRouter, } from "./utils/index.js";
|
|
3
4
|
export { RouterComponent } from "./interfaces.js";
|
|
4
5
|
export { Outlet, useLocation, useNavigate, useParams, useSearchParams, useFetcher, useMatch, useRoutes, useResolvedPath, matchRoutes, generatePath, matchPath, createRoutesFromChildren, Navigate, } from "react-router-dom";
|
package/lib/routing/types.d.ts
CHANGED
|
@@ -2,8 +2,15 @@
|
|
|
2
2
|
export type NotFoundComponentContainerProps = {
|
|
3
3
|
content: React.FC;
|
|
4
4
|
};
|
|
5
|
-
export type
|
|
5
|
+
export type MetadataLink = {
|
|
6
|
+
rel: string;
|
|
7
|
+
type?: string;
|
|
8
|
+
sizes?: string;
|
|
9
|
+
href: string;
|
|
10
|
+
};
|
|
11
|
+
export type MetadataTag = {
|
|
6
12
|
name?: string;
|
|
7
13
|
property?: string;
|
|
8
14
|
content: string;
|
|
9
15
|
};
|
|
16
|
+
export type Metadata = MetadataTag | MetadataLink;
|
|
@@ -247,6 +247,14 @@ export const defineRouter = (option) => {
|
|
|
247
247
|
*/
|
|
248
248
|
export const generateMetadata = (metadatas) => {
|
|
249
249
|
return metadatas.map((metadata) => {
|
|
250
|
-
|
|
250
|
+
const { rel, sizes, type, href } = metadata;
|
|
251
|
+
const { content, name, property } = metadata;
|
|
252
|
+
if (rel && href) {
|
|
253
|
+
return (_jsx("link", { rel: rel, sizes: sizes, type: type, href: href }, rel));
|
|
254
|
+
}
|
|
255
|
+
if (property) {
|
|
256
|
+
return (_jsx("meta", { property: property, content: content }, property));
|
|
257
|
+
}
|
|
258
|
+
return (_jsx("meta", { name: name, content: content }, name));
|
|
251
259
|
});
|
|
252
260
|
};
|