Skip to content

Commit 3f18da0

Browse files
authored
Merge pull request #7629 from sagemathinc/jupyter-tweak-cells
Jupyter: tweak cell prompt and buttonbar
2 parents 0a9af2c + f043d92 commit 3f18da0

File tree

16 files changed

+436
-287
lines changed

16 files changed

+436
-287
lines changed

src/packages/frontend/_jupyter.sass

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,73 +4,73 @@
44
*/
55

66
.smc-jupyter-nbviewer-content
7-
border : 1px solid lightgray
7+
border: 1px solid lightgray
88

99
.smc-jupyter-nbviewer
10-
background : white
11-
position : fixed
12-
width : 100%
10+
background: white
11+
position: fixed
12+
width: 100%
1313

1414
.smc-jupyter-notebook
15-
background : white
16-
width : 100%
17-
left : 0px
18-
min-height : 10em /* ensure path is covered while loading notebook */
15+
background: white
16+
width: 100%
17+
left: 0px
18+
min-height: 10em /* ensure path is covered while loading notebook */
1919

2020
.smc-jupyter-notebook-history-slider-controls
21-
position : absolute
22-
top : 8px
23-
right : 5px
24-
width : 80%
25-
background : white
26-
border : 2px solid orange
27-
border-radius : 4px
28-
padding : 20px
29-
box-shadow : 5px 6px 4px lightgray
21+
position: absolute
22+
top: 8px
23+
right: 5px
24+
width: 80%
25+
background: white
26+
border: 2px solid orange
27+
border-radius: 4px
28+
padding: 20px
29+
box-shadow: 5px 6px 4px lightgray
3030

3131
.smc-jupyter-notebook-history-slider
32-
margin-top : 11px
32+
margin-top: 11px
3333

3434
.smc-jupyter-notebook-status-messages
35-
font-size : 10pt
35+
font-size: 10pt
3636

3737
.smc-jupyter-notebook-danger
38-
color : white
39-
font-weight : bold
40-
font-size : 7pt
41-
background : red
38+
color: white
39+
font-weight: bold
40+
font-size: 7pt
41+
background: red
4242

4343
.smc-jupyter-history-revision-number
44-
font-size : 10pt
44+
font-size: 10pt
4545

4646
.smc-jupyter-history-revision-time
47-
font-size : 10pt
47+
font-size: 10pt
4848

4949
/* Used for new sync. */
5050
.smc-jupyter-cursor
51-
position : absolute
52-
width : 15em
53-
z-index : 5 !important
51+
position: absolute
52+
width: 15em
53+
z-index: 5 !important
5454

5555
.smc-jupyter-cursor-inside
56-
height : 1.2em
57-
width : 1px
56+
height: 1.2em
57+
width: 1px
5858

5959
.smc-jupyter-cursor-label
60-
font-size : 8pt
61-
font-family : serif
62-
color : #fff
63-
z-index : 1000
60+
font-size: 8pt
61+
font-family: serif
62+
color: #fff
63+
z-index: 1000
6464

6565
.smc-jupyter-notebook-notebook
66-
width : 100%
66+
width: 100%
6767

6868
.cc-jupyter-snippets
6969
.ant-collapse-content-box
70-
padding: 0 !important
70+
padding: 0 !important
7171

7272
span.hl
73-
background-color : yellow
73+
background-color: yellow
7474
font-weight: bold
7575

7676
.cc-jupyter-snippet
@@ -94,7 +94,7 @@
9494
font-size: 80%
9595

9696
.cc-jupyter-snippet-header
97-
vertical-align: -0.125em // to match ANTD's collapse icon
97+
vertical-align: -0.125em // to match ANTD's collapse icon
9898
p
9999
display: inline
100100
@@ -107,3 +107,8 @@
107107

108108
.MathJax_SVG_Display
109109
padding-right: 1em
110+
111+
.cc-jupyter-buttonbar-dropdown
112+
.ant-dropdown-menu-item
113+
font-size: 12px !important
114+
color: $COL_GRAY_D !important

src/packages/frontend/components/copy-button.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ interface Props {
99
value?: string;
1010
size?;
1111
noText?: boolean;
12+
block?: true;
1213
}
1314

1415
export default function CopyButton({
1516
style,
1617
value,
1718
size,
1819
noText = false,
20+
block,
1921
}: Props) {
2022
const [copied, setCopied] = useState<boolean>(false);
2123
useEffect(() => {
@@ -24,6 +26,7 @@ export default function CopyButton({
2426
return (
2527
<CopyToClipboard text={value} onCopy={() => setCopied(true)}>
2628
<Button
29+
block={block}
2730
size={size}
2831
type="text"
2932
style={style}

src/packages/frontend/components/icon.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ import {
7373
DoubleRightOutlined,
7474
DownCircleOutlined,
7575
DownOutlined,
76+
DownSquareOutlined,
7677
DownloadOutlined,
7778
EditFilled,
7879
EditOutlined,
@@ -95,6 +96,7 @@ import {
9596
FolderOpenOutlined,
9697
FolderOutlined,
9798
FontSizeOutlined,
99+
ForkOutlined,
98100
ForwardOutlined,
99101
FrownOutlined,
100102
FunctionOutlined,
@@ -138,6 +140,7 @@ import {
138140
MedicineBoxOutlined,
139141
MehOutlined,
140142
MenuOutlined,
143+
MergeCellsOutlined,
141144
MinusCircleOutlined,
142145
MinusOutlined,
143146
MinusSquareOutlined,
@@ -203,6 +206,7 @@ import {
203206
UnorderedListOutlined,
204207
UpCircleOutlined,
205208
UpOutlined,
209+
UpSquareOutlined,
206210
UploadOutlined,
207211
UserAddOutlined,
208212
UserDeleteOutlined,
@@ -612,6 +616,10 @@ const IconSpec: { [name: string]: any } = {
612616
"clean-outlined": ClearOutlined,
613617
"sound-outlined": SoundOutlined,
614618
"rise-outlined": RiseOutlined,
619+
"up-square-outlined": UpSquareOutlined,
620+
"down-square-outlined": DownSquareOutlined,
621+
"merge-cells-outlined": MergeCellsOutlined,
622+
"fork-outlined": ForkOutlined,
615623
};
616624

617625
// Icon Fonts coming from https://www.iconfont.cn/?lang=en-us

src/packages/frontend/components/paste-button.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ import { alert_message } from "@cocalc/frontend/alerts";
77
interface Props {
88
style?: CSSProperties;
99
paste: (text: string) => any;
10+
block?: true;
1011
}
1112

12-
export default function PasteButton({ style, paste }: Props) {
13+
export default function PasteButton({ style, paste, block }: Props) {
1314
const [pasted, setPasted] = useState<boolean>(false);
1415

1516
async function onClick() {
@@ -27,7 +28,13 @@ export default function PasteButton({ style, paste }: Props) {
2728
}
2829

2930
return (
30-
<Button size="small" type="text" style={style} onClick={onClick}>
31+
<Button
32+
size="small"
33+
type="text"
34+
style={style}
35+
onClick={onClick}
36+
block={block}
37+
>
3138
<Icon name={pasted ? "check" : "paste"} />
3239
{pasted ? "Pasted" : "Paste"}
3340
</Button>

src/packages/frontend/frame-editors/whiteboard-editor/elements/code/input-prompt.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ export default function CodeInputPrompt({ element }) {
3333
end={element.data?.end}
3434
actions={actions}
3535
id={element.id}
36-
hideMove
37-
hideCut
38-
hideRun
3936
/>
4037
);
4138
}

0 commit comments

Comments
 (0)