@pronto-tools-and-more/components 6.27.0 → 6.28.0
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/main.ts +0 -1
- package/src/parts/AppBar/AppBar.tsx +0 -3
- package/src/parts/Button/Button.tsx +0 -10
- package/src/parts/Components/Components.tsx +0 -12
- package/src/parts/CreateFakeSection/CreateFakeSection.ts +0 -8
- package/src/parts/EPaperLink/EPaperLink.tsx +0 -19
- package/src/parts/EPapers/EPapers.tsx +0 -28
- package/src/parts/FakeNode/FakeNode.ts +0 -6
- package/src/parts/FooterItemsList/FooterItemsList.tsx +0 -13
- package/src/parts/HasComplexChildren/HasComplexChildren.ts +0 -7
- package/src/parts/HeaderMenuItems/HeaderMenuItems.tsx +0 -12
- package/src/parts/Home/Home.tsx +0 -9
- package/src/parts/ISearchResult/ISearchResult.tsx +0 -7
- package/src/parts/ISearchResultComponent/ISearchResultComponent.tsx +0 -6
- package/src/parts/IssueList/IssueList.tsx +0 -31
- package/src/parts/JsonComponent/JsonComponent.tsx +0 -6
- package/src/parts/Link/Link.tsx +0 -17
- package/src/parts/Login/Login.tsx +0 -9
- package/src/parts/Main/Main.tsx +0 -1
- package/src/parts/MenuItems/MenuItems.tsx +0 -17
- package/src/parts/MockReact/MockReact.tsx +0 -21
- package/src/parts/MostRead/MostRead.tsx +0 -42
- package/src/parts/NoSearchResults/NoSearchResults.tsx +0 -15
- package/src/parts/Parts/Parts.tsx +0 -10
- package/src/parts/PostContentBody/PostContentBody.tsx +0 -21
- package/src/parts/React/React.tsx +0 -9
- package/src/parts/SearchField/SearchField.tsx +0 -14
- package/src/parts/SearchLink/SearchLink.tsx +0 -19
- package/src/parts/SearchResults/SearchResults.tsx +0 -118
- package/src/parts/SubscriptionLink/SubscriptionLink.tsx +0 -19
- package/src/parts/Swiper/Swiper.tsx +0 -11
- package/src/parts/UnwrapComponent/UnwrapComponent.tsx +0 -98
package/package.json
CHANGED
package/src/main.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from "./parts/Components/Components.tsx";
|
@@ -1,12 +0,0 @@
|
|
1
|
-
export * from "../EPaperLink/EPaperLink.tsx";
|
2
|
-
export * from "../FooterItemsList/FooterItemsList.tsx";
|
3
|
-
export * from "../HeaderMenuItems/HeaderMenuItems.tsx";
|
4
|
-
export * from "../JsonComponent/JsonComponent.tsx";
|
5
|
-
export * from "../Link/Link.tsx";
|
6
|
-
export * from "../Login/Login.tsx";
|
7
|
-
export * from "../MenuItems/MenuItems.tsx";
|
8
|
-
export * from "../PostContentBody/PostContentBody.tsx";
|
9
|
-
export * from "../SearchField/SearchField.tsx";
|
10
|
-
export * from "../SearchLink/SearchLink.tsx";
|
11
|
-
export * from "../SearchResults/SearchResults.tsx";
|
12
|
-
export * from "../SubscriptionLink/SubscriptionLink.tsx";
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import { JsonComponent } from "../JsonComponent/JsonComponent.tsx";
|
2
|
-
|
3
|
-
export const EPaperLink = ({ message }: { message?: string } = {}) => {
|
4
|
-
const json = {
|
5
|
-
type: "button",
|
6
|
-
tap: {
|
7
|
-
type: "navigate",
|
8
|
-
path: "e-paper",
|
9
|
-
},
|
10
|
-
message,
|
11
|
-
buttonClass: "e-paper",
|
12
|
-
id: "button-epaper",
|
13
|
-
};
|
14
|
-
return (
|
15
|
-
<div className="EPaperLink">
|
16
|
-
<JsonComponent json={json} />
|
17
|
-
</div>
|
18
|
-
);
|
19
|
-
};
|
@@ -1,28 +0,0 @@
|
|
1
|
-
export const EPapers = () => {
|
2
|
-
return {
|
3
|
-
content: {
|
4
|
-
type: "issue",
|
5
|
-
descriptionMessage: "",
|
6
|
-
customMessages: [],
|
7
|
-
tapCover: {
|
8
|
-
type: "openContent",
|
9
|
-
mode: "MODAL",
|
10
|
-
titleBar: true,
|
11
|
-
},
|
12
|
-
},
|
13
|
-
dataSource: {
|
14
|
-
type: "issue",
|
15
|
-
sort: [
|
16
|
-
{
|
17
|
-
publicationDate: {
|
18
|
-
direction: "ASC",
|
19
|
-
},
|
20
|
-
},
|
21
|
-
],
|
22
|
-
batchSize: 12,
|
23
|
-
},
|
24
|
-
type: "list",
|
25
|
-
class: "epaper-issues",
|
26
|
-
template: "grid",
|
27
|
-
};
|
28
|
-
};
|
@@ -1,13 +0,0 @@
|
|
1
|
-
import { MenuItems } from "../MenuItems/MenuItems.tsx";
|
2
|
-
|
3
|
-
export const FooterItemsList = ({
|
4
|
-
className,
|
5
|
-
menuName = "",
|
6
|
-
}: { className?: string; menuName?: string } = {}) => {
|
7
|
-
const fullClassName = `FooterItemsList ${className}`;
|
8
|
-
return (
|
9
|
-
<div className={fullClassName}>
|
10
|
-
<MenuItems menuName={menuName} />
|
11
|
-
</div>
|
12
|
-
);
|
13
|
-
};
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import { MenuItems } from "../MenuItems/MenuItems.tsx";
|
2
|
-
|
3
|
-
export const HeaderMenuItems = ({
|
4
|
-
menuName = "",
|
5
|
-
}: { menuName?: string } = {}) => {
|
6
|
-
const fullClassName = `HeaderMenuItems`;
|
7
|
-
return (
|
8
|
-
<div className={fullClassName}>
|
9
|
-
<MenuItems menuName={menuName} />
|
10
|
-
</div>
|
11
|
-
);
|
12
|
-
};
|
package/src/parts/Home/Home.tsx
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
export const IssueList = () => {
|
2
|
-
return {
|
3
|
-
content: {
|
4
|
-
type: "issue",
|
5
|
-
template: "cover",
|
6
|
-
downloadOptions: {
|
7
|
-
buttonType: "SINGLE",
|
8
|
-
progressType: "RADIAL",
|
9
|
-
},
|
10
|
-
openContent: {},
|
11
|
-
tapCover: {
|
12
|
-
type: "openContent",
|
13
|
-
mode: "MODAL",
|
14
|
-
titleBar: true,
|
15
|
-
},
|
16
|
-
},
|
17
|
-
dataSource: {
|
18
|
-
type: "issue",
|
19
|
-
sort: [
|
20
|
-
{
|
21
|
-
publicationDate: {
|
22
|
-
direction: "DESC",
|
23
|
-
},
|
24
|
-
},
|
25
|
-
],
|
26
|
-
limit: 3,
|
27
|
-
},
|
28
|
-
type: "list",
|
29
|
-
template: "horizontal",
|
30
|
-
};
|
31
|
-
};
|
package/src/parts/Link/Link.tsx
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
import { JsonComponent } from "../JsonComponent/JsonComponent.tsx";
|
2
|
-
|
3
|
-
export const Link = ({ to, message }: { to: string; message: string }) => {
|
4
|
-
const json = {
|
5
|
-
type: "button",
|
6
|
-
tap: {
|
7
|
-
type: "navigate",
|
8
|
-
path: to,
|
9
|
-
},
|
10
|
-
message,
|
11
|
-
};
|
12
|
-
return (
|
13
|
-
<div className="Link">
|
14
|
-
<JsonComponent json={json} />
|
15
|
-
</div>
|
16
|
-
);
|
17
|
-
};
|
package/src/parts/Main/Main.tsx
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export * from "../Components/Components.tsx";
|
@@ -1,17 +0,0 @@
|
|
1
|
-
import { JsonComponent } from "../JsonComponent/JsonComponent.tsx";
|
2
|
-
|
3
|
-
export const MenuItems = ({ menuName }: { menuName: string }) => {
|
4
|
-
const json = {
|
5
|
-
dataSource: {
|
6
|
-
type: "menu",
|
7
|
-
filter: {
|
8
|
-
name: {
|
9
|
-
value: menuName,
|
10
|
-
},
|
11
|
-
},
|
12
|
-
},
|
13
|
-
type: "menu",
|
14
|
-
template: "STATIC",
|
15
|
-
};
|
16
|
-
return <JsonComponent json={json} />;
|
17
|
-
};
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { jest } from "@jest/globals";
|
2
|
-
|
3
|
-
// jest.unstable_mockModule("react", () => {
|
4
|
-
// return {
|
5
|
-
// createElement(key, props, children) {
|
6
|
-
// return {
|
7
|
-
// key,
|
8
|
-
// props,
|
9
|
-
// children,
|
10
|
-
// };
|
11
|
-
// },
|
12
|
-
// };
|
13
|
-
// });
|
14
|
-
|
15
|
-
// jest.unstable_mockModule("react/jsx-runtime", () => {
|
16
|
-
// return {
|
17
|
-
// jsx(fn, props) {
|
18
|
-
// return fn(props);
|
19
|
-
// },
|
20
|
-
// };
|
21
|
-
// });
|
@@ -1,42 +0,0 @@
|
|
1
|
-
export const MostRead = ({ limit = 3 }) => {
|
2
|
-
return {
|
3
|
-
content: {
|
4
|
-
type: "issue",
|
5
|
-
issueContextKey: "content",
|
6
|
-
template: "details",
|
7
|
-
descriptionMessage: "",
|
8
|
-
class: "issue-card",
|
9
|
-
hideComponents: {
|
10
|
-
publication: true,
|
11
|
-
tags: true,
|
12
|
-
categories: true,
|
13
|
-
publicationDate: true,
|
14
|
-
cover: true,
|
15
|
-
properties: true,
|
16
|
-
description: false,
|
17
|
-
},
|
18
|
-
},
|
19
|
-
dataSource: {
|
20
|
-
type: "content",
|
21
|
-
filter: {
|
22
|
-
AND: [
|
23
|
-
{
|
24
|
-
contentType: {
|
25
|
-
value: "POST",
|
26
|
-
},
|
27
|
-
},
|
28
|
-
{
|
29
|
-
postType: {
|
30
|
-
value: "post",
|
31
|
-
},
|
32
|
-
},
|
33
|
-
],
|
34
|
-
},
|
35
|
-
limit,
|
36
|
-
},
|
37
|
-
type: "list",
|
38
|
-
tapEntry: {
|
39
|
-
type: "openContent",
|
40
|
-
},
|
41
|
-
};
|
42
|
-
};
|
@@ -1,15 +0,0 @@
|
|
1
|
-
import { JsonComponent } from "../JsonComponent/JsonComponent.tsx";
|
2
|
-
|
3
|
-
export const NoSearchResults = () => {
|
4
|
-
const json = {
|
5
|
-
tag: "p",
|
6
|
-
type: "html",
|
7
|
-
content: "SEARCH_RESULT_NO_SEARCH",
|
8
|
-
class: "no-search",
|
9
|
-
condition: {
|
10
|
-
value: "$context.phrase",
|
11
|
-
operation: "NOT_SET",
|
12
|
-
},
|
13
|
-
};
|
14
|
-
return <JsonComponent json={json} />;
|
15
|
-
};
|
@@ -1,10 +0,0 @@
|
|
1
|
-
export * from "../AppBar/AppBar.tsx";
|
2
|
-
export * from "../Button/Button.tsx";
|
3
|
-
export * from "../EPapers/EPapers.tsx";
|
4
|
-
export * from "../Home/Home.tsx";
|
5
|
-
export * from "../IssueList/IssueList.tsx";
|
6
|
-
export * from "../Login/Login.tsx";
|
7
|
-
export * from "../MostRead/MostRead.tsx";
|
8
|
-
export * from "../NoSearchResults/NoSearchResults.tsx";
|
9
|
-
export * from "../SearchField/SearchField.tsx";
|
10
|
-
export * from "../Swiper/Swiper.tsx";
|
@@ -1,21 +0,0 @@
|
|
1
|
-
import { JsonComponent } from "../JsonComponent/JsonComponent.tsx";
|
2
|
-
|
3
|
-
export const PostContentBody = () => {
|
4
|
-
const json = {
|
5
|
-
type: "content-body",
|
6
|
-
id: "post-content-body",
|
7
|
-
customBlocks: [],
|
8
|
-
class: ["post-content-service"],
|
9
|
-
dataSource: {
|
10
|
-
type: "content",
|
11
|
-
preventSSRCache: true,
|
12
|
-
filter: {
|
13
|
-
id: {
|
14
|
-
value: "$context.content.id",
|
15
|
-
},
|
16
|
-
},
|
17
|
-
},
|
18
|
-
isLazy: false,
|
19
|
-
};
|
20
|
-
return <JsonComponent json={json} />;
|
21
|
-
};
|
@@ -1,14 +0,0 @@
|
|
1
|
-
import type React from "react";
|
2
|
-
import { JsonComponent } from "../JsonComponent/JsonComponent.tsx";
|
3
|
-
|
4
|
-
export const SearchField = (): React.ReactElement => {
|
5
|
-
const json = {
|
6
|
-
type: "search-field",
|
7
|
-
className: "searchfield",
|
8
|
-
};
|
9
|
-
return (
|
10
|
-
<div className="SearchField">
|
11
|
-
<JsonComponent json={json} />
|
12
|
-
</div>
|
13
|
-
);
|
14
|
-
};
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import { JsonComponent } from "../JsonComponent/JsonComponent.tsx";
|
2
|
-
|
3
|
-
export const SearchLink = ({ message }: { message?: string } = {}) => {
|
4
|
-
const json = {
|
5
|
-
type: "button",
|
6
|
-
tap: {
|
7
|
-
type: "navigate",
|
8
|
-
path: "suche",
|
9
|
-
},
|
10
|
-
message,
|
11
|
-
buttonClass: "search",
|
12
|
-
id: "button-search",
|
13
|
-
};
|
14
|
-
return (
|
15
|
-
<div className="SearchLink">
|
16
|
-
<JsonComponent json={json} />
|
17
|
-
</div>
|
18
|
-
);
|
19
|
-
};
|
@@ -1,118 +0,0 @@
|
|
1
|
-
import { ISearchResult } from "../ISearchResult/ISearchResult.tsx";
|
2
|
-
import type { ISearchResultComponent } from "../ISearchResultComponent/ISearchResultComponent.tsx";
|
3
|
-
import { JsonComponent } from "../JsonComponent/JsonComponent.tsx";
|
4
|
-
import * as UnwrapComponent from "../UnwrapComponent/UnwrapComponent.tsx";
|
5
|
-
|
6
|
-
export const SearchResults = ({
|
7
|
-
SearchResult,
|
8
|
-
}: {
|
9
|
-
SearchResult: ISearchResultComponent;
|
10
|
-
}) => {
|
11
|
-
const searchResult: ISearchResult = {
|
12
|
-
description: "abc",
|
13
|
-
label: "abc",
|
14
|
-
readtime: "",
|
15
|
-
title: "$context.title",
|
16
|
-
imageSrc: "",
|
17
|
-
};
|
18
|
-
const unwrapped = UnwrapComponent.unwrapComponent(
|
19
|
-
<SearchResult item={searchResult} />
|
20
|
-
);
|
21
|
-
const json = {
|
22
|
-
content: unwrapped,
|
23
|
-
dataSource: {
|
24
|
-
phrase: "$context.phrase",
|
25
|
-
type: "search-result",
|
26
|
-
filter: {
|
27
|
-
AND: [
|
28
|
-
{
|
29
|
-
OR: [
|
30
|
-
{
|
31
|
-
contentType: {
|
32
|
-
value: "POST",
|
33
|
-
},
|
34
|
-
},
|
35
|
-
{
|
36
|
-
contentType: {
|
37
|
-
value: "BUNDLE",
|
38
|
-
},
|
39
|
-
},
|
40
|
-
],
|
41
|
-
},
|
42
|
-
{
|
43
|
-
postType: {
|
44
|
-
value: "post",
|
45
|
-
},
|
46
|
-
},
|
47
|
-
{
|
48
|
-
condition: {
|
49
|
-
value: "$context.issue-age",
|
50
|
-
compareValue: "day",
|
51
|
-
},
|
52
|
-
age: {
|
53
|
-
count: 1,
|
54
|
-
unit: "DAY",
|
55
|
-
},
|
56
|
-
},
|
57
|
-
{
|
58
|
-
condition: {
|
59
|
-
value: "$context.issue-age",
|
60
|
-
compareValue: "week",
|
61
|
-
},
|
62
|
-
age: {
|
63
|
-
count: 1,
|
64
|
-
unit: "WEEK",
|
65
|
-
},
|
66
|
-
},
|
67
|
-
{
|
68
|
-
condition: {
|
69
|
-
value: "$context.issue-age",
|
70
|
-
compareValue: "month",
|
71
|
-
},
|
72
|
-
age: {
|
73
|
-
count: 1,
|
74
|
-
unit: "MONTH",
|
75
|
-
},
|
76
|
-
},
|
77
|
-
{
|
78
|
-
condition: {
|
79
|
-
value: "$context.issue-age",
|
80
|
-
compareValue: "year",
|
81
|
-
},
|
82
|
-
age: {
|
83
|
-
count: 1,
|
84
|
-
unit: "YEAR",
|
85
|
-
},
|
86
|
-
},
|
87
|
-
],
|
88
|
-
},
|
89
|
-
contextKey: "searchResults",
|
90
|
-
searchOptions: {
|
91
|
-
sortBy: "PUB_DATE_DESC",
|
92
|
-
findAll: true,
|
93
|
-
},
|
94
|
-
limitCharactersBeforeHit: 70,
|
95
|
-
legacyMode: {
|
96
|
-
mapPostToIssue: true,
|
97
|
-
unwrapBundles: true,
|
98
|
-
},
|
99
|
-
},
|
100
|
-
type: "list",
|
101
|
-
class: "schlauch-section",
|
102
|
-
emptyMessage: {
|
103
|
-
message: "SEARCH_RESULT_NO_RESULT",
|
104
|
-
variables: ["$context.phrase"],
|
105
|
-
},
|
106
|
-
errorMessage: "SEARCH_ERROR",
|
107
|
-
errorButtonLabel: "SEARCH_ERROR_RETRY",
|
108
|
-
template: "grid",
|
109
|
-
tapEntry: {
|
110
|
-
type: "openContent",
|
111
|
-
},
|
112
|
-
};
|
113
|
-
return (
|
114
|
-
<div className="SearchResults">
|
115
|
-
<JsonComponent json={json} />
|
116
|
-
</div>
|
117
|
-
);
|
118
|
-
};
|
@@ -1,19 +0,0 @@
|
|
1
|
-
import { JsonComponent } from "../JsonComponent/JsonComponent.tsx";
|
2
|
-
|
3
|
-
export const SubscriptionLink = ({ message }: { message?: string } = {}) => {
|
4
|
-
const json = {
|
5
|
-
type: "button",
|
6
|
-
tap: {
|
7
|
-
type: "navigate",
|
8
|
-
path: "subscriptions",
|
9
|
-
},
|
10
|
-
message,
|
11
|
-
buttonClass: "subscriptions",
|
12
|
-
id: "button-subscriptions",
|
13
|
-
};
|
14
|
-
return (
|
15
|
-
<div className="SubscriptionLink">
|
16
|
-
<JsonComponent json={json} />
|
17
|
-
</div>
|
18
|
-
);
|
19
|
-
};
|
@@ -1,98 +0,0 @@
|
|
1
|
-
import type React from "react";
|
2
|
-
import * as HasComplexChildren from "../HasComplexChildren/HasComplexChildren.ts";
|
3
|
-
import * as CreateFakeSection from "../CreateFakeSection/CreateFakeSection.ts";
|
4
|
-
|
5
|
-
export const createElement = (tag, props, ...children) => {
|
6
|
-
return {
|
7
|
-
tag,
|
8
|
-
props,
|
9
|
-
children,
|
10
|
-
};
|
11
|
-
};
|
12
|
-
|
13
|
-
const getComponentChildren = (element: any, componentProps: any) => {
|
14
|
-
if (componentProps && componentProps.children) {
|
15
|
-
if (typeof componentProps.children === "string") {
|
16
|
-
return [componentProps.children];
|
17
|
-
}
|
18
|
-
return componentProps.children;
|
19
|
-
}
|
20
|
-
if (element && element.children) {
|
21
|
-
if (typeof element.children === "string") {
|
22
|
-
return [element.children];
|
23
|
-
}
|
24
|
-
return element.children;
|
25
|
-
}
|
26
|
-
return [];
|
27
|
-
};
|
28
|
-
|
29
|
-
const getComponentProperties = (element: any) => {
|
30
|
-
// @ts-ignore
|
31
|
-
const componentType = element.type;
|
32
|
-
// @ts-ignore
|
33
|
-
const componentProps = element.props;
|
34
|
-
//@ts-ignore
|
35
|
-
const componentChildren = getComponentChildren(element, componentProps);
|
36
|
-
return {
|
37
|
-
componentType,
|
38
|
-
componentProps,
|
39
|
-
componentChildren,
|
40
|
-
};
|
41
|
-
};
|
42
|
-
|
43
|
-
export const unwrapComponent = (element: React.ReactNode) => {
|
44
|
-
if (!element) {
|
45
|
-
return {
|
46
|
-
type: "html",
|
47
|
-
tag: "div",
|
48
|
-
content: `Unknown component`,
|
49
|
-
};
|
50
|
-
}
|
51
|
-
if (
|
52
|
-
typeof element === "string" ||
|
53
|
-
typeof element === "number" ||
|
54
|
-
typeof element === "boolean"
|
55
|
-
) {
|
56
|
-
return {
|
57
|
-
type: "html",
|
58
|
-
tag: "div",
|
59
|
-
content: `${element}`,
|
60
|
-
};
|
61
|
-
}
|
62
|
-
|
63
|
-
const { componentChildren, componentProps, componentType } =
|
64
|
-
getComponentProperties(element);
|
65
|
-
|
66
|
-
if (typeof componentType === "function") {
|
67
|
-
const vnode = componentType({
|
68
|
-
...componentProps,
|
69
|
-
});
|
70
|
-
const rendered = unwrapComponent(vnode);
|
71
|
-
return rendered;
|
72
|
-
}
|
73
|
-
|
74
|
-
if (typeof componentType === "string") {
|
75
|
-
const hasComplexChildren =
|
76
|
-
HasComplexChildren.hasComplexChildren(componentChildren);
|
77
|
-
const renderedChildren = hasComplexChildren
|
78
|
-
? componentChildren.map(unwrapComponent)
|
79
|
-
: [];
|
80
|
-
const content = hasComplexChildren ? "" : componentChildren[0] || "";
|
81
|
-
const props = componentProps ? componentProps : {};
|
82
|
-
|
83
|
-
return CreateFakeSection.createFakeSection([
|
84
|
-
{
|
85
|
-
type: "html",
|
86
|
-
tag: componentType,
|
87
|
-
content,
|
88
|
-
},
|
89
|
-
...renderedChildren,
|
90
|
-
]);
|
91
|
-
}
|
92
|
-
if (componentType) {
|
93
|
-
return {
|
94
|
-
type: "TODO",
|
95
|
-
};
|
96
|
-
}
|
97
|
-
return {};
|
98
|
-
};
|