dn-react-router-toolkit 0.1.1 → 0.1.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/auth-kit/apple_auth.d.mts +24 -0
- package/dist/{esm/auth-kit → auth-kit}/apple_auth.d.ts +11 -2
- package/dist/auth-kit/apple_auth.js +75 -0
- package/dist/auth-kit/apple_auth.mjs +50 -0
- package/dist/auth-kit/auth_service.d.mts +73 -0
- package/dist/{esm/auth-kit → auth-kit}/auth_service.d.ts +17 -11
- package/dist/auth-kit/auth_service.js +257 -0
- package/dist/auth-kit/auth_service.mjs +218 -0
- package/dist/auth-kit/client/google_login_button.d.mts +9 -0
- package/dist/auth-kit/client/google_login_button.d.ts +9 -0
- package/dist/auth-kit/client/google_login_button.js +67 -0
- package/dist/auth-kit/client/google_login_button.mjs +32 -0
- package/dist/auth-kit/client/redirect_page.d.mts +5 -0
- package/dist/auth-kit/client/redirect_page.d.ts +5 -0
- package/dist/auth-kit/client/redirect_page.js +53 -0
- package/dist/auth-kit/client/redirect_page.mjs +18 -0
- package/dist/auth-kit/google_auth.d.mts +27 -0
- package/dist/{esm/auth-kit → auth-kit}/google_auth.d.ts +11 -2
- package/dist/auth-kit/google_auth.js +144 -0
- package/dist/auth-kit/google_auth.mjs +117 -0
- package/dist/auth-kit/jwt.d.mts +18 -0
- package/dist/{esm/auth-kit → auth-kit}/jwt.d.ts +5 -2
- package/dist/auth-kit/jwt.js +76 -0
- package/dist/auth-kit/jwt.mjs +51 -0
- package/dist/auth-kit/kakao_auth.d.mts +24 -0
- package/dist/{esm/auth-kit → auth-kit}/kakao_auth.d.ts +11 -2
- package/dist/auth-kit/kakao_auth.js +115 -0
- package/dist/auth-kit/kakao_auth.mjs +88 -0
- package/dist/auth-kit/repository.d.mts +42 -0
- package/dist/{esm/auth-kit → auth-kit}/repository.d.ts +3 -1
- package/dist/auth-kit/repository.js +18 -0
- package/dist/auth-kit/repository.mjs +0 -0
- package/dist/auth-kit/with_auth.d.mts +17 -0
- package/dist/auth-kit/with_auth.d.ts +17 -0
- package/dist/auth-kit/with_auth.js +108 -0
- package/dist/auth-kit/with_auth.mjs +71 -0
- package/dist/cn.d.mts +3 -0
- package/dist/cn.d.ts +3 -0
- package/dist/cn.js +32 -0
- package/dist/cn.mjs +7 -0
- package/dist/components/index.d.mts +5 -0
- package/dist/components/index.d.ts +5 -0
- package/dist/components/index.js +261 -0
- package/dist/components/index.mjs +219 -0
- package/dist/components/modal/fullscreen_container.d.mts +7 -0
- package/dist/components/modal/fullscreen_container.d.ts +7 -0
- package/dist/components/modal/fullscreen_container.js +102 -0
- package/dist/components/modal/fullscreen_container.mjs +68 -0
- package/dist/components/modal/hooks.d.mts +18 -0
- package/dist/components/modal/hooks.d.ts +18 -0
- package/dist/components/modal/hooks.js +236 -0
- package/dist/components/modal/hooks.mjs +204 -0
- package/dist/components/modal/index.d.mts +4 -0
- package/dist/components/modal/index.d.ts +4 -0
- package/dist/components/modal/index.js +238 -0
- package/dist/components/modal/index.mjs +203 -0
- package/dist/components/modal/modal.d.mts +13 -0
- package/dist/components/modal/modal.d.ts +13 -0
- package/dist/components/modal/modal.js +155 -0
- package/dist/components/modal/modal.mjs +130 -0
- package/dist/components/styles.d.mts +9 -0
- package/dist/components/styles.d.ts +9 -0
- package/dist/components/styles.js +48 -0
- package/dist/components/styles.mjs +17 -0
- package/dist/date.d.mts +3 -0
- package/dist/date.d.ts +3 -0
- package/dist/date.js +63 -0
- package/dist/date.mjs +28 -0
- package/dist/file-kit/cdn.d.mts +5 -0
- package/dist/file-kit/cdn.d.ts +5 -0
- package/dist/file-kit/cdn.js +34 -0
- package/dist/file-kit/cdn.mjs +9 -0
- package/dist/file-kit/client/drop_file_input.d.mts +33 -0
- package/dist/{esm/file-kit → file-kit}/client/drop_file_input.d.ts +10 -8
- package/dist/file-kit/client/drop_file_input.js +235 -0
- package/dist/file-kit/client/drop_file_input.mjs +205 -0
- package/dist/file-kit/client/file_uploader.d.mts +13 -0
- package/dist/{esm/file-kit → file-kit}/client/file_uploader.d.ts +4 -2
- package/dist/file-kit/client/file_uploader.js +115 -0
- package/dist/file-kit/client/file_uploader.mjs +90 -0
- package/dist/file-kit/file_service.d.mts +26 -0
- package/dist/{esm/file-kit → file-kit}/file_service.d.ts +7 -4
- package/dist/file-kit/file_service.js +60 -0
- package/dist/file-kit/file_service.mjs +35 -0
- package/dist/file-kit/object_storage.d.mts +17 -0
- package/dist/{esm/file-kit → file-kit}/object_storage.d.ts +6 -2
- package/dist/file-kit/object_storage.js +78 -0
- package/dist/file-kit/object_storage.mjs +57 -0
- package/dist/file-kit/repository.d.mts +16 -0
- package/dist/{esm/file-kit → file-kit}/repository.d.ts +3 -1
- package/dist/file-kit/repository.js +18 -0
- package/dist/file-kit/repository.mjs +0 -0
- package/dist/file-kit/responsive_image.d.mts +20 -0
- package/dist/file-kit/responsive_image.d.ts +20 -0
- package/dist/file-kit/responsive_image.js +123 -0
- package/dist/file-kit/responsive_image.mjs +87 -0
- package/dist/http-kit/index.d.mts +1 -0
- package/dist/http-kit/index.d.ts +1 -0
- package/dist/http-kit/index.js +111 -0
- package/dist/http-kit/index.mjs +68 -0
- package/dist/http-kit/response.d.mts +19 -0
- package/dist/http-kit/response.d.ts +19 -0
- package/dist/http-kit/response.js +109 -0
- package/dist/http-kit/response.mjs +68 -0
- package/dist/index.d.mts +4 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +91 -0
- package/dist/index.mjs +51 -0
- package/dist/route/api/auth/login/[provider]/route.js +113 -0
- package/dist/route/api/auth/login/[provider]/route.mjs +86 -0
- package/dist/route/api/auth/login/_provider_/route.d.mts +20 -0
- package/dist/route/api/auth/login/_provider_/route.d.ts +20 -0
- package/dist/route/api/auth/login/route.d.mts +14 -0
- package/dist/route/api/auth/login/route.d.ts +14 -0
- package/dist/route/api/auth/login/route.js +107 -0
- package/dist/route/api/auth/login/route.mjs +80 -0
- package/dist/route/api/auth/logout/route.d.mts +14 -0
- package/dist/route/api/auth/logout/route.d.ts +14 -0
- package/dist/route/api/auth/logout/route.js +98 -0
- package/dist/route/api/auth/logout/route.mjs +71 -0
- package/dist/route/api/auth/refresh/route.d.mts +13 -0
- package/dist/route/api/auth/refresh/route.d.ts +13 -0
- package/dist/route/api/auth/refresh/route.js +92 -0
- package/dist/route/api/auth/refresh/route.mjs +65 -0
- package/dist/route/api/auth/route.d.mts +13 -0
- package/dist/route/api/auth/route.d.ts +13 -0
- package/dist/route/api/auth/route.js +82 -0
- package/dist/route/api/auth/route.mjs +55 -0
- package/dist/route/api/files/[fileId]/route.js +99 -0
- package/dist/route/api/files/[fileId]/route.mjs +72 -0
- package/dist/route/api/files/_fileId_/route.d.mts +17 -0
- package/dist/route/api/files/_fileId_/route.d.ts +17 -0
- package/dist/route/api/files/route.d.mts +16 -0
- package/dist/route/api/files/route.d.ts +16 -0
- package/dist/route/api/files/route.js +106 -0
- package/dist/route/api/files/route.mjs +79 -0
- package/dist/route/api.d.mts +29 -0
- package/dist/route/api.d.ts +29 -0
- package/dist/route/api.js +395 -0
- package/dist/route/api.mjs +368 -0
- package/dist/route/auth/callback/[provider]/route.js +120 -0
- package/dist/route/auth/callback/[provider]/route.mjs +93 -0
- package/dist/route/auth/callback/_provider_/route.d.mts +20 -0
- package/dist/route/auth/callback/_provider_/route.d.ts +20 -0
- package/dist/seo-kit/index.d.mts +6 -0
- package/dist/seo-kit/index.d.ts +6 -0
- package/dist/seo-kit/index.js +321 -0
- package/dist/seo-kit/index.mjs +282 -0
- package/dist/seo-kit/loader.d.mts +7 -0
- package/dist/seo-kit/loader.d.ts +7 -0
- package/dist/seo-kit/loader.js +43 -0
- package/dist/seo-kit/loader.mjs +18 -0
- package/dist/seo-kit/seo.d.mts +103 -0
- package/dist/{esm/seo-kit → seo-kit}/seo.d.ts +10 -6
- package/dist/seo-kit/seo.js +286 -0
- package/dist/seo-kit/seo.mjs +251 -0
- package/dist/seo-kit/seo_loader.d.mts +16 -0
- package/dist/seo-kit/seo_loader.d.ts +16 -0
- package/dist/seo-kit/seo_loader.js +68 -0
- package/dist/seo-kit/seo_loader.mjs +31 -0
- package/dist/singleton.d.mts +3 -0
- package/dist/singleton.d.ts +3 -0
- package/dist/singleton.js +37 -0
- package/dist/singleton.mjs +12 -0
- package/dist/slug.d.mts +3 -0
- package/dist/slug.d.ts +3 -0
- package/dist/slug.js +32 -0
- package/dist/slug.mjs +7 -0
- package/package.json +36 -34
- package/tsup.config.ts +9 -0
- package/dist/cjs/auth-kit/apple_auth.js +0 -61
- package/dist/cjs/auth-kit/auth_service.js +0 -204
- package/dist/cjs/auth-kit/client/google_login_button.js +0 -19
- package/dist/cjs/auth-kit/client/redirect_page.js +0 -18
- package/dist/cjs/auth-kit/google_auth.js +0 -69
- package/dist/cjs/auth-kit/jwt.js +0 -54
- package/dist/cjs/auth-kit/kakao_auth.js +0 -43
- package/dist/cjs/auth-kit/repository.js +0 -2
- package/dist/cjs/auth-kit/with_auth.js +0 -46
- package/dist/cjs/cn.js +0 -6
- package/dist/cjs/components/index.js +0 -18
- package/dist/cjs/components/modal/fullscreen_container.js +0 -49
- package/dist/cjs/components/modal/hooks.js +0 -76
- package/dist/cjs/components/modal/index.js +0 -19
- package/dist/cjs/components/modal/modal.js +0 -79
- package/dist/cjs/components/styles.js +0 -10
- package/dist/cjs/date.js +0 -31
- package/dist/cjs/file-kit/cdn.js +0 -9
- package/dist/cjs/file-kit/client/drop_file_input.js +0 -148
- package/dist/cjs/file-kit/client/file_uploader.js +0 -88
- package/dist/cjs/file-kit/file_service.js +0 -32
- package/dist/cjs/file-kit/object_storage.js +0 -51
- package/dist/cjs/file-kit/repository.js +0 -2
- package/dist/cjs/file-kit/responsive_image.js +0 -63
- package/dist/cjs/http-kit/index.js +0 -17
- package/dist/cjs/http-kit/response.js +0 -37
- package/dist/cjs/index.js +0 -20
- package/dist/cjs/route/api/auth/login/[provider]/route.js +0 -36
- package/dist/cjs/route/api/auth/login/route.js +0 -35
- package/dist/cjs/route/api/auth/logout/route.js +0 -22
- package/dist/cjs/route/api/auth/refresh/route.js +0 -22
- package/dist/cjs/route/api/auth/route.js +0 -12
- package/dist/cjs/route/api/files/[fileId]/route.js +0 -20
- package/dist/cjs/route/api/files/route.js +0 -34
- package/dist/cjs/route/auth/callback/[provider]/route.js +0 -38
- package/dist/cjs/route/index.js +0 -80
- package/dist/cjs/seo-kit/index.js +0 -19
- package/dist/cjs/seo-kit/loader.js +0 -17
- package/dist/cjs/seo-kit/seo.js +0 -278
- package/dist/cjs/seo-kit/seo_loader.js +0 -15
- package/dist/cjs/singleton.js +0 -12
- package/dist/cjs/slug.js +0 -10
- package/dist/esm/auth-kit/apple_auth.js +0 -57
- package/dist/esm/auth-kit/auth_service.js +0 -197
- package/dist/esm/auth-kit/client/google_login_button.d.ts +0 -5
- package/dist/esm/auth-kit/client/google_login_button.js +0 -16
- package/dist/esm/auth-kit/client/redirect_page.d.ts +0 -1
- package/dist/esm/auth-kit/client/redirect_page.js +0 -15
- package/dist/esm/auth-kit/google_auth.js +0 -65
- package/dist/esm/auth-kit/jwt.js +0 -50
- package/dist/esm/auth-kit/kakao_auth.js +0 -39
- package/dist/esm/auth-kit/repository.js +0 -1
- package/dist/esm/auth-kit/with_auth.d.ts +0 -12
- package/dist/esm/auth-kit/with_auth.js +0 -43
- package/dist/esm/cn.d.ts +0 -1
- package/dist/esm/cn.js +0 -3
- package/dist/esm/components/index.d.ts +0 -2
- package/dist/esm/components/index.js +0 -2
- package/dist/esm/components/modal/fullscreen_container.d.ts +0 -5
- package/dist/esm/components/modal/fullscreen_container.js +0 -45
- package/dist/esm/components/modal/hooks.d.ts +0 -15
- package/dist/esm/components/modal/hooks.js +0 -67
- package/dist/esm/components/modal/index.d.ts +0 -3
- package/dist/esm/components/modal/index.js +0 -3
- package/dist/esm/components/modal/modal.d.ts +0 -10
- package/dist/esm/components/modal/modal.js +0 -43
- package/dist/esm/components/styles.d.ts +0 -7
- package/dist/esm/components/styles.js +0 -7
- package/dist/esm/date.d.ts +0 -1
- package/dist/esm/date.js +0 -24
- package/dist/esm/file-kit/cdn.d.ts +0 -3
- package/dist/esm/file-kit/cdn.js +0 -5
- package/dist/esm/file-kit/client/drop_file_input.js +0 -144
- package/dist/esm/file-kit/client/file_uploader.js +0 -84
- package/dist/esm/file-kit/file_service.js +0 -28
- package/dist/esm/file-kit/object_storage.js +0 -47
- package/dist/esm/file-kit/repository.js +0 -1
- package/dist/esm/file-kit/responsive_image.d.ts +0 -17
- package/dist/esm/file-kit/responsive_image.js +0 -58
- package/dist/esm/http-kit/index.d.ts +0 -1
- package/dist/esm/http-kit/index.js +0 -1
- package/dist/esm/http-kit/response.d.ts +0 -17
- package/dist/esm/http-kit/response.js +0 -31
- package/dist/esm/index.d.ts +0 -4
- package/dist/esm/index.js +0 -4
- package/dist/esm/route/api/auth/login/[provider]/route.d.ts +0 -10
- package/dist/esm/route/api/auth/login/[provider]/route.js +0 -32
- package/dist/esm/route/api/auth/login/route.d.ts +0 -6
- package/dist/esm/route/api/auth/login/route.js +0 -31
- package/dist/esm/route/api/auth/logout/route.d.ts +0 -6
- package/dist/esm/route/api/auth/logout/route.js +0 -18
- package/dist/esm/route/api/auth/refresh/route.d.ts +0 -4
- package/dist/esm/route/api/auth/refresh/route.js +0 -18
- package/dist/esm/route/api/auth/route.d.ts +0 -4
- package/dist/esm/route/api/auth/route.js +0 -8
- package/dist/esm/route/api/files/[fileId]/route.d.ts +0 -8
- package/dist/esm/route/api/files/[fileId]/route.js +0 -16
- package/dist/esm/route/api/files/route.d.ts +0 -6
- package/dist/esm/route/api/files/route.js +0 -30
- package/dist/esm/route/auth/callback/[provider]/route.d.ts +0 -11
- package/dist/esm/route/auth/callback/[provider]/route.js +0 -34
- package/dist/esm/route/index.d.ts +0 -22
- package/dist/esm/route/index.js +0 -76
- package/dist/esm/seo-kit/index.d.ts +0 -3
- package/dist/esm/seo-kit/index.js +0 -3
- package/dist/esm/seo-kit/loader.d.ts +0 -5
- package/dist/esm/seo-kit/loader.js +0 -14
- package/dist/esm/seo-kit/seo.js +0 -275
- package/dist/esm/seo-kit/seo_loader.d.ts +0 -12
- package/dist/esm/seo-kit/seo_loader.js +0 -12
- package/dist/esm/singleton.d.ts +0 -1
- package/dist/esm/singleton.js +0 -9
- package/dist/esm/slug.d.ts +0 -1
- package/dist/esm/slug.js +0 -6
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// src/seo-kit/index.ts
|
|
31
|
+
var seo_kit_exports = {};
|
|
32
|
+
__export(seo_kit_exports, {
|
|
33
|
+
configSEO: () => configSEO,
|
|
34
|
+
createLoader: () => createLoader,
|
|
35
|
+
createSEOLoader: () => createSEOLoader
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(seo_kit_exports);
|
|
38
|
+
|
|
39
|
+
// src/seo-kit/loader.ts
|
|
40
|
+
function createLoader(fn = () => ({})) {
|
|
41
|
+
let loadedData;
|
|
42
|
+
return {
|
|
43
|
+
getData() {
|
|
44
|
+
return loadedData;
|
|
45
|
+
},
|
|
46
|
+
wrap(mapper) {
|
|
47
|
+
return async function Thing(props) {
|
|
48
|
+
loadedData = await fn(props);
|
|
49
|
+
return mapper(loadedData);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// src/seo-kit/seo_loader.tsx
|
|
56
|
+
var import_react = __toESM(require("react"));
|
|
57
|
+
function createSEOLoader(fn = () => ({})) {
|
|
58
|
+
const loader = createLoader(fn);
|
|
59
|
+
return {
|
|
60
|
+
...loader,
|
|
61
|
+
meta: loader.wrap((data) => data.seo.meta),
|
|
62
|
+
Page(Fc) {
|
|
63
|
+
return loader.wrap((data) => /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, data.seo?.generateJSONLD(), /* @__PURE__ */ import_react.default.createElement(Fc, { ...data })));
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// src/seo-kit/seo.tsx
|
|
69
|
+
var import_react2 = __toESM(require("react"));
|
|
70
|
+
function configSEO(config) {
|
|
71
|
+
return {
|
|
72
|
+
config,
|
|
73
|
+
async init(props = {}) {
|
|
74
|
+
const canonicalPath = props.canonicalPath;
|
|
75
|
+
const url = canonicalPath ? `${config.origin}${canonicalPath}` : `${config.origin}${props.path || ""}`;
|
|
76
|
+
const pageTitle = props.title ? `${props.title} | ${config.siteName}` : config.siteName;
|
|
77
|
+
const description = props.description || config.description;
|
|
78
|
+
const keywords = props.keywords || config.keywords;
|
|
79
|
+
const websiteSchemaId = `${config.origin}/#website`;
|
|
80
|
+
const websiteSchema = {
|
|
81
|
+
"@type": "WebSite",
|
|
82
|
+
"@id": websiteSchemaId,
|
|
83
|
+
url: config.origin,
|
|
84
|
+
name: config.siteName,
|
|
85
|
+
alternateName: config.siteName,
|
|
86
|
+
description: config.description,
|
|
87
|
+
inLanguage: "ko"
|
|
88
|
+
};
|
|
89
|
+
const thumbnailSchemaId = `${url}/#thumbnail`;
|
|
90
|
+
const thumbnail = props.thumbnail || (typeof config.thumbnail === "function" ? await config.thumbnail() : config.thumbnail);
|
|
91
|
+
const thumbnailUrl = thumbnail?.url;
|
|
92
|
+
const socialImage = thumbnail ? [
|
|
93
|
+
typeof thumbnail === "string" ? {
|
|
94
|
+
url: thumbnail,
|
|
95
|
+
alt: `${props.title} \uB300\uD45C \uC774\uBBF8\uC9C0`
|
|
96
|
+
} : thumbnail
|
|
97
|
+
] : [];
|
|
98
|
+
const images = [
|
|
99
|
+
...thumbnailUrl ? [
|
|
100
|
+
{
|
|
101
|
+
id: thumbnailSchemaId,
|
|
102
|
+
url: thumbnailUrl,
|
|
103
|
+
alt: `${props.title} \uB300\uD45C \uC774\uBBF8\uC9C0`
|
|
104
|
+
}
|
|
105
|
+
] : [],
|
|
106
|
+
...props.images || [],
|
|
107
|
+
...props.collection?.map((portfolio) => portfolio.thumbnail) || []
|
|
108
|
+
].filter(Boolean);
|
|
109
|
+
const image = images.filter((file) => file.id).map((file) => ({
|
|
110
|
+
"@type": "ImageObject",
|
|
111
|
+
"@id": `${url}/#${file.id}`
|
|
112
|
+
}));
|
|
113
|
+
const breadcrumbSchemaId = `${url}#breadcrumb`;
|
|
114
|
+
const updatedAt = props.updatedAt;
|
|
115
|
+
const createdAt = props.createdAt;
|
|
116
|
+
const meta = () => {
|
|
117
|
+
return [
|
|
118
|
+
{ title: pageTitle },
|
|
119
|
+
{ name: "description", content: description },
|
|
120
|
+
{ name: "keywords", content: keywords?.join(", ") || "" },
|
|
121
|
+
{
|
|
122
|
+
tagName: "link",
|
|
123
|
+
rel: "canonical",
|
|
124
|
+
href: url
|
|
125
|
+
},
|
|
126
|
+
{ property: "og:type", content: props.type || "website" },
|
|
127
|
+
{ property: "og:title", content: pageTitle },
|
|
128
|
+
{ property: "og:description", content: description },
|
|
129
|
+
{ property: "og:url", content: url },
|
|
130
|
+
{ property: "og:site_name", content: config.siteName },
|
|
131
|
+
...socialImage.map((file) => ({
|
|
132
|
+
property: "og:image",
|
|
133
|
+
content: file.url
|
|
134
|
+
})),
|
|
135
|
+
{
|
|
136
|
+
property: "twitter:card",
|
|
137
|
+
content: socialImage.length > 0 ? "summary_large_image" : "summary"
|
|
138
|
+
},
|
|
139
|
+
{ property: "twitter:title", content: pageTitle },
|
|
140
|
+
{ property: "twitter:description", content: description },
|
|
141
|
+
...socialImage.map((file) => ({
|
|
142
|
+
property: "twitter:image",
|
|
143
|
+
content: file.url
|
|
144
|
+
}))
|
|
145
|
+
];
|
|
146
|
+
};
|
|
147
|
+
const additionalStructedData = [
|
|
148
|
+
...typeof props.structedData === "function" ? await props.structedData() : props.structedData || [],
|
|
149
|
+
...typeof config.structedData === "function" ? await config.structedData() : config.structedData || []
|
|
150
|
+
];
|
|
151
|
+
function getStructedData() {
|
|
152
|
+
const collectionMainEntity = props.collection ? {
|
|
153
|
+
"@type": "ItemList",
|
|
154
|
+
numberOfItems: props.collection.length,
|
|
155
|
+
itemListElement: props.collection.map((item, index) => ({
|
|
156
|
+
"@type": "ListItem",
|
|
157
|
+
position: index + 1,
|
|
158
|
+
url: item.url,
|
|
159
|
+
item: {
|
|
160
|
+
"@type": "WebPage",
|
|
161
|
+
"@id": `${item.url}#webpage`,
|
|
162
|
+
url: item.url,
|
|
163
|
+
name: item.title,
|
|
164
|
+
thumbnailUrl: item.thumbnail?.url,
|
|
165
|
+
dateModified: item.updatedAt?.toISOString(),
|
|
166
|
+
dateCreated: item.createdAt?.toISOString(),
|
|
167
|
+
datePublished: item.createdAt?.toISOString()
|
|
168
|
+
}
|
|
169
|
+
}))
|
|
170
|
+
} : void 0;
|
|
171
|
+
return {
|
|
172
|
+
"@context": "https://schema.org",
|
|
173
|
+
"@graph": [
|
|
174
|
+
{
|
|
175
|
+
"@type": "WebPage",
|
|
176
|
+
"@id": `${url}#webpage`,
|
|
177
|
+
url,
|
|
178
|
+
name: pageTitle,
|
|
179
|
+
description,
|
|
180
|
+
keywords,
|
|
181
|
+
dateModified: updatedAt?.toISOString(),
|
|
182
|
+
datePublished: createdAt?.toISOString(),
|
|
183
|
+
dateCreated: createdAt?.toISOString(),
|
|
184
|
+
primaryImageOfPage: thumbnail ? {
|
|
185
|
+
"@id": thumbnailSchemaId
|
|
186
|
+
} : void 0,
|
|
187
|
+
isPartOf: {
|
|
188
|
+
"@id": websiteSchemaId
|
|
189
|
+
},
|
|
190
|
+
inLanguage: "ko",
|
|
191
|
+
breadcrumb: props.breadcrumbs && props.breadcrumbs.length > 0 ? {
|
|
192
|
+
"@id": breadcrumbSchemaId
|
|
193
|
+
} : void 0,
|
|
194
|
+
image,
|
|
195
|
+
mainEntity: collectionMainEntity
|
|
196
|
+
},
|
|
197
|
+
props.article && {
|
|
198
|
+
"@type": "Article",
|
|
199
|
+
"@id": `${url}#article`,
|
|
200
|
+
url,
|
|
201
|
+
name: pageTitle,
|
|
202
|
+
description,
|
|
203
|
+
keywords,
|
|
204
|
+
headline: pageTitle,
|
|
205
|
+
dateModified: updatedAt?.toISOString(),
|
|
206
|
+
datePublished: createdAt?.toISOString(),
|
|
207
|
+
dateCreated: createdAt?.toISOString(),
|
|
208
|
+
isPartOf: {
|
|
209
|
+
"@id": websiteSchemaId
|
|
210
|
+
},
|
|
211
|
+
inLanguage: "ko",
|
|
212
|
+
image
|
|
213
|
+
},
|
|
214
|
+
props.blogPosting && {
|
|
215
|
+
"@type": "BlogPosting",
|
|
216
|
+
"@id": `${url}/#blogposting`,
|
|
217
|
+
url,
|
|
218
|
+
headline: pageTitle,
|
|
219
|
+
description,
|
|
220
|
+
thumbnailUrl,
|
|
221
|
+
datePublished: createdAt?.toISOString(),
|
|
222
|
+
dateModified: updatedAt?.toISOString(),
|
|
223
|
+
isPartOf: { "@id": websiteSchemaId },
|
|
224
|
+
image
|
|
225
|
+
},
|
|
226
|
+
props.creativeWork && {
|
|
227
|
+
"@type": "CreativeWork",
|
|
228
|
+
"@id": `${url}/#creativework`,
|
|
229
|
+
url,
|
|
230
|
+
name: pageTitle,
|
|
231
|
+
description,
|
|
232
|
+
datePublished: createdAt?.toISOString(),
|
|
233
|
+
dateModified: updatedAt?.toISOString(),
|
|
234
|
+
isPartOf: { "@id": websiteSchemaId },
|
|
235
|
+
thumbnailUrl,
|
|
236
|
+
image
|
|
237
|
+
},
|
|
238
|
+
props.visualArtwork && {
|
|
239
|
+
"@type": "VisualArtwork",
|
|
240
|
+
"@id": `${url}/#visualartwork`,
|
|
241
|
+
url,
|
|
242
|
+
name: pageTitle,
|
|
243
|
+
description,
|
|
244
|
+
datePublished: createdAt?.toISOString(),
|
|
245
|
+
dateModified: updatedAt?.toISOString(),
|
|
246
|
+
isPartOf: { "@id": websiteSchemaId },
|
|
247
|
+
thumbnailUrl,
|
|
248
|
+
image
|
|
249
|
+
},
|
|
250
|
+
props.collection && {
|
|
251
|
+
"@type": "CollectionPage",
|
|
252
|
+
"@id": `${url}/#collectionpage`,
|
|
253
|
+
url,
|
|
254
|
+
name: pageTitle,
|
|
255
|
+
description,
|
|
256
|
+
isPartOf: { "@id": websiteSchemaId },
|
|
257
|
+
image,
|
|
258
|
+
inLanguage: "ko-KR",
|
|
259
|
+
breadcrumb: props.breadcrumbs && props.breadcrumbs.length > 0 ? {
|
|
260
|
+
"@id": `${url}/#breadcrumb`
|
|
261
|
+
} : void 0,
|
|
262
|
+
mainEntity: collectionMainEntity
|
|
263
|
+
},
|
|
264
|
+
websiteSchema,
|
|
265
|
+
props.breadcrumbs && props.breadcrumbs.length > 0 && {
|
|
266
|
+
"@id": breadcrumbSchemaId,
|
|
267
|
+
"@type": "BreadcrumbList",
|
|
268
|
+
itemListElement: props.breadcrumbs.map((breadcrumb, index) => ({
|
|
269
|
+
"@type": "ListItem",
|
|
270
|
+
position: index + 1,
|
|
271
|
+
name: breadcrumb.label,
|
|
272
|
+
item: `${config.origin}${breadcrumb.href}`
|
|
273
|
+
}))
|
|
274
|
+
},
|
|
275
|
+
...additionalStructedData,
|
|
276
|
+
...images.map((file) => {
|
|
277
|
+
return {
|
|
278
|
+
"@type": "ImageObject",
|
|
279
|
+
"@id": `${url}/#${file.id}`,
|
|
280
|
+
url: file.url,
|
|
281
|
+
contentUrl: file.url,
|
|
282
|
+
name: file.alt,
|
|
283
|
+
description: file.alt,
|
|
284
|
+
width: file?.width?.toString(),
|
|
285
|
+
height: file?.height?.toString(),
|
|
286
|
+
creditText: config.copyright,
|
|
287
|
+
license: `${config.origin}/terms`,
|
|
288
|
+
copyrightNotice: config.copyright,
|
|
289
|
+
acquireLicensePage: `${config.origin}/terms`
|
|
290
|
+
};
|
|
291
|
+
})
|
|
292
|
+
].filter(Boolean)
|
|
293
|
+
};
|
|
294
|
+
}
|
|
295
|
+
function generateJSONLD() {
|
|
296
|
+
const structedData = getStructedData();
|
|
297
|
+
return /* @__PURE__ */ import_react2.default.createElement(
|
|
298
|
+
"script",
|
|
299
|
+
{
|
|
300
|
+
type: "application/ld+json",
|
|
301
|
+
dangerouslySetInnerHTML: {
|
|
302
|
+
__html: JSON.stringify(structedData).replace(/</g, "\\u003c")
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
return {
|
|
308
|
+
config,
|
|
309
|
+
props,
|
|
310
|
+
meta,
|
|
311
|
+
generateJSONLD
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
};
|
|
315
|
+
}
|
|
316
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
317
|
+
0 && (module.exports = {
|
|
318
|
+
configSEO,
|
|
319
|
+
createLoader,
|
|
320
|
+
createSEOLoader
|
|
321
|
+
});
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
// src/seo-kit/loader.ts
|
|
2
|
+
function createLoader(fn = () => ({})) {
|
|
3
|
+
let loadedData;
|
|
4
|
+
return {
|
|
5
|
+
getData() {
|
|
6
|
+
return loadedData;
|
|
7
|
+
},
|
|
8
|
+
wrap(mapper) {
|
|
9
|
+
return async function Thing(props) {
|
|
10
|
+
loadedData = await fn(props);
|
|
11
|
+
return mapper(loadedData);
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// src/seo-kit/seo_loader.tsx
|
|
18
|
+
import React from "react";
|
|
19
|
+
function createSEOLoader(fn = () => ({})) {
|
|
20
|
+
const loader = createLoader(fn);
|
|
21
|
+
return {
|
|
22
|
+
...loader,
|
|
23
|
+
meta: loader.wrap((data) => data.seo.meta),
|
|
24
|
+
Page(Fc) {
|
|
25
|
+
return loader.wrap((data) => /* @__PURE__ */ React.createElement(React.Fragment, null, data.seo?.generateJSONLD(), /* @__PURE__ */ React.createElement(Fc, { ...data })));
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// src/seo-kit/seo.tsx
|
|
31
|
+
import React2 from "react";
|
|
32
|
+
function configSEO(config) {
|
|
33
|
+
return {
|
|
34
|
+
config,
|
|
35
|
+
async init(props = {}) {
|
|
36
|
+
const canonicalPath = props.canonicalPath;
|
|
37
|
+
const url = canonicalPath ? `${config.origin}${canonicalPath}` : `${config.origin}${props.path || ""}`;
|
|
38
|
+
const pageTitle = props.title ? `${props.title} | ${config.siteName}` : config.siteName;
|
|
39
|
+
const description = props.description || config.description;
|
|
40
|
+
const keywords = props.keywords || config.keywords;
|
|
41
|
+
const websiteSchemaId = `${config.origin}/#website`;
|
|
42
|
+
const websiteSchema = {
|
|
43
|
+
"@type": "WebSite",
|
|
44
|
+
"@id": websiteSchemaId,
|
|
45
|
+
url: config.origin,
|
|
46
|
+
name: config.siteName,
|
|
47
|
+
alternateName: config.siteName,
|
|
48
|
+
description: config.description,
|
|
49
|
+
inLanguage: "ko"
|
|
50
|
+
};
|
|
51
|
+
const thumbnailSchemaId = `${url}/#thumbnail`;
|
|
52
|
+
const thumbnail = props.thumbnail || (typeof config.thumbnail === "function" ? await config.thumbnail() : config.thumbnail);
|
|
53
|
+
const thumbnailUrl = thumbnail?.url;
|
|
54
|
+
const socialImage = thumbnail ? [
|
|
55
|
+
typeof thumbnail === "string" ? {
|
|
56
|
+
url: thumbnail,
|
|
57
|
+
alt: `${props.title} \uB300\uD45C \uC774\uBBF8\uC9C0`
|
|
58
|
+
} : thumbnail
|
|
59
|
+
] : [];
|
|
60
|
+
const images = [
|
|
61
|
+
...thumbnailUrl ? [
|
|
62
|
+
{
|
|
63
|
+
id: thumbnailSchemaId,
|
|
64
|
+
url: thumbnailUrl,
|
|
65
|
+
alt: `${props.title} \uB300\uD45C \uC774\uBBF8\uC9C0`
|
|
66
|
+
}
|
|
67
|
+
] : [],
|
|
68
|
+
...props.images || [],
|
|
69
|
+
...props.collection?.map((portfolio) => portfolio.thumbnail) || []
|
|
70
|
+
].filter(Boolean);
|
|
71
|
+
const image = images.filter((file) => file.id).map((file) => ({
|
|
72
|
+
"@type": "ImageObject",
|
|
73
|
+
"@id": `${url}/#${file.id}`
|
|
74
|
+
}));
|
|
75
|
+
const breadcrumbSchemaId = `${url}#breadcrumb`;
|
|
76
|
+
const updatedAt = props.updatedAt;
|
|
77
|
+
const createdAt = props.createdAt;
|
|
78
|
+
const meta = () => {
|
|
79
|
+
return [
|
|
80
|
+
{ title: pageTitle },
|
|
81
|
+
{ name: "description", content: description },
|
|
82
|
+
{ name: "keywords", content: keywords?.join(", ") || "" },
|
|
83
|
+
{
|
|
84
|
+
tagName: "link",
|
|
85
|
+
rel: "canonical",
|
|
86
|
+
href: url
|
|
87
|
+
},
|
|
88
|
+
{ property: "og:type", content: props.type || "website" },
|
|
89
|
+
{ property: "og:title", content: pageTitle },
|
|
90
|
+
{ property: "og:description", content: description },
|
|
91
|
+
{ property: "og:url", content: url },
|
|
92
|
+
{ property: "og:site_name", content: config.siteName },
|
|
93
|
+
...socialImage.map((file) => ({
|
|
94
|
+
property: "og:image",
|
|
95
|
+
content: file.url
|
|
96
|
+
})),
|
|
97
|
+
{
|
|
98
|
+
property: "twitter:card",
|
|
99
|
+
content: socialImage.length > 0 ? "summary_large_image" : "summary"
|
|
100
|
+
},
|
|
101
|
+
{ property: "twitter:title", content: pageTitle },
|
|
102
|
+
{ property: "twitter:description", content: description },
|
|
103
|
+
...socialImage.map((file) => ({
|
|
104
|
+
property: "twitter:image",
|
|
105
|
+
content: file.url
|
|
106
|
+
}))
|
|
107
|
+
];
|
|
108
|
+
};
|
|
109
|
+
const additionalStructedData = [
|
|
110
|
+
...typeof props.structedData === "function" ? await props.structedData() : props.structedData || [],
|
|
111
|
+
...typeof config.structedData === "function" ? await config.structedData() : config.structedData || []
|
|
112
|
+
];
|
|
113
|
+
function getStructedData() {
|
|
114
|
+
const collectionMainEntity = props.collection ? {
|
|
115
|
+
"@type": "ItemList",
|
|
116
|
+
numberOfItems: props.collection.length,
|
|
117
|
+
itemListElement: props.collection.map((item, index) => ({
|
|
118
|
+
"@type": "ListItem",
|
|
119
|
+
position: index + 1,
|
|
120
|
+
url: item.url,
|
|
121
|
+
item: {
|
|
122
|
+
"@type": "WebPage",
|
|
123
|
+
"@id": `${item.url}#webpage`,
|
|
124
|
+
url: item.url,
|
|
125
|
+
name: item.title,
|
|
126
|
+
thumbnailUrl: item.thumbnail?.url,
|
|
127
|
+
dateModified: item.updatedAt?.toISOString(),
|
|
128
|
+
dateCreated: item.createdAt?.toISOString(),
|
|
129
|
+
datePublished: item.createdAt?.toISOString()
|
|
130
|
+
}
|
|
131
|
+
}))
|
|
132
|
+
} : void 0;
|
|
133
|
+
return {
|
|
134
|
+
"@context": "https://schema.org",
|
|
135
|
+
"@graph": [
|
|
136
|
+
{
|
|
137
|
+
"@type": "WebPage",
|
|
138
|
+
"@id": `${url}#webpage`,
|
|
139
|
+
url,
|
|
140
|
+
name: pageTitle,
|
|
141
|
+
description,
|
|
142
|
+
keywords,
|
|
143
|
+
dateModified: updatedAt?.toISOString(),
|
|
144
|
+
datePublished: createdAt?.toISOString(),
|
|
145
|
+
dateCreated: createdAt?.toISOString(),
|
|
146
|
+
primaryImageOfPage: thumbnail ? {
|
|
147
|
+
"@id": thumbnailSchemaId
|
|
148
|
+
} : void 0,
|
|
149
|
+
isPartOf: {
|
|
150
|
+
"@id": websiteSchemaId
|
|
151
|
+
},
|
|
152
|
+
inLanguage: "ko",
|
|
153
|
+
breadcrumb: props.breadcrumbs && props.breadcrumbs.length > 0 ? {
|
|
154
|
+
"@id": breadcrumbSchemaId
|
|
155
|
+
} : void 0,
|
|
156
|
+
image,
|
|
157
|
+
mainEntity: collectionMainEntity
|
|
158
|
+
},
|
|
159
|
+
props.article && {
|
|
160
|
+
"@type": "Article",
|
|
161
|
+
"@id": `${url}#article`,
|
|
162
|
+
url,
|
|
163
|
+
name: pageTitle,
|
|
164
|
+
description,
|
|
165
|
+
keywords,
|
|
166
|
+
headline: pageTitle,
|
|
167
|
+
dateModified: updatedAt?.toISOString(),
|
|
168
|
+
datePublished: createdAt?.toISOString(),
|
|
169
|
+
dateCreated: createdAt?.toISOString(),
|
|
170
|
+
isPartOf: {
|
|
171
|
+
"@id": websiteSchemaId
|
|
172
|
+
},
|
|
173
|
+
inLanguage: "ko",
|
|
174
|
+
image
|
|
175
|
+
},
|
|
176
|
+
props.blogPosting && {
|
|
177
|
+
"@type": "BlogPosting",
|
|
178
|
+
"@id": `${url}/#blogposting`,
|
|
179
|
+
url,
|
|
180
|
+
headline: pageTitle,
|
|
181
|
+
description,
|
|
182
|
+
thumbnailUrl,
|
|
183
|
+
datePublished: createdAt?.toISOString(),
|
|
184
|
+
dateModified: updatedAt?.toISOString(),
|
|
185
|
+
isPartOf: { "@id": websiteSchemaId },
|
|
186
|
+
image
|
|
187
|
+
},
|
|
188
|
+
props.creativeWork && {
|
|
189
|
+
"@type": "CreativeWork",
|
|
190
|
+
"@id": `${url}/#creativework`,
|
|
191
|
+
url,
|
|
192
|
+
name: pageTitle,
|
|
193
|
+
description,
|
|
194
|
+
datePublished: createdAt?.toISOString(),
|
|
195
|
+
dateModified: updatedAt?.toISOString(),
|
|
196
|
+
isPartOf: { "@id": websiteSchemaId },
|
|
197
|
+
thumbnailUrl,
|
|
198
|
+
image
|
|
199
|
+
},
|
|
200
|
+
props.visualArtwork && {
|
|
201
|
+
"@type": "VisualArtwork",
|
|
202
|
+
"@id": `${url}/#visualartwork`,
|
|
203
|
+
url,
|
|
204
|
+
name: pageTitle,
|
|
205
|
+
description,
|
|
206
|
+
datePublished: createdAt?.toISOString(),
|
|
207
|
+
dateModified: updatedAt?.toISOString(),
|
|
208
|
+
isPartOf: { "@id": websiteSchemaId },
|
|
209
|
+
thumbnailUrl,
|
|
210
|
+
image
|
|
211
|
+
},
|
|
212
|
+
props.collection && {
|
|
213
|
+
"@type": "CollectionPage",
|
|
214
|
+
"@id": `${url}/#collectionpage`,
|
|
215
|
+
url,
|
|
216
|
+
name: pageTitle,
|
|
217
|
+
description,
|
|
218
|
+
isPartOf: { "@id": websiteSchemaId },
|
|
219
|
+
image,
|
|
220
|
+
inLanguage: "ko-KR",
|
|
221
|
+
breadcrumb: props.breadcrumbs && props.breadcrumbs.length > 0 ? {
|
|
222
|
+
"@id": `${url}/#breadcrumb`
|
|
223
|
+
} : void 0,
|
|
224
|
+
mainEntity: collectionMainEntity
|
|
225
|
+
},
|
|
226
|
+
websiteSchema,
|
|
227
|
+
props.breadcrumbs && props.breadcrumbs.length > 0 && {
|
|
228
|
+
"@id": breadcrumbSchemaId,
|
|
229
|
+
"@type": "BreadcrumbList",
|
|
230
|
+
itemListElement: props.breadcrumbs.map((breadcrumb, index) => ({
|
|
231
|
+
"@type": "ListItem",
|
|
232
|
+
position: index + 1,
|
|
233
|
+
name: breadcrumb.label,
|
|
234
|
+
item: `${config.origin}${breadcrumb.href}`
|
|
235
|
+
}))
|
|
236
|
+
},
|
|
237
|
+
...additionalStructedData,
|
|
238
|
+
...images.map((file) => {
|
|
239
|
+
return {
|
|
240
|
+
"@type": "ImageObject",
|
|
241
|
+
"@id": `${url}/#${file.id}`,
|
|
242
|
+
url: file.url,
|
|
243
|
+
contentUrl: file.url,
|
|
244
|
+
name: file.alt,
|
|
245
|
+
description: file.alt,
|
|
246
|
+
width: file?.width?.toString(),
|
|
247
|
+
height: file?.height?.toString(),
|
|
248
|
+
creditText: config.copyright,
|
|
249
|
+
license: `${config.origin}/terms`,
|
|
250
|
+
copyrightNotice: config.copyright,
|
|
251
|
+
acquireLicensePage: `${config.origin}/terms`
|
|
252
|
+
};
|
|
253
|
+
})
|
|
254
|
+
].filter(Boolean)
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
function generateJSONLD() {
|
|
258
|
+
const structedData = getStructedData();
|
|
259
|
+
return /* @__PURE__ */ React2.createElement(
|
|
260
|
+
"script",
|
|
261
|
+
{
|
|
262
|
+
type: "application/ld+json",
|
|
263
|
+
dangerouslySetInnerHTML: {
|
|
264
|
+
__html: JSON.stringify(structedData).replace(/</g, "\\u003c")
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
);
|
|
268
|
+
}
|
|
269
|
+
return {
|
|
270
|
+
config,
|
|
271
|
+
props,
|
|
272
|
+
meta,
|
|
273
|
+
generateJSONLD
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
export {
|
|
279
|
+
configSEO,
|
|
280
|
+
createLoader,
|
|
281
|
+
createSEOLoader
|
|
282
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/seo-kit/loader.ts
|
|
21
|
+
var loader_exports = {};
|
|
22
|
+
__export(loader_exports, {
|
|
23
|
+
createLoader: () => createLoader
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(loader_exports);
|
|
26
|
+
function createLoader(fn = () => ({})) {
|
|
27
|
+
let loadedData;
|
|
28
|
+
return {
|
|
29
|
+
getData() {
|
|
30
|
+
return loadedData;
|
|
31
|
+
},
|
|
32
|
+
wrap(mapper) {
|
|
33
|
+
return async function Thing(props) {
|
|
34
|
+
loadedData = await fn(props);
|
|
35
|
+
return mapper(loadedData);
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
41
|
+
0 && (module.exports = {
|
|
42
|
+
createLoader
|
|
43
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
// src/seo-kit/loader.ts
|
|
2
|
+
function createLoader(fn = () => ({})) {
|
|
3
|
+
let loadedData;
|
|
4
|
+
return {
|
|
5
|
+
getData() {
|
|
6
|
+
return loadedData;
|
|
7
|
+
},
|
|
8
|
+
wrap(mapper) {
|
|
9
|
+
return async function Thing(props) {
|
|
10
|
+
loadedData = await fn(props);
|
|
11
|
+
return mapper(loadedData);
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
createLoader
|
|
18
|
+
};
|