Skip to content

feat: LEAP-1467: Adapt Textarea result container to new style #6413

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions web/libs/editor/src/components/HtxTextBox/HtxTextBox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,16 @@ export class HtxTextBox extends React.Component {
<>
<Paragraph {...props}>
<span ref={this.textRef}>{text}</span>
{isEditable && onChange && (
<EditOutlined onClick={this.startEditing} aria-label="Edit Region" className="ant-typography-edit" />
)}
</Paragraph>
{isEditable && onChange && (
<Tooltip title="Edit">
<EditOutlined onClick={this.startEditing} aria-label="Edit Region" className="ant-typography-edit" />
</Tooltip>
)}
{isDeleteable && onDelete && (
<DeleteOutlined className={styles.delete} aria-label="Delete Region" onClick={onDelete} />
<Tooltip title="Delete">
<DeleteOutlined className={styles.delete} aria-label="Delete Region" onClick={onDelete} />
</Tooltip>
)}
</>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
.mark {
cursor: pointer;
background-color: #f6ffed;
border: 1px solid #b7eb8f;
border-radius: 5px;
background-color: var(--sand_100);
border: 1px solid var(--sand_300);
border-radius: 4px;
margin: 0;
padding: 0.4em 1em;
white-space: pre-line;
box-shadow: 0px 4px 12px 0px var(--black_4), 0px 1px 2px 0px var(--black_10);

&.selected {
border: 1px solid red;
border: 1px solid var(--persimmon_500);
}

&.highlighted {
border: 1px dashed #00aeff;
border: 1px dashed var(--grape_600);
}

&.relation {
Expand All @@ -29,19 +29,33 @@

.row {
display: flex;
margin-bottom: 0.5em;
margin-bottom: 1em;
flex-wrap: nowrap;
align-items: center;

.mark {
margin-bottom: 0;
flex-grow: 1;
}

// fix antd styles to resize textarea container and fix paddings
div[class~="ant-typography-edit-content"] {
flex-grow: 1;
left: -1px;
padding: 0;
margin-top: -1px;
margin-bottom: calc(1.6em - 9px);

textarea {
// the same as in .mark, its padding set to 0
padding: 0.4em 1em;
}

}

span[class~="anticon"] {
width: 24px;
height: 24px;
padding: 0;
margin: 0 0 0 0.5em;
}
}
Loading