Skip to content

Commit

Permalink
Fix demo site icons
Browse files Browse the repository at this point in the history
  • Loading branch information
JiuqingSong committed Jan 8, 2025
1 parent 93b0cb2 commit 1033ae6
Show file tree
Hide file tree
Showing 12 changed files with 287 additions and 252 deletions.
2 changes: 1 addition & 1 deletion demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<div id="mainPane"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.14.0/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.14.0/umd/react-dom.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fluentui-react/8.60.1/fluentui-react.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fluentui-react/8.122.3/fluentui-react.min.js"></script>
<script src="rooster-min.js"></script>
<script src="rooster-react-min.js"></script>
<script src="demo.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion demo/scripts/utils/cssMonitor.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Stylesheet } from '@fluentui/merge-styles/lib/Stylesheet';
import { Stylesheet } from '@fluentui/merge-styles';

let isCssMonitorStarted: boolean = false;
const activeWindows: Window[] = [];
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<div id="mainPane"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.14.0/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.14.0/umd/react-dom.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fluentui-react/8.60.1/fluentui-react.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fluentui-react/8.122.3/fluentui-react.min.js"></script>
<script src="scripts/demo.js"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"publish": "node tools/build.js clean normalize buildcommonjs buildamd buildmjs dts pack packprod builddemo builddoc publish"
},
"devDependencies": {
"@fluentui/react": "^8.0.0",
"@fluentui/react": "8.122.3",
"@microsoft/loader-load-themed-styles": "1.8.11",
"@types/color": "3.0.0",
"@types/dompurify": "2.2.3",
Expand Down
4 changes: 2 additions & 2 deletions packages/roosterjs-react/lib/emoji/components/EmojiIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { css } from '@fluentui/react/lib/Utilities';
import type { Emoji } from '../type/Emoji';
import type { EmojiPaneStyle } from '../type/EmojiPaneStyles';
import type { IProcessedStyleSet, IStyleSet } from '@fluentui/react/lib/Styling';
import type { IProcessedStyleSet } from '@fluentui/react/lib/Styling';
/**
* @internal
* Emoji icon data
Expand All @@ -11,7 +11,7 @@ export interface EmojiIconProps {
id: string;
emoji: Emoji;
strings: Record<string, string>;
classNames: IProcessedStyleSet<IStyleSet<EmojiPaneStyle>>;
classNames: IProcessedStyleSet<EmojiPaneStyle>;
onClick?: (e: React.MouseEvent<EventTarget>) => void;
onMouseOver?: (e: React.MouseEvent<EventTarget>) => void;
onFocus?: React.FocusEventHandler<HTMLButtonElement>;
Expand Down
4 changes: 2 additions & 2 deletions packages/roosterjs-react/lib/emoji/components/EmojiNavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Icon } from '@fluentui/react/lib/Icon';
import { TooltipHost } from '@fluentui/react/lib/Tooltip';
import type { EmojiFamilyKeys } from '../utils/emojiList';
import type { EmojiPaneStyle } from '../type/EmojiPaneStyles';
import type { IProcessedStyleSet, IStyleSet } from '@fluentui/react/lib/Styling';
import type { IProcessedStyleSet } from '@fluentui/react/lib/Styling';

/**
* @internal
Expand All @@ -18,7 +18,7 @@ export interface EmojiNavBarProps {
currentSelected?: string;
getTabId?: (selected: EmojiFamilyKeys) => string;
strings: Record<string, string>;
classNames: IProcessedStyleSet<IStyleSet<EmojiPaneStyle>>;
classNames: IProcessedStyleSet<EmojiPaneStyle>;
}

/**
Expand Down
257 changes: 131 additions & 126 deletions packages/roosterjs-react/lib/emoji/components/EmojiPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ import { mergeStyleSets } from '@fluentui/react/lib/Styling';
import { searchEmojis } from '../utils/searchEmojis';
import { TextField } from '@fluentui/react/lib/TextField';
import { useTheme } from '@fluentui/react/lib/Theme';
import type { EmojiPaneStyle } from '../type/EmojiPaneStyles';
import type { IProcessedStyleSet } from '@fluentui/react/lib/Styling';
import type { EmojiFamilyKeys } from '../utils/emojiList';
import type { EmojiIconProps } from './EmojiIcon';
import type { EmojiNavBarProps } from './EmojiNavBar';
Expand Down Expand Up @@ -607,149 +609,152 @@ const calcPaneWidth = () => {
return paneWidth.toString() + 'px';
};

const getEmojiPaneClassName = memoizeFunction((theme: Theme) => {
const palette = theme.palette;
return mergeStyleSets({
quickPicker: {
overflowY: 'hidden',
':after': {
content: '',
position: 'absolute',
left: '0px',
top: '0px',
bottom: '0px',
right: '0px',
zIndex: 1,
borderWidth: '1px',
borderStyle: 'solid',
borderColor: 'rgb(255, 255, 255)',
borderImage: 'initial',
outline: 'rgb(102, 102, 102) solid 1px',
const getEmojiPaneClassName = memoizeFunction(
(theme: Theme): IProcessedStyleSet<EmojiPaneStyle> => {
const palette = theme.palette;
const styles: EmojiPaneStyle = {
quickPicker: {
overflowY: 'hidden',
':after': {
content: '',
position: 'absolute',
left: '0px',
top: '0px',
bottom: '0px',
right: '0px',
zIndex: 1,
borderWidth: '1px',
borderStyle: 'solid',
borderColor: 'rgb(255, 255, 255)',
borderImage: 'initial',
outline: 'rgb(102, 102, 102) solid 1px',
},
},
},

tooltip: {
padding: '8px',
},
tooltip: {
padding: '8px',
},

emojiTextInput: {
padding: '6px',
},
emojiTextInput: {
padding: '6px',
},

partialList: {
maxHeight: calcMaxHeight(),
overflow: 'hidden',
overflowY: 'scroll',
},
partialList: {
maxHeight: calcMaxHeight(),
overflow: 'hidden',
overflowY: 'scroll',
},

fullListContent: {
width: calcPaneWidth(),
},
fullListContent: {
width: calcPaneWidth(),
},

fullListBody: {
maxHeight: calcMaxHeight(),
overflow: 'hidden',
overflowY: 'scroll',
height: calcMaxHeight(),
},
fullListBody: {
maxHeight: calcMaxHeight(),
overflow: 'hidden',
overflowY: 'scroll',
height: calcMaxHeight(),
},

fullList: {
position: 'relative',
},
fullList: {
position: 'relative',
},

roosterEmojiPane: {
padding: '1px',
background: palette.white,
},
roosterEmojiPane: {
padding: '1px',
background: palette.white,
},

emoji: {
fontSize: '18px',
width: '40px',
height: '40px',
border: '0',
position: 'relative',
background: palette.white,
transition: 'backgorund 0.5s ease-in-out',
},
emoji: {
fontSize: '18px',
width: '40px',
height: '40px',
border: '0',
position: 'relative',
background: palette.white,
transition: 'backgorund 0.5s ease-in-out',
},

emojiSelected: {
background: palette.neutralLight,
},
emojiSelected: {
background: palette.neutralLight,
},

navBar: {
top: '-1px',
zIndex: 10,
position: 'sticky',
},
navBar: {
top: '-1px',
zIndex: 10,
position: 'sticky',
},

navBarTooltip: {
display: 'inline-block',
},
navBarTooltip: {
display: 'inline-block',
},

navBarButton: {
height: '40px',
width: '40px',
border: '0',
borderBottom: 'solid 1px',
padding: 0,
marginBottom: 0,
display: 'inline-block',
color: palette.themeDark,
background: palette.white,
'&:hover': {
cursor: 'default',
navBarButton: {
height: '40px',
width: '40px',
border: '0',
borderBottom: 'solid 1px',
padding: 0,
marginBottom: 0,
display: 'inline-block',
color: palette.themeDark,
background: palette.white,
'&:hover': {
cursor: 'default',
},
},
},

selected: {
borderBottom: '2px solid',
borderBottomColor: palette.themeDark,
},
selected: {
borderBottom: '2px solid',
borderBottomColor: palette.themeDark,
},

statusBar: {
borderTop: 'solid 1px',
height: '50px',
overflow: 'hidden',
position: 'relative',
background: palette.white,
},
statusBar: {
borderTop: 'solid 1px',
height: '50px',
overflow: 'hidden',
position: 'relative',
background: palette.white,
},

statusBarIcon: {
padding: '4px',
fontSize: '25px',
display: 'inline-block',
fontStyle: 'normal',
fontWeight: 'normal',
lineHeight: '40px',
},
statusBarIcon: {
padding: '4px',
fontSize: '25px',
display: 'inline-block',
fontStyle: 'normal',
fontWeight: 'normal',
lineHeight: '40px',
},

statusBarDetailsContainer: {
padding: '0 4px',
lineHeight: '50px',
position: 'absolute',
display: 'inline-block',
left: '40px',
right: '0',
top: '0',
},
statusBarDetailsContainer: {
padding: '0 4px',
lineHeight: '50px',
position: 'absolute',
display: 'inline-block',
left: '40px',
right: '0',
top: '0',
},

statusBarDetails: {
fontWeight: 'bold',
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
},
statusBarDetails: {
fontWeight: 'bold',
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
},

statusBarNoResultDetailsContainer: {
lineHeight: '50px',
position: 'absolute',
display: 'inline-block',
top: '0',
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
left: '0',
padding: '0 8px',
},
});
});
statusBarNoResultDetailsContainer: {
lineHeight: '50px',
position: 'absolute',
display: 'inline-block',
top: '0',
whiteSpace: 'nowrap',
overflow: 'hidden',
textOverflow: 'ellipsis',
left: '0',
padding: '0 8px',
},
};
return mergeStyleSets(styles);
}
);
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from 'react';
import { TooltipHost, TooltipOverflowMode } from '@fluentui/react/lib/Tooltip';
import type { Emoji } from '../type/Emoji';
import type { EmojiPaneStyle } from '../type/EmojiPaneStyles';
import type { IProcessedStyleSet, IStyleSet } from '@fluentui/react/lib/Styling';
import type { IProcessedStyleSet } from '@fluentui/react/lib/Styling';
/**
* @internal
* Emoji Status Bar data
Expand All @@ -11,7 +11,7 @@ export interface EmojiStatusBarProps {
emoji: Emoji;
strings: Record<string, string>;
hasResult: boolean;
classNames: IProcessedStyleSet<IStyleSet<EmojiPaneStyle>>;
classNames: IProcessedStyleSet<EmojiPaneStyle>;
}

const NO_SUGGESTIONS = 'emjDNoSuggetions';
Expand Down
Loading

0 comments on commit 1033ae6

Please sign in to comment.