@pramen/cms 0.0.65 → 0.0.66

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/index.d.ts CHANGED
@@ -66,6 +66,20 @@ export interface FieldDefinition {
66
66
  * whole set — the reason this is a field type and not a wider `select`.
67
67
  */
68
68
  | "reference" | "repeater" | "group";
69
+ /**
70
+ * Help text under the control — what the field MEANS, when it applies, what leaving it
71
+ * empty does. Optional, and worth writing exactly when the label alone leaves a real
72
+ * question open: an "Address" that is only used for an event with no venue attached, a
73
+ * "Time to" that applies to every day of a range rather than the last one.
74
+ *
75
+ * The alternative is a comment beside the field's declaration in the app's source, where
76
+ * the person filling the field in will never see it — which is where this kind of note
77
+ * had nowhere else to go before.
78
+ *
79
+ * One or two sentences. It is announced via `aria-describedby`, so a paragraph here is a
80
+ * paragraph a screen-reader user hears before every edit.
81
+ */
82
+ description?: string;
69
83
  required?: boolean;
70
84
  default?: unknown;
71
85
  /** repeater/group only — the nested fields. */
package/dist/index.js CHANGED
@@ -1086,6 +1086,11 @@ export function validateFieldSchema(raw, path = "fieldsSchema", depth = 0) {
1086
1086
  const f = { name, type };
1087
1087
  if (typeof o.label === "string" && o.label.trim() !== "")
1088
1088
  f.label = o.label.trim();
1089
+ // Same treatment as `label`, and it has to be HERE: this function rebuilds every entry
1090
+ // from a whitelist, so a key it does not name is dropped without a word — an authored
1091
+ // description would round-trip through `createContentType` and come back gone.
1092
+ if (typeof o.description === "string" && o.description.trim() !== "")
1093
+ f.description = o.description.trim();
1089
1094
  if (o.required === true)
1090
1095
  f.required = true;
1091
1096
  if (o.default !== undefined)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pramen/cms",
3
- "version": "0.0.65",
3
+ "version": "0.0.66",
4
4
  "description": "Optional block/page builder for pramen — Drupal-Paragraphs-style typed blocks in named regions, reusable blocks, scheduled publishing, built entirely from pramen primitives.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -41,7 +41,7 @@
41
41
  "access": "public"
42
42
  },
43
43
  "dependencies": {
44
- "@pramen/server": "0.0.65"
44
+ "@pramen/server": "0.0.66"
45
45
  },
46
46
  "peerDependencies": {
47
47
  "react": ">=18"
package/src/index.ts CHANGED
@@ -135,6 +135,20 @@ export interface FieldDefinition {
135
135
  | "reference"
136
136
  | "repeater"
137
137
  | "group";
138
+ /**
139
+ * Help text under the control — what the field MEANS, when it applies, what leaving it
140
+ * empty does. Optional, and worth writing exactly when the label alone leaves a real
141
+ * question open: an "Address" that is only used for an event with no venue attached, a
142
+ * "Time to" that applies to every day of a range rather than the last one.
143
+ *
144
+ * The alternative is a comment beside the field's declaration in the app's source, where
145
+ * the person filling the field in will never see it — which is where this kind of note
146
+ * had nowhere else to go before.
147
+ *
148
+ * One or two sentences. It is announced via `aria-describedby`, so a paragraph here is a
149
+ * paragraph a screen-reader user hears before every edit.
150
+ */
151
+ description?: string;
138
152
  required?: boolean;
139
153
  default?: unknown;
140
154
  /** repeater/group only — the nested fields. */
@@ -1569,6 +1583,10 @@ export function validateFieldSchema(raw: unknown, path = "fieldsSchema", depth =
1569
1583
  }
1570
1584
  const f: FieldDefinition = { name, type };
1571
1585
  if (typeof o.label === "string" && o.label.trim() !== "") f.label = o.label.trim();
1586
+ // Same treatment as `label`, and it has to be HERE: this function rebuilds every entry
1587
+ // from a whitelist, so a key it does not name is dropped without a word — an authored
1588
+ // description would round-trip through `createContentType` and come back gone.
1589
+ if (typeof o.description === "string" && o.description.trim() !== "") f.description = o.description.trim();
1572
1590
  if (o.required === true) f.required = true;
1573
1591
  if (o.default !== undefined) f.default = o.default;
1574
1592