@pronto-tools-and-more/components 10.25.0 → 10.27.0
Sign up to get free protection for your applications and to get access to all the features.
package/dist/main.js
CHANGED
@@ -567,6 +567,33 @@ var Heading = ({
|
|
567
567
|
return /* @__PURE__ */ React.createElement("h4", { className: fullClassName }, text);
|
568
568
|
};
|
569
569
|
|
570
|
+
// src/parts/LanguageRegistry/LanguageRegistry.ts
|
571
|
+
var createLanguageRegistry = () => {
|
572
|
+
const languages = /* @__PURE__ */ Object.create(null);
|
573
|
+
const links = /* @__PURE__ */ Object.create(null);
|
574
|
+
const menus = /* @__PURE__ */ Object.create(null);
|
575
|
+
const getLink = (language, key) => {
|
576
|
+
return links[language][key];
|
577
|
+
};
|
578
|
+
const getText = (language, key) => {
|
579
|
+
return languages[language][key];
|
580
|
+
};
|
581
|
+
const getMenu = (language, key) => {
|
582
|
+
return menus[language][key];
|
583
|
+
};
|
584
|
+
const register = (item) => {
|
585
|
+
links[item.id] = item.links;
|
586
|
+
languages[item.id] = item.language;
|
587
|
+
menus[item.id] = item.menus;
|
588
|
+
};
|
589
|
+
return {
|
590
|
+
register,
|
591
|
+
getLink,
|
592
|
+
getText,
|
593
|
+
getMenu
|
594
|
+
};
|
595
|
+
};
|
596
|
+
|
570
597
|
// src/parts/Link/Link.tsx
|
571
598
|
var Link = ({
|
572
599
|
to,
|
@@ -915,6 +942,26 @@ var SearchResults = ({
|
|
915
942
|
return /* @__PURE__ */ React.createElement("div", { className: "SearchResults" }, /* @__PURE__ */ React.createElement(JsonComponent, { json }));
|
916
943
|
};
|
917
944
|
|
945
|
+
// src/parts/Seo/Seo.tsx
|
946
|
+
var Seo = ({
|
947
|
+
title,
|
948
|
+
description,
|
949
|
+
keywords,
|
950
|
+
titlePostfix
|
951
|
+
} = {}) => {
|
952
|
+
const json = {
|
953
|
+
title: `${title}${titlePostfix}`,
|
954
|
+
seo: {
|
955
|
+
og_title: `${title}${titlePostfix}`,
|
956
|
+
og_description: description,
|
957
|
+
description,
|
958
|
+
title: `${title}${titlePostfix}`,
|
959
|
+
keywords
|
960
|
+
}
|
961
|
+
};
|
962
|
+
return /* @__PURE__ */ React.createElement(JsonComponent, { json });
|
963
|
+
};
|
964
|
+
|
918
965
|
// src/parts/SubscriptionLink/SubscriptionLink.tsx
|
919
966
|
var SubscriptionLink = ({ message } = {}) => {
|
920
967
|
const json = {
|
@@ -1000,7 +1047,9 @@ export {
|
|
1000
1047
|
SearchHeaderToggle,
|
1001
1048
|
SearchLink,
|
1002
1049
|
SearchResults,
|
1050
|
+
Seo,
|
1003
1051
|
SubscriptionLink,
|
1004
1052
|
TagList,
|
1053
|
+
createLanguageRegistry,
|
1005
1054
|
dateHelper
|
1006
1055
|
};
|
@@ -26,6 +26,7 @@ export * from "../ISearchResult/ISearchResult.ts";
|
|
26
26
|
export * from "../ISearchResultComponent/ISearchResultComponent.tsx";
|
27
27
|
export * from "../ITagItem/ITagItem.ts";
|
28
28
|
export * from "../JsonComponent/JsonComponent.tsx";
|
29
|
+
export * from "../LanguageRegistry/LanguageRegistry.ts";
|
29
30
|
export * from "../Link/Link.tsx";
|
30
31
|
export * from "../Login/Login.tsx";
|
31
32
|
export * from "../MaskIcon/MaskIcon.tsx";
|
@@ -38,5 +39,6 @@ export * from "../SearchHeaderSelect/SearchHeaderSelect.tsx";
|
|
38
39
|
export * from "../SearchHeaderToggle/SearchHeaderToggle.tsx";
|
39
40
|
export * from "../SearchLink/SearchLink.tsx";
|
40
41
|
export * from "../SearchResults/SearchResults.tsx";
|
42
|
+
export * from "../Seo/Seo.tsx";
|
41
43
|
export * from "../SubscriptionLink/SubscriptionLink.tsx";
|
42
44
|
export * from "../TagList/TagList.tsx";
|
@@ -0,0 +1,11 @@
|
|
1
|
+
export interface ILanguageRegistry<TLinks, TLanguage, TMenus> {
|
2
|
+
readonly getLink: (language: string, key: keyof TLinks) => string;
|
3
|
+
readonly getText: (language: string, key: keyof TLanguage) => string;
|
4
|
+
readonly getMenu: (language: string, key: keyof TMenus) => string;
|
5
|
+
readonly register: (item: {
|
6
|
+
id: string;
|
7
|
+
language: TLanguage;
|
8
|
+
links: TLinks;
|
9
|
+
menus: TMenus;
|
10
|
+
}) => void;
|
11
|
+
}
|