@koine/next 2.0.0-beta.10 → 2.0.0-beta.12
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/package.json +16 -16
- package/12/AnalyticsGoogle.js +0 -79
- package/12/DisableErrorOverlay.js +0 -31
- package/12/DynamicNamespaces.js +0 -23
- package/12/Favicon.js +0 -29
- package/12/Link.js +0 -38
- package/12/NextProgress.js +0 -69
- package/12/Seo.js +0 -29
- package/12/SeoDefaults.js +0 -31
- package/12/T.js +0 -43
- package/12/ThemeContext.js +0 -25
- package/12/ThemeProvider.js +0 -256
- package/12/TransText.js +0 -23
- package/12/app/AppHead.js +0 -31
- package/12/app/AppMain.js +0 -6
- package/12/app/css/AppMain.js +0 -39
- package/12/app/css/AppTheme.js +0 -33
- package/12/app/css/auth/index.js +0 -40
- package/12/app/css/index.js +0 -36
- package/12/app/index.js +0 -7
- package/12/app/sc/AppMain.js +0 -70
- package/12/app/sc/AppTheme.js +0 -33
- package/12/app/sc/auth/index.js +0 -40
- package/12/app/sc/index.js +0 -36
- package/12/document/Document.js +0 -49
- package/12/document/css/index.js +0 -60
- package/12/document/index.js +0 -19
- package/12/document/sc/index.js +0 -73
- package/12/getT.js +0 -23
- package/12/index.js +0 -100
- package/12/seoBuildTags.js +0 -126
- package/12/to.js +0 -31
- package/12/translationAsOptions.js +0 -19
- package/12/types-i18n.js +0 -15
- package/12/types-seo.js +0 -4
- package/12/useBackUrl.js +0 -47
- package/12/useDateFormat.js +0 -42
- package/12/useForm.js +0 -65
- package/12/useLocale.js +0 -25
- package/12/useT.js +0 -58
- package/12/useTheme.js +0 -23
- package/12/useTo.js +0 -26
- package/config/index.js +0 -317
- package/getSiteUrl.js +0 -24
- package/index.js +0 -20
- package/load.js +0 -31
package/12/document/Document.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
Document: function() {
|
|
13
|
-
return Document;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
-
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
21
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
22
|
-
const _document = /*#__PURE__*/ _interop_require_wildcard._(require("next/document"));
|
|
23
|
-
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
|
24
|
-
const _Meta = /*#__PURE__*/ _interop_require_default._(require("@koine/react/Meta"));
|
|
25
|
-
const _NoJs = /*#__PURE__*/ _interop_require_default._(require("@koine/react/NoJs"));
|
|
26
|
-
let Document = class Document extends _document.default {
|
|
27
|
-
render() {
|
|
28
|
-
const { locale, defaultLocale } = this.props.__NEXT_DATA__;
|
|
29
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_document.Html, {
|
|
30
|
-
lang: locale || defaultLocale,
|
|
31
|
-
className: "no-js",
|
|
32
|
-
children: [
|
|
33
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_document.Head, {
|
|
34
|
-
children: [
|
|
35
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Meta.default, {}),
|
|
36
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_NoJs.default, {})
|
|
37
|
-
]
|
|
38
|
-
}),
|
|
39
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)("body", {
|
|
40
|
-
children: [
|
|
41
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_document.Main, {}),
|
|
42
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_document.NextScript, {})
|
|
43
|
-
]
|
|
44
|
-
})
|
|
45
|
-
]
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
const _default = Document;
|
package/12/document/css/index.js
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
Document: function() {
|
|
13
|
-
return Document;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
-
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
21
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
22
|
-
const _document = /*#__PURE__*/ _interop_require_wildcard._(require("next/document"));
|
|
23
|
-
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
|
24
|
-
const _Meta = /*#__PURE__*/ _interop_require_default._(require("@koine/react/Meta"));
|
|
25
|
-
const _NoJs = /*#__PURE__*/ _interop_require_default._(require("@koine/react/NoJs"));
|
|
26
|
-
let Document = class Document extends _document.default {
|
|
27
|
-
// static override async getInitialProps(
|
|
28
|
-
// ctx: DocumentContext
|
|
29
|
-
// ): Promise<DocumentInitialProps & { theme: ThemeVanillaValue }> {
|
|
30
|
-
// const initialProps = await NextDocument.getInitialProps(ctx);
|
|
31
|
-
// return {
|
|
32
|
-
// ...initialProps,
|
|
33
|
-
// theme: getInitialThemeFromRequest(
|
|
34
|
-
// ctx.req?.headers.cookie /* || document?.cookie */ || ""
|
|
35
|
-
// ),
|
|
36
|
-
// };
|
|
37
|
-
// }
|
|
38
|
-
render() {
|
|
39
|
-
const { locale, defaultLocale } = this.props.__NEXT_DATA__;
|
|
40
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_document.Html, {
|
|
41
|
-
lang: locale || defaultLocale,
|
|
42
|
-
className: "no-js",
|
|
43
|
-
children: [
|
|
44
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_document.Head, {
|
|
45
|
-
children: [
|
|
46
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Meta.default, {}),
|
|
47
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_NoJs.default, {})
|
|
48
|
-
]
|
|
49
|
-
}),
|
|
50
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)("body", {
|
|
51
|
-
children: [
|
|
52
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_document.Main, {}),
|
|
53
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_document.NextScript, {})
|
|
54
|
-
]
|
|
55
|
-
})
|
|
56
|
-
]
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
const _default = Document;
|
package/12/document/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
Document: function() {
|
|
13
|
-
return _Document.Document;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _Document.Document;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _Document = require("./Document");
|
package/12/document/sc/index.js
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
/* ? eslint-disable @next/next/no-document-import-in-page */ "use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
Document: function() {
|
|
13
|
-
return Document;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
-
const _interop_require_wildcard = require("@swc/helpers/_/_interop_require_wildcard");
|
|
21
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
22
|
-
const _document = /*#__PURE__*/ _interop_require_wildcard._(require("next/document"));
|
|
23
|
-
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
|
24
|
-
const _styledcomponents = require("styled-components");
|
|
25
|
-
const _Meta = /*#__PURE__*/ _interop_require_default._(require("@koine/react/Meta"));
|
|
26
|
-
const _NoJs = /*#__PURE__*/ _interop_require_default._(require("@koine/react/NoJs"));
|
|
27
|
-
let Document = class Document extends _document.default {
|
|
28
|
-
static async getInitialProps(ctx) {
|
|
29
|
-
const sheet = new _styledcomponents.ServerStyleSheet();
|
|
30
|
-
const originalRenderPage = ctx.renderPage;
|
|
31
|
-
try {
|
|
32
|
-
ctx.renderPage = ()=>originalRenderPage({
|
|
33
|
-
enhanceApp: (App)=>(props)=>sheet.collectStyles(/*#__PURE__*/ (0, _jsxruntime.jsx)(App, {
|
|
34
|
-
...props
|
|
35
|
-
}))
|
|
36
|
-
});
|
|
37
|
-
const initialProps = await _document.default.getInitialProps(ctx);
|
|
38
|
-
return {
|
|
39
|
-
...initialProps,
|
|
40
|
-
styles: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_react.default.Fragment, {
|
|
41
|
-
children: [
|
|
42
|
-
initialProps.styles,
|
|
43
|
-
sheet.getStyleElement()
|
|
44
|
-
]
|
|
45
|
-
})
|
|
46
|
-
};
|
|
47
|
-
} finally{
|
|
48
|
-
sheet.seal();
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
render() {
|
|
52
|
-
const { locale, defaultLocale } = this.props.__NEXT_DATA__;
|
|
53
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_document.Html, {
|
|
54
|
-
lang: locale || defaultLocale,
|
|
55
|
-
className: "no-js",
|
|
56
|
-
children: [
|
|
57
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_document.Head, {
|
|
58
|
-
children: [
|
|
59
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Meta.default, {}),
|
|
60
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_NoJs.default, {})
|
|
61
|
-
]
|
|
62
|
-
}),
|
|
63
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)("body", {
|
|
64
|
-
children: [
|
|
65
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_document.Main, {}),
|
|
66
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_document.NextScript, {})
|
|
67
|
-
]
|
|
68
|
-
})
|
|
69
|
-
]
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
};
|
|
73
|
-
const _default = Document;
|
package/12/getT.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
function _export(target, all) {
|
|
7
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: all[name]
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
_export(exports, {
|
|
13
|
-
getT: function() {
|
|
14
|
-
return getT;
|
|
15
|
-
},
|
|
16
|
-
default: function() {
|
|
17
|
-
return _default;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
21
|
-
const _getT = /*#__PURE__*/ _interop_require_default._(require("next-translate/getT"));
|
|
22
|
-
const getT = _getT.default;
|
|
23
|
-
const _default = getT;
|
package/12/index.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
AnalyticsGoogle: function() {
|
|
13
|
-
return _AnalyticsGoogle.AnalyticsGoogle;
|
|
14
|
-
},
|
|
15
|
-
DisableErrorOverlay: function() {
|
|
16
|
-
return _DisableErrorOverlay.DisableErrorOverlay;
|
|
17
|
-
},
|
|
18
|
-
DynamicNamespaces: function() {
|
|
19
|
-
return _DynamicNamespaces.DynamicNamespaces;
|
|
20
|
-
},
|
|
21
|
-
Favicon: function() {
|
|
22
|
-
return _Favicon.Favicon;
|
|
23
|
-
},
|
|
24
|
-
getT: function() {
|
|
25
|
-
return _getT.getT;
|
|
26
|
-
},
|
|
27
|
-
Link: function() {
|
|
28
|
-
return _Link.Link;
|
|
29
|
-
},
|
|
30
|
-
NextProgress: function() {
|
|
31
|
-
return _NextProgress.NextProgress;
|
|
32
|
-
},
|
|
33
|
-
Seo: function() {
|
|
34
|
-
return _Seo.Seo;
|
|
35
|
-
},
|
|
36
|
-
SeoDefaults: function() {
|
|
37
|
-
return _SeoDefaults.SeoDefaults;
|
|
38
|
-
},
|
|
39
|
-
T: function() {
|
|
40
|
-
return _T.T;
|
|
41
|
-
},
|
|
42
|
-
ThemeContext: function() {
|
|
43
|
-
return _ThemeContext.ThemeContext;
|
|
44
|
-
},
|
|
45
|
-
ThemeProvider: function() {
|
|
46
|
-
return _ThemeProvider.ThemeProvider;
|
|
47
|
-
},
|
|
48
|
-
to: function() {
|
|
49
|
-
return _to.to;
|
|
50
|
-
},
|
|
51
|
-
translationAsOptions: function() {
|
|
52
|
-
return _translationAsOptions.translationAsOptions;
|
|
53
|
-
},
|
|
54
|
-
TransText: function() {
|
|
55
|
-
return _TransText.TransText;
|
|
56
|
-
},
|
|
57
|
-
useBackUrl: function() {
|
|
58
|
-
return _useBackUrl.useBackUrl;
|
|
59
|
-
},
|
|
60
|
-
useDateFormat: function() {
|
|
61
|
-
return _useDateFormat.useDateFormat;
|
|
62
|
-
},
|
|
63
|
-
useForm: function() {
|
|
64
|
-
return _useForm.useForm;
|
|
65
|
-
},
|
|
66
|
-
useLocale: function() {
|
|
67
|
-
return _useLocale.useLocale;
|
|
68
|
-
},
|
|
69
|
-
useT: function() {
|
|
70
|
-
return _useT.useT;
|
|
71
|
-
},
|
|
72
|
-
useTheme: function() {
|
|
73
|
-
return _useTheme.useTheme;
|
|
74
|
-
},
|
|
75
|
-
useTo: function() {
|
|
76
|
-
return _useTo.useTo;
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
const _AnalyticsGoogle = require("./AnalyticsGoogle");
|
|
80
|
-
const _DisableErrorOverlay = require("./DisableErrorOverlay");
|
|
81
|
-
const _DynamicNamespaces = require("./DynamicNamespaces");
|
|
82
|
-
const _Favicon = require("./Favicon");
|
|
83
|
-
const _getT = require("./getT");
|
|
84
|
-
const _Link = require("./Link");
|
|
85
|
-
const _NextProgress = require("./NextProgress");
|
|
86
|
-
const _Seo = require("./Seo");
|
|
87
|
-
const _SeoDefaults = require("./SeoDefaults");
|
|
88
|
-
const _T = require("./T");
|
|
89
|
-
const _ThemeContext = require("./ThemeContext");
|
|
90
|
-
const _ThemeProvider = require("./ThemeProvider");
|
|
91
|
-
const _to = require("./to");
|
|
92
|
-
const _translationAsOptions = require("./translationAsOptions");
|
|
93
|
-
const _TransText = require("./TransText");
|
|
94
|
-
const _useBackUrl = require("./useBackUrl");
|
|
95
|
-
const _useDateFormat = require("./useDateFormat");
|
|
96
|
-
const _useForm = require("./useForm");
|
|
97
|
-
const _useLocale = require("./useLocale");
|
|
98
|
-
const _useT = require("./useT");
|
|
99
|
-
const _useTheme = require("./useTheme");
|
|
100
|
-
const _useTo = require("./useTo");
|
package/12/seoBuildTags.js
DELETED
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
seoBuildTags: function() {
|
|
13
|
-
return seoBuildTags;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
21
|
-
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
|
22
|
-
const _isArray = /*#__PURE__*/ _interop_require_default._(require("@koine/utils/isArray"));
|
|
23
|
-
const defaults = {
|
|
24
|
-
tplTitle: ""
|
|
25
|
-
};
|
|
26
|
-
const seoBuildTags = ({ seo, hidden, keywords, title = "", titleTemplate, defaultTitle, noindex, nofollow, description, languageAlternates = [], twitter, facebook, openGraph, og: ogAlias, canonical, metaTags, linkTags } = {})=>{
|
|
27
|
-
const id = "seo-";
|
|
28
|
-
const render = [];
|
|
29
|
-
const $names = {};
|
|
30
|
-
const $properties = {};
|
|
31
|
-
if (titleTemplate) {
|
|
32
|
-
defaults.tplTitle = titleTemplate;
|
|
33
|
-
}
|
|
34
|
-
title = title || seo?.title || "";
|
|
35
|
-
if (title) {
|
|
36
|
-
if (defaults.tplTitle && defaults.tplTitle !== title) {
|
|
37
|
-
title = defaults.tplTitle.replace(/%s/g, title);
|
|
38
|
-
}
|
|
39
|
-
} else if (defaultTitle) {
|
|
40
|
-
title = defaultTitle;
|
|
41
|
-
}
|
|
42
|
-
if (title) {
|
|
43
|
-
render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("title", {
|
|
44
|
-
children: title
|
|
45
|
-
}, id + "title"));
|
|
46
|
-
$properties["og:title"] = title; // overridden later...
|
|
47
|
-
}
|
|
48
|
-
$names["robots"] = `${noindex || hidden ? "noindex" : "index"},${nofollow || hidden ? "nofollow" : "follow"}`;
|
|
49
|
-
description = description || seo?.description;
|
|
50
|
-
if (description) {
|
|
51
|
-
$names["description"] = description;
|
|
52
|
-
$properties["og:description"] = description; // overridden later...
|
|
53
|
-
}
|
|
54
|
-
keywords = keywords || seo?.keywords;
|
|
55
|
-
if (keywords) {
|
|
56
|
-
$names["keywords"] = (0, _isArray.default)(keywords) ? keywords.join(", ") : keywords;
|
|
57
|
-
}
|
|
58
|
-
if (languageAlternates?.length > 0) {
|
|
59
|
-
languageAlternates.forEach(({ href, hrefLang })=>{
|
|
60
|
-
render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
|
|
61
|
-
rel: "alternate",
|
|
62
|
-
hrefLang: hrefLang,
|
|
63
|
-
href: href
|
|
64
|
-
}, id + "languageAlternate-" + hrefLang));
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
if (canonical) {
|
|
68
|
-
render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
|
|
69
|
-
rel: "canonical",
|
|
70
|
-
href: canonical
|
|
71
|
-
}, id + "canonical"));
|
|
72
|
-
$properties["og:url"] = canonical;
|
|
73
|
-
}
|
|
74
|
-
if (facebook?.appId) $properties["fb:app_id"] = facebook.appId;
|
|
75
|
-
if (twitter) {
|
|
76
|
-
if (twitter.cardType) $names["twitter:card"] = twitter.cardType;
|
|
77
|
-
if (twitter.site) $names["twitter:site"] = twitter.site;
|
|
78
|
-
if (twitter.handle) $names["twitter:creator"] = twitter.handle;
|
|
79
|
-
}
|
|
80
|
-
const og = ogAlias || openGraph;
|
|
81
|
-
if (og?.title) $properties["og:title"] = og?.title;
|
|
82
|
-
if (og?.description) $properties["og:description"] = og?.description;
|
|
83
|
-
if (og?.url) $properties["og:url"] = og.url;
|
|
84
|
-
if (og?.type) $properties["og:type"] = og.type.toLowerCase();
|
|
85
|
-
if (og?.locale) $properties["og:locale"] = og.locale;
|
|
86
|
-
if (og?.siteName) $properties["og:siteName"] = og.siteName;
|
|
87
|
-
const ogimage = og?.image || seo?.ogimage;
|
|
88
|
-
if (ogimage) $properties["og:image"] = ogimage;
|
|
89
|
-
Object.keys($names).forEach((key)=>{
|
|
90
|
-
render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
|
|
91
|
-
name: key,
|
|
92
|
-
content: $names[key]
|
|
93
|
-
}, id + "name-" + key));
|
|
94
|
-
});
|
|
95
|
-
Object.keys($properties).forEach((key)=>{
|
|
96
|
-
render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
|
|
97
|
-
property: key,
|
|
98
|
-
content: $properties[key]
|
|
99
|
-
}, id + "prop-" + +key));
|
|
100
|
-
});
|
|
101
|
-
if (metaTags && metaTags.length > 0) {
|
|
102
|
-
metaTags.forEach((tag)=>{
|
|
103
|
-
render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
|
|
104
|
-
...tag
|
|
105
|
-
}, id + "meta-" + (tag.name || tag.property || tag.httpEquiv)));
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
if (linkTags?.length) {
|
|
109
|
-
linkTags.forEach((tag)=>{
|
|
110
|
-
render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
|
|
111
|
-
...tag
|
|
112
|
-
}, id + "link-" + (tag.href || tag.rel)));
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
// TODO: alternates and canonical
|
|
116
|
-
// canonical = 'https://www.domain.com/';
|
|
117
|
-
// languageAlternates={[{
|
|
118
|
-
// hrefLang: 'en',
|
|
119
|
-
// href: 'https://www.domain.com/en',
|
|
120
|
-
// }]}
|
|
121
|
-
// <link rel="alternate" hreflang="x-default" href="https://www.domain.com/nl/">
|
|
122
|
-
// <link rel="alternate" hreflang="nl" href="https://www.domain.com/nl/">
|
|
123
|
-
// <link rel="alternate" hreflang="en" href="https://www.domain.com/en/">
|
|
124
|
-
return render;
|
|
125
|
-
};
|
|
126
|
-
const _default = seoBuildTags;
|
package/12/to.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
to: function() {
|
|
13
|
-
return to;
|
|
14
|
-
},
|
|
15
|
-
default: function() {
|
|
16
|
-
return _default;
|
|
17
|
-
}
|
|
18
|
-
});
|
|
19
|
-
function to(...args) {
|
|
20
|
-
let relative = "";
|
|
21
|
-
const [t] = args;
|
|
22
|
-
if (args.length === 3) {
|
|
23
|
-
if (args[2]) {
|
|
24
|
-
relative = t(args[1], args[2]).replace("*", "");
|
|
25
|
-
}
|
|
26
|
-
} else if (args.length === 2) {
|
|
27
|
-
relative = t(args[1]);
|
|
28
|
-
}
|
|
29
|
-
return relative;
|
|
30
|
-
}
|
|
31
|
-
const _default = to;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "translationAsOptions", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return translationAsOptions;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
function translationAsOptions(t, i18nKey) {
|
|
12
|
-
const dictionary = t(i18nKey, undefined, {
|
|
13
|
-
returnObjects: true
|
|
14
|
-
});
|
|
15
|
-
return Object.keys(dictionary).map((key)=>({
|
|
16
|
-
value: key,
|
|
17
|
-
label: dictionary[key]
|
|
18
|
-
}));
|
|
19
|
-
}
|
package/12/types-i18n.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file
|
|
3
|
-
*
|
|
4
|
-
* Test this on TSplayground:
|
|
5
|
-
* https://www.typescriptlang.org/play?#code/PTAEFpK6dv4YpSBQJSgJYEYAcA7YAFwE8AHTfAcwGcA6AEzqJrTGQ86+7hRQYCmAYwA2AQwBOA0PjEBbATTJih0gJJ58oAN4oMlIgIkAzFdIAqEsfhriimAPY2dejKHQAiAH4eAXKGsSAG5XAF8+fXxDEzNQS2tbMXsnGgBhJ2NMKh1w8LYIHkKi4sh8rE1ickVmVnQS+obUFFIyaQApB0oAHgBlbAAaUB6AJgA+UABeIexQAQAPQ3wGGlAaIglKKlcAfiHh2YWBJZW1jepXDF2AAwASbT7QujuR0KuL0H8+1398AQA3IwhNAAKmBemBoAAIpghMlZBISKAHMYAiIRKAiAALaTrBJ2Rw2cHAFDzMgOCREDFVOJWGz4lLQ2EEySIqYaAh0eJ0pIEmhA4Cg8GgABy8kUylUJ0xDgAriIGKA5EkhJiMdjQJkREcxSsAO5GHG0xJwlaSaSCTK-BhEklzMkUqmtGl4pICUUKJSxKYAUQWVlhXQA1gISMjndyTYy4SzBqdNqN+YLQBCAErCGUSGiYAGKsRkVoKlo4hwHXGw1HomU0MQAIy1q3Wm1AyixK2MEgccgCGKN9PwQotlEwcKRNYAVsJKQAKKsysRoxHtzvdto9ADywo1mC1AEo6EK1J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AWixsWJmz88WVnGU9M8hIhohYWV4bcUhRMt8+zanlzrtQUCChBNzxsczWgnHNG1FFBAWZzXBYmmgMAXHKQphtzvH+k3AAA9GRKVlIKSAltxgQDxjwDFjweV9AJVlV0AaVqlmVmPbV4lvVvTA1jAZVoVtaEV-wcx0uQsBwcV9JyV41tVjEdq3I81zxq191qKO11VmwI8NAhWzVhWsta1sAQ1+1jER1js9koNrgVwaV31tMP8GCBB3UfbSkakrho4Xhm8Lx2N4No16VglrNt-ZRwK-N5N4cotvCvh3V-VuN21mRdN712BmtwwYYP3TN4uftv3at4dgQAdjEU1vtid+BgIPN5bdUzsTUugJ2KcW5qKQtjwYtncS3DALd4tvhrxvdxt7Vw9m8Ntk9g9ltm8S13d1wMh8t+N7tsN0zP15TAIflLhjF3wRZkZ+9qKGsflAlrhv9vVk9oQL9jwYl3wY5ugU5gDtwBgflU1rhuDhDk9zFmE6N6D2ZogcD94YwflBwMJ311tqFAjzd-lId7NgQb9ijxDjATEYDqFGd0D4cLUSjtwTAaj8d4YLhmD9DsULj-QYYFDvDmd-jjwK5kTz3ajwoyTgTvD2T9AP47C0kScEE3ygmT5yGQKKUA+hUQjbRY8Q7d4OQcTuvItv5gFlTsANTkEu0TTowVCEKdyfOLyKVOUIzt-HaaQUzn0twCzqdvD6z0KWThwFjhQRT28Dj-9sINFL1sNp9ztvgUIIAA
|
|
6
|
-
*
|
|
7
|
-
* @see
|
|
8
|
-
* - https://stackoverflow.com/q/75531366/1938970: fix for `Type instantiation is excessively deep and possibly infinite in Promise.all`
|
|
9
|
-
*
|
|
10
|
-
* @notes
|
|
11
|
-
* I might take a better look at how things were done in [i18next](https://github.com/i18next/i18next/blob/master/index.d.ts)
|
|
12
|
-
*/ "use strict";
|
|
13
|
-
Object.defineProperty(exports, "__esModule", {
|
|
14
|
-
value: true
|
|
15
|
-
});
|
package/12/types-seo.js
DELETED
package/12/useBackUrl.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
function _export(target, all) {
|
|
7
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: all[name]
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
_export(exports, {
|
|
13
|
-
useBackUrl: function() {
|
|
14
|
-
return useBackUrl;
|
|
15
|
-
},
|
|
16
|
-
default: function() {
|
|
17
|
-
return _default;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
21
|
-
const _router = require("next/router");
|
|
22
|
-
const _react = require("react");
|
|
23
|
-
const _createStorage = /*#__PURE__*/ _interop_require_default._(require("@koine/browser/createStorage"));
|
|
24
|
-
const back = (0, _createStorage.default)({
|
|
25
|
-
lastUrl: ""
|
|
26
|
-
});
|
|
27
|
-
function useBackUrl() {
|
|
28
|
-
const { asPath } = (0, _router.useRouter)();
|
|
29
|
-
const calledOnce = (0, _react.useRef)(false);
|
|
30
|
-
const [backUrl, setBackUrl] = (0, _react.useState)();
|
|
31
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32
|
-
(0, _react.useEffect)(()=>{
|
|
33
|
-
if (calledOnce.current) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const prevLastUrl = back.get("lastUrl");
|
|
37
|
-
// console.log("useBackUrl: prevLastUrl", prevLastUrl);
|
|
38
|
-
// first set it to use on a link, set to undefined if the previous URL
|
|
39
|
-
// is the same as the current one
|
|
40
|
-
setBackUrl(asPath === prevLastUrl || !prevLastUrl ? undefined : prevLastUrl);
|
|
41
|
-
// then update the local storage
|
|
42
|
-
back.set("lastUrl", asPath);
|
|
43
|
-
calledOnce.current = true;
|
|
44
|
-
});
|
|
45
|
-
return backUrl;
|
|
46
|
-
}
|
|
47
|
-
const _default = useBackUrl;
|
package/12/useDateFormat.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
function _export(target, all) {
|
|
7
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
get: all[name]
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
_export(exports, {
|
|
13
|
-
useDateFormat: function() {
|
|
14
|
-
return useDateFormat;
|
|
15
|
-
},
|
|
16
|
-
default: function() {
|
|
17
|
-
return _default;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
21
|
-
const _format = /*#__PURE__*/ _interop_require_default._(require("date-fns/format"));
|
|
22
|
-
const _router = require("next/router");
|
|
23
|
-
const _react = require("react");
|
|
24
|
-
const _useDateLocale = /*#__PURE__*/ _interop_require_default._(require("@koine/react/hooks/useDateLocale"));
|
|
25
|
-
const useDateFormat = ()=>{
|
|
26
|
-
const [formatter, setFormatter] = (0, _react.useState)(()=>(...args)=>(0, _format.default)(...args));
|
|
27
|
-
const router = (0, _router.useRouter)();
|
|
28
|
-
const locale = (0, _useDateLocale.default)(router.locale);
|
|
29
|
-
(0, _react.useEffect)(()=>{
|
|
30
|
-
if (locale) {
|
|
31
|
-
const newFormatter = (date, _format1, options)=>(0, _format.default)(date, _format1, {
|
|
32
|
-
...options || {},
|
|
33
|
-
locale
|
|
34
|
-
});
|
|
35
|
-
setFormatter(()=>(...args)=>newFormatter(...args));
|
|
36
|
-
}
|
|
37
|
-
}, [
|
|
38
|
-
locale
|
|
39
|
-
]);
|
|
40
|
-
return formatter;
|
|
41
|
-
};
|
|
42
|
-
const _default = useDateFormat;
|