-
-
Notifications
You must be signed in to change notification settings - Fork 665
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sheets-thread-comment): comment support for sheets (#2228)
* feat: add thread-comment pkg * feat: update * feat: update * feat: update * feat: update * feat: update * feat: update * feat: temp * feat: update * feat: update * feat: u * feat: update * feat: update * feat: update * feat: update * fix: #2121 * fix: close #2120 * fix: #2114 * fix: #2112 * feat: temp * feat: update * feat: support at-input * feat: ref-range * feat: update mentions * feat: user * feat: update * feat: update comment * feat: style update * feat: update * feat: update * feat: update * feat: update * feat: rename * feat: scroller * feat: update * feat: update * feat: update * feat: update * fix: #684 univer-pro * feat: auto-height * feat: update * feat: update * fix: eslint * feat: remove useless code * build: fix build error * chore: fix lockfile * build: fix deps * feat: update * feat: update * feat: update * feat: i18n * feat: add sheet name * feat: disable undo on resolve comment operation * feat: update * fix: #2174 * feat: #2162 checkbox ticked and unticked value * feat: update * fix: hover-manager-service * feat: support copy-paste * feat: sidebar visible status * feat: style * feat: update * feat: update init * feat: temp * feat: update * feat: update * fix: checkbox validator * feat: lint * fix: error when delete worksheet * feat: refactor canvas popup service * feat: update * feat: lock * feat: custom-render event handler * feat: update ref * fix: copy-paste * feat: update * feat: update * feat: update max-height * feat: update * feat: fix delete comment * fix: #715 * feat: update * feat: update scroll * feat: style update * feat: bugfix * feat: update * feat: close sidebar * fix: cv undo * feat: update * feat: render z-index * feat: code review issue * feat: transform mentions data * feat: u * feat: bugfix * feat: update * feat: update * feat: style & bugfix * feat: style update * feat: update * feat: update * feat: update * feat: add thread-comment-data-source-service to support async comment crud * feat: rename * feat: build issue * fix: sort order of comments * feat: lint * feat: rename * feat: rebase dev --------- Co-authored-by: 白熱 <sonne@asaki.me>
- Loading branch information
Showing
90 changed files
with
5,343 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -277,6 +277,7 @@ export enum CustomRangeType { | |
BOOKMARK, | ||
COMMENT, | ||
CUSTOM, | ||
MENTION, | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
68 changes: 68 additions & 0 deletions
68
packages/design/src/components/mentions/Mentions.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import type { Meta } from '@storybook/react'; | ||
import React, { useState } from 'react'; | ||
|
||
import { Mention } from 'react-mentions'; | ||
import { Mentions } from './Mentions'; | ||
|
||
const meta: Meta<typeof Mentions> = { | ||
title: 'Components / Mentions', | ||
component: Mentions, | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
tags: ['autodocs'], | ||
}; | ||
|
||
export default meta; | ||
|
||
export const InputBasic = { | ||
|
||
render() { | ||
const [value, onChange] = useState(''); | ||
|
||
return ( | ||
<div style={{ width: 400 }}> | ||
<Mentions | ||
value={value} | ||
onChange={(e) => onChange(e.target.value)} | ||
> | ||
<Mention | ||
trigger="@" | ||
data={[ | ||
{ | ||
id: '1', | ||
display: 'zhangwei ', | ||
}, | ||
{ | ||
id: '2', | ||
display: 'zhangwei2 ', | ||
}, | ||
{ | ||
id: '3', | ||
display: 'zhangwei3 ', | ||
}, | ||
]} | ||
/> | ||
</Mentions> | ||
</div> | ||
|
||
); | ||
}, | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import React, { forwardRef } from 'react'; | ||
import type { MentionsInputProps } from 'react-mentions'; | ||
import { MentionsInput } from 'react-mentions'; | ||
import styles from './index.module.less'; | ||
|
||
export interface IMentionsProps extends MentionsInputProps {} | ||
|
||
export const Mentions = forwardRef<React.Component<MentionsInputProps, any, any>, IMentionsProps>((props, ref) => { | ||
return ( | ||
<MentionsInput | ||
ref={ref} | ||
{...props} | ||
className={styles.mentions} | ||
/> | ||
); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
.mentions { | ||
width: 100%; | ||
} | ||
|
||
.mentions__control { | ||
min-height: 32px; | ||
} | ||
|
||
.mentions__highlighter { | ||
border-radius: 6px; | ||
background: rgba(var(--color-white)); | ||
padding: 6px 10px; | ||
font-size: 13px !important; | ||
line-height: 20px !important; | ||
max-height: 114px; | ||
|
||
strong { | ||
color: rgb(var(--blue-500)); | ||
} | ||
} | ||
|
||
.mentions__highlighter__substring { | ||
visibility: inherit !important; | ||
color: rgb(var(--color-black)); | ||
} | ||
|
||
.mentions__input { | ||
width: 100%; | ||
caret-color: red; | ||
background-color: transparent; | ||
color: transparent; | ||
padding: 6px 10px; | ||
border: 1px solid rgb(var(--border-color)); | ||
border-radius: 6px; | ||
font-size: 13px !important; | ||
line-height: 20px !important; | ||
max-height: 114px; | ||
} | ||
|
||
.mentions__input:focus { | ||
border: 1px solid rgb(var(--blue-500)); | ||
outline: none !important; | ||
} | ||
|
||
.mentions__suggestions { | ||
border-radius: 8px; | ||
overflow: hidden; | ||
background: rgb(var(--color-white)) !important; | ||
border: 1px solid rgb(var(--grey-200)) !important; | ||
box-shadow: var(--box-shadow-base) !important; | ||
width: 100%; | ||
box-sizing: border-box; | ||
margin-top: 20px !important; | ||
} | ||
|
||
.mentions__suggestions__list { | ||
display: flex; | ||
flex-direction: column; | ||
padding: 8px !important; | ||
width: 100%; | ||
box-sizing: border-box; | ||
} | ||
|
||
.mentions__suggestions__item { | ||
padding: 4px 8px; | ||
border-radius: 6px; | ||
} | ||
|
||
.mentions__suggestions__item--focused { | ||
background-color: rgb(var(--grey-50)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* Copyright 2023-present DreamNum Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
export { Mentions } from './Mentions'; | ||
export type { IMentionsProps } from './Mentions'; | ||
export { Mention, type MentionProps } from 'react-mentions'; |
Oops, something went wrong.