This repository was archived by the owner on Jul 9, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 376
feat: repaint ui for setProperties in visual editor #2017
Merged
Merged
Changes from 23 commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
e401f62
elements interface
alanlong9278 874417f
styled component
alanlong9278 85c04ce
Merge branch 'master' into julong/nodeDesign
alanlong9278 1de0d13
use styledComponent in visual editor
alanlong9278 8136288
refactor
alanlong9278 e662100
Merge branch 'master' into julong/nodeDesign
alanlong9278 e571084
add styled package
alanlong9278 cd45b6c
Merge branch 'julong/nodeDesign' of https://github.com/microsoft/BotF…
alanlong9278 cd3a822
module name
alanlong9278 0375ba5
revert uischema & refactor itemOverview component
alanlong9278 c06b9e6
ui adjust
alanlong9278 337e8f3
rename & delete needless code
alanlong9278 5221a3f
Merge branch 'master' into julong/nodeDesign
a-b-r-o-w-n 1c4b956
Merge branch 'master' into julong/nodeDesign
alanlong9278 bbc3cc9
Merge branch 'julong/nodeDesign' of https://github.com/microsoft/BotF…
alanlong9278 291b44f
truncate text
alanlong9278 ea45495
Merge branch 'master' into julong/nodeDesign
alanlong9278 4c4cbf6
copy formcard to listoverviewcard for choiceinput and setProperties
alanlong9278 e907af9
refactor code
alanlong9278 2c96f84
Merge branch 'master' into julong/nodeDesign
alanlong9278 da2dbd3
Merge branch 'master' into julong/nodeDesign
alanlong9278 b744555
delete listOverviewWidget
alanlong9278 349cd6e
css
alanlong9278 b05c560
fix some bug
alanlong9278 582bb49
Merge branch 'master' into julong/nodeDesign
alanlong9278 0535f83
Merge branch 'master' into julong/nodeDesign
alanlong9278 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
84 changes: 0 additions & 84 deletions
84
Composer/packages/extensions/visual-designer/__tests__/widgets/ChoiceInput.test.tsx
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
39 changes: 39 additions & 0 deletions
39
Composer/packages/extensions/visual-designer/src/components/common/ListOverview.tsx
This file contains hidden or 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,39 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| /** @jsx jsx */ | ||
| import { jsx } from '@emotion/core'; | ||
| import { FC, ComponentClass } from 'react'; | ||
|
|
||
| import { SingleLineDiv } from '../elements/styledComponents'; | ||
|
|
||
| export interface ListOverviewProps { | ||
| items: string[]; | ||
| ItemRender: FC<any> | ComponentClass<any, any>; | ||
| maxCount: number; | ||
| styles?: Record<string, any>; | ||
| } | ||
| export const ListOverview: FC<ListOverviewProps> = ({ items, ItemRender, maxCount, styles }) => { | ||
| return ( | ||
| <div css={{ padding: '0 0 8px 8px' }}> | ||
| {items.slice(0, 3).map((value, index) => { | ||
|
alanlong9278 marked this conversation as resolved.
Outdated
|
||
| return ( | ||
| <ItemRender key={index} title={typeof value === 'string' ? value : ''} css={{ marginTop: '8px' }}> | ||
| {value} | ||
| </ItemRender> | ||
| ); | ||
| })} | ||
| {items.length > maxCount ? ( | ||
| <SingleLineDiv | ||
| data-testid="hasMore" | ||
| style={{ | ||
| marginTop: '8px', | ||
| textAlign: 'center', | ||
| }} | ||
| > | ||
| {`${items.length - 3} more`} | ||
|
alanlong9278 marked this conversation as resolved.
Outdated
|
||
| </SingleLineDiv> | ||
| ) : null} | ||
| </div> | ||
| ); | ||
| }; | ||
64 changes: 64 additions & 0 deletions
64
Composer/packages/extensions/visual-designer/src/components/elements/styledComponents.tsx
This file contains hidden or 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,64 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| import { css } from '@emotion/core'; | ||
| import styled from '@emotion/styled'; | ||
| import { Link } from 'office-ui-fabric-react/lib/Link'; | ||
|
|
||
| import { ObiColors } from '../../constants/ElementColors'; | ||
|
|
||
| import { MultiLineDivProps, DivProps } from './styledComponents.types'; | ||
|
|
||
| const dynamicStyle = props => | ||
| css` | ||
| color: ${props.color || ObiColors.Black}; | ||
| `; | ||
|
|
||
| export const LinkBtn = styled(Link)(props => ({ | ||
| color: props.color || ObiColors.AzureBlue, | ||
| })); | ||
|
|
||
| export const Span = styled.span` | ||
| ${dynamicStyle} | ||
| `; | ||
|
|
||
| export const BorderedDiv = styled.div<DivProps>(props => ({ | ||
| color: props.color || ObiColors.Black, | ||
| width: props.width, | ||
| height: props.height, | ||
| padding: '2px 0 0 8px', | ||
| whiteSpace: 'nowrap', | ||
| textOverflow: 'ellipsis', | ||
| overflow: 'hidden', | ||
| fontFamily: 'Segoe UI', | ||
| fontSize: '12px', | ||
| lineHeight: '14px', | ||
| border: '1px solid #C4C4C4', | ||
| boxSizing: 'border-box', | ||
| })); | ||
|
|
||
| export const MultiLineDiv = styled.div<MultiLineDivProps>(props => ({ | ||
| color: props.color || ObiColors.Black, | ||
| fontSize: '12px', | ||
| height: `${(props.lineNum || 1) * 19}px`, | ||
| lineHeight: '19px', | ||
| fontFamily: 'Segoe UI', | ||
| overflow: 'hidden', | ||
| textOverflow: 'ellipsis', | ||
| wordBreak: 'break-word', | ||
| display: '-webkit-box', | ||
| '-webkit-line-clamp': `${props.lineNum || 1}`, | ||
| '-webkit-box-orient': 'vertical', | ||
| })); | ||
|
|
||
| export const SingleLineDiv = styled.div<DivProps>(props => ({ | ||
| width: props.width || 150, | ||
| height: props.height || '19px', | ||
| color: props.color || ObiColors.Black, | ||
| fontSize: '12px', | ||
| whiteSpace: 'nowrap', | ||
| textOverflow: 'ellipsis', | ||
| overflow: 'hidden', | ||
| lineHeight: '19px', | ||
| fontFamily: 'Segoe UI', | ||
| })); |
15 changes: 15 additions & 0 deletions
15
...ser/packages/extensions/visual-designer/src/components/elements/styledComponents.types.ts
This file contains hidden or 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,15 @@ | ||
| // Copyright (c) Microsoft Corporation. | ||
| // Licensed under the MIT License. | ||
|
|
||
| import { DetailedHTMLProps, HTMLAttributes, ComponentClass, FC } from 'react'; | ||
|
|
||
| export type ElementProps = DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>; | ||
| export interface DivProps extends ElementProps { | ||
| width?: number; | ||
| height?: number; | ||
| } | ||
|
|
||
| export interface MultiLineDivProps extends DivProps { | ||
| lineNum?: number; | ||
| } | ||
| export type ElementComponent<T extends ElementProps> = FC<T> | ComponentClass<T, any>; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.