@aiaiai-pt/design-system 0.46.2 → 0.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.
@@ -167,11 +167,12 @@
167
167
 
168
168
  (async () => {
169
169
  try {
170
- const [core, charts, components, renderers] = await Promise.all([
170
+ const [core, charts, components, renderers, features] = await Promise.all([
171
171
  import("echarts/core"),
172
172
  import("echarts/charts"),
173
173
  import("echarts/components"),
174
174
  import("echarts/renderers"),
175
+ import("echarts/features"),
175
176
  ]);
176
177
  if (disposed || !container) return;
177
178
 
@@ -184,6 +185,11 @@
184
185
  components.TooltipComponent,
185
186
  components.LegendComponent,
186
187
  renderers.CanvasRenderer,
188
+ // echarts 6 (#773): `grid.containLabel` moved behind this opt-in
189
+ // feature. Registering it preserves the v5 layout (labels contained
190
+ // inside the grid) our `buildChartOption` relies on — without it
191
+ // echarts 6 silently ignores `containLabel` and clips axis labels.
192
+ features.LegacyGridContainLabel,
187
193
  ]);
188
194
 
189
195
  chart = core.init(container, null, { renderer: "canvas" });
@@ -22,15 +22,24 @@
22
22
  * Everything here is PURE and dependency-free.
23
23
  */
24
24
  export type ObjectFallback = "redact" | "json";
25
+ /** How a boolean renders: "raw" (default) → "true"/"false" (both hosts'
26
+ * historical output); "yes-no" → "Yes"/"No" (the staff admin's cell copy —
27
+ * #748 lifts it here so the admin's private renderCell fork can retire). */
28
+ export type BooleanDisplay = "raw" | "yes-no";
25
29
  /**
26
- * Pure value → display string. Scalars stringify; arrays join their non-empty
27
- * formatted members; a disclosed relationship object ({id,label}|{name}|{title})
28
- * renders its human label then its id. An UNKNOWN object renders per
29
- * `objectFallback`: "redact" (default) "" (never dumps internals the public
30
- * security boundary); "json" pretty JSON (the admin operator view).
30
+ * Pure value → display string. Scalars stringify (booleans per
31
+ * `booleanDisplay`); arrays join their non-empty formatted members; a
32
+ * disclosed relationship object renders its human handle
33
+ * (label→name→display_name→title→code) then its id`display_name`/`code`
34
+ * joined the order in #748 so an expanded rel carrying only those (ontology
35
+ * rows commonly do) renders its handle, not its UUID. An UNKNOWN object
36
+ * renders per `objectFallback`: "redact" (default) → "" (never dumps
37
+ * internals — the public security boundary); "json" → pretty JSON (the admin
38
+ * operator view).
31
39
  */
32
40
  export declare function formatScalar(value: unknown, opts?: {
33
41
  objectFallback?: ObjectFallback;
42
+ booleanDisplay?: BooleanDisplay;
34
43
  }): string;
35
44
  /** True for an ISO-8601 timestamp STRING (not a bare date). Value-shape
36
45
  * detection — used where the schema can't tell us the field is a datetime. */
@@ -60,6 +69,7 @@ export declare function displayCell(value: unknown, locale: string, opts?: {
60
69
  treatAsDate?: boolean;
61
70
  treatAsDateTime?: boolean;
62
71
  objectFallback?: ObjectFallback;
72
+ booleanDisplay?: BooleanDisplay;
63
73
  }): string;
64
74
  /** Operator copy for a status value (falls back to the raw value). `labels` is
65
75
  * untrusted DATA — a non-object/array is ignored. */
@@ -24,21 +24,37 @@
24
24
 
25
25
  export type ObjectFallback = "redact" | "json";
26
26
 
27
+ /** How a boolean renders: "raw" (default) → "true"/"false" (both hosts'
28
+ * historical output); "yes-no" → "Yes"/"No" (the staff admin's cell copy —
29
+ * #748 lifts it here so the admin's private renderCell fork can retire). */
30
+ export type BooleanDisplay = "raw" | "yes-no";
31
+
27
32
  /**
28
- * Pure value → display string. Scalars stringify; arrays join their non-empty
29
- * formatted members; a disclosed relationship object ({id,label}|{name}|{title})
30
- * renders its human label then its id. An UNKNOWN object renders per
31
- * `objectFallback`: "redact" (default) "" (never dumps internals the public
32
- * security boundary); "json" pretty JSON (the admin operator view).
33
+ * Pure value → display string. Scalars stringify (booleans per
34
+ * `booleanDisplay`); arrays join their non-empty formatted members; a
35
+ * disclosed relationship object renders its human handle
36
+ * (label→name→display_name→title→code) then its id`display_name`/`code`
37
+ * joined the order in #748 so an expanded rel carrying only those (ontology
38
+ * rows commonly do) renders its handle, not its UUID. An UNKNOWN object
39
+ * renders per `objectFallback`: "redact" (default) → "" (never dumps
40
+ * internals — the public security boundary); "json" → pretty JSON (the admin
41
+ * operator view).
33
42
  */
34
43
  export function formatScalar(
35
44
  value: unknown,
36
- opts: { objectFallback?: ObjectFallback } = {},
45
+ opts: {
46
+ objectFallback?: ObjectFallback;
47
+ booleanDisplay?: BooleanDisplay;
48
+ } = {},
37
49
  ): string {
38
50
  // `== null` catches both null and undefined.
39
51
  if (value == null) return "";
40
52
  if (typeof value === "string") return value;
41
- if (typeof value === "number" || typeof value === "boolean") {
53
+ if (typeof value === "boolean") {
54
+ if (opts.booleanDisplay === "yes-no") return value ? "Yes" : "No";
55
+ return String(value);
56
+ }
57
+ if (typeof value === "number") {
42
58
  return String(value);
43
59
  }
44
60
  if (Array.isArray(value)) {
@@ -49,7 +65,7 @@ export function formatScalar(
49
65
  }
50
66
  if (typeof value === "object") {
51
67
  const o = value as Record<string, unknown>;
52
- for (const k of ["label", "name", "title"]) {
68
+ for (const k of ["label", "name", "display_name", "title", "code"]) {
53
69
  const v = o[k];
54
70
  if (typeof v === "string" && v) return v;
55
71
  }
@@ -130,6 +146,7 @@ export function displayCell(
130
146
  treatAsDate?: boolean;
131
147
  treatAsDateTime?: boolean;
132
148
  objectFallback?: ObjectFallback;
149
+ booleanDisplay?: BooleanDisplay;
133
150
  } = {},
134
151
  ): string {
135
152
  if (typeof value === "string" && value) {
@@ -137,7 +154,10 @@ export function displayCell(
137
154
  if (opts.treatAsDateTime) return formatDateTime(value, locale);
138
155
  }
139
156
  if (isIsoTimestamp(value)) return formatTimestamp(value, locale);
140
- return formatScalar(value, { objectFallback: opts.objectFallback });
157
+ return formatScalar(value, {
158
+ objectFallback: opts.objectFallback,
159
+ booleanDisplay: opts.booleanDisplay,
160
+ });
141
161
  }
142
162
 
143
163
  /** Operator copy for a status value (falls back to the raw value). `labels` is
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiaiai-pt/design-system",
3
- "version": "0.46.2",
3
+ "version": "0.47.0",
4
4
  "description": "Design system tokens and Svelte components for aiaiai products",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -83,14 +83,14 @@
83
83
  "@codemirror/view": "^6.40.0",
84
84
  "@lezer/highlight": "^1.0.0",
85
85
  "date-fns": "^4.1.0",
86
- "echarts": "^5.5.0",
86
+ "echarts": "^6.1.0",
87
87
  "ol": "^10.0.0",
88
88
  "svelte": "^5.0.0"
89
89
  },
90
90
  "devDependencies": {
91
91
  "@sveltejs/package": "^2.5.7",
92
92
  "date-fns": "^4.1.0",
93
- "echarts": "^5.6.0",
93
+ "echarts": "^6.1.0",
94
94
  "jsdom": "^29.1.1",
95
95
  "ol": "^10.8.0",
96
96
  "svelte": "^5.55.3",