@qoretechnologies/reqraft 0.10.36 → 0.10.38-pr.95.gf1f6403

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.
Files changed (35) hide show
  1. package/dist/components/form/engine/CompactRow.d.ts.map +1 -1
  2. package/dist/components/form/engine/CompactRow.js +121 -2
  3. package/dist/components/form/engine/CompactRow.js.map +1 -1
  4. package/dist/components/form/engine/FormEngine.d.ts +20 -0
  5. package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
  6. package/dist/components/form/engine/FormEngine.js +91 -22
  7. package/dist/components/form/engine/FormEngine.js.map +1 -1
  8. package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts +27 -0
  9. package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts.map +1 -0
  10. package/dist/components/form/engine/_structuredData/SchemaDataView.js +259 -0
  11. package/dist/components/form/engine/_structuredData/SchemaDataView.js.map +1 -0
  12. package/dist/components/form/engine/compactRowStyles.d.ts +11 -0
  13. package/dist/components/form/engine/compactRowStyles.d.ts.map +1 -1
  14. package/dist/components/form/engine/compactRowStyles.js +14 -3
  15. package/dist/components/form/engine/compactRowStyles.js.map +1 -1
  16. package/dist/components/form/engine/readFirst.d.ts +16 -0
  17. package/dist/components/form/engine/readFirst.d.ts.map +1 -1
  18. package/dist/components/form/engine/readFirst.js +72 -5
  19. package/dist/components/form/engine/readFirst.js.map +1 -1
  20. package/dist/components/form/fields/array/ArrayAuto.d.ts.map +1 -1
  21. package/dist/components/form/fields/array/ArrayAuto.js +13 -1
  22. package/dist/components/form/fields/array/ArrayAuto.js.map +1 -1
  23. package/dist/components/form/fields/auto/AutoFormField.d.ts +4 -0
  24. package/dist/components/form/fields/auto/AutoFormField.d.ts.map +1 -1
  25. package/dist/components/form/fields/auto/AutoFormField.js +8 -1
  26. package/dist/components/form/fields/auto/AutoFormField.js.map +1 -1
  27. package/package.json +1 -1
  28. package/src/components/form/engine/CompactRow.tsx +112 -11
  29. package/src/components/form/engine/FormEngine.stories.tsx +313 -13
  30. package/src/components/form/engine/FormEngine.tsx +98 -7
  31. package/src/components/form/engine/_structuredData/SchemaDataView.tsx +462 -0
  32. package/src/components/form/engine/compactRowStyles.ts +14 -2
  33. package/src/components/form/engine/readFirst.ts +81 -4
  34. package/src/components/form/fields/array/ArrayAuto.tsx +12 -0
  35. package/src/components/form/fields/auto/AutoFormField.tsx +11 -0
