@pronto-tools-and-more/components 10.18.0 → 10.20.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
@@ -5,11 +5,35 @@ var JsonComponent = ({ json }) => {
5
5
  };
6
6
 
7
7
  // src/parts/ArticleAuthors/ArticleAuthors.tsx
8
+ var unrender = (element, renderElement) => {
9
+ const { render, unrender: unrender7, ...rest } = element;
10
+ const node = render({
11
+ id: `$functions.id($context, 'context', 'id')`,
12
+ name: `$functions.id($context, 'context', 'name')`,
13
+ type: `$functions.id($context, 'context', 'type')`,
14
+ language: `$functions.id($context, 'context', 'properties', 'lang')`,
15
+ imageSrc: `$functions.id($context, 'context', 'properties', 'thumbnails', 'default')`
16
+ });
17
+ const condition = {
18
+ value: "$context.context.type",
19
+ operation: "EQUALS",
20
+ compareValue: "author"
21
+ };
22
+ const final = {
23
+ ...renderElement(node),
24
+ condition
25
+ };
26
+ return {
27
+ ...rest,
28
+ content: final
29
+ };
30
+ };
8
31
  var ArticleAuthors = ({
9
32
  render
10
33
  }) => {
11
34
  const json = {
12
35
  render,
36
+ unrender,
13
37
  dataSource: {
14
38
  data: "$context.content.taxonomies",
15
39
  type: "context",
@@ -97,6 +121,23 @@ var createFilterFromProperties = ({
97
121
  };
98
122
 
99
123
  // src/parts/ArticleList/ArticleList.tsx
124
+ var unrender2 = (element, renderElement) => {
125
+ const { render, ...rest } = element;
126
+ const node = render({
127
+ name: `$functions.id($context, 'content', 'name')`,
128
+ description: `$functions.id($context, 'content', 'description')`,
129
+ imageSrc: `$functions.id($context, 'content', 'thumbnails', 'default')`,
130
+ slug: `$functions.id($context, 'content', 'properties', 'slug')`,
131
+ metadataVideoPodcast: `$functions.id($context, 'content', 'properties', 'metadataVideoPodcast')`,
132
+ readTime: `$functions.getReadTime($context.content)`,
133
+ publicationDate: `$functions.id($context, 'content', 'publicationDate')`
134
+ });
135
+ const final = renderElement(node);
136
+ return {
137
+ ...rest,
138
+ content: final
139
+ };
140
+ };
100
141
  var ArticleList = ({
101
142
  properties,
102
143
  render,
@@ -114,6 +155,7 @@ var ArticleList = ({
114
155
  });
115
156
  const json = {
116
157
  render,
158
+ unrender: unrender2,
117
159
  dataSource: {
118
160
  type: "content",
119
161
  filter: {
@@ -190,12 +232,35 @@ var Button = ({
190
232
  };
191
233
 
192
234
  // src/parts/CategoryList/CategoryList.tsx
235
+ var unrender3 = (element, renderElement) => {
236
+ const { render, unrender: unrender7, ...rest } = element;
237
+ const node = render({
238
+ id: `$functions.id($context, 'context', 'id')`,
239
+ name: `$functions.id($context, 'context', 'name')`,
240
+ type: `$functions.id($context, 'context', 'type')`,
241
+ language: `$functions.id($context, 'context', 'properties', 'lang')`
242
+ });
243
+ const condition = {
244
+ value: "$context.context.type",
245
+ operation: "EQUALS",
246
+ compareValue: "category"
247
+ };
248
+ const final = {
249
+ ...renderElement(node),
250
+ condition
251
+ };
252
+ return {
253
+ ...rest,
254
+ content: final
255
+ };
256
+ };
193
257
  var CategoryList = ({
194
258
  render,
195
259
  contentKey
196
260
  }) => {
197
261
  const json = {
198
262
  render,
263
+ unrender: unrender3,
199
264
  dataSource: {
200
265
  data: `$context.${contentKey ?? "content"}.taxonomies`,
201
266
  type: "context",
@@ -209,6 +274,23 @@ var CategoryList = ({
209
274
  };
210
275
 
211
276
  // src/parts/Collection/Collection.tsx
277
+ var unrender4 = (element, renderElement) => {
278
+ const { render, ...rest } = element;
279
+ const node = render({
280
+ name: `$functions.id($context, 'collection-content', 'name')`,
281
+ description: `$functions.id($context, 'collection-content', 'description')`,
282
+ imageSrc: `$functions.id($context, 'collection-content', 'thumbnails', 'default')`,
283
+ slug: `$functions.id($context, 'collection-content', 'properties', 'slug')`,
284
+ metadataVideoPodcast: `$functions.id($context, 'collection-content', 'properties', 'metadataVideoPodcast')`,
285
+ readTime: `$functions.getReadTime($context['collection-content'])`,
286
+ publicationDate: `$functions.id($context, 'collection-content', 'publicationDate')`
287
+ });
288
+ const final = renderElement(node);
289
+ return {
290
+ ...rest,
291
+ content: final
292
+ };
293
+ };
212
294
  var Collection = ({
213
295
  limit,
214
296
  offset,
@@ -217,6 +299,7 @@ var Collection = ({
217
299
  }) => {
218
300
  const json = {
219
301
  render,
302
+ unrender: unrender4,
220
303
  dataSource: {
221
304
  type: "collection-content",
222
305
  limit: `${limit}`,
@@ -268,6 +351,11 @@ var ContentTitle = () => {
268
351
  return /* @__PURE__ */ React.createElement(JsonComponent, { json });
269
352
  };
270
353
 
354
+ // src/parts/DateHelper/DateHelper.ts
355
+ var dateHelper = (date, format, language = "de") => {
356
+ return `$functions.dateHelper(${date}).locale('${language}').format('${format}')`;
357
+ };
358
+
271
359
  // src/parts/DossierList/DossierList.tsx
272
360
  var DossierList = () => {
273
361
  const json = {
@@ -529,7 +617,9 @@ var PublicationToggle = () => {
529
617
  };
530
618
 
531
619
  // src/parts/SearchField/SearchField.tsx
532
- var SearchField = () => {
620
+ var SearchField = ({
621
+ placeholder
622
+ } = {}) => {
533
623
  const json = {
534
624
  type: "search-field",
535
625
  class: "searchfield"
@@ -544,7 +634,39 @@ var SearchHeaderSelect = () => {
544
634
 
545
635
  // src/parts/SearchHeaderToggle/SearchHeaderToggle.tsx
546
636
  var SearchHeaderToggle = () => {
547
- return /* @__PURE__ */ React.createElement("div", { className: "SearchHeaderToggle" }, /* @__PURE__ */ React.createElement("div", null, "news"), /* @__PURE__ */ React.createElement("div", null, "epaper"));
637
+ const json = {
638
+ content: [
639
+ {
640
+ type: "button",
641
+ tap: {
642
+ type: "navigate",
643
+ params: {
644
+ searchtype: "news"
645
+ },
646
+ mergeParams: true,
647
+ path: "suche"
648
+ },
649
+ message: "News",
650
+ buttonClass: "news"
651
+ },
652
+ {
653
+ type: "button",
654
+ tap: {
655
+ type: "navigate",
656
+ params: {
657
+ searchtype: "epaper"
658
+ },
659
+ mergeParams: true,
660
+ path: "suche"
661
+ },
662
+ message: "E-Paper",
663
+ buttonClass: "epaper"
664
+ }
665
+ ],
666
+ type: "section",
667
+ class: "search-toggle selected)"
668
+ };
669
+ return /* @__PURE__ */ React.createElement("div", { className: "SearchHeaderToggle" }, /* @__PURE__ */ React.createElement(JsonComponent, { json }));
548
670
  };
549
671
 
550
672
  // src/parts/SearchLink/SearchLink.tsx
@@ -584,6 +706,28 @@ var getFilterLanguage = (language) => {
584
706
  };
585
707
 
586
708
  // src/parts/SearchResults/SearchResults.tsx
709
+ var getImageSrc = (fallbackImage) => {
710
+ if (fallbackImage) {
711
+ return `$functions.fallback($functions.id($context, 'search-result', 'issue', 'thumbnails', 'default'), '${fallbackImage}')`;
712
+ }
713
+ return `$functions.id($context, 'search-result', 'issue', 'thumbnails', 'default')`;
714
+ };
715
+ var unrender5 = (element, renderElement) => {
716
+ const { render, fallbackImage, ...rest } = element;
717
+ const node = render({
718
+ title: "$functions.id($context, 'search-result', 'issue', 'name')",
719
+ name: "$functions.id($context, 'search-result', 'issue', 'name')",
720
+ description: "$functions.id($context, 'search-result', 'issue', 'description')",
721
+ imageSrc: getImageSrc(fallbackImage),
722
+ language: "$functions.id($context, 'search-result', 'issue', 'properties', 'lang')",
723
+ slug: "$functions.id($context, 'search-result', 'issue', 'properties', 'slug')"
724
+ });
725
+ const final = renderElement(node);
726
+ return {
727
+ ...rest,
728
+ content: final
729
+ };
730
+ };
587
731
  var SearchResults = ({
588
732
  render,
589
733
  language,
@@ -661,6 +805,7 @@ var SearchResults = ({
661
805
  }
662
806
  const json = {
663
807
  render,
808
+ unrender: unrender5,
664
809
  fallbackImage,
665
810
  dataSource: {
666
811
  phrase: "$context.phrase",
@@ -711,9 +856,31 @@ var SubscriptionLink = ({ message } = {}) => {
711
856
  };
712
857
 
713
858
  // src/parts/TagList/TagList.tsx
859
+ var unrender6 = (element, renderElement) => {
860
+ const { render, ...rest } = element;
861
+ const node = render({
862
+ id: `$functions.id($context, 'context', 'id')`,
863
+ name: `$functions.id($context, 'context', 'name')`,
864
+ language: `$functions.id($context, 'context', 'properties', 'lang')`
865
+ });
866
+ const condition = {
867
+ value: "$context.context.type",
868
+ operation: "EQUALS",
869
+ compareValue: "tag"
870
+ };
871
+ const final = {
872
+ ...renderElement(node),
873
+ condition
874
+ };
875
+ return {
876
+ ...rest,
877
+ content: final
878
+ };
879
+ };
714
880
  var TagList = ({ render }) => {
715
881
  const json = {
716
882
  render,
883
+ unrender: unrender6,
717
884
  dataSource: {
718
885
  data: "$context.content.taxonomies",
719
886
  type: "context",
@@ -757,5 +924,6 @@ export {
757
924
  SearchLink,
758
925
  SearchResults,
759
926
  SubscriptionLink,
760
- TagList
927
+ TagList,
928
+ dateHelper
761
929
  };
@@ -7,6 +7,7 @@ export * from "../Collection/Collection.tsx";
7
7
  export * from "../Container/Container.tsx";
8
8
  export * from "../ContentBody/ContentBody.tsx";
9
9
  export * from "../ContentTitle/ContentTitle.tsx";
10
+ export * from "../DateHelper/DateHelper.ts";
10
11
  export * from "../DossierList/DossierList.tsx";
11
12
  export * from "../DossierSwiper/DossierSwiper.tsx";
12
13
  export * from "../EPaperLink/EPaperLink.tsx";
@@ -0,0 +1 @@
1
+ export declare const dateHelper: (date: string, format: string, language?: string) => string;
@@ -1,2 +1,4 @@
1
1
  import type React from "react";
2
- export declare const SearchField: () => React.ReactElement;
2
+ export declare const SearchField: ({ placeholder, }?: {
3
+ placeholder?: string;
4
+ }) => React.ReactElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pronto-tools-and-more/components",
3
- "version": "10.18.0",
3
+ "version": "10.20.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.0",
19
+ "@types/node": "^22.9.1",
20
20
  "@types/react": "^18.3.12",
21
21
  "esbuild": "^0.24.0",
22
22
  "react": "^18.3.1",