@pareto-engineering/design-system 4.0.0-alpha.63 → 4.0.0-alpha.65
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/f/FormInput/FormInput.js +13 -43
- package/dist/cjs/f/common/Label/Label.js +3 -18
- package/dist/cjs/f/common/Label/styles.scss +0 -5
- package/dist/cjs/f/common/index.js +1 -21
- package/dist/cjs/f/fields/Checkbox/Checkbox.js +10 -20
- package/dist/cjs/f/fields/Checkbox/styles.scss +7 -5
- package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +8 -21
- package/dist/cjs/f/fields/ChoicesInput/styles.scss +44 -41
- package/dist/cjs/f/fields/EditorInput/EditorInput.js +8 -33
- package/dist/cjs/f/fields/EditorInput/styles.scss +92 -90
- package/dist/cjs/f/fields/LinkInput/LinkInput.js +10 -20
- package/dist/cjs/f/fields/LinkInput/styles.scss +52 -51
- package/dist/cjs/f/fields/QueryChoices/QueryChoices.js +2 -26
- package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +0 -24
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +10 -17
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +13 -19
- package/dist/cjs/f/fields/QueryCombobox/styles.scss +11 -4
- package/dist/cjs/f/fields/QuerySelect/QuerySelect.js +2 -10
- package/dist/cjs/f/fields/RatingsInput/RatingsInput.js +11 -33
- package/dist/cjs/f/fields/RatingsInput/styles.scss +5 -1
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +9 -33
- package/dist/cjs/f/fields/SelectInput/styles.scss +5 -2
- package/dist/cjs/f/fields/TextInput/TextInput.js +15 -37
- package/dist/cjs/f/fields/TextInput/styles.scss +37 -30
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +11 -35
- package/dist/cjs/f/fields/TextareaInput/styles.scss +30 -27
- package/dist/cjs/f/fields/index.js +1 -26
- package/dist/es/f/FormInput/FormInput.js +3 -33
- package/dist/es/f/common/Description/Description.js +1 -1
- package/dist/es/f/common/Label/Label.js +4 -20
- package/dist/es/f/common/Label/styles.scss +0 -5
- package/dist/es/f/common/index.js +1 -3
- package/dist/es/f/fields/Checkbox/Checkbox.js +11 -20
- package/dist/es/f/fields/Checkbox/styles.scss +7 -5
- package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +9 -22
- package/dist/es/f/fields/ChoicesInput/styles.scss +44 -41
- package/dist/es/f/fields/EditorInput/EditorInput.js +9 -34
- package/dist/es/f/fields/EditorInput/styles.scss +92 -90
- package/dist/es/f/fields/LinkInput/LinkInput.js +11 -19
- package/dist/es/f/fields/LinkInput/styles.scss +52 -51
- package/dist/es/f/fields/QueryChoices/QueryChoices.js +2 -26
- package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +1 -25
- package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +11 -18
- package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +14 -20
- package/dist/es/f/fields/QueryCombobox/styles.scss +11 -4
- package/dist/es/f/fields/QuerySelect/QuerySelect.js +2 -10
- package/dist/es/f/fields/RatingsInput/RatingsInput.js +12 -35
- package/dist/es/f/fields/RatingsInput/styles.scss +5 -1
- package/dist/es/f/fields/SelectInput/SelectInput.js +10 -34
- package/dist/es/f/fields/SelectInput/styles.scss +5 -2
- package/dist/es/f/fields/TextInput/TextInput.js +16 -36
- package/dist/es/f/fields/TextInput/styles.scss +37 -30
- package/dist/es/f/fields/TextareaInput/TextareaInput.js +11 -35
- package/dist/es/f/fields/TextareaInput/styles.scss +30 -27
- package/dist/es/f/fields/index.js +1 -2
- package/package.json +3 -3
- package/src/stories/f/Checkbox.stories.jsx +13 -21
- package/src/stories/f/ChoicesInput.stories.jsx +12 -27
- package/src/stories/f/EditorInput.stories.jsx +7 -14
- package/src/stories/f/LinkInput.stories.jsx +15 -22
- package/src/stories/f/QueryChoices.stories.jsx +12 -19
- package/src/stories/f/QueryCombobox.stories.jsx +16 -24
- package/src/stories/f/QuerySelect.stories.jsx +12 -19
- package/src/stories/f/RatingsInput.stories.jsx +7 -14
- package/src/stories/f/SelectInput.stories.jsx +12 -19
- package/src/stories/f/TextInput.stories.jsx +16 -23
- package/src/stories/f/TextareaInput.stories.jsx +7 -14
- package/src/ui/f/FormInput/FormInput.jsx +12 -57
- package/src/ui/f/common/Description/Description.jsx +2 -2
- package/src/ui/f/common/Label/Label.jsx +2 -20
- package/src/ui/f/common/Label/styles.scss +0 -5
- package/src/ui/f/common/index.js +0 -2
- package/src/ui/f/fields/Checkbox/Checkbox.jsx +22 -33
- package/src/ui/f/fields/Checkbox/styles.scss +7 -5
- package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +43 -57
- package/src/ui/f/fields/ChoicesInput/styles.scss +44 -41
- package/src/ui/f/fields/EditorInput/EditorInput.jsx +13 -40
- package/src/ui/f/fields/EditorInput/styles.scss +92 -90
- package/src/ui/f/fields/LinkInput/LinkInput.jsx +35 -44
- package/src/ui/f/fields/LinkInput/styles.scss +52 -51
- package/src/ui/f/fields/QueryChoices/QueryChoices.jsx +0 -28
- package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +2 -30
- package/src/ui/f/fields/QueryCombobox/common/Combobox/Combobox.jsx +32 -41
- package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +55 -62
- package/src/ui/f/fields/QueryCombobox/styles.scss +11 -4
- package/src/ui/f/fields/QuerySelect/QuerySelect.jsx +0 -8
- package/src/ui/f/fields/RatingsInput/RatingsInput.jsx +16 -46
- package/src/ui/f/fields/RatingsInput/styles.scss +5 -1
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +28 -58
- package/src/ui/f/fields/SelectInput/styles.scss +5 -2
- package/src/ui/f/fields/TextInput/TextInput.jsx +24 -49
- package/src/ui/f/fields/TextInput/styles.scss +37 -30
- package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +28 -57
- package/src/ui/f/fields/TextareaInput/styles.scss +30 -27
- package/src/ui/f/fields/index.js +0 -1
- package/tests/__snapshots__/Storyshots.test.js.snap +609 -8434
- package/dist/cjs/f/common/InputWrapper/InputWrapper.js +0 -73
- package/dist/cjs/f/common/InputWrapper/index.js +0 -13
- package/dist/cjs/f/common/InputWrapper/styles.scss +0 -13
- package/dist/cjs/f/common/V2/Description/Description.js +0 -76
- package/dist/cjs/f/common/V2/Description/index.js +0 -13
- package/dist/cjs/f/common/V2/Description/styles.scss +0 -10
- package/dist/cjs/f/common/V2/Label/Label.js +0 -84
- package/dist/cjs/f/common/V2/Label/index.js +0 -13
- package/dist/cjs/f/common/V2/Label/styles.scss +0 -9
- package/dist/cjs/f/common/V2/index.js +0 -19
- package/dist/cjs/f/fields/V2/Checkbox/Checkbox.js +0 -122
- package/dist/cjs/f/fields/V2/Checkbox/index.js +0 -13
- package/dist/cjs/f/fields/V2/Checkbox/styles.scss +0 -16
- package/dist/cjs/f/fields/V2/ChoicesInput/ChoicesInput.js +0 -154
- package/dist/cjs/f/fields/V2/ChoicesInput/common/Choice/Choice.js +0 -104
- package/dist/cjs/f/fields/V2/ChoicesInput/common/Choice/index.js +0 -13
- package/dist/cjs/f/fields/V2/ChoicesInput/common/index.js +0 -12
- package/dist/cjs/f/fields/V2/ChoicesInput/index.js +0 -13
- package/dist/cjs/f/fields/V2/ChoicesInput/styles.scss +0 -79
- package/dist/cjs/f/fields/V2/EditorInput/EditorInput.js +0 -197
- package/dist/cjs/f/fields/V2/EditorInput/common/Toolbar.js +0 -257
- package/dist/cjs/f/fields/V2/EditorInput/common/TreeViewPlugin.js +0 -18
- package/dist/cjs/f/fields/V2/EditorInput/common/index.js +0 -20
- package/dist/cjs/f/fields/V2/EditorInput/index.js +0 -13
- package/dist/cjs/f/fields/V2/EditorInput/styles.scss +0 -149
- package/dist/cjs/f/fields/V2/LinkInput/LinkInput.js +0 -156
- package/dist/cjs/f/fields/V2/LinkInput/index.js +0 -13
- package/dist/cjs/f/fields/V2/LinkInput/styles.scss +0 -90
- package/dist/cjs/f/fields/V2/QueryChoices/QueryChoices.js +0 -137
- package/dist/cjs/f/fields/V2/QueryChoices/index.js +0 -13
- package/dist/cjs/f/fields/V2/QueryCombobox/QueryCombobox.js +0 -229
- package/dist/cjs/f/fields/V2/QueryCombobox/common/Combobox/Combobox.js +0 -236
- package/dist/cjs/f/fields/V2/QueryCombobox/common/Combobox/index.js +0 -13
- package/dist/cjs/f/fields/V2/QueryCombobox/common/Menu/Menu.js +0 -83
- package/dist/cjs/f/fields/V2/QueryCombobox/common/Menu/index.js +0 -13
- package/dist/cjs/f/fields/V2/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +0 -300
- package/dist/cjs/f/fields/V2/QueryCombobox/common/MultipleCombobox/index.js +0 -13
- package/dist/cjs/f/fields/V2/QueryCombobox/common/index.js +0 -26
- package/dist/cjs/f/fields/V2/QueryCombobox/index.js +0 -13
- package/dist/cjs/f/fields/V2/QueryCombobox/styles.scss +0 -127
- package/dist/cjs/f/fields/V2/QuerySelect/QuerySelect.js +0 -198
- package/dist/cjs/f/fields/V2/QuerySelect/index.js +0 -13
- package/dist/cjs/f/fields/V2/RatingsInput/RatingsInput.js +0 -130
- package/dist/cjs/f/fields/V2/RatingsInput/common/Rating/Rating.js +0 -117
- package/dist/cjs/f/fields/V2/RatingsInput/common/Rating/index.js +0 -13
- package/dist/cjs/f/fields/V2/RatingsInput/common/index.js +0 -12
- package/dist/cjs/f/fields/V2/RatingsInput/index.js +0 -13
- package/dist/cjs/f/fields/V2/RatingsInput/styles.scss +0 -48
- package/dist/cjs/f/fields/V2/SelectInput/SelectInput.js +0 -154
- package/dist/cjs/f/fields/V2/SelectInput/index.js +0 -13
- package/dist/cjs/f/fields/V2/SelectInput/styles.scss +0 -87
- package/dist/cjs/f/fields/V2/TextInput/TextInput.js +0 -155
- package/dist/cjs/f/fields/V2/TextInput/index.js +0 -13
- package/dist/cjs/f/fields/V2/TextInput/styles.scss +0 -78
- package/dist/cjs/f/fields/V2/TextareaInput/TextareaInput.js +0 -152
- package/dist/cjs/f/fields/V2/TextareaInput/index.js +0 -13
- package/dist/cjs/f/fields/V2/TextareaInput/styles.scss +0 -53
- package/dist/cjs/f/fields/V2/index.js +0 -82
- package/dist/es/f/common/InputWrapper/InputWrapper.js +0 -61
- package/dist/es/f/common/InputWrapper/index.js +0 -2
- package/dist/es/f/common/InputWrapper/styles.scss +0 -13
- package/dist/es/f/common/V2/Description/Description.js +0 -68
- package/dist/es/f/common/V2/Description/index.js +0 -2
- package/dist/es/f/common/V2/Description/styles.scss +0 -10
- package/dist/es/f/common/V2/Label/Label.js +0 -76
- package/dist/es/f/common/V2/Label/index.js +0 -2
- package/dist/es/f/common/V2/Label/styles.scss +0 -9
- package/dist/es/f/common/V2/index.js +0 -2
- package/dist/es/f/fields/V2/Checkbox/Checkbox.js +0 -114
- package/dist/es/f/fields/V2/Checkbox/index.js +0 -2
- package/dist/es/f/fields/V2/Checkbox/styles.scss +0 -16
- package/dist/es/f/fields/V2/ChoicesInput/ChoicesInput.js +0 -148
- package/dist/es/f/fields/V2/ChoicesInput/common/Choice/Choice.js +0 -97
- package/dist/es/f/fields/V2/ChoicesInput/common/Choice/index.js +0 -2
- package/dist/es/f/fields/V2/ChoicesInput/common/index.js +0 -1
- package/dist/es/f/fields/V2/ChoicesInput/index.js +0 -2
- package/dist/es/f/fields/V2/ChoicesInput/styles.scss +0 -79
- package/dist/es/f/fields/V2/EditorInput/EditorInput.js +0 -192
- package/dist/es/f/fields/V2/EditorInput/common/Toolbar.js +0 -246
- package/dist/es/f/fields/V2/EditorInput/common/TreeViewPlugin.js +0 -11
- package/dist/es/f/fields/V2/EditorInput/common/index.js +0 -2
- package/dist/es/f/fields/V2/EditorInput/index.js +0 -2
- package/dist/es/f/fields/V2/EditorInput/styles.scss +0 -149
- package/dist/es/f/fields/V2/LinkInput/LinkInput.js +0 -148
- package/dist/es/f/fields/V2/LinkInput/index.js +0 -2
- package/dist/es/f/fields/V2/LinkInput/styles.scss +0 -90
- package/dist/es/f/fields/V2/QueryChoices/QueryChoices.js +0 -126
- package/dist/es/f/fields/V2/QueryChoices/index.js +0 -2
- package/dist/es/f/fields/V2/QueryCombobox/QueryCombobox.js +0 -221
- package/dist/es/f/fields/V2/QueryCombobox/common/Combobox/Combobox.js +0 -229
- package/dist/es/f/fields/V2/QueryCombobox/common/Combobox/index.js +0 -2
- package/dist/es/f/fields/V2/QueryCombobox/common/Menu/Menu.js +0 -73
- package/dist/es/f/fields/V2/QueryCombobox/common/Menu/index.js +0 -2
- package/dist/es/f/fields/V2/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +0 -293
- package/dist/es/f/fields/V2/QueryCombobox/common/MultipleCombobox/index.js +0 -2
- package/dist/es/f/fields/V2/QueryCombobox/common/index.js +0 -3
- package/dist/es/f/fields/V2/QueryCombobox/index.js +0 -2
- package/dist/es/f/fields/V2/QueryCombobox/styles.scss +0 -127
- package/dist/es/f/fields/V2/QuerySelect/QuerySelect.js +0 -186
- package/dist/es/f/fields/V2/QuerySelect/index.js +0 -2
- package/dist/es/f/fields/V2/RatingsInput/RatingsInput.js +0 -124
- package/dist/es/f/fields/V2/RatingsInput/common/Rating/Rating.js +0 -109
- package/dist/es/f/fields/V2/RatingsInput/common/Rating/index.js +0 -2
- package/dist/es/f/fields/V2/RatingsInput/common/index.js +0 -1
- package/dist/es/f/fields/V2/RatingsInput/index.js +0 -2
- package/dist/es/f/fields/V2/RatingsInput/styles.scss +0 -48
- package/dist/es/f/fields/V2/SelectInput/SelectInput.js +0 -146
- package/dist/es/f/fields/V2/SelectInput/index.js +0 -2
- package/dist/es/f/fields/V2/SelectInput/styles.scss +0 -87
- package/dist/es/f/fields/V2/TextInput/TextInput.js +0 -147
- package/dist/es/f/fields/V2/TextInput/index.js +0 -2
- package/dist/es/f/fields/V2/TextInput/styles.scss +0 -78
- package/dist/es/f/fields/V2/TextareaInput/TextareaInput.js +0 -146
- package/dist/es/f/fields/V2/TextareaInput/index.js +0 -2
- package/dist/es/f/fields/V2/TextareaInput/styles.scss +0 -53
- package/dist/es/f/fields/V2/index.js +0 -11
- package/src/stories/f/v2/Checkbox.stories.jsx +0 -102
- package/src/stories/f/v2/ChoicesInput.stories.jsx +0 -139
- package/src/stories/f/v2/EditorInput.stories.jsx +0 -81
- package/src/stories/f/v2/LinkInput.stories.jsx +0 -93
- package/src/stories/f/v2/QueryChoices.stories.jsx +0 -144
- package/src/stories/f/v2/QueryCombobox.stories.jsx +0 -301
- package/src/stories/f/v2/QuerySelect.stories.jsx +0 -150
- package/src/stories/f/v2/RatingsInput.stories.jsx +0 -77
- package/src/stories/f/v2/SelectInput.stories.jsx +0 -95
- package/src/stories/f/v2/TextInput.stories.jsx +0 -120
- package/src/stories/f/v2/TextareaInput.stories.jsx +0 -107
- package/src/stories/f/v2/__generated__/FormInputAllTaskStatusesQuery.graphql.js +0 -122
- package/src/stories/f/v2/__generated__/FormInputAllTeamsQuery.graphql.js +0 -139
- package/src/stories/f/v2/__generated__/QueryChoicesAllTaskStatusesQuery.graphql.js +0 -122
- package/src/stories/f/v2/__generated__/QueryComboboxAllTeamsQuery.graphql.js +0 -139
- package/src/stories/f/v2/__generated__/QuerySelectAllTaskStatusesQuery.graphql.js +0 -122
- package/src/ui/f/common/InputWrapper/InputWrapper.jsx +0 -83
- package/src/ui/f/common/InputWrapper/index.js +0 -2
- package/src/ui/f/common/InputWrapper/styles.scss +0 -13
- package/src/ui/f/common/V2/Description/Description.jsx +0 -94
- package/src/ui/f/common/V2/Description/index.js +0 -2
- package/src/ui/f/common/V2/Description/styles.scss +0 -10
- package/src/ui/f/common/V2/Label/Label.jsx +0 -102
- package/src/ui/f/common/V2/Label/index.js +0 -2
- package/src/ui/f/common/V2/Label/styles.scss +0 -9
- package/src/ui/f/common/V2/index.js +0 -2
- package/src/ui/f/fields/V2/Checkbox/Checkbox.jsx +0 -146
- package/src/ui/f/fields/V2/Checkbox/index.js +0 -2
- package/src/ui/f/fields/V2/Checkbox/styles.scss +0 -16
- package/src/ui/f/fields/V2/ChoicesInput/ChoicesInput.jsx +0 -183
- package/src/ui/f/fields/V2/ChoicesInput/common/Choice/Choice.jsx +0 -125
- package/src/ui/f/fields/V2/ChoicesInput/common/Choice/index.js +0 -2
- package/src/ui/f/fields/V2/ChoicesInput/common/index.js +0 -1
- package/src/ui/f/fields/V2/ChoicesInput/index.js +0 -2
- package/src/ui/f/fields/V2/ChoicesInput/styles.scss +0 -79
- package/src/ui/f/fields/V2/EditorInput/EditorInput.jsx +0 -244
- package/src/ui/f/fields/V2/EditorInput/common/Toolbar.jsx +0 -356
- package/src/ui/f/fields/V2/EditorInput/common/TreeViewPlugin.jsx +0 -16
- package/src/ui/f/fields/V2/EditorInput/common/index.jsx +0 -2
- package/src/ui/f/fields/V2/EditorInput/index.js +0 -2
- package/src/ui/f/fields/V2/EditorInput/styles.scss +0 -149
- package/src/ui/f/fields/V2/LinkInput/LinkInput.jsx +0 -187
- package/src/ui/f/fields/V2/LinkInput/index.js +0 -2
- package/src/ui/f/fields/V2/LinkInput/styles.scss +0 -90
- package/src/ui/f/fields/V2/QueryChoices/QueryChoices.jsx +0 -153
- package/src/ui/f/fields/V2/QueryChoices/index.js +0 -2
- package/src/ui/f/fields/V2/QueryCombobox/QueryCombobox.jsx +0 -254
- package/src/ui/f/fields/V2/QueryCombobox/common/Combobox/Combobox.jsx +0 -276
- package/src/ui/f/fields/V2/QueryCombobox/common/Combobox/index.js +0 -2
- package/src/ui/f/fields/V2/QueryCombobox/common/Menu/Menu.jsx +0 -103
- package/src/ui/f/fields/V2/QueryCombobox/common/Menu/index.js +0 -2
- package/src/ui/f/fields/V2/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +0 -362
- package/src/ui/f/fields/V2/QueryCombobox/common/MultipleCombobox/index.js +0 -2
- package/src/ui/f/fields/V2/QueryCombobox/common/index.js +0 -3
- package/src/ui/f/fields/V2/QueryCombobox/index.js +0 -2
- package/src/ui/f/fields/V2/QueryCombobox/styles.scss +0 -127
- package/src/ui/f/fields/V2/QuerySelect/QuerySelect.jsx +0 -220
- package/src/ui/f/fields/V2/QuerySelect/index.js +0 -2
- package/src/ui/f/fields/V2/RatingsInput/RatingsInput.jsx +0 -152
- package/src/ui/f/fields/V2/RatingsInput/common/Rating/Rating.jsx +0 -142
- package/src/ui/f/fields/V2/RatingsInput/common/Rating/index.js +0 -2
- package/src/ui/f/fields/V2/RatingsInput/common/index.js +0 -1
- package/src/ui/f/fields/V2/RatingsInput/index.js +0 -2
- package/src/ui/f/fields/V2/RatingsInput/styles.scss +0 -48
- package/src/ui/f/fields/V2/SelectInput/SelectInput.jsx +0 -187
- package/src/ui/f/fields/V2/SelectInput/index.js +0 -2
- package/src/ui/f/fields/V2/SelectInput/styles.scss +0 -87
- package/src/ui/f/fields/V2/TextInput/TextInput.jsx +0 -192
- package/src/ui/f/fields/V2/TextInput/index.js +0 -2
- package/src/ui/f/fields/V2/TextInput/styles.scss +0 -78
- package/src/ui/f/fields/V2/TextareaInput/TextareaInput.jsx +0 -180
- package/src/ui/f/fields/V2/TextareaInput/index.js +0 -2
- package/src/ui/f/fields/V2/TextareaInput/styles.scss +0 -53
- package/src/ui/f/fields/V2/index.js +0 -11
|
@@ -1,192 +0,0 @@
|
|
|
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 { FormLabelV2, FormDescriptionV2 } 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
|
-
showDebugger
|
|
44
|
-
// ...otherProps
|
|
45
|
-
}) => {
|
|
46
|
-
useInsertionEffect(() => {
|
|
47
|
-
import("./styles.scss");
|
|
48
|
-
}, []);
|
|
49
|
-
const formik = useFormikContext();
|
|
50
|
-
const setInitialValue = () => {
|
|
51
|
-
const value = formik.values[name];
|
|
52
|
-
try {
|
|
53
|
-
JSON.parse(value);
|
|
54
|
-
return value;
|
|
55
|
-
} catch {
|
|
56
|
-
const defaultValue = {
|
|
57
|
-
root: {
|
|
58
|
-
children: [{
|
|
59
|
-
children: [{
|
|
60
|
-
detail: 0,
|
|
61
|
-
format: 0,
|
|
62
|
-
mode: 'normal',
|
|
63
|
-
style: '',
|
|
64
|
-
text: '',
|
|
65
|
-
type: 'text',
|
|
66
|
-
version: 1
|
|
67
|
-
}],
|
|
68
|
-
direction: 'ltr',
|
|
69
|
-
format: '',
|
|
70
|
-
indent: 0,
|
|
71
|
-
type: 'paragraph',
|
|
72
|
-
version: 1
|
|
73
|
-
}],
|
|
74
|
-
direction: 'ltr',
|
|
75
|
-
format: '',
|
|
76
|
-
indent: 0,
|
|
77
|
-
type: 'root',
|
|
78
|
-
version: 1
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
defaultValue.root.children[0].children[0].text = value;
|
|
82
|
-
return JSON.stringify(defaultValue);
|
|
83
|
-
}
|
|
84
|
-
};
|
|
85
|
-
const onChange = state => {
|
|
86
|
-
formik.setValues({
|
|
87
|
-
...formik.values,
|
|
88
|
-
[name]: JSON.stringify(state)
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
const initialConfig = {
|
|
92
|
-
nameSpace: name,
|
|
93
|
-
editable: !disabled,
|
|
94
|
-
editorState: setInitialValue(),
|
|
95
|
-
theme: {
|
|
96
|
-
text: {
|
|
97
|
-
italic: 'italic',
|
|
98
|
-
strikethrough: 'strikethrough',
|
|
99
|
-
underline: 'underlined'
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
nodes: [AutoLinkNode, LinkNode, ListNode, ListItemNode]
|
|
103
|
-
};
|
|
104
|
-
return /*#__PURE__*/React.createElement(LexicalComposer, {
|
|
105
|
-
initialConfig: initialConfig
|
|
106
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
107
|
-
id: id,
|
|
108
|
-
className: [baseClassName, componentClassName, userClassName, `y-${color}`, disabled && 'disabled'].filter(e => e).join(' '),
|
|
109
|
-
style: {
|
|
110
|
-
...style,
|
|
111
|
-
'--resize': resize,
|
|
112
|
-
'--rows': `${rows}em`
|
|
113
|
-
}
|
|
114
|
-
}, /*#__PURE__*/React.createElement(FormLabelV2, {
|
|
115
|
-
name: name,
|
|
116
|
-
color: labelColor,
|
|
117
|
-
optional: optional
|
|
118
|
-
}, label), !disabled && /*#__PURE__*/React.createElement(Toolbar, null), /*#__PURE__*/React.createElement(RichTextPlugin, {
|
|
119
|
-
contentEditable: /*#__PURE__*/React.createElement(ContentEditable, {
|
|
120
|
-
id: name,
|
|
121
|
-
className: "content-editable"
|
|
122
|
-
})
|
|
123
|
-
}), /*#__PURE__*/React.createElement(OnChangePlugin, {
|
|
124
|
-
onChange: onChange
|
|
125
|
-
}), /*#__PURE__*/React.createElement(LinkPlugin, null), /*#__PURE__*/React.createElement(ListPlugin, null), /*#__PURE__*/React.createElement(TabIndentationPlugin, null), /*#__PURE__*/React.createElement(HistoryPlugin, null), /*#__PURE__*/React.createElement(FormDescriptionV2, {
|
|
126
|
-
className: "s-1",
|
|
127
|
-
description: description,
|
|
128
|
-
name: name
|
|
129
|
-
}), showDebugger && /*#__PURE__*/React.createElement(TreeViewPlugin, null)));
|
|
130
|
-
};
|
|
131
|
-
EditorInput.propTypes = {
|
|
132
|
-
/**
|
|
133
|
-
* The HTML id for this element
|
|
134
|
-
*/
|
|
135
|
-
id: PropTypes.string,
|
|
136
|
-
/**
|
|
137
|
-
* The HTML class names for this element
|
|
138
|
-
*/
|
|
139
|
-
className: PropTypes.string,
|
|
140
|
-
/**
|
|
141
|
-
* The React-written, css properties for this element.
|
|
142
|
-
*/
|
|
143
|
-
style: PropTypes.objectOf(PropTypes.string),
|
|
144
|
-
/**
|
|
145
|
-
* The input name (html - and Formik state)
|
|
146
|
-
*/
|
|
147
|
-
name: PropTypes.string.isRequired,
|
|
148
|
-
/**
|
|
149
|
-
* The input label
|
|
150
|
-
*/
|
|
151
|
-
label: PropTypes.string.isRequired,
|
|
152
|
-
/**
|
|
153
|
-
* The input value validator function
|
|
154
|
-
*/
|
|
155
|
-
// validate:PropTypes.func,
|
|
156
|
-
|
|
157
|
-
/**
|
|
158
|
-
* The number of rows int the text area
|
|
159
|
-
*/
|
|
160
|
-
rows: PropTypes.number,
|
|
161
|
-
/**
|
|
162
|
-
* Color of the text
|
|
163
|
-
*/
|
|
164
|
-
color: PropTypes.string,
|
|
165
|
-
/**
|
|
166
|
-
* Label base color
|
|
167
|
-
*/
|
|
168
|
-
labelColor: PropTypes.string,
|
|
169
|
-
/**
|
|
170
|
-
* Text area description
|
|
171
|
-
*/
|
|
172
|
-
description: PropTypes.string,
|
|
173
|
-
/**
|
|
174
|
-
* Whether the text area should be disabled
|
|
175
|
-
*/
|
|
176
|
-
disabled: PropTypes.bool,
|
|
177
|
-
/**
|
|
178
|
-
* Whether the input is optional or not
|
|
179
|
-
*/
|
|
180
|
-
optional: PropTypes.bool,
|
|
181
|
-
/**
|
|
182
|
-
* The resize property of the text area
|
|
183
|
-
*/
|
|
184
|
-
resize: PropTypes.oneOf(['none', 'both', 'horizontal', 'vertical'])
|
|
185
|
-
};
|
|
186
|
-
EditorInput.defaultProps = {
|
|
187
|
-
rows: 10,
|
|
188
|
-
disabled: false,
|
|
189
|
-
color: 'paragraph',
|
|
190
|
-
resize: 'vertical'
|
|
191
|
-
};
|
|
192
|
-
export default /*#__PURE__*/memo(EditorInput);
|
|
@@ -1,246 +0,0 @@
|
|
|
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;
|
|
@@ -1,11 +0,0 @@
|
|
|
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;
|
|
@@ -1,149 +0,0 @@
|
|
|
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
|
-
$default-gap: calc(var(--gap) / 2);
|
|
8
|
-
$default-padding: .55em .75em;
|
|
9
|
-
$default-border: 1px solid var(--outline-inputs);
|
|
10
|
-
$default-input-border-radius: var(--theme-default-input-border-radius);
|
|
11
|
-
$default-border: var(--theme-default-input-border);
|
|
12
|
-
$focus-border: var(--theme-focus-input-border);
|
|
13
|
-
$active-background: var(--hard-background-inputs);
|
|
14
|
-
$default-background: var(--background-inputs);
|
|
15
|
-
$default-icon-color: var(--on-background-inputs);
|
|
16
|
-
$disabled-background: var(--background-inputs-30);
|
|
17
|
-
$default-color-menu-padding: .5em .25em;
|
|
18
|
-
|
|
19
|
-
.#{bem.$base}.editor-input {
|
|
20
|
-
display: flex;
|
|
21
|
-
flex-direction: column;
|
|
22
|
-
|
|
23
|
-
> .#{bem.$base}.form-label {
|
|
24
|
-
margin-bottom: var(--gap);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
> .#{bem.$base}.toolbar {
|
|
28
|
-
display: flex;
|
|
29
|
-
gap: $default-gap;
|
|
30
|
-
margin-bottom: .25em;
|
|
31
|
-
|
|
32
|
-
> .group {
|
|
33
|
-
> button {
|
|
34
|
-
background: $default-background;
|
|
35
|
-
border: $default-border;
|
|
36
|
-
color: $default-icon-color;
|
|
37
|
-
padding: $default-padding;
|
|
38
|
-
|
|
39
|
-
&.active {
|
|
40
|
-
background-color: $active-background;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.flip {
|
|
46
|
-
transform: scaleX(-1);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
&:not(.disabled) {
|
|
51
|
-
&:hover,
|
|
52
|
-
&:focus,
|
|
53
|
-
&:active {
|
|
54
|
-
> .textarea {
|
|
55
|
-
border: $focus-border;
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
&.disabled {
|
|
61
|
-
> .textarea {
|
|
62
|
-
background: $disabled-background;
|
|
63
|
-
color: var(--metadata);
|
|
64
|
-
cursor: not-allowed;
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.color-menu-button {
|
|
69
|
-
&:hover {
|
|
70
|
-
> .#{bem.$base}.popover {
|
|
71
|
-
display: block;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
> .#{bem.$base}.popover {
|
|
76
|
-
padding: $default-color-menu-padding;
|
|
77
|
-
|
|
78
|
-
.color-menu {
|
|
79
|
-
display: flex;
|
|
80
|
-
flex-wrap: wrap;
|
|
81
|
-
gap: calc($default-gap / 2);
|
|
82
|
-
justify-content: center;
|
|
83
|
-
max-width: 10em;
|
|
84
|
-
min-width: 5em;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.color-option:hover {
|
|
88
|
-
opacity: .5;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
> .content-editable {
|
|
94
|
-
background: $default-background;
|
|
95
|
-
border: $default-border;
|
|
96
|
-
border-radius: $default-input-border-radius;
|
|
97
|
-
color: var(--y);
|
|
98
|
-
height: var(--rows);
|
|
99
|
-
outline: none;
|
|
100
|
-
overflow: auto;
|
|
101
|
-
padding: $default-padding;
|
|
102
|
-
resize: var(--resize);
|
|
103
|
-
width: 100%;
|
|
104
|
-
|
|
105
|
-
li:has(ol, ul) {
|
|
106
|
-
list-style-type: none;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
p,
|
|
110
|
-
span,
|
|
111
|
-
strong,
|
|
112
|
-
em,
|
|
113
|
-
li {
|
|
114
|
-
&.underlined {
|
|
115
|
-
text-decoration: underline;
|
|
116
|
-
|
|
117
|
-
&.strikethrough {
|
|
118
|
-
text-decoration: underline line-through;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
&.strikethrough {
|
|
123
|
-
text-decoration: line-through;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
&.italic {
|
|
127
|
-
font-style: italic;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
:first-child {
|
|
132
|
-
margin-top: 0;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
&::placeholder {
|
|
136
|
-
color: var(--metadata);
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
> .tree-view-output {
|
|
142
|
-
background: $default-background;
|
|
143
|
-
border: $default-border;
|
|
144
|
-
border-radius: $default-input-border-radius;
|
|
145
|
-
max-height: 20em;
|
|
146
|
-
overflow: auto;
|
|
147
|
-
padding: $default-padding;
|
|
148
|
-
}
|
|
149
|
-
}
|