@pega/cosmos-react-build 8.0.0-build.9.0 → 8.0.0
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/lib/components/AppShell/AppShell.styles.d.ts +1 -1
- package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
- package/lib/components/AppShell/AppShell.styles.js +1 -46
- package/lib/components/AppShell/AppShell.styles.js.map +1 -1
- package/lib/components/AppShell/Header/AppHeader.d.ts +2 -3
- package/lib/components/AppShell/Header/AppHeader.d.ts.map +1 -1
- package/lib/components/AppShell/Header/AppHeader.js +4 -4
- package/lib/components/AppShell/Header/AppHeader.js.map +1 -1
- package/lib/components/AppShell/Header/AppHeader.styles.d.ts +2 -2
- package/lib/components/AppShell/Header/AppHeader.styles.d.ts.map +1 -1
- package/lib/components/BackgroundPicker/BackgroundPicker.d.ts +6 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.js +82 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.js.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.styles.d.ts +15 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.styles.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.styles.js +152 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.styles.js.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.d.ts +5 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.js +30 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.test-ids.js.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.types.d.ts +98 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.types.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.types.js +29 -0
- package/lib/components/BackgroundPicker/BackgroundPicker.types.js.map +1 -0
- package/lib/components/BackgroundPicker/GradientConfig.d.ts +6 -0
- package/lib/components/BackgroundPicker/GradientConfig.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/GradientConfig.js +149 -0
- package/lib/components/BackgroundPicker/GradientConfig.js.map +1 -0
- package/lib/components/BackgroundPicker/ImageConfig.d.ts +6 -0
- package/lib/components/BackgroundPicker/ImageConfig.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/ImageConfig.js +64 -0
- package/lib/components/BackgroundPicker/ImageConfig.js.map +1 -0
- package/lib/components/BackgroundPicker/SolidColorConfig.d.ts +6 -0
- package/lib/components/BackgroundPicker/SolidColorConfig.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/SolidColorConfig.js +24 -0
- package/lib/components/BackgroundPicker/SolidColorConfig.js.map +1 -0
- package/lib/components/BackgroundPicker/index.d.ts +3 -0
- package/lib/components/BackgroundPicker/index.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/index.js +2 -0
- package/lib/components/BackgroundPicker/index.js.map +1 -0
- package/lib/components/BackgroundPicker/utils.d.ts +24 -0
- package/lib/components/BackgroundPicker/utils.d.ts.map +1 -0
- package/lib/components/BackgroundPicker/utils.js +186 -0
- package/lib/components/BackgroundPicker/utils.js.map +1 -0
- package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts +2 -3
- package/lib/components/DynamicContentEditor/DynamicContentEditor.d.ts.map +1 -1
- package/lib/components/DynamicContentEditor/DynamicContentEditor.js.map +1 -1
- package/lib/components/DynamicInput/BooleanControl.d.ts +3 -5
- package/lib/components/DynamicInput/BooleanControl.d.ts.map +1 -1
- package/lib/components/DynamicInput/BooleanControl.js.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.d.ts +1 -2
- package/lib/components/DynamicInput/DynamicInput.d.ts.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.js +33 -33
- package/lib/components/DynamicInput/DynamicInput.js.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.styles.d.ts +2 -2
- package/lib/components/DynamicInput/DynamicInput.styles.d.ts.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.styles.js +1 -0
- package/lib/components/DynamicInput/DynamicInput.styles.js.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.types.d.ts +61 -11
- package/lib/components/DynamicInput/DynamicInput.types.d.ts.map +1 -1
- package/lib/components/DynamicInput/DynamicInput.types.js.map +1 -1
- package/lib/components/Expression/Expression.d.ts +6 -0
- package/lib/components/Expression/Expression.d.ts.map +1 -0
- package/lib/components/Expression/Expression.js +36 -0
- package/lib/components/Expression/Expression.js.map +1 -0
- package/lib/components/Expression/Expression.styles.d.ts +7 -0
- package/lib/components/Expression/Expression.styles.d.ts.map +1 -0
- package/lib/components/Expression/Expression.styles.js +47 -0
- package/lib/components/Expression/Expression.styles.js.map +1 -0
- package/lib/components/Expression/Expression.test-ids.d.ts +2 -0
- package/lib/components/Expression/Expression.test-ids.d.ts.map +1 -0
- package/lib/components/Expression/Expression.test-ids.js +8 -0
- package/lib/components/Expression/Expression.test-ids.js.map +1 -0
- package/lib/components/Expression/Expression.types.d.ts +53 -0
- package/lib/components/Expression/Expression.types.d.ts.map +1 -0
- package/lib/components/Expression/Expression.types.js +2 -0
- package/lib/components/Expression/Expression.types.js.map +1 -0
- package/lib/components/Expression/index.d.ts +3 -0
- package/lib/components/Expression/index.d.ts.map +1 -0
- package/lib/components/Expression/index.js +2 -0
- package/lib/components/Expression/index.js.map +1 -0
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts +7 -5
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js +393 -76
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.js.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts +9 -2
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js +100 -26
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.js.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.d.ts +2 -0
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.d.ts.map +1 -0
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.js +6 -0
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.js.map +1 -0
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts +32 -6
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/CodeEditor.types.js.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js +1 -0
- package/lib/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.js.map +1 -1
- package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.d.ts +3 -0
- package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.d.ts.map +1 -0
- package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.js +34 -0
- package/lib/components/ExpressionBuilder/CodeEditor/mode/jsonLinter.js.map +1 -0
- package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts +2 -3
- package/lib/components/ExpressionBuilder/ExpressionBuilder.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.js.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.styles.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts +3 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.types.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionBuilder.types.js.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts +2 -3
- package/lib/components/ExpressionBuilder/ExpressionDetails.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionDetails.js.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionList.d.ts +2 -3
- package/lib/components/ExpressionBuilder/ExpressionList.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/ExpressionList.js.map +1 -1
- package/lib/components/ExpressionBuilder/index.d.ts +1 -1
- package/lib/components/ExpressionBuilder/index.d.ts.map +1 -1
- package/lib/components/ExpressionBuilder/index.js.map +1 -1
- package/lib/components/FieldReference/FieldReference.styles.d.ts +1 -0
- package/lib/components/FieldReference/FieldReference.styles.d.ts.map +1 -1
- package/lib/components/FieldReference/FieldReference.styles.js +45 -37
- package/lib/components/FieldReference/FieldReference.styles.js.map +1 -1
- package/lib/components/FieldReference/FieldReference.test-ids.d.ts +1 -0
- package/lib/components/FieldReference/FieldReference.test-ids.d.ts.map +1 -1
- package/lib/components/FieldReference/FieldReference.test-ids.js +3 -0
- package/lib/components/FieldReference/FieldReference.test-ids.js.map +1 -1
- package/lib/components/FieldReference/FieldReference.types.d.ts +6 -1
- package/lib/components/FieldReference/FieldReference.types.d.ts.map +1 -1
- package/lib/components/FieldReference/FieldReference.types.js.map +1 -1
- package/lib/components/FieldReference/FieldReferenceDisplay.d.ts.map +1 -1
- package/lib/components/FieldReference/FieldReferenceDisplay.js +11 -7
- package/lib/components/FieldReference/FieldReferenceDisplay.js.map +1 -1
- package/lib/components/FieldReference/FieldReferenceInput.d.ts.map +1 -1
- package/lib/components/FieldReference/FieldReferenceInput.js +17 -11
- package/lib/components/FieldReference/FieldReferenceInput.js.map +1 -1
- package/lib/components/FieldReference/FieldReferenceMenuList.d.ts +5 -4
- package/lib/components/FieldReference/FieldReferenceMenuList.d.ts.map +1 -1
- package/lib/components/FieldReference/FieldReferenceMenuList.js +7 -5
- package/lib/components/FieldReference/FieldReferenceMenuList.js.map +1 -1
- package/lib/components/FieldReference/index.d.ts +2 -2
- package/lib/components/FieldReference/index.d.ts.map +1 -1
- package/lib/components/FieldReference/index.js +1 -1
- package/lib/components/FieldReference/index.js.map +1 -1
- package/lib/components/IconTile/IconTile.d.ts +7 -3
- package/lib/components/IconTile/IconTile.d.ts.map +1 -1
- package/lib/components/IconTile/IconTile.js +40 -4
- package/lib/components/IconTile/IconTile.js.map +1 -1
- package/lib/components/IconTile/IconTile.types.d.ts +17 -15
- package/lib/components/IconTile/IconTile.types.d.ts.map +1 -1
- package/lib/components/IconTile/IconTile.types.js.map +1 -1
- package/lib/components/IconTile/Tiles/Ai.d.ts +1 -1
- package/lib/components/IconTile/Tiles/Ai.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/Ai.js.map +1 -1
- package/lib/components/IconTile/Tiles/Automation.d.ts +1 -1
- package/lib/components/IconTile/Tiles/Automation.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/Automation.js.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationAppend.d.ts +1 -1
- package/lib/components/IconTile/Tiles/AutomationAppend.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationAppend.js.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationCall.d.ts +1 -1
- package/lib/components/IconTile/Tiles/AutomationCall.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationCall.js.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationForEach.d.ts +1 -1
- package/lib/components/IconTile/Tiles/AutomationForEach.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationForEach.js.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationReturn.d.ts +1 -1
- package/lib/components/IconTile/Tiles/AutomationReturn.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationReturn.js.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationSet.d.ts +1 -1
- package/lib/components/IconTile/Tiles/AutomationSet.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/AutomationSet.js.map +1 -1
- package/lib/components/IconTile/Tiles/Case.d.ts +1 -1
- package/lib/components/IconTile/Tiles/Case.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/Case.js.map +1 -1
- package/lib/components/IconTile/Tiles/CaseGoTo.d.ts +1 -1
- package/lib/components/IconTile/Tiles/CaseGoTo.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/CaseGoTo.js.map +1 -1
- package/lib/components/IconTile/Tiles/CaseProcess.d.ts +1 -1
- package/lib/components/IconTile/Tiles/CaseProcess.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/CaseProcess.js.map +1 -1
- package/lib/components/IconTile/Tiles/CaseSla.d.ts +1 -1
- package/lib/components/IconTile/Tiles/CaseSla.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/CaseSla.js.map +1 -1
- package/lib/components/IconTile/Tiles/CaseStage.d.ts +1 -1
- package/lib/components/IconTile/Tiles/CaseStage.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/CaseStage.js.map +1 -1
- package/lib/components/IconTile/Tiles/CaseWait.d.ts +1 -1
- package/lib/components/IconTile/Tiles/CaseWait.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/CaseWait.js.map +1 -1
- package/lib/components/IconTile/Tiles/LogicDecisionStep.d.ts +1 -1
- package/lib/components/IconTile/Tiles/LogicDecisionStep.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/LogicDecisionStep.js.map +1 -1
- package/lib/components/IconTile/Tiles/LogicFunction.d.ts +1 -1
- package/lib/components/IconTile/Tiles/LogicFunction.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/LogicFunction.js.map +1 -1
- package/lib/components/IconTile/Tiles/LogicValidation.d.ts +1 -1
- package/lib/components/IconTile/Tiles/LogicValidation.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/LogicValidation.js.map +1 -1
- package/lib/components/IconTile/Tiles/LogicWhen.d.ts +1 -1
- package/lib/components/IconTile/Tiles/LogicWhen.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/LogicWhen.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleAuthenticate.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleAuthenticate.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleAuthenticate.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleConfiguration.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleConfiguration.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleConfiguration.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleConnector.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleConnector.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleConnector.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleDataPage.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleDataPage.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleDataPage.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleField.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleField.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleField.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleInsight.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleInsight.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleInsight.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleIntegrationSystem.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleIntegrationSystem.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleIntegrationSystem.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleLiveData.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleLiveData.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleLiveData.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleParagraph.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleParagraph.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleParagraph.js.map +1 -1
- package/lib/components/IconTile/Tiles/RulePermission.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RulePermission.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RulePermission.js.map +1 -1
- package/lib/components/IconTile/Tiles/RulePersona.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RulePersona.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RulePersona.js.map +1 -1
- package/lib/components/IconTile/Tiles/RulePortal.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RulePortal.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RulePortal.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleRecord.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleRecord.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleRecord.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleSystem.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleSystem.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleSystem.js.map +1 -1
- package/lib/components/IconTile/Tiles/RuleView.d.ts +1 -1
- package/lib/components/IconTile/Tiles/RuleView.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/RuleView.js.map +1 -1
- package/lib/components/IconTile/Tiles/Task.d.ts +1 -1
- package/lib/components/IconTile/Tiles/Task.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/Task.js.map +1 -1
- package/lib/components/IconTile/Tiles/TaskAction.d.ts +1 -1
- package/lib/components/IconTile/Tiles/TaskAction.d.ts.map +1 -1
- package/lib/components/IconTile/Tiles/TaskAction.js.map +1 -1
- package/lib/components/IconTile/iconUtils.d.ts +11 -0
- package/lib/components/IconTile/iconUtils.d.ts.map +1 -0
- package/lib/components/IconTile/iconUtils.js +41 -0
- package/lib/components/IconTile/iconUtils.js.map +1 -0
- package/lib/components/IconTile/index.d.ts +1 -0
- package/lib/components/IconTile/index.d.ts.map +1 -1
- package/lib/components/IconTile/index.js.map +1 -1
- package/lib/components/ItemLibrary/ItemLibrary.d.ts +10 -10
- package/lib/components/ItemLibrary/ItemLibrary.d.ts.map +1 -1
- package/lib/components/ItemLibrary/ItemLibrary.js +26 -18
- package/lib/components/ItemLibrary/ItemLibrary.js.map +1 -1
- package/lib/components/LifeCycle/Category.d.ts +8 -6
- package/lib/components/LifeCycle/Category.d.ts.map +1 -1
- package/lib/components/LifeCycle/Category.js +53 -36
- package/lib/components/LifeCycle/Category.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.d.ts +8 -4
- package/lib/components/LifeCycle/LifeCycle.d.ts.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.js +113 -19
- package/lib/components/LifeCycle/LifeCycle.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.test-ids.d.ts +6 -0
- package/lib/components/LifeCycle/LifeCycle.test-ids.d.ts.map +1 -0
- package/lib/components/LifeCycle/LifeCycle.test-ids.js +10 -0
- package/lib/components/LifeCycle/LifeCycle.test-ids.js.map +1 -0
- package/lib/components/LifeCycle/LifeCycle.types.d.ts +713 -58
- package/lib/components/LifeCycle/LifeCycle.types.d.ts.map +1 -1
- package/lib/components/LifeCycle/LifeCycle.types.js +71 -61
- package/lib/components/LifeCycle/LifeCycle.types.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycleContext.d.ts +16 -4
- package/lib/components/LifeCycle/LifeCycleContext.d.ts.map +1 -1
- package/lib/components/LifeCycle/LifeCycleContext.js +7 -1
- package/lib/components/LifeCycle/LifeCycleContext.js.map +1 -1
- package/lib/components/LifeCycle/LifeCycleDragDropList.d.ts +21 -0
- package/lib/components/LifeCycle/LifeCycleDragDropList.d.ts.map +1 -0
- package/lib/components/LifeCycle/LifeCycleDragDropList.js +298 -0
- package/lib/components/LifeCycle/LifeCycleDragDropList.js.map +1 -0
- package/lib/components/LifeCycle/LifeCycleList.d.ts +8 -6
- package/lib/components/LifeCycle/LifeCycleList.d.ts.map +1 -1
- package/lib/components/LifeCycle/LifeCycleList.js +20 -30
- package/lib/components/LifeCycle/LifeCycleList.js.map +1 -1
- package/lib/components/LifeCycle/Stage.d.ts +12 -7
- package/lib/components/LifeCycle/Stage.d.ts.map +1 -1
- package/lib/components/LifeCycle/Stage.js +87 -72
- package/lib/components/LifeCycle/Stage.js.map +1 -1
- package/lib/components/LifeCycle/Step.d.ts +21 -14
- package/lib/components/LifeCycle/Step.d.ts.map +1 -1
- package/lib/components/LifeCycle/Step.js +75 -51
- package/lib/components/LifeCycle/Step.js.map +1 -1
- package/lib/components/LifeCycle/Task.d.ts +18 -7
- package/lib/components/LifeCycle/Task.d.ts.map +1 -1
- package/lib/components/LifeCycle/Task.js +119 -55
- package/lib/components/LifeCycle/Task.js.map +1 -1
- package/lib/components/LifeCycle/index.d.ts +2 -1
- package/lib/components/LifeCycle/index.d.ts.map +1 -1
- package/lib/components/LifeCycle/index.js +1 -0
- package/lib/components/LifeCycle/index.js.map +1 -1
- package/lib/components/LifeCycle/utils.d.ts +14 -0
- package/lib/components/LifeCycle/utils.d.ts.map +1 -0
- package/lib/components/LifeCycle/utils.js +250 -0
- package/lib/components/LifeCycle/utils.js.map +1 -0
- package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts +2 -3
- package/lib/components/MobileBuildSummary/MobileBuildSummary.d.ts.map +1 -1
- package/lib/components/MobileBuildSummary/MobileBuildSummary.js.map +1 -1
- package/lib/components/ObjectSelect/ObjectPicker.d.ts +2 -2
- package/lib/components/ObjectSelect/ObjectPicker.d.ts.map +1 -1
- package/lib/components/ObjectSelect/ObjectPicker.js.map +1 -1
- package/lib/components/PageTemplates/GalleryPage.d.ts +2 -2
- package/lib/components/PageTemplates/GalleryPage.d.ts.map +1 -1
- package/lib/components/PageTemplates/GalleryPage.js.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.d.ts +5 -5
- package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
- package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
- package/lib/components/PageTemplates/ShowcasePage.d.ts +2 -2
- package/lib/components/PageTemplates/ShowcasePage.d.ts.map +1 -1
- package/lib/components/PageTemplates/ShowcasePage.js.map +1 -1
- package/lib/components/RuleSelect/RuleSelect.js +3 -3
- package/lib/components/RuleSelect/RuleSelect.js.map +1 -1
- package/lib/components/Workbench/Workbench.d.ts +2 -3
- package/lib/components/Workbench/Workbench.d.ts.map +1 -1
- package/lib/components/Workbench/Workbench.js.map +1 -1
- package/lib/components/Workbench/Workbench.styles.d.ts +2 -2
- package/lib/components/Workbench/Workbench.styles.d.ts.map +1 -1
- package/lib/index.d.ts +4 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +4 -2
- package/lib/index.js.map +1 -1
- package/lib/{components/FieldReference → utils}/typeIconMapping.d.ts +8 -0
- package/lib/utils/typeIconMapping.d.ts.map +1 -0
- package/lib/{components/FieldReference → utils}/typeIconMapping.js +15 -3
- package/lib/utils/typeIconMapping.js.map +1 -0
- package/package.json +16 -14
- package/lib/components/FieldReference/typeIconMapping.d.ts.map +0 -1
- package/lib/components/FieldReference/typeIconMapping.js.map +0 -1
- package/lib/components/FlowModeller/AddNode.d.ts +0 -18
- package/lib/components/FlowModeller/AddNode.d.ts.map +0 -1
- package/lib/components/FlowModeller/AddNode.js +0 -86
- package/lib/components/FlowModeller/AddNode.js.map +0 -1
- package/lib/components/FlowModeller/Connector.d.ts +0 -6
- package/lib/components/FlowModeller/Connector.d.ts.map +0 -1
- package/lib/components/FlowModeller/Connector.js +0 -69
- package/lib/components/FlowModeller/Connector.js.map +0 -1
- package/lib/components/FlowModeller/DeletePopover.d.ts +0 -19
- package/lib/components/FlowModeller/DeletePopover.d.ts.map +0 -1
- package/lib/components/FlowModeller/DeletePopover.js +0 -136
- package/lib/components/FlowModeller/DeletePopover.js.map +0 -1
- package/lib/components/FlowModeller/FlowModeller.d.ts +0 -5
- package/lib/components/FlowModeller/FlowModeller.d.ts.map +0 -1
- package/lib/components/FlowModeller/FlowModeller.js +0 -317
- package/lib/components/FlowModeller/FlowModeller.js.map +0 -1
- package/lib/components/FlowModeller/FlowModeller.types.d.ts +0 -27
- package/lib/components/FlowModeller/FlowModeller.types.d.ts.map +0 -1
- package/lib/components/FlowModeller/FlowModeller.types.js +0 -2
- package/lib/components/FlowModeller/FlowModeller.types.js.map +0 -1
- package/lib/components/FlowModeller/FlowModellerContext.d.ts +0 -10
- package/lib/components/FlowModeller/FlowModellerContext.d.ts.map +0 -1
- package/lib/components/FlowModeller/FlowModellerContext.js +0 -8
- package/lib/components/FlowModeller/FlowModellerContext.js.map +0 -1
- package/lib/components/FlowModeller/Node/Node.types.d.ts +0 -75
- package/lib/components/FlowModeller/Node/Node.types.d.ts.map +0 -1
- package/lib/components/FlowModeller/Node/Node.types.js +0 -27
- package/lib/components/FlowModeller/Node/Node.types.js.map +0 -1
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts +0 -20
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.d.ts.map +0 -1
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.js +0 -151
- package/lib/components/FlowModeller/Node/NodeTemplate.styles.js.map +0 -1
- package/lib/components/FlowModeller/Node/NodeTemplates.d.ts +0 -6
- package/lib/components/FlowModeller/Node/NodeTemplates.d.ts.map +0 -1
- package/lib/components/FlowModeller/Node/NodeTemplates.js +0 -69
- package/lib/components/FlowModeller/Node/NodeTemplates.js.map +0 -1
- package/lib/components/FlowModeller/Node.d.ts +0 -5
- package/lib/components/FlowModeller/Node.d.ts.map +0 -1
- package/lib/components/FlowModeller/Node.js +0 -22
- package/lib/components/FlowModeller/Node.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Renderer.d.ts +0 -5
- package/lib/components/FlowModeller/Renderer/Renderer.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Renderer.js +0 -48
- package/lib/components/FlowModeller/Renderer/Renderer.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts +0 -18
- package/lib/components/FlowModeller/Renderer/Renderer.types.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Renderer.types.js +0 -2
- package/lib/components/FlowModeller/Renderer/Renderer.types.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts +0 -59
- package/lib/components/FlowModeller/Renderer/Utils/Graph.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/Graph.js +0 -258
- package/lib/components/FlowModeller/Renderer/Utils/Graph.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts +0 -36
- package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js +0 -120
- package/lib/components/FlowModeller/Renderer/Utils/GraphLayout.js.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts +0 -28
- package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.d.ts.map +0 -1
- package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js +0 -172
- package/lib/components/FlowModeller/Renderer/Utils/GraphTraversal.js.map +0 -1
- package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts +0 -18
- package/lib/components/FlowModeller/Utils/addNodeUtils.d.ts.map +0 -1
- package/lib/components/FlowModeller/Utils/addNodeUtils.js +0 -141
- package/lib/components/FlowModeller/Utils/addNodeUtils.js.map +0 -1
- package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts +0 -30
- package/lib/components/FlowModeller/Utils/deleteNodeUtils.d.ts.map +0 -1
- package/lib/components/FlowModeller/Utils/deleteNodeUtils.js +0 -81
- package/lib/components/FlowModeller/Utils/deleteNodeUtils.js.map +0 -1
- package/lib/components/FlowModeller/helper.d.ts +0 -39
- package/lib/components/FlowModeller/helper.d.ts.map +0 -1
- package/lib/components/FlowModeller/helper.js +0 -198
- package/lib/components/FlowModeller/helper.js.map +0 -1
- package/lib/components/FlowModeller/index.d.ts +0 -20
- package/lib/components/FlowModeller/index.d.ts.map +0 -1
- package/lib/components/FlowModeller/index.js +0 -12
- package/lib/components/FlowModeller/index.js.map +0 -1
- package/lib/components/IconTile/IconTile.styles.d.ts +0 -7
- package/lib/components/IconTile/IconTile.styles.d.ts.map +0 -1
- package/lib/components/IconTile/IconTile.styles.js +0 -68
- package/lib/components/IconTile/IconTile.styles.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.tsx"],"names":[],"mappings":";AAAA,uBAAuB;AACvB,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAErF,OAAO,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAElD,OAAO,qCAAqC,CAAC;AAC7C,OAAO,oCAAoC,CAAC;AAE5C,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEzE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4DAA4D,CAAC;AAQjG,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,kBAAkB,MAAM,sBAAsB,CAAC;AAEtD,UAAU,CAAC,YAAY,EAAE,GAAG,EAAE;IAC5B,MAAM,MAAM,GAAG;QACb,8CAA8C;QAC9C,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE;QACtC,+CAA+C;QAC/C,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE;QACtC,+CAA+C;QAC/C,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE;QACzC,iDAAiD;QACjD,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,cAAc,EAAE;QAC3C,gDAAgD;QAChD,EAAE,KAAK,EAAE,eAAe,EAA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;YACzB,WAAW,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;aAAM,CAAC;YACN,UAAU,EAAE,SAAS,EAAE,CAAC;YACxB,WAAW,CAAC,KAAK,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,EAAE,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC,CAAC;IAE3B,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;QACvB,OAAO,GAAG,EAAE;YACV,OAAO,CAAC,OAAO,GAAG,KAAK,CAAC;QAC1B,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,MAAC,gBAAgB,IACf,SAAS,EAAE;YACT,SAAS,EAAE,QAAQ;YACnB,OAAO,EAAE,SAAS;SACnB,EACD,IAAI,EAAE;YACJ,IAAI,EAAE,CAAC;SACR,EACD,GAAG,EAAE,yBAAyB,EAC9B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,OAAO,EAClB,WAAW,EAAE,WAAW,KACpB,KAAK,aAET,KAAC,eAAe,IACd,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,EAAE,GAAG,oBAAoB,EAAE,GAAG,iBAAiB,EAAE,EAC1D,cAAc,EAAE,MAAM,CAAC,EAAE;oBACvB,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;oBAC/B,aAAa,CAAC,MAAM,CAAC,CAAC;gBACxB,CAAC,GACD,EACD,MAAM,IAAI,KAAC,mBAAmB,IAAC,MAAM,EAAC,OAAO,YAAE,MAAM,GAAuB,IAC5D,CACpB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,UAAU,CAAC","sourcesContent":["// cspell:words unfocus\nimport { forwardRef, useRef, useState, useEffect, useImperativeHandle } from 'react';\nimport type { FunctionComponent, PropsWithoutRef } from 'react';\nimport { Controlled as ReactCodeMirror } from 'react-codemirror2';\nimport { showHint, defineMode } from 'codemirror';\nimport type { Editor, Position, EditorChange, EditorConfiguration } from 'codemirror';\nimport 'codemirror/addon/edit/closebrackets';\nimport 'codemirror/addon/hint/show-hint.js';\n\nimport { useConsolidatedRef, useElement } from '@pega/cosmos-react-core';\nimport type { ForwardProps } from '@pega/cosmos-react-core';\nimport { StyledFormFieldInfo } from '@pega/cosmos-react-core/lib/components/FormField/FormField';\n\nimport type {\n AutoCompleteTriggerChar,\n CodeEditorProps,\n EditorState,\n SuggestionType\n} from './CodeEditor.types';\nimport { StyledCodeEditor } from './CodeEditor.styles';\nimport getCodeSuggestions from './getCodeSuggestions';\n\ndefineMode('expression', () => {\n const tokens = [\n // Below regex is used to identify the context\n { token: /\\w+@/, style: 'ex-context' },\n // Below regex is used to identify the RuleType\n { token: /\\w+:/, style: 'ex-context' },\n // Below regex is used to identify the RuleName\n { token: /\\w+[(]/, style: 'ex-ruleName' },\n // Below regex is used to identify the delimeters\n { token: /[:.(),]/, style: 'ex-delimeter' },\n // Below regex is used to identify the operators\n { token: /[-+\\\\/*=<>@]+/, style: 'ex-operator' },\n // Below regex is used to identify the spaces\n { token: / /, style: 'ex-space' }\n ];\n\n return {\n startState() {\n return { inString: false };\n },\n token(stream, state) {\n // Used to identify the constants in the expression\n const nextChar = stream.peek();\n if (!state.inString && (nextChar === \"'\" || nextChar === '\"')) {\n stream.next(); // Skip quote\n state.inString = true; // Update state\n }\n\n if (state.inString) {\n if (nextChar && stream.skipTo(nextChar)) {\n // Quote found on this line\n stream.next(); // Skip quote\n state.inString = false; // Clear flag\n } else {\n stream.skipToEnd(); // Rest of line is string\n }\n return nextChar === '\"' ? 'ex-constant' : 'ex-context'; // Token style\n }\n\n if (stream.peek() === '.') {\n stream.next();\n if (stream.match(/.\\w+\\(/)) return 'ex-delimeter';\n }\n\n // Used to match the regex in the expression\n for (const element of tokens) {\n const match = stream.match(element.token, false);\n if (match) {\n if (stream.pos === stream.start) {\n stream.next();\n }\n return element.style;\n }\n }\n stream.next();\n return null;\n }\n };\n});\n\nconst defaultConfigOptions: Pick<\n EditorConfiguration,\n 'lineWrapping' | 'smartIndent' | 'autoCloseBrackets' | 'extraKeys'\n> = {\n lineWrapping: true,\n smartIndent: true,\n autoCloseBrackets: true,\n extraKeys: { Tab: false, 'Shift-Tab': false }\n};\n\nconst CodeEditor: FunctionComponent<CodeEditorProps & ForwardProps> = forwardRef(\n function CodeEditor(\n {\n fetchSuggestions,\n autoCompleteTriggers,\n editorConfigProps,\n codeEditorHandle,\n defaultValue = '',\n loading = false,\n readOnly,\n errors,\n onChange,\n ...props\n }: PropsWithoutRef<CodeEditorProps>,\n ref: CodeEditorProps['ref']\n ) {\n const [value, setCode] = useState<string>(defaultValue);\n const [suggestions, setSuggestions] = useState<SuggestionType[]>([]);\n const [codeMirror, setCodeMirror] = useState<Editor | null>(null);\n const [codeEditorContainer, setCodeEditorContainer] = useElement<HTMLDivElement>();\n const codeEditorConsolidatedRef = useConsolidatedRef(setCodeEditorContainer, ref);\n const [suggestionTrigger, setSuggestionTrigger] = useState<{\n character: AutoCompleteTriggerChar;\n cursorPosition: Position;\n } | null>(null);\n const [popover, showPopover] = useState(false);\n const mounted = useRef(false);\n\n useImperativeHandle<any, EditorState>(\n codeEditorHandle,\n () => ({\n insertText: (text: string) => {\n if (codeMirror) {\n if (codeMirror.getSelection()) {\n codeMirror.replaceSelection(text);\n } else {\n const cur: Position = codeMirror.getCursor();\n codeMirror.replaceRange(text, cur);\n }\n }\n },\n getValue: () => {\n return codeMirror?.getValue();\n }\n }),\n [codeMirror]\n );\n\n const autoComplete = (codeEditor: Editor) => {\n const hintOptions = {\n completeSingle: false,\n completeOnSingleClick: true,\n closeOnUnfocus: true,\n suggestions,\n container: codeEditorContainer,\n loading,\n triggerCharacterCursorPos: suggestionTrigger?.cursorPosition\n };\n showHint(codeEditor, getCodeSuggestions, hintOptions);\n };\n\n const onBeforeChange = async (editor: Editor, _data: EditorChange, textvalue: string) => {\n setCode(textvalue);\n onChange?.(textvalue);\n const currentCursor = editor.getCursor();\n const currentCharacter = editor\n .getTokenAt(currentCursor)\n .string.trim() as AutoCompleteTriggerChar;\n\n let newSuggestions: SuggestionType[] = [];\n\n if (autoCompleteTriggers?.includes(currentCharacter) && fetchSuggestions) {\n setSuggestionTrigger({\n character: currentCharacter,\n cursorPosition: currentCursor\n });\n\n newSuggestions = [\n ...(await fetchSuggestions(currentCharacter, {\n line: currentCursor.line,\n ch: currentCursor.ch\n }))\n ];\n if (mounted.current) {\n setSuggestions(newSuggestions);\n }\n }\n };\n\n useEffect(() => {\n if (!popover) return;\n const isSuggestionTriggerPresent =\n suggestionTrigger &&\n codeMirror\n ?.getTokenAt(suggestionTrigger.cursorPosition)\n .string.includes(suggestionTrigger.character);\n\n if (!isSuggestionTriggerPresent) {\n codeMirror?.closeHint();\n showPopover(false);\n setSuggestionTrigger(null);\n }\n }, [onBeforeChange]);\n\n useEffect(() => {\n if (codeMirror && (suggestionTrigger || loading)) {\n autoComplete(codeMirror);\n showPopover(true);\n } else {\n codeMirror?.closeHint();\n showPopover(false);\n }\n }, [suggestions, loading]);\n\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n\n return (\n <StyledCodeEditor\n container={{\n direction: 'column',\n justify: 'between'\n }}\n item={{\n grow: 1\n }}\n ref={codeEditorConsolidatedRef}\n errors={errors}\n readOnly={readOnly}\n isLoading={loading}\n suggestions={suggestions}\n {...props}\n >\n <ReactCodeMirror\n value={value}\n onBeforeChange={onBeforeChange}\n options={{ ...defaultConfigOptions, ...editorConfigProps }}\n editorDidMount={editor => {\n editor.setSize('100%', '100%');\n setCodeMirror(editor);\n }}\n />\n {errors && <StyledFormFieldInfo status='error'>{errors}</StyledFormFieldInfo>}\n </StyledCodeEditor>\n );\n }\n);\n\nexport default CodeEditor;\n"]}
|
|
1
|
+
{"version":3,"file":"CodeEditor.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/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AW,CAAC,aAAa,GAAI,CACpE,CAAC,CAAC,CAAC,CACF,KAAC,IAAI,cAAE,WAAW,CAAC,aAAa,GAAQ,CACzC,IACI,GACC,CACX,EACA,MAAM,IAAI,CACT,KAAC,mBAAmB,IAAC,EAAE,EAAE,WAAW,EAAE,MAAM,EAAC,OAAO,iBAAc,OAAO,CAAC,YAAY,YACnF,MAAM,GACa,CACvB,IACgB,IAClB,CACJ,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,WAAW,CAAC,UAAU,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["// cspell:words unfocus\nimport { forwardRef, useRef, useState, useEffect, useImperativeHandle, useMemo } from 'react';\nimport type { PropsWithoutRef } from 'react';\nimport { Controlled as ReactCodeMirror } from 'react-codemirror2';\nimport 'codemirror/addon/hint/show-hint.js';\nimport 'codemirror/addon/edit/closebrackets';\nimport 'codemirror/addon/edit/matchbrackets';\nimport { Pass, showHint, defineMode, registerHelper } from 'codemirror';\nimport type {\n Editor,\n Position,\n EditorChange,\n EditorConfiguration,\n MarkerRange,\n TextMarker\n} from 'codemirror';\n\nimport {\n Popover,\n Text,\n UnorderedList,\n Flex,\n useI18n,\n useTestIds,\n withTestIds,\n useUID,\n debounce\n} from '@pega/cosmos-react-core';\nimport type { ForwardRefForwardPropsComponent } from '@pega/cosmos-react-core';\nimport { StyledFormFieldInfo } from '@pega/cosmos-react-core/lib/components/FormField/FormField';\n\nimport type {\n AutoCompleteTriggerChar,\n CodeEditorProps,\n SuggestionType,\n CustomPositionProps\n} from './CodeEditor.types';\nimport {\n StyledSuggestions,\n StyledCodeEditor,\n StyledPopover,\n StyledList,\n StyledWarnIcon\n} from './CodeEditor.styles';\nimport getCodeSuggestions from './getCodeSuggestions';\nimport { getEditorsTestIds } from './CodeEditor.test-ids';\nimport { lint as jsonLint } from './mode/jsonLinter';\n\nconst contextText = 'ex-context';\nconst commentText = 'ex-comment';\nconst languages = ['json', 'javascript'];\n\nconst additionalOperators = ['and', 'or', 'when', 'otherwise', 'isA', 'asA', 'define', 'isNone'];\n\ndefineMode('expression', (config, parserConfig) => {\n const isSingleLine = parserConfig.isSingleLine;\n\n const tokens = [\n // Below regex is used to identify the context\n { token: /\\w+@/, style: contextText },\n // Below regex is used to identify the RuleType\n { token: /\\w+:/, style: contextText },\n // Below regex is used to identify the RuleName\n { token: /\\w+[(]/, style: 'ex-ruleName' },\n // Below regex is used to identify the delimeters\n { token: /[:.(),[\\]]/, style: 'ex-delimeter' },\n // Below regex is used to identify the operators\n { token: /[-+\\\\/*=<>@#]+/, style: 'ex-operator' },\n // Below regex is used to identify the spaces\n { token: / /, style: 'ex-space' }\n ];\n\n return {\n startState() {\n return { inString: false, inMultiLineComment: false };\n },\n token(stream, state) {\n /** Additional operator highlighting */\n for (let i = 0; i < additionalOperators.length; i += 1) {\n const keyword = additionalOperators[i];\n const len = keyword.length;\n const currentPos = stream.pos;\n\n if (stream.match(keyword, true)) {\n const before = currentPos === 0 ? null : stream.string.charAt(currentPos - 1);\n const after = stream.eol() ? null : stream.peek();\n\n const isWordChar = (char: string) => char.includes(' ');\n\n if ((!before || isWordChar(before)) && (!after || isWordChar(after))) {\n return 'ex-additional-operators';\n }\n stream.backUp(len);\n }\n }\n /* Highlights single and multi line comments */\n if (state.inMultiLineComment && !isSingleLine) {\n if (stream.match(/.*?\\*\\//)) {\n state.inMultiLineComment = false;\n } else {\n stream.skipToEnd();\n }\n return commentText;\n }\n\n if (stream.match(/\\/\\*/) && !isSingleLine) {\n state.inMultiLineComment = true;\n return commentText;\n }\n\n if (stream.match(/\\/\\//) && !isSingleLine) {\n stream.skipToEnd();\n return commentText;\n }\n // Used to identify the constants in the expression\n if (!state.inMultiLineComment) {\n const nextChar = stream.peek();\n if (!state.inString && (nextChar === \"'\" || nextChar === '\"')) {\n stream.next(); // Skip quote\n state.inString = true; // Update state\n }\n\n if (state.inString) {\n if (nextChar && stream.skipTo(nextChar)) {\n // Quote found on this line\n stream.next(); // Skip quote\n state.inString = false; // Clear flag\n } else {\n stream.skipToEnd(); // Rest of line is string\n }\n return nextChar === '\"' ? 'ex-constant' : contextText; // Token style\n }\n\n // Used to match the regex in the expression\n for (const element of tokens) {\n const match = stream.match(element.token, false);\n if (match) {\n if (stream.pos === stream.start) {\n stream.next();\n }\n return element.style;\n }\n }\n }\n stream.next();\n return null;\n }\n };\n});\n\nconst CodeEditor: ForwardRefForwardPropsComponent<CodeEditorProps> = forwardRef(\n (\n {\n testId,\n fetchSuggestions,\n autoCompleteTriggers,\n editorConfigProps,\n codeEditorHandle,\n defaultValue = '',\n loading = false,\n readOnly,\n isSingleLine = false,\n errors,\n onChange,\n onBlur,\n inLineErrors,\n 'aria-describedby': ariaDescribedBy,\n ...restProps\n }: PropsWithoutRef<CodeEditorProps>,\n ref: CodeEditorProps['ref']\n ) => {\n const t = useI18n();\n const [value, setCode] = useState<string>(defaultValue);\n const [showEditor, setShowEditor] = useState(false);\n const [isFocused, setIsFocused] = useState(false);\n const [suggestions, setSuggestions] = useState<SuggestionType[]>([]);\n const [codeMirror, setCodeMirror] = useState<Editor | null>(null);\n const [suggestionTrigger, setSuggestionTrigger] = useState<{\n character: AutoCompleteTriggerChar;\n cursorPosition: Position;\n } | null>(null);\n const [popover, showPopover] = useState(false);\n const mounted = useRef(false);\n const testIds = useTestIds(testId, getEditorsTestIds);\n const editorRef = useRef<Editor | null>(null);\n const uId = useUID();\n const errorDescId = `${uId}-description`;\n const onBlurRef = useRef(onBlur);\n const hasSuggestionRef = useRef(true);\n\n useImperativeHandle(\n codeEditorHandle,\n () => ({\n insertText: (\n text: string,\n resetContent?: boolean,\n customPosition?: CustomPositionProps\n ) => {\n if (editorRef.current) {\n if (editorRef.current.getSelection()) {\n editorRef.current.replaceSelection(text);\n } else if (customPosition?.start && customPosition?.end) {\n editorRef.current.replaceRange(\n text,\n { ...customPosition.start },\n { ...customPosition.end }\n );\n } else {\n const cur: Position = editorRef.current.getCursor();\n const doc = editorRef.current.getDoc();\n const lastLine = doc.lastLine(); // Get the index of the last line\n const lastCharIndex = doc.getLine(lastLine).length;\n editorRef.current.replaceRange(\n text,\n resetContent ? { ch: lastCharIndex, line: lastLine } : cur,\n resetContent ? { ch: 0, line: 0 } : undefined\n );\n }\n }\n },\n getValue: () => {\n return editorRef.current?.getValue();\n }\n }),\n []\n );\n\n const autoComplete = (codeEditor: Editor) => {\n const hintOptions = {\n completeSingle: false,\n completeOnSingleClick: true,\n closeOnUnfocus: true,\n suggestions,\n loading,\n triggerCharacterCursorPos: suggestionTrigger?.cursorPosition\n };\n\n debounce(() => showHint(codeEditor, getCodeSuggestions, hintOptions), 100)();\n };\n\n const errorHandler = (val: string) => {\n if (!editorConfigProps?.lint) return;\n const mode = editorConfigProps?.mode;\n switch (mode) {\n case 'json':\n return jsonLint(val);\n case 'expression':\n default:\n return undefined;\n }\n };\n\n useEffect(() => {\n onBlurRef.current = onBlur;\n }, [onBlur]);\n\n const onBlurHandler = (editor: Editor) => {\n if (onBlurRef.current) {\n onBlurRef.current(editor.getDoc().getValue());\n }\n };\n\n const onBeforeChange = async (editor: Editor, _data: EditorChange, textvalue: string) => {\n const updatedTextValue = isSingleLine ? textvalue.replaceAll(/\\n/g, '') : textvalue;\n setCode(updatedTextValue);\n /** _data.origin is a flag from codemirror that tells from where the change was made in the code editor input */\n onChange?.(updatedTextValue, errorHandler(updatedTextValue), _data.origin);\n const currentCursor = editor.getCursor();\n const currentCharacter = editor\n .getTokenAt(currentCursor)\n .string.trim() as AutoCompleteTriggerChar;\n let newSuggestions: SuggestionType[] = [];\n\n if (autoCompleteTriggers?.includes(currentCharacter) && fetchSuggestions) {\n const suggestionData = await fetchSuggestions(currentCharacter, {\n line: currentCursor.line,\n ch: currentCursor.ch\n });\n\n if (suggestionData === undefined) {\n hasSuggestionRef.current = false;\n return;\n }\n\n setSuggestionTrigger({\n character: currentCharacter,\n cursorPosition: currentCursor\n });\n\n hasSuggestionRef.current = true;\n newSuggestions = [...suggestionData];\n if (mounted.current) {\n setSuggestions(newSuggestions);\n }\n }\n };\n\n useEffect(() => {\n if (!popover) {\n return;\n }\n const isSuggestionTriggerPresent =\n suggestionTrigger &&\n codeMirror\n ?.getTokenAt(suggestionTrigger.cursorPosition)\n .string.includes(suggestionTrigger.character);\n\n if (!isSuggestionTriggerPresent) {\n codeMirror?.closeHint();\n showPopover(false);\n setSuggestionTrigger(null);\n }\n }, [onBeforeChange]);\n\n useEffect(() => {\n if (codeMirror && isFocused && hasSuggestionRef.current && (suggestionTrigger || loading)) {\n autoComplete(codeMirror);\n showPopover(true);\n } else {\n codeMirror?.closeHint();\n showPopover(false);\n }\n }, [suggestions, loading, suggestionTrigger, codeMirror]);\n\n const [popoverInfo, setPopoverInfo] = useState<{\n targetElement: Element | null;\n errorMessages: string[];\n }>({ targetElement: null, errorMessages: [] });\n\n const [show, setShow] = useState(false);\n const [errorMapping, setErrorMapping] = useState<string[][]>([]);\n const [textMarkerList, setTextMarkerList] = useState<TextMarker<MarkerRange>[]>([]);\n\n const removeInLineErrors = () => {\n if (textMarkerList.length) {\n textMarkerList.forEach(item => item.clear());\n }\n };\n\n useEffect(() => {\n removeInLineErrors();\n if (inLineErrors?.length && codeMirror) {\n const markerList: TextMarker<MarkerRange>[] = [];\n const errorMessageMap = inLineErrors?.map(({ start, end, messages }, index) => {\n if (messages.length) {\n markerList.push(\n codeMirror.markText(start, end, {\n className: `cm-ex-underline-error error-${index}`\n })\n );\n return messages;\n }\n return [];\n });\n setTextMarkerList(markerList);\n setErrorMapping(errorMessageMap);\n } else {\n setErrorMapping([]);\n }\n }, [inLineErrors, codeMirror]);\n\n useEffect(() => {\n mounted.current = true;\n return () => {\n mounted.current = false;\n };\n }, []);\n\n const getErrors = (target: Element) => {\n const errorMessages: string[] = [];\n if (target) {\n errorMapping.forEach((item, index) => {\n if (target.classList.contains(`error-${index}`)) {\n errorMessages.push(...item);\n }\n });\n }\n\n return errorMessages;\n };\n\n const onMouseMove = (event: Event | null, type?: string) => {\n if (codeMirror && errorMapping.length) {\n let target: Element | null;\n\n if (type === 'cursor') {\n const coords = codeMirror.getCursor();\n const charCoords = codeMirror.charCoords(coords, 'window');\n target = document.elementFromPoint(charCoords.left, charCoords.top);\n } else {\n target = event?.target instanceof Element ? event.target : null;\n }\n\n if (target) {\n const errorMessages = getErrors(target);\n if (errorMessages.length) {\n setPopoverInfo(() => {\n return {\n targetElement: target,\n errorMessages\n };\n });\n setShow(true);\n } else {\n setShow(false);\n }\n }\n }\n };\n\n const onMouseLeave = () => {\n setShow(false);\n };\n\n const hidePopover = (e: KeyboardEvent) => {\n if (e.shiftKey && (e.metaKey || e.ctrlKey) && e.key === ' ') {\n onMouseMove(null, 'cursor');\n } else {\n setShow(false);\n }\n };\n\n useEffect(() => {\n if (codeMirror && inLineErrors?.length && errorMapping.length) {\n const codeMirrorWrapper = codeMirror.getWrapperElement();\n\n codeMirrorWrapper.addEventListener('keydown', hidePopover);\n codeMirrorWrapper.addEventListener('mousedown', onMouseLeave);\n\n const elementsWithClassName = Array.from(\n codeMirrorWrapper.getElementsByClassName('cm-ex-underline-error')\n );\n\n elementsWithClassName.forEach(element => {\n element.addEventListener('mouseenter', onMouseMove);\n element.addEventListener('mouseleave', onMouseLeave);\n });\n\n return () => {\n codeMirrorWrapper.removeEventListener('keydown', hidePopover);\n codeMirrorWrapper.removeEventListener('mousedown', onMouseLeave);\n\n elementsWithClassName.forEach(element => {\n element.removeEventListener('mouseenter', onMouseMove);\n element.removeEventListener('mouseleave', onMouseLeave);\n });\n };\n }\n return undefined;\n }, [value, inLineErrors, errorMapping, codeMirror]);\n\n const extendModeWithSingleLine = (\n mode: EditorConfiguration['mode'],\n singleLineEditor: boolean\n ) => {\n if (typeof mode === 'string' || (mode && typeof mode.name === 'string')) {\n return {\n name: typeof mode === 'string' ? mode : mode.name,\n isSingleLine: singleLineEditor\n };\n }\n return mode;\n };\n\n useEffect(() => {\n (async () => {\n if (editorConfigProps?.placeholder) {\n await import('codemirror/addon/display/placeholder');\n }\n\n if (languages.includes(editorConfigProps?.mode as string)) {\n await import('codemirror/mode/javascript/javascript');\n await import('codemirror/theme/eclipse.css');\n }\n\n if (editorConfigProps?.foldGutter && !isSingleLine) {\n await import('codemirror/addon/fold/foldcode');\n await import('codemirror/addon/fold/foldgutter');\n await import('codemirror/addon/fold/brace-fold');\n await import('codemirror/addon/fold/comment-fold');\n await import('codemirror/addon/fold/foldgutter.css');\n }\n\n if (editorConfigProps?.lint) {\n await import('codemirror/addon/lint/lint.css');\n await import('codemirror/addon/lint/lint');\n\n if (editorConfigProps.mode === 'json') {\n await import('codemirror/addon/lint/json-lint');\n registerHelper('lint', 'json', jsonLint);\n }\n }\n setShowEditor(true);\n })();\n }, [editorConfigProps]);\n\n const updatedEditorConfig: EditorConfiguration = useMemo(() => {\n const mode = extendModeWithSingleLine(editorConfigProps?.mode || 'expression', isSingleLine);\n return {\n ...editorConfigProps,\n lineWrapping: !isSingleLine,\n smartIndent: true,\n autoCloseBrackets: true,\n matchBrackets: true,\n lineNumbers: !isSingleLine && editorConfigProps?.lineNumbers,\n placeholder: editorConfigProps?.placeholder,\n extraKeys: {\n /** default tab and shift tab behavior\n * https://codemirror.net/5/\n * https://discuss.codemirror.net/t/does-tab-key-work-in-codemirror-6/2705\n */\n Tab: isSingleLine ? false : () => Pass,\n 'Shift-Tab': isSingleLine ? false : () => Pass,\n ...(isSingleLine ? { Enter: () => {} } : {})\n },\n mode,\n ...(languages.includes(editorConfigProps?.mode as string) ? { theme: 'eclipse' } : {}),\n ...(editorConfigProps?.foldGutter && !isSingleLine\n ? {\n foldGutter: true,\n gutters: (() => {\n const guttersArr: string[] = [];\n if (editorConfigProps?.lint) guttersArr.push('CodeMirror-lint-markers');\n if (editorConfigProps?.lineNumbers) guttersArr.push('CodeMirror-linenumbers');\n return [...guttersArr, 'CodeMirror-foldgutter'];\n })()\n }\n : {}),\n ...(editorConfigProps?.mode === 'json'\n ? {\n mode: 'application/json',\n lint: editorConfigProps.lint\n }\n : {})\n };\n }, [isSingleLine, editorConfigProps]);\n\n const handlePaste = (editor: Editor, event: ClipboardEvent) => {\n if (isSingleLine) {\n const doc = editor.getDoc();\n const pastedContent = event.clipboardData?.getData('text/plain').trim();\n const singleLineContent = pastedContent?.replace(/\\r?\\n|\\r/g, ' ') || '';\n\n if (doc && doc.getSelection()) {\n doc.replaceSelection(singleLineContent);\n } else {\n const cursor: Position = doc.getCursor();\n doc.replaceRange(singleLineContent, cursor);\n }\n const cursor: Position = doc.getCursor();\n doc.setCursor(cursor);\n event.preventDefault();\n }\n };\n\n useEffect(() => {\n const editor = editorRef.current;\n if (editor && isSingleLine) {\n editor.on('paste', handlePaste);\n }\n return () => {\n if (editor) {\n editor.off('paste', handlePaste);\n }\n };\n }, [isSingleLine]);\n\n useEffect(() => {\n const textArea = codeMirror?.getInputField();\n if (!textArea) return;\n\n let describedBy = textArea.getAttribute('aria-describedby') || '';\n const ids = new Set(describedBy.split(' ').filter(item => item));\n\n if (ariaDescribedBy && !ids.has(ariaDescribedBy)) {\n ids.add(ariaDescribedBy);\n }\n\n if (errors && !ids.has(errorDescId)) {\n ids.add(errorDescId);\n } else if (!errors && ids.has(errorDescId)) {\n ids.delete(errorDescId);\n }\n\n if (!ariaDescribedBy) {\n describedBy = ids.has(errorDescId) ? errorDescId : '';\n } else describedBy = Array.from(ids).join(' ').trim();\n\n if (describedBy) {\n textArea.setAttribute('aria-describedby', describedBy);\n } else {\n textArea.removeAttribute('aria-describedby');\n }\n }, [codeMirror, errors, ariaDescribedBy]);\n\n return (\n <>\n <StyledSuggestions isLoading={loading} suggestions={suggestions} />\n <StyledCodeEditor\n {...restProps}\n data-testid={testIds.root}\n container={{\n direction: 'column',\n justify: 'between'\n }}\n item={{\n grow: 1\n }}\n ref={ref}\n errors={errors}\n readOnly={readOnly}\n isLoading={loading}\n suggestions={suggestions}\n isSingleLine={isSingleLine}\n editorConfigProps={updatedEditorConfig}\n >\n {showEditor && (\n <ReactCodeMirror\n value={value}\n onBeforeChange={onBeforeChange}\n options={updatedEditorConfig}\n editorDidMount={editor => {\n editor.setSize('100%', '100%');\n setCodeMirror(editor);\n editorRef.current = editor;\n }}\n onBlur={editor => {\n setIsFocused(false);\n if (onBlur) {\n onBlurHandler(editor);\n }\n }}\n onFocus={() => {\n setIsFocused(true);\n }}\n />\n )}\n {popoverInfo.errorMessages.length > 0 && popoverInfo.targetElement !== null && (\n <Popover\n as={StyledPopover}\n show={show}\n target={popoverInfo.targetElement}\n placement='bottom-start'\n data-testid={testIds.errorPopover}\n >\n <Flex container={{ direction: 'column', gap: 1 }}>\n <Flex container={{ gap: 1 }}>\n <StyledWarnIcon name='warn-solid' />\n <Text variant='h4'>\n {t('errors', [], {\n count:\n popoverInfo.errorMessages.length === 1\n ? 1\n : // Using NaN to always select \"other\" pluralization form\n NaN\n })}\n </Text>\n </Flex>\n {popoverInfo.errorMessages.length > 1 ? (\n <UnorderedList as={StyledList} items={popoverInfo.errorMessages} />\n ) : (\n <Text>{popoverInfo.errorMessages}</Text>\n )}\n </Flex>\n </Popover>\n )}\n {errors && (\n <StyledFormFieldInfo id={errorDescId} status='error' data-testid={testIds.errorMessage}>\n {errors}\n </StyledFormFieldInfo>\n )}\n </StyledCodeEditor>\n </>\n );\n }\n);\n\nexport default withTestIds(CodeEditor, getEditorsTestIds);\n"]}
|
|
@@ -1,9 +1,16 @@
|
|
|
1
|
-
import type { SuggestionType } from './CodeEditor.types';
|
|
1
|
+
import type { CodeEditorProps, SuggestionType } from './CodeEditor.types';
|
|
2
2
|
export declare const StyledLoading: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const StyledWarnIcon: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("@pega/cosmos-react-core").IconProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
4
|
+
export declare const StyledPopover: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
+
export declare const StyledList: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
6
|
+
export declare const StyledCodeEditor: import("styled-components").StyledComponent<import("@pega/cosmos-react-core").ForwardRefForwardPropsComponent<import("@pega/cosmos-react-core").FlexProps>, import("styled-components").DefaultTheme, Pick<CodeEditorProps, "editorConfigProps" | "isSingleLine" | "showEditorOnly"> & {
|
|
4
7
|
isLoading?: boolean;
|
|
5
8
|
errors?: string;
|
|
6
9
|
readOnly?: boolean;
|
|
7
10
|
suggestions: SuggestionType[];
|
|
8
11
|
}, never>;
|
|
12
|
+
export declare const StyledSuggestions: import("styled-components").GlobalStyleComponent<{
|
|
13
|
+
isLoading?: boolean;
|
|
14
|
+
suggestions: SuggestionType[];
|
|
15
|
+
}, import("styled-components").DefaultTheme>;
|
|
9
16
|
//# sourceMappingURL=CodeEditor.styles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CodeEditor.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAK1E,eAAO,MAAM,aAAa,yGAEzB,CAAC;AAEF,eAAO,MAAM,cAAc,0LAIzB,CAAC;AAIH,eAAO,MAAM,aAAa,yGAWxB,CAAC;AAIH,eAAO,MAAM,UAAU,yGAIrB,CAAC;AAGH,eAAO,MAAM,gBAAgB;gBAEb,OAAO;aACV,MAAM;eACJ,OAAO;iBACL,cAAc,EAAE;SA+hB/B,CAAC;AAIH,eAAO,MAAM,iBAAiB;gBAChB,OAAO;iBACN,cAAc,EAAE;4CA+C7B,CAAC"}
|
|
@@ -1,18 +1,49 @@
|
|
|
1
|
-
|
|
2
|
-
import styled, { css } from 'styled-components';
|
|
1
|
+
import styled, { createGlobalStyle, css } from 'styled-components';
|
|
3
2
|
import { mix } from 'polished';
|
|
4
|
-
import { defaultThemeProp, calculateFontSize, Flex } from '@pega/cosmos-react-core';
|
|
3
|
+
import { defaultThemeProp, calculateFontSize, Flex, Icon } from '@pega/cosmos-react-core';
|
|
5
4
|
import { StyledFormField } from '@pega/cosmos-react-core/lib/components/FormField/FormField';
|
|
5
|
+
const primaryBackground = 'primary-background';
|
|
6
|
+
const contentWidth = 'content-width';
|
|
6
7
|
export const StyledLoading = styled.div `
|
|
7
8
|
font-size: 1.5rem;
|
|
8
9
|
`;
|
|
9
|
-
export const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
export const StyledWarnIcon = styled(Icon)(({ theme }) => {
|
|
11
|
+
return css `
|
|
12
|
+
color: ${theme.base.palette.urgent};
|
|
13
|
+
`;
|
|
14
|
+
});
|
|
15
|
+
StyledWarnIcon.defaultProps = defaultThemeProp;
|
|
16
|
+
export const StyledPopover = styled.div(({ theme }) => {
|
|
17
|
+
const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
|
|
18
|
+
return css `
|
|
19
|
+
font-size: ${fontSize.xxs};
|
|
20
|
+
max-width: ${theme.base[contentWidth].sm};
|
|
21
|
+
padding: ${theme.base.spacing};
|
|
22
|
+
white-space: pre-line;
|
|
23
|
+
word-break: break-word;
|
|
24
|
+
pointer-events: none;
|
|
25
|
+
`;
|
|
26
|
+
});
|
|
27
|
+
StyledPopover.defaultProps = defaultThemeProp;
|
|
28
|
+
export const StyledList = styled.div(({ theme }) => {
|
|
29
|
+
return css `
|
|
30
|
+
padding-inline-start: calc(0.25 * ${theme.base.spacing});
|
|
31
|
+
`;
|
|
32
|
+
});
|
|
33
|
+
StyledList.defaultProps = defaultThemeProp;
|
|
34
|
+
export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'form-control': { ':read-only': { 'background-color': readOnlyBackgroundColor } }, 'form-field': { error: { 'status-color': errorBackground } }, input } }, errors, readOnly, showEditorOnly, editorConfigProps, isSingleLine = false }) => {
|
|
35
|
+
const jsonMode = editorConfigProps?.mode === 'application/json';
|
|
13
36
|
return css `
|
|
37
|
+
width: 100%;
|
|
38
|
+
${showEditorOnly &&
|
|
39
|
+
css `
|
|
40
|
+
max-height: 10rem;
|
|
41
|
+
`}
|
|
14
42
|
position: relative;
|
|
15
|
-
|
|
43
|
+
${!showEditorOnly &&
|
|
44
|
+
css `
|
|
45
|
+
max-height: 100%;
|
|
46
|
+
`}
|
|
16
47
|
overflow-y: auto;
|
|
17
48
|
${StyledFormField} {
|
|
18
49
|
flex-grow: 1;
|
|
@@ -21,20 +52,44 @@ export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'fo
|
|
|
21
52
|
/* PADDING */
|
|
22
53
|
.react-codemirror2 {
|
|
23
54
|
flex-grow: 1;
|
|
24
|
-
|
|
55
|
+
${isSingleLine
|
|
56
|
+
? css `
|
|
57
|
+
min-height: ${input.height};
|
|
58
|
+
& * {
|
|
59
|
+
scrollbar-width: none;
|
|
60
|
+
::-webkit-scrollbar {
|
|
61
|
+
display: none;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
`
|
|
65
|
+
: css `
|
|
66
|
+
min-height: 3.75rem;
|
|
67
|
+
`}
|
|
25
68
|
overflow-y: auto;
|
|
26
69
|
${readOnly &&
|
|
70
|
+
!jsonMode &&
|
|
27
71
|
css `
|
|
28
72
|
max-height: 5.625rem;
|
|
29
73
|
`}
|
|
30
74
|
}
|
|
31
75
|
|
|
76
|
+
.CodeMirror-placeholder {
|
|
77
|
+
opacity: ${base.transparency['transparent-3']};
|
|
78
|
+
}
|
|
79
|
+
|
|
32
80
|
.CodeMirror-lines {
|
|
33
81
|
cursor: text;
|
|
34
82
|
min-height: 0.063rem; /* prevents collapsing before first draw */
|
|
35
|
-
padding: ${base.spacing};
|
|
83
|
+
padding: ${base.spacing} 0;
|
|
36
84
|
}
|
|
37
85
|
|
|
86
|
+
${editorConfigProps?.theme === 'eclipse' &&
|
|
87
|
+
css `
|
|
88
|
+
.cm-s-eclipse .cm-string {
|
|
89
|
+
color: ${base.palette.urgent};
|
|
90
|
+
}
|
|
91
|
+
`}
|
|
92
|
+
|
|
38
93
|
.CodeMirror-scrollbar-filler,
|
|
39
94
|
.CodeMirror-gutter-filler {
|
|
40
95
|
background-color: white; /* The little square between H and V scrollbars */
|
|
@@ -343,6 +398,7 @@ export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'fo
|
|
|
343
398
|
-webkit-tap-highlight-color: transparent;
|
|
344
399
|
-webkit-font-variant-ligatures: contextual;
|
|
345
400
|
font-variant-ligatures: contextual;
|
|
401
|
+
padding: 0 ${base.spacing};
|
|
346
402
|
}
|
|
347
403
|
.CodeMirror-wrap pre.CodeMirror-line,
|
|
348
404
|
.CodeMirror-wrap pre.CodeMirror-line-like {
|
|
@@ -445,6 +501,12 @@ export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'fo
|
|
|
445
501
|
}
|
|
446
502
|
|
|
447
503
|
.CodeMirror {
|
|
504
|
+
${isSingleLine &&
|
|
505
|
+
css `
|
|
506
|
+
white-space: nowrap;
|
|
507
|
+
height: auto;
|
|
508
|
+
padding-inline-end: ${base.spacing};
|
|
509
|
+
`}
|
|
448
510
|
overflow: hidden;
|
|
449
511
|
font-family: monospace;
|
|
450
512
|
direction: ltr;
|
|
@@ -466,10 +528,16 @@ export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'fo
|
|
|
466
528
|
.cm-ex-context {
|
|
467
529
|
color: ${base.palette.interactive};
|
|
468
530
|
}
|
|
531
|
+
.cm-ex-additional-operators {
|
|
532
|
+
color: ${base.palette.interactive};
|
|
533
|
+
}
|
|
469
534
|
.cm-ex-operator {
|
|
470
535
|
color: ${base.palette.warn};
|
|
471
536
|
font-weight: bold;
|
|
472
537
|
}
|
|
538
|
+
.cm-ex-comment {
|
|
539
|
+
color: ${base.palette.info};
|
|
540
|
+
}
|
|
473
541
|
.cm-ex-ruleName {
|
|
474
542
|
color: ${base.palette.success};
|
|
475
543
|
}
|
|
@@ -479,34 +547,36 @@ export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'fo
|
|
|
479
547
|
.cm-ex-constant {
|
|
480
548
|
color: ${base.palette.pending};
|
|
481
549
|
}
|
|
482
|
-
|
|
550
|
+
.cm-ex-underline-error {
|
|
551
|
+
text-decoration: underline;
|
|
552
|
+
text-decoration-style: wavy;
|
|
553
|
+
text-decoration-color: ${base.colors.red.medium};
|
|
554
|
+
}
|
|
555
|
+
`;
|
|
556
|
+
});
|
|
557
|
+
StyledCodeEditor.defaultProps = defaultThemeProp;
|
|
558
|
+
export const StyledSuggestions = createGlobalStyle(({ theme: { base }, isLoading, suggestions }) => {
|
|
559
|
+
const activeColor = mix(0.85, base.palette[primaryBackground], base.palette.interactive);
|
|
560
|
+
const hoverColor = mix(0.95, base.palette[primaryBackground], base.palette.interactive);
|
|
561
|
+
const fontSizes = calculateFontSize(base['font-size'], base['font-scale']);
|
|
562
|
+
return css `
|
|
483
563
|
.CodeMirror-hints {
|
|
484
564
|
position: absolute;
|
|
485
|
-
z-index:
|
|
565
|
+
z-index: calc(${base['z-index'].backdrop} + 1);
|
|
486
566
|
transition: height ${base.animation.speed} ${base.animation.timing.ease};
|
|
487
|
-
padding: 0;
|
|
488
567
|
border-radius: calc(0.5 * ${base['border-radius']});
|
|
489
568
|
box-shadow: ${base.shadow.low};
|
|
490
569
|
border: 0.0625rem solid ${base.palette['border-line']};
|
|
491
|
-
background-color: ${base.palette[
|
|
570
|
+
background-color: ${base.palette[primaryBackground]};
|
|
492
571
|
font-size: ${fontSizes.s};
|
|
493
572
|
max-height: 12rem;
|
|
494
573
|
overflow-y: auto;
|
|
495
|
-
min-width:
|
|
574
|
+
min-width: ${base[contentWidth].xs};
|
|
496
575
|
}
|
|
497
576
|
|
|
498
577
|
.CodeMirror-hint {
|
|
499
|
-
|
|
500
|
-
css `
|
|
501
|
-
pointer-events: none;
|
|
502
|
-
`}
|
|
503
|
-
min-height: 1.2rem;
|
|
504
|
-
width: calc(1.5 * ${base['content-width'].xs});
|
|
578
|
+
width: calc(1.5 * ${base[contentWidth].xs});
|
|
505
579
|
cursor: pointer;
|
|
506
|
-
@media (pointer: coarse) {
|
|
507
|
-
min-height: 1.2rem;
|
|
508
|
-
}
|
|
509
|
-
line-height: 1.2rem;
|
|
510
580
|
&:focus-within {
|
|
511
581
|
background-color: ${activeColor};
|
|
512
582
|
}
|
|
@@ -517,6 +587,10 @@ export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'fo
|
|
|
517
587
|
padding-inline: ${base.spacing};
|
|
518
588
|
}
|
|
519
589
|
|
|
590
|
+
body .CodeMirror-lint-tooltip {
|
|
591
|
+
z-index: ${base['z-index'].tooltip};
|
|
592
|
+
}
|
|
593
|
+
|
|
520
594
|
${!isLoading &&
|
|
521
595
|
suggestions?.length > 0 &&
|
|
522
596
|
css `
|
|
@@ -526,5 +600,5 @@ export const StyledCodeEditor = styled(Flex)(({ theme: { base, components: { 'fo
|
|
|
526
600
|
`}
|
|
527
601
|
`;
|
|
528
602
|
});
|
|
529
|
-
|
|
603
|
+
StyledSuggestions.defaultProps = defaultThemeProp;
|
|
530
604
|
//# sourceMappingURL=CodeEditor.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.styles.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAC;AACpF,OAAO,EAAE,eAAe,EAAE,MAAM,4DAA4D,CAAC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I,CAAC,OAAO;;;MAG9B,CAAC,SAAS;QACZ,WAAW,EAAE,MAAM,GAAG,CAAC;QACvB,GAAG,CAAA;;4BAEqB,WAAW;;KAElC;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["// cspell:words vscrollbar hscrollbar\nimport styled, { css } from 'styled-components';\nimport { mix } from 'polished';\n\nimport { defaultThemeProp, calculateFontSize, Flex } from '@pega/cosmos-react-core';\nimport { StyledFormField } from '@pega/cosmos-react-core/lib/components/FormField/FormField';\n\nimport type { SuggestionType } from './CodeEditor.types';\n\nexport const StyledLoading = styled.div`\n font-size: 1.5rem;\n`;\n\nexport const StyledCodeEditor = styled(Flex)<{\n isLoading?: boolean;\n errors?: string;\n readOnly?: boolean;\n suggestions: SuggestionType[];\n}>(({\n theme: {\n base,\n components: {\n 'form-control': {\n ':read-only': { 'background-color': readOnlyBackgroundColor }\n },\n 'form-field': {\n error: { 'status-color': errorBackground }\n }\n }\n },\n errors,\n isLoading,\n suggestions,\n readOnly\n}) => {\n const activeColor = mix(0.85, base.palette['primary-background'], base.palette.interactive);\n\n const hoverColor = mix(0.95, base.palette['primary-background'], base.palette.interactive);\n\n const fontSizes = calculateFontSize(base['font-size'], base['font-scale']);\n return css`\n position: relative;\n max-height: 100%;\n overflow-y: auto;\n ${StyledFormField} {\n flex-grow: 1;\n }\n\n /* PADDING */\n .react-codemirror2 {\n flex-grow: 1;\n min-height: 3.75rem;\n overflow-y: auto;\n ${readOnly &&\n css`\n max-height: 5.625rem;\n `}\n }\n\n .CodeMirror-lines {\n cursor: text;\n min-height: 0.063rem; /* prevents collapsing before first draw */\n padding: ${base.spacing};\n }\n\n .CodeMirror-scrollbar-filler,\n .CodeMirror-gutter-filler {\n background-color: white; /* The little square between H and V scrollbars */\n }\n\n /* GUTTER */\n\n .CodeMirror-gutters {\n position: absolute;\n left: 0;\n top: 0;\n min-height: 100%;\n z-index: 3;\n border-right: 0.063rem solid #dddddd;\n background-color: #f7f7f7;\n white-space: nowrap;\n }\n .CodeMirror-linenumber {\n padding: 0 0.125rem 0 0.313rem;\n min-width: 1.25rem;\n text-align: right;\n color: #999999;\n white-space: nowrap;\n }\n\n .CodeMirror-guttermarker {\n color: black;\n }\n .CodeMirror-guttermarker-subtle {\n color: #999999;\n }\n\n /* CURSOR */\n\n .CodeMirror-cursor {\n position: absolute;\n pointer-events: none;\n border-left: 0.0625rem solid ${base.palette.dark};\n border-right: none;\n width: 0;\n ${readOnly &&\n css`\n display: none;\n `}\n }\n\n /* Shown when moving in bi-directional text */\n .CodeMirror div.CodeMirror-secondarycursor {\n border-left: 0.063rem solid silver;\n }\n .cm-fat-cursor-mark {\n background-color: rgba(20, 255, 20, 0.5);\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n }\n .cm-animate-fat-cursor {\n width: auto;\n border: 0;\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n background-color: #77ee77;\n }\n @-moz-keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n @-webkit-keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n @keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n\n .cm-tab {\n display: inline-block;\n text-decoration: inherit;\n }\n\n .CodeMirror-rulers {\n position: absolute;\n left: 0;\n right: 0;\n top: -3.125rem;\n bottom: 0;\n overflow: hidden;\n }\n .CodeMirror-ruler {\n border-left: 0.063rem solid #cccccc;\n top: 0;\n bottom: 0;\n position: absolute;\n }\n\n /* DEFAULT THEME */\n\n .cm-s-default .cm-header {\n color: blue;\n }\n .cm-negative {\n color: #dd4444;\n }\n .cm-positive {\n color: #229922;\n }\n .cm-strong {\n font-weight: bold;\n }\n .cm-s-default .cm-quote {\n color: #009900;\n }\n .cm-em {\n font-style: italic;\n }\n .cm-link {\n text-decoration: underline;\n }\n .cm-strikethrough {\n text-decoration: line-through;\n }\n\n .cm-s-default .cm-keyword {\n color: #770088;\n }\n .cm-s-default .cm-atom {\n color: #221199;\n }\n .cm-s-default .cm-number {\n color: #116644;\n }\n .cm-s-default .cm-def {\n color: #0000ff;\n }\n .cm-s-default .cm-variable-2 {\n color: #0055aa;\n }\n .cm-s-default .cm-variable-3,\n .cm-s-default .cm-type {\n color: #008855;\n }\n .cm-s-default .cm-comment {\n color: #aa5500;\n }\n .cm-s-default .cm-string {\n color: #aa1111;\n }\n .cm-s-default .cm-string-2 {\n color: #ff5500;\n }\n .cm-s-default .cm-meta {\n color: #555555;\n }\n .cm-s-default .cm-qualifier {\n color: #555555;\n }\n .cm-s-default .cm-builtin {\n color: #3300aa;\n }\n .cm-s-default .cm-bracket {\n color: #999977;\n }\n .cm-s-default .cm-tag {\n color: #117700;\n }\n .cm-s-default .cm-attribute {\n color: #0000cc;\n }\n .cm-s-default .cm-hr {\n color: #999999;\n }\n .cm-s-default .cm-link {\n color: #0000cc;\n }\n\n .cm-s-default .cm-error {\n color: #ff0000;\n }\n .cm-invalidchar {\n color: #ff0000;\n }\n\n .CodeMirror-composing {\n border-bottom: 0.125rem solid;\n }\n\n /* Default styles for common addons */\n\n div.CodeMirror span.CodeMirror-matchingbracket {\n color: #00bb00;\n }\n div.CodeMirror span.CodeMirror-nonmatchingbracket {\n color: #aa2222;\n }\n .CodeMirror-matchingtag {\n background: rgba(255, 150, 0, 0.3);\n }\n .CodeMirror-activeline-background {\n background: #e8f2ff;\n }\n\n /* STOP */\n\n /* The rest of this file contains styles related to the mechanics of\n the editor. You probably shouldn't touch them. */\n\n .CodeMirror-scroll {\n overflow: scroll !important;\n margin-bottom: -3.125rem;\n margin-right: -3.125rem;\n padding-bottom: 3.125rem;\n height: 100%;\n outline: none; /* Prevent dragging from highlighting the element */\n position: relative;\n }\n .CodeMirror-sizer {\n position: relative;\n border-right: 3.125rem solid transparent;\n }\n\n /* The fake, visible scrollbars. Used to force redraw during scrolling\n before actual scrolling happens, thus preventing shaking and\n flickering artifacts. */\n .CodeMirror-vscrollbar,\n .CodeMirror-hscrollbar,\n .CodeMirror-scrollbar-filler,\n .CodeMirror-gutter-filler {\n position: absolute;\n z-index: 6;\n display: none;\n }\n .CodeMirror-vscrollbar {\n right: 0;\n top: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n }\n .CodeMirror-hscrollbar {\n bottom: 0;\n left: 0;\n overflow-y: hidden;\n overflow-x: scroll;\n }\n .CodeMirror-scrollbar-filler {\n right: 0;\n bottom: 0;\n }\n .CodeMirror-gutter-filler {\n left: 0;\n bottom: 0;\n }\n .CodeMirror-gutter {\n white-space: normal;\n height: 100%;\n display: inline-block;\n vertical-align: top;\n margin-bottom: -3.125rem;\n }\n .CodeMirror-gutter-wrapper {\n position: absolute;\n z-index: 4;\n background: none !important;\n border: none !important;\n }\n .CodeMirror-gutter-background {\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: 4;\n }\n .CodeMirror-gutter-elt {\n position: absolute;\n cursor: default;\n z-index: 4;\n }\n .CodeMirror-gutter-wrapper ::selection {\n background-color: transparent;\n }\n .CodeMirror-gutter-wrapper ::-moz-selection {\n background-color: transparent;\n }\n\n .CodeMirror pre.CodeMirror-line,\n .CodeMirror pre.CodeMirror-line-like {\n /* Reset some styles that the rest of the page might have set */\n -moz-border-radius: 0;\n -webkit-border-radius: 0;\n border-radius: 0;\n border-width: 0;\n background: transparent;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n white-space: pre;\n word-wrap: normal;\n line-height: inherit;\n color: inherit;\n z-index: 2;\n position: relative;\n overflow: visible;\n -webkit-tap-highlight-color: transparent;\n -webkit-font-variant-ligatures: contextual;\n font-variant-ligatures: contextual;\n }\n .CodeMirror-wrap pre.CodeMirror-line,\n .CodeMirror-wrap pre.CodeMirror-line-like {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: normal;\n }\n\n .CodeMirror-linebackground {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 0;\n }\n\n .CodeMirror-linewidget {\n position: relative;\n z-index: 2;\n padding: 0.006rem; /* Force widget margins to stay inside of the container */\n }\n\n .CodeMirror-rtl pre {\n direction: rtl;\n }\n\n .CodeMirror-code {\n outline: none;\n }\n\n /* Force content-box sizing for the elements where we expect it */\n .CodeMirror-scroll,\n .CodeMirror-sizer,\n .CodeMirror-gutter,\n .CodeMirror-linenumber {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n }\n\n .CodeMirror-measure {\n position: absolute;\n width: 100%;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n }\n\n .CodeMirror-measure pre {\n position: static;\n }\n\n div.CodeMirror-dragcursors {\n visibility: visible;\n }\n\n .CodeMirror-selected {\n background: #d9d9d9;\n }\n .CodeMirror-focused .CodeMirror-selected {\n background: #d7d4f0;\n }\n .CodeMirror-focused {\n border-color: ${base.palette.interactive} !important;\n }\n .CodeMirror:not(.CodeMirror-focused) .CodeMirror-cursors {\n visibility: hidden;\n }\n .CodeMirror-crosshair {\n cursor: crosshair;\n }\n .CodeMirror-line::selection,\n .CodeMirror-line > span::selection,\n .CodeMirror-line > span > span::selection {\n background: #d7d4f0;\n }\n .CodeMirror-line::-moz-selection,\n .CodeMirror-line > span::-moz-selection,\n .CodeMirror-line > span > span::-moz-selection {\n background: #d7d4f0;\n }\n\n .cm-searching {\n background-color: rgba(255, 255, 0, 0.4);\n }\n\n /* Used to force a border model for a node */\n .cm-force-border {\n padding-right: 0.006rem;\n }\n\n /* See issue #2901 */\n .cm-tab-wrap-hack::after {\n content: '';\n }\n\n /* Help users use markselection to safely style text background */\n span.CodeMirror-selectedtext {\n background: none;\n }\n\n .CodeMirror {\n overflow: hidden;\n font-family: monospace;\n direction: ltr;\n position: relative;\n background-color: ${base.palette['background-color']};\n color: ${base.palette['foreground-color']};\n border: 0.0625rem solid ${base.palette['border-line']};\n border-radius: calc(0.5 * ${base['border-radius']});\n ${errors &&\n css`\n border-color: ${errorBackground};\n `}\n ${readOnly &&\n css`\n background-color: ${readOnlyBackgroundColor};\n `}\n }\n\n .cm-ex-context {\n color: ${base.palette.interactive};\n }\n .cm-ex-operator {\n color: ${base.palette.warn};\n font-weight: bold;\n }\n .cm-ex-ruleName {\n color: ${base.palette.success};\n }\n .cm-ex-delimeter {\n color: ${base.palette['foreground-color']};\n }\n .cm-ex-constant {\n color: ${base.palette.pending};\n }\n\n .CodeMirror-hints {\n position: absolute;\n z-index: 10;\n transition: height ${base.animation.speed} ${base.animation.timing.ease};\n padding: 0;\n border-radius: calc(0.5 * ${base['border-radius']});\n box-shadow: ${base.shadow.low};\n border: 0.0625rem solid ${base.palette['border-line']};\n background-color: ${base.palette['primary-background']};\n font-size: ${fontSizes.s};\n max-height: 12rem;\n overflow-y: auto;\n min-width: 8rem;\n }\n\n .CodeMirror-hint {\n ${(isLoading || suggestions?.length === 0) &&\n css`\n pointer-events: none;\n `}\n min-height: 1.2rem;\n width: calc(1.5 * ${base['content-width'].xs});\n cursor: pointer;\n @media (pointer: coarse) {\n min-height: 1.2rem;\n }\n line-height: 1.2rem;\n &:focus-within {\n background-color: ${activeColor};\n }\n\n &:hover:not([aria-disabled='true']) {\n background-color: ${hoverColor};\n }\n padding-inline: ${base.spacing};\n }\n\n ${!isLoading &&\n suggestions?.length > 0 &&\n css`\n li.CodeMirror-hint-active {\n background-color: ${activeColor};\n }\n `}\n `;\n});\n\nStyledCodeEditor.defaultProps = defaultThemeProp;\n"]}
|
|
1
|
+
{"version":3,"file":"CodeEditor.styles.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,iBAAiB,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,IAAI,E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IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAEzF,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IAExF,MAAM,SAAS,GAAG,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IAC3E,OAAO,GAAG,CAAA;;;sBAGU,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ;2BACnB,IAAI,CAAC,SAAS,CAAC,KAAK,IAAI,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI;kCAC3C,IAAI,CAAC,eAAe,CAAC;oBACnC,IAAI,CAAC,MAAM,CAAC,GAAG;gCACH,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;0BACjC,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC;mBACtC,SAAS,CAAC,CAAC;;;mBAGX,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE;;;;0BAId,IAAI,CAAC,YAAY,CAAC,CAAC,EAAE;;;4BAGnB,WAAW;;;;4BAIX,UAAU;;wBAEd,IAAI,CAAC,OAAO;;;;iBAInB,IAAI,CAAC,SAAS,CAAC,CAAC,OAAO;;;MAGlC,CAAC,SAAS;QACZ,WAAW,EAAE,MAAM,GAAG,CAAC;QACvB,GAAG,CAAA;;4BAEqB,WAAW;;KAElC;GACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,iBAAiB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { createGlobalStyle, css } from 'styled-components';\nimport { mix } from 'polished';\n\nimport { defaultThemeProp, calculateFontSize, Flex, Icon } from '@pega/cosmos-react-core';\nimport { StyledFormField } from '@pega/cosmos-react-core/lib/components/FormField/FormField';\n\nimport type { CodeEditorProps, SuggestionType } from './CodeEditor.types';\n\nconst primaryBackground = 'primary-background';\nconst contentWidth = 'content-width';\n\nexport const StyledLoading = styled.div`\n font-size: 1.5rem;\n`;\n\nexport const StyledWarnIcon = styled(Icon)(({ theme }) => {\n return css`\n color: ${theme.base.palette.urgent};\n `;\n});\n\nStyledWarnIcon.defaultProps = defaultThemeProp;\n\nexport const StyledPopover = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n font-size: ${fontSize.xxs};\n max-width: ${theme.base[contentWidth].sm};\n padding: ${theme.base.spacing};\n white-space: pre-line;\n word-break: break-word;\n pointer-events: none;\n `;\n});\n\nStyledPopover.defaultProps = defaultThemeProp;\n\nexport const StyledList = styled.div(({ theme }) => {\n return css`\n padding-inline-start: calc(0.25 * ${theme.base.spacing});\n `;\n});\nStyledList.defaultProps = defaultThemeProp;\n\nexport const StyledCodeEditor = styled(Flex)<\n Pick<CodeEditorProps, 'showEditorOnly' | 'editorConfigProps' | 'isSingleLine'> & {\n isLoading?: boolean;\n errors?: string;\n readOnly?: boolean;\n suggestions: SuggestionType[];\n }\n>(({\n theme: {\n base,\n components: {\n 'form-control': {\n ':read-only': { 'background-color': readOnlyBackgroundColor }\n },\n 'form-field': {\n error: { 'status-color': errorBackground }\n },\n input\n }\n },\n errors,\n readOnly,\n showEditorOnly,\n editorConfigProps,\n isSingleLine = false\n}) => {\n const jsonMode = editorConfigProps?.mode === 'application/json';\n\n return css`\n width: 100%;\n ${showEditorOnly &&\n css`\n max-height: 10rem;\n `}\n position: relative;\n ${!showEditorOnly &&\n css`\n max-height: 100%;\n `}\n overflow-y: auto;\n ${StyledFormField} {\n flex-grow: 1;\n }\n\n /* PADDING */\n .react-codemirror2 {\n flex-grow: 1;\n ${isSingleLine\n ? css`\n min-height: ${input.height};\n & * {\n scrollbar-width: none;\n ::-webkit-scrollbar {\n display: none;\n }\n }\n `\n : css`\n min-height: 3.75rem;\n `}\n overflow-y: auto;\n ${readOnly &&\n !jsonMode &&\n css`\n max-height: 5.625rem;\n `}\n }\n\n .CodeMirror-placeholder {\n opacity: ${base.transparency['transparent-3']};\n }\n\n .CodeMirror-lines {\n cursor: text;\n min-height: 0.063rem; /* prevents collapsing before first draw */\n padding: ${base.spacing} 0;\n }\n\n ${editorConfigProps?.theme === 'eclipse' &&\n css`\n .cm-s-eclipse .cm-string {\n color: ${base.palette.urgent};\n }\n `}\n\n .CodeMirror-scrollbar-filler,\n .CodeMirror-gutter-filler {\n background-color: white; /* The little square between H and V scrollbars */\n }\n\n /* GUTTER */\n\n .CodeMirror-gutters {\n position: absolute;\n left: 0;\n top: 0;\n min-height: 100%;\n z-index: 3;\n border-right: 0.063rem solid #dddddd;\n background-color: #f7f7f7;\n white-space: nowrap;\n }\n .CodeMirror-linenumber {\n padding: 0 0.125rem 0 0.313rem;\n min-width: 1.25rem;\n text-align: right;\n color: #999999;\n white-space: nowrap;\n }\n\n .CodeMirror-guttermarker {\n color: black;\n }\n .CodeMirror-guttermarker-subtle {\n color: #999999;\n }\n\n /* CURSOR */\n\n .CodeMirror-cursor {\n position: absolute;\n pointer-events: none;\n border-left: 0.0625rem solid ${base.palette.dark};\n border-right: none;\n width: 0;\n ${readOnly &&\n css`\n display: none;\n `}\n }\n\n /* Shown when moving in bi-directional text */\n .CodeMirror div.CodeMirror-secondarycursor {\n border-left: 0.063rem solid silver;\n }\n .cm-fat-cursor-mark {\n background-color: rgba(20, 255, 20, 0.5);\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n }\n .cm-animate-fat-cursor {\n width: auto;\n border: 0;\n -webkit-animation: blink 1.06s steps(1) infinite;\n -moz-animation: blink 1.06s steps(1) infinite;\n animation: blink 1.06s steps(1) infinite;\n background-color: #77ee77;\n }\n @-moz-keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n @-webkit-keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n @keyframes blink {\n 50% {\n background-color: transparent;\n }\n }\n\n .cm-tab {\n display: inline-block;\n text-decoration: inherit;\n }\n\n .CodeMirror-rulers {\n position: absolute;\n left: 0;\n right: 0;\n top: -3.125rem;\n bottom: 0;\n overflow: hidden;\n }\n .CodeMirror-ruler {\n border-left: 0.063rem solid #cccccc;\n top: 0;\n bottom: 0;\n position: absolute;\n }\n\n /* DEFAULT THEME */\n\n .cm-s-default .cm-header {\n color: blue;\n }\n .cm-negative {\n color: #dd4444;\n }\n .cm-positive {\n color: #229922;\n }\n .cm-strong {\n font-weight: bold;\n }\n .cm-s-default .cm-quote {\n color: #009900;\n }\n .cm-em {\n font-style: italic;\n }\n .cm-link {\n text-decoration: underline;\n }\n .cm-strikethrough {\n text-decoration: line-through;\n }\n\n .cm-s-default .cm-keyword {\n color: #770088;\n }\n .cm-s-default .cm-atom {\n color: #221199;\n }\n .cm-s-default .cm-number {\n color: #116644;\n }\n .cm-s-default .cm-def {\n color: #0000ff;\n }\n .cm-s-default .cm-variable-2 {\n color: #0055aa;\n }\n .cm-s-default .cm-variable-3,\n .cm-s-default .cm-type {\n color: #008855;\n }\n .cm-s-default .cm-comment {\n color: #aa5500;\n }\n .cm-s-default .cm-string {\n color: #aa1111;\n }\n .cm-s-default .cm-string-2 {\n color: #ff5500;\n }\n .cm-s-default .cm-meta {\n color: #555555;\n }\n .cm-s-default .cm-qualifier {\n color: #555555;\n }\n .cm-s-default .cm-builtin {\n color: #3300aa;\n }\n .cm-s-default .cm-bracket {\n color: #999977;\n }\n .cm-s-default .cm-tag {\n color: #117700;\n }\n .cm-s-default .cm-attribute {\n color: #0000cc;\n }\n .cm-s-default .cm-hr {\n color: #999999;\n }\n .cm-s-default .cm-link {\n color: #0000cc;\n }\n\n .cm-s-default .cm-error {\n color: #ff0000;\n }\n .cm-invalidchar {\n color: #ff0000;\n }\n\n .CodeMirror-composing {\n border-bottom: 0.125rem solid;\n }\n\n /* Default styles for common addons */\n\n div.CodeMirror span.CodeMirror-matchingbracket {\n color: #00bb00;\n }\n div.CodeMirror span.CodeMirror-nonmatchingbracket {\n color: #aa2222;\n }\n .CodeMirror-matchingtag {\n background: rgba(255, 150, 0, 0.3);\n }\n .CodeMirror-activeline-background {\n background: #e8f2ff;\n }\n\n /* STOP */\n\n /* The rest of this file contains styles related to the mechanics of\n the editor. You probably shouldn't touch them. */\n\n .CodeMirror-scroll {\n overflow: scroll !important;\n margin-bottom: -3.125rem;\n margin-right: -3.125rem;\n padding-bottom: 3.125rem;\n height: 100%;\n outline: none; /* Prevent dragging from highlighting the element */\n position: relative;\n }\n .CodeMirror-sizer {\n position: relative;\n border-right: 3.125rem solid transparent;\n }\n\n /* The fake, visible scrollbars. Used to force redraw during scrolling\n before actual scrolling happens, thus preventing shaking and\n flickering artifacts. */\n .CodeMirror-vscrollbar,\n .CodeMirror-hscrollbar,\n .CodeMirror-scrollbar-filler,\n .CodeMirror-gutter-filler {\n position: absolute;\n z-index: 6;\n display: none;\n }\n .CodeMirror-vscrollbar {\n right: 0;\n top: 0;\n overflow-x: hidden;\n overflow-y: scroll;\n }\n .CodeMirror-hscrollbar {\n bottom: 0;\n left: 0;\n overflow-y: hidden;\n overflow-x: scroll;\n }\n .CodeMirror-scrollbar-filler {\n right: 0;\n bottom: 0;\n }\n .CodeMirror-gutter-filler {\n left: 0;\n bottom: 0;\n }\n .CodeMirror-gutter {\n white-space: normal;\n height: 100%;\n display: inline-block;\n vertical-align: top;\n margin-bottom: -3.125rem;\n }\n .CodeMirror-gutter-wrapper {\n position: absolute;\n z-index: 4;\n background: none !important;\n border: none !important;\n }\n .CodeMirror-gutter-background {\n position: absolute;\n top: 0;\n bottom: 0;\n z-index: 4;\n }\n .CodeMirror-gutter-elt {\n position: absolute;\n cursor: default;\n z-index: 4;\n }\n .CodeMirror-gutter-wrapper ::selection {\n background-color: transparent;\n }\n .CodeMirror-gutter-wrapper ::-moz-selection {\n background-color: transparent;\n }\n\n .CodeMirror pre.CodeMirror-line,\n .CodeMirror pre.CodeMirror-line-like {\n /* Reset some styles that the rest of the page might have set */\n -moz-border-radius: 0;\n -webkit-border-radius: 0;\n border-radius: 0;\n border-width: 0;\n background: transparent;\n font-family: inherit;\n font-size: inherit;\n margin: 0;\n white-space: pre;\n word-wrap: normal;\n line-height: inherit;\n color: inherit;\n z-index: 2;\n position: relative;\n overflow: visible;\n -webkit-tap-highlight-color: transparent;\n -webkit-font-variant-ligatures: contextual;\n font-variant-ligatures: contextual;\n padding: 0 ${base.spacing};\n }\n .CodeMirror-wrap pre.CodeMirror-line,\n .CodeMirror-wrap pre.CodeMirror-line-like {\n word-wrap: break-word;\n white-space: pre-wrap;\n word-break: normal;\n }\n\n .CodeMirror-linebackground {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n z-index: 0;\n }\n\n .CodeMirror-linewidget {\n position: relative;\n z-index: 2;\n padding: 0.006rem; /* Force widget margins to stay inside of the container */\n }\n\n .CodeMirror-rtl pre {\n direction: rtl;\n }\n\n .CodeMirror-code {\n outline: none;\n }\n\n /* Force content-box sizing for the elements where we expect it */\n .CodeMirror-scroll,\n .CodeMirror-sizer,\n .CodeMirror-gutter,\n .CodeMirror-linenumber {\n -moz-box-sizing: content-box;\n box-sizing: content-box;\n }\n\n .CodeMirror-measure {\n position: absolute;\n width: 100%;\n height: 0;\n overflow: hidden;\n visibility: hidden;\n }\n\n .CodeMirror-measure pre {\n position: static;\n }\n\n div.CodeMirror-dragcursors {\n visibility: visible;\n }\n\n .CodeMirror-selected {\n background: #d9d9d9;\n }\n .CodeMirror-focused .CodeMirror-selected {\n background: #d7d4f0;\n }\n .CodeMirror-focused {\n border-color: ${base.palette.interactive} !important;\n }\n .CodeMirror:not(.CodeMirror-focused) .CodeMirror-cursors {\n visibility: hidden;\n }\n .CodeMirror-crosshair {\n cursor: crosshair;\n }\n .CodeMirror-line::selection,\n .CodeMirror-line > span::selection,\n .CodeMirror-line > span > span::selection {\n background: #d7d4f0;\n }\n .CodeMirror-line::-moz-selection,\n .CodeMirror-line > span::-moz-selection,\n .CodeMirror-line > span > span::-moz-selection {\n background: #d7d4f0;\n }\n\n .cm-searching {\n background-color: rgba(255, 255, 0, 0.4);\n }\n\n /* Used to force a border model for a node */\n .cm-force-border {\n padding-right: 0.006rem;\n }\n\n /* See issue #2901 */\n .cm-tab-wrap-hack::after {\n content: '';\n }\n\n /* Help users use markselection to safely style text background */\n span.CodeMirror-selectedtext {\n background: none;\n }\n\n .CodeMirror {\n ${isSingleLine &&\n css`\n white-space: nowrap;\n height: auto;\n padding-inline-end: ${base.spacing};\n `}\n overflow: hidden;\n font-family: monospace;\n direction: ltr;\n position: relative;\n background-color: ${base.palette['background-color']};\n color: ${base.palette['foreground-color']};\n border: 0.0625rem solid ${base.palette['border-line']};\n border-radius: calc(0.5 * ${base['border-radius']});\n ${errors &&\n css`\n border-color: ${errorBackground};\n `}\n ${readOnly &&\n css`\n background-color: ${readOnlyBackgroundColor};\n `}\n }\n\n .cm-ex-context {\n color: ${base.palette.interactive};\n }\n .cm-ex-additional-operators {\n color: ${base.palette.interactive};\n }\n .cm-ex-operator {\n color: ${base.palette.warn};\n font-weight: bold;\n }\n .cm-ex-comment {\n color: ${base.palette.info};\n }\n .cm-ex-ruleName {\n color: ${base.palette.success};\n }\n .cm-ex-delimeter {\n color: ${base.palette['foreground-color']};\n }\n .cm-ex-constant {\n color: ${base.palette.pending};\n }\n .cm-ex-underline-error {\n text-decoration: underline;\n text-decoration-style: wavy;\n text-decoration-color: ${base.colors.red.medium};\n }\n `;\n});\n\nStyledCodeEditor.defaultProps = defaultThemeProp;\n\nexport const StyledSuggestions = createGlobalStyle<{\n isLoading?: boolean;\n suggestions: SuggestionType[];\n}>(({ theme: { base }, isLoading, suggestions }) => {\n const activeColor = mix(0.85, base.palette[primaryBackground], base.palette.interactive);\n\n const hoverColor = mix(0.95, base.palette[primaryBackground], base.palette.interactive);\n\n const fontSizes = calculateFontSize(base['font-size'], base['font-scale']);\n return css`\n .CodeMirror-hints {\n position: absolute;\n z-index: calc(${base['z-index'].backdrop} + 1);\n transition: height ${base.animation.speed} ${base.animation.timing.ease};\n border-radius: calc(0.5 * ${base['border-radius']});\n box-shadow: ${base.shadow.low};\n border: 0.0625rem solid ${base.palette['border-line']};\n background-color: ${base.palette[primaryBackground]};\n font-size: ${fontSizes.s};\n max-height: 12rem;\n overflow-y: auto;\n min-width: ${base[contentWidth].xs};\n }\n\n .CodeMirror-hint {\n width: calc(1.5 * ${base[contentWidth].xs});\n cursor: pointer;\n &:focus-within {\n background-color: ${activeColor};\n }\n\n &:hover:not([aria-disabled='true']) {\n background-color: ${hoverColor};\n }\n padding-inline: ${base.spacing};\n }\n\n body .CodeMirror-lint-tooltip {\n z-index: ${base['z-index'].tooltip};\n }\n\n ${!isLoading &&\n suggestions?.length > 0 &&\n css`\n li.CodeMirror-hint-active {\n background-color: ${activeColor};\n }\n `}\n `;\n});\n\nStyledSuggestions.defaultProps = defaultThemeProp;\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeEditor.test-ids.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,uKAGnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CodeEditor.test-ids.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.test-ids.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,MAAM,CAAC,MAAM,iBAAiB,GAAG,aAAa,CAAC,QAAQ,EAAE;IACvD,eAAe;IACf,eAAe;CACP,CAAC,CAAC","sourcesContent":["import { createTestIds } from '@pega/cosmos-react-core';\n\nexport const getEditorsTestIds = createTestIds('editor', [\n 'error-popover',\n 'error-message'\n] as const);\n"]}
|
|
@@ -1,14 +1,27 @@
|
|
|
1
1
|
import type { Ref } from 'react';
|
|
2
2
|
import type { ShowHintOptions, EditorConfiguration, Position } from 'codemirror';
|
|
3
|
-
import type { MenuItemProps } from '@pega/cosmos-react-core';
|
|
4
|
-
export type AutoCompleteTriggerChar = '@' | '.' | ':';
|
|
3
|
+
import type { MenuItemProps, TestIdProp } from '@pega/cosmos-react-core';
|
|
4
|
+
export type AutoCompleteTriggerChar = '@' | '.' | ':' | '#' | '(' | ')' | '[' | ']';
|
|
5
5
|
export type SuggestionType = Pick<MenuItemProps, 'primary' | 'secondary' | 'id'>;
|
|
6
|
+
export interface CustomPositionProps {
|
|
7
|
+
start?: Position;
|
|
8
|
+
end?: Position;
|
|
9
|
+
}
|
|
6
10
|
export interface EditorState {
|
|
7
11
|
getValue: () => string | undefined;
|
|
8
|
-
insertText: (text: string) => void;
|
|
12
|
+
insertText: (text: string, resetContent?: boolean, customPositions?: CustomPositionProps) => void;
|
|
9
13
|
}
|
|
10
14
|
export type CursorPosition = Pick<Position, 'ch' | 'line'>;
|
|
11
|
-
export interface
|
|
15
|
+
export interface ErrorRange {
|
|
16
|
+
line: number;
|
|
17
|
+
ch: number;
|
|
18
|
+
}
|
|
19
|
+
export interface LintError {
|
|
20
|
+
from: Position;
|
|
21
|
+
to: Position;
|
|
22
|
+
message: string;
|
|
23
|
+
}
|
|
24
|
+
export interface CodeEditorProps extends TestIdProp {
|
|
12
25
|
/** Default expression to set in the code editor */
|
|
13
26
|
defaultValue?: string;
|
|
14
27
|
/** Compiled error message */
|
|
@@ -16,17 +29,30 @@ export interface CodeEditorProps {
|
|
|
16
29
|
/** Enable read only mode */
|
|
17
30
|
readOnly?: boolean;
|
|
18
31
|
/** Fetches suggestion list for suggestions popover */
|
|
19
|
-
fetchSuggestions?: (autoCompleteTrigger: AutoCompleteTriggerChar, cursorPosition: CursorPosition) => Promise<SuggestionType[]>;
|
|
32
|
+
fetchSuggestions?: (autoCompleteTrigger: AutoCompleteTriggerChar, cursorPosition: CursorPosition) => Promise<SuggestionType[] | undefined>;
|
|
20
33
|
/** characters which triggers suggestions */
|
|
21
34
|
autoCompleteTriggers?: AutoCompleteTriggerChar[];
|
|
22
35
|
/** Code editor configuration props */
|
|
23
36
|
editorConfigProps?: EditorConfiguration;
|
|
24
37
|
/** To show loader for intellisense popover */
|
|
25
38
|
loading?: boolean;
|
|
39
|
+
/** Called when editor loses the focus */
|
|
40
|
+
onBlur?: (expression: string) => void;
|
|
26
41
|
/** Called when editor content changes. */
|
|
27
|
-
onChange?: (expression: string) => void;
|
|
42
|
+
onChange?: (expression: string, errors?: LintError[], source?: string) => void;
|
|
43
|
+
/** underlined error message */
|
|
44
|
+
inLineErrors?: {
|
|
45
|
+
start: ErrorRange;
|
|
46
|
+
end: ErrorRange;
|
|
47
|
+
messages: string[];
|
|
48
|
+
}[];
|
|
49
|
+
/** For single line code editor rendering */
|
|
50
|
+
isSingleLine?: boolean;
|
|
28
51
|
codeEditorHandle: Ref<EditorState>;
|
|
29
52
|
ref?: Ref<HTMLDivElement>;
|
|
53
|
+
showEditorOnly?: boolean;
|
|
54
|
+
/** Information to announce to screen reader users on focusing CodeEditor. */
|
|
55
|
+
'aria-describedby'?: string;
|
|
30
56
|
}
|
|
31
57
|
export interface EditorHintOptions extends ShowHintOptions {
|
|
32
58
|
suggestions?: SuggestionType[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CodeEditor.types.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEjF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"CodeEditor.types.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeE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":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Ref } from 'react';\nimport type { ShowHintOptions, EditorConfiguration, Position } from 'codemirror';\n\nimport type { MenuItemProps } from '@pega/cosmos-react-core';\n\nexport type AutoCompleteTriggerChar = '@' | '.' | ':';\n\nexport type SuggestionType = Pick<MenuItemProps, 'primary' | 'secondary' | 'id'>;\n\nexport interface EditorState {\n getValue: () => string | undefined;\n insertText: (text: string) => void;\n}\n\nexport type CursorPosition = Pick<Position, 'ch' | 'line'>;\n\nexport interface CodeEditorProps {\n /** Default expression to set in the code editor */\n defaultValue?: string;\n /** Compiled error message */\n errors?: string;\n /** Enable read only mode */\n readOnly?: boolean;\n /** Fetches suggestion list for suggestions popover */\n fetchSuggestions?: (\n autoCompleteTrigger: AutoCompleteTriggerChar,\n cursorPosition: CursorPosition\n ) => Promise<SuggestionType[]>;\n /** characters which triggers suggestions */\n autoCompleteTriggers?: AutoCompleteTriggerChar[];\n /** Code editor configuration props */\n editorConfigProps?: EditorConfiguration;\n /** To show loader for intellisense popover */\n loading?: boolean;\n /** Called when editor content changes. */\n onChange?: (expression: string) => void;\n codeEditorHandle: Ref<EditorState>;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport interface EditorHintOptions extends ShowHintOptions {\n suggestions?: SuggestionType[];\n loading?: boolean;\n triggerCharacterCursorPos?: Position;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"CodeEditor.types.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/CodeEditor.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Ref } from 'react';\nimport type { ShowHintOptions, EditorConfiguration, Position } from 'codemirror';\n\nimport type { MenuItemProps, TestIdProp } from '@pega/cosmos-react-core';\n\nexport type AutoCompleteTriggerChar = '@' | '.' | ':' | '#' | '(' | ')' | '[' | ']';\n\nexport type SuggestionType = Pick<MenuItemProps, 'primary' | 'secondary' | 'id'>;\n\nexport interface CustomPositionProps {\n start?: Position;\n end?: Position;\n}\n\nexport interface EditorState {\n getValue: () => string | undefined;\n insertText: (text: string, resetContent?: boolean, customPositions?: CustomPositionProps) => void;\n}\n\nexport type CursorPosition = Pick<Position, 'ch' | 'line'>;\n\nexport interface ErrorRange {\n line: number;\n ch: number;\n}\n\nexport interface LintError {\n from: Position;\n to: Position;\n message: string;\n}\n\nexport interface CodeEditorProps extends TestIdProp {\n /** Default expression to set in the code editor */\n defaultValue?: string;\n /** Compiled error message */\n errors?: string;\n /** Enable read only mode */\n readOnly?: boolean;\n /** Fetches suggestion list for suggestions popover */\n fetchSuggestions?: (\n autoCompleteTrigger: AutoCompleteTriggerChar,\n cursorPosition: CursorPosition\n ) => Promise<SuggestionType[] | undefined>;\n /** characters which triggers suggestions */\n autoCompleteTriggers?: AutoCompleteTriggerChar[];\n /** Code editor configuration props */\n editorConfigProps?: EditorConfiguration;\n /** To show loader for intellisense popover */\n loading?: boolean;\n /** Called when editor loses the focus */\n onBlur?: (expression: string) => void;\n /** Called when editor content changes. */\n onChange?: (expression: string, errors?: LintError[], source?: string) => void;\n /** underlined error message */\n inLineErrors?: { start: ErrorRange; end: ErrorRange; messages: string[] }[];\n /** For single line code editor rendering */\n isSingleLine?: boolean;\n codeEditorHandle: Ref<EditorState>;\n ref?: Ref<HTMLDivElement>;\n showEditorOnly?: boolean;\n /** Information to announce to screen reader users on focusing CodeEditor. */\n 'aria-describedby'?: string;\n}\n\nexport interface EditorHintOptions extends ShowHintOptions {\n suggestions?: SuggestionType[];\n loading?: boolean;\n triggerCharacterCursorPos?: Position;\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCodeSuggestions.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAKzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,QAAA,MAAM,kBAAkB,eACV,MAAM,uDAQf,iBAAiB;;cASZ,MAAM;qBACC,MAAM;gBACX,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI;;;;
|
|
1
|
+
{"version":3,"file":"getCodeSuggestions.d.ts","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAKzC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAG5D,QAAA,MAAM,kBAAkB,eACV,MAAM,uDAQf,iBAAiB;;cASZ,MAAM;qBACC,MAAM;gBACX,CAAC,OAAO,EAAE,aAAa,KAAK,IAAI;;;;CA+C3C,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCodeSuggestions.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.tsx"],"names":[],"mappings":";;AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,QAAQ,MAAM,sDAAsD,CAAC;AAG5E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,kBAAkB,GAAG,CACzB,UAAkB,EAClB,EACE,WAAW,GAAG,EAAE,EAChB,OAAO,GAAG,KAAK,EACf,yBAAyB,GAAG;IAC1B,EAAE,EAAE,CAAC;IACL,IAAI,EAAE,CAAC;CACR,EACiB,EACpB,EAAE;IACF,MAAM,eAAe,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC;IAC/C,MAAM,WAAW,GAAG,UAAU;SAC3B,QAAQ,EAAE;SACV,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AW,EAAE,CAAC,CAAC,CAAC;IAC1F,CAAC;IAED,OAAO;QACL,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,GAAG,CAAC,eAAe,CAAC,IAAI,EAAE,yBAAyB,CAAC,EAAE,GAAG,CAAC,CAAC;QACjE,EAAE,EAAE,GAAG,CAAC,eAAe,CAAC,IAAI,EAAE,eAAe,CAAC,EAAE,CAAC;KAClD,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import ReactDOM from 'react-dom';\nimport { Pos } from 'codemirror';\nimport type { Editor } from 'codemirror';\n\nimport { Progress, Flex, EmptyState } from '@pega/cosmos-react-core';\nimport MenuItem from '@pega/cosmos-react-core/lib/components/Menu/MenuItem';\n\nimport type { EditorHintOptions } from './CodeEditor.types';\nimport { StyledLoading } from './CodeEditor.styles';\n\nconst getCodeSuggestions = (\n codeMirror: Editor,\n {\n suggestions = [],\n loading = false,\n triggerCharacterCursorPos = {\n ch: 0,\n line: 0\n }\n }: EditorHintOptions\n) => {\n const currentPosition = codeMirror.getCursor();\n const filterQuery = codeMirror\n .getValue()\n .split('\\n')\n [triggerCharacterCursorPos.line]?.substring(triggerCharacterCursorPos.ch, currentPosition.ch);\n\n let filteredList: {\n text: string;\n displayText: string;\n render: (element: HTMLLIElement) => void;\n }[] = [];\n\n if (loading || suggestions.length === 0) {\n filteredList = [\n {\n text: '',\n displayText: '',\n render: (element: HTMLLIElement) => {\n ReactDOM.render(\n <Flex\n container={{\n justify: 'center',\n pad: 1\n }}\n >\n {loading ? (\n <Progress variant='ring' placement='inline' visible={loading} as={StyledLoading} />\n ) : (\n <EmptyState />\n )}\n </Flex>,\n element\n );\n }\n }\n ];\n } else {\n filteredList = suggestions\n .map(hint => {\n return {\n text: hint.id,\n displayText: hint.primary,\n render: (element: HTMLLIElement) => {\n ReactDOM.render(<MenuItem {...hint} key={hint.id} role='menuitem' />, element);\n }\n };\n })\n .filter(item => item.displayText.toLowerCase().startsWith(filterQuery.toLowerCase()));\n }\n\n return {\n list: filteredList,\n from: Pos(currentPosition.line, triggerCharacterCursorPos.ch - 1),\n to: Pos(currentPosition.line, currentPosition.ch)\n };\n};\n\nexport default getCodeSuggestions;\n"]}
|
|
1
|
+
{"version":3,"file":"getCodeSuggestions.js","sourceRoot":"","sources":["../../../../src/components/ExpressionBuilder/CodeEditor/getCodeSuggestions.tsx"],"names":[],"mappings":";;AAAA,OAAO,QAAQ,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAGjC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,QAAQ,MAAM,sDAAsD,CAAC;AAG5E,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,kBAAkB,GAAG,CACzB,UAAkB,EAClB,EACE,WAAW,GAAG,EAAE,EAChB,OAAO,GAAG,KAAK,EACf,yBAAyB,GAAG;IAC1B,EAAE,EAAE,CAAC;IACL,IAAI,EAAE,CAAC;CACR,EACiB,EACpB,EAAE;IACF,MAAM,eAAe,GAAG,UAAU,CAAC,SAAS,EAAE,CAAC;IAC/C,MAAM,WAAW,GAAG,UAAU;SAC3B,QAAQ,EAAE;SACV,KAAK,CAAC,IAAI,CAAC,CACX,yBAAyB,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,yBAAyB,CAAC,EAAE,EAAE,eAAe,CAAC,EAAE,CAAC,CAAC;IAEhG,IAAI,YAAY,GAIV,EAAE,CAAC;IAET,IAAI,OAAO,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxC,YAAY,GAAG;YACb;gBACE,IAAI,EAAE,EAAE;gBACR,WAAW,EAAE,EAAE;gBACf,MAAM,EAAE,CAAC,OAAsB,EAAE,EAAE;oBACjC,OAAO,CAAC,KAAK,CAAC,aAAa,GAAG,MAAM,CAAC;oBACrC,QAAQ,CAAC,MAAM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\n\nimport { Progress, Flex, EmptyState } from '@pega/cosmos-react-core';\nimport MenuItem from '@pega/cosmos-react-core/lib/components/Menu/MenuItem';\n\nimport type { EditorHintOptions } from './CodeEditor.types';\nimport { StyledLoading } from './CodeEditor.styles';\n\nconst getCodeSuggestions = (\n codeMirror: Editor,\n {\n suggestions = [],\n loading = false,\n triggerCharacterCursorPos = {\n ch: 0,\n line: 0\n }\n }: EditorHintOptions\n) => {\n const currentPosition = codeMirror.getCursor();\n const filterQuery = codeMirror\n .getValue()\n .split('\\n')\n [triggerCharacterCursorPos.line]?.substring(triggerCharacterCursorPos.ch, currentPosition.ch);\n\n let filteredList: {\n text: string;\n displayText: string;\n render: (element: HTMLLIElement) => void;\n }[] = [];\n\n if (loading || suggestions.length === 0) {\n filteredList = [\n {\n text: '',\n displayText: '',\n render: (element: HTMLLIElement) => {\n element.style.pointerEvents = 'none';\n ReactDOM.render(\n <Flex\n container={{\n justify: 'center',\n pad: 1\n }}\n >\n {loading ? (\n <Progress variant='ring' placement='inline' visible={loading} as={StyledLoading} />\n ) : (\n <EmptyState />\n )}\n </Flex>,\n element\n );\n }\n }\n ];\n } else {\n filteredList = suggestions\n .map(hint => {\n return {\n text: hint.id,\n displayText: hint.primary,\n render: (element: HTMLLIElement) => {\n ReactDOM.render(<MenuItem {...hint} key={hint.id} role='menuitem' />, element);\n }\n };\n })\n .filter(item => item.displayText.toLowerCase().startsWith(filterQuery.toLowerCase()));\n }\n\n return {\n list: filteredList,\n from: Pos(currentPosition.line, triggerCharacterCursorPos.ch - 1),\n to: Pos(currentPosition.line, currentPosition.ch)\n };\n};\n\nexport default getCodeSuggestions;\n"]}
|