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