@qoretechnologies/reqraft 0.10.73-pr.161.gde29c8a → 0.10.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/codeSize/index.d.ts.map +1 -1
- package/dist/components/codeSize/index.js +2 -3
- package/dist/components/codeSize/index.js.map +1 -1
- package/dist/components/dpqlEditor/DpqlEditor.d.ts.map +1 -1
- package/dist/components/dpqlEditor/DpqlEditor.js +3 -5
- package/dist/components/dpqlEditor/DpqlEditor.js.map +1 -1
- package/dist/components/dpqlEditor/dpqlCompletions.d.ts +2 -2
- package/dist/components/dpqlEditor/dpqlCompletions.d.ts.map +1 -1
- package/dist/components/dpqlEditor/dpqlCompletions.js +8 -15
- package/dist/components/dpqlEditor/dpqlCompletions.js.map +1 -1
- package/dist/components/dpqlEditor/useDpqlSession.d.ts.map +1 -1
- package/dist/components/dpqlEditor/useDpqlSession.js +2 -3
- package/dist/components/dpqlEditor/useDpqlSession.js.map +1 -1
- package/dist/components/form/engine/CompactRow.d.ts.map +1 -1
- package/dist/components/form/engine/CompactRow.js +38 -52
- 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 +25 -27
- package/dist/components/form/engine/CompactToolbar.js.map +1 -1
- package/dist/components/form/engine/FormEngine.d.ts +1 -14
- package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
- package/dist/components/form/engine/FormEngine.js +32 -55
- package/dist/components/form/engine/FormEngine.js.map +1 -1
- package/dist/components/form/engine/HiddenFieldsNote.d.ts.map +1 -1
- package/dist/components/form/engine/HiddenFieldsNote.js +3 -2
- package/dist/components/form/engine/HiddenFieldsNote.js.map +1 -1
- package/dist/components/form/engine/OptionFieldMessages.d.ts.map +1 -1
- package/dist/components/form/engine/OptionFieldMessages.js +9 -17
- package/dist/components/form/engine/OptionFieldMessages.js.map +1 -1
- package/dist/components/form/engine/OptionsHelpDialog.d.ts.map +1 -1
- package/dist/components/form/engine/OptionsHelpDialog.js +4 -5
- package/dist/components/form/engine/OptionsHelpDialog.js.map +1 -1
- package/dist/components/form/engine/_structuredData/StructuredDataView.d.ts.map +1 -1
- package/dist/components/form/engine/_structuredData/StructuredDataView.js +2 -3
- package/dist/components/form/engine/_structuredData/StructuredDataView.js.map +1 -1
- package/dist/components/form/engine/optionActions.d.ts.map +1 -1
- package/dist/components/form/engine/optionActions.js +2 -3
- package/dist/components/form/engine/optionActions.js.map +1 -1
- package/dist/components/form/engine/readFirst.d.ts.map +1 -1
- package/dist/components/form/engine/readFirst.js +18 -18
- package/dist/components/form/engine/readFirst.js.map +1 -1
- package/dist/components/form/expressions/builder/argumentLabel.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/argumentLabel.js +5 -6
- package/dist/components/form/expressions/builder/argumentLabel.js.map +1 -1
- package/dist/components/form/expressions/builder/index.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/index.js +3 -2
- package/dist/components/form/expressions/builder/index.js.map +1 -1
- package/dist/components/form/fields/rich-text/RichText.d.ts.map +1 -1
- package/dist/components/form/fields/rich-text/RichText.js +3 -5
- package/dist/components/form/fields/rich-text/RichText.js.map +1 -1
- package/dist/components/form/fields/rich-text/useTemplateTags.d.ts.map +1 -1
- package/dist/components/form/fields/rich-text/useTemplateTags.js +3 -6
- package/dist/components/form/fields/rich-text/useTemplateTags.js.map +1 -1
- package/dist/components/form/fields/template/TemplateBrowser.d.ts.map +1 -1
- package/dist/components/form/fields/template/TemplateBrowser.js +1 -3
- package/dist/components/form/fields/template/TemplateBrowser.js.map +1 -1
- package/dist/components/form/fields/template/TemplateField.d.ts +44 -3
- package/dist/components/form/fields/template/TemplateField.d.ts.map +1 -1
- package/dist/components/form/fields/template/TemplateField.js +50 -34
- package/dist/components/form/fields/template/TemplateField.js.map +1 -1
- package/dist/components/form/fields/template/TemplatePicker.d.ts.map +1 -1
- package/dist/components/form/fields/template/TemplatePicker.js +21 -23
- package/dist/components/form/fields/template/TemplatePicker.js.map +1 -1
- package/dist/components/form/fields/template/referenceNames.d.ts +1 -1
- package/dist/components/form/fields/template/referenceNames.d.ts.map +1 -1
- package/dist/components/form/fields/template/referenceNames.js +2 -4
- package/dist/components/form/fields/template/referenceNames.js.map +1 -1
- package/dist/components/smartEditor/CompletionMenu.d.ts.map +1 -1
- package/dist/components/smartEditor/CompletionMenu.js +8 -27
- package/dist/components/smartEditor/CompletionMenu.js.map +1 -1
- package/dist/components/smartEditor/SmartEditor.d.ts.map +1 -1
- package/dist/components/smartEditor/SmartEditor.js +8 -12
- package/dist/components/smartEditor/SmartEditor.js.map +1 -1
- package/dist/components/smartEditor/contextTitle.d.ts.map +1 -1
- package/dist/components/smartEditor/contextTitle.js +1 -3
- package/dist/components/smartEditor/contextTitle.js.map +1 -1
- package/dist/components/smartEditor/templateCompletions.d.ts +1 -1
- package/dist/components/smartEditor/templateCompletions.d.ts.map +1 -1
- package/dist/components/smartEditor/templateCompletions.js +11 -22
- package/dist/components/smartEditor/templateCompletions.js.map +1 -1
- package/dist/components/smartEditor/useEditingAids.d.ts.map +1 -1
- package/dist/components/smartEditor/useEditingAids.js +10 -12
- package/dist/components/smartEditor/useEditingAids.js.map +1 -1
- package/dist/components/smartEditor/useLspAutocomplete.d.ts.map +1 -1
- package/dist/components/smartEditor/useLspAutocomplete.js +37 -5
- package/dist/components/smartEditor/useLspAutocomplete.js.map +1 -1
- package/dist/helpers/noDescription.d.ts +1 -1
- package/dist/helpers/noDescription.d.ts.map +1 -1
- package/dist/helpers/noDescription.js +1 -2
- package/dist/helpers/noDescription.js.map +1 -1
- package/dist/helpers/qorusTypeCatalogue.d.ts +0 -6
- package/dist/helpers/qorusTypeCatalogue.d.ts.map +1 -1
- package/dist/helpers/qorusTypeCatalogue.js +1 -16
- package/dist/helpers/qorusTypeCatalogue.js.map +1 -1
- package/dist/helpers/templateCatalogue.d.ts.map +1 -1
- package/dist/helpers/templateCatalogue.js +3 -4
- package/dist/helpers/templateCatalogue.js.map +1 -1
- package/dist/helpers/templateTree.d.ts +13 -4
- package/dist/helpers/templateTree.d.ts.map +1 -1
- package/dist/helpers/templateTree.js +49 -56
- package/dist/helpers/templateTree.js.map +1 -1
- package/dist/helpers/templates.d.ts.map +1 -1
- package/dist/helpers/templates.js +5 -5
- package/dist/helpers/templates.js.map +1 -1
- package/dist/hooks/useTemplates.d.ts.map +1 -1
- package/dist/hooks/useTemplates.js +3 -23
- package/dist/hooks/useTemplates.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/helpers/reqraftLabels.d.ts +0 -327
- package/dist/helpers/reqraftLabels.d.ts.map +0 -1
- package/dist/helpers/reqraftLabels.js +0 -394
- package/dist/helpers/reqraftLabels.js.map +0 -1
|
@@ -95,7 +95,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
95
95
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
96
96
|
exports.CompactRow = exports.richtextItemText = void 0;
|
|
97
97
|
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
98
|
-
var reqraftLabels_1 = require("../../../helpers/reqraftLabels");
|
|
99
98
|
var reqore_1 = require("@qoretechnologies/reqore");
|
|
100
99
|
var rowMenuContext_1 = require("./rowMenuContext");
|
|
101
100
|
var optionActions_1 = require("./optionActions");
|
|
@@ -119,6 +118,7 @@ var compactRowContext_1 = require("./compactRowContext");
|
|
|
119
118
|
var qorusTypeCatalogue_1 = require("../../../helpers/qorusTypeCatalogue");
|
|
120
119
|
var typeSentenceForm_1 = require("../typeSentenceForm");
|
|
121
120
|
var inheritProps_1 = require("./inheritProps");
|
|
121
|
+
var noDescription_1 = require("../../../helpers/noDescription");
|
|
122
122
|
var revealRow_1 = require("./revealRow");
|
|
123
123
|
var compactRowStyles_1 = require("./compactRowStyles");
|
|
124
124
|
var OptionFieldMessages_1 = require("./OptionFieldMessages");
|
|
@@ -239,8 +239,7 @@ var SUMMARY_TEXT_STYLE = Object.freeze({
|
|
|
239
239
|
*/
|
|
240
240
|
var WebLink = (0, react_1.memo)(function (_a) {
|
|
241
241
|
var address = _a.address, color = _a.color;
|
|
242
|
-
|
|
243
|
-
return ((0, jsx_runtime_1.jsx)("a", { className: 'options-readfirst-link', href: address, target: '_blank', rel: 'noopener noreferrer', "aria-label": feWords.opensInNewTab(address), style: color ? { color: color } : undefined,
|
|
242
|
+
return ((0, jsx_runtime_1.jsx)("a", { className: 'options-readfirst-link', href: address, target: '_blank', rel: 'noopener noreferrer', "aria-label": "".concat(address, " (opens in a new tab)"), style: color ? { color: color } : undefined,
|
|
244
243
|
// the link's, not the row's: the row opens on a click and on Enter or Space
|
|
245
244
|
onClick: function (event) { return event.stopPropagation(); }, onKeyDown: function (event) {
|
|
246
245
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
@@ -256,7 +255,6 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
256
255
|
var _b;
|
|
257
256
|
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
258
257
|
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;
|
|
259
|
-
var feWords = (0, reqraftLabels_1.useReqraftLabels)().formEngine;
|
|
260
258
|
var readOnly = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.readOnly; });
|
|
261
259
|
var commitMode = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.commitMode; });
|
|
262
260
|
var options = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.options; });
|
|
@@ -395,7 +393,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
395
393
|
/* Opacity through `effect`, which is how this repo dims a reqore
|
|
396
394
|
component (see the card's `short_desc` below); only the flex
|
|
397
395
|
rule, which reqore has no prop for, stays inline. */
|
|
398
|
-
effect: { opacity: 0.7 }, style: { flexShrink: 0 }, tooltip:
|
|
396
|
+
effect: { opacity: 0.7 }, style: { flexShrink: 0 }, tooltip: 'This value is an expression' }), rendered] }));
|
|
399
397
|
};
|
|
400
398
|
// Template value ($local:…): the read-only template picker — the SAME chip
|
|
401
399
|
// TemplateField renders when disabled, so a template reads identically here
|
|
@@ -671,10 +669,10 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
671
669
|
if ((0, hoveringPointer_1.isHoveringPointer)(e)) {
|
|
672
670
|
setHighlightedOptions(requiredGroupsInfo.members[chipGroups[0]] || []);
|
|
673
671
|
}
|
|
674
|
-
}, onPointerLeave: 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 ?
|
|
672
|
+
}, onPointerLeave: 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'
|
|
675
673
|
: coveredByLabel ?
|
|
676
|
-
|
|
677
|
-
:
|
|
674
|
+
"Covered by \u201C".concat(coveredByLabel, "\u201D")
|
|
675
|
+
: '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 ?
|
|
678
676
|
[{ divider: true, label: groupName, dividerAlign: 'left' }]
|
|
679
677
|
: []), true), requiredGroupsInfo.members[groupName].map(function (member) {
|
|
680
678
|
var _a;
|
|
@@ -990,7 +988,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
990
988
|
// status-dot column — there is no edit in progress there to cancel, so the
|
|
991
989
|
// whole-field revert is the only undo that makes sense.
|
|
992
990
|
var revertButton = changed ?
|
|
993
|
-
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'options-readfirst-revert', size: 'small', flat: true, minimal: true, icon: 'HistoryLine', tooltip:
|
|
991
|
+
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'options-readfirst-revert', size: 'small', flat: true, minimal: true, icon: 'HistoryLine', tooltip: 'Revert changes', onClick: function (e) {
|
|
994
992
|
var _a;
|
|
995
993
|
e.stopPropagation();
|
|
996
994
|
handleValueChange.apply(void 0, __spreadArray([optionName], (0, argumentPresence_1.restoredFieldChange)((_a = originalValue.current) === null || _a === void 0 ? void 0 : _a[optionName]), false));
|
|
@@ -1017,21 +1015,21 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1017
1015
|
var confirmClearValue = function (event) {
|
|
1018
1016
|
event === null || event === void 0 ? void 0 : event.stopPropagation();
|
|
1019
1017
|
confirmAction({
|
|
1020
|
-
title:
|
|
1021
|
-
description:
|
|
1022
|
-
confirmLabel:
|
|
1018
|
+
title: 'Clear value',
|
|
1019
|
+
description: "Clear the current value of \"".concat(label, "\"?"),
|
|
1020
|
+
confirmLabel: 'Clear value',
|
|
1023
1021
|
confirmButtonIntent: 'danger',
|
|
1024
1022
|
intent: 'danger',
|
|
1025
1023
|
onConfirm: function () { return handleValueChange(optionName, undefined); },
|
|
1026
1024
|
});
|
|
1027
1025
|
};
|
|
1028
1026
|
var clearValueButton = hasValue && !readOnly && editorLacksOwnClear ?
|
|
1029
|
-
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'options-readfirst-clear', size: 'small', flat: true, minimal: true, icon: 'DeleteBinLine', intent: 'danger', "aria-label":
|
|
1027
|
+
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'options-readfirst-clear', size: 'small', flat: true, minimal: true, icon: 'DeleteBinLine', intent: 'danger', "aria-label": 'Clear value', tooltip: 'Clear value', onClick: confirmClearValue })
|
|
1030
1028
|
: null;
|
|
1031
1029
|
// Batched commit: a changed row is a draft until Save — mark it with the
|
|
1032
1030
|
// product's Draft chip (always visible, unlike the hover-revealed revert).
|
|
1033
1031
|
var draftChip = commitMode === 'batched' && changed ?
|
|
1034
|
-
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { className: 'options-readfirst-draft', label:
|
|
1032
|
+
(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 } })
|
|
1035
1033
|
: null;
|
|
1036
1034
|
// nothing can have been typed where the value is a fixed choice, or the form is read-only (a card opened to read)
|
|
1037
1035
|
var isPassiveCloseAction = fixedAllowedValueOption || !!readOnly;
|
|
@@ -1047,7 +1045,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1047
1045
|
// Not offered when the close action is passive (a fixed choice) —
|
|
1048
1046
|
// nothing can have been typed, so there is nothing to cancel.
|
|
1049
1047
|
var cancelEditButton = !isPassiveCloseAction && editedSinceOpened ?
|
|
1050
|
-
(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":
|
|
1048
|
+
(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) {
|
|
1051
1049
|
event.stopPropagation();
|
|
1052
1050
|
cancelEdit();
|
|
1053
1051
|
} })
|
|
@@ -1056,7 +1054,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1056
1054
|
var openedWithFormLoadValue = !editEntryValue.current ||
|
|
1057
1055
|
(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);
|
|
1058
1056
|
var editRowRevertButton = openedWithFormLoadValue ? null : revertButton;
|
|
1059
|
-
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 ?
|
|
1057
|
+
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 () {
|
|
1060
1058
|
// what was typed inside the field's pause reaches the form before the row closes
|
|
1061
1059
|
pendingEdits.flush();
|
|
1062
1060
|
collapseOption(optionName);
|
|
@@ -1101,9 +1099,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1101
1099
|
[
|
|
1102
1100
|
{
|
|
1103
1101
|
// the default's description is the server's markdown: its words, not its marks
|
|
1104
|
-
content:
|
|
1105
|
-
.defaultIs(schema.default_value_display_name || '', (0, readFirst_1.markdownToProse)(schema.default_value_desc))
|
|
1106
|
-
.trim(),
|
|
1102
|
+
content: "Default: ".concat(schema.default_value_display_name || '', " \u2014 ").concat((0, readFirst_1.markdownToProse)(schema.default_value_desc)).trim(),
|
|
1107
1103
|
},
|
|
1108
1104
|
]
|
|
1109
1105
|
: []), true);
|
|
@@ -1135,8 +1131,8 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1135
1131
|
var typeSentence = (0, qorusTypeCatalogue_1.optionTypeSentence)(schema, typeName, typeSentenceForm);
|
|
1136
1132
|
// what the option is, or, where it has no description at all, why nothing says so (qorus#646)
|
|
1137
1133
|
var labelHover = [
|
|
1138
|
-
(schema === null || schema === void 0 ? void 0 : schema.short_desc) || (!(schema === null || schema === void 0 ? void 0 : schema.desc) && typeSentence ?
|
|
1139
|
-
typeSentence &&
|
|
1134
|
+
(schema === null || schema === void 0 ? void 0 : schema.short_desc) || (!(schema === null || schema === void 0 ? void 0 : schema.desc) && typeSentence ? noDescription_1.NO_OPTION_DESCRIPTION : undefined),
|
|
1135
|
+
typeSentence && "Takes ".concat(typeSentence, "."),
|
|
1140
1136
|
]
|
|
1141
1137
|
.filter(Boolean)
|
|
1142
1138
|
.join('\n') || undefined;
|
|
@@ -1148,7 +1144,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1148
1144
|
/* `small`, as the row's other controls are (its clear, its list, Done, its revert): it was `tiny` with a
|
|
1149
1145
|
mouse, and stood 26px high beside the open editor's 32px buttons (qorus#646). A finger had `small`
|
|
1150
1146
|
already, so a touch screen draws it as before. */
|
|
1151
|
-
size: 'small', minimal: true, flat: true, fixed: true, className: 'options-readfirst-help', "aria-label":
|
|
1147
|
+
size: 'small', minimal: true, flat: true, fixed: true, className: 'options-readfirst-help', "aria-label": "Help: ".concat(label), tooltip: 'Help', effect: { opacity: rowInks.helpOpacity }, onClick: function (event) {
|
|
1152
1148
|
event.stopPropagation();
|
|
1153
1149
|
handleOptionLabelClick(optionName);
|
|
1154
1150
|
}, onKeyDown: function (event) {
|
|
@@ -1221,10 +1217,10 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1221
1217
|
// Secondary edit actions tuck into a "More" (⋮) menu so the card header stays
|
|
1222
1218
|
// calm: Fullscreen always, plus Remove field for a removable option. Rendered
|
|
1223
1219
|
// just before the Done ✓ in both expanded layouts.
|
|
1224
|
-
var moreMenu = ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreDropdown, { className: 'options-readfirst-more', icon: 'More2Fill', flat: true, minimal: true, fixed: true, size: 'small', tooltip:
|
|
1220
|
+
var moreMenu = ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreDropdown, { className: 'options-readfirst-more', icon: 'More2Fill', flat: true, minimal: true, fixed: true, size: 'small', tooltip: 'More actions', items: __spreadArray(__spreadArray(__spreadArray([
|
|
1225
1221
|
{
|
|
1226
1222
|
// a card opened to read is viewed in full, not edited
|
|
1227
|
-
label: readOnly ?
|
|
1223
|
+
label: readOnly ? 'View fullscreen' : 'Edit fullscreen',
|
|
1228
1224
|
icon: 'FullscreenLine',
|
|
1229
1225
|
className: 'options-readfirst-fullscreen',
|
|
1230
1226
|
onClick: function () { return setFocusedEditing(optionName); },
|
|
@@ -1232,12 +1228,12 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1232
1228
|
], (removable && !hidden ?
|
|
1233
1229
|
[
|
|
1234
1230
|
{
|
|
1235
|
-
label:
|
|
1231
|
+
label: 'Remove field',
|
|
1236
1232
|
icon: 'DeleteBinLine',
|
|
1237
1233
|
intent: 'danger',
|
|
1238
1234
|
onClick: function () {
|
|
1239
1235
|
return confirmAction({
|
|
1240
|
-
title:
|
|
1236
|
+
title: 'Remove field',
|
|
1241
1237
|
onConfirm: function () { return removeSelectedOption(optionName); },
|
|
1242
1238
|
});
|
|
1243
1239
|
},
|
|
@@ -1297,7 +1293,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1297
1293
|
};
|
|
1298
1294
|
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] ?
|
|
1299
1295
|
{ minHeight: readRowHeights.current[optionName] }
|
|
1300
|
-
: undefined }, clusterHoverProps, { children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledLabelBlock, { className: 'options-readfirst-label-block', children: [(0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledRowLabel, { role: 'button', tabIndex: 0, "aria-label":
|
|
1296
|
+
: undefined }, clusterHoverProps, { children: [(0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledLabelBlock, { className: 'options-readfirst-label-block', children: [(0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledRowLabel, { role: 'button', tabIndex: 0, "aria-label": "Collapse ".concat(label), title: labelHover, "$color": cKey, "$pointer": true, onClick: collapse_1, onKeyDown: function (event) {
|
|
1301
1297
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
1302
1298
|
event.preventDefault();
|
|
1303
1299
|
collapse_1();
|
|
@@ -1365,13 +1361,13 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1365
1361
|
}), inlineOptionActions.map(function (action, index) {
|
|
1366
1362
|
return renderInjectedOptionAction(action, index);
|
|
1367
1363
|
}), editRowRevertButton, cancelEditButton, hasValue && !readOnly ?
|
|
1368
|
-
(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":
|
|
1364
|
+
(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 })
|
|
1369
1365
|
: null, moreMenu, closeExpandedFieldButton] })] }), absorbedNodes, (0, jsx_runtime_1.jsx)("div", { style: { display: 'contents' }, onKeyDown: function (event) {
|
|
1370
1366
|
if (event.key === 'Escape') {
|
|
1371
1367
|
event.stopPropagation();
|
|
1372
1368
|
cancelEdit();
|
|
1373
1369
|
}
|
|
1374
|
-
}, children: (0, jsx_runtime_1.jsxs)(FocusedEditing_1.FocusedEditing, __assign({ isFullscreen: focusedEditing === optionName, onClose: function () { return setFocusedEditing(undefined); }, description: (schema === null || schema === void 0 ? void 0 : schema.display_name) || optionName }, (readOnly ? { label:
|
|
1370
|
+
}, children: (0, jsx_runtime_1.jsxs)(FocusedEditing_1.FocusedEditing, __assign({ isFullscreen: focusedEditing === optionName, onClose: function () { return setFocusedEditing(undefined); }, description: (schema === null || schema === void 0 ? void 0 : schema.display_name) || optionName }, (readOnly ? { label: 'Focused View' } : {}), { children: [focusedEditing === optionName ?
|
|
1375
1371
|
(0, jsx_runtime_1.jsx)(Description_1.Description, { longDescription: schema === null || schema === void 0 ? void 0 : schema.desc, shortDescription: schema === null || schema === void 0 ? void 0 : schema.short_desc, longDescriptionShownByDefault: true })
|
|
1376
1372
|
: null, (0, jsx_runtime_1.jsx)(rowMenuContext_1.RowMenuContext.Provider, { value: rowMenu, children: (0, jsx_runtime_1.jsx)(pendingEdit_1.PendingEditsContext.Provider, { value: pendingEdits, children: renderOption(optionName, optionField) }) })] })) })] }, optionName));
|
|
1377
1373
|
}
|
|
@@ -1400,7 +1396,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1400
1396
|
// default-value hints, plus a read-only covered-by note (editable covered rows
|
|
1401
1397
|
// carry that in their chip instead).
|
|
1402
1398
|
var valueReasons = __spreadArray(__spreadArray([], inlineMessages, true), (empty && coveredByLabel ?
|
|
1403
|
-
[{ content:
|
|
1399
|
+
[{ content: "Covered by \u201C".concat(coveredByLabel, "\u201D"), intent: 'success' }]
|
|
1404
1400
|
: []), true);
|
|
1405
1401
|
// A hash row reveals its sub-fields as read-only sub-rows under a "view
|
|
1406
1402
|
// more" disclosure; the row itself still expands the real editor on click.
|
|
@@ -1563,7 +1559,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1563
1559
|
(schema === null || schema === void 0 ? void 0 : schema.ui_type) === 'markdown' &&
|
|
1564
1560
|
typeof (optionField === null || optionField === void 0 ? void 0 : optionField.value) === 'string' &&
|
|
1565
1561
|
isMultilineMarkdown(optionField.value)) ?
|
|
1566
|
-
|
|
1562
|
+
"".concat(optionField.value.trim().split('\n').length, " lines")
|
|
1567
1563
|
: undefined;
|
|
1568
1564
|
// the option's type beside its name, while the form shows field types: in words, as an open option says it
|
|
1569
1565
|
var typeLabel = typeShown ? typeWords : undefined;
|
|
@@ -1581,9 +1577,9 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1581
1577
|
(!!(schema === null || schema === void 0 ? void 0 : schema.disabled) ||
|
|
1582
1578
|
fieldReadonly ||
|
|
1583
1579
|
!(0, validations_1.hasAllDependenciesFullfilled)(schema === null || schema === void 0 ? void 0 : schema.depends_on, availableOptions, options || {}));
|
|
1584
|
-
var fieldDisabledReason = (schema === null || schema === void 0 ? void 0 : schema.disabled) ?
|
|
1585
|
-
: fieldReadonly ?
|
|
1586
|
-
:
|
|
1580
|
+
var fieldDisabledReason = (schema === null || schema === void 0 ? void 0 : schema.disabled) ? 'This field is disabled'
|
|
1581
|
+
: fieldReadonly ? 'Set by Qorus — not editable'
|
|
1582
|
+
: 'Disabled — dependencies are not fulfilled';
|
|
1587
1583
|
// Dependency contract: top-level entries must ALL hold; a nested array
|
|
1588
1584
|
// means ANY of its entries; `name=value` requires that exact value, and
|
|
1589
1585
|
// `name!=value` requires any other answer. Parsed by the same helper the
|
|
@@ -1602,7 +1598,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1602
1598
|
// `!name` compares against nothing — it is satisfied by the sibling
|
|
1603
1599
|
// being unanswered — so it says so, rather than going through the
|
|
1604
1600
|
// comparison template and reading `Name ≠ undefined`.
|
|
1605
|
-
label: op === '!' ?
|
|
1601
|
+
label: op === '!' ? "".concat(depLabel, " unset")
|
|
1606
1602
|
: !op ? depLabel
|
|
1607
1603
|
: "".concat(depLabel, " ").concat(op === '=' ? '=' : '≠', " ").concat(expected),
|
|
1608
1604
|
fulfilled: op === '!' ? (0, readFirst_1.isOptionValueEmpty)(depValue)
|
|
@@ -1625,20 +1621,10 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1625
1621
|
if ((0, hoveringPointer_1.isHoveringPointer)(e)) {
|
|
1626
1622
|
setHighlightedOptions(depHighlightNames);
|
|
1627
1623
|
}
|
|
1628
|
-
}, onPointerLeave: function () { return setHighlightedOptions([]); }, children: (0, jsx_runtime_1.jsx)(reqore_1.ReqoreDropdown, { className: 'options-readfirst-lock-deps', size: 'tiny', minimal: true, flat: true, compact: true, icon: 'LockLine', tooltip:
|
|
1629
|
-
{
|
|
1630
|
-
divider: true,
|
|
1631
|
-
label: feWords.unlockedBy,
|
|
1632
|
-
dividerAlign: 'left',
|
|
1633
|
-
}
|
|
1624
|
+
}, onPointerLeave: function () { return setHighlightedOptions([]); }, children: (0, jsx_runtime_1.jsx)(reqore_1.ReqoreDropdown, { className: 'options-readfirst-lock-deps', size: 'tiny', minimal: true, flat: true, compact: true, icon: 'LockLine', tooltip: 'Disabled \u2014 depends on other fields. Click to locate them.', items: __spreadArray([
|
|
1625
|
+
{ divider: true, label: 'Unlocked by:', dividerAlign: 'left' }
|
|
1634
1626
|
], dependencyEntries.flatMap(function (entry) { return __spreadArray(__spreadArray([], (Array.isArray(entry) ?
|
|
1635
|
-
[
|
|
1636
|
-
{
|
|
1637
|
-
divider: true,
|
|
1638
|
-
label: feWords.anyOf,
|
|
1639
|
-
dividerAlign: 'left',
|
|
1640
|
-
},
|
|
1641
|
-
]
|
|
1627
|
+
[{ divider: true, label: 'any of:', dividerAlign: 'left' }]
|
|
1642
1628
|
: []), true), (Array.isArray(entry) ? entry : [entry]).flatMap(function (dep) {
|
|
1643
1629
|
var info = describeDependency(dep);
|
|
1644
1630
|
return info.exists ?
|
|
@@ -1737,9 +1723,9 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1737
1723
|
to announce what it does — and "Edit X", not "X", is what it does. */
|
|
1738
1724
|
var readOnlyIsAWayIn = !!readOnly && !fieldDisabled && !readOnlyOpens && !!onReadOnlyActivate;
|
|
1739
1725
|
var actsOnClick = !readOnly || readOnlyIsAWayIn || readOnlyOpens;
|
|
1740
|
-
var row = ((0, jsx_runtime_1.jsxs)("div", __assign({ "data-field": optionName, role: actsOnClick ? 'button' : undefined, tabIndex: actsOnClick ? 0 : undefined, "aria-label": readOnlyIsAWayIn ?
|
|
1726
|
+
var row = ((0, jsx_runtime_1.jsxs)("div", __assign({ "data-field": optionName, role: actsOnClick ? 'button' : undefined, tabIndex: actsOnClick ? 0 : undefined, "aria-label": readOnlyIsAWayIn ? "Edit ".concat(label)
|
|
1741
1727
|
: readOnlyOpens ?
|
|
1742
|
-
|
|
1728
|
+
"View ".concat(label)
|
|
1743
1729
|
: readOnly ?
|
|
1744
1730
|
undefined
|
|
1745
1731
|
: label, className: "readfirst-row options-readfirst-value".concat(readOnly ? ' readfirst-row-read' : '').concat(readOnlyIsAWayIn || readOnlyOpens ? ' readfirst-row-way-in' : '').concat(readOnlyOpens ? ' readfirst-row-opens' : '').concat(hidden ? ' readfirst-row-hidden' : '').concat(fieldDisabled ? ' readfirst-row-disabled' : '').concat(isHighlighted ? ' readfirst-row-group-highlight' : '').concat(isFlashed ? ' readfirst-row-flash' : '').concat(showLabelDesc ? ' readfirst-row-info-open' : '').concat(panelMessages.length || showStructuredPreview || showCodePreview || showMarkdownPreview || showLongTextInset ? ' readfirst-row-tall' : '').concat(clusterBlockClass ? ' ' + clusterBlockClass : ''), "aria-disabled": fieldDisabled || undefined, style: readOnlyIsAWayIn || readOnlyOpens ? __assign(__assign({}, stripeStyle), { cursor: 'pointer' }) : stripeStyle, onClick: actsOnClick ? activate : undefined, onKeyDown: !actsOnClick ? undefined : (function (event) {
|
|
@@ -1892,9 +1878,9 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1892
1878
|
// that opens this menu also expands the row, which unmounts the
|
|
1893
1879
|
// menu — on touch that made the collapsed actions unreachable,
|
|
1894
1880
|
// the exact problem the collapse exists to solve.
|
|
1895
|
-
onClick: function (event) { return event.stopPropagation(); }, children: (0, jsx_runtime_1.jsx)(reqore_1.ReqoreDropdown, { className: 'options-injected-actions-menu', icon: 'MoreFill', flat: true, minimal: true, fixed: true, size: 'tiny', tooltip:
|
|
1881
|
+
onClick: function (event) { return event.stopPropagation(); }, children: (0, jsx_runtime_1.jsx)(reqore_1.ReqoreDropdown, { className: 'options-injected-actions-menu', icon: 'MoreFill', flat: true, minimal: true, fixed: true, size: 'tiny', tooltip: 'Field actions', items: injectedOptionActionMenuItems }) })
|
|
1896
1882
|
: null, (0, jsx_runtime_1.jsx)(compactRowStyles_1.StyledActionSlot, { className: 'options-readfirst-statusdot-slot', "$width": 12, children: changed && !readOnly && !hidden ?
|
|
1897
|
-
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'options-readfirst-revert', size: 'tiny', flat: true, minimal: true, compact: true, icon: 'HistoryLine', tooltip:
|
|
1883
|
+
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'options-readfirst-revert', size: 'tiny', flat: true, minimal: true, compact: true, icon: 'HistoryLine', tooltip: 'Revert changes', onClick: function (e) {
|
|
1898
1884
|
var _a;
|
|
1899
1885
|
e.stopPropagation();
|
|
1900
1886
|
handleValueChange.apply(void 0, __spreadArray([optionName], (0, argumentPresence_1.restoredFieldChange)((_a = originalValue.current) === null || _a === void 0 ? void 0 : _a[optionName]), false));
|