@pareto-engineering/design-system 4.0.0-alpha.69 → 4.0.0-alpha.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.storybook/preview.js +29 -12
- package/dist/cjs/a/AnimatedGradient/AnimatedGradient.js +0 -1
- package/dist/cjs/a/AnimatedGradient/webGIRenderer.js +0 -1
- package/dist/cjs/a/AppContext/ContextProvider.js +2 -0
- package/dist/cjs/{c/ContentSlides/common/Slide/Slide.js → a/LexicalPreview/LexicalPreview.js} +43 -28
- package/dist/cjs/{c/ContentSlides/common/HorizontalMenu → a/LexicalPreview}/index.js +3 -3
- package/dist/cjs/a/LexicalPreview/styles.scss +46 -0
- package/dist/cjs/a/People/common/Person/Person.js +7 -2
- package/dist/cjs/a/ProgressBar/ProgressBar.js +3 -3
- package/dist/cjs/a/ProgressBar/styles.scss +11 -1
- package/dist/cjs/a/XMLEditor/XMLEditor.js +123 -0
- package/dist/cjs/{c/ContentSlides/common/Slide → a/XMLEditor/common}/index.js +3 -3
- package/dist/cjs/a/XMLEditor/common/theme.js +186 -0
- package/dist/cjs/{c/ContentSlides/common/Navigator → a/XMLEditor}/index.js +3 -3
- package/dist/cjs/a/XMLEditor/styles.scss +17 -0
- package/dist/cjs/a/index.js +15 -1
- package/dist/cjs/b/ExpandableLexicalPreview/ExpandableLexicalPreview.js +125 -0
- package/dist/cjs/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.js +112 -0
- package/dist/cjs/{c/ContentSlides/common/Sidebar → b/ExpandableLexicalPreview/common/ExpandButton}/index.js +3 -3
- package/dist/cjs/b/ExpandableLexicalPreview/common/index.js +12 -0
- package/dist/cjs/b/ExpandableLexicalPreview/index.js +13 -0
- package/dist/cjs/b/ExpandableLexicalPreview/styles.scss +84 -0
- package/dist/cjs/b/Logo/Logo.js +0 -1
- package/dist/cjs/b/Title/Title.js +0 -1
- package/dist/cjs/b/index.js +8 -1
- package/dist/cjs/c/SocialMediaShareButton/SocialMediaShareButton.js +0 -2
- package/dist/cjs/c/index.js +0 -13
- package/dist/cjs/f/FormInput/FormInput.js +2 -0
- package/dist/cjs/f/fields/EditorInput/EditorInput.js +14 -3
- package/dist/cjs/f/fields/EditorInput/common/StopPropagationPlugin.js +30 -0
- package/dist/cjs/f/fields/EditorInput/common/index.js +7 -0
- package/dist/cjs/f/fields/QueryCombobox/QueryCombobox.js +11 -1
- package/dist/cjs/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +32 -3
- package/dist/cjs/index.js +0 -11
- package/dist/cjs/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +0 -1
- package/dist/es/a/AnimatedGradient/AnimatedGradient.js +0 -1
- package/dist/es/a/AnimatedGradient/webGIRenderer.js +0 -1
- package/dist/es/a/BlurOverlay/BlurOverlay.js +0 -1
- package/dist/es/a/DotInfo/DotInfo.js +0 -1
- package/dist/es/a/LexicalPreview/LexicalPreview.js +80 -0
- package/dist/es/a/LexicalPreview/index.js +2 -0
- package/dist/es/a/LexicalPreview/styles.scss +46 -0
- package/dist/es/a/People/common/Person/Person.js +22 -15
- package/dist/es/a/ProgressBar/ProgressBar.js +3 -3
- package/dist/es/a/ProgressBar/styles.scss +11 -1
- package/dist/es/a/XMLEditor/XMLEditor.js +112 -0
- package/dist/es/a/XMLEditor/common/index.js +1 -0
- package/dist/es/a/XMLEditor/common/theme.js +180 -0
- package/dist/es/a/XMLEditor/index.js +1 -0
- package/dist/es/a/XMLEditor/styles.scss +17 -0
- package/dist/es/a/index.js +3 -1
- package/dist/es/b/ExpandableLexicalPreview/ExpandableLexicalPreview.js +115 -0
- package/dist/es/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.js +102 -0
- package/dist/es/b/ExpandableLexicalPreview/common/ExpandButton/index.js +1 -0
- package/dist/es/b/ExpandableLexicalPreview/common/index.js +1 -0
- package/dist/es/b/ExpandableLexicalPreview/index.js +2 -0
- package/dist/es/b/ExpandableLexicalPreview/styles.scss +84 -0
- package/dist/es/b/Logo/Logo.js +0 -1
- package/dist/es/b/Title/Title.js +0 -1
- package/dist/es/b/index.js +2 -1
- package/dist/es/c/SocialMediaShareButton/SocialMediaShareButton.js +0 -2
- package/dist/es/c/index.js +0 -1
- package/dist/es/f/fields/EditorInput/EditorInput.js +15 -4
- package/dist/es/f/fields/EditorInput/common/StopPropagationPlugin.js +23 -0
- package/dist/es/f/fields/EditorInput/common/index.js +2 -1
- package/dist/es/f/fields/QueryCombobox/QueryCombobox.js +11 -1
- package/dist/es/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.js +32 -3
- package/dist/es/index.js +0 -1
- package/dist/es/test/QueryLoader/__generated__/QueryLoaderHelloQuery.graphql.js +0 -1
- package/package.json +7 -5
- package/src/stories/StyleGuide/ai-icons.stories.mdx +27 -0
- package/src/stories/StyleGuide/icons.stories.mdx +22 -22
- package/src/stories/a/LexicalPreview.stories.jsx +28 -0
- package/src/stories/a/ProgressBar.stories.jsx +1 -1
- package/src/stories/a/XMLEditor.stories.jsx +21 -0
- package/src/stories/b/ExpandableLexicalPreview.stories.jsx +29 -0
- package/src/stories/colors.js +4 -0
- package/src/stories/f/QueryCombobox.stories.jsx +22 -0
- package/src/ui/a/LexicalPreview/LexicalPreview.jsx +109 -0
- package/src/ui/a/LexicalPreview/index.js +2 -0
- package/src/ui/a/LexicalPreview/styles.scss +46 -0
- package/src/ui/a/People/common/Person/Person.jsx +31 -19
- package/src/ui/a/ProgressBar/ProgressBar.jsx +2 -0
- package/src/ui/a/ProgressBar/styles.scss +11 -1
- package/src/ui/a/XMLEditor/XMLEditor.jsx +182 -0
- package/src/ui/a/XMLEditor/common/index.js +1 -0
- package/src/ui/a/XMLEditor/common/theme.jsx +184 -0
- package/src/ui/a/XMLEditor/index.js +1 -0
- package/src/ui/a/XMLEditor/styles.scss +17 -0
- package/src/ui/a/index.js +2 -0
- package/src/ui/b/ExpandableLexicalPreview/ExpandableLexicalPreview.jsx +157 -0
- package/src/ui/b/ExpandableLexicalPreview/common/ExpandButton/ExpandButton.jsx +123 -0
- package/src/ui/b/ExpandableLexicalPreview/common/ExpandButton/index.js +1 -0
- package/src/ui/b/ExpandableLexicalPreview/common/index.js +1 -0
- package/src/ui/b/ExpandableLexicalPreview/index.js +2 -0
- package/src/ui/b/ExpandableLexicalPreview/styles.scss +84 -0
- package/src/ui/b/index.js +1 -0
- package/src/ui/c/index.js +0 -1
- package/src/ui/f/fields/EditorInput/EditorInput.jsx +16 -2
- package/src/ui/f/fields/EditorInput/common/StopPropagationPlugin.jsx +29 -0
- package/src/ui/f/fields/EditorInput/common/index.jsx +1 -0
- package/src/ui/f/fields/QueryCombobox/QueryCombobox.jsx +12 -0
- package/src/ui/f/fields/QueryCombobox/common/MultipleCombobox/MultipleCombobox.jsx +38 -1
- package/src/ui/index.js +0 -1
- package/tests/__snapshots__/Storyshots.test.js.snap +1531 -782
- package/dist/cjs/c/ContentSlides/ContentSlides.js +0 -172
- package/dist/cjs/c/ContentSlides/Context.js +0 -10
- package/dist/cjs/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +0 -124
- package/dist/cjs/c/ContentSlides/common/Navigator/Navigator.js +0 -128
- package/dist/cjs/c/ContentSlides/common/Sidebar/Sidebar.js +0 -92
- package/dist/cjs/c/ContentSlides/common/index.js +0 -33
- package/dist/cjs/c/ContentSlides/index.js +0 -27
- package/dist/cjs/c/ContentSlides/styles.scss +0 -312
- package/dist/cjs/c/ContentSlides/useContentSlides.js +0 -11
- package/dist/cjs/r/SwitchRouteMap/SwitchRouteMap.js +0 -58
- package/dist/cjs/r/SwitchRouteMap/index.js +0 -13
- package/dist/cjs/r/common/PrivateRoute/PrivateRoute.js +0 -75
- package/dist/cjs/r/common/PrivateRoute/index.js +0 -13
- package/dist/cjs/r/common/index.js +0 -12
- package/dist/cjs/r/index.js +0 -27
- package/dist/es/c/ContentSlides/ContentSlides.js +0 -160
- package/dist/es/c/ContentSlides/Context.js +0 -2
- package/dist/es/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.js +0 -116
- package/dist/es/c/ContentSlides/common/HorizontalMenu/index.js +0 -2
- package/dist/es/c/ContentSlides/common/Navigator/Navigator.js +0 -118
- package/dist/es/c/ContentSlides/common/Navigator/index.js +0 -2
- package/dist/es/c/ContentSlides/common/Sidebar/Sidebar.js +0 -84
- package/dist/es/c/ContentSlides/common/Sidebar/index.js +0 -2
- package/dist/es/c/ContentSlides/common/Slide/Slide.js +0 -65
- package/dist/es/c/ContentSlides/common/Slide/index.js +0 -2
- package/dist/es/c/ContentSlides/common/index.js +0 -4
- package/dist/es/c/ContentSlides/index.js +0 -4
- package/dist/es/c/ContentSlides/styles.scss +0 -312
- package/dist/es/c/ContentSlides/useContentSlides.js +0 -3
- package/dist/es/r/SwitchRouteMap/SwitchRouteMap.js +0 -45
- package/dist/es/r/SwitchRouteMap/index.js +0 -2
- package/dist/es/r/common/PrivateRoute/PrivateRoute.js +0 -67
- package/dist/es/r/common/PrivateRoute/index.js +0 -2
- package/dist/es/r/common/index.js +0 -1
- package/dist/es/r/index.js +0 -2
- package/src/stories/c/ContentSlides.stories.jsx +0 -214
- package/src/ui/c/ContentSlides/ContentSlides.jsx +0 -214
- package/src/ui/c/ContentSlides/Context.js +0 -3
- package/src/ui/c/ContentSlides/common/HorizontalMenu/HorizontalMenu.jsx +0 -145
- package/src/ui/c/ContentSlides/common/HorizontalMenu/index.js +0 -2
- package/src/ui/c/ContentSlides/common/Navigator/Navigator.jsx +0 -150
- package/src/ui/c/ContentSlides/common/Navigator/index.js +0 -2
- package/src/ui/c/ContentSlides/common/Sidebar/Sidebar.jsx +0 -135
- package/src/ui/c/ContentSlides/common/Sidebar/index.js +0 -2
- package/src/ui/c/ContentSlides/common/Slide/Slide.jsx +0 -87
- package/src/ui/c/ContentSlides/common/Slide/index.js +0 -2
- package/src/ui/c/ContentSlides/common/index.js +0 -4
- package/src/ui/c/ContentSlides/index.js +0 -4
- package/src/ui/c/ContentSlides/styles.scss +0 -312
- package/src/ui/c/ContentSlides/useContentSlides.js +0 -4
- package/src/ui/r/SwitchRouteMap/SwitchRouteMap.jsx +0 -64
- package/src/ui/r/SwitchRouteMap/index.js +0 -2
- package/src/ui/r/common/PrivateRoute/PrivateRoute.jsx +0 -73
- package/src/ui/r/common/PrivateRoute/index.js +0 -2
- package/src/ui/r/common/index.js +0 -1
- package/src/ui/r/index.js +0 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { LexicalPreview } from 'ui'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title :'a/LexicalPreview',
|
|
8
|
+
component :LexicalPreview,
|
|
9
|
+
subcomponents:{
|
|
10
|
+
// Item:TextareaInput.Item
|
|
11
|
+
},
|
|
12
|
+
decorators:[],
|
|
13
|
+
argTypes :{
|
|
14
|
+
color:{ control: 'text' },
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// eslint-disable-next-line no-useless-escape
|
|
19
|
+
const nodes = '{\"root\":{\"children\":[{\"children\":[{\"children\":[{\"detail\":0,\"format\":1,\"mode\":\"normal\",\"style\":\"\",\"text\":\"This is bold.\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":1},{\"children\":[{\"detail\":0,\"format\":2,\"mode\":\"normal\",\"style\":\"\",\"text\":\"This is italic.\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":2},{\"children\":[{\"detail\":0,\"format\":8,\"mode\":\"normal\",\"style\":\"\",\"text\":\"This is underlined.\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":3},{\"children\":[{\"children\":[{\"children\":[{\"detail\":0,\"format\":4,\"mode\":\"normal\",\"style\":\"\",\"text\":\"This is struck.\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":1,\"type\":\"listitem\",\"version\":1,\"value\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"list\",\"version\":1,\"listType\":\"bullet\",\"start\":1,\"tag\":\"ul\"}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":4}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"list\",\"version\":1,\"listType\":\"bullet\",\"start\":1,\"tag\":\"ul\"}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"root\",\"version\":1}}'
|
|
20
|
+
|
|
21
|
+
const Template = (args) => (
|
|
22
|
+
<LexicalPreview {...args} />
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
export const Base = Template.bind({})
|
|
26
|
+
Base.args = {
|
|
27
|
+
nodes,
|
|
28
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react'
|
|
2
|
+
|
|
3
|
+
import { XMLEditor } from 'ui'
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title :'a/XMLEditor',
|
|
7
|
+
component :XMLEditor,
|
|
8
|
+
decorators:[
|
|
9
|
+
// storyfn => <div className="">{ storyfn() }</div>,
|
|
10
|
+
],
|
|
11
|
+
argTypes:{},
|
|
12
|
+
controls:{
|
|
13
|
+
},
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const Template = (args) => (
|
|
17
|
+
<XMLEditor {...args} />
|
|
18
|
+
)
|
|
19
|
+
|
|
20
|
+
export const Base = Template.bind({})
|
|
21
|
+
Base.args = {}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/* @pareto-engineering/generator-front 1.0.12 */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { ExpandableLexicalPreview } from 'ui'
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
title :'b/ExpandableLexicalPreview',
|
|
8
|
+
component :ExpandableLexicalPreview,
|
|
9
|
+
subcomponents:{
|
|
10
|
+
// Item:TextareaInput.Item
|
|
11
|
+
},
|
|
12
|
+
decorators:[],
|
|
13
|
+
argTypes :{
|
|
14
|
+
color:{ control: 'text' },
|
|
15
|
+
},
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// eslint-disable-next-line no-useless-escape
|
|
19
|
+
const nodes = '{\"root\":{\"children\":[{\"children\":[{\"children\":[{\"detail\":0,\"format\":1,\"mode\":\"normal\",\"style\":\"\",\"text\":\"This is bold.\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":1},{\"children\":[{\"detail\":0,\"format\":2,\"mode\":\"normal\",\"style\":\"\",\"text\":\"This is italic.\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":2},{\"children\":[{\"detail\":0,\"format\":8,\"mode\":\"normal\",\"style\":\"\",\"text\":\"This is underlined.\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":3},{\"children\":[{\"children\":[{\"children\":[{\"detail\":0,\"format\":4,\"mode\":\"normal\",\"style\":\"\",\"text\":\"This is struck.\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":1,\"type\":\"listitem\",\"version\":1,\"value\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"list\",\"version\":1,\"listType\":\"bullet\",\"start\":1,\"tag\":\"ul\"}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":4}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"list\",\"version\":1,\"listType\":\"bullet\",\"start\":1,\"tag\":\"ul\"}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"root\",\"version\":1}}'
|
|
20
|
+
|
|
21
|
+
const Template = (args) => (
|
|
22
|
+
<ExpandableLexicalPreview {...args} />
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
export const Base = Template.bind({})
|
|
26
|
+
Base.args = {
|
|
27
|
+
nodes,
|
|
28
|
+
title:'Task Instructions',
|
|
29
|
+
}
|
package/src/stories/colors.js
CHANGED
|
@@ -230,10 +230,32 @@ MultipleSelectWithDefaultFormikState.args = {
|
|
|
230
230
|
{
|
|
231
231
|
value:'VGVhbU5vZGU6MDAxZTIyOGEtYzA5My00MGI0LWE1MTUtYTNkMTM1NTE1MDNl',
|
|
232
232
|
label:'Apple',
|
|
233
|
+
color:'red',
|
|
233
234
|
},
|
|
234
235
|
{
|
|
235
236
|
value:'VGVhbU5vZGU6MDA0N2U4MzktODY0Zi00N2U5LTg3ZjgtZGUwMmM2Yzg1YWJm',
|
|
236
237
|
label:'Pear',
|
|
238
|
+
color:'green',
|
|
239
|
+
},
|
|
240
|
+
],
|
|
241
|
+
},
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export const MultipleSelectWithGetTagColorFunction = ResolvedTemplate.bind({})
|
|
245
|
+
MultipleSelectWithGetTagColorFunction.args = {
|
|
246
|
+
multiple :true,
|
|
247
|
+
getTagColor :(tag) => tag.color,
|
|
248
|
+
defaultFormikState:{
|
|
249
|
+
teams:[
|
|
250
|
+
{
|
|
251
|
+
value:'VGVhbU5vZGU6MDAxZTIyOGEtYzA5My00MGI0LWE1MTUtYTNkMTM1NTE1MDNl',
|
|
252
|
+
label:'Apple',
|
|
253
|
+
color:'red',
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
value:'VGVhbU5vZGU6MDA0N2U4MzktODY0Zi00N2U5LTg3ZjgtZGUwMmM2Yzg1YWJm',
|
|
257
|
+
label:'Pear',
|
|
258
|
+
color:'green',
|
|
237
259
|
},
|
|
238
260
|
],
|
|
239
261
|
},
|
|
@@ -0,0 +1,109 @@
|
|
|
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 { LexicalComposer } from '@lexical/react/LexicalComposer'
|
|
5
|
+
import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin'
|
|
6
|
+
import { ContentEditable } from '@lexical/react/LexicalContentEditable'
|
|
7
|
+
import { AutoLinkNode, LinkNode } from '@lexical/link'
|
|
8
|
+
import { ListItemNode, ListNode } from '@lexical/list'
|
|
9
|
+
|
|
10
|
+
import PropTypes from 'prop-types'
|
|
11
|
+
import styleNames from '@pareto-engineering/bem/exports'
|
|
12
|
+
import './styles.scss'
|
|
13
|
+
|
|
14
|
+
// Local Definitions
|
|
15
|
+
|
|
16
|
+
const baseClassName = styleNames.base
|
|
17
|
+
const componentClassName = 'lexical-preview'
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* This is the component description.
|
|
21
|
+
*/
|
|
22
|
+
const LexicalPreview = ({
|
|
23
|
+
id,
|
|
24
|
+
className:userClassName,
|
|
25
|
+
style,
|
|
26
|
+
nodes,
|
|
27
|
+
color,
|
|
28
|
+
// ...otherProps
|
|
29
|
+
}) => {
|
|
30
|
+
const initialConfig = {
|
|
31
|
+
nameSpace :id,
|
|
32
|
+
editable :false,
|
|
33
|
+
editorState:nodes,
|
|
34
|
+
theme :{
|
|
35
|
+
text:{
|
|
36
|
+
italic :'italic',
|
|
37
|
+
strikethrough:'strikethrough',
|
|
38
|
+
underline :'underlined',
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
nodes:[
|
|
42
|
+
AutoLinkNode,
|
|
43
|
+
LinkNode,
|
|
44
|
+
ListNode,
|
|
45
|
+
ListItemNode,
|
|
46
|
+
],
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return (
|
|
50
|
+
<LexicalComposer
|
|
51
|
+
initialConfig={initialConfig}
|
|
52
|
+
>
|
|
53
|
+
<div
|
|
54
|
+
id={id}
|
|
55
|
+
className={[
|
|
56
|
+
baseClassName,
|
|
57
|
+
componentClassName,
|
|
58
|
+
userClassName,
|
|
59
|
+
`y-${color}`,
|
|
60
|
+
]
|
|
61
|
+
.filter((e) => e)
|
|
62
|
+
.join(' ')}
|
|
63
|
+
style={style}
|
|
64
|
+
>
|
|
65
|
+
<RichTextPlugin
|
|
66
|
+
contentEditable={(
|
|
67
|
+
<ContentEditable
|
|
68
|
+
id={id}
|
|
69
|
+
className="content-editable"
|
|
70
|
+
/>
|
|
71
|
+
)}
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
</LexicalComposer>
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
LexicalPreview.propTypes = {
|
|
79
|
+
/**
|
|
80
|
+
* The HTML id for this element
|
|
81
|
+
*/
|
|
82
|
+
id:PropTypes.string,
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The HTML class names for this element
|
|
86
|
+
*/
|
|
87
|
+
className:PropTypes.string,
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* The React-written, css properties for this element.
|
|
91
|
+
*/
|
|
92
|
+
style:PropTypes.objectOf(PropTypes.string),
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Color of the text
|
|
96
|
+
*/
|
|
97
|
+
color:PropTypes.string,
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* The nodes to render in the form of a json string
|
|
101
|
+
*/
|
|
102
|
+
nodes:PropTypes.string,
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
LexicalPreview.defaultProps = {
|
|
106
|
+
color:'paragraph',
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export default LexicalPreview
|
|
@@ -0,0 +1,46 @@
|
|
|
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
|
+
.#{bem.$base}.lexical-preview {
|
|
8
|
+
> .content-editable {
|
|
9
|
+
color: var(--y);
|
|
10
|
+
overflow: auto;
|
|
11
|
+
|
|
12
|
+
li:has(ol, ul) {
|
|
13
|
+
list-style-type: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
p,
|
|
17
|
+
span,
|
|
18
|
+
strong,
|
|
19
|
+
em,
|
|
20
|
+
li {
|
|
21
|
+
&.underlined {
|
|
22
|
+
text-decoration: underline;
|
|
23
|
+
|
|
24
|
+
&.strikethrough {
|
|
25
|
+
text-decoration: underline line-through;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
&.strikethrough {
|
|
30
|
+
text-decoration: line-through;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&.italic {
|
|
34
|
+
font-style: italic;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
:first-child {
|
|
39
|
+
margin-top: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&::placeholder {
|
|
43
|
+
color: var(--metadata);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -23,28 +23,40 @@ const Person = ({
|
|
|
23
23
|
role,
|
|
24
24
|
color,
|
|
25
25
|
// ...otherProps
|
|
26
|
-
}) =>
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
}) => {
|
|
27
|
+
const handleImageSrcError = (e) => {
|
|
28
|
+
e.target.onerror = null
|
|
29
|
+
e.target.src = '/default-avatar.svg'
|
|
30
|
+
}
|
|
30
31
|
|
|
31
|
-
|
|
32
|
+
return (
|
|
33
|
+
<div
|
|
34
|
+
id={id}
|
|
35
|
+
className={[
|
|
32
36
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
37
|
+
baseClassName,
|
|
38
|
+
|
|
39
|
+
componentClassName,
|
|
40
|
+
userClassName,
|
|
41
|
+
`y-${color}`,
|
|
42
|
+
]
|
|
43
|
+
.filter((e) => e)
|
|
44
|
+
.join(' ')}
|
|
45
|
+
style={style}
|
|
46
|
+
>
|
|
47
|
+
<img
|
|
48
|
+
className="image v50 mr-v"
|
|
49
|
+
src={image || '/default-avatar.svg'}
|
|
50
|
+
alt={`${name}, ${role}`}
|
|
51
|
+
onError={handleImageSrcError}
|
|
52
|
+
/>
|
|
53
|
+
<div className="details">
|
|
54
|
+
{name && <p className="name">{name}</p>}
|
|
55
|
+
{ role && <p className="role">{role}</p>}
|
|
56
|
+
</div>
|
|
45
57
|
</div>
|
|
46
|
-
|
|
47
|
-
|
|
58
|
+
)
|
|
59
|
+
}
|
|
48
60
|
|
|
49
61
|
Person.propTypes = {
|
|
50
62
|
/**
|
|
@@ -24,6 +24,7 @@ const ProgressBar = ({
|
|
|
24
24
|
color,
|
|
25
25
|
progress,
|
|
26
26
|
height,
|
|
27
|
+
rounded,
|
|
27
28
|
// ...otherProps
|
|
28
29
|
}) => (
|
|
29
30
|
<div
|
|
@@ -36,6 +37,7 @@ const ProgressBar = ({
|
|
|
36
37
|
attached && styleNames.modifierAttached,
|
|
37
38
|
color && `x-${color}`,
|
|
38
39
|
userClassName,
|
|
40
|
+
rounded && 'rounded',
|
|
39
41
|
]
|
|
40
42
|
.filter((e) => e)
|
|
41
43
|
.join(' ')}
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
$default-height:var(--height, 1em);
|
|
6
6
|
$default-border:none;//2px solid var(--grid);
|
|
7
7
|
$default-transition-duration:.5s;
|
|
8
|
-
$default-color:var(--x, var(--
|
|
8
|
+
$default-color:var(--x, var(--main));
|
|
9
|
+
$default-border-radius:var(--theme-border-radius, 1.875rem);
|
|
9
10
|
|
|
10
11
|
.#{bem.$base}.progress-bar {
|
|
12
|
+
background-color: var(--progress-bar-background-color);
|
|
11
13
|
border: $default-border;
|
|
12
14
|
height: $default-height;
|
|
13
15
|
position: relative;
|
|
@@ -28,6 +30,14 @@ $default-color:var(--x, var(--main1));
|
|
|
28
30
|
z-index: 1;
|
|
29
31
|
}
|
|
30
32
|
|
|
33
|
+
&.rounded {
|
|
34
|
+
border-radius: $default-border-radius;
|
|
35
|
+
|
|
36
|
+
&::after {
|
|
37
|
+
border-radius: $default-border-radius;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
31
41
|
&.#{bem.$modifier-attached} {
|
|
32
42
|
border: unset;
|
|
33
43
|
border-bottom: $default-border;
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/* eslint-disable import/no-extraneous-dependencies */
|
|
2
|
+
import * as React from 'react'
|
|
3
|
+
|
|
4
|
+
import { useEffect, useRef } from 'react'
|
|
5
|
+
|
|
6
|
+
import PropTypes from 'prop-types'
|
|
7
|
+
|
|
8
|
+
import { EditorState } from '@codemirror/state'
|
|
9
|
+
|
|
10
|
+
import {
|
|
11
|
+
EditorView,
|
|
12
|
+
keymap,
|
|
13
|
+
lineNumbers,
|
|
14
|
+
drawSelection,
|
|
15
|
+
dropCursor,
|
|
16
|
+
highlightActiveLine,
|
|
17
|
+
highlightActiveLineGutter,
|
|
18
|
+
highlightSpecialChars,
|
|
19
|
+
crosshairCursor,
|
|
20
|
+
rectangularSelection,
|
|
21
|
+
} from '@codemirror/view'
|
|
22
|
+
|
|
23
|
+
import {
|
|
24
|
+
defaultKeymap,
|
|
25
|
+
} from '@codemirror/commands'
|
|
26
|
+
|
|
27
|
+
import {
|
|
28
|
+
indentOnInput,
|
|
29
|
+
bracketMatching,
|
|
30
|
+
foldGutter,
|
|
31
|
+
} from '@codemirror/language'
|
|
32
|
+
|
|
33
|
+
import { xml } from '@codemirror/lang-xml'
|
|
34
|
+
|
|
35
|
+
import styleNames from '@pareto-engineering/bem/exports'
|
|
36
|
+
|
|
37
|
+
import { theme } from './common'
|
|
38
|
+
|
|
39
|
+
import './styles.scss'
|
|
40
|
+
|
|
41
|
+
const baseClassName = styleNames.base
|
|
42
|
+
|
|
43
|
+
const componentClassName = 'code-editor'
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* codemirror documentation:
|
|
47
|
+
* https://codemirror.net/
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
const XMLEditor = ({
|
|
51
|
+
id,
|
|
52
|
+
className: userClassName,
|
|
53
|
+
style,
|
|
54
|
+
readOnly,
|
|
55
|
+
height,
|
|
56
|
+
gutterWidth,
|
|
57
|
+
config,
|
|
58
|
+
onChange,
|
|
59
|
+
stopPropagationKeys,
|
|
60
|
+
}) => {
|
|
61
|
+
const editorRef = useRef()
|
|
62
|
+
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
const startState = EditorState.create({
|
|
65
|
+
doc :config,
|
|
66
|
+
extensions:[
|
|
67
|
+
keymap.of(defaultKeymap),
|
|
68
|
+
indentOnInput(),
|
|
69
|
+
lineNumbers(),
|
|
70
|
+
bracketMatching(),
|
|
71
|
+
foldGutter(),
|
|
72
|
+
drawSelection(),
|
|
73
|
+
highlightActiveLine(),
|
|
74
|
+
highlightActiveLineGutter(),
|
|
75
|
+
highlightSpecialChars(),
|
|
76
|
+
dropCursor(),
|
|
77
|
+
rectangularSelection(),
|
|
78
|
+
crosshairCursor(),
|
|
79
|
+
xml(),
|
|
80
|
+
theme,
|
|
81
|
+
EditorState.readOnly.of(readOnly),
|
|
82
|
+
EditorView.updateListener.of((view) => {
|
|
83
|
+
onChange(view)
|
|
84
|
+
// view.state.doc.toString() to receive the current content in the editor.
|
|
85
|
+
}),
|
|
86
|
+
EditorView.domEventHandlers({
|
|
87
|
+
keydown(e) {
|
|
88
|
+
if (stopPropagationKeys?.includes(e.key)) {
|
|
89
|
+
e.stopPropagation()
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
}),
|
|
93
|
+
],
|
|
94
|
+
})
|
|
95
|
+
|
|
96
|
+
const view = new EditorView({
|
|
97
|
+
state :startState,
|
|
98
|
+
parent:editorRef.current,
|
|
99
|
+
})
|
|
100
|
+
|
|
101
|
+
return () => {
|
|
102
|
+
view.destroy()
|
|
103
|
+
}
|
|
104
|
+
}, [editorRef])
|
|
105
|
+
|
|
106
|
+
return (
|
|
107
|
+
<div
|
|
108
|
+
id={id}
|
|
109
|
+
ref={editorRef}
|
|
110
|
+
className={[
|
|
111
|
+
baseClassName,
|
|
112
|
+
componentClassName,
|
|
113
|
+
userClassName,
|
|
114
|
+
]
|
|
115
|
+
.filter((e) => e)
|
|
116
|
+
.join(' ')}
|
|
117
|
+
style={{
|
|
118
|
+
'--height' :height,
|
|
119
|
+
'--gutter-width':gutterWidth,
|
|
120
|
+
...style,
|
|
121
|
+
}}
|
|
122
|
+
/>
|
|
123
|
+
)
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
XMLEditor.propTypes = {
|
|
127
|
+
/**
|
|
128
|
+
* The HTML id for this element
|
|
129
|
+
*/
|
|
130
|
+
id:PropTypes.string,
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The HTML class names for this element
|
|
134
|
+
*/
|
|
135
|
+
className:PropTypes.string,
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* The React-written, css properties for this element.
|
|
139
|
+
*/
|
|
140
|
+
style:PropTypes.objectOf(PropTypes.string),
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Whether or not the content is read only.
|
|
144
|
+
*/
|
|
145
|
+
readOnly:PropTypes.bool,
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* The initial labeling configuration.
|
|
149
|
+
*/
|
|
150
|
+
config:PropTypes.string,
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* The height of the editor.
|
|
154
|
+
*/
|
|
155
|
+
height:PropTypes.string,
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* The callback for when the labeling configuration changes.
|
|
159
|
+
*/
|
|
160
|
+
onChange:PropTypes.func,
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* The width of the gutter.
|
|
164
|
+
*/
|
|
165
|
+
gutterWidth:PropTypes.string,
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* The keys to stop propagation on.
|
|
169
|
+
*/
|
|
170
|
+
stopPropagationKeys:PropTypes.arrayOf(PropTypes.string),
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
XMLEditor.defaultProps = {
|
|
174
|
+
config:`<View>
|
|
175
|
+
<!--Edit this config to customize the labeling interface.-->
|
|
176
|
+
</View>
|
|
177
|
+
`,
|
|
178
|
+
height :'20em',
|
|
179
|
+
gutterWidth:'3em',
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export default XMLEditor
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as theme } from './theme'
|