@qoretechnologies/reqraft 0.10.66-pr.145.gbf28ebd → 0.10.66-pr.152.g3349989
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/.claude/CLAUDE.md +24 -0
- package/dist/components/form/engine/CompactRow.d.ts.map +1 -1
- package/dist/components/form/engine/CompactRow.js +28 -130
- package/dist/components/form/engine/CompactRow.js.map +1 -1
- package/dist/components/form/engine/CompactToolbar.d.ts.map +1 -1
- package/dist/components/form/engine/CompactToolbar.js +16 -78
- package/dist/components/form/engine/CompactToolbar.js.map +1 -1
- package/dist/components/form/engine/FormEngine.d.ts +1 -48
- package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
- package/dist/components/form/engine/FormEngine.js +211 -477
- package/dist/components/form/engine/FormEngine.js.map +1 -1
- package/dist/components/form/engine/OptionFieldMessages.d.ts +2 -18
- package/dist/components/form/engine/OptionFieldMessages.d.ts.map +1 -1
- package/dist/components/form/engine/OptionFieldMessages.js +3 -29
- package/dist/components/form/engine/OptionFieldMessages.js.map +1 -1
- package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts.map +1 -1
- package/dist/components/form/engine/_structuredData/SchemaDataView.js +1 -27
- package/dist/components/form/engine/_structuredData/SchemaDataView.js.map +1 -1
- package/dist/components/form/engine/compactRowContext.d.ts +0 -5
- package/dist/components/form/engine/compactRowContext.d.ts.map +1 -1
- package/dist/components/form/engine/compactRowContext.js.map +1 -1
- package/dist/components/form/engine/compactRowStyles.d.ts +0 -12
- package/dist/components/form/engine/compactRowStyles.d.ts.map +1 -1
- package/dist/components/form/engine/compactRowStyles.js +40 -76
- package/dist/components/form/engine/compactRowStyles.js.map +1 -1
- package/dist/components/form/engine/compactToolbarContext.d.ts +0 -3
- package/dist/components/form/engine/compactToolbarContext.d.ts.map +1 -1
- package/dist/components/form/engine/compactToolbarContext.js.map +1 -1
- package/dist/components/form/engine/readFirst.d.ts +2 -14
- package/dist/components/form/engine/readFirst.d.ts.map +1 -1
- package/dist/components/form/engine/readFirst.js +2 -6
- package/dist/components/form/engine/readFirst.js.map +1 -1
- package/dist/components/form/engine/revealRow.d.ts +0 -13
- package/dist/components/form/engine/revealRow.d.ts.map +1 -1
- package/dist/components/form/engine/revealRow.js +1 -24
- package/dist/components/form/engine/revealRow.js.map +1 -1
- package/dist/components/form/engine/rowFocus.d.ts +1 -9
- package/dist/components/form/engine/rowFocus.d.ts.map +1 -1
- package/dist/components/form/engine/rowFocus.js +5 -17
- package/dist/components/form/engine/rowFocus.js.map +1 -1
- package/dist/components/form/expressions/ExpressionField.d.ts.map +1 -1
- package/dist/components/form/expressions/ExpressionField.js +1 -3
- package/dist/components/form/expressions/ExpressionField.js.map +1 -1
- package/dist/components/form/expressions/builder/index.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/index.js +1 -3
- package/dist/components/form/expressions/builder/index.js.map +1 -1
- package/dist/components/form/expressions/mockExpressions.d.ts.map +1 -1
- package/dist/components/form/expressions/mockExpressions.js +0 -18
- package/dist/components/form/expressions/mockExpressions.js.map +1 -1
- package/dist/components/form/expressions/renderExpressionToText.d.ts.map +1 -1
- package/dist/components/form/expressions/renderExpressionToText.js +0 -21
- package/dist/components/form/expressions/renderExpressionToText.js.map +1 -1
- package/dist/components/form/fields/Field.d.ts.map +1 -1
- package/dist/components/form/fields/Field.js +11 -13
- package/dist/components/form/fields/Field.js.map +1 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.d.ts +0 -7
- package/dist/components/form/fields/allowed-values/AllowedValues.d.ts.map +1 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.js +8 -30
- package/dist/components/form/fields/allowed-values/AllowedValues.js.map +1 -1
- package/dist/components/form/fields/array/ArrayAuto.d.ts.map +1 -1
- package/dist/components/form/fields/array/ArrayAuto.js +3 -23
- package/dist/components/form/fields/array/ArrayAuto.js.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.d.ts +1 -5
- package/dist/components/form/fields/auto/AutoFormField.d.ts.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.js +15 -30
- package/dist/components/form/fields/auto/AutoFormField.js.map +1 -1
- package/dist/components/form/fields/long-string/LongString.d.ts +1 -7
- package/dist/components/form/fields/long-string/LongString.d.ts.map +1 -1
- package/dist/components/form/fields/long-string/LongString.js +5 -9
- package/dist/components/form/fields/long-string/LongString.js.map +1 -1
- package/dist/components/form/fields/multi-select/MultiSelectFormField.d.ts.map +1 -1
- package/dist/components/form/fields/multi-select/MultiSelectFormField.js +5 -6
- package/dist/components/form/fields/multi-select/MultiSelectFormField.js.map +1 -1
- package/dist/components/form/fields/number/Number.d.ts +1 -4
- package/dist/components/form/fields/number/Number.d.ts.map +1 -1
- package/dist/components/form/fields/number/Number.js +5 -13
- package/dist/components/form/fields/number/Number.js.map +1 -1
- package/dist/components/form/fields/radio-group/RadioGroup.d.ts.map +1 -1
- package/dist/components/form/fields/radio-group/RadioGroup.js +7 -13
- package/dist/components/form/fields/radio-group/RadioGroup.js.map +1 -1
- package/dist/components/form/fields/template/TemplateField.d.ts.map +1 -1
- package/dist/components/form/fields/template/TemplateField.js +53 -86
- package/dist/components/form/fields/template/TemplateField.js.map +1 -1
- package/dist/components/form/index.d.ts +0 -2
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/index.js +0 -2
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/imageLightbox/ImageLightbox.d.ts.map +1 -1
- package/dist/components/imageLightbox/ImageLightbox.js +0 -2
- package/dist/components/imageLightbox/ImageLightbox.js.map +1 -1
- package/dist/components/supportTicket/InterfaceReferenceTags.d.ts +2 -3
- package/dist/components/supportTicket/InterfaceReferenceTags.d.ts.map +1 -1
- package/dist/components/supportTicket/InterfaceReferenceTags.js.map +1 -1
- package/dist/components/supportTicket/ReferencePicker.d.ts +1 -2
- package/dist/components/supportTicket/ReferencePicker.d.ts.map +1 -1
- package/dist/components/supportTicket/ReferencePicker.js +13 -19
- package/dist/components/supportTicket/ReferencePicker.js.map +1 -1
- package/dist/components/supportTicket/TicketHeader.d.ts.map +1 -1
- package/dist/components/supportTicket/TicketHeader.js +1 -4
- package/dist/components/supportTicket/TicketHeader.js.map +1 -1
- package/dist/components/supportTicket/TicketReplyBox.d.ts.map +1 -1
- package/dist/components/supportTicket/TicketReplyBox.js +10 -29
- package/dist/components/supportTicket/TicketReplyBox.js.map +1 -1
- package/dist/components/supportTicket/useLoadedImages.d.ts +0 -10
- package/dist/components/supportTicket/useLoadedImages.d.ts.map +1 -1
- package/dist/components/supportTicket/useLoadedImages.js +1 -63
- package/dist/components/supportTicket/useLoadedImages.js.map +1 -1
- package/dist/components/ticketReferences/TicketReferences.d.ts.map +1 -1
- package/dist/components/ticketReferences/TicketReferences.js +2 -6
- package/dist/components/ticketReferences/TicketReferences.js.map +1 -1
- package/dist/components/ticketThread/TicketThread.d.ts.map +1 -1
- package/dist/components/ticketThread/TicketThread.js +16 -10
- package/dist/components/ticketThread/TicketThread.js.map +1 -1
- package/dist/helpers/allowedValues.d.ts +0 -12
- package/dist/helpers/allowedValues.d.ts.map +1 -1
- package/dist/helpers/allowedValues.js +1 -20
- package/dist/helpers/allowedValues.js.map +1 -1
- package/dist/helpers/singleLineString.d.ts.map +1 -1
- package/dist/helpers/singleLineString.js +0 -1
- package/dist/helpers/singleLineString.js.map +1 -1
- package/package.json +1 -1
- package/src/components/form/engine/CompactRow.tsx +27 -147
- package/src/components/form/engine/CompactToolbar.tsx +17 -85
- package/src/components/form/engine/FormEngine.stories.tsx +209 -145
- package/src/components/form/engine/FormEngine.tsx +130 -520
- package/src/components/form/engine/FormEngineRemote.stories.tsx +9 -0
- package/src/components/form/engine/FormEngineStickyHeaders.stories.tsx +4 -5
- package/src/components/form/engine/OptionFieldMessages.tsx +2 -81
- package/src/components/form/engine/_structuredData/SchemaDataView.stories.tsx +9 -0
- package/src/components/form/engine/_structuredData/SchemaDataView.tsx +4 -17
- package/src/components/form/engine/compactRowContext.ts +0 -5
- package/src/components/form/engine/compactRowStyles.ts +38 -234
- package/src/components/form/engine/compactToolbarContext.ts +0 -3
- package/src/components/form/engine/readFirst.ts +3 -16
- package/src/components/form/engine/revealRow.ts +0 -27
- package/src/components/form/engine/rowFocus.ts +6 -17
- package/src/components/form/expressions/ExpressionField.stories.tsx +0 -7
- package/src/components/form/expressions/ExpressionField.tsx +1 -9
- package/src/components/form/expressions/builder/ExpressionBuilder.stories.tsx +66 -2
- package/src/components/form/expressions/builder/index.tsx +1 -3
- package/src/components/form/expressions/mockExpressions.ts +0 -18
- package/src/components/form/expressions/renderExpressionToText.ts +0 -15
- package/src/components/form/fields/Field.tsx +9 -11
- package/src/components/form/fields/allowed-values/AllowedValues.tsx +9 -33
- package/src/components/form/fields/array/ArrayAuto.tsx +0 -20
- package/src/components/form/fields/array/ArrayAutoField.stories.tsx +9 -0
- package/src/components/form/fields/auto/AutoFormField.tsx +10 -36
- package/src/components/form/fields/binary/Binary.stories.tsx +6 -0
- package/src/components/form/fields/boolean/Boolean.stories.tsx +3 -0
- package/src/components/form/fields/color/Color.stories.tsx +9 -0
- package/src/components/form/fields/date/Date.stories.tsx +3 -0
- package/src/components/form/fields/file/File.stories.tsx +6 -0
- package/src/components/form/fields/long-string/LongString.stories.tsx +3 -27
- package/src/components/form/fields/long-string/LongString.tsx +3 -14
- package/src/components/form/fields/multi-select/MultiSelectFormField.tsx +4 -5
- package/src/components/form/fields/number/Number.stories.tsx +6 -0
- package/src/components/form/fields/number/Number.tsx +4 -19
- package/src/components/form/fields/object/Object.stories.tsx +12 -0
- package/src/components/form/fields/radio-group/RadioGroup.tsx +7 -13
- package/src/components/form/fields/schema-definition/SchemaDefinitionField.stories.tsx +6 -0
- package/src/components/form/fields/select/Select.stories.tsx +18 -0
- package/src/components/form/fields/template/TemplateField.tsx +17 -49
- package/src/components/form/fields/timeout/Timeout.stories.tsx +18 -0
- package/src/components/form/fields/url/Url.stories.tsx +3 -0
- package/src/components/form/index.tsx +0 -2
- package/src/components/imageLightbox/ImageLightbox.stories.tsx +3 -0
- package/src/components/imageLightbox/ImageLightbox.tsx +0 -2
- package/src/components/log/Log.stories.tsx +15 -0
- package/src/components/menu/Menu.stories.tsx +3 -0
- package/src/components/supportTicket/AttachmentChips.stories.tsx +3 -0
- package/src/components/supportTicket/InterfaceReferenceTags.stories.tsx +3 -0
- package/src/components/supportTicket/InterfaceReferenceTags.tsx +2 -3
- package/src/components/supportTicket/ReferencePicker.stories.tsx +10 -0
- package/src/components/supportTicket/ReferencePicker.tsx +12 -22
- package/src/components/supportTicket/TicketConversation.stories.tsx +1 -0
- package/src/components/supportTicket/TicketHeader.stories.tsx +3 -0
- package/src/components/supportTicket/TicketHeader.tsx +1 -2
- package/src/components/supportTicket/TicketMetaTags.stories.tsx +6 -0
- package/src/components/supportTicket/TicketReplyBox.stories.tsx +24 -24
- package/src/components/supportTicket/TicketReplyBox.tsx +5 -27
- package/src/components/supportTicket/useLoadedImages.ts +0 -20
- package/src/components/ticketReferences/TicketReferences.stories.tsx +3 -26
- package/src/components/ticketReferences/TicketReferences.tsx +4 -12
- package/src/components/ticketThread/TicketThread.stories.tsx +17 -71
- package/src/components/ticketThread/TicketThread.tsx +28 -15
- package/src/helpers/allowedValues.ts +0 -19
- package/src/helpers/singleLineString.ts +0 -1
- package/src/hooks/useFetch/useFetch.stories.tsx +9 -0
- package/src/hooks/useStorage/useStorage.stories.tsx +9 -0
- package/src/hooks/useWebSocket/useWebsocket.stories.tsx +35 -0
- package/src/stories/Tests/utils.ts +0 -40
- package/src/tracking/ui/ExperimentCard.stories.tsx +46 -15
- package/src/tracking/ui/ExperimentsOverlay.stories.tsx +3 -1
- package/dist/components/form/engine/ItemAttention.d.ts +0 -12
- package/dist/components/form/engine/ItemAttention.d.ts.map +0 -1
- package/dist/components/form/engine/ItemAttention.js +0 -31
- package/dist/components/form/engine/ItemAttention.js.map +0 -1
- package/dist/components/form/engine/formAppearance.d.ts +0 -79
- package/dist/components/form/engine/formAppearance.d.ts.map +0 -1
- package/dist/components/form/engine/formAppearance.js +0 -141
- package/dist/components/form/engine/formAppearance.js.map +0 -1
- package/dist/components/form/fields/ChoiceGroupHeading.d.ts +0 -21
- package/dist/components/form/fields/ChoiceGroupHeading.d.ts.map +0 -1
- package/dist/components/form/fields/ChoiceGroupHeading.js +0 -33
- package/dist/components/form/fields/ChoiceGroupHeading.js.map +0 -1
- package/dist/components/form/fields/allowed-values/savedValues.d.ts +0 -30
- package/dist/components/form/fields/allowed-values/savedValues.d.ts.map +0 -1
- package/dist/components/form/fields/allowed-values/savedValues.js +0 -39
- package/dist/components/form/fields/allowed-values/savedValues.js.map +0 -1
- package/dist/helpers/fieldDescription.d.ts +0 -16
- package/dist/helpers/fieldDescription.d.ts.map +0 -1
- package/dist/helpers/fieldDescription.js +0 -40
- package/dist/helpers/fieldDescription.js.map +0 -1
- package/src/components/form/engine/FormEngineAppearance.stories.tsx +0 -613
- package/src/components/form/engine/ItemAttention.tsx +0 -43
- package/src/components/form/engine/formAppearance.ts +0 -178
- package/src/components/form/fields/ChoiceGroupHeading.tsx +0 -38
- package/src/components/form/fields/allowed-values/savedValues.ts +0 -64
- package/src/helpers/fieldDescription.ts +0 -39
package/.claude/CLAUDE.md
CHANGED
|
@@ -223,6 +223,30 @@ yarn build:test # Type-check without emit
|
|
|
223
223
|
request can pass in CI and hang locally. When a story passes in CI but times out on
|
|
224
224
|
your machine, look for an unmocked request before anything else.
|
|
225
225
|
- **Visual regression via Qlip** (not Chromatic): the story run captures snapshots through the `qlip` Vitest plugin. Upload is gated on `QLIP_UPLOAD_TOKEN` (`vitest.config.ts`), so **local runs capture but never upload** — PNGs land in `qlip/screenshots/<ts>/stories/auto/<StoryId>.png` (gitignored); read the PNG to verify a visual change. CI (`.github/workflows/tests.yml`) sets the token and uploads a build for dashboard review. The full visual-change flow + the `qlip` MCP review skill live in the imported `stacks/frontend/FRONTEND.md`.
|
|
226
|
+
- **Capture a look once, not a behaviour many times.** Qlip catches a change in how a component
|
|
227
|
+
looks; a story's play assertions test what it does. A story is captured only when its end state
|
|
228
|
+
looks different from every other capture of the same component: one capture per distinct look
|
|
229
|
+
(the field holding chips, plain text, read-only, empty, the completion list open, the picker at
|
|
230
|
+
its top level / drilled into a group / searched / on a phone, a hover or details card, each error
|
|
231
|
+
or diagnostic state, long content, find and replace, signature help...). Every other story keeps
|
|
232
|
+
its play and gets, per story (story parameters merge over the meta's):
|
|
233
|
+
|
|
234
|
+
```ts
|
|
235
|
+
parameters: {
|
|
236
|
+
// Interaction-only: the play assertions are the guard, and the end state
|
|
237
|
+
// is already pictured by `WithSemanticTokens`.
|
|
238
|
+
qlip: { skip: true },
|
|
239
|
+
},
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
naming the story that pictures its end state. Each capture is a baseline a human accepts by
|
|
243
|
+
hand, and a look changed on purpose is then one diff to review, not thirty.
|
|
244
|
+
- A capture shows what the story is about, or does not exist: a story about a list or a hover
|
|
245
|
+
ends with it open if its look is distinct; otherwise it is skipped.
|
|
246
|
+
- A "…On Touch" / "…On A Phone" story captured at desktop size is the desktop picture again:
|
|
247
|
+
give it `qlip: { viewport: PHONE_VIEWPORT }` when its layout differs, otherwise skip it.
|
|
248
|
+
- Before adding a story, check whether an existing capture of the component already shows its
|
|
249
|
+
end state; a new capture needs a look no other has.
|
|
226
250
|
|
|
227
251
|
## Code Patterns & Conventions
|
|
228
252
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompactRow.d.ts","sourceRoot":"","sources":["../../../../src/components/form/engine/CompactRow.tsx"],"names":[],"mappings":"AAeA,OAAO,EACL,eAAe,EAIhB,MAAM,8BAA8B,CAAC;AAItC,OAAO,KAAe,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CompactRow.d.ts","sourceRoot":"","sources":["../../../../src/components/form/engine/CompactRow.tsx"],"names":[],"mappings":"AAeA,OAAO,EACL,eAAe,EAIhB,MAAM,8BAA8B,CAAC;AAItC,OAAO,KAAe,MAAM,OAAO,CAAC;AA8HpC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,SAAU,OAAO,KAAG,MAAM,GAAG,SAG7C,CAAC;AAEd,eAAO,MAAM,UAAU,yHASlB;IACD,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,eAAe,CAAC;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;mBAGe;IACf,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAI1B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,6CAy3EF,CAAC"}
|
|
@@ -106,7 +106,6 @@ var use_context_selector_1 = require("use-context-selector");
|
|
|
106
106
|
var validations_1 = require("../../../helpers/validations");
|
|
107
107
|
var templates_1 = require("../../../helpers/templates");
|
|
108
108
|
var common_1 = require("../../../helpers/common");
|
|
109
|
-
var fieldDescription_1 = require("../../../helpers/fieldDescription");
|
|
110
109
|
var templateText_1 = require("../../../helpers/templateText");
|
|
111
110
|
var ReadOnlyTemplateTag_1 = require("../fields/template/ReadOnlyTemplateTag");
|
|
112
111
|
var TemplateText_1 = require("../fields/template/TemplateText");
|
|
@@ -115,7 +114,6 @@ var Description_1 = require("../../Description");
|
|
|
115
114
|
var markdownRendererContext_1 = require("../../Description/markdownRendererContext");
|
|
116
115
|
var FocusedEditing_1 = require("../../FocusedEditing");
|
|
117
116
|
var compactRowContext_1 = require("./compactRowContext");
|
|
118
|
-
var formAppearance_1 = require("./formAppearance");
|
|
119
117
|
var revealRow_1 = require("./revealRow");
|
|
120
118
|
var compactRowStyles_1 = require("./compactRowStyles");
|
|
121
119
|
var OptionFieldMessages_1 = require("./OptionFieldMessages");
|
|
@@ -216,14 +214,8 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
216
214
|
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
217
215
|
var optionName = _a.optionName, optionField = _a.optionField, _r = _a.hidden, hidden = _r === void 0 ? false : _r, _s = _a.clustered, clustered = _s === void 0 ? false : _s, _t = _a.clusterFirst, clusterFirst = _t === void 0 ? false : _t, _u = _a.clusterLast, clusterLast = _u === void 0 ? false : _u, absorbedFields = _a.absorbedFields;
|
|
218
216
|
var readOnly = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.readOnly; });
|
|
219
|
-
// The look only — see `TFormEngineAppearance`. Nothing a row DOES reads it.
|
|
220
|
-
var calm = (0, formAppearance_1.useIsCalmForm)();
|
|
221
217
|
var commitMode = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.commitMode; });
|
|
222
218
|
var options = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.options; });
|
|
223
|
-
// Whether this field's emptiness is a fault yet: the person has opened it and left,
|
|
224
|
-
// or the host reported a submit attempt. Before that a required field is only to
|
|
225
|
-
// fill in, and says so in the quiet colour.
|
|
226
|
-
var visited = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { var _a; return v.revealRequired || !!((_a = v.visitedOptions) === null || _a === void 0 ? void 0 : _a.includes(optionName)); });
|
|
227
219
|
// An absorbed field keeps its own name — it is a different field, not a
|
|
228
220
|
// property of its host — so the label comes from its schema exactly as it
|
|
229
221
|
// would on its own row.
|
|
@@ -306,11 +298,6 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
306
298
|
var cDanger = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.cDanger; });
|
|
307
299
|
var cWarning = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.cWarning; });
|
|
308
300
|
var cInfo = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.cInfo; });
|
|
309
|
-
var cText = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.cText; });
|
|
310
|
-
// A field's NAME: full text colour by default; grey in the calm look, so the
|
|
311
|
-
// value beside it is what the eye lands on. One colour for the read row, the
|
|
312
|
-
// open row and the edit card, so a name does not change as its field opens.
|
|
313
|
-
var cLabel = calm ? "".concat(cText, "b3") : cKey;
|
|
314
301
|
// A markdown value renders as a document in the row's inset; the host's
|
|
315
302
|
// renderer when it supplied one, reqraft's own otherwise.
|
|
316
303
|
// Value-cell content: colour adds a swatch, file an icon + size; hash keeps
|
|
@@ -367,11 +354,6 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
367
354
|
return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'small', minimal: true, intent: 'info', icon: 'FileLine', label: formatted, labelKey: fileSize !== undefined ? (0, readFirst_1.formatBytes)(fileSize) : undefined }));
|
|
368
355
|
}
|
|
369
356
|
if (valueType === 'bool' || valueType === 'boolean') {
|
|
370
|
-
// Calm: Yes and No are words. Neither is a status — "No" is not a
|
|
371
|
-
// failure — so neither is coloured.
|
|
372
|
-
if (calm) {
|
|
373
|
-
return (0, jsx_runtime_1.jsx)("span", { style: textStyle, children: formatted });
|
|
374
|
-
}
|
|
375
357
|
var truthy = (field === null || field === void 0 ? void 0 : field.value) === true || (field === null || field === void 0 ? void 0 : field.value) === 'true';
|
|
376
358
|
return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'small', minimal: true, intent: truthy ? 'success' : 'danger', label: formatted }));
|
|
377
359
|
}
|
|
@@ -563,11 +545,8 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
563
545
|
}, children: actionLabel }), "".concat(optionName, "-injected-action-").concat(index)));
|
|
564
546
|
};
|
|
565
547
|
var required = !!((schema === null || schema === void 0 ? void 0 : schema.required) || (schema === null || schema === void 0 ? void 0 : schema.required_groups));
|
|
566
|
-
// The asterisk says "you have to fill this in". Read-only, nobody does.
|
|
567
|
-
|
|
568
|
-
// value column instead ("Required · add a value"), and a filled one has
|
|
569
|
-
// nothing left to ask for.
|
|
570
|
-
var requiredMark = required && !readOnly && !calm;
|
|
548
|
+
// The asterisk says "you have to fill this in". Read-only, nobody does.
|
|
549
|
+
var requiredMark = required && !readOnly;
|
|
571
550
|
var removable = !readOnly && !(schema === null || schema === void 0 ? void 0 : schema.preselected) && !(schema === null || schema === void 0 ? void 0 : schema.required) && !(schema === null || schema === void 0 ? void 0 : schema.required_groups);
|
|
572
551
|
var changed = !hidden && !readOnly && hasOptionChanged(optionField === null || optionField === void 0 ? void 0 : optionField.value, optionName);
|
|
573
552
|
// "Has a value" = set to anything non-empty. Drives the edit-row Clear
|
|
@@ -610,13 +589,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
610
589
|
var requiredGroupChip = !hidden && !readOnly && memberGroups.length && !(schema === null || schema === void 0 ? void 0 : schema.required) ?
|
|
611
590
|
(0, jsx_runtime_1.jsx)("span", { style: { display: 'inline-flex' }, role: 'presentation', onClick: function (e) { return e.stopPropagation(); }, onKeyDown: function (e) { return e.stopPropagation(); }, onMouseEnter: function () {
|
|
612
591
|
return setHighlightedOptions(requiredGroupsInfo.members[chipGroups[0]] || []);
|
|
613
|
-
}, onMouseLeave: function () { return setHighlightedOptions([]); }, children: (0, jsx_runtime_1.jsx)(reqore_1.ReqoreDropdown, { className: 'options-readfirst-required-group', size: 'tiny', minimal: true, flat: true, compact: true, effect:
|
|
614
|
-
// Calm: a met group is nothing to point at — only the unmet one is
|
|
615
|
-
// coloured.
|
|
616
|
-
intent: groupResolved ?
|
|
617
|
-
calm ? undefined
|
|
618
|
-
: 'success'
|
|
619
|
-
: 'warning', icon: groupResolved ? 'CheckLine' : 'LinkM', label: !groupResolved ? 'One of'
|
|
592
|
+
}, onMouseLeave: function () { return setHighlightedOptions([]); }, children: (0, jsx_runtime_1.jsx)(reqore_1.ReqoreDropdown, { className: 'options-readfirst-required-group', size: 'tiny', minimal: true, flat: true, compact: true, effect: { uppercase: true, spaced: 1 }, intent: groupResolved ? 'success' : 'warning', icon: groupResolved ? 'CheckLine' : 'LinkM', label: !groupResolved ? 'One of'
|
|
620
593
|
: coveredByLabel ?
|
|
621
594
|
"Covered by \u201C".concat(coveredByLabel, "\u201D")
|
|
622
595
|
: 'Covers', filterable: chipGroups.reduce(function (n, g) { return n + requiredGroupsInfo.members[g].length; }, 0) > 6, items: chipGroups.flatMap(function (groupName) { return __spreadArray(__spreadArray([], (chipGroups.length > 1 ?
|
|
@@ -756,58 +729,28 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
756
729
|
if (!editor)
|
|
757
730
|
return undefined;
|
|
758
731
|
var settled = false;
|
|
759
|
-
/* A control that is not a text box holds the caret PROVISIONALLY. An editor that
|
|
760
|
-
takes text can mount after the row opens (a code editor loads late), and until
|
|
761
|
-
it does the only control there is its chrome: a fullscreen toggle. When the
|
|
762
|
-
text box arrives it takes the caret, unless the reader has moved it since. A
|
|
763
|
-
row that never grows one (a pick-one) simply keeps its control. */
|
|
764
|
-
var provisional = null;
|
|
765
732
|
var takeCaret = function () {
|
|
766
733
|
var _a;
|
|
767
734
|
if (settled)
|
|
768
735
|
return true;
|
|
769
736
|
var active = document.activeElement;
|
|
770
|
-
if (provisional) {
|
|
771
|
-
if (active !== provisional) {
|
|
772
|
-
// The reader moved the caret themselves. Leave it there.
|
|
773
|
-
settled = true;
|
|
774
|
-
return true;
|
|
775
|
-
}
|
|
776
|
-
var textEntry = (0, rowFocus_1.findRowFocusTarget)(editor, { textEntryOnly: true });
|
|
777
|
-
if (!textEntry)
|
|
778
|
-
return false;
|
|
779
|
-
textEntry.focus({ preventScroll: true });
|
|
780
|
-
// An editor's text box can be in the DOM before it can take focus (Monaco's
|
|
781
|
-
// edit area, mid-layout), and `focus()` then does nothing. Only a caret
|
|
782
|
-
// that landed counts; otherwise try again on the editor's next change.
|
|
783
|
-
if (document.activeElement !== textEntry)
|
|
784
|
-
return false;
|
|
785
|
-
settled = true;
|
|
786
|
-
return true;
|
|
787
|
-
}
|
|
788
737
|
if (active && active !== document.body && !((_a = rowRef.current) === null || _a === void 0 ? void 0 : _a.contains(active))) {
|
|
789
738
|
// Someone else holds the caret — a field the reader moved into while
|
|
790
739
|
// this row's editor was still arriving. Leave it where it is.
|
|
791
740
|
settled = true;
|
|
792
741
|
return true;
|
|
793
742
|
}
|
|
794
|
-
|
|
795
|
-
var control = (0, rowFocus_1.findRowFocusTarget)(editor, { textEntryOnly: !inlineEditable });
|
|
743
|
+
var control = (0, rowFocus_1.findRowFocusTarget)(editor);
|
|
796
744
|
if (!control)
|
|
797
745
|
return false;
|
|
798
|
-
// The least scroll that shows the row clear of the pinned box header,
|
|
799
|
-
//
|
|
800
|
-
|
|
801
|
-
if (rowRef.current && !(0, revealRow_1.isCaretLineInView)(control, (0, revealRow_1.getRevealClearance)(control))) {
|
|
746
|
+
// The least scroll that shows the row clear of the pinned box header,
|
|
747
|
+
// and none when it is already in view (see `revealRow`).
|
|
748
|
+
if (rowRef.current) {
|
|
802
749
|
(0, revealRow_1.revealRow)(rowRef.current, 'auto');
|
|
803
750
|
}
|
|
804
751
|
// `preventScroll`, because the reveal above has already put the row
|
|
805
752
|
// where it belongs; letting focus scroll as well moves it twice.
|
|
806
753
|
control.focus({ preventScroll: true });
|
|
807
|
-
// A control that cannot take focus yet (still laying out) did not take
|
|
808
|
-
// the caret: try again on the editor's next change.
|
|
809
|
-
if (document.activeElement !== control)
|
|
810
|
-
return false;
|
|
811
754
|
/* …and if the control the row offers is a PICKER, open it.
|
|
812
755
|
*
|
|
813
756
|
* A closed picker prints the value it holds, which is exactly what the
|
|
@@ -825,13 +768,6 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
825
768
|
if (openedByAuthor.current && inlineEditable && (0, rowFocus_1.isClosedPickerTrigger)(control)) {
|
|
826
769
|
openedByAuthor.current = false;
|
|
827
770
|
setOpenThePicker(true);
|
|
828
|
-
settled = true;
|
|
829
|
-
return true;
|
|
830
|
-
}
|
|
831
|
-
if ((0, rowFocus_1.findRowFocusTarget)(editor, { textEntryOnly: true }) !== control) {
|
|
832
|
-
// Not a text box: hold it until one arrives (see `provisional`).
|
|
833
|
-
provisional = control;
|
|
834
|
-
return false;
|
|
835
771
|
}
|
|
836
772
|
settled = true;
|
|
837
773
|
return true;
|
|
@@ -842,9 +778,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
842
778
|
if (takeCaret())
|
|
843
779
|
observer.disconnect();
|
|
844
780
|
});
|
|
845
|
-
|
|
846
|
-
// style change after it is inserted (see the `focus()` checks above).
|
|
847
|
-
observer.observe(editor, { childList: true, subtree: true, attributes: true });
|
|
781
|
+
observer.observe(editor, { childList: true, subtree: true });
|
|
848
782
|
return function () { return observer.disconnect(); };
|
|
849
783
|
}, [isExpanded, optionName, inlineEditable]);
|
|
850
784
|
// What the field held when it was opened — the baseline Cancel restores.
|
|
@@ -987,7 +921,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
987
921
|
// Batched commit: a changed row is a draft until Save — mark it with the
|
|
988
922
|
// product's Draft chip (always visible, unlike the hover-revealed revert).
|
|
989
923
|
var draftChip = commitMode === 'batched' && changed ?
|
|
990
|
-
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { className: 'options-readfirst-draft', label: 'Draft', intent: 'warning', icon: 'EditLine', size: 'tiny', minimal: true, fixed: true, flat: true, compact: true, effect:
|
|
924
|
+
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { className: 'options-readfirst-draft', label: 'Draft', intent: 'warning', icon: 'EditLine', size: 'tiny', minimal: true, fixed: true, flat: true, compact: true, effect: { uppercase: true, spaced: 1 } })
|
|
991
925
|
: null;
|
|
992
926
|
var isPassiveCloseAction = fixedAllowedValueOption;
|
|
993
927
|
// Cancel — the counterpart to Done, and the answer to "how do I get out of
|
|
@@ -1002,7 +936,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1002
936
|
// Not offered when the close action is passive (a fixed choice) —
|
|
1003
937
|
// nothing can have been typed, so there is nothing to cancel.
|
|
1004
938
|
var cancelEditButton = !isPassiveCloseAction && editedSinceOpened ?
|
|
1005
|
-
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'options-readfirst-cancel', size: 'small', flat: true, minimal: true, fixed: true, icon: 'CloseLine', intent:
|
|
939
|
+
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'options-readfirst-cancel', size: 'small', flat: true, minimal: true, fixed: true, icon: 'CloseLine', intent: 'warning', "aria-label": 'Cancel edit', tooltip: 'Cancel edit \u2014 discard the changes made since this field was opened', onClick: function (event) {
|
|
1006
940
|
event.stopPropagation();
|
|
1007
941
|
cancelEdit();
|
|
1008
942
|
} })
|
|
@@ -1011,10 +945,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1011
945
|
var openedWithFormLoadValue = !editEntryValue.current ||
|
|
1012
946
|
(0, isEqual_1.default)(editEntryValue.current.value, (_f = (_e = originalValue.current) === null || _e === void 0 ? void 0 : _e[optionName]) === null || _f === void 0 ? void 0 : _f.value);
|
|
1013
947
|
var editRowRevertButton = openedWithFormLoadValue ? null : revertButton;
|
|
1014
|
-
var closeExpandedFieldButton = ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'options-readfirst-done', size: 'small',
|
|
1015
|
-
// Calm: a neutral button. Closing a field is not a healthy figure and
|
|
1016
|
-
// not the page's one primary action, so it takes neither colour.
|
|
1017
|
-
intent: !isPassiveCloseAction && !calm ? 'success' : undefined, flat: isPassiveCloseAction, minimal: isPassiveCloseAction, fixed: true, icon: isPassiveCloseAction ? 'CloseLine' : 'CheckLine', "aria-label": isPassiveCloseAction ? 'Close field' : 'Done', tooltip: isPassiveCloseAction ? 'Close field' : 'Done', onClick: function () { return toggleExpandedOption(optionName); } }));
|
|
948
|
+
var closeExpandedFieldButton = ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'options-readfirst-done', size: 'small', intent: !isPassiveCloseAction ? 'success' : undefined, flat: isPassiveCloseAction, minimal: isPassiveCloseAction, fixed: true, icon: isPassiveCloseAction ? 'CloseLine' : 'CheckLine', "aria-label": isPassiveCloseAction ? 'Close field' : 'Done', tooltip: isPassiveCloseAction ? 'Close field' : 'Done', onClick: function () { return toggleExpandedOption(optionName); } }));
|
|
1018
949
|
// Info tiers: Tier 1 (danger/warning + dependency hints) must be visible
|
|
1019
950
|
// without interaction; Tier 2 (info/success, default notes) sits behind ⓘ.
|
|
1020
951
|
var infoActive = !hidden;
|
|
@@ -1040,10 +971,6 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1040
971
|
allOptions: availableOptions,
|
|
1041
972
|
getType: getTypeForOption,
|
|
1042
973
|
isRendererOnly: isRendererOnly,
|
|
1043
|
-
calm: calm,
|
|
1044
|
-
readOnly: readOnly,
|
|
1045
|
-
// Until the person has been to the field, its requirement is stated plainly.
|
|
1046
|
-
requirementPending: !visited,
|
|
1047
974
|
}).map(function (m) { return ({ intent: m.intent, content: String(m.label) }); })
|
|
1048
975
|
: [];
|
|
1049
976
|
// TWO display channels, matching the Focus prototype:
|
|
@@ -1074,7 +1001,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1074
1001
|
// the inline editor: opening a field used to drop it, leaving an editing row
|
|
1075
1002
|
// with no route to the field's description at all. Stops propagation because
|
|
1076
1003
|
// both labels are click targets themselves (the row expands / collapses).
|
|
1077
|
-
var helpIcon = (0
|
|
1004
|
+
var helpIcon = (schema === null || schema === void 0 ? void 0 : schema.desc) ?
|
|
1078
1005
|
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'QuestionLine', size: '12px', effect: { opacity: 0.55 }, margin: 'left', marginSize: 'tiny', role: 'button', tabIndex: -1, "aria-label": 'Help', className: 'options-readfirst-help', style: { cursor: 'help' }, onClick: function (event) {
|
|
1079
1006
|
event.stopPropagation();
|
|
1080
1007
|
handleOptionLabelClick(optionName);
|
|
@@ -1098,9 +1025,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1098
1025
|
inside a row, never a page, and markdown authored as a document opens with
|
|
1099
1026
|
a heading that would outgrow the field label above it. Without a host
|
|
1100
1027
|
renderer the string is drawn as it always was. */
|
|
1101
|
-
var renderInfoStrip = function (m, index) { return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreMessage, { size: 'small', opaque: false, flat: true,
|
|
1102
|
-
// Calm: a note that only informs takes no colour (`calmNoteIntent`).
|
|
1103
|
-
intent: (0, formAppearance_1.calmNoteIntent)(m.intent, calm), title: m.title, style: { marginBottom: 8 }, children: markdownRenderer && typeof m.content === 'string' ?
|
|
1028
|
+
var renderInfoStrip = function (m, index) { return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreMessage, { size: 'small', opaque: false, flat: true, intent: m.intent, title: m.title, style: { marginBottom: 8 }, children: markdownRenderer && typeof m.content === 'string' ?
|
|
1104
1029
|
markdownRenderer({ value: m.content, compact: true })
|
|
1105
1030
|
: m.content }, "".concat(m.content, "-").concat(index))); };
|
|
1106
1031
|
var reasonColor = function (intent) {
|
|
@@ -1208,16 +1133,16 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1208
1133
|
var collapse_1 = function () { return toggleExpandedOption(optionName); };
|
|
1209
1134
|
var editingRow = ((0, jsx_runtime_1.jsxs)("div", __assign({ ref: rowRef, "data-field": optionName, className: 'readfirst-row readfirst-row-editing options-readfirst-inline options-readfirst-value', style: readRowHeights.current[optionName] ?
|
|
1210
1135
|
{ minHeight: readRowHeights.current[optionName] }
|
|
1211
|
-
: undefined }, clusterHoverProps, { children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledLabelBlock, { className: 'options-readfirst-label-block', children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRowLabel, { role: 'button', tabIndex: 0, "aria-label": "Collapse ".concat(label), title: (schema === null || schema === void 0 ? void 0 : schema.short_desc) || undefined, "$color":
|
|
1136
|
+
: undefined }, clusterHoverProps, { children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledLabelBlock, { className: 'options-readfirst-label-block', children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRowLabel, { role: 'button', tabIndex: 0, "aria-label": "Collapse ".concat(label), title: (schema === null || schema === void 0 ? void 0 : schema.short_desc) || undefined, "$color": cKey, "$pointer": true, onClick: collapse_1, onKeyDown: function (event) {
|
|
1212
1137
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
1213
1138
|
event.preventDefault();
|
|
1214
1139
|
collapse_1();
|
|
1215
1140
|
}
|
|
1216
|
-
}, children: [label, required
|
|
1141
|
+
}, children: [label, required ?
|
|
1217
1142
|
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'Asterisk', color: 'danger', size: '10px' })
|
|
1218
1143
|
: null, helpIcon] }), labelShortDesc ?
|
|
1219
1144
|
(0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledLabelDesc, { className: 'options-readfirst-label-desc', size: 'small', effect: { opacity: 0.55 }, children: labelShortDesc })
|
|
1220
|
-
: null, codeSizeNode] }), (0, jsx_runtime_1.jsxs)("div", { ref: editorRef,
|
|
1145
|
+
: null, codeSizeNode] }), (0, jsx_runtime_1.jsxs)("div", { ref: editorRef, style: { minWidth: 0 }, onKeyDown: function (event) {
|
|
1221
1146
|
if (event.key === 'Escape') {
|
|
1222
1147
|
event.stopPropagation();
|
|
1223
1148
|
// Escape discards. It used to call `collapse()`, which closed
|
|
@@ -1252,17 +1177,17 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1252
1177
|
var schemaIntentColor = (schema === null || schema === void 0 ? void 0 : schema.intent) ?
|
|
1253
1178
|
(_j = theme === null || theme === void 0 ? void 0 : theme.intents) === null || _j === void 0 ? void 0 : _j[schema.intent]
|
|
1254
1179
|
: undefined;
|
|
1255
|
-
return ((0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledEditCard, {
|
|
1180
|
+
return ((0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledEditCard, { "data-field": optionName, className: COMPACT_SINGLE_VALUE_TYPES.has(editType) ?
|
|
1256
1181
|
'options-readfirst-card options-readfirst-card-single'
|
|
1257
|
-
: 'options-readfirst-card', "$bg": cHover, "$border": schemaIntentColor ? "".concat(schemaIntentColor, "66") : "".concat(cInfo, "66"),
|
|
1182
|
+
: 'options-readfirst-card', "$bg": cHover, "$border": schemaIntentColor ? "".concat(schemaIntentColor, "66") : "".concat(cInfo, "66"), children: [(0, jsx_runtime_1.jsxs)("div", { style: {
|
|
1258
1183
|
display: 'flex',
|
|
1259
1184
|
alignItems: 'flex-start',
|
|
1260
1185
|
justifyContent: 'space-between',
|
|
1261
1186
|
gap: 12,
|
|
1262
|
-
}, children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledCardHeading, { children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledCardLabel, { "$color":
|
|
1187
|
+
}, children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledCardHeading, { children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledCardLabel, { "$color": cKey, children: [((schema === null || schema === void 0 ? void 0 : schema.icon) ||
|
|
1263
1188
|
(schema === null || schema === void 0 ? void 0 : schema.image)) ?
|
|
1264
1189
|
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: schema === null || schema === void 0 ? void 0 : schema.icon, image: schema === null || schema === void 0 ? void 0 : schema.image, size: '14px' })
|
|
1265
|
-
: null, (0, jsx_runtime_1.jsxs)("span", { children: [label, required
|
|
1190
|
+
: null, (0, jsx_runtime_1.jsxs)("span", { children: [label, required ?
|
|
1266
1191
|
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'Asterisk', color: 'danger', size: '10px' })
|
|
1267
1192
|
: null, helpIcon] }), cardBadges.map(function (badge, index) {
|
|
1268
1193
|
return typeof badge === 'object' ?
|
|
@@ -1279,11 +1204,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1279
1204
|
return renderInjectedOptionAction(action, index);
|
|
1280
1205
|
}), editRowRevertButton, cancelEditButton, hasValue && !readOnly ?
|
|
1281
1206
|
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { size: 'small', icon: 'DeleteBinLine', minimal: true, flat: true, fixed: true, intent: 'danger', className: 'options-readfirst-clear', "aria-label": 'Clear value', tooltip: 'Clear value', onClick: confirmClearValue })
|
|
1282
|
-
: null, moreMenu, closeExpandedFieldButton] })] }), absorbedNodes, (0, jsx_runtime_1.jsx)("div", {
|
|
1283
|
-
// The card's editor, as the inline row's is: an opened card takes the
|
|
1284
|
-
// caret too (the tap-to-edit rule above), so opening Description or
|
|
1285
|
-
// Source Code by a click or by a blocked submit puts the cursor in it.
|
|
1286
|
-
ref: editorRef, className: 'options-readfirst-row-editor', style: { display: 'contents' }, onKeyDown: function (event) {
|
|
1207
|
+
: null, moreMenu, closeExpandedFieldButton] })] }), absorbedNodes, (0, jsx_runtime_1.jsx)("div", { style: { display: 'contents' }, onKeyDown: function (event) {
|
|
1287
1208
|
if (event.key === 'Escape') {
|
|
1288
1209
|
event.stopPropagation();
|
|
1289
1210
|
cancelEdit();
|
|
@@ -1317,7 +1238,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1317
1238
|
// default-value hints, plus a read-only covered-by note (editable covered rows
|
|
1318
1239
|
// carry that in their chip instead).
|
|
1319
1240
|
var valueReasons = __spreadArray(__spreadArray([], inlineMessages, true), (empty && coveredByLabel ?
|
|
1320
|
-
[{ content: "Covered by \u201C".concat(coveredByLabel, "\u201D"), intent:
|
|
1241
|
+
[{ content: "Covered by \u201C".concat(coveredByLabel, "\u201D"), intent: 'success' }]
|
|
1321
1242
|
: []), true);
|
|
1322
1243
|
// A hash row reveals its sub-fields as read-only sub-rows under a "view
|
|
1323
1244
|
// more" disclosure; the row itself still expands the real editor on click.
|
|
@@ -1597,26 +1518,10 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1597
1518
|
covered: !!coveredByLabel || groupResolved,
|
|
1598
1519
|
invalid: worstIntent === 'danger',
|
|
1599
1520
|
warned: worstIntent === 'warning',
|
|
1600
|
-
visited: visited,
|
|
1601
1521
|
});
|
|
1602
1522
|
// No dot at all in a read-only form: the dot reports progress on the
|
|
1603
1523
|
// form, and a read view has no progress to report.
|
|
1604
|
-
|
|
1605
|
-
// Calm: no dot on a healthy row, and none on an empty required one either —
|
|
1606
|
-
// its value column already says "Required · add a value" in amber, and one
|
|
1607
|
-
// thing is said once. Only a failing value keeps the red dot beside the
|
|
1608
|
-
// reason it gives.
|
|
1609
|
-
var dotStatus = hidden || fieldDisabled || readOnly || (calm && rowStatus !== 'invalid') ?
|
|
1610
|
-
undefined
|
|
1611
|
-
: rowStatus;
|
|
1612
|
-
// Calm: an empty required value is said IN the value column, in amber,
|
|
1613
|
-
// where the value would be — instead of a dash plus a red reason beside it.
|
|
1614
|
-
// Not on a locked field (its lock and reason speak for it) or one that
|
|
1615
|
-
// shows the default it will fall back to.
|
|
1616
|
-
var calmRequiredWord = calm && empty && !hidden && !!(schema === null || schema === void 0 ? void 0 : schema.required) && !fieldDisabled && !formattedDefault ?
|
|
1617
|
-
readOnly ? formAppearance_1.CALM_REQUIRED_READ_LABEL
|
|
1618
|
-
: formAppearance_1.CALM_REQUIRED_LABEL
|
|
1619
|
-
: undefined;
|
|
1524
|
+
var dotStatus = hidden || fieldDisabled || readOnly ? undefined : rowStatus;
|
|
1620
1525
|
var dotColor = dotStatus === 'invalid' ? cDanger
|
|
1621
1526
|
: dotStatus === 'todo' ? cWarning
|
|
1622
1527
|
: dotStatus === 'set' ? cSuccess || cInfo
|
|
@@ -1634,7 +1539,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1634
1539
|
event.preventDefault();
|
|
1635
1540
|
activate(event);
|
|
1636
1541
|
}
|
|
1637
|
-
}) }, clusterHoverProps, { children: [clusterNode, (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledLabelBlock, { className: 'options-readfirst-label-block', children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRowLabel, { title: (schema === null || schema === void 0 ? void 0 : schema.short_desc) || undefined, "$color":
|
|
1542
|
+
}) }, clusterHoverProps, { children: [clusterNode, (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledLabelBlock, { className: 'options-readfirst-label-block', children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRowLabel, { title: (schema === null || schema === void 0 ? void 0 : schema.short_desc) || undefined, "$color": cKey, children: [rowChromeIcon, (0, jsx_runtime_1.jsxs)("span", { className: 'options-readfirst-label-text', style: { minWidth: 0 }, children: [label, requiredMark ?
|
|
1638
1543
|
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'Asterisk', color: 'danger', size: '10px', margin: 'left', marginSize: 'tiny' })
|
|
1639
1544
|
: null, helpIcon] }), typeLabel ?
|
|
1640
1545
|
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'tiny', minimal: true, label: typeLabel, labelEffect: { opacity: 0.55 } })
|
|
@@ -1669,20 +1574,13 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1669
1574
|
!showsTemplateText &&
|
|
1670
1575
|
typeof formatted === 'string') ?
|
|
1671
1576
|
formatted
|
|
1672
|
-
: undefined, "$color":
|
|
1673
|
-
rowStatus === 'pending' ?
|
|
1674
|
-
"".concat(cMuted, "a6")
|
|
1675
|
-
: cWarning
|
|
1676
|
-
: empty || hidden ? "".concat(cMuted, "66")
|
|
1677
|
-
: cKey, "$empty": (empty || hidden) && !calmRequiredWord, children: [(showMarkdownPreview || showLongTextInset || (previewWithSchema && showStructuredPreview)) ?
|
|
1577
|
+
: undefined, "$color": empty || hidden ? "".concat(cMuted, "66") : cKey, "$empty": empty || hidden, children: [(showMarkdownPreview || showLongTextInset || (previewWithSchema && showStructuredPreview)) ?
|
|
1678
1578
|
null
|
|
1679
1579
|
: (0, jsx_runtime_1.jsx)("span", { className: 'options-readfirst-valuetext', children: hidden || empty ?
|
|
1680
|
-
|
|
1580
|
+
formattedDefault || '—'
|
|
1681
1581
|
: renderReadFirstValue(optionField, schema, formatted, readOnly) }), readOnlyChoiceDesc ?
|
|
1682
1582
|
(0, jsx_runtime_1.jsx)("span", { className: 'options-readfirst-choice-desc', children: readOnlyChoiceDesc })
|
|
1683
|
-
: null, (
|
|
1684
|
-
valueReasons.filter(function (m) { return m.content !== calmRequiredWord; })
|
|
1685
|
-
: valueReasons).map(function (m, i) { return ((0, jsx_runtime_1.jsx)("span", { className: 'options-readfirst-reason', style: { color: reasonColor(m.intent) }, children: m.content }, "".concat(m.content, "-").concat(i))); }), panelMessages.length ?
|
|
1583
|
+
: null, valueReasons.map(function (m, i) { return ((0, jsx_runtime_1.jsx)("span", { className: 'options-readfirst-reason', style: { color: reasonColor(m.intent) }, children: m.content }, "".concat(m.content, "-").concat(i))); }), panelMessages.length ?
|
|
1686
1584
|
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreControlGroup, { className: 'options-readfirst-info-panel', vertical: true, fluid: true, gapSize: 'normal', children: panelMessages.map(renderInfoStrip) })
|
|
1687
1585
|
: null, showStructuredPreview ?
|
|
1688
1586
|
// The inset lives inside the row now, so a click on a value chip would
|
|
@@ -1763,7 +1661,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1763
1661
|
handleValueChange(optionName, (_b = (_a = originalValue.current) === null || _a === void 0 ? void 0 : _a[optionName]) === null || _b === void 0 ? void 0 : _b.value, (_d = (_c = originalValue.current) === null || _c === void 0 ? void 0 : _c[optionName]) === null || _d === void 0 ? void 0 : _d.type);
|
|
1764
1662
|
} })
|
|
1765
1663
|
: dotColor ?
|
|
1766
|
-
(0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledStatusDot, {
|
|
1664
|
+
(0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledStatusDot, { "$color": dotColor, "$ring": dotStatus !== 'set', "aria-hidden": true })
|
|
1767
1665
|
: null })] })] }), optionName));
|
|
1768
1666
|
return row;
|
|
1769
1667
|
});
|