@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,1683 +0,0 @@
|
|
|
1
|
-
// Ported from qorus-ide `src/stories/Components/ExpressionBuilder.stories.tsx`.
|
|
2
|
-
// Adaptations: import the ported builder from `./index`; drive the catalogue
|
|
3
|
-
// offline via `mockExpressions` (passed as the `expressions` prop) instead of a
|
|
4
|
-
// live server; the IDE's `_testsClickButton` / `_testsSelectItemFromCollection`
|
|
5
|
-
// helpers are inlined here with `@storybook/test` primitives. The count-based
|
|
6
|
-
// assertions (`.expression`, `.expression-and`, `.expression-or`) are preserved.
|
|
7
|
-
import { StoryObj } from '@storybook/react-vite';
|
|
8
|
-
import { expect, fireEvent, fn, userEvent, waitFor, within } from 'storybook/test';
|
|
9
|
-
import { useState } from 'react';
|
|
10
|
-
import { sleep } from '../../../../../__tests__/utils';
|
|
11
|
-
import { StoryMeta } from '../../../../types';
|
|
12
|
-
import { templateChipLabel } from '../../../../helpers/templateText';
|
|
13
|
-
import { mockExpressions } from '../mockExpressions';
|
|
14
|
-
import { IExpression } from '../types';
|
|
15
|
-
import { ExpressionBuilder } from './index';
|
|
16
|
-
|
|
17
|
-
// --- inlined test helpers (equivalents of the IDE `../Tests/utils`) ---------
|
|
18
|
-
|
|
19
|
-
/** Count regular expression cards (`.expression`). */
|
|
20
|
-
const expressionCount = (scope: ParentNode = document) =>
|
|
21
|
-
scope.querySelectorAll('.expression').length;
|
|
22
|
-
|
|
23
|
-
/** Click a ReqoreButton by visible label (anywhere in the document). */
|
|
24
|
-
const clickButtonByLabel = async (label: string) => {
|
|
25
|
-
const body = within(document.body);
|
|
26
|
-
const el = await body.findByText(label, undefined, { timeout: 10000 });
|
|
27
|
-
await fireEvent.click(el);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
/** Click a button by CSS selector. */
|
|
31
|
-
const clickSelector = async (selector: string, nth = 0, scope: ParentNode = document) => {
|
|
32
|
-
const els = scope.querySelectorAll(selector);
|
|
33
|
-
await fireEvent.click(els[nth]);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
/** Wait for some text to appear in the document. */
|
|
37
|
-
const waitForText = async (text: string | RegExp, scope: HTMLElement = document.body) => {
|
|
38
|
-
const body = within(scope);
|
|
39
|
-
await waitFor(() => expect(body.queryAllByText(text)[0]).toBeTruthy(), { timeout: 10000 });
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Equivalent of the IDE's `_testsSelectItemFromCollection`: open the operator
|
|
44
|
-
* picker (a `Select` rendered as a button labelled `currentLabel`), then click
|
|
45
|
-
* the target item in the collection modal. The picker has descriptions, so the
|
|
46
|
-
* toolkit `Select` opens a `SelectFieldCollection` modal (not an inline
|
|
47
|
-
* dropdown) — the item is a collection button with the display name as text.
|
|
48
|
-
*/
|
|
49
|
-
const selectOperation = async (
|
|
50
|
-
currentLabel: string,
|
|
51
|
-
itemLabel: string,
|
|
52
|
-
ownerDocument: Document = document
|
|
53
|
-
) => {
|
|
54
|
-
const body = within(ownerDocument.body);
|
|
55
|
-
// Open the picker (placeholder when empty, or the current operation name).
|
|
56
|
-
const trigger = await body.findByText(currentLabel, undefined, { timeout: 10000 });
|
|
57
|
-
await fireEvent.click(trigger);
|
|
58
|
-
// Click the item inside the now-open collection modal.
|
|
59
|
-
const item = await waitFor(
|
|
60
|
-
() => {
|
|
61
|
-
const el = within(ownerDocument.body).queryAllByText(itemLabel)[0];
|
|
62
|
-
if (!el) throw new Error(`collection item "${itemLabel}" not ready`);
|
|
63
|
-
return el;
|
|
64
|
-
},
|
|
65
|
-
{ timeout: 10000 }
|
|
66
|
-
);
|
|
67
|
-
await fireEvent.click(item);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
/** Count varargs remove-argument buttons (`.expression-remove-arg`). */
|
|
71
|
-
const removeArgCount = () => document.querySelectorAll('.expression-remove-arg').length;
|
|
72
|
-
|
|
73
|
-
// --- fixtures ---------------------------------------------------------------
|
|
74
|
-
|
|
75
|
-
const localTemplates = {
|
|
76
|
-
label: 'Testing',
|
|
77
|
-
items: [
|
|
78
|
-
{
|
|
79
|
-
label: 'Testing bool',
|
|
80
|
-
badge: 'Test',
|
|
81
|
-
items: [{ label: 'Testing bool', badge: 'bool', value: '$local:some-bool' }],
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
label: 'Testing Richtext',
|
|
85
|
-
badge: 'richtext',
|
|
86
|
-
items: [{ label: 'Richtext Template', badge: 'richtext', value: '$local:some-richtext' }],
|
|
87
|
-
},
|
|
88
|
-
],
|
|
89
|
-
} as any;
|
|
90
|
-
|
|
91
|
-
const meta = {
|
|
92
|
-
component: ExpressionBuilder,
|
|
93
|
-
title: 'Components/Form/Expressions/ExpressionBuilder',
|
|
94
|
-
args: {
|
|
95
|
-
expressions: mockExpressions,
|
|
96
|
-
localTemplates,
|
|
97
|
-
onChange: fn(),
|
|
98
|
-
},
|
|
99
|
-
render: (args) => {
|
|
100
|
-
const [exp, setExp] = useState<IExpression>(args.value);
|
|
101
|
-
|
|
102
|
-
return (
|
|
103
|
-
<ExpressionBuilder
|
|
104
|
-
{...args}
|
|
105
|
-
value={exp}
|
|
106
|
-
onChange={(value) => {
|
|
107
|
-
args.onChange?.(value);
|
|
108
|
-
setExp(value);
|
|
109
|
-
}}
|
|
110
|
-
/>
|
|
111
|
-
);
|
|
112
|
-
},
|
|
113
|
-
} as StoryMeta<typeof ExpressionBuilder>;
|
|
114
|
-
|
|
115
|
-
export default meta;
|
|
116
|
-
export type Story = StoryObj<typeof meta>;
|
|
117
|
-
|
|
118
|
-
export const Default: Story = {
|
|
119
|
-
args: {
|
|
120
|
-
returnType: ['string', 'int'],
|
|
121
|
-
},
|
|
122
|
-
parameters: {
|
|
123
|
-
docs: {
|
|
124
|
-
description: {
|
|
125
|
-
story:
|
|
126
|
-
'Renders the ExpressionBuilder with no value and a string-or-int return type — a single empty expression card is shown so the operator can pick an operation.',
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
play: async ({ canvasElement }) => {
|
|
131
|
-
await waitFor(() => expect(expressionCount(canvasElement)).toBe(1), { timeout: 10000 });
|
|
132
|
-
},
|
|
133
|
-
};
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Picking a varargs operation on a fresh builder. Used to crash: the fresh
|
|
137
|
-
* value has no operands, the operator change pushed `undefined` for the one
|
|
138
|
-
* catalogue argument, and the varargs branch of `addMissingArgs` never
|
|
139
|
-
* filled the hole, so the validator read `.type` of `undefined`.
|
|
140
|
-
*/
|
|
141
|
-
export const AdditionPickedFresh: Story = {
|
|
142
|
-
...Default,
|
|
143
|
-
parameters: {
|
|
144
|
-
docs: {
|
|
145
|
-
description: {
|
|
146
|
-
story:
|
|
147
|
-
'Renders an empty ExpressionBuilder and picks "Addition" from the operation picker — the card shows one empty Value operand and the "Add value" slot, with no crash and no error boundary.',
|
|
148
|
-
},
|
|
149
|
-
},
|
|
150
|
-
},
|
|
151
|
-
play: async (context) => {
|
|
152
|
-
await Default.play!(context);
|
|
153
|
-
await selectOperation('Select operation', 'Addition');
|
|
154
|
-
|
|
155
|
-
await waitFor(() => expect(count('.expression-arg')).toBe(1), { timeout: 10000 });
|
|
156
|
-
expect(addSlot()).not.toBeNull();
|
|
157
|
-
expect(document.querySelector('.reqore-error-boundary')).toBeNull();
|
|
158
|
-
await waitForText('Value');
|
|
159
|
-
expect(context.args.onChange).toHaveBeenLastCalledWith(
|
|
160
|
-
expect.objectContaining({
|
|
161
|
-
value: expect.objectContaining({ exp: '+', args: [{ type: undefined }] }),
|
|
162
|
-
})
|
|
163
|
-
);
|
|
164
|
-
},
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
export const DefaultBoolean: Story = {
|
|
168
|
-
args: {
|
|
169
|
-
returnType: ['boolean'],
|
|
170
|
-
},
|
|
171
|
-
parameters: {
|
|
172
|
-
docs: {
|
|
173
|
-
description: {
|
|
174
|
-
story:
|
|
175
|
-
'Renders the ExpressionBuilder with no value and a boolean return type — a single empty expression card is shown so the operator can pick a boolean-returning operation.',
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
|
-
},
|
|
179
|
-
play: async () => {
|
|
180
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
181
|
-
},
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
export const WithSimpleValue: Story = {
|
|
185
|
-
args: {
|
|
186
|
-
returnType: ['string'],
|
|
187
|
-
value: {
|
|
188
|
-
is_expression: true,
|
|
189
|
-
value: {
|
|
190
|
-
exp: 'contains',
|
|
191
|
-
args: [
|
|
192
|
-
{ type: 'string', value: '$local:input' },
|
|
193
|
-
{ type: 'string', value: 'es' },
|
|
194
|
-
{ type: 'bool', value: true },
|
|
195
|
-
],
|
|
196
|
-
},
|
|
197
|
-
},
|
|
198
|
-
},
|
|
199
|
-
parameters: {
|
|
200
|
-
docs: {
|
|
201
|
-
description: {
|
|
202
|
-
story:
|
|
203
|
-
'Renders the ExpressionBuilder holding a single "contains" expression with three arguments — the card shows the operation and each operand slot.',
|
|
204
|
-
},
|
|
205
|
-
},
|
|
206
|
-
},
|
|
207
|
-
play: async () => {
|
|
208
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
209
|
-
},
|
|
210
|
-
};
|
|
211
|
-
|
|
212
|
-
export const WithComplexValue: Story = {
|
|
213
|
-
args: {
|
|
214
|
-
value: {
|
|
215
|
-
is_expression: true,
|
|
216
|
-
value: {
|
|
217
|
-
exp: '&&',
|
|
218
|
-
args: [
|
|
219
|
-
{
|
|
220
|
-
value: {
|
|
221
|
-
exp: '||',
|
|
222
|
-
args: [
|
|
223
|
-
{
|
|
224
|
-
value: {
|
|
225
|
-
exp: 'contains',
|
|
226
|
-
args: [
|
|
227
|
-
{ type: 'string', value: '$local:input' },
|
|
228
|
-
{ type: 'string', value: 'es' },
|
|
229
|
-
],
|
|
230
|
-
},
|
|
231
|
-
is_expression: true,
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
value: {
|
|
235
|
-
exp: '&&',
|
|
236
|
-
args: [
|
|
237
|
-
{
|
|
238
|
-
value: {
|
|
239
|
-
exp: 'starts-with',
|
|
240
|
-
args: [
|
|
241
|
-
{ type: 'string', value: 'test' },
|
|
242
|
-
{ type: 'string', value: 't' },
|
|
243
|
-
],
|
|
244
|
-
},
|
|
245
|
-
is_expression: true,
|
|
246
|
-
},
|
|
247
|
-
{
|
|
248
|
-
value: {
|
|
249
|
-
exp: 'starts-with',
|
|
250
|
-
args: [
|
|
251
|
-
{ type: 'string', value: 'test' },
|
|
252
|
-
{ type: 'string', value: 't' },
|
|
253
|
-
],
|
|
254
|
-
},
|
|
255
|
-
is_expression: true,
|
|
256
|
-
},
|
|
257
|
-
],
|
|
258
|
-
},
|
|
259
|
-
is_expression: true,
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
value: {
|
|
263
|
-
exp: '>=',
|
|
264
|
-
args: [
|
|
265
|
-
{ type: 'int', value: 23 },
|
|
266
|
-
{ type: 'string', value: '$local:id' },
|
|
267
|
-
],
|
|
268
|
-
},
|
|
269
|
-
is_expression: true,
|
|
270
|
-
},
|
|
271
|
-
],
|
|
272
|
-
},
|
|
273
|
-
is_expression: true,
|
|
274
|
-
},
|
|
275
|
-
{
|
|
276
|
-
value: {
|
|
277
|
-
exp: 'ends-with',
|
|
278
|
-
args: [
|
|
279
|
-
{ type: 'string', value: '$local:str' },
|
|
280
|
-
{ type: 'string', value: '$local:p' },
|
|
281
|
-
],
|
|
282
|
-
},
|
|
283
|
-
is_expression: true,
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
value: {
|
|
287
|
-
exp: '<',
|
|
288
|
-
args: [
|
|
289
|
-
{ type: 'int', value: '$local:input' },
|
|
290
|
-
{ type: 'string', value: '$local:p' },
|
|
291
|
-
],
|
|
292
|
-
},
|
|
293
|
-
is_expression: true,
|
|
294
|
-
},
|
|
295
|
-
],
|
|
296
|
-
},
|
|
297
|
-
},
|
|
298
|
-
},
|
|
299
|
-
parameters: {
|
|
300
|
-
docs: {
|
|
301
|
-
description: {
|
|
302
|
-
story:
|
|
303
|
-
'Renders the ExpressionBuilder holding a nested &&/|| expression with six leaf expressions — the builder shows the full expression tree with the AND/OR group cards and their operand cards.',
|
|
304
|
-
},
|
|
305
|
-
},
|
|
306
|
-
},
|
|
307
|
-
play: async () => {
|
|
308
|
-
await waitFor(() => expect(expressionCount()).toBe(6), { timeout: 10000 });
|
|
309
|
-
},
|
|
310
|
-
};
|
|
311
|
-
|
|
312
|
-
export const ShowsExplanation: Story = {
|
|
313
|
-
...WithComplexValue,
|
|
314
|
-
parameters: {
|
|
315
|
-
...WithComplexValue.parameters,
|
|
316
|
-
docs: {
|
|
317
|
-
description: {
|
|
318
|
-
story:
|
|
319
|
-
'Renders the nested expression tree and clicks Explain — the plain-language explanation of the whole expression is shown alongside the builder.',
|
|
320
|
-
},
|
|
321
|
-
},
|
|
322
|
-
},
|
|
323
|
-
play: async (args) => {
|
|
324
|
-
await WithComplexValue.play!(args);
|
|
325
|
-
await clickButtonByLabel('Explain');
|
|
326
|
-
await waitFor(
|
|
327
|
-
() => {
|
|
328
|
-
const body = within(document.body);
|
|
329
|
-
expect(body.queryAllByText(/startsWith|&&|\|\|/i).length).toBeGreaterThan(0);
|
|
330
|
-
},
|
|
331
|
-
{ timeout: 10000 }
|
|
332
|
-
);
|
|
333
|
-
},
|
|
334
|
-
};
|
|
335
|
-
|
|
336
|
-
export const Readonly: Story = {
|
|
337
|
-
...WithComplexValue,
|
|
338
|
-
args: {
|
|
339
|
-
...WithComplexValue.args,
|
|
340
|
-
readOnly: true,
|
|
341
|
-
},
|
|
342
|
-
parameters: {
|
|
343
|
-
...WithComplexValue.parameters,
|
|
344
|
-
docs: {
|
|
345
|
-
description: {
|
|
346
|
-
story:
|
|
347
|
-
'Renders the nested expression tree with readOnly enabled — the tree is visible but the AND/OR add-group controls are hidden so the operator cannot mutate it.',
|
|
348
|
-
},
|
|
349
|
-
},
|
|
350
|
-
},
|
|
351
|
-
play: async (args) => {
|
|
352
|
-
await WithComplexValue.play!(args);
|
|
353
|
-
expect(document.querySelector('.expression-and')).toBeNull();
|
|
354
|
-
},
|
|
355
|
-
};
|
|
356
|
-
|
|
357
|
-
export const FocusedEditing: Story = {
|
|
358
|
-
...WithComplexValue,
|
|
359
|
-
parameters: {
|
|
360
|
-
...WithComplexValue.parameters,
|
|
361
|
-
docs: {
|
|
362
|
-
description: {
|
|
363
|
-
story:
|
|
364
|
-
'Renders the nested expression tree, hovers a card and clicks its fullscreen action — the focused-editing modal opens over that subtree.',
|
|
365
|
-
},
|
|
366
|
-
},
|
|
367
|
-
},
|
|
368
|
-
play: async (args) => {
|
|
369
|
-
await WithComplexValue.play!(args);
|
|
370
|
-
await userEvent.hover(document.querySelectorAll('.expression')[0]);
|
|
371
|
-
await sleep(500);
|
|
372
|
-
await clickSelector('.expression-item-fullscreen', 3);
|
|
373
|
-
await waitForText('Focused Editing');
|
|
374
|
-
},
|
|
375
|
-
};
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
* Ported from the IDE `WithArgWithAllowedValues`: a FRESH op-select of
|
|
379
|
-
* `Matches Regular Expression`, whose third arg ("Regex Options") carries
|
|
380
|
-
* `element_allowed_values`. The IDE play only selects and settles; here we
|
|
381
|
-
* also assert the allowed-values operand actually paints — the regression
|
|
382
|
-
* this family guards (a value-less fresh op-select must render its operands).
|
|
383
|
-
*/
|
|
384
|
-
export const WithArgWithAllowedValues: Story = {
|
|
385
|
-
args: {
|
|
386
|
-
returnType: ['bool'],
|
|
387
|
-
},
|
|
388
|
-
parameters: {
|
|
389
|
-
docs: {
|
|
390
|
-
description: {
|
|
391
|
-
story:
|
|
392
|
-
'Renders an empty ExpressionBuilder and selects "Matches Regular Expression" — the third operand ("Regex Options") carries element_allowed_values and renders the "Select one or more" picker.',
|
|
393
|
-
},
|
|
394
|
-
},
|
|
395
|
-
},
|
|
396
|
-
play: async (args) => {
|
|
397
|
-
await Default.play!(args);
|
|
398
|
-
|
|
399
|
-
await selectOperation('Select operation', 'Matches Regular Expression');
|
|
400
|
-
|
|
401
|
-
await waitForText('Regex Options');
|
|
402
|
-
await waitForText('Select one or more:');
|
|
403
|
-
},
|
|
404
|
-
};
|
|
405
|
-
|
|
406
|
-
export const WithIntType: Story = {
|
|
407
|
-
args: {
|
|
408
|
-
type: 'int',
|
|
409
|
-
value: {
|
|
410
|
-
value: {
|
|
411
|
-
exp: '>=',
|
|
412
|
-
args: [
|
|
413
|
-
{ type: 'int', value: '$local:input' },
|
|
414
|
-
{ type: 'int', value: 20 },
|
|
415
|
-
],
|
|
416
|
-
},
|
|
417
|
-
},
|
|
418
|
-
},
|
|
419
|
-
parameters: {
|
|
420
|
-
docs: {
|
|
421
|
-
description: {
|
|
422
|
-
story:
|
|
423
|
-
'Renders the ExpressionBuilder with an int-typed >= expression comparing $local:input to 20 — the operands render as Number fields inside the expression card.',
|
|
424
|
-
},
|
|
425
|
-
},
|
|
426
|
-
},
|
|
427
|
-
play: async () => {
|
|
428
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
429
|
-
},
|
|
430
|
-
};
|
|
431
|
-
|
|
432
|
-
/**
|
|
433
|
-
* Ported from the IDE `ArgsChangeWhenOperatorChanges`: a valued
|
|
434
|
-
* `String Contains` switches to a regex op and the argument row re-shapes —
|
|
435
|
-
* the string args carry over (exact richtext/string matches) and the new
|
|
436
|
-
* "Regex Options" allowed-values arg appears. Adaptation: the IDE switches to
|
|
437
|
-
* `Does Not Match Regular Expression`; the fixture ships only the positive
|
|
438
|
-
* `Matches Regular Expression`, which exercises the same arg-reshape path.
|
|
439
|
-
*/
|
|
440
|
-
export const ArgsChangeWhenOperatorChanges: Story = {
|
|
441
|
-
...WithSimpleValue,
|
|
442
|
-
parameters: {
|
|
443
|
-
...WithSimpleValue.parameters,
|
|
444
|
-
docs: {
|
|
445
|
-
description: {
|
|
446
|
-
story:
|
|
447
|
-
'Renders the seeded "String Contains" expression, then switches the operation to "Matches Regular Expression" — the string operands carry over and the new "Regex Options" allowed-values operand appears.',
|
|
448
|
-
},
|
|
449
|
-
},
|
|
450
|
-
},
|
|
451
|
-
play: async () => {
|
|
452
|
-
// Both string operands of the seeded `contains` render as textareas.
|
|
453
|
-
await waitFor(
|
|
454
|
-
() => expect(document.querySelectorAll('.expression .reqore-textarea')).toHaveLength(2),
|
|
455
|
-
{ timeout: 10000 }
|
|
456
|
-
);
|
|
457
|
-
|
|
458
|
-
await selectOperation('String Contains', 'Matches Regular Expression');
|
|
459
|
-
|
|
460
|
-
await waitForText('Regex Options');
|
|
461
|
-
},
|
|
462
|
-
};
|
|
463
|
-
|
|
464
|
-
export const NewGroupsCanBeCreated: Story = {
|
|
465
|
-
args: {
|
|
466
|
-
...WithSimpleValue.args,
|
|
467
|
-
returnType: ['bool'],
|
|
468
|
-
},
|
|
469
|
-
parameters: {
|
|
470
|
-
docs: {
|
|
471
|
-
description: {
|
|
472
|
-
story:
|
|
473
|
-
'Renders the seeded "String Contains" expression, then clicks the AND and OR add-group actions — the tree grows from 1 to 3 expression cards as new grouping levels are added.',
|
|
474
|
-
},
|
|
475
|
-
},
|
|
476
|
-
},
|
|
477
|
-
play: async () => {
|
|
478
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
479
|
-
|
|
480
|
-
await fireEvent.click(document.querySelector('.expression-and')!);
|
|
481
|
-
await waitFor(() => expect(expressionCount()).toBe(2), { timeout: 10000 });
|
|
482
|
-
|
|
483
|
-
await fireEvent.click(document.querySelector('.expression-or')!);
|
|
484
|
-
await waitFor(() => expect(expressionCount()).toBe(3), { timeout: 10000 });
|
|
485
|
-
},
|
|
486
|
-
};
|
|
487
|
-
|
|
488
|
-
export const GroupsCanBeDeleted: Story = {
|
|
489
|
-
...WithComplexValue,
|
|
490
|
-
parameters: {
|
|
491
|
-
...WithComplexValue.parameters,
|
|
492
|
-
docs: {
|
|
493
|
-
description: {
|
|
494
|
-
story:
|
|
495
|
-
'Renders the nested expression tree (6 cards) and removes one group — the tree shrinks to 5 cards after the delete.',
|
|
496
|
-
},
|
|
497
|
-
},
|
|
498
|
-
},
|
|
499
|
-
play: async () => {
|
|
500
|
-
await waitFor(() => expect(expressionCount()).toBe(6), { timeout: 10000 });
|
|
501
|
-
|
|
502
|
-
await sleep(1000);
|
|
503
|
-
|
|
504
|
-
await userEvent.hover(document.querySelectorAll('.expression')[1]);
|
|
505
|
-
await sleep(300);
|
|
506
|
-
await fireEvent.click(document.querySelectorAll('.expression-group-remove')[0]);
|
|
507
|
-
|
|
508
|
-
await waitFor(() => expect(expressionCount()).toBe(5), { timeout: 10000 });
|
|
509
|
-
},
|
|
510
|
-
};
|
|
511
|
-
|
|
512
|
-
/**
|
|
513
|
-
* The `extraActions` seam — how the IDE restores its AI-assist button when it
|
|
514
|
-
* adopts this builder (Phase E). The factory runs per expression card and
|
|
515
|
-
* receives that card's `selectedExpression`, exactly the context the IDE's
|
|
516
|
-
* inline `AiAssistanceAction({ context: selectedExpression })` captured.
|
|
517
|
-
*/
|
|
518
|
-
export const WithInjectedExtraActions: Story = {
|
|
519
|
-
parameters: {
|
|
520
|
-
docs: {
|
|
521
|
-
description: {
|
|
522
|
-
story:
|
|
523
|
-
'Renders the nested expression tree with an extraActions factory that injects an AI-assist button per card. Hovering an expression reveals the injected action alongside the built-in ones.',
|
|
524
|
-
},
|
|
525
|
-
},
|
|
526
|
-
},
|
|
527
|
-
args: {
|
|
528
|
-
...WithComplexValue.args,
|
|
529
|
-
extraActions: ({ selectedExpression }) => [
|
|
530
|
-
{
|
|
531
|
-
icon: 'MagicLine',
|
|
532
|
-
className: 'expression-ai-assist',
|
|
533
|
-
tooltip: `AI assistance for ${selectedExpression?.display_name ?? 'this expression'}`,
|
|
534
|
-
show: 'hover',
|
|
535
|
-
size: 'tiny',
|
|
536
|
-
fixed: true,
|
|
537
|
-
onClick: fn(),
|
|
538
|
-
},
|
|
539
|
-
],
|
|
540
|
-
},
|
|
541
|
-
play: async () => {
|
|
542
|
-
await waitFor(() => expect(expressionCount()).toBe(6), { timeout: 10000 });
|
|
543
|
-
|
|
544
|
-
// Hover actions mount on hover (same pattern as the IDE's own tests).
|
|
545
|
-
await userEvent.hover(document.querySelectorAll('.expression')[0]);
|
|
546
|
-
await waitFor(() =>
|
|
547
|
-
expect(document.querySelector('.expression-ai-assist')).toBeInTheDocument()
|
|
548
|
-
);
|
|
549
|
-
},
|
|
550
|
-
};
|
|
551
|
-
|
|
552
|
-
// --- Variable-arguments family ----------------------------------------------
|
|
553
|
-
// Ported from the IDE `ExpressionWithIntReturnType` / `VariableArguments*`.
|
|
554
|
-
// Adaptation: the offline `+` (Addition) fixture entry stands in for the live
|
|
555
|
-
// catalogue's `+`. With 4 args (2 `$local:` templates + 2 int literals) the
|
|
556
|
-
// first arg renders inline and the 3 "rest" args each get a remove button, so
|
|
557
|
-
// `.expression-remove-arg` starts at 3 and the templates render two
|
|
558
|
-
// `.template-remove` chips.
|
|
559
|
-
|
|
560
|
-
/** Base: a `+` (Addition) varargs expression with four int operands. */
|
|
561
|
-
export const ExpressionWithIntReturnType: Story = {
|
|
562
|
-
args: {
|
|
563
|
-
type: 'int',
|
|
564
|
-
returnType: 'int',
|
|
565
|
-
value: {
|
|
566
|
-
value: {
|
|
567
|
-
exp: '+',
|
|
568
|
-
args: [
|
|
569
|
-
{ type: 'int', value: '$local:id' },
|
|
570
|
-
{ type: 'int', value: 20 },
|
|
571
|
-
{ type: 'int', value: '$local:time' },
|
|
572
|
-
{ type: 'int', value: 10 },
|
|
573
|
-
],
|
|
574
|
-
},
|
|
575
|
-
is_expression: true,
|
|
576
|
-
},
|
|
577
|
-
},
|
|
578
|
-
parameters: {
|
|
579
|
-
docs: {
|
|
580
|
-
description: {
|
|
581
|
-
story:
|
|
582
|
-
'Renders the ExpressionBuilder with a "+" (Addition) varargs expression holding four int operands — every operand, the first included, exposes a remove-argument button.',
|
|
583
|
-
},
|
|
584
|
-
},
|
|
585
|
-
},
|
|
586
|
-
play: async () => {
|
|
587
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
588
|
-
// Four operands → four remove-argument buttons; only the last one left
|
|
589
|
-
// could not be removed.
|
|
590
|
-
await waitFor(() => expect(removeArgCount()).toBe(4), { timeout: 10000 });
|
|
591
|
-
},
|
|
592
|
-
};
|
|
593
|
-
|
|
594
|
-
/** Remove one variable argument — the remove-arg count drops from 4 to 3. */
|
|
595
|
-
export const VariableArgumentsCanBeRemoved: Story = {
|
|
596
|
-
...ExpressionWithIntReturnType,
|
|
597
|
-
parameters: {
|
|
598
|
-
...ExpressionWithIntReturnType.parameters,
|
|
599
|
-
docs: {
|
|
600
|
-
description: {
|
|
601
|
-
story:
|
|
602
|
-
'Renders the "+" varargs expression and clicks one remove-argument button — one operand disappears and the remove-arg count drops from 4 to 3.',
|
|
603
|
-
},
|
|
604
|
-
},
|
|
605
|
-
},
|
|
606
|
-
play: async (args) => {
|
|
607
|
-
await ExpressionWithIntReturnType.play!(args);
|
|
608
|
-
|
|
609
|
-
await fireEvent.click(document.querySelector('.expression-remove-arg')!);
|
|
610
|
-
|
|
611
|
-
await waitFor(() => expect(removeArgCount()).toBe(3), { timeout: 10000 });
|
|
612
|
-
},
|
|
613
|
-
};
|
|
614
|
-
|
|
615
|
-
/** Remove one then add one back — the count returns to 4. */
|
|
616
|
-
export const VariableArgumentsCanBeAdded: Story = {
|
|
617
|
-
...ExpressionWithIntReturnType,
|
|
618
|
-
parameters: {
|
|
619
|
-
...ExpressionWithIntReturnType.parameters,
|
|
620
|
-
docs: {
|
|
621
|
-
description: {
|
|
622
|
-
story:
|
|
623
|
-
'Renders the "+" varargs expression, removes one operand and then adds one back through the "Add value" slot after the last operand — the remove-arg count moves 4 → 3 → 4.',
|
|
624
|
-
},
|
|
625
|
-
},
|
|
626
|
-
},
|
|
627
|
-
play: async (args) => {
|
|
628
|
-
await ExpressionWithIntReturnType.play!(args);
|
|
629
|
-
|
|
630
|
-
await fireEvent.click(document.querySelector('.expression-remove-arg')!);
|
|
631
|
-
await waitFor(() => expect(removeArgCount()).toBe(3), { timeout: 10000 });
|
|
632
|
-
|
|
633
|
-
await fireEvent.click(document.querySelector('.expression-add-arg')!);
|
|
634
|
-
await waitFor(() => expect(removeArgCount()).toBe(4), { timeout: 10000 });
|
|
635
|
-
},
|
|
636
|
-
};
|
|
637
|
-
|
|
638
|
-
// --- Varargs reorder family -------------------------------------------------
|
|
639
|
-
// Toolkit-only (no IDE counterpart): a varargs expression lets the user move
|
|
640
|
-
// its operands. `reorder` picks the surface — the field's ⋮ menu by default,
|
|
641
|
-
// a drag grip and/or a position dropdown on request. Seeded on `concat` so
|
|
642
|
-
// the operand order is readable.
|
|
643
|
-
|
|
644
|
-
const CONCAT_OPERANDS = ['first', 'second', 'third'];
|
|
645
|
-
const OPERAND_LITERALS = [...CONCAT_OPERANDS, 'plain', '$local:some-richtext'];
|
|
646
|
-
|
|
647
|
-
/**
|
|
648
|
-
* What an operand field holds. A text operand is edited in the chip editor
|
|
649
|
-
* (these stories offer templates), so it is read from the editable field; a
|
|
650
|
-
* template chip in it shows the name these stories' templates give the
|
|
651
|
-
* reference ("Richtext Template"), read back as the reference it names.
|
|
652
|
-
*/
|
|
653
|
-
const readOperand = (field: HTMLElement): string => {
|
|
654
|
-
if (field instanceof HTMLInputElement || field instanceof HTMLTextAreaElement) {
|
|
655
|
-
return field.value;
|
|
656
|
-
}
|
|
657
|
-
const shown = (field.textContent ?? '').replace(/\uFEFF/g, '').trim();
|
|
658
|
-
return (
|
|
659
|
-
OPERAND_LITERALS.find(
|
|
660
|
-
(literal) => literal === shown || templateChipLabel(localTemplates as never, literal) === shown
|
|
661
|
-
) ?? shown
|
|
662
|
-
);
|
|
663
|
-
};
|
|
664
|
-
|
|
665
|
-
/** Every operand editor's text, in DOM order (no number or position inputs). */
|
|
666
|
-
const operandTexts = () =>
|
|
667
|
-
Array.from(
|
|
668
|
-
document.querySelectorAll<HTMLElement>('.expression textarea, .expression [contenteditable="true"]')
|
|
669
|
-
).map(readOperand);
|
|
670
|
-
|
|
671
|
-
/** Seeded operand values in DOM order — only the seeded ones, so stray fields don't count. */
|
|
672
|
-
const operandValues = () =>
|
|
673
|
-
Array.from(
|
|
674
|
-
document.querySelectorAll<HTMLElement>(
|
|
675
|
-
'.expression textarea, .expression input, .expression [contenteditable="true"]'
|
|
676
|
-
)
|
|
677
|
-
)
|
|
678
|
-
.map(readOperand)
|
|
679
|
-
.filter((value) => OPERAND_LITERALS.includes(value));
|
|
680
|
-
|
|
681
|
-
const count = (selector: string) => document.querySelectorAll(selector).length;
|
|
682
|
-
|
|
683
|
-
/** Open the `⋮` menu of the nth operand field and expand its "Move Argument" section. */
|
|
684
|
-
const openMoveMenu = async (nth: number) => {
|
|
685
|
-
await clickSelector('.template-more', nth);
|
|
686
|
-
await waitForText('Move Argument');
|
|
687
|
-
// The section's className lands on its toggle button.
|
|
688
|
-
await clickSelector('.template-menu-actions');
|
|
689
|
-
};
|
|
690
|
-
|
|
691
|
-
/** Open the `⋮` menu of the nth operand field. */
|
|
692
|
-
const openFieldMenu = (nth: number) => clickSelector('.template-more', nth);
|
|
693
|
-
|
|
694
|
-
const waitForOrder = (order: string[]) =>
|
|
695
|
-
waitFor(() => expect(operandValues()).toEqual(order), { timeout: 10000 });
|
|
696
|
-
|
|
697
|
-
const expectReportedOrder = (context: { args: { onChange?: unknown } }, order: string[]) =>
|
|
698
|
-
expect(context.args.onChange).toHaveBeenLastCalledWith(
|
|
699
|
-
expect.objectContaining({
|
|
700
|
-
value: expect.objectContaining({
|
|
701
|
-
exp: 'concat',
|
|
702
|
-
args: order.map((value) => ({ type: 'string', value })),
|
|
703
|
-
}),
|
|
704
|
-
})
|
|
705
|
-
);
|
|
706
|
-
|
|
707
|
-
const concatArgs: Story['args'] = {
|
|
708
|
-
type: 'string',
|
|
709
|
-
returnType: 'string',
|
|
710
|
-
value: {
|
|
711
|
-
value: {
|
|
712
|
-
exp: 'concat',
|
|
713
|
-
args: CONCAT_OPERANDS.map((value) => ({ type: 'string', value })),
|
|
714
|
-
},
|
|
715
|
-
is_expression: true,
|
|
716
|
-
},
|
|
717
|
-
};
|
|
718
|
-
|
|
719
|
-
/** Base: a `concat` varargs expression with three string operands, default reorder surfaces. */
|
|
720
|
-
export const ConcatExpression: Story = {
|
|
721
|
-
args: concatArgs,
|
|
722
|
-
parameters: {
|
|
723
|
-
docs: {
|
|
724
|
-
description: {
|
|
725
|
-
story:
|
|
726
|
-
'Renders a "concat" varargs expression with three string operands ("first", "second", "third"), each edited in the chip editor a string field with templates now uses — a contenteditable box rather than a textarea, so a template reference in an operand reads as its name. By default each operand gets a drag grip and a "Move Argument" section in its ⋮ menu — opened and expanded here on the second operand to show "Move before / after / to start / to end" and, at three operands, a "Move to position" caption with a single "2nd" position dropdown beside it, opened to show 1st / 2nd / 3rd.',
|
|
727
|
-
},
|
|
728
|
-
},
|
|
729
|
-
},
|
|
730
|
-
play: async () => {
|
|
731
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
732
|
-
await waitForOrder(CONCAT_OPERANDS);
|
|
733
|
-
expect(removeArgCount()).toBe(3);
|
|
734
|
-
expect(count('.expression-arg-drag-handle')).toBe(3);
|
|
735
|
-
expect(count('.expression-arg-position')).toBe(0);
|
|
736
|
-
|
|
737
|
-
await openMoveMenu(1);
|
|
738
|
-
await waitForText('Move before');
|
|
739
|
-
expect(count('.expression-arg-move-after')).toBe(1);
|
|
740
|
-
expect(count('.expression-arg-move-start')).toBe(1);
|
|
741
|
-
expect(count('.expression-arg-move-end')).toBe(1);
|
|
742
|
-
expect(count('.expression-arg-move-to')).toBe(1);
|
|
743
|
-
// Three operands: one position dropdown — no segments, no typed field, no "More".
|
|
744
|
-
expect(count('.expression-arg-move-to-picker')).toBe(1);
|
|
745
|
-
expect(count('.expression-arg-move-to-input')).toBe(0);
|
|
746
|
-
expect(count('.expression-arg-move-to-more')).toBe(0);
|
|
747
|
-
// Open the picker so the capture shows its three positions.
|
|
748
|
-
await clickSelector('.expression-arg-move-to-picker');
|
|
749
|
-
await waitForText('3rd');
|
|
750
|
-
},
|
|
751
|
-
};
|
|
752
|
-
|
|
753
|
-
const LONG_OPERANDS = ['first', 'second', 'third', 'fourth', 'fifth', 'sixth', 'seventh'];
|
|
754
|
-
|
|
755
|
-
/** Seven operands: the strip grows a typed field and a "More" list past the four segments. */
|
|
756
|
-
export const ReorderLongConcat: Story = {
|
|
757
|
-
args: {
|
|
758
|
-
...concatArgs,
|
|
759
|
-
value: {
|
|
760
|
-
value: {
|
|
761
|
-
exp: 'concat',
|
|
762
|
-
args: LONG_OPERANDS.map((value) => ({ type: 'string', value })),
|
|
763
|
-
},
|
|
764
|
-
is_expression: true,
|
|
765
|
-
},
|
|
766
|
-
},
|
|
767
|
-
parameters: {
|
|
768
|
-
docs: {
|
|
769
|
-
description: {
|
|
770
|
-
story:
|
|
771
|
-
'Renders a seven-operand "concat": typing 6 and Enter into the second operand\'s "Move to position" field moves it to sixth, "More → 7th" moves it last, and the menu is then reopened on that operand with "Move Argument" expanded and "More" open — the strip shows the segments 1–4, the number field for 5–7 with its arrow, and the list 5th / 6th / 7th with 7th (the current position) disabled. Each string operand is edited in the chip editor a field with templates now uses — a contenteditable box rather than a textarea, which is why the operand boxes are narrower than they were.',
|
|
772
|
-
},
|
|
773
|
-
},
|
|
774
|
-
},
|
|
775
|
-
play: async (context) => {
|
|
776
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
777
|
-
await waitFor(() => expect(count('.expression-arg-drag-handle')).toBe(7), { timeout: 10000 });
|
|
778
|
-
|
|
779
|
-
await openMoveMenu(1);
|
|
780
|
-
await waitForText('Move to position');
|
|
781
|
-
expect(count('.expression-arg-move-to-4')).toBe(1);
|
|
782
|
-
expect(count('.expression-arg-move-to-input')).toBe(1);
|
|
783
|
-
expect(count('.expression-arg-move-to-more')).toBe(1);
|
|
784
|
-
|
|
785
|
-
// change + keyDown rather than `userEvent.type`: the typing helper also
|
|
786
|
-
// emits hover events, which React bubbles through the popover's portal to
|
|
787
|
-
// the panel and raises its floating "Wrap" layer over the capture.
|
|
788
|
-
const field = document.querySelector<HTMLInputElement>('.expression-arg-move-to-input')!;
|
|
789
|
-
await fireEvent.change(field, { target: { value: '6' } });
|
|
790
|
-
await fireEvent.keyDown(field, { key: 'Enter' });
|
|
791
|
-
await waitFor(
|
|
792
|
-
() =>
|
|
793
|
-
expect(operandTexts()).toEqual(['first', 'third', 'fourth', 'fifth', 'sixth', 'second', 'seventh']),
|
|
794
|
-
{ timeout: 10000 }
|
|
795
|
-
);
|
|
796
|
-
|
|
797
|
-
await openMoveMenu(5);
|
|
798
|
-
await waitForText('Move to position');
|
|
799
|
-
await clickSelector('.expression-arg-move-to-more');
|
|
800
|
-
await waitForText('7th');
|
|
801
|
-
await clickSelector('.expression-arg-move-to-7');
|
|
802
|
-
await waitFor(
|
|
803
|
-
() =>
|
|
804
|
-
expect(operandTexts()).toEqual(['first', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'second']),
|
|
805
|
-
{ timeout: 10000 }
|
|
806
|
-
);
|
|
807
|
-
expect(context.args.onChange).toHaveBeenLastCalledWith(
|
|
808
|
-
expect.objectContaining({
|
|
809
|
-
value: expect.objectContaining({
|
|
810
|
-
args: ['first', 'third', 'fourth', 'fifth', 'sixth', 'seventh', 'second'].map(
|
|
811
|
-
(value) => ({ type: 'string', value })
|
|
812
|
-
),
|
|
813
|
-
}),
|
|
814
|
-
})
|
|
815
|
-
);
|
|
816
|
-
|
|
817
|
-
// Leave the strip and its "More" list on screen for the capture.
|
|
818
|
-
await openMoveMenu(6);
|
|
819
|
-
await waitForText('Move to position');
|
|
820
|
-
await clickSelector('.expression-arg-move-to-more');
|
|
821
|
-
await waitForText('5th');
|
|
822
|
-
// A remounted operand refetches the expression catalogue; the "Use
|
|
823
|
-
// Expression" row is a skeleton until that settles, so wait it out.
|
|
824
|
-
await waitFor(() => expect(count('.reqore-skeleton')).toBe(0), { timeout: 30000 });
|
|
825
|
-
},
|
|
826
|
-
};
|
|
827
|
-
|
|
828
|
-
/** `reorder: ['overflowMenu']` — "Move to start", "Move after", then "Move to position". */
|
|
829
|
-
export const ReorderViaOverflowMenu: Story = {
|
|
830
|
-
args: { ...concatArgs, reorder: ['overflowMenu'] },
|
|
831
|
-
parameters: {
|
|
832
|
-
docs: {
|
|
833
|
-
description: {
|
|
834
|
-
story:
|
|
835
|
-
'Renders the "concat" expression with only the ⋮ menu surface (no grip) and reorders it through the "Move Argument" section: "Move to start" on the third operand, "Move after" on the operand that is now second, then "3rd" from the "Move to position" dropdown on the first — the order goes first/second/third → third/first/second → third/second/first → second/first/third, each move closes its menu, and onChange reports the reordered args. Each string operand is edited in the chip editor a field with templates now uses — a contenteditable box rather than a textarea, which is why the operand boxes are narrower than they were.',
|
|
836
|
-
},
|
|
837
|
-
},
|
|
838
|
-
},
|
|
839
|
-
play: async (context) => {
|
|
840
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
841
|
-
await waitForOrder(CONCAT_OPERANDS);
|
|
842
|
-
expect(count('.expression-arg-drag-handle')).toBe(0);
|
|
843
|
-
|
|
844
|
-
await openMoveMenu(2);
|
|
845
|
-
await waitForText('Move to start');
|
|
846
|
-
await clickSelector('.expression-arg-move-start');
|
|
847
|
-
await waitForOrder(['third', 'first', 'second']);
|
|
848
|
-
// A move closes the menu it came from.
|
|
849
|
-
await waitFor(() => expect(count('.expression-arg-move-start')).toBe(0), { timeout: 10000 });
|
|
850
|
-
|
|
851
|
-
await openMoveMenu(1);
|
|
852
|
-
await waitForText('Move after');
|
|
853
|
-
await clickSelector('.expression-arg-move-after');
|
|
854
|
-
await waitForOrder(['third', 'second', 'first']);
|
|
855
|
-
|
|
856
|
-
await openMoveMenu(0);
|
|
857
|
-
await waitForText('Move to position');
|
|
858
|
-
await clickSelector('.expression-arg-move-to-picker');
|
|
859
|
-
await waitForText('3rd');
|
|
860
|
-
await clickSelector('.expression-arg-move-to-3');
|
|
861
|
-
await waitForOrder(['second', 'first', 'third']);
|
|
862
|
-
|
|
863
|
-
expectReportedOrder(context, ['second', 'first', 'third']);
|
|
864
|
-
},
|
|
865
|
-
};
|
|
866
|
-
|
|
867
|
-
/** `reorder: ['dragHandle']` — a grip before each operand, no menu rows. */
|
|
868
|
-
export const ReorderViaDragHandle: Story = {
|
|
869
|
-
args: { ...concatArgs, reorder: ['dragHandle'] },
|
|
870
|
-
parameters: {
|
|
871
|
-
docs: {
|
|
872
|
-
description: {
|
|
873
|
-
story:
|
|
874
|
-
'Renders the "concat" expression with a drag grip before each operand and no "Move Argument" section in the ⋮ menu. Dragging the third operand onto the first puts it first — the order becomes third/first/second. Each string operand is edited in the chip editor a field with templates now uses — a contenteditable box rather than a textarea, which is why the operand boxes are narrower than they were.',
|
|
875
|
-
},
|
|
876
|
-
},
|
|
877
|
-
},
|
|
878
|
-
play: async (context) => {
|
|
879
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
880
|
-
await waitForOrder(CONCAT_OPERANDS);
|
|
881
|
-
expect(count('.expression-arg-drag-handle')).toBe(3);
|
|
882
|
-
expect(count('.expression-arg-position')).toBe(0);
|
|
883
|
-
|
|
884
|
-
await openFieldMenu(1);
|
|
885
|
-
await waitForText('Use Template');
|
|
886
|
-
expect(count('.template-menu-actions')).toBe(0);
|
|
887
|
-
|
|
888
|
-
const handles = document.querySelectorAll('.expression-arg-drag-handle');
|
|
889
|
-
const target = handles[0].closest('.expression-arg')!;
|
|
890
|
-
expect(handles[2].getAttribute('draggable')).toBe('true');
|
|
891
|
-
await fireEvent.dragStart(handles[2]);
|
|
892
|
-
await fireEvent.dragOver(target);
|
|
893
|
-
await fireEvent.drop(target);
|
|
894
|
-
await fireEvent.dragEnd(handles[2]);
|
|
895
|
-
|
|
896
|
-
await waitForOrder(['third', 'first', 'second']);
|
|
897
|
-
expectReportedOrder(context, ['third', 'first', 'second']);
|
|
898
|
-
},
|
|
899
|
-
};
|
|
900
|
-
|
|
901
|
-
// --- Add value slot ---------------------------------------------------------
|
|
902
|
-
// A varargs expression adds its next operand through a dashed slot rendered
|
|
903
|
-
// after the last one, where the value will appear — not through a header
|
|
904
|
-
// icon. Keyed on `concat` so the label reads "Add value".
|
|
905
|
-
|
|
906
|
-
const addSlot = () => document.querySelector<HTMLButtonElement>('.expression-add-arg');
|
|
907
|
-
|
|
908
|
-
/** The slot is the last thing in the operand row, and clicking it adds a focused, empty operand. */
|
|
909
|
-
export const AddValueSlot: Story = {
|
|
910
|
-
args: concatArgs,
|
|
911
|
-
parameters: {
|
|
912
|
-
docs: {
|
|
913
|
-
description: {
|
|
914
|
-
story:
|
|
915
|
-
'Renders the "concat" expression with the dashed "Add value" slot after the third operand — the only add control, no header icon. Clicking it appends a fourth, empty operand that takes focus, the slot moves after it, and onChange reports four args.',
|
|
916
|
-
},
|
|
917
|
-
},
|
|
918
|
-
},
|
|
919
|
-
play: async (context) => {
|
|
920
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
921
|
-
await waitForOrder(CONCAT_OPERANDS);
|
|
922
|
-
|
|
923
|
-
const slot = addSlot()!;
|
|
924
|
-
expect(slot.textContent).toContain('Add value');
|
|
925
|
-
expect(slot).toBeEnabled();
|
|
926
|
-
// Last in the operand group, after every operand.
|
|
927
|
-
expect(slot.nextElementSibling).toBeNull();
|
|
928
|
-
expect(count('.expression-arg')).toBe(3);
|
|
929
|
-
expect(document.querySelector('.reqore-panel-title .expression-add-arg')).toBeNull();
|
|
930
|
-
|
|
931
|
-
await fireEvent.click(slot);
|
|
932
|
-
|
|
933
|
-
await waitFor(() => expect(count('.expression-arg')).toBe(4), { timeout: 10000 });
|
|
934
|
-
const operands = document.querySelectorAll('.expression-arg');
|
|
935
|
-
const added = operands[operands.length - 1];
|
|
936
|
-
await waitFor(() => expect(added.contains(document.activeElement)).toBe(true), {
|
|
937
|
-
timeout: 10000,
|
|
938
|
-
});
|
|
939
|
-
// Still after the last operand.
|
|
940
|
-
expect(addSlot()!.nextElementSibling).toBeNull();
|
|
941
|
-
expect(context.args.onChange).toHaveBeenLastCalledWith(
|
|
942
|
-
expect.objectContaining({
|
|
943
|
-
value: expect.objectContaining({
|
|
944
|
-
exp: 'concat',
|
|
945
|
-
args: expect.arrayContaining([
|
|
946
|
-
...CONCAT_OPERANDS.map((value) => ({ type: 'string', value })),
|
|
947
|
-
]),
|
|
948
|
-
}),
|
|
949
|
-
})
|
|
950
|
-
);
|
|
951
|
-
const reported = (context.args.onChange as ReturnType<typeof fn>).mock.lastCall?.[0];
|
|
952
|
-
expect(reported.value.args).toHaveLength(4);
|
|
953
|
-
},
|
|
954
|
-
};
|
|
955
|
-
|
|
956
|
-
/** An incomplete expression keeps the slot visible but disabled, saying why. */
|
|
957
|
-
export const AddValueSlotWhileIncomplete: Story = {
|
|
958
|
-
args: {
|
|
959
|
-
...concatArgs,
|
|
960
|
-
value: {
|
|
961
|
-
value: {
|
|
962
|
-
exp: 'concat',
|
|
963
|
-
args: [
|
|
964
|
-
{ type: 'string', value: 'first' },
|
|
965
|
-
{ type: 'string', value: 'second' },
|
|
966
|
-
{ type: 'string' },
|
|
967
|
-
],
|
|
968
|
-
},
|
|
969
|
-
is_expression: true,
|
|
970
|
-
},
|
|
971
|
-
},
|
|
972
|
-
parameters: {
|
|
973
|
-
docs: {
|
|
974
|
-
description: {
|
|
975
|
-
story:
|
|
976
|
-
'Renders the "concat" expression with its third operand still empty — the "Add value" slot stays where it is but is disabled, and its tooltip says to fill in the current values first.',
|
|
977
|
-
},
|
|
978
|
-
},
|
|
979
|
-
},
|
|
980
|
-
play: async () => {
|
|
981
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
982
|
-
await waitFor(() => expect(addSlot()).toBeDisabled(), { timeout: 10000 });
|
|
983
|
-
expect(count('.expression-arg')).toBe(3);
|
|
984
|
-
},
|
|
985
|
-
};
|
|
986
|
-
|
|
987
|
-
/** The slot is also the "move to end" drop target for the drag grip. */
|
|
988
|
-
export const AddValueSlotDropToEnd: Story = {
|
|
989
|
-
args: { ...concatArgs, reorder: ['dragHandle'] },
|
|
990
|
-
parameters: {
|
|
991
|
-
docs: {
|
|
992
|
-
description: {
|
|
993
|
-
story:
|
|
994
|
-
'Renders the "concat" expression with drag grips and drops the first operand onto the "Add value" slot — the operand moves to the end, so the order becomes second/third/first, and onChange reports it.',
|
|
995
|
-
},
|
|
996
|
-
},
|
|
997
|
-
},
|
|
998
|
-
play: async (context) => {
|
|
999
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
1000
|
-
await waitForOrder(CONCAT_OPERANDS);
|
|
1001
|
-
|
|
1002
|
-
const handles = document.querySelectorAll('.expression-arg-drag-handle');
|
|
1003
|
-
const slot = addSlot()!;
|
|
1004
|
-
await fireEvent.dragStart(handles[0]);
|
|
1005
|
-
await fireEvent.dragOver(slot);
|
|
1006
|
-
await fireEvent.drop(slot);
|
|
1007
|
-
await fireEvent.dragEnd(handles[0]);
|
|
1008
|
-
|
|
1009
|
-
await waitForOrder(['second', 'third', 'first']);
|
|
1010
|
-
expectReportedOrder(context, ['second', 'third', 'first']);
|
|
1011
|
-
expect(count('.expression-arg')).toBe(3);
|
|
1012
|
-
},
|
|
1013
|
-
};
|
|
1014
|
-
|
|
1015
|
-
/** On a phone the operands stack, and the slot is simply the last row. */
|
|
1016
|
-
export const AddValueSlotOnPhone: Story = {
|
|
1017
|
-
args: concatArgs,
|
|
1018
|
-
parameters: {
|
|
1019
|
-
qlip: { viewport: { width: 390, height: 844 } },
|
|
1020
|
-
docs: {
|
|
1021
|
-
description: {
|
|
1022
|
-
story:
|
|
1023
|
-
'Renders the phone presentation of the "concat" expression — the operands stack into a column and the "Add value" slot becomes a full-width row under them, with the plus and label centred.',
|
|
1024
|
-
},
|
|
1025
|
-
},
|
|
1026
|
-
},
|
|
1027
|
-
play: async () => {
|
|
1028
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
1029
|
-
await waitForOrder(CONCAT_OPERANDS);
|
|
1030
|
-
const slot = addSlot()!;
|
|
1031
|
-
expect(slot).toBeEnabled();
|
|
1032
|
-
expect(slot.nextElementSibling).toBeNull();
|
|
1033
|
-
},
|
|
1034
|
-
};
|
|
1035
|
-
|
|
1036
|
-
/**
|
|
1037
|
-
* The expression panels, nested or not, that reach past the box of the one they are nested in: none
|
|
1038
|
-
* should. A nested expression is indented; at its full width the indent pushed its right edge - and the
|
|
1039
|
-
* actions that float above it on hover - past its parent, and past a narrow screen's edge.
|
|
1040
|
-
*/
|
|
1041
|
-
const panelsPastTheirParent = () =>
|
|
1042
|
-
[...document.querySelectorAll<HTMLElement>('.expression, .reqore-panel')]
|
|
1043
|
-
.filter((panel) => panel.getBoundingClientRect().width > 0)
|
|
1044
|
-
.map((panel) => {
|
|
1045
|
-
const parent = panel.parentElement!.getBoundingClientRect();
|
|
1046
|
-
const box = panel.getBoundingClientRect();
|
|
1047
|
-
return { panel: panel.className.split(' ').pop(), over: Math.round(box.right - parent.right) };
|
|
1048
|
-
})
|
|
1049
|
-
.filter(({ over }) => over > 0);
|
|
1050
|
-
|
|
1051
|
-
/** The controls of an expression's title (its operation, its actions) that reach past its panel: none should. */
|
|
1052
|
-
const titlesPastTheirPanel = () =>
|
|
1053
|
-
[...document.querySelectorAll<HTMLElement>('.expression')].flatMap((panel) => {
|
|
1054
|
-
const box = panel.getBoundingClientRect();
|
|
1055
|
-
return [...panel.querySelectorAll<HTMLElement>('.expression-operator-selector, .reqore-panel-title button')]
|
|
1056
|
-
.filter((control) => control.closest('.expression') === panel && control.getBoundingClientRect().width > 0)
|
|
1057
|
-
.map((control) => Math.round(control.getBoundingClientRect().right - box.right))
|
|
1058
|
-
.filter((over) => over > 0);
|
|
1059
|
-
});
|
|
1060
|
-
|
|
1061
|
-
/** The column a 320px screen leaves the condition, and narrower ones a form's indents leave it. */
|
|
1062
|
-
const NARROW_COLUMNS = [320, 280, 240, 200, 186];
|
|
1063
|
-
|
|
1064
|
-
/**
|
|
1065
|
-
* The order's fields, for the narrow-column stories: the operands refer to them, and a field picker
|
|
1066
|
-
* whose value is not among its templates has nothing to offer - it is drawn disabled, and the operand
|
|
1067
|
-
* reads as read-only.
|
|
1068
|
-
*/
|
|
1069
|
-
const orderTemplates = {
|
|
1070
|
-
label: 'Order',
|
|
1071
|
-
items: [
|
|
1072
|
-
{
|
|
1073
|
-
label: 'Order',
|
|
1074
|
-
badge: 'Order',
|
|
1075
|
-
items: [
|
|
1076
|
-
{ label: 'Quantity', badge: 'int', value: '$local:quantity' },
|
|
1077
|
-
{ label: 'Price', badge: 'int', value: '$local:price' },
|
|
1078
|
-
],
|
|
1079
|
-
},
|
|
1080
|
-
],
|
|
1081
|
-
} as any;
|
|
1082
|
-
|
|
1083
|
-
/** A comparison with the longest operation name nested in an "AND" group, in a column it can narrow. */
|
|
1084
|
-
export const NestedFitsNarrowColumn: Story = {
|
|
1085
|
-
args: {
|
|
1086
|
-
localTemplates: orderTemplates,
|
|
1087
|
-
value: {
|
|
1088
|
-
is_expression: true,
|
|
1089
|
-
value: {
|
|
1090
|
-
exp: '&&',
|
|
1091
|
-
args: [
|
|
1092
|
-
{
|
|
1093
|
-
is_expression: true,
|
|
1094
|
-
value: {
|
|
1095
|
-
exp: '>=',
|
|
1096
|
-
args: [
|
|
1097
|
-
{ type: 'int', value: '$local:quantity' },
|
|
1098
|
-
{ type: 'int', value: 100 },
|
|
1099
|
-
],
|
|
1100
|
-
},
|
|
1101
|
-
},
|
|
1102
|
-
{
|
|
1103
|
-
is_expression: true,
|
|
1104
|
-
value: {
|
|
1105
|
-
exp: '>=',
|
|
1106
|
-
args: [
|
|
1107
|
-
{ type: 'int', value: '$local:price' },
|
|
1108
|
-
{ type: 'int', value: 5 },
|
|
1109
|
-
],
|
|
1110
|
-
},
|
|
1111
|
-
},
|
|
1112
|
-
],
|
|
1113
|
-
},
|
|
1114
|
-
},
|
|
1115
|
-
},
|
|
1116
|
-
decorators: [
|
|
1117
|
-
(Story) => (
|
|
1118
|
-
<div className='narrow-column' style={{ width: NARROW_COLUMNS[0], maxWidth: '100%' }}>
|
|
1119
|
-
<Story />
|
|
1120
|
-
</div>
|
|
1121
|
-
),
|
|
1122
|
-
],
|
|
1123
|
-
parameters: {
|
|
1124
|
-
qlip: { viewport: { width: 320, height: 800 } },
|
|
1125
|
-
docs: {
|
|
1126
|
-
description: {
|
|
1127
|
-
story:
|
|
1128
|
-
'Renders two "Logical Greater Than Or Equal" comparisons nested in an "AND" group, in a column narrowed from 320px to 186px - what a 320px screen leaves a condition in a form - and shown at 186px: each nested expression is indented and stays inside the group, its operation name shortened to fit, so the actions that float above it on hover stay on the screen.',
|
|
1129
|
-
},
|
|
1130
|
-
},
|
|
1131
|
-
},
|
|
1132
|
-
play: async ({ canvasElement }) => {
|
|
1133
|
-
await waitFor(() => expect(expressionCount()).toBe(2), { timeout: 10000 });
|
|
1134
|
-
// editable: every control of the operands can be used (a field picker with nothing to offer is disabled)
|
|
1135
|
-
expect(
|
|
1136
|
-
[...canvasElement.querySelectorAll<HTMLButtonElement>('.expression-arg button')].filter((b) => b.disabled).map((b) => b.textContent)
|
|
1137
|
-
).toEqual([]);
|
|
1138
|
-
const column = canvasElement.querySelector('.narrow-column') as HTMLElement;
|
|
1139
|
-
// as narrow as a 320px screen leaves the condition, and narrower
|
|
1140
|
-
for (const width of NARROW_COLUMNS) {
|
|
1141
|
-
column.style.width = `${width}px`;
|
|
1142
|
-
await waitFor(
|
|
1143
|
-
() =>
|
|
1144
|
-
expect({ width, past: panelsPastTheirParent(), titles: titlesPastTheirPanel() }).toEqual({
|
|
1145
|
-
width,
|
|
1146
|
-
past: [],
|
|
1147
|
-
titles: [],
|
|
1148
|
-
}),
|
|
1149
|
-
{ timeout: 10000 }
|
|
1150
|
-
);
|
|
1151
|
-
// the operation stays readable: named in full in a 320px column, and shortened, not crushed, below
|
|
1152
|
-
const selector = canvasElement.querySelector('.expression .expression-operator-selector') as HTMLElement;
|
|
1153
|
-
const name = selector.querySelector('.reqore-button-text-content') as HTMLElement;
|
|
1154
|
-
const shown = { width, selector: Math.round(selector.getBoundingClientRect().width) >= 60, full: name.scrollWidth <= name.clientWidth + 1 };
|
|
1155
|
-
expect(shown).toEqual({ width, selector: true, full: width === NARROW_COLUMNS[0] ? true : shown.full });
|
|
1156
|
-
}
|
|
1157
|
-
},
|
|
1158
|
-
};
|
|
1159
|
-
|
|
1160
|
-
/**
|
|
1161
|
-
* The controls of the operands (a value or a field, its clear button, its `⋮` menu) that reach past their
|
|
1162
|
-
* operand's row, or a row past its expression: none should, or a control is cut off or hangs outside.
|
|
1163
|
-
*/
|
|
1164
|
-
const operandControlsPastTheirRow = () =>
|
|
1165
|
-
[...document.querySelectorAll<HTMLElement>('.expression-arg')].flatMap((row) => {
|
|
1166
|
-
const box = row.getBoundingClientRect();
|
|
1167
|
-
const panel = (row.closest('.expression') as HTMLElement).getBoundingClientRect();
|
|
1168
|
-
const right = Math.min(box.right, panel.right);
|
|
1169
|
-
return [...row.querySelectorAll<HTMLElement>('button, input, .reqore-tag')]
|
|
1170
|
-
.filter((control) => control.closest('.expression-arg') === row && control.getBoundingClientRect().width > 0)
|
|
1171
|
-
.map((control) => ({
|
|
1172
|
-
control: control.className.split(' ').filter((c) => !/^sc-/.test(c)).pop() ?? control.tagName,
|
|
1173
|
-
over: Math.round(control.getBoundingClientRect().right - right),
|
|
1174
|
-
}))
|
|
1175
|
-
.filter(({ over }) => over > 0);
|
|
1176
|
-
});
|
|
1177
|
-
|
|
1178
|
-
/** The same condition's operands - a field and a number each - in a column narrowed to 186px. */
|
|
1179
|
-
export const OperandsFitNarrowColumn: Story = {
|
|
1180
|
-
args: NestedFitsNarrowColumn.args,
|
|
1181
|
-
decorators: NestedFitsNarrowColumn.decorators,
|
|
1182
|
-
parameters: {
|
|
1183
|
-
qlip: { viewport: { width: 320, height: 800 } },
|
|
1184
|
-
docs: {
|
|
1185
|
-
description: {
|
|
1186
|
-
story:
|
|
1187
|
-
'Renders the nested "AND" condition in a column narrowed from 320px to 186px - what a 320px screen leaves a condition in a form - and shown at 186px: each operand\'s value or field, its clear button and its ⋮ menu stay inside the operand\'s row, the field shortened to fit.',
|
|
1188
|
-
},
|
|
1189
|
-
},
|
|
1190
|
-
},
|
|
1191
|
-
play: async ({ canvasElement }) => {
|
|
1192
|
-
await waitFor(() => expect(expressionCount()).toBe(2), { timeout: 10000 });
|
|
1193
|
-
// editable: the operands' controls are all usable, so their narrow layout is the editing one
|
|
1194
|
-
expect(
|
|
1195
|
-
[...canvasElement.querySelectorAll<HTMLButtonElement>('.expression-arg button')].filter((b) => b.disabled).map((b) => b.textContent)
|
|
1196
|
-
).toEqual([]);
|
|
1197
|
-
const column = canvasElement.querySelector('.narrow-column') as HTMLElement;
|
|
1198
|
-
for (const width of NARROW_COLUMNS) {
|
|
1199
|
-
column.style.width = `${width}px`;
|
|
1200
|
-
await waitFor(
|
|
1201
|
-
() => expect({ width, past: operandControlsPastTheirRow() }).toEqual({ width, past: [] }),
|
|
1202
|
-
{ timeout: 10000 }
|
|
1203
|
-
);
|
|
1204
|
-
}
|
|
1205
|
-
},
|
|
1206
|
-
};
|
|
1207
|
-
|
|
1208
|
-
/**
|
|
1209
|
-
* On a phone the remove action leaves the operand row for its ⋮ menu. The play
|
|
1210
|
-
* runs at the runner's desktop viewport, where the inline buttons are the
|
|
1211
|
-
* route, and leaves the second operand's menu open; the capture, taken at
|
|
1212
|
-
* phone width, shows that menu with "Remove value" as its last row and no
|
|
1213
|
-
* remove button beside any field.
|
|
1214
|
-
*/
|
|
1215
|
-
export const RemoveValueOnPhone: Story = {
|
|
1216
|
-
args: concatArgs,
|
|
1217
|
-
parameters: {
|
|
1218
|
-
qlip: { viewport: { width: 390, height: 844 } },
|
|
1219
|
-
docs: {
|
|
1220
|
-
description: {
|
|
1221
|
-
story:
|
|
1222
|
-
'Renders the phone presentation of the "concat" expression with the second operand\'s ⋮ menu open — the operand row has no remove button; "Remove value" is the last row of the menu, after a divider, and the "Add value" slot is the full-width row under the operands.',
|
|
1223
|
-
},
|
|
1224
|
-
},
|
|
1225
|
-
},
|
|
1226
|
-
play: async () => {
|
|
1227
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
1228
|
-
await waitForOrder(CONCAT_OPERANDS);
|
|
1229
|
-
// Desktop viewport during play: every operand removes inline.
|
|
1230
|
-
expect(count('.expression-remove-arg')).toBe(3);
|
|
1231
|
-
await openFieldMenu(1);
|
|
1232
|
-
await waitForText('Use Template');
|
|
1233
|
-
},
|
|
1234
|
-
};
|
|
1235
|
-
|
|
1236
|
-
/** The first operand goes like any other; the last one left has no remove. */
|
|
1237
|
-
export const FirstValueCanBeRemoved: Story = {
|
|
1238
|
-
args: concatArgs,
|
|
1239
|
-
parameters: {
|
|
1240
|
-
docs: {
|
|
1241
|
-
description: {
|
|
1242
|
-
story:
|
|
1243
|
-
'Renders the "concat" expression and removes the first operand, then the first again — the order goes first/second/third → second/third → third, onChange reports each step, and the last operand left carries no remove button.',
|
|
1244
|
-
},
|
|
1245
|
-
},
|
|
1246
|
-
},
|
|
1247
|
-
play: async (context) => {
|
|
1248
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
1249
|
-
await waitForOrder(CONCAT_OPERANDS);
|
|
1250
|
-
expect(count('.expression-remove-arg')).toBe(3);
|
|
1251
|
-
|
|
1252
|
-
await clickSelector('.expression-remove-arg', 0);
|
|
1253
|
-
await waitForOrder(['second', 'third']);
|
|
1254
|
-
expectReportedOrder(context, ['second', 'third']);
|
|
1255
|
-
expect(count('.expression-remove-arg')).toBe(2);
|
|
1256
|
-
|
|
1257
|
-
await clickSelector('.expression-remove-arg', 0);
|
|
1258
|
-
await waitForOrder(['third']);
|
|
1259
|
-
expectReportedOrder(context, ['third']);
|
|
1260
|
-
expect(count('.expression-remove-arg')).toBe(0);
|
|
1261
|
-
},
|
|
1262
|
-
};
|
|
1263
|
-
|
|
1264
|
-
/** Read-only: no slot, nothing to add. */
|
|
1265
|
-
export const AddValueSlotReadOnly: Story = {
|
|
1266
|
-
args: { ...concatArgs, readOnly: true },
|
|
1267
|
-
parameters: {
|
|
1268
|
-
docs: {
|
|
1269
|
-
description: {
|
|
1270
|
-
story:
|
|
1271
|
-
'Renders the "concat" expression read-only — the three operands are shown and the "Add value" slot is absent.',
|
|
1272
|
-
},
|
|
1273
|
-
},
|
|
1274
|
-
},
|
|
1275
|
-
play: async () => {
|
|
1276
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
1277
|
-
await waitForOrder(CONCAT_OPERANDS);
|
|
1278
|
-
expect(addSlot()).toBeNull();
|
|
1279
|
-
},
|
|
1280
|
-
};
|
|
1281
|
-
|
|
1282
|
-
/** A template operand moved past a literal: each field shows the operand now in its slot. */
|
|
1283
|
-
export const ReorderKeepsTemplateOperand: Story = {
|
|
1284
|
-
args: {
|
|
1285
|
-
...concatArgs,
|
|
1286
|
-
value: {
|
|
1287
|
-
value: {
|
|
1288
|
-
exp: 'concat',
|
|
1289
|
-
args: [
|
|
1290
|
-
{ type: 'string', value: '$local:some-richtext' },
|
|
1291
|
-
{ type: 'string', value: 'plain' },
|
|
1292
|
-
],
|
|
1293
|
-
},
|
|
1294
|
-
is_expression: true,
|
|
1295
|
-
},
|
|
1296
|
-
},
|
|
1297
|
-
parameters: {
|
|
1298
|
-
docs: {
|
|
1299
|
-
description: {
|
|
1300
|
-
story:
|
|
1301
|
-
'Renders a "concat" (default surfaces: grip and ⋮ menu) whose first operand is the template reference "$local:some-richtext" and whose second is the literal "plain". "Move to end" on the template operand swaps them — the literal now sits first and the reference second, each in its own field, and nothing shows the reference twice.',
|
|
1302
|
-
},
|
|
1303
|
-
},
|
|
1304
|
-
},
|
|
1305
|
-
play: async (context) => {
|
|
1306
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
1307
|
-
await waitForOrder(['$local:some-richtext', 'plain']);
|
|
1308
|
-
|
|
1309
|
-
await openMoveMenu(0);
|
|
1310
|
-
await waitForText('Move to end');
|
|
1311
|
-
await clickSelector('.expression-arg-move-end');
|
|
1312
|
-
|
|
1313
|
-
// Without remounting the slots, slot 0 would keep its template state and
|
|
1314
|
-
// still show the reference while the literal showed nowhere.
|
|
1315
|
-
await waitForOrder(['plain', '$local:some-richtext']);
|
|
1316
|
-
expect(context.args.onChange).toHaveBeenLastCalledWith(
|
|
1317
|
-
expect.objectContaining({
|
|
1318
|
-
value: expect.objectContaining({
|
|
1319
|
-
exp: 'concat',
|
|
1320
|
-
args: [
|
|
1321
|
-
{ type: 'string', value: 'plain' },
|
|
1322
|
-
{ type: 'string', value: '$local:some-richtext' },
|
|
1323
|
-
],
|
|
1324
|
-
}),
|
|
1325
|
-
})
|
|
1326
|
-
);
|
|
1327
|
-
},
|
|
1328
|
-
};
|
|
1329
|
-
|
|
1330
|
-
/** `reorder: ['positionPicker']` — an ordinal dropdown before each operand. */
|
|
1331
|
-
export const ReorderViaPositionPicker: Story = {
|
|
1332
|
-
args: { ...concatArgs, reorder: ['positionPicker'] },
|
|
1333
|
-
parameters: {
|
|
1334
|
-
docs: {
|
|
1335
|
-
description: {
|
|
1336
|
-
story:
|
|
1337
|
-
'Renders the "concat" expression with each operand\'s position ("1st", "2nd", "3rd") as a dropdown before its field. Picking "1st" on the third operand moves it to the front — the order becomes third/first/second. Each string operand is edited in the chip editor a field with templates now uses — a contenteditable box rather than a textarea, which is why the operand boxes are narrower than they were.',
|
|
1338
|
-
},
|
|
1339
|
-
},
|
|
1340
|
-
},
|
|
1341
|
-
play: async (context) => {
|
|
1342
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
1343
|
-
await waitForOrder(CONCAT_OPERANDS);
|
|
1344
|
-
expect(count('.expression-arg-position')).toBe(3);
|
|
1345
|
-
expect(count('.expression-arg-drag-handle')).toBe(0);
|
|
1346
|
-
|
|
1347
|
-
await clickSelector('.expression-arg-position', 2);
|
|
1348
|
-
// The open list adds a second "1st" — the first is the first operand's own trigger.
|
|
1349
|
-
await waitFor(() => expect(within(document.body).queryAllByText('1st').length).toBe(2), {
|
|
1350
|
-
timeout: 10000,
|
|
1351
|
-
});
|
|
1352
|
-
const items = within(document.body).queryAllByText('1st');
|
|
1353
|
-
await fireEvent.click(items[items.length - 1]);
|
|
1354
|
-
|
|
1355
|
-
await waitForOrder(['third', 'first', 'second']);
|
|
1356
|
-
expectReportedOrder(context, ['third', 'first', 'second']);
|
|
1357
|
-
},
|
|
1358
|
-
};
|
|
1359
|
-
|
|
1360
|
-
/** Every surface at once. */
|
|
1361
|
-
export const ReorderAllSurfaces: Story = {
|
|
1362
|
-
args: { ...concatArgs, reorder: ['overflowMenu', 'dragHandle', 'positionPicker'] },
|
|
1363
|
-
parameters: {
|
|
1364
|
-
docs: {
|
|
1365
|
-
description: {
|
|
1366
|
-
story:
|
|
1367
|
-
'Renders the "concat" expression with every reorder surface at once — a drag grip and a position dropdown before each operand, plus the "Move Argument" section in the ⋮ menu, opened and expanded on the second operand. Each string operand is edited in the chip editor a field with templates now uses — a contenteditable box rather than a textarea, which is why the operand boxes are narrower than they were.',
|
|
1368
|
-
},
|
|
1369
|
-
},
|
|
1370
|
-
},
|
|
1371
|
-
play: async () => {
|
|
1372
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
1373
|
-
await waitForOrder(CONCAT_OPERANDS);
|
|
1374
|
-
expect(count('.expression-arg-drag-handle')).toBe(3);
|
|
1375
|
-
expect(count('.expression-arg-position')).toBe(3);
|
|
1376
|
-
|
|
1377
|
-
await openMoveMenu(1);
|
|
1378
|
-
await waitForText('Move before');
|
|
1379
|
-
},
|
|
1380
|
-
};
|
|
1381
|
-
|
|
1382
|
-
/** `reorder: false` — nothing but the remove buttons. */
|
|
1383
|
-
export const ReorderDisabled: Story = {
|
|
1384
|
-
args: { ...concatArgs, reorder: false },
|
|
1385
|
-
parameters: {
|
|
1386
|
-
docs: {
|
|
1387
|
-
description: {
|
|
1388
|
-
story:
|
|
1389
|
-
'Renders the "concat" expression with reordering turned off — no grip, no position dropdown, and the ⋮ menu (opened on the second operand) has no "Move Argument" section; only the remove buttons remain. Each string operand is edited in the chip editor a field with templates now uses — a contenteditable box rather than a textarea, which is why the operand boxes are narrower than they were.',
|
|
1390
|
-
},
|
|
1391
|
-
},
|
|
1392
|
-
},
|
|
1393
|
-
play: async () => {
|
|
1394
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
1395
|
-
await waitForOrder(CONCAT_OPERANDS);
|
|
1396
|
-
expect(removeArgCount()).toBe(3);
|
|
1397
|
-
expect(count('.expression-arg-drag-handle')).toBe(0);
|
|
1398
|
-
expect(count('.expression-arg-position')).toBe(0);
|
|
1399
|
-
|
|
1400
|
-
await openFieldMenu(1);
|
|
1401
|
-
await waitForText('Use Template');
|
|
1402
|
-
expect(count('.template-menu-actions')).toBe(0);
|
|
1403
|
-
},
|
|
1404
|
-
};
|
|
1405
|
-
|
|
1406
|
-
/** Phone width: the operands stack, the ⋮ menu still carries the move rows. */
|
|
1407
|
-
export const ReorderOnPhone: Story = {
|
|
1408
|
-
args: { ...concatArgs, reorder: ['overflowMenu', 'dragHandle', 'positionPicker'] },
|
|
1409
|
-
parameters: {
|
|
1410
|
-
qlip: { viewport: { width: 390, height: 844 } },
|
|
1411
|
-
docs: {
|
|
1412
|
-
description: {
|
|
1413
|
-
story:
|
|
1414
|
-
'Renders the phone presentation of the "concat" expression with every reorder surface — the operands stack into a column, each keeps its grip and position dropdown, and the ⋮ menu (opened and expanded on the second operand) still carries the "Move Argument" section, so reordering needs no hover or drag. Each string operand is edited in the chip editor a field with templates now uses — a contenteditable box rather than a textarea, which is why the operand boxes are narrower than they were.',
|
|
1415
|
-
},
|
|
1416
|
-
},
|
|
1417
|
-
},
|
|
1418
|
-
play: ReorderAllSurfaces.play,
|
|
1419
|
-
};
|
|
1420
|
-
|
|
1421
|
-
// --- Wrap / unwrap family ---------------------------------------------------
|
|
1422
|
-
// Ported from the IDE `ExpressionCanBeWrapped` / `ExpressionCanBeUnwrapped`.
|
|
1423
|
-
// Adaptations: (1) the offline `Convert to Boolean` (base op) and `Join List
|
|
1424
|
-
// Elements` (wrap target) fixture entries stand in for the live catalogue.
|
|
1425
|
-
// (2) The IDE starts from an empty `Default` and *selects* the base op fresh;
|
|
1426
|
-
// here a valued `convert-to-boolean` is *seeded* so the story stays focused
|
|
1427
|
-
// on its actual subject — the wrap (and unwrap) interaction. (The historical
|
|
1428
|
-
// "fresh op-select paints an empty card" blocker was the Select collection
|
|
1429
|
-
// modal collapsing the card panel — fixed in `SelectFormField`; fresh
|
|
1430
|
-
// selection is covered by `WithArgWithAllowedValues` above.)
|
|
1431
|
-
|
|
1432
|
-
/** A seeded `Convert to Boolean` whose operand carries a template value. */
|
|
1433
|
-
const seededConvert: IExpression = {
|
|
1434
|
-
is_expression: true,
|
|
1435
|
-
value: {
|
|
1436
|
-
exp: 'convert-to-boolean',
|
|
1437
|
-
args: [{ type: 'richtext', value: '$local:some-richtext' }],
|
|
1438
|
-
},
|
|
1439
|
-
};
|
|
1440
|
-
|
|
1441
|
-
/** Wrap a seeded expression inside another op (Join List Elements). */
|
|
1442
|
-
export const ExpressionCanBeWrapped: Story = {
|
|
1443
|
-
args: {
|
|
1444
|
-
returnType: ['string', 'int'],
|
|
1445
|
-
value: seededConvert,
|
|
1446
|
-
},
|
|
1447
|
-
parameters: {
|
|
1448
|
-
docs: {
|
|
1449
|
-
description: {
|
|
1450
|
-
story:
|
|
1451
|
-
'Renders a seeded "Convert to Boolean" expression, hovers the card and picks "Join List Elements" from the Wrap picker — the outer op mounts and the original expression becomes its first operand.',
|
|
1452
|
-
},
|
|
1453
|
-
},
|
|
1454
|
-
},
|
|
1455
|
-
play: async ({ canvasElement }) => {
|
|
1456
|
-
// Seeded base op + its operand render.
|
|
1457
|
-
await waitFor(() => expect(expressionCount(canvasElement)).toBe(1), { timeout: 10000 });
|
|
1458
|
-
await waitForText('Value To Convert', canvasElement);
|
|
1459
|
-
|
|
1460
|
-
// Hover the card to reveal the floating "Wrap" picker, then wrap it in
|
|
1461
|
-
// `Join List Elements` — the wrapped op becomes its first operand and the
|
|
1462
|
-
// outer card shows "List To Join". The card count goes 1 → 2.
|
|
1463
|
-
await userEvent.hover(canvasElement.querySelectorAll('.expression')[0]);
|
|
1464
|
-
await sleep(500);
|
|
1465
|
-
await selectOperation('Wrap', 'Join List Elements', canvasElement.ownerDocument);
|
|
1466
|
-
await waitForText('List To Join', canvasElement);
|
|
1467
|
-
await waitFor(() => expect(expressionCount(canvasElement)).toBe(2), { timeout: 10000 });
|
|
1468
|
-
},
|
|
1469
|
-
};
|
|
1470
|
-
|
|
1471
|
-
/** Wrap, then unwrap — back to a single expression card. */
|
|
1472
|
-
export const ExpressionCanBeUnwrapped: Story = {
|
|
1473
|
-
...ExpressionCanBeWrapped,
|
|
1474
|
-
parameters: {
|
|
1475
|
-
...ExpressionCanBeWrapped.parameters,
|
|
1476
|
-
docs: {
|
|
1477
|
-
description: {
|
|
1478
|
-
story:
|
|
1479
|
-
'Renders the wrapped expression from ExpressionCanBeWrapped, then hovers and unwraps the outer op — the inner "Convert to Boolean" survives and the outer wrapper is removed.',
|
|
1480
|
-
},
|
|
1481
|
-
},
|
|
1482
|
-
},
|
|
1483
|
-
play: async (args) => {
|
|
1484
|
-
await ExpressionCanBeWrapped.play!(args);
|
|
1485
|
-
|
|
1486
|
-
// Unwrap the outer op (keep the child) — the `.expression-unwrap` action.
|
|
1487
|
-
await userEvent.hover(args.canvasElement.querySelectorAll('.expression')[0]);
|
|
1488
|
-
await sleep(500);
|
|
1489
|
-
// The card's actions are ReQore *floating* actions, so they are portalled out
|
|
1490
|
-
// of the canvas — this one lookup stays document-scoped on purpose.
|
|
1491
|
-
await clickSelector('.expression-unwrap');
|
|
1492
|
-
|
|
1493
|
-
await waitFor(() => expect(expressionCount(args.canvasElement)).toBe(1), { timeout: 10000 });
|
|
1494
|
-
},
|
|
1495
|
-
};
|
|
1496
|
-
|
|
1497
|
-
// --- Mismatched-argument confirmation family (Tier B) -----------------------
|
|
1498
|
-
// Ported from the IDE `FunctionArgs…NeedConfirmation` + its Accept-all /
|
|
1499
|
-
// Discard-all / Confirm-selection variants. These exercise
|
|
1500
|
-
// `ConfirmMismatchedTypesModal` and its three submit handlers
|
|
1501
|
-
// (`updateMultipleArgs` → Discard / Accept all / Confirm selection).
|
|
1502
|
-
//
|
|
1503
|
-
// HOW THE MODAL FIRES: the builder flags an argument `types_mismatch: true`
|
|
1504
|
-
// when its value's type is *accepted but not exact* for the operand schema
|
|
1505
|
-
// (`updateExp`, builder/index.tsx ~313: `getAcceptedTypes` includes it / `any`
|
|
1506
|
-
// but `getExactMatches` does not). The modal renders whenever any visible arg
|
|
1507
|
-
// carries that flag (`hasArgumentsWithTypeMismatch`, index.tsx ~810).
|
|
1508
|
-
//
|
|
1509
|
-
// `FunctionArgsArePassedToNewFunctionAndNeedConfirmation` drives the REAL
|
|
1510
|
-
// IDE trigger: a valued `Format Date` switches to a string op, carrying its
|
|
1511
|
-
// `date` first arg into a `richtext` operand (accepted-but-not-exact → flag →
|
|
1512
|
-
// modal). This op-switch used to paint an empty card offline — the Select
|
|
1513
|
-
// collection modal's item click collapsed the card panel (fixed in
|
|
1514
|
-
// `SelectFormField`) — which is why the three handler variants below SEED the
|
|
1515
|
-
// `types_mismatch` flag instead: their subject is the modal's three submit
|
|
1516
|
-
// handlers, and seeding keeps each handler test single-step deterministic.
|
|
1517
|
-
|
|
1518
|
-
/**
|
|
1519
|
-
* A seeded `String Contains` whose first arg is flagged `types_mismatch` — the
|
|
1520
|
-
* accepted-but-not-exact state the builder produces when an op-switch passes an
|
|
1521
|
-
* incompatible arg into a new function. The deterministic precondition for the
|
|
1522
|
-
* three submit-handler variants; the real op-switch trigger is exercised by
|
|
1523
|
-
* `FunctionArgsArePassedToNewFunctionAndNeedConfirmation`.
|
|
1524
|
-
*/
|
|
1525
|
-
const seededMismatch: IExpression = {
|
|
1526
|
-
is_expression: true,
|
|
1527
|
-
value: {
|
|
1528
|
-
exp: 'contains',
|
|
1529
|
-
args: [
|
|
1530
|
-
{ type: 'string', value: '$local:input', is_expression: false, required: true, types_mismatch: true },
|
|
1531
|
-
{ type: 'string', value: 'es', is_expression: false, required: true },
|
|
1532
|
-
{ type: 'bool', value: true, is_expression: false, required: true },
|
|
1533
|
-
],
|
|
1534
|
-
},
|
|
1535
|
-
};
|
|
1536
|
-
|
|
1537
|
-
/** Seeded-modal base for the three submit-handler variants (not exported). */
|
|
1538
|
-
const SeededMismatchBase: Story = {
|
|
1539
|
-
args: {
|
|
1540
|
-
returnType: ['string', 'int'],
|
|
1541
|
-
value: seededMismatch,
|
|
1542
|
-
},
|
|
1543
|
-
play: async () => {
|
|
1544
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
1545
|
-
// The modal mounts with its title and per-argument transform copy.
|
|
1546
|
-
await waitForText('Confirm type selection for mismatched arguments');
|
|
1547
|
-
await waitForText(/will be transformed|deselect the arguments/i);
|
|
1548
|
-
},
|
|
1549
|
-
};
|
|
1550
|
-
|
|
1551
|
-
/**
|
|
1552
|
-
* The REAL trigger, IDE-parity (`ExpressionBuilder.stories` line 592 family):
|
|
1553
|
-
* a valued `Format Date` is switched to `Matches Regular Expression`, whose
|
|
1554
|
-
* first operand is `richtext` — the carried `date` arg is accepted-but-not-
|
|
1555
|
-
* exact, so the builder flags it and the confirmation modal mounts.
|
|
1556
|
-
*/
|
|
1557
|
-
export const FunctionArgsArePassedToNewFunctionAndNeedConfirmation: Story = {
|
|
1558
|
-
parameters: {
|
|
1559
|
-
docs: {
|
|
1560
|
-
description: {
|
|
1561
|
-
story:
|
|
1562
|
-
'Renders a valued "Format Date" expression and switches the operation to "Matches Regular Expression" — the carried date arg is accepted-but-not-exact for the new richtext operand and the mismatched-arguments confirmation modal mounts.',
|
|
1563
|
-
},
|
|
1564
|
-
},
|
|
1565
|
-
},
|
|
1566
|
-
args: {
|
|
1567
|
-
returnType: 'string',
|
|
1568
|
-
value: {
|
|
1569
|
-
is_expression: true,
|
|
1570
|
-
type: 'string',
|
|
1571
|
-
value: {
|
|
1572
|
-
exp: 'format_date',
|
|
1573
|
-
args: [
|
|
1574
|
-
{
|
|
1575
|
-
type: 'date',
|
|
1576
|
-
value: '2025-11-05T23:00:00.000Z',
|
|
1577
|
-
is_expression: false,
|
|
1578
|
-
required: true,
|
|
1579
|
-
},
|
|
1580
|
-
{
|
|
1581
|
-
type: 'richtext',
|
|
1582
|
-
value: [{ type: 'paragraph', children: [{ text: 'YYYY-MM-DD' }] }],
|
|
1583
|
-
is_expression: false,
|
|
1584
|
-
required: true,
|
|
1585
|
-
},
|
|
1586
|
-
],
|
|
1587
|
-
},
|
|
1588
|
-
},
|
|
1589
|
-
},
|
|
1590
|
-
play: async () => {
|
|
1591
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
1592
|
-
await waitForText('Date To Format');
|
|
1593
|
-
|
|
1594
|
-
await selectOperation('Format Date', 'Matches Regular Expression');
|
|
1595
|
-
|
|
1596
|
-
await waitForText('Confirm type selection for mismatched arguments');
|
|
1597
|
-
},
|
|
1598
|
-
};
|
|
1599
|
-
|
|
1600
|
-
/** "Confirm selection" keeps the (still-selected) mismatched arg, transformed. */
|
|
1601
|
-
export const AcceptIncompatibleFunctionArgsSelection: Story = {
|
|
1602
|
-
...SeededMismatchBase,
|
|
1603
|
-
parameters: {
|
|
1604
|
-
...SeededMismatchBase.parameters,
|
|
1605
|
-
docs: {
|
|
1606
|
-
description: {
|
|
1607
|
-
story:
|
|
1608
|
-
'Renders the seeded mismatch-flagged expression, then clicks "Confirm selection" on the mismatched-arguments modal — the (still-selected) argument is kept and transformed to the new expected type.',
|
|
1609
|
-
},
|
|
1610
|
-
},
|
|
1611
|
-
},
|
|
1612
|
-
play: async (args) => {
|
|
1613
|
-
await SeededMismatchBase.play!(args);
|
|
1614
|
-
|
|
1615
|
-
await sleep(500);
|
|
1616
|
-
await clickButtonByLabel('Confirm selection');
|
|
1617
|
-
// Modal dismissed; one card remains.
|
|
1618
|
-
await waitFor(
|
|
1619
|
-
() =>
|
|
1620
|
-
expect(
|
|
1621
|
-
within(document.body).queryByText('Confirm type selection for mismatched arguments')
|
|
1622
|
-
).toBeNull(),
|
|
1623
|
-
{ timeout: 10000 }
|
|
1624
|
-
);
|
|
1625
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
1626
|
-
},
|
|
1627
|
-
};
|
|
1628
|
-
|
|
1629
|
-
/** "Accept all" — every mismatched arg is transformed and kept. */
|
|
1630
|
-
export const AcceptAllIncompatibleFunctionArgs: Story = {
|
|
1631
|
-
...SeededMismatchBase,
|
|
1632
|
-
parameters: {
|
|
1633
|
-
...SeededMismatchBase.parameters,
|
|
1634
|
-
docs: {
|
|
1635
|
-
description: {
|
|
1636
|
-
story:
|
|
1637
|
-
'Renders the seeded mismatch-flagged expression, then clicks "Accept all" on the mismatched-arguments modal — every flagged argument is transformed and kept.',
|
|
1638
|
-
},
|
|
1639
|
-
},
|
|
1640
|
-
},
|
|
1641
|
-
play: async (args) => {
|
|
1642
|
-
await SeededMismatchBase.play!(args);
|
|
1643
|
-
|
|
1644
|
-
await sleep(500);
|
|
1645
|
-
await clickButtonByLabel('Accept all');
|
|
1646
|
-
await waitFor(
|
|
1647
|
-
() =>
|
|
1648
|
-
expect(
|
|
1649
|
-
within(document.body).queryByText('Confirm type selection for mismatched arguments')
|
|
1650
|
-
).toBeNull(),
|
|
1651
|
-
{ timeout: 10000 }
|
|
1652
|
-
);
|
|
1653
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
1654
|
-
},
|
|
1655
|
-
};
|
|
1656
|
-
|
|
1657
|
-
/** "Discard all" — every mismatched arg is cleared. */
|
|
1658
|
-
export const DiscardAllIncompatibleFunctionArgs: Story = {
|
|
1659
|
-
...SeededMismatchBase,
|
|
1660
|
-
parameters: {
|
|
1661
|
-
...SeededMismatchBase.parameters,
|
|
1662
|
-
docs: {
|
|
1663
|
-
description: {
|
|
1664
|
-
story:
|
|
1665
|
-
'Renders the seeded mismatch-flagged expression, then clicks "Discard all" on the mismatched-arguments modal — every flagged argument is cleared.',
|
|
1666
|
-
},
|
|
1667
|
-
},
|
|
1668
|
-
},
|
|
1669
|
-
play: async (args) => {
|
|
1670
|
-
await SeededMismatchBase.play!(args);
|
|
1671
|
-
|
|
1672
|
-
await sleep(500);
|
|
1673
|
-
await clickButtonByLabel('Discard all');
|
|
1674
|
-
await waitFor(
|
|
1675
|
-
() =>
|
|
1676
|
-
expect(
|
|
1677
|
-
within(document.body).queryByText('Confirm type selection for mismatched arguments')
|
|
1678
|
-
).toBeNull(),
|
|
1679
|
-
{ timeout: 10000 }
|
|
1680
|
-
);
|
|
1681
|
-
await waitFor(() => expect(expressionCount()).toBe(1), { timeout: 10000 });
|
|
1682
|
-
},
|
|
1683
|
-
};
|