@c-rex/components 0.0.1 → 0.0.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/components/src/autocomplete.d.ts +8 -0
- package/dist/components/src/autocomplete.d.ts.map +1 -0
- package/dist/components/src/autocomplete.js +36 -0
- package/dist/components/src/blog-card.d.ts +17 -0
- package/dist/components/src/blog-card.d.ts.map +1 -0
- package/dist/components/src/blog-card.js +16 -0
- package/dist/components/src/blur-image.d.ts +4 -0
- package/dist/components/src/blur-image.d.ts.map +1 -0
- package/dist/components/src/blur-image.js +16 -0
- package/dist/components/src/breadcrumb.d.ts +9 -0
- package/dist/components/src/breadcrumb.d.ts.map +1 -0
- package/dist/components/src/breadcrumb.js +33 -0
- package/dist/components/src/empty.d.ts +3 -0
- package/dist/components/src/empty.d.ts.map +1 -0
- package/dist/components/src/empty.js +9 -0
- package/dist/components/src/navbar.d.ts +8 -0
- package/dist/components/src/navbar.d.ts.map +1 -0
- package/dist/components/src/navbar.js +14 -0
- package/dist/components/src/providers/search-state-wrapper.d.ts +13 -0
- package/dist/components/src/providers/search-state-wrapper.d.ts.map +1 -0
- package/dist/components/src/providers/search-state-wrapper.js +10 -0
- package/dist/components/src/result-list.d.ts +8 -0
- package/dist/components/src/result-list.d.ts.map +1 -0
- package/dist/components/src/result-list.js +17 -0
- package/dist/components/src/result-view/blog.d.ts +8 -0
- package/dist/components/src/result-view/blog.d.ts.map +1 -0
- package/dist/components/src/result-view/blog.js +22 -0
- package/dist/components/src/result-view/table.d.ts +8 -0
- package/dist/components/src/result-view/table.d.ts.map +1 -0
- package/dist/components/src/result-view/table.js +26 -0
- package/dist/components/src/sidebar.d.ts +10 -0
- package/dist/components/src/sidebar.d.ts.map +1 -0
- package/dist/components/src/sidebar.js +10 -0
- package/dist/constants/src/index.d.ts +17 -0
- package/dist/constants/src/index.d.ts.map +1 -0
- package/dist/constants/src/index.js +30 -0
- package/dist/contexts/src/index.d.ts +15 -0
- package/dist/contexts/src/index.d.ts.map +1 -0
- package/dist/contexts/src/index.js +18 -0
- package/dist/interfaces/src/common.d.ts +36 -0
- package/dist/interfaces/src/common.d.ts.map +1 -0
- package/dist/interfaces/src/common.js +2 -0
- package/dist/interfaces/src/config.d.ts +26 -0
- package/dist/interfaces/src/config.d.ts.map +1 -0
- package/dist/interfaces/src/config.js +2 -0
- package/dist/interfaces/src/directoryNodes.d.ts +8 -0
- package/dist/interfaces/src/directoryNodes.d.ts.map +1 -0
- package/dist/interfaces/src/directoryNodes.js +2 -0
- package/dist/interfaces/src/documentTypes.d.ts +7 -0
- package/dist/interfaces/src/documentTypes.d.ts.map +1 -0
- package/dist/interfaces/src/documentTypes.js +2 -0
- package/dist/interfaces/src/index.d.ts +7 -0
- package/dist/interfaces/src/index.d.ts.map +1 -0
- package/dist/interfaces/src/index.js +22 -0
- package/dist/interfaces/src/informationUnits.d.ts +53 -0
- package/dist/interfaces/src/informationUnits.d.ts.map +1 -0
- package/dist/interfaces/src/informationUnits.js +2 -0
- package/dist/interfaces/src/treeOfContent.d.ts +8 -0
- package/dist/interfaces/src/treeOfContent.d.ts.map +1 -0
- package/dist/interfaces/src/treeOfContent.js +2 -0
- package/dist/types/src/index.d.ts +8 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/index.js +2 -0
- package/dist/utils/src/breadcrumbs.d.ts +3 -0
- package/dist/utils/src/breadcrumbs.d.ts.map +1 -0
- package/dist/utils/src/breadcrumbs.js +14 -0
- package/dist/utils/src/classMerge.d.ts +3 -0
- package/dist/utils/src/classMerge.d.ts.map +1 -0
- package/dist/utils/src/classMerge.js +8 -0
- package/dist/utils/src/index.d.ts +5 -0
- package/dist/utils/src/index.d.ts.map +1 -0
- package/dist/utils/src/index.js +20 -0
- package/dist/utils/src/treeOfContent.d.ts +2 -0
- package/dist/utils/src/treeOfContent.d.ts.map +1 -0
- package/dist/utils/src/treeOfContent.js +85 -0
- package/dist/utils/src/utils.d.ts +8 -0
- package/dist/utils/src/utils.d.ts.map +1 -0
- package/dist/utils/src/utils.js +37 -0
- package/package.json +77 -42
- package/dist/index.d.mts +0 -68
- package/dist/index.d.ts +0 -68
- package/dist/index.js +0 -2919
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -2910
- package/dist/index.mjs.map +0 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./common"), exports);
|
|
18
|
+
__exportStar(require("./config"), exports);
|
|
19
|
+
__exportStar(require("./directoryNodes"), exports);
|
|
20
|
+
__exportStar(require("./documentTypes"), exports);
|
|
21
|
+
__exportStar(require("./informationUnits"), exports);
|
|
22
|
+
__exportStar(require("./treeOfContent"), exports);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { DirectoryNodes } from "./directoryNodes";
|
|
2
|
+
import { DefaultLinksRequest, DefaultPageInfo, idShortID, Labels } from "./common";
|
|
3
|
+
interface informationUnitsClass extends idShortID {
|
|
4
|
+
labels: Labels[];
|
|
5
|
+
}
|
|
6
|
+
export interface informationUnitsDirectories extends idShortID {
|
|
7
|
+
labels: Labels[];
|
|
8
|
+
links: DefaultLinksRequest[];
|
|
9
|
+
class: informationUnitsClass;
|
|
10
|
+
childNodes?: informationUnitsClass[];
|
|
11
|
+
}
|
|
12
|
+
export interface informationUnitsRenditions extends informationUnitsDirectories {
|
|
13
|
+
source: string;
|
|
14
|
+
format: string;
|
|
15
|
+
}
|
|
16
|
+
export interface informationUnitsItems extends idShortID {
|
|
17
|
+
directories: informationUnitsDirectories[];
|
|
18
|
+
identities: informationUnitsDirectories[];
|
|
19
|
+
class: informationUnitsClass;
|
|
20
|
+
labels: Labels[];
|
|
21
|
+
titles: Labels[];
|
|
22
|
+
links: DefaultLinksRequest[];
|
|
23
|
+
renditions: informationUnitsRenditions[];
|
|
24
|
+
iirdsVersion: {
|
|
25
|
+
value: string;
|
|
26
|
+
};
|
|
27
|
+
revision: string;
|
|
28
|
+
score: number;
|
|
29
|
+
directoryNodes: DirectoryNodes[];
|
|
30
|
+
languages: string[];
|
|
31
|
+
}
|
|
32
|
+
export interface informationUnitsResponse extends idShortID {
|
|
33
|
+
languages: string[];
|
|
34
|
+
labels: Labels[];
|
|
35
|
+
titles: Labels[];
|
|
36
|
+
files: {
|
|
37
|
+
format: string;
|
|
38
|
+
type: string;
|
|
39
|
+
link: string;
|
|
40
|
+
}[];
|
|
41
|
+
}
|
|
42
|
+
export interface informationUnits {
|
|
43
|
+
items: informationUnitsItems[];
|
|
44
|
+
pageInfo: DefaultPageInfo;
|
|
45
|
+
}
|
|
46
|
+
export interface AutocompleteSuggestion {
|
|
47
|
+
suggestions: {
|
|
48
|
+
type: string;
|
|
49
|
+
value: string;
|
|
50
|
+
}[];
|
|
51
|
+
}
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=informationUnits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"informationUnits.d.ts","sourceRoot":"","sources":["../../../../interfaces/src/informationUnits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,MAAM,EACP,MAAM,UAAU,CAAC;AAElB,UAAU,qBAAsB,SAAQ,SAAS;IAC/C,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,2BAA4B,SAAQ,SAAS;IAC5D,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,KAAK,EAAE,qBAAqB,CAAC;IAC7B,UAAU,CAAC,EAAE,qBAAqB,EAAE,CAAC;CACtC;AAED,MAAM,WAAW,0BACf,SAAQ,2BAA2B;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAsB,SAAQ,SAAS;IACtD,WAAW,EAAE,2BAA2B,EAAE,CAAC;IAC3C,UAAU,EAAE,2BAA2B,EAAE,CAAC;IAC1C,KAAK,EAAE,qBAAqB,CAAC;IAC7B,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,UAAU,EAAE,0BAA0B,EAAE,CAAC;IACzC,YAAY,EAAE;QACZ,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,cAAc,EAAE,CAAC;IACjC,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,wBAAyB,SAAQ,SAAS;IACzD,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,KAAK,EAAE;QACL,MAAM,EAAE,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,EAAE,CAAC;CACL;AAED,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,qBAAqB,EAAE,CAAC;IAC/B,QAAQ,EAAE,eAAe,CAAC;CAC3B;AAED,MAAM,WAAW,sBAAsB;IACrC,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,EAAE,CAAC;CACL"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"treeOfContent.d.ts","sourceRoot":"","sources":["../../../../interfaces/src/treeOfContent.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,aAAa,EAAE,CAAC;CAC3B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LOG_CATEGORIES, LOG_LEVELS, ALL } from "@c-rex/constants";
|
|
2
|
+
export type QueryParams = {
|
|
3
|
+
key: string;
|
|
4
|
+
value: string;
|
|
5
|
+
};
|
|
6
|
+
export type LogLevelType = keyof typeof LOG_LEVELS | typeof ALL;
|
|
7
|
+
export type LogCategoriesType = typeof LOG_CATEGORIES[number] | typeof ALL;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../types/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAEnE,MAAM,MAAM,WAAW,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AACzD,MAAM,MAAM,YAAY,GAAG,MAAM,OAAO,UAAU,GAAG,OAAO,GAAG,CAAA;AAC/D,MAAM,MAAM,iBAAiB,GAAG,OAAO,cAAc,CAAC,MAAM,CAAC,GAAG,OAAO,GAAG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumbs.d.ts","sourceRoot":"","sources":["../../../../utils/src/breadcrumbs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAElD,eAAO,MAAM,uBAAuB,GAChC,eAAe,aAAa,EAAE,KAC/B,aAAa,EAWf,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateBreadcrumbItems = void 0;
|
|
4
|
+
const generateBreadcrumbItems = (treeOfContent) => {
|
|
5
|
+
const result = [];
|
|
6
|
+
treeOfContent.forEach((item) => {
|
|
7
|
+
if (item.active) {
|
|
8
|
+
const filteredChildren = (0, exports.generateBreadcrumbItems)(item.children);
|
|
9
|
+
result.push(item, ...filteredChildren);
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
return result;
|
|
13
|
+
};
|
|
14
|
+
exports.generateBreadcrumbItems = generateBreadcrumbItems;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"classMerge.d.ts","sourceRoot":"","sources":["../../../../utils/src/classMerge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,MAAM,CAAC;AAG7C,wBAAgB,EAAE,CAAC,GAAG,MAAM,EAAE,UAAU,EAAE,UAEzC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cn = cn;
|
|
4
|
+
const clsx_1 = require("clsx");
|
|
5
|
+
const tailwind_merge_1 = require("tailwind-merge");
|
|
6
|
+
function cn(...inputs) {
|
|
7
|
+
return (0, tailwind_merge_1.twMerge)((0, clsx_1.clsx)(inputs));
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../utils/src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./utils"), exports);
|
|
18
|
+
__exportStar(require("./treeOfContent"), exports);
|
|
19
|
+
__exportStar(require("./breadcrumbs"), exports);
|
|
20
|
+
__exportStar(require("./classMerge"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"treeOfContent.d.ts","sourceRoot":"","sources":["../../../../utils/src/treeOfContent.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/*
|
|
4
|
+
import { DirectoryNodesService } from "@c-rex/services";
|
|
5
|
+
|
|
6
|
+
import { DirectoryNodes } from "@c-rex/interfaces";
|
|
7
|
+
import { informationUnitsDirectories } from "@c-rex/interfaces";
|
|
8
|
+
import { TreeOfContent } from "@c-rex/interfaces";
|
|
9
|
+
|
|
10
|
+
export const generateTreeOfContent = async (
|
|
11
|
+
directoryNodes: DirectoryNodes[],
|
|
12
|
+
): Promise<TreeOfContent[]> => {
|
|
13
|
+
|
|
14
|
+
const service = new DirectoryNodesService();
|
|
15
|
+
|
|
16
|
+
if (directoryNodes.length == 0) return [];
|
|
17
|
+
if (directoryNodes[0] == undefined) return [];
|
|
18
|
+
|
|
19
|
+
let id = directoryNodes[0].shortId;
|
|
20
|
+
let response = await service.getItem(id);
|
|
21
|
+
const childList = await getChildrenInfo(response.childNodes);
|
|
22
|
+
let result: TreeOfContent[] = childList;
|
|
23
|
+
|
|
24
|
+
while (response.parents != undefined) {
|
|
25
|
+
if (response.informationUnits[0] == undefined) return result;
|
|
26
|
+
if (response.labels[0] == undefined) return result;
|
|
27
|
+
if (response.parents[0] == undefined) return result;
|
|
28
|
+
|
|
29
|
+
const infoId = response.informationUnits[0].shortId;
|
|
30
|
+
const aux = {
|
|
31
|
+
active: true,
|
|
32
|
+
label: response.labels[0].value,
|
|
33
|
+
id: response.shortId,
|
|
34
|
+
link: `/info/${infoId}`,
|
|
35
|
+
children: [...result],
|
|
36
|
+
};
|
|
37
|
+
id = response.parents[0].shortId;
|
|
38
|
+
response = await service.getItem(id);
|
|
39
|
+
|
|
40
|
+
const tree = await getChildrenInfo(response.childNodes, aux);
|
|
41
|
+
|
|
42
|
+
result = [...tree];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return result;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const getChildrenInfo = async (
|
|
49
|
+
childNodes: informationUnitsDirectories[],
|
|
50
|
+
childItem?: TreeOfContent,
|
|
51
|
+
): Promise<TreeOfContent[]> => {
|
|
52
|
+
const result: TreeOfContent[] = [];
|
|
53
|
+
if (childNodes == undefined) return result;
|
|
54
|
+
|
|
55
|
+
for (const item of childNodes) {
|
|
56
|
+
if (item.labels[0] == undefined) break;
|
|
57
|
+
|
|
58
|
+
const infoId = await getLink(item.shortId);
|
|
59
|
+
let resultItem: TreeOfContent = {
|
|
60
|
+
active: false,
|
|
61
|
+
label: item.labels[0].value,
|
|
62
|
+
link: `/info/${infoId}`,
|
|
63
|
+
id: item.shortId,
|
|
64
|
+
children: [],
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
if (childItem?.id == item.shortId) {
|
|
68
|
+
resultItem = childItem;
|
|
69
|
+
}
|
|
70
|
+
result.push(resultItem);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return result;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
const getLink = async (id: string): Promise<string> => {
|
|
77
|
+
|
|
78
|
+
const service = new DirectoryNodesService();
|
|
79
|
+
const response = await service.getItem(id);
|
|
80
|
+
if (response.informationUnits == undefined) return "";
|
|
81
|
+
if (response.informationUnits[0] == undefined) return "";
|
|
82
|
+
|
|
83
|
+
return response.informationUnits[0].shortId;
|
|
84
|
+
};
|
|
85
|
+
*/
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { QueryParams } from '@c-rex/types';
|
|
2
|
+
export declare const createParams: (fieldsList: string[], key?: string) => {
|
|
3
|
+
key: string;
|
|
4
|
+
value: string;
|
|
5
|
+
}[];
|
|
6
|
+
export declare const updateUrlWithParams: (router: any, params: QueryParams[]) => void;
|
|
7
|
+
export declare const generateQueryParams: (params: QueryParams[]) => string;
|
|
8
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../utils/src/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAI3C,eAAO,MAAM,YAAY,GAAI,YAAY,MAAM,EAAE,EAAE,MAAK,MAAiB;;;GAIlE,CAAC;AAER,eAAO,MAAM,mBAAmB,GAE5B,QAAQ,GAAG,EACX,QAAQ,WAAW,EAAE,SAUxB,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,QAAQ,WAAW,EAAE,KAAG,MAQ3D,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateQueryParams = exports.updateUrlWithParams = exports.createParams = void 0;
|
|
4
|
+
//import * as Flags from 'country-flag-icons/react/3x2';
|
|
5
|
+
//import { AppRouterInstance } from 'next/dist/shared/lib/app-router-context.shared-runtime';
|
|
6
|
+
const createParams = (fieldsList, key = "Fields") => fieldsList.map((item) => ({
|
|
7
|
+
key: key,
|
|
8
|
+
value: item,
|
|
9
|
+
}));
|
|
10
|
+
exports.createParams = createParams;
|
|
11
|
+
const updateUrlWithParams = (
|
|
12
|
+
//router: AppRouterInstance,
|
|
13
|
+
router, params) => {
|
|
14
|
+
const searchParams = new URLSearchParams(window.location.search);
|
|
15
|
+
params.forEach((param) => {
|
|
16
|
+
searchParams.set(param.key, param.value.toString());
|
|
17
|
+
});
|
|
18
|
+
const queryString = searchParams.toString();
|
|
19
|
+
router.push(`${window.location.pathname}?${queryString}`);
|
|
20
|
+
};
|
|
21
|
+
exports.updateUrlWithParams = updateUrlWithParams;
|
|
22
|
+
const generateQueryParams = (params) => {
|
|
23
|
+
const queryParams = params
|
|
24
|
+
.map((param) => `${encodeURIComponent(param.key)}=${encodeURIComponent(param.value)}`)
|
|
25
|
+
.join("&");
|
|
26
|
+
return queryParams;
|
|
27
|
+
};
|
|
28
|
+
exports.generateQueryParams = generateQueryParams;
|
|
29
|
+
/*
|
|
30
|
+
export const getFlagIcon = (countryCode: string): JSX.Element | null => {
|
|
31
|
+
if (countryCode === undefined) return null;
|
|
32
|
+
|
|
33
|
+
return Flags[countryCode] || null;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
*/
|
package/package.json
CHANGED
|
@@ -1,43 +1,78 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
2
|
+
"name": "@c-rex/components",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"files": [
|
|
5
|
+
"dist"
|
|
6
|
+
],
|
|
7
|
+
"exports": {
|
|
8
|
+
"./autocomplete": {
|
|
9
|
+
"types": "./src/autocomplete.tsx",
|
|
10
|
+
"import": "./src/autocomplete.tsx"
|
|
11
|
+
},
|
|
12
|
+
"./blog-card": {
|
|
13
|
+
"types": "./src/blog-card.tsx",
|
|
14
|
+
"import": "./src/blog-card.tsx"
|
|
15
|
+
},
|
|
16
|
+
"./blur-image": {
|
|
17
|
+
"types": "./src/blur-image.tsx",
|
|
18
|
+
"import": "./src/blur-image.tsx"
|
|
19
|
+
},
|
|
20
|
+
"./breadcrumb": {
|
|
21
|
+
"types": "./src/breadcrumb.tsx",
|
|
22
|
+
"import": "./src/breadcrumb.tsx"
|
|
23
|
+
},
|
|
24
|
+
"./empty": {
|
|
25
|
+
"types": "./src/empty.tsx",
|
|
26
|
+
"import": "./src/empty.tsx"
|
|
27
|
+
},
|
|
28
|
+
"./navbar": {
|
|
29
|
+
"types": "./src/navbar.tsx",
|
|
30
|
+
"import": "./src/navbar.tsx"
|
|
31
|
+
},
|
|
32
|
+
"./providers/search-state-wrapper": {
|
|
33
|
+
"types": "./src/providers/search-state-wrapper.tsx",
|
|
34
|
+
"import": "./src/providers/search-state-wrapper.tsx"
|
|
35
|
+
},
|
|
36
|
+
"./result-list": {
|
|
37
|
+
"types": "./src/result-list.tsx",
|
|
38
|
+
"import": "./src/result-list.tsx"
|
|
39
|
+
},
|
|
40
|
+
"./result-view/blog": {
|
|
41
|
+
"types": "./src/result-view/blog.tsx",
|
|
42
|
+
"import": "./src/result-view/blog.tsx"
|
|
43
|
+
},
|
|
44
|
+
"./result-view/table": {
|
|
45
|
+
"types": "./src/result-view/table.tsx",
|
|
46
|
+
"import": "./src/result-view/table.tsx"
|
|
47
|
+
},
|
|
48
|
+
"./sidebar": {
|
|
49
|
+
"types": "./src/sidebar.tsx",
|
|
50
|
+
"import": "./src/sidebar.tsx"
|
|
51
|
+
},
|
|
52
|
+
"./package.json": "./package.json"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"dev": "tsc --watch",
|
|
56
|
+
"build": "tsc"
|
|
57
|
+
},
|
|
58
|
+
"devDependencies": {
|
|
59
|
+
"@c-rex/eslint-config": "*",
|
|
60
|
+
"@c-rex/typescript-config": "*",
|
|
61
|
+
"@turbo/gen": "^2.4.4",
|
|
62
|
+
"@types/node": "^22.13.10",
|
|
63
|
+
"@types/react": "19.0.10",
|
|
64
|
+
"@types/react-dom": "19.0.4",
|
|
65
|
+
"eslint": "^9.23.0",
|
|
66
|
+
"typescript": "latest"
|
|
67
|
+
},
|
|
68
|
+
"dependencies": {
|
|
69
|
+
"next": "^14",
|
|
70
|
+
"react": "^18",
|
|
71
|
+
"react-dom": "^18",
|
|
72
|
+
"@c-rex/ui": "*",
|
|
73
|
+
"@c-rex/services": "*",
|
|
74
|
+
"@c-rex/interfaces": "*",
|
|
75
|
+
"@c-rex/contexts": "*",
|
|
76
|
+
"@c-rex/utils": "*"
|
|
77
|
+
}
|
|
78
|
+
}
|
package/dist/index.d.mts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { FC, ReactNode, ComponentProps } from 'react';
|
|
2
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import Image from 'next/image';
|
|
4
|
-
import { TreeOfContent, informationUnitsItems } from '@c-rex/interfaces';
|
|
5
|
-
import { Sidebar } from '@c-rex/ui';
|
|
6
|
-
|
|
7
|
-
interface SearchStateWrapperProps {
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
filters: {
|
|
10
|
-
searchValue: string;
|
|
11
|
-
page: number;
|
|
12
|
-
selectedLanguage: string[];
|
|
13
|
-
availableLanguages: string[];
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
declare const SearchStateWrapper: FC<SearchStateWrapperProps>;
|
|
17
|
-
|
|
18
|
-
type Props = {
|
|
19
|
-
initialValue: string;
|
|
20
|
-
onSelect: (value: string) => void;
|
|
21
|
-
onSearch: (value: string) => Promise<string[]>;
|
|
22
|
-
};
|
|
23
|
-
declare const AutoComplete: ({ initialValue, onSearch, onSelect, }: Props) => react_jsx_runtime.JSX.Element;
|
|
24
|
-
|
|
25
|
-
interface BlogCardProp {
|
|
26
|
-
data: {
|
|
27
|
-
title: string;
|
|
28
|
-
blurDataURL: string;
|
|
29
|
-
image: string;
|
|
30
|
-
description: string;
|
|
31
|
-
authors: string;
|
|
32
|
-
_id: string;
|
|
33
|
-
date: string;
|
|
34
|
-
slug: string;
|
|
35
|
-
};
|
|
36
|
-
priority?: boolean;
|
|
37
|
-
horizontal?: boolean;
|
|
38
|
-
}
|
|
39
|
-
declare const BlogCard: ({ data, priority, horizontal, }: BlogCardProp) => react_jsx_runtime.JSX.Element;
|
|
40
|
-
|
|
41
|
-
declare const BlurImage: (props: ComponentProps<typeof Image>) => react_jsx_runtime.JSX.Element;
|
|
42
|
-
|
|
43
|
-
interface BreadcrumbProps {
|
|
44
|
-
items: TreeOfContent[];
|
|
45
|
-
loading?: boolean;
|
|
46
|
-
}
|
|
47
|
-
declare const Breadcrumb: FC<BreadcrumbProps>;
|
|
48
|
-
|
|
49
|
-
declare const Empty: FC;
|
|
50
|
-
|
|
51
|
-
interface NavBarProps {
|
|
52
|
-
scroll?: boolean;
|
|
53
|
-
large?: boolean;
|
|
54
|
-
}
|
|
55
|
-
declare const NavBar: FC<NavBarProps>;
|
|
56
|
-
|
|
57
|
-
interface ResultListProps {
|
|
58
|
-
items: informationUnitsItems[];
|
|
59
|
-
}
|
|
60
|
-
declare const ResultList: FC<ResultListProps>;
|
|
61
|
-
|
|
62
|
-
interface SidebarProps extends ComponentProps<typeof Sidebar> {
|
|
63
|
-
data: TreeOfContent[];
|
|
64
|
-
loading?: boolean;
|
|
65
|
-
}
|
|
66
|
-
declare function AppSidebar({ data, loading, ...props }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
67
|
-
|
|
68
|
-
export { AppSidebar, AutoComplete, BlogCard, BlurImage, Breadcrumb, Empty, NavBar, ResultList, SearchStateWrapper };
|
package/dist/index.d.ts
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { FC, ReactNode, ComponentProps } from 'react';
|
|
2
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import Image from 'next/image';
|
|
4
|
-
import { TreeOfContent, informationUnitsItems } from '@c-rex/interfaces';
|
|
5
|
-
import { Sidebar } from '@c-rex/ui';
|
|
6
|
-
|
|
7
|
-
interface SearchStateWrapperProps {
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
filters: {
|
|
10
|
-
searchValue: string;
|
|
11
|
-
page: number;
|
|
12
|
-
selectedLanguage: string[];
|
|
13
|
-
availableLanguages: string[];
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
declare const SearchStateWrapper: FC<SearchStateWrapperProps>;
|
|
17
|
-
|
|
18
|
-
type Props = {
|
|
19
|
-
initialValue: string;
|
|
20
|
-
onSelect: (value: string) => void;
|
|
21
|
-
onSearch: (value: string) => Promise<string[]>;
|
|
22
|
-
};
|
|
23
|
-
declare const AutoComplete: ({ initialValue, onSearch, onSelect, }: Props) => react_jsx_runtime.JSX.Element;
|
|
24
|
-
|
|
25
|
-
interface BlogCardProp {
|
|
26
|
-
data: {
|
|
27
|
-
title: string;
|
|
28
|
-
blurDataURL: string;
|
|
29
|
-
image: string;
|
|
30
|
-
description: string;
|
|
31
|
-
authors: string;
|
|
32
|
-
_id: string;
|
|
33
|
-
date: string;
|
|
34
|
-
slug: string;
|
|
35
|
-
};
|
|
36
|
-
priority?: boolean;
|
|
37
|
-
horizontal?: boolean;
|
|
38
|
-
}
|
|
39
|
-
declare const BlogCard: ({ data, priority, horizontal, }: BlogCardProp) => react_jsx_runtime.JSX.Element;
|
|
40
|
-
|
|
41
|
-
declare const BlurImage: (props: ComponentProps<typeof Image>) => react_jsx_runtime.JSX.Element;
|
|
42
|
-
|
|
43
|
-
interface BreadcrumbProps {
|
|
44
|
-
items: TreeOfContent[];
|
|
45
|
-
loading?: boolean;
|
|
46
|
-
}
|
|
47
|
-
declare const Breadcrumb: FC<BreadcrumbProps>;
|
|
48
|
-
|
|
49
|
-
declare const Empty: FC;
|
|
50
|
-
|
|
51
|
-
interface NavBarProps {
|
|
52
|
-
scroll?: boolean;
|
|
53
|
-
large?: boolean;
|
|
54
|
-
}
|
|
55
|
-
declare const NavBar: FC<NavBarProps>;
|
|
56
|
-
|
|
57
|
-
interface ResultListProps {
|
|
58
|
-
items: informationUnitsItems[];
|
|
59
|
-
}
|
|
60
|
-
declare const ResultList: FC<ResultListProps>;
|
|
61
|
-
|
|
62
|
-
interface SidebarProps extends ComponentProps<typeof Sidebar> {
|
|
63
|
-
data: TreeOfContent[];
|
|
64
|
-
loading?: boolean;
|
|
65
|
-
}
|
|
66
|
-
declare function AppSidebar({ data, loading, ...props }: SidebarProps): react_jsx_runtime.JSX.Element;
|
|
67
|
-
|
|
68
|
-
export { AppSidebar, AutoComplete, BlogCard, BlurImage, Breadcrumb, Empty, NavBar, ResultList, SearchStateWrapper };
|