@pareto-engineering/design-system 4.0.0-alpha.5 → 4.0.0-alpha.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/a/AnimatedBlobs/AnimatedBlobs.js +90 -0
- package/dist/cjs/a/AnimatedBlobs/index.js +13 -0
- package/dist/cjs/a/AnimatedBlobs/styles.scss +87 -0
- package/dist/cjs/a/AnimatedGradient/AnimatedGradient.js +60 -0
- package/dist/cjs/a/AnimatedGradient/index.js +13 -0
- package/dist/cjs/a/AnimatedGradient/styles.scss +14 -0
- package/dist/cjs/a/AnimatedGradient/webGIRenderer.js +528 -0
- package/dist/cjs/a/AppContext/ContextProvider.js +0 -2
- package/dist/cjs/a/AppContext/useTheme.js +0 -4
- package/dist/cjs/a/BlurOverlay/BlurOverlay.js +59 -0
- package/dist/cjs/a/BlurOverlay/index.js +13 -0
- package/dist/cjs/a/BlurOverlay/styles.scss +31 -0
- package/dist/cjs/a/ContentTree/ContentTree.js +10 -4
- package/dist/cjs/a/ContentTree/common/Tree/Tree.js +12 -5
- package/dist/cjs/a/ContentTree/styles.scss +34 -11
- package/dist/cjs/a/Conversation/Conversation.js +11 -16
- package/dist/cjs/a/Conversation/common/Message/Message.js +15 -12
- package/dist/cjs/a/Conversation/styles.scss +56 -124
- package/dist/cjs/a/DotInfo/DotInfo.js +1 -1
- package/dist/cjs/a/Figure/Figure.js +1 -1
- package/dist/cjs/a/HamburgerButton/HamburgerButton.js +1 -1
- package/dist/cjs/a/IconList/IconList.js +1 -1
- package/dist/cjs/a/IconList/common/Item/Item.js +1 -1
- package/dist/cjs/a/Label/Label.js +13 -5
- package/dist/cjs/a/Label/styles.scss +4 -4
- package/dist/cjs/a/LoadingCircle/LoadingCircle.js +1 -1
- package/dist/cjs/a/MetaCard/MetaCard.js +65 -0
- package/dist/cjs/a/MetaCard/index.js +13 -0
- package/dist/cjs/a/MetaCard/styles.scss +45 -0
- package/dist/cjs/a/People/People.js +1 -1
- package/dist/cjs/a/People/common/Person/Person.js +5 -5
- package/dist/cjs/a/People/styles.scss +10 -4
- package/dist/cjs/a/Popover/Popover.js +3 -3
- package/dist/cjs/a/Popover/styles.scss +1 -1
- package/dist/cjs/a/ProgressBar/ProgressBar.js +1 -1
- package/dist/cjs/a/Quote/Quote.js +1 -1
- package/dist/cjs/a/Removable/Removable.js +72 -0
- package/dist/cjs/a/Removable/index.js +13 -0
- package/dist/cjs/a/Removable/styles.scss +33 -0
- package/dist/cjs/a/SVG/SVG.js +1 -1
- package/dist/cjs/a/SnapScroller/SnapScroller.js +1 -1
- package/dist/cjs/a/SnapScroller/styles.scss +30 -10
- package/dist/cjs/a/Spinner/Spinner.js +1 -1
- package/dist/cjs/a/TextSteps/TextSteps.js +70 -0
- package/dist/cjs/a/TextSteps/index.js +13 -0
- package/dist/cjs/a/TextSteps/styles.scss +29 -0
- package/dist/cjs/a/Timestamp/Timestamp.js +1 -1
- package/dist/cjs/a/Tip/Tip.js +86 -0
- package/dist/cjs/a/Tip/index.js +13 -0
- package/dist/cjs/a/Tip/styles.scss +16 -0
- package/dist/cjs/a/index.js +50 -1
- package/dist/cjs/b/Button/Button.js +22 -9
- package/dist/cjs/b/Button/common/Group/Group.js +57 -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 +41 -11
- package/dist/cjs/b/Card/Card.js +74 -0
- package/dist/cjs/b/Card/common/Group/Group.js +73 -0
- package/dist/cjs/b/Card/common/Group/index.js +13 -0
- package/dist/cjs/b/Card/common/Group/styles.scss +35 -0
- package/dist/cjs/b/Card/common/Section/Section.js +59 -0
- package/dist/cjs/b/Card/common/Section/index.js +13 -0
- package/dist/cjs/b/Card/common/index.js +19 -0
- package/dist/cjs/b/Card/index.js +13 -0
- package/dist/cjs/b/Card/styles.scss +57 -0
- package/dist/cjs/b/Logo/Logo.js +1 -1
- package/dist/cjs/b/Page/Page.js +15 -5
- package/dist/cjs/b/Page/common/PageHelmet/PageHelmet.js +12 -2
- package/dist/cjs/b/Page/common/Section/Section.js +13 -3
- package/dist/cjs/b/Page/styles.scss +25 -4
- package/dist/cjs/b/SocialMediaButton/SocialMediaButton.js +6 -2
- package/dist/cjs/b/SocialMediaButton/styles.scss +0 -14
- package/dist/cjs/b/ThemeSelector/ThemeSelector.js +17 -27
- package/dist/cjs/b/ThemeSelector/styles.scss +44 -6
- package/dist/cjs/b/Title/Title.js +1 -2
- package/dist/cjs/b/index.js +8 -1
- package/dist/cjs/c/ContentSlides/ContentSlides.js +1 -1
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +1 -3
- package/dist/cjs/c/ContentSlides/common/Sidebar/Sidebar.js +0 -2
- package/dist/cjs/c/ContentSlides/styles.scss +2 -2
- package/dist/cjs/c/Modal/Modal.js +2 -2
- package/dist/cjs/c/Modal/common/ModalHeader/ModalHeader.js +1 -1
- package/dist/cjs/c/Modal/styles.scss +7 -12
- package/dist/cjs/c/Shortener/Shortener.js +1 -1
- package/dist/cjs/c/SocialMediaShareButton/SocialMediaShareButton.js +1 -1
- package/dist/cjs/f/FormInput/FormInput.js +13 -3
- package/dist/cjs/f/common/Debugger/Debugger.js +1 -1
- package/dist/cjs/f/common/Description/Description.js +6 -5
- package/dist/cjs/f/common/InputWrapper/InputWrapper.js +74 -0
- package/dist/cjs/f/common/InputWrapper/index.js +13 -0
- package/dist/cjs/f/common/InputWrapper/styles.scss +13 -0
- package/dist/cjs/f/common/Label/Label.js +19 -5
- package/dist/cjs/f/common/Label/styles.scss +8 -2
- package/dist/cjs/f/common/index.js +8 -1
- package/dist/cjs/f/fields/Checkbox/Checkbox.js +41 -11
- package/dist/cjs/f/fields/Checkbox/styles.scss +7 -8
- package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +56 -25
- package/dist/cjs/f/fields/ChoicesInput/common/Choice/Choice.js +2 -2
- package/dist/cjs/f/fields/ChoicesInput/styles.scss +52 -43
- package/dist/cjs/f/fields/EditorInput/EditorInput.js +222 -0
- package/dist/cjs/f/fields/EditorInput/common/Toolbar.js +257 -0
- package/dist/cjs/f/fields/EditorInput/common/TreeViewPlugin.js +19 -0
- package/dist/cjs/f/fields/EditorInput/common/index.js +20 -0
- package/dist/cjs/f/fields/EditorInput/index.js +13 -0
- package/dist/cjs/f/fields/EditorInput/styles.scss +147 -0
- package/dist/cjs/f/fields/LinkInput/LinkInput.js +164 -0
- package/dist/cjs/f/fields/LinkInput/index.js +13 -0
- package/dist/cjs/f/fields/LinkInput/styles.scss +89 -0
- package/dist/cjs/f/fields/QueryChoices/QueryChoices.js +27 -3
- package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +36 -6
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +44 -17
- package/dist/cjs/f/fields/QueryCombobox/common/Menu/Menu.js +1 -1
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +36 -26
- package/dist/cjs/f/fields/QueryCombobox/styles.scss +64 -30
- package/dist/cjs/f/fields/QuerySelect/QuerySelect.js +17 -3
- package/dist/cjs/f/fields/RatingsInput/RatingsInput.js +42 -20
- package/dist/cjs/f/fields/RatingsInput/common/Rating/Rating.js +5 -5
- package/dist/cjs/f/fields/RatingsInput/styles.scss +6 -13
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +46 -16
- package/dist/cjs/f/fields/SelectInput/styles.scss +60 -26
- package/dist/cjs/f/fields/TextInput/TextInput.js +51 -18
- package/dist/cjs/f/fields/TextInput/styles.scss +56 -20
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +44 -23
- package/dist/cjs/f/fields/TextareaInput/styles.scss +42 -25
- package/dist/cjs/f/fields/index.js +15 -1
- package/dist/cjs/form.scss +1 -1
- package/dist/cjs/r/SwitchRouteMap/SwitchRouteMap.js +1 -1
- package/dist/cjs/r/common/PrivateRoute/PrivateRoute.js +1 -1
- package/dist/cjs/test/QueryLoader/QueryLoader.js +2 -0
- package/dist/es/a/AnimatedBlobs/AnimatedBlobs.js +82 -0
- package/dist/es/a/AnimatedBlobs/index.js +1 -0
- package/dist/es/a/AnimatedBlobs/styles.scss +87 -0
- package/dist/es/a/AnimatedGradient/AnimatedGradient.js +52 -0
- package/dist/es/a/AnimatedGradient/index.js +1 -0
- package/dist/es/a/AnimatedGradient/styles.scss +14 -0
- package/dist/es/a/AnimatedGradient/webGIRenderer.js +492 -0
- package/dist/es/a/AppContext/useTheme.js +0 -4
- package/dist/es/a/BlurOverlay/BlurOverlay.js +51 -0
- package/dist/es/a/BlurOverlay/index.js +2 -0
- package/dist/es/a/BlurOverlay/styles.scss +31 -0
- package/dist/es/a/ContentTree/ContentTree.js +9 -3
- 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 +10 -15
- package/dist/es/a/Conversation/common/Message/Message.js +15 -12
- package/dist/es/a/Conversation/styles.scss +56 -124
- package/dist/es/a/Label/Label.js +12 -4
- package/dist/es/a/Label/styles.scss +4 -4
- package/dist/es/a/MetaCard/MetaCard.js +57 -0
- package/dist/es/a/MetaCard/index.js +1 -0
- package/dist/es/a/MetaCard/styles.scss +45 -0
- package/dist/es/a/People/common/Person/Person.js +5 -5
- package/dist/es/a/People/styles.scss +10 -4
- package/dist/es/a/Popover/Popover.js +2 -2
- package/dist/es/a/Popover/styles.scss +1 -1
- package/dist/es/a/Removable/Removable.js +64 -0
- package/dist/es/a/Removable/index.js +2 -0
- package/dist/es/a/Removable/styles.scss +33 -0
- package/dist/es/a/SnapScroller/styles.scss +30 -10
- package/dist/es/a/TextSteps/TextSteps.js +61 -0
- package/dist/es/a/TextSteps/index.js +1 -0
- package/dist/es/a/TextSteps/styles.scss +29 -0
- package/dist/es/a/Tip/Tip.js +78 -0
- package/dist/es/a/Tip/index.js +2 -0
- package/dist/es/a/Tip/styles.scss +16 -0
- package/dist/es/a/index.js +8 -1
- package/dist/es/b/Button/Button.js +22 -8
- package/dist/es/b/Button/common/Group/Group.js +49 -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 +41 -11
- package/dist/es/b/Card/Card.js +66 -0
- package/dist/es/b/Card/common/Group/Group.js +65 -0
- package/dist/es/b/Card/common/Group/index.js +1 -0
- package/dist/es/b/Card/common/Group/styles.scss +35 -0
- package/dist/es/b/Card/common/Section/Section.js +48 -0
- package/dist/es/b/Card/common/Section/index.js +1 -0
- package/dist/es/b/Card/common/index.js +2 -0
- package/dist/es/b/Card/index.js +1 -0
- package/dist/es/b/Card/styles.scss +57 -0
- package/dist/es/b/Page/Page.js +14 -3
- package/dist/es/b/Page/common/PageHelmet/PageHelmet.js +12 -2
- package/dist/es/b/Page/common/Section/Section.js +12 -2
- package/dist/es/b/Page/styles.scss +25 -4
- package/dist/es/b/SocialMediaButton/SocialMediaButton.js +5 -1
- package/dist/es/b/SocialMediaButton/styles.scss +0 -14
- package/dist/es/b/ThemeSelector/ThemeSelector.js +16 -27
- package/dist/es/b/ThemeSelector/styles.scss +44 -6
- package/dist/es/b/index.js +2 -1
- package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +1 -1
- package/dist/es/c/ContentSlides/styles.scss +2 -2
- package/dist/es/c/Modal/Modal.js +1 -1
- package/dist/es/c/Modal/common/ModalHeader/ModalHeader.js +1 -1
- package/dist/es/c/Modal/styles.scss +7 -12
- package/dist/es/f/FormInput/FormInput.js +13 -1
- package/dist/es/f/common/Description/Description.js +5 -4
- package/dist/es/f/common/InputWrapper/InputWrapper.js +66 -0
- package/dist/es/f/common/InputWrapper/index.js +2 -0
- package/dist/es/f/common/InputWrapper/styles.scss +13 -0
- package/dist/es/f/common/Label/Label.js +18 -4
- package/dist/es/f/common/Label/styles.scss +8 -2
- package/dist/es/f/common/index.js +2 -1
- package/dist/es/f/fields/Checkbox/Checkbox.js +41 -11
- package/dist/es/f/fields/Checkbox/styles.scss +7 -8
- package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +56 -25
- package/dist/es/f/fields/ChoicesInput/common/Choice/Choice.js +1 -1
- package/dist/es/f/fields/ChoicesInput/styles.scss +52 -43
- package/dist/es/f/fields/EditorInput/EditorInput.js +217 -0
- package/dist/es/f/fields/EditorInput/common/Toolbar.js +246 -0
- package/dist/es/f/fields/EditorInput/common/TreeViewPlugin.js +11 -0
- package/dist/es/f/fields/EditorInput/common/index.js +2 -0
- package/dist/es/f/fields/EditorInput/index.js +2 -0
- package/dist/es/f/fields/EditorInput/styles.scss +147 -0
- package/dist/es/f/fields/LinkInput/LinkInput.js +156 -0
- package/dist/es/f/fields/LinkInput/index.js +2 -0
- package/dist/es/f/fields/LinkInput/styles.scss +89 -0
- package/dist/es/f/fields/QueryChoices/QueryChoices.js +26 -2
- package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +35 -5
- package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +43 -16
- package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +35 -25
- package/dist/es/f/fields/QueryCombobox/styles.scss +64 -30
- package/dist/es/f/fields/QuerySelect/QuerySelect.js +17 -3
- package/dist/es/f/fields/RatingsInput/RatingsInput.js +42 -20
- package/dist/es/f/fields/RatingsInput/common/Rating/Rating.js +4 -4
- package/dist/es/f/fields/RatingsInput/styles.scss +6 -13
- package/dist/es/f/fields/SelectInput/SelectInput.js +46 -16
- package/dist/es/f/fields/SelectInput/styles.scss +60 -26
- package/dist/es/f/fields/TextInput/TextInput.js +51 -18
- package/dist/es/f/fields/TextInput/styles.scss +56 -20
- package/dist/es/f/fields/TextareaInput/TextareaInput.js +44 -23
- package/dist/es/f/fields/TextareaInput/styles.scss +42 -25
- package/dist/es/f/fields/index.js +3 -1
- package/dist/es/form.scss +1 -1
- package/package.json +18 -15
- 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/MetaCard.stories.jsx +35 -0
- package/src/stories/a/People.stories.jsx +22 -2
- package/src/stories/a/Quote.stories.jsx +1 -1
- 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/TextSteps.stories.jsx +19 -0
- package/src/stories/a/Tip.stories.jsx +29 -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/Card/Card.stories.jsx +59 -0
- package/src/stories/b/Card/Group.stories.jsx +59 -0
- package/src/stories/b/Page.stories.jsx +19 -3
- 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/c/ContentSlides.stories.jsx +1 -1
- package/src/stories/colors.js +22 -28
- package/src/stories/f/Checkbox.stories.jsx +22 -7
- package/src/stories/f/ChoicesInput.stories.jsx +21 -7
- package/src/stories/f/EditorInput.stories.jsx +88 -0
- package/src/stories/f/LinkInput.stories.jsx +100 -0
- package/src/stories/f/QueryChoices.stories.jsx +20 -4
- package/src/stories/f/QueryCombobox.stories.jsx +25 -13
- package/src/stories/f/QuerySelect.stories.jsx +20 -5
- package/src/stories/f/RatingsInput.stories.jsx +16 -2
- package/src/stories/f/SelectInput.stories.jsx +27 -5
- package/src/stories/f/TextInput.stories.jsx +33 -12
- package/src/stories/f/TextareaInput.stories.jsx +16 -2
- package/src/ui/a/AnimatedBlobs/AnimatedBlobs.jsx +102 -0
- package/src/ui/a/AnimatedBlobs/index.js +1 -0
- package/src/ui/a/AnimatedBlobs/styles.scss +87 -0
- package/src/ui/a/AnimatedGradient/AnimatedGradient.jsx +73 -0
- package/src/ui/a/AnimatedGradient/index.js +1 -0
- package/src/ui/a/AnimatedGradient/styles.scss +14 -0
- package/src/ui/a/AnimatedGradient/webGIRenderer.js +541 -0
- package/src/ui/a/AppContext/useTheme.js +0 -4
- package/src/ui/a/BlurOverlay/BlurOverlay.jsx +75 -0
- package/src/ui/a/BlurOverlay/index.js +2 -0
- package/src/ui/a/BlurOverlay/styles.scss +31 -0
- package/src/ui/a/ContentTree/ContentTree.jsx +8 -4
- 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 +14 -18
- package/src/ui/a/Conversation/common/Message/Message.jsx +18 -11
- package/src/ui/a/Conversation/styles.scss +56 -124
- package/src/ui/a/Label/Label.jsx +11 -2
- package/src/ui/a/Label/styles.scss +4 -4
- package/src/ui/a/MetaCard/MetaCard.jsx +81 -0
- package/src/ui/a/MetaCard/index.js +1 -0
- package/src/ui/a/MetaCard/styles.scss +45 -0
- package/src/ui/a/People/common/Person/Person.jsx +5 -5
- package/src/ui/a/People/styles.scss +10 -4
- package/src/ui/a/Popover/Popover.jsx +2 -2
- package/src/ui/a/Popover/styles.scss +1 -1
- package/src/ui/a/Removable/Removable.jsx +85 -0
- package/src/ui/a/Removable/index.js +2 -0
- package/src/ui/a/Removable/styles.scss +33 -0
- package/src/ui/a/SnapScroller/styles.scss +30 -10
- package/src/ui/a/TextSteps/TextSteps.jsx +87 -0
- package/src/ui/a/TextSteps/index.js +1 -0
- package/src/ui/a/TextSteps/styles.scss +29 -0
- package/src/ui/a/Tip/Tip.jsx +105 -0
- package/src/ui/a/Tip/index.js +2 -0
- package/src/ui/a/Tip/styles.scss +16 -0
- package/src/ui/a/index.js +7 -0
- package/src/ui/b/Button/Button.jsx +28 -8
- package/src/ui/b/Button/common/Group/Group.jsx +71 -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 +41 -11
- package/src/ui/b/Card/Card.jsx +94 -0
- package/src/ui/b/Card/common/Group/Group.jsx +91 -0
- package/src/ui/b/Card/common/Group/index.js +1 -0
- package/src/ui/b/Card/common/Group/styles.scss +35 -0
- package/src/ui/b/Card/common/Section/Section.jsx +70 -0
- package/src/ui/b/Card/common/Section/index.js +1 -0
- package/src/ui/b/Card/common/index.js +2 -0
- package/src/ui/b/Card/index.js +1 -0
- package/src/ui/b/Card/styles.scss +57 -0
- package/src/ui/b/Page/Page.jsx +11 -1
- package/src/ui/b/Page/common/PageHelmet/PageHelmet.jsx +14 -3
- package/src/ui/b/Page/common/Section/Section.jsx +16 -1
- package/src/ui/b/Page/styles.scss +25 -4
- package/src/ui/b/SocialMediaButton/SocialMediaButton.jsx +5 -1
- package/src/ui/b/SocialMediaButton/styles.scss +0 -14
- package/src/ui/b/ThemeSelector/ThemeSelector.jsx +16 -29
- package/src/ui/b/ThemeSelector/styles.scss +44 -6
- package/src/ui/b/index.js +1 -0
- package/src/ui/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.jsx +1 -1
- package/src/ui/c/ContentSlides/styles.scss +2 -2
- package/src/ui/c/Modal/Modal.jsx +1 -1
- package/src/ui/c/Modal/common/ModalHeader/ModalHeader.jsx +1 -1
- package/src/ui/c/Modal/styles.scss +7 -12
- package/src/ui/f/FormInput/FormInput.jsx +23 -0
- package/src/ui/f/common/Description/Description.jsx +5 -4
- package/src/ui/f/common/InputWrapper/InputWrapper.jsx +89 -0
- package/src/ui/f/common/InputWrapper/index.js +2 -0
- package/src/ui/f/common/InputWrapper/styles.scss +13 -0
- package/src/ui/f/common/Label/Label.jsx +18 -2
- package/src/ui/f/common/Label/styles.scss +8 -2
- package/src/ui/f/common/index.js +1 -0
- package/src/ui/f/fields/Checkbox/Checkbox.jsx +65 -27
- package/src/ui/f/fields/Checkbox/styles.scss +7 -8
- package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +83 -48
- package/src/ui/f/fields/ChoicesInput/common/Choice/Choice.jsx +10 -3
- package/src/ui/f/fields/ChoicesInput/styles.scss +52 -43
- package/src/ui/f/fields/EditorInput/EditorInput.jsx +272 -0
- package/src/ui/f/fields/EditorInput/common/Toolbar.jsx +356 -0
- package/src/ui/f/fields/EditorInput/common/TreeViewPlugin.jsx +16 -0
- package/src/ui/f/fields/EditorInput/common/index.jsx +2 -0
- package/src/ui/f/fields/EditorInput/index.js +2 -0
- package/src/ui/f/fields/EditorInput/styles.scss +147 -0
- package/src/ui/f/fields/LinkInput/LinkInput.jsx +197 -0
- package/src/ui/f/fields/LinkInput/index.js +2 -0
- package/src/ui/f/fields/LinkInput/styles.scss +89 -0
- package/src/ui/f/fields/QueryChoices/QueryChoices.jsx +28 -0
- package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +37 -2
- package/src/ui/f/fields/QueryCombobox/common/Combobox/Combobox.jsx +68 -38
- package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +81 -66
- package/src/ui/f/fields/QueryCombobox/styles.scss +64 -30
- package/src/ui/f/fields/QuerySelect/QuerySelect.jsx +16 -1
- package/src/ui/f/fields/RatingsInput/RatingsInput.jsx +55 -28
- package/src/ui/f/fields/RatingsInput/common/Rating/Rating.jsx +4 -4
- package/src/ui/f/fields/RatingsInput/styles.scss +6 -13
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +88 -49
- package/src/ui/f/fields/SelectInput/styles.scss +60 -26
- package/src/ui/f/fields/TextInput/TextInput.jsx +71 -34
- package/src/ui/f/fields/TextInput/styles.scss +56 -20
- package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +65 -43
- package/src/ui/f/fields/TextareaInput/styles.scss +42 -25
- package/src/ui/f/fields/index.js +2 -0
- package/src/ui/form.scss +1 -1
- package/tests/__snapshots__/Storyshots.test.js.snap +14253 -5695
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
/* eslint-disable import/no-extraneous-dependencies -- required here */
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { useInsertionEffect, memo } from 'react';
|
|
5
|
+
import { useFormikContext } from 'formik';
|
|
6
|
+
import { LexicalComposer } from '@lexical/react/LexicalComposer';
|
|
7
|
+
import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin';
|
|
8
|
+
import { ContentEditable } from '@lexical/react/LexicalContentEditable';
|
|
9
|
+
import { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin';
|
|
10
|
+
import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin';
|
|
11
|
+
import { LinkPlugin } from '@lexical/react/LexicalLinkPlugin';
|
|
12
|
+
import { ListPlugin } from '@lexical/react/LexicalListPlugin';
|
|
13
|
+
import { TabIndentationPlugin } from '@lexical/react/LexicalTabIndentationPlugin';
|
|
14
|
+
import { AutoLinkNode, LinkNode } from '@lexical/link';
|
|
15
|
+
import { ListItemNode, ListNode } from '@lexical/list';
|
|
16
|
+
import PropTypes from 'prop-types';
|
|
17
|
+
import styleNames from '@pareto-engineering/bem/exports';
|
|
18
|
+
|
|
19
|
+
// Local Definitions
|
|
20
|
+
|
|
21
|
+
import { FormLabel, FormDescription, InputWrapper } from "../../common";
|
|
22
|
+
import { Toolbar, TreeViewPlugin } from "./common";
|
|
23
|
+
const baseClassName = styleNames.base;
|
|
24
|
+
const componentClassName = 'editor-input';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* This is the component description.
|
|
28
|
+
*/
|
|
29
|
+
const EditorInput = ({
|
|
30
|
+
id,
|
|
31
|
+
className: userClassName,
|
|
32
|
+
style,
|
|
33
|
+
name,
|
|
34
|
+
label,
|
|
35
|
+
// validate,
|
|
36
|
+
resize,
|
|
37
|
+
color,
|
|
38
|
+
rows,
|
|
39
|
+
optional,
|
|
40
|
+
labelColor,
|
|
41
|
+
description,
|
|
42
|
+
disabled,
|
|
43
|
+
labelSpan,
|
|
44
|
+
desktopLabelSpan,
|
|
45
|
+
inputSpan,
|
|
46
|
+
desktopInputSpan,
|
|
47
|
+
showDebugger
|
|
48
|
+
// ...otherProps
|
|
49
|
+
}) => {
|
|
50
|
+
useInsertionEffect(() => {
|
|
51
|
+
import("./styles.scss");
|
|
52
|
+
}, []);
|
|
53
|
+
const formik = useFormikContext();
|
|
54
|
+
const setInitialValue = () => {
|
|
55
|
+
const value = formik.values[name];
|
|
56
|
+
try {
|
|
57
|
+
JSON.parse(value);
|
|
58
|
+
return value;
|
|
59
|
+
} catch {
|
|
60
|
+
const defaultValue = {
|
|
61
|
+
root: {
|
|
62
|
+
children: [{
|
|
63
|
+
children: [{
|
|
64
|
+
detail: 0,
|
|
65
|
+
format: 0,
|
|
66
|
+
mode: 'normal',
|
|
67
|
+
style: '',
|
|
68
|
+
text: '',
|
|
69
|
+
type: 'text',
|
|
70
|
+
version: 1
|
|
71
|
+
}],
|
|
72
|
+
direction: 'ltr',
|
|
73
|
+
format: '',
|
|
74
|
+
indent: 0,
|
|
75
|
+
type: 'paragraph',
|
|
76
|
+
version: 1
|
|
77
|
+
}],
|
|
78
|
+
direction: 'ltr',
|
|
79
|
+
format: '',
|
|
80
|
+
indent: 0,
|
|
81
|
+
type: 'root',
|
|
82
|
+
version: 1
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
defaultValue.root.children[0].children[0].text = value;
|
|
86
|
+
return JSON.stringify(defaultValue);
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
const onChange = state => {
|
|
90
|
+
formik.setValues({
|
|
91
|
+
...formik.values,
|
|
92
|
+
[name]: JSON.stringify(state)
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
const initialConfig = {
|
|
96
|
+
nameSpace: name,
|
|
97
|
+
editable: !disabled,
|
|
98
|
+
editorState: setInitialValue(),
|
|
99
|
+
theme: {
|
|
100
|
+
text: {
|
|
101
|
+
italic: 'italic',
|
|
102
|
+
strikethrough: 'strikethrough',
|
|
103
|
+
underline: 'underlined'
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
nodes: [AutoLinkNode, LinkNode, ListNode, ListItemNode]
|
|
107
|
+
};
|
|
108
|
+
return /*#__PURE__*/React.createElement(LexicalComposer, {
|
|
109
|
+
initialConfig: initialConfig
|
|
110
|
+
}, /*#__PURE__*/React.createElement(FormLabel, {
|
|
111
|
+
name: name,
|
|
112
|
+
color: labelColor,
|
|
113
|
+
optional: optional,
|
|
114
|
+
columnSpan: labelSpan,
|
|
115
|
+
desktopColumnSpan: desktopLabelSpan
|
|
116
|
+
// {...otherProps}
|
|
117
|
+
}, label), /*#__PURE__*/React.createElement(InputWrapper, {
|
|
118
|
+
id: id,
|
|
119
|
+
className: [baseClassName, componentClassName, userClassName, `y-${color}`, disabled && 'disabled'].filter(e => e).join(' '),
|
|
120
|
+
style: {
|
|
121
|
+
...style,
|
|
122
|
+
'--resize': resize,
|
|
123
|
+
'--rows': `${rows}em`
|
|
124
|
+
},
|
|
125
|
+
columnSpan: inputSpan,
|
|
126
|
+
desktopColumnSpan: desktopInputSpan
|
|
127
|
+
}, !disabled && /*#__PURE__*/React.createElement(Toolbar, null), /*#__PURE__*/React.createElement(RichTextPlugin, {
|
|
128
|
+
contentEditable: /*#__PURE__*/React.createElement(ContentEditable, {
|
|
129
|
+
id: name,
|
|
130
|
+
className: "content-editable"
|
|
131
|
+
})
|
|
132
|
+
}), /*#__PURE__*/React.createElement(OnChangePlugin, {
|
|
133
|
+
onChange: onChange
|
|
134
|
+
}), /*#__PURE__*/React.createElement(LinkPlugin, null), /*#__PURE__*/React.createElement(ListPlugin, null), /*#__PURE__*/React.createElement(TabIndentationPlugin, null), /*#__PURE__*/React.createElement(HistoryPlugin, null), /*#__PURE__*/React.createElement(FormDescription, {
|
|
135
|
+
className: "s-1",
|
|
136
|
+
description: description,
|
|
137
|
+
name: name
|
|
138
|
+
}), showDebugger && /*#__PURE__*/React.createElement(TreeViewPlugin, null)));
|
|
139
|
+
};
|
|
140
|
+
EditorInput.propTypes = {
|
|
141
|
+
/**
|
|
142
|
+
* The HTML id for this element
|
|
143
|
+
*/
|
|
144
|
+
id: PropTypes.string,
|
|
145
|
+
/**
|
|
146
|
+
* The HTML class names for this element
|
|
147
|
+
*/
|
|
148
|
+
className: PropTypes.string,
|
|
149
|
+
/**
|
|
150
|
+
* The React-written, css properties for this element.
|
|
151
|
+
*/
|
|
152
|
+
style: PropTypes.objectOf(PropTypes.string),
|
|
153
|
+
/**
|
|
154
|
+
* The input name (html - and Formik state)
|
|
155
|
+
*/
|
|
156
|
+
name: PropTypes.string.isRequired,
|
|
157
|
+
/**
|
|
158
|
+
* The input label
|
|
159
|
+
*/
|
|
160
|
+
label: PropTypes.string.isRequired,
|
|
161
|
+
/**
|
|
162
|
+
* The input value validator function
|
|
163
|
+
*/
|
|
164
|
+
// validate:PropTypes.func,
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* The number of rows int the text area
|
|
168
|
+
*/
|
|
169
|
+
rows: PropTypes.number,
|
|
170
|
+
/**
|
|
171
|
+
* Color of the text
|
|
172
|
+
*/
|
|
173
|
+
color: PropTypes.string,
|
|
174
|
+
/**
|
|
175
|
+
* Label base color
|
|
176
|
+
*/
|
|
177
|
+
labelColor: PropTypes.string,
|
|
178
|
+
/**
|
|
179
|
+
* Text area description
|
|
180
|
+
*/
|
|
181
|
+
description: PropTypes.string,
|
|
182
|
+
/**
|
|
183
|
+
* Whether the text area should be disabled
|
|
184
|
+
*/
|
|
185
|
+
disabled: PropTypes.bool,
|
|
186
|
+
/**
|
|
187
|
+
* Whether the input is optional or not
|
|
188
|
+
*/
|
|
189
|
+
optional: PropTypes.bool,
|
|
190
|
+
/**
|
|
191
|
+
* The number of columns the label should span
|
|
192
|
+
*/
|
|
193
|
+
labelSpan: PropTypes.number,
|
|
194
|
+
/**
|
|
195
|
+
* The number of columns the input should span
|
|
196
|
+
*/
|
|
197
|
+
inputSpan: PropTypes.number,
|
|
198
|
+
/**
|
|
199
|
+
* The number of columns the label should span on desktop
|
|
200
|
+
*/
|
|
201
|
+
desktopLabelSpan: PropTypes.number,
|
|
202
|
+
/**
|
|
203
|
+
* The number of columns the input should span on desktop
|
|
204
|
+
*/
|
|
205
|
+
desktopInputSpan: PropTypes.number,
|
|
206
|
+
/**
|
|
207
|
+
* The resize property of the text area
|
|
208
|
+
*/
|
|
209
|
+
resize: PropTypes.oneOf(['none', 'both', 'horizontal', 'vertical'])
|
|
210
|
+
};
|
|
211
|
+
EditorInput.defaultProps = {
|
|
212
|
+
rows: 10,
|
|
213
|
+
disabled: false,
|
|
214
|
+
color: 'paragraph',
|
|
215
|
+
resize: 'vertical'
|
|
216
|
+
};
|
|
217
|
+
export default /*#__PURE__*/memo(EditorInput);
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies -- required here */
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { useEffect, useState, useCallback, useRef } from 'react';
|
|
4
|
+
import { $getSelection, $isRangeSelection, FORMAT_TEXT_COMMAND, FORMAT_ELEMENT_COMMAND, UNDO_COMMAND, REDO_COMMAND, COMMAND_PRIORITY_NORMAL, createCommand } from 'lexical';
|
|
5
|
+
import { INSERT_ORDERED_LIST_COMMAND, INSERT_UNORDERED_LIST_COMMAND, REMOVE_LIST_COMMAND, $isListNode, ListNode } from '@lexical/list';
|
|
6
|
+
import { $isAtNodeEnd } from '@lexical/selection';
|
|
7
|
+
import { $isLinkNode, TOGGLE_LINK_COMMAND } from '@lexical/link';
|
|
8
|
+
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
|
|
9
|
+
import { mergeRegister, $getNearestNodeOfType } from '@lexical/utils';
|
|
10
|
+
import { Popover } from "../../../..";
|
|
11
|
+
import styleNames from '@pareto-engineering/bem/exports';
|
|
12
|
+
const baseClassName = styleNames.base;
|
|
13
|
+
const componentClassName = 'toolbar';
|
|
14
|
+
const getSelectedNode = selection => {
|
|
15
|
+
const {
|
|
16
|
+
anchor,
|
|
17
|
+
focus
|
|
18
|
+
} = selection;
|
|
19
|
+
const anchorNode = selection.anchor.getNode();
|
|
20
|
+
const focusNode = selection.focus.getNode();
|
|
21
|
+
if (anchorNode === focusNode) {
|
|
22
|
+
return anchorNode;
|
|
23
|
+
}
|
|
24
|
+
const isBackward = selection.isBackward();
|
|
25
|
+
if (isBackward) {
|
|
26
|
+
return $isAtNodeEnd(focus) ? anchorNode : focusNode;
|
|
27
|
+
}
|
|
28
|
+
return $isAtNodeEnd(anchor) ? focusNode : anchorNode;
|
|
29
|
+
};
|
|
30
|
+
const defaultColor = 'var(--paragraph)';
|
|
31
|
+
const colorOptions = ['red', 'blue', 'green', 'yellow', 'orange', 'purple', 'pink', 'brown'];
|
|
32
|
+
const Toolbar = () => {
|
|
33
|
+
const [editor] = useLexicalComposerContext();
|
|
34
|
+
const [isBold, setIsBold] = useState(false);
|
|
35
|
+
const [isItalic, setIsItalic] = useState(false);
|
|
36
|
+
const [isStrikethrough, setIsStrikethrough] = useState(false);
|
|
37
|
+
const [blockType, setBlockType] = useState('paragraph');
|
|
38
|
+
const [isLink, setIsLink] = useState(false);
|
|
39
|
+
const [isUnderline, setIsUnderline] = useState(false);
|
|
40
|
+
const [color, setColor] = useState(defaultColor);
|
|
41
|
+
const colorMenuRef = useRef(false);
|
|
42
|
+
const formatBulletList = () => {
|
|
43
|
+
if (blockType !== 'ul') {
|
|
44
|
+
editor.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND);
|
|
45
|
+
} else {
|
|
46
|
+
editor.dispatchCommand(REMOVE_LIST_COMMAND);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
const formatNumberedList = () => {
|
|
50
|
+
if (blockType !== 'ol') {
|
|
51
|
+
editor.dispatchCommand(INSERT_ORDERED_LIST_COMMAND);
|
|
52
|
+
} else {
|
|
53
|
+
editor.dispatchCommand(REMOVE_LIST_COMMAND);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
const formatLink = useCallback(() => {
|
|
57
|
+
if (!isLink) {
|
|
58
|
+
// eslint-disable-next-line no-alert
|
|
59
|
+
const path = prompt('Enter the full URL. Ex: https://www.example.com');
|
|
60
|
+
editor.dispatchCommand(TOGGLE_LINK_COMMAND, path);
|
|
61
|
+
} else {
|
|
62
|
+
editor.dispatchCommand(TOGGLE_LINK_COMMAND, null);
|
|
63
|
+
}
|
|
64
|
+
}, [editor, isLink]);
|
|
65
|
+
const updateToolbar = useCallback(() => {
|
|
66
|
+
const selection = $getSelection();
|
|
67
|
+
|
|
68
|
+
// Check list selection
|
|
69
|
+
if ($isRangeSelection(selection)) {
|
|
70
|
+
const anchorNode = selection.anchor.getNode();
|
|
71
|
+
const element = anchorNode.getKey() === 'root' ? anchorNode : anchorNode.getTopLevelElementOrThrow();
|
|
72
|
+
if ($isListNode(element)) {
|
|
73
|
+
const parentList = $getNearestNodeOfType(anchorNode, ListNode);
|
|
74
|
+
const type = parentList ? parentList.getTag() : element.getTag();
|
|
75
|
+
setBlockType(type);
|
|
76
|
+
} else {
|
|
77
|
+
setBlockType(element);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// Check nodes for color
|
|
81
|
+
const nodes = selection.getNodes().filter(node => node.getType() === 'text');
|
|
82
|
+
nodes.forEach(node => {
|
|
83
|
+
const style = node.getStyle();
|
|
84
|
+
const colorProperty = style.match(/color: ([^;]+)/);
|
|
85
|
+
if (colorProperty) {
|
|
86
|
+
setColor(colorProperty[1]);
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
setColor(false);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
// Check selection text styles
|
|
93
|
+
setIsBold(selection.hasFormat('bold'));
|
|
94
|
+
setIsItalic(selection.hasFormat('italic'));
|
|
95
|
+
setIsStrikethrough(selection.hasFormat('strikethrough'));
|
|
96
|
+
setIsUnderline(selection.hasFormat('underline'));
|
|
97
|
+
setIsLink(selection.hasFormat('link'));
|
|
98
|
+
|
|
99
|
+
// Check links
|
|
100
|
+
const node = getSelectedNode(selection);
|
|
101
|
+
const parent = node.getParent();
|
|
102
|
+
if ($isLinkNode(parent) || $isLinkNode(node)) {
|
|
103
|
+
setIsLink(true);
|
|
104
|
+
} else {
|
|
105
|
+
setIsLink(false);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}, [editor]);
|
|
109
|
+
const UPDATE_COLOR_COMMAND = createCommand();
|
|
110
|
+
editor.registerCommand(UPDATE_COLOR_COMMAND, payload => {
|
|
111
|
+
const selection = $getSelection();
|
|
112
|
+
const nodes = selection?.extract().filter(node => node.getType() === 'text');
|
|
113
|
+
nodes?.forEach(node => {
|
|
114
|
+
const style = node.getStyle();
|
|
115
|
+
const colorProperty = style?.match(/color: ([^;]+)/);
|
|
116
|
+
if (colorProperty && color !== payload) {
|
|
117
|
+
node.setStyle(style.replace(colorProperty[0], `color: ${payload}`));
|
|
118
|
+
} else if (colorProperty) {
|
|
119
|
+
node.setStyle(`color: ${defaultColor}`);
|
|
120
|
+
} else {
|
|
121
|
+
node.setStyle(`color: ${payload}`);
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
}, COMMAND_PRIORITY_NORMAL);
|
|
125
|
+
useEffect(() => mergeRegister(editor.registerUpdateListener(({
|
|
126
|
+
editorState
|
|
127
|
+
}) => {
|
|
128
|
+
editorState.read(() => {
|
|
129
|
+
updateToolbar();
|
|
130
|
+
});
|
|
131
|
+
})), [updateToolbar, editor]);
|
|
132
|
+
const dispatchUpdateColor = useCallback((e, payload) => {
|
|
133
|
+
e.stopPropagation();
|
|
134
|
+
editor.dispatchCommand(UPDATE_COLOR_COMMAND, payload);
|
|
135
|
+
}, [editor]);
|
|
136
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
137
|
+
className: `${baseClassName} ${componentClassName}`
|
|
138
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
139
|
+
className: "group"
|
|
140
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
141
|
+
type: "button",
|
|
142
|
+
className: isBold ? 'active' : undefined,
|
|
143
|
+
onClick: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'bold')
|
|
144
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
145
|
+
className: "icon"
|
|
146
|
+
}, "|")), /*#__PURE__*/React.createElement("button", {
|
|
147
|
+
type: "button",
|
|
148
|
+
className: isItalic ? 'active' : undefined,
|
|
149
|
+
onClick: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'italic')
|
|
150
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
151
|
+
className: "icon"
|
|
152
|
+
}, "}")), /*#__PURE__*/React.createElement("button", {
|
|
153
|
+
type: "button",
|
|
154
|
+
className: isUnderline ? 'active' : undefined,
|
|
155
|
+
onClick: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'underline')
|
|
156
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
157
|
+
className: "icon"
|
|
158
|
+
}, "~")), /*#__PURE__*/React.createElement("button", {
|
|
159
|
+
type: "button",
|
|
160
|
+
className: isStrikethrough ? 'active' : undefined,
|
|
161
|
+
onClick: () => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'strikethrough')
|
|
162
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
163
|
+
className: "icon"
|
|
164
|
+
}, "?")), /*#__PURE__*/React.createElement("button", {
|
|
165
|
+
type: "button",
|
|
166
|
+
className: color && color !== defaultColor ? 'active color-menu-button' : 'color-menu-button',
|
|
167
|
+
onClick: () => editor.dispatchCommand(UPDATE_COLOR_COMMAND, color !== defaultColor ? defaultColor : color),
|
|
168
|
+
ref: colorMenuRef,
|
|
169
|
+
style: {
|
|
170
|
+
position: 'relative'
|
|
171
|
+
}
|
|
172
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
173
|
+
className: "icon",
|
|
174
|
+
style: {
|
|
175
|
+
color
|
|
176
|
+
}
|
|
177
|
+
}, "Q"), /*#__PURE__*/React.createElement(Popover, {
|
|
178
|
+
parentRef: colorMenuRef
|
|
179
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
180
|
+
className: "color-menu"
|
|
181
|
+
}, colorOptions.map(option => /*#__PURE__*/React.createElement("span", {
|
|
182
|
+
role: "button",
|
|
183
|
+
className: "icon color-option",
|
|
184
|
+
style: {
|
|
185
|
+
color: option
|
|
186
|
+
},
|
|
187
|
+
onClick: e => dispatchUpdateColor(e, option),
|
|
188
|
+
onKeyDown: e => dispatchUpdateColor(e, option),
|
|
189
|
+
tabIndex: 0,
|
|
190
|
+
key: option
|
|
191
|
+
}, "o"))))), /*#__PURE__*/React.createElement("button", {
|
|
192
|
+
type: "button",
|
|
193
|
+
className: isLink ? 'active' : undefined,
|
|
194
|
+
onClick: () => formatLink()
|
|
195
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
196
|
+
className: "icon"
|
|
197
|
+
}, "]")), /*#__PURE__*/React.createElement("button", {
|
|
198
|
+
type: "button",
|
|
199
|
+
className: blockType === 'ul' ? 'active' : undefined,
|
|
200
|
+
onClick: () => formatBulletList()
|
|
201
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
202
|
+
className: "icon"
|
|
203
|
+
}, ".")), /*#__PURE__*/React.createElement("button", {
|
|
204
|
+
type: "button",
|
|
205
|
+
className: blockType === 'ol' ? 'active' : undefined,
|
|
206
|
+
onClick: () => formatNumberedList()
|
|
207
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
208
|
+
className: "icon"
|
|
209
|
+
}, "-"))), /*#__PURE__*/React.createElement("div", {
|
|
210
|
+
className: "group"
|
|
211
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
212
|
+
type: "button",
|
|
213
|
+
onClick: () => editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'left')
|
|
214
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
215
|
+
className: "icon"
|
|
216
|
+
}, "^")), /*#__PURE__*/React.createElement("button", {
|
|
217
|
+
type: "button",
|
|
218
|
+
onClick: () => editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'center')
|
|
219
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
220
|
+
className: "icon"
|
|
221
|
+
}, "_")), /*#__PURE__*/React.createElement("button", {
|
|
222
|
+
type: "button",
|
|
223
|
+
onClick: () => editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'right')
|
|
224
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
225
|
+
className: "icon"
|
|
226
|
+
}, "`")), /*#__PURE__*/React.createElement("button", {
|
|
227
|
+
type: "button",
|
|
228
|
+
onClick: () => editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'justify')
|
|
229
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
230
|
+
className: "icon"
|
|
231
|
+
}, "{"))), /*#__PURE__*/React.createElement("div", {
|
|
232
|
+
className: "group"
|
|
233
|
+
}, /*#__PURE__*/React.createElement("button", {
|
|
234
|
+
type: "button",
|
|
235
|
+
onClick: () => editor.dispatchCommand(UNDO_COMMAND)
|
|
236
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
237
|
+
className: "icon"
|
|
238
|
+
}, "\\")), /*#__PURE__*/React.createElement("button", {
|
|
239
|
+
type: "button",
|
|
240
|
+
className: "flip",
|
|
241
|
+
onClick: () => editor.dispatchCommand(REDO_COMMAND)
|
|
242
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
243
|
+
className: "icon"
|
|
244
|
+
}, "\\"))));
|
|
245
|
+
};
|
|
246
|
+
export default Toolbar;
|
|
@@ -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,147 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
/* stylelint-disable max-nesting-depth -- required here */
|
|
3
|
+
|
|
4
|
+
@use "@pareto-engineering/bem";
|
|
5
|
+
@use "@pareto-engineering/styles/src/mixins";
|
|
6
|
+
@use "@pareto-engineering/styles/src/globals" as *;
|
|
7
|
+
|
|
8
|
+
$default-gap: calc(var(--gap) / 2);
|
|
9
|
+
$default-padding: .55em .75em;
|
|
10
|
+
$default-border: 1px solid var(--outline-inputs);
|
|
11
|
+
$default-input-border-radius: var(--theme-default-input-border-radius);
|
|
12
|
+
$default-border: var(--theme-default-input-border);
|
|
13
|
+
$focus-border: var(--theme-focus-input-border);
|
|
14
|
+
$active-background: var(--hard-background-inputs);
|
|
15
|
+
$default-background: var(--background-inputs);
|
|
16
|
+
$default-icon-color: var(--on-background-inputs);
|
|
17
|
+
$disabled-background: var(--background-inputs-30);
|
|
18
|
+
$default-color-menu-padding: .5em .25em;
|
|
19
|
+
|
|
20
|
+
.#{bem.$base}.editor-input {
|
|
21
|
+
&.#{bem.$base}.input-wrapper {
|
|
22
|
+
display: flex;
|
|
23
|
+
flex-direction: column;
|
|
24
|
+
|
|
25
|
+
> .#{bem.$base}.toolbar {
|
|
26
|
+
display: flex;
|
|
27
|
+
gap: $default-gap;
|
|
28
|
+
margin-bottom: .25em;
|
|
29
|
+
|
|
30
|
+
> .group {
|
|
31
|
+
> button {
|
|
32
|
+
background: $default-background;
|
|
33
|
+
border: $default-border;
|
|
34
|
+
color: $default-icon-color;
|
|
35
|
+
padding: $default-padding;
|
|
36
|
+
|
|
37
|
+
&.active {
|
|
38
|
+
background-color: $active-background;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.flip {
|
|
44
|
+
transform: scaleX(-1);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&:not(.disabled) {
|
|
49
|
+
&:hover,
|
|
50
|
+
&:focus,
|
|
51
|
+
&:active {
|
|
52
|
+
> .textarea {
|
|
53
|
+
border: $focus-border;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&.disabled {
|
|
59
|
+
> .textarea {
|
|
60
|
+
background: $disabled-background;
|
|
61
|
+
color: var(--metadata);
|
|
62
|
+
cursor: not-allowed;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.color-menu-button {
|
|
67
|
+
&:hover {
|
|
68
|
+
> .#{bem.$base}.popover {
|
|
69
|
+
display: block;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
> .#{bem.$base}.popover {
|
|
74
|
+
padding: $default-color-menu-padding;
|
|
75
|
+
|
|
76
|
+
.color-menu {
|
|
77
|
+
display: flex;
|
|
78
|
+
flex-wrap: wrap;
|
|
79
|
+
gap: calc($default-gap / 2);
|
|
80
|
+
justify-content: center;
|
|
81
|
+
max-width: 10em;
|
|
82
|
+
min-width: 5em;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.color-option:hover {
|
|
86
|
+
opacity: .5;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
> .content-editable {
|
|
92
|
+
background: $default-background;
|
|
93
|
+
border: $default-border;
|
|
94
|
+
border-radius: $default-input-border-radius;
|
|
95
|
+
color: var(--y);
|
|
96
|
+
height: var(--rows);
|
|
97
|
+
outline: none;
|
|
98
|
+
overflow: auto;
|
|
99
|
+
padding: $default-padding;
|
|
100
|
+
resize: var(--resize);
|
|
101
|
+
width: 100%;
|
|
102
|
+
|
|
103
|
+
li:has(ol, ul) {
|
|
104
|
+
list-style-type: none;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
p,
|
|
108
|
+
span,
|
|
109
|
+
strong,
|
|
110
|
+
em,
|
|
111
|
+
li {
|
|
112
|
+
&.underlined {
|
|
113
|
+
text-decoration: underline;
|
|
114
|
+
|
|
115
|
+
&.strikethrough {
|
|
116
|
+
text-decoration: underline line-through;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
&.strikethrough {
|
|
121
|
+
text-decoration: line-through;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
&.italic {
|
|
125
|
+
font-style: italic;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
:first-child {
|
|
130
|
+
margin-top: 0;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
&::placeholder {
|
|
134
|
+
color: var(--metadata);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
> .tree-view-output {
|
|
140
|
+
background: $default-background;
|
|
141
|
+
border: $default-border;
|
|
142
|
+
border-radius: $default-input-border-radius;
|
|
143
|
+
max-height: 20em;
|
|
144
|
+
overflow: auto;
|
|
145
|
+
padding: $default-padding;
|
|
146
|
+
}
|
|
147
|
+
}
|