@qoretechnologies/reqraft 0.10.66-pr.145.gcb1e59d → 0.10.66
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/README.md +53 -1
- package/dist/components/Description/AllowedValuesHelp.d.ts +20 -0
- package/dist/components/Description/AllowedValuesHelp.d.ts.map +1 -0
- package/dist/components/Description/AllowedValuesHelp.js +86 -0
- package/dist/components/Description/AllowedValuesHelp.js.map +1 -0
- package/dist/components/Description/describedControl.d.ts +54 -0
- package/dist/components/Description/describedControl.d.ts.map +1 -0
- package/dist/components/Description/describedControl.js +81 -0
- package/dist/components/Description/describedControl.js.map +1 -0
- package/dist/components/Description/index.d.ts.map +1 -1
- package/dist/components/Description/index.js +3 -2
- package/dist/components/Description/index.js.map +1 -1
- package/dist/components/colorValue/colorValue.d.ts +59 -0
- package/dist/components/colorValue/colorValue.d.ts.map +1 -0
- package/dist/components/colorValue/colorValue.js +245 -0
- package/dist/components/colorValue/colorValue.js.map +1 -0
- package/dist/components/colorValue/index.d.ts +34 -0
- package/dist/components/colorValue/index.d.ts.map +1 -0
- package/dist/components/colorValue/index.js +136 -0
- package/dist/components/colorValue/index.js.map +1 -0
- package/dist/components/colorValue/labels.d.ts +12 -0
- package/dist/components/colorValue/labels.d.ts.map +1 -0
- package/dist/components/colorValue/labels.js +11 -0
- package/dist/components/colorValue/labels.js.map +1 -0
- package/dist/components/composer/Composer.d.ts +1 -1
- package/dist/components/composer/Composer.d.ts.map +1 -1
- package/dist/components/composer/Composer.js +2 -2
- package/dist/components/composer/Composer.js.map +1 -1
- package/dist/components/dpqlEditor/DpqlEditor.d.ts.map +1 -1
- package/dist/components/dpqlEditor/DpqlEditor.js +156 -10
- package/dist/components/dpqlEditor/DpqlEditor.js.map +1 -1
- package/dist/components/dpqlEditor/dpqlCompletions.d.ts +39 -0
- package/dist/components/dpqlEditor/dpqlCompletions.d.ts.map +1 -0
- package/dist/components/dpqlEditor/dpqlCompletions.js +294 -0
- package/dist/components/dpqlEditor/dpqlCompletions.js.map +1 -0
- package/dist/components/dpqlEditor/dpqlHelpers.d.ts +54 -5
- package/dist/components/dpqlEditor/dpqlHelpers.d.ts.map +1 -1
- package/dist/components/dpqlEditor/dpqlHelpers.js +420 -63
- package/dist/components/dpqlEditor/dpqlHelpers.js.map +1 -1
- package/dist/components/dpqlEditor/dpqlInserter.d.ts.map +1 -1
- package/dist/components/dpqlEditor/dpqlInserter.js +67 -29
- package/dist/components/dpqlEditor/dpqlInserter.js.map +1 -1
- package/dist/components/dpqlEditor/dpqlTags.d.ts +17 -7
- package/dist/components/dpqlEditor/dpqlTags.d.ts.map +1 -1
- package/dist/components/dpqlEditor/dpqlTags.js +44 -17
- package/dist/components/dpqlEditor/dpqlTags.js.map +1 -1
- package/dist/components/dpqlEditor/types.d.ts +94 -8
- package/dist/components/dpqlEditor/types.d.ts.map +1 -1
- package/dist/components/dpqlEditor/useDpqlSession.d.ts +7 -2
- package/dist/components/dpqlEditor/useDpqlSession.d.ts.map +1 -1
- package/dist/components/dpqlEditor/useDpqlSession.js +49 -17
- 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 +336 -243
- 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 +20 -57
- package/dist/components/form/engine/CompactToolbar.js.map +1 -1
- package/dist/components/form/engine/FormEngine.d.ts +67 -59
- package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
- package/dist/components/form/engine/FormEngine.js +606 -409
- package/dist/components/form/engine/FormEngine.js.map +1 -1
- package/dist/components/form/engine/HiddenFieldsNote.d.ts +28 -0
- package/dist/components/form/engine/HiddenFieldsNote.d.ts.map +1 -0
- package/dist/components/form/engine/HiddenFieldsNote.js +32 -0
- package/dist/components/form/engine/HiddenFieldsNote.js.map +1 -0
- package/dist/components/form/engine/OptionFieldMessages.d.ts +2 -18
- package/dist/components/form/engine/OptionFieldMessages.d.ts.map +1 -1
- package/dist/components/form/engine/OptionFieldMessages.js +28 -25
- 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 +19 -2
- package/dist/components/form/engine/OptionsHelpDialog.js.map +1 -1
- package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts +2 -2
- package/dist/components/form/engine/_structuredData/SchemaDataView.d.ts.map +1 -1
- package/dist/components/form/engine/_structuredData/SchemaDataView.js +11 -31
- package/dist/components/form/engine/_structuredData/SchemaDataView.js.map +1 -1
- package/dist/components/form/engine/compactRowContext.d.ts +30 -6
- package/dist/components/form/engine/compactRowContext.d.ts.map +1 -1
- package/dist/components/form/engine/compactRowContext.js.map +1 -1
- package/dist/components/form/engine/compactRowStyles.d.ts +56 -31
- package/dist/components/form/engine/compactRowStyles.d.ts.map +1 -1
- package/dist/components/form/engine/compactRowStyles.js +121 -110
- package/dist/components/form/engine/compactRowStyles.js.map +1 -1
- package/dist/components/form/engine/compactToolbarColors.d.ts +16 -0
- package/dist/components/form/engine/compactToolbarColors.d.ts.map +1 -0
- package/dist/components/form/engine/compactToolbarColors.js +21 -0
- package/dist/components/form/engine/compactToolbarColors.js.map +1 -0
- package/dist/components/form/engine/compactToolbarContext.d.ts +0 -3
- package/dist/components/form/engine/compactToolbarContext.d.ts.map +1 -1
- package/dist/components/form/engine/compactToolbarContext.js.map +1 -1
- package/dist/components/form/engine/inheritProps.d.ts +29 -0
- package/dist/components/form/engine/inheritProps.d.ts.map +1 -0
- package/dist/components/form/engine/inheritProps.js +43 -0
- package/dist/components/form/engine/inheritProps.js.map +1 -0
- package/dist/components/form/engine/operatorSummary.d.ts +26 -0
- package/dist/components/form/engine/operatorSummary.d.ts.map +1 -0
- package/dist/components/form/engine/operatorSummary.js +35 -0
- package/dist/components/form/engine/operatorSummary.js.map +1 -0
- package/dist/components/form/engine/readFirst.d.ts +26 -22
- package/dist/components/form/engine/readFirst.d.ts.map +1 -1
- package/dist/components/form/engine/readFirst.js +79 -115
- package/dist/components/form/engine/readFirst.js.map +1 -1
- package/dist/components/form/engine/readFirstColors.d.ts +30 -0
- package/dist/components/form/engine/readFirstColors.d.ts.map +1 -0
- package/dist/components/form/engine/readFirstColors.js +51 -0
- package/dist/components/form/engine/readFirstColors.js.map +1 -0
- package/dist/components/form/engine/rowFocus.d.ts +3 -9
- package/dist/components/form/engine/rowFocus.d.ts.map +1 -1
- package/dist/components/form/engine/rowFocus.js +30 -19
- package/dist/components/form/engine/rowFocus.js.map +1 -1
- package/dist/components/form/engine/typeChoices.d.ts +1 -1
- package/dist/components/form/engine/variants/VariantCalmTable.d.ts.map +1 -1
- package/dist/components/form/engine/variants/VariantCalmTable.js +2 -1
- package/dist/components/form/engine/variants/VariantCalmTable.js.map +1 -1
- package/dist/components/form/engine/variants/VariantCards.d.ts.map +1 -1
- package/dist/components/form/engine/variants/VariantCards.js +2 -1
- package/dist/components/form/engine/variants/VariantCards.js.map +1 -1
- package/dist/components/form/engine/variants/VariantFocus.js +1 -1
- package/dist/components/form/engine/variants/VariantFocus.js.map +1 -1
- package/dist/components/form/engine/variants/VariantMinimal.d.ts.map +1 -1
- package/dist/components/form/engine/variants/VariantMinimal.js +2 -1
- package/dist/components/form/engine/variants/VariantMinimal.js.map +1 -1
- package/dist/components/form/engine/variants/variantParts.d.ts +1 -1
- package/dist/components/form/engine/variants/variantParts.d.ts.map +1 -1
- package/dist/components/form/engine/variants/variantParts.js +25 -17
- package/dist/components/form/engine/variants/variantParts.js.map +1 -1
- package/dist/components/form/expressions/DpqlRendering.d.ts +1 -1
- package/dist/components/form/expressions/DpqlRendering.d.ts.map +1 -1
- package/dist/components/form/expressions/DpqlRendering.js +7 -6
- package/dist/components/form/expressions/DpqlRendering.js.map +1 -1
- package/dist/components/form/expressions/ExpressionField.d.ts +67 -3
- package/dist/components/form/expressions/ExpressionField.d.ts.map +1 -1
- package/dist/components/form/expressions/ExpressionField.js +536 -114
- package/dist/components/form/expressions/ExpressionField.js.map +1 -1
- package/dist/components/form/expressions/argumentPresence.d.ts +14 -0
- package/dist/components/form/expressions/argumentPresence.d.ts.map +1 -1
- package/dist/components/form/expressions/argumentPresence.js +16 -1
- package/dist/components/form/expressions/argumentPresence.js.map +1 -1
- package/dist/components/form/expressions/builder/argumentDetail.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/argumentDetail.js +4 -1
- package/dist/components/form/expressions/builder/argumentDetail.js.map +1 -1
- package/dist/components/form/expressions/builder/argumentLabel.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/argumentLabel.js +30 -11
- package/dist/components/form/expressions/builder/argumentLabel.js.map +1 -1
- package/dist/components/form/expressions/builder/argumentWrapper.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/argumentWrapper.js +3 -1
- package/dist/components/form/expressions/builder/argumentWrapper.js.map +1 -1
- package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.d.ts +9 -0
- package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.js +30 -27
- package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.js.map +1 -1
- package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.d.ts +1 -1
- package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.js +7 -5
- package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.js.map +1 -1
- package/dist/components/form/expressions/builder/index.d.ts +34 -2
- package/dist/components/form/expressions/builder/index.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/index.js +170 -80
- package/dist/components/form/expressions/builder/index.js.map +1 -1
- package/dist/components/form/expressions/builder/item.d.ts +6 -2
- package/dist/components/form/expressions/builder/item.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/item.js +19 -5
- package/dist/components/form/expressions/builder/item.js.map +1 -1
- package/dist/components/form/expressions/builder/renderTemplate.js +1 -1
- package/dist/components/form/expressions/builder/renderTemplate.js.map +1 -1
- package/dist/components/form/expressions/dpqlMockRecordPath.d.ts +11 -0
- package/dist/components/form/expressions/dpqlMockRecordPath.d.ts.map +1 -0
- package/dist/components/form/expressions/dpqlMockRecordPath.js +254 -0
- package/dist/components/form/expressions/dpqlMockRecordPath.js.map +1 -0
- package/dist/components/form/expressions/expressionOperands.d.ts +16 -0
- package/dist/components/form/expressions/expressionOperands.d.ts.map +1 -0
- package/dist/components/form/expressions/expressionOperands.js +97 -0
- package/dist/components/form/expressions/expressionOperands.js.map +1 -0
- package/dist/components/form/expressions/fieldPath.d.ts +24 -0
- package/dist/components/form/expressions/fieldPath.d.ts.map +1 -0
- package/dist/components/form/expressions/fieldPath.js +152 -0
- package/dist/components/form/expressions/fieldPath.js.map +1 -0
- package/dist/components/form/expressions/loneValue.d.ts +17 -0
- package/dist/components/form/expressions/loneValue.d.ts.map +1 -0
- package/dist/components/form/expressions/loneValue.js +33 -0
- package/dist/components/form/expressions/loneValue.js.map +1 -0
- package/dist/components/form/expressions/mockExpressions.d.ts.map +1 -1
- package/dist/components/form/expressions/mockExpressions.js +22 -5
- package/dist/components/form/expressions/mockExpressions.js.map +1 -1
- package/dist/components/form/expressions/renderExpressionToText.d.ts +2 -0
- package/dist/components/form/expressions/renderExpressionToText.d.ts.map +1 -1
- package/dist/components/form/expressions/renderExpressionToText.js +37 -25
- package/dist/components/form/expressions/renderExpressionToText.js.map +1 -1
- package/dist/components/form/expressions/textOfExpression.d.ts +18 -0
- package/dist/components/form/expressions/textOfExpression.d.ts.map +1 -0
- package/dist/components/form/expressions/textOfExpression.js +49 -0
- package/dist/components/form/expressions/textOfExpression.js.map +1 -0
- package/dist/components/form/expressions/types.d.ts +12 -0
- package/dist/components/form/expressions/types.d.ts.map +1 -1
- package/dist/components/form/expressions/types.js +6 -1
- package/dist/components/form/expressions/types.js.map +1 -1
- package/dist/components/form/expressions/useExpressionType.d.ts +26 -0
- package/dist/components/form/expressions/useExpressionType.d.ts.map +1 -0
- package/dist/components/form/expressions/useExpressionType.js +181 -0
- package/dist/components/form/expressions/useExpressionType.js.map +1 -0
- package/dist/components/form/expressions/useRenderExpression.d.ts.map +1 -1
- package/dist/components/form/expressions/useRenderExpression.js +13 -9
- package/dist/components/form/expressions/useRenderExpression.js.map +1 -1
- package/dist/components/form/expressions/wildcardExpressions.d.ts +27 -0
- package/dist/components/form/expressions/wildcardExpressions.d.ts.map +1 -0
- package/dist/components/form/expressions/wildcardExpressions.js +101 -0
- package/dist/components/form/expressions/wildcardExpressions.js.map +1 -0
- package/dist/components/form/fields/Field.d.ts.map +1 -1
- package/dist/components/form/fields/Field.js +39 -18
- package/dist/components/form/fields/Field.js.map +1 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.d.ts +0 -7
- package/dist/components/form/fields/allowed-values/AllowedValues.d.ts.map +1 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.js +46 -35
- package/dist/components/form/fields/allowed-values/AllowedValues.js.map +1 -1
- package/dist/components/form/fields/allowed-values/choicePicture.d.ts +37 -0
- package/dist/components/form/fields/allowed-values/choicePicture.d.ts.map +1 -0
- package/dist/components/form/fields/allowed-values/choicePicture.js +64 -0
- package/dist/components/form/fields/allowed-values/choicePicture.js.map +1 -0
- package/dist/components/form/fields/array/ArrayAuto.d.ts.map +1 -1
- package/dist/components/form/fields/array/ArrayAuto.js +24 -0
- package/dist/components/form/fields/array/ArrayAuto.js.map +1 -1
- package/dist/components/form/fields/array/ArrayAutoField.d.ts.map +1 -1
- package/dist/components/form/fields/array/ArrayAutoField.js +36 -13
- package/dist/components/form/fields/array/ArrayAutoField.js.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.d.ts +30 -1
- package/dist/components/form/fields/auto/AutoFormField.d.ts.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.js +123 -79
- package/dist/components/form/fields/auto/AutoFormField.js.map +1 -1
- package/dist/components/form/fields/auto/hostEditorValue.d.ts +30 -0
- package/dist/components/form/fields/auto/hostEditorValue.d.ts.map +1 -0
- package/dist/components/form/fields/auto/hostEditorValue.js +53 -0
- package/dist/components/form/fields/auto/hostEditorValue.js.map +1 -0
- package/dist/components/form/fields/binary/Binary.d.ts.map +1 -1
- package/dist/components/form/fields/binary/Binary.js +23 -3
- package/dist/components/form/fields/binary/Binary.js.map +1 -1
- package/dist/components/form/fields/boolean/Boolean.d.ts +5 -0
- package/dist/components/form/fields/boolean/Boolean.d.ts.map +1 -1
- package/dist/components/form/fields/boolean/Boolean.js +9 -1
- package/dist/components/form/fields/boolean/Boolean.js.map +1 -1
- package/dist/components/form/fields/color/Color.d.ts +103 -16
- package/dist/components/form/fields/color/Color.d.ts.map +1 -1
- package/dist/components/form/fields/color/Color.js +616 -16
- package/dist/components/form/fields/color/Color.js.map +1 -1
- package/dist/components/form/fields/emittedValues.d.ts +34 -3
- package/dist/components/form/fields/emittedValues.d.ts.map +1 -1
- package/dist/components/form/fields/emittedValues.js +24 -1
- package/dist/components/form/fields/emittedValues.js.map +1 -1
- package/dist/components/form/fields/file/File.d.ts +1 -1
- package/dist/components/form/fields/file/File.d.ts.map +1 -1
- package/dist/components/form/fields/file/File.js +4 -2
- package/dist/components/form/fields/file/File.js.map +1 -1
- package/dist/components/form/fields/long-string/LongString.d.ts +1 -7
- package/dist/components/form/fields/long-string/LongString.d.ts.map +1 -1
- package/dist/components/form/fields/long-string/LongString.js +30 -13
- package/dist/components/form/fields/long-string/LongString.js.map +1 -1
- package/dist/components/form/fields/markdown/MarkdownView.js +1 -1
- package/dist/components/form/fields/multi-select/MultiSelectFormField.d.ts.map +1 -1
- package/dist/components/form/fields/multi-select/MultiSelectFormField.js +10 -7
- package/dist/components/form/fields/multi-select/MultiSelectFormField.js.map +1 -1
- package/dist/components/form/fields/number/Number.d.ts +7 -4
- package/dist/components/form/fields/number/Number.d.ts.map +1 -1
- package/dist/components/form/fields/number/Number.js +45 -18
- package/dist/components/form/fields/number/Number.js.map +1 -1
- package/dist/components/form/fields/object/Object.d.ts +1 -1
- package/dist/components/form/fields/object/Object.d.ts.map +1 -1
- package/dist/components/form/fields/object/Object.js +4 -2
- package/dist/components/form/fields/object/Object.js.map +1 -1
- package/dist/components/form/fields/pendingEdit.d.ts +52 -0
- package/dist/components/form/fields/pendingEdit.d.ts.map +1 -0
- package/dist/components/form/fields/pendingEdit.js +79 -0
- package/dist/components/form/fields/pendingEdit.js.map +1 -0
- package/dist/components/form/fields/radio-group/RadioGroup.d.ts.map +1 -1
- package/dist/components/form/fields/radio-group/RadioGroup.js +8 -13
- package/dist/components/form/fields/radio-group/RadioGroup.js.map +1 -1
- package/dist/components/form/fields/rich-text/RichText.d.ts +20 -1
- package/dist/components/form/fields/rich-text/RichText.d.ts.map +1 -1
- package/dist/components/form/fields/rich-text/RichText.js +426 -91
- package/dist/components/form/fields/rich-text/RichText.js.map +1 -1
- package/dist/components/form/fields/rich-text/useTemplateTags.d.ts +18 -0
- package/dist/components/form/fields/rich-text/useTemplateTags.d.ts.map +1 -0
- package/dist/components/form/fields/rich-text/useTemplateTags.js +80 -0
- package/dist/components/form/fields/rich-text/useTemplateTags.js.map +1 -0
- package/dist/components/form/fields/schema-definition/CatalogLeafForm.d.ts.map +1 -1
- package/dist/components/form/fields/schema-definition/CatalogLeafForm.js +4 -1
- package/dist/components/form/fields/schema-definition/CatalogLeafForm.js.map +1 -1
- package/dist/components/form/fields/schema-definition/CatalogNodeEditor.d.ts.map +1 -1
- package/dist/components/form/fields/schema-definition/CatalogNodeEditor.js +20 -5
- package/dist/components/form/fields/schema-definition/CatalogNodeEditor.js.map +1 -1
- package/dist/components/form/fields/schema-definition/TableEditor.d.ts.map +1 -1
- package/dist/components/form/fields/schema-definition/TableEditor.js +10 -2
- package/dist/components/form/fields/schema-definition/TableEditor.js.map +1 -1
- package/dist/components/form/fields/schema-definition/index.d.ts.map +1 -1
- package/dist/components/form/fields/schema-definition/index.js +8 -4
- package/dist/components/form/fields/schema-definition/index.js.map +1 -1
- package/dist/components/form/fields/select/Select.d.ts +10 -1
- package/dist/components/form/fields/select/Select.d.ts.map +1 -1
- package/dist/components/form/fields/select/Select.js +28 -14
- package/dist/components/form/fields/select/Select.js.map +1 -1
- package/dist/components/form/fields/select/SelectCollection.d.ts +5 -0
- package/dist/components/form/fields/select/SelectCollection.d.ts.map +1 -1
- package/dist/components/form/fields/select/SelectCollection.js +25 -12
- package/dist/components/form/fields/select/SelectCollection.js.map +1 -1
- package/dist/components/form/fields/select/unavailableRow.d.ts +23 -0
- package/dist/components/form/fields/select/unavailableRow.d.ts.map +1 -0
- package/dist/components/form/fields/select/unavailableRow.js +55 -0
- package/dist/components/form/fields/select/unavailableRow.js.map +1 -0
- package/dist/components/form/fields/template/ReadOnlyTemplateTag.d.ts +11 -5
- package/dist/components/form/fields/template/ReadOnlyTemplateTag.d.ts.map +1 -1
- package/dist/components/form/fields/template/ReadOnlyTemplateTag.js +21 -5
- package/dist/components/form/fields/template/ReadOnlyTemplateTag.js.map +1 -1
- package/dist/components/form/fields/template/TemplateBrowser.d.ts +16 -0
- package/dist/components/form/fields/template/TemplateBrowser.d.ts.map +1 -0
- package/dist/components/form/fields/template/TemplateBrowser.js +89 -0
- package/dist/components/form/fields/template/TemplateBrowser.js.map +1 -0
- package/dist/components/form/fields/template/TemplateField.d.ts +105 -1
- package/dist/components/form/fields/template/TemplateField.d.ts.map +1 -1
- package/dist/components/form/fields/template/TemplateField.js +706 -168
- package/dist/components/form/fields/template/TemplateField.js.map +1 -1
- package/dist/components/form/fields/template/TemplatePicker.d.ts +54 -0
- package/dist/components/form/fields/template/TemplatePicker.d.ts.map +1 -0
- package/dist/components/form/fields/template/TemplatePicker.js +459 -0
- package/dist/components/form/fields/template/TemplatePicker.js.map +1 -0
- package/dist/components/form/fields/template/TemplateText.d.ts +0 -17
- package/dist/components/form/fields/template/TemplateText.d.ts.map +1 -1
- package/dist/components/form/fields/template/TemplateText.js +22 -16
- package/dist/components/form/fields/template/TemplateText.js.map +1 -1
- package/dist/components/form/fields/template/referenceNames.d.ts +63 -0
- package/dist/components/form/fields/template/referenceNames.d.ts.map +1 -0
- package/dist/components/form/fields/template/referenceNames.js +69 -0
- package/dist/components/form/fields/template/referenceNames.js.map +1 -0
- package/dist/components/form/fields/template/writtenAsText.d.ts +61 -0
- package/dist/components/form/fields/template/writtenAsText.d.ts.map +1 -0
- package/dist/components/form/fields/template/writtenAsText.js +204 -0
- package/dist/components/form/fields/template/writtenAsText.js.map +1 -0
- package/dist/components/form/index.d.ts +12 -2
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/index.js +25 -3
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/form/typeSentenceForm.d.ts +17 -0
- package/dist/components/form/typeSentenceForm.d.ts.map +1 -0
- package/dist/components/form/typeSentenceForm.js +54 -0
- package/dist/components/form/typeSentenceForm.js.map +1 -0
- package/dist/components/imageLightbox/ImageLightbox.d.ts.map +1 -1
- package/dist/components/imageLightbox/ImageLightbox.js +19 -9
- package/dist/components/imageLightbox/ImageLightbox.js.map +1 -1
- package/dist/components/log/Log.d.ts.map +1 -1
- package/dist/components/log/Log.js +20 -8
- package/dist/components/log/Log.js.map +1 -1
- package/dist/components/menu/Menu.d.ts.map +1 -1
- package/dist/components/menu/Menu.js +19 -10
- package/dist/components/menu/Menu.js.map +1 -1
- package/dist/components/smartEditor/CompletionMenu.d.ts +53 -0
- package/dist/components/smartEditor/CompletionMenu.d.ts.map +1 -0
- package/dist/components/smartEditor/CompletionMenu.js +302 -0
- package/dist/components/smartEditor/CompletionMenu.js.map +1 -0
- package/dist/components/smartEditor/MarkdownDoc.d.ts +1 -1
- package/dist/components/smartEditor/MarkdownDoc.js +3 -3
- package/dist/components/smartEditor/MarkdownDoc.js.map +1 -1
- package/dist/components/smartEditor/SmartEditor.d.ts.map +1 -1
- package/dist/components/smartEditor/SmartEditor.js +616 -190
- package/dist/components/smartEditor/SmartEditor.js.map +1 -1
- package/dist/components/smartEditor/completionStyle.d.ts +28 -0
- package/dist/components/smartEditor/completionStyle.d.ts.map +1 -0
- package/dist/components/smartEditor/completionStyle.js +79 -0
- package/dist/components/smartEditor/completionStyle.js.map +1 -0
- package/dist/components/smartEditor/contextTitle.d.ts +10 -0
- package/dist/components/smartEditor/contextTitle.d.ts.map +1 -0
- package/dist/components/smartEditor/contextTitle.js +21 -0
- package/dist/components/smartEditor/contextTitle.js.map +1 -0
- package/dist/components/smartEditor/editingAids.d.ts +64 -0
- package/dist/components/smartEditor/editingAids.d.ts.map +1 -0
- package/dist/components/smartEditor/editingAids.js +213 -0
- package/dist/components/smartEditor/editingAids.js.map +1 -0
- package/dist/components/smartEditor/index.d.ts +6 -1
- package/dist/components/smartEditor/index.d.ts.map +1 -1
- package/dist/components/smartEditor/index.js +19 -1
- package/dist/components/smartEditor/index.js.map +1 -1
- package/dist/components/smartEditor/templateCompletions.d.ts +98 -0
- package/dist/components/smartEditor/templateCompletions.d.ts.map +1 -0
- package/dist/components/smartEditor/templateCompletions.js +380 -0
- package/dist/components/smartEditor/templateCompletions.js.map +1 -0
- package/dist/components/smartEditor/typedReferences.d.ts +34 -0
- package/dist/components/smartEditor/typedReferences.d.ts.map +1 -0
- package/dist/components/smartEditor/typedReferences.js +179 -0
- package/dist/components/smartEditor/typedReferences.js.map +1 -0
- package/dist/components/smartEditor/types.d.ts +116 -2
- package/dist/components/smartEditor/types.d.ts.map +1 -1
- package/dist/components/smartEditor/useEditingAids.d.ts +38 -0
- package/dist/components/smartEditor/useEditingAids.d.ts.map +1 -0
- package/dist/components/smartEditor/useEditingAids.js +392 -0
- package/dist/components/smartEditor/useEditingAids.js.map +1 -0
- package/dist/components/smartEditor/useLspAutocomplete.d.ts +106 -3
- package/dist/components/smartEditor/useLspAutocomplete.d.ts.map +1 -1
- package/dist/components/smartEditor/useLspAutocomplete.js +592 -149
- package/dist/components/smartEditor/useLspAutocomplete.js.map +1 -1
- package/dist/components/smartEditor/useLspHover.d.ts +33 -7
- package/dist/components/smartEditor/useLspHover.d.ts.map +1 -1
- package/dist/components/smartEditor/useLspHover.js +364 -35
- package/dist/components/smartEditor/useLspHover.js.map +1 -1
- package/dist/components/smartEditor/useLspSemanticTokens.js +1 -1
- package/dist/components/smartEditor/useLspSemanticTokens.js.map +1 -1
- package/dist/components/smartEditor/useLspSession.d.ts +6 -0
- package/dist/components/smartEditor/useLspSession.d.ts.map +1 -1
- package/dist/components/smartEditor/useLspSession.js +7 -6
- package/dist/components/smartEditor/useLspSession.js.map +1 -1
- package/dist/components/smartEditor/useLspSignatureHelp.d.ts.map +1 -1
- package/dist/components/smartEditor/useLspSignatureHelp.js +6 -11
- package/dist/components/smartEditor/useLspSignatureHelp.js.map +1 -1
- package/dist/components/smartEditor/useTabCameIn.d.ts +10 -0
- package/dist/components/smartEditor/useTabCameIn.d.ts.map +1 -0
- package/dist/components/smartEditor/useTabCameIn.js +42 -0
- package/dist/components/smartEditor/useTabCameIn.js.map +1 -0
- package/dist/components/supportTicket/AttachmentChips.d.ts.map +1 -1
- package/dist/components/supportTicket/AttachmentChips.js +15 -5
- package/dist/components/supportTicket/AttachmentChips.js.map +1 -1
- package/dist/components/supportTicket/InterfaceReferenceTags.d.ts +2 -3
- package/dist/components/supportTicket/InterfaceReferenceTags.d.ts.map +1 -1
- package/dist/components/supportTicket/InterfaceReferenceTags.js.map +1 -1
- package/dist/components/supportTicket/ReferencePicker.d.ts +9 -3
- package/dist/components/supportTicket/ReferencePicker.d.ts.map +1 -1
- package/dist/components/supportTicket/ReferencePicker.js +38 -23
- package/dist/components/supportTicket/ReferencePicker.js.map +1 -1
- package/dist/components/supportTicket/TicketHeader.d.ts +3 -4
- package/dist/components/supportTicket/TicketHeader.d.ts.map +1 -1
- package/dist/components/supportTicket/TicketHeader.js +21 -6
- package/dist/components/supportTicket/TicketHeader.js.map +1 -1
- package/dist/components/supportTicket/TicketMetaTags.d.ts +1 -1
- package/dist/components/supportTicket/TicketReplyBox.d.ts.map +1 -1
- package/dist/components/supportTicket/TicketReplyBox.js +10 -29
- package/dist/components/supportTicket/TicketReplyBox.js.map +1 -1
- package/dist/components/supportTicket/useLoadedImages.d.ts +0 -10
- package/dist/components/supportTicket/useLoadedImages.d.ts.map +1 -1
- package/dist/components/supportTicket/useLoadedImages.js +1 -63
- package/dist/components/supportTicket/useLoadedImages.js.map +1 -1
- package/dist/components/ticketReferences/TicketReferences.d.ts.map +1 -1
- package/dist/components/ticketReferences/TicketReferences.js +10 -9
- package/dist/components/ticketReferences/TicketReferences.js.map +1 -1
- package/dist/components/ticketThread/TicketThread.d.ts.map +1 -1
- package/dist/components/ticketThread/TicketThread.js +52 -21
- package/dist/components/ticketThread/TicketThread.js.map +1 -1
- package/dist/helpers/allowedValues.d.ts +21 -12
- package/dist/helpers/allowedValues.d.ts.map +1 -1
- package/dist/helpers/allowedValues.js +40 -20
- package/dist/helpers/allowedValues.js.map +1 -1
- package/dist/helpers/descriptionTooltip.d.ts +46 -0
- package/dist/helpers/descriptionTooltip.d.ts.map +1 -0
- package/dist/helpers/descriptionTooltip.js +76 -0
- package/dist/helpers/descriptionTooltip.js.map +1 -0
- package/dist/helpers/domProps.d.ts +5 -0
- package/dist/helpers/domProps.d.ts.map +1 -0
- package/dist/helpers/domProps.js +47 -0
- package/dist/helpers/domProps.js.map +1 -0
- package/dist/helpers/expressions.d.ts +115 -4
- package/dist/helpers/expressions.d.ts.map +1 -1
- package/dist/helpers/expressions.js +247 -29
- package/dist/helpers/expressions.js.map +1 -1
- package/dist/helpers/hoveringPointer.d.ts +26 -0
- package/dist/helpers/hoveringPointer.d.ts.map +1 -0
- package/dist/helpers/hoveringPointer.js +29 -0
- package/dist/helpers/hoveringPointer.js.map +1 -0
- package/dist/helpers/markdownText.d.ts +14 -0
- package/dist/helpers/markdownText.d.ts.map +1 -0
- package/dist/helpers/markdownText.js +160 -0
- package/dist/helpers/markdownText.js.map +1 -0
- package/dist/helpers/noDescription.d.ts +9 -0
- package/dist/helpers/noDescription.d.ts.map +1 -0
- package/dist/helpers/noDescription.js +13 -0
- package/dist/helpers/noDescription.js.map +1 -0
- package/dist/helpers/optionUiTypes.d.ts +2 -2
- package/dist/helpers/qorusTypeCatalogue.d.ts +147 -0
- package/dist/helpers/qorusTypeCatalogue.d.ts.map +1 -0
- package/dist/helpers/qorusTypeCatalogue.js +505 -0
- package/dist/helpers/qorusTypeCatalogue.js.map +1 -0
- package/dist/helpers/readableColors.d.ts +36 -0
- package/dist/helpers/readableColors.d.ts.map +1 -0
- package/dist/helpers/readableColors.js +116 -0
- package/dist/helpers/readableColors.js.map +1 -0
- package/dist/helpers/recordFieldReference.d.ts +15 -0
- package/dist/helpers/recordFieldReference.d.ts.map +1 -0
- package/dist/helpers/recordFieldReference.js +89 -0
- package/dist/helpers/recordFieldReference.js.map +1 -0
- package/dist/helpers/singleLineString.d.ts.map +1 -1
- package/dist/helpers/singleLineString.js +0 -1
- package/dist/helpers/singleLineString.js.map +1 -1
- package/dist/helpers/templateCatalogue.d.ts +104 -0
- package/dist/helpers/templateCatalogue.d.ts.map +1 -0
- package/dist/helpers/templateCatalogue.js +116 -0
- package/dist/helpers/templateCatalogue.js.map +1 -0
- package/dist/helpers/templateCatalogueContext.d.ts +19 -0
- package/dist/helpers/templateCatalogueContext.d.ts.map +1 -0
- package/dist/helpers/templateCatalogueContext.js +31 -0
- package/dist/helpers/templateCatalogueContext.js.map +1 -0
- package/dist/helpers/templateItems.d.ts +2 -2
- package/dist/helpers/templateItems.d.ts.map +1 -1
- package/dist/helpers/templateItems.js +6 -4
- package/dist/helpers/templateItems.js.map +1 -1
- package/dist/helpers/templateText.d.ts +1 -0
- package/dist/helpers/templateText.d.ts.map +1 -1
- package/dist/helpers/templateText.js +7 -3
- package/dist/helpers/templateText.js.map +1 -1
- package/dist/helpers/templateTree.d.ts +248 -0
- package/dist/helpers/templateTree.d.ts.map +1 -0
- package/dist/helpers/templateTree.js +892 -0
- package/dist/helpers/templateTree.js.map +1 -0
- package/dist/helpers/templateType.d.ts +28 -0
- package/dist/helpers/templateType.d.ts.map +1 -0
- package/dist/helpers/templateType.js +30 -0
- package/dist/helpers/templateType.js.map +1 -0
- package/dist/helpers/templates.d.ts +86 -16
- package/dist/helpers/templates.d.ts.map +1 -1
- package/dist/helpers/templates.js +305 -45
- package/dist/helpers/templates.js.map +1 -1
- package/dist/helpers/validations.d.ts +27 -0
- package/dist/helpers/validations.d.ts.map +1 -1
- package/dist/helpers/validations.js +169 -39
- package/dist/helpers/validations.js.map +1 -1
- package/dist/helpers/webLink.d.ts +8 -0
- package/dist/helpers/webLink.d.ts.map +1 -0
- package/dist/helpers/webLink.js +29 -0
- package/dist/helpers/webLink.js.map +1 -0
- package/dist/hooks/useQorusTypes.d.ts +12 -17
- package/dist/hooks/useQorusTypes.d.ts.map +1 -1
- package/dist/hooks/useQorusTypes.js +44 -172
- package/dist/hooks/useQorusTypes.js.map +1 -1
- package/dist/hooks/useReadableIntentShade.d.ts +9 -0
- package/dist/hooks/useReadableIntentShade.d.ts.map +1 -0
- package/dist/hooks/useReadableIntentShade.js +23 -0
- package/dist/hooks/useReadableIntentShade.js.map +1 -0
- package/dist/hooks/useReadableOpacity.d.ts +6 -0
- package/dist/hooks/useReadableOpacity.d.ts.map +1 -0
- package/dist/hooks/useReadableOpacity.js +17 -0
- package/dist/hooks/useReadableOpacity.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -1
- package/dist/index.js.map +1 -1
- package/dist/tracking/ui/ExperimentCard.d.ts +1 -1
- package/dist/tracking/ui/ExperimentCard.d.ts.map +1 -1
- package/dist/tracking/ui/ExperimentCard.js +26 -10
- package/dist/tracking/ui/ExperimentCard.js.map +1 -1
- package/dist/tracking/ui/card.d.ts +2 -2
- package/dist/tracking/ui/card.d.ts.map +1 -1
- package/dist/tracking/ui/card.js +2 -2
- package/dist/tracking/ui/card.js.map +1 -1
- package/dist/tracking/ui/readable.d.ts +14 -0
- package/dist/tracking/ui/readable.d.ts.map +1 -0
- package/dist/tracking/ui/readable.js +60 -0
- package/dist/tracking/ui/readable.js.map +1 -0
- package/dist/utils/fetch.d.ts +9 -2
- package/dist/utils/fetch.d.ts.map +1 -1
- package/dist/utils/fetch.js +6 -5
- package/dist/utils/fetch.js.map +1 -1
- package/dist/utils/lspClient.types.d.ts +2 -0
- package/dist/utils/lspClient.types.d.ts.map +1 -1
- package/dist/utils/websocket.d.ts +65 -2
- package/dist/utils/websocket.d.ts.map +1 -1
- package/dist/utils/websocket.js +276 -44
- package/dist/utils/websocket.js.map +1 -1
- package/package.json +14 -6
- package/.claude/CLAUDE.md +0 -317
- package/.tasks/EXPORT_EXPRESSION_BUILDER.md +0 -38
- package/.tasks/EXPRESSION_BUILDER_REPORT.md +0 -149
- package/.tasks/EXPRESSION_FIELD_SEAMS.md +0 -66
- package/.tasks/FIELD_STACK_REPORT.md +0 -234
- package/.tasks/FORM_ENGINE_COMPACT_READ_FIRST.md +0 -558
- package/.tasks/FORM_ENGINE_EXPRESSIONS.md +0 -197
- package/.tasks/FORM_ENGINE_OPTIONS_SYNC.md +0 -95
- package/.tasks/FORM_FIELD_EXTRAS.md +0 -72
- package/.tasks/INDEX.md +0 -111
- package/.tasks/LSP_SHARED_CONNECTION.md +0 -75
- package/.tasks/QONSOLE_ASSIST_FEATURES.md +0 -306
- package/.tasks/RENDER_EXPRESSION_LSP.md +0 -159
- package/.tasks/REQRAFT_AUTO_FIELD.md +0 -176
- package/.tasks/SCHEMA_DEFINITION_FIELD.md +0 -250
- package/.tasks/SMART_EDITOR_CONTEXT_AND_POLISH.md +0 -340
- package/.tasks/SMART_EDITOR_LSP_FEATURES.md +0 -299
- package/.tasks/SMART_EDITOR_REVIEW_FOLLOWUPS.md +0 -280
- package/.tasks/SMART_EDITOR_UX_POLISH.md +0 -383
- package/.tasks/SMART_EDITOR_VISUAL_POLISH.md +0 -246
- package/.tasks/STORY_NETWORK_ISOLATION.md +0 -98
- package/.tasks/TEMPLATE_TOKEN_GRAMMAR.md +0 -72
- package/CODE_OF_CONDUCT.md +0 -105
- package/CONTRIBUTING.MD +0 -78
- package/SECURITY.md +0 -3
- package/chromatic.config.json +0 -5
- package/design/COMPACT_ENGINE_REDESIGN.md +0 -156
- package/design/COMPACT_INFO_DISPLAY.md +0 -87
- package/design/COMPACT_PARITY.md +0 -85
- package/design/EXPRESSION_BUILDER_REPORT_STRATEGY.md +0 -92
- package/design/FORM_ENGINE_COMPACT.md +0 -300
- package/design/FORM_ENGINE_COMPACT_UX_PLAN.md +0 -353
- package/design/FORM_ENGINE_EXPRESSIONS.md +0 -257
- package/design/FORM_ENGINE_FIELD_MIGRATION.md +0 -419
- package/design/IDE_INTEGRATION.md +0 -64
- package/design/RENDER_EXPRESSION_TRANSPORT.md +0 -156
- package/design/SELECT_DIALOG_FLOOR.md +0 -86
- package/design/SMART_EDITOR_UX.md +0 -438
- package/design/TRACKING.md +0 -290
- package/design/UNAVAILABLE_ALLOWED_VALUES.md +0 -226
- package/dist/components/form/engine/formAppearance.d.ts +0 -49
- package/dist/components/form/engine/formAppearance.d.ts.map +0 -1
- package/dist/components/form/engine/formAppearance.js +0 -50
- package/dist/components/form/engine/formAppearance.js.map +0 -1
- package/dist/components/form/fields/ChoiceGroupHeading.d.ts +0 -21
- package/dist/components/form/fields/ChoiceGroupHeading.d.ts.map +0 -1
- package/dist/components/form/fields/ChoiceGroupHeading.js +0 -33
- package/dist/components/form/fields/ChoiceGroupHeading.js.map +0 -1
- package/dist/components/form/fields/allowed-values/savedValues.d.ts +0 -30
- package/dist/components/form/fields/allowed-values/savedValues.d.ts.map +0 -1
- package/dist/components/form/fields/allowed-values/savedValues.js +0 -39
- package/dist/components/form/fields/allowed-values/savedValues.js.map +0 -1
- package/dist/helpers/fieldDescription.d.ts +0 -16
- package/dist/helpers/fieldDescription.d.ts.map +0 -1
- package/dist/helpers/fieldDescription.js +0 -40
- package/dist/helpers/fieldDescription.js.map +0 -1
- package/src/components/Description/index.tsx +0 -254
- package/src/components/Description/markdownRendererContext.tsx +0 -29
- package/src/components/FocusedEditing/index.tsx +0 -50
- package/src/components/codeSize/index.tsx +0 -79
- package/src/components/composer/Composer.stories.tsx +0 -238
- package/src/components/composer/Composer.tsx +0 -554
- package/src/components/composer/helpers.ts +0 -74
- package/src/components/composer/index.ts +0 -2
- package/src/components/dpqlEditor/DpqlEditor.stories.tsx +0 -1183
- package/src/components/dpqlEditor/DpqlEditor.tsx +0 -219
- package/src/components/dpqlEditor/dpqlHelpers.ts +0 -287
- package/src/components/dpqlEditor/dpqlInserter.ts +0 -121
- package/src/components/dpqlEditor/dpqlProbe.ts +0 -165
- package/src/components/dpqlEditor/dpqlTags.ts +0 -114
- package/src/components/dpqlEditor/index.ts +0 -41
- package/src/components/dpqlEditor/types.ts +0 -203
- package/src/components/dpqlEditor/useDpqlProbe.ts +0 -33
- package/src/components/dpqlEditor/useDpqlSession.ts +0 -411
- package/src/components/form/engine/CompactRow.tsx +0 -2740
- package/src/components/form/engine/CompactToolbar.tsx +0 -399
- package/src/components/form/engine/FormEngine.stories.tsx +0 -9934
- package/src/components/form/engine/FormEngine.tsx +0 -4891
- package/src/components/form/engine/FormEngineAppearance.stories.tsx +0 -609
- package/src/components/form/engine/FormEngineRemote.stories.tsx +0 -679
- package/src/components/form/engine/FormEngineStickyHeaders.stories.tsx +0 -335
- package/src/components/form/engine/FormFieldsSkeleton.tsx +0 -82
- package/src/components/form/engine/OptionFieldMessages.tsx +0 -548
- package/src/components/form/engine/OptionsHelpDialog.tsx +0 -29
- package/src/components/form/engine/__fixtures__/basicFormOptions.ts +0 -309
- package/src/components/form/engine/__fixtures__/fieldChromeOptions.ts +0 -45
- package/src/components/form/engine/_structuredData/SchemaDataView.stories.tsx +0 -233
- package/src/components/form/engine/_structuredData/SchemaDataView.tsx +0 -755
- package/src/components/form/engine/_structuredData/StructuredDataView.stories.tsx +0 -85
- package/src/components/form/engine/_structuredData/StructuredDataView.tsx +0 -75
- package/src/components/form/engine/_structuredData/structuredData.ts +0 -145
- package/src/components/form/engine/compactRowContext.ts +0 -153
- package/src/components/form/engine/compactRowStyles.ts +0 -1087
- package/src/components/form/engine/compactToolbarContext.ts +0 -72
- package/src/components/form/engine/formAppearance.ts +0 -79
- package/src/components/form/engine/optionActions.ts +0 -128
- package/src/components/form/engine/optionsContext.ts +0 -24
- package/src/components/form/engine/readFirst.ts +0 -1090
- package/src/components/form/engine/rendererTypes.ts +0 -107
- package/src/components/form/engine/revealRow.ts +0 -123
- package/src/components/form/engine/rowFocus.ts +0 -112
- package/src/components/form/engine/rowMenuContext.ts +0 -159
- package/src/components/form/engine/rowOpenPicker.ts +0 -27
- package/src/components/form/engine/typeChoices.ts +0 -63
- package/src/components/form/engine/variants/FormEngineVariants.stories.tsx +0 -159
- package/src/components/form/engine/variants/VariantCalmTable.tsx +0 -244
- package/src/components/form/engine/variants/VariantCards.tsx +0 -212
- package/src/components/form/engine/variants/VariantFocus.tsx +0 -382
- package/src/components/form/engine/variants/VariantMinimal.tsx +0 -170
- package/src/components/form/engine/variants/focusDemo.ts +0 -145
- package/src/components/form/engine/variants/variantModel.ts +0 -223
- package/src/components/form/engine/variants/variantParts.tsx +0 -313
- package/src/components/form/expressions/DpqlRendering.tsx +0 -85
- package/src/components/form/expressions/ExpressionField.stories.tsx +0 -1395
- package/src/components/form/expressions/ExpressionField.tsx +0 -503
- package/src/components/form/expressions/argumentPresence.ts +0 -213
- package/src/components/form/expressions/builder/ExpressionBuilder.stories.tsx +0 -1683
- package/src/components/form/expressions/builder/argumentDetail.tsx +0 -17
- package/src/components/form/expressions/builder/argumentLabel.tsx +0 -146
- package/src/components/form/expressions/builder/argumentSlot.tsx +0 -101
- package/src/components/form/expressions/builder/argumentWrapper.tsx +0 -243
- package/src/components/form/expressions/builder/confirmMismatchedTypesModal.tsx +0 -120
- package/src/components/form/expressions/builder/confirmUnsupportedTypeModal.tsx +0 -69
- package/src/components/form/expressions/builder/index.tsx +0 -1545
- package/src/components/form/expressions/builder/item.tsx +0 -89
- package/src/components/form/expressions/builder/moveToPositionStrip.tsx +0 -156
- package/src/components/form/expressions/builder/renderTemplate.tsx +0 -42
- package/src/components/form/expressions/dpqlMockLanguage.ts +0 -566
- package/src/components/form/expressions/dpqlMockLsp.ts +0 -126
- package/src/components/form/expressions/mockExpressions.ts +0 -317
- package/src/components/form/expressions/renderExpressionToText.ts +0 -152
- package/src/components/form/expressions/types.ts +0 -110
- package/src/components/form/expressions/useExpressions.ts +0 -101
- package/src/components/form/expressions/useRenderExpression.ts +0 -165
- package/src/components/form/fields/ChoiceGroupHeading.tsx +0 -38
- package/src/components/form/fields/Field.stories.tsx +0 -143
- package/src/components/form/fields/Field.tsx +0 -734
- package/src/components/form/fields/allowed-values/AllowedValues.tsx +0 -321
- package/src/components/form/fields/allowed-values/savedValues.ts +0 -64
- package/src/components/form/fields/array/ArrayAuto.tsx +0 -237
- package/src/components/form/fields/array/ArrayAutoField.stories.tsx +0 -475
- package/src/components/form/fields/array/ArrayAutoField.tsx +0 -367
- package/src/components/form/fields/auto/AutoFormField.stories.tsx +0 -825
- package/src/components/form/fields/auto/AutoFormField.tsx +0 -1183
- package/src/components/form/fields/binary/Binary.stories.tsx +0 -122
- package/src/components/form/fields/binary/Binary.tsx +0 -91
- package/src/components/form/fields/boolean/Boolean.stories.tsx +0 -125
- package/src/components/form/fields/boolean/Boolean.tsx +0 -34
- package/src/components/form/fields/byte-size/ByteSize.stories.tsx +0 -87
- package/src/components/form/fields/byte-size/ByteSize.tsx +0 -58
- package/src/components/form/fields/color/Color.stories.tsx +0 -99
- package/src/components/form/fields/color/Color.tsx +0 -46
- package/src/components/form/fields/cron/Cron.stories.tsx +0 -68
- package/src/components/form/fields/cron/Cron.tsx +0 -80
- package/src/components/form/fields/date/Date.stories.tsx +0 -77
- package/src/components/form/fields/date/Date.tsx +0 -55
- package/src/components/form/fields/emittedValues.ts +0 -70
- package/src/components/form/fields/file/File.stories.tsx +0 -161
- package/src/components/form/fields/file/File.tsx +0 -227
- package/src/components/form/fields/long-string/LongString.stories.tsx +0 -147
- package/src/components/form/fields/long-string/LongString.tsx +0 -141
- package/src/components/form/fields/markdown/Markdown.stories.tsx +0 -76
- package/src/components/form/fields/markdown/Markdown.tsx +0 -81
- package/src/components/form/fields/markdown/MarkdownView.tsx +0 -222
- package/src/components/form/fields/multi-select/MultiSelectFormField.tsx +0 -140
- package/src/components/form/fields/number/Number.stories.tsx +0 -159
- package/src/components/form/fields/number/Number.tsx +0 -175
- package/src/components/form/fields/object/Object.stories.tsx +0 -398
- package/src/components/form/fields/object/Object.tsx +0 -255
- package/src/components/form/fields/radio-group/RadioGroup.stories.tsx +0 -95
- package/src/components/form/fields/radio-group/RadioGroup.tsx +0 -52
- package/src/components/form/fields/radio-group/images/java-96x128.png +0 -0
- package/src/components/form/fields/radio-group/images/python-129x128.png +0 -0
- package/src/components/form/fields/radio-group/images/qore-106x128.png +0 -0
- package/src/components/form/fields/rich-text/RichText.stories.tsx +0 -260
- package/src/components/form/fields/rich-text/RichText.tsx +0 -537
- package/src/components/form/fields/schema-definition/CatalogLeafForm.tsx +0 -242
- package/src/components/form/fields/schema-definition/CatalogNodeEditor.tsx +0 -758
- package/src/components/form/fields/schema-definition/Hint.tsx +0 -22
- package/src/components/form/fields/schema-definition/InlineValidationBanner.tsx +0 -138
- package/src/components/form/fields/schema-definition/Loader.tsx +0 -20
- package/src/components/form/fields/schema-definition/MigrationsTab.tsx +0 -187
- package/src/components/form/fields/schema-definition/SchemaDefinitionField.stories.tsx +0 -286
- package/src/components/form/fields/schema-definition/TableEditor.tsx +0 -155
- package/src/components/form/fields/schema-definition/TablesTab.tsx +0 -138
- package/src/components/form/fields/schema-definition/catalog.ts +0 -237
- package/src/components/form/fields/schema-definition/helpers.ts +0 -90
- package/src/components/form/fields/schema-definition/index.tsx +0 -418
- package/src/components/form/fields/schema-definition/mockCatalog.ts +0 -325
- package/src/components/form/fields/schema-definition/mockDefinition.ts +0 -111
- package/src/components/form/fields/schema-definition/referenceSuggestions.tsx +0 -152
- package/src/components/form/fields/schema-definition/starterTemplate.ts +0 -68
- package/src/components/form/fields/schema-definition/types.ts +0 -185
- package/src/components/form/fields/schema-definition/useSchemaOptionCatalog.ts +0 -49
- package/src/components/form/fields/select/Select.stories.tsx +0 -872
- package/src/components/form/fields/select/Select.tsx +0 -624
- package/src/components/form/fields/select/SelectCollection.tsx +0 -594
- package/src/components/form/fields/string/String.stories.tsx +0 -86
- package/src/components/form/fields/string/String.tsx +0 -43
- package/src/components/form/fields/template/ExampleValueModal.stories.tsx +0 -114
- package/src/components/form/fields/template/ExampleValueModal.tsx +0 -99
- package/src/components/form/fields/template/ReadOnlyTemplateTag.tsx +0 -47
- package/src/components/form/fields/template/TemplateField.stories.tsx +0 -1121
- package/src/components/form/fields/template/TemplateField.tsx +0 -1749
- package/src/components/form/fields/template/TemplateText.tsx +0 -115
- package/src/components/form/fields/template/__fixtures__/longExampleValue.ts +0 -7
- package/src/components/form/fields/template/__fixtures__/multiLevelTemplates.json +0 -147
- package/src/components/form/fields/template/__fixtures__/templates.json +0 -83
- package/src/components/form/fields/timeout/Timeout.stories.tsx +0 -228
- package/src/components/form/fields/timeout/Timeout.tsx +0 -87
- package/src/components/form/fields/url/Url.stories.tsx +0 -94
- package/src/components/form/fields/url/Url.tsx +0 -85
- package/src/components/form/index.tsx +0 -49
- package/src/components/imageLightbox/ImageLightbox.stories.tsx +0 -238
- package/src/components/imageLightbox/ImageLightbox.tsx +0 -238
- package/src/components/imageLightbox/index.ts +0 -1
- package/src/components/log/Log.stories.tsx +0 -333
- package/src/components/log/Log.tsx +0 -285
- package/src/components/menu/Menu.stories.tsx +0 -155
- package/src/components/menu/Menu.tsx +0 -312
- package/src/components/qonsoleSmartInput/QonsoleSmartInput.stories.tsx +0 -797
- package/src/components/qonsoleSmartInput/QonsoleSmartInput.tsx +0 -105
- package/src/components/qonsoleSmartInput/index.ts +0 -16
- package/src/components/qonsoleSmartInput/qonsoleInserter.ts +0 -77
- package/src/components/qonsoleSmartInput/types.ts +0 -133
- package/src/components/qonsoleSmartInput/useQonsoleSession.ts +0 -124
- package/src/components/searchFilterBar/SearchFilterBar.stories.tsx +0 -62
- package/src/components/searchFilterBar/SearchFilterBar.tsx +0 -144
- package/src/components/searchFilterBar/index.ts +0 -1
- package/src/components/smartEditor/MarkdownDoc.tsx +0 -190
- package/src/components/smartEditor/SmartEditor.stories.tsx +0 -475
- package/src/components/smartEditor/SmartEditor.tsx +0 -808
- package/src/components/smartEditor/__fixtures__/mockLspServer.ts +0 -205
- package/src/components/smartEditor/helpers.ts +0 -217
- package/src/components/smartEditor/index.ts +0 -35
- package/src/components/smartEditor/styling.ts +0 -45
- package/src/components/smartEditor/types.ts +0 -211
- package/src/components/smartEditor/useLspAutocomplete.ts +0 -758
- package/src/components/smartEditor/useLspDiagnosticDecorations.ts +0 -125
- package/src/components/smartEditor/useLspHover.ts +0 -230
- package/src/components/smartEditor/useLspSemanticTokens.ts +0 -298
- package/src/components/smartEditor/useLspSession.ts +0 -231
- package/src/components/smartEditor/useLspSignatureHelp.ts +0 -198
- package/src/components/supportTicket/AttachmentChips.stories.tsx +0 -171
- package/src/components/supportTicket/AttachmentChips.tsx +0 -147
- package/src/components/supportTicket/InterfaceReferenceTags.stories.tsx +0 -257
- package/src/components/supportTicket/InterfaceReferenceTags.tsx +0 -130
- package/src/components/supportTicket/ReferencePicker.stories.tsx +0 -580
- package/src/components/supportTicket/ReferencePicker.tsx +0 -573
- package/src/components/supportTicket/TicketConversation.stories.tsx +0 -120
- package/src/components/supportTicket/TicketHeader.stories.tsx +0 -183
- package/src/components/supportTicket/TicketHeader.tsx +0 -248
- package/src/components/supportTicket/TicketMetaTags.stories.tsx +0 -103
- package/src/components/supportTicket/TicketMetaTags.tsx +0 -85
- package/src/components/supportTicket/TicketReplyBox.stories.tsx +0 -357
- package/src/components/supportTicket/TicketReplyBox.tsx +0 -172
- package/src/components/supportTicket/__fixtures__/kindMarks.ts +0 -28
- package/src/components/supportTicket/attachmentAccess.ts +0 -97
- package/src/components/supportTicket/fileToAttachment.ts +0 -24
- package/src/components/supportTicket/index.ts +0 -10
- package/src/components/supportTicket/meta.ts +0 -206
- package/src/components/supportTicket/ticketModel.ts +0 -131
- package/src/components/supportTicket/useLoadedImages.ts +0 -93
- package/src/components/ticketReferences/TicketReferences.stories.tsx +0 -341
- package/src/components/ticketReferences/TicketReferences.tsx +0 -914
- package/src/components/ticketReferences/index.ts +0 -2
- package/src/components/ticketThread/TicketThread.stories.tsx +0 -898
- package/src/components/ticketThread/TicketThread.tsx +0 -706
- package/src/components/ticketThread/index.ts +0 -6
- package/src/contexts/FetchContext.tsx +0 -25
- package/src/contexts/ReqraftContext.tsx +0 -9
- package/src/contexts/StorageContext.tsx +0 -33
- package/src/global.d.ts +0 -4
- package/src/helpers/allowedValues.ts +0 -268
- package/src/helpers/choiceChip.ts +0 -227
- package/src/helpers/common.ts +0 -326
- package/src/helpers/dpqlDetection.ts +0 -209
- package/src/helpers/expressions.ts +0 -140
- package/src/helpers/fieldDescription.ts +0 -39
- package/src/helpers/optionUiTypes.ts +0 -199
- package/src/helpers/options.ts +0 -150
- package/src/helpers/providerValue.ts +0 -125
- package/src/helpers/scrollbar.ts +0 -32
- package/src/helpers/singleLineString.ts +0 -62
- package/src/helpers/templateItems.ts +0 -81
- package/src/helpers/templateText.ts +0 -350
- package/src/helpers/templates.ts +0 -602
- package/src/helpers/validations.ts +0 -2085
- package/src/hooks/useArgSchema.ts +0 -37
- package/src/hooks/useCoarsePointer.ts +0 -30
- package/src/hooks/useFetch/useFetch.stories.tsx +0 -379
- package/src/hooks/useFetch/useFetch.tsx +0 -154
- package/src/hooks/usePhoneViewport.ts +0 -34
- package/src/hooks/useQorusTypes.ts +0 -233
- package/src/hooks/useReqraftProperty.ts +0 -16
- package/src/hooks/useStorage/useStorage.stories.tsx +0 -168
- package/src/hooks/useStorage/useStorage.ts +0 -35
- package/src/hooks/useTemplates.ts +0 -123
- package/src/hooks/useValidation.ts +0 -9
- package/src/hooks/useWebSocket/useWebSocket.ts +0 -224
- package/src/hooks/useWebSocket/useWebsocket.stories.tsx +0 -640
- package/src/hooks/useWhyDidYouUpdate.ts +0 -38
- package/src/index.tsx +0 -86
- package/src/providers/FetchProvider.tsx +0 -40
- package/src/providers/ReqraftProvider.tsx +0 -52
- package/src/providers/StorageProvider.tsx +0 -131
- package/src/stores/currentUser/currentUser.stories.tsx +0 -100
- package/src/stores/currentUser/currentUser.tsx +0 -94
- package/src/stories/Data/fileFieldArgSchema.json +0 -86
- package/src/stories/Tests/utils.ts +0 -320
- package/src/stories/storyNetwork.ts +0 -92
- package/src/stories/tracking.tsx +0 -206
- package/src/tracking/browser/attach.ts +0 -186
- package/src/tracking/browser/env.ts +0 -78
- package/src/tracking/core/consent.ts +0 -37
- package/src/tracking/core/engagement.ts +0 -47
- package/src/tracking/core/experiments.ts +0 -258
- package/src/tracking/core/hash.ts +0 -26
- package/src/tracking/core/ids.ts +0 -25
- package/src/tracking/core/observable.ts +0 -23
- package/src/tracking/core/queue.ts +0 -131
- package/src/tracking/core/sections.ts +0 -166
- package/src/tracking/core/storage.ts +0 -69
- package/src/tracking/core/tracker.ts +0 -417
- package/src/tracking/core/types.ts +0 -162
- package/src/tracking/core/utm.ts +0 -23
- package/src/tracking/index.ts +0 -72
- package/src/tracking/markup.ts +0 -17
- package/src/tracking/react/Experiment.tsx +0 -44
- package/src/tracking/react/TrackingProvider.tsx +0 -56
- package/src/tracking/react/hooks.ts +0 -106
- package/src/tracking/react/index.ts +0 -13
- package/src/tracking/testing.ts +0 -108
- package/src/tracking/ui/ExperimentCard.stories.tsx +0 -296
- package/src/tracking/ui/ExperimentCard.tsx +0 -667
- package/src/tracking/ui/ExperimentsOverlay.stories.tsx +0 -155
- package/src/tracking/ui/ExperimentsOverlay.tsx +0 -437
- package/src/tracking/ui/anchor.ts +0 -180
- package/src/tracking/ui/card.ts +0 -464
- package/src/tracking/ui/client.ts +0 -117
- package/src/tracking/ui/index.ts +0 -77
- package/src/tracking/ui/types.ts +0 -110
- package/src/tracking/ui/useExperimentsAdmin.ts +0 -103
- package/src/types/Form.ts +0 -29
- package/src/types.ts +0 -14
- package/src/utils/datetime.ts +0 -10
- package/src/utils/fetch.ts +0 -457
- package/src/utils/lspClient.ts +0 -711
- package/src/utils/lspClient.types.ts +0 -211
- package/src/utils/queryUnlessCancelled.ts +0 -28
- package/src/utils/websocket.ts +0 -293
- package/vite.config.ts +0 -58
- package/vitest.config.ts +0 -69
|
@@ -1,1395 +0,0 @@
|
|
|
1
|
-
import { ReqoreButton } from '@qoretechnologies/reqore';
|
|
2
|
-
import type { IReqoreEffect } from '@qoretechnologies/reqore/dist/components/Effect';
|
|
3
|
-
import { StoryObj } from '@storybook/react-vite';
|
|
4
|
-
import { expect, fn, userEvent, waitFor, within } from 'storybook/test';
|
|
5
|
-
import { useEffect, useMemo, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import { storyApiUrl } from '../../../stories/storyNetwork';
|
|
8
|
-
import { StoryMeta } from '../../../types';
|
|
9
|
-
import { FormEngine } from '../engine/FormEngine';
|
|
10
|
-
import { dpqlMockParseCalls } from './dpqlMockLsp';
|
|
11
|
-
import { ExpressionField } from './ExpressionField';
|
|
12
|
-
import { mockExpressions } from './mockExpressions';
|
|
13
|
-
import { IExpression } from './types';
|
|
14
|
-
|
|
15
|
-
/** The IDE's AI-assist button, as it renders on every expression card there
|
|
16
|
-
* (qorus-ide `src/components/AiButton` + `src/constants/effects.ts`
|
|
17
|
-
* `SynthColorEffect`, resolved): a `ReqoreButton` carrying the Qorus AI
|
|
18
|
-
* gradient. Only the click is stubbed — the real one opens a Qonsole session,
|
|
19
|
-
* which is the IDE's to own and the reason the seam exists. */
|
|
20
|
-
const IDE_AI_BUTTON_EFFECT: IReqoreEffect = {
|
|
21
|
-
gradient: {
|
|
22
|
-
colors: { 0: '#13163a', 100: '#5c1976' },
|
|
23
|
-
animate: 'hover',
|
|
24
|
-
animationSpeed: 5,
|
|
25
|
-
},
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
/** A stable `onChange` for stories that own their value themselves. */
|
|
29
|
-
const noopChange = (): void => undefined;
|
|
30
|
-
|
|
31
|
-
const SAMPLE: IExpression = {
|
|
32
|
-
is_expression: true,
|
|
33
|
-
value: {
|
|
34
|
-
exp: '==',
|
|
35
|
-
args: [
|
|
36
|
-
{ type: 'string', value: '$local:name' },
|
|
37
|
-
{ type: 'string', value: 'John' },
|
|
38
|
-
],
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
const meta = {
|
|
43
|
-
component: ExpressionField,
|
|
44
|
-
title: 'Components/Form/Expressions/ExpressionField',
|
|
45
|
-
parameters: {
|
|
46
|
-
mockData: [
|
|
47
|
-
{
|
|
48
|
-
url: storyApiUrl('system?action=expressions&context=ui'),
|
|
49
|
-
method: 'GET',
|
|
50
|
-
status: 200,
|
|
51
|
-
response: mockExpressions,
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
},
|
|
55
|
-
args: {
|
|
56
|
-
onChange: fn(),
|
|
57
|
-
expressions: mockExpressions,
|
|
58
|
-
},
|
|
59
|
-
render(args) {
|
|
60
|
-
const [value, setValue] = useState<IExpression | undefined>(args.value);
|
|
61
|
-
return (
|
|
62
|
-
<ExpressionField
|
|
63
|
-
{...args}
|
|
64
|
-
value={value}
|
|
65
|
-
onChange={(v) => {
|
|
66
|
-
args.onChange?.(v);
|
|
67
|
-
setValue(v);
|
|
68
|
-
}}
|
|
69
|
-
/>
|
|
70
|
-
);
|
|
71
|
-
},
|
|
72
|
-
} as StoryMeta<typeof ExpressionField>;
|
|
73
|
-
|
|
74
|
-
export default meta;
|
|
75
|
-
type Story = StoryObj<typeof meta>;
|
|
76
|
-
|
|
77
|
-
/** The DPQL editor overlays "Connecting to language server…" / "Loading
|
|
78
|
-
* schema…" while its LSP session starts — a snapshot must never catch that
|
|
79
|
-
* transient, so every Text-mode play ends by waiting the overlay out. */
|
|
80
|
-
const waitForLspIdle = (canvasElement: HTMLElement) =>
|
|
81
|
-
waitFor(
|
|
82
|
-
() => {
|
|
83
|
-
expect(canvasElement.querySelector('[contenteditable="true"]')).toBeInTheDocument();
|
|
84
|
-
expect(canvasElement.textContent).not.toContain('Connecting to language server');
|
|
85
|
-
expect(canvasElement.textContent).not.toContain('Loading schema');
|
|
86
|
-
},
|
|
87
|
-
{ timeout: 10000 }
|
|
88
|
-
);
|
|
89
|
-
|
|
90
|
-
/** The shell with a populated expression — the Visual/Text mode toggle. */
|
|
91
|
-
export const Default: Story = {
|
|
92
|
-
args: {
|
|
93
|
-
value: SAMPLE,
|
|
94
|
-
},
|
|
95
|
-
parameters: {
|
|
96
|
-
docs: {
|
|
97
|
-
description: {
|
|
98
|
-
story:
|
|
99
|
-
'Renders ExpressionField holding a "$local:name == John" expression — the Visual builder shows the Logical Equals operator with its two operands and the Visual/Text mode toggle.',
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
async play({ canvasElement }) {
|
|
104
|
-
const canvas = within(canvasElement);
|
|
105
|
-
|
|
106
|
-
// Visual mode renders the ported builder (with its own Explain); the shell
|
|
107
|
-
// adds only the Visual/Text toggle.
|
|
108
|
-
await waitFor(() => expect(canvasElement.querySelector('.expression')).toBeInTheDocument(), {
|
|
109
|
-
timeout: 6000,
|
|
110
|
-
});
|
|
111
|
-
await expect(await canvas.findByText('Logical Equals')).toBeInTheDocument();
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Empty expression — an empty AST renders no "Preview" box at all (nothing to
|
|
117
|
-
* parse), just the bare editor waiting for input.
|
|
118
|
-
*/
|
|
119
|
-
export const Empty: Story = {
|
|
120
|
-
args: {
|
|
121
|
-
value: { is_expression: true, value: { args: [] } },
|
|
122
|
-
defaultMode: 'text',
|
|
123
|
-
},
|
|
124
|
-
parameters: {
|
|
125
|
-
docs: {
|
|
126
|
-
description: {
|
|
127
|
-
story:
|
|
128
|
-
'Renders ExpressionField in Text mode with an empty expression AST — only the DPQL editor shows; the "Preview" box stays hidden until there is something to show.',
|
|
129
|
-
},
|
|
130
|
-
},
|
|
131
|
-
},
|
|
132
|
-
async play({ canvasElement }) {
|
|
133
|
-
const canvas = within(canvasElement);
|
|
134
|
-
await waitForLspIdle(canvasElement);
|
|
135
|
-
/* An empty query has nothing to render — no Preview box.
|
|
136
|
-
The testid is the assertion that matters: after the rename a
|
|
137
|
-
`queryByText('Parsed')` would be null whatever the box did, and an
|
|
138
|
-
assertion that cannot fail is worse than no assertion. */
|
|
139
|
-
await expect(canvas.queryByTestId('expression-preview')).toBeNull();
|
|
140
|
-
await expect(canvas.queryByText('Preview')).toBeNull();
|
|
141
|
-
},
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* The round-trip: a `FormEngine` field with `supports_expressions` whose
|
|
146
|
-
* stored value is an expression (`{ type, value:<AST>, is_expression:true }`)
|
|
147
|
-
* renders the `ExpressionField` shell (FormEngine sets
|
|
148
|
-
* `allowTextExpressions` on TemplateField) — Visual mode shows the ported
|
|
149
|
-
* builder, and the Visual/Text toggle is present.
|
|
150
|
-
*/
|
|
151
|
-
/**
|
|
152
|
-
* The seam a host actually reaches. The builder's own `WithInjectedExtraActions`
|
|
153
|
-
* story proves the `extraActions` slot on `&&` / `||` group children, which the
|
|
154
|
-
* group recursion forwards; this one proves the two hops that used to drop it —
|
|
155
|
-
* the shell hosts mount, and an operand that is itself an expression (rendered
|
|
156
|
-
* through an operand `TemplateField`, not the group recursion).
|
|
157
|
-
*/
|
|
158
|
-
export const NestedOperandKeepsInjectedActions: Story = {
|
|
159
|
-
args: {
|
|
160
|
-
value: {
|
|
161
|
-
is_expression: true,
|
|
162
|
-
value: {
|
|
163
|
-
exp: 'contains',
|
|
164
|
-
args: [
|
|
165
|
-
{ type: 'string', value: '$local:input' },
|
|
166
|
-
{
|
|
167
|
-
is_expression: true,
|
|
168
|
-
value: {
|
|
169
|
-
exp: 'contains',
|
|
170
|
-
args: [
|
|
171
|
-
{ type: 'string', value: '$local:other' },
|
|
172
|
-
{ type: 'string', value: 'es' },
|
|
173
|
-
],
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
],
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
extraActions: () => [
|
|
180
|
-
{
|
|
181
|
-
as: ReqoreButton,
|
|
182
|
-
props: {
|
|
183
|
-
icon: 'ChatAiFill',
|
|
184
|
-
fixed: true,
|
|
185
|
-
compact: true,
|
|
186
|
-
minimal: true,
|
|
187
|
-
transparent: true,
|
|
188
|
-
effect: IDE_AI_BUTTON_EFFECT,
|
|
189
|
-
className: 'expression-ai-assist',
|
|
190
|
-
onClick: fn(),
|
|
191
|
-
},
|
|
192
|
-
// Always visible here, unlike the IDE's hover-revealed original: the
|
|
193
|
-
// point of this story is to count which cards received the seam, and
|
|
194
|
-
// hovering a nested card bubbles to the outer one, which would make a
|
|
195
|
-
// hover-gated count ambiguous (and put a hover popover in the snapshot).
|
|
196
|
-
show: true,
|
|
197
|
-
size: 'tiny',
|
|
198
|
-
},
|
|
199
|
-
],
|
|
200
|
-
},
|
|
201
|
-
parameters: {
|
|
202
|
-
docs: {
|
|
203
|
-
description: {
|
|
204
|
-
story:
|
|
205
|
-
'Renders ExpressionField holding a String Contains expression whose second operand is itself a String Contains expression, with an extraActions factory that injects an AI-assist button per card. Both cards show the injected action, the nested operand\'s included.',
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
},
|
|
209
|
-
play: async () => {
|
|
210
|
-
const cards = () => document.querySelectorAll('.expression');
|
|
211
|
-
// Outer card plus the nested operand's card. The nested builder fetches
|
|
212
|
-
// the (mocked) catalogue on its own, so it mounts a beat after the outer.
|
|
213
|
-
await waitFor(() => expect(cards().length).toBe(2), { timeout: 10000 });
|
|
214
|
-
|
|
215
|
-
// Scoped to the NESTED card, so the outer card's action cannot satisfy it.
|
|
216
|
-
await waitFor(() =>
|
|
217
|
-
expect(cards()[1].querySelector('.expression-ai-assist')).toBeInTheDocument()
|
|
218
|
-
);
|
|
219
|
-
// And the seam reached every card, not just one.
|
|
220
|
-
expect(document.querySelectorAll('.expression-ai-assist').length).toBe(2);
|
|
221
|
-
},
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
export const ViaFormEngine: Story = {
|
|
225
|
-
parameters: {
|
|
226
|
-
docs: {
|
|
227
|
-
description: {
|
|
228
|
-
story:
|
|
229
|
-
'Renders a FormEngine schema with a bool option that carries supports_expressions and a stored expression value — the engine routes through TemplateField and mounts the ExpressionField shell with the Visual builder and the Visual/Text toggle.',
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
},
|
|
233
|
-
render: () => {
|
|
234
|
-
const [value, setValue] = useState<any>({
|
|
235
|
-
condition: { type: 'bool', value: SAMPLE.value, is_expression: true },
|
|
236
|
-
});
|
|
237
|
-
return (
|
|
238
|
-
<FormEngine
|
|
239
|
-
name='exprForm'
|
|
240
|
-
options={
|
|
241
|
-
{
|
|
242
|
-
condition: {
|
|
243
|
-
type: 'bool',
|
|
244
|
-
ui_type: 'bool',
|
|
245
|
-
display_name: 'Condition',
|
|
246
|
-
preselected: true,
|
|
247
|
-
supports_expressions: true,
|
|
248
|
-
expressions: mockExpressions,
|
|
249
|
-
},
|
|
250
|
-
} as any
|
|
251
|
-
}
|
|
252
|
-
value={value}
|
|
253
|
-
onChange={(_n, v) => setValue(v)}
|
|
254
|
-
/>
|
|
255
|
-
);
|
|
256
|
-
},
|
|
257
|
-
async play({ canvasElement }) {
|
|
258
|
-
const canvas = within(canvasElement);
|
|
259
|
-
// The ported builder rendered inside the engine-driven form.
|
|
260
|
-
await waitFor(() => expect(canvasElement.querySelector('.expression')).toBeInTheDocument(), {
|
|
261
|
-
timeout: 6000,
|
|
262
|
-
});
|
|
263
|
-
await expect(await canvas.findByText('Logical Equals')).toBeInTheDocument();
|
|
264
|
-
// The ExpressionField shell wraps it: the Visual/Text toggle is present.
|
|
265
|
-
await expect(await canvas.findByText('Visual')).toBeInTheDocument();
|
|
266
|
-
await expect(canvas.getByText('Text')).toBeInTheDocument();
|
|
267
|
-
// A valid expression is validated as an expression, not as the base
|
|
268
|
-
// `bool` type — no "must be True or False" error.
|
|
269
|
-
await expect(canvas.queryByText(/True or False/)).not.toBeInTheDocument();
|
|
270
|
-
},
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* FormEngine → Text mode, the serialize direction: switching the
|
|
275
|
-
* engine-driven expression field to Text seeds the DPQL editor from the
|
|
276
|
-
* stored AST (`dpql/serialize` over the mock LSP) and the "Preview" box
|
|
277
|
-
* renders the same AST.
|
|
278
|
-
*/
|
|
279
|
-
export const ViaFormEngineTextMode: Story = {
|
|
280
|
-
parameters: {
|
|
281
|
-
docs: {
|
|
282
|
-
description: {
|
|
283
|
-
story:
|
|
284
|
-
'Renders the FormEngine expression field, then switches to Text mode — the DPQL editor seeds from the stored AST via the mock LSP\'s dpql/serialize call, highlighted like typed text. The server\'s rendering reads exactly as that text, so no "Preview" box repeats it.',
|
|
285
|
-
},
|
|
286
|
-
},
|
|
287
|
-
},
|
|
288
|
-
render: ViaFormEngine.render,
|
|
289
|
-
async play({ canvasElement }) {
|
|
290
|
-
const canvas = within(canvasElement);
|
|
291
|
-
|
|
292
|
-
// Visual (the builder) renders first.
|
|
293
|
-
await waitFor(() => expect(canvasElement.querySelector('.expression')).toBeInTheDocument(), {
|
|
294
|
-
timeout: 6000,
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
// Switch to Text — the DPQL editor mounts and seeds from the AST
|
|
298
|
-
// (`dpql/serialize` over the mock LSP).
|
|
299
|
-
await userEvent.click(await canvas.findByText('Text'));
|
|
300
|
-
const editable = (await waitFor(
|
|
301
|
-
() => {
|
|
302
|
-
const el = canvasElement.querySelector('[contenteditable="true"]');
|
|
303
|
-
if (!el) throw new Error('editor not ready');
|
|
304
|
-
return el as HTMLElement;
|
|
305
|
-
},
|
|
306
|
-
{ timeout: 10000 }
|
|
307
|
-
)) as HTMLElement;
|
|
308
|
-
// The template ref renders as a chip ("local: name" + zero-width marks)
|
|
309
|
-
// and the literal gets quoted — assert the seeded content, not raw DPQL.
|
|
310
|
-
await waitFor(
|
|
311
|
-
() => {
|
|
312
|
-
expect(editable.textContent).toMatch(/local:?\s*name/);
|
|
313
|
-
expect(editable.textContent).toContain('John');
|
|
314
|
-
},
|
|
315
|
-
{ timeout: 10000 }
|
|
316
|
-
);
|
|
317
|
-
// …and highlighted: the server colours its own copy of the text, which it
|
|
318
|
-
// only holds if a value SET after mount reaches it as well as typing does.
|
|
319
|
-
await waitFor(
|
|
320
|
-
() => {
|
|
321
|
-
const literal = Array.from(editable.querySelectorAll<HTMLElement>('span[style]')).find(
|
|
322
|
-
(span) => span.textContent === '"John"' && !!span.style.color
|
|
323
|
-
);
|
|
324
|
-
expect(literal, 'the seeded text is coloured by the server').toBeTruthy();
|
|
325
|
-
},
|
|
326
|
-
{ timeout: 10000 }
|
|
327
|
-
);
|
|
328
|
-
/* The server renders `$local:name == "John"`, which reads exactly as the
|
|
329
|
-
text above it — the chip draws over the quotes — so there is no Preview. */
|
|
330
|
-
await waitFor(
|
|
331
|
-
() =>
|
|
332
|
-
expect(canvasElement.querySelector('.expression-field')?.getAttribute('data-preview')).toBe(
|
|
333
|
-
'repeats'
|
|
334
|
-
),
|
|
335
|
-
{ timeout: 10000 }
|
|
336
|
-
);
|
|
337
|
-
await expect(canvas.queryByTestId('expression-preview')).toBeNull();
|
|
338
|
-
await waitForLspIdle(canvasElement);
|
|
339
|
-
},
|
|
340
|
-
};
|
|
341
|
-
|
|
342
|
-
/**
|
|
343
|
-
* FormEngine → Text mode, the parse direction: typing DPQL into an (empty)
|
|
344
|
-
* engine-driven expression field parses to the AST (`dpql/parse` over the
|
|
345
|
-
* mock LSP) and lands in the form value with `is_expression` — the 4-arg
|
|
346
|
-
* `isFunction` onChange flow end-to-end. (Typing starts from an empty
|
|
347
|
-
* expression: synthetic keystrokes only land in an empty Slate document;
|
|
348
|
-
* the seeded direction is covered by `ViaFormEngineTextMode` above.)
|
|
349
|
-
*/
|
|
350
|
-
export const ViaFormEngineTextTyping: Story = {
|
|
351
|
-
parameters: {
|
|
352
|
-
docs: {
|
|
353
|
-
description: {
|
|
354
|
-
story:
|
|
355
|
-
"Renders the FormEngine expression field with an empty AST in Text mode. Typing DPQL text triggers the mock LSP's dpql/parse and the parsed expression lands in the form value with is_expression set.",
|
|
356
|
-
},
|
|
357
|
-
},
|
|
358
|
-
},
|
|
359
|
-
render: (args) => {
|
|
360
|
-
const [value, setValue] = useState<any>({
|
|
361
|
-
condition: { type: 'bool', value: { args: [] }, is_expression: true },
|
|
362
|
-
});
|
|
363
|
-
return (
|
|
364
|
-
<FormEngine
|
|
365
|
-
name='exprForm'
|
|
366
|
-
options={
|
|
367
|
-
{
|
|
368
|
-
condition: {
|
|
369
|
-
type: 'bool',
|
|
370
|
-
ui_type: 'bool',
|
|
371
|
-
display_name: 'Condition',
|
|
372
|
-
preselected: true,
|
|
373
|
-
supports_expressions: true,
|
|
374
|
-
expressions: mockExpressions,
|
|
375
|
-
},
|
|
376
|
-
} as any
|
|
377
|
-
}
|
|
378
|
-
value={value}
|
|
379
|
-
onChange={(_n, v) => {
|
|
380
|
-
args.onChange?.(v as any);
|
|
381
|
-
setValue(v);
|
|
382
|
-
}}
|
|
383
|
-
/>
|
|
384
|
-
);
|
|
385
|
-
},
|
|
386
|
-
async play({ canvasElement, args }) {
|
|
387
|
-
const canvas = within(canvasElement);
|
|
388
|
-
|
|
389
|
-
// Switch the form field to Text — empty expression, so the editor
|
|
390
|
-
// starts blank.
|
|
391
|
-
await userEvent.click(await canvas.findByText('Text'));
|
|
392
|
-
const editable = (await waitFor(
|
|
393
|
-
() => {
|
|
394
|
-
const el = canvasElement.querySelector('[contenteditable="true"]');
|
|
395
|
-
if (!el) throw new Error('editor not ready');
|
|
396
|
-
return el as HTMLElement;
|
|
397
|
-
},
|
|
398
|
-
{ timeout: 10000 }
|
|
399
|
-
)) as HTMLElement;
|
|
400
|
-
|
|
401
|
-
// Type DPQL — the debounced `dpql/parse` (mock echoes the text into an
|
|
402
|
-
// `==` AST) flows through TemplateField's `handleExpressionChange` into
|
|
403
|
-
// FormEngine's 4-arg `handleValueChange`.
|
|
404
|
-
await userEvent.click(editable);
|
|
405
|
-
await userEvent.type(editable, 'name');
|
|
406
|
-
|
|
407
|
-
await waitFor(
|
|
408
|
-
() => {
|
|
409
|
-
const calls = (args.onChange as ReturnType<typeof fn>).mock.calls;
|
|
410
|
-
const last = calls[calls.length - 1]?.[0] as any;
|
|
411
|
-
expect(last?.condition?.is_expression).toBe(true);
|
|
412
|
-
},
|
|
413
|
-
{ timeout: 10000 }
|
|
414
|
-
);
|
|
415
|
-
await waitFor(() => expect(canvas.getByTestId('expression-preview')).toBeInTheDocument(), {
|
|
416
|
-
timeout: 10000,
|
|
417
|
-
});
|
|
418
|
-
await waitForLspIdle(canvasElement);
|
|
419
|
-
},
|
|
420
|
-
};
|
|
421
|
-
|
|
422
|
-
/**
|
|
423
|
-
* A field's declared type travels with every parse, and the answer is shown
|
|
424
|
-
* only where there is something to decide.
|
|
425
|
-
*
|
|
426
|
-
* The mock returns type analysis ONLY when the request carried a
|
|
427
|
-
* `target_type`, exactly as the server does - so these stories fail if the
|
|
428
|
-
* field stops sending it, rather than passing on a fixture.
|
|
429
|
-
*/
|
|
430
|
-
/* `text` is per-story, and that is not cosmetic. `DpqlProbe` caches parse
|
|
431
|
-
results in a session-wide singleton keyed by the TEXT ALONE, so two stories
|
|
432
|
-
typing the same string share one answer: the second gets a cache HIT, sends
|
|
433
|
-
no request at all, and is handed the answer computed for the OTHER field's
|
|
434
|
-
type. That is order-dependent, so it passed locally and failed on CI, where
|
|
435
|
-
the two ran the other way round — and the instrumentation proved it by
|
|
436
|
-
reporting `parses=[]` for a field that was nonetheless showing a parsed
|
|
437
|
-
value. Distinct text per story keeps them independent. */
|
|
438
|
-
const typedExpressionStory = (
|
|
439
|
-
fieldType: string,
|
|
440
|
-
text: string,
|
|
441
|
-
description: string,
|
|
442
|
-
expectation: (canvasElement: HTMLElement) => Promise<void>
|
|
443
|
-
): Story => ({
|
|
444
|
-
parameters: {
|
|
445
|
-
docs: { description: { story: description } },
|
|
446
|
-
},
|
|
447
|
-
render: () => {
|
|
448
|
-
const [value, setValue] = useState<any>({
|
|
449
|
-
amount: { type: fieldType, value: { args: [] }, is_expression: true },
|
|
450
|
-
});
|
|
451
|
-
return (
|
|
452
|
-
<FormEngine
|
|
453
|
-
name='typedExprForm'
|
|
454
|
-
options={
|
|
455
|
-
{
|
|
456
|
-
amount: {
|
|
457
|
-
type: fieldType,
|
|
458
|
-
ui_type: fieldType,
|
|
459
|
-
display_name: 'Amount',
|
|
460
|
-
preselected: true,
|
|
461
|
-
supports_expressions: true,
|
|
462
|
-
expressions: mockExpressions,
|
|
463
|
-
},
|
|
464
|
-
} as any
|
|
465
|
-
}
|
|
466
|
-
value={value}
|
|
467
|
-
onChange={(_n, v) => setValue(v)}
|
|
468
|
-
/>
|
|
469
|
-
);
|
|
470
|
-
},
|
|
471
|
-
async play({ canvasElement }) {
|
|
472
|
-
const canvas = within(canvasElement);
|
|
473
|
-
await userEvent.click(await canvas.findByText('Text'));
|
|
474
|
-
const editable = (await waitFor(
|
|
475
|
-
() => {
|
|
476
|
-
const el = canvasElement.querySelector('[contenteditable="true"]');
|
|
477
|
-
if (!el) throw new Error('editor not ready');
|
|
478
|
-
return el as HTMLElement;
|
|
479
|
-
},
|
|
480
|
-
{ timeout: 10000 }
|
|
481
|
-
)) as HTMLElement;
|
|
482
|
-
/* The editor mounting is NOT the same as the language server being ready,
|
|
483
|
-
and typing into it before the socket is up loses the parse: no request is
|
|
484
|
-
sent, so no `target_type` answer ever comes back and the fit message is
|
|
485
|
-
never rendered. That is a race, not a slow response — raising the
|
|
486
|
-
expectation's timeout would not have helped.
|
|
487
|
-
|
|
488
|
-
It cost a red CI run that was green locally, where the mock connects
|
|
489
|
-
immediately. Worse, it is silent in the sibling story: one that asserts
|
|
490
|
-
the ABSENCE of the message passes for the wrong reason under exactly the
|
|
491
|
-
same race. */
|
|
492
|
-
await waitForLspIdle(canvasElement);
|
|
493
|
-
await userEvent.click(editable);
|
|
494
|
-
await userEvent.type(editable, text);
|
|
495
|
-
await expectation(canvasElement);
|
|
496
|
-
await waitForLspIdle(canvasElement);
|
|
497
|
-
},
|
|
498
|
-
});
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
* Text used as a number: the conversion is attempted, not guaranteed, so the
|
|
502
|
-
* field says so and offers the conversion. The value itself is checked again
|
|
503
|
-
* server-side when the expression actually runs.
|
|
504
|
-
*/
|
|
505
|
-
export const TextModeTypeMayNotFit: Story = typedExpressionStory(
|
|
506
|
-
'int',
|
|
507
|
-
'"a" + 1',
|
|
508
|
-
'Types `"a" + 1` into the Text view of an int field. The expression returns text, so the field warns "This may not fit" and offers the `toInt(…)` conversion.',
|
|
509
|
-
async (canvasElement) => {
|
|
510
|
-
/* Matched against the rendered TEXT, not with `getByText`. `ReqoreMessage`
|
|
511
|
-
renders its title through nested nodes, so an exact single-element match
|
|
512
|
-
reports "unable to find" for a message that is demonstrably on screen —
|
|
513
|
-
the very failure testing-library's own error describes ("the text is
|
|
514
|
-
broken up by multiple elements"). A unit test against this component
|
|
515
|
-
reproduced that directly: the container held the title, the message and
|
|
516
|
-
the fix chip, and `getByText` still could not find it.
|
|
517
|
-
|
|
518
|
-
The assertion stays meaningful: the title has to be present AND the
|
|
519
|
-
suggested conversion has to be the one for this field's type. */
|
|
520
|
-
/* The assertion carries the diagnosis with it. A DOM dump is truncated by
|
|
521
|
-
testing-library and a `console.log` does not reliably reach a CI log, but
|
|
522
|
-
a custom matcher message always does — and the one thing worth knowing
|
|
523
|
-
here is whether the front end SENT `target_type` at all, because the mock
|
|
524
|
-
answers with analysis only when it did. Without this the failure looks
|
|
525
|
-
identical whether the request lacked a target or the answer went
|
|
526
|
-
unrendered. */
|
|
527
|
-
const why = () =>
|
|
528
|
-
`parses=${JSON.stringify(dpqlMockParseCalls)} text=${JSON.stringify(
|
|
529
|
-
(canvasElement.textContent || '').slice(0, 400)
|
|
530
|
-
)}`;
|
|
531
|
-
await waitFor(
|
|
532
|
-
() => {
|
|
533
|
-
expect(canvasElement.textContent, why()).toContain('This may not fit');
|
|
534
|
-
expect(
|
|
535
|
-
canvasElement.querySelector('[data-testid="expression-type-fix"]')?.textContent,
|
|
536
|
-
why()
|
|
537
|
-
).toContain('toInt(');
|
|
538
|
-
},
|
|
539
|
-
{ timeout: 10000 }
|
|
540
|
-
);
|
|
541
|
-
}
|
|
542
|
-
);
|
|
543
|
-
|
|
544
|
-
/**
|
|
545
|
-
* Text used as text needs no conversion at all, so nothing is said. A warning
|
|
546
|
-
* here would be noise, and noise is what teaches people to ignore the
|
|
547
|
-
* warnings that matter.
|
|
548
|
-
*/
|
|
549
|
-
export const TextModeTypeFits: Story = typedExpressionStory(
|
|
550
|
-
'string',
|
|
551
|
-
'"a" + "b"',
|
|
552
|
-
'Types `"a" + "b"` into the Text view of a string field. The expression already returns text, so no fit message is shown.',
|
|
553
|
-
async (canvasElement) => {
|
|
554
|
-
/* Settled when the server has analysed the WHOLE text against this field's
|
|
555
|
-
type — not when a Preview appears, which is shown only when the rendering
|
|
556
|
-
differs from what was typed and so says nothing about the analysis. */
|
|
557
|
-
await waitFor(
|
|
558
|
-
() =>
|
|
559
|
-
expect(
|
|
560
|
-
dpqlMockParseCalls.some((call) => call.text === '"a" + "b"' && call.target === 'string'),
|
|
561
|
-
`parses=${JSON.stringify(dpqlMockParseCalls)}`
|
|
562
|
-
).toBe(true),
|
|
563
|
-
{ timeout: 10000 }
|
|
564
|
-
);
|
|
565
|
-
await waitForLspIdle(canvasElement);
|
|
566
|
-
/* Absence, checked against the rendered text for the same reason its sibling
|
|
567
|
-
checks presence that way: `queryByText` returns null for a message that IS
|
|
568
|
-
on screen but split across nodes, so it would report "no warning" whether
|
|
569
|
-
or not one was drawn — passing for the wrong reason is worse here than
|
|
570
|
-
failing, because absence is the whole claim. */
|
|
571
|
-
expect(canvasElement.textContent).not.toContain('This may not fit');
|
|
572
|
-
expect(canvasElement.textContent).not.toContain('This does not fit');
|
|
573
|
-
}
|
|
574
|
-
);
|
|
575
|
-
|
|
576
|
-
/**
|
|
577
|
-
* An `auto` field accepts anything, so there is nothing to check the
|
|
578
|
-
* expression's return type against and no target is sent at all.
|
|
579
|
-
*
|
|
580
|
-
* This is not a hypothetical. An expression VALUE is
|
|
581
|
-
* `{ is_expression: true, value: {...} }` — a hash whatever the expression
|
|
582
|
-
* computes — and the auto field used to infer its type from that envelope, so
|
|
583
|
-
* writing an expression made the field decide it held a `hash`. That inferred
|
|
584
|
-
* type was then handed back as the return type to check against, and `1 + 2`
|
|
585
|
-
* was rejected on a test assertion's Value with "The expression returns int,
|
|
586
|
-
* and this field holds hash": the field disagreeing with itself about a value
|
|
587
|
-
* the author had just written.
|
|
588
|
-
*/
|
|
589
|
-
export const TextModeAutoAsksNothing: Story = typedExpressionStory(
|
|
590
|
-
'auto',
|
|
591
|
-
'1 + 2',
|
|
592
|
-
'Types `1 + 2` into the Text view of an `auto` field. The field accepts any result, so no return type is sent to the server and no fit message is shown.',
|
|
593
|
-
async (canvasElement) => {
|
|
594
|
-
await waitFor(
|
|
595
|
-
() => {
|
|
596
|
-
expect(canvasElement.querySelector('[contenteditable="true"]')).toBeTruthy();
|
|
597
|
-
},
|
|
598
|
-
{ timeout: 10000 }
|
|
599
|
-
);
|
|
600
|
-
/* The contract, not just the symptom: the mock answers with analysis only
|
|
601
|
-
when a target was sent, so asserting the MESSAGE is absent would also
|
|
602
|
-
pass if the request simply never happened. Assert what was asked. */
|
|
603
|
-
await waitFor(
|
|
604
|
-
() => {
|
|
605
|
-
expect(
|
|
606
|
-
dpqlMockParseCalls.length,
|
|
607
|
-
`parses=${JSON.stringify(dpqlMockParseCalls)}`
|
|
608
|
-
).toBeGreaterThan(0);
|
|
609
|
-
},
|
|
610
|
-
{ timeout: 10000 }
|
|
611
|
-
);
|
|
612
|
-
expect(
|
|
613
|
-
dpqlMockParseCalls.every((call) => !call.target),
|
|
614
|
-
`an auto field must send no target_type: ${JSON.stringify(dpqlMockParseCalls)}`
|
|
615
|
-
).toBe(true);
|
|
616
|
-
expect(canvasElement.textContent).not.toContain('This does not fit');
|
|
617
|
-
expect(canvasElement.textContent).not.toContain('This may not fit');
|
|
618
|
-
}
|
|
619
|
-
);
|
|
620
|
-
|
|
621
|
-
/**
|
|
622
|
-
* Text (DPQL) mode, backed by a mock-socket LSP. Typing DPQL parses to the
|
|
623
|
-
* AST (`dpql/parse`); the "Preview" box reflects it. (Slate typing is
|
|
624
|
-
* driven live; the play test asserts the editor mounted + connected.)
|
|
625
|
-
*/
|
|
626
|
-
export const TextMode: Story = {
|
|
627
|
-
args: {
|
|
628
|
-
value: { is_expression: true, value: { args: [] } },
|
|
629
|
-
defaultMode: 'text',
|
|
630
|
-
},
|
|
631
|
-
parameters: {
|
|
632
|
-
docs: {
|
|
633
|
-
description: {
|
|
634
|
-
story:
|
|
635
|
-
'Renders ExpressionField in Text (DPQL) mode over a mock-socket LSP. Typing DPQL text triggers dpql/parse and the "Preview" box reflects the resulting AST.',
|
|
636
|
-
},
|
|
637
|
-
},
|
|
638
|
-
},
|
|
639
|
-
async play({ canvasElement }) {
|
|
640
|
-
const canvas = within(canvasElement);
|
|
641
|
-
const editable = (await waitFor(
|
|
642
|
-
() => {
|
|
643
|
-
const el = canvasElement.querySelector('[contenteditable="true"]');
|
|
644
|
-
if (!el) throw new Error('editor not ready');
|
|
645
|
-
return el as HTMLElement;
|
|
646
|
-
},
|
|
647
|
-
{ timeout: 6000 }
|
|
648
|
-
)) as HTMLElement;
|
|
649
|
-
|
|
650
|
-
// Type DPQL → debounced `dpql/parse` → AST → the "Preview" box
|
|
651
|
-
// reflects it (the mock echoes the typed text into an `==` expression).
|
|
652
|
-
await userEvent.click(editable);
|
|
653
|
-
await userEvent.type(editable, 'name');
|
|
654
|
-
await waitFor(
|
|
655
|
-
() => expect(canvas.getByTestId('expression-preview').textContent).toContain('name'),
|
|
656
|
-
{ timeout: 6000 }
|
|
657
|
-
);
|
|
658
|
-
await waitForLspIdle(canvasElement);
|
|
659
|
-
},
|
|
660
|
-
};
|
|
661
|
-
|
|
662
|
-
/**
|
|
663
|
-
* A plain `bool` field with `supports_expressions` and no value — starts as
|
|
664
|
-
* the normal field; the "Use Expression" toggle (More menu) switches it.
|
|
665
|
-
* Driven live for the toggle interaction.
|
|
666
|
-
*/
|
|
667
|
-
export const ToggleInFormEngine: Story = {
|
|
668
|
-
parameters: {
|
|
669
|
-
docs: {
|
|
670
|
-
description: {
|
|
671
|
-
story:
|
|
672
|
-
'Renders a FormEngine schema with a plain bool option (supports_expressions, no value). Clicking More then "Use Expression" flips the field to expression mode and the ExpressionField shell with the Visual builder mounts in place of the checkbox.',
|
|
673
|
-
},
|
|
674
|
-
},
|
|
675
|
-
},
|
|
676
|
-
render: () => {
|
|
677
|
-
const [value, setValue] = useState<any>({});
|
|
678
|
-
return (
|
|
679
|
-
<FormEngine
|
|
680
|
-
name='exprToggle'
|
|
681
|
-
options={
|
|
682
|
-
{
|
|
683
|
-
flag: {
|
|
684
|
-
type: 'bool',
|
|
685
|
-
ui_type: 'bool',
|
|
686
|
-
display_name: 'Flag',
|
|
687
|
-
preselected: true,
|
|
688
|
-
supports_expressions: true,
|
|
689
|
-
expressions: mockExpressions,
|
|
690
|
-
},
|
|
691
|
-
} as any
|
|
692
|
-
}
|
|
693
|
-
value={value}
|
|
694
|
-
onChange={(_n, v) => setValue(v)}
|
|
695
|
-
/>
|
|
696
|
-
);
|
|
697
|
-
},
|
|
698
|
-
async play({ canvasElement }) {
|
|
699
|
-
const canvas = within(canvasElement);
|
|
700
|
-
|
|
701
|
-
// Starts as the normal bool field — its "More" menu (TemplateField's
|
|
702
|
-
// `.template-more`) is the entry point to expression mode.
|
|
703
|
-
const more = (await waitFor(
|
|
704
|
-
() => {
|
|
705
|
-
const el = canvasElement.querySelector('.template-more') as HTMLElement | null;
|
|
706
|
-
if (!el) throw new Error('More menu not ready');
|
|
707
|
-
return el;
|
|
708
|
-
},
|
|
709
|
-
{ timeout: 6000 }
|
|
710
|
-
)) as HTMLElement;
|
|
711
|
-
await userEvent.click(more);
|
|
712
|
-
|
|
713
|
-
// "Use Expression" (`.function-selector`) flips the field into expression
|
|
714
|
-
// mode.
|
|
715
|
-
await userEvent.click(await canvas.findByText('Use Expression'));
|
|
716
|
-
|
|
717
|
-
// The ExpressionField shell mounts: its `.expression-field` wrapper, the
|
|
718
|
-
// ported builder (`.expression`), and the Visual/Text toggle.
|
|
719
|
-
await waitFor(
|
|
720
|
-
() => {
|
|
721
|
-
expect(canvasElement.querySelector('.expression-field')).toBeInTheDocument();
|
|
722
|
-
expect(canvasElement.querySelector('.expression')).toBeInTheDocument();
|
|
723
|
-
},
|
|
724
|
-
{ timeout: 6000 }
|
|
725
|
-
);
|
|
726
|
-
await expect(await canvas.findByText('Visual')).toBeInTheDocument();
|
|
727
|
-
},
|
|
728
|
-
};
|
|
729
|
-
|
|
730
|
-
/**
|
|
731
|
-
* Wait for the DOM to stop changing.
|
|
732
|
-
*
|
|
733
|
-
* Both stories below assert a NEGATIVE — that the view the author was put in
|
|
734
|
-
* is not swapped out from under them — and a swap lands a render or two after
|
|
735
|
-
* the interaction that causes it. `waitFor` is therefore no help at all: it
|
|
736
|
-
* passes on the transient state BEFORE the swap and proves nothing. Settling
|
|
737
|
-
* on the DOM going quiet is what makes the assertion mean something.
|
|
738
|
-
*/
|
|
739
|
-
const settle = (root: HTMLElement, quietMs = 400): Promise<void> =>
|
|
740
|
-
new Promise<void>((resolve) => {
|
|
741
|
-
let quiet: ReturnType<typeof setTimeout>;
|
|
742
|
-
const stop = (): void => {
|
|
743
|
-
observer.disconnect();
|
|
744
|
-
resolve();
|
|
745
|
-
};
|
|
746
|
-
const observer = new MutationObserver(() => {
|
|
747
|
-
clearTimeout(quiet);
|
|
748
|
-
quiet = setTimeout(stop, quietMs);
|
|
749
|
-
});
|
|
750
|
-
observer.observe(root, {
|
|
751
|
-
attributes: true,
|
|
752
|
-
characterData: true,
|
|
753
|
-
childList: true,
|
|
754
|
-
subtree: true,
|
|
755
|
-
});
|
|
756
|
-
quiet = setTimeout(stop, quietMs);
|
|
757
|
-
});
|
|
758
|
-
|
|
759
|
-
/** Open a compact row — a read-first row shows its label, not its editor. */
|
|
760
|
-
const openCompactRow = async (canvasElement: HTMLElement): Promise<void> => {
|
|
761
|
-
const label = (await waitFor(
|
|
762
|
-
() => {
|
|
763
|
-
const el = within(canvasElement).queryByText('Value');
|
|
764
|
-
if (!el) throw new Error('row not rendered');
|
|
765
|
-
return el as HTMLElement;
|
|
766
|
-
},
|
|
767
|
-
{ timeout: 10000 }
|
|
768
|
-
)) as HTMLElement;
|
|
769
|
-
if (!canvasElement.querySelector('input[type="text"], textarea, [contenteditable="true"]')) {
|
|
770
|
-
await userEvent.click(label);
|
|
771
|
-
}
|
|
772
|
-
};
|
|
773
|
-
|
|
774
|
-
/**
|
|
775
|
-
* Type an expression into a plain field, accept the offer, and assert the
|
|
776
|
-
* shell opens on TEXT and stays there.
|
|
777
|
-
*
|
|
778
|
-
* Shared so that each story below differs only in the FORM around the field —
|
|
779
|
-
* which is the variable under test, the plain engine being healthy and the
|
|
780
|
-
* arrangements a real consumer builds being the ones that break it.
|
|
781
|
-
*/
|
|
782
|
-
const acceptTypedExpression = async (canvasElement: HTMLElement): Promise<void> => {
|
|
783
|
-
const input = (await waitFor(
|
|
784
|
-
() => {
|
|
785
|
-
const el = canvasElement.querySelector(
|
|
786
|
-
'input[type="text"], textarea, [contenteditable="true"]'
|
|
787
|
-
);
|
|
788
|
-
if (!el) throw new Error('field not ready');
|
|
789
|
-
return el as HTMLElement;
|
|
790
|
-
},
|
|
791
|
-
{ timeout: 10000 }
|
|
792
|
-
)) as HTMLElement;
|
|
793
|
-
|
|
794
|
-
await userEvent.click(input);
|
|
795
|
-
await userEvent.type(input, '1 + 2');
|
|
796
|
-
|
|
797
|
-
// The offer appears only after the server (here the mock) has said the text
|
|
798
|
-
// really is an expression — a successful parse alone means nothing.
|
|
799
|
-
const offer = (await waitFor(
|
|
800
|
-
() => {
|
|
801
|
-
const el = canvasElement.querySelector('.dpql-detected-offer');
|
|
802
|
-
if (!el) throw new Error('offer not made');
|
|
803
|
-
return el as HTMLElement;
|
|
804
|
-
},
|
|
805
|
-
{ timeout: 10000 }
|
|
806
|
-
)) as HTMLElement;
|
|
807
|
-
|
|
808
|
-
await userEvent.click(offer);
|
|
809
|
-
|
|
810
|
-
await waitFor(() => expect(canvasElement.querySelector('.expression-field')).toBeInTheDocument(), {
|
|
811
|
-
timeout: 10000,
|
|
812
|
-
});
|
|
813
|
-
|
|
814
|
-
await settle(canvasElement);
|
|
815
|
-
|
|
816
|
-
// Text, not Visual: the DPQL editor is mounted and the builder is not.
|
|
817
|
-
const editable = canvasElement.querySelector(
|
|
818
|
-
'.expression-field [contenteditable="true"]'
|
|
819
|
-
) as HTMLElement | null;
|
|
820
|
-
expect(editable).toBeInTheDocument();
|
|
821
|
-
expect(canvasElement.querySelector('.expression-field .expression')).not.toBeInTheDocument();
|
|
822
|
-
|
|
823
|
-
/* And it holds the author's own sentence.
|
|
824
|
-
*
|
|
825
|
-
* Landing in Text mode with an EMPTY editor is barely better than landing in
|
|
826
|
-
* the builder: what the author typed is not on screen either way, and a
|
|
827
|
-
* Preview of it sitting beside an empty box reads as the text having been
|
|
828
|
-
* thrown away. The AST reaches this shell one render after the mode does, so
|
|
829
|
-
* this is exactly the assertion that fails when seeding only ever gets one
|
|
830
|
-
* turn. */
|
|
831
|
-
await waitFor(() => expect(editable?.textContent).toContain('1 + 2'), { timeout: 10000 });
|
|
832
|
-
};
|
|
833
|
-
|
|
834
|
-
/**
|
|
835
|
-
* Accepting "Use as expression" lands in TEXT mode, and STAYS there.
|
|
836
|
-
*
|
|
837
|
-
* An author who typed `1 + 2` into a plain field and accepted the offer is
|
|
838
|
-
* already writing in that language: `TemplateField` hands the shell
|
|
839
|
-
* `defaultMode='text'` for exactly that reason. Landing them in the visual
|
|
840
|
-
* builder instead makes them find their own sentence again — and the sentence
|
|
841
|
-
* they typed is not shown anywhere, because the builder renders operands, not
|
|
842
|
-
* text.
|
|
843
|
-
*
|
|
844
|
-
* The whole path is covered deliberately: the offer is the ONLY entry that
|
|
845
|
-
* asks for Text mode, so a story that enters expression mode through the More
|
|
846
|
-
* menu (`ToggleInFormEngine`) cannot guard it — that route never sets
|
|
847
|
-
* `expressionFromText` and correctly lands on Visual.
|
|
848
|
-
*/
|
|
849
|
-
export const OfferAcceptedOpensTextMode: Story = {
|
|
850
|
-
parameters: {
|
|
851
|
-
docs: {
|
|
852
|
-
description: {
|
|
853
|
-
story:
|
|
854
|
-
'Types DPQL into a plain string field, accepts the "Use as expression" offer, and asserts the expression shell opens on Text (the DPQL editor seeded with the typed text) rather than on the visual builder — and stays there once the DOM settles.',
|
|
855
|
-
},
|
|
856
|
-
},
|
|
857
|
-
},
|
|
858
|
-
render: () => {
|
|
859
|
-
const [value, setValue] = useState<any>({});
|
|
860
|
-
return (
|
|
861
|
-
<FormEngine
|
|
862
|
-
name='dpqlOfferForm'
|
|
863
|
-
options={
|
|
864
|
-
{
|
|
865
|
-
expected: {
|
|
866
|
-
type: 'string',
|
|
867
|
-
ui_type: 'string',
|
|
868
|
-
display_name: 'Value',
|
|
869
|
-
preselected: true,
|
|
870
|
-
supports_expressions: true,
|
|
871
|
-
expressions: mockExpressions,
|
|
872
|
-
},
|
|
873
|
-
} as any
|
|
874
|
-
}
|
|
875
|
-
value={value}
|
|
876
|
-
onChange={(_n, v) => setValue(v)}
|
|
877
|
-
/>
|
|
878
|
-
);
|
|
879
|
-
},
|
|
880
|
-
async play({ canvasElement }) {
|
|
881
|
-
await acceptTypedExpression(canvasElement);
|
|
882
|
-
},
|
|
883
|
-
};
|
|
884
|
-
|
|
885
|
-
/**
|
|
886
|
-
* The accepted offer survives a host that rebuilds the field's schema.
|
|
887
|
-
*
|
|
888
|
-
* A consumer form does not hand the engine one frozen schema. qorus-ide's test
|
|
889
|
-
* step drawer derives the schema it passes FROM the current value — a path that
|
|
890
|
-
* holds a reference is given the reference editor, a compared value is typed by
|
|
891
|
-
* the path it is compared against — so the engine is handed a brand-new options
|
|
892
|
-
* object on every change, including the one the accepted offer itself causes.
|
|
893
|
-
*
|
|
894
|
-
* The offer's whole promise is that the author keeps writing where they were
|
|
895
|
-
* writing. If a re-derived schema takes that away, the promise is only kept on
|
|
896
|
-
* forms simple enough not to have one, which is not the form this feature was
|
|
897
|
-
* built for.
|
|
898
|
-
*/
|
|
899
|
-
export const OfferSurvivesARederivedSchema: Story = {
|
|
900
|
-
parameters: {
|
|
901
|
-
docs: {
|
|
902
|
-
description: {
|
|
903
|
-
story:
|
|
904
|
-
"Repeats the accepted-offer flow against a host that rebuilds the options schema from the value on every change (as qorus-ide's step drawer does) — the Text view the offer opened must survive the churn.",
|
|
905
|
-
},
|
|
906
|
-
},
|
|
907
|
-
},
|
|
908
|
-
render: () => {
|
|
909
|
-
const [value, setValue] = useState<any>({});
|
|
910
|
-
// Rebuilt from the value, so its identity changes on every edit — the
|
|
911
|
-
// host behaviour being modelled.
|
|
912
|
-
const options = useMemo(
|
|
913
|
-
() =>
|
|
914
|
-
({
|
|
915
|
-
expected: {
|
|
916
|
-
type: 'string',
|
|
917
|
-
ui_type: 'string',
|
|
918
|
-
display_name: 'Value',
|
|
919
|
-
preselected: true,
|
|
920
|
-
supports_expressions: true,
|
|
921
|
-
expressions: mockExpressions,
|
|
922
|
-
},
|
|
923
|
-
}) as any,
|
|
924
|
-
[value]
|
|
925
|
-
);
|
|
926
|
-
return (
|
|
927
|
-
<FormEngine
|
|
928
|
-
name='dpqlOfferChurnForm'
|
|
929
|
-
options={options}
|
|
930
|
-
value={value}
|
|
931
|
-
onChange={(_n, v) => setValue(v)}
|
|
932
|
-
/>
|
|
933
|
-
);
|
|
934
|
-
},
|
|
935
|
-
async play({ canvasElement }) {
|
|
936
|
-
await acceptTypedExpression(canvasElement);
|
|
937
|
-
},
|
|
938
|
-
};
|
|
939
|
-
|
|
940
|
-
/**
|
|
941
|
-
* The accepted offer survives the COMPACT read-first row.
|
|
942
|
-
*
|
|
943
|
-
* The forms this feature was built for are compact ones — qorus-ide's test step
|
|
944
|
-
* drawer renders every option as a read-first row that shows a summary of what
|
|
945
|
-
* the field holds and opens onto the editor. Accepting the offer is the moment
|
|
946
|
-
* a field that held nothing starts holding something, so it is exactly the
|
|
947
|
-
* moment that treatment changes, and the author is inside the control while it
|
|
948
|
-
* does.
|
|
949
|
-
*/
|
|
950
|
-
export const OfferSurvivesACompactRow: Story = {
|
|
951
|
-
parameters: {
|
|
952
|
-
docs: {
|
|
953
|
-
description: {
|
|
954
|
-
story:
|
|
955
|
-
'Repeats the accepted-offer flow in a compact (read-first) form whose schema is rebuilt from the value — the arrangement qorus-ide uses — and asserts the Text view survives it.',
|
|
956
|
-
},
|
|
957
|
-
},
|
|
958
|
-
},
|
|
959
|
-
render: () => {
|
|
960
|
-
const [value, setValue] = useState<any>({});
|
|
961
|
-
const options = useMemo(
|
|
962
|
-
() =>
|
|
963
|
-
({
|
|
964
|
-
expected: {
|
|
965
|
-
type: 'string',
|
|
966
|
-
ui_type: 'string',
|
|
967
|
-
display_name: 'Value',
|
|
968
|
-
preselected: true,
|
|
969
|
-
supports_expressions: true,
|
|
970
|
-
expressions: mockExpressions,
|
|
971
|
-
},
|
|
972
|
-
}) as any,
|
|
973
|
-
[value]
|
|
974
|
-
);
|
|
975
|
-
return (
|
|
976
|
-
<FormEngine
|
|
977
|
-
name='dpqlOfferCompactForm'
|
|
978
|
-
compact
|
|
979
|
-
flat
|
|
980
|
-
transparent
|
|
981
|
-
padded={false}
|
|
982
|
-
showTypeToggle={false}
|
|
983
|
-
size='small'
|
|
984
|
-
options={options}
|
|
985
|
-
value={value}
|
|
986
|
-
onChange={(_n, v) => setValue(v)}
|
|
987
|
-
/>
|
|
988
|
-
);
|
|
989
|
-
},
|
|
990
|
-
async play({ canvasElement }) {
|
|
991
|
-
await openCompactRow(canvasElement);
|
|
992
|
-
await acceptTypedExpression(canvasElement);
|
|
993
|
-
},
|
|
994
|
-
};
|
|
995
|
-
|
|
996
|
-
/**
|
|
997
|
-
* The Text view survives the host answering LATE about the field.
|
|
998
|
-
*
|
|
999
|
-
* A consumer does not settle a row's schema the moment it is drawn. qorus-ide
|
|
1000
|
-
* re-derives these rows from catalogues it is still fetching — the type a
|
|
1001
|
-
* compared value gets is read off the reference it is compared against — so the
|
|
1002
|
-
* type a row was OPENED with is not always the type it ends up with, and the
|
|
1003
|
-
* change can land a second or two after the author has already acted.
|
|
1004
|
-
*
|
|
1005
|
-
* That is the reported symptom this covers, and it is the one that made the bug
|
|
1006
|
-
* look intermittent rather than reproducible: clicking Text appeared to work,
|
|
1007
|
-
* and then a moment later the control was back on Visual with nothing on screen
|
|
1008
|
-
* to say why.
|
|
1009
|
-
*/
|
|
1010
|
-
export const TextViewSurvivesALateHostChange: Story = {
|
|
1011
|
-
parameters: {
|
|
1012
|
-
docs: {
|
|
1013
|
-
description: {
|
|
1014
|
-
story:
|
|
1015
|
-
"Accepts the offer in a compact row, then has the host re-type the field a moment later (as qorus-ide does when its reference catalogue answers) — the Text view must not be swapped out from under the author.",
|
|
1016
|
-
},
|
|
1017
|
-
},
|
|
1018
|
-
},
|
|
1019
|
-
render: () => {
|
|
1020
|
-
const [value, setValue] = useState<any>({});
|
|
1021
|
-
const [retyped, setRetyped] = useState(false);
|
|
1022
|
-
// Fires once the field is holding an expression: the host's answer lands
|
|
1023
|
-
// after the author has already accepted the offer.
|
|
1024
|
-
const isExpression = !!value?.expected?.is_expression;
|
|
1025
|
-
useEffect(() => {
|
|
1026
|
-
if (!isExpression) return undefined;
|
|
1027
|
-
const timer = setTimeout(() => setRetyped(true), 500);
|
|
1028
|
-
return () => clearTimeout(timer);
|
|
1029
|
-
}, [isExpression]);
|
|
1030
|
-
const options = useMemo(
|
|
1031
|
-
() =>
|
|
1032
|
-
({
|
|
1033
|
-
expected: {
|
|
1034
|
-
// `auto` is one of the types a compact row opens as a CARD rather
|
|
1035
|
-
// than in place, so this is a re-type that moves the editor — the
|
|
1036
|
-
// whole point of the exercise.
|
|
1037
|
-
type: retyped ? 'auto' : 'string',
|
|
1038
|
-
ui_type: retyped ? 'auto' : 'string',
|
|
1039
|
-
display_name: 'Value',
|
|
1040
|
-
preselected: true,
|
|
1041
|
-
supports_expressions: true,
|
|
1042
|
-
expressions: mockExpressions,
|
|
1043
|
-
},
|
|
1044
|
-
}) as any,
|
|
1045
|
-
[retyped]
|
|
1046
|
-
);
|
|
1047
|
-
return (
|
|
1048
|
-
/* The host's answer is not otherwise visible, and the assertion has to
|
|
1049
|
-
wait for it rather than for a duration. An attribute, not text: a
|
|
1050
|
-
printed "true" ended up in the story's snapshot. */
|
|
1051
|
-
<div data-host-retyped={String(retyped)}>
|
|
1052
|
-
<FormEngine
|
|
1053
|
-
name='dpqlOfferLateForm'
|
|
1054
|
-
compact
|
|
1055
|
-
flat
|
|
1056
|
-
transparent
|
|
1057
|
-
padded={false}
|
|
1058
|
-
showTypeToggle={false}
|
|
1059
|
-
size='small'
|
|
1060
|
-
options={options}
|
|
1061
|
-
value={value}
|
|
1062
|
-
onChange={(_n, v) => setValue(v)}
|
|
1063
|
-
/>
|
|
1064
|
-
</div>
|
|
1065
|
-
);
|
|
1066
|
-
},
|
|
1067
|
-
async play({ canvasElement }) {
|
|
1068
|
-
await openCompactRow(canvasElement);
|
|
1069
|
-
await acceptTypedExpression(canvasElement);
|
|
1070
|
-
|
|
1071
|
-
// Wait for the host's late answer to actually land — a timeout here would
|
|
1072
|
-
// make the assertion a race.
|
|
1073
|
-
await waitFor(
|
|
1074
|
-
() => expect(canvasElement.querySelector('[data-host-retyped="true"]')).toBeTruthy(),
|
|
1075
|
-
{ timeout: 10000 }
|
|
1076
|
-
);
|
|
1077
|
-
await settle(canvasElement);
|
|
1078
|
-
|
|
1079
|
-
expect(
|
|
1080
|
-
canvasElement.querySelector('.expression-field [contenteditable="true"]')
|
|
1081
|
-
).toBeInTheDocument();
|
|
1082
|
-
expect(canvasElement.querySelector('.expression-field .expression')).not.toBeInTheDocument();
|
|
1083
|
-
},
|
|
1084
|
-
};
|
|
1085
|
-
|
|
1086
|
-
/**
|
|
1087
|
-
* The field's own menu stays in the toolbar row.
|
|
1088
|
-
*
|
|
1089
|
-
* `TemplateField` renders its controls — the More menu that offers "Use
|
|
1090
|
-
* Template", and the undo for an accepted offer — as SIBLINGS of the expression
|
|
1091
|
-
* shell. Beside an ordinary one-line editor, centring that menu in the flex
|
|
1092
|
-
* line is what lines it up with the row's other buttons.
|
|
1093
|
-
*
|
|
1094
|
-
* The shell is not one line. It is a toolbar with an editor, a type message and
|
|
1095
|
-
* a preview stacked under it, so centring put the menu somewhere down the side
|
|
1096
|
-
* of that block — level with nothing, overlapping the editor, and a long way
|
|
1097
|
-
* from the Undo it belongs beside.
|
|
1098
|
-
*
|
|
1099
|
-
* Only reachable with templates ON OFFER, which is why the stories above miss
|
|
1100
|
-
* it: with nothing to offer the menu is not rendered at all.
|
|
1101
|
-
*
|
|
1102
|
-
* Inside a form row the field no longer draws that menu itself: it publishes
|
|
1103
|
-
* its items into the row's own ⋮ (`rowMenuContext` — one menu per control), so
|
|
1104
|
-
* the menu asserted here is the row's, and the field's own must be absent.
|
|
1105
|
-
*/
|
|
1106
|
-
export const FieldMenuStaysInTheToolbar: Story = {
|
|
1107
|
-
parameters: {
|
|
1108
|
-
docs: {
|
|
1109
|
-
description: {
|
|
1110
|
-
story:
|
|
1111
|
-
"Accepts the offer on a compact row whose field also has templates. The row shows ONE More menu — the field publishes its items into the row's ⋮ rather than drawing its own — and that menu sits in the shell's toolbar row, level with Undo, not part-way down the editor.",
|
|
1112
|
-
},
|
|
1113
|
-
},
|
|
1114
|
-
},
|
|
1115
|
-
render: () => {
|
|
1116
|
-
const [value, setValue] = useState<any>({});
|
|
1117
|
-
return (
|
|
1118
|
-
<FormEngine
|
|
1119
|
-
name='dpqlOfferToolbarForm'
|
|
1120
|
-
compact
|
|
1121
|
-
flat
|
|
1122
|
-
transparent
|
|
1123
|
-
padded={false}
|
|
1124
|
-
showTypeToggle={false}
|
|
1125
|
-
size='small'
|
|
1126
|
-
options={
|
|
1127
|
-
{
|
|
1128
|
-
expected: {
|
|
1129
|
-
type: 'string',
|
|
1130
|
-
ui_type: 'string',
|
|
1131
|
-
display_name: 'Value',
|
|
1132
|
-
preselected: true,
|
|
1133
|
-
supports_expressions: true,
|
|
1134
|
-
supports_templates: true,
|
|
1135
|
-
expressions: mockExpressions,
|
|
1136
|
-
templates: {
|
|
1137
|
-
items: [
|
|
1138
|
-
{
|
|
1139
|
-
label: 'Values this case captures',
|
|
1140
|
-
items: [{ label: 'Order status', value: '$.order.status', badge: 'string' }],
|
|
1141
|
-
},
|
|
1142
|
-
],
|
|
1143
|
-
},
|
|
1144
|
-
},
|
|
1145
|
-
} as any
|
|
1146
|
-
}
|
|
1147
|
-
value={value}
|
|
1148
|
-
onChange={(_n, v) => setValue(v)}
|
|
1149
|
-
/>
|
|
1150
|
-
);
|
|
1151
|
-
},
|
|
1152
|
-
async play({ canvasElement }) {
|
|
1153
|
-
await openCompactRow(canvasElement);
|
|
1154
|
-
await acceptTypedExpression(canvasElement);
|
|
1155
|
-
|
|
1156
|
-
// One menu per control: the row's ⋮, not a second one drawn by the field.
|
|
1157
|
-
expect(canvasElement.querySelector('.template-more')).toBeNull();
|
|
1158
|
-
const menus = canvasElement.querySelectorAll('.options-readfirst-more');
|
|
1159
|
-
expect(menus).toHaveLength(1);
|
|
1160
|
-
const menu = menus[0] as HTMLElement;
|
|
1161
|
-
|
|
1162
|
-
// The toolbar row is the shell's first line — the Visual/Text toggle.
|
|
1163
|
-
const toggle = within(canvasElement).getByText('Text').closest('button') as HTMLElement;
|
|
1164
|
-
const toolbar = toggle.getBoundingClientRect();
|
|
1165
|
-
const control = menu.getBoundingClientRect();
|
|
1166
|
-
|
|
1167
|
-
/* Reported as numbers: "the menu is in the wrong place" is not something a
|
|
1168
|
-
CI log can show, and the two rectangles are the whole story. */
|
|
1169
|
-
const where = `toolbar ${Math.round(toolbar.top)}–${Math.round(
|
|
1170
|
-
toolbar.bottom
|
|
1171
|
-
)}, menu ${Math.round(control.top)}–${Math.round(control.bottom)}`;
|
|
1172
|
-
|
|
1173
|
-
// Level with the toolbar: the menu's own centre falls inside that row.
|
|
1174
|
-
const centre = control.top + control.height / 2;
|
|
1175
|
-
expect(
|
|
1176
|
-
centre >= toolbar.top && centre <= toolbar.bottom,
|
|
1177
|
-
`the field's More menu should sit in the toolbar row — ${where}`
|
|
1178
|
-
).toBe(true);
|
|
1179
|
-
},
|
|
1180
|
-
};
|
|
1181
|
-
|
|
1182
|
-
/**
|
|
1183
|
-
* The Text editor seeds from an AST that arrives AFTER the mode flips.
|
|
1184
|
-
*
|
|
1185
|
-
* `TemplateField` passes the shell its OWN `value` prop, and on the render
|
|
1186
|
-
* that flips the field into expression mode that prop is still the STRING the
|
|
1187
|
-
* author typed — the parsed AST only comes back through the host form one
|
|
1188
|
-
* render later. So the shell mounts in Text mode with nothing to serialize,
|
|
1189
|
-
* and an effect that runs on the mode alone has already had its only turn: the
|
|
1190
|
-
* author gets an empty editor with a Preview of an expression sitting beside
|
|
1191
|
-
* it, which reads as the text having been thrown away.
|
|
1192
|
-
*
|
|
1193
|
-
* Modelled here rather than live because it is a pure ordering problem — no
|
|
1194
|
-
* instance, no offer, no host form. The late arrival is the whole test.
|
|
1195
|
-
*/
|
|
1196
|
-
export const TextModeSeedsWhenAstArrivesLate: Story = {
|
|
1197
|
-
parameters: {
|
|
1198
|
-
docs: {
|
|
1199
|
-
description: {
|
|
1200
|
-
story:
|
|
1201
|
-
"Mounts the shell in Text mode with a value that is not yet an AST, then delivers the AST a moment later — the DPQL editor must seed from it rather than stay empty.",
|
|
1202
|
-
},
|
|
1203
|
-
},
|
|
1204
|
-
},
|
|
1205
|
-
render: () => {
|
|
1206
|
-
const [value, setValue] = useState<IExpression>({
|
|
1207
|
-
is_expression: true,
|
|
1208
|
-
// What `TemplateField` actually holds at that moment: the typed text.
|
|
1209
|
-
value: '1 + 2' as unknown as IExpression['value'],
|
|
1210
|
-
});
|
|
1211
|
-
useEffect(() => {
|
|
1212
|
-
const timer = setTimeout(() => setValue(SAMPLE), 100);
|
|
1213
|
-
return () => clearTimeout(timer);
|
|
1214
|
-
}, []);
|
|
1215
|
-
return (
|
|
1216
|
-
<ExpressionField
|
|
1217
|
-
value={value}
|
|
1218
|
-
onChange={noopChange}
|
|
1219
|
-
defaultMode='text'
|
|
1220
|
-
expressions={mockExpressions}
|
|
1221
|
-
/>
|
|
1222
|
-
);
|
|
1223
|
-
},
|
|
1224
|
-
async play({ canvasElement }) {
|
|
1225
|
-
const editable = (await waitFor(
|
|
1226
|
-
() => {
|
|
1227
|
-
const el = canvasElement.querySelector('[contenteditable="true"]');
|
|
1228
|
-
if (!el) throw new Error('editor not ready');
|
|
1229
|
-
return el as HTMLElement;
|
|
1230
|
-
},
|
|
1231
|
-
{ timeout: 10000 }
|
|
1232
|
-
)) as HTMLElement;
|
|
1233
|
-
|
|
1234
|
-
// The AST arrives late; the editor must catch up with it.
|
|
1235
|
-
await waitFor(
|
|
1236
|
-
() => {
|
|
1237
|
-
expect(editable.textContent).toMatch(/local:?\s*name/);
|
|
1238
|
-
expect(editable.textContent).toContain('John');
|
|
1239
|
-
},
|
|
1240
|
-
{ timeout: 10000 }
|
|
1241
|
-
);
|
|
1242
|
-
await waitForLspIdle(canvasElement);
|
|
1243
|
-
},
|
|
1244
|
-
};
|
|
1245
|
-
|
|
1246
|
-
/**
|
|
1247
|
-
* The Text view offers template completions.
|
|
1248
|
-
*
|
|
1249
|
-
* Templates are how an author names a value the surrounding interface already
|
|
1250
|
-
* has, and the Text view is a DPQL editor like any other: typing `$` asks the
|
|
1251
|
-
* language server, in position, and shows what it answers. Nothing about
|
|
1252
|
-
* mounting that editor inside the expression shell changes it — the shell
|
|
1253
|
-
* passes no template list of its own, because there is none to pass.
|
|
1254
|
-
*
|
|
1255
|
-
* Asserted here because it had never been asserted anywhere: the shell's Text
|
|
1256
|
-
* view had only ever been exercised for parse, serialize and type analysis, so
|
|
1257
|
-
* "does `$` still work in there?" was an open question with no cost to
|
|
1258
|
-
* answering. What this covers is the CLIENT half — that the shell surfaces
|
|
1259
|
-
* what the server offers. Which contexts the live Qorus server offers is its
|
|
1260
|
-
* own question, and this cannot answer it.
|
|
1261
|
-
*/
|
|
1262
|
-
export const TextModeOffersTemplateCompletions: Story = {
|
|
1263
|
-
args: {
|
|
1264
|
-
value: { is_expression: true, value: { args: [] } },
|
|
1265
|
-
defaultMode: 'text',
|
|
1266
|
-
},
|
|
1267
|
-
parameters: {
|
|
1268
|
-
docs: {
|
|
1269
|
-
description: {
|
|
1270
|
-
story:
|
|
1271
|
-
'Types `$` into the shell\'s Text view — the DPQL editor asks the language server in position and the template namespaces ($data:, $config:, …) open in the completion dropdown.',
|
|
1272
|
-
},
|
|
1273
|
-
},
|
|
1274
|
-
},
|
|
1275
|
-
async play({ canvasElement }) {
|
|
1276
|
-
const editable = (await waitFor(
|
|
1277
|
-
() => {
|
|
1278
|
-
const el = canvasElement.querySelector('[contenteditable="true"]');
|
|
1279
|
-
if (!el) throw new Error('editor not ready');
|
|
1280
|
-
return el as HTMLElement;
|
|
1281
|
-
},
|
|
1282
|
-
{ timeout: 10000 }
|
|
1283
|
-
)) as HTMLElement;
|
|
1284
|
-
|
|
1285
|
-
// The editor mounting is not the language server being ready, and a `$`
|
|
1286
|
-
// typed before the socket is up asks nothing at all.
|
|
1287
|
-
await waitForLspIdle(canvasElement);
|
|
1288
|
-
await userEvent.click(editable);
|
|
1289
|
-
await userEvent.type(editable, '$');
|
|
1290
|
-
|
|
1291
|
-
// The dropdown is portalled, so it is looked for in the document rather
|
|
1292
|
-
// than in the canvas.
|
|
1293
|
-
await waitFor(
|
|
1294
|
-
() => {
|
|
1295
|
-
const dropdown = document.querySelector('.reqore-menu');
|
|
1296
|
-
expect(dropdown).not.toBeNull();
|
|
1297
|
-
expect(dropdown!.textContent).toContain('$data:');
|
|
1298
|
-
expect(dropdown!.textContent).toContain('$config:');
|
|
1299
|
-
},
|
|
1300
|
-
{ timeout: 20000 }
|
|
1301
|
-
);
|
|
1302
|
-
},
|
|
1303
|
-
};
|
|
1304
|
-
|
|
1305
|
-
/**
|
|
1306
|
-
* LIVE — fetches the real expression catalogue from the configured Qorus
|
|
1307
|
-
* instance (no `expressions` override). This is the true apples-to-apples
|
|
1308
|
-
* with qorus-ide: the picker shows the full ~121-function catalogue and
|
|
1309
|
-
* schema-driven operands / operator words.
|
|
1310
|
-
*
|
|
1311
|
-
* Prereq (same as the DpqlEditor live stories): point the storybook at a
|
|
1312
|
-
* reachable instance + token, e.g.
|
|
1313
|
-
* `REACT_APP_QORUS_INSTANCE=https://localhost:8012/ REACT_APP_QORUS_TOKEN=<token> yarn storybook`
|
|
1314
|
-
* Without a reachable instance the picker shows "No data available". Marked
|
|
1315
|
-
* `live` so it is skipped by the offline test-runner.
|
|
1316
|
-
*/
|
|
1317
|
-
export const Live: Story = {
|
|
1318
|
-
// Real catalogue fetch — excluded from the offline play-test runner
|
|
1319
|
-
// (network/auth), still snapshotted by Chromatic. Mirrors the DpqlEditor
|
|
1320
|
-
// live stories.
|
|
1321
|
-
tags: ['!test'],
|
|
1322
|
-
parameters: {
|
|
1323
|
-
live: true,
|
|
1324
|
-
docs: {
|
|
1325
|
-
description: {
|
|
1326
|
-
story:
|
|
1327
|
-
'Renders ExpressionField against a live Qorus instance — the picker fetches the real ~121-function catalogue rather than the mock, and the seeded "contains" expression exercises the schema-driven operators and operands.',
|
|
1328
|
-
},
|
|
1329
|
-
},
|
|
1330
|
-
},
|
|
1331
|
-
args: {
|
|
1332
|
-
type: 'bool',
|
|
1333
|
-
value: {
|
|
1334
|
-
is_expression: true,
|
|
1335
|
-
value: {
|
|
1336
|
-
exp: 'contains',
|
|
1337
|
-
args: [
|
|
1338
|
-
{ type: 'string', value: '$local:input' },
|
|
1339
|
-
{ type: 'string', value: 'es' },
|
|
1340
|
-
{ type: 'bool', value: true },
|
|
1341
|
-
],
|
|
1342
|
-
},
|
|
1343
|
-
},
|
|
1344
|
-
},
|
|
1345
|
-
render(args) {
|
|
1346
|
-
const [value, setValue] = useState<IExpression | undefined>(args.value);
|
|
1347
|
-
// No `expressions` prop → ExpressionField fetches the real catalogue.
|
|
1348
|
-
return (
|
|
1349
|
-
<ExpressionField
|
|
1350
|
-
type={args.type}
|
|
1351
|
-
returnType={args.type}
|
|
1352
|
-
value={value}
|
|
1353
|
-
onChange={(v) => {
|
|
1354
|
-
args.onChange?.(v);
|
|
1355
|
-
setValue(v);
|
|
1356
|
-
}}
|
|
1357
|
-
/>
|
|
1358
|
-
);
|
|
1359
|
-
},
|
|
1360
|
-
};
|
|
1361
|
-
|
|
1362
|
-
/**
|
|
1363
|
-
* LIVE — server-side rendering over the LSP (`dpql/renderExpression`). Text
|
|
1364
|
-
* mode against the real instance: the live "Preview" box should show the
|
|
1365
|
-
* server rendering — `"test".startsWith("t", true)` — not the DPQL form
|
|
1366
|
-
* (`"test" startsWith "t"`). Compare with
|
|
1367
|
-
* qorus-ide's Explain (storybook :6007) for the same AST. Prereq: same as
|
|
1368
|
-
* `Live`; note the LSP WebSocket is NOT CORS-blocked, unlike REST fetches
|
|
1369
|
-
* from storybook to localhost:8012.
|
|
1370
|
-
*/
|
|
1371
|
-
export const LiveExplain: Story = {
|
|
1372
|
-
tags: ['!test'],
|
|
1373
|
-
parameters: {
|
|
1374
|
-
live: true,
|
|
1375
|
-
docs: {
|
|
1376
|
-
description: {
|
|
1377
|
-
story:
|
|
1378
|
-
'Renders ExpressionField in Text mode against a live Qorus instance — the "Preview" box shows the server\'s readable rendering from dpql/renderExpression, `"test".startsWith("t", true)`, beside the DPQL it was written as, `"test" startsWith "t"`.',
|
|
1379
|
-
},
|
|
1380
|
-
},
|
|
1381
|
-
},
|
|
1382
|
-
args: {
|
|
1383
|
-
value: {
|
|
1384
|
-
is_expression: true,
|
|
1385
|
-
value: {
|
|
1386
|
-
exp: 'starts-with',
|
|
1387
|
-
args: [
|
|
1388
|
-
{ type: 'string', value: 'test' },
|
|
1389
|
-
{ type: 'string', value: 't' },
|
|
1390
|
-
],
|
|
1391
|
-
},
|
|
1392
|
-
},
|
|
1393
|
-
defaultMode: 'text',
|
|
1394
|
-
},
|
|
1395
|
-
};
|