@qoretechnologies/reqraft 0.10.53 → 0.10.54-pr.115.ge2d364c
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 +25 -0
- package/.tasks/INDEX.md +1 -0
- package/.tasks/STORY_NETWORK_ISOLATION.md +98 -0
- package/README.md +1 -1
- package/design/FORM_ENGINE_EXPRESSIONS.md +110 -0
- package/design/RENDER_EXPRESSION_TRANSPORT.md +18 -0
- package/dist/components/dpqlEditor/dpqlProbe.d.ts +37 -0
- package/dist/components/dpqlEditor/dpqlProbe.d.ts.map +1 -0
- package/dist/components/dpqlEditor/dpqlProbe.js +203 -0
- package/dist/components/dpqlEditor/dpqlProbe.js.map +1 -0
- package/dist/components/dpqlEditor/index.d.ts +4 -0
- package/dist/components/dpqlEditor/index.d.ts.map +1 -1
- package/dist/components/dpqlEditor/index.js +5 -1
- package/dist/components/dpqlEditor/index.js.map +1 -1
- package/dist/components/dpqlEditor/types.d.ts +29 -2
- package/dist/components/dpqlEditor/types.d.ts.map +1 -1
- package/dist/components/dpqlEditor/useDpqlProbe.d.ts +4 -0
- package/dist/components/dpqlEditor/useDpqlProbe.d.ts.map +1 -0
- package/dist/components/dpqlEditor/useDpqlProbe.js +29 -0
- package/dist/components/dpqlEditor/useDpqlProbe.js.map +1 -0
- package/dist/components/dpqlEditor/useDpqlSession.d.ts +5 -2
- package/dist/components/dpqlEditor/useDpqlSession.d.ts.map +1 -1
- package/dist/components/dpqlEditor/useDpqlSession.js +8 -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 +186 -21
- 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 +5 -2
- package/dist/components/form/engine/CompactToolbar.js.map +1 -1
- package/dist/components/form/engine/FormEngine.d.ts +159 -11
- package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
- package/dist/components/form/engine/FormEngine.js +376 -75
- package/dist/components/form/engine/FormEngine.js.map +1 -1
- package/dist/components/form/engine/FormFieldsSkeleton.d.ts +48 -0
- package/dist/components/form/engine/FormFieldsSkeleton.d.ts.map +1 -0
- package/dist/components/form/engine/FormFieldsSkeleton.js +38 -0
- package/dist/components/form/engine/FormFieldsSkeleton.js.map +1 -0
- package/dist/components/form/engine/OptionFieldMessages.d.ts +17 -2
- package/dist/components/form/engine/OptionFieldMessages.d.ts.map +1 -1
- package/dist/components/form/engine/OptionFieldMessages.js +61 -11
- 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 +7 -1
- package/dist/components/form/engine/_structuredData/SchemaDataView.js.map +1 -1
- package/dist/components/form/engine/compactToolbarContext.d.ts +1 -0
- package/dist/components/form/engine/compactToolbarContext.d.ts.map +1 -1
- package/dist/components/form/engine/readFirst.d.ts +42 -1
- package/dist/components/form/engine/readFirst.d.ts.map +1 -1
- package/dist/components/form/engine/readFirst.js +74 -7
- package/dist/components/form/engine/readFirst.js.map +1 -1
- package/dist/components/form/engine/rendererTypes.d.ts +13 -0
- package/dist/components/form/engine/rendererTypes.d.ts.map +1 -1
- package/dist/components/form/engine/rendererTypes.js.map +1 -1
- package/dist/components/form/engine/rowMenuContext.d.ts +78 -0
- package/dist/components/form/engine/rowMenuContext.d.ts.map +1 -0
- package/dist/components/form/engine/rowMenuContext.js +103 -0
- package/dist/components/form/engine/rowMenuContext.js.map +1 -0
- package/dist/components/form/engine/typeChoices.d.ts +37 -0
- package/dist/components/form/engine/typeChoices.d.ts.map +1 -0
- package/dist/components/form/engine/typeChoices.js +25 -0
- package/dist/components/form/engine/typeChoices.js.map +1 -0
- package/dist/components/form/expressions/ExpressionField.d.ts +7 -1
- package/dist/components/form/expressions/ExpressionField.d.ts.map +1 -1
- package/dist/components/form/expressions/ExpressionField.js +181 -33
- package/dist/components/form/expressions/ExpressionField.js.map +1 -1
- package/dist/components/form/expressions/argumentPresence.d.ts +97 -0
- package/dist/components/form/expressions/argumentPresence.d.ts.map +1 -0
- package/dist/components/form/expressions/argumentPresence.js +203 -0
- package/dist/components/form/expressions/argumentPresence.js.map +1 -0
- package/dist/components/form/expressions/builder/argumentLabel.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/argumentLabel.js +9 -4
- package/dist/components/form/expressions/builder/argumentLabel.js.map +1 -1
- package/dist/components/form/expressions/builder/index.d.ts +15 -2
- package/dist/components/form/expressions/builder/index.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/index.js +19 -57
- package/dist/components/form/expressions/builder/index.js.map +1 -1
- package/dist/components/form/expressions/dpqlMockLsp.d.ts +17 -0
- package/dist/components/form/expressions/dpqlMockLsp.d.ts.map +1 -1
- package/dist/components/form/expressions/dpqlMockLsp.js +75 -9
- package/dist/components/form/expressions/dpqlMockLsp.js.map +1 -1
- package/dist/components/form/expressions/renderExpressionToText.d.ts.map +1 -1
- package/dist/components/form/expressions/renderExpressionToText.js +94 -19
- 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 +3 -1
- package/dist/components/form/fields/Field.js.map +1 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.d.ts +11 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.d.ts.map +1 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.js +14 -2
- package/dist/components/form/fields/allowed-values/AllowedValues.js.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.d.ts.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.js +13 -2
- package/dist/components/form/fields/auto/AutoFormField.js.map +1 -1
- package/dist/components/form/fields/rich-text/RichText.d.ts +11 -0
- package/dist/components/form/fields/rich-text/RichText.d.ts.map +1 -1
- package/dist/components/form/fields/rich-text/RichText.js +84 -5
- package/dist/components/form/fields/rich-text/RichText.js.map +1 -1
- package/dist/components/form/fields/template/ReadOnlyTemplateTag.d.ts +2 -1
- package/dist/components/form/fields/template/ReadOnlyTemplateTag.d.ts.map +1 -1
- package/dist/components/form/fields/template/ReadOnlyTemplateTag.js +3 -2
- package/dist/components/form/fields/template/ReadOnlyTemplateTag.js.map +1 -1
- package/dist/components/form/fields/template/TemplateField.d.ts +31 -1
- package/dist/components/form/fields/template/TemplateField.d.ts.map +1 -1
- package/dist/components/form/fields/template/TemplateField.js +507 -40
- package/dist/components/form/fields/template/TemplateField.js.map +1 -1
- package/dist/components/form/index.d.ts +1 -0
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/index.js +1 -0
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/smartEditor/__fixtures__/mockLspServer.d.ts +1 -0
- package/dist/components/smartEditor/__fixtures__/mockLspServer.d.ts.map +1 -1
- package/dist/components/smartEditor/__fixtures__/mockLspServer.js +6 -1
- package/dist/components/smartEditor/__fixtures__/mockLspServer.js.map +1 -1
- package/dist/helpers/dpqlDetection.d.ts +58 -0
- package/dist/helpers/dpqlDetection.d.ts.map +1 -0
- package/dist/helpers/dpqlDetection.js +164 -0
- package/dist/helpers/dpqlDetection.js.map +1 -0
- package/dist/helpers/optionUiTypes.d.ts +1 -1
- package/dist/helpers/options.d.ts +37 -0
- package/dist/helpers/options.d.ts.map +1 -1
- package/dist/helpers/options.js +78 -1
- package/dist/helpers/options.js.map +1 -1
- package/dist/helpers/templateItems.d.ts +47 -0
- package/dist/helpers/templateItems.d.ts.map +1 -0
- package/dist/helpers/templateItems.js +88 -0
- package/dist/helpers/templateItems.js.map +1 -0
- package/dist/helpers/templates.d.ts +21 -0
- package/dist/helpers/templates.d.ts.map +1 -1
- package/dist/helpers/templates.js +49 -3
- package/dist/helpers/templates.js.map +1 -1
- package/dist/helpers/validations.d.ts.map +1 -1
- package/dist/helpers/validations.js +56 -9
- package/dist/helpers/validations.js.map +1 -1
- package/dist/hooks/useArgSchema.d.ts +2 -1
- package/dist/hooks/useArgSchema.d.ts.map +1 -1
- package/dist/hooks/useFetch/useFetch.d.ts +3 -1
- package/dist/hooks/useFetch/useFetch.d.ts.map +1 -1
- package/dist/hooks/useFetch/useFetch.js +47 -9
- package/dist/hooks/useFetch/useFetch.js.map +1 -1
- package/dist/hooks/useTemplates.d.ts +20 -0
- package/dist/hooks/useTemplates.d.ts.map +1 -1
- package/dist/hooks/useTemplates.js +34 -2
- package/dist/hooks/useTemplates.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -1
- package/dist/index.js.map +1 -1
- package/dist/stories/storyNetwork.d.ts +36 -0
- package/dist/stories/storyNetwork.d.ts.map +1 -0
- package/dist/stories/storyNetwork.js +82 -0
- package/dist/stories/storyNetwork.js.map +1 -0
- package/dist/utils/fetch.d.ts +151 -1
- package/dist/utils/fetch.d.ts.map +1 -1
- package/dist/utils/fetch.js +256 -44
- package/dist/utils/fetch.js.map +1 -1
- package/dist/utils/lspClient.d.ts +6 -0
- package/dist/utils/lspClient.d.ts.map +1 -1
- package/dist/utils/lspClient.js +62 -11
- package/dist/utils/lspClient.js.map +1 -1
- package/dist/utils/websocket.d.ts +6 -0
- package/dist/utils/websocket.d.ts.map +1 -1
- package/dist/utils/websocket.js +15 -7
- package/dist/utils/websocket.js.map +1 -1
- package/package.json +2 -2
- package/src/components/dpqlEditor/DpqlEditor.stories.tsx +0 -2
- package/src/components/dpqlEditor/dpqlProbe.ts +165 -0
- package/src/components/dpqlEditor/index.ts +4 -0
- package/src/components/dpqlEditor/types.ts +26 -2
- package/src/components/dpqlEditor/useDpqlProbe.ts +33 -0
- package/src/components/dpqlEditor/useDpqlSession.ts +20 -4
- package/src/components/form/engine/CompactRow.tsx +231 -11
- package/src/components/form/engine/CompactToolbar.tsx +10 -3
- package/src/components/form/engine/FormEngine.stories.tsx +331 -30
- package/src/components/form/engine/FormEngine.tsx +504 -87
- package/src/components/form/engine/FormFieldsSkeleton.tsx +76 -0
- package/src/components/form/engine/OptionFieldMessages.tsx +89 -11
- package/src/components/form/engine/_structuredData/SchemaDataView.tsx +11 -0
- package/src/components/form/engine/compactToolbarContext.ts +1 -1
- package/src/components/form/engine/readFirst.ts +86 -7
- package/src/components/form/engine/rendererTypes.ts +12 -0
- package/src/components/form/engine/rowMenuContext.ts +159 -0
- package/src/components/form/engine/typeChoices.ts +55 -0
- package/src/components/form/expressions/ExpressionField.stories.tsx +828 -31
- package/src/components/form/expressions/ExpressionField.tsx +234 -29
- package/src/components/form/expressions/argumentPresence.ts +200 -0
- package/src/components/form/expressions/builder/argumentLabel.tsx +10 -4
- package/src/components/form/expressions/builder/index.tsx +31 -75
- package/src/components/form/expressions/dpqlMockLsp.ts +81 -1
- package/src/components/form/expressions/renderExpressionToText.ts +106 -17
- package/src/components/form/fields/Field.tsx +3 -2
- package/src/components/form/fields/allowed-values/AllowedValues.tsx +13 -2
- package/src/components/form/fields/auto/AutoFormField.tsx +12 -2
- package/src/components/form/fields/rich-text/RichText.tsx +112 -19
- package/src/components/form/fields/template/ReadOnlyTemplateTag.tsx +4 -2
- package/src/components/form/fields/template/TemplateField.tsx +667 -95
- package/src/components/form/index.tsx +1 -0
- package/src/components/log/Log.stories.tsx +2 -1
- package/src/components/smartEditor/__fixtures__/mockLspServer.ts +6 -1
- package/src/helpers/dpqlDetection.ts +209 -0
- package/src/helpers/options.ts +70 -0
- package/src/helpers/templateItems.ts +81 -0
- package/src/helpers/templates.ts +51 -2
- package/src/helpers/validations.ts +59 -9
- package/src/hooks/useFetch/useFetch.stories.tsx +6 -5
- package/src/hooks/useFetch/useFetch.tsx +53 -7
- package/src/hooks/useStorage/useStorage.stories.tsx +2 -1
- package/src/hooks/useTemplates.ts +41 -0
- package/src/hooks/useWebSocket/useWebsocket.stories.tsx +2 -1
- package/src/index.tsx +14 -1
- package/src/stores/currentUser/currentUser.stories.tsx +2 -1
- package/src/stories/storyNetwork.ts +92 -0
- package/src/utils/fetch.ts +311 -21
- package/src/utils/lspClient.ts +68 -11
- package/src/utils/websocket.ts +20 -9
|
@@ -3,6 +3,27 @@ export type { ISlateElement, ISlateText, TSlateNode, } from '../smartEditor/type
|
|
|
3
3
|
export interface IDpqlParseResult {
|
|
4
4
|
success: boolean;
|
|
5
5
|
expression: Record<string, any> | null;
|
|
6
|
+
/** The type the server inferred for the expression's result. */
|
|
7
|
+
inferred_type?: string;
|
|
8
|
+
/** Echo of the `target_type` the request asked about, when one was sent. */
|
|
9
|
+
target_type?: string;
|
|
10
|
+
/** `true` when the inferred type already satisfies the target. */
|
|
11
|
+
type_compatible?: boolean;
|
|
12
|
+
/** `true` when a conversion to the target exists at all. */
|
|
13
|
+
auto_coercible?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* `true` when that conversion is only ATTEMPTED, not guaranteed — text used
|
|
16
|
+
* as a number, whose outcome depends on what the text turns out to hold.
|
|
17
|
+
* A total conversion (a number used as text) reports `false`, and the server
|
|
18
|
+
* emits no diagnostic for it: warning about something that cannot fail
|
|
19
|
+
* teaches authors to ignore the warnings that can.
|
|
20
|
+
*/
|
|
21
|
+
coercion_may_fail?: boolean;
|
|
22
|
+
/** The conversion that would make the expression fit, when one would. */
|
|
23
|
+
suggested_fix?: {
|
|
24
|
+
text: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
};
|
|
6
27
|
diagnostics: Array<{
|
|
7
28
|
range: {
|
|
8
29
|
start: {
|
|
@@ -158,8 +179,14 @@ export interface IDpqlEditorRef {
|
|
|
158
179
|
message: string;
|
|
159
180
|
}>;
|
|
160
181
|
}>;
|
|
161
|
-
/**
|
|
162
|
-
|
|
182
|
+
/**
|
|
183
|
+
* Parse DPQL text into an expression AST via `dpql/parse`.
|
|
184
|
+
*
|
|
185
|
+
* `targetType` asks the server, in the same round trip, whether the
|
|
186
|
+
* expression's result can satisfy that type — see `coercion_may_fail` on
|
|
187
|
+
* the result. Omit it to ask only whether the text parses.
|
|
188
|
+
*/
|
|
189
|
+
parse: (text: string, targetType?: string) => Promise<IDpqlParseResult>;
|
|
163
190
|
/** Serialize an expression AST back to DPQL text via `dpql/serialize`. */
|
|
164
191
|
serialize: (expression: Record<string, any>) => Promise<string>;
|
|
165
192
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/dpqlEditor/types.ts"],"names":[],"mappings":"AAKA,YAAY,EACV,aAAa,EACb,UAAU,EACV,UAAU,GACX,MAAM,sBAAsB,CAAC;AAE9B,0EAA0E;AAC1E,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACvC,WAAW,EAAE,KAAK,CAAC;QACjB,KAAK,EAAE;YACL,KAAK,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAC;gBAAC,SAAS,EAAE,MAAM,CAAA;aAAE,CAAC;YAC3C,GAAG,EAAE;gBAAE,IAAI,EAAE,MAAM,CAAC;gBAAC,SAAS,EAAE,MAAM,CAAA;aAAE,CAAC;SAC1C,CAAC;QACF,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACvB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,gBAAgB;IAC/B,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,OAAO,CAAC,EA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(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useDpqlProbe = void 0;
|
|
4
|
+
// Copyright 2026 Qore Technologies, s.r.o.
|
|
5
|
+
// React access to the shared DPQL detection probe (`dpqlProbe`). The hook
|
|
6
|
+
// itself opens nothing: a field becomes a consumer of the shared document
|
|
7
|
+
// only once it actually asks a question, and stops being one when it
|
|
8
|
+
// unmounts. A form full of fields that never see expression-shaped text
|
|
9
|
+
// therefore never opens the document at all.
|
|
10
|
+
var react_1 = require("react");
|
|
11
|
+
var dpqlProbe_1 = require("./dpqlProbe");
|
|
12
|
+
var useDpqlProbe = function () {
|
|
13
|
+
var acquired = (0, react_1.useRef)(false);
|
|
14
|
+
(0, react_1.useEffect)(function () { return function () {
|
|
15
|
+
if (acquired.current) {
|
|
16
|
+
acquired.current = false;
|
|
17
|
+
dpqlProbe_1.dpqlProbe.release();
|
|
18
|
+
}
|
|
19
|
+
}; }, []);
|
|
20
|
+
return (0, react_1.useCallback)(function (text) {
|
|
21
|
+
if (!acquired.current) {
|
|
22
|
+
acquired.current = true;
|
|
23
|
+
dpqlProbe_1.dpqlProbe.acquire();
|
|
24
|
+
}
|
|
25
|
+
return dpqlProbe_1.dpqlProbe.parse(text);
|
|
26
|
+
}, []);
|
|
27
|
+
};
|
|
28
|
+
exports.useDpqlProbe = useDpqlProbe;
|
|
29
|
+
//# sourceMappingURL=useDpqlProbe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDpqlProbe.js","sourceRoot":"","sources":["../../../src/components/dpqlEditor/useDpqlProbe.ts"],"names":[],"mappings":";;;AAAA,2CAA2C;AAC3C,0EAA0E;AAC1E,0EAA0E;AAC1E,qEAAqE;AACrE,wEAAwE;AACxE,6CAA6C;AAC7C,+BAAuD;AACvD,yCAA0D;AAInD,IAAM,YAAY,GAAG;IAC1B,IAAM,QAAQ,GAAG,IAAA,cAAM,EAAC,KAAK,CAAC,CAAC;IAE/B,IAAA,iBAAS,EACP,cAAM,OAAA;QACJ,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;YACrB,QAAQ,CAAC,OAAO,GAAG,KAAK,CAAC;YACzB,qBAAS,CAAC,OAAO,EAAE,CAAC;QACtB,CAAC;IACH,CAAC,EALK,CAKL,EACD,EAAE,CACH,CAAC;IAEF,OAAO,IAAA,mBAAW,EAAC,UAAC,IAAY;QAC9B,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACtB,QAAQ,CAAC,OAAO,GAAG,IAAI,CAAC;YACxB,qBAAS,CAAC,OAAO,EAAE,CAAC;QACtB,CAAC;QAED,OAAO,qBAAS,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC,CAAC;AArBW,QAAA,YAAY,gBAqBvB"}
|
|
@@ -41,8 +41,11 @@ export interface IUseDpqlSessionResult {
|
|
|
41
41
|
fieldMeta: Record<string, IDpqlFieldMeta>;
|
|
42
42
|
/** Most recent `publishDiagnostics`. */
|
|
43
43
|
diagnostics: ILspDiagnostic[];
|
|
44
|
-
/**
|
|
45
|
-
|
|
44
|
+
/**
|
|
45
|
+
* `dpql/parse` — DPQL text → expression AST, and, when `targetType` is
|
|
46
|
+
* given, whether that result can satisfy the type the field declares.
|
|
47
|
+
*/
|
|
48
|
+
parse: (text: string, targetType?: string) => Promise<IDpqlParseResult>;
|
|
46
49
|
/** `dpql/serialize` — expression AST → DPQL text. */
|
|
47
50
|
serialize: (expression: Record<string, any>) => Promise<string>;
|
|
48
51
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDpqlSession.d.ts","sourceRoot":"","sources":["../../../src/components/dpqlEditor/useDpqlSession.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAiB,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AACnF,OAAO,EAAE,gBAAgB,EAAE,eAAe,EAAE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AAqB,CA6UvB"}
|
|
@@ -294,7 +294,7 @@ function useDpqlSession(opts) {
|
|
|
294
294
|
// preserves every function reference; only this one field is
|
|
295
295
|
// overridden.
|
|
296
296
|
var wrappedSession = (0, react_1.useMemo)(function () { return (__assign(__assign({}, session), { isContextReady: isContextBound })); }, [session, isContextBound]);
|
|
297
|
-
var parse = (0, react_1.useCallback)(function (text) { return __awaiter(_this, void 0, void 0, function () {
|
|
297
|
+
var parse = (0, react_1.useCallback)(function (text, targetType) { return __awaiter(_this, void 0, void 0, function () {
|
|
298
298
|
var result, _a;
|
|
299
299
|
var _b, _c, _d;
|
|
300
300
|
return __generator(this, function (_e) {
|
|
@@ -306,12 +306,18 @@ function useDpqlSession(opts) {
|
|
|
306
306
|
_e.label = 1;
|
|
307
307
|
case 1:
|
|
308
308
|
_e.trys.push([1, 3, , 4]);
|
|
309
|
-
return [4 /*yield*/, session.client.customRequest('dpql/parse', { uri: session.uri, text: text })];
|
|
309
|
+
return [4 /*yield*/, session.client.customRequest('dpql/parse', __assign({ uri: session.uri, text: text }, (targetType ? { target_type: targetType } : {})))];
|
|
310
310
|
case 2:
|
|
311
311
|
result = _e.sent();
|
|
312
312
|
return [2 /*return*/, {
|
|
313
313
|
success: (_b = result === null || result === void 0 ? void 0 : result.success) !== null && _b !== void 0 ? _b : false,
|
|
314
314
|
expression: (_c = result === null || result === void 0 ? void 0 : result.expression) !== null && _c !== void 0 ? _c : null,
|
|
315
|
+
inferred_type: result === null || result === void 0 ? void 0 : result.inferred_type,
|
|
316
|
+
target_type: result === null || result === void 0 ? void 0 : result.target_type,
|
|
317
|
+
type_compatible: result === null || result === void 0 ? void 0 : result.type_compatible,
|
|
318
|
+
auto_coercible: result === null || result === void 0 ? void 0 : result.auto_coercible,
|
|
319
|
+
coercion_may_fail: result === null || result === void 0 ? void 0 : result.coercion_may_fail,
|
|
320
|
+
suggested_fix: result === null || result === void 0 ? void 0 : result.suggested_fix,
|
|
315
321
|
diagnostics: (_d = result === null || result === void 0 ? void 0 : result.diagnostics) !== null && _d !== void 0 ? _d : [],
|
|
316
322
|
}];
|
|
317
323
|
case 3:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDpqlSession.js","sourceRoot":"","sources":["../../../src/components/dpqlEditor/useDpqlSession.ts"],"names":[],"mappings":";AAAA,2CAA2C;AAC3C,qEAAqE;AACrE,wEAAwE;AACxE,wEAAwE;AACxE,2EAA2E;AAC3E,yEAAyE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzE,+BAA0E;AAE1E,8DAAmF;
|
|
1
|
+
{"version":3,"file":"useDpqlSession.js","sourceRoot":"","sources":["../../../src/components/dpqlEditor/useDpqlSession.ts"],"names":[],"mappings":";AAAA,2CAA2C;AAC3C,qEAAqE;AACrE,wEAAwE;AACxE,wEAAwE;AACxE,2EAA2E;AAC3E,yEAAyE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEzE,+BAA0E;AAE1E,8DAAmF;AAyDnF,SAAgB,cAAc,CAC5B,IAA4B;IAD9B,iBA+UC;IA3UG,IAAA,QAAQ,GAON,IAAI,SAPE,EACR,UAAU,GAMR,IAAI,WANI,EACD,UAAU,GAKjB,IAAI,QALa,EACnB,UAAU,GAIR,IAAI,WAJI,EACV,KAGE,IAAI,YAHU,EAAhB,WAAW,mBAAG,EAAE,KAAA,EAChB,KAEE,IAAI,oBAFqB,EAA3B,mBAAmB,mBAAG,KAAK,KAAA,EAC3B,UAAU,GACR,IAAI,WADI,CACH;IAET,4DAA4D;IAC5D,qEAAqE;IACrE,qEAAqE;IACrE,sBAAsB;IACtB,IAAM,oBAAoB,GACxB,OAAO,CAAC,QAAQ,IAAI,UAAU,CAAC,IAAI,CAAC,mBAAmB,CAAC;IAE1D,IAAM,eAAe,GAAG,CAAC;QACvB,IAAM,CAAC,GAAwB,EAAE,CAAC;QAClC,IAAI,mBAAmB,EAAE,CAAC;Y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B,EAAE,CAAC,EAAE,EAAC;oBACtE,CAAC;;;;oBAEgB,qBAAM,OAAO,CAAC,MAAM,CAAC,aAAa,CAE9C,eAAe,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,EAAA;;oBAFnC,MAAM,GAAG,SAE0B;oBACnC,KAAK,GAAG,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,WAAW,mCAAI,EAAE,CAAC;oBACxC,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;wBACrB,sBAAO;gCACL,KAAK,EAAE,KAAK;gCACZ,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,UAAC,CAAC,IAAK,OAAA,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,EAAxB,CAAwB,CAAC;6BACnD,EAAC;oBACJ,CAAC;oBACD,sBAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAC;;;oBAEvB,sBAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,2BAA2B,EAAE,CAAC,EAAE,EAAC;;;;SAE/E,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;IAElC,OAAO;QACL,OAAO,EAAE,cAAc;QACvB,SAAS,WAAA;QACT,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,KAAK,OAAA;QACL,SAAS,WAAA;QACT,QAAQ,UAAA;KACT,CAAC;AACJ,CAAC;AA/UD,wCA+UC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompactRow.d.ts","sourceRoot":"","sources":["../../../../src/components/form/engine/CompactRow.tsx"],"names":[],"mappings":"
|
|
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;AA2HpC;;;;;;;;;;;;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,6CAuvEF,CAAC"}
|
|
@@ -96,6 +96,7 @@ 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
98
|
var reqore_1 = require("@qoretechnologies/reqore");
|
|
99
|
+
var rowMenuContext_1 = require("./rowMenuContext");
|
|
99
100
|
var optionActions_1 = require("./optionActions");
|
|
100
101
|
var flatten_1 = __importDefault(require("lodash/flatten"));
|
|
101
102
|
var isEqual_1 = __importDefault(require("lodash/isEqual"));
|
|
@@ -199,8 +200,8 @@ var richtextItemText = function (item) {
|
|
|
199
200
|
exports.richtextItemText = richtextItemText;
|
|
200
201
|
exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
201
202
|
var _b;
|
|
202
|
-
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
203
|
-
var optionName = _a.optionName, optionField = _a.optionField,
|
|
203
|
+
var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
204
|
+
var optionName = _a.optionName, optionField = _a.optionField, _q = _a.hidden, hidden = _q === void 0 ? false : _q, _r = _a.clustered, clustered = _r === void 0 ? false : _r, _s = _a.clusterFirst, clusterFirst = _s === void 0 ? false : _s, _t = _a.clusterLast, clusterLast = _t === void 0 ? false : _t, absorbedFields = _a.absorbedFields;
|
|
204
205
|
var readOnly = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.readOnly; });
|
|
205
206
|
var commitMode = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.commitMode; });
|
|
206
207
|
var options = (0, use_context_selector_1.useContextSelector)(compactRowContext_1.CompactRowContext, function (v) { return v.options; });
|
|
@@ -283,12 +284,34 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
283
284
|
// summary you click to open. A read-only row is the only rendering the
|
|
284
285
|
// value gets, so it wraps.
|
|
285
286
|
full) {
|
|
287
|
+
var _a;
|
|
286
288
|
if (full === void 0) { full = false; }
|
|
287
289
|
var valueType = (0, readFirst_1.getValueType)(field, schema);
|
|
288
290
|
var wrapStyle = __assign({ display: 'inline-flex', alignItems: 'center', gap: 6, minWidth: 0, maxWidth: '100%' }, (full ? { flexWrap: 'wrap' } : {}));
|
|
289
291
|
var textStyle = full ?
|
|
290
292
|
{ whiteSpace: 'pre-wrap', overflowWrap: 'anywhere' }
|
|
291
293
|
: { overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' };
|
|
294
|
+
/* A row has to SAY when its value is an expression.
|
|
295
|
+
|
|
296
|
+
Reported from the live IDE: an author accepted the *Use as expression*
|
|
297
|
+
offer on one field and not on the other, and the two rows read exactly
|
|
298
|
+
the same - `1 + 2` and `2 + 1`, both plain text - so there was no way
|
|
299
|
+
to tell which had been converted. The assertion then compared the
|
|
300
|
+
string `"1 + 2"` against the number `3` and the author had no way to
|
|
301
|
+
see why.
|
|
302
|
+
|
|
303
|
+
The same Σ the expression editor uses, so the mark means the same thing
|
|
304
|
+
wherever it appears. */
|
|
305
|
+
var withExpressionMarker = function (rendered) {
|
|
306
|
+
if (!(field === null || field === void 0 ? void 0 : field.is_expression)) {
|
|
307
|
+
return rendered;
|
|
308
|
+
}
|
|
309
|
+
return ((0, jsx_runtime_1.jsxs)("span", { style: __assign(__assign({}, wrapStyle), { gap: 4 }), children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: 'Functions', size: 'tiny',
|
|
310
|
+
/* A stable hook: reqore renders every icon as a bare
|
|
311
|
+
`.reqore-icon`, so without this there is nothing to select the
|
|
312
|
+
mark by — in a test or in a consumer's stylesheet. */
|
|
313
|
+
className: 'reqraft-expression-marker', style: { flexShrink: 0, opacity: 0.7 }, tooltip: 'This value is an expression' }), rendered] }));
|
|
314
|
+
};
|
|
292
315
|
if (valueType === 'rgbcolor') {
|
|
293
316
|
var swatch = (0, readFirst_1.colorToCss)(field === null || field === void 0 ? void 0 : field.value);
|
|
294
317
|
return ((0, jsx_runtime_1.jsxs)("span", { style: swatch ? __assign(__assign({}, wrapStyle), {
|
|
@@ -307,6 +330,34 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
307
330
|
var truthy = (field === null || field === void 0 ? void 0 : field.value) === true || (field === null || field === void 0 ? void 0 : field.value) === 'true';
|
|
308
331
|
return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { size: 'small', minimal: true, intent: truthy ? 'success' : 'danger', label: formatted }));
|
|
309
332
|
}
|
|
333
|
+
// A test's cases read as CHIPS here, the same as the names in the table
|
|
334
|
+
// this row opens (`CasesTable`, qorus-ide). `test-cases` is a
|
|
335
|
+
// renderer-only ui_type, so it reached none of the branches above and
|
|
336
|
+
// fell through to the generic summary, which flattens the array of case
|
|
337
|
+
// hashes to a comma-joined string — "case_1, resolved_expected_values".
|
|
338
|
+
// A case name is an identifier the author types into `$.` references and
|
|
339
|
+
// skip conditions, and a chip is how the rest of the product writes an
|
|
340
|
+
// identifier down; the table already agreed, so the collapsed row was the
|
|
341
|
+
// only surface still printing them as prose.
|
|
342
|
+
//
|
|
343
|
+
// `intent` is a FILL, which is what a tag is — the hazard the other
|
|
344
|
+
// branches warn about is only ever using an intent as a TEXT colour.
|
|
345
|
+
//
|
|
346
|
+
// Falls through to the plain summary unless EVERY entry yields a name: a
|
|
347
|
+
// partly-chipped row would read as though the unnamed cases were missing.
|
|
348
|
+
if (valueType === 'test-cases' && Array.isArray(field === null || field === void 0 ? void 0 : field.value)) {
|
|
349
|
+
var caseNames = field.value.map(function (item) {
|
|
350
|
+
var name = item === null || item === void 0 ? void 0 : item.name;
|
|
351
|
+
return typeof name === 'string' ? name.trim() : '';
|
|
352
|
+
});
|
|
353
|
+
if (caseNames.length > 0 && caseNames.every(function (name) { return name !== ''; })) {
|
|
354
|
+
return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreControlGroup, { gapSize: 'tiny', verticalAlign: 'center',
|
|
355
|
+
// An editable row is ONE line: further chips clip with the row
|
|
356
|
+
// instead of growing it. A read-only row is the only rendering
|
|
357
|
+
// the value gets, so it wraps and shows every case.
|
|
358
|
+
wrap: full, style: full ? undefined : { minWidth: 0, overflow: 'hidden' }, children: caseNames.map(function (name, index) { return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, { className: 'options-readfirst-case-tag', size: 'small', minimal: true, intent: 'info', label: name }, "".concat(name, "-").concat(index))); }) }));
|
|
359
|
+
}
|
|
360
|
+
}
|
|
310
361
|
// Code-editor read summary: replace the truncated string with a chip
|
|
311
362
|
// showing line count + character count. The actual code renders below
|
|
312
363
|
// the row as a monospace `<pre>` inside a `ReqoreCollapsibleContent` —
|
|
@@ -350,13 +401,32 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
350
401
|
if (allowedImage) {
|
|
351
402
|
return ((0, jsx_runtime_1.jsxs)("span", { style: wrapStyle, children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { image: allowedImage, size: '16px', style: { flexShrink: 0 } }), (0, jsx_runtime_1.jsx)("span", { style: textStyle, children: formatted })] }));
|
|
352
403
|
}
|
|
404
|
+
// The same, for an option whose mark is an ICON rather than a logo. Only
|
|
405
|
+
// images were drawn here, so a list whose entries are told apart by their
|
|
406
|
+
// icon — every interface kind is a bare word, `Service`, `Job`, `Qog` —
|
|
407
|
+
// showed the mark while choosing and lost it the moment the row went
|
|
408
|
+
// read-only, which is where a reader spends most of their time.
|
|
409
|
+
var allowedIcon = (0, readFirst_1.getAllowedValueIcon)(field === null || field === void 0 ? void 0 : field.value, schema);
|
|
410
|
+
if (allowedIcon) {
|
|
411
|
+
return ((0, jsx_runtime_1.jsxs)("span", { style: wrapStyle, children: [(0, jsx_runtime_1.jsx)(reqore_1.ReqoreIcon, { icon: allowedIcon, size: '16px', style: { flexShrink: 0 } }), (0, jsx_runtime_1.jsx)("span", { style: textStyle, children: formatted })] }));
|
|
412
|
+
}
|
|
353
413
|
// Template value ($local:…): the read-only template picker — the SAME chip
|
|
354
414
|
// TemplateField renders when disabled, so a template reads identically here
|
|
355
415
|
// and in the editor (qorus-ide intent scheme: info / qorus purple).
|
|
416
|
+
//
|
|
417
|
+
// A field may also declare templates OF ITS OWN, and a value drawn from
|
|
418
|
+
// that list is just as much a template even when it does not look like
|
|
419
|
+
// `$name:key` — `isValueTemplate` is a guess at the shape of the built-in
|
|
420
|
+
// grammar, and a host's own grammar (a Qorus test's `$.order.id`) fails it.
|
|
421
|
+
// Asking the field's list whether it CONTAINS the value settles it without
|
|
422
|
+
// guessing at syntax, and hands back the entry whose label the chip prints,
|
|
423
|
+
// so a reference reads as the name it was chosen by here as well as in the
|
|
424
|
+
// editor rather than as a raw path.
|
|
425
|
+
var ownTemplates = (_a = schema === null || schema === void 0 ? void 0 : schema.templates) !== null && _a !== void 0 ? _a : templates;
|
|
356
426
|
if (typeof (field === null || field === void 0 ? void 0 : field.value) === 'string' &&
|
|
357
427
|
!field.is_expression &&
|
|
358
|
-
(0, templates_1.isValueTemplate)(field.value)) {
|
|
359
|
-
return (0, jsx_runtime_1.jsx)(ReadOnlyTemplateTag_1.ReadOnlyTemplateTag, { value: field.value, templates:
|
|
428
|
+
((0, templates_1.isValueTemplate)(field.value) || !!(0, templates_1.findTemplate)(ownTemplates !== null && ownTemplates !== void 0 ? ownTemplates : {}, field.value))) {
|
|
429
|
+
return (0, jsx_runtime_1.jsx)(ReadOnlyTemplateTag_1.ReadOnlyTemplateTag, { value: field.value, templates: ownTemplates, size: 'small' });
|
|
360
430
|
}
|
|
361
431
|
// A LIST whose elements are rich-text envelopes is a list of strings, so it
|
|
362
432
|
// reads as those strings. Without this the row fell through to the generic
|
|
@@ -385,7 +455,10 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
385
455
|
// the chips visibly float above the words. Inheriting the row's
|
|
386
456
|
// size makes centring align the baselines too, at whatever font
|
|
387
457
|
// size the consuming app uses.
|
|
388
|
-
style: { fontSize: 'inherit' }, icon: 'ExchangeDollarLine', label: segment.text || segment.value,
|
|
458
|
+
style: { fontSize: 'inherit' }, icon: 'ExchangeDollarLine', label: segment.text || segment.value,
|
|
459
|
+
// The same card the chosen-template chip shows: what the
|
|
460
|
+
// value IS, not the reference that names it.
|
|
461
|
+
tooltip: (0, templates_1.templateTooltip)(templates, segment.value) }, (0, templates_1.getTemplateTagStyle)((_a = (templates ? (0, templates_1.findTemplate)(templates, segment.value || '') : undefined)) === null || _a === void 0 ? void 0 : _a.metadata)), index)
|
|
389
462
|
: (0, jsx_runtime_1.jsx)("span", { style: { whiteSpace: full ? 'pre-wrap' : 'pre' }, children: full ? segment.text : collapseSummaryBreaks(segment.text) }, index);
|
|
390
463
|
}) }));
|
|
391
464
|
}
|
|
@@ -406,7 +479,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
406
479
|
return segment.kind === 'token' ? __assign(__assign({}, segment), (0, templates_1.describeTemplateReference)(templates, segment.text)) : segment;
|
|
407
480
|
});
|
|
408
481
|
if (named.some(function (segment) { return segment.kind === 'token'; })) {
|
|
409
|
-
return ((0, jsx_runtime_1.jsx)("span", { style: __assign(__assign({}, wrapStyle), { gap: 4, overflow: 'hidden' }), children: named.map(function (segment, index) {
|
|
482
|
+
return withExpressionMarker((0, jsx_runtime_1.jsx)("span", { style: __assign(__assign({}, wrapStyle), { gap: 4, overflow: 'hidden' }), children: named.map(function (segment, index) {
|
|
410
483
|
var _a;
|
|
411
484
|
return segment.kind === 'token' ?
|
|
412
485
|
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreTag, __assign({ size: 'tiny',
|
|
@@ -417,7 +490,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
417
490
|
}) }));
|
|
418
491
|
}
|
|
419
492
|
}
|
|
420
|
-
return full ? (0, jsx_runtime_1.jsx)("span", { style: textStyle, children: formatted }) : formatted;
|
|
493
|
+
return withExpressionMarker(full ? (0, jsx_runtime_1.jsx)("span", { style: textStyle, children: formatted }) : formatted);
|
|
421
494
|
};
|
|
422
495
|
var schema = options === null || options === void 0 ? void 0 : options[optionName];
|
|
423
496
|
var label = (schema === null || schema === void 0 ? void 0 : schema.display_name) || optionName;
|
|
@@ -435,14 +508,14 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
435
508
|
// hover-gated button is unreachable without a hover — and anything past the
|
|
436
509
|
// inline cap overflows regardless, so a consumer injecting ten actions can
|
|
437
510
|
// never push the row's value out of view.
|
|
438
|
-
var
|
|
511
|
+
var _u = react_1.default.useMemo(function () {
|
|
439
512
|
return collapseOptionActions ?
|
|
440
513
|
[[], injectedOptionActions]
|
|
441
514
|
: [
|
|
442
515
|
injectedOptionActions.slice(0, MAX_INLINE_OPTION_ACTIONS),
|
|
443
516
|
injectedOptionActions.slice(MAX_INLINE_OPTION_ACTIONS),
|
|
444
517
|
];
|
|
445
|
-
}, [collapseOptionActions, injectedOptionActions]), inlineOptionActions =
|
|
518
|
+
}, [collapseOptionActions, injectedOptionActions]), inlineOptionActions = _u[0], menuOptionActions = _u[1];
|
|
446
519
|
var injectedOptionActionMenuItems = react_1.default.useMemo(function () {
|
|
447
520
|
return menuOptionActions.map(function (action, index) {
|
|
448
521
|
var _a, _b;
|
|
@@ -486,7 +559,22 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
486
559
|
var changed = !hidden && !readOnly && hasOptionChanged(optionField === null || optionField === void 0 ? void 0 : optionField.value, optionName);
|
|
487
560
|
// "Has a value" = set to anything non-empty. Drives the edit-row Clear
|
|
488
561
|
// button and the cluster node's filled state (see `memberSet`).
|
|
489
|
-
|
|
562
|
+
/* "Is there anything to clear?" — this predicate has exactly one job, and
|
|
563
|
+
both of its uses are the Clear-value button.
|
|
564
|
+
|
|
565
|
+
An empty list is not a value. `[]` is neither `undefined`, `null` nor `''`,
|
|
566
|
+
so a field whose last item had just been removed went on offering to clear
|
|
567
|
+
it, and the confirmation asked whether to clear nothing. A test's cases
|
|
568
|
+
table is where this shows: delete the last case and a red clear-all sat
|
|
569
|
+
above an empty table, guarding a no-op.
|
|
570
|
+
|
|
571
|
+
Deliberately arrays only. An empty hash is arguable — "present but empty"
|
|
572
|
+
can be a real state for a hash — and nothing has demonstrated the same
|
|
573
|
+
defect there, so widening this predicate would be a guess. */
|
|
574
|
+
var hasValue = (optionField === null || optionField === void 0 ? void 0 : optionField.value) !== undefined &&
|
|
575
|
+
(optionField === null || optionField === void 0 ? void 0 : optionField.value) !== null &&
|
|
576
|
+
(optionField === null || optionField === void 0 ? void 0 : optionField.value) !== '' &&
|
|
577
|
+
!(Array.isArray(optionField.value) && optionField.value.length === 0);
|
|
490
578
|
// Required-group membership shows a PERSISTENT chip on every member: amber
|
|
491
579
|
// "One of" while the group is unmet (tap → flash siblings), then a muted-green
|
|
492
580
|
// resolution once satisfied — "Covers" on the field that satisfied it,
|
|
@@ -531,7 +619,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
531
619
|
: (schema === null || schema === void 0 ? void 0 : schema.ui_type) || (schema === null || schema === void 0 ? void 0 : schema.type))) !== null && _d !== void 0 ? _d : '';
|
|
532
620
|
// Scalars edit in place inside the row; complex fields (tall or nested
|
|
533
621
|
// editors) still open the expanded card below.
|
|
534
|
-
var
|
|
622
|
+
var inlineEditableNow = !readOnly &&
|
|
535
623
|
!(schema === null || schema === void 0 ? void 0 : schema.arg_schema) &&
|
|
536
624
|
!(operators && (0, size_1.default)(operators)) &&
|
|
537
625
|
// Expression fields open the builder/DPQL editor — too tall for inline.
|
|
@@ -539,6 +627,43 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
539
627
|
// A choice with per-option logos (e.g. language) reads better collapsed.
|
|
540
628
|
!(0, readFirst_1.optionHasImages)(schema) &&
|
|
541
629
|
!COMPACT_COMPLEX_TYPES.has(editType);
|
|
630
|
+
/* Which of the two editors a row gets is settled when the row OPENS.
|
|
631
|
+
*
|
|
632
|
+
* Every term above reads the VALUE or a schema derived from it, so the
|
|
633
|
+
* answer can change while the author is inside the control — and the two
|
|
634
|
+
* branches are different subtrees, so a changed answer does not restyle
|
|
635
|
+
* the editor, it unmounts one and mounts the other. Everything the old one
|
|
636
|
+
* held goes with it: what was typed, the caret, and any state the editor
|
|
637
|
+
* keeps about how it was entered.
|
|
638
|
+
*
|
|
639
|
+
* `is_expression` is the term that actually fires, and it fires on the one
|
|
640
|
+
* interaction that exists to keep the author where they are: accepting
|
|
641
|
+
* "Use as expression" is the moment the value becomes an expression, and
|
|
642
|
+
* the expression shell opens on its Text view precisely because the author
|
|
643
|
+
* has just written the expression as text. The remount discarded that and
|
|
644
|
+
* dropped them into the visual builder, so the sentence they had typed was
|
|
645
|
+
* nowhere on screen. Clicking Text then appeared to work and bounced back,
|
|
646
|
+
* because the next value change remounted the row again.
|
|
647
|
+
*
|
|
648
|
+
* So the row keeps the editor it opened with for as long as it is open,
|
|
649
|
+
* and asks the question again when it is next opened — the same trade
|
|
650
|
+
* `editEntryValue` above makes for a different reason, and the one
|
|
651
|
+
* qorus-ide's `referenceEditorLatch` makes for this exact one. A field that
|
|
652
|
+
* already holds an expression when it is opened still gets the card; it is
|
|
653
|
+
* only a field that BECOMES one under the author that stays put.
|
|
654
|
+
*
|
|
655
|
+
* Held in a ref and settled during render rather than in an effect: an
|
|
656
|
+
* effect lands one render late, and one render late is a visible flash of
|
|
657
|
+
* the wrong editor — which is the thing being fixed.
|
|
658
|
+
*/
|
|
659
|
+
var inlineEditableLatch = react_1.default.useRef(undefined);
|
|
660
|
+
if (!isExpanded) {
|
|
661
|
+
inlineEditableLatch.current = undefined;
|
|
662
|
+
}
|
|
663
|
+
else if (inlineEditableLatch.current === undefined) {
|
|
664
|
+
inlineEditableLatch.current = inlineEditableNow;
|
|
665
|
+
}
|
|
666
|
+
var inlineEditable = isExpanded ? !!inlineEditableLatch.current : inlineEditableNow;
|
|
542
667
|
// Auto-focus the editor's first input when a field is opened, so you can type
|
|
543
668
|
// straight away (matches the prototype's tap-to-edit feel).
|
|
544
669
|
var editorRef = react_1.default.useRef(null);
|
|
@@ -604,7 +729,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
604
729
|
// below an early return, so a hook placed there would run conditionally.
|
|
605
730
|
var rawArgSchema = schema === null || schema === void 0 ? void 0 : schema.arg_schema;
|
|
606
731
|
var argSchemaId = typeof rawArgSchema === 'string' ? rawArgSchema : undefined;
|
|
607
|
-
var
|
|
732
|
+
var _v = react_1.default.useState(undefined), resolvedArgSchema = _v[0], setResolvedArgSchema = _v[1];
|
|
608
733
|
// Only worth a request when there is a described value to preview: a row whose
|
|
609
734
|
// value is unset or scalar renders no inset, so fetching its schema would buy
|
|
610
735
|
// a round trip per row and show nothing. `query` caches GETs, so rows sharing
|
|
@@ -786,7 +911,22 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
786
911
|
// stacks children flush, and the class rule that used to carry a 4px gap
|
|
787
912
|
// never reached this element at all — which is why two messages read as one
|
|
788
913
|
// two-tone block with no space between them.
|
|
789
|
-
|
|
914
|
+
/* A message is PROSE, so it is drawn by the host's prose renderer.
|
|
915
|
+
|
|
916
|
+
`markdownRendererContext` says this package renders markdown "in exactly
|
|
917
|
+
one place — a field's description". That was one place short: a schema
|
|
918
|
+
message is written by the same author, in the same dialect, and it landed
|
|
919
|
+
here as a raw string. A Qorus warning reading "Give that step a **Fixture
|
|
920
|
+
Output**" showed the asterisks, and every reference inside it stayed a raw
|
|
921
|
+
`$.` path where the editor two lines above renders it as a named chip.
|
|
922
|
+
|
|
923
|
+
`compact` for the same reason the row inset asks for it: this is a strip
|
|
924
|
+
inside a row, never a page, and markdown authored as a document opens with
|
|
925
|
+
a heading that would outgrow the field label above it. Without a host
|
|
926
|
+
renderer the string is drawn as it always was. */
|
|
927
|
+
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' ?
|
|
928
|
+
markdownRenderer({ value: m.content, compact: true })
|
|
929
|
+
: m.content }, "".concat(m.content, "-").concat(index))); };
|
|
790
930
|
var reasonColor = function (intent) {
|
|
791
931
|
var _a;
|
|
792
932
|
return intent === 'danger' ? cDanger
|
|
@@ -817,10 +957,12 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
817
957
|
onMouseLeave: function () { return setHighlightedOptions([]); },
|
|
818
958
|
}
|
|
819
959
|
: {};
|
|
960
|
+
// Items the EDITOR inside this row published — see `rowMenuContext`.
|
|
961
|
+
var _w = (0, rowMenuContext_1.useRowMenuRegistry)(), rowMenu = _w.rowMenu, editorMenuItems = _w.items;
|
|
820
962
|
// Secondary edit actions tuck into a "More" (⋮) menu so the card header stays
|
|
821
963
|
// calm: Fullscreen always, plus Remove field for a removable option. Rendered
|
|
822
964
|
// just before the Done ✓ in both expanded layouts.
|
|
823
|
-
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([
|
|
965
|
+
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([
|
|
824
966
|
{
|
|
825
967
|
label: 'Edit fullscreen',
|
|
826
968
|
icon: 'FullscreenLine',
|
|
@@ -840,7 +982,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
840
982
|
},
|
|
841
983
|
},
|
|
842
984
|
]
|
|
843
|
-
: []), true), injectedOptionActionMenuItems, true) }));
|
|
985
|
+
: []), true), injectedOptionActionMenuItems, true), editorMenuItems, true) }));
|
|
844
986
|
// The absorbed siblings' controls, rendered inside this row.
|
|
845
987
|
//
|
|
846
988
|
// Each keeps its own label so it is still identifiable — it is a different
|
|
@@ -910,7 +1052,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
910
1052
|
}
|
|
911
1053
|
}, children: [panelMessages.length ?
|
|
912
1054
|
(0, jsx_runtime_1.jsx)(reqore_1.ReqoreControlGroup, { className: 'options-readfirst-info-panel', vertical: true, fluid: true, gapSize: 'normal', children: panelMessages.map(renderInfoStrip) })
|
|
913
|
-
: null, absorbedNodes, renderOption(optionName, optionField, 'small', true)] }), (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRowActions, { children: [draftChip, editRowRevertButton, cancelEditButton, clearValueButton, inlineOptionActions.map(function (action, index) {
|
|
1055
|
+
: null, absorbedNodes, (0, jsx_runtime_1.jsx)(rowMenuContext_1.RowMenuContext.Provider, { value: rowMenu, children: renderOption(optionName, optionField, 'small', true) })] }), (0, jsx_runtime_1.jsxs)(compactRowStyles_1.StyledRowActions, { children: [draftChip, editRowRevertButton, cancelEditButton, clearValueButton, inlineOptionActions.map(function (action, index) {
|
|
914
1056
|
return renderInjectedOptionAction(action, index);
|
|
915
1057
|
}), moreMenu, closeExpandedFieldButton] }), clusterNode] }), optionName));
|
|
916
1058
|
// ALWAYS wrap the editing row in the same StyledColumn so its parent stays
|
|
@@ -968,7 +1110,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
968
1110
|
}
|
|
969
1111
|
}, children: (0, jsx_runtime_1.jsxs)(FocusedEditing_1.FocusedEditing, { isFullscreen: focusedEditing === optionName, onClose: function () { return setFocusedEditing(undefined); }, description: (schema === null || schema === void 0 ? void 0 : schema.display_name) || optionName, children: [focusedEditing === optionName ?
|
|
970
1112
|
(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 })
|
|
971
|
-
: null, renderOption(optionName, optionField)] }) })] }, optionName));
|
|
1113
|
+
: null, (0, jsx_runtime_1.jsx)(rowMenuContext_1.RowMenuContext.Provider, { value: rowMenu, children: renderOption(optionName, optionField) })] }) })] }, optionName));
|
|
972
1114
|
}
|
|
973
1115
|
var formatted = (0, readFirst_1.formatOptionValue)(optionField, schema);
|
|
974
1116
|
var empty = formatted === '';
|
|
@@ -999,9 +1141,19 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
999
1141
|
: []), true);
|
|
1000
1142
|
// A hash row reveals its sub-fields as read-only sub-rows under a "view
|
|
1001
1143
|
// more" disclosure; the row itself still expands the real editor on click.
|
|
1144
|
+
/* An EXPRESSION is not a hash, whatever shape it is stored in.
|
|
1145
|
+
|
|
1146
|
+
`{is_expression: true, value: {exp, args}}` is hash-shaped, so a field
|
|
1147
|
+
holding one earned the structured inset and the row printed the syntax
|
|
1148
|
+
tree — `is_expression true / value / exp + / args 1 2` — directly under a
|
|
1149
|
+
summary line that already read `1 + 2`. The AST is how an expression is
|
|
1150
|
+
STORED, not what it is; the row's line is the whole value, and the
|
|
1151
|
+
expression editor is where its parts are looked at. Same exclusion, and
|
|
1152
|
+
for the same reason, as `schema-definition` beside it. */
|
|
1002
1153
|
var hashEntries = (!hidden &&
|
|
1003
1154
|
(valueType === 'hash' || valueType === 'free-hash') &&
|
|
1004
|
-
(schema === null || schema === void 0 ? void 0 : schema.ui_type) !== 'schema-definition'
|
|
1155
|
+
(schema === null || schema === void 0 ? void 0 : schema.ui_type) !== 'schema-definition' &&
|
|
1156
|
+
(0, readFirst_1.getExpressionAst)(optionField) === undefined) ?
|
|
1005
1157
|
(0, readFirst_1.getHashEntries)(optionField, schema)
|
|
1006
1158
|
: [];
|
|
1007
1159
|
// A LIST OF HASHES/objects gets the same expandable structured preview a hash
|
|
@@ -1043,6 +1195,18 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1043
1195
|
valueType === 'richtext' &&
|
|
1044
1196
|
Array.isArray(optionField === null || optionField === void 0 ? void 0 : optionField.value) &&
|
|
1045
1197
|
(0, common_1.richtextToSegments)(optionField.value).some(function (segment) { return segment.kind === 'tag'; });
|
|
1198
|
+
/* The same pair, for a value that IS one template rather than prose with
|
|
1199
|
+
templates embedded in it. `showsTemplateChips` above closed the richtext
|
|
1200
|
+
case and left this one open: a chosen reference renders as
|
|
1201
|
+
`ReadOnlyTemplateTag`, which carries its own popover, while the row went
|
|
1202
|
+
on setting a native `title` holding the raw reference. Hovering fired
|
|
1203
|
+
both — two tooltips in two places, and the one that says something useful
|
|
1204
|
+
is not the one a screenshot captures. */
|
|
1205
|
+
var showsTemplateTag = !hidden &&
|
|
1206
|
+
typeof (optionField === null || optionField === void 0 ? void 0 : optionField.value) === 'string' &&
|
|
1207
|
+
!(optionField === null || optionField === void 0 ? void 0 : optionField.is_expression) &&
|
|
1208
|
+
((0, templates_1.isValueTemplate)(optionField.value) ||
|
|
1209
|
+
!!(0, templates_1.findTemplate)((_l = (_k = schema === null || schema === void 0 ? void 0 : schema.templates) !== null && _k !== void 0 ? _k : templates) !== null && _l !== void 0 ? _l : {}, optionField.value));
|
|
1046
1210
|
// Markdown reads the same way for the same reason: the row itself can only
|
|
1047
1211
|
// show a line of text, and for markdown that line is the SOURCE — the reader
|
|
1048
1212
|
// gets `## ` and `**` where the point of the value is what it looks like
|
|
@@ -1193,7 +1357,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1193
1357
|
(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', className: 'options-readfirst-row-icon' })
|
|
1194
1358
|
: null;
|
|
1195
1359
|
var rowSchemaIntentColor = (schema === null || schema === void 0 ? void 0 : schema.intent) ?
|
|
1196
|
-
(
|
|
1360
|
+
(_m = theme === null || theme === void 0 ? void 0 : theme.intents) === null || _m === void 0 ? void 0 : _m[schema.intent]
|
|
1197
1361
|
: undefined;
|
|
1198
1362
|
var rowStripeColor = (showStripe ? intentColor : undefined) || rowSchemaIntentColor;
|
|
1199
1363
|
// Intent stripe on the block ROOT so it spans the field's whole territory:
|
|
@@ -1208,7 +1372,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1208
1372
|
// boxes — so the dot and the box can never disagree). Hidden (not-yet-added)
|
|
1209
1373
|
// and dependency-locked rows show no dot (the add/lock affordance speaks for
|
|
1210
1374
|
// them). worstIntent already folds in schema + validation messages.
|
|
1211
|
-
var cSuccess = (
|
|
1375
|
+
var cSuccess = (_o = theme === null || theme === void 0 ? void 0 : theme.intents) === null || _o === void 0 ? void 0 : _o.success;
|
|
1212
1376
|
var rowStatus = (0, readFirst_1.getReadFirstStatus)({
|
|
1213
1377
|
empty: empty,
|
|
1214
1378
|
required: required,
|
|
@@ -1259,6 +1423,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1259
1423
|
!showCodePreview &&
|
|
1260
1424
|
!showMarkdownPreview &&
|
|
1261
1425
|
!showsTemplateChips &&
|
|
1426
|
+
!showsTemplateTag &&
|
|
1262
1427
|
typeof formatted === 'string') ?
|
|
1263
1428
|
formatted
|
|
1264
1429
|
: undefined, "$color": empty || hidden ? "".concat(cMuted, "66") : cKey, "$empty": empty || hidden, children: [(showMarkdownPreview || showLongTextInset || (previewWithSchema && showStructuredPreview)) ?
|
|
@@ -1311,7 +1476,7 @@ exports.CompactRow = (0, react_1.memo)(function (_a) {
|
|
|
1311
1476
|
// consumer that registers nothing — the heading is
|
|
1312
1477
|
// accented either way, just in the theme's own colour
|
|
1313
1478
|
// rather than one this library picked.
|
|
1314
|
-
accent: ((
|
|
1479
|
+
accent: ((_p = theme === null || theme === void 0 ? void 0 : theme.intents) === null || _p === void 0 ? void 0 : _p.custom1) || cInfo,
|
|
1315
1480
|
}, onItemClick: function () { return activate(); } })
|
|
1316
1481
|
: (0, jsx_runtime_1.jsx)(StructuredDataView_1.StructuredDataView, { value: optionField === null || optionField === void 0 ? void 0 : optionField.value, collapsibleRoot: false, showTypes: showFieldTypes, defaultExpandDepth: 2, onItemClick: function () { return activate(); } }) }) }) })
|
|
1317
1482
|
: null, showCodePreview ?
|