@jupyterlab/cells 4.0.0-alpha.2 → 4.0.0-alpha.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/lib/celldragutils.d.ts +1 -7
  2. package/lib/celldragutils.js +12 -13
  3. package/lib/celldragutils.js.map +1 -1
  4. package/lib/index.d.ts +1 -0
  5. package/lib/index.js +1 -0
  6. package/lib/index.js.map +1 -1
  7. package/lib/inputarea.d.ts +9 -19
  8. package/lib/inputarea.js +16 -29
  9. package/lib/inputarea.js.map +1 -1
  10. package/lib/model.d.ts +121 -79
  11. package/lib/model.js +179 -392
  12. package/lib/model.js.map +1 -1
  13. package/lib/placeholder.d.ts +23 -19
  14. package/lib/placeholder.js +30 -35
  15. package/lib/placeholder.js.map +1 -1
  16. package/lib/resizeHandle.d.ts +0 -1
  17. package/lib/resizeHandle.js +9 -11
  18. package/lib/resizeHandle.js.map +1 -1
  19. package/lib/searchprovider.d.ts +31 -0
  20. package/lib/searchprovider.js +359 -0
  21. package/lib/searchprovider.js.map +1 -0
  22. package/lib/testutils.d.ts +22 -0
  23. package/lib/testutils.js +48 -0
  24. package/lib/testutils.js.map +1 -0
  25. package/lib/widget.d.ts +226 -42
  26. package/lib/widget.js +672 -270
  27. package/lib/widget.js.map +1 -1
  28. package/package.json +36 -33
  29. package/src/celldragutils.ts +214 -0
  30. package/src/collapser.tsx +150 -0
  31. package/src/headerfooter.ts +52 -0
  32. package/src/index.ts +17 -0
  33. package/src/inputarea.ts +292 -0
  34. package/src/model.ts +845 -0
  35. package/src/placeholder.ts +125 -0
  36. package/src/resizeHandle.ts +96 -0
  37. package/src/searchprovider.ts +433 -0
  38. package/src/testutils.ts +57 -0
  39. package/src/widget.ts +2290 -0
  40. package/style/collapser.css +5 -4
  41. package/style/headerfooter.css +3 -3
  42. package/style/index.css +4 -2
  43. package/style/index.js +4 -2
  44. package/style/inputarea.css +19 -17
  45. package/style/placeholder.css +1 -1
  46. package/style/widget.css +85 -7
@@ -5,8 +5,8 @@
5
5
 
6
6
  .jp-Collapser {
7
7
  flex: 0 0 var(--jp-cell-collapser-width);
8
- padding: 0px;
9
- margin: 0px;
8
+ padding: 0;
9
+ margin: 0;
10
10
  border: none;
11
11
  outline: none;
12
12
  background: transparent;
@@ -18,10 +18,11 @@
18
18
  display: block;
19
19
  width: 100%;
20
20
  box-sizing: border-box;
21
+
21
22
  /* height: 100% doesn't work because the height of its parent is computed from content */
22
23
  position: absolute;
23
- top: 0px;
24
- bottom: 0px;
24
+ top: 0;
25
+ bottom: 0;
25
26
  }
26
27
 
27
28
  /*-----------------------------------------------------------------------------
@@ -10,10 +10,10 @@
10
10
  /* Hidden by zero height by default */
11
11
  .jp-CellHeader,