@@ -0,0 +1,27 @@
1
+ import { IQorusFormSchema } from '@qoretechnologies/ts-toolkit';
2
+ import React from 'react';
3
+ export interface ISchemaDataViewProps {
4
+ /** The stored value, with or without `{type, value}` envelopes. */
5
+ value: unknown;
6
+ /** The schema describing this level — a field's `arg_schema`. */
7
+ schema: IQorusFormSchema;
8
+ /** Show each field's declared type beside its name. */
9
+ showTypes?: boolean;
10
+ /** Colours, taken from the row so the preview matches its surroundings. */
11
+ colors: {
12
+ key: string;
13
+ muted: string;
14
+ border: string;
15
+ };
16
+ onItemClick?: () => void;
17
+ }
18
+ export declare const SchemaDataView: React.MemoExoticComponent<({ value, schema, showTypes, colors, onItemClick }: ISchemaDataViewProps) => import("react/jsx-runtime").JSX.Element>;
19
+ /**
20
+ * Whether a value can be rendered through a schema at all.
21
+ *
22
+ * A schema describes fields, so there has to be a described level to show: a
23
+ * hash, or a list of them. A list of scalars has no field names to use and falls
24
+ * back to the untyped renderer, which is the right tool for it.
25
+ */
26
+ export declare const canRenderWithSchema: (value: unknown, schema: unknown) => boolean;
27
+ //# sourceMappingURL=SchemaDataView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaDataView.d.ts","sourceRoot":"","sources":["../../../../../src/components/form/engine/_structuredData/SchemaDataView.tsx"],"names":[],"mappings":"AACA,OAAO,EAEL,gBAAgB,EAEjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,MAAM,OAAO,CAAC;AAiJ1B,MAAM,WAAW,oBAAoB;IACnC,mEAAmE;IACnE,KAAK,EAAE,OAAO,CAAC;IACf,iEAAiE;IACjE,MAAM,EAAE,gBAAgB,CAAC;IACzB,uDAAuD;IACvD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,2EAA2E;IAC3E,MAAM,EAAE;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACvD,WAAW,CAAC,EAAE,MAAM,IAAI,CAAC;CAC1B;AA8QD,eAAO,MAAM,cAAc,gFAC2B,oBAAoB,6CASzE,CAAC;AAIF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,UAAW,OAAO,UAAU,OAAO,KAAG,OASrE,CAAC"}
@@ -0,0 +1,259 @@
1
+ "use strict";
2
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
3
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
4
+ return cooked;
5
+ };
6
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
7
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
8
+ if (ar || !(i in from)) {
9
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
10
+ ar[i] = from[i];
11
+ }
12
+ }
13
+ return to.concat(ar || Array.prototype.slice.call(from));
14
+ };
15
+ var __importDefault = (this && this.__importDefault) || function (mod) {
16
+ return (mod && mod.__esModule) ? mod : { "default": mod };
17
+ };
18
+ Object.defineProperty(exports, "__esModule", { value: true });
19
+ exports.canRenderWithSchema = exports.SchemaDataView = void 0;
20
+ var jsx_runtime_1 = require("react/jsx-runtime");
21
+ var reqore_1 = require("@qoretechnologies/reqore");
22
+ var react_1 = __importDefault(require("react"));
23
+ var styled_components_1 = __importDefault(require("styled-components"));
24
+ var use_context_selector_1 = require("use-context-selector");
25
+ var compactRowContext_1 = require("../compactRowContext");
26
+ var compactRowStyles_1 = require("../compactRowStyles");
27
+ var readFirst_1 = require("../readFirst");
28
+ var structuredData_1 = require("./structuredData");
29
+ /**
30
+ * A read-only rendering of a value THROUGH the schema that describes it.
31
+ *
32
+ * `StructuredDataView` renders data nobody has described: it has to announce
33
+ * what it found ("Object · 2 fields"), print raw keys, and colour values by
34
+ * inferred type, because inference is all it has. That is the right rendering
35
+ * for untyped data and the wrong one for ours — a form field with an
36
+ * `arg_schema` is a value whose shape, names and choices are all known in
37
+ * advance, and showing it as a data tree asks the reader to decode a structure
38
+ * the form already knows how to say out loud.
39
+ *
40
+ * So a described value is rendered the way the form asked for it, in the form's
41
+ * own clothes:
42
+ *
43
+ * - Field names use `StyledRowLabel` and values use `StyledRowValue` — the very
44
+ * components the option rows above are built from. Not a copy of their CSS: a
45
+ * copy is a second definition of "what a form label looks like", and the two
46
+ * drift the first time either is touched.
47
+ * - Values are formatted by the same `formatOptionValue` the rows use, so an
48
+ * `allowed_values` entry resolves to its display name, a bool to Yes/No, a
49
+ * date to the app's format. The same words appear in the summary, the preview
50
+ * and the editor.
51
+ * - Fields appear in the schema's order — the order the form puts them in.
52
+ *
53
+ * A list renders as numbered items: the number sits in a left margin with a rule
54
+ * running down beside the fields belonging to it, and the item's first field
55
+ * starts on the number's own line. The rule is what makes a list of multi-field
56
+ * items readable — without it, "which item does this field belong to?" is
57
+ * answered only by counting.
58
+ *
59
+ * Two deliberate properties:
60
+ *
61
+ * - **Nothing is hidden.** A key the schema does not describe is still shown,
62
+ * under its raw name, after the described ones. A preview that quietly dropped
63
+ * data would be worse than a raw tree, not better.
64
+ * - **It degrades, it does not fail.** With no schema for a level, the caller
65
+ * keeps using `StructuredDataView` — undescribed data still deserves the
66
+ * renderer built for undescribed data.
67
+ */
68
+ /** Width of the shared label column, set once on the root (see `labelColumn`). */
69
+ var LABEL_COL_VAR = '--schema-view-label-col';
70
+ var StyledSchemaView = styled_components_1.default.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n gap: 6px;\n min-width: 0;\n"], ["\n display: flex;\n flex-direction: column;\n gap: 6px;\n min-width: 0;\n"])));
71
+ /**
72
+ * One list item: its number in the left margin, its fields beside it.
73
+ *
74
+ * `align-items: start` over a single grid row is what puts the first field on
75
+ * the number's line — the fields are one block starting at the top, not a grid
76
+ * row each, so nothing can push them down past their own marker.
77
+ */
78
+ var StyledItem = styled_components_1.default.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: grid;\n grid-template-columns: auto minmax(0, 1fr);\n column-gap: 8px;\n align-items: start;\n min-width: 0;\n"], ["\n display: grid;\n grid-template-columns: auto minmax(0, 1fr);\n column-gap: 8px;\n align-items: start;\n min-width: 0;\n"])));
79
+ /** The item number. Furniture, so it reads quieter than the data it indexes;
80
+ * `tabular-nums` keeps "9." and "10." the same width. */
81
+ var StyledMarker = styled_components_1.default.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n color: ", ";\n font-size: 12px;\n font-variant-numeric: tabular-nums;\n line-height: 20px;\n white-space: nowrap;\n"], ["\n color: ", ";\n font-size: 12px;\n font-variant-numeric: tabular-nums;\n line-height: 20px;\n white-space: nowrap;\n"])), function (_a) {
82
+ var $color = _a.$color;
83
+ return $color;
84
+ });
85
+ /** The rule tying an item's fields to its number. */
86
+ var StyledItemFields = styled_components_1.default.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n border-left: 1px solid ", ";\n padding-left: 10px;\n min-width: 0;\n"], ["\n border-left: 1px solid ", ";\n padding-left: 10px;\n min-width: 0;\n"])), function (_a) {
87
+ var $border = _a.$border;
88
+ return $border;
89
+ });
90
+ /**
91
+ * A record's fields: one shared label column, values in the next.
92
+ *
93
+ * The column width is a variable set once on the root, so every field of every
94
+ * item lines up on one edge. Sizing per record would align an item's own fields
95
+ * and leave the items ragged against each other, which reads as a rendering
96
+ * fault rather than as a list.
97
+ */
98
+ var StyledFields = styled_components_1.default.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: grid;\n grid-template-columns: var(", ", 140px) minmax(0, 1fr);\n column-gap: 10px;\n row-gap: 2px;\n align-items: baseline;\n min-width: 0;\n\n /* A row's value truncates because a row is one line high. The preview is the\n place that shows what the row could not, so a long value wraps here instead\n of ellipsising \u2014 otherwise opening the preview would reveal exactly as\n little as the line above it. */\n .options-readfirst-valuetext {\n white-space: normal;\n overflow: visible;\n text-overflow: clip;\n overflow-wrap: anywhere;\n }\n\n /* Mono faces run visually larger than the UI face at the same pixel size, so\n a literal set at the row's 13px looks a step bolder than the label naming\n it. A hair smaller puts the two back on the same footing. */\n .schema-view-data {\n font-size: 12.5px;\n }\n"], ["\n display: grid;\n grid-template-columns: var(", ", 140px) minmax(0, 1fr);\n column-gap: 10px;\n row-gap: 2px;\n align-items: baseline;\n min-width: 0;\n\n /* A row's value truncates because a row is one line high. The preview is the\n place that shows what the row could not, so a long value wraps here instead\n of ellipsising \u2014 otherwise opening the preview would reveal exactly as\n little as the line above it. */\n .options-readfirst-valuetext {\n white-space: normal;\n overflow: visible;\n text-overflow: clip;\n overflow-wrap: anywhere;\n }\n\n /* Mono faces run visually larger than the UI face at the same pixel size, so\n a literal set at the row's 13px looks a step bolder than the label naming\n it. A hair smaller puts the two back on the same footing. */\n .schema-view-data {\n font-size: 12.5px;\n }\n"])), LABEL_COL_VAR);
99
+ /** A nested level spans both columns and indents under its own name. */
100
+ var StyledNested = styled_components_1.default.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n grid-column: 1 / -1;\n margin-left: 2px;\n padding-left: 10px;\n border-left: 1px solid ", ";\n min-width: 0;\n"], ["\n grid-column: 1 / -1;\n margin-left: 2px;\n padding-left: 10px;\n border-left: 1px solid ", ";\n min-width: 0;\n"])), function (_a) {
101
+ var $border = _a.$border;
102
+ return $border;
103
+ });
104
+ var StyledNestedLabel = styled_components_1.default.div(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n grid-column: 1 / -1;\n"], ["\n grid-column: 1 / -1;\n"])));
105
+ /** A code value is a block, not a cell: it spans the grid under its own name. */
106
+ var StyledCodeCell = styled_components_1.default.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n grid-column: 1 / -1;\n min-width: 0;\n margin: 2px 0 4px;\n"], ["\n grid-column: 1 / -1;\n min-width: 0;\n margin: 2px 0 4px;\n"])));
107
+ /** Look inside a `{type, value}` envelope, once. `isUiEncodedValue` is the
108
+ * engine's single authority on what an envelope is — a looser test would unwrap
109
+ * a real user hash that happens to carry a `value` key and drop its siblings. */
110
+ var unwrap = function (item) { return ((0, structuredData_1.isUiEncodedValue)(item) ? item.value : item); };
111
+ var isRecord = function (value) {
112
+ return !!value && typeof value === 'object' && !Array.isArray(value);
113
+ };
114
+ /** Whether a value is worth a row of its own. `false` and `0` are values. */
115
+ var isSet = function (value) {
116
+ return value !== undefined && value !== null && value !== '' && !(Array.isArray(value) && !value.length);
117
+ };
118
+ /**
119
+ * The keys to render, in the order to render them: the schema's own order first
120
+ * (that is the order the form puts the fields in), then anything stored that the
121
+ * schema does not mention, so undescribed data is shown rather than dropped.
122
+ */
123
+ var orderedKeys = function (record, schema) {
124
+ var described = Object.keys(schema).filter(function (key) { return isSet(unwrap(record[key])); });
125
+ var extra = Object.keys(record).filter(function (key) { return !(key in schema) && isSet(unwrap(record[key])); });
126
+ return __spreadArray(__spreadArray([], described, true), extra, true);
127
+ };
128
+ /** A field whose content is source code. `ui_type` is what the form renders by,
129
+ * so it is what the preview reads by too — the storage type is just `string`. */
130
+ var isCodeField = function (fieldSchema) {
131
+ var uiType = fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.ui_type;
132
+ return uiType === 'code-editor';
133
+ };
134
+ var fieldLabel = function (key, fieldSchema) {
135
+ return (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.display_name) || key;
136
+ };
137
+ /**
138
+ * The width of the shared label column, measured from the longest name that will
139
+ * actually be rendered.
140
+ *
141
+ * A fixed width is a guess in both directions: too wide and a name sits far from
142
+ * its value, too narrow and every name ellipsises. Measuring fits the content;
143
+ * the `%` ceiling stops one long name from taking the whole row when the inset
144
+ * is narrow — a phone, or a deeply nested level.
145
+ */
146
+ var labelColumn = function (value, schema) {
147
+ var inner = unwrap(value);
148
+ var records = (Array.isArray(inner) ? inner.map(unwrap) : [inner]).filter(isRecord);
149
+ var longest = records.reduce(function (widest, record) {
150
+ var own = orderedKeys(record, schema).reduce(function (max, key) {
151
+ return Math.max(max, fieldLabel(key, schema[key]).length);
152
+ }, 0);
153
+ return Math.max(widest, own);
154
+ }, 0);
155
+ return longest ? "min(".concat(longest + 1, "ch, 45%)") : '140px';
156
+ };
157
+ /** One field's value, rendered the way its row above renders it. */
158
+ var FieldValue = function (_a) {
159
+ var field = _a.field, fieldSchema = _a.fieldSchema, color = _a.color;
160
+ var formatted = (0, readFirst_1.formatOptionValue)(field, fieldSchema);
161
+ // An allowed value that carries a logo shows it here too, exactly as the row
162
+ // above does — the preview is the same value, so it gets the same treatment.
163
+ var image = (0, readFirst_1.getAllowedValueImage)(field.value, fieldSchema);
164
+ // Data reads in mono; a chosen label does not.
165
+ //
166
+ // "qorus-session" is a literal the author typed — an identifier where the
167
+ // characters themselves matter, and where a proportional font makes `l`/`1`
168
+ // and `O`/`0` a guess. "Default RBAC" is not data at all: it is the name of a
169
+ // choice, written by whoever wrote the schema, and setting it in mono would
170
+ // dress up a label as a value. Resolving through `allowed_values` is what
171
+ // separates the two, and it is the same lookup that produced the text.
172
+ var isChosenLabel = !!(0, readFirst_1.findAllowedValueOption)(field.value, fieldSchema);
173
+ return ((0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledRowValue, { "$color": color, children: field.value === true || field.value === false ?
174
+ (0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'small', minimal: true, intent: field.value === true ? 'success' : 'danger', label: formatted })
175
+ : (0, jsx_runtime_1.jsxs)("span", { className: "options-readfirst-valuetext".concat(isChosenLabel ? '' : ' schema-view-data'), style: isChosenLabel ? undefined : { fontFamily: compactRowStyles_1.MONO_FONT_STACK }, children: [image ?
176
+ (0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { image: image, size: '14px', style: { flexShrink: 0, marginRight: 6, verticalAlign: 'middle' } })
177
+ : null, formatted] }) }));
178
+ };
179
+ /** One described hash: its fields as label/value pairs in the shared columns. */
180
+ var SchemaRecord = function (_a) {
181
+ var record = _a.record, schema = _a.schema, showTypes = _a.showTypes, colors = _a.colors;
182
+ // The SAME host renderer the row above uses for a `code-editor` field. Read
183
+ // from context rather than threaded through props: a nested level is arbitrarily
184
+ // deep, and the renderer is a property of the form, not of any one level.
185
+ var codePreviewRenderer = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.codePreviewRenderer; });
186
+ var cHover = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.cHover; });
187
+ return ((0, jsx_runtime_1.jsx)(StyledFields, { className: 'schema-view-fields', children: orderedKeys(record, schema).map(function (key) {
188
+ var fieldSchema = schema[key];
189
+ var nested = fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.arg_schema;
190
+ var value = unwrap(record[key]);
191
+ var label = fieldLabel(key, fieldSchema);
192
+ var labelWithType = showTypes && (fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.type) ? "".concat(label, " \u00B7 ").concat(fieldSchema.type) : label;
193
+ // A field that describes its own level renders AS that level, indented
194
+ // under its name — the same decision, one step down.
195
+ if (nested && (isRecord(value) || Array.isArray(value))) {
196
+ return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(StyledNestedLabel, { children: (0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledRowLabel, { "$color": colors.key, children: labelWithType }) }), (0, jsx_runtime_1.jsx)(StyledNested, { "$border": colors.border, children: (0, jsx_runtime_1.jsx)(SchemaLevel, { value: value, schema: nested, showTypes: showTypes, colors: colors }) })] }, key));
197
+ }
198
+ // A code value is source, and source is read as source: the host's renderer
199
+ // gives it the syntax highlighting (and read-only LSP hover) it has in the
200
+ // Source Code field, and "Show more" keeps a long body from taking over the
201
+ // preview. Flattening it to one mono line — which is what a plain value cell
202
+ // does — throws all of that away for a field whose whole content is code.
203
+ if (isCodeField(fieldSchema) && typeof value === 'string') {
204
+ return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(StyledNestedLabel, { children: (0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledRowLabel, { "$color": colors.key, children: labelWithType }) }), (0, jsx_runtime_1.jsx)(StyledCodeCell, { onClick: function (event) { return event.stopPropagation(); }, children: (0, jsx_runtime_1.jsx)(reqore_1.ReqoreCollapsibleContent, { maxCollapsedHeight: 96, buttonProps: { className: 'options-readfirst-viewmore' }, children: codePreviewRenderer ?
205
+ codePreviewRenderer({
206
+ value: value,
207
+ name: key,
208
+ schema: fieldSchema,
209
+ options: schema,
210
+ values: record,
211
+ })
212
+ : (0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledCodePreview, { className: 'options-readfirst-code', "$bg": cHover, "$border": "".concat(colors.border, "88"), "$fg": colors.key, children: value }) }) })] }, key));
213
+ }
214
+ return ((0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledRowLabel, { "$color": colors.key, title: label, children: labelWithType }), (0, jsx_runtime_1.jsx)(FieldValue, { field: { type: fieldSchema === null || fieldSchema === void 0 ? void 0 : fieldSchema.type, value: value }, fieldSchema: fieldSchema, color: colors.key })] }, key));
215
+ }) }));
216
+ };
217
+ /** A level: a list of numbered items, or a single described hash. */
218
+ var SchemaLevel = function (_a) {
219
+ var value = _a.value, schema = _a.schema, showTypes = _a.showTypes, colors = _a.colors;
220
+ var inner = unwrap(value);
221
+ if (Array.isArray(inner)) {
222
+ return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: inner.map(function (item, index) {
223
+ var record = unwrap(item);
224
+ return ((0, jsx_runtime_1.jsxs)(StyledItem, { className: 'schema-view-item', children: [(0, jsx_runtime_1.jsxs)(StyledMarker, { "$color": colors.muted, children: [index + 1, "."] }), (0, jsx_runtime_1.jsx)(StyledItemFields, { "$border": colors.border, children: isRecord(record) ?
225
+ (0, jsx_runtime_1.jsx)(SchemaRecord, { record: record, schema: schema, showTypes: showTypes, colors: colors })
226
+ : (0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledRowValue, { "$color": colors.key, children: (0, jsx_runtime_1.jsx)("span", { className: 'options-readfirst-valuetext schema-view-data', style: { fontFamily: compactRowStyles_1.MONO_FONT_STACK }, children: (0, readFirst_1.formatOptionValue)({ value: record }) }) }) })] }, index));
227
+ }) }));
228
+ }
229
+ if (isRecord(inner)) {
230
+ return (0, jsx_runtime_1.jsx)(SchemaRecord, { record: inner, schema: schema, showTypes: showTypes, colors: colors });
231
+ }
232
+ return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreP, { size: 'small', style: { color: colors.key }, children: (0, readFirst_1.formatOptionValue)({ value: inner }) }));
233
+ };
234
+ exports.SchemaDataView = react_1.default.memo(function (_a) {
235
+ var _b;
236
+ var value = _a.value, schema = _a.schema, showTypes = _a.showTypes, colors = _a.colors, onItemClick = _a.onItemClick;
237
+ return ((0, jsx_runtime_1.jsx)(StyledSchemaView, { className: 'schema-data-view', onClick: onItemClick, style: (_b = {}, _b[LABEL_COL_VAR] = labelColumn(value, schema), _b), children: (0, jsx_runtime_1.jsx)(SchemaLevel, { value: value, schema: schema, showTypes: showTypes, colors: colors }) }));
238
+ });
239
+ exports.SchemaDataView.displayName = 'SchemaDataView';
240
+ /**
241
+ * Whether a value can be rendered through a schema at all.
242
+ *
243
+ * A schema describes fields, so there has to be a described level to show: a
244
+ * hash, or a list of them. A list of scalars has no field names to use and falls
245
+ * back to the untyped renderer, which is the right tool for it.
246
+ */
247
+ var canRenderWithSchema = function (value, schema) {
248
+ if (!schema || typeof schema !== 'object' || !Object.keys(schema).length) {
249
+ return false;
250
+ }
251
+ var inner = unwrap(value);
252
+ if (Array.isArray(inner)) {
253
+ return inner.some(function (item) { return isRecord(unwrap(item)); });
254
+ }
255
+ return isRecord(inner);
256
+ };
257
+ exports.canRenderWithSchema = canRenderWithSchema;
258
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8;
259
+ //# sourceMappingURL=SchemaDataView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SchemaDataView.js","sourceRoot":"","sources":["../../../../../src/components/form/engine/_structuredData/SchemaDataView.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,mDAAoG;AAMpG,gDAA0B;AAC1B,wEAAuC;AACvC,6DAA0D;AAC1D,0DAAyD;AACzD,wDAAyG;AACzG,0CAA+F;AAC/F,mDAAoD;AAEpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,kFAAkF;AAClF,IAAM,aAAa,GAAG,yBAAyB,CAAC;AAEhD,IAAM,gBAAgB,GAAG,2BAAM,CAAC,GAAG,kJAAA,+EAKlC,IAAA,CAAC;AAEF;;;;;;GAMG;AACH,IAAM,UAAU,GAAG,2BAAM,CAAC,GAAG,oMAAA,iIAM5B,IAAA,CAAC;AAEF;0DAC0D;AAC1D,IAAM,YAAY,GAAG,2BAAM,CAAC,GAAG,gMAAoB,aACxC,EAAsB,8GAKhC,KALU,UAAC,EAAU;QAAR,MAAM,YAAA;IAAO,OAAA,MAAM;AAAN,CAAM,CAKhC,CAAC;AAEF,qDAAqD;AACrD,IAAM,gBAAgB,GAAG,2BAAM,CAAC,GAAG,+IAAqB,6BAC7B,EAAwB,6CAGlD,KAH0B,UAAC,EAAW;QAAT,OAAO,aAAA;IAAO,OAAA,OAAO;AAAP,CAAO,CAGlD,CAAC;AAEF;;;;;;;GAOG;AACH,IAAM,YAAY,GAAG,2BAAM,CAAC,GAAG,66BAAA,mDAEA,EAAa,qzBAuB3C,KAvB8B,aAAa,CAuB3C,CAAC;AAEF,wEAAwE;AACxE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CAQ5E,CACF,CAAC;AAEF,sBAAc,CAAC,WAAW,GAAG,gBAAgB,CAAC;AAE9C;;;;;;GAMG;AACI,IAAM,mBAAmB,GAAG,UAAC,KAAc,EAAE,MAAe;IACjE,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,CAAC;QACzE,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5B,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,IAAI,CAAC,UAAC,IAAI,IAAK,OAAA,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAtB,CAAsB,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzB,CAAC,CAAC;AATW,QAAA,mBAAmB,uBAS9B"}
@@ -47,6 +47,17 @@ export declare const StyledStatusDot: any;
47
47
  export declare const StyledActionSlot: any;
