@pronto-tools-and-more/components 10.24.0 → 10.26.0

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/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
+ }
@@ -0,0 +1,2 @@
1
+ import type { ILanguageRegistry } from "../ILanguageRegistry/ILanguageRegistry.ts";
2
+ export declare const createLanguageRegistry: <TLinks, TLanguage, TMenus>() => ILanguageRegistry<TLinks, TLanguage, TMenus>;
@@ -0,0 +1,6 @@
1
+ export declare const Seo: ({ title, description, keywords, titlePostfix, }?: {
2
+ title?: string;
3
+ description?: string;
4
+ keywords?: string;
5
+ titlePostfix?: string;
6
+ }) => import("react").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pronto-tools-and-more/components",
3
- "version": "10.24.0",
3
+ "version": "10.26.0",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",
@@ -16,7 +16,7 @@
16
16
  "author": "",
17
17
  "license": "MIT",
18
18
  "devDependencies": {
19
- "@types/node": "^22.9.1",
19
+ "@types/node": "^22.10.0",
20
20
  "@types/react": "^18.3.12",
21
21
  "esbuild": "^0.24.0",
22
22
  "react": "^18.3.1",