12
12
  .jp-CellFooter {
13
- height: 0px;
13
+ height: 0;
14
14
  width: 100%;
15
- padding: 0px;
16
- margin: 0px;
15
+ padding: 0;
16
+ margin: 0;
17
17
  border: none;
18
18
  outline: none;
19
19
  background: transparent;
package/style/index.css CHANGED
@@ -7,12 +7,14 @@
7
7
  @import url('~@lumino/widgets/style/index.css');
8
8
  @import url('~@jupyterlab/ui-components/style/index.css');
9
9
  @import url('~@jupyterlab/apputils/style/index.css');
10
+ @import url('~@jupyterlab/rendermime/style/index.css');
11
+ @import url('~@jupyterlab/attachments/style/index.css');
10
12
  @import url('~@lumino/dragdrop/style/index.css');
11
13
  @import url('~@jupyterlab/codeeditor/style/index.css');
14
+ @import url('~@jupyterlab/documentsearch/style/index.css');
12
15
  @import url('~@jupyterlab/codemirror/style/index.css');
13
- @import url('~@jupyterlab/rendermime/style/index.css');
14
- @import url('~@jupyterlab/attachments/style/index.css');
15
16
  @import url('~@jupyterlab/filebrowser/style/index.css');
16
17
  @import url('~@jupyterlab/outputarea/style/index.css');
18
+ @import url('~@jupyterlab/toc/style/index.css');
17
19
 
18
20
  @import url('./base.css');
package/style/index.js CHANGED
@@ -7,12 +7,14 @@
7
7
  import '@lumino/widgets/style/index.js';
8
8
  import '@jupyterlab/ui-components/style/index.js';
9
9
  import '@jupyterlab/apputils/style/index.js';
10
+ import '@jupyterlab/rendermime/style/index.js';
11
+ import '@jupyterlab/attachments/style/index.js';
10
12
  import '@lumino/dragdrop/style/index.js';
11
13
  import '@jupyterlab/codeeditor/style/index.js';
14
+ import '@jupyterlab/documentsearch/style/index.js';
12
15
  import '@jupyterlab/codemirror/style/index.js';
13
- import '@jupyterlab/rendermime/style/index.js';
14
- import '@jupyterlab/attachments/style/index.js';
15
16
  import '@jupyterlab/filebrowser/style/index.js';
16
17
  import '@jupyterlab/outputarea/style/index.js';
18
+ import '@jupyterlab/toc/style/index.js';
17
19
 
18
20
  import './base.css';
@@ -10,35 +10,26 @@
10
10
  /* All input areas */
11
11
  .jp-InputArea {
12
12
  display: table;
13
+ table-layout: fixed;
14
+ width: 100%;
13
15
  overflow: hidden;
14
16
  }
15
17
 
16
18
  .jp-InputArea-editor {
17
19
  display: table-cell;
18
- width: 100%;
19
20
  overflow: hidden;
20
21
  vertical-align: top;
21
- }
22
22
 
23
- body[data-format='mobile'] .jp-InputArea-editor {
24
- display: table-row;
25
- }
26
-
27
- .jp-InputArea-editor {
28
23
  /* This is the non-active, default styling */
29
24
  border: var(--jp-border-width) solid var(--jp-cell-editor-border-color);
30
- border-radius: 0px;
25
+ border-radius: 0;
31
26
  background: var(--jp-cell-editor-background);
32
27
  }
33
28
 
34
- body[data-format='mobile'] .jp-InputArea-editor {
35
- margin-left: var(--jp-notebook-padding);
36
- }
37
-
38
29
  .jp-InputPrompt {
39
30
  display: table-cell;
40
31
  vertical-align: top;
41
- min-width: var(--jp-cell-prompt-width);
32
+ width: var(--jp-cell-prompt-width);
42
33
  color: var(--jp-cell-inprompt-font-color);
43
34
  font-family: var(--jp-cell-prompt-font-family);
44
35
  padding: var(--jp-code-padding);
@@ -47,12 +38,13 @@ body[data-format='mobile'] .jp-InputArea-editor {
47
38
  line-height: var(--jp-code-line-height);
48
39
  font-size: var(--jp-code-font-size);
49
40
  border: var(--jp-border-width) solid transparent;
50
- opacity: var(--jp-cell-prompt-opacity);
41
+
51
42
  /* Right align prompt text, don't wrap to handle large prompt numbers */
52
43
  text-align: right;
53
44
  white-space: nowrap;
54
45
  overflow: hidden;
55
46
  text-overflow: ellipsis;
47
+
56
48
  /* Disable text selection */
57
49
  -webkit-user-select: none;
58
50
  -moz-user-select: none;
@@ -60,7 +52,17 @@ body[data-format='mobile'] .jp-InputArea-editor {
60
52
  user-select: none;
61
53
  }
62
54
 
63
- body[data-format='mobile'] .jp-InputPrompt {
64
- display: table-row;
65
- text-align: left;
55
+ /*-----------------------------------------------------------------------------
56
+ | Mobile
57
+ |----------------------------------------------------------------------------*/
58
+ @media only screen and (max-width: 760px) {
59
+ .jp-InputArea-editor {
60
+ display: table-row;
61
+ margin-left: var(--jp-notebook-padding);
62
+ }
63
+
64
+ .jp-InputPrompt {
65
+ display: table-row;
66
+ text-align: left;
67
+ }
66
68
  }
@@ -34,6 +34,6 @@
34
34
 
35
35
  .jp-Placeholder-content .jp-MoreHorizIcon:hover {
36
36
  border: 1px solid var(--jp-border-color1);
37
- box-shadow: 0px 0px 2px 0px rgba(0, 0, 0, 0.25);
37
+ box-shadow: 0 0 2px 0 rgba(0, 0, 0, 0.25);
38
38
  background-color: var(--jp-layout-color0);
39
39
  }
package/style/widget.css CHANGED
@@ -17,7 +17,7 @@
17
17
 
18
18
  .jp-Cell {
19
19
  padding: var(--jp-cell-padding);
20
- margin: 0px;
20
+ margin: 0;
21
21
  border: none;
22
22
  outline: none;
23
23
  background: transparent;
@@ -31,8 +31,9 @@
31
31
  .jp-Cell-outputWrapper {
32
32
  display: flex;
33
33
  flex-direction: row;
34
- padding: 0px;
35
- margin: 0px;
34
+ padding: 0;
35
+ margin: 0;
36
+
36
37
  /* Added to reveal the box-shadow on the input and output collapsers. */
37
38
  overflow: visible;
38
39
  }
@@ -71,17 +72,42 @@
71
72
  .jp-CodeCell.jp-mod-outputsScrolled .jp-Cell-outputArea {
72
73
  overflow-y: auto;
73
74
  max-height: 24em;
74
- box-shadow: inset 0 0 6px 2px rgba(0, 0, 0, 0.3);
75
75
  margin-left: var(--jp-private-cell-scrolling-output-offset);
76
+ resize: vertical;
77
+ }
78
+
79
+ .jp-CodeCell.jp-mod-outputsScrolled .jp-Cell-outputArea[style*='height'] {
80
+ max-height: unset;
81
+ }
82
+
83
+ .jp-CodeCell.jp-mod-outputsScrolled .jp-Cell-outputArea::after {
84
+ content: ' ';
85
+ box-shadow: inset 0 0 6px 2px rgb(0 0 0 / 30%);
86
+ width: 100%;
87
+ height: 100%;
88
+ position: sticky;
89
+ bottom: 0;
90
+ top: 0;
91
+ margin-top: -50%;
92
+ float: left;
93
+ display: block;
94
+ pointer-events: none;
95
+ }
96
+
97
+ .jp-CodeCell.jp-mod-outputsScrolled .jp-OutputArea-child {
76
98
  padding-top: 6px;
77
99
  }
78
100
 
79
101
  .jp-CodeCell.jp-mod-outputsScrolled .jp-OutputArea-prompt {
80
- min-width: calc(
102
+ width: calc(
81
103
  var(--jp-cell-prompt-width) - var(--jp-private-cell-scrolling-output-offset)
82
104
  );
83
105
  }
84
106
 
107
+ .jp-CodeCell.jp-mod-outputsScrolled .jp-OutputArea-promptOverlay {
108
+ left: calc(-1 * var(--jp-private-cell-scrolling-output-offset));
109
+ }
110
+
85
111
  /*-----------------------------------------------------------------------------
86
112
  | CodeCell
87
113
  |----------------------------------------------------------------------------*/
@@ -106,13 +132,65 @@
106
132
  .jp-collapseHeadingButton {
107
133
  display: flex;
108
134
  min-height: var(--jp-cell-collapser-min-height);
135
+ font-size: var(--jp-code-font-size);
109
136
  position: absolute;
110
- background-size: 25px !important;
137
+ background-color: transparent;
138
+ background-size: 25px;
139
+ background-repeat: no-repeat;
140
+ background-position-x: center;
141
+ background-position-y: top;
142
+ background-image: var(--jp-icon-caret-down);
111
143
  right: 0;
112
144
  top: 0;
113
145
  bottom: 0;
114
146
  }
115
147
 
148
+ .jp-collapseHeadingButton.jp-mod-collapsed {
149
+ background-image: var(--jp-icon-caret-right);
150
+ }
151
+
152
+ /*
153
+ set the container font size to match that of content
154
+ so that the nested collapse buttons have the right size
155
+ */
156
+ .jp-MarkdownCell .jp-InputPrompt {
157
+ font-size: var(--jp-content-font-size1);
158
+ }
159
+
160
+ /*
161
+ Align collapseHeadingButton with cell top header
162
+ The font sizes are identical to the ones in packages/rendermime/style/base.css
163
+ */
164
+ .jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='1'] {
165
+ font-size: var(--jp-content-font-size5);
166
+ background-position-y: calc(0.3 * var(--jp-content-font-size5));
167
+ }
168
+
169
+ .jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='2'] {
170
+ font-size: var(--jp-content-font-size4);
171
+ background-position-y: calc(0.3 * var(--jp-content-font-size4));
172
+ }
173
+
174
+ .jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='3'] {
175
+ font-size: var(--jp-content-font-size3);
176
+ background-position-y: calc(0.3 * var(--jp-content-font-size3));
177
+ }
178
+
179
+ .jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='4'] {
180
+ font-size: var(--jp-content-font-size2);
181
+ background-position-y: calc(0.3 * var(--jp-content-font-size2));
182
+ }
183
+
184
+ .jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='5'] {
185
+ font-size: var(--jp-content-font-size1);
186
+ background-position-y: top;
187
+ }
188
+
189
+ .jp-mod-rendered .jp-collapseHeadingButton[data-heading-level='6'] {
190
+ font-size: var(--jp-content-font-size0);
191
+ background-position-y: top;
192
+ }
193
+
116
194
  /* collapseHeadingButton (show only on (hover,active) if hiddenCellsButton is shown) */
117
195
  .jp-Notebook.jp-mod-showHiddenCellsButton .jp-collapseHeadingButton {
118
196
  display: none;
@@ -124,7 +202,7 @@
124
202
  display: flex;
125
203
  }
126
204
 
127
- /* showHiddenCellsButton (only show if jp-mod-showHiddenCellsButton is set, which
205
+ /* showHiddenCellsButton (only show if jp-mod-showHiddenCellsButton is set, which
128
206
  is a consequence of the showHiddenCellsButton option in Notebook Settings)*/
129
207
  .jp-Notebook.jp-mod-showHiddenCellsButton .jp-showHiddenCellsButton {
130
208
  margin-left: calc(var(--jp-cell-prompt-width) + 2 * var(--jp-code-padding));