@instructure/ui-source-code-editor 8.25.1-snapshot-19
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.
- package/CHANGELOG.md +17 -0
- package/README.md +48 -0
- package/es/SourceCodeEditor/SourceCodeEditorLocator.js +81 -0
- package/es/SourceCodeEditor/customKeybinding.js +96 -0
- package/es/SourceCodeEditor/index.js +587 -0
- package/es/SourceCodeEditor/props.js +55 -0
- package/es/SourceCodeEditor/styles.js +204 -0
- package/es/SourceCodeEditor/theme.js +52 -0
- package/es/index.js +24 -0
- package/lib/SourceCodeEditor/SourceCodeEditorLocator.js +92 -0
- package/lib/SourceCodeEditor/customKeybinding.js +104 -0
- package/lib/SourceCodeEditor/index.js +601 -0
- package/lib/SourceCodeEditor/props.js +67 -0
- package/lib/SourceCodeEditor/styles.js +213 -0
- package/lib/SourceCodeEditor/theme.js +60 -0
- package/lib/index.js +13 -0
- package/lib/package.json +1 -0
- package/package.json +68 -0
- package/src/SourceCodeEditor/README.md +794 -0
- package/src/SourceCodeEditor/SourceCodeEditorLocator.ts +56 -0
- package/src/SourceCodeEditor/customKeybinding.ts +121 -0
- package/src/SourceCodeEditor/index.tsx +659 -0
- package/src/SourceCodeEditor/props.ts +291 -0
- package/src/SourceCodeEditor/styles.ts +200 -0
- package/src/SourceCodeEditor/theme.ts +55 -0
- package/src/index.ts +25 -0
- package/tsconfig.build.json +25 -0
- package/tsconfig.build.tsbuildinfo +1 -0
- package/tsconfig.json +4 -0
- package/types/SourceCodeEditor/SourceCodeEditorLocator.d.ts +607 -0
- package/types/SourceCodeEditor/SourceCodeEditorLocator.d.ts.map +1 -0
- package/types/SourceCodeEditor/customKeybinding.d.ts +4 -0
- package/types/SourceCodeEditor/customKeybinding.d.ts.map +1 -0
- package/types/SourceCodeEditor/index.d.ts +126 -0
- package/types/SourceCodeEditor/index.d.ts.map +1 -0
- package/types/SourceCodeEditor/props.d.ts +130 -0
- package/types/SourceCodeEditor/props.d.ts.map +1 -0
- package/types/SourceCodeEditor/styles.d.ts +14 -0
- package/types/SourceCodeEditor/styles.d.ts.map +1 -0
- package/types/SourceCodeEditor/theme.d.ts +10 -0
- package/types/SourceCodeEditor/theme.d.ts.map +1 -0
- package/types/index.d.ts +3 -0
- package/types/index.d.ts.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SourceCodeEditorLocator.d.ts","sourceRoot":"","sources":["../../src/SourceCodeEditor/SourceCodeEditorLocator.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAA;AAK5D,eAAO,MAAM,uBAAuB;;iCACH,GAAG,EAAE;6BAGT,GAAG,EAAE;6BAGL,GAAG,EAAE;8BAGJ,GAAG,EAAE;gCAGH,GAAG,EAAE;gCAGL,GAAG,EAAE;yCAGI,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAlBb,GAAG,EAAE;6BAGT,GAAG,EAAE;6BAGL,GAAG,EAAE;8BAGJ,GAAG,EAAE;gCAGH,GAAG,EAAE;gCAGL,GAAG,EAAE;yCAGI,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAlBb,GAAG,EAAE;6BAGT,GAAG,EAAE;6BAGL,GAAG,EAAE;8BAGJ,GAAG,EAAE;gCAGH,GAAG,EAAE;gCAGL,GAAG,EAAE;yCAGI,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAlBb,GAAG,EAAE;6BAGT,GAAG,EAAE;6BAGL,GAAG,EAAE;8BAGJ,GAAG,EAAE;gCAGH,GAAG,EAAE;gCAGL,GAAG,EAAE;yCAGI,GAAG,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iCAlBb,GAAG,EAAE;6BAGT,GAAG,EAAE;6BAGL,GAAG,EAAE;8BAGJ,GAAG,EAAE;gCAGH,GAAG,EAAE;gCAGL,GAAG,EAAE;yCAGI,GAAG,EAAE;;sPAM5C,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"customKeybinding.d.ts","sourceRoot":"","sources":["../../src/SourceCodeEditor/customKeybinding.ts"],"names":[],"mappings":"AAgDA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAElD,QAAA,MAAM,wBAAwB,EAAE,UAAU,EAoEzC,CAAA;AAED,OAAO,EAAE,wBAAwB,EAAE,CAAA"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { Component } from 'react';
|
|
3
|
+
import type { KeyBinding } from '@codemirror/view';
|
|
4
|
+
import { StreamLanguage } from '@codemirror/language';
|
|
5
|
+
import { jsx } from '@instructure/emotion';
|
|
6
|
+
import type { SourceCodeEditorProps } from './props';
|
|
7
|
+
/**
|
|
8
|
+
---
|
|
9
|
+
category: components
|
|
10
|
+
---
|
|
11
|
+
@tsProps
|
|
12
|
+
**/
|
|
13
|
+
declare class SourceCodeEditor extends Component<SourceCodeEditorProps> {
|
|
14
|
+
static readonly componentId = "SourceCodeEditor";
|
|
15
|
+
static propTypes: import("@instructure/shared-types/types/UtilityTypes").PropValidators<keyof {
|
|
16
|
+
label: string;
|
|
17
|
+
language?: "sh" | "js" | "json" | "javascript" | "jsx" | "shell" | "css" | "html" | "markdown" | "yaml" | "yml" | "bash" | undefined;
|
|
18
|
+
readOnly?: boolean | undefined;
|
|
19
|
+
editable?: boolean | undefined;
|
|
20
|
+
lineNumbers?: boolean | undefined;
|
|
21
|
+
foldGutter?: boolean | undefined;
|
|
22
|
+
highlightActiveLineGutter?: boolean | undefined;
|
|
23
|
+
highlightActiveLine?: boolean | undefined;
|
|
24
|
+
lineWrapping?: boolean | undefined;
|
|
25
|
+
autofocus?: boolean | undefined;
|
|
26
|
+
spellcheck?: boolean | undefined;
|
|
27
|
+
indentOnLoad?: boolean | undefined;
|
|
28
|
+
indentWithTab?: boolean | undefined;
|
|
29
|
+
indentUnit?: string | undefined;
|
|
30
|
+
direction?: "ltr" | "rtl" | undefined;
|
|
31
|
+
rtlMoveVisually?: boolean | undefined;
|
|
32
|
+
defaultValue?: string | undefined;
|
|
33
|
+
value?: string | undefined;
|
|
34
|
+
onChange?: ((value: string) => void) | undefined;
|
|
35
|
+
onFocus?: (() => void) | undefined;
|
|
36
|
+
onBlur?: (() => void) | undefined;
|
|
37
|
+
attachment?: "bottom" | "top" | undefined;
|
|
38
|
+
elementRef?: ((element: HTMLDivElement | null) => void) | undefined;
|
|
39
|
+
containerRef?: ((element: HTMLDivElement | null) => void) | undefined;
|
|
40
|
+
}>;
|
|
41
|
+
static allowedProps: readonly (keyof {
|
|
42
|
+
label: string;
|
|
43
|
+
language?: "sh" | "js" | "json" | "javascript" | "jsx" | "shell" | "css" | "html" | "markdown" | "yaml" | "yml" | "bash" | undefined;
|
|
44
|
+
readOnly?: boolean | undefined;
|
|
45
|
+
editable?: boolean | undefined;
|
|
46
|
+
lineNumbers?: boolean | undefined;
|
|
47
|
+
foldGutter?: boolean | undefined;
|
|
48
|
+
highlightActiveLineGutter?: boolean | undefined;
|
|
49
|
+
highlightActiveLine?: boolean | undefined;
|
|
50
|
+
lineWrapping?: boolean | undefined;
|
|
51
|
+
autofocus?: boolean | undefined;
|
|
52
|
+
spellcheck?: boolean | undefined;
|
|
53
|
+
indentOnLoad?: boolean | undefined;
|
|
54
|
+
indentWithTab?: boolean | undefined;
|
|
55
|
+
indentUnit?: string | undefined;
|
|
56
|
+
direction?: "ltr" | "rtl" | undefined;
|
|
57
|
+
rtlMoveVisually?: boolean | undefined;
|
|
58
|
+
defaultValue?: string | undefined;
|
|
59
|
+
value?: string | undefined;
|
|
60
|
+
onChange?: ((value: string) => void) | undefined;
|
|
61
|
+
onFocus?: (() => void) | undefined;
|
|
62
|
+
onBlur?: (() => void) | undefined;
|
|
63
|
+
attachment?: "bottom" | "top" | undefined;
|
|
64
|
+
elementRef?: ((element: HTMLDivElement | null) => void) | undefined;
|
|
65
|
+
containerRef?: ((element: HTMLDivElement | null) => void) | undefined;
|
|
66
|
+
})[];
|
|
67
|
+
static defaultProps: {
|
|
68
|
+
language: string;
|
|
69
|
+
readOnly: boolean;
|
|
70
|
+
editable: boolean;
|
|
71
|
+
lineNumbers: boolean;
|
|
72
|
+
foldGutter: boolean;
|
|
73
|
+
highlightActiveLine: boolean;
|
|
74
|
+
highlightActiveLineGutter: boolean;
|
|
75
|
+
lineWrapping: boolean;
|
|
76
|
+
autofocus: boolean;
|
|
77
|
+
spellcheck: boolean;
|
|
78
|
+
rtlMoveVisually: boolean;
|
|
79
|
+
indentOnLoad: boolean;
|
|
80
|
+
indentWithTab: boolean;
|
|
81
|
+
defaultValue: string;
|
|
82
|
+
};
|
|
83
|
+
private readonly _id;
|
|
84
|
+
ref: HTMLDivElement | null;
|
|
85
|
+
private _containerRef?;
|
|
86
|
+
private _editorView?;
|
|
87
|
+
private _raf;
|
|
88
|
+
private _newSelectionAfterValueChange?;
|
|
89
|
+
handleRef: (el: HTMLDivElement | null) => void;
|
|
90
|
+
handleContainerRef: (el: HTMLDivElement | null) => void;
|
|
91
|
+
private addAnimationFrame;
|
|
92
|
+
private cancelAnimationFrames;
|
|
93
|
+
focus(): void;
|
|
94
|
+
get hasFocus(): boolean | undefined;
|
|
95
|
+
selectAll(): void;
|
|
96
|
+
deselectAll(): void;
|
|
97
|
+
indentCurrentSelection(): void;
|
|
98
|
+
indentAll(): void;
|
|
99
|
+
private dispatchViewEffects;
|
|
100
|
+
private dispatchViewChanges;
|
|
101
|
+
private dispatchViewSelection;
|
|
102
|
+
get currentDocValue(): import("@codemirror/state").Text | undefined;
|
|
103
|
+
get isControlled(): boolean;
|
|
104
|
+
constructor(props: SourceCodeEditorProps);
|
|
105
|
+
componentDidMount(): void;
|
|
106
|
+
componentWillUnmount(): void;
|
|
107
|
+
componentDidUpdate(prevProps: SourceCodeEditorProps): void;
|
|
108
|
+
private shouldUpdateExtensions;
|
|
109
|
+
get direction(): "ltr" | "rtl" | undefined;
|
|
110
|
+
get extensions(): (import("@codemirror/state").Extension | StreamLanguage<unknown>)[];
|
|
111
|
+
get baseExtensions(): import("@codemirror/state").Extension[];
|
|
112
|
+
get keymaps(): KeyBinding[];
|
|
113
|
+
get commandKeybinding(): readonly KeyBinding[];
|
|
114
|
+
get themeExtension(): import("@codemirror/state").Extension[] | undefined;
|
|
115
|
+
get languageExtension(): import("@codemirror/language").LanguageSupport | StreamLanguage<unknown>;
|
|
116
|
+
callOnChangeHandler(newValue: string): void;
|
|
117
|
+
get onChangeExtension(): import("@codemirror/state").Extension;
|
|
118
|
+
get focusListenerExtension(): import("@codemirror/state").Extension;
|
|
119
|
+
get announceLineNumberExtension(): import("@codemirror/state").Extension;
|
|
120
|
+
refreshExtensions(): void;
|
|
121
|
+
refreshEditorValue(): void;
|
|
122
|
+
render(): jsx.JSX.Element;
|
|
123
|
+
}
|
|
124
|
+
export default SourceCodeEditor;
|
|
125
|
+
export { SourceCodeEditor };
|
|
126
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|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AGD,IAAI,YAAY,YAEf;gBAEW,KAAK,EAAE,qBAAqB;IAKxC,iBAAiB;IAuBjB,oBAAoB;IAMpB,kBAAkB,CAAC,SAAS,EAAE,qBAAqB;IAcnD,OAAO,CAAC,sBAAsB;IAgC9B,IAAI,SAAS,8BAIZ;IAED,IAAI,UAAU,wEAkDb;IAED,IAAI,cAAc,4CAsBjB;IAED,IAAI,OAAO,IAAI,UAAU,EAAE,CAsB1B;IAED,IAAI,iBAAiB,0BAYpB;IAED,IAAI,cAAc,wDAmBjB;IAED,IAAI,iBAAiB,6EA0BpB;IAED,mBAAmB,CAAC,QAAQ,EAAE,MAAM;IAUpC,IAAI,iBAAiB,0CA2BpB;IAED,IAAI,sBAAsB,0CAgBzB;IAED,IAAI,2BAA2B,0CAiB9B;IAED,iBAAiB;IAIjB,kBAAkB;IAoClB,MAAM;CAqBP;AAED,eAAe,gBAAgB,CAAA;AAC/B,OAAO,EAAE,gBAAgB,EAAE,CAAA"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import type { TagStyle } from '@codemirror/language';
|
|
2
|
+
import type { PropValidators, CodeEditorTheme, OtherHTMLAttributes } from '@instructure/shared-types';
|
|
3
|
+
import type { WithStyleProps, StyleObject, ComponentStyle } from '@instructure/emotion';
|
|
4
|
+
import type { WithDeterministicIdProps } from '@instructure/ui-react-utils';
|
|
5
|
+
import type { BidirectionalProps } from '@instructure/ui-i18n';
|
|
6
|
+
declare type SourceCodeEditorOwnProps = {
|
|
7
|
+
/**
|
|
8
|
+
* The label text that screen readers will read when this component gets
|
|
9
|
+
* focus.
|
|
10
|
+
*/
|
|
11
|
+
label: string;
|
|
12
|
+
/**
|
|
13
|
+
* The language to use (adds autocomplete and syntax highlighting).
|
|
14
|
+
*/
|
|
15
|
+
language?: 'sh' | 'js' | 'json' | 'javascript' | 'jsx' | 'shell' | 'css' | 'html' | 'markdown' | 'yaml' | 'yml' | 'bash';
|
|
16
|
+
/**
|
|
17
|
+
* This disables editing of the editor content by the user and API calls.
|
|
18
|
+
*
|
|
19
|
+
* __Note:__ The editor is still focusable in readOnly mode. Read more at the [codemirror documentation](https://codemirror.net/6/docs/ref/#state.EditorState%5EreadOnly).
|
|
20
|
+
*/
|
|
21
|
+
readOnly?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Controls whether the editor content DOM is editable.
|
|
24
|
+
*
|
|
25
|
+
* __Note:__ When set to false, the editor is not focusable.
|
|
26
|
+
* (This doesn't affect API calls that change the editor content, e.g.: copy-paste,
|
|
27
|
+
* even when those are bound to keys or buttons.) Read more at the [codemirror documentation](https://codemirror.net/6/docs/ref/#view.EditorView%5Eeditable).
|
|
28
|
+
*/
|
|
29
|
+
editable?: boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Whether to display the line numbers in the gutter
|
|
32
|
+
*/
|
|
33
|
+
lineNumbers?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Whether to show a fold status indicator before foldable lines (which can be clicked to fold or unfold the line)
|
|
36
|
+
*/
|
|
37
|
+
foldGutter?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Whether to highlight gutter elements on the active line (visible only when a gutter is visible)
|
|
40
|
+
*/
|
|
41
|
+
highlightActiveLineGutter?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* Highlights the lines that have a cursor on them
|
|
44
|
+
*/
|
|
45
|
+
highlightActiveLine?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Whether it should scroll or wrap for long lines. Defaults to false (scroll)
|
|
48
|
+
*/
|
|
49
|
+
lineWrapping?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Whether the editor should focus itself on initialization
|
|
52
|
+
*/
|
|
53
|
+
autofocus?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Whether spellcheck will be enabled on the input
|
|
56
|
+
*/
|
|
57
|
+
spellcheck?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Whether the editor should auto-indent the code on this initial load
|
|
60
|
+
* and when the `value` is changed
|
|
61
|
+
*/
|
|
62
|
+
indentOnLoad?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* When this feature is on, Tab and Shift-Tab will indent the code. By default, it is turned off, and tabbing will focus the next element in the tab order.
|
|
65
|
+
*
|
|
66
|
+
* __Note__: Even if this feature is on, pressing Escape before tabbing will not handle indentation and will handle focus instead.
|
|
67
|
+
*/
|
|
68
|
+
indentWithTab?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Overrides the unit by which indentation happens (defaults to 2 spaces).
|
|
71
|
+
* Should be a string consisting either entirely of spaces or entirely of tabs.
|
|
72
|
+
*/
|
|
73
|
+
indentUnit?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Flips overall layout and selects base paragraph direction to be "LTR" or "RTL".
|
|
76
|
+
*/
|
|
77
|
+
direction?: 'ltr' | 'rtl';
|
|
78
|
+
/**
|
|
79
|
+
* Whether horizontal cursor movement through "RTL" text is visual
|
|
80
|
+
* (pressing the left arrow moves the cursor left) or logical
|
|
81
|
+
* (pressing the left arrow moves to the next lower index in the string,
|
|
82
|
+
* which is visually right in "RTL" text)
|
|
83
|
+
*/
|
|
84
|
+
rtlMoveVisually?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* The default value of the editor (in uncontrolled mode)
|
|
87
|
+
*/
|
|
88
|
+
defaultValue?: string;
|
|
89
|
+
/**
|
|
90
|
+
* The selected value for the controlled version
|
|
91
|
+
* (needs an onChange handler to work)
|
|
92
|
+
*/
|
|
93
|
+
value?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Called when the value of the component changes.
|
|
96
|
+
*/
|
|
97
|
+
onChange?: (value: string) => void;
|
|
98
|
+
/**
|
|
99
|
+
* Called when the editor receives focus
|
|
100
|
+
*/
|
|
101
|
+
onFocus?: () => void;
|
|
102
|
+
/**
|
|
103
|
+
* Called when the editor loses focus
|
|
104
|
+
*/
|
|
105
|
+
onBlur?: () => void;
|
|
106
|
+
/**
|
|
107
|
+
* Sets minor visual styles (border radius & top/bottom margin)
|
|
108
|
+
*/
|
|
109
|
+
attachment?: 'bottom' | 'top';
|
|
110
|
+
/**
|
|
111
|
+
* provides a reference to the underlying html root element
|
|
112
|
+
*/
|
|
113
|
+
elementRef?: (element: HTMLDivElement | null) => void;
|
|
114
|
+
/**
|
|
115
|
+
* provides a reference to the html element of the editor's container
|
|
116
|
+
*/
|
|
117
|
+
containerRef?: (element: HTMLDivElement | null) => void;
|
|
118
|
+
};
|
|
119
|
+
declare type PropKeys = keyof SourceCodeEditorOwnProps;
|
|
120
|
+
declare type AllowedPropKeys = Readonly<Array<PropKeys>>;
|
|
121
|
+
declare type SourceCodeEditorProps = SourceCodeEditorOwnProps & WithStyleProps<CodeEditorTheme, Record<keyof SourceCodeEditorStyle, any>> & BidirectionalProps & OtherHTMLAttributes<SourceCodeEditorOwnProps> & WithDeterministicIdProps;
|
|
122
|
+
declare type SourceCodeEditorStyle = ComponentStyle<'codeEditor' | 'codeEditorContainer'> & {
|
|
123
|
+
theme: StyleObject;
|
|
124
|
+
highlightStyle: TagStyle[];
|
|
125
|
+
};
|
|
126
|
+
declare const propTypes: PropValidators<PropKeys>;
|
|
127
|
+
declare const allowedProps: AllowedPropKeys;
|
|
128
|
+
export type { SourceCodeEditorProps, SourceCodeEditorStyle };
|
|
129
|
+
export { propTypes, allowedProps };
|
|
130
|
+
//# sourceMappingURL=props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/SourceCodeEditor/props.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAIpD,OAAO,KAAK,EACV,cAAc,EACd,eAAe,EACf,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAClC,OAAO,KAAK,EACV,cAAc,EACd,WAAW,EACX,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAA;AAC3E,O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AM,IAAI,CAAA;IAEpB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IAEnB;;OAEG;IACH,UAAU,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAA;IAQ7B;;OAEG;IACH,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAA;IAErD;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,KAAK,IAAI,CAAA;CACxD,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,wBAAwB,CAAA;AAE9C,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,qBAAqB,GAAG,wBAAwB,GACnD,cAAc,CACZ,eAAe,EAGf,MAAM,CAAC,MAAM,qBAAqB,EAAE,GAAG,CAAC,CACzC,GACD,kBAAkB,GAClB,mBAAmB,CAAC,wBAAwB,CAAC,GAC7C,wBAAwB,CAAA;AAE1B,aAAK,qBAAqB,GAAG,cAAc,CACzC,YAAY,GAAG,qBAAqB,CACrC,GAAG;IACF,KAAK,EAAE,WAAW,CAAA;IAClB,cAAc,EAAE,QAAQ,EAAE,CAAA;CAC3B,CAAA;AAED,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAuCvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eA0BnB,CAAA;AAED,YAAY,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { SourceCodeEditorTheme } from '@instructure/shared-types';
|
|
2
|
+
import type { SourceCodeEditorProps, SourceCodeEditorStyle } from './props';
|
|
3
|
+
/**
|
|
4
|
+
* ---
|
|
5
|
+
* private: true
|
|
6
|
+
* ---
|
|
7
|
+
* Generates the style object from the theme and provided additional information
|
|
8
|
+
* @param {Object} componentTheme The theme variable object.
|
|
9
|
+
* @param {Object} props the props of the component, the style is applied to
|
|
10
|
+
* @return {Object} The final style object, which will be used in the component
|
|
11
|
+
*/
|
|
12
|
+
declare const generateStyle: (componentTheme: SourceCodeEditorTheme, props: SourceCodeEditorProps) => SourceCodeEditorStyle;
|
|
13
|
+
export default generateStyle;
|
|
14
|
+
//# sourceMappingURL=styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/SourceCodeEditor/styles.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AACtE,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAE3E;;;;;;;;GAQG;AACH,QAAA,MAAM,aAAa,mBACD,qBAAqB,SAC9B,qBAAqB,KAC3B,qBA4JF,CAAA;AAED,eAAe,aAAa,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Theme } from '@instructure/ui-themes';
|
|
2
|
+
import type { SourceCodeEditorTheme } from '@instructure/shared-types';
|
|
3
|
+
/**
|
|
4
|
+
* Generates the theme object for the component from the theme and provided additional information
|
|
5
|
+
* @param {Object} theme The actual theme object.
|
|
6
|
+
* @return {Object} The final theme object with the overrides and component variables
|
|
7
|
+
*/
|
|
8
|
+
declare const generateComponentTheme: (theme: Theme) => SourceCodeEditorTheme;
|
|
9
|
+
export default generateComponentTheme;
|
|
10
|
+
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/SourceCodeEditor/theme.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AAEtE;;;;GAIG;AACH,QAAA,MAAM,sBAAsB,UAAW,KAAK,KAAG,qBAoB9C,CAAA;AAED,eAAe,sBAAsB,CAAA"}
|
package/types/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,YAAY,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA"}
|