maverick-wave-astro 1.46.0 → 1.47.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.
@@ -408,6 +408,7 @@ const look: LookOptions = {
408
408
  } from '../dist/story/caption.js';
409
409
  import {
410
410
  type BlocksCard,
411
+ cardTexts,
411
412
  designFor,
412
413
  designsOf,
413
414
  seriesCards,
@@ -1077,7 +1078,10 @@ const look: LookOptions = {
1077
1078
  design,
1078
1079
  frame,
1079
1080
  motion: playable ? motion : null,
1080
- texts: seriesTexts(seriesData[el.dataset.series ?? '']?.config ?? {}),
1081
+ texts: cardTexts(
1082
+ seriesTexts(seriesData[el.dataset.series ?? '']?.config ?? {}),
1083
+ card
1084
+ ),
1081
1085
  moves: playable && Boolean(motion),
1082
1086
  state: 'waiting',
1083
1087
  scene: null,
@@ -179,7 +179,17 @@ export interface RenderedBlock {
179
179
  export interface BlocksCard {
180
180
  kind: 'blocks';
181
181
  blocks: RenderedBlock[];
182
+ without?: OwnText[];
182
183
  }
184
+ declare const OWN_SWITCHES: {
185
+ readonly footer: "showFooter";
186
+ readonly reply: "showReply";
187
+ };
188
+ type OwnText = keyof typeof OWN_SWITCHES;
189
+ export declare const cardTexts: <T extends {
190
+ footer?: string;
191
+ reply?: string;
192
+ }>(texts: T, card: StoryCard) => T;
183
193
  export type StoryCard = EventCard | PromoCard | BlocksCard;
184
194
  export declare const eventBlocks: (card: EventCard) => BlocksCard;
185
195
  export declare const storyDate: (date: string, locale?: string) => StoryDate | undefined;
@@ -199,3 +209,4 @@ export interface SeriesStory {
199
209
  share: StoryShare;
200
210
  }
201
211
  export declare const seriesCards: (series: StorySeries, site: string, locale?: string, now?: Date) => SeriesStory[];
212
+ export {};
@@ -79,6 +79,16 @@ export const seriesTexts = (config) => ({
79
79
  footer: shown(config.showFooter, config.footer),
80
80
  reply: shown(config.showReply, config.reply),
81
81
  });
82
+ // An entry switches the series' call to action or note off for its own story,
83
+ // say an Instagram live nobody registers for.
84
+ const OWN_SWITCHES = { footer: 'showFooter', reply: 'showReply' };
85
+ const switchedOff = (item) => Object.keys(OWN_SWITCHES).filter(text => item[OWN_SWITCHES[text]] === false);
86
+ export const cardTexts = (texts, card) => card.kind === 'blocks' && card.without?.length
87
+ ? {
88
+ ...texts,
89
+ ...Object.fromEntries(card.without.map(text => [text, undefined])),
90
+ }
91
+ : texts;
82
92
  // The event card as blocks: the tile with time and place beside it, title,
83
93
  // description and price - the layout every story of a series starts from.
84
94
  export const eventBlocks = (card) => {
@@ -327,12 +337,18 @@ export const seriesCards = (series, site, locale = 'de-DE', now = new Date()) =>
327
337
  shareLine(block, source === FIXED_TEXT && HEADINGS.includes(block.style)),
328
338
  ]
329
339
  : []);
340
+ const without = switchedOff(item);
341
+ const card = {
342
+ kind: 'blocks',
343
+ blocks,
344
+ ...(without.length ? { without } : {}),
345
+ };
330
346
  return {
331
- card: { kind: 'blocks', blocks },
347
+ card,
332
348
  label,
333
349
  file: storyFileName(site, name, label, date ?? ''),
334
350
  expires: order === 'upcoming' && date ? eventExpiry({ date }) : undefined,
335
- share: { lead, date, lines, footer, reply },
351
+ share: { lead, date, lines, ...cardTexts({ footer, reply }, card) },
336
352
  };
337
353
  })
338
354
  .filter(story => story.card.blocks.length > 0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "maverick-wave-astro",
3
- "version": "1.46.0",
3
+ "version": "1.47.0",
4
4
  "description": "Shared frame for static Astro homepages built with MaverickWave: layout, SEO, design variants, schedule, building blocks.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -52,7 +52,7 @@
52
52
  "showKicker": "true"
53
53
  },
54
54
  "title": "Text der kleinen Überschrift",
55
- "description": "Steht oben neben dem Logo, zum Beispiel „Workshop“ oder „Mittagstisch“.",
55
+ "description": "Steht oben neben dem Logo, zum Beispiel „Termin“ oder „Mittagstisch“.",
56
56
  "type": "string",
57
57
  "x-translate": false
58
58
  },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "title": "Stories",
4
- "description": "Wie deine Stories aussehen. Wähl einen Look und, wenn du magst, eigene Farben und die Stelle fürs Logo - die Vorschau rechts zeigt es sofort. Alles Weitere steht unter „Feinschliff“ und passt meist schon. Welches Design eine Story bekommt, wählst du im Reiter Story eines Bereichs, zum Beispiel bei den Workshops.",
4
+ "description": "Wie deine Stories aussehen. Wähl einen Look und, wenn du magst, eigene Farben und die Stelle fürs Logo - die Vorschau rechts zeigt es sofort. Alles Weitere steht unter „Feinschliff“ und passt meist schon. Welches Design eine Story bekommt, wählst du im Reiter Story eines Bereichs, zum Beispiel bei den Terminen.",
5
5
  "type": "object",
6
6
  "additionalProperties": false,
7
7
  "required": ["designs"],