48
48
  export declare const StyledColumn: any;
49
49
  export declare const StyledRowInset: any;
50
+ /**
51
+ * The stack literal text renders in: source, ids, tokens, data strings.
52
+ *
53
+ * Defined HERE rather than taken from reqore's `ReqoreFonts.mono`, which is the
54
+ * same stack. Reqore is a peer dependency at `>=0.71.16` and that export arrived
55
+ * later, so reading it would crash every consumer inside the declared range —
56
+ * the whole form preview lost over a font choice. One local constant costs
57
+ * nothing and keeps the code preview and the schema view's data values
58
+ * identical, which is the only reason to share it in the first place.
59
+ */
60
+ export declare const MONO_FONT_STACK = "ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace";
50
61
  export declare const StyledCodePreview: any;
51
62
  export declare const StyledColorSwatch: any;
52
63
  export declare const StyledGroupBody: any;
@@ -1 +1 @@
1
- {"version":3,"file":"compactRowStyles.d.ts","sour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MAAM,yBAAyB,KAOrC,CAAC;AAQF,eAAO,MAAM,iBAAiB,KAwB7B,CAAC;AAEF,eAAO,MAAM,cAAc,KAkB1B,CAAC;AAGF,eAAO,MAAM,gBAAgB,KAK5B,CAAC;AAEF,eAAO,MAAM,cAAc,KAW1B,CAAC;AAMF,eAAO,MAAM,eAAe,KAO3B,CAAC;AAEF,eAAO,MAAM,iBAAiB,KAI7B,CAAC;AAIF,eAAO,MAAM,eAAe,KAO3B,CAAC;AAIF,eAAO,MAAM,cAAc,KAqC1B,CAAC;AAEF,eAAO,MAAM,gBAAgB,KAQ5B,CAAC;AAMF,eAAO,MAAM,eAAe,KAO3B,CAAC;AAEF,eAAO,MAAM,gBAAgB,KAK5B,CAAC;AAEF,eAAO,MAAM,YAAY,KAGxB,CAAC;AAKF,eAAO,MAAM,cAAc,KAI1B,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,2FAC8D,CAAC;AAO3F,eAAO,MAAM,iBAAiB,KAa7B,CAAC;AAGF,eAAO,MAAM,iBAAiB,KAO7B,CAAC;AAEF,eAAO,MAAM,eAAe,KAmQ3B,CAAC"}
@@ -7,7 +7,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
7
7
  return (mod && mod.__esModule) ? mod : { "default": mod };
