@difizen/libro-codemirror 0.0.2-alpha.0

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 (126) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +0 -0
  3. package/es/auto-complete/closebrackets.d.ts +12 -0
  4. package/es/auto-complete/closebrackets.d.ts.map +1 -0
  5. package/es/auto-complete/closebrackets.js +408 -0
  6. package/es/auto-complete/completion.d.ts +57 -0
  7. package/es/auto-complete/completion.d.ts.map +1 -0
  8. package/es/auto-complete/completion.js +265 -0
  9. package/es/auto-complete/config.d.ts +22 -0
  10. package/es/auto-complete/config.d.ts.map +1 -0
  11. package/es/auto-complete/config.js +44 -0
  12. package/es/auto-complete/filter.d.ts +13 -0
  13. package/es/auto-complete/filter.d.ts.map +1 -0
  14. package/es/auto-complete/filter.js +191 -0
  15. package/es/auto-complete/index.d.ts +17 -0
  16. package/es/auto-complete/index.d.ts.map +1 -0
  17. package/es/auto-complete/index.js +107 -0
  18. package/es/auto-complete/snippet.d.ts +14 -0
  19. package/es/auto-complete/snippet.d.ts.map +1 -0
  20. package/es/auto-complete/snippet.js +447 -0
  21. package/es/auto-complete/state.d.ts +63 -0
  22. package/es/auto-complete/state.d.ts.map +1 -0
  23. package/es/auto-complete/state.js +452 -0
  24. package/es/auto-complete/theme.d.ts +6 -0
  25. package/es/auto-complete/theme.d.ts.map +1 -0
  26. package/es/auto-complete/theme.js +151 -0
  27. package/es/auto-complete/tooltip.d.ts +5 -0
  28. package/es/auto-complete/tooltip.d.ts.map +1 -0
  29. package/es/auto-complete/tooltip.js +365 -0
  30. package/es/auto-complete/view.d.ts +43 -0
  31. package/es/auto-complete/view.d.ts.map +1 -0
  32. package/es/auto-complete/view.js +372 -0
  33. package/es/auto-complete/word.d.ts +3 -0
  34. package/es/auto-complete/word.d.ts.map +1 -0
  35. package/es/auto-complete/word.js +119 -0
  36. package/es/completion.d.ts +6 -0
  37. package/es/completion.d.ts.map +1 -0
  38. package/es/completion.js +84 -0
  39. package/es/config.d.ts +184 -0
  40. package/es/config.d.ts.map +1 -0
  41. package/es/config.js +473 -0
  42. package/es/editor.d.ts +361 -0
  43. package/es/editor.d.ts.map +1 -0
  44. package/es/editor.js +1126 -0
  45. package/es/factory.d.ts +3 -0
  46. package/es/factory.d.ts.map +1 -0
  47. package/es/factory.js +12 -0
  48. package/es/hyperlink.d.ts +15 -0
  49. package/es/hyperlink.d.ts.map +1 -0
  50. package/es/hyperlink.js +120 -0
  51. package/es/indent.d.ts +8 -0
  52. package/es/indent.d.ts.map +1 -0
  53. package/es/indent.js +58 -0
  54. package/es/indentation-markers/config.d.ts +17 -0
  55. package/es/indentation-markers/config.d.ts.map +1 -0
  56. package/es/indentation-markers/config.js +10 -0
  57. package/es/indentation-markers/index.d.ts +3 -0
  58. package/es/indentation-markers/index.d.ts.map +1 -0
  59. package/es/indentation-markers/index.js +160 -0
  60. package/es/indentation-markers/map.d.ts +77 -0
  61. package/es/indentation-markers/map.d.ts.map +1 -0
  62. package/es/indentation-markers/map.js +265 -0
  63. package/es/indentation-markers/utils.d.ts +27 -0
  64. package/es/indentation-markers/utils.d.ts.map +1 -0
  65. package/es/indentation-markers/utils.js +91 -0
  66. package/es/index.d.ts +11 -0
  67. package/es/index.d.ts.map +1 -0
  68. package/es/index.js +10 -0
  69. package/es/libro-icon.d.ts +3 -0
  70. package/es/libro-icon.d.ts.map +1 -0
  71. package/es/libro-icon.js +2 -0
  72. package/es/mimetype.d.ts +22 -0
  73. package/es/mimetype.d.ts.map +1 -0
  74. package/es/mimetype.js +59 -0
  75. package/es/mode.d.ts +86 -0
  76. package/es/mode.d.ts.map +1 -0
  77. package/es/mode.js +284 -0
  78. package/es/monitor.d.ts +32 -0
  79. package/es/monitor.d.ts.map +1 -0
  80. package/es/monitor.js +129 -0
  81. package/es/python-lang.d.ts +3 -0
  82. package/es/python-lang.d.ts.map +1 -0
  83. package/es/python-lang.js +7 -0
  84. package/es/style/base.css +131 -0
  85. package/es/style/theme.css +12 -0
  86. package/es/style/variables.css +403 -0
  87. package/es/theme.d.ts +35 -0
  88. package/es/theme.d.ts.map +1 -0
  89. package/es/theme.js +225 -0
  90. package/es/tooltip.d.ts +10 -0
  91. package/es/tooltip.d.ts.map +1 -0
  92. package/es/tooltip.js +170 -0
  93. package/package.json +74 -0
  94. package/src/auto-complete/README.md +71 -0
  95. package/src/auto-complete/closebrackets.ts +423 -0
  96. package/src/auto-complete/completion.ts +345 -0
  97. package/src/auto-complete/config.ts +101 -0
  98. package/src/auto-complete/filter.ts +215 -0
  99. package/src/auto-complete/index.ts +112 -0
  100. package/src/auto-complete/snippet.ts +394 -0
  101. package/src/auto-complete/state.ts +472 -0
  102. package/src/auto-complete/theme.ts +126 -0
  103. package/src/auto-complete/tooltip.ts +386 -0
  104. package/src/auto-complete/view.ts +343 -0
  105. package/src/auto-complete/word.ts +118 -0
  106. package/src/completion.ts +61 -0
  107. package/src/config.ts +689 -0
  108. package/src/editor.ts +1078 -0
  109. package/src/factory.ts +10 -0
  110. package/src/hyperlink.ts +95 -0
  111. package/src/indent.ts +69 -0
  112. package/src/indentation-markers/config.ts +31 -0
  113. package/src/indentation-markers/index.ts +192 -0
  114. package/src/indentation-markers/map.ts +273 -0
  115. package/src/indentation-markers/utils.ts +84 -0
  116. package/src/index.ts +11 -0
  117. package/src/libro-icon.ts +4 -0
  118. package/src/mimetype.ts +49 -0
  119. package/src/mode.ts +269 -0
  120. package/src/monitor.ts +105 -0
  121. package/src/python-lang.ts +7 -0
  122. package/src/style/base.css +129 -0
  123. package/src/style/theme.css +12 -0
  124. package/src/style/variables.css +405 -0
  125. package/src/theme.ts +231 -0
  126. package/src/tooltip.ts +145 -0
