jupyter-specta 0.1.2 → 0.1.4

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 (51) hide show
  1. package/lib/app.js +1 -1
  2. package/lib/components/cellSkeleton.d.ts +6 -0
  3. package/lib/components/cellSkeleton.js +19 -0
  4. package/lib/components/divider.d.ts +2 -0
  5. package/lib/components/divider.js +4 -0
  6. package/lib/components/icon/gear.d.ts +2 -0
  7. package/lib/components/icon/gear.js +17 -0
  8. package/lib/components/iconButton.d.ts +8 -0
  9. package/lib/components/iconButton.js +4 -0
  10. package/lib/create_notebook_panel.d.ts +7 -1
  11. package/lib/create_notebook_panel.js +37 -1
  12. package/lib/document/factory.d.ts +5 -1
  13. package/lib/document/factory.js +13 -3
  14. package/lib/extension_plugins.js +11 -2
  15. package/lib/layout/article.d.ts +12 -0
  16. package/lib/layout/article.js +35 -0
  17. package/lib/layout/default.js +2 -5
  18. package/lib/layout/{plugin.js → index.js} +5 -0
  19. package/lib/layout/layout_registry.d.ts +1 -0
  20. package/lib/layout/layout_registry.js +6 -0
  21. package/lib/metadata/index.d.ts +3 -0
  22. package/lib/metadata/index.js +14 -0
  23. package/lib/shell.js +0 -1
  24. package/lib/specta_cell_output.d.ts +11 -2
  25. package/lib/specta_cell_output.js +22 -1
  26. package/lib/specta_model.d.ts +6 -4
  27. package/lib/specta_model.js +89 -13
  28. package/lib/specta_widget.d.ts +5 -1
  29. package/lib/specta_widget.js +25 -8
  30. package/lib/specta_widget_factory.js +7 -2
  31. package/lib/token.d.ts +18 -0
  32. package/lib/tool.d.ts +5 -1
  33. package/lib/tool.js +40 -6
  34. package/lib/topbar/index.d.ts +5 -0
  35. package/lib/topbar/index.js +30 -0
  36. package/lib/topbar/kernelStatus.d.ts +28 -0
  37. package/lib/topbar/kernelStatus.js +20 -0
  38. package/lib/topbar/settingDialog.d.ts +7 -0
  39. package/lib/topbar/settingDialog.js +73 -0
  40. package/lib/topbar/widget.d.ts +9 -0
  41. package/lib/topbar/widget.js +41 -0
  42. package/package.json +23 -13
  43. package/schema/app-meta.json +39 -0
  44. package/schema/cell-meta.json +37 -0
  45. package/style/article.css +314 -0
  46. package/style/base.css +125 -0
  47. package/style/index.css +2 -0
  48. package/style/index.js +3 -1
  49. package/style/skeleton.css +87 -0
  50. package/style/style.css +9 -4
  51. /package/lib/layout/{plugin.d.ts → index.d.ts} +0 -0