8
8
  };
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
- exports.StyledGroupBody = exports.StyledColorSwatch = exports.StyledCodePreview = exports.StyledRowInset = exports.StyledColumn = exports.StyledActionSlot = exports.StyledStatusDot = exports.StyledRowActions = exports.StyledRowValue = exports.StyledCardLabel = exports.StyledCardHeading = exports.StyledLabelDesc = exports.StyledRowLabel = exports.StyledLabelBlock = exports.StyledEditCard = exports.StyledClusterNode = exports.StyledStatusBoxGroupLabel = exports.StyledRequiredClusterHeader = exports.StyledRequiredClusterBox = exports.StyledStatusBox = exports.StyledGroupHeaderLine = exports.StyledGroupHeader = exports.StyledCompactPanel = exports.PANEL_LEFT_CSS = exports.LABEL_COL = exports.LABEL_COL_VAR = exports.LABEL_AFFORDANCE_WIDTH = exports.LABEL_COL_MAX = exports.LABEL_COL_MIN = exports.GROUP_INDENT = exports.COMPACT_PANEL_LEFT = exports.COMPACT_VALUE_LEFT = exports.COMPACT_ROW_GAP = exports.COMPACT_ROW_PAD_X = exports.COMPACT_LABEL_COL = exports.HEADER_GAP = void 0;
10
+ exports.StyledGroupBody = exports.StyledColorSwatch = exports.StyledCodePreview = exports.MONO_FONT_STACK = exports.StyledRowInset = exports.StyledColumn = exports.StyledActionSlot = exports.StyledStatusDot = exports.StyledRowActions = exports.StyledRowValue = exports.StyledCardLabel = exports.StyledCardHeading = exports.StyledLabelDesc = exports.StyledRowLabel = exports.StyledLabelBlock = exports.StyledEditCard = exports.StyledClusterNode = exports.StyledStatusBoxGroupLabel = exports.StyledRequiredClusterHeader = exports.StyledRequiredClusterBox = exports.StyledStatusBox = exports.StyledGroupHeaderLine = exports.StyledGroupHeader = exports.StyledCompactPanel = exports.PANEL_LEFT_CSS = exports.LABEL_COL = exports.LABEL_COL_VAR = exports.LABEL_AFFORDANCE_WIDTH = exports.LABEL_COL_MAX = exports.LABEL_COL_MIN = exports.GROUP_INDENT = exports.COMPACT_PANEL_LEFT = exports.COMPACT_VALUE_LEFT = exports.COMPACT_ROW_GAP = exports.COMPACT_ROW_PAD_X = exports.COMPACT_LABEL_COL = exports.HEADER_GAP = void 0;
11
11
  var reqore_1 = require("@qoretechnologies/reqore");