@@ -0,0 +1,403 @@
1
+ /*
2
+ The following CSS variables define the main, public API for styling JupyterLab.
3
+ These variables should be used by all plugins wherever possible. In other
4
+ words, plugins should not define custom colors, sizes, etc unless absolutely
5
+ necessary. This enables users to change the visual theme of JupyterLab
6
+ by changing these variables.
7
+
8
+ Many variables appear in an ordered sequence (0,1,2,3). These sequences
9
+ are designed to work well together, so for example, `--jp-border-color1` should
10
+ be used with `--jp-layout-color1`. The numbers have the following meanings:
11
+
12
+ * 0: super-primary, reserved for special emphasis
13
+ * 1: primary, most important under normal situations
14
+ * 2: secondary, next most important under normal situations
15
+ * 3: tertiary, next most important under normal situations
16
+
17
+ Throughout JupyterLab, we are mostly following principles from Google's
18
+ Material Design when selecting colors. We are not, however, following
19
+ all of MD as it is not optimized for dense, information rich UIs.
20
+ */
21
+
22
+ :root {
23
+ /* Elevation
24
+ *
25
+ * We style box-shadows using Material Design's idea of elevation. These particular numbers are taken from here:
26
+ *
27
+ * https://github.com/material-components/material-components-web
28
+ * https://material-components-web.appspot.com/elevation.html
29
+ */
30
+
31
+ --jp-shadow-base-lightness: 0;
32
+ --jp-shadow-umbra-color: rgba(
33
+ var(--jp-shadow-base-lightness),
34
+ var(--jp-shadow-base-lightness),
35
+ var(--jp-shadow-base-lightness),
36
+ 20%
37
+ );
38
+ --jp-shadow-penumbra-color: rgba(
39
+ var(--jp-shadow-base-lightness),
40
+ var(--jp-shadow-base-lightness),
41
+ var(--jp-shadow-base-lightness),
42
+ 14%
43
+ );
44
+ --jp-shadow-ambient-color: rgba(
45
+ var(--jp-shadow-base-lightness),
46
+ var(--jp-shadow-base-lightness),
47
+ var(--jp-shadow-base-lightness),
48
+ 12%
49
+ );
50
+ --jp-elevation-z0: none;
51
+ --jp-elevation-z1: 0 2px 1px -1px var(--jp-shadow-umbra-color),
52
+ 0 1px 1px 0 var(--jp-shadow-penumbra-color),
53
+ 0 1px 3px 0 var(--jp-shadow-ambient-color);
54
+ --jp-elevation-z2: 0 3px 1px -2px var(--jp-shadow-umbra-color),
55
+ 0 2px 2px 0 var(--jp-shadow-penumbra-color),
56
+ 0 1px 5px 0 var(--jp-shadow-ambient-color);
57
+ --jp-elevation-z4: 0 2px 4px -1px var(--jp-shadow-umbra-color),
58
+ 0 4px 5px 0 var(--jp-shadow-penumbra-color),
59
+ 0 1px 10px 0 var(--jp-shadow-ambient-color);
60
+ --jp-elevation-z6: 0 3px 5px -1px var(--jp-shadow-umbra-color),
61
+ 0 6px 10px 0 var(--jp-shadow-penumbra-color),
62
+ 0 1px 18px 0 var(--jp-shadow-ambient-color);
63
+ --jp-elevation-z8: 0 5px 5px -3px var(--jp-shadow-umbra-color),
64
+ 0 8px 10px 1px var(--jp-shadow-penumbra-color),
65
+ 0 3px 14px 2px var(--jp-shadow-ambient-color);
66
+ --jp-elevation-z12: 0 7px 8px -4px var(--jp-shadow-umbra-color),
67
+ 0 12px 17px 2px var(--jp-shadow-penumbra-color),
68
+ 0 5px 22px 4px var(--jp-shadow-ambient-color);
69
+ --jp-elevation-z16: 0 8px 10px -5px var(--jp-shadow-umbra-color),
70
+ 0 16px 24px 2px var(--jp-shadow-penumbra-color),
71
+ 0 6px 30px 5px var(--jp-shadow-ambient-color);
72
+ --jp-elevation-z20: 0 10px 13px -6px var(--jp-shadow-umbra-color),
73
+ 0 20px 31px 3px var(--jp-shadow-penumbra-color),
74
+ 0 8px 38px 7px var(--jp-shadow-ambient-color);
75
+ --jp-elevation-z24: 0 11px 15px -7px var(--jp-shadow-umbra-color),
76
+ 0 24px 38px 3px var(--jp-shadow-penumbra-color),
77
+ 0 9px 46px 8px var(--jp-shadow-ambient-color);
78
+
79
+ /* Borders
80
+ *
81
+ * The following variables, specify the visual styling of borders in JupyterLab.
82
+ */
83
+
84
+ --jp-border-width: 1px;
85
+ --jp-border-color0: var(--md-grey-400);
86
+ --jp-border-color1: var(--md-grey-400);
87
+ --jp-border-color2: var(--md-grey-300);
88
+ --jp-border-color3: var(--md-grey-200);
89
+ --jp-inverse-border-color: var(--md-grey-600);
90
+ --jp-border-radius: 2px;
91
+
92
+ /* UI Fonts
93
+ *
94
+ * The UI font CSS variables are used for the typography all of the JupyterLab
95
+ * user interface elements that are not directly user generated content.
96
+ *
97
+ * The font sizing here is done assuming that the body font size of --jp-ui-font-size1
98
+ * is applied to a parent element. When children elements, such as headings, are sized
99
+ * in em all things will be computed relative to that body size.
100
+ */
101
+
102
+ --jp-ui-font-scale-factor: 1.2;
103
+ --jp-ui-font-size0: 0.83333em;
104
+ --jp-ui-font-size1: 13px; /* Base font size */
105
+ --jp-ui-font-size2: 1.2em;
106
+ --jp-ui-font-size3: 1.44em;
107
+ --jp-ui-font-family: system-ui, -apple-system, blinkmacsystemfont, 'Segoe UI',
108
+ helvetica, arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
109
+ 'Segoe UI Symbol';
110
+
111
+ /*
112
+ * Use these font colors against the corresponding main layout colors.
113
+ * In a light theme, these go from dark to light.
114
+ */
115
+
116
+ /* Defaults use Material Design specification */
117
+ --jp-ui-font-color0: rgba(0, 0, 0, 100%);
118
+ --jp-ui-font-color1: rgba(0, 0, 0, 87%);
119
+ --jp-ui-font-color2: rgba(0, 0, 0, 54%);
120
+ --jp-ui-font-color3: rgba(0, 0, 0, 38%);
121
+
122
+ /*
123
+ * Use these against the brand/accent/warn/error colors.
124
+ * These will typically go from light to darker, in both a dark and light theme.
125
+ */
126
+
127
+ --jp-ui-inverse-font-color0: rgba(255, 255, 255, 100%);
128
+ --jp-ui-inverse-font-color1: rgba(255, 255, 255, 100%);
129
+ --jp-ui-inverse-font-color2: rgba(255, 255, 255, 70%);
130
+ --jp-ui-inverse-font-color3: rgba(255, 255, 255, 50%);
131
+
132
+ /* Content Fonts
133
+ *
134
+ * Content font variables are used for typography of user generated content.
135
+ *
136
+ * The font sizing here is done assuming that the body font size of --jp-content-font-size1
137
+ * is applied to a parent element. When children elements, such as headings, are sized
138
+ * in em all things will be computed relative to that body size.
139
+ */
140
+
141
+ --jp-content-line-height: 1.6;
142
+ --jp-content-font-scale-factor: 1.2;
143
+ --jp-content-font-size0: 0.83333em;
144
+ --jp-content-font-size1: 14px; /* Base font size */
145
+ --jp-content-font-size2: 1.2em;
146
+ --jp-content-font-size3: 1.44em;
147
+ --jp-content-font-size4: 1.728em;
148
+ --jp-content-font-size5: 2.0736em;
149
+
150
+ /* This gives a magnification of about 125% in presentation mode over normal. */
151
+ --jp-content-presentation-font-size1: 17px;
152
+ --jp-content-heading-line-height: 1;
153
+ --jp-content-heading-margin-top: 1.2em;
154
+ --jp-content-heading-margin-bottom: 0.8em;
155
+ --jp-content-heading-font-weight: 500;
156
+
157
+ /* Defaults use Material Design specification */
158
+ --jp-content-font-color0: rgba(0, 0, 0, 100%);
159
+ --jp-content-font-color1: rgba(0, 0, 0, 87%);
160
+ --jp-content-font-color2: rgba(0, 0, 0, 54%);
161
+ --jp-content-font-color3: rgba(0, 0, 0, 38%);
162
+ --jp-content-link-color: var(--md-blue-700);
163
+ --jp-content-font-family: system-ui, -apple-system, blinkmacsystemfont, 'Segoe UI',
164
+ helvetica, arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
165
+ 'Segoe UI Symbol';
166
+
167
+ /*
168
+ * Code Fonts
169
+ *
170
+ * Code font variables are used for typography of code and other monospaces content.
171
+ */
172
+
173
+ --jp-code-font-size: 14px;
174
+ --jp-code-line-height: 20px; /* 17px for 13px base */
175
+ --jp-code-padding: 5px; /* 5px for 13px base, codemirror highlighting needs integer px value */
176
+ --jp-code-font-family-default: menlo-regular, consolas, 'DejaVu Sans Mono', monospace;
177
+ --jp-code-font-family: var(--jp-code-font-family-default);
178
+
179
+ /* This gives a magnification of about 125% in presentation mode over normal. */
180
+ --jp-code-presentation-font-size: 16px;
181
+
182
+ /* may need to tweak cursor width if you change font size */
183
+ --jp-code-cursor-width0: 1.4px;
184
+ --jp-code-cursor-width1: 2px;
185
+ --jp-code-cursor-width2: 4px;
186
+
187
+ /* Layout
188
+ *
189
+ * The following are the main layout colors use in JupyterLab. In a light
190
+ * theme these would go from light to dark.
191
+ */
192
+
193
+ --jp-layout-color0: transparent;
194
+ --jp-layout-color1: white;
195
+ --jp-layout-color2: var(--md-grey-200);
196
+ --jp-layout-color3: var(--md-grey-400);
197
+ --jp-layout-color4: var(--md-grey-600);
198
+
199
+ /* Inverse Layout
200
+ *
201
+ * The following are the inverse layout colors use in JupyterLab. In a light
202
+ * theme these would go from dark to light.
203
+ */
204
+
205
+ --jp-inverse-layout-color0: #111;
206
+ --jp-inverse-layout-color1: var(--md-grey-900);
207
+ --jp-inverse-layout-color2: var(--md-grey-800);
208
+ --jp-inverse-layout-color3: var(--md-grey-700);
209
+ --jp-inverse-layout-color4: var(--md-grey-600);
210
+
211
+ /* Brand/accent */
212
+
213
+ --jp-brand-color0: var(--md-blue-900);
214
+ --jp-brand-color1: var(--md-blue-700);
215
+ --jp-brand-color2: var(--md-blue-300);
216
+ --jp-brand-color3: var(--md-blue-100);
217
+ --jp-brand-color4: var(--md-blue-50);
218
+ --jp-accent-color0: var(--md-green-900);
219
+ --jp-accent-color1: var(--md-green-700);
220
+ --jp-accent-color2: var(--md-green-300);
221
+ --jp-accent-color3: var(--md-green-100);
222
+
223
+ /* State colors (warn, error, success, info) */
224
+
225
+ --jp-warn-color0: var(--md-orange-900);
226
+ --jp-warn-color1: var(--md-orange-700);
227
+ --jp-warn-color2: var(--md-orange-300);
228
+ --jp-warn-color3: var(--md-orange-100);
229
+ --jp-error-color0: var(--md-red-900);
230
+ --jp-error-color1: var(--md-red-700);
231
+ --jp-error-color2: var(--md-red-300);
232
+ --jp-error-color3: var(--md-red-100);
233
+ --jp-success-color0: var(--md-green-900);
234
+ --jp-success-color1: var(--md-green-700);
235
+ --jp-success-color2: var(--md-green-300);
236
+ --jp-success-color3: var(--md-green-100);
237
+ --jp-info-color0: var(--md-cyan-900);
238
+ --jp-info-color1: var(--md-cyan-700);
239
+ --jp-info-color2: var(--md-cyan-300);
240
+ --jp-info-color3: var(--md-cyan-100);
241
+
242
+ /* Cell specific styles */
243
+
244
+ --jp-cell-padding: 5px;
245
+ --jp-cell-collapser-width: 8px;
246
+ --jp-cell-collapser-min-height: 20px;
247
+ --jp-cell-collapser-not-active-hover-opacity: 0.6;
248
+ --jp-cell-editor-background: var(--md-grey-100);
249
+ --jp-cell-editor-border-color: var(--md-grey-300);
250
+ --jp-cell-editor-box-shadow: inset 0 0 2px var(--md-blue-300);
251
+ --jp-cell-editor-active-background: var(--jp-layout-color0);
252
+ --jp-cell-editor-active-border-color: var(--jp-brand-color1);
253
+ --jp-cell-prompt-width: 64px;
254
+ --jp-cell-prompt-font-family: var(--jp-code-font-family-default);
255
+ --jp-cell-prompt-letter-spacing: 0;
256
+ --jp-cell-prompt-opacity: 1;
257
+ --jp-cell-prompt-not-active-opacity: 0.5;
258
+ --jp-cell-prompt-not-active-font-color: var(--md-grey-700);
259
+
260
+ /* A custom blend of MD grey and blue 600
261
+ * See https://meyerweb.com/eric/tools/color-blend/#546E7A:1E88E5:5:hex */
262
+ --jp-cell-inprompt-font-color: #307fc1;
263
+
264
+ /* A custom blend of MD grey and orange 600
265
+ * https://meyerweb.com/eric/tools/color-blend/#546E7A:F4511E:5:hex */
266
+ --jp-cell-outprompt-font-color: #bf5b3d;
267
+
268
+ /* Notebook specific styles */
269
+
270
+ --jp-notebook-padding: 10px;
271
+ --jp-notebook-select-background: var(--jp-layout-color1);
272
+ --jp-notebook-multiselected-color: var(--md-blue-50);
273
+
274
+ /* The scroll padding is calculated to fill enough space at the bottom of the
275
+ notebook to show one single-line cell (with appropriate padding) at the top
276
+ when the notebook is scrolled all the way to the bottom. We also subtract one
277
+ pixel so that no scrollbar appears if we have just one single-line cell in the
278
+ notebook. This padding is to enable a 'scroll past end' feature in a notebook.
279
+ */
280
+ --jp-notebook-scroll-padding: calc(
281
+ 100% - var(--jp-code-font-size) * var(--jp-code-line-height) -
282
+ var(--jp-code-padding) - var(--jp-cell-padding) - 1px
283
+ );
284
+
285
+ /* Rendermime styles */
286
+
287
+ --jp-rendermime-error-background: #fdd;
288
+ --jp-rendermime-table-row-background: var(--md-grey-100);
289
+ --jp-rendermime-table-row-hover-background: var(--md-light-blue-50);
290
+
291
+ /* Dialog specific styles */
292
+
293
+ --jp-dialog-background: rgba(0, 0, 0, 25%);
294
+
295
+ /* Console specific styles */
296
+
297
+ --jp-console-padding: 10px;
298
+
299
+ /* Toolbar specific styles */
300
+
301
+ --jp-toolbar-border-color: var(--jp-border-color1);
302
+ --jp-toolbar-micro-height: 8px;
303
+ --jp-toolbar-background: var(--jp-layout-color1);
304
+ --jp-toolbar-box-shadow: 0 0 2px 0 rgba(0, 0, 0, 24%);
305
+ --jp-toolbar-header-margin: 4px 4px 0 4px;
306
+ --jp-toolbar-active-background: var(--md-grey-300);
307
+
308
+ /* Statusbar specific styles */
309
+
310
+ --jp-statusbar-height: 24px;
311
+
312
+ /* Input field styles */
313
+
314
+ --jp-input-box-shadow: inset 0 0 2px var(--md-blue-300);
315
+ --jp-input-active-background: var(--jp-layout-color1);
316
+ --jp-input-hover-background: var(--jp-layout-color1);
317
+ --jp-input-background: var(--md-grey-100);
318
+ --jp-input-border-color: var(--jp-inverse-border-color);
319
+ --jp-input-active-border-color: var(--jp-brand-color1);
320
+ --jp-input-active-box-shadow-color: rgba(19, 124, 189, 30%);
321
+
322
+ /* General editor styles */
323
+
324
+ --jp-editor-selected-background: #b4ceff;
325
+ --jp-editor-selected-focused-background: #b9d1ff;
326
+ --jp-editor-cursor-color: var(--jp-ui-font-color0);
327
+
328
+ /* Code mirror specific styles */
329
+
330
+ --jp-mirror-editor-keyword-color: #0b8658;
331
+ --jp-mirror-editor-atom-color: #88f;
332
+ --jp-mirror-editor-number-color: #0b8658;
333
+ --jp-mirror-editor-def-color: #00f;
334
+ --jp-mirror-editor-variable-color: var(--md-grey-900);
335
+ --jp-mirror-editor-variable-2-color: #2260a0;
336
+ --jp-mirror-editor-variable-3-color: #085;
337
+ --jp-mirror-editor-punctuation-color: #2260a0;
338
+ --jp-mirror-editor-property-color: #2260a0;
339
+ --jp-mirror-editor-operator-color: #c702c7;
340
+ --jp-mirror-editor-comment-color: #408080;
341
+ --jp-mirror-editor-string-color: #ba2121;
342
+ --jp-mirror-editor-string-2-color: #708;
343
+ --jp-mirror-editor-meta-color: #c702c7;
344
+ --jp-mirror-editor-qualifier-color: #555;
345
+ --jp-mirror-editor-builtin-color: #0b8658;
346
+ --jp-mirror-editor-bracket-color: #997;
347
+ --jp-mirror-editor-tag-color: #170;
348
+ --jp-mirror-editor-attribute-color: #00c;
349
+ --jp-mirror-editor-header-color: blue;
350
+ --jp-mirror-editor-quote-color: #090;
351
+ --jp-mirror-editor-link-color: #00c;
352
+ --jp-mirror-editor-error-color: #f00;
353
+ --jp-mirror-editor-hr-color: #999;
354
+
355
+ /*
356
+ RTC user specific colors.
357
+ These colors are used for the cursor, username in the editor,
358
+ and the icon of the user.
359
+ */
360
+
361
+ --jp-collaborator-color1: #ffad8e;
362
+ --jp-collaborator-color2: #dac83d;
363
+ --jp-collaborator-color3: #72dd76;
364
+ --jp-collaborator-color4: #00e4d0;
365
+ --jp-collaborator-color5: #45d4ff;
366
+ --jp-collaborator-color6: #e2b1ff;
367
+ --jp-collaborator-color7: #ff9de6;
368
+
369
+ /* Vega extension styles */
370
+
371
+ --jp-vega-background: white;
372
+
373
+ /* Sidebar-related styles */
374
+
375
+ --jp-sidebar-min-width: 250px;
376
+
377
+ /* Search-related styles */
378
+
379
+ --jp-search-toggle-off-opacity: 0.5;
380
+ --jp-search-toggle-hover-opacity: 0.8;
381
+ --jp-search-toggle-on-opacity: 1;
382
+ --jp-search-selected-match-background-color: rgb(245, 200, 0);
383
+ --jp-search-selected-match-color: black;
384
+ --jp-search-unselected-match-background-color: var(--jp-inverse-layout-color0);
385
+ --jp-search-unselected-match-color: var(--jp-ui-inverse-font-color0);
386
+
387
+ /* Icon colors that work well with light or dark backgrounds */
388
+ --jp-icon-contrast-color0: var(--md-purple-600);
389
+ --jp-icon-contrast-color1: var(--md-green-600);
390
+ --jp-icon-contrast-color2: var(--md-pink-600);
391
+ --jp-icon-contrast-color3: var(--md-blue-600);
392
+
393
+ /* Button colors */
394
+ --jp-accept-color-normal: var(--md-blue-700);
395
+ --jp-accept-color-hover: var(--md-blue-800);
396
+ --jp-accept-color-active: var(--md-blue-900);
397
+ --jp-warn-color-normal: var(--md-red-700);
398
+ --jp-warn-color-hover: var(--md-red-800);
399
+ --jp-warn-color-active: var(--md-red-900);
400
+ --jp-reject-color-normal: var(--md-grey-600);
401
+ --jp-reject-color-hover: var(--md-grey-700);
402
+ --jp-reject-color-active: var(--md-grey-800);
403
+ }
package/es/theme.d.ts ADDED
@@ -0,0 +1,35 @@
1
+ import { HighlightStyle } from '@codemirror/language';
2
+ import type { Extension } from '@codemirror/state';
3
+ export declare const jupyterEditorTheme: Extension;
4
+ export declare const jupyterHighlightStyle: HighlightStyle;
5
+ /**
6
+ * JupyterLab CodeMirror 6 theme
7
+ */
8
+ export declare const jupyterTheme: Extension;
9
+ /**
10
+ * Get the default CodeMirror 6 theme for JupyterLab
11
+ *
12
+ * @alpha
13
+ * @returns Default theme
14
+ */
15
+ export declare function defaultTheme(): Extension;
16
+ /**
17
+ * Register a new theme.
18
+ *
19
+ * @alpha
20
+ * @param name Theme name
21
+ * @param theme Codemirror 6 theme extension
22
+ */
23
+ export declare function registerTheme(name: string, theme: Extension): void;
24
+ /**
25
+ * Get a theme.
26
+ *
27
+ * #### Notes
28
+ * It falls back to the default theme
29
+ *
30
+ * @alpha
31
+ * @param name Theme name
32
+ * @returns Theme extension
33
+ */
34
+ export declare function getTheme(name: string): Extension;
35
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../src/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EAEf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAInD,eAAO,MAAM,kBAAkB,WA0G7B,CAAC;AAEH,eAAO,MAAM,qBAAqB,gBAuDhC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,YAAY,EAAE,SAG1B,CAAC;AAeF;;;;;GAKG;AACH,wBAAgB,YAAY,IAAI,SAAS,CAExC;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,QAE3D;AAED;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAIhD"}
package/es/theme.js ADDED
@@ -0,0 +1,225 @@
1
+ import { defaultHighlightStyle, HighlightStyle, syntaxHighlighting } from '@codemirror/language';
2
+ import { EditorView } from '@codemirror/view';
3
+ import { tags as t } from '@lezer/highlight';
4
+ export var jupyterEditorTheme = EditorView.theme({
5
+ /**
6
+ * CodeMirror themes are handling the background/color in this way. This works
7
+ * fine for CodeMirror editors outside the notebook, but the notebook styles
8
+ * these things differently.
9
+ */
10
+ '&': {
11
+ background: 'var(--jp-layout-color0)',
12
+ color: 'var(--mana-libro-text-default-color)'
13
+ },
14
+ /* In the notebook, we want this styling to be handled by its container */
15
+ '.jp-CodeConsole &, .jp-Notebook &': {
16
+ background: 'transparent'
17
+ },
18
+ '.cm-content': {
19
+ caretColor: 'var(--jp-editor-cursor-color)'
20
+ },
21
+ '.cm-cursor, .cm-dropCursor': {
22
+ borderLeft: 'var(--jp-code-cursor-width0) solid var(--mana-libro-editor-cursor-color)'
23
+ },
24
+ '.cm-selectionBackground, .cm-content ::selection': {
25
+ color: 'unset',
26
+ backgroundColor: 'var(--mana-libro-editor-selection-color) !important'
27
+ },
28
+ '&.cm-focused .cm-selectionBackground': {
29
+ backgroundColor: 'var(--mana-libro-editor-selection-color) !important'
30
+ },
31
+ '.cm-gutters': {
32
+ borderRight: 'unset',
33
+ backgroundColor: 'var(--mana-libro-input-background)',
34
+ // paddingBottom: '15px',
35
+ color: 'var(--mana-libro-editor-gutter-number-color)',
36
+ fontFamily: 'var(--jp-code-font-family-default)',
37
+ fontWeight: '400',
38
+ fontSize: '13px',
39
+ lineHeight: '20px'
40
+ },
41
+ '.cm-foldGutter .cm-gutterElement': {
42
+ width: '20px',
43
+ paddingRight: '8px',
44
+ display: 'flex',
45
+ justifyContent: 'center',
46
+ alignItems: 'center'
47
+ },
48
+ '.cm-line': {
49
+ paddingLeft: '1px'
50
+ },
51
+ '.cm-activeLineGutter': {
52
+ backgroundColor: 'var(--mana-libro-editor-activeline-color) !important'
53
+ },
54
+ '.cm-lineNumbers .cm-gutterElement': {
55
+ padding: '0 0 0 16px',
56
+ minWidth: '32px'
57
+ },
58
+ 'cm-selectionMatch': {
59
+ backgroundColor: 'var(--mana-libro-editor-selectionMatch-color)'
60
+ },
61
+ '.cm-activeLine': {
62
+ backgroundColor: 'var(--mana-libro-editor-activeline-color)'
63
+ },
64
+ '.cm-scroller': {
65
+ fontFamily: 'var(--jp-code-font-family-default)',
66
+ fontWeight: '400',
67
+ fontSize: '13px',
68
+ letterSpacing: '0',
69
+ lineHeight: '20px'
70
+ },
71
+ // '.cm-editor': {
72
+ // paddingTop: '24px',
73
+ // },
74
+
75
+ '.cm-searchMatch': {
76
+ backgroundColor: 'var(--jp-search-unselected-match-background-color)',
77
+ color: 'var(--jp-search-unselected-match-color)'
78
+ },
79
+ '.cm-searchMatch span': {
80
+ backgroundColor: 'var(--jp-search-unselected-match-background-color)',
81
+ color: 'var(--jp-search-unselected-match-color)'
82
+ },
83
+ '.cm-searchMatch.cm-searchMatch-selected': {
84
+ backgroundColor: 'var(--jp-search-selected-match-background-color) !important',
85
+ color: 'var(--jp-search-selected-match-color) !important'
86
+ },
87
+ '.cm-searchMatch.cm-searchMatch-selected span': {
88
+ backgroundColor: 'var(--jp-search-selected-match-background-color) !important',
89
+ color: 'var(--jp-search-selected-match-color) !important'
90
+ }
91
+
92
+ // '.cm-content, .cm-gutter': { minHeight: '30px' },
93
+ });
94
+
95
+ export var jupyterHighlightStyle = HighlightStyle.define([
96
+ // Order matters - a rule will override the previous ones; important for example for in headings styles.
97
+ {
98
+ tag: t.meta,
99
+ color: 'var(--jp-mirror-editor-meta-color)'
100
+ }, {
101
+ tag: t.heading,
102
+ color: 'var(--jp-mirror-editor-header-color)'
103
+ }, {
104
+ tag: [t.heading1, t.heading2, t.heading3, t.heading4],
105
+ color: 'var(--jp-mirror-editor-header-color)',
106
+ fontWeight: 'bold'
107
+ }, {
108
+ tag: t.keyword,
109
+ color: 'var(--mana-libro-editor-keyword-color)',
110
+ fontWeight: 'bold'
111
+ }, {
112
+ tag: t.atom,
113
+ color: 'var(--mana-libro-editor-atom-color)'
114
+ }, {
115
+ tag: t.number,
116
+ color: 'var(--mana-libro-editor-number-color)'
117
+ }, {
118
+ tag: [t.definition(t.name), t.function(t.definition(t.variableName))],
119
+ color: 'var(--mana-libro-editor-def-color)'
120
+ }, {
121
+ tag: t.variableName,
122
+ color: 'var(--mana-libro-editor-variable-color)'
123
+ }, {
124
+ tag: [t.special(t.variableName), t.self],
125
+ color: 'var(--mana-libro-editor-variable-2-color)'
126
+ }, {
127
+ tag: t.punctuation,
128
+ color: 'var(--mana-libro-editor-punctuation-color)'
129
+ }, {
130
+ tag: t.propertyName,
131
+ color: 'var(--mana-libro-editor-property-color)'
132
+ }, {
133
+ tag: t.operator,
134
+ color: 'var(--mana-libro-editor-operator-color)',
135
+ fontWeight: 'bold'
136
+ }, {
137
+ tag: t.comment,
138
+ color: 'var(--mana-libro-editor-comment-color)',
139
+ fontStyle: 'italic'
140
+ }, {
141
+ tag: t.string,
142
+ color: 'var(--mana-libro-editor-string-color)'
143
+ }, {
144
+ tag: [t.labelName, t.monospace, t.special(t.string)],
145
+ color: 'var(--jp-mirror-editor-string-2-color)'
146
+ }, {
147
+ tag: t.bracket,
148
+ color: 'var(--jp-mirror-editor-bracket-color)'
149
+ }, {
150
+ tag: t.tagName,
151
+ color: 'var(--jp-mirror-editor-tag-color)'
152
+ }, {
153
+ tag: t.attributeName,
154
+ color: 'var(--jp-mirror-editor-attribute-color)'
155
+ }, {
156
+ tag: t.quote,
157
+ color: 'var(--jp-mirror-editor-quote-color)'
158
+ }, {
159
+ tag: t.link,
160
+ color: 'var(--jp-mirror-editor-link-color)',
161
+ textDecoration: 'underline'
162
+ }, {
163
+ tag: [t.separator, t.derefOperator, t.paren],
164
+ color: ''
165
+ }, {
166
+ tag: t.strong,
167
+ fontWeight: 'bold'
168
+ }, {
169
+ tag: t.emphasis,
170
+ fontStyle: 'italic'
171
+ }, {
172
+ tag: t.strikethrough,
173
+ textDecoration: 'line-through'
174
+ }]);
175
+
176
+ /**
177
+ * JupyterLab CodeMirror 6 theme
178
+ */
179
+ export var jupyterTheme = [jupyterEditorTheme, syntaxHighlighting(jupyterHighlightStyle)];
180
+
181
+ /**
182
+ * A namespace to handle CodeMirror 6 theme
183
+ *
184
+ * @alpha
185
+ */
186
+ /**
187
+ * CodeMirror 6 themes
188
+ */
189
+ var themeMap = new Map([['codemirror', [EditorView.baseTheme({}), syntaxHighlighting(defaultHighlightStyle)]], ['jupyter', jupyterTheme]]);
190
+
191
+ /**
192
+ * Get the default CodeMirror 6 theme for JupyterLab
193
+ *
194
+ * @alpha
195
+ * @returns Default theme
196
+ */
197
+ export function defaultTheme() {
198
+ return themeMap.get('jupyter');
199
+ }
200
+
201
+ /**
202
+ * Register a new theme.
203
+ *
204
+ * @alpha
205
+ * @param name Theme name
206
+ * @param theme Codemirror 6 theme extension
207
+ */
208
+ export function registerTheme(name, theme) {
209
+ themeMap.set(name, theme);
210
+ }
211
+
212
+ /**
213
+ * Get a theme.
214
+ *
215
+ * #### Notes
216
+ * It falls back to the default theme
217
+ *
218
+ * @alpha
219
+ * @param name Theme name
220
+ * @returns Theme extension
221
+ */
222
+ export function getTheme(name) {
223
+ var ext = themeMap.get(name);
224
+ return ext !== null && ext !== void 0 ? ext : defaultTheme();
225
+ }
@@ -0,0 +1,10 @@
1
+ import { StateField } from '@codemirror/state';
2
+ import type { Command, KeyBinding, Tooltip } from '@codemirror/view';
3
+ import type { TooltipProvider } from '@difizen/libro-code-editor';
4
+ export declare const startTooltipEffect: import("@codemirror/state").StateEffectType<boolean>;
5
+ export declare const closeTooltipEffect: import("@codemirror/state").StateEffectType<null>;
6
+ export declare const startTooltip: Command;
7
+ export declare const closeTooltip: Command;
8
+ export declare const tooltipKeymap: readonly KeyBinding[];
9
+ export declare function tabTooltip(tooltipProvider: TooltipProvider | undefined): (import("@codemirror/state").Extension | StateField<Tooltip | null>)[];
10
+ //# sourceMappingURL=tooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../src/tooltip.ts"],"names":[],"mappings":"AAEA,OAAO,EAAe,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE5D,OAAO,KAAK,EACV,OAAO,EACP,UAAU,EAEV,OAAO,EAER,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAIlE,eAAO,MAAM,kBAAkB,sDAAgC,CAAC;AAChE,eAAO,MAAM,kBAAkB,mDAA6B,CAAC;AAsD7D,eAAO,MAAM,YAAY,EAAE,OAG1B,CAAC;AAGF,eAAO,MAAM,YAAY,EAAE,OAG1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,SAAS,UAAU,EAG9C,CAAC;AAyDF,wBAAgB,UAAU,CAAC,eAAe,EAAE,eAAe,GAAG,SAAS,0EAEtE"}