@eccenca/gui-elements 25.0.0 → 25.1.0-changeupgradedtoreact18cmem6639.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/CHANGELOG.md +124 -0
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js +30 -26
- package/dist/cjs/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/cjs/cmem/ActivityControl/ActivityExecutionErrorReportModal.js +11 -5
- package/dist/cjs/cmem/ActivityControl/ActivityExecutionErrorReportModal.js.map +1 -1
- package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js +1 -3
- package/dist/cjs/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
- package/dist/cjs/cmem/ContentBlobToggler/ContentBlobToggler.js +13 -6
- package/dist/cjs/cmem/ContentBlobToggler/ContentBlobToggler.js.map +1 -1
- package/dist/cjs/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js +49 -11
- package/dist/cjs/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js.map +1 -1
- package/dist/cjs/cmem/markdown/Markdown.js +2 -2
- package/dist/cjs/cmem/markdown/Markdown.js.map +1 -1
- package/dist/cjs/cmem/react-flow/ReactFlow/ReactFlowV12.js.map +1 -1
- package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +1 -1
- package/dist/cjs/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -1
- package/dist/cjs/cmem/react-flow/configuration/graph.js +0 -2
- package/dist/cjs/cmem/react-flow/configuration/graph.js.map +1 -1
- package/dist/cjs/cmem/react-flow/configuration/linking.js +0 -2
- package/dist/cjs/cmem/react-flow/configuration/linking.js.map +1 -1
- package/dist/cjs/cmem/react-flow/configuration/workflow.js +0 -2
- package/dist/cjs/cmem/react-flow/configuration/workflow.js.map +1 -1
- package/dist/cjs/common/Intent/index.js +1 -1
- package/dist/cjs/common/Intent/index.js.map +1 -1
- package/dist/cjs/common/index.js +1 -0
- package/dist/cjs/common/index.js.map +1 -1
- package/dist/cjs/common/utils/CssCustomProperties.js.map +1 -1
- package/dist/cjs/common/utils/colorHash.js +26 -12
- package/dist/cjs/common/utils/colorHash.js.map +1 -1
- package/dist/cjs/components/Application/ApplicationSidebarNavigation.js.map +1 -1
- package/dist/cjs/components/Application/ApplicationTitle.js +5 -1
- package/dist/cjs/components/Application/ApplicationTitle.js.map +1 -1
- package/dist/cjs/components/Application/ApplicationViewability.js +33 -0
- package/dist/cjs/components/Application/ApplicationViewability.js.map +1 -0
- package/dist/cjs/components/Application/index.js +1 -0
- package/dist/cjs/components/Application/index.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/cjs/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js +2 -9
- package/dist/cjs/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/cjs/components/AutocompleteField/autoCompleteFieldUtils.js.map +1 -1
- package/dist/cjs/components/Button/Button.js +6 -2
- package/dist/cjs/components/Button/Button.js.map +1 -1
- package/dist/cjs/components/ColorField/ColorField.js +114 -0
- package/dist/cjs/components/ColorField/ColorField.js.map +1 -0
- package/dist/cjs/components/ContentGroup/ContentGroup.js +19 -19
- package/dist/cjs/components/ContentGroup/ContentGroup.js.map +1 -1
- package/dist/cjs/components/ContextOverlay/ContextMenu.js +4 -4
- package/dist/cjs/components/ContextOverlay/ContextMenu.js.map +1 -1
- package/dist/cjs/components/ContextOverlay/ContextOverlay.js +3 -2
- package/dist/cjs/components/ContextOverlay/ContextOverlay.js.map +1 -1
- package/dist/cjs/components/DecoupledOverlay/DecoupledOverlay.js +48 -0
- package/dist/cjs/components/DecoupledOverlay/DecoupledOverlay.js.map +1 -0
- package/dist/cjs/components/Icon/IconButton.js +2 -2
- package/dist/cjs/components/Icon/IconButton.js.map +1 -1
- package/dist/cjs/components/Icon/canonicalIconNames.js +10 -1
- package/dist/cjs/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/cjs/components/Icon/transformIcon.js +14 -0
- package/dist/cjs/components/Icon/transformIcon.js.map +1 -0
- package/dist/cjs/components/MultiSelect/MultiSelect.js +63 -24
- package/dist/cjs/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/cjs/components/NotAvailable/NotAvailable.js +42 -0
- package/dist/cjs/components/NotAvailable/NotAvailable.js.map +1 -0
- package/dist/cjs/components/Notification/Notification.js.map +1 -1
- package/dist/cjs/components/OverviewItem/OverviewItemDepiction.js.map +1 -1
- package/dist/cjs/components/RadioButton/RadioButton.js +5 -2
- package/dist/cjs/components/RadioButton/RadioButton.js.map +1 -1
- package/dist/cjs/components/Select/Select.js +6 -4
- package/dist/cjs/components/Select/Select.js.map +1 -1
- package/dist/cjs/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/cjs/components/Table/Table.js.map +1 -1
- package/dist/cjs/components/Table/TableContainer.js +1 -1
- package/dist/cjs/components/Table/TableContainer.js.map +1 -1
- package/dist/cjs/components/Table/TableExpandRow.js +2 -2
- package/dist/cjs/components/Table/TableExpandRow.js.map +1 -1
- package/dist/cjs/components/TextField/useTextValidation.js +17 -8
- package/dist/cjs/components/TextField/useTextValidation.js.map +1 -1
- package/dist/cjs/components/Tooltip/Tooltip.js +11 -7
- package/dist/cjs/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/cjs/components/Typography/InlineText.js +29 -0
- package/dist/cjs/components/Typography/InlineText.js.map +1 -0
- package/dist/cjs/components/Typography/index.js +1 -0
- package/dist/cjs/components/Typography/index.js.map +1 -1
- package/dist/cjs/components/VisualTour/VisualTour.js +30 -36
- package/dist/cjs/components/VisualTour/VisualTour.js.map +1 -1
- package/dist/cjs/components/index.js +3 -0
- package/dist/cjs/components/index.js.map +1 -1
- package/dist/cjs/extensions/codemirror/CodeMirror.js +59 -21
- package/dist/cjs/extensions/codemirror/CodeMirror.js.map +1 -1
- package/dist/cjs/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js +1 -1
- package/dist/cjs/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js.map +1 -1
- package/dist/cjs/extensions/codemirror/tests/codemirrorTestHelper.js +2 -2
- package/dist/cjs/extensions/codemirror/tests/codemirrorTestHelper.js.map +1 -1
- package/dist/cjs/extensions/codemirror/toolbars/EditorAppearanceConfigMenu.js +23 -0
- package/dist/cjs/extensions/codemirror/toolbars/EditorAppearanceConfigMenu.js.map +1 -0
- package/dist/cjs/extensions/codemirror/toolbars/markdown.toolbar.js +5 -2
- package/dist/cjs/extensions/codemirror/toolbars/markdown.toolbar.js.map +1 -1
- package/dist/cjs/extensions/react-flow/edges/EdgeLabel.js +8 -3
- package/dist/cjs/extensions/react-flow/edges/EdgeLabel.js.map +1 -1
- package/dist/cjs/extensions/react-flow/edges/EdgeNew.js +6 -4
- package/dist/cjs/extensions/react-flow/edges/EdgeNew.js.map +1 -1
- package/dist/cjs/extensions/react-flow/edges/EdgeTools.js +2 -2
- package/dist/cjs/extensions/react-flow/edges/EdgeTools.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleContent.js +5 -2
- package/dist/cjs/extensions/react-flow/handles/HandleContent.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/handles/HandleTools.js +2 -2
- package/dist/cjs/extensions/react-flow/handles/HandleTools.js.map +1 -1
- package/dist/cjs/extensions/react-flow/markers/ReactFlowMarkers.js.map +1 -1
- package/dist/cjs/extensions/react-flow/minimap/MiniMap.js +1 -1
- package/dist/cjs/extensions/react-flow/minimap/MiniMap.js.map +1 -1
- package/dist/cjs/extensions/react-flow/minimap/MiniMapV12.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js +7 -5
- package/dist/cjs/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/NodeDefault.js +5 -2
- package/dist/cjs/extensions/react-flow/nodes/NodeDefault.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/NodeTools.js +6 -2
- package/dist/cjs/extensions/react-flow/nodes/NodeTools.js.map +1 -1
- package/dist/cjs/extensions/react-flow/nodes/nodeUtils.js.map +1 -1
- package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js +19 -14
- package/dist/esm/cmem/ActivityControl/ActivityControlWidget.js.map +1 -1
- package/dist/esm/cmem/ActivityControl/ActivityExecutionErrorReportModal.js +4 -1
- package/dist/esm/cmem/ActivityControl/ActivityExecutionErrorReportModal.js.map +1 -1
- package/dist/esm/cmem/ActivityControl/SilkActivityControl.js +1 -3
- package/dist/esm/cmem/ActivityControl/SilkActivityControl.js.map +1 -1
- package/dist/esm/cmem/ContentBlobToggler/ContentBlobToggler.js +9 -5
- package/dist/esm/cmem/ContentBlobToggler/ContentBlobToggler.js.map +1 -1
- package/dist/esm/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js +57 -9
- package/dist/esm/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.js.map +1 -1
- package/dist/esm/cmem/markdown/Markdown.js +1 -1
- package/dist/esm/cmem/markdown/Markdown.js.map +1 -1
- package/dist/esm/cmem/react-flow/ReactFlow/ReactFlowV12.js.map +1 -1
- package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js +1 -1
- package/dist/esm/cmem/react-flow/StickyNoteModal/StickyNoteModal.js.map +1 -1
- package/dist/esm/cmem/react-flow/configuration/graph.js +0 -2
- package/dist/esm/cmem/react-flow/configuration/graph.js.map +1 -1
- package/dist/esm/cmem/react-flow/configuration/linking.js +0 -2
- package/dist/esm/cmem/react-flow/configuration/linking.js.map +1 -1
- package/dist/esm/cmem/react-flow/configuration/workflow.js +0 -2
- package/dist/esm/cmem/react-flow/configuration/workflow.js.map +1 -1
- package/dist/esm/common/Intent/index.js +1 -1
- package/dist/esm/common/Intent/index.js.map +1 -1
- package/dist/esm/common/index.js +2 -1
- package/dist/esm/common/index.js.map +1 -1
- package/dist/esm/common/utils/CssCustomProperties.js.map +1 -1
- package/dist/esm/common/utils/colorHash.js +26 -13
- package/dist/esm/common/utils/colorHash.js.map +1 -1
- package/dist/esm/common/utils/reduceToText.js +1 -1
- package/dist/esm/components/Application/ApplicationSidebarNavigation.js.map +1 -1
- package/dist/esm/components/Application/ApplicationTitle.js +5 -1
- package/dist/esm/components/Application/ApplicationTitle.js.map +1 -1
- package/dist/esm/components/Application/ApplicationViewability.js +28 -0
- package/dist/esm/components/Application/ApplicationViewability.js.map +1 -0
- package/dist/esm/components/Application/index.js +1 -0
- package/dist/esm/components/Application/index.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestion.js.map +1 -1
- package/dist/esm/components/AutoSuggestion/AutoSuggestionList.js.map +1 -1
- package/dist/esm/components/AutocompleteField/AutoCompleteField.js +9 -16
- package/dist/esm/components/AutocompleteField/AutoCompleteField.js.map +1 -1
- package/dist/esm/components/AutocompleteField/autoCompleteFieldUtils.js.map +1 -1
- package/dist/esm/components/Button/Button.js +6 -2
- package/dist/esm/components/Button/Button.js.map +1 -1
- package/dist/esm/components/ColorField/ColorField.js +140 -0
- package/dist/esm/components/ColorField/ColorField.js.map +1 -0
- package/dist/esm/components/ContentGroup/ContentGroup.js +1 -1
- package/dist/esm/components/ContentGroup/ContentGroup.js.map +1 -1
- package/dist/esm/components/ContextOverlay/ContextMenu.js +4 -4
- package/dist/esm/components/ContextOverlay/ContextMenu.js.map +1 -1
- package/dist/esm/components/ContextOverlay/ContextOverlay.js +3 -2
- package/dist/esm/components/ContextOverlay/ContextOverlay.js.map +1 -1
- package/dist/esm/components/DecoupledOverlay/DecoupledOverlay.js +42 -0
- package/dist/esm/components/DecoupledOverlay/DecoupledOverlay.js.map +1 -0
- package/dist/esm/components/Icon/IconButton.js +2 -2
- package/dist/esm/components/Icon/IconButton.js.map +1 -1
- package/dist/esm/components/Icon/canonicalIconNames.js +10 -1
- package/dist/esm/components/Icon/canonicalIconNames.js.map +1 -1
- package/dist/esm/components/Icon/transformIcon.js +21 -0
- package/dist/esm/components/Icon/transformIcon.js.map +1 -0
- package/dist/esm/components/MultiSelect/MultiSelect.js +66 -27
- package/dist/esm/components/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/esm/components/NotAvailable/NotAvailable.js +46 -0
- package/dist/esm/components/NotAvailable/NotAvailable.js.map +1 -0
- package/dist/esm/components/Notification/Notification.js.map +1 -1
- package/dist/esm/components/OverviewItem/OverviewItemDepiction.js.map +1 -1
- package/dist/esm/components/RadioButton/RadioButton.js +6 -2
- package/dist/esm/components/RadioButton/RadioButton.js.map +1 -1
- package/dist/esm/components/Select/Select.js +3 -1
- package/dist/esm/components/Select/Select.js.map +1 -1
- package/dist/esm/components/Skeleton/Skeleton.js.map +1 -1
- package/dist/esm/components/Table/Table.js.map +1 -1
- package/dist/esm/components/Table/TableContainer.js +1 -1
- package/dist/esm/components/Table/TableContainer.js.map +1 -1
- package/dist/esm/components/Table/TableExpandRow.js +1 -1
- package/dist/esm/components/Table/TableExpandRow.js.map +1 -1
- package/dist/esm/components/TextField/useTextValidation.js +39 -8
- package/dist/esm/components/TextField/useTextValidation.js.map +1 -1
- package/dist/esm/components/Tooltip/Tooltip.js +11 -7
- package/dist/esm/components/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/components/Typography/InlineText.js +33 -0
- package/dist/esm/components/Typography/InlineText.js.map +1 -0
- package/dist/esm/components/Typography/index.js +1 -0
- package/dist/esm/components/Typography/index.js.map +1 -1
- package/dist/esm/components/VisualTour/VisualTour.js +31 -37
- package/dist/esm/components/VisualTour/VisualTour.js.map +1 -1
- package/dist/esm/components/index.js +3 -0
- package/dist/esm/components/index.js.map +1 -1
- package/dist/esm/extensions/codemirror/CodeMirror.js +62 -24
- package/dist/esm/extensions/codemirror/CodeMirror.js.map +1 -1
- package/dist/esm/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js +1 -1
- package/dist/esm/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.js.map +1 -1
- package/dist/esm/extensions/codemirror/tests/codemirrorTestHelper.js +3 -3
- package/dist/esm/extensions/codemirror/tests/codemirrorTestHelper.js.map +1 -1
- package/dist/esm/extensions/codemirror/toolbars/EditorAppearanceConfigMenu.js +47 -0
- package/dist/esm/extensions/codemirror/toolbars/EditorAppearanceConfigMenu.js.map +1 -0
- package/dist/esm/extensions/codemirror/toolbars/markdown.toolbar.js +16 -2
- package/dist/esm/extensions/codemirror/toolbars/markdown.toolbar.js.map +1 -1
- package/dist/esm/extensions/react-flow/edges/EdgeLabel.js +4 -2
- package/dist/esm/extensions/react-flow/edges/EdgeLabel.js.map +1 -1
- package/dist/esm/extensions/react-flow/edges/EdgeNew.js +3 -1
- package/dist/esm/extensions/react-flow/edges/EdgeNew.js.map +1 -1
- package/dist/esm/extensions/react-flow/edges/EdgeTools.js +1 -1
- package/dist/esm/extensions/react-flow/edges/EdgeTools.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleContent.js +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleContent.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleDefault.js.map +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleTools.js +1 -1
- package/dist/esm/extensions/react-flow/handles/HandleTools.js.map +1 -1
- package/dist/esm/extensions/react-flow/markers/ReactFlowMarkers.js.map +1 -1
- package/dist/esm/extensions/react-flow/minimap/MiniMap.js +1 -1
- package/dist/esm/extensions/react-flow/minimap/MiniMap.js.map +1 -1
- package/dist/esm/extensions/react-flow/minimap/MiniMapV12.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js +4 -2
- package/dist/esm/extensions/react-flow/nodes/NodeContent.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/NodeDefault.js +1 -1
- package/dist/esm/extensions/react-flow/nodes/NodeDefault.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/NodeTools.js +2 -1
- package/dist/esm/extensions/react-flow/nodes/NodeTools.js.map +1 -1
- package/dist/esm/extensions/react-flow/nodes/nodeUtils.js.map +1 -1
- package/dist/types/cmem/ActivityControl/ActivityControlWidget.d.ts +13 -4
- package/dist/types/cmem/ActivityControl/ActivityExecutionErrorReportModal.d.ts +1 -1
- package/dist/types/cmem/ActivityControl/SilkActivityControl.d.ts +4 -4
- package/dist/types/cmem/ContentBlobToggler/ContentBlobToggler.d.ts +5 -1
- package/dist/types/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.d.ts +27 -11
- package/dist/types/cmem/markdown/Markdown.d.ts +2 -1
- package/dist/types/cmem/react-flow/configuration/graph.d.ts +2 -1
- package/dist/types/cmem/react-flow/configuration/linking.d.ts +2 -1
- package/dist/types/cmem/react-flow/configuration/workflow.d.ts +2 -1
- package/dist/types/common/index.d.ts +2 -1
- package/dist/types/common/utils/CssCustomProperties.d.ts +2 -2
- package/dist/types/common/utils/colorHash.d.ts +5 -4
- package/dist/types/components/Accordion/AccordionItem.d.ts +1 -1
- package/dist/types/components/Application/ApplicationSidebarNavigation.d.ts +2 -0
- package/dist/types/components/Application/ApplicationViewability.d.ts +36 -0
- package/dist/types/components/Application/index.d.ts +1 -0
- package/dist/types/components/AutoSuggestion/AutoSuggestion.d.ts +2 -2
- package/dist/types/components/AutocompleteField/AutoCompleteField.d.ts +2 -12
- package/dist/types/components/AutocompleteField/autoCompleteFieldUtils.d.ts +1 -1
- package/dist/types/components/Button/Button.d.ts +3 -3
- package/dist/types/components/Card/CardHeader.d.ts +1 -1
- package/dist/types/components/ColorField/ColorField.d.ts +30 -0
- package/dist/types/components/ContentGroup/ContentGroup.d.ts +1 -1
- package/dist/types/components/ContextOverlay/ContextMenu.d.ts +9 -3
- package/dist/types/components/ContextOverlay/ContextOverlay.d.ts +8 -2
- package/dist/types/components/DecoupledOverlay/DecoupledOverlay.d.ts +22 -0
- package/dist/types/components/Depiction/Depiction.d.ts +1 -1
- package/dist/types/components/Dialog/SimpleDialog.d.ts +1 -1
- package/dist/types/components/Form/FieldItem.d.ts +1 -1
- package/dist/types/components/Form/FieldSet.d.ts +3 -3
- package/dist/types/components/HoverToggler/HoverToggler.d.ts +2 -2
- package/dist/types/components/Icon/IconButton.d.ts +1 -1
- package/dist/types/components/Icon/canonicalIconNames.d.ts +9 -1
- package/dist/types/components/Icon/transformIcon.d.ts +2 -0
- package/dist/types/components/Label/Label.d.ts +3 -3
- package/dist/types/components/Menu/MenuItem.d.ts +1 -1
- package/dist/types/components/MultiSelect/MultiSelect.d.ts +17 -5
- package/dist/types/components/NotAvailable/NotAvailable.d.ts +32 -0
- package/dist/types/components/Notification/Notification.d.ts +2 -2
- package/dist/types/components/OverviewItem/OverviewItemActions.d.ts +1 -1
- package/dist/types/components/PropertyValuePair/PropertyValueList.d.ts +1 -1
- package/dist/types/components/RadioButton/RadioButton.d.ts +8 -2
- package/dist/types/components/Select/Select.d.ts +2 -1
- package/dist/types/components/Skeleton/Skeleton.d.ts +1 -1
- package/dist/types/components/Structure/TitleSubsection.d.ts +3 -6
- package/dist/types/components/SuggestField/index.d.ts +2 -2
- package/dist/types/components/Table/TableContainer.d.ts +3 -3
- package/dist/types/components/Tabs/Tab.d.ts +4 -10
- package/dist/types/components/Tabs/TabTitle.d.ts +1 -1
- package/dist/types/components/TextField/TextArea.d.ts +1 -1
- package/dist/types/components/Typography/InlineText.d.ts +13 -0
- package/dist/types/components/Typography/index.d.ts +1 -0
- package/dist/types/components/index.d.ts +3 -0
- package/dist/types/extensions/codemirror/CodeMirror.d.ts +12 -9
- package/dist/types/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.d.ts +1 -1
- package/dist/types/extensions/codemirror/tests/codemirrorTestHelper.d.ts +1 -1
- package/dist/types/extensions/codemirror/toolbars/EditorAppearanceConfigMenu.d.ts +24 -0
- package/dist/types/extensions/codemirror/toolbars/markdown.toolbar.d.ts +2 -0
- package/dist/types/extensions/react-flow/edges/EdgeLabel.d.ts +3 -3
- package/dist/types/extensions/react-flow/edges/EdgeTools.d.ts +1 -1
- package/dist/types/extensions/react-flow/handles/HandleContent.d.ts +2 -2
- package/dist/types/extensions/react-flow/handles/HandleTools.d.ts +2 -2
- package/dist/types/extensions/react-flow/nodes/NodeContent.d.ts +3 -3
- package/dist/types/extensions/react-flow/nodes/NodeTools.d.ts +2 -2
- package/package.json +65 -61
- package/src/_shame.scss +1 -35
- package/src/cmem/ActivityControl/ActivityControlWidget.stories.tsx +3 -8
- package/src/cmem/ActivityControl/ActivityControlWidget.tsx +74 -41
- package/src/cmem/ActivityControl/ActivityExecutionErrorReportModal.tsx +6 -4
- package/src/cmem/ActivityControl/SilkActivityControl.tsx +5 -5
- package/src/cmem/ContentBlobToggler/ContentBlobToggler.tsx +16 -6
- package/src/cmem/ContentBlobToggler/StringPreviewContentBlobToggler.tsx +72 -19
- package/src/cmem/ContentBlobToggler/stories/StringPreviewContentBlobToggler.stories.tsx +27 -0
- package/src/cmem/ContentBlobToggler/tests/StringPreviewContentBlobToggler.test.tsx +98 -0
- package/src/cmem/markdown/Markdown.stories.tsx +2 -2
- package/src/cmem/markdown/Markdown.tsx +2 -1
- package/src/cmem/markdown/markdown.scss +1 -1
- package/src/cmem/react-flow/ReactFlow/ReactFlowV12.tsx +1 -0
- package/src/cmem/react-flow/StickyNoteModal/StickyNoteModal.tsx +1 -1
- package/src/cmem/react-flow/configuration/graph.ts +2 -3
- package/src/cmem/react-flow/configuration/linking.ts +2 -3
- package/src/cmem/react-flow/configuration/workflow.ts +2 -3
- package/src/common/Intent/index.ts +2 -1
- package/src/common/index.ts +2 -1
- package/src/common/scss/_accessibility-defaults.scss +101 -0
- package/src/common/utils/CssCustomProperties.ts +5 -3
- package/src/common/utils/colorHash.ts +38 -20
- package/src/components/Accordion/AccordionItem.tsx +1 -1
- package/src/components/Accordion/Stories/AccordionItem.stories.tsx +1 -1
- package/src/components/Application/ApplicationSidebarNavigation.tsx +5 -2
- package/src/components/Application/ApplicationTitle.tsx +7 -1
- package/src/components/Application/ApplicationViewability.tsx +61 -0
- package/src/components/Application/_colors.scss +15 -0
- package/src/components/Application/_content.scss +7 -0
- package/src/components/Application/_header.scss +45 -21
- package/src/components/Application/_sidebar.scss +6 -0
- package/src/components/Application/_toolbar.scss +3 -3
- package/src/components/Application/_viewability.scss +13 -0
- package/src/components/Application/application.scss +1 -0
- package/src/components/Application/index.ts +1 -0
- package/src/components/Application/stories/ApplicationViewability.stories.tsx +37 -0
- package/src/components/Application/stories/ColorPalettes.stories.tsx +4 -3
- package/src/components/Application/tests/ApplicationViewability.test.tsx +43 -0
- package/src/components/AutoSuggestion/AutoSuggestion.scss +3 -1
- package/src/components/AutoSuggestion/AutoSuggestion.tsx +4 -4
- package/src/components/AutoSuggestion/AutoSuggestionList.tsx +1 -1
- package/src/components/AutoSuggestion/tests/ExtendedCodeEditor.test.tsx +1 -1
- package/src/components/AutocompleteField/AutoCompleteField.tsx +9 -18
- package/src/components/AutocompleteField/autoCompleteFieldUtils.tsx +1 -1
- package/src/components/Badge/Badge.stories.tsx +1 -1
- package/src/components/Badge/Badge.test.tsx +22 -0
- package/src/components/Breadcrumb/breadcrumb.scss +2 -2
- package/src/components/Button/Button.test.tsx +16 -2
- package/src/components/Button/Button.tsx +11 -6
- package/src/components/Button/button.scss +2 -0
- package/src/components/Card/CardHeader.tsx +1 -1
- package/src/components/Card/card.scss +6 -0
- package/src/components/Card/stories/Card.stories.tsx +1 -1
- package/src/components/Checkbox/Stories/Checkbox.stories.tsx +1 -1
- package/src/components/Checkbox/checkbox.scss +23 -3
- package/src/components/ColorField/ColorField.stories.tsx +72 -0
- package/src/components/ColorField/ColorField.test.tsx +101 -0
- package/src/components/ColorField/ColorField.tsx +200 -0
- package/src/components/ColorField/_colorfield.scss +67 -0
- package/src/components/ContentGroup/ContentGroup.stories.tsx +1 -1
- package/src/components/ContentGroup/ContentGroup.tsx +3 -3
- package/src/components/ContentGroup/_contentgroup.scss +9 -0
- package/src/components/ContextOverlay/ContextMenu.tsx +10 -4
- package/src/components/ContextOverlay/ContextOverlay.tsx +23 -4
- package/src/components/DecoupledOverlay/DecoupledOverlay.stories.tsx +30 -0
- package/src/components/DecoupledOverlay/DecoupledOverlay.tsx +100 -0
- package/src/components/DecoupledOverlay/_decoupledoverlay.scss +46 -0
- package/src/components/Depiction/Depiction.tsx +1 -1
- package/src/components/Depiction/depiction.scss +6 -0
- package/src/components/Dialog/SimpleDialog.tsx +1 -1
- package/src/components/Dialog/dialog.scss +10 -2
- package/src/components/Dialog/stories/Modal.stories.tsx +1 -1
- package/src/components/FlexibleLayout/flexiblelayout.scss +16 -0
- package/src/components/Form/FieldItem.tsx +1 -1
- package/src/components/Form/FieldSet.tsx +3 -3
- package/src/components/Form/Stories/FieldItem.stories.tsx +1 -1
- package/src/components/Form/Stories/FieldSet.stories.tsx +1 -1
- package/src/components/Form/form.scss +2 -2
- package/src/components/Grid/grid.scss +17 -0
- package/src/components/Grid/stories/Grid.stories.tsx +10 -7
- package/src/components/Grid/stories/GridColumn.stories.tsx +1 -1
- package/src/components/Grid/stories/GridRow.stories.tsx +14 -8
- package/src/components/HoverToggler/HoverToggler.tsx +2 -2
- package/src/components/Icon/IconButton.tsx +3 -3
- package/src/components/Icon/canonicalIconNames.tsx +11 -1
- package/src/components/Icon/stories/IconButton.stories.tsx +1 -1
- package/src/components/Icon/stories/TestIcon.stories.tsx +1 -1
- package/src/components/Icon/transformIcon.tsx +17 -0
- package/src/components/Label/Label.tsx +3 -3
- package/src/components/Link/Link.stories.tsx +30 -0
- package/src/components/Link/link.scss +33 -8
- package/src/components/Menu/MenuItem.tsx +1 -1
- package/src/components/Menu/Stories/MenuItem.stories.tsx +1 -1
- package/src/components/MultiSelect/MultiSelect.tsx +104 -32
- package/src/components/MultiSuggestField/MultiSuggestField.stories.tsx +40 -1
- package/src/components/MultiSuggestField/_multisuggestfield.scss +18 -0
- package/src/components/MultiSuggestField/tests/MultiSuggestField.test.tsx +89 -37
- package/src/components/NotAvailable/NotAvailable.stories.tsx +15 -0
- package/src/components/NotAvailable/NotAvailable.tsx +71 -0
- package/src/components/Notification/Notification.stories.tsx +2 -1
- package/src/components/Notification/Notification.tsx +3 -3
- package/src/components/Notification/notification.scss +6 -0
- package/src/components/OverviewItem/OverviewItemActions.tsx +1 -1
- package/src/components/OverviewItem/OverviewItemDepiction.tsx +1 -1
- package/src/components/OverviewItem/overviewitem.scss +9 -0
- package/src/components/OverviewItem/stories/OverviewItem.stories.tsx +29 -1
- package/src/components/OverviewItem/stories/OverviewItemActions.stories.tsx +3 -3
- package/src/components/OverviewItem/stories/OverviewItemDepiction.stories.tsx +1 -1
- package/src/components/OverviewItem/stories/OverviewItemDescription.stories.tsx +2 -2
- package/src/components/OverviewItem/stories/OverviewItemLine.stories.tsx +1 -1
- package/src/components/Pagination/Stories/Pagination.stories.tsx +32 -0
- package/src/components/Pagination/pagination.scss +55 -5
- package/src/components/PropertyValuePair/PropertyValueList.tsx +1 -1
- package/src/components/PropertyValuePair/propertyvalue.scss +23 -1
- package/src/components/RadioButton/RadioButton.tsx +15 -3
- package/src/components/RadioButton/Stories/RadioButton.stories.tsx +1 -1
- package/src/components/RadioButton/radiobutton.scss +18 -1
- package/src/components/Select/Select.tsx +8 -6
- package/src/components/Separation/separation.scss +6 -0
- package/src/components/Skeleton/Skeleton.tsx +2 -2
- package/src/components/Structure/TitleSubsection.tsx +1 -1
- package/src/components/Table/Table.tsx +1 -1
- package/src/components/Table/TableContainer.tsx +4 -4
- package/src/components/Table/TableExpandRow.tsx +1 -1
- package/src/components/Table/table.scss +22 -0
- package/src/components/Tabs/TabTitle.tsx +1 -1
- package/src/components/Tabs/stories/TabTitle.stories.tsx +7 -2
- package/src/components/Tabs/tabs.scss +2 -2
- package/src/components/Tag/stories/Tag.stories.tsx +1 -1
- package/src/components/Tag/stories/TagList.stories.tsx +3 -3
- package/src/components/Tag/tag.scss +19 -9
- package/src/components/TextField/TextArea.tsx +1 -1
- package/src/components/TextField/stories/TextArea.stories.tsx +1 -1
- package/src/components/TextField/stories/TextField.stories.tsx +24 -3
- package/src/components/TextField/tests/useTextValidation.test.tsx +83 -0
- package/src/components/TextField/textfield.scss +20 -0
- package/src/components/TextField/useTextValidation.ts +17 -8
- package/src/components/TextReducer/TextReducer.stories.tsx +4 -1
- package/src/components/TextReducer/TextReducer.test.tsx +3 -3
- package/src/components/Toolbar/toolbar.scss +1 -2
- package/src/components/Tooltip/Tooltip.test.tsx +40 -5
- package/src/components/Tooltip/Tooltip.tsx +15 -11
- package/src/components/Typography/InlineText.tsx +24 -0
- package/src/components/Typography/_reset.scss +2 -0
- package/src/components/Typography/index.ts +1 -0
- package/src/components/Typography/stories/InlineText.stories.tsx +27 -0
- package/src/components/Typography/typography.scss +37 -3
- package/src/components/VisualTour/VisualTour.tsx +35 -55
- package/src/components/VisualTour/visualTour.scss +0 -34
- package/src/components/index.scss +2 -0
- package/src/components/index.ts +3 -0
- package/src/configuration/_customproperties.scss +32 -0
- package/src/configuration/stories/customproperties.stories.tsx +122 -0
- package/src/extensions/codemirror/CodeMirror.stories.tsx +9 -4
- package/src/extensions/codemirror/CodeMirror.tsx +93 -37
- package/src/extensions/codemirror/_codemirror.scss +18 -28
- package/src/extensions/codemirror/hooks/useCodemirrorModeExtension.hooks.ts +1 -2
- package/src/extensions/codemirror/tests/CodeEditor.test.tsx +138 -0
- package/src/extensions/codemirror/tests/EditorAppearanceConfigMenu.test.tsx +131 -0
- package/src/extensions/codemirror/tests/codemirrorTestHelper.ts +3 -3
- package/src/extensions/codemirror/toolbars/EditorAppearanceConfigMenu.tsx +59 -0
- package/src/extensions/codemirror/toolbars/markdown.toolbar.tsx +17 -3
- package/src/extensions/react-flow/_config.scss +3 -3
- package/src/extensions/react-flow/_react-flow_v12.scss +1 -1
- package/src/extensions/react-flow/edges/EdgeLabel.tsx +15 -11
- package/src/extensions/react-flow/edges/EdgeNew.tsx +6 -6
- package/src/extensions/react-flow/edges/EdgeTools.tsx +5 -6
- package/src/extensions/react-flow/edges/_edges.scss +3 -2
- package/src/extensions/react-flow/edges/stories/EdgeLabel.stories.tsx +2 -1
- package/src/extensions/react-flow/handles/HandleContent.tsx +4 -4
- package/src/extensions/react-flow/handles/HandleDefault.tsx +3 -3
- package/src/extensions/react-flow/handles/HandleTools.tsx +3 -3
- package/src/extensions/react-flow/handles/_handles.scss +3 -3
- package/src/extensions/react-flow/markers/ReactFlowMarkers.tsx +1 -1
- package/src/extensions/react-flow/minimap/MiniMap.tsx +2 -1
- package/src/extensions/react-flow/minimap/MiniMapV12.tsx +1 -1
- package/src/extensions/react-flow/nodes/NodeContent.tsx +20 -19
- package/src/extensions/react-flow/nodes/NodeDefault.tsx +1 -1
- package/src/extensions/react-flow/nodes/NodeDefaultV12.tsx +1 -2
- package/src/extensions/react-flow/nodes/NodeTools.tsx +8 -8
- package/src/extensions/react-flow/nodes/_nodes.scss +4 -3
- package/src/extensions/react-flow/nodes/nodeUtils.tsx +1 -0
- package/src/extensions/react-flow/nodes/stories/NodeContent.stories.tsx +3 -1
- package/src/includes/carbon-components/_requisits.scss +3 -1
- package/src/index.scss +2 -0
- package/src/test/setupTests.js +1 -1
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { createPortal } from "react-dom";
|
|
3
|
-
import { Classes as BlueprintClasses } from "@blueprintjs/core";
|
|
4
|
-
import { createPopper } from "@popperjs/core";
|
|
5
3
|
|
|
6
4
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
7
5
|
import {
|
|
@@ -14,6 +12,7 @@ import {
|
|
|
14
12
|
CardHeader,
|
|
15
13
|
CardOptions,
|
|
16
14
|
CardTitle,
|
|
15
|
+
DecoupledOverlay,
|
|
17
16
|
IconButton,
|
|
18
17
|
Markdown,
|
|
19
18
|
ModalSize,
|
|
@@ -71,10 +70,6 @@ export const VisualTour = ({
|
|
|
71
70
|
usableStepTarget = false,
|
|
72
71
|
isOpen = false,
|
|
73
72
|
}: VisualTourProps) => {
|
|
74
|
-
if (isOpen === false) {
|
|
75
|
-
return null;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
73
|
const [currentStepIndex, setCurrentStepIndex] = React.useState<number>(0);
|
|
79
74
|
const [currentStepComponent, setCurrentStepComponent] = React.useState<React.JSX.Element | null>(null);
|
|
80
75
|
|
|
@@ -130,7 +125,7 @@ export const VisualTour = ({
|
|
|
130
125
|
<Button
|
|
131
126
|
key={"next"}
|
|
132
127
|
variant="outlined"
|
|
133
|
-
|
|
128
|
+
elevated
|
|
134
129
|
onClick={() => {
|
|
135
130
|
setCurrentStepIndex(currentStepIndex + 1);
|
|
136
131
|
}}
|
|
@@ -144,7 +139,7 @@ export const VisualTour = ({
|
|
|
144
139
|
text={closeLabel}
|
|
145
140
|
onClick={closeTour}
|
|
146
141
|
variant="outlined"
|
|
147
|
-
|
|
142
|
+
elevated
|
|
148
143
|
rightIcon={"navigation-close"}
|
|
149
144
|
/>
|
|
150
145
|
),
|
|
@@ -235,7 +230,11 @@ export const VisualTour = ({
|
|
|
235
230
|
};
|
|
236
231
|
}, [currentStepIndex, usableStepTarget]);
|
|
237
232
|
|
|
238
|
-
|
|
233
|
+
if (isOpen === false) {
|
|
234
|
+
return null;
|
|
235
|
+
} else {
|
|
236
|
+
return currentStepComponent;
|
|
237
|
+
}
|
|
239
238
|
};
|
|
240
239
|
|
|
241
240
|
interface StepModalProps {
|
|
@@ -292,25 +291,6 @@ interface StepPopoverProps {
|
|
|
292
291
|
|
|
293
292
|
/** Popover that is displayed and points at the highlighted element. */
|
|
294
293
|
const StepPopover = ({ highlightedElement, step, titleOption, actionButtons }: StepPopoverProps) => {
|
|
295
|
-
const tooltipRef = React.useCallback(
|
|
296
|
-
(tooltip: HTMLDivElement | null) => {
|
|
297
|
-
if (tooltip) {
|
|
298
|
-
createPopper(highlightedElement, tooltip, {
|
|
299
|
-
placement: "auto",
|
|
300
|
-
modifiers: [
|
|
301
|
-
{
|
|
302
|
-
name: "offset",
|
|
303
|
-
options: {
|
|
304
|
-
offset: [0, 15],
|
|
305
|
-
},
|
|
306
|
-
},
|
|
307
|
-
],
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
},
|
|
311
|
-
[highlightedElement]
|
|
312
|
-
);
|
|
313
|
-
|
|
314
294
|
const backdropRef = React.useCallback(
|
|
315
295
|
(backdrop: HTMLDivElement | null) => {
|
|
316
296
|
const highlightStencil = () => {
|
|
@@ -340,39 +320,39 @@ const StepPopover = ({ highlightedElement, step, titleOption, actionButtons }: S
|
|
|
340
320
|
[highlightedElement]
|
|
341
321
|
);
|
|
342
322
|
|
|
323
|
+
// map to only tooltip size because the `DecoupledOverlay` only supports them
|
|
324
|
+
let overlaySize: TooltipSize = "large";
|
|
325
|
+
switch (step.size) {
|
|
326
|
+
case "tiny":
|
|
327
|
+
overlaySize = "small";
|
|
328
|
+
break;
|
|
329
|
+
case "regular":
|
|
330
|
+
overlaySize = "medium";
|
|
331
|
+
break;
|
|
332
|
+
case "xlarge":
|
|
333
|
+
case "fullscreen":
|
|
334
|
+
overlaySize = "large";
|
|
335
|
+
break;
|
|
336
|
+
}
|
|
337
|
+
|
|
343
338
|
return createPortal(
|
|
344
339
|
<div className={`${eccgui}-visual-tour`}>
|
|
345
340
|
<div className={`${eccgui}-visual-tour__focushelper`} ref={backdropRef} />
|
|
346
341
|
<div>
|
|
347
342
|
<div className={`${eccgui}-visual-tour__backdrop`} />
|
|
348
343
|
</div>
|
|
349
|
-
<
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
aria-hidden
|
|
362
|
-
/>
|
|
363
|
-
<div className={`${BlueprintClasses.POPOVER_CONTENT} ${eccgui}-visual-tour__overlay__content`}>
|
|
364
|
-
<Card isOnlyLayout elevation={-1} whitespaceAmount="small">
|
|
365
|
-
<CardHeader>
|
|
366
|
-
<CardTitle>{step.title}</CardTitle>
|
|
367
|
-
<CardOptions>{titleOption}</CardOptions>
|
|
368
|
-
</CardHeader>
|
|
369
|
-
<CardContent>
|
|
370
|
-
<StepContent step={step} />
|
|
371
|
-
</CardContent>
|
|
372
|
-
<CardActions inverseDirection>{actionButtons}</CardActions>
|
|
373
|
-
</Card>
|
|
374
|
-
</div>
|
|
375
|
-
</div>
|
|
344
|
+
<DecoupledOverlay targetSelectorOrElement={highlightedElement} size={overlaySize} usePortal={false}>
|
|
345
|
+
<Card isOnlyLayout elevation={-1} whitespaceAmount="small">
|
|
346
|
+
<CardHeader>
|
|
347
|
+
<CardTitle>{step.title}</CardTitle>
|
|
348
|
+
<CardOptions>{titleOption}</CardOptions>
|
|
349
|
+
</CardHeader>
|
|
350
|
+
<CardContent>
|
|
351
|
+
<StepContent step={step} />
|
|
352
|
+
</CardContent>
|
|
353
|
+
<CardActions inverseDirection>{actionButtons}</CardActions>
|
|
354
|
+
</Card>
|
|
355
|
+
</DecoupledOverlay>
|
|
376
356
|
</div>,
|
|
377
357
|
document.body
|
|
378
358
|
);
|
|
@@ -31,40 +31,6 @@
|
|
|
31
31
|
opacity: 0;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
.#{$eccgui}-visual-tour__arrow {
|
|
35
|
-
&::before {
|
|
36
|
-
background: $card-background-color;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.#{$eccgui}-visual-tour__overlay[data-popper-placement="top"] & {
|
|
40
|
-
bottom: -0.5 * $eccgui-size-block-whitespace;
|
|
41
|
-
}
|
|
42
|
-
.#{$eccgui}-visual-tour__overlay[data-popper-placement="right"] & {
|
|
43
|
-
left: -0.5 * $eccgui-size-block-whitespace;
|
|
44
|
-
}
|
|
45
|
-
.#{$eccgui}-visual-tour__overlay[data-popper-placement="bottom"] & {
|
|
46
|
-
top: -0.5 * $eccgui-size-block-whitespace;
|
|
47
|
-
}
|
|
48
|
-
.#{$eccgui}-visual-tour__overlay[data-popper-placement="left"] & {
|
|
49
|
-
right: -0.5 * $eccgui-size-block-whitespace;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.#{$eccgui}-visual-tour__overlay {
|
|
54
|
-
z-index: 8002; // 2 over application header
|
|
55
|
-
&--small {
|
|
56
|
-
@extend .#{$eccgui}-tooltip--small;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
&--medium {
|
|
60
|
-
@extend .#{$eccgui}-tooltip--medium;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
&--large {
|
|
64
|
-
@extend .#{$eccgui}-tooltip--large;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
34
|
.#{$eccgui}-card__content {
|
|
69
35
|
.#{$eccgui}-visual-tour__overlay__content & {
|
|
70
36
|
max-height: 45vh;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
@import "./Card/card";
|
|
6
6
|
@import "./Chat/chat";
|
|
7
7
|
@import "./Checkbox/checkbox";
|
|
8
|
+
@import "./DecoupledOverlay/decoupledoverlay";
|
|
8
9
|
@import "./Depiction/depiction";
|
|
9
10
|
@import "./Dialog/dialog";
|
|
10
11
|
@import "./FlexibleLayout/flexiblelayout";
|
|
@@ -32,6 +33,7 @@
|
|
|
32
33
|
@import "./Tabs/tabs";
|
|
33
34
|
@import "./Tag/tag";
|
|
34
35
|
@import "./TextField/textfield";
|
|
36
|
+
@import "./ColorField/colorfield";
|
|
35
37
|
@import "./TagInput/taginput";
|
|
36
38
|
@import "./Toolbar/toolbar";
|
|
37
39
|
@import "./Tooltip/tooltip";
|
package/src/components/index.ts
CHANGED
|
@@ -7,8 +7,10 @@ export * from "./Card";
|
|
|
7
7
|
export * from "./Chat";
|
|
8
8
|
export * from "./Checkbox/Checkbox";
|
|
9
9
|
export * from "./CodeAutocompleteField";
|
|
10
|
+
export * from "./ColorField/ColorField";
|
|
10
11
|
export * from "./ContentGroup/ContentGroup";
|
|
11
12
|
export * from "./ContextOverlay";
|
|
13
|
+
export * from "./DecoupledOverlay/DecoupledOverlay";
|
|
12
14
|
export * from "./Depiction/Depiction";
|
|
13
15
|
export * from "./Dialog";
|
|
14
16
|
export * from "./FlexibleLayout";
|
|
@@ -23,6 +25,7 @@ export * from "./Link/Link";
|
|
|
23
25
|
export * from "./List/List";
|
|
24
26
|
export * from "./Menu";
|
|
25
27
|
export * from "./MultiSuggestField";
|
|
28
|
+
export * from "./NotAvailable/NotAvailable";
|
|
26
29
|
export * from "./Notification";
|
|
27
30
|
export * from "./OverviewItem";
|
|
28
31
|
export * from "./Pagination/Pagination";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* We mirror our SCSS variables here to improve availability in inline styles
|
|
3
|
+
* and module styles without included SCSS config stack.
|
|
4
|
+
* Colors are set in `src/components/Application/_colors.scss`.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
:root {
|
|
8
|
+
--#{$eccgui}-size-typo-caption: #{$eccgui-size-typo-caption};
|
|
9
|
+
--#{$eccgui}-size-typo-caption-lineheight: #{$eccgui-size-typo-caption-lineheight};
|
|
10
|
+
--#{$eccgui}-size-typo-text: #{$eccgui-size-typo-text};
|
|
11
|
+
--#{$eccgui}-size-typo-text-lineheight: #{$eccgui-size-typo-text-lineheight};
|
|
12
|
+
--#{$eccgui}-size-typo-subtitle: #{$eccgui-size-typo-subtitle};
|
|
13
|
+
--#{$eccgui}-size-typo-subtitle-lineheight: #{$eccgui-size-typo-subtitle-lineheight};
|
|
14
|
+
--#{$eccgui}-size-typo-title: #{$eccgui-size-typo-title};
|
|
15
|
+
--#{$eccgui}-size-typo-title-lineheight: #{$eccgui-size-typo-title-lineheight};
|
|
16
|
+
--#{$eccgui}-size-typo-headline: #{$eccgui-size-typo-headline};
|
|
17
|
+
--#{$eccgui}-size-typo-headline-lineheight: #{$eccgui-size-typo-headline-lineheight};
|
|
18
|
+
--#{$eccgui}-font-weight-light: #{$eccgui-font-weight-light};
|
|
19
|
+
--#{$eccgui}-font-weight-regular: #{$eccgui-font-weight-regular};
|
|
20
|
+
--#{$eccgui}-font-weight-bold: #{$eccgui-font-weight-bold};
|
|
21
|
+
--#{$eccgui}-font-spacing-condensed: #{$eccgui-font-spacing-condensed};
|
|
22
|
+
--#{$eccgui}-font-spacing-regular: #{$eccgui-font-spacing-regular};
|
|
23
|
+
--#{$eccgui}-font-spacing-wide: #{$eccgui-font-spacing-wide};
|
|
24
|
+
--#{$eccgui}-size-block-whitespace: #{$eccgui-size-block-whitespace};
|
|
25
|
+
--#{$eccgui}-size-inline-whitespace: #{$eccgui-size-inline-whitespace};
|
|
26
|
+
--#{$eccgui}-opacity-regular: #{$eccgui-opacity-regular};
|
|
27
|
+
--#{$eccgui}-opacity-narrow: #{$eccgui-opacity-narrow};
|
|
28
|
+
--#{$eccgui}-opacity-muted: #{$eccgui-opacity-muted};
|
|
29
|
+
--#{$eccgui}-opacity-disabled: #{$eccgui-opacity-disabled};
|
|
30
|
+
--#{$eccgui}-opacity-ghostly: #{$eccgui-opacity-ghostly};
|
|
31
|
+
--#{$eccgui}-opacity-invisible: #{$eccgui-opacity-invisible};
|
|
32
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Meta, StoryFn } from "@storybook/react";
|
|
3
|
+
|
|
4
|
+
import CssCustomProperties from "../../common/utils/CssCustomProperties";
|
|
5
|
+
import {
|
|
6
|
+
Section,
|
|
7
|
+
SectionHeader,
|
|
8
|
+
Spacing,
|
|
9
|
+
Table,
|
|
10
|
+
TableBody,
|
|
11
|
+
TableCell,
|
|
12
|
+
TableContainer,
|
|
13
|
+
TableHead,
|
|
14
|
+
TableHeader,
|
|
15
|
+
TableRow,
|
|
16
|
+
TitleSubsection,
|
|
17
|
+
} from "../../components";
|
|
18
|
+
import { CLASSPREFIX as eccgui } from "../../index";
|
|
19
|
+
|
|
20
|
+
const groups: { title: string; filterName: (name: string) => boolean }[] = [
|
|
21
|
+
{
|
|
22
|
+
title: "Typography",
|
|
23
|
+
filterName: (name) => name.startsWith(`--${eccgui}-size-typo`),
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
title: "Font weights and spacing",
|
|
27
|
+
filterName: (name) => name.startsWith(`--${eccgui}-font`),
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
title: "Whitespace",
|
|
31
|
+
filterName: (name) => name.startsWith(`--${eccgui}-size-block`) || name.startsWith(`--${eccgui}-size-inline`),
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
title: "Color aliases",
|
|
35
|
+
filterName: (name) => name.startsWith(`--${eccgui}-color`) && !name.startsWith(`--${eccgui}-color-palette`),
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
title: "Accessibility",
|
|
39
|
+
filterName: (name) => name.startsWith(`--${eccgui}-a11y`),
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
title: "Opacity",
|
|
43
|
+
filterName: (name) => name.startsWith(`--${eccgui}-opacity`),
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
title: "Palette colors",
|
|
47
|
+
filterName: (name) => name.startsWith(`--${eccgui}-color-palette`),
|
|
48
|
+
},
|
|
49
|
+
];
|
|
50
|
+
|
|
51
|
+
const CssCustomPropertiesOverview = () => {
|
|
52
|
+
return (
|
|
53
|
+
<>
|
|
54
|
+
{groups.map(({ title, filterName }) => {
|
|
55
|
+
const properties = new CssCustomProperties({
|
|
56
|
+
selectorText: ":root",
|
|
57
|
+
filterName,
|
|
58
|
+
removeDashPrefix: false,
|
|
59
|
+
returnObject: false,
|
|
60
|
+
}).customProperties() as string[][];
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<React.Fragment key={title}>
|
|
64
|
+
<Section>
|
|
65
|
+
<SectionHeader>
|
|
66
|
+
<TitleSubsection>{title}</TitleSubsection>
|
|
67
|
+
</SectionHeader>
|
|
68
|
+
<Spacing size="tiny" />
|
|
69
|
+
<TableContainer>
|
|
70
|
+
<Table columnWidths={["60%", "40%"]}>
|
|
71
|
+
<TableHead>
|
|
72
|
+
<TableRow>
|
|
73
|
+
<TableHeader>CSS custom property</TableHeader>
|
|
74
|
+
<TableHeader>Current value</TableHeader>
|
|
75
|
+
</TableRow>
|
|
76
|
+
</TableHead>
|
|
77
|
+
<TableBody>
|
|
78
|
+
{properties.map(([name, value]) => (
|
|
79
|
+
<TableRow key={name}>
|
|
80
|
+
<TableCell>
|
|
81
|
+
<code>{name}</code>
|
|
82
|
+
</TableCell>
|
|
83
|
+
<TableCell>
|
|
84
|
+
{name.startsWith(`--${eccgui}-color`) && (
|
|
85
|
+
<span
|
|
86
|
+
style={{
|
|
87
|
+
display: "inline-block",
|
|
88
|
+
width: `var(--${eccgui}-size-block-whitespace)`,
|
|
89
|
+
height: `var(--${eccgui}-size-block-whitespace)`,
|
|
90
|
+
backgroundColor: value,
|
|
91
|
+
verticalAlign: "middle",
|
|
92
|
+
marginRight: `var(--${eccgui}-size-inline-whitespace)`,
|
|
93
|
+
border: "1px solid currentColor",
|
|
94
|
+
}}
|
|
95
|
+
/>
|
|
96
|
+
)}
|
|
97
|
+
<code>{value}</code>
|
|
98
|
+
</TableCell>
|
|
99
|
+
</TableRow>
|
|
100
|
+
))}
|
|
101
|
+
</TableBody>
|
|
102
|
+
</Table>
|
|
103
|
+
</TableContainer>
|
|
104
|
+
</Section>
|
|
105
|
+
<Spacing size="large" />
|
|
106
|
+
</React.Fragment>
|
|
107
|
+
);
|
|
108
|
+
})}
|
|
109
|
+
</>
|
|
110
|
+
);
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* We mirror our SCSS configuration variables as CSS custom vars.
|
|
115
|
+
* This way they can be easily used for inline styles or in CSS modules without SCSS includes.
|
|
116
|
+
*/
|
|
117
|
+
export default {
|
|
118
|
+
title: "Configuration/CSS Custom Properties",
|
|
119
|
+
component: CssCustomPropertiesOverview,
|
|
120
|
+
} as Meta<typeof CssCustomPropertiesOverview>;
|
|
121
|
+
|
|
122
|
+
export const Default: StoryFn = () => <CssCustomPropertiesOverview />;
|
|
@@ -24,17 +24,22 @@ const TemplateFull: StoryFn<typeof CodeEditor> = (args) => <CodeEditor {...args}
|
|
|
24
24
|
|
|
25
25
|
export const BasicExample = TemplateFull.bind({});
|
|
26
26
|
BasicExample.args = {
|
|
27
|
-
name: "
|
|
27
|
+
name: "jsinput",
|
|
28
|
+
mode: "json",
|
|
29
|
+
defaultValue: '{ json: "true" }',
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const MarkdownWithToolbar = TemplateFull.bind({});
|
|
33
|
+
MarkdownWithToolbar.args = {
|
|
34
|
+
name: "mdinput",
|
|
28
35
|
mode: "markdown",
|
|
29
36
|
defaultValue: "**test me**",
|
|
30
37
|
useToolbar: true,
|
|
31
|
-
disabled: false,
|
|
32
|
-
readOnly: true,
|
|
33
38
|
};
|
|
34
39
|
|
|
35
40
|
export const LinterExample = TemplateFull.bind({});
|
|
36
41
|
LinterExample.args = {
|
|
37
|
-
name: "
|
|
42
|
+
name: "lintinput",
|
|
38
43
|
defaultValue: "**test me**",
|
|
39
44
|
mode: "javascript",
|
|
40
45
|
useLinting: true,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import React, { useMemo, useRef } from "react";
|
|
2
2
|
import { defaultKeymap, indentWithTab } from "@codemirror/commands";
|
|
3
3
|
import { defaultHighlightStyle, foldKeymap } from "@codemirror/language";
|
|
4
|
-
import { EditorState, Extension
|
|
4
|
+
import { Compartment,EditorState, Extension } from "@codemirror/state";
|
|
5
5
|
import { DOMEventHandlers, EditorView, KeyBinding, keymap, Rect, ViewUpdate } from "@codemirror/view";
|
|
6
6
|
import { minimalSetup } from "codemirror";
|
|
7
7
|
|
|
8
|
+
import { Markdown } from "../../cmem/markdown/Markdown";
|
|
9
|
+
import { EditorAppearanceConfigMenu } from "./toolbars/EditorAppearanceConfigMenu";
|
|
8
10
|
import { IntentTypes } from "../../common/Intent";
|
|
9
11
|
import { markField } from "../../components/AutoSuggestion/extensions/markText";
|
|
10
12
|
import { TestableComponent } from "../../components/interfaces";
|
|
11
|
-
import { MarkdownToolbar } from "./toolbars/markdown.toolbar";
|
|
12
|
-
import { Markdown } from "../../cmem/markdown/Markdown";
|
|
13
13
|
import { CLASSPREFIX as eccgui } from "../../configuration/constants";
|
|
14
14
|
|
|
15
15
|
//hooks
|
|
@@ -31,12 +31,23 @@ import {
|
|
|
31
31
|
adaptedLineNumbers,
|
|
32
32
|
adaptedLintGutter,
|
|
33
33
|
adaptedPlaceholder,
|
|
34
|
-
compartment,
|
|
35
34
|
adaptedSyntaxHighlighting,
|
|
35
|
+
compartment,
|
|
36
36
|
} from "./tests/codemirrorTestHelper";
|
|
37
|
+
import { MarkdownToolbar } from "./toolbars/markdown.toolbar";
|
|
37
38
|
import { ExtensionCreator } from "./types";
|
|
38
39
|
|
|
39
|
-
|
|
40
|
+
interface EditorAppearance {
|
|
41
|
+
/**
|
|
42
|
+
* If enabled the code editor won't show numbers before each line.
|
|
43
|
+
*/
|
|
44
|
+
preventLineNumbers?: boolean;
|
|
45
|
+
|
|
46
|
+
/** Long lines are wrapped and displayed on multiple lines */
|
|
47
|
+
wrapLines?: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface CodeEditorProps extends EditorAppearance, Omit<React.HTMLAttributes<HTMLDivElement>, "translate" | "onChange" | "onKeyDown" | "onMouseDown" | "onScroll">, TestableComponent {
|
|
40
51
|
// Is called with the editor instance that allows access via the CodeMirror API
|
|
41
52
|
setEditorView?: (editor: EditorView | undefined) => void;
|
|
42
53
|
/**
|
|
@@ -86,10 +97,6 @@ export interface CodeEditorProps extends Omit<React.HTMLAttributes<HTMLDivElemen
|
|
|
86
97
|
* Default value used first when the editor is instanciated.
|
|
87
98
|
*/
|
|
88
99
|
defaultValue?: string;
|
|
89
|
-
/**
|
|
90
|
-
* If enabled the code editor won't show numbers before each line.
|
|
91
|
-
*/
|
|
92
|
-
preventLineNumbers?: boolean;
|
|
93
100
|
|
|
94
101
|
/** Set read-only mode. Default: false */
|
|
95
102
|
readOnly?: boolean;
|
|
@@ -97,11 +104,8 @@ export interface CodeEditorProps extends Omit<React.HTMLAttributes<HTMLDivElemen
|
|
|
97
104
|
/** Optional height of the component */
|
|
98
105
|
height?: number | string;
|
|
99
106
|
|
|
100
|
-
/** Long lines are wrapped and displayed on multiple lines */
|
|
101
|
-
wrapLines?: boolean;
|
|
102
|
-
|
|
103
107
|
/**
|
|
104
|
-
* Add properties to the `div` used as
|
|
108
|
+
* Add properties to the `div` used as wrapper element.
|
|
105
109
|
* @deprecated (v26) You can now use all properties directly on `CodeEditor`.
|
|
106
110
|
*/
|
|
107
111
|
outerDivAttributes?: Omit<React.HTMLAttributes<HTMLDivElement>, "id" | "data-test-id" | "data-testid" | "translate" | "onChange" | "onKeyDown" | "onMouseDown" | "onScroll">;
|
|
@@ -186,6 +190,18 @@ const ModeLinterMap: ReadonlyMap<SupportedCodeEditorModes, ReadonlyArray<Extensi
|
|
|
186
190
|
|
|
187
191
|
const ModeToolbarSupport: ReadonlyArray<SupportedCodeEditorModes> = ["markdown"];
|
|
188
192
|
|
|
193
|
+
const defaultAppearanceForModeWithToolbar: ReadonlyMap<SupportedCodeEditorModes, EditorAppearance> = new Map([
|
|
194
|
+
["markdown", { wrapLines: true, preventLineNumbers: true }]
|
|
195
|
+
]);
|
|
196
|
+
|
|
197
|
+
const getDefaultAppearanceForModeWithToolbar = (hasToolbar: boolean, mode?: SupportedCodeEditorModes): EditorAppearance | undefined => {
|
|
198
|
+
if (hasToolbar && mode) {
|
|
199
|
+
return defaultAppearanceForModeWithToolbar.get(mode);
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return undefined;
|
|
203
|
+
}
|
|
204
|
+
|
|
189
205
|
/**
|
|
190
206
|
* Includes a code editor, currently we use CodeMirror library as base.
|
|
191
207
|
*/
|
|
@@ -200,11 +216,11 @@ export const CodeEditor = ({
|
|
|
200
216
|
name,
|
|
201
217
|
id,
|
|
202
218
|
mode,
|
|
203
|
-
preventLineNumbers
|
|
219
|
+
preventLineNumbers,
|
|
220
|
+
wrapLines,
|
|
204
221
|
defaultValue = "",
|
|
205
222
|
readOnly = false,
|
|
206
223
|
shouldHaveMinimalSetup = true,
|
|
207
|
-
wrapLines = false,
|
|
208
224
|
onScroll,
|
|
209
225
|
setEditorView,
|
|
210
226
|
supportCodeFolding = false,
|
|
@@ -221,16 +237,30 @@ export const CodeEditor = ({
|
|
|
221
237
|
autoFocus = false,
|
|
222
238
|
disabled = false,
|
|
223
239
|
intent,
|
|
224
|
-
useToolbar,
|
|
240
|
+
useToolbar = false,
|
|
225
241
|
translate,
|
|
226
242
|
...otherCodeEditorProps
|
|
227
243
|
}: CodeEditorProps) => {
|
|
228
244
|
const parent = useRef<any>(undefined);
|
|
229
245
|
const [view, setView] = React.useState<EditorView | undefined>();
|
|
230
|
-
const
|
|
246
|
+
const defaultAppearanceForModeWithToolbar = getDefaultAppearanceForModeWithToolbar(useToolbar, mode);
|
|
247
|
+
const [editorAppearance, setEditorAppearance] = React.useState<{[s: string]: boolean;}>(
|
|
248
|
+
{
|
|
249
|
+
// we also set the fallback default here
|
|
250
|
+
wrapLines: wrapLines ?? defaultAppearanceForModeWithToolbar?.wrapLines ?? false,
|
|
251
|
+
preventLineNumbers: preventLineNumbers ?? defaultAppearanceForModeWithToolbar?.preventLineNumbers ?? false,
|
|
252
|
+
}
|
|
253
|
+
)
|
|
254
|
+
const currentView = React.useRef<EditorView>(undefined)
|
|
231
255
|
currentView.current = view
|
|
232
256
|
const currentReadOnly = React.useRef(readOnly)
|
|
233
257
|
currentReadOnly.current = readOnly
|
|
258
|
+
const currentOnChange = React.useRef(onChange)
|
|
259
|
+
currentOnChange.current = onChange
|
|
260
|
+
const currentDisabled = React.useRef(disabled)
|
|
261
|
+
currentDisabled.current = disabled
|
|
262
|
+
const currentIntent = React.useRef(intent)
|
|
263
|
+
currentIntent.current = intent
|
|
234
264
|
const [showPreview, setShowPreview] = React.useState<boolean>(false);
|
|
235
265
|
// CodeMirror Compartments in order to allow for re-configuration after initialization
|
|
236
266
|
const readOnlyCompartment = React.useRef<Compartment>(compartment())
|
|
@@ -319,18 +349,18 @@ export const CodeEditor = ({
|
|
|
319
349
|
disabledCompartment.current.of(EditorView?.editable.of(!disabled)),
|
|
320
350
|
AdaptedEditorViewDomEventHandlers(domEventHandlers) as Extension,
|
|
321
351
|
EditorView?.updateListener.of((v: ViewUpdate) => {
|
|
322
|
-
if (
|
|
352
|
+
if (currentDisabled.current) return;
|
|
323
353
|
|
|
324
|
-
if (
|
|
354
|
+
if (currentOnChange.current && v.docChanged) {
|
|
325
355
|
// Only fire if the text has actually been changed
|
|
326
|
-
|
|
356
|
+
currentOnChange.current(v.state.doc.toString());
|
|
327
357
|
}
|
|
328
358
|
|
|
329
359
|
if (onSelection)
|
|
330
360
|
onSelection(v.state.selection.ranges.filter((r) => !r.empty).map(({ from, to }) => ({ from, to })));
|
|
331
361
|
|
|
332
|
-
if (onFocusChange &&
|
|
333
|
-
v.view.dom.classList.add(`${eccgui}-intent--${
|
|
362
|
+
if (onFocusChange && currentIntent.current && !v.view.dom.classList?.contains(`${eccgui}-intent--${currentIntent.current}`)) {
|
|
363
|
+
v.view.dom.classList.add(`${eccgui}-intent--${currentIntent.current}`);
|
|
334
364
|
}
|
|
335
365
|
|
|
336
366
|
if (onCursorChange) {
|
|
@@ -353,9 +383,9 @@ export const CodeEditor = ({
|
|
|
353
383
|
}
|
|
354
384
|
}),
|
|
355
385
|
shouldHaveMinimalSetupCompartment.current.of(addExtensionsFor(shouldHaveMinimalSetup, minimalSetup)),
|
|
356
|
-
preventLineNumbersCompartment.current.of(addExtensionsFor(!preventLineNumbers, adaptedLineNumbers())),
|
|
386
|
+
preventLineNumbersCompartment.current.of(addExtensionsFor(!editorAppearance.preventLineNumbers, adaptedLineNumbers())),
|
|
357
387
|
shouldHighlightActiveLineCompartment.current.of(addExtensionsFor(shouldHighlightActiveLine, adaptedHighlightActiveLine())),
|
|
358
|
-
wrapLinesCompartment.current.of(addExtensionsFor(wrapLines, EditorView?.lineWrapping)),
|
|
388
|
+
wrapLinesCompartment.current.of(addExtensionsFor((editorAppearance.wrapLines!), EditorView?.lineWrapping)),
|
|
359
389
|
supportCodeFoldingCompartment.current.of(addExtensionsFor(supportCodeFolding, adaptedFoldGutter(), adaptedCodeFolding())),
|
|
360
390
|
useLintingCompartment.current.of(addExtensionsFor(useLinting, ...linters)),
|
|
361
391
|
adaptedSyntaxHighlighting(defaultHighlightStyle),
|
|
@@ -377,11 +407,11 @@ export const CodeEditor = ({
|
|
|
377
407
|
}
|
|
378
408
|
|
|
379
409
|
if (disabled) {
|
|
380
|
-
view.dom.
|
|
410
|
+
view.dom.classList.add(`${eccgui}-disabled`);
|
|
381
411
|
}
|
|
382
412
|
|
|
383
|
-
if (
|
|
384
|
-
view.dom.className += ` ${eccgui}-intent--${
|
|
413
|
+
if (currentIntent.current) {
|
|
414
|
+
view.dom.className += ` ${eccgui}-intent--${currentIntent.current}`;
|
|
385
415
|
}
|
|
386
416
|
|
|
387
417
|
if (autoFocus) {
|
|
@@ -432,24 +462,39 @@ export const CodeEditor = ({
|
|
|
432
462
|
}, [tabIntentSize])
|
|
433
463
|
|
|
434
464
|
React.useEffect(() => {
|
|
435
|
-
updateExtension(EditorView?.editable.of(!disabled), disabledCompartment.current)
|
|
465
|
+
updateExtension(EditorView?.editable.of(!disabled), disabledCompartment.current);
|
|
466
|
+
if (view?.dom) {
|
|
467
|
+
if (disabled) {
|
|
468
|
+
view.dom.classList.add(`${eccgui}-disabled`);
|
|
469
|
+
} else {
|
|
470
|
+
view.dom.classList.remove(`${eccgui}-disabled`);
|
|
471
|
+
}
|
|
472
|
+
}
|
|
436
473
|
}, [disabled])
|
|
437
474
|
|
|
438
475
|
React.useEffect(() => {
|
|
439
|
-
|
|
440
|
-
|
|
476
|
+
setEditorAppearance({
|
|
477
|
+
...editorAppearance,
|
|
478
|
+
preventLineNumbers: preventLineNumbers ?? editorAppearance?.preventLineNumbers ?? false,
|
|
479
|
+
});
|
|
480
|
+
updateExtension(addExtensionsFor(!editorAppearance.preventLineNumbers, adaptedLineNumbers()), preventLineNumbersCompartment.current)
|
|
481
|
+
}, [preventLineNumbers, editorAppearance.preventLineNumbers])
|
|
441
482
|
|
|
442
483
|
React.useEffect(() => {
|
|
443
|
-
|
|
444
|
-
|
|
484
|
+
setEditorAppearance({
|
|
485
|
+
...editorAppearance,
|
|
486
|
+
wrapLines: wrapLines ?? editorAppearance?.wrapLines ?? false,
|
|
487
|
+
});
|
|
488
|
+
updateExtension(addExtensionsFor(editorAppearance.wrapLines!, EditorView?.lineWrapping), wrapLinesCompartment.current)
|
|
489
|
+
}, [wrapLines, editorAppearance.wrapLines])
|
|
445
490
|
|
|
446
491
|
React.useEffect(() => {
|
|
447
|
-
updateExtension(addExtensionsFor(
|
|
448
|
-
}, [
|
|
492
|
+
updateExtension(addExtensionsFor(shouldHaveMinimalSetup ?? true, minimalSetup), shouldHaveMinimalSetupCompartment.current)
|
|
493
|
+
}, [shouldHaveMinimalSetup])
|
|
449
494
|
|
|
450
495
|
React.useEffect(() => {
|
|
451
|
-
updateExtension(addExtensionsFor(
|
|
452
|
-
}, [
|
|
496
|
+
updateExtension(addExtensionsFor(shouldHighlightActiveLine ?? false, adaptedHighlightActiveLine()), shouldHighlightActiveLineCompartment.current)
|
|
497
|
+
}, [shouldHighlightActiveLine])
|
|
453
498
|
|
|
454
499
|
React.useEffect(() => {
|
|
455
500
|
updateExtension(addExtensionsFor(supportCodeFolding ?? false, adaptedFoldGutter(), adaptedCodeFolding()), supportCodeFoldingCompartment.current)
|
|
@@ -461,7 +506,7 @@ export const CodeEditor = ({
|
|
|
461
506
|
|
|
462
507
|
const hasToolbarSupport = mode && ModeToolbarSupport.indexOf(mode) > -1 && useToolbar;
|
|
463
508
|
|
|
464
|
-
const editorToolbar = (mode?: SupportedCodeEditorModes): JSX.Element => {
|
|
509
|
+
const editorToolbar = (mode?: SupportedCodeEditorModes): React.JSX.Element => {
|
|
465
510
|
switch (mode) {
|
|
466
511
|
case "markdown":
|
|
467
512
|
return (
|
|
@@ -474,6 +519,17 @@ export const CodeEditor = ({
|
|
|
474
519
|
translate={getTranslation}
|
|
475
520
|
disabled={disabled}
|
|
476
521
|
readonly={readOnly}
|
|
522
|
+
configMenu={(
|
|
523
|
+
<EditorAppearanceConfigMenu
|
|
524
|
+
config={{...editorAppearance}}
|
|
525
|
+
configLocked={{
|
|
526
|
+
wrapLines,
|
|
527
|
+
preventLineNumbers,
|
|
528
|
+
}}
|
|
529
|
+
setConfig={setEditorAppearance}
|
|
530
|
+
configPropertyTranslate={getTranslation}
|
|
531
|
+
/>
|
|
532
|
+
)}
|
|
477
533
|
/>
|
|
478
534
|
</div>
|
|
479
535
|
{showPreview && (
|