12
12
  var sizes_1 = require("@qoretechnologies/reqore/dist/constants/sizes");
13
13
  var styled_components_1 = __importDefault(require("styled-components"));
@@ -182,12 +182,23 @@ exports.StyledColumn = styled_components_1.default.div(templateObject_19 || (tem
182
182
  // under the value summary. Full-width of the value column (it's a flex child of
183
183
  // the wrapping value cell) so it lines up with the value, not the label gutter.
184
184
  exports.StyledRowInset = styled_components_1.default.div(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n flex-basis: 100%;\n width: 100%;\n margin-top: 4px;\n"], ["\n flex-basis: 100%;\n width: 100%;\n margin-top: 4px;\n"])));
185
+ /**
186
+ * The stack literal text renders in: source, ids, tokens, data strings.
187
+ *
188
+ * Defined HERE rather than taken from reqore's `ReqoreFonts.mono`, which is the
189
+ * same stack. Reqore is a peer dependency at `>=0.71.16` and that export arrived
190
+ * later, so reading it would crash every consumer inside the declared range —
191
+ * the whole form preview lost over a font choice. One local constant costs
192
+ * nothing and keeps the code preview and the schema view's data values
193
+ * identical, which is the only reason to share it in the first place.
194
+ */
195
+ exports.MONO_FONT_STACK = "ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace";
185
196
  // A collapsed code-block preview shown under the value summary for a
186
197
  // `code-editor` field. Multi-line, monospace, subtle background — matches
187
198
  // the aesthetic of the classic code-view surface but small enough to sit
188
199
  // inside a read-row. Height is capped by the wrapping `ReqoreCollapsibleContent`
189
200
  // so the "Show more" affordance stays useful.
190
- exports.StyledCodePreview = styled_components_1.default.pre(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n margin: 0;\n padding: 8px 10px;\n border-radius: 4px;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n font-family:\n ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;\n font-size: 11.5px;\n line-height: 1.5;\n white-space: pre;\n overflow: auto;\n max-width: 100%;\n"], ["\n margin: 0;\n padding: 8px 10px;\n border-radius: 4px;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n font-family:\n ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;\n font-size: 11.5px;\n line-height: 1.5;\n white-space: pre;\n overflow: auto;\n max-width: 100%;\n"])), function (_a) {
201
+ exports.StyledCodePreview = styled_components_1.default.pre(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n margin: 0;\n padding: 8px 10px;\n border-radius: 4px;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n font-family: ", ";\n font-size: 11.5px;\n line-height: 1.5;\n white-space: pre;\n overflow: auto;\n max-width: 100%;\n"], ["\n margin: 0;\n padding: 8px 10px;\n border-radius: 4px;\n background: ", ";\n border: 1px solid ", ";\n color: ", ";\n font-family: ", ";\n font-size: 11.5px;\n line-height: 1.5;\n white-space: pre;\n overflow: auto;\n max-width: 100%;\n"])), function (_a) {
191
202
  var $bg = _a.$bg;
192
203
  return $bg;
193
204
  }, function (_a) {
@@ -196,7 +207,7 @@ exports.StyledCodePreview = styled_components_1.default.pre(templateObject_21 ||
196
207
  }, function (_a) {
197
208
  var $fg = _a.$fg;
198
209
  return $fg;
199
- });
210
+ }, exports.MONO_FONT_STACK);
200
211
  // A small inline colour swatch shown before an rgbcolor value's hex string.
201
212
  exports.StyledColorSwatch = styled_components_1.default.span(templateObject_22 || (templateObject_22 = __makeTemplateObject(["\n width: 12px;\n height: 12px;\n border-radius: 3px;\n flex: 0 0 auto;\n background: ", ";\n border: 1px solid ", ";\n"], ["\n width: 12px;\n height: 12px;\n border-radius: 3px;\n flex: 0 0 auto;\n background: ", ";\n border: 1px solid ", ";\n"])), function (_a) {
202
213
  var $color = _a.$color;
@@ -1 +1 @@
1
- {"version":3,"file":"compactRowStyles.js","sourceRoot":"","sources":["../../../../src/components/form/engine/compactRowStyles.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,mDAAgE;AAChE,uEAAsF;AACtF,wEAAuC;AAEvC,8EAA8E;AAC9E,oEAAoE;AACvD,QAAA,UAAU,GAAW,KAAK,CAAC;AAExC,4EAA4E;AAC5E,gFAAgF;AAChF,8EAA8E;AAC9E,gFAAgF;AAChF,8EAA8E;AACjE,QAAA,iBAAiB,GAAG,GAAG,CAAC,CAAC,4CAA4C;AACrE,QAAA,iBAAiB,GAAG,EAAE,CAAC,CAAC,oCAAoC;AAC5D,QAAA,eAAe,GAAG,EAAE,CAAC,CAAC,kBAAkB;AACrD,gFAAgF;AACnE,QAAA,kBAAkB,GAAG,yBAAiB,GAAG,yBAAiB,GAAG,uBAAe,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,EAoBtB,UAAC,EAAU;QAAR,MAAM,YAAA;IAAO,OAAA,UAAG,MAAM,OAAI;AAAb,CAAa,EAO3B,UAAC,EAAU;QAAR,MAAM,YAAA;IAAO,OAAA,UAAG,MAAM,OAAI;AAAb,CAAa,EAkB/B,UAAC,EAAU;QAAR,MAAM,YAAA;IAAO,OAAA,MAAM;AAAN,CAAM,EA0BtB,UAAC,EAAU;QAAR,MAAM,YAAA;IAAO,OAAA,MAAM;AAAN,CAAM,EA0D5B,sBAAc,EAkDxB"}
1
+ {"version":3,"file":"compactRowStyles.js","sourceRoot":"","sources":["../../../../src/components/form/engine/compactRowStyles.ts"],"names":[],"mappings":";;;;;;;;;;AAAA,mDAAgE;AAChE,uEAAsF;AACtF,wEAAuC;AAEvC,8EAA8E;AAC9E,oEAAoE;AACvD,QAAA,UAAU,GAAW,KAAK,CAAC;AAExC,4EAA4E;AAC5E,gFAAgF;AAChF,8EAA8E;AAC9E,gFAAgF;AAChF,8EAA8E;AACjE,QAAA,iBAAiB,GAAG,GAAG,CAAC,CAAC,4CAA4C;AACrE,QAAA,iBAAiB,GAAG,EAAE,CAAC,CAAC,oCAAoC;AAC5D,QAAA,eAAe,GAAG,EAAE,CAAC,CAAC,kBAAkB;AACrD,gFAAgF;AACnE,QAAA,kBAAkB,GAAG,yBAAiB,GAAG,yBAAiB,GAAG,uBAAe,CAAC;AAC1F,6EAA6E;AAChE,QAAA,kBAAkB,GAAG,0BAAkB,GAAG,EAAE,CAAC;AAC1D,iFAAiF;AACjF,iFAAiF;AACjF,6EAA6E;AAChE,QAAA,YAAY,GAAG,UAAG,yBAAiB,OAAI,CAAC;AAErD,6EAA6E;AAC7E,8EAA8E;AAC9E,6EAA6E;AAC7E,iFAAiF;AACjF,iFAAiF;AACjF,2EAA2E;AAC3E,8EAA8E;AACjE,QAAA,aAAa,GAAG,GAAG,CAAC;AACpB,QAAA,aAAa,GAAG,yBAAiB,CAAC,CAAC,MAAM;AACtD;;;;;;;;;;;;;;GAcG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sBAAc,EAkDxB"}
@@ -12,6 +12,22 @@ export declare const shouldAutoCollapseCompactAllowedValueOption: (schema: TQoru
12
12
  * and the inline editor can close without a separate confirmation. */
13
13
  export declare const isCompactBooleanOption: (schema: TQorusFormFieldSchema | undefined) => boolean;
14
14
  export declare const shouldAutoCollapseCompactOption: (schema: TQorusFormFieldSchema | undefined, value: unknown) => boolean;
15
+ /**
16
+ * Prefer the matching allowed_values entry's display_name (fallback `name`)
17
+ * over the raw stored value.
18
+ *
19
+ * Exported (as `findAllowedValueOption`) because the form engine's value
20
+ * validation has to answer the SAME question — "is this stored value one of the
21
+ * declared choices?" — and answering it differently loses data. An
22
+ * `allowed_values` entry is written three ways: an envelope (`{value: {type,
23
+ * value}}`), a bare value (`{value: 'default'}`) or a named entry
24
+ * (`{name: 'default'}`). This has always accepted all three; the engine's
25
+ * clearing guard accepted only the first and the third, so a schema using the
26
+ * bare form had its value ERASED on load while this function went on rendering
27
+ * the display name for it — the row read "Default RBAC" collapsed and "—" when
28
+ * opened, and the value was gone from the submitted data.
29
+ */
30
+ export declare const findAllowedValueOption: (value: unknown, schema?: TQorusFormFieldSchema) => any | undefined;
15
31
  /** True when the field's selectable options carry images (logos). Such a choice
16
32
  * renders too tall/rich for an inline row, so compact opens it in the card. */
17
33
  export declare const optionHasImages: (schema?: TQorusFormFieldSchema) => boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"readFirst.d.ts","sourceRoot":"","sources":["../../../../src/components/form/engine/readFirst.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAc,MAAM,8BAA8B,CAAC;AAkFlG;;;GAGG;AAEH,+FAA+F;AAC/F,eAAO,MAAM,kBAAkB,UAAW,OAAO,KAAG,OAIN,CAAC;AAE/C,eAAO,MAAM,gCAAgC,WACnC,qBAAqB,GAAG,SAAS,KACxC,OAiBF,CAAC;AAEF,eAAO,MAAM,2CAA2C,WAC9C,qBAAqB,GAAG,SAAS,SAClC,OAAO,KACb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AkB,MAAO;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,OAAO,CAAC;IAClB,8EAA8E;IAC9E,OAAO,EAAE,OAAO,CAAC;IACjB,yEAAyE;IACzE,OAAO,EAAE,OAAO,CAAC;IACjB,6EAA6E;IAC7E,MAAM,EAAE,OAAO,CAAC;CACjB,KAAG,gBAQH,CAAC;AAEF,mFAAmF;AACnF,eAAO,MAAM,kBAAkB,WAAY,gBAAgB,KAAG,WAAW,GAAG,KAAK,GAAG,UAGrE,CAAC;AAEhB,oFAAoF;AACpF,eAAO,MAAM,sBAAsB,kBACnB,OAAO,MAAM,EAAE,eAAe,GAAG,SAAS,CAAC,KACxD,oBAOF,CAAC;AAEF;;;mBAGmB;AACnB,MAAM,WAAW,wBAAwB;IACvC;+EAC2E;IAC3E,SAAS,EAAE,OAAO,CAAC;IACnB;;;;4DAIwD;IACxD,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,2BAA2B,iBACxB,MAAM,EAAE,gBACR,CAAC,IAAI,EAAE,MAAM,KAAK,wBAAwB,GAAG,SAAS,KACnE,MAAM,GAAG,SASX,CAAC"}
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.getFirstAttentionOptionName = exports.getReadFirstCompletion = exports.getReadFirstBucket = exports.getReadFirstStatus = exports.getOptionGroupLabel = exports.getOptionGroup = exports.getHashEntries = exports.formatOptionValue = exports.summariseMarkdown = exports.SUMMARY_MAX_LENGTH = exports.formatBytes = exports.getValueType = exports.getFileSize = exports.formatFileValue = exports.colorToCss = exports.formatColorValue = exports.getAllowedValueImage = exports.optionHasImages = exports.shouldAutoCollapseCompactOption = exports.isCompactBooleanOption = exports.shouldAutoCollapseCompactAllowedValueOption = exports.isFixedCompactAllowedValueOption = exports.isOptionValueEmpty = void 0;
6
+ exports.getFirstAttentionOptionName = exports.getReadFirstCompletion = exports.getReadFirstBucket = exports.getReadFirstStatus = exports.getOptionGroupLabel = exports.getOptionGroup = exports.getHashEntries = exports.formatOptionValue = exports.summariseMarkdown = exports.SUMMARY_MAX_LENGTH = exports.formatBytes = exports.getValueType = exports.getFileSize = exports.formatFileValue = exports.colorToCss = exports.formatColorValue = exports.getAllowedValueImage = exports.optionHasImages = exports.findAllowedValueOption = exports.shouldAutoCollapseCompactOption = exports.isCompactBooleanOption = exports.shouldAutoCollapseCompactAllowedValueOption = exports.isFixedCompactAllowedValueOption = exports.isOptionValueEmpty = void 0;
7
7
  var rendererTypes_1 = require("./rendererTypes");
8
8
  var structuredData_1 = require("./_structuredData/structuredData");
9
9
  var renderExpressionToText_1 = require("../expressions/renderExpressionToText");
@@ -47,6 +47,53 @@ var summarizeListItem = function (item) {
47
47
  }
48
48
  return undefined;
49
49
  };
50
+ /**
51
+ * Label ONE list item from the sub-schema that describes it.
52
+ *
53
+ * `summarizeListItem` can only read an item that names ITSELF — one carrying a
54
+ * `name` or `display_name` key. A hash whose fields are all domain fields names
55
+ * itself nowhere: an auth profile's scheme has `type`, `cookie_name`,
56
+ * `redirect_url`, and the row fell back to "2 items" — true, and silent about
57
+ * which two.
58
+ *
59
+ * The `arg_schema` is the same description the sub-form was built from, so the
60
+ * row can read an item the way the form asked for it: the FIRST declared field
61
+ * the item actually has, resolved through that field's allowed values. The
62
+ * scheme list then reads "Default RBAC, Cookie" — the words the author picked —
63
+ * instead of a count.
64
+ *
65
+ * Schema order, not value order: the first declared field is the one the form
66
+ * puts at the top of the item, which is the one that identifies it to its author.
67
+ * Value order is insertion order and would vary between two equal items.
68
+ */
69
+ var summarizeHashItemFromSchema = function (item, argSchema) {
70
+ if (!argSchema) {
71
+ return undefined;
72
+ }
73
+ var record = isTypedEnvelope(item) ? item.value : item;
74
+ if (!record || typeof record !== 'object' || Array.isArray(record)) {
75
+ return undefined;
76
+ }
77
+ var fields = record;
78
+ var key = Object.keys(argSchema).find(function (name) {
79
+ var raw = fields[name];
80
+ var value = isTypedEnvelope(raw) ? raw.value : raw;
81
+ return value !== undefined && value !== null && value !== '';
82
+ });
83
+ if (!key) {
84
+ return undefined;
85
+ }
86
+ var raw = fields[key];
87
+ var value = isTypedEnvelope(raw) ? raw.value : raw;
88
+ var label = getAllowedValueLabel(value, argSchema[key]);
89
+ if (label) {
90
+ return label;
91
+ }
92
+ // No allowed values (a free-text field): the stored value IS what was typed,
93
+ // so it reads correctly as-is. An object at this position has no short form,
94
+ // and a count beats printing its shape.
95
+ return typeof value === 'string' || typeof value === 'number' ? value : undefined;
96
+ };
50
97
  /** Summarise a list value: join item labels, or fall back to an "N items" count
51
98
  * (e.g. a list of anonymous hashes). Never prints raw objects. */
52
99
  /**
@@ -59,8 +106,12 @@ var summarizeListItem = function (item) {
59
106
  * does, so it can read the same way instead of printing the wire form back.
60
107
  */
61
108
  var formatList = function (items, schema) {
109
+ var argSchema = schema === null || schema === void 0 ? void 0 : schema.arg_schema;
62
110
  var parts = items
63
- .map(function (item) { var _a; return (_a = getAllowedValueLabel(item, schema)) !== null && _a !== void 0 ? _a : summarizeListItem(item); })
111
+ .map(function (item) {
112
+ var _a, _b;
113
+ return (_b = (_a = getAllowedValueLabel(item, schema)) !== null && _a !== void 0 ? _a : summarizeListItem(item)) !== null && _b !== void 0 ? _b : summarizeHashItemFromSchema(item, argSchema);
114
+ })
64
115
  .filter(function (part) { return part !== '' && part !== undefined && part !== null; });
65
116
  return parts.length ? parts.join(', ') : pluralize(items.length, 'item');
66
117
  };
@@ -127,9 +178,22 @@ var shouldAutoCollapseCompactOption = function (schema, value) {
127
178
  ((0, exports.isCompactBooleanOption)(schema) || (0, exports.isFixedCompactAllowedValueOption)(schema));
128
179
  };
129
180
  exports.shouldAutoCollapseCompactOption = shouldAutoCollapseCompactOption;
130
- /** Prefer the matching allowed_values entry's display_name (fallback `name`)
131
- * over the raw stored value. */
132
- var findAllowedOption = function (value, schema) {
181
+ /**
182
+ * Prefer the matching allowed_values entry's display_name (fallback `name`)
183
+ * over the raw stored value.
184
+ *
185
+ * Exported (as `findAllowedValueOption`) because the form engine's value
186
+ * validation has to answer the SAME question — "is this stored value one of the
187
+ * declared choices?" — and answering it differently loses data. An
188
+ * `allowed_values` entry is written three ways: an envelope (`{value: {type,
189
+ * value}}`), a bare value (`{value: 'default'}`) or a named entry
190
+ * (`{name: 'default'}`). This has always accepted all three; the engine's
191
+ * clearing guard accepted only the first and the third, so a schema using the
192
+ * bare form had its value ERASED on load while this function went on rendering
193
+ * the display name for it — the row read "Default RBAC" collapsed and "—" when
194
+ * opened, and the value was gone from the submitted data.
195
+ */
196
+ var findAllowedValueOption = function (value, schema) {
133
197
  var _a;
134
198
  var s = schema;
135
199
  var options = ((_a = s === null || s === void 0 ? void 0 : s.allowed_values) === null || _a === void 0 ? void 0 : _a.length) ? s.allowed_values : s === null || s === void 0 ? void 0 : s.items;
@@ -138,10 +202,13 @@ var findAllowedOption = function (value, schema) {
138
202
  }
139
203
  return options.find(function (option) { var _a; return ((_a = option === null || option === void 0 ? void 0 : option.value) === null || _a === void 0 ? void 0 : _a.value) === value || (option === null || option === void 0 ? void 0 : option.value) === value || (option === null || option === void 0 ? void 0 : option.name) === value; });
140
204
  };
205
+ exports.findAllowedValueOption = findAllowedValueOption;
141
206
  var getAllowedValueLabel = function (value, schema) {
142
207
  var match = findAllowedOption(value, schema);
143
208
  return match ? match.display_name || match.title || match.name || undefined : undefined;
144
209
  };
210
+ /** Local alias for the module's own callers. */
211
+ var findAllowedOption = exports.findAllowedValueOption;
145
212
  /** True when the field's selectable options carry images (logos). Such a choice
146
213
  * renders too tall/rich for an inline row, so compact opens it in the card. */
147
214
  var optionHasImages = function (schema) {