@@ -0,0 +1,314 @@
1
+ @import url('https://fonts.googleapis.com/css2?family=Source+Serif+4:ital,opsz,wght@0,8..60,200..900;1,8..60,200..900&display=swap');
2
+ @import url('https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,100..900;1,100..900&display=swap');
3
+ @import url('https://fonts.googleapis.com/css2?family=Source+Code+Pro:ital,wght@0,200..900;1,200..900&family=Work+Sans:ital,wght@0,100..900;1,100..900&display=swap');
4
+
5
+ .specta-article-host-widget {
6
+ display: flex;
7
+ justify-content: center;
8
+ margin: 0 24px;
9
+ padding-bottom: 200px;
10
+ --jp-content-font-family: 'Source Serif 4', Georgia, serif;
11
+ --jp-code-font-family:
12
+ 'Source Code Pro', Menlo, Monaco, 'Courier New', Courier, monospace;
13
+ --jp-code-font-size: 14px;
14
+ }
15
+
16
+ .specta-article-host-widget {
17
+ .jp-Collapser-child,
18
+ .jp-collapseHeadingButton,
19
+ .jp-InputPrompt,
20
+ .jp-InputCollapser,
21
+ .jp-InternalAnchorLink {
22
+ display: none;
23
+ }
24
+
25
+ .specta-article-outputs-panel {
26
+ max-width: 680px;
27
+ width: 100%;
28
+ font-size: 1rem;
29
+ line-height: 1.6;
30
+ }
31
+
32
+ .specta-article-outputs-panel {
33
+ .jp-MarkdownOutput {
34
+ padding-left: 0px !important;
35
+ padding-right: 0px !important;
36
+ }
37
+
38
+ .specta-item-widget {
39
+ padding: 0 !important;
40
+ }
41
+ }
42
+
43
+ h1 {
44
+ font-family: 'Work Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
45
+ letter-spacing: -0.014em;
46
+ line-height: 38px;
47
+ margin-bottom: 24px;
48
+ margin-top: 1.5em !important;
49
+ font-size: 32px;
50
+ font-weight: 700;
51
+ font-style: normal;
52
+ }
53
+
54
+ h2 {
55
+ font-family: 'Work Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
56
+ margin-top: 1em !important;
57
+ font-size: 1.6em;
58
+ }
59
+
60
+ h3 {
61
+ margin-top: 1em !important;
62
+ font-size: 1.3em;
63
+ }
64
+
65
+ h4 {
66
+ margin-top: 1em;
67
+ font-size: 1.2em;
68
+ }
69
+
70
+ h5 {
71
+ margin-top: 1em;
72
+ font-size: 1.1em;
73
+ }
74
+
75
+ h6 {
76
+ margin-top: 1em;
77
+ font-size: 1em;
78
+ }
79
+
80
+ p {
81
+ font-size: 1rem;
82
+ line-height: 1.6;
83
+ margin-bottom: 1.2em;
84
+ }
85
+
86
+ a {
87
+ color: #007bff;
88
+ text-decoration: none;
89
+ }
90
+
91
+ a:hover {
92
+ text-decoration: underline;
93
+ }
94
+
95
+ pre {
96
+ background-color: var(--jp-cell-editor-background) !important;
97
+ padding: 32px !important;
98
+ border-radius: 4px !important;
99
+ border: 1px solid var(--jp-cell-editor-border-color) !important;
100
+ overflow-x: auto;
101
+ margin: 0 !important;
102
+ margin-top: 56px !important;
103
+ font-size: 0.85em !important;
104
+ line-height: 1.4 !important;
105
+ }
106
+
107
+ pre code {
108
+ color: #222;
109
+ background-color: transparent !important;
110
+ padding: 0;
111
+ font-size: 14px !important;
112
+ }
113
+
114
+ code {
115
+ background-color: #e9ecef;
116
+ padding: 0.2em 0.4em;
117
+ border-radius: 4px;
118
+ font-size: 14px !important;
119
+ }
120
+
121
+ p code {
122
+ font-size: 75% !important;
123
+ }
124
+
125
+ img {
126
+ max-width: 100%;
127
+ height: auto;
128
+ display: block;
129
+ margin: 1.5em auto;
130
+ border-radius: 4px;
131
+ }
132
+
133
+ blockquote {
134
+ border-left: 3px solid #ffffff00;
135
+ padding-left: 16px;
136
+ margin: 1.2em 0;
137
+ font-style: italic;
138
+ color: var(--jp-ui-font-color2);
139
+ font-size: 1em;
140
+ }
141
+
142
+ blockquote p {
143
+ margin-bottom: 0.4em;
144
+ }
145
+
146
+ ul,
147
+ ol {
148
+ margin-bottom: 1.2em;
149
+ padding-left: 1.5em;
150
+ font-size: 1rem;
151
+ line-height: 1.6;
152
+ }
153
+
154
+ li {
155
+ margin-bottom: 0.4em;
156
+ }
157
+
158
+ hr {
159
+ border: 0;
160
+ height: 1px;
161
+ background-color: #ddd;
162
+ margin: 2em 0;
163
+ }
164
+
165
+ table {
166
+ width: 100%;
167
+ border-collapse: collapse;
168
+ margin: 1.2em 0;
169
+ font-size: 0.9em;
170
+ }
171
+
172
+ th,
173
+ td {
174
+ border: 1px solid #ddd;
175
+ padding: 6px 10px;
176
+ text-align: left;
177
+ }
178
+
179
+ th {
180
+ background-color: #f7f7f7;
181
+ font-weight: bold;
182
+ }
183
+
184
+ h1 + p,
185
+ h2 + p,
186
+ h3 + p,
187
+ h4 + p,
188
+ h5 + p {
189
+ margin-top: 0.66em !important;
190
+ }
191
+
192
+ .jp-CodeCell {
193
+ padding: 0 !important;
194
+ margin-top: 40px !important;
195
+ }
196
+
197
+ .jp-CodeCell + .jp-OutputArea > .jp-OutputArea-child {
198
+ margin-top: 40px !important;
199
+ }
200
+ .jp-InputArea-editor {
201
+ padding: 32px !important;
202
+ border-radius: 4px !important;
203
+ background-color: var(--jp-cell-editor-background) !important;
204
+ }
205
+ .jp-InputArea-editor > div.cm-editor {
206
+ background: transparent !important;
207
+ }
208
+ .cm-content {
209
+ padding: 0 !important;
210
+ }
211
+ }
212
+ /* Bigger screen */
213
+ @media screen and (min-width: 728px) {
214
+ .specta-article-host-widget {
215
+ .specta-article-outputs-panel {
216
+ font-size: 1.1rem;
217
+ line-height: 1.7;
218
+ }
219
+
220
+ h1 {
221
+ font-size: 42px;
222
+ font-style: normal;
223
+ font-weight: 700;
224
+ margin-top: 1.8em !important;
225
+ margin-bottom: 32px;
226
+ line-height: 52px;
227
+ letter-spacing: -0.011em;
228
+ }
229
+
230
+ h2 {
231
+ font-size: 24px;
232
+ font-weight: 700;
233
+ margin-top: 1.25em !important;
234
+ line-height: 30px;
235
+ margin-bottom: 0 !important;
236
+ letter-spacing: -0.016em;
237
+ }
238
+
239
+ h3 {
240
+ letter-spacing: 0;
241
+ line-height: 24px;
242
+ font-size: 20px;
243
+ margin-top: 1.72em !important;
244
+ font-weight: 700;
245
+ }
246
+
247
+ h4 {
248
+ font-size: 1.3em;
249
+ }
250
+
251
+ h5 {
252
+ font-size: 1.2em;
253
+ }
254
+
255
+ h6 {
256
+ font-size: 1.1em;
257
+ }
258
+
259
+ p,
260
+ ul,
261
+ ol {
262
+ letter-spacing: -0.003em;
263
+ line-height: 32px;
264
+ font-size: 20px;
265
+ margin-top: 2.1em;
266
+ margin-bottom: 0px !important;
267
+ font-style: normal;
268
+ word-break: break-word;
269
+ font-weight: 400;
270
+ }
271
+
272
+ li {
273
+ margin-bottom: 0.5em;
274
+ }
275
+
276
+ pre {
277
+ font-size: 0.9em;
278
+ padding: 15px;
279
+ }
280
+
281
+ pre code,
282
+ code {
283
+ font-size: 0.9em;
284
+ }
285
+
286
+ blockquote {
287
+ font-size: 1.1em;
288
+ margin: 1.5em 0;
289
+ padding-left: 20px;
290
+ }
291
+
292
+ table {
293
+ font-size: 0.95em;
294
+ margin: 1.5em 0;
295
+ }
296
+
297
+ th,
298
+ td {
299
+ padding: 8px 12px;
300
+ }
301
+
302
+ img {
303
+ margin: 2em auto;
304
+ }
305
+
306
+ .jp-CodeCell {
307
+ margin-top: 56px !important;
308
+ }
309
+
310
+ .jp-CodeCell + .jp-OutputArea > .jp-OutputArea-child {
311
+ margin-top: 56px !important;
312
+ }
313
+ }
314
+ }
package/style/base.css CHANGED
@@ -1,3 +1,5 @@
1
+ /* Extension styles */
2
+
1
3
  .specta-loader-host {
2
4
  position: fixed;
3
5
  top: 0;
@@ -54,3 +56,126 @@
54
56
  .jp-specta-notebook-panel {
55
57
  overflow: auto;
56
58
  }
59
+
60
+ #specta-top-panel {
61
+ min-height: 40px;
62
+ display: flex;
63
+ box-shadow: unset !important;
64
+ z-index: 100;
65
+ }
66
+
67
+ .specta-topbar-element {
68
+ width: 100%;
69
+ display: flex;
70
+ }
71
+
72
+ .specta-topbar {
73
+ display: flex;
74
+ flex-direction: row;
75
+ height: 40px;
76
+ width: calc(100% + 20px);
77
+ box-shadow:
78
+ rgba(0 0 0 / 20%) 0 2px 4px -1px,
79
+ rgba(0 0 0 / 14%) 0 4px 5px 0,
80
+ rgba(0 0 0 / 12%) 0 1px 10px 0;
81
+ gap: 10px;
82
+ align-items: center;
83
+ justify-content: space-between;
84
+ padding: 0 1rem;
85
+ position: relative;
86
+ }
87
+
88
+ .specta-topbar-left {
89
+ display: flex;
90
+ align-items: center;
91
+ gap: 0.5rem;
92
+ }
93
+
94
+ .specta-topbar-right {
95
+ position: relative;
96
+ }
97
+
98
+ .specta-topbar-title {
99
+ line-height: 40px;
100
+ font-size: 1.5rem;
101
+ }
102
+
103
+ .specta-topbar-theme {
104
+ font-size: var(--jp-ui-font-size1) !important;
105
+ }
106
+
107
+ .specta-icon-button {
108
+ border-radius: 50% !important;
109
+ transition: background 0.2s ease;
110
+ background: transparent;
111
+ }
112
+ .specta-icon-button:hover {
113
+ background-color: var('--jp-layout-color3');
114
+ }
115
+
116
+ .specta-config-dialog {
117
+ position: absolute;
118
+ top: calc(100% + 8px);
119
+ right: 0;
120
+ border-radius: 8px;
121
+ z-index: 100;
122
+ resize: none;
123
+ overflow: unset;
124
+ background: var(--jp-layout-color2);
125
+ padding: 0 !important;
126
+ }
127
+
128
+ .specta-config-arrow {
129
+ position: absolute;
130
+ top: -8px;
131
+ right: 15px;
132
+ width: 0;
133
+ height: 0;
134
+ border-left: 8px solid transparent;
135
+ border-right: 8px solid transparent;
136
+ border-bottom: 8px solid var(--jp-layout-color2);
137
+ filter: drop-shadow(0 -1px 1px rgba(0, 0, 0, 0.1));
138
+ }
139
+
140
+ .specta-divider {
141
+ margin: 0px;
142
+ flex-shrink: 0;
143
+ border-width: 0px 0px thin;
144
+ border-style: solid;
145
+ border-color: var(--jp-border-color1);
146
+ padding: auto;
147
+ margin-bottom: 5px;
148
+ }
149
+
150
+ .skeleton {
151
+ position: relative;
152
+ overflow: hidden;
153
+ background-color: #e2e2e2; /* Light gray base */
154
+ border-radius: 4px;
155
+ }
156
+
157
+ .skeleton::after {
158
+ content: '';
159
+ position: absolute;
160
+ top: 0;
161
+ left: -150px;
162
+ height: 100%;
163
+ width: 150px;
164
+ background: linear-gradient(
165
+ 90deg,
166
+ transparent,
167
+ rgba(255, 255, 255, 0.4),
168
+ transparent
169
+ );
170
+ animation: shimmer 1.5s infinite;
171
+ }
172
+
173
+ @keyframes shimmer {
174
+ 100% {
175
+ transform: translateX(100%);
176
+ }
177
+ }
178
+
179
+ .invisible {
180
+ visibility: hidden;
181
+ }
package/style/index.css CHANGED
@@ -1 +1,3 @@
1
1
  @import url('base.css');
2
+ @import url('article.css');
3
+ @import url('skeleton.css');
package/style/index.js CHANGED
@@ -1 +1,3 @@
1
- import './base.css';
1
+ import './base.css';
2
+ import './article.css';
3
+ import './skeleton.css';
@@ -0,0 +1,87 @@
1
+ .skeleton-bar-chart.vertical {
2
+ display: flex;
3
+ align-items: flex-end;
4
+ gap: 8px;
5
+ height: 120px;
6
+ margin-bottom: 12px;
7
+ }
8
+
9
+ .vertical-bar {
10
+ flex: 1;
11
+ background-color: var(--jp-layout-color2);
12
+ border-radius: 4px 4px 0 0;
13
+ transform-origin: bottom;
14
+ animation: pulse-bar 1.5s infinite ease-in-out;
15
+ height: 40%;
16
+ }
17
+
18
+ @keyframes pulse-bar {
19
+ 0%,
20
+ 100% {
21
+ height: 40%;
22
+ }
23
+ 50% {
24
+ height: 90%;
25
+ }
26
+ }
27
+
28
+ .skeleton-line-chart {
29
+ width: 100%;
30
+ height: 150px;
31
+ background-color: var(--jp-layout-color1);
32
+ border: solid 4px var(--jp-layout-color2);
33
+ position: relative;
34
+ overflow: hidden;
35
+ border-radius: 8px;
36
+ margin-bottom: 12px;
37
+ }
38
+
39
+ .skeleton-line-chart svg {
40
+ width: 100%;
41
+ height: 100%;
42
+ }
43
+
44
+ .skeleton-line-chart polyline {
45
+ fill: none;
46
+ stroke: var(--jp-layout-color2);
47
+ stroke-width: 2;
48
+ stroke-linecap: round;
49
+ stroke-linejoin: round;
50
+ stroke-dasharray: 200;
51
+ stroke-dashoffset: 200;
52
+ animation: draw-line 1.5s ease-in-out infinite;
53
+ }
54
+
55
+ @keyframes shimmer {
56
+ 100% {
57
+ transform: translateX(200%);
58
+ }
59
+ }
60
+
61
+ @keyframes draw-line {
62
+ 0% {
63
+ stroke-dashoffset: 200;
64
+ }
65
+ 100% {
66
+ stroke-dashoffset: 0;
67
+ }
68
+ }
69
+
70
+ .skeleton-label {
71
+ position: absolute;
72
+ top: 50%;
73
+ left: 50%;
74
+ transform: translate(-50%, -50%);
75
+ font-size: 1.25rem;
76
+ font-weight: 400;
77
+ color: var(--jp-ui-font-color2);
78
+ opacity: 0.8;
79
+ pointer-events: none;
80
+ font-family: 'Work Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
81
+ }
82
+
83
+ .specta-cell-placeholder {
84
+ transition:
85
+ opacity 0.4s ease,
86
+ transform 0.4s ease;
87
+ }
package/style/style.css CHANGED
@@ -1,3 +1,5 @@
1
+ /* App only style */
2
+
1
3
  #jp-main-content-panel .jp-MainAreaWidget {
2
4
  background: var(--jp-layout-color1);
3
5
  }
@@ -6,9 +8,16 @@
6
8
  display: none;
7
9
  }
8
10
 
11
+ #specta-top-panel {
12
+ contain: unset !important;
13
+ box-shadow: unset !important;
14
+ z-index: 100;
15
+ }
16
+
9
17
  .specta-file-browser {
10
18
  max-width: 1200px;
11
19
  margin: 0 auto;
20
+ margin-top: 10px !important;
12
21
  padding: 50px 20px;
13
22
  background: var(--jp-layout-color3);
14
23
  }
@@ -23,7 +32,3 @@
23
32
  background: var(--jp-layout-color1);
24
33
  box-shadow: var(--jp-elevation-z4);
25
34
  }
26
-
27
- .jp-specta-notebook-panel {
28
- overflow: auto;
29
- }
File without changes