@bygghammar/cms-platform 0.74.0 → 0.75.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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.75.0
2
+
3
+ - Countdown: pick the replacement global block from a dropdown instead of typing its key.
4
+
1
5
  # Changelog
2
6
 
3
7
  ## 0.74.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bygghammar/cms-platform",
3
- "version": "0.74.0",
3
+ "version": "0.75.0",
4
4
  "description": "Shared CMS platform: blocks, block types, i18n core, UI primitives and design-token contract used by every Bygghammar/Voyara site.",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -2413,7 +2413,11 @@ export {
2413
2413
  };
2414
2414
 
2415
2415
  /* ---------------- Countdown ---------------- */
2416
- export function CountdownInspector({ block, patch }: BlockPatchProps) {
2416
+ export function CountdownInspector({
2417
+ block,
2418
+ patch,
2419
+ globalSections = [],
2420
+ }: BlockPatchProps & { globalSections?: { key: string; name: string }[] }) {
2417
2421
  const p = (block.props ?? {}) as CountdownProps;
2418
2422
  const update = (next: CountdownProps) => patch(next as unknown as BlockProps);
2419
2423
 
@@ -2711,11 +2715,37 @@ export function CountdownInspector({ block, patch }: BlockPatchProps) {
2711
2715
  (v) => update({ ...p, onExpire: v as CountdownProps["onExpire"] }),
2712
2716
  )}
2713
2717
  {p.onExpire === "replace" ? (
2714
- <TextField
2715
- label="Global block key to show instead"
2716
- value={p.expiredSectionKey ?? ""}
2717
- onChange={(v) => update({ ...p, expiredSectionKey: v })}
2718
- />
2718
+ globalSections.length ? (
2719
+ <label className="block space-y-1.5">
2720
+ <span className="block text-[0.7rem] uppercase tracking-[0.22em] text-ink/60">
2721
+ Global block to show instead
2722
+ </span>
2723
+ <select
2724
+ value={p.expiredSectionKey ?? ""}
2725
+ onChange={(e) => update({ ...p, expiredSectionKey: e.target.value })}
2726
+ className="w-full border border-ink/15 bg-white px-2.5 py-1.5 text-sm text-ink focus:border-sea focus:outline-none"
2727
+ >
2728
+ <option value="">— none —</option>
2729
+ {globalSections.map((g) => (
2730
+ <option key={g.key} value={g.key}>
2731
+ {g.name} ({g.key})
2732
+ </option>
2733
+ ))}
2734
+ {p.expiredSectionKey &&
2735
+ !globalSections.some((g) => g.key === p.expiredSectionKey) ? (
2736
+ <option value={p.expiredSectionKey}>
2737
+ {p.expiredSectionKey} (missing)
2738
+ </option>
2739
+ ) : null}
2740
+ </select>
2741
+ </label>
2742
+ ) : (
2743
+ <TextField
2744
+ label="Global block key to show instead"
2745
+ value={p.expiredSectionKey ?? ""}
2746
+ onChange={(v) => update({ ...p, expiredSectionKey: v })}
2747
+ />
2748
+ )
2719
2749
  ) : null}
2720
2750
  {p.onExpire === "revealPage" ? (
2721
2751
  <>
@@ -750,7 +750,7 @@ export function BlockInspector({
750
750
  case "courseList":
751
751
  return <TripListInspector block={block} patch={patch} />;
752
752
  case "countdown":
753
- return <CountdownInspector block={block} patch={patch} />;
753
+ return <CountdownInspector block={block} patch={patch} globalSections={globalSections} />;
754
754
  case "ctaBanner":
755
755
  return <CtaBannerInspector block={block} patch={patch} />;
756
756
  case "mediaSplit":