pixel-react 1.6.5 → 1.6.7
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/lib/1fb4472b34e4fe07.css +1 -0
- package/lib/StyleGuide/ColorPalette/ColorPalette.stories.d.ts +6 -0
- package/lib/StyleGuide/Typography/Typography.stories.d.ts +6 -0
- package/lib/components/Accordion/Accordion.d.ts +1 -1
- package/lib/components/Accordion/Accordion.stories.d.ts +6 -0
- package/lib/components/Accordion/types.d.ts +12 -0
- package/lib/components/AddButton/AddButton.d.ts +5 -0
- package/lib/components/AddButton/AddButton.stories.d.ts +6 -0
- package/lib/components/AddButton/index.d.ts +1 -0
- package/lib/components/AddButton/types.d.ts +4 -0
- package/lib/components/AddResourceButton/AddButton.stories.d.ts +8 -0
- package/lib/components/AddVariables/AddVariables.d.ts +5 -0
- package/lib/components/AddVariables/index.d.ts +1 -0
- package/lib/components/AddVariables/types.d.ts +35 -0
- package/lib/components/AllProjectsDropdown/AllProjectsDropdown.stories.d.ts +7 -0
- package/lib/components/AppHeader/AppHeader.stories.d.ts +7 -0
- package/lib/components/AttachImage/AttachImage.stories.d.ts +7 -0
- package/lib/components/AttachmentButton/AttachmentButton.stories.d.ts +9 -0
- package/lib/components/Avatar/Avatar.stories.d.ts +10 -0
- package/lib/components/Button/Button.stories.d.ts +13 -0
- package/lib/components/Charts/BarChart/BarChart.stories.d.ts +6 -0
- package/lib/components/Charts/DashboardDonutChart/DashboardDonutChart.stories.d.ts +7 -0
- package/lib/components/Charts/DonutChart/DonutChart.stories.d.ts +6 -0
- package/lib/components/Charts/IconRadialChart/IconRadialChart.stories.d.ts +8 -0
- package/lib/components/Charts/LineChart/LineChart.stories.d.ts +7 -0
- package/lib/components/Charts/MultiRadialChart/MultiRadialChart.stories.d.ts +8 -0
- package/lib/components/Charts/PieChart/PieChart.stories.d.ts +7 -0
- package/lib/components/Charts/RadialChart/RadialChart.stories.d.ts +6 -0
- package/lib/components/Checkbox/Checkbox.stories.d.ts +8 -0
- package/lib/components/Checkbox/types.d.ts +4 -0
- package/lib/components/Chip/Chip.stories.d.ts +14 -0
- package/lib/components/Comment/Comments.d.ts +4 -0
- package/lib/components/Comment/comment/Comment.d.ts +11 -0
- package/lib/components/Comment/comment/useNode.d.ts +7 -0
- package/lib/components/Comment/index.d.ts +1 -0
- package/lib/components/Comment/type.d.ts +25 -0
- package/lib/components/ConnectingBranch/ConnectingBranch.stories.d.ts +6 -0
- package/lib/components/DatePicker/DatePicker.stories.d.ts +9 -0
- package/lib/components/DragAndDrop/DragAndDrop.stories.d.ts +6 -0
- package/lib/components/Drawer/Drawer.stories.d.ts +12 -0
- package/lib/components/EditTextField/EditTextField.stories.d.ts +10 -0
- package/lib/components/Editor/Editor.stories.d.ts +6 -0
- package/lib/components/Editor/constants.d.ts +1 -1
- package/lib/components/Editor/types.d.ts +10 -2
- package/lib/components/Excel/ExcelFile.stories.d.ts +6 -0
- package/lib/components/ExcelFile/ChangeExcelStyles.d.ts +14 -0
- package/lib/components/ExcelFile/ColorBarSelector/ColorBarSelector.d.ts +8 -0
- package/lib/components/ExcelFile/ContextMenu/ContextMenu.d.ts +4 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/ActiveCell.d.ts +7 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/Cell.d.ts +4 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/ColumnIndicator.d.ts +5 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/Copied.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/CornerIndicator.d.ts +5 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/DataEditor.d.ts +5 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/DataViewer.d.ts +8 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/FloatingRect.d.ts +10 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/HeaderRow.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/Row.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/RowIndicator.d.ts +5 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/Selected.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/Spreadsheet.d.ts +80 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/Table.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/actions.d.ts +174 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/areModelsEqual.d.ts +1 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/context.d.ts +8 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/engine.d.ts +22 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/formula.d.ts +17 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/index.d.ts +2 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-graph.d.ts +21 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-hash.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/engine/point-set.d.ts +24 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/index.d.ts +13 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/matrix.d.ts +67 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/point-range.d.ts +22 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/point.d.ts +11 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/reducer.d.ts +27 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/selection.d.ts +95 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/types.d.ts +178 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/use-dispatch.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/use-selector.d.ts +3 -0
- package/lib/components/ExcelFile/ExcelFile/Excel/util.d.ts +44 -0
- package/lib/components/ExcelFile/ExcelFile/ExcelFile.d.ts +19 -0
- package/lib/components/ExcelFile/ExcelFile.stories.d.ts +6 -0
- package/lib/components/ExcelFile/ExcelSheetBar/ExcelSheetBar.d.ts +12 -0
- package/lib/components/ExcelFile/ExcelToolBar/ExcelToolBar.d.ts +15 -0
- package/lib/components/ExcelFile/ImportExcelStyles.d.ts +24 -0
- package/lib/components/ExcelFile/Types.d.ts +129 -0
- package/lib/components/ExcelFile/index.d.ts +1 -0
- package/lib/components/ExpandableMenu/ExpandableMenu.stories.d.ts +7 -0
- package/lib/components/FF_Captcha/captcha.stories.d.ts +8 -0
- package/lib/components/FileDropzone/FileDropzone.stories.d.ts +8 -0
- package/lib/components/Form/Form.stories.d.ts +7 -0
- package/lib/components/GridLayout/GridLayout.stories.d.ts +8 -0
- package/lib/components/HighlightText/HighlightText.stories.d.ts +6 -0
- package/lib/components/Icon/Icon.stories.d.ts +8 -0
- package/lib/components/IconButton/IconButton.d.ts +1 -2
- package/lib/components/IconButton/IconButton.stories.d.ts +7 -0
- package/lib/components/IconButton/types.d.ts +1 -1
- package/lib/components/IconRadioGroup/IconRadioGroup.stories.d.ts +7 -0
- package/lib/components/Input/Input.d.ts +1 -1
- package/lib/components/Input/Input.stories.d.ts +9 -0
- package/lib/components/InputWithDropdown/InputWithDropdown.stories.d.ts +9 -0
- package/lib/components/LabelEditTextField/LabelEditTextField.stories.d.ts +13 -0
- package/lib/components/LazyLoad/LazyLoad.stories.d.ts +6 -0
- package/lib/components/MachineInputField/MachineInputField.stories.d.ts +6 -0
- package/lib/components/MenuOption/MenuOption.stories.d.ts +16 -0
- package/lib/components/MiniModal/MiniModal.stories.d.ts +10 -0
- package/lib/components/Modal/Modal.stories.d.ts +7 -0
- package/lib/components/ModulesChip/ModuleChip.stories.d.ts +6 -0
- package/lib/components/MultiSelect/MultiSelect.d.ts +1 -1
- package/lib/components/MultiSelect/MultiSelect.stories.d.ts +11 -0
- package/lib/components/NLPInput/NlpInput.stories.d.ts +7 -0
- package/lib/components/Paper/Paper.stories.d.ts +11 -0
- package/lib/components/PhoneInput/PhoneInput.d.ts +6 -0
- package/lib/components/PhoneInput/index.d.ts +1 -0
- package/lib/components/PhoneInput/types.d.ts +10 -0
- package/lib/components/PopUpModal/types.d.ts +1 -0
- package/lib/components/RadioButton/RadioButton.stories.d.ts +10 -0
- package/lib/components/RadioGroup/RadioGroup.stories.d.ts +9 -0
- package/lib/components/Search/Search.stories.d.ts +6 -0
- package/lib/components/Select/Select.stories.d.ts +14 -0
- package/lib/components/Select/components/Dropdown/Dropdown.d.ts +4 -0
- package/lib/components/Select/components/Dropdown/dropdownTypes.d.ts +17 -0
- package/lib/components/SequentialConnectingBranch/SequentialConnectingBranch.stories.d.ts +6 -0
- package/lib/components/StateDropdown/StateDropdown.stories.d.ts +10 -0
- package/lib/components/StatusButton/StatusButton.stories.d.ts +14 -0
- package/lib/components/StatusCard/StatusCard.stories.d.ts +11 -0
- package/lib/components/Table/Table.stories.d.ts +13 -0
- package/lib/components/TableTree/TableTree.stories.d.ts +7 -0
- package/lib/components/TableWithAccordion/TableWithAccordion.d.ts +5 -0
- package/lib/components/TableWithAccordion/data.d.ts +8 -0
- package/lib/components/TableWithAccordion/index.d.ts +1 -0
- package/lib/components/TableWithAccordion/types.d.ts +67 -0
- package/lib/components/Tabs/Tabs.stories.d.ts +9 -0
- package/lib/components/TextArea/Textarea.stories.d.ts +9 -0
- package/lib/components/Toast/Toast.stories.d.ts +6 -0
- package/lib/components/Toastify/Toastify.stories.d.ts +6 -0
- package/lib/components/Toggle/Toggle.stories.d.ts +12 -0
- package/lib/components/Tooltip/Tooltip.stories.d.ts +15 -0
- package/lib/components/Typography/Typography.stories.d.ts +10 -0
- package/lib/components/VariableInput/VariableInput.stories.d.ts +6 -0
- package/lib/index.d.ts +186 -12
- package/lib/index.esm.js +2842 -385
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +2846 -384
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/utils/checkDuplicates/checkDuplicates.d.ts +1 -0
- package/lib/utils/checkEmpty/checkEmpty.stories.d.ts +6 -0
- package/lib/utils/compareArrays/compareArrays.stories.d.ts +6 -0
- package/lib/utils/compareObjects/compareObjects.stories.d.ts +6 -0
- package/lib/utils/debounce/debounce.stories.d.ts +6 -0
- package/lib/utils/ffID/ffID.stories.d.ts +6 -0
- package/lib/utils/find/findAndInsert.d.ts +7 -0
- package/lib/utils/find/findAndInsert.stories.d.ts +7 -0
- package/lib/utils/findAndInsert/findAndInsert.stories.d.ts +7 -0
- package/lib/utils/getEncryptedData/getEncryptedData.stories.d.ts +6 -0
- package/lib/utils/getExtension/getExtension.stories.d.ts +6 -0
- package/lib/utils/getSequentialPayload/getSequentialPayload.stories.d.ts +10 -0
- package/lib/utils/throttle/throttle.stories.d.ts +6 -0
- package/lib/utils/truncateText/truncateText.stories.d.ts +6 -0
- package/package.json +2 -1
- package/src/assets/Themes/BaseTheme.scss +9 -0
- package/src/assets/Themes/DarkTheme.scss +62 -41
- package/src/assets/icons/add_file.svg +4 -17
- package/src/assets/icons/add_variable.svg +11 -0
- package/src/assets/icons/approval_pending.svg +8 -8
- package/src/assets/icons/authorization.svg +4 -0
- package/src/assets/icons/capture_icon.svg +2 -5
- package/src/assets/icons/configuration.svg +3 -3
- package/src/assets/icons/defects.svg +8 -8
- package/src/assets/icons/depends_on_script.svg +7 -0
- package/src/assets/icons/element.svg +4 -4
- package/src/assets/icons/email_group.svg +3 -0
- package/src/assets/icons/executions_icon.svg +3 -0
- package/src/assets/icons/labels.svg +8 -0
- package/src/assets/icons/machine_disable_icon.svg +18 -0
- package/src/assets/icons/machine_enable_icon.svg +10 -0
- package/src/assets/icons/parameters.svg +3 -0
- package/src/assets/icons/pre_post_condition.svg +8 -0
- package/src/assets/icons/program_element.svg +8 -0
- package/src/assets/icons/project_element.svg +4 -4
- package/src/assets/icons/step_group.svg +10 -10
- package/src/assets/icons/suites_icon.svg +3 -0
- package/src/assets/icons/tap_icon.svg +3 -3
- package/src/assets/icons/test_data.svg +5 -0
- package/src/assets/icons/test_data_set.svg +7 -0
- package/src/assets/icons/variable.svg +3 -3
- package/src/assets/icons/variable_set.svg +5 -0
- package/src/assets/icons/web_service_icon.svg +3 -3
- package/src/components/Accordion/Accordion.stories.tsx +4 -0
- package/src/components/Accordion/Accordion.tsx +7 -1
- package/src/components/Accordion/types.ts +12 -0
- package/src/components/AddVariables/AddVariables.scss +14 -0
- package/src/components/AddVariables/AddVariables.stories.tsx +44 -0
- package/src/components/AddVariables/AddVariables.tsx +113 -0
- package/src/components/AddVariables/index.ts +1 -0
- package/src/components/AddVariables/types.ts +36 -0
- package/src/components/AllProjectsDropdown/AllProjectsDropdown.scss +1 -1
- package/src/components/AppHeader/AppHeader.scss +7 -1
- package/src/components/AppHeader/types.ts +8 -9
- package/src/components/Checkbox/Checkbox.scss +57 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +91 -15
- package/src/components/Checkbox/Checkbox.tsx +4 -1
- package/src/components/Checkbox/types.ts +4 -0
- package/src/components/Comment/Comments.scss +166 -0
- package/src/components/Comment/Comments.stories.tsx +212 -0
- package/src/components/Comment/Comments.tsx +51 -0
- package/src/components/Comment/comment/Comment.tsx +206 -0
- package/src/components/Comment/comment/useNode.ts +51 -0
- package/src/components/Comment/index.ts +1 -0
- package/src/components/Comment/type.ts +36 -0
- package/src/components/Drawer/Drawer.scss +2 -1
- package/src/components/Editor/Editor.stories.tsx +2 -2
- package/src/components/Editor/Editor.tsx +4 -2
- package/src/components/Editor/VariableDropdown.scss +8 -2
- package/src/components/Editor/VariableDropdown.tsx +15 -7
- package/src/components/Editor/constants.ts +1 -1
- package/src/components/Editor/types.ts +12 -2
- package/src/components/FieldSet/FieldSet.scss +2 -1
- package/src/components/FieldSet/FieldSet.stories.tsx +2 -1
- package/src/components/Icon/iconList.ts +29 -2
- package/src/components/IconButton/IconButton.stories.tsx +1 -0
- package/src/components/IconButton/IconButton.tsx +5 -8
- package/src/components/IconButton/types.ts +2 -2
- package/src/components/IconRadioGroup/IconRadioGroup.scss +2 -1
- package/src/components/Input/Input.tsx +99 -88
- package/src/components/LabelEditTextField/LabelEditTextField.tsx +1 -1
- package/src/components/Modal/Modal.stories.tsx +2 -1
- package/src/components/MultiSelect/MultiSelect.scss +29 -0
- package/src/components/MultiSelect/MultiSelect.stories.tsx +19 -5
- package/src/components/MultiSelect/MultiSelect.tsx +29 -19
- package/src/components/PhoneInput/PhoneInput.d.ts +3 -0
- package/src/components/PhoneInput/PhoneInput.stories.tsx +95 -0
- package/src/components/PhoneInput/PhoneInput.tsx +90 -0
- package/src/components/PhoneInput/index.ts +1 -0
- package/src/components/PhoneInput/phoneInput.scss +3 -0
- package/src/components/PhoneInput/types.ts +10 -0
- package/src/components/PopUpModal/PopUpModal.stories.tsx +14 -13
- package/src/components/PopUpModal/PopUpModal.tsx +2 -1
- package/src/components/PopUpModal/types.ts +14 -13
- package/src/components/Select/Select.stories.tsx +2 -2
- package/src/components/TableWithAccordion/TableWithAccordion.scss +54 -0
- package/src/components/TableWithAccordion/TableWithAccordion.stories.tsx +94 -0
- package/src/components/TableWithAccordion/TableWithAccordion.tsx +174 -0
- package/src/components/TableWithAccordion/data.ts +37 -0
- package/src/components/TableWithAccordion/index.ts +1 -0
- package/src/components/TableWithAccordion/types.ts +70 -0
- package/src/components/Tabs/Tabs.scss +0 -1
- package/src/index.ts +12 -1
- package/src/utils/checkDuplicates/CheckDuplicates.stories.tsx +40 -0
- package/src/utils/checkDuplicates/checkDuplicates.ts +13 -0
- package/lib/components/TableTree/TableTree copy.d.ts +0 -25
@@ -0,0 +1,166 @@
|
|
1
|
+
@use '../../assets/styles/fonts';
|
2
|
+
.ff-comments-container {
|
3
|
+
display: flex;
|
4
|
+
flex-direction: column;
|
5
|
+
|
6
|
+
.comment-wrapper-one {
|
7
|
+
position: relative;
|
8
|
+
padding-left: 20px;
|
9
|
+
}
|
10
|
+
.comment-wrapper {
|
11
|
+
position: relative;
|
12
|
+
margin-bottom: 10px;
|
13
|
+
}
|
14
|
+
|
15
|
+
.commentContainer {
|
16
|
+
margin-bottom: 10px;
|
17
|
+
width: 75vw;
|
18
|
+
max-width: fit-content;
|
19
|
+
border-radius: 5px;
|
20
|
+
}
|
21
|
+
|
22
|
+
.commentContainer__avatar {
|
23
|
+
background-color: var(--ff-comment-input-border-color);
|
24
|
+
color: var(--ff-comment-avatar-text-color);
|
25
|
+
font-weight: bold;
|
26
|
+
border-radius: 4px;
|
27
|
+
width: 30px;
|
28
|
+
height: 30px;
|
29
|
+
display: flex;
|
30
|
+
align-items: center;
|
31
|
+
justify-content: center;
|
32
|
+
margin-right: 10px;
|
33
|
+
position: absolute;
|
34
|
+
top: -5px;
|
35
|
+
left: -40px;
|
36
|
+
z-index: 1;
|
37
|
+
@extend .fontSm;
|
38
|
+
}
|
39
|
+
|
40
|
+
.comment-actions {
|
41
|
+
display: flex;
|
42
|
+
}
|
43
|
+
.first-comment {
|
44
|
+
min-width: 632px;
|
45
|
+
min-height: 74px;
|
46
|
+
border-radius: 8px;
|
47
|
+
border: 1px solid var(--ff-comment-border-color);
|
48
|
+
@extend .fontSm;
|
49
|
+
}
|
50
|
+
.first-comment-heading {
|
51
|
+
margin: 5px;
|
52
|
+
}
|
53
|
+
.input-wrapper {
|
54
|
+
position: relative;
|
55
|
+
display: flex;
|
56
|
+
padding-top: 6px;
|
57
|
+
padding-bottom: 10px;
|
58
|
+
}
|
59
|
+
|
60
|
+
.inputContainer__input {
|
61
|
+
padding: 5px;
|
62
|
+
border: 1px solid var(--ff-comment-border-color);
|
63
|
+
border-radius: 4px;
|
64
|
+
resize: none;
|
65
|
+
margin: 0 10px;
|
66
|
+
outline: none;
|
67
|
+
&:focus,
|
68
|
+
&:focus-visible {
|
69
|
+
outline: 1px solid var(--ff-comment-input-border-color);
|
70
|
+
}
|
71
|
+
}
|
72
|
+
.inputEditContainer__input {
|
73
|
+
padding: 5px;
|
74
|
+
border: 1px solid var(--ff-comment-border-color);
|
75
|
+
border-radius: 4px;
|
76
|
+
width: 100%;
|
77
|
+
outline: none;
|
78
|
+
&:focus,
|
79
|
+
&:focus-visible {
|
80
|
+
outline: 1px solid var(--ff-comment-input-border-color);
|
81
|
+
}
|
82
|
+
}
|
83
|
+
|
84
|
+
.reply {
|
85
|
+
margin-right: 5px;
|
86
|
+
cursor: pointer;
|
87
|
+
}
|
88
|
+
.reply-comment {
|
89
|
+
right: 2%;
|
90
|
+
bottom: 15%;
|
91
|
+
position: absolute;
|
92
|
+
background: var(--ff-comment-avatar-text-color);
|
93
|
+
height: 20px;
|
94
|
+
width: 20px;
|
95
|
+
display: flex;
|
96
|
+
align-items: center;
|
97
|
+
justify-content: center;
|
98
|
+
border-radius: 50%;
|
99
|
+
}
|
100
|
+
.child-comments {
|
101
|
+
position: relative;
|
102
|
+
margin-left: 15px;
|
103
|
+
margin-top: 10px;
|
104
|
+
padding-left: 20px;
|
105
|
+
border-left: 1px solid var(--ff-comment-border-color);
|
106
|
+
border-bottom-left-radius: 15px;
|
107
|
+
padding-top: 10px;
|
108
|
+
&::before {
|
109
|
+
content: '';
|
110
|
+
position: absolute;
|
111
|
+
top: 0;
|
112
|
+
left: -2px;
|
113
|
+
width: 2px;
|
114
|
+
height: 15px;
|
115
|
+
background-color: var(--ff-comment-border-color);
|
116
|
+
border-radius: 15px 0 0 15px;
|
117
|
+
}
|
118
|
+
}
|
119
|
+
.reply-text {
|
120
|
+
display: flex;
|
121
|
+
}
|
122
|
+
.ff-message-container {
|
123
|
+
display: flex;
|
124
|
+
flex-direction: column;
|
125
|
+
gap: 10px;
|
126
|
+
}
|
127
|
+
.ff-message {
|
128
|
+
display: flex;
|
129
|
+
gap: 10px;
|
130
|
+
align-items: center;
|
131
|
+
}
|
132
|
+
.ff-message-name {
|
133
|
+
@extend .fontSm;
|
134
|
+
}
|
135
|
+
.ff-message-time {
|
136
|
+
@extend .fontXs;
|
137
|
+
}
|
138
|
+
.editable-text {
|
139
|
+
word-wrap: break-word;
|
140
|
+
color: var(--ff-comment-text-color);
|
141
|
+
&:focus,
|
142
|
+
&:focus-visible {
|
143
|
+
outline: 1px solid var(--ff-comment-input-border-color);
|
144
|
+
}
|
145
|
+
@extend .fontSm;
|
146
|
+
}
|
147
|
+
.adding-text,
|
148
|
+
.editable-text {
|
149
|
+
width: 95%;
|
150
|
+
}
|
151
|
+
|
152
|
+
.first_input {
|
153
|
+
width: 100%;
|
154
|
+
&:focus {
|
155
|
+
outline: none;
|
156
|
+
border-color: var(--ff-comment-input-border-color);
|
157
|
+
}
|
158
|
+
&::-webkit-scrollbar {
|
159
|
+
width: 3px;
|
160
|
+
}
|
161
|
+
&::-webkit-scrollbar-thumb {
|
162
|
+
background-color: var(--ff-comment-text-color);
|
163
|
+
border-radius: 4px;
|
164
|
+
}
|
165
|
+
}
|
166
|
+
}
|
@@ -0,0 +1,212 @@
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
2
|
+
import Comments from './Comments';
|
3
|
+
import '../../assets/styles/_colors.scss';
|
4
|
+
import './Comments.scss';
|
5
|
+
import React from 'react';
|
6
|
+
|
7
|
+
const meta: Meta<typeof Comments> = {
|
8
|
+
title: 'Components/Comments',
|
9
|
+
component: Comments,
|
10
|
+
parameters: {
|
11
|
+
layout: 'centered',
|
12
|
+
},
|
13
|
+
tags: ['autodocs'],
|
14
|
+
};
|
15
|
+
|
16
|
+
type Story = StoryObj<typeof Comments>;
|
17
|
+
export const basicCommentWithOutData: Story = {
|
18
|
+
render: () => {
|
19
|
+
const handleCommentsDataChange = (inputValue: string) => {
|
20
|
+
//DEMO: we are getting that value from LabelEditTextField
|
21
|
+
console.info('Confirmed input value:', inputValue);
|
22
|
+
};
|
23
|
+
return (
|
24
|
+
<Comments
|
25
|
+
onCommentsDataChange={handleCommentsDataChange}
|
26
|
+
commentsData={{
|
27
|
+
comments: [],
|
28
|
+
}}
|
29
|
+
handleAddComment={() => {}}
|
30
|
+
handleEditComment={() => {}}
|
31
|
+
handleDeleteComment={() => {}}
|
32
|
+
/>
|
33
|
+
);
|
34
|
+
},
|
35
|
+
};
|
36
|
+
|
37
|
+
export const basicCommentWithData: Story = {
|
38
|
+
render: () => {
|
39
|
+
const handleCommentsDataChange = (inputValue: string) => {
|
40
|
+
//DEMO: we are getting that value from LabelEditTextField
|
41
|
+
console.info('Confirmed input value:', inputValue);
|
42
|
+
};
|
43
|
+
return (
|
44
|
+
<Comments
|
45
|
+
onCommentsDataChange={handleCommentsDataChange}
|
46
|
+
commentsData={{
|
47
|
+
createdBy: 'USR29890',
|
48
|
+
modifiedBy: 'USR29890',
|
49
|
+
createdByUname: 'Asha',
|
50
|
+
modifiedByUname: 'Asha',
|
51
|
+
createdOn: '13 Nov 2024 06:05 PM',
|
52
|
+
modifiedOn: '13 Nov 2024 06:05 PM',
|
53
|
+
id: 1,
|
54
|
+
name: 'Asha',
|
55
|
+
emailId: [],
|
56
|
+
description: 'Comment 1',
|
57
|
+
commentParentId: '',
|
58
|
+
comments: [
|
59
|
+
{
|
60
|
+
createdBy: 'USR29890',
|
61
|
+
modifiedBy: 'USR29890',
|
62
|
+
createdByUname: 'Asha',
|
63
|
+
modifiedByUname: 'Asha',
|
64
|
+
createdOn: '13 Nov 2024 06:08 PM',
|
65
|
+
modifiedOn: '13 Nov 2024 06:08 PM',
|
66
|
+
id: 2,
|
67
|
+
name: 'Asha',
|
68
|
+
emailId: [],
|
69
|
+
description: 'Reply 1',
|
70
|
+
commentParentId: 'b995a9a0-a88e-4950-bb7e-1e2e820eca59',
|
71
|
+
comments: [
|
72
|
+
{
|
73
|
+
createdBy: 'USR29890',
|
74
|
+
modifiedBy: 'USR29890',
|
75
|
+
createdByUname: 'Asha',
|
76
|
+
modifiedByUname: 'Asha',
|
77
|
+
createdOn: '13 Nov 2024 06:08 PM',
|
78
|
+
modifiedOn: '13 Nov 2024 06:08 PM',
|
79
|
+
id: 3,
|
80
|
+
name: 'Asha',
|
81
|
+
emailId: [],
|
82
|
+
description: 'Sub Reply 1.1',
|
83
|
+
commentParentId: '5142f486-bde3-4fca-9a1c-541cdad7422c',
|
84
|
+
comments: [],
|
85
|
+
},
|
86
|
+
{
|
87
|
+
createdBy: 'USR29890',
|
88
|
+
modifiedBy: 'USR29890',
|
89
|
+
createdByUname: 'Asha',
|
90
|
+
modifiedByUname: 'Asha',
|
91
|
+
createdOn: '13 Nov 2024 06:09 PM',
|
92
|
+
modifiedOn: '13 Nov 2024 06:09 PM',
|
93
|
+
id: 4,
|
94
|
+
name: 'Asha',
|
95
|
+
emailId: [],
|
96
|
+
description: 'Sub Reply 1.2',
|
97
|
+
commentParentId: '5142f486-bde3-4fca-9a1c-541cdad7422c',
|
98
|
+
comments: [],
|
99
|
+
},
|
100
|
+
{
|
101
|
+
createdBy: 'USR29890',
|
102
|
+
modifiedBy: 'USR29890',
|
103
|
+
createdByUname: 'Asha',
|
104
|
+
modifiedByUname: 'Asha',
|
105
|
+
createdOn: '13 Nov 2024 06:12 PM',
|
106
|
+
modifiedOn: '13 Nov 2024 06:12 PM',
|
107
|
+
id: 5,
|
108
|
+
name: 'Asha',
|
109
|
+
emailId: [],
|
110
|
+
description: 'Reply 1.3',
|
111
|
+
commentParentId: '5142f486-bde3-4fca-9a1c-541cdad7422c',
|
112
|
+
comments: [],
|
113
|
+
},
|
114
|
+
],
|
115
|
+
},
|
116
|
+
{
|
117
|
+
createdBy: 'USR29890',
|
118
|
+
modifiedBy: 'USR29890',
|
119
|
+
createdByUname: 'Asha',
|
120
|
+
modifiedByUname: 'Asha',
|
121
|
+
createdOn: '13 Nov 2024 06:09 PM',
|
122
|
+
modifiedOn: '13 Nov 2024 06:09 PM',
|
123
|
+
id: 6,
|
124
|
+
name: 'Asha',
|
125
|
+
emailId: [],
|
126
|
+
description: 'Reply 2',
|
127
|
+
commentParentId: 'b995a9a0-a88e-4950-bb7e-1e2e820eca59',
|
128
|
+
comments: [
|
129
|
+
{
|
130
|
+
createdBy: 'USR29890',
|
131
|
+
modifiedBy: 'USR29890',
|
132
|
+
createdByUname: 'Asha',
|
133
|
+
modifiedByUname: 'Asha',
|
134
|
+
createdOn: '13 Nov 2024 06:10 PM',
|
135
|
+
modifiedOn: '13 Nov 2024 06:10 PM',
|
136
|
+
id: 7,
|
137
|
+
name: 'Asha',
|
138
|
+
emailId: [],
|
139
|
+
description: 'Reply 2.1',
|
140
|
+
commentParentId: '90fddbe9-f661-4dad-9a10-79160b5b8c5e',
|
141
|
+
comments: [],
|
142
|
+
},
|
143
|
+
{
|
144
|
+
createdBy: 'USR29890',
|
145
|
+
modifiedBy: 'USR29890',
|
146
|
+
createdByUname: 'Asha',
|
147
|
+
modifiedByUname: 'Asha',
|
148
|
+
createdOn: '13 Nov 2024 06:10 PM',
|
149
|
+
modifiedOn: '13 Nov 2024 06:10 PM',
|
150
|
+
id: 8,
|
151
|
+
name: 'Asha',
|
152
|
+
emailId: [],
|
153
|
+
description: 'Reply 2.2',
|
154
|
+
commentParentId: '90fddbe9-f661-4dad-9a10-79160b5b8c5e',
|
155
|
+
comments: [],
|
156
|
+
},
|
157
|
+
],
|
158
|
+
},
|
159
|
+
{
|
160
|
+
createdBy: 'USR29890',
|
161
|
+
modifiedBy: 'USR29890',
|
162
|
+
createdByUname: 'Asha',
|
163
|
+
modifiedByUname: 'Asha',
|
164
|
+
createdOn: '13 Nov 2024 06:11 PM',
|
165
|
+
modifiedOn: '13 Nov 2024 06:11 PM',
|
166
|
+
id: 9,
|
167
|
+
name: 'Asha',
|
168
|
+
emailId: [],
|
169
|
+
description: 'Reply 3',
|
170
|
+
commentParentId: 'b995a9a0-a88e-4950-bb7e-1e2e820eca59',
|
171
|
+
comments: [
|
172
|
+
{
|
173
|
+
createdBy: 'USR29890',
|
174
|
+
modifiedBy: 'USR29890',
|
175
|
+
createdByUname: 'Asha',
|
176
|
+
modifiedByUname: 'Asha',
|
177
|
+
createdOn: '13 Nov 2024 06:11 PM',
|
178
|
+
modifiedOn: '13 Nov 2024 06:11 PM',
|
179
|
+
id: 10,
|
180
|
+
name: 'Asha',
|
181
|
+
emailId: [],
|
182
|
+
description: 'Reply 3.1',
|
183
|
+
commentParentId: '12c3d310-33a3-458a-9b76-e295f067fd44',
|
184
|
+
comments: [],
|
185
|
+
},
|
186
|
+
{
|
187
|
+
createdBy: 'USR29890',
|
188
|
+
modifiedBy: 'USR29890',
|
189
|
+
createdByUname: 'Asha',
|
190
|
+
modifiedByUname: 'Asha',
|
191
|
+
createdOn: '13 Nov 2024 06:11 PM',
|
192
|
+
modifiedOn: '13 Nov 2024 06:11 PM',
|
193
|
+
id: 11,
|
194
|
+
name: 'Asha',
|
195
|
+
emailId: [],
|
196
|
+
description: 'Reply 3.2',
|
197
|
+
commentParentId: '12c3d310-33a3-458a-9b76-e295f067fd44',
|
198
|
+
comments: [],
|
199
|
+
},
|
200
|
+
],
|
201
|
+
},
|
202
|
+
],
|
203
|
+
}}
|
204
|
+
handleAddComment={() => {}}
|
205
|
+
handleEditComment={() => {}}
|
206
|
+
handleDeleteComment={() => {}}
|
207
|
+
/>
|
208
|
+
);
|
209
|
+
},
|
210
|
+
};
|
211
|
+
|
212
|
+
export default meta;
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import { useState, useEffect } from 'react';
|
2
|
+
import Comment from './comment/Comment';
|
3
|
+
import useNode from './comment/useNode';
|
4
|
+
import './Comments.scss';
|
5
|
+
import { CommentType, HandleNodeFunction, CommentsProps } from './type';
|
6
|
+
|
7
|
+
const initialComments: CommentType = {
|
8
|
+
comments: [],
|
9
|
+
};
|
10
|
+
|
11
|
+
const Comments = ({
|
12
|
+
commentsData,
|
13
|
+
|
14
|
+
onCommentsDataChange,
|
15
|
+
}: CommentsProps) => {
|
16
|
+
const [commentData, setCommentsData] = useState(
|
17
|
+
commentsData ?? initialComments
|
18
|
+
);
|
19
|
+
const { insertNode, editNode, deleteNode } = useNode();
|
20
|
+
|
21
|
+
const handleInsertNode: HandleNodeFunction = (commentId, item) => {
|
22
|
+
const updatedTree = insertNode(commentData, commentId, item);
|
23
|
+
setCommentsData({ ...updatedTree });
|
24
|
+
};
|
25
|
+
|
26
|
+
const handleEditNode: HandleNodeFunction = (commentId, value) => {
|
27
|
+
const updatedTree = editNode(commentData, commentId, value);
|
28
|
+
setCommentsData({ ...updatedTree });
|
29
|
+
};
|
30
|
+
|
31
|
+
const handleDeleteNode = (commentId: number) => {
|
32
|
+
const updatedTree = deleteNode(commentData, commentId);
|
33
|
+
setCommentsData({ ...updatedTree });
|
34
|
+
};
|
35
|
+
useEffect(() => {
|
36
|
+
onCommentsDataChange(commentData);
|
37
|
+
}, [commentData, onCommentsDataChange]);
|
38
|
+
|
39
|
+
return (
|
40
|
+
<div className="ff-comments-container">
|
41
|
+
<Comment
|
42
|
+
handleInsertNode={handleInsertNode}
|
43
|
+
handleEditNode={handleEditNode}
|
44
|
+
handleDeleteNode={handleDeleteNode}
|
45
|
+
comment={commentData}
|
46
|
+
/>
|
47
|
+
</div>
|
48
|
+
);
|
49
|
+
};
|
50
|
+
|
51
|
+
export default Comments;
|
@@ -0,0 +1,206 @@
|
|
1
|
+
import { CommentType } from '../type';
|
2
|
+
import { useState, useEffect } from 'react';
|
3
|
+
import '../Comments.scss';
|
4
|
+
import Icon from '../../Icon';
|
5
|
+
|
6
|
+
interface CommentProps {
|
7
|
+
handleInsertNode: any;
|
8
|
+
handleEditNode: any;
|
9
|
+
handleDeleteNode: (commentId: any) => any;
|
10
|
+
comment: CommentType;
|
11
|
+
depth?: number;
|
12
|
+
}
|
13
|
+
|
14
|
+
const Comment = ({
|
15
|
+
handleInsertNode,
|
16
|
+
handleEditNode,
|
17
|
+
handleDeleteNode,
|
18
|
+
comment,
|
19
|
+
depth = 0,
|
20
|
+
}: CommentProps) => {
|
21
|
+
const [input, setInput] = useState('');
|
22
|
+
const [editMode, setEditMode] = useState(false);
|
23
|
+
const [showInput, setShowInput] = useState(false);
|
24
|
+
const [expand, setExpand] = useState(true);
|
25
|
+
|
26
|
+
const { modifiedByUname, createdByUname, modifiedOn, createdOn } =
|
27
|
+
comment || {};
|
28
|
+
const randomPastTime = modifiedOn ?? createdOn ?? new Date().toLocaleString();
|
29
|
+
const firstName = modifiedByUname ?? createdByUname ?? 'Anonymous';
|
30
|
+
|
31
|
+
const isDepthLimitReached = depth > 2;
|
32
|
+
const avatar = firstName ? firstName.charAt(0).toUpperCase() : 'A';
|
33
|
+
|
34
|
+
useEffect(() => {
|
35
|
+
if (editMode && comment.description) {
|
36
|
+
setInput(comment.description);
|
37
|
+
}
|
38
|
+
}, [editMode, comment.description]);
|
39
|
+
|
40
|
+
const handleNewComment = () => {
|
41
|
+
setExpand(!expand);
|
42
|
+
setShowInput(true);
|
43
|
+
};
|
44
|
+
|
45
|
+
const onAddComment = () => {
|
46
|
+
if (input.length === 0) return;
|
47
|
+
if (editMode) {
|
48
|
+
handleEditNode(comment.id, input);
|
49
|
+
} else {
|
50
|
+
setExpand(true);
|
51
|
+
handleInsertNode(comment.id, input);
|
52
|
+
setShowInput(false);
|
53
|
+
setInput('');
|
54
|
+
}
|
55
|
+
if (editMode) setEditMode(false);
|
56
|
+
};
|
57
|
+
return (
|
58
|
+
<div className="commentsContainer">
|
59
|
+
<div className={depth === 0 ? 'comment-wrapper-one' : 'comment-wrapper'}>
|
60
|
+
<div className={depth === 0 ? 'inputContainer' : 'commentContainer'}>
|
61
|
+
{depth === 0 ? (
|
62
|
+
<div className="first-comment">
|
63
|
+
<h5 className="first-comment-heading">Comments</h5>
|
64
|
+
<div className="input-wrapper">
|
65
|
+
<textarea
|
66
|
+
className="inputContainer__input first_input"
|
67
|
+
rows={3}
|
68
|
+
autoFocus
|
69
|
+
value={input}
|
70
|
+
onChange={(e) => setInput(e.target.value)}
|
71
|
+
placeholder={'Add a comment'}
|
72
|
+
/>
|
73
|
+
<span className="reply comment reply-comment">
|
74
|
+
<Icon
|
75
|
+
name="send_to_steps"
|
76
|
+
onClick={onAddComment}
|
77
|
+
color="71347B"
|
78
|
+
/>
|
79
|
+
</span>
|
80
|
+
</div>
|
81
|
+
</div>
|
82
|
+
) : (
|
83
|
+
<>
|
84
|
+
<div className="commentContainer__avatar">{avatar}</div>
|
85
|
+
<div className="ff-message-container">
|
86
|
+
<div className="ff-message">
|
87
|
+
<div className="ff-message-name" style={{ fontWeight: 700 }}>
|
88
|
+
{firstName}
|
89
|
+
</div>
|
90
|
+
<div className="ff-message-time">{randomPastTime}</div>
|
91
|
+
</div>
|
92
|
+
|
93
|
+
<div className="editable-text">{comment.description}</div>
|
94
|
+
</div>
|
95
|
+
</>
|
96
|
+
)}
|
97
|
+
</div>
|
98
|
+
|
99
|
+
{editMode && (
|
100
|
+
<div className="inputContainer">
|
101
|
+
<input
|
102
|
+
type="text"
|
103
|
+
className="editable-text inputContainer__input"
|
104
|
+
value={input}
|
105
|
+
onChange={(e) => setInput(e.target.value)}
|
106
|
+
autoFocus
|
107
|
+
/>
|
108
|
+
</div>
|
109
|
+
)}
|
110
|
+
{depth > 0 && (
|
111
|
+
<div className="comment-actions">
|
112
|
+
{editMode ? (
|
113
|
+
<>
|
114
|
+
<div
|
115
|
+
className="reply"
|
116
|
+
onClick={() => {
|
117
|
+
onAddComment();
|
118
|
+
setEditMode(false);
|
119
|
+
}}
|
120
|
+
>
|
121
|
+
<Icon name="save_as_step" width={12} height={12} />
|
122
|
+
</div>
|
123
|
+
<div
|
124
|
+
className="reply"
|
125
|
+
onClick={() => {
|
126
|
+
setEditMode(false);
|
127
|
+
}}
|
128
|
+
>
|
129
|
+
<Icon name="close" color="#A91224" width={10} height={10} />
|
130
|
+
</div>
|
131
|
+
</>
|
132
|
+
) : (
|
133
|
+
<>
|
134
|
+
{!isDepthLimitReached && (
|
135
|
+
<div className="reply" onClick={handleNewComment}>
|
136
|
+
{expand ? (
|
137
|
+
<Icon name="window_minimize" width={12} height={12} />
|
138
|
+
) : (
|
139
|
+
<>
|
140
|
+
<Icon name="plus_icon" width={12} height={12} />
|
141
|
+
<Icon name="add_page" width={12} height={12} />
|
142
|
+
</>
|
143
|
+
)}
|
144
|
+
</div>
|
145
|
+
)}
|
146
|
+
<div className="reply" onClick={() => setEditMode(true)}>
|
147
|
+
<Icon name="edit" width={12} height={12} />
|
148
|
+
</div>
|
149
|
+
<div
|
150
|
+
className="reply"
|
151
|
+
onClick={() => handleDeleteNode(comment.id)}
|
152
|
+
>
|
153
|
+
<Icon name="delete" color="#A91224" width={12} height={12} />
|
154
|
+
</div>
|
155
|
+
</>
|
156
|
+
)}
|
157
|
+
</div>
|
158
|
+
)}
|
159
|
+
<div
|
160
|
+
className={comment?.comments?.length > 0 ? 'child-comments' : ''}
|
161
|
+
style={{
|
162
|
+
display: expand ? 'block' : 'none',
|
163
|
+
paddingLeft: 25,
|
164
|
+
}}
|
165
|
+
>
|
166
|
+
{showInput && (
|
167
|
+
<div className="inputContainer">
|
168
|
+
<input
|
169
|
+
type="text"
|
170
|
+
className="inputContainer__input adding-text"
|
171
|
+
autoFocus
|
172
|
+
onChange={(e) => setInput(e.target.value)}
|
173
|
+
/>
|
174
|
+
<div className="reply-text">
|
175
|
+
<div className="reply" onClick={onAddComment}>
|
176
|
+
<Icon name="send_to_steps" width={12} height={12} />
|
177
|
+
</div>
|
178
|
+
<div
|
179
|
+
className="reply"
|
180
|
+
onClick={() => {
|
181
|
+
setShowInput(false);
|
182
|
+
if (!comment?.comments?.length) setExpand(false);
|
183
|
+
}}
|
184
|
+
>
|
185
|
+
<Icon name="close" width={10} height={10} color="#A91224" />
|
186
|
+
</div>
|
187
|
+
</div>
|
188
|
+
</div>
|
189
|
+
)}
|
190
|
+
{comment?.comments?.map((cmnt) => (
|
191
|
+
<Comment
|
192
|
+
key={cmnt.id}
|
193
|
+
handleInsertNode={handleInsertNode}
|
194
|
+
handleEditNode={handleEditNode}
|
195
|
+
handleDeleteNode={handleDeleteNode}
|
196
|
+
comment={cmnt}
|
197
|
+
depth={depth + 1}
|
198
|
+
/>
|
199
|
+
))}
|
200
|
+
</div>
|
201
|
+
</div>
|
202
|
+
</div>
|
203
|
+
);
|
204
|
+
};
|
205
|
+
|
206
|
+
export default Comment;
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import { CommentType } from '../type';
|
2
|
+
|
3
|
+
const useNode = () => {
|
4
|
+
const insertNode = (
|
5
|
+
tree: CommentType,
|
6
|
+
commentId: number | string,
|
7
|
+
item: string
|
8
|
+
): CommentType => {
|
9
|
+
if (tree.id === commentId) {
|
10
|
+
tree.comments.push({
|
11
|
+
id: Date.now().toString(),
|
12
|
+
description: item,
|
13
|
+
comments: [],
|
14
|
+
});
|
15
|
+
return tree;
|
16
|
+
}
|
17
|
+
|
18
|
+
tree.comments = tree.comments.map((child) =>
|
19
|
+
insertNode(child, commentId, item)
|
20
|
+
);
|
21
|
+
return tree;
|
22
|
+
};
|
23
|
+
|
24
|
+
const editNode = (
|
25
|
+
tree: CommentType,
|
26
|
+
commentId: number | string,
|
27
|
+
value: string
|
28
|
+
): CommentType => {
|
29
|
+
if (tree.id === commentId) {
|
30
|
+
tree.description = value;
|
31
|
+
return tree;
|
32
|
+
}
|
33
|
+
|
34
|
+
tree.comments = tree.comments.map((child) =>
|
35
|
+
editNode(child, commentId, value)
|
36
|
+
);
|
37
|
+
return tree;
|
38
|
+
};
|
39
|
+
|
40
|
+
const deleteNode = (tree: CommentType, commentId: number): CommentType => {
|
41
|
+
if (!tree) return tree;
|
42
|
+
tree.comments = tree.comments
|
43
|
+
.filter((child) => child.id !== commentId)
|
44
|
+
.map((child) => deleteNode(child, commentId));
|
45
|
+
return tree;
|
46
|
+
};
|
47
|
+
|
48
|
+
return { insertNode, editNode, deleteNode };
|
49
|
+
};
|
50
|
+
|
51
|
+
export default useNode;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { default } from './Comments';
|