@pareto-engineering/design-system 4.0.0-alpha.63 → 4.0.0-alpha.64
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/Description/Description.js +6 -5
- package/dist/cjs/f/common/Label/Label.js +9 -22
- 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 +16 -21
- package/dist/cjs/f/fields/Checkbox/styles.scss +7 -5
- package/dist/cjs/f/fields/ChoicesInput/ChoicesInput.js +13 -23
- package/dist/cjs/f/fields/ChoicesInput/styles.scss +44 -41
- package/dist/cjs/f/fields/EditorInput/EditorInput.js +11 -39
- package/dist/cjs/f/fields/EditorInput/styles.scss +92 -90
- package/dist/cjs/f/fields/LinkInput/LinkInput.js +14 -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 +4 -30
- package/dist/cjs/f/fields/QueryCombobox/common/Combobox/Combobox.js +7 -16
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +9 -17
- package/dist/cjs/f/fields/QueryCombobox/styles.scss +38 -37
- package/dist/cjs/f/fields/QuerySelect/QuerySelect.js +2 -10
- package/dist/cjs/f/fields/RatingsInput/RatingsInput.js +14 -38
- package/dist/cjs/f/fields/RatingsInput/styles.scss +5 -1
- package/dist/cjs/f/fields/SelectInput/SelectInput.js +14 -36
- package/dist/cjs/f/fields/SelectInput/styles.scss +5 -2
- package/dist/cjs/f/fields/TextInput/TextInput.js +19 -37
- package/dist/cjs/f/fields/TextInput/styles.scss +37 -30
- package/dist/cjs/f/fields/TextareaInput/TextareaInput.js +15 -37
- 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 +4 -1
- package/dist/es/f/common/Label/Label.js +15 -24
- 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 +14 -19
- package/dist/es/f/fields/Checkbox/styles.scss +7 -5
- package/dist/es/f/fields/ChoicesInput/ChoicesInput.js +31 -39
- package/dist/es/f/fields/ChoicesInput/styles.scss +44 -41
- package/dist/es/f/fields/EditorInput/EditorInput.js +12 -35
- package/dist/es/f/fields/EditorInput/styles.scss +92 -90
- package/dist/es/f/fields/LinkInput/LinkInput.js +14 -20
- 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 +4 -26
- package/dist/es/f/fields/QueryCombobox/common/Combobox/Combobox.js +8 -17
- package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +10 -18
- package/dist/es/f/fields/QueryCombobox/styles.scss +38 -37
- package/dist/es/f/fields/QuerySelect/QuerySelect.js +2 -10
- package/dist/es/f/fields/RatingsInput/RatingsInput.js +15 -35
- package/dist/es/f/fields/RatingsInput/styles.scss +5 -1
- package/dist/es/f/fields/SelectInput/SelectInput.js +14 -36
- package/dist/es/f/fields/SelectInput/styles.scss +5 -2
- package/dist/es/f/fields/TextInput/TextInput.js +19 -37
- package/dist/es/f/fields/TextInput/styles.scss +37 -30
- package/dist/es/f/fields/TextareaInput/TextareaInput.js +15 -37
- package/dist/es/f/fields/TextareaInput/styles.scss +30 -27
- package/dist/es/f/fields/index.js +1 -2
- package/package.json +2 -2
- 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 +6 -2
- package/src/ui/f/common/Label/Label.jsx +27 -37
- 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 +27 -33
- package/src/ui/f/fields/Checkbox/styles.scss +7 -5
- package/src/ui/f/fields/ChoicesInput/ChoicesInput.jsx +29 -38
- package/src/ui/f/fields/ChoicesInput/styles.scss +44 -41
- package/src/ui/f/fields/EditorInput/EditorInput.jsx +16 -41
- package/src/ui/f/fields/EditorInput/styles.scss +92 -90
- package/src/ui/f/fields/LinkInput/LinkInput.jsx +38 -45
- 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 +5 -31
- package/src/ui/f/fields/QueryCombobox/common/Combobox/Combobox.jsx +35 -46
- package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +63 -73
- package/src/ui/f/fields/QueryCombobox/styles.scss +38 -37
- package/src/ui/f/fields/QuerySelect/QuerySelect.jsx +0 -8
- package/src/ui/f/fields/RatingsInput/RatingsInput.jsx +20 -47
- package/src/ui/f/fields/RatingsInput/styles.scss +5 -1
- package/src/ui/f/fields/SelectInput/SelectInput.jsx +33 -61
- package/src/ui/f/fields/SelectInput/styles.scss +5 -2
- package/src/ui/f/fields/TextInput/TextInput.jsx +27 -50
- package/src/ui/f/fields/TextInput/styles.scss +37 -30
- package/src/ui/f/fields/TextareaInput/TextareaInput.jsx +32 -59
- package/src/ui/f/fields/TextareaInput/styles.scss +30 -27
- package/src/ui/f/fields/index.js +0 -1
- 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,244 +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
|
-
|
|
17
|
-
import PropTypes from 'prop-types'
|
|
18
|
-
import styleNames from '@pareto-engineering/bem/exports'
|
|
19
|
-
|
|
20
|
-
// Local Definitions
|
|
21
|
-
|
|
22
|
-
import { FormLabelV2, FormDescriptionV2 } from '../../../common'
|
|
23
|
-
import { Toolbar, TreeViewPlugin } from './common'
|
|
24
|
-
|
|
25
|
-
const baseClassName = styleNames.base
|
|
26
|
-
const componentClassName = 'editor-input'
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* This is the component description.
|
|
30
|
-
*/
|
|
31
|
-
const EditorInput = ({
|
|
32
|
-
id,
|
|
33
|
-
className:userClassName,
|
|
34
|
-
style,
|
|
35
|
-
name,
|
|
36
|
-
label,
|
|
37
|
-
// validate,
|
|
38
|
-
resize,
|
|
39
|
-
color,
|
|
40
|
-
rows,
|
|
41
|
-
optional,
|
|
42
|
-
labelColor,
|
|
43
|
-
description,
|
|
44
|
-
disabled,
|
|
45
|
-
showDebugger,
|
|
46
|
-
// ...otherProps
|
|
47
|
-
}) => {
|
|
48
|
-
useInsertionEffect(() => {
|
|
49
|
-
import('./styles.scss')
|
|
50
|
-
}, [])
|
|
51
|
-
|
|
52
|
-
const formik = useFormikContext()
|
|
53
|
-
|
|
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
|
-
{
|
|
64
|
-
children:[
|
|
65
|
-
{
|
|
66
|
-
detail :0,
|
|
67
|
-
format :0,
|
|
68
|
-
mode :'normal',
|
|
69
|
-
style :'',
|
|
70
|
-
text :'',
|
|
71
|
-
type :'text',
|
|
72
|
-
version:1,
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
direction:'ltr',
|
|
76
|
-
format :'',
|
|
77
|
-
indent :0,
|
|
78
|
-
type :'paragraph',
|
|
79
|
-
version :1,
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
|
-
direction:'ltr',
|
|
83
|
-
format :'',
|
|
84
|
-
indent :0,
|
|
85
|
-
type :'root',
|
|
86
|
-
version :1,
|
|
87
|
-
},
|
|
88
|
-
}
|
|
89
|
-
defaultValue.root.children[0].children[0].text = value
|
|
90
|
-
return JSON.stringify(defaultValue)
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const onChange = (state) => {
|
|
95
|
-
formik.setValues({
|
|
96
|
-
...formik.values,
|
|
97
|
-
[name]:JSON.stringify(state),
|
|
98
|
-
})
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const initialConfig = {
|
|
102
|
-
nameSpace :name,
|
|
103
|
-
editable :!disabled,
|
|
104
|
-
editorState:setInitialValue(),
|
|
105
|
-
theme :{
|
|
106
|
-
text:{
|
|
107
|
-
italic :'italic',
|
|
108
|
-
strikethrough:'strikethrough',
|
|
109
|
-
underline :'underlined',
|
|
110
|
-
},
|
|
111
|
-
},
|
|
112
|
-
nodes:[
|
|
113
|
-
AutoLinkNode,
|
|
114
|
-
LinkNode,
|
|
115
|
-
ListNode,
|
|
116
|
-
ListItemNode,
|
|
117
|
-
],
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return (
|
|
121
|
-
<LexicalComposer
|
|
122
|
-
initialConfig={initialConfig}
|
|
123
|
-
>
|
|
124
|
-
<div
|
|
125
|
-
id={id}
|
|
126
|
-
className={[
|
|
127
|
-
baseClassName,
|
|
128
|
-
componentClassName,
|
|
129
|
-
userClassName,
|
|
130
|
-
`y-${color}`,
|
|
131
|
-
disabled && 'disabled',
|
|
132
|
-
]
|
|
133
|
-
.filter((e) => e)
|
|
134
|
-
.join(' ')}
|
|
135
|
-
style={{
|
|
136
|
-
...style,
|
|
137
|
-
'--resize':resize,
|
|
138
|
-
'--rows' :`${rows}em`,
|
|
139
|
-
}}
|
|
140
|
-
>
|
|
141
|
-
<FormLabelV2
|
|
142
|
-
name={name}
|
|
143
|
-
color={labelColor}
|
|
144
|
-
optional={optional}
|
|
145
|
-
>
|
|
146
|
-
{label}
|
|
147
|
-
</FormLabelV2>
|
|
148
|
-
|
|
149
|
-
{ !disabled && <Toolbar /> }
|
|
150
|
-
<RichTextPlugin
|
|
151
|
-
contentEditable={(
|
|
152
|
-
<ContentEditable
|
|
153
|
-
id={name}
|
|
154
|
-
className="content-editable"
|
|
155
|
-
/>
|
|
156
|
-
)}
|
|
157
|
-
/>
|
|
158
|
-
<OnChangePlugin onChange={onChange} />
|
|
159
|
-
<LinkPlugin />
|
|
160
|
-
<ListPlugin />
|
|
161
|
-
<TabIndentationPlugin />
|
|
162
|
-
<HistoryPlugin />
|
|
163
|
-
<FormDescriptionV2 className="s-1" description={description} name={name} />
|
|
164
|
-
{ showDebugger && <TreeViewPlugin />}
|
|
165
|
-
</div>
|
|
166
|
-
</LexicalComposer>
|
|
167
|
-
)
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
EditorInput.propTypes = {
|
|
171
|
-
/**
|
|
172
|
-
* The HTML id for this element
|
|
173
|
-
*/
|
|
174
|
-
id:PropTypes.string,
|
|
175
|
-
|
|
176
|
-
/**
|
|
177
|
-
* The HTML class names for this element
|
|
178
|
-
*/
|
|
179
|
-
className:PropTypes.string,
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* The React-written, css properties for this element.
|
|
183
|
-
*/
|
|
184
|
-
style:PropTypes.objectOf(PropTypes.string),
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* The input name (html - and Formik state)
|
|
188
|
-
*/
|
|
189
|
-
name:PropTypes.string.isRequired,
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* The input label
|
|
193
|
-
*/
|
|
194
|
-
label:PropTypes.string.isRequired,
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* The input value validator function
|
|
198
|
-
*/
|
|
199
|
-
// validate:PropTypes.func,
|
|
200
|
-
|
|
201
|
-
/**
|
|
202
|
-
* The number of rows int the text area
|
|
203
|
-
*/
|
|
204
|
-
rows:PropTypes.number,
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* Color of the text
|
|
208
|
-
*/
|
|
209
|
-
color:PropTypes.string,
|
|
210
|
-
|
|
211
|
-
/**
|
|
212
|
-
* Label base color
|
|
213
|
-
*/
|
|
214
|
-
labelColor:PropTypes.string,
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Text area description
|
|
218
|
-
*/
|
|
219
|
-
description:PropTypes.string,
|
|
220
|
-
|
|
221
|
-
/**
|
|
222
|
-
* Whether the text area should be disabled
|
|
223
|
-
*/
|
|
224
|
-
disabled:PropTypes.bool,
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* Whether the input is optional or not
|
|
228
|
-
*/
|
|
229
|
-
optional:PropTypes.bool,
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* The resize property of the text area
|
|
233
|
-
*/
|
|
234
|
-
resize:PropTypes.oneOf(['none', 'both', 'horizontal', 'vertical']),
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
EditorInput.defaultProps = {
|
|
238
|
-
rows :10,
|
|
239
|
-
disabled:false,
|
|
240
|
-
color :'paragraph',
|
|
241
|
-
resize :'vertical',
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
export default memo(EditorInput)
|
|
@@ -1,356 +0,0 @@
|
|
|
1
|
-
/* eslint-disable import/no-extraneous-dependencies -- required here */
|
|
2
|
-
import * as React from 'react'
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
useEffect,
|
|
6
|
-
useState,
|
|
7
|
-
useCallback,
|
|
8
|
-
useRef,
|
|
9
|
-
} from 'react'
|
|
10
|
-
|
|
11
|
-
import {
|
|
12
|
-
$getSelection,
|
|
13
|
-
$isRangeSelection,
|
|
14
|
-
FORMAT_TEXT_COMMAND,
|
|
15
|
-
FORMAT_ELEMENT_COMMAND,
|
|
16
|
-
UNDO_COMMAND,
|
|
17
|
-
REDO_COMMAND,
|
|
18
|
-
COMMAND_PRIORITY_NORMAL,
|
|
19
|
-
createCommand,
|
|
20
|
-
} from 'lexical'
|
|
21
|
-
import {
|
|
22
|
-
INSERT_ORDERED_LIST_COMMAND,
|
|
23
|
-
INSERT_UNORDERED_LIST_COMMAND,
|
|
24
|
-
REMOVE_LIST_COMMAND,
|
|
25
|
-
$isListNode,
|
|
26
|
-
ListNode,
|
|
27
|
-
} from '@lexical/list'
|
|
28
|
-
import {
|
|
29
|
-
$isAtNodeEnd,
|
|
30
|
-
} from '@lexical/selection'
|
|
31
|
-
import {
|
|
32
|
-
$isLinkNode,
|
|
33
|
-
TOGGLE_LINK_COMMAND,
|
|
34
|
-
} from '@lexical/link'
|
|
35
|
-
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
|
36
|
-
import { mergeRegister, $getNearestNodeOfType } from '@lexical/utils'
|
|
37
|
-
|
|
38
|
-
import { Popover } from 'ui'
|
|
39
|
-
|
|
40
|
-
import styleNames from '@pareto-engineering/bem/exports'
|
|
41
|
-
|
|
42
|
-
const baseClassName = styleNames.base
|
|
43
|
-
|
|
44
|
-
const componentClassName = 'toolbar'
|
|
45
|
-
|
|
46
|
-
const getSelectedNode = (selection) => {
|
|
47
|
-
const { anchor, focus } = selection
|
|
48
|
-
const anchorNode = selection.anchor.getNode()
|
|
49
|
-
const focusNode = selection.focus.getNode()
|
|
50
|
-
if (anchorNode === focusNode) {
|
|
51
|
-
return anchorNode
|
|
52
|
-
}
|
|
53
|
-
const isBackward = selection.isBackward()
|
|
54
|
-
if (isBackward) {
|
|
55
|
-
return $isAtNodeEnd(focus) ? anchorNode : focusNode
|
|
56
|
-
}
|
|
57
|
-
return $isAtNodeEnd(anchor) ? focusNode : anchorNode
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const defaultColor = 'var(--paragraph)'
|
|
61
|
-
|
|
62
|
-
const colorOptions = [
|
|
63
|
-
'red',
|
|
64
|
-
'blue',
|
|
65
|
-
'green',
|
|
66
|
-
'yellow',
|
|
67
|
-
'orange',
|
|
68
|
-
'purple',
|
|
69
|
-
'pink',
|
|
70
|
-
'brown',
|
|
71
|
-
]
|
|
72
|
-
|
|
73
|
-
const Toolbar = () => {
|
|
74
|
-
const [editor] = useLexicalComposerContext()
|
|
75
|
-
const [isBold, setIsBold] = useState(false)
|
|
76
|
-
const [isItalic, setIsItalic] = useState(false)
|
|
77
|
-
const [isStrikethrough, setIsStrikethrough] = useState(false)
|
|
78
|
-
const [blockType, setBlockType] = useState('paragraph')
|
|
79
|
-
const [isLink, setIsLink] = useState(false)
|
|
80
|
-
const [isUnderline, setIsUnderline] = useState(false)
|
|
81
|
-
const [color, setColor] = useState(defaultColor)
|
|
82
|
-
|
|
83
|
-
const colorMenuRef = useRef(false)
|
|
84
|
-
|
|
85
|
-
const formatBulletList = () => {
|
|
86
|
-
if (blockType !== 'ul') {
|
|
87
|
-
editor.dispatchCommand(INSERT_UNORDERED_LIST_COMMAND)
|
|
88
|
-
} else {
|
|
89
|
-
editor.dispatchCommand(REMOVE_LIST_COMMAND)
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const formatNumberedList = () => {
|
|
94
|
-
if (blockType !== 'ol') {
|
|
95
|
-
editor.dispatchCommand(INSERT_ORDERED_LIST_COMMAND)
|
|
96
|
-
} else {
|
|
97
|
-
editor.dispatchCommand(REMOVE_LIST_COMMAND)
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
const formatLink = useCallback(() => {
|
|
102
|
-
if (!isLink) {
|
|
103
|
-
// eslint-disable-next-line no-alert
|
|
104
|
-
const path = prompt('Enter the full URL. Ex: https://www.example.com')
|
|
105
|
-
editor.dispatchCommand(TOGGLE_LINK_COMMAND, path)
|
|
106
|
-
} else {
|
|
107
|
-
editor.dispatchCommand(TOGGLE_LINK_COMMAND, null)
|
|
108
|
-
}
|
|
109
|
-
}, [editor, isLink])
|
|
110
|
-
|
|
111
|
-
const updateToolbar = useCallback(() => {
|
|
112
|
-
const selection = $getSelection()
|
|
113
|
-
|
|
114
|
-
// Check list selection
|
|
115
|
-
if ($isRangeSelection(selection)) {
|
|
116
|
-
const anchorNode = selection.anchor.getNode()
|
|
117
|
-
const element = anchorNode.getKey() === 'root'
|
|
118
|
-
? anchorNode
|
|
119
|
-
: anchorNode.getTopLevelElementOrThrow()
|
|
120
|
-
if ($isListNode(element)) {
|
|
121
|
-
const parentList = $getNearestNodeOfType(anchorNode, ListNode)
|
|
122
|
-
const type = parentList ? parentList.getTag() : element.getTag()
|
|
123
|
-
setBlockType(type)
|
|
124
|
-
} else {
|
|
125
|
-
setBlockType(element)
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// Check nodes for color
|
|
129
|
-
const nodes = selection.getNodes().filter((node) => node.getType() === 'text')
|
|
130
|
-
nodes.forEach((node) => {
|
|
131
|
-
const style = node.getStyle()
|
|
132
|
-
const colorProperty = style.match(/color: ([^;]+)/)
|
|
133
|
-
if (colorProperty) {
|
|
134
|
-
setColor(colorProperty[1])
|
|
135
|
-
return
|
|
136
|
-
}
|
|
137
|
-
setColor(false)
|
|
138
|
-
})
|
|
139
|
-
|
|
140
|
-
// Check selection text styles
|
|
141
|
-
setIsBold(selection.hasFormat('bold'))
|
|
142
|
-
setIsItalic(selection.hasFormat('italic'))
|
|
143
|
-
setIsStrikethrough(selection.hasFormat('strikethrough'))
|
|
144
|
-
setIsUnderline(selection.hasFormat('underline'))
|
|
145
|
-
setIsLink(selection.hasFormat('link'))
|
|
146
|
-
|
|
147
|
-
// Check links
|
|
148
|
-
const node = getSelectedNode(selection)
|
|
149
|
-
const parent = node.getParent()
|
|
150
|
-
if ($isLinkNode(parent) || $isLinkNode(node)) {
|
|
151
|
-
setIsLink(true)
|
|
152
|
-
} else {
|
|
153
|
-
setIsLink(false)
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}, [editor])
|
|
157
|
-
|
|
158
|
-
const UPDATE_COLOR_COMMAND = createCommand()
|
|
159
|
-
|
|
160
|
-
editor.registerCommand(UPDATE_COLOR_COMMAND, (payload) => {
|
|
161
|
-
const selection = $getSelection()
|
|
162
|
-
const nodes = selection?.extract().filter((node) => node.getType() === 'text')
|
|
163
|
-
nodes?.forEach((node) => {
|
|
164
|
-
const style = node.getStyle()
|
|
165
|
-
const colorProperty = style?.match(/color: ([^;]+)/)
|
|
166
|
-
if (colorProperty && color !== payload) {
|
|
167
|
-
node.setStyle(style.replace(colorProperty[0], `color: ${payload}`))
|
|
168
|
-
} else if (colorProperty) {
|
|
169
|
-
node.setStyle(`color: ${defaultColor}`)
|
|
170
|
-
} else {
|
|
171
|
-
node.setStyle(`color: ${payload}`)
|
|
172
|
-
}
|
|
173
|
-
})
|
|
174
|
-
}, COMMAND_PRIORITY_NORMAL)
|
|
175
|
-
|
|
176
|
-
useEffect(() => mergeRegister(
|
|
177
|
-
editor.registerUpdateListener(({ editorState }) => {
|
|
178
|
-
editorState.read(() => {
|
|
179
|
-
updateToolbar()
|
|
180
|
-
})
|
|
181
|
-
}),
|
|
182
|
-
), [updateToolbar, editor])
|
|
183
|
-
|
|
184
|
-
const dispatchUpdateColor = useCallback((e, payload) => {
|
|
185
|
-
e.stopPropagation()
|
|
186
|
-
editor.dispatchCommand(UPDATE_COLOR_COMMAND, payload)
|
|
187
|
-
}, [editor])
|
|
188
|
-
|
|
189
|
-
return (
|
|
190
|
-
<div className={`${baseClassName} ${componentClassName}`}>
|
|
191
|
-
<div className="group">
|
|
192
|
-
<button
|
|
193
|
-
type="button"
|
|
194
|
-
className={isBold ? 'active' : undefined}
|
|
195
|
-
onClick={() => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'bold')}
|
|
196
|
-
>
|
|
197
|
-
<span className="icon">
|
|
198
|
-
|
|
|
199
|
-
</span>
|
|
200
|
-
</button>
|
|
201
|
-
<button
|
|
202
|
-
type="button"
|
|
203
|
-
className={isItalic ? 'active' : undefined}
|
|
204
|
-
onClick={() => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'italic')}
|
|
205
|
-
>
|
|
206
|
-
<span className="icon">
|
|
207
|
-
}
|
|
208
|
-
</span>
|
|
209
|
-
</button>
|
|
210
|
-
<button
|
|
211
|
-
type="button"
|
|
212
|
-
className={isUnderline ? 'active' : undefined}
|
|
213
|
-
onClick={() => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'underline')}
|
|
214
|
-
>
|
|
215
|
-
<span className="icon">
|
|
216
|
-
~
|
|
217
|
-
</span>
|
|
218
|
-
</button>
|
|
219
|
-
<button
|
|
220
|
-
type="button"
|
|
221
|
-
className={isStrikethrough ? 'active' : undefined}
|
|
222
|
-
onClick={() => editor.dispatchCommand(FORMAT_TEXT_COMMAND, 'strikethrough')}
|
|
223
|
-
>
|
|
224
|
-
<span className="icon">
|
|
225
|
-
?
|
|
226
|
-
</span>
|
|
227
|
-
</button>
|
|
228
|
-
<button
|
|
229
|
-
type="button"
|
|
230
|
-
className={color && color !== defaultColor ? 'active color-menu-button' : 'color-menu-button'}
|
|
231
|
-
onClick={() => editor.dispatchCommand(UPDATE_COLOR_COMMAND,
|
|
232
|
-
color !== defaultColor ? defaultColor : color)}
|
|
233
|
-
ref={colorMenuRef}
|
|
234
|
-
style={{ position: 'relative' }}
|
|
235
|
-
>
|
|
236
|
-
<span
|
|
237
|
-
className="icon"
|
|
238
|
-
style={{
|
|
239
|
-
color,
|
|
240
|
-
}}
|
|
241
|
-
>
|
|
242
|
-
Q
|
|
243
|
-
</span>
|
|
244
|
-
<Popover
|
|
245
|
-
parentRef={colorMenuRef}
|
|
246
|
-
>
|
|
247
|
-
<div className="color-menu">
|
|
248
|
-
{
|
|
249
|
-
colorOptions.map((option) => (
|
|
250
|
-
<span
|
|
251
|
-
role="button"
|
|
252
|
-
className="icon color-option"
|
|
253
|
-
style={{
|
|
254
|
-
color:option,
|
|
255
|
-
}}
|
|
256
|
-
onClick={(e) => dispatchUpdateColor(e, option)}
|
|
257
|
-
onKeyDown={(e) => dispatchUpdateColor(e, option)}
|
|
258
|
-
tabIndex={0}
|
|
259
|
-
key={option}
|
|
260
|
-
>
|
|
261
|
-
o
|
|
262
|
-
</span>
|
|
263
|
-
))
|
|
264
|
-
}
|
|
265
|
-
</div>
|
|
266
|
-
</Popover>
|
|
267
|
-
</button>
|
|
268
|
-
|
|
269
|
-
<button
|
|
270
|
-
type="button"
|
|
271
|
-
className={isLink ? 'active' : undefined}
|
|
272
|
-
onClick={() => formatLink()}
|
|
273
|
-
>
|
|
274
|
-
<span className="icon">
|
|
275
|
-
]
|
|
276
|
-
</span>
|
|
277
|
-
</button>
|
|
278
|
-
<button
|
|
279
|
-
type="button"
|
|
280
|
-
className={blockType === 'ul' ? 'active' : undefined}
|
|
281
|
-
onClick={() => formatBulletList()}
|
|
282
|
-
>
|
|
283
|
-
<span className="icon">
|
|
284
|
-
.
|
|
285
|
-
</span>
|
|
286
|
-
</button>
|
|
287
|
-
<button
|
|
288
|
-
type="button"
|
|
289
|
-
className={blockType === 'ol' ? 'active' : undefined}
|
|
290
|
-
onClick={() => formatNumberedList()}
|
|
291
|
-
>
|
|
292
|
-
<span className="icon">
|
|
293
|
-
-
|
|
294
|
-
</span>
|
|
295
|
-
</button>
|
|
296
|
-
</div>
|
|
297
|
-
|
|
298
|
-
<div className="group">
|
|
299
|
-
<button
|
|
300
|
-
type="button"
|
|
301
|
-
onClick={() => editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'left')}
|
|
302
|
-
>
|
|
303
|
-
<span className="icon">
|
|
304
|
-
^
|
|
305
|
-
</span>
|
|
306
|
-
</button>
|
|
307
|
-
<button
|
|
308
|
-
type="button"
|
|
309
|
-
onClick={() => editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'center')}
|
|
310
|
-
>
|
|
311
|
-
<span className="icon">
|
|
312
|
-
_
|
|
313
|
-
</span>
|
|
314
|
-
</button>
|
|
315
|
-
<button
|
|
316
|
-
type="button"
|
|
317
|
-
onClick={() => editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'right')}
|
|
318
|
-
>
|
|
319
|
-
<span className="icon">
|
|
320
|
-
`
|
|
321
|
-
</span>
|
|
322
|
-
</button>
|
|
323
|
-
<button
|
|
324
|
-
type="button"
|
|
325
|
-
onClick={() => editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'justify')}
|
|
326
|
-
>
|
|
327
|
-
<span className="icon">
|
|
328
|
-
{
|
|
329
|
-
</span>
|
|
330
|
-
</button>
|
|
331
|
-
</div>
|
|
332
|
-
|
|
333
|
-
<div className="group">
|
|
334
|
-
<button
|
|
335
|
-
type="button"
|
|
336
|
-
onClick={() => editor.dispatchCommand(UNDO_COMMAND)}
|
|
337
|
-
>
|
|
338
|
-
<span className="icon">
|
|
339
|
-
\
|
|
340
|
-
</span>
|
|
341
|
-
</button>
|
|
342
|
-
<button
|
|
343
|
-
type="button"
|
|
344
|
-
className="flip"
|
|
345
|
-
onClick={() => editor.dispatchCommand(REDO_COMMAND)}
|
|
346
|
-
>
|
|
347
|
-
<span className="icon">
|
|
348
|
-
\
|
|
349
|
-
</span>
|
|
350
|
-
</button>
|
|
351
|
-
</div>
|
|
352
|
-
</div>
|
|
353
|
-
)
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
export default Toolbar
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
|
3
|
-
import { TreeView } from '@lexical/react/LexicalTreeView'
|
|
4
|
-
|
|
5
|
-
const TreeViewPlugin = () => {
|
|
6
|
-
const [editor] = useLexicalComposerContext()
|
|
7
|
-
|
|
8
|
-
return (
|
|
9
|
-
<TreeView
|
|
10
|
-
viewClassName="tree-view-output"
|
|
11
|
-
editor={editor}
|
|
12
|
-
/>
|
|
13
|
-
)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
export default TreeViewPlugin
|