dn-react-router-toolkit 0.1.7 → 0.1.9
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/components/client_env.d.mts +7 -0
- package/dist/components/client_env.d.ts +7 -0
- package/dist/{seo-kit/seo_loader.js → components/client_env.js} +17 -35
- package/dist/components/client_env.mjs +19 -0
- package/dist/seo-kit/seo.d.mts +19 -51
- package/dist/seo-kit/seo.d.ts +19 -51
- package/dist/seo-kit/seo.js +246 -238
- package/dist/seo-kit/seo.mjs +246 -238
- package/package.json +1 -1
- package/dist/seo-kit/index.d.mts +0 -6
- package/dist/seo-kit/index.d.ts +0 -6
- package/dist/seo-kit/index.js +0 -321
- package/dist/seo-kit/index.mjs +0 -282
- package/dist/seo-kit/loader.d.mts +0 -7
- package/dist/seo-kit/loader.d.ts +0 -7
- package/dist/seo-kit/loader.js +0 -43
- package/dist/seo-kit/loader.mjs +0 -18
- package/dist/seo-kit/seo_loader.d.mts +0 -16
- package/dist/seo-kit/seo_loader.d.ts +0 -16
- package/dist/seo-kit/seo_loader.mjs +0 -31
|
@@ -27,42 +27,24 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
|
|
30
|
-
// src/
|
|
31
|
-
var
|
|
32
|
-
__export(
|
|
33
|
-
|
|
30
|
+
// src/components/client_env.tsx
|
|
31
|
+
var client_env_exports = {};
|
|
32
|
+
__export(client_env_exports, {
|
|
33
|
+
default: () => ClientEnv
|
|
34
34
|
});
|
|
35
|
-
module.exports = __toCommonJS(
|
|
36
|
-
|
|
37
|
-
// src/seo-kit/loader.ts
|
|
38
|
-
function createLoader(fn = () => ({})) {
|
|
39
|
-
let loadedData;
|
|
40
|
-
return {
|
|
41
|
-
getData() {
|
|
42
|
-
return loadedData;
|
|
43
|
-
},
|
|
44
|
-
wrap(mapper) {
|
|
45
|
-
return async function Thing(props) {
|
|
46
|
-
loadedData = await fn(props);
|
|
47
|
-
return mapper(loadedData);
|
|
48
|
-
};
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// src/seo-kit/seo_loader.tsx
|
|
35
|
+
module.exports = __toCommonJS(client_env_exports);
|
|
54
36
|
var import_react = __toESM(require("react"));
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
37
|
+
var import_react_router = require("react-router");
|
|
38
|
+
function ClientEnv({ dataKey = "ENV" }) {
|
|
39
|
+
const data = (0, import_react_router.useRouteLoaderData)("root");
|
|
40
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, data && /* @__PURE__ */ import_react.default.createElement(
|
|
41
|
+
"script",
|
|
42
|
+
{
|
|
43
|
+
dangerouslySetInnerHTML: {
|
|
44
|
+
__html: `window.process = ${JSON.stringify({
|
|
45
|
+
env: data?.[dataKey]
|
|
46
|
+
})}`
|
|
47
|
+
}
|
|
62
48
|
}
|
|
63
|
-
|
|
49
|
+
));
|
|
64
50
|
}
|
|
65
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
-
0 && (module.exports = {
|
|
67
|
-
createSEOLoader
|
|
68
|
-
});
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// src/components/client_env.tsx
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { useRouteLoaderData } from "react-router";
|
|
4
|
+
function ClientEnv({ dataKey = "ENV" }) {
|
|
5
|
+
const data = useRouteLoaderData("root");
|
|
6
|
+
return /* @__PURE__ */ React.createElement(React.Fragment, null, data && /* @__PURE__ */ React.createElement(
|
|
7
|
+
"script",
|
|
8
|
+
{
|
|
9
|
+
dangerouslySetInnerHTML: {
|
|
10
|
+
__html: `window.process = ${JSON.stringify({
|
|
11
|
+
env: data?.[dataKey]
|
|
12
|
+
})}`
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
));
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
ClientEnv as default
|
|
19
|
+
};
|
package/dist/seo-kit/seo.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as Schema from 'schema-dts';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import * as Schema from 'schema-dts';
|
|
3
3
|
import { MetaFunction } from 'react-router';
|
|
4
4
|
|
|
5
5
|
type SEOImage = {
|
|
@@ -15,8 +15,8 @@ declare function configSEO(config: {
|
|
|
15
15
|
siteName: string;
|
|
16
16
|
description: string;
|
|
17
17
|
keywords?: string[];
|
|
18
|
-
thumbnail?: SEOImage | (() => SEOImage | null
|
|
19
|
-
structedData?: Schema.Thing[] | (() => Schema.Thing[]
|
|
18
|
+
thumbnail?: SEOImage | (() => SEOImage | null);
|
|
19
|
+
structedData?: Schema.Thing[] | (() => Schema.Thing[]);
|
|
20
20
|
copyright?: string;
|
|
21
21
|
}): {
|
|
22
22
|
config: {
|
|
@@ -24,26 +24,26 @@ declare function configSEO(config: {
|
|
|
24
24
|
siteName: string;
|
|
25
25
|
description: string;
|
|
26
26
|
keywords?: string[];
|
|
27
|
-
thumbnail?: SEOImage | (() => SEOImage | null
|
|
28
|
-
structedData?: Schema.Thing[] | (() => Schema.Thing[]
|
|
27
|
+
thumbnail?: SEOImage | (() => SEOImage | null);
|
|
28
|
+
structedData?: Schema.Thing[] | (() => Schema.Thing[]);
|
|
29
29
|
copyright?: string;
|
|
30
30
|
};
|
|
31
|
-
init(props
|
|
31
|
+
init: (props: {
|
|
32
32
|
title?: string;
|
|
33
33
|
description?: string;
|
|
34
34
|
keywords?: string[];
|
|
35
35
|
path?: string;
|
|
36
36
|
type?: string;
|
|
37
|
-
canonicalPath
|
|
37
|
+
canonicalPath: string;
|
|
38
38
|
breadcrumbs?: {
|
|
39
|
-
|
|
39
|
+
title: string;
|
|
40
40
|
href: string;
|
|
41
41
|
}[];
|
|
42
42
|
thumbnail?: SEOImage;
|
|
43
43
|
images?: SEOImage[];
|
|
44
44
|
updatedAt?: Date;
|
|
45
45
|
createdAt?: Date;
|
|
46
|
-
structedData?: Schema.Thing[] | (() => Schema.Thing[]
|
|
46
|
+
structedData?: Schema.Thing[] | (() => Schema.Thing[]);
|
|
47
47
|
article?: boolean;
|
|
48
48
|
blogPosting?: boolean;
|
|
49
49
|
creativeWork?: boolean;
|
|
@@ -56,48 +56,16 @@ declare function configSEO(config: {
|
|
|
56
56
|
updatedAt?: Date;
|
|
57
57
|
createdAt?: Date;
|
|
58
58
|
}[];
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
props: {
|
|
70
|
-
title?: string;
|
|
71
|
-
description?: string;
|
|
72
|
-
keywords?: string[];
|
|
73
|
-
path?: string;
|
|
74
|
-
type?: string;
|
|
75
|
-
canonicalPath?: string;
|
|
76
|
-
breadcrumbs?: {
|
|
77
|
-
label: string;
|
|
78
|
-
href: string;
|
|
79
|
-
}[];
|
|
80
|
-
thumbnail?: SEOImage;
|
|
81
|
-
images?: SEOImage[];
|
|
82
|
-
updatedAt?: Date;
|
|
83
|
-
createdAt?: Date;
|
|
84
|
-
structedData?: Schema.Thing[] | (() => Schema.Thing[] | Promise<Schema.Thing[]>);
|
|
85
|
-
article?: boolean;
|
|
86
|
-
blogPosting?: boolean;
|
|
87
|
-
creativeWork?: boolean;
|
|
88
|
-
visualArtwork?: boolean;
|
|
89
|
-
collection?: {
|
|
90
|
-
title: string;
|
|
91
|
-
url: string;
|
|
92
|
-
description?: string;
|
|
93
|
-
thumbnail?: SEOImage;
|
|
94
|
-
updatedAt?: Date;
|
|
95
|
-
createdAt?: Date;
|
|
96
|
-
}[];
|
|
97
|
-
};
|
|
98
|
-
meta: MetaFunction<unknown, Record<string, unknown>>;
|
|
99
|
-
generateJSONLD: () => React.JSX.Element;
|
|
100
|
-
}>;
|
|
59
|
+
}) => {
|
|
60
|
+
pageTitle: string;
|
|
61
|
+
type: string | undefined;
|
|
62
|
+
description: string;
|
|
63
|
+
keywords: string[] | undefined;
|
|
64
|
+
url: string;
|
|
65
|
+
thumbnail: SEOImage | null | undefined;
|
|
66
|
+
};
|
|
67
|
+
meta: MetaFunction<unknown, Record<string, unknown>>;
|
|
68
|
+
StructedData: () => React.JSX.Element;
|
|
101
69
|
};
|
|
102
70
|
|
|
103
71
|
export { type SEO, type SEOImage, configSEO };
|
package/dist/seo-kit/seo.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as Schema from 'schema-dts';
|
|
2
1
|
import React from 'react';
|
|
2
|
+
import * as Schema from 'schema-dts';
|
|
3
3
|
import { MetaFunction } from 'react-router';
|
|
4
4
|
|
|
5
5
|
type SEOImage = {
|
|
@@ -15,8 +15,8 @@ declare function configSEO(config: {
|
|
|
15
15
|
siteName: string;
|
|
16
16
|
description: string;
|
|
17
17
|
keywords?: string[];
|
|
18
|
-
thumbnail?: SEOImage | (() => SEOImage | null
|
|
19
|
-
structedData?: Schema.Thing[] | (() => Schema.Thing[]
|
|
18
|
+
thumbnail?: SEOImage | (() => SEOImage | null);
|
|
19
|
+
structedData?: Schema.Thing[] | (() => Schema.Thing[]);
|
|
20
20
|
copyright?: string;
|
|
21
21
|
}): {
|
|
22
22
|
config: {
|
|
@@ -24,26 +24,26 @@ declare function configSEO(config: {
|
|
|
24
24
|
siteName: string;
|
|
25
25
|
description: string;
|
|
26
26
|
keywords?: string[];
|
|
27
|
-
thumbnail?: SEOImage | (() => SEOImage | null
|
|
28
|
-
structedData?: Schema.Thing[] | (() => Schema.Thing[]
|
|
27
|
+
thumbnail?: SEOImage | (() => SEOImage | null);
|
|
28
|
+
structedData?: Schema.Thing[] | (() => Schema.Thing[]);
|
|
29
29
|
copyright?: string;
|
|
30
30
|
};
|
|
31
|
-
init(props
|
|
31
|
+
init: (props: {
|
|
32
32
|
title?: string;
|
|
33
33
|
description?: string;
|
|
34
34
|
keywords?: string[];
|
|
35
35
|
path?: string;
|
|
36
36
|
type?: string;
|
|
37
|
-
canonicalPath
|
|
37
|
+
canonicalPath: string;
|
|
38
38
|
breadcrumbs?: {
|
|
39
|
-
|
|
39
|
+
title: string;
|
|
40
40
|
href: string;
|
|
41
41
|
}[];
|
|
42
42
|
thumbnail?: SEOImage;
|
|
43
43
|
images?: SEOImage[];
|
|
44
44
|
updatedAt?: Date;
|
|
45
45
|
createdAt?: Date;
|
|
46
|
-
structedData?: Schema.Thing[] | (() => Schema.Thing[]
|
|
46
|
+
structedData?: Schema.Thing[] | (() => Schema.Thing[]);
|
|
47
47
|
article?: boolean;
|
|
48
48
|
blogPosting?: boolean;
|
|
49
49
|
creativeWork?: boolean;
|
|
@@ -56,48 +56,16 @@ declare function configSEO(config: {
|
|
|
56
56
|
updatedAt?: Date;
|
|
57
57
|
createdAt?: Date;
|
|
58
58
|
}[];
|
|
59
|
-
})
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
props: {
|
|
70
|
-
title?: string;
|
|
71
|
-
description?: string;
|
|
72
|
-
keywords?: string[];
|
|
73
|
-
path?: string;
|
|
74
|
-
type?: string;
|
|
75
|
-
canonicalPath?: string;
|
|
76
|
-
breadcrumbs?: {
|
|
77
|
-
label: string;
|
|
78
|
-
href: string;
|
|
79
|
-
}[];
|
|
80
|
-
thumbnail?: SEOImage;
|
|
81
|
-
images?: SEOImage[];
|
|
82
|
-
updatedAt?: Date;
|
|
83
|
-
createdAt?: Date;
|
|
84
|
-
structedData?: Schema.Thing[] | (() => Schema.Thing[] | Promise<Schema.Thing[]>);
|
|
85
|
-
article?: boolean;
|
|
86
|
-
blogPosting?: boolean;
|
|
87
|
-
creativeWork?: boolean;
|
|
88
|
-
visualArtwork?: boolean;
|
|
89
|
-
collection?: {
|
|
90
|
-
title: string;
|
|
91
|
-
url: string;
|
|
92
|
-
description?: string;
|
|
93
|
-
thumbnail?: SEOImage;
|
|
94
|
-
updatedAt?: Date;
|
|
95
|
-
createdAt?: Date;
|
|
96
|
-
}[];
|
|
97
|
-
};
|
|
98
|
-
meta: MetaFunction<unknown, Record<string, unknown>>;
|
|
99
|
-
generateJSONLD: () => React.JSX.Element;
|
|
100
|
-
}>;
|
|
59
|
+
}) => {
|
|
60
|
+
pageTitle: string;
|
|
61
|
+
type: string | undefined;
|
|
62
|
+
description: string;
|
|
63
|
+
keywords: string[] | undefined;
|
|
64
|
+
url: string;
|
|
65
|
+
thumbnail: SEOImage | null | undefined;
|
|
66
|
+
};
|
|
67
|
+
meta: MetaFunction<unknown, Record<string, unknown>>;
|
|
68
|
+
StructedData: () => React.JSX.Element;
|
|
101
69
|
};
|
|
102
70
|
|
|
103
71
|
export { type SEO, type SEOImage, configSEO };
|