@pronto-tools-and-more/components 10.0.0 → 10.1.0

Sign up to get free protection for your applications and to get access to all the features.
package/dist/main.js CHANGED
@@ -4,6 +4,170 @@ var JsonComponent = ({ json }) => {
4
4
  return node;
5
5
  };
6
6
 
7
+ // src/parts/ArticleAuthors/ArticleAuthors.tsx
8
+ var ArticleAuthors = ({
9
+ render
10
+ }) => {
11
+ const json = {
12
+ render,
13
+ dataSource: {
14
+ data: "$context.content.taxonomies",
15
+ type: "context",
16
+ batchSize: 1e6
17
+ },
18
+ type: "list",
19
+ class: "data-custom-author-list",
20
+ template: "horizontal"
21
+ };
22
+ return /* @__PURE__ */ React.createElement("div", { className: "ArticleAuthors" }, /* @__PURE__ */ React.createElement(JsonComponent, { json }));
23
+ };
24
+
25
+ // src/parts/CreateFilterFromProperties/CreateFilterFromProperties.ts
26
+ var createFilterFromProperties = ({
27
+ properties,
28
+ authorId,
29
+ categoryId,
30
+ bundleId
31
+ }) => {
32
+ if (bundleId) {
33
+ return [
34
+ {
35
+ bundle: {
36
+ value: {
37
+ id: bundleId
38
+ }
39
+ }
40
+ }
41
+ ];
42
+ }
43
+ if (categoryId) {
44
+ return [
45
+ {
46
+ taxonomies: {
47
+ content: {
48
+ value: {
49
+ id: {
50
+ value: authorId
51
+ }
52
+ }
53
+ }
54
+ }
55
+ }
56
+ ];
57
+ }
58
+ if (authorId) {
59
+ return [
60
+ {
61
+ taxonomies: {
62
+ content: {
63
+ value: {
64
+ id: {
65
+ value: authorId
66
+ }
67
+ }
68
+ }
69
+ }
70
+ }
71
+ ];
72
+ }
73
+ const entries = Object.entries(properties);
74
+ if (entries.length === 0) {
75
+ return [];
76
+ }
77
+ const outerFilter = [];
78
+ for (const [key, value] of Object.entries(properties)) {
79
+ if (Array.isArray(value)) {
80
+ const innerFilter = [];
81
+ for (const item of value) {
82
+ innerFilter.push({
83
+ properties: {
84
+ key,
85
+ value: item
86
+ }
87
+ });
88
+ }
89
+ if (innerFilter.length > 0) {
90
+ outerFilter.push({
91
+ OR: innerFilter
92
+ });
93
+ }
94
+ }
95
+ }
96
+ return outerFilter;
97
+ };
98
+
99
+ // src/parts/ArticleList/ArticleList.tsx
100
+ var ArticleList = ({
101
+ properties,
102
+ render,
103
+ authorId,
104
+ categoryId,
105
+ bundleId
106
+ }) => {
107
+ const additionalFilter = createFilterFromProperties({
108
+ properties,
109
+ authorId,
110
+ categoryId,
111
+ bundleId
112
+ });
113
+ const json = {
114
+ render,
115
+ dataSource: {
116
+ type: "content",
117
+ filter: {
118
+ AND: [
119
+ {
120
+ postType: {
121
+ value: "post"
122
+ }
123
+ },
124
+ {
125
+ contentType: {
126
+ value: "POST"
127
+ }
128
+ },
129
+ ...additionalFilter
130
+ ]
131
+ },
132
+ offset: "0",
133
+ sort: [
134
+ {
135
+ publicationDate: {
136
+ direction: "DESC"
137
+ }
138
+ }
139
+ ],
140
+ contextKey: "content"
141
+ },
142
+ type: "list",
143
+ tapEntry: {
144
+ value: {
145
+ type: "openUrl",
146
+ url: "#",
147
+ target: "#"
148
+ },
149
+ condition: {
150
+ compareValue: "external_links",
151
+ value: "#"
152
+ },
153
+ fallback: {
154
+ type: "openContent"
155
+ }
156
+ },
157
+ class: "data-custom-list",
158
+ template: "horizontal",
159
+ pagination: {
160
+ suffix: "articles",
161
+ text: {
162
+ next: {
163
+ label: ""
164
+ }
165
+ }
166
+ }
167
+ };
168
+ return /* @__PURE__ */ React.createElement("div", { className: "ArticleList IssueList" }, /* @__PURE__ */ React.createElement(JsonComponent, { json }));
169
+ };
170
+
7
171
  // src/parts/Button/Button.tsx
8
172
  var Button = ({
9
173
  message,
@@ -259,152 +423,6 @@ var Heading = ({
259
423
  return /* @__PURE__ */ React.createElement("h4", { className: fullClassName }, text);
260
424
  };
261
425
 
262
- // src/parts/CreateFilterFromProperties/CreateFilterFromProperties.ts
263
- var createFilterFromProperties = ({
264
- properties,
265
- authorId,
266
- categoryId,
267
- bundleId
268
- }) => {
269
- if (bundleId) {
270
- return [
271
- {
272
- bundle: {
273
- value: {
274
- id: bundleId
275
- }
276
- }
277
- }
278
- ];
279
- }
280
- if (categoryId) {
281
- return [
282
- {
283
- taxonomies: {
284
- content: {
285
- value: {
286
- id: {
287
- value: authorId
288
- }
289
- }
290
- }
291
- }
292
- }
293
- ];
294
- }
295
- if (authorId) {
296
- return [
297
- {
298
- taxonomies: {
299
- content: {
300
- value: {
301
- id: {
302
- value: authorId
303
- }
304
- }
305
- }
306
- }
307
- }
308
- ];
309
- }
310
- const entries = Object.entries(properties);
311
- if (entries.length === 0) {
312
- return [];
313
- }
314
- const outerFilter = [];
315
- for (const [key, value] of Object.entries(properties)) {
316
- if (Array.isArray(value)) {
317
- const innerFilter = [];
318
- for (const item of value) {
319
- innerFilter.push({
320
- properties: {
321
- key,
322
- value: item
323
- }
324
- });
325
- }
326
- if (innerFilter.length > 0) {
327
- outerFilter.push({
328
- OR: innerFilter
329
- });
330
- }
331
- }
332
- }
333
- return outerFilter;
334
- };
335
-
336
- // src/parts/ArticleList/ArticleList.tsx
337
- var ArticleList = ({
338
- properties,
339
- render,
340
- authorId,
341
- categoryId,
342
- bundleId
343
- }) => {
344
- const additionalFilter = createFilterFromProperties({
345
- properties,
346
- authorId,
347
- categoryId,
348
- bundleId
349
- });
350
- const json = {
351
- render,
352
- dataSource: {
353
- type: "content",
354
- filter: {
355
- AND: [
356
- {
357
- postType: {
358
- value: "post"
359
- }
360
- },
361
- {
362
- contentType: {
363
- value: "POST"
364
- }
365
- },
366
- ...additionalFilter
367
- ]
368
- },
369
- offset: "0",
370
- sort: [
371
- {
372
- publicationDate: {
373
- direction: "DESC"
374
- }
375
- }
376
- ],
377
- contextKey: "content"
378
- },
379
- type: "list",
380
- tapEntry: {
381
- value: {
382
- type: "openUrl",
383
- url: "#",
384
- target: "#"
385
- },
386
- condition: {
387
- compareValue: "external_links",
388
- value: "#"
389
- },
390
- fallback: {
391
- type: "openContent"
392
- }
393
- },
394
- class: "data-custom-list",
395
- template: "horizontal",
396
- pagination: {
397
- suffix: "articles",
398
- text: {
399
- next: {
400
- label: ""
401
- }
402
- }
403
- }
404
- };
405
- return /* @__PURE__ */ React.createElement("div", { className: "ArticleList IssueList" }, /* @__PURE__ */ React.createElement(JsonComponent, { json }));
406
- };
407
-
408
426
  // src/parts/Link/Link.tsx
409
427
  var Link = ({
410
428
  to,
@@ -686,6 +704,7 @@ var SubscriptionLink = ({ message } = {}) => {
686
704
  return /* @__PURE__ */ React.createElement("div", { className: "SubscriptionLink" }, /* @__PURE__ */ React.createElement(JsonComponent, { json }));
687
705
  };
688
706
  export {
707
+ ArticleAuthors,
689
708
  ArticleList,
690
709
  Button,
691
710
  CategoryList,
@@ -0,0 +1,5 @@
1
+ import type React from "react";
2
+ import type { IAuthorItem } from "../IAuthorItem/IAuthorItem.ts";
3
+ export interface ArticleAuthorRenderer {
4
+ (item: IAuthorItem): React.ReactNode;
5
+ }
@@ -0,0 +1,4 @@
1
+ import { ArticleAuthorRenderer } from "../ArticleAuthorRenderer/ArticleAuthorRenderer.ts";
2
+ export declare const ArticleAuthors: ({ render, }: {
3
+ render: ArticleAuthorRenderer;
4
+ }) => import("react").JSX.Element;
@@ -1,3 +1,6 @@
1
+ export * from "../ArticleAuthors/ArticleAuthors.tsx";
2
+ export * from "../ArticleList/ArticleList.tsx";
3
+ export * from "../ArticleListItemRenderer/ArticleListItemRenderer.ts";
1
4
  export * from "../Button/Button.tsx";
2
5
  export * from "../CategoryList/CategoryList.tsx";
3
6
  export * from "../Collection/Collection.tsx";
@@ -14,13 +17,11 @@ export * from "../HeaderLogo/HeaderLogo.tsx";
14
17
  export * from "../HeaderLogoSection/HeaderLogoSection.tsx";
15
18
  export * from "../HeaderMenuItems/HeaderMenuItems.tsx";
16
19
  export * from "../Heading/Heading.tsx";
20
+ export * from "../IArticleListItem/IArticleListItem.ts";
17
21
  export * from "../ICategoryItem/ICategoryItem.ts";
18
22
  export * from "../IFooterSocialLink/IFooterSocialLink.ts";
19
- export * from "../IArticleListItem/IArticleListItem.ts";
20
23
  export * from "../ISearchResult/ISearchResult.ts";
21
24
  export * from "../ISearchResultComponent/ISearchResultComponent.tsx";
22
- export * from "../ArticleList/ArticleList.tsx";
23
- export * from "../ArticleListItemRenderer/ArticleListItemRenderer.ts";
24
25
  export * from "../JsonComponent/JsonComponent.tsx";
25
26
  export * from "../Link/Link.tsx";
26
27
  export * from "../Login/Login.tsx";
@@ -0,0 +1,8 @@
1
+ export interface IAuthorItem {
2
+ readonly name: string;
3
+ readonly id: string;
4
+ readonly language: string;
5
+ readonly imageSrc: string;
6
+ readonly email: string;
7
+ readonly description: string;
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pronto-tools-and-more/components",
3
- "version": "10.0.0",
3
+ "version": "10.1.0",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "types": "dist/main.d.ts",