1 | import { Token } from '@lumino/coreutils';
|
2 | import '../style/index.css';
|
3 | export var TextKind;
|
4 | (function (TextKind) {
|
5 | TextKind["code"] = "code";
|
6 | TextKind["content"] = "content";
|
7 | })(TextKind || (TextKind = {}));
|
8 | export const KIND_LABELS = {
|
9 | code: 'Code',
|
10 | content: 'Content'
|
11 | };
|
12 | export var FontFormat;
|
13 | (function (FontFormat) {
|
14 | FontFormat["woff2"] = "woff2";
|
15 | FontFormat["woff"] = "woff";
|
16 | })(FontFormat || (FontFormat = {}));
|
17 | export const FONT_FORMATS = {
|
18 | woff2: 'font/woff2',
|
19 | woff: 'font/woff'
|
20 | };
|
21 | export const CMD = {
|
22 | code: {
|
23 | fontSize: 'code-font-size',
|
24 | fontFamily: 'code-font-family',
|
25 | lineHeight: 'code-line-height'
|
26 | },
|
27 | content: {
|
28 | fontSize: 'content-font-size',
|
29 | fontFamily: 'content-font-family',
|
30 | lineHeight: 'content-line-height'
|
31 | },
|
32 | editFonts: 'font-editor:open',
|
33 | customFonts: {
|
34 | disable: 'custom-fonts:disable',
|
35 | enable: 'custom-fonts:enable'
|
36 | }
|
37 | };
|
38 | export const ROOT = ':root';
|
39 | export const CSS = {
|
40 | code: {
|
41 | 'font-family': '--jp-code-font-family',
|
42 | 'font-size': '--jp-code-font-size',
|
43 | 'line-height': '--jp-code-line-height'
|
44 | },
|
45 | content: {
|
46 | 'font-family': '--jp-content-font-family',
|
47 | 'font-size': '--jp-content-font-size1',
|
48 | 'line-height': '--jp-content-line-height'
|
49 | }
|
50 | };
|
51 | export const TEXT_OPTIONS = {
|
52 | 'font-size': _m => Array.from(Array(25).keys()).map(i => `${i + 8}px`),
|
53 | 'line-height': _m => Array.from(Array(8).keys()).map(i => `${i * 0.25 + 1}`),
|
54 | 'font-family': m => {
|
55 | let names = Array.from(m.fonts.values()).reduce((memo, f) => {
|
56 | return memo.concat(f.name);
|
57 | }, []);
|
58 | names.sort((a, b) => a.localeCompare(b));
|
59 | return names;
|
60 | }
|
61 | };
|
62 | export const TEXT_LABELS = {
|
63 | 'font-size': 'Size',
|
64 | 'line-height': 'Line Height',
|
65 | 'font-family': 'Font'
|
66 | };
|
67 | export const DEFAULT = {
|
68 | code: {
|
69 | fontSize: '13px',
|
70 | lineHeight: '1',
|
71 | fontFamily: '"Source Code Pro", monospace'
|
72 | }
|
73 | };
|
74 | export const PACKAGE_NAME = '@deathbeds/jupyterlab-fonts';
|
75 | export const CONFIGURED_CLASS = 'jp-fonts-configured';
|
76 |
|
77 | export const IFontManager = new Token('@deathbeds/jupyterlab-fonts:IFontManager');
|
78 |
|
\ | No newline at end of file |