@qoretechnologies/reqraft 0.10.61 → 0.10.62-pr.137.g052ba87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Description/describedControl.d.ts +48 -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 +2 -1
- package/dist/components/Description/index.js.map +1 -1
- package/dist/components/dpqlEditor/DpqlEditor.d.ts.map +1 -1
- package/dist/components/dpqlEditor/DpqlEditor.js +25 -5
- package/dist/components/dpqlEditor/DpqlEditor.js.map +1 -1
- package/dist/components/dpqlEditor/dpqlHelpers.d.ts +10 -1
- package/dist/components/dpqlEditor/dpqlHelpers.d.ts.map +1 -1
- package/dist/components/dpqlEditor/dpqlHelpers.js +30 -13
- package/dist/components/dpqlEditor/dpqlHelpers.js.map +1 -1
- package/dist/components/dpqlEditor/dpqlTags.d.ts +6 -0
- package/dist/components/dpqlEditor/dpqlTags.d.ts.map +1 -1
- package/dist/components/dpqlEditor/dpqlTags.js +8 -3
- package/dist/components/dpqlEditor/dpqlTags.js.map +1 -1
- package/dist/components/dpqlEditor/types.d.ts +42 -2
- package/dist/components/dpqlEditor/types.d.ts.map +1 -1
- package/dist/components/dpqlEditor/useDpqlSession.d.ts +2 -2
- package/dist/components/dpqlEditor/useDpqlSession.d.ts.map +1 -1
- package/dist/components/dpqlEditor/useDpqlSession.js +16 -7
- 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 +42 -17
- package/dist/components/form/engine/CompactRow.js.map +1 -1
- package/dist/components/form/engine/FormEngine.d.ts +7 -1
- package/dist/components/form/engine/FormEngine.d.ts.map +1 -1
- package/dist/components/form/engine/FormEngine.js +113 -29
- package/dist/components/form/engine/FormEngine.js.map +1 -1
- package/dist/components/form/engine/OptionFieldMessages.d.ts.map +1 -1
- package/dist/components/form/engine/OptionFieldMessages.js +12 -1
- package/dist/components/form/engine/OptionFieldMessages.js.map +1 -1
- package/dist/components/form/engine/compactRowContext.d.ts +16 -0
- 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/readFirst.d.ts +23 -2
- package/dist/components/form/engine/readFirst.d.ts.map +1 -1
- package/dist/components/form/engine/readFirst.js +36 -46
- package/dist/components/form/engine/readFirst.js.map +1 -1
- package/dist/components/form/engine/typeChoices.d.ts +1 -1
- package/dist/components/form/expressions/ExpressionField.d.ts +41 -3
- package/dist/components/form/expressions/ExpressionField.d.ts.map +1 -1
- package/dist/components/form/expressions/ExpressionField.js +398 -99
- package/dist/components/form/expressions/ExpressionField.js.map +1 -1
- package/dist/components/form/expressions/builder/argumentLabel.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/argumentLabel.js +6 -4
- package/dist/components/form/expressions/builder/argumentLabel.js.map +1 -1
- package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/confirmMismatchedTypesModal.js +4 -4
- 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 +6 -3
- package/dist/components/form/expressions/builder/confirmUnsupportedTypeModal.js.map +1 -1
- package/dist/components/form/expressions/builder/index.d.ts +24 -2
- package/dist/components/form/expressions/builder/index.d.ts.map +1 -1
- package/dist/components/form/expressions/builder/index.js +80 -32
- 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/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/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 +35 -9
- 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 +37 -0
- package/dist/components/form/expressions/textOfExpression.js.map +1 -0
- package/dist/components/form/expressions/useRenderExpression.d.ts.map +1 -1
- package/dist/components/form/expressions/useRenderExpression.js +7 -7
- package/dist/components/form/expressions/useRenderExpression.js.map +1 -1
- package/dist/components/form/fields/Field.d.ts.map +1 -1
- package/dist/components/form/fields/Field.js +16 -6
- package/dist/components/form/fields/Field.js.map +1 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.d.ts.map +1 -1
- package/dist/components/form/fields/allowed-values/AllowedValues.js +13 -3
- package/dist/components/form/fields/allowed-values/AllowedValues.js.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.d.ts.map +1 -1
- package/dist/components/form/fields/auto/AutoFormField.js +29 -6
- package/dist/components/form/fields/auto/AutoFormField.js.map +1 -1
- package/dist/components/form/fields/binary/Binary.js +1 -1
- 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 +90 -16
- package/dist/components/form/fields/color/Color.d.ts.map +1 -1
- package/dist/components/form/fields/color/Color.js +575 -16
- package/dist/components/form/fields/color/Color.js.map +1 -1
- package/dist/components/form/fields/emittedValues.d.ts +8 -0
- package/dist/components/form/fields/emittedValues.d.ts.map +1 -1
- package/dist/components/form/fields/emittedValues.js +10 -0
- 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/number/Number.d.ts.map +1 -1
- package/dist/components/form/fields/number/Number.js +5 -2
- 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/rich-text/RichText.d.ts +8 -1
- package/dist/components/form/fields/rich-text/RichText.d.ts.map +1 -1
- package/dist/components/form/fields/rich-text/RichText.js +117 -71
- 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 +49 -0
- package/dist/components/form/fields/rich-text/useTemplateTags.js.map +1 -0
- package/dist/components/form/fields/schema-definition/CatalogNodeEditor.d.ts.map +1 -1
- package/dist/components/form/fields/schema-definition/CatalogNodeEditor.js +5 -1
- 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 +6 -2
- package/dist/components/form/fields/schema-definition/index.js.map +1 -1
- package/dist/components/form/fields/template/ReadOnlyTemplateTag.d.ts +3 -1
- package/dist/components/form/fields/template/ReadOnlyTemplateTag.d.ts.map +1 -1
- package/dist/components/form/fields/template/ReadOnlyTemplateTag.js +6 -2
- package/dist/components/form/fields/template/ReadOnlyTemplateTag.js.map +1 -1
- package/dist/components/form/fields/template/TemplateBrowser.d.ts +22 -0
- package/dist/components/form/fields/template/TemplateBrowser.d.ts.map +1 -0
- package/dist/components/form/fields/template/TemplateBrowser.js +54 -0
- package/dist/components/form/fields/template/TemplateBrowser.js.map +1 -0
- package/dist/components/form/fields/template/TemplateField.d.ts +80 -1
- package/dist/components/form/fields/template/TemplateField.d.ts.map +1 -1
- package/dist/components/form/fields/template/TemplateField.js +526 -81
- package/dist/components/form/fields/template/TemplateField.js.map +1 -1
- 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 +8 -4
- package/dist/components/form/fields/template/TemplateText.js.map +1 -1
- package/dist/components/form/fields/template/writtenAsText.d.ts +57 -0
- package/dist/components/form/fields/template/writtenAsText.d.ts.map +1 -0
- package/dist/components/form/fields/template/writtenAsText.js +206 -0
- package/dist/components/form/fields/template/writtenAsText.js.map +1 -0
- package/dist/components/form/index.d.ts +6 -0
- package/dist/components/form/index.d.ts.map +1 -1
- package/dist/components/form/index.js +14 -1
- package/dist/components/form/index.js.map +1 -1
- package/dist/components/menu/Menu.d.ts.map +1 -1
- package/dist/components/menu/Menu.js +17 -9
- package/dist/components/menu/Menu.js.map +1 -1
- package/dist/components/smartEditor/CompletionMenu.d.ts +43 -0
- package/dist/components/smartEditor/CompletionMenu.d.ts.map +1 -0
- package/dist/components/smartEditor/CompletionMenu.js +196 -0
- package/dist/components/smartEditor/CompletionMenu.js.map +1 -0
- package/dist/components/smartEditor/SmartEditor.d.ts.map +1 -1
- package/dist/components/smartEditor/SmartEditor.js +38 -129
- package/dist/components/smartEditor/SmartEditor.js.map +1 -1
- package/dist/components/smartEditor/completionStyle.d.ts +27 -0
- package/dist/components/smartEditor/completionStyle.d.ts.map +1 -0
- package/dist/components/smartEditor/completionStyle.js +66 -0
- package/dist/components/smartEditor/completionStyle.js.map +1 -0
- package/dist/components/smartEditor/index.d.ts +5 -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 +14 -0
- package/dist/components/smartEditor/templateCompletions.d.ts.map +1 -0
- package/dist/components/smartEditor/templateCompletions.js +84 -0
- package/dist/components/smartEditor/templateCompletions.js.map +1 -0
- package/dist/components/smartEditor/types.d.ts +6 -0
- package/dist/components/smartEditor/types.d.ts.map +1 -1
- package/dist/components/smartEditor/useLspAutocomplete.d.ts +32 -0
- package/dist/components/smartEditor/useLspAutocomplete.d.ts.map +1 -1
- package/dist/components/smartEditor/useLspAutocomplete.js +162 -112
- package/dist/components/smartEditor/useLspAutocomplete.js.map +1 -1
- package/dist/components/smartEditor/useLspHover.d.ts +6 -0
- package/dist/components/smartEditor/useLspHover.d.ts.map +1 -1
- package/dist/components/smartEditor/useLspHover.js +46 -1
- package/dist/components/smartEditor/useLspHover.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/helpers/descriptionTooltip.d.ts +43 -0
- package/dist/helpers/descriptionTooltip.d.ts.map +1 -0
- package/dist/helpers/descriptionTooltip.js +70 -0
- package/dist/helpers/descriptionTooltip.js.map +1 -0
- package/dist/helpers/expressions.d.ts +82 -1
- package/dist/helpers/expressions.d.ts.map +1 -1
- package/dist/helpers/expressions.js +178 -3
- package/dist/helpers/expressions.js.map +1 -1
- package/dist/helpers/markdownText.d.ts +14 -0
- package/dist/helpers/markdownText.d.ts.map +1 -0
- package/dist/helpers/markdownText.js +99 -0
- package/dist/helpers/markdownText.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/templates.d.ts +26 -1
- package/dist/helpers/templates.d.ts.map +1 -1
- package/dist/helpers/templates.js +41 -6
- package/dist/helpers/templates.js.map +1 -1
- package/dist/helpers/validations.d.ts +9 -0
- package/dist/helpers/validations.d.ts.map +1 -1
- package/dist/helpers/validations.js +120 -23
- package/dist/helpers/validations.js.map +1 -1
- package/dist/hooks/useQorusTypes.js +13 -13
- package/dist/hooks/useQorusTypes.js.map +1 -1
- package/package.json +12 -3
- 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/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 -2620
- package/src/components/form/engine/CompactToolbar.tsx +0 -330
- package/src/components/form/engine/FormEngine.stories.tsx +0 -9725
- package/src/components/form/engine/FormEngine.tsx +0 -4569
- package/src/components/form/engine/FormEngineRemote.stories.tsx +0 -679
- package/src/components/form/engine/FormEngineStickyHeaders.stories.tsx +0 -331
- package/src/components/form/engine/FormFieldsSkeleton.tsx +0 -82
- package/src/components/form/engine/OptionFieldMessages.tsx +0 -477
- 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 -742
- 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 -148
- package/src/components/form/engine/compactRowStyles.ts +0 -898
- package/src/components/form/engine/compactToolbarContext.ts +0 -69
- 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 -1077
- 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 -101
- 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 -137
- 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/Field.stories.tsx +0 -143
- package/src/components/form/fields/Field.tsx +0 -732
- package/src/components/form/fields/allowed-values/AllowedValues.tsx +0 -297
- 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 -1164
- 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 -120
- package/src/components/form/fields/long-string/LongString.tsx +0 -130
- 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 -139
- package/src/components/form/fields/number/Number.stories.tsx +0 -159
- package/src/components/form/fields/number/Number.tsx +0 -160
- 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 -46
- 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 -83
- package/src/components/form/fields/rich-text/RichText.tsx +0 -366
- 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 -1717
- 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 -47
- package/src/components/imageLightbox/ImageLightbox.stories.tsx +0 -238
- package/src/components/imageLightbox/ImageLightbox.tsx +0 -236
- 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 -129
- package/src/components/supportTicket/ReferencePicker.stories.tsx +0 -584
- package/src/components/supportTicket/ReferencePicker.tsx +0 -563
- package/src/components/supportTicket/TicketConversation.stories.tsx +0 -121
- package/src/components/supportTicket/TicketHeader.stories.tsx +0 -183
- package/src/components/supportTicket/TicketHeader.tsx +0 -247
- 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 -354
- package/src/components/supportTicket/TicketReplyBox.tsx +0 -150
- 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 -73
- package/src/components/ticketReferences/TicketReferences.stories.tsx +0 -315
- package/src/components/ticketReferences/TicketReferences.tsx +0 -906
- package/src/components/ticketReferences/index.ts +0 -2
- package/src/components/ticketThread/TicketThread.stories.tsx +0 -829
- package/src/components/ticketThread/TicketThread.tsx +0 -719
- 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 -249
- package/src/helpers/common.ts +0 -326
- package/src/helpers/dpqlDetection.ts +0 -209
- package/src/helpers/expressions.ts +0 -140
- 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 -61
- 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
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { IReqorePanelAction } from '@qoretechnologies/reqore/dist/components/Panel';
|
|
2
|
+
import { TReqoreTooltipProp } from '@qoretechnologies/reqore/dist/types/global';
|
|
3
|
+
import { Key, ReactElement } from 'react';
|
|
4
|
+
import { IDescriptionTooltipOptions } from '../../helpers/descriptionTooltip';
|
|
5
|
+
/** What the ⓘ is called, for a screen reader: the thing it explains. */
|
|
6
|
+
export declare const describedControlInfoLabel: (name: string) => string;
|
|
7
|
+
export interface IDescriptionInfoButtonProps {
|
|
8
|
+
/** The description it opens: the server's markdown, drawn as every description card is. */
|
|
9
|
+
description: string;
|
|
10
|
+
/** What it describes: the card's title and the button's accessible name. */
|
|
11
|
+
name: string;
|
|
12
|
+
descriptions: IDescriptionTooltipOptions;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A finger's way to a control's description: a small ⓘ beside the control that opens its card on a tap. A tap on
|
|
16
|
+
* the control itself does what the control does, and only that.
|
|
17
|
+
*/
|
|
18
|
+
export declare const DescriptionInfoButton: import("react").MemoExoticComponent<({ description, name, descriptions }: IDescriptionInfoButtonProps) => import("react/jsx-runtime").JSX.Element>;
|
|
19
|
+
export interface IDescribedControl {
|
|
20
|
+
/** The control's own hover, with a mouse. None on a touch screen, where a tap is the control's own. */
|
|
21
|
+
tooltip?: TReqoreTooltipProp;
|
|
22
|
+
/** The ⓘ to put beside the control, on a touch screen. */
|
|
23
|
+
info?: ReactElement;
|
|
24
|
+
/** The same ⓘ as a panel's header action, for a control that is a panel. */
|
|
25
|
+
infoAction?: IReqorePanelAction;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* How a control that does something when tapped - a checkbox, a tab, a collapsible section - shows its description.
|
|
29
|
+
*
|
|
30
|
+
* With a mouse, as its hover card. On a touch screen (`descriptions.tapToOpen`), never on the control: a tap there
|
|
31
|
+
* ticked the box or switched the tab and opened the card at once. The card opens from an ⓘ beside the control
|
|
32
|
+
* instead (`info`, or `infoAction` for a panel's header). A control with no description gets neither.
|
|
33
|
+
*/
|
|
34
|
+
export declare const describedControl: (description: unknown, descriptions: IDescriptionTooltipOptions, name: string) => IDescribedControl;
|
|
35
|
+
/**
|
|
36
|
+
* A control with its ⓘ beside it, in one row, keyed as the control was; the control alone where there is no ⓘ
|
|
37
|
+
* (a mouse, or no description).
|
|
38
|
+
*/
|
|
39
|
+
export declare const besideItsInfo: (control: ReactElement, info: ReactElement | undefined, key: Key) => ReactElement;
|
|
40
|
+
/**
|
|
41
|
+
* A collapsible section's description, as props for its `ReqorePanel`: with a mouse its header's hover, on a touch
|
|
42
|
+
* screen an ⓘ among its header's actions, so a tap on the header only opens or closes it.
|
|
43
|
+
*/
|
|
44
|
+
export declare const describedPanelProps: (description: unknown, descriptions: IDescriptionTooltipOptions, name: string) => {
|
|
45
|
+
tooltip?: TReqoreTooltipProp;
|
|
46
|
+
actions?: IReqorePanelAction[];
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=describedControl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describedControl.d.ts","sourceRoot":"","sources":["../../../src/components/Description/describedControl.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gDAAgD,CAAC;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,4CAA4C,CAAC;AAChF,OAAO,EAAgB,GAAG,EAAQ,YAAY,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAsB,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAElG,wEAAwE;AACxE,eAAO,MAAM,yBAAyB,SAAU,MAAM,WAAoB,CAAC;AAE3E,MAAM,WAAW,2BAA2B;IAC1C,2FAA2F;IAC3F,WAAW,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,0BAA0B,CAAC;CAC1C;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,4EACM,2BAA2B,6CAalE,CAAC;AAIF,MAAM,WAAW,iBAAiB;IAChC,uGAAuG;IACvG,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,0DAA0D;IAC1D,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,4EAA4E;IAC5E,UAAU,CAAC,EAAE,kBAAkB,CAAC;CACjC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,gBACd,OAAO,gBACN,0BAA0B,QAClC,MAAM,KACX,iBAmBF,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,aAAa,YACf,YAAY,QACf,YAAY,GAAG,SAAS,OACzB,GAAG,KACP,YAM+B,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,mBAAmB,gBACjB,OAAO,gBACN,0BAA0B,QAClC,MAAM,KACX;IAAE,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAAC,OAAO,CAAC,EAAE,kBAAkB,EAAE,CAAA;CAGhE,CAAC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.describedPanelProps = exports.besideItsInfo = exports.describedControl = exports.DescriptionInfoButton = exports.describedControlInfoLabel = void 0;
|
|
15
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
16
|
+
// Copyright 2026 Qore Technologies, s.r.o.
|
|
17
|
+
var reqore_1 = require("@qoretechnologies/reqore");
|
|
18
|
+
var react_1 = require("react");
|
|
19
|
+
var descriptionTooltip_1 = require("../../helpers/descriptionTooltip");
|
|
20
|
+
/** What the ⓘ is called, for a screen reader: the thing it explains. */
|
|
21
|
+
var describedControlInfoLabel = function (name) { return "About ".concat(name); };
|
|
22
|
+
exports.describedControlInfoLabel = describedControlInfoLabel;
|
|
23
|
+
/**
|
|
24
|
+
* A finger's way to a control's description: a small ⓘ beside the control that opens its card on a tap. A tap on
|
|
25
|
+
* the control itself does what the control does, and only that.
|
|
26
|
+
*/
|
|
27
|
+
exports.DescriptionInfoButton = (0, react_1.memo)(function (_a) {
|
|
28
|
+
var description = _a.description, name = _a.name, descriptions = _a.descriptions;
|
|
29
|
+
return ((0, jsx_runtime_1.jsx)(reqore_1.ReqoreButton, { className: 'reqraft-description-info', icon: 'InformationLine',
|
|
30
|
+
// a finger's size: Reqore's big control is 48px
|
|
31
|
+
size: 'big', minimal: true, flat: true, fixed: true, "aria-label": (0, exports.describedControlInfoLabel)(name), tooltip: (0, descriptionTooltip_1.descriptionTooltip)(description, __assign(__assign({}, descriptions), { tapToOpen: true }), name) }));
|
|
32
|
+
});
|
|
33
|
+
exports.DescriptionInfoButton.displayName = 'DescriptionInfoButton';
|
|
34
|
+
/**
|
|
35
|
+
* How a control that does something when tapped - a checkbox, a tab, a collapsible section - shows its description.
|
|
36
|
+
*
|
|
37
|
+
* With a mouse, as its hover card. On a touch screen (`descriptions.tapToOpen`), never on the control: a tap there
|
|
38
|
+
* ticked the box or switched the tab and opened the card at once. The card opens from an ⓘ beside the control
|
|
39
|
+
* instead (`info`, or `infoAction` for a panel's header). A control with no description gets neither.
|
|
40
|
+
*/
|
|
41
|
+
var describedControl = function (description, descriptions, name) {
|
|
42
|
+
if (!descriptions.tapToOpen) {
|
|
43
|
+
return { tooltip: (0, descriptionTooltip_1.descriptionTooltip)(description, descriptions) };
|
|
44
|
+
}
|
|
45
|
+
if (typeof description !== 'string' || !description.trim()) {
|
|
46
|
+
return {};
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
info: (0, jsx_runtime_1.jsx)(exports.DescriptionInfoButton, { description: description, name: name, descriptions: descriptions }),
|
|
50
|
+
infoAction: {
|
|
51
|
+
className: 'reqraft-description-info',
|
|
52
|
+
icon: 'InformationLine',
|
|
53
|
+
size: 'big',
|
|
54
|
+
minimal: true,
|
|
55
|
+
flat: true,
|
|
56
|
+
'aria-label': (0, exports.describedControlInfoLabel)(name),
|
|
57
|
+
tooltip: (0, descriptionTooltip_1.descriptionTooltip)(description, __assign(__assign({}, descriptions), { tapToOpen: true }), name),
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
exports.describedControl = describedControl;
|
|
62
|
+
/**
|
|
63
|
+
* A control with its ⓘ beside it, in one row, keyed as the control was; the control alone where there is no ⓘ
|
|
64
|
+
* (a mouse, or no description).
|
|
65
|
+
*/
|
|
66
|
+
var besideItsInfo = function (control, info, key) {
|
|
67
|
+
return info ?
|
|
68
|
+
(0, jsx_runtime_1.jsxs)(reqore_1.ReqoreControlGroup, { className: 'reqraft-described-control', gapSize: 'tiny', children: [control, info] }, key)
|
|
69
|
+
: (0, react_1.cloneElement)(control, { key: key });
|
|
70
|
+
};
|
|
71
|
+
exports.besideItsInfo = besideItsInfo;
|
|
72
|
+
/**
|
|
73
|
+
* A collapsible section's description, as props for its `ReqorePanel`: with a mouse its header's hover, on a touch
|
|
74
|
+
* screen an ⓘ among its header's actions, so a tap on the header only opens or closes it.
|
|
75
|
+
*/
|
|
76
|
+
var describedPanelProps = function (description, descriptions, name) {
|
|
77
|
+
var _a = (0, exports.describedControl)(description, descriptions, name), tooltip = _a.tooltip, infoAction = _a.infoAction;
|
|
78
|
+
return __assign({ tooltip: tooltip }, (infoAction ? { actions: [infoAction] } : {}));
|
|
79
|
+
};
|
|
80
|
+
exports.describedPanelProps = describedPanelProps;
|
|
81
|
+
//# sourceMappingURL=describedControl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describedControl.js","sourceRoot":"","sources":["../../../src/components/Description/describedControl.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA2C;AAC3C,mDAA4E;AAG5E,+BAA8D;AAC9D,uEAAkG;AAElG,wEAAwE;AACjE,IAAM,yBAAyB,GAAG,UAAC,IAAY,IAAK,OAAA,gBAAS,IAAI,CAAE,EAAf,CAAe,CAAC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uCAAkB,EAAC,WAAW,wBAAO,YAAY,KAAE,SAAS,EAAE,IAAI,KAAI,IAAI,CAAC;SAC/D;KACxB,CAAC;AACJ,CAAC,CAAC;AAvBW,QAAA,gBAAgB,oBAuB3B;AAEF;;;GAGG;AACI,IAAM,aAAa,GAAG,UAC3B,OAAqB,EACrB,IAA8B,EAC9B,GAAQ;IAER,OAAA,IAAI,CAAC,CAAC;QACJ,wBAAC,2BAAkB,IAAW,SAAS,EAAC,2BAA2B,EAAC,OAAO,EAAC,MAAM,aAC/E,OAAO,EACP,IAAI,KAFkB,GAAG,CAGP;QACvB,CAAC,CAAC,IAAA,oBAAY,EAAC,OAAO,EAAE,EAAE,GAAG,KAAA,EAAE,CAAC;AALhC,CAKgC,CAAC;AAVtB,QAAA,aAAa,iBAUS;AAEnC;;;GAGG;AACI,IAAM,mBAAmB,GAAG,UACjC,WAAoB,EACpB,YAAwC,EACxC,IAAY;IAEN,IAAA,KAA0B,IAAA,wBAAgB,EAAC,WAAW,EAAE,YAAY,EAAE,IAAI,CAAC,EAAzE,OAAO,aAAA,EAAE,UAAU,gBAAsD,CAAC;IAClF,kBAAS,OAAO,SAAA,IAAK,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAG;AACvE,CAAC,CAAC;AAPW,QAAA,mBAAmB,uBAO9B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Description/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,qBAAqB,EAAW,MAAM,oDAAoD,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Description/index.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,qBAAqB,EAAW,MAAM,oDAAoD,CAAC;AACpG,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAO1D,MAAM,WAAW,iBAAkB,SAAQ,qBAAqB;IAC9D,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,6BAA6B,CAAC,EAAE,OAAO,CAAC;IACxC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,MAAM,CAAC,EAAE,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;IAC5C,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAoHD,eAAO,MAAM,YAAY,UAAW,GAAG,4CAQtC,CAAC;AAEF,eAAO,MAAM,WAAW,oMAWnB,iBAAiB,6CA8FrB,CAAC"}
|
|
@@ -36,6 +36,7 @@ var Paragraph_1 = require("@qoretechnologies/reqore/dist/components/Paragraph");
|
|
|
36
36
|
var react_1 = require("react");
|
|
37
37
|
var react_markdown_1 = __importDefault(require("react-markdown"));
|
|
38
38
|
var styled_components_1 = __importDefault(require("styled-components"));
|
|
39
|
+
var markdownText_1 = require("../../helpers/markdownText");
|
|
39
40
|
var markdownRendererContext_1 = require("./markdownRendererContext");
|
|
40
41
|
/**
|
|
41
42
|
* System monospace, spelled out rather than imported from
|
|
@@ -111,7 +112,7 @@ exports.Description = (0, react_1.memo)(function (_a) {
|
|
|
111
112
|
// its own paragraphs, lists, headings — and a `<p>` may not contain
|
|
112
113
|
// any of them, so the browser closed the outer paragraph early and
|
|
113
114
|
// the rest of the description escaped its own styling.
|
|
114
|
-
(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [markdownRenderer ? (markdownRenderer({ value: finalLongDescription, compact: compact })) : ((0, jsx_runtime_1.jsx)(StyledDescriptionMarkdown, { "$compact": compact, children: (0, jsx_runtime_1.jsx)(react_markdown_1.default, { components: components, children: finalLongDescription }) })), renderToggle()] })) : ((0, jsx_runtime_1.jsx)(Paragraph_1.ReqoreP, __assign({}, rest, { children: (0, jsx_runtime_1.jsxs)(reqore_1.ReqoreSpan, { effect: effect, children: [finalShownDescription, " ", finalLongDescription ? renderToggle() : null] }) }))), margin === 'both' || margin === 'bottom' ? (0, jsx_runtime_1.jsx)(reqore_1.ReqoreVerticalSpacer, { height: 10 }) : null] }));
|
|
115
|
+
(0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [markdownRenderer ? (markdownRenderer({ value: finalLongDescription, compact: compact })) : ((0, jsx_runtime_1.jsx)(StyledDescriptionMarkdown, { "$compact": compact, children: (0, jsx_runtime_1.jsx)(react_markdown_1.default, { components: components, children: finalLongDescription }) })), renderToggle()] })) : ((0, jsx_runtime_1.jsx)(Paragraph_1.ReqoreP, __assign({}, rest, { children: (0, jsx_runtime_1.jsxs)(reqore_1.ReqoreSpan, { effect: effect, children: [(0, markdownText_1.markdownToProse)(finalShownDescription), " ", finalLongDescription ? renderToggle() : null] }) }))), margin === 'both' || margin === 'bottom' ? (0, jsx_runtime_1.jsx)(reqore_1.ReqoreVerticalSpacer, { height: 10 }) : null] }));
|
|
115
116
|
});
|
|
116
117
|
var templateObject_1;
|
|
117
118
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Description/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAA8F;AAC9F,gFAAoG;AAEpG,+BAA6D;AAC7D,kEAA2C;AAC3C,wEAAuC;AACvC,qEAAgE;AAmBhE;;;;;GAKG;AACH,IAAM,SAAS,GACb,qFAAqF,CAAC;AAExF;;;;;;GAMG;AACH,IAAM,yBAAyB,GAAG,2BAAM,CAAC,GAAG,8sEAAwB,8nBAajD,EAAS,w8BAsCd,EAA0D,2OAevD,EAAiD,iCAGjD,EAAiD,iCAGjD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KAAK,MAAM,IAAI,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,uBAAC,6BAAoB,IAAC,MAAM,EAAE,EAAE,GAAI,CAAC,CAAC,CAAC,IAAI,IACtF,CACJ,CAAC;AACJ,CAAC,CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DpqlEditor.d.ts","sourceRoot":"","sources":["../../../src/components/dpqlEditor/DpqlEditor.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"DpqlEditor.d.ts","sourceRoot":"","sources":["../../../src/components/dpqlEditor/DpqlEditor.tsx"],"names":[],"mappings":";AAoBA,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAK3D,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC;AASjD,eAAO,MAAM,UAAU,6GA8LtB,CAAC"}
|
|
@@ -68,6 +68,8 @@ var dpqlHelpers_1 = require("./dpqlHelpers");
|
|
|
68
68
|
var dpqlInserter_1 = require("./dpqlInserter");
|
|
69
69
|
var dpqlTags_1 = require("./dpqlTags");
|
|
70
70
|
var useDpqlSession_1 = require("./useDpqlSession");
|
|
71
|
+
var useTemplateTags_1 = require("../form/fields/rich-text/useTemplateTags");
|
|
72
|
+
var descriptionTooltip_1 = require("../../helpers/descriptionTooltip");
|
|
71
73
|
// Trigger characters that open the autocomplete on typing. Space is
|
|
72
74
|
// deliberately NOT in the set — typing a space after a chip (or after a
|
|
73
75
|
// keyword like `==`) shouldn't pop the dropdown. Sigils (`@`, `$`) and
|
|
@@ -75,7 +77,7 @@ var useDpqlSession_1 = require("./useDpqlSession");
|
|
|
75
77
|
// of completion is handled by typing inside an already-open token.
|
|
76
78
|
var DPQL_TRIGGERS = new Set(['@', '$', '.', ':']);
|
|
77
79
|
exports.DpqlEditor = (0, react_1.forwardRef)(function (_a, ref) {
|
|
78
|
-
var value = _a.value, onChange = _a.onChange, provider = _a.provider, recordType = _a.recordType, options = _a.options, actionCode = _a.actionCode, height = _a.height, _b = _a.readOnly, readOnly = _b === void 0 ? false : _b, _c = _a.showDiagnostics, showDiagnostics = _c === void 0 ? true : _c, _d = _a.enableHover, enableHover = _d === void 0 ? true : _d, _e = _a.templateTagsUseIntent, templateTagsUseIntent = _e === void 0 ? false : _e, loadingIndicator = _a.loadingIndicator, templates = _a.templates, onBlur = _a.onBlur, _f = _a.useServerParse, useServerParse = _f === void 0 ? false : _f, fields = _a.fields, _g = _a.alertPayloadContext, alertPayloadContext = _g === void 0 ? false : _g, fsmContext = _a.fsmContext;
|
|
80
|
+
var value = _a.value, onChange = _a.onChange, provider = _a.provider, recordType = _a.recordType, options = _a.options, actionCode = _a.actionCode, height = _a.height, _b = _a.readOnly, readOnly = _b === void 0 ? false : _b, _c = _a.showDiagnostics, showDiagnostics = _c === void 0 ? true : _c, _d = _a.enableHover, enableHover = _d === void 0 ? true : _d, _e = _a.templateTagsUseIntent, templateTagsUseIntent = _e === void 0 ? false : _e, loadingIndicator = _a.loadingIndicator, templates = _a.templates, onBlur = _a.onBlur, _f = _a.useServerParse, useServerParse = _f === void 0 ? false : _f, fields = _a.fields, _g = _a.alertPayloadContext, alertPayloadContext = _g === void 0 ? false : _g, fsmContext = _a.fsmContext, onUnavailable = _a.onUnavailable, onReady = _a.onReady;
|
|
79
81
|
var dpql = (0, useDpqlSession_1.useDpqlSession)({
|
|
80
82
|
provider: provider,
|
|
81
83
|
recordType: recordType,
|
|
@@ -174,14 +176,29 @@ exports.DpqlEditor = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
174
176
|
if (!useServerParse)
|
|
175
177
|
return dpqlHelpers_1.dpqlSlateConverter;
|
|
176
178
|
return __assign(__assign({}, dpqlHelpers_1.dpqlSlateConverter), { toSlateNodes: function (text) {
|
|
177
|
-
if (text === serverParsedFor &&
|
|
178
|
-
serverParsedNodes) {
|
|
179
|
+
if (text === serverParsedFor && serverParsedNodes) {
|
|
179
180
|
return serverParsedNodes;
|
|
180
181
|
}
|
|
181
182
|
return dpqlHelpers_1.dpqlSlateConverter.toSlateNodes(text);
|
|
182
183
|
} });
|
|
183
184
|
}, [useServerParse, serverParsedFor, serverParsedNodes]);
|
|
184
|
-
|
|
185
|
+
// no language server to talk to: said once, for the host to show what works without one
|
|
186
|
+
var unavailable = dpql.session.isUnavailable;
|
|
187
|
+
(0, react_1.useEffect)(function () {
|
|
188
|
+
if (unavailable)
|
|
189
|
+
onUnavailable === null || onUnavailable === void 0 ? void 0 : onUnavailable();
|
|
190
|
+
}, [unavailable]);
|
|
191
|
+
// the language server can now parse and write the text: said once, as the session says it
|
|
192
|
+
var ready = dpql.session.isReady && dpql.session.isContextReady;
|
|
193
|
+
(0, react_1.useEffect)(function () {
|
|
194
|
+
if (ready)
|
|
195
|
+
onReady === null || onReady === void 0 ? void 0 : onReady();
|
|
196
|
+
}, [ready]);
|
|
197
|
+
var templateTags = (0, useTemplateTags_1.useTemplateTags)(templates, !readOnly);
|
|
198
|
+
var descriptions = (0, descriptionTooltip_1.useDescriptionTooltips)();
|
|
199
|
+
var tagRenderer = (0, react_1.useMemo)(function () {
|
|
200
|
+
return (0, dpqlTags_1.makeDpqlTagRenderer)(dpql.fieldMeta, { templateTagsUseIntent: templateTagsUseIntent, templates: templates, descriptions: descriptions });
|
|
201
|
+
}, [dpql.fieldMeta, templateTagsUseIntent, templates, descriptions]);
|
|
185
202
|
(0, react_1.useImperativeHandle)(ref, function () { return ({
|
|
186
203
|
format: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
187
204
|
var formatted;
|
|
@@ -201,7 +218,10 @@ exports.DpqlEditor = (0, react_1.forwardRef)(function (_a, ref) {
|
|
|
201
218
|
parse: dpql.parse,
|
|
202
219
|
serialize: dpql.serialize,
|
|
203
220
|
}); }, [dpql, value, onChange]);
|
|
204
|
-
return ((0, jsx_runtime_1.jsx)(SmartEditor_1.SmartEditor, { session: dpql.session, value: value, onChange: onChange, tagRenderer: tagRenderer, triggerCharacters: DPQL_TRIGGERS, converter: converter, completionInserter: dpqlInserter_1.dpqlCompletionInserter, height: height, readOnly: readOnly, showDiagnostics: showDiagnostics, enableHover: enableHover, onBlur: onBlur,
|
|
221
|
+
return ((0, jsx_runtime_1.jsx)(SmartEditor_1.SmartEditor, { session: dpql.session, value: value, onChange: onChange, tagRenderer: tagRenderer, triggerCharacters: DPQL_TRIGGERS, converter: converter, completionInserter: dpqlInserter_1.dpqlCompletionInserter, height: height, readOnly: readOnly, showDiagnostics: showDiagnostics, enableHover: enableHover, onBlur: onBlur,
|
|
222
|
+
// the templates it labels chips with are the ones it lists when clicked or tabbed into, as a
|
|
223
|
+
// rich-text field lists them (qorus#646)
|
|
224
|
+
tags: templateTags, isLoading: isParsing, loadingIndicator: loadingIndicator }));
|
|
205
225
|
});
|
|
206
226
|
exports.DpqlEditor.displayName = 'DpqlEditor';
|
|
207
227
|
//# sourceMappingURL=DpqlEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DpqlEditor.js","sourceRoot":"","sources":["../../../src/components/dpqlEditor/DpqlEditor.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA2C;AAC3C,wEAAwE;AACxE,wEAAwE;AACxE,0EAA0E;AAC1E,qEAAqE;AACrE,uEAAuE;AACvE,cAAc;AACd,EAAE;AACF,qEAAqE;AACrE,iEAAiE;AACjE,sEAAsE;AACtE,sEAAsE;AACtE,oDAAoD;AAEpD,+
|
|
1
|
+
{"version":3,"file":"DpqlEditor.js","sourceRoot":"","sources":["../../../src/components/dpqlEditor/DpqlEditor.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA2C;AAC3C,wEAAwE;AACxE,wEAAwE;AACxE,0EAA0E;AAC1E,qEAAqE;AACrE,uEAAuE;AACvE,cAAc;AACd,EAAE;AACF,qEAAqE;AACrE,iEA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ACH,cAAsB,OAAA,CAAC;QACrB,MAAM,EAAE;;;;4BACY,qBAAM,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,EAAA;;wBAAvC,SAAS,GAAG,SAA2B;wBAC7C,IAAI,SAAS,KAAK,IAAI,IAAI,SAAS,KAAK,KAAK,EAAE,CAAC;4BAC9C,QAAQ,CAAC,SAAS,CAAC,CAAC;wBACtB,CAAC;;;;aACF;QACD,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,SAAS,EAAE,IAAI,CAAC,SAAS;KAC1B,CAAC,EAVoB,CAUpB,EACF,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,CAAC,CACxB,CAAC;IAEF,OAAO,CACL,uBAAC,yBAAW,IACV,OAAO,EAAE,IAAI,CAAC,OAAO,EACrB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,iBAAiB,EAAE,aAAa,EAChC,SAAS,EAAE,SAAS,EACpB,kBAAkB,EAAE,qCAAsB,EAC1C,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,eAAe,EAAE,eAAe,EAChC,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM;QACd,6FAA6F;QAC7F,yCAAyC;QACzC,IAAI,EAAE,YAAY,EAClB,SAAS,EAAE,SAAS,EACpB,gBAAgB,EAAE,gBAAgB,GAClC,CACH,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,kBAAU,CAAC,WAAW,GAAG,YAAY,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ISlateConverter, ISlateElement } from '../smartEditor/types';
|
|
1
|
+
import { ISlateConverter, ISlateElement, TSlateNode } from '../smartEditor/types';
|
|
2
2
|
/**
|
|
3
3
|
* Convert plain DPQL text to Slate elements. Parses `$prefix:{value}` and
|
|
4
4
|
* `@field` patterns into tag elements; everything else becomes text nodes.
|
|
@@ -10,6 +10,15 @@ export declare function plainTextToSlate(text: string): ISlateElement[];
|
|
|
10
10
|
* `$local:name == "John"` read the same.
|
|
11
11
|
*/
|
|
12
12
|
export declare function dpqlDisplayedText(text: string): string;
|
|
13
|
+
/**
|
|
14
|
+
* `children` with a text node on each side of every chip, as Slate requires of
|
|
15
|
+
* an inline void: adjacent text nodes are left as they are, and an empty
|
|
16
|
+
* paragraph gets one empty text node. The server's `dpql/toRichtext` writes a
|
|
17
|
+
* chip that starts or ends a line without the empty text beside it, and a
|
|
18
|
+
* document loaded that way is never normalised, so the caret a click puts
|
|
19
|
+
* after such a chip lands back inside it, where typing does nothing.
|
|
20
|
+
*/
|
|
21
|
+
export declare function withTextAroundTags(children: TSlateNode[]): TSlateNode[];
|
|
13
22
|
/** Convert Slate elements back to plain DPQL text. */
|
|
14
23
|
export declare function slateToPlainText(elements: ISlateElement[]): string;
|
|
15
24
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dpqlHelpers.d.ts","sourceRoot":"","sources":["../../../src/components/dpqlEditor/dpqlHelpers.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"dpqlHelpers.d.ts","sourceRoot":"","sources":["../../../src/components/dpqlEditor/dpqlHelpers.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAc,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAsB9F;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,EAAE,CAyD9D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQtD;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,UAAU,EAAE,GAAG,UAAU,EAAE,CAYvE;AAgBD,sDAAsD;AACtD,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,aAAa,EAAE,GAAG,MAAM,CAElE;AAgBD;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,aAAa,EAAE,EACzB,UAAU,EAAE,MAAM,EAAE,EACpB,YAAY,EAAE,MAAM,GACnB,MAAM,CAyCR;AAED,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED,8DAA8D;AAC9D,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAgBjD;AAED,yEAAyE;AACzE,eAAO,MAAM,kBAAkB,EAAE,eAIhC,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,OAAO,GAChB,aAAa,EAAE,GAAG,IAAI,CAsCxB"}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// SmartEditor primitive uses these via the `converter` prop on
|
|
7
7
|
// `DpqlEditor`; the SmartEditor itself has no knowledge of DPQL syntax.
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.richtextResponseToSlate = exports.dpqlSlateConverter = exports.getTagLabel = exports.isTagCompletion = exports.slateSelectionToOffset = exports.slateToPlainText = exports.dpqlDisplayedText = exports.plainTextToSlate = void 0;
|
|
9
|
+
exports.richtextResponseToSlate = exports.dpqlSlateConverter = exports.getTagLabel = exports.isTagCompletion = exports.slateSelectionToOffset = exports.slateToPlainText = exports.withTextAroundTags = exports.dpqlDisplayedText = exports.plainTextToSlate = void 0;
|
|
10
10
|
// Combined pattern that matches templates, field refs, or plain text segments.
|
|
11
11
|
// Template values without braces match only word chars and dots (not quotes,
|
|
12
12
|
// parens, etc.); the `(?<![.\w])` lookbehind on `@` prevents matching inside
|
|
@@ -50,9 +50,10 @@ function plainTextToSlate(text) {
|
|
|
50
50
|
line[matchEnd] === '"';
|
|
51
51
|
var textStart = isQuoted ? matchStart - 1 : matchStart;
|
|
52
52
|
var textEnd = isQuoted ? matchEnd + 1 : matchEnd;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
53
|
+
// Every chip has a text node on each side, even an empty one: a chip
|
|
54
|
+
// that starts or ends the line otherwise leaves the caret nowhere to go
|
|
55
|
+
// but into the chip, where Slate drops whatever is typed.
|
|
56
|
+
children.push({ text: line.slice(lastIndex, textStart) });
|
|
56
57
|
var fullMatch = match[0];
|
|
57
58
|
if (match[1]) {
|
|
58
59
|
var colonIdx = fullMatch.indexOf(':');
|
|
@@ -69,12 +70,7 @@ function plainTextToSlate(text) {
|
|
|
69
70
|
}
|
|
70
71
|
lastIndex = textEnd;
|
|
71
72
|
}
|
|
72
|
-
|
|
73
|
-
children.push({ text: line.slice(lastIndex) });
|
|
74
|
-
}
|
|
75
|
-
if (children.length === 0) {
|
|
76
|
-
children.push({ text: '' });
|
|
77
|
-
}
|
|
73
|
+
children.push({ text: line.slice(lastIndex) });
|
|
78
74
|
return { type: 'paragraph', children: children };
|
|
79
75
|
});
|
|
80
76
|
}
|
|
@@ -94,6 +90,29 @@ function dpqlDisplayedText(text) {
|
|
|
94
90
|
.join('\n');
|
|
95
91
|
}
|
|
96
92
|
exports.dpqlDisplayedText = dpqlDisplayedText;
|
|
93
|
+
/**
|
|
94
|
+
* `children` with a text node on each side of every chip, as Slate requires of
|
|
95
|
+
* an inline void: adjacent text nodes are left as they are, and an empty
|
|
96
|
+
* paragraph gets one empty text node. The server's `dpql/toRichtext` writes a
|
|
97
|
+
* chip that starts or ends a line without the empty text beside it, and a
|
|
98
|
+
* document loaded that way is never normalised, so the caret a click puts
|
|
99
|
+
* after such a chip lands back inside it, where typing does nothing.
|
|
100
|
+
*/
|
|
101
|
+
function withTextAroundTags(children) {
|
|
102
|
+
var out = [];
|
|
103
|
+
for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {
|
|
104
|
+
var child = children_1[_i];
|
|
105
|
+
if (!('text' in child) && (out.length === 0 || !('text' in out[out.length - 1]))) {
|
|
106
|
+
out.push({ text: '' });
|
|
107
|
+
}
|
|
108
|
+
out.push(child);
|
|
109
|
+
}
|
|
110
|
+
if (out.length === 0 || !('text' in out[out.length - 1])) {
|
|
111
|
+
out.push({ text: '' });
|
|
112
|
+
}
|
|
113
|
+
return out;
|
|
114
|
+
}
|
|
115
|
+
exports.withTextAroundTags = withTextAroundTags;
|
|
97
116
|
function createTagElement(value, label, metadata) {
|
|
98
117
|
return {
|
|
99
118
|
type: 'tag',
|
|
@@ -257,9 +276,7 @@ function richtextResponseToSlate(response) {
|
|
|
257
276
|
return null;
|
|
258
277
|
}
|
|
259
278
|
}
|
|
260
|
-
|
|
261
|
-
children.push({ text: '' });
|
|
262
|
-
paragraphs.push({ type: 'paragraph', children: children });
|
|
279
|
+
paragraphs.push({ type: 'paragraph', children: withTextAroundTags(children) });
|
|
263
280
|
}
|
|
264
281
|
if (paragraphs.length === 0) {
|
|
265
282
|
paragraphs.push({ type: 'paragraph', children: [{ text: '' }] });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dpqlHelpers.js","sourceRoot":"","sources":["../../../src/components/dpqlEditor/dpqlHelpers.ts"],"names":[],"mappings":";AAAA,2CAA2C;AAC3C,uEAAuE;AACvE,mEAAmE;AACnE,mEAAmE;AACnE,+DAA+D;AAC/D,wEAAwE;;;AAIxE,+EAA+E;AAC/E,6EAA6E;AAC7E,6EAA6E;AAC7E,wBAAwB;AACxB,EAAE;AACF,wEAAwE;AACxE,+EAA+E;AAC/E,qEAAqE;AACrE,EAAE;AACF,wGAAwG;AACxG,6FAA6F;AAC7F,4EAA4E;AAC5E,IAAM,UAAU,GAAG,WAAW,CAAC;AAC/B,IAAM,SAAS,GAAG,uBAAuB,CAAC;AAC1C,IAAM,UAAU,GAAG,UAAG,UAAU,SAAG,SAAS,MAAG,CAAC;AAChD,IAAM,aAAa,GAAG,IAAI,MAAM,CAC9B,yFAAkF,UAAU,mBAAS,UAAU,QAAK,EACpH,IAAI,CACL,CAAC;AAE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AI,EAAE,KAAK;oBACX,KAAK,EAAE,CAAC,CAAC,KAAK;oBACd,KAAK,EACH,OAAO,CAAC,CAAC,KAAK,KAAK,QAAQ;wBACzB,CAAC,CAAC,CAAC,CAAC,KAAK;wBACT,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC;oBAC1B,QAAQ,EAAE,MAAC,CAAC,CAAC,QAAgC,mCAAI,SAAS;oBAC1D,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAgB,CAAC;iBACtB,CAAC,CAAC;YACtB,CAAC;iBAAM,CAAC;gBACN,yDAAyD;gBACzD,4CAA4C;gBAC5C,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC;QACD,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IACjF,CAAC;IACD,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5B,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;IACnE,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAxCD,0DAwCC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IReqoreTagProps } from '@qoretechnologies/reqore/dist/components/Tag';
|
|
2
2
|
import { IReqoreFormTemplates } from '@qoretechnologies/reqore/dist/components/Textarea';
|
|
3
|
+
import { IDescriptionTooltipOptions } from '../../helpers/descriptionTooltip';
|
|
3
4
|
import { ISlateElement } from '../smartEditor/types';
|
|
4
5
|
import { IDpqlFieldMeta } from './useDpqlSession';
|
|
5
6
|
/** Color scheme for tag rendering, keyed by template prefix. */
|
|
@@ -37,6 +38,11 @@ export interface IDpqlTagRendererOptions {
|
|
|
37
38
|
* that is not found keeps its path.
|
|
38
39
|
*/
|
|
39
40
|
templates?: IReqoreFormTemplates;
|
|
41
|
+
/**
|
|
42
|
+
* How the editor shows a description's card (`useDescriptionTooltips`): a field's and a template's
|
|
43
|
+
* description is markdown, drawn as the template list draws it, and opened by a tap on a touch screen.
|
|
44
|
+
*/
|
|
45
|
+
descriptions?: IDescriptionTooltipOptions;
|
|
40
46
|
}
|
|
41
47
|
/**
|
|
42
48
|
* Build the `tagRenderer` callback for DpqlEditor. Closes over the live
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dpqlTags.d.ts","sourceRoot":"","sources":["../../../src/components/dpqlEditor/dpqlTags.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;
|
|
1
|
+
{"version":3,"file":"dpqlTags.d.ts","sourceRoot":"","sources":["../../../src/components/dpqlEditor/dpqlTags.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,mDAAmD,CAAC;AACzF,OAAO,EAAsB,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAElG,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,gEAAgE;AAChE,eAAO,MAAM,eAAe,EAAE,MAAM,CAClC,MAAM,EACN;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAAE,CAe3C,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;CAIlC,CAAC;AAEF,eAAO,MAAM,eAAe;;;;CAI3B,CAAC;AAEF,eAAO,MAAM,sBAAsB,UAAW,MAAM,KAAG,MAItD,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACtC;;;;;;;;OAQG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC;;;OAGG;IACH,YAAY,CAAC,EAAE,0BAA0B,CAAC;CAC3C;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,EACzC,OAAO,GAAE,uBAA4B,SAExB,aAAa,KAAG,eAAe,CA0C7C"}
|
|
@@ -15,6 +15,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.makeDpqlTagRenderer = exports.getTemplatePrefixColor = exports.FIELD_REF_COLOR = exports.DEFAULT_TEMPLATE_COLOR = exports.TEMPLATE_COLORS = void 0;
|
|
18
|
+
var descriptionTooltip_1 = require("../../helpers/descriptionTooltip");
|
|
18
19
|
var templates_1 = require("../../helpers/templates");
|
|
19
20
|
/** Color scheme for tag rendering, keyed by template prefix. */
|
|
20
21
|
exports.TEMPLATE_COLORS = {
|
|
@@ -56,15 +57,16 @@ exports.getTemplatePrefixColor = getTemplatePrefixColor;
|
|
|
56
57
|
function makeDpqlTagRenderer(fieldMeta, options) {
|
|
57
58
|
if (options === void 0) { options = {}; }
|
|
58
59
|
return function (tag) {
|
|
59
|
-
var _a, _b;
|
|
60
|
+
var _a, _b, _c, _d;
|
|
60
61
|
var tagValue = (_a = tag.value) === null || _a === void 0 ? void 0 : _a.toString();
|
|
61
62
|
if (!tagValue)
|
|
62
63
|
return {};
|
|
63
64
|
if (tagValue.startsWith('@')) {
|
|
64
65
|
var fieldName = tagValue.slice(1);
|
|
65
66
|
var meta = fieldMeta[fieldName];
|
|
67
|
+
// the field's name and type head the card, and its description is drawn under them
|
|
66
68
|
var tooltip = meta
|
|
67
|
-
? "".concat(meta.display_name || fieldName).concat(((
|
|
69
|
+
? (0, descriptionTooltip_1.descriptionTooltip)(meta.short_desc, (_b = options.descriptions) !== null && _b !== void 0 ? _b : {}, "".concat(meta.display_name || fieldName).concat(((_c = meta.type) === null || _c === void 0 ? void 0 : _c.name) ? " (".concat(meta.type.name, ")") : ''))
|
|
68
70
|
: undefined;
|
|
69
71
|
return {
|
|
70
72
|
icon: 'Database2Line',
|
|
@@ -76,7 +78,10 @@ function makeDpqlTagRenderer(fieldMeta, options) {
|
|
|
76
78
|
if (tagValue.startsWith('$')) {
|
|
77
79
|
var named = options.templates && (0, templates_1.describeTemplateReference)(options.templates, tagValue);
|
|
78
80
|
return __assign(__assign({ icon: 'ExchangeDollarLine' }, ((named === null || named === void 0 ? void 0 : named.item) ?
|
|
79
|
-
{
|
|
81
|
+
{
|
|
82
|
+
label: named.label,
|
|
83
|
+
tooltip: (0, templates_1.templateTooltip)(options.templates, tagValue, (_d = options.descriptions) !== null && _d !== void 0 ? _d : {}),
|
|
84
|
+
}
|
|
80
85
|
: {})), (options.templateTagsUseIntent
|
|
81
86
|
? { intent: 'info' }
|
|
82
87
|
: { color: (0, exports.getTemplatePrefixColor)(tagValue) }));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dpqlTags.js","sourceRoot":"","sources":["../../../src/components/dpqlEditor/dpqlTags.ts"],"names":[],"mappings":";AAAA,2CAA2C;AAC3C,wEAAwE;AACxE,mDAAmD;;;;;;;;;;;;;;AAInD,qDAAqF;AAIrF,gEAAgE;AACnD,QAAA,eAAe,GAGxB;IACF,IAAI,EAAS,EAAE,EAAE,EAAE,0BAA0B,EAAE,MAAM,EAAE,0BAA0B,EAAE,EAAE,EAAE,SAAS,EAAE;IAClG,KAAK,EAAQ,EAAE,EAAE,EAAE,0BAA0B,EAAE,MAAM,EAAE,0BAA0B,EAAE,EAAE,EAAE,SAAS,EAAE;IAClG,SAAS,EAAI,EAAE,EAAE,EAAE,0BAA0B,EAAE,MAAM,EAAE,0BAA0B,EAAE,EAAE,EAAE,SAAS,EAAE;IAClG,MAAM,E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EAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;YAC1F,2BACE,IAAI,EAAE,oBAAoB,IACvB,CAAC,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,IAAI,EAAC,CAAC;gBACf;oBACE,KAAK,EAAE,KAAK,CAAC,KAAK;oBAClB,OAAO,EAAE,IAAA,2BAAe,EAAC,OAAO,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAA,OAAO,CAAC,YAAY,mCAAI,EAAE,CAAC;iBAClF;gBACH,CAAC,CAAC,EAAE,CAAC,GACF,CAAC,OAAO,CAAC,qBAAqB;gBAC/B,CAAC,CAAC,EAAE,MAAM,EAAE,MAAe,EAAE;gBAC7B,CAAC,CAAC,EAAE,KAAK,EAAE,IAAA,8BAAsB,EAAC,QAAQ,CAAiB,EAAE,CAAC,EAChE;QACJ,CAAC;QAED,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC;AACJ,CAAC;AA9CD,kDA8CC"}
|
|
@@ -26,6 +26,22 @@ export interface IDpqlParseResult {
|
|
|
26
26
|
text: string;
|
|
27
27
|
description?: string;
|
|
28
28
|
};
|
|
29
|
+
/**
|
|
30
|
+
* How the server reads the expression as a condition, when the request asked (`condition: true`):
|
|
31
|
+
* `condition` (it gives true or false), `truthiness` (a number, a list, a hash: true unless it is zero or
|
|
32
|
+
* empty), `not_a_condition` (text, a date or a time), `unknown` (a result it cannot tell). A server that
|
|
33
|
+
* does not know the question leaves it out.
|
|
34
|
+
*/
|
|
35
|
+
condition_reading?: 'condition' | 'truthiness' | 'not_a_condition' | 'unknown';
|
|
36
|
+
/**
|
|
37
|
+
* With `condition`: each part of the expression's `&&`, `||` and `!`, at any depth, with the type it gives
|
|
38
|
+
* and how a condition reads it - in the server's walk order (qorus#646). `condition_reading` is the worst of
|
|
39
|
+
* the expression's own reading and its parts'.
|
|
40
|
+
*/
|
|
41
|
+
parts?: Array<{
|
|
42
|
+
type: string;
|
|
43
|
+
reading: 'condition' | 'truthiness' | 'not_a_condition' | 'unknown';
|
|
44
|
+
}>;
|
|
29
45
|
diagnostics: Array<{
|
|
30
46
|
range: {
|
|
31
47
|
start: {
|
|
@@ -43,6 +59,14 @@ export interface IDpqlParseResult {
|
|
|
43
59
|
source?: string;
|
|
44
60
|
}>;
|
|
45
61
|
}
|
|
62
|
+
/** What else a `dpql/parse` asks. */
|
|
63
|
+
export interface IDpqlParseOptions {
|
|
64
|
+
/**
|
|
65
|
+
* The expression is a condition: ask how the server reads it as one (`condition: true`) instead of
|
|
66
|
+
* whether it fits a type; the target type is not sent.
|
|
67
|
+
*/
|
|
68
|
+
condition?: boolean;
|
|
69
|
+
}
|
|
46
70
|
/** A record's fields for `dpql/setContext`: each field's type (or types) and an optional description. */
|
|
47
71
|
export type TDpqlFields = Record<string, {
|
|
48
72
|
type: string | string[];
|
|
@@ -115,6 +139,17 @@ export interface IDpqlEditorProps {
|
|
|
115
139
|
templates?: IReqoreFormTemplates;
|
|
116
140
|
/** Called when the editor loses focus. */
|
|
117
141
|
onBlur?: () => void;
|
|
142
|
+
/**
|
|
143
|
+
* Called once when there is no language server to talk to (connecting failed): the editor can show the
|
|
144
|
+
* text but not parse, serialize or complete it, so a host that needs those offers what works without it.
|
|
145
|
+
*/
|
|
146
|
+
onUnavailable?: () => void;
|
|
147
|
+
/**
|
|
148
|
+
* Called once the language server can parse and write this editor's text: its session is connected and
|
|
149
|
+
* its context bound. A host that parses or serializes through the editor's ref waits for this rather
|
|
150
|
+
* than asking earlier, when the answer is "nothing parsed".
|
|
151
|
+
*/
|
|
152
|
+
onReady?: () => void;
|
|
118
153
|
/**
|
|
119
154
|
* Opt-in to server-driven plain-text → Slate parsing via the LSP's
|
|
120
155
|
* `dpql/toRichtext` custom method. When `true`, the editor calls
|
|
@@ -210,9 +245,14 @@ export interface IDpqlEditorRef {
|
|
|
210
245
|
* `targetType` asks the server, in the same round trip, whether the
|
|
211
246
|
* expression's result can satisfy that type — see `coercion_may_fail` on
|
|
212
247
|
* the result. Omit it to ask only whether the text parses.
|
|
248
|
+
*
|
|
249
|
+
* `condition` asks instead how the server reads the expression as a condition (`condition_reading`).
|
|
250
|
+
*/
|
|
251
|
+
parse: (text: string, targetType?: string, options?: IDpqlParseOptions) => Promise<IDpqlParseResult>;
|
|
252
|
+
/**
|
|
253
|
+
* Serialize an expression AST back to DPQL text via `dpql/serialize`: '' while the session has no client,
|
|
254
|
+
* and rejected, with the server's reason, when the server refuses to write the value.
|
|
213
255
|
*/
|
|
214
|
-
parse: (text: string, targetType?: string) => Promise<IDpqlParseResult>;
|
|
215
|
-
/** Serialize an expression AST back to DPQL text via `dpql/serialize`. */
|
|
216
256
|
serialize: (expression: Record<string, any>) => Promise<string>;
|
|
217
257
|
}
|
|
218
258
|
//# sourceMappingURL=types.d.ts.map
|