@pareto-engineering/design-system 4.0.0-alpha.9 → 4.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/.storybook/preview.js +29 -12
- package/dist/cjs/a/AnimatedBlobs/AnimatedBlobs.js +6 -7
- package/dist/cjs/a/AnimatedGradient/AnimatedGradient.js +15 -12
- package/dist/cjs/a/AnimatedGradient/styles.scss +2 -1
- package/dist/cjs/a/AnimatedGradient/webGIRenderer.js +0 -1
- package/dist/cjs/a/AppContext/Context.js +3 -4
- package/dist/cjs/a/AppContext/ContextProvider.js +6 -6
- package/dist/cjs/a/AppContext/useTheme.js +2 -7
- package/dist/cjs/a/BlurOverlay/BlurOverlay.js +58 -0
- package/dist/cjs/{r/common/PrivateRoute → a/BlurOverlay}/index.js +3 -3
- package/dist/cjs/a/BlurOverlay/styles.scss +33 -0
- package/dist/cjs/a/ContentTree/ContentTree.js +16 -9
- package/dist/cjs/a/ContentTree/common/Tree/Tree.js +20 -13
- package/dist/cjs/a/ContentTree/common/useContentTree.js +1 -2
- package/dist/cjs/a/ContentTree/common/useFirstVisibleNode.js +1 -2
- package/dist/cjs/a/ContentTree/styles.scss +34 -11
- package/dist/cjs/a/Conversation/Context.js +3 -4
- package/dist/cjs/a/Conversation/Conversation.js +18 -22
- package/dist/cjs/a/Conversation/common/Message/Message.js +18 -16
- package/dist/cjs/a/Conversation/styles.scss +56 -124
- package/dist/cjs/a/DatePicker/DatePicker.js +162 -0
- package/dist/cjs/a/DatePicker/index.js +13 -0
- package/dist/cjs/a/DatePicker/styles.scss +380 -0
- package/dist/cjs/a/DotInfo/DotInfo.js +6 -7
- package/dist/cjs/a/Figure/Figure.js +6 -7
- package/dist/cjs/a/HamburgerButton/HamburgerButton.js +5 -8
- package/dist/cjs/a/IconList/IconList.js +5 -8
- package/dist/cjs/a/IconList/common/Item/Item.js +4 -5
- package/dist/cjs/a/Label/Label.js +5 -8
- package/dist/cjs/a/Label/styles.scss +5 -5
- package/dist/cjs/a/LoadingCircle/LoadingCircle.js +6 -7
- package/dist/cjs/a/MetaCard/MetaCard.js +14 -10
- package/dist/cjs/a/MetaCard/styles.scss +18 -1
- package/dist/cjs/a/People/People.js +8 -7
- package/dist/cjs/a/People/common/Person/Person.js +15 -11
- package/dist/cjs/a/People/styles.scss +10 -4
- package/dist/cjs/a/Popover/Popover.js +12 -10
- package/dist/cjs/a/Popover/styles.scss +1 -1
- package/dist/cjs/a/ProgressBar/ProgressBar.js +9 -10
- package/dist/cjs/a/ProgressBar/styles.scss +11 -1
- package/dist/cjs/a/Quote/Quote.js +21 -12
- package/dist/cjs/a/Quote/styles.scss +16 -37
- package/dist/cjs/a/Removable/Removable.js +71 -0
- package/dist/cjs/{c/ContentSlides/common/Navigator → a/Removable}/index.js +3 -3
- package/dist/cjs/a/Removable/styles.scss +33 -0
- package/dist/cjs/a/SVG/SVG.js +8 -10
- package/dist/cjs/a/SVG/common/UseSVG/UseSVG.js +3 -4
- package/dist/cjs/a/SnapScroller/SnapScroller.js +40 -14
- package/dist/cjs/a/SnapScroller/styles.scss +32 -3
- package/dist/cjs/a/Spinner/Spinner.js +6 -7
- package/dist/cjs/a/TextSteps/TextSteps.js +7 -10
- package/dist/cjs/a/TextSteps/styles.scss +1 -1
- package/dist/cjs/a/Timestamp/Timestamp.js +12 -12
- package/dist/cjs/a/Tip/Tip.js +25 -12
- package/dist/cjs/a/Tip/styles.scss +7 -13
- package/dist/cjs/a/ToggleSwitch/ToggleSwitch.js +81 -0
- package/dist/cjs/a/ToggleSwitch/index.js +13 -0
- package/dist/cjs/a/ToggleSwitch/styles.scss +51 -0
- package/dist/cjs/a/Tooltip/Tooltip.js +87 -0
- package/dist/cjs/{c/ContentSlides/common/Sidebar → a/Tooltip}/index.js +3 -3
- package/dist/cjs/a/Tooltip/styles.scss +61 -0
- package/dist/cjs/a/XMLEditor/XMLEditor.js +137 -0
- package/dist/cjs/{c/ContentSlides/common/Slide → a/XMLEditor/common}/index.js +3 -3
- package/dist/cjs/a/XMLEditor/common/theme.js +186 -0
- package/dist/cjs/a/XMLEditor/index.js +13 -0
- package/dist/cjs/a/XMLEditor/styles.scss +24 -0
- package/dist/cjs/a/index.js +43 -1
- package/dist/cjs/b/Button/Button.js +24 -15
- package/dist/cjs/b/Button/common/Group/Group.js +54 -0
- package/dist/cjs/b/Button/common/Group/index.js +13 -0
- package/dist/cjs/b/Button/common/Group/styles.scss +11 -0
- package/dist/cjs/b/Button/common/index.js +12 -0
- package/dist/cjs/b/Button/styles.scss +39 -11
- package/dist/cjs/b/Card/Card.js +6 -7
- package/dist/cjs/b/Card/common/Group/Group.js +6 -9
- package/dist/cjs/b/Card/common/Group/styles.scss +0 -7
- package/dist/cjs/b/Card/common/Section/Section.js +4 -5
- package/dist/cjs/b/Card/styles.scss +11 -0
- package/dist/cjs/b/Logo/Logo.js +9 -10
- package/dist/cjs/b/Page/Context.js +3 -4
- package/dist/cjs/b/Page/Page.js +13 -13
- package/dist/cjs/b/Page/common/PageHelmet/PageHelmet.js +21 -8
- package/dist/cjs/b/Page/common/Section/Section.js +12 -8
- package/dist/cjs/b/Page/styles.scss +5 -2
- package/dist/cjs/b/SocialMediaButton/SocialMediaButton.js +10 -9
- package/dist/cjs/b/SocialMediaButton/styles.scss +0 -14
- package/dist/cjs/b/ThemeSelector/ThemeSelector.js +19 -35
- package/dist/cjs/b/ThemeSelector/styles.scss +44 -6
- package/dist/cjs/b/Title/Title.js +4 -12
- package/dist/cjs/c/Modal/Modal.js +7 -8
- package/dist/cjs/c/Modal/common/ModalHeader/ModalHeader.js +4 -5
- package/dist/cjs/c/Modal/styles.scss +7 -12
- package/dist/cjs/c/Shortener/Shortener.js +11 -9
- package/dist/cjs/c/SocialMediaShareButton/SocialMediaShareButton.js +6 -9
- package/dist/cjs/c/index.js +0 -13
- package/dist/cjs/f/FormInput/FormInput.js +19 -9
- package/dist/cjs/f/common/Debugger/Debugger.js +10 -10
- package/dist/cjs/f/common/Description/Description.js +11 -11
- package/dist/cjs/f/common/Description/styles.scss +1 -2
- package/dist/cjs/f/common/Label/Label.js +7 -9
- package/dist/cjs/f/common/Label/styles.scss +3 -2
- package/dist/cjs/f/common/index.js +18 -1
- package/dist/cjs/f/common/utils/index.js +12 -0
- package/dist/cjs/f/common/utils/lookUpInputValueFromFetchedOptions.js +29 -0
- package/dist/cjs/f/fields/Checkbox/Checkbox.js +31 -14
- package/dist/cjs/f/fields/Checkbox/styles.scss +5 -4
- package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +42 -34
- package/dist/cjs/f/fields/ChoicesInput/common/Choice/Choice.js +5 -6
- package/dist/cjs/f/fields/ChoicesInput/styles.scss +32 -8
- package/dist/cjs/f/fields/EditorInput/EditorInput.js +236 -0
- package/dist/cjs/f/fields/EditorInput/common/BlockFormatDropDown/BlockFormatDropDown.js +256 -0
- package/dist/cjs/f/fields/EditorInput/common/BlockFormatDropDown/index.js +13 -0
- package/dist/cjs/f/fields/EditorInput/common/BlockFormatDropDown/styles.scss +55 -0
- package/dist/cjs/f/fields/EditorInput/common/ColorPicker/ColorPicker.js +98 -0
- package/dist/cjs/f/fields/EditorInput/common/ColorPicker/index.js +13 -0
- package/dist/cjs/f/fields/EditorInput/common/ColorPicker/styles.scss +36 -0
- package/dist/cjs/f/fields/EditorInput/common/FontSizeDropDown/FontSizeDropDown.js +94 -0
- package/dist/cjs/f/fields/EditorInput/common/FontSizeDropDown/index.js +13 -0
- package/dist/cjs/f/fields/EditorInput/common/FontSizeDropDown/styles.scss +55 -0
- package/dist/cjs/f/fields/EditorInput/common/StopPropagationPlugin.js +30 -0
- package/dist/cjs/f/fields/EditorInput/common/ToolbarPlugin/ToolbarPlugin.js +289 -0
- package/dist/cjs/f/fields/EditorInput/common/ToolbarPlugin/index.js +13 -0
- package/dist/cjs/f/fields/EditorInput/common/ToolbarPlugin/styles.scss +56 -0
- package/dist/cjs/f/fields/EditorInput/common/TreeViewPlugin.js +18 -0
- package/dist/cjs/f/fields/EditorInput/common/index.js +48 -0
- package/dist/cjs/f/fields/EditorInput/index.js +13 -0
- package/dist/cjs/f/fields/EditorInput/styles.scss +240 -0
- package/dist/cjs/f/fields/LinkInput/LinkInput.js +152 -0
- package/dist/cjs/f/fields/LinkInput/index.js +13 -0
- package/dist/cjs/f/fields/LinkInput/styles.scss +90 -0
- package/dist/cjs/f/fields/QueryChoices/QueryChoices.js +9 -9
- package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +45 -16
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +65 -27
- package/dist/cjs/f/fields/QueryCombobox/common/Menu/Menu.js +4 -5
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +88 -37
- package/dist/cjs/f/fields/QueryCombobox/styles.scss +69 -27
- package/dist/cjs/f/fields/QuerySelect/QuerySelect.js +15 -9
- package/dist/cjs/f/fields/RatingsInput/RatingsInput.js +20 -18
- package/dist/cjs/f/fields/RatingsInput/common/Rating/Rating.js +8 -9
- package/dist/cjs/f/fields/RatingsInput/styles.scss +7 -10
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +52 -50
- package/dist/cjs/f/fields/SelectInput/common/Menu/Menu.js +83 -0
- package/dist/cjs/f/fields/SelectInput/common/Menu/index.js +13 -0
- package/dist/cjs/f/fields/SelectInput/common/Multiple/Multiple.js +242 -0
- package/dist/cjs/f/fields/SelectInput/common/Multiple/index.js +13 -0
- package/dist/cjs/f/fields/SelectInput/common/Single/Single.js +115 -0
- package/dist/cjs/f/fields/SelectInput/common/Single/index.js +13 -0
- package/dist/cjs/f/fields/SelectInput/common/index.js +26 -0
- package/dist/cjs/f/fields/SelectInput/styles.scss +163 -32
- package/dist/cjs/f/fields/TextInput/TextInput.js +32 -26
- package/dist/cjs/f/fields/TextInput/styles.scss +59 -22
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +17 -23
- package/dist/cjs/f/fields/TextareaInput/styles.scss +33 -13
- package/dist/cjs/f/fields/index.js +15 -1
- package/dist/cjs/form.scss +1 -1
- package/dist/cjs/g/DragAndDrop/DragAndDrop.js +97 -0
- package/dist/cjs/g/DragAndDrop/common/DraggableItem/DraggableItem.js +80 -0
- package/dist/cjs/g/DragAndDrop/common/DraggableItem/index.js +13 -0
- package/dist/cjs/g/DragAndDrop/common/DraggableItem/styles.scss +12 -0
- package/dist/cjs/g/DragAndDrop/common/index.js +12 -0
- package/dist/cjs/g/DragAndDrop/index.js +13 -0
- package/dist/cjs/g/DragAndDrop/styles.scss +8 -0
- package/dist/cjs/g/ExpandableLexicalPreview/ExpandableLexicalPreview.js +137 -0
- package/dist/cjs/g/ExpandableLexicalPreview/common/NewWindowPortal/NewWindowPortal.js +79 -0
- package/dist/cjs/g/ExpandableLexicalPreview/common/NewWindowPortal/index.js +13 -0
- package/dist/cjs/g/ExpandableLexicalPreview/common/NewWindowPortal/styles.scss +9 -0
- package/dist/cjs/g/ExpandableLexicalPreview/common/index.js +12 -0
- package/dist/cjs/g/ExpandableLexicalPreview/index.js +13 -0
- package/dist/cjs/g/ExpandableLexicalPreview/styles.scss +34 -0
- package/dist/cjs/g/index.js +19 -0
- package/dist/cjs/index.js +11 -11
- package/dist/cjs/test/QueryLoader/QueryLoader.js +9 -7
- package/dist/cjs/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +0 -1
- package/dist/cjs/test/QueryLoader/common/PreloadedTestData/PreloadedTestData.js +3 -4
- package/dist/cjs/utils/hooks/index.js +7 -0
- package/dist/cjs/utils/hooks/useDynamicPosition.js +1 -2
- package/dist/cjs/utils/hooks/useOutsideClick.js +25 -0
- package/dist/cjs/utils/hooks/useWindowSize.js +1 -2
- package/dist/cjs/utils/index.js +6 -0
- package/dist/es/a/AnimatedBlobs/AnimatedBlobs.js +18 -23
- package/dist/es/a/AnimatedGradient/AnimatedGradient.js +8 -7
- package/dist/es/a/AnimatedGradient/styles.scss +2 -1
- package/dist/es/a/AnimatedGradient/webGIRenderer.js +0 -1
- package/dist/es/a/AppContext/useTheme.js +0 -4
- package/dist/es/a/BlurOverlay/BlurOverlay.js +45 -0
- package/dist/es/a/BlurOverlay/index.js +2 -0
- package/dist/es/a/BlurOverlay/styles.scss +33 -0
- package/dist/es/a/ContentTree/ContentTree.js +9 -6
- package/dist/es/a/ContentTree/common/Tree/Tree.js +12 -5
- package/dist/es/a/ContentTree/styles.scss +34 -11
- package/dist/es/a/Conversation/Conversation.js +18 -28
- package/dist/es/a/Conversation/common/Message/Message.js +15 -12
- package/dist/es/a/Conversation/styles.scss +56 -124
- package/dist/es/a/DatePicker/DatePicker.js +154 -0
- package/dist/es/a/DatePicker/index.js +2 -0
- package/dist/es/a/DatePicker/styles.scss +380 -0
- package/dist/es/a/DotInfo/DotInfo.js +9 -15
- package/dist/es/a/Figure/Figure.js +10 -15
- package/dist/es/a/HamburgerButton/HamburgerButton.js +13 -18
- package/dist/es/a/IconList/IconList.js +10 -15
- package/dist/es/a/Label/Label.js +6 -11
- package/dist/es/a/Label/styles.scss +5 -5
- package/dist/es/a/LoadingCircle/LoadingCircle.js +32 -37
- package/dist/es/a/MetaCard/MetaCard.js +13 -13
- package/dist/es/a/MetaCard/styles.scss +18 -1
- package/dist/es/a/People/People.js +11 -16
- package/dist/es/a/People/common/Person/Person.js +25 -18
- package/dist/es/a/People/styles.scss +10 -4
- package/dist/es/a/Popover/Popover.js +3 -5
- package/dist/es/a/Popover/styles.scss +1 -1
- package/dist/es/a/ProgressBar/ProgressBar.js +14 -19
- package/dist/es/a/ProgressBar/styles.scss +11 -1
- package/dist/es/a/Quote/Quote.js +25 -20
- package/dist/es/a/Quote/styles.scss +16 -37
- package/dist/es/a/Removable/Removable.js +59 -0
- package/dist/es/a/Removable/index.js +2 -0
- package/dist/es/a/Removable/styles.scss +33 -0
- package/dist/es/a/SVG/SVG.js +2 -4
- package/dist/es/a/SnapScroller/SnapScroller.js +34 -10
- package/dist/es/a/SnapScroller/styles.scss +32 -3
- package/dist/es/a/Spinner/Spinner.js +9 -14
- package/dist/es/a/TextSteps/TextSteps.js +16 -21
- package/dist/es/a/TextSteps/styles.scss +1 -1
- package/dist/es/a/Timestamp/Timestamp.js +3 -5
- package/dist/es/a/Tip/Tip.js +24 -15
- package/dist/es/a/Tip/styles.scss +7 -13
- package/dist/es/a/ToggleSwitch/ToggleSwitch.js +69 -0
- package/dist/es/a/ToggleSwitch/index.js +2 -0
- package/dist/es/a/ToggleSwitch/styles.scss +51 -0
- package/dist/es/a/Tooltip/Tooltip.js +75 -0
- package/{src/ui/c/ContentSlides/common/Sidebar → dist/es/a/Tooltip}/index.js +1 -1
- package/dist/es/a/Tooltip/styles.scss +61 -0
- package/dist/es/a/XMLEditor/XMLEditor.js +126 -0
- package/dist/es/a/XMLEditor/common/index.js +1 -0
- package/dist/es/a/XMLEditor/common/theme.js +180 -0
- package/dist/es/a/XMLEditor/index.js +1 -0
- package/dist/es/a/XMLEditor/styles.scss +24 -0
- package/dist/es/a/index.js +7 -1
- package/dist/es/b/Button/Button.js +20 -10
- package/dist/es/b/Button/common/Group/Group.js +44 -0
- package/dist/es/b/Button/common/Group/index.js +1 -0
- package/dist/es/b/Button/common/Group/styles.scss +11 -0
- package/dist/es/b/Button/common/index.js +1 -0
- package/dist/es/b/Button/styles.scss +39 -11
- package/dist/es/b/Card/Card.js +11 -16
- package/dist/es/b/Card/common/Group/Group.js +2 -5
- package/dist/es/b/Card/common/Group/styles.scss +0 -7
- package/dist/es/b/Card/styles.scss +11 -0
- package/dist/es/b/Logo/Logo.js +2 -5
- package/dist/es/b/Page/Page.js +7 -7
- package/dist/es/b/Page/common/PageHelmet/PageHelmet.js +15 -2
- package/dist/es/b/Page/common/Section/Section.js +8 -3
- package/dist/es/b/Page/styles.scss +5 -2
- package/dist/es/b/SocialMediaButton/SocialMediaButton.js +6 -5
- package/dist/es/b/SocialMediaButton/styles.scss +0 -14
- package/dist/es/b/ThemeSelector/ThemeSelector.js +13 -32
- package/dist/es/b/ThemeSelector/styles.scss +44 -6
- package/dist/es/b/Title/Title.js +11 -21
- package/dist/es/c/Modal/Modal.js +14 -19
- package/dist/es/c/Modal/common/ModalHeader/ModalHeader.js +1 -1
- package/dist/es/c/Modal/styles.scss +7 -12
- package/dist/es/c/Shortener/Shortener.js +2 -4
- package/dist/es/c/SocialMediaShareButton/SocialMediaShareButton.js +1 -6
- package/dist/es/c/index.js +0 -1
- package/dist/es/f/FormInput/FormInput.js +15 -5
- package/dist/es/f/common/Debugger/Debugger.js +2 -4
- package/dist/es/f/common/Description/Description.js +6 -8
- package/dist/es/f/common/Description/styles.scss +1 -2
- package/dist/es/f/common/Label/Label.js +8 -15
- package/dist/es/f/common/Label/styles.scss +3 -2
- package/dist/es/f/common/index.js +2 -1
- package/dist/es/f/common/utils/index.js +1 -0
- package/dist/es/f/common/utils/lookUpInputValueFromFetchedOptions.js +20 -0
- package/dist/es/f/fields/Checkbox/Checkbox.js +27 -9
- package/dist/es/f/fields/Checkbox/styles.scss +5 -4
- package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +52 -46
- package/dist/es/f/fields/ChoicesInput/common/Choice/Choice.js +1 -1
- package/dist/es/f/fields/ChoicesInput/styles.scss +32 -8
- package/dist/es/f/fields/EditorInput/EditorInput.js +225 -0
- package/dist/es/f/fields/EditorInput/common/BlockFormatDropDown/BlockFormatDropDown.js +246 -0
- package/dist/es/f/fields/EditorInput/common/BlockFormatDropDown/index.js +2 -0
- package/dist/es/f/fields/EditorInput/common/BlockFormatDropDown/styles.scss +55 -0
- package/dist/es/f/fields/EditorInput/common/ColorPicker/ColorPicker.js +87 -0
- package/dist/es/f/fields/EditorInput/common/ColorPicker/index.js +2 -0
- package/dist/es/f/fields/EditorInput/common/ColorPicker/styles.scss +36 -0
- package/dist/es/f/fields/EditorInput/common/FontSizeDropDown/FontSizeDropDown.js +81 -0
- package/dist/es/f/fields/EditorInput/common/FontSizeDropDown/index.js +2 -0
- package/dist/es/f/fields/EditorInput/common/FontSizeDropDown/styles.scss +55 -0
- package/dist/es/f/fields/EditorInput/common/StopPropagationPlugin.js +23 -0
- package/dist/es/f/fields/EditorInput/common/ToolbarPlugin/ToolbarPlugin.js +277 -0
- package/dist/es/f/fields/EditorInput/common/ToolbarPlugin/index.js +2 -0
- package/dist/es/f/fields/EditorInput/common/ToolbarPlugin/styles.scss +56 -0
- package/dist/es/f/fields/EditorInput/common/TreeViewPlugin.js +11 -0
- package/dist/es/f/fields/EditorInput/common/index.js +6 -0
- package/dist/es/f/fields/EditorInput/index.js +2 -0
- package/dist/es/f/fields/EditorInput/styles.scss +240 -0
- package/dist/es/f/fields/LinkInput/LinkInput.js +146 -0
- package/dist/es/f/fields/LinkInput/index.js +2 -0
- package/dist/es/f/fields/LinkInput/styles.scss +90 -0
- package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +35 -10
- package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +56 -18
- package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +78 -27
- package/dist/es/f/fields/QueryCombobox/styles.scss +69 -27
- package/dist/es/f/fields/QuerySelect/QuerySelect.js +7 -1
- package/dist/es/f/fields/RatingsInput/RatingsInput.js +11 -14
- package/dist/es/f/fields/RatingsInput/common/Rating/Rating.js +4 -4
- package/dist/es/f/fields/RatingsInput/styles.scss +7 -10
- package/dist/es/f/fields/SelectInput/SelectInput.js +46 -46
- package/dist/es/f/fields/SelectInput/common/Menu/Menu.js +73 -0
- package/{src/ui/c/ContentSlides/common/Slide → dist/es/f/fields/SelectInput/common/Menu}/index.js +1 -1
- package/dist/es/f/fields/SelectInput/common/Multiple/Multiple.js +233 -0
- package/dist/es/f/fields/SelectInput/common/Multiple/index.js +2 -0
- package/dist/es/f/fields/SelectInput/common/Single/Single.js +107 -0
- package/dist/es/{c/ContentSlides/common/Sidebar → f/fields/SelectInput/common/Single}/index.js +1 -1
- package/dist/es/f/fields/SelectInput/common/index.js +3 -0
- package/dist/es/f/fields/SelectInput/styles.scss +163 -32
- package/dist/es/f/fields/TextInput/TextInput.js +27 -19
- package/dist/es/f/fields/TextInput/styles.scss +59 -22
- package/dist/es/f/fields/TextareaInput/TextareaInput.js +12 -18
- package/dist/es/f/fields/TextareaInput/styles.scss +33 -13
- package/dist/es/f/fields/index.js +3 -1
- package/dist/es/form.scss +1 -1
- package/dist/es/g/DragAndDrop/DragAndDrop.js +88 -0
- package/dist/es/g/DragAndDrop/common/DraggableItem/DraggableItem.js +72 -0
- package/dist/es/g/DragAndDrop/common/DraggableItem/index.js +2 -0
- package/dist/es/g/DragAndDrop/common/DraggableItem/styles.scss +12 -0
- package/dist/es/g/DragAndDrop/common/index.js +1 -0
- package/dist/es/g/DragAndDrop/index.js +2 -0
- package/dist/es/g/DragAndDrop/styles.scss +8 -0
- package/dist/es/g/ExpandableLexicalPreview/ExpandableLexicalPreview.js +126 -0
- package/dist/es/g/ExpandableLexicalPreview/common/NewWindowPortal/NewWindowPortal.js +70 -0
- package/dist/es/g/ExpandableLexicalPreview/common/NewWindowPortal/index.js +2 -0
- package/dist/es/g/ExpandableLexicalPreview/common/NewWindowPortal/styles.scss +9 -0
- package/dist/es/g/ExpandableLexicalPreview/common/index.js +1 -0
- package/dist/es/g/ExpandableLexicalPreview/index.js +2 -0
- package/dist/es/g/ExpandableLexicalPreview/styles.scss +34 -0
- package/dist/es/g/index.js +2 -0
- package/dist/es/index.js +1 -1
- package/dist/es/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +0 -1
- package/dist/es/utils/hooks/index.js +2 -1
- package/dist/es/utils/hooks/useOutsideClick.js +19 -0
- package/dist/es/utils/index.js +1 -1
- package/package.json +20 -5
- package/src/stories/StyleGuide/ai-icons.stories.mdx +27 -0
- package/src/stories/StyleGuide/icons.stories.mdx +22 -22
- package/src/stories/a/AppContext.stories.jsx +4 -2
- package/src/stories/a/BlurOverlay.stories.jsx +39 -0
- package/src/stories/a/Conversation.stories.jsx +11 -42
- package/src/stories/a/DatePicker.stories.jsx +96 -0
- package/src/stories/a/People.stories.jsx +22 -2
- package/src/stories/a/ProgressBar.stories.jsx +1 -1
- package/src/stories/a/Quote.stories.jsx +30 -10
- package/src/stories/a/Removable.stories.jsx +22 -0
- package/src/stories/a/SnapScroller.stories.jsx +2 -2
- package/src/stories/a/Spinner.stories.jsx +1 -1
- package/src/stories/a/Tip.stories.jsx +3 -2
- package/src/stories/a/ToggleSwitch.stories.jsx +22 -0
- package/src/stories/a/Tooltip.stories.jsx +75 -0
- package/src/stories/a/XMLEditor.stories.jsx +26 -0
- package/src/stories/b/{Button.stories.jsx → Button/Button.stories.jsx} +18 -0
- package/src/stories/b/Button/Group.stories.jsx +35 -0
- package/src/stories/b/SocialMediaButton.stories.jsx +4 -2
- package/src/stories/b/ThemeSelector.stories.jsx +1 -5
- package/src/stories/b/Title.stories.jsx +1 -1
- package/src/stories/colors.js +26 -28
- package/src/stories/f/Checkbox.stories.jsx +9 -2
- package/src/stories/f/ChoicesInput.stories.jsx +13 -14
- package/src/stories/f/EditorInput.stories.jsx +81 -0
- package/src/stories/f/LinkInput.stories.jsx +93 -0
- package/src/stories/f/QueryChoices.stories.jsx +13 -4
- package/src/stories/f/QueryCombobox.stories.jsx +57 -13
- package/src/stories/f/QuerySelect.stories.jsx +13 -5
- package/src/stories/f/RatingsInput.stories.jsx +9 -2
- package/src/stories/f/SelectInput.stories.jsx +46 -7
- package/src/stories/f/TextInput.stories.jsx +15 -1
- package/src/stories/f/TextareaInput.stories.jsx +9 -2
- package/src/stories/g/DragAndDrop.stories.jsx +114 -0
- package/src/stories/g/ExpandableLexicalPreview.stories.jsx +37 -0
- package/src/ui/a/AnimatedBlobs/AnimatedBlobs.jsx +25 -31
- package/src/ui/a/AnimatedGradient/AnimatedGradient.jsx +7 -6
- package/src/ui/a/AnimatedGradient/styles.scss +2 -1
- package/src/ui/a/AppContext/useTheme.js +0 -4
- package/src/ui/a/BlurOverlay/BlurOverlay.jsx +69 -0
- package/src/ui/a/BlurOverlay/index.js +2 -0
- package/src/ui/a/BlurOverlay/styles.scss +33 -0
- package/src/ui/a/ContentTree/ContentTree.jsx +9 -9
- package/src/ui/a/ContentTree/common/Tree/Tree.jsx +19 -7
- package/src/ui/a/ContentTree/styles.scss +34 -11
- package/src/ui/a/Conversation/Conversation.jsx +34 -44
- package/src/ui/a/Conversation/common/Message/Message.jsx +18 -11
- package/src/ui/a/Conversation/styles.scss +56 -124
- package/src/ui/a/DatePicker/DatePicker.jsx +201 -0
- package/src/ui/a/DatePicker/index.js +2 -0
- package/src/ui/a/DatePicker/styles.scss +380 -0
- package/src/ui/a/DotInfo/DotInfo.jsx +23 -29
- package/src/ui/a/Figure/Figure.jsx +21 -27
- package/src/ui/a/HamburgerButton/HamburgerButton.jsx +27 -33
- package/src/ui/a/IconList/IconList.jsx +22 -28
- package/src/ui/a/Label/Label.jsx +21 -27
- package/src/ui/a/Label/styles.scss +5 -5
- package/src/ui/a/LoadingCircle/LoadingCircle.jsx +43 -49
- package/src/ui/a/MetaCard/MetaCard.jsx +25 -24
- package/src/ui/a/MetaCard/styles.scss +18 -1
- package/src/ui/a/People/People.jsx +25 -31
- package/src/ui/a/People/common/Person/Person.jsx +34 -22
- package/src/ui/a/People/styles.scss +10 -4
- package/src/ui/a/Popover/Popover.jsx +4 -6
- package/src/ui/a/Popover/styles.scss +1 -1
- package/src/ui/a/ProgressBar/ProgressBar.jsx +27 -31
- package/src/ui/a/ProgressBar/styles.scss +11 -1
- package/src/ui/a/Quote/Quote.jsx +38 -37
- package/src/ui/a/Quote/styles.scss +16 -37
- package/src/ui/a/Removable/Removable.jsx +78 -0
- package/src/ui/a/Removable/index.js +2 -0
- package/src/ui/a/Removable/styles.scss +33 -0
- package/src/ui/a/SVG/SVG.jsx +3 -5
- package/src/ui/a/SnapScroller/SnapScroller.jsx +28 -6
- package/src/ui/a/SnapScroller/styles.scss +32 -3
- package/src/ui/a/Spinner/Spinner.jsx +19 -25
- package/src/ui/a/TextSteps/TextSteps.jsx +31 -38
- package/src/ui/a/TextSteps/styles.scss +1 -1
- package/src/ui/a/Timestamp/Timestamp.jsx +5 -7
- package/src/ui/a/Tip/Tip.jsx +39 -28
- package/src/ui/a/Tip/styles.scss +7 -13
- package/src/ui/a/ToggleSwitch/ToggleSwitch.jsx +93 -0
- package/src/ui/a/ToggleSwitch/index.js +2 -0
- package/src/ui/a/ToggleSwitch/styles.scss +51 -0
- package/src/ui/a/Tooltip/Tooltip.jsx +106 -0
- package/src/ui/a/Tooltip/index.js +2 -0
- package/src/ui/a/Tooltip/styles.scss +61 -0
- package/src/ui/a/XMLEditor/XMLEditor.jsx +200 -0
- package/src/ui/a/XMLEditor/common/index.js +1 -0
- package/src/ui/a/XMLEditor/common/theme.jsx +184 -0
- package/src/ui/a/XMLEditor/index.js +1 -0
- package/src/ui/a/XMLEditor/styles.scss +24 -0
- package/src/ui/a/index.js +6 -0
- package/src/ui/b/Button/Button.jsx +25 -10
- package/src/ui/b/Button/common/Group/Group.jsx +65 -0
- package/src/ui/b/Button/common/Group/index.js +1 -0
- package/src/ui/b/Button/common/Group/styles.scss +11 -0
- package/src/ui/b/Button/common/index.js +1 -0
- package/src/ui/b/Button/styles.scss +39 -11
- package/src/ui/b/Card/Card.jsx +25 -31
- package/src/ui/b/Card/common/Group/Group.jsx +3 -6
- package/src/ui/b/Card/common/Group/styles.scss +0 -7
- package/src/ui/b/Card/styles.scss +11 -0
- package/src/ui/b/Logo/Logo.jsx +3 -5
- package/src/ui/b/Page/Page.jsx +5 -6
- package/src/ui/b/Page/common/PageHelmet/PageHelmet.jsx +20 -3
- package/src/ui/b/Page/common/Section/Section.jsx +10 -3
- package/src/ui/b/Page/styles.scss +5 -2
- package/src/ui/b/SocialMediaButton/SocialMediaButton.jsx +7 -8
- package/src/ui/b/SocialMediaButton/styles.scss +0 -14
- package/src/ui/b/ThemeSelector/ThemeSelector.jsx +13 -35
- package/src/ui/b/ThemeSelector/styles.scss +44 -6
- package/src/ui/b/Title/Title.jsx +36 -46
- package/src/ui/c/Modal/Modal.jsx +25 -31
- package/src/ui/c/Modal/common/ModalHeader/ModalHeader.jsx +1 -1
- package/src/ui/c/Modal/styles.scss +7 -12
- package/src/ui/c/Shortener/Shortener.jsx +3 -5
- package/src/ui/c/SocialMediaShareButton/SocialMediaShareButton.jsx +2 -6
- package/src/ui/c/index.js +0 -1
- package/src/ui/f/FormInput/FormInput.jsx +26 -5
- package/src/ui/f/common/Debugger/Debugger.jsx +3 -5
- package/src/ui/f/common/Description/Description.jsx +7 -10
- package/src/ui/f/common/Description/styles.scss +1 -2
- package/src/ui/f/common/Label/Label.jsx +20 -28
- package/src/ui/f/common/Label/styles.scss +3 -2
- package/src/ui/f/common/index.js +1 -0
- package/src/ui/f/common/utils/index.js +1 -0
- package/src/ui/f/common/utils/lookUpInputValueFromFetchedOptions.js +23 -0
- package/src/ui/f/fields/Checkbox/Checkbox.jsx +37 -14
- package/src/ui/f/fields/Checkbox/styles.scss +5 -4
- package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +78 -66
- package/src/ui/f/fields/ChoicesInput/common/Choice/Choice.jsx +10 -3
- package/src/ui/f/fields/ChoicesInput/styles.scss +32 -8
- package/src/ui/f/fields/EditorInput/EditorInput.jsx +286 -0
- package/src/ui/f/fields/EditorInput/common/BlockFormatDropDown/BlockFormatDropDown.jsx +292 -0
- package/src/ui/f/fields/EditorInput/common/BlockFormatDropDown/index.js +2 -0
- package/src/ui/f/fields/EditorInput/common/BlockFormatDropDown/styles.scss +55 -0
- package/src/ui/f/fields/EditorInput/common/ColorPicker/ColorPicker.jsx +115 -0
- package/src/ui/f/fields/EditorInput/common/ColorPicker/index.js +2 -0
- package/src/ui/f/fields/EditorInput/common/ColorPicker/styles.scss +36 -0
- package/src/ui/f/fields/EditorInput/common/FontSizeDropDown/FontSizeDropDown.jsx +134 -0
- package/src/ui/f/fields/EditorInput/common/FontSizeDropDown/index.js +2 -0
- package/src/ui/f/fields/EditorInput/common/FontSizeDropDown/styles.scss +55 -0
- package/src/ui/f/fields/EditorInput/common/StopPropagationPlugin.jsx +29 -0
- package/src/ui/f/fields/EditorInput/common/ToolbarPlugin/ToolbarPlugin.jsx +417 -0
- package/src/ui/f/fields/EditorInput/common/ToolbarPlugin/index.js +2 -0
- package/src/ui/f/fields/EditorInput/common/ToolbarPlugin/styles.scss +56 -0
- package/src/ui/f/fields/EditorInput/common/TreeViewPlugin.jsx +16 -0
- package/src/ui/f/fields/EditorInput/common/index.js +6 -0
- package/src/ui/f/fields/EditorInput/index.js +2 -0
- package/src/ui/f/fields/EditorInput/styles.scss +240 -0
- package/src/ui/f/fields/LinkInput/LinkInput.jsx +185 -0
- package/src/ui/f/fields/LinkInput/index.js +2 -0
- package/src/ui/f/fields/LinkInput/styles.scss +90 -0
- package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +41 -12
- package/src/ui/f/fields/QueryCombobox/common/Combobox/Combobox.jsx +51 -14
- package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +101 -39
- package/src/ui/f/fields/QueryCombobox/styles.scss +69 -27
- package/src/ui/f/fields/QuerySelect/QuerySelect.jsx +8 -1
- package/src/ui/f/fields/RatingsInput/RatingsInput.jsx +13 -18
- package/src/ui/f/fields/RatingsInput/common/Rating/Rating.jsx +4 -4
- package/src/ui/f/fields/RatingsInput/styles.scss +7 -10
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +50 -48
- package/src/ui/f/fields/SelectInput/common/Menu/Menu.jsx +103 -0
- package/{dist/es/c/ContentSlides/common/Slide → src/ui/f/fields/SelectInput/common/Menu}/index.js +1 -1
- package/src/ui/f/fields/SelectInput/common/Multiple/Multiple.jsx +288 -0
- package/src/ui/f/fields/SelectInput/common/Multiple/index.js +2 -0
- package/src/ui/f/fields/SelectInput/common/Single/Single.jsx +139 -0
- package/src/ui/f/fields/SelectInput/common/Single/index.js +2 -0
- package/src/ui/f/fields/SelectInput/common/index.js +3 -0
- package/src/ui/f/fields/SelectInput/styles.scss +163 -32
- package/src/ui/f/fields/TextInput/TextInput.jsx +35 -26
- package/src/ui/f/fields/TextInput/styles.scss +59 -22
- package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +22 -31
- package/src/ui/f/fields/TextareaInput/styles.scss +33 -13
- package/src/ui/f/fields/index.js +2 -0
- package/src/ui/form.scss +1 -1
- package/src/ui/g/DragAndDrop/DragAndDrop.jsx +118 -0
- package/src/ui/g/DragAndDrop/common/DraggableItem/DraggableItem.jsx +98 -0
- package/src/ui/g/DragAndDrop/common/DraggableItem/index.js +2 -0
- package/src/ui/g/DragAndDrop/common/DraggableItem/styles.scss +12 -0
- package/src/ui/g/DragAndDrop/common/index.js +1 -0
- package/src/ui/g/DragAndDrop/index.js +2 -0
- package/src/ui/g/DragAndDrop/styles.scss +8 -0
- package/src/ui/g/ExpandableLexicalPreview/ExpandableLexicalPreview.jsx +180 -0
- package/src/ui/g/ExpandableLexicalPreview/common/NewWindowPortal/NewWindowPortal.jsx +80 -0
- package/src/ui/g/ExpandableLexicalPreview/common/NewWindowPortal/index.js +2 -0
- package/src/ui/g/ExpandableLexicalPreview/common/NewWindowPortal/styles.scss +9 -0
- package/src/ui/g/ExpandableLexicalPreview/common/index.js +1 -0
- package/src/ui/g/ExpandableLexicalPreview/index.js +2 -0
- package/src/ui/g/ExpandableLexicalPreview/styles.scss +34 -0
- package/src/ui/g/index.js +2 -0
- package/src/ui/index.js +1 -1
- package/src/ui/utils/hooks/index.js +1 -0
- package/src/ui/utils/hooks/useOutsideClick.js +23 -0
- package/src/ui/utils/index.js +1 -1
- package/tests/__snapshots__/Storyshots.test.js.snap +25444 -8784
- package/tests/mockResizeObserver.js +9 -0
- package/tests/test-setup.js +3 -0
- package/dist/cjs/b/Title/styles.scss +0 -16
- package/dist/cjs/c/ContentSlides/ContentSlides.js +0 -172
- package/dist/cjs/c/ContentSlides/Context.js +0 -11
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +0 -127
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/index.js +0 -13
- package/dist/cjs/c/ContentSlides/common/Navigator/Navigator.js +0 -129
- package/dist/cjs/c/ContentSlides/common/Sidebar/Sidebar.js +0 -95
- package/dist/cjs/c/ContentSlides/common/Slide/Slide.js +0 -76
- package/dist/cjs/c/ContentSlides/common/index.js +0 -33
- package/dist/cjs/c/ContentSlides/index.js +0 -27
- package/dist/cjs/c/ContentSlides/styles.scss +0 -312
- package/dist/cjs/c/ContentSlides/useContentSlides.js +0 -11
- package/dist/cjs/r/SwitchRouteMap/SwitchRouteMap.js +0 -59
- package/dist/cjs/r/SwitchRouteMap/index.js +0 -13
- package/dist/cjs/r/common/PrivateRoute/PrivateRoute.js +0 -75
- package/dist/cjs/r/common/index.js +0 -12
- package/dist/cjs/r/index.js +0 -27
- package/dist/es/b/Title/styles.scss +0 -16
- package/dist/es/c/ContentSlides/ContentSlides.js +0 -162
- package/dist/es/c/ContentSlides/Context.js +0 -2
- package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +0 -116
- package/dist/es/c/ContentSlides/common/HorizontalMenu/index.js +0 -2
- package/dist/es/c/ContentSlides/common/Navigator/Navigator.js +0 -118
- package/dist/es/c/ContentSlides/common/Navigator/index.js +0 -2
- package/dist/es/c/ContentSlides/common/Sidebar/Sidebar.js +0 -84
- package/dist/es/c/ContentSlides/common/Slide/Slide.js +0 -65
- package/dist/es/c/ContentSlides/common/index.js +0 -4
- package/dist/es/c/ContentSlides/index.js +0 -4
- package/dist/es/c/ContentSlides/styles.scss +0 -312
- package/dist/es/c/ContentSlides/useContentSlides.js +0 -3
- package/dist/es/r/SwitchRouteMap/SwitchRouteMap.js +0 -45
- package/dist/es/r/SwitchRouteMap/index.js +0 -2
- package/dist/es/r/common/PrivateRoute/PrivateRoute.js +0 -67
- package/dist/es/r/common/PrivateRoute/index.js +0 -2
- package/dist/es/r/common/index.js +0 -1
- package/dist/es/r/index.js +0 -2
- package/src/stories/c/ContentSlides.stories.jsx +0 -214
- package/src/ui/b/Title/styles.scss +0 -16
- package/src/ui/c/ContentSlides/ContentSlides.jsx +0 -216
- package/src/ui/c/ContentSlides/Context.js +0 -3
- package/src/ui/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.jsx +0 -145
- package/src/ui/c/ContentSlides/common/HorizontalMenu/index.js +0 -2
- package/src/ui/c/ContentSlides/common/Navigator/Navigator.jsx +0 -150
- package/src/ui/c/ContentSlides/common/Navigator/index.js +0 -2
- package/src/ui/c/ContentSlides/common/Sidebar/Sidebar.jsx +0 -135
- package/src/ui/c/ContentSlides/common/Slide/Slide.jsx +0 -87
- package/src/ui/c/ContentSlides/common/index.js +0 -4
- package/src/ui/c/ContentSlides/index.js +0 -4
- package/src/ui/c/ContentSlides/styles.scss +0 -312
- package/src/ui/c/ContentSlides/useContentSlides.js +0 -4
- package/src/ui/r/SwitchRouteMap/SwitchRouteMap.jsx +0 -64
- package/src/ui/r/SwitchRouteMap/index.js +0 -2
- package/src/ui/r/common/PrivateRoute/PrivateRoute.jsx +0 -73
- package/src/ui/r/common/PrivateRoute/index.js +0 -2
- package/src/ui/r/common/index.js +0 -1
- package/src/ui/r/index.js +0 -2
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
|
|
3
|
+
@use "@pareto-engineering/bem";
|
|
4
|
+
@use "react-color-palette/css";
|
|
5
|
+
|
|
6
|
+
$default-width: 20rem;
|
|
7
|
+
|
|
8
|
+
.#{bem.$base}.color-picker {
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
position: relative;
|
|
11
|
+
|
|
12
|
+
> button {
|
|
13
|
+
align-items: center;
|
|
14
|
+
background-color: var(--x);
|
|
15
|
+
border: 0;
|
|
16
|
+
color: var(--on-background-inputs);
|
|
17
|
+
display: flex;
|
|
18
|
+
gap: calc(var(--gap) / 2);
|
|
19
|
+
padding: calc(var(--theme-default-padding) / 2);
|
|
20
|
+
|
|
21
|
+
&:hover {
|
|
22
|
+
background: var(--hard-x);
|
|
23
|
+
border-radius: calc(var(--theme-default-border-radius) / 2);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
> .#{bem.$base}.popover {
|
|
29
|
+
background-color: var(--background-far);
|
|
30
|
+
border: 1px solid var(--hard-background-cards);
|
|
31
|
+
border-radius: calc(var(--theme-default-border-radius) / 2);
|
|
32
|
+
color: var(--heading);
|
|
33
|
+
padding: calc(var(--theme-default-padding) / 2);
|
|
34
|
+
width: $default-width;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useState, useRef, useCallback } from 'react';
|
|
4
|
+
import { $getSelection, $isRangeSelection } from 'lexical';
|
|
5
|
+
import { $patchStyleText } from '@lexical/selection';
|
|
6
|
+
import PropTypes from 'prop-types';
|
|
7
|
+
import styleNames from '@pareto-engineering/bem/exports';
|
|
8
|
+
import "./styles.scss";
|
|
9
|
+
import { Popover } from "../../../../../a";
|
|
10
|
+
import { useOutsideClick } from "../../../../../utils";
|
|
11
|
+
|
|
12
|
+
// Local Definitions
|
|
13
|
+
|
|
14
|
+
const baseClassName = styleNames.base;
|
|
15
|
+
const componentClassName = 'font-size-drop-down';
|
|
16
|
+
const FONT_SIZE_OPTIONS = [['10px', '10px'], ['11px', '11px'], ['12px', '12px'], ['13px', '13px'], ['14px', '14px'], ['15px', '15px'], ['16px', '16px'], ['17px', '17px'], ['18px', '18px'], ['19px', '19px'], ['20px', '20px']];
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* This is the component description.
|
|
20
|
+
*/
|
|
21
|
+
const FontSizeDropDown = ({
|
|
22
|
+
id,
|
|
23
|
+
className: userClassName,
|
|
24
|
+
style,
|
|
25
|
+
editor,
|
|
26
|
+
value
|
|
27
|
+
// ...otherProps
|
|
28
|
+
}) => {
|
|
29
|
+
const parentRef = useRef(null);
|
|
30
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
31
|
+
useOutsideClick(parentRef, () => setIsOpen(false));
|
|
32
|
+
const handleClick = useCallback(option => {
|
|
33
|
+
editor.update(() => {
|
|
34
|
+
const selection = $getSelection();
|
|
35
|
+
if ($isRangeSelection(selection)) {
|
|
36
|
+
$patchStyleText(selection, {
|
|
37
|
+
'font-size': option
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}, [editor]);
|
|
42
|
+
return /*#__PURE__*/React.createElement("button", {
|
|
43
|
+
id: id,
|
|
44
|
+
className: [baseClassName, componentClassName, userClassName, 'group'].filter(e => e).join(' '),
|
|
45
|
+
style: style,
|
|
46
|
+
ref: parentRef,
|
|
47
|
+
type: "button",
|
|
48
|
+
onClick: () => setIsOpen(!isOpen)
|
|
49
|
+
// {...otherProps}
|
|
50
|
+
}, /*#__PURE__*/React.createElement("span", null, value), /*#__PURE__*/React.createElement("span", {
|
|
51
|
+
className: "icon"
|
|
52
|
+
}, "V"), isOpen && /*#__PURE__*/React.createElement(Popover, {
|
|
53
|
+
parentRef: parentRef,
|
|
54
|
+
isOpen: isOpen,
|
|
55
|
+
color: "background-far"
|
|
56
|
+
}, FONT_SIZE_OPTIONS.map(([option, text]) => /*#__PURE__*/React.createElement("button", {
|
|
57
|
+
className: `item ${value === option ? 'active' : ''}`,
|
|
58
|
+
onClick: () => handleClick(option),
|
|
59
|
+
type: "button"
|
|
60
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
61
|
+
className: "text"
|
|
62
|
+
}, text)))));
|
|
63
|
+
};
|
|
64
|
+
FontSizeDropDown.propTypes = {
|
|
65
|
+
/**
|
|
66
|
+
* The HTML id for this element
|
|
67
|
+
*/
|
|
68
|
+
id: PropTypes.string,
|
|
69
|
+
/**
|
|
70
|
+
* The HTML class names for this element
|
|
71
|
+
*/
|
|
72
|
+
className: PropTypes.string,
|
|
73
|
+
/**
|
|
74
|
+
* The React-written, css properties for this element.
|
|
75
|
+
*/
|
|
76
|
+
style: PropTypes.objectOf(PropTypes.string)
|
|
77
|
+
};
|
|
78
|
+
FontSizeDropDown.defaultProps = {
|
|
79
|
+
// someProp:false
|
|
80
|
+
};
|
|
81
|
+
export default FontSizeDropDown;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
|
|
3
|
+
@use "@pareto-engineering/bem";
|
|
4
|
+
|
|
5
|
+
$default-width: 4.5rem;
|
|
6
|
+
|
|
7
|
+
.#{bem.$base}.font-size-drop-down {
|
|
8
|
+
align-items: center;
|
|
9
|
+
background-color: var(--x);
|
|
10
|
+
border: 0;
|
|
11
|
+
color: var(--on-background-inputs);
|
|
12
|
+
cursor: pointer;
|
|
13
|
+
display: flex;
|
|
14
|
+
gap: calc(var(--gap) / 2);
|
|
15
|
+
margin-inline: calc(var(--theme-default-padding) / 4);
|
|
16
|
+
padding: calc(var(--theme-default-padding) / 2);
|
|
17
|
+
position: relative;
|
|
18
|
+
|
|
19
|
+
&:hover {
|
|
20
|
+
background: var(--hard-x);
|
|
21
|
+
border-radius: calc(var(--theme-default-border-radius) / 2);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
> .#{bem.$base}.popover {
|
|
25
|
+
background-color: var(--background-far);
|
|
26
|
+
border: 1px solid var(--hard-background-cards);
|
|
27
|
+
border-radius: calc(var(--theme-default-border-radius) / 2);
|
|
28
|
+
color: var(--heading);
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
padding: calc(var(--theme-default-padding) / 2);
|
|
32
|
+
width: $default-width;
|
|
33
|
+
|
|
34
|
+
> .item {
|
|
35
|
+
align-items: center;
|
|
36
|
+
background-color: var(--x);
|
|
37
|
+
border: 0;
|
|
38
|
+
border-radius: calc(var(--theme-default-border-radius) / 2);
|
|
39
|
+
color: var(--paragraph);
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
display: flex;
|
|
42
|
+
gap: calc(var(--gap) / 2);
|
|
43
|
+
padding: calc(var(--theme-default-padding) / 2);
|
|
44
|
+
transition: all .2s;
|
|
45
|
+
|
|
46
|
+
&:hover {
|
|
47
|
+
background-color: var(--hard-x);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&.active {
|
|
51
|
+
background-color: var(--hard-ui-main);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useInsertionEffect } from 'react';
|
|
2
|
+
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
3
|
+
const StopPropagationPlugin = ({
|
|
4
|
+
stopPropagationKeys
|
|
5
|
+
}) => {
|
|
6
|
+
const [editor] = useLexicalComposerContext();
|
|
7
|
+
useInsertionEffect(() => {
|
|
8
|
+
const onKeyDown = e => {
|
|
9
|
+
if (stopPropagationKeys?.includes(e.key)) {
|
|
10
|
+
e.stopPropagation();
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
return editor.registerRootListener((rootElement, prevRootElement) => {
|
|
14
|
+
if (prevRootElement !== null) {
|
|
15
|
+
prevRootElement.removeEventListener('keydown', onKeyDown);
|
|
16
|
+
}
|
|
17
|
+
if (rootElement !== null) {
|
|
18
|
+
rootElement.addEventListener('keydown', onKeyDown);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
}, [editor]);
|
|
22
|
+
};
|
|
23
|
+
export default StopPropagationPlugin;
|
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies -- required here */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useEffect, useState, useCallback } from 'react';
|
|
4
|
+
import PropTypes from 'prop-types';
|
|
5
|
+
import { mergeRegister, $getNearestNodeOfType, $findMatchingParent } from '@lexical/utils';
|
|
6
|
+
import { $isHeadingNode } from '@lexical/rich-text';
|
|
7
|
+
import { $getSelection, $isRangeSelection, $isRootOrShadowRoot, FORMAT_TEXT_COMMAND, FORMAT_ELEMENT_COMMAND, UNDO_COMMAND, REDO_COMMAND, SELECTION_CHANGE_COMMAND, COMMAND_PRIORITY_CRITICAL, CAN_UNDO_COMMAND, CAN_REDO_COMMAND, DEPRECATED_$isGridSelection } from 'lexical';
|
|
8
|
+
import { $isListNode, ListNode } from '@lexical/list';
|
|
9
|
+
import { $getSelectionStyleValueForProperty, $isAtNodeEnd, $patchStyleText } from '@lexical/selection';
|
|
10
|
+
import { $isLinkNode, TOGGLE_LINK_COMMAND } from '@lexical/link';
|
|
11
|
+
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
12
|
+
import { $isTableNode } from '@lexical/table';
|
|
13
|
+
import styleNames from '@pareto-engineering/bem/exports';
|
|
14
|
+
import { BlockFormatDropDown } from "../BlockFormatDropDown";
|
|
15
|
+
import { ColorPicker } from "../ColorPicker";
|
|
16
|
+
import { FontSizeDropDown } from "../FontSizeDropDown";
|
|
17
|
+
|
|
18
|
+
// Local Definitions
|
|
19
|
+
import "./styles.scss";
|
|
20
|
+
const getSelectedNode = selection => {
|
|
21
|
+
const {
|
|
22
|
+
anchor,
|
|
23
|
+
focus
|
|
24
|
+
} = selection;
|
|
25
|
+
const anchorNode = selection.anchor.getNode();
|
|
26
|
+
const focusNode = selection.focus.getNode();
|
|
27
|
+
if (anchorNode === focusNode) {
|
|
28
|
+
return anchorNode;
|
|
29
|
+
}
|
|
30
|
+
const isBackward = selection.isBackward();
|
|
31
|
+
if (isBackward) {
|
|
32
|
+
return $isAtNodeEnd(focus) ? anchorNode : focusNode;
|
|
33
|
+
}
|
|
34
|
+
return $isAtNodeEnd(anchor) ? focusNode : anchorNode;
|
|
35
|
+
};
|
|
36
|
+
export const blockTypeToBlockName = {
|
|
37
|
+
bullet: 'Bulleted List',
|
|
38
|
+
check: 'Check List',
|
|
39
|
+
code: 'Code Block',
|
|
40
|
+
h1: 'Heading 1',
|
|
41
|
+
h2: 'Heading 2',
|
|
42
|
+
h3: 'Heading 3',
|
|
43
|
+
number: 'Numbered List',
|
|
44
|
+
paragraph: 'Normal',
|
|
45
|
+
quote: 'Quote'
|
|
46
|
+
};
|
|
47
|
+
const baseClassName = styleNames.base;
|
|
48
|
+
const componentClassName = 'toolbar-plugin';
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* This is the component description
|
|
52
|
+
*/
|
|
53
|
+
const ToolbarPlugin = ({
|
|
54
|
+
id,
|
|
55
|
+
className: userClassName,
|
|
56
|
+
style: inlineStyles,
|
|
57
|
+
baseBgColor
|
|
58
|
+
// ...otherProps
|
|
59
|
+
}) => {
|
|
60
|
+
const [editor] = useLexicalComposerContext();
|
|
61
|
+
const [activeEditor, setActiveEditor] = useState(editor);
|
|
62
|
+
const [blockType, setBlockType] = useState('paragraph');
|
|
63
|
+
const [rootType, setRootType] = useState('root');
|
|
64
|
+
const [fontSize, setFontSize] = useState('15px');
|
|
65
|
+
const [isEditable, setIsEditable] = useState(() => editor.isEditable());
|
|
66
|
+
const [isBold, setIsBold] = useState(false);
|
|
67
|
+
const [isItalic, setIsItalic] = useState(false);
|
|
68
|
+
const [isStrikethrough, setIsStrikethrough] = useState(false);
|
|
69
|
+
const [isLink, setIsLink] = useState(false);
|
|
70
|
+
const [isUnderline, setIsUnderline] = useState(false);
|
|
71
|
+
const [canRedo, setCanRedo] = useState(false);
|
|
72
|
+
const [canUndo, setCanUndo] = useState(false);
|
|
73
|
+
const formatLink = useCallback(() => {
|
|
74
|
+
if (!isLink) {
|
|
75
|
+
// eslint-disable-next-line no-alert
|
|
76
|
+
const path = prompt('Enter the full URL. Ex: https://www.example.com');
|
|
77
|
+
editor.dispatchCommand(TOGGLE_LINK_COMMAND, path);
|
|
78
|
+
} else {
|
|
79
|
+
editor.dispatchCommand(TOGGLE_LINK_COMMAND, null);
|
|
80
|
+
}
|
|
81
|
+
}, [editor, isLink]);
|
|
82
|
+
const $updateToolbar = useCallback(() => {
|
|
83
|
+
const selection = $getSelection();
|
|
84
|
+
if ($isRangeSelection(selection)) {
|
|
85
|
+
const anchorNode = selection.anchor.getNode();
|
|
86
|
+
let element = anchorNode.getKey() === 'root' ? anchorNode : $findMatchingParent(anchorNode, e => {
|
|
87
|
+
const parent = e.getParent();
|
|
88
|
+
return parent !== null && $isRootOrShadowRoot(parent);
|
|
89
|
+
});
|
|
90
|
+
if (element === null) {
|
|
91
|
+
element = anchorNode.getTopLevelElementOrThrow();
|
|
92
|
+
}
|
|
93
|
+
const elementKey = element.getKey();
|
|
94
|
+
const elementDOM = activeEditor.getElementByKey(elementKey);
|
|
95
|
+
|
|
96
|
+
// Update text format
|
|
97
|
+
setIsBold(selection.hasFormat('bold'));
|
|
98
|
+
setIsItalic(selection.hasFormat('italic'));
|
|
99
|
+
setIsUnderline(selection.hasFormat('underline'));
|
|
100
|
+
setIsStrikethrough(selection.hasFormat('strikethrough'));
|
|
101
|
+
|
|
102
|
+
// Update links
|
|
103
|
+
const node = getSelectedNode(selection);
|
|
104
|
+
const parent = node.getParent();
|
|
105
|
+
if ($isLinkNode(parent) || $isLinkNode(node)) {
|
|
106
|
+
setIsLink(true);
|
|
107
|
+
} else {
|
|
108
|
+
setIsLink(false);
|
|
109
|
+
}
|
|
110
|
+
const tableNode = $findMatchingParent(node, $isTableNode);
|
|
111
|
+
if ($isTableNode(tableNode)) {
|
|
112
|
+
setRootType('table');
|
|
113
|
+
} else {
|
|
114
|
+
setRootType('root');
|
|
115
|
+
}
|
|
116
|
+
if (elementDOM !== null) {
|
|
117
|
+
if ($isListNode(element)) {
|
|
118
|
+
const parentList = $getNearestNodeOfType(anchorNode, ListNode);
|
|
119
|
+
const type = parentList ? parentList.getListType() : element.getListType();
|
|
120
|
+
setBlockType(type);
|
|
121
|
+
} else {
|
|
122
|
+
const type = $isHeadingNode(element) ? element.getTag() : element.getType();
|
|
123
|
+
if (type in blockTypeToBlockName) {
|
|
124
|
+
setBlockType(type);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
setFontSize($getSelectionStyleValueForProperty(selection, 'font-size', '15px'));
|
|
129
|
+
}
|
|
130
|
+
}, [activeEditor]);
|
|
131
|
+
useEffect(() => editor.registerCommand(SELECTION_CHANGE_COMMAND, (_payload, newEditor) => {
|
|
132
|
+
$updateToolbar();
|
|
133
|
+
setActiveEditor(newEditor);
|
|
134
|
+
return false;
|
|
135
|
+
}, COMMAND_PRIORITY_CRITICAL), [editor, $updateToolbar]);
|
|
136
|
+
useEffect(() => mergeRegister(editor.registerEditableListener(editable => {
|
|
137
|
+
setIsEditable(editable);
|
|
138
|
+
}), activeEditor.registerUpdateListener(({
|
|
139
|
+
editorState
|
|
140
|
+
}) => {
|
|
141
|
+
editorState.read(() => {
|
|
142
|
+
$updateToolbar();
|
|
143
|
+
});
|
|
144
|
+
}), activeEditor.registerCommand(CAN_UNDO_COMMAND, payload => {
|
|
145
|
+
setCanUndo(payload);
|
|
146
|
+
return false;
|
|
147
|
+
}, COMMAND_PRIORITY_CRITICAL), activeEditor.registerCommand(CAN_REDO_COMMAND, payload => {
|
|
148
|
+
setCanRedo(payload);
|
|
149
|
+
return false;
|
|
150
|
+
}, COMMAND_PRIORITY_CRITICAL)), [$updateToolbar, activeEditor, editor]);
|
|
151
|
+
const applyStyleText = useCallback(styles => {
|
|
152
|
+
activeEditor.update(() => {
|
|
153
|
+
const selection = $getSelection();
|
|
154
|
+
if ($isRangeSelection(selection) || DEPRECATED_$isGridSelection(selection)) {
|
|
155
|
+
$patchStyleText(selection, styles);
|
|
156
|
+
}
|
|
157
|
+
});
|
|
158
|
+
}, [activeEditor]);
|
|
159
|
+
const onFontColorSelect = useCallback(value => {
|
|
160
|
+
applyStyleText({
|
|
161
|
+
color: value
|
|
162
|
+
});
|
|
163
|
+
}, [applyStyleText]);
|
|
164
|
+
const onBgColorSelect = useCallback(value => {
|
|
165
|
+
applyStyleText({
|
|
166
|
+
'background-color': value
|
|
167
|
+
});
|
|
168
|
+
}, [applyStyleText]);
|
|
169
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
170
|
+
id: id,
|
|
171
|
+
className: [baseClassName, componentClassName, userClassName, `x-${baseBgColor}`].filter(e => e).join(' '),
|
|
172
|
+
style: inlineStyles
|
|
173
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
174
|
+
className: "group"
|
|
175
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
176
|
+
type: "button",
|
|
177
|
+
onClick: () => editor.dispatchCommand(UNDO_COMMAND),
|
|
178
|
+
className: "ai-icon",
|
|
179
|
+
disabled: !canUndo || !isEditable
|
|
180
|
+
}, "A"), /*#__PURE__*/React.createElement("button", {
|
|
181
|
+
type: "button",
|
|
182
|
+
className: "ai-icon",
|
|
183
|
+
onClick: () => editor.dispatchCommand(REDO_COMMAND),
|
|
184
|
+
disabled: !canRedo || !isEditable
|
|
185
|
+
}, "B")), /*#__PURE__*/React.createElement(BlockFormatDropDown, {
|
|
186
|
+
blockType: blockType,
|
|
187
|
+
editor: editor,
|
|
188
|
+
rootType: rootType
|
|
189
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
190
|
+
className: "group"
|
|
191
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
192
|
+
type: "button",
|
|
193
|
+
className: isBold ? 'active' : undefined,
|
|
194
|
+
onClick: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'bold')
|
|
195
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
196
|
+
className: "icon"
|
|
197
|
+
}, "|")), /*#__PURE__*/React.createElement("button", {
|
|
198
|
+
type: "button",
|
|
199
|
+
className: isItalic ? 'active' : undefined,
|
|
200
|
+
onClick: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'italic')
|
|
201
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
202
|
+
className: "icon"
|
|
203
|
+
}, "}")), /*#__PURE__*/React.createElement("button", {
|
|
204
|
+
type: "button",
|
|
205
|
+
className: isUnderline ? 'active' : undefined,
|
|
206
|
+
onClick: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'underline')
|
|
207
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
208
|
+
className: "icon"
|
|
209
|
+
}, "~")), /*#__PURE__*/React.createElement("button", {
|
|
210
|
+
type: "button",
|
|
211
|
+
className: isStrikethrough ? 'active' : undefined,
|
|
212
|
+
onClick: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'strikethrough')
|
|
213
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
214
|
+
className: "icon"
|
|
215
|
+
}, "?")), /*#__PURE__*/React.createElement("button", {
|
|
216
|
+
type: "button",
|
|
217
|
+
className: isLink ? 'active' : undefined,
|
|
218
|
+
onClick: formatLink
|
|
219
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
220
|
+
className: "icon"
|
|
221
|
+
}, "]"))), /*#__PURE__*/React.createElement(FontSizeDropDown, {
|
|
222
|
+
editor: editor,
|
|
223
|
+
value: fontSize
|
|
224
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
225
|
+
className: "group"
|
|
226
|
+
}, /*#__PURE__*/React.createElement(ColorPicker, {
|
|
227
|
+
icon: "'",
|
|
228
|
+
onChange: onFontColorSelect
|
|
229
|
+
}), /*#__PURE__*/React.createElement(ColorPicker, {
|
|
230
|
+
icon: "#",
|
|
231
|
+
onChange: onBgColorSelect
|
|
232
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
233
|
+
className: "group"
|
|
234
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
235
|
+
type: "button",
|
|
236
|
+
onClick: () => editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'left')
|
|
237
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
238
|
+
className: "icon"
|
|
239
|
+
}, "^")), /*#__PURE__*/React.createElement("button", {
|
|
240
|
+
type: "button",
|
|
241
|
+
onClick: () => editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'center')
|
|
242
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
243
|
+
className: "icon"
|
|
244
|
+
}, "_")), /*#__PURE__*/React.createElement("button", {
|
|
245
|
+
type: "button",
|
|
246
|
+
onClick: () => editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'right')
|
|
247
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
248
|
+
className: "icon"
|
|
249
|
+
}, "`")), /*#__PURE__*/React.createElement("button", {
|
|
250
|
+
type: "button",
|
|
251
|
+
onClick: () => editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'justify')
|
|
252
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
253
|
+
className: "icon"
|
|
254
|
+
}, "{"))));
|
|
255
|
+
};
|
|
256
|
+
ToolbarPlugin.propTypes = {
|
|
257
|
+
/**
|
|
258
|
+
* The HTML id for this element
|
|
259
|
+
*/
|
|
260
|
+
id: PropTypes.string,
|
|
261
|
+
/**
|
|
262
|
+
* The HTML class names for this element
|
|
263
|
+
*/
|
|
264
|
+
className: PropTypes.string,
|
|
265
|
+
/**
|
|
266
|
+
* The React-written, css properties for this element.
|
|
267
|
+
*/
|
|
268
|
+
style: PropTypes.objectOf(PropTypes.string),
|
|
269
|
+
/**
|
|
270
|
+
* Base background color
|
|
271
|
+
*/
|
|
272
|
+
baseBgColor: PropTypes.string
|
|
273
|
+
};
|
|
274
|
+
ToolbarPlugin.defaultProps = {
|
|
275
|
+
baseBgColor: 'background-far'
|
|
276
|
+
};
|
|
277
|
+
export default ToolbarPlugin;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
|
|
3
|
+
@use "@pareto-engineering/bem";
|
|
4
|
+
@use "@pareto-engineering/styles/src/mixins";
|
|
5
|
+
@use "@pareto-engineering/styles/src/globals" as *;
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
$default-gap: calc(var(--gap) / 2);
|
|
9
|
+
$default-padding: .55em .75em;
|
|
10
|
+
$default-input-border-radius: var(--theme-default-input-border-radius);
|
|
11
|
+
$default-border: var(--theme-default-input-border);
|
|
12
|
+
$default-icon-color: var(--soft-ui-icons);
|
|
13
|
+
|
|
14
|
+
.#{bem.$base}.toolbar-plugin {
|
|
15
|
+
align-items: center;
|
|
16
|
+
border-inline: $default-border;
|
|
17
|
+
border-top: $default-border;
|
|
18
|
+
border-top-left-radius: $default-input-border-radius;
|
|
19
|
+
border-top-right-radius: $default-input-border-radius;
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-wrap: wrap;
|
|
22
|
+
padding-block: calc(var(--theme-default-padding) / 4);
|
|
23
|
+
|
|
24
|
+
> .ds + .group {
|
|
25
|
+
border-left: 1px solid var(--soft-background-inputs);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
> .group {
|
|
29
|
+
display: flex;
|
|
30
|
+
gap: calc(var(--gap) / 2);
|
|
31
|
+
|
|
32
|
+
> button {
|
|
33
|
+
background: var(--x);
|
|
34
|
+
border: 0;
|
|
35
|
+
border-radius: calc(var(--theme-default-border-radius) / 2);
|
|
36
|
+
color: $default-icon-color;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
margin: 0;
|
|
39
|
+
padding: $default-padding;
|
|
40
|
+
|
|
41
|
+
&:hover,
|
|
42
|
+
&.active {
|
|
43
|
+
background: var(--hard-x);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&:not(.#{bem.$base}) {
|
|
48
|
+
padding-inline: calc(var(--theme-default-padding) / 4);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
&:not(:last-child, .#{bem.$base}) {
|
|
53
|
+
border-right: 1px solid var(--soft-background-inputs);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
3
|
+
import { TreeView } from '@lexical/react/LexicalTreeView';
|
|
4
|
+
const TreeViewPlugin = () => {
|
|
5
|
+
const [editor] = useLexicalComposerContext();
|
|
6
|
+
return /*#__PURE__*/React.createElement(TreeView, {
|
|
7
|
+
viewClassName: "tree-view-output",
|
|
8
|
+
editor: editor
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
export default TreeViewPlugin;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { BlockFormatDropDown } from "./BlockFormatDropDown";
|
|
2
|
+
export { default as TreeViewPlugin } from "./TreeViewPlugin";
|
|
3
|
+
export { default as StopPropagationPlugin } from "./StopPropagationPlugin";
|
|
4
|
+
export { ToolbarPlugin } from "./ToolbarPlugin";
|
|
5
|
+
export { ColorPicker } from "./ColorPicker";
|
|
6
|
+
export { FontSizeDropDown } from "./FontSizeDropDown";
|