@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.
Files changed (43) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +48 -0
  3. package/es/SourceCodeEditor/SourceCodeEditorLocator.js +81 -0
  4. package/es/SourceCodeEditor/customKeybinding.js +96 -0
  5. package/es/SourceCodeEditor/index.js +587 -0
  6. package/es/SourceCodeEditor/props.js +55 -0
  7. package/es/SourceCodeEditor/styles.js +204 -0
  8. package/es/SourceCodeEditor/theme.js +52 -0
  9. package/es/index.js +24 -0
  10. package/lib/SourceCodeEditor/SourceCodeEditorLocator.js +92 -0
  11. package/lib/SourceCodeEditor/customKeybinding.js +104 -0
  12. package/lib/SourceCodeEditor/index.js +601 -0
  13. package/lib/SourceCodeEditor/props.js +67 -0
  14. package/lib/SourceCodeEditor/styles.js +213 -0
  15. package/lib/SourceCodeEditor/theme.js +60 -0
  16. package/lib/index.js +13 -0
  17. package/lib/package.json +1 -0
  18. package/package.json +68 -0
  19. package/src/SourceCodeEditor/README.md +794 -0
  20. package/src/SourceCodeEditor/SourceCodeEditorLocator.ts +56 -0
  21. package/src/SourceCodeEditor/customKeybinding.ts +121 -0
  22. package/src/SourceCodeEditor/index.tsx +659 -0
  23. package/src/SourceCodeEditor/props.ts +291 -0
  24. package/src/SourceCodeEditor/styles.ts +200 -0
  25. package/src/SourceCodeEditor/theme.ts +55 -0
  26. package/src/index.ts +25 -0
  27. package/tsconfig.build.json +25 -0
  28. package/tsconfig.build.tsbuildinfo +1 -0
  29. package/tsconfig.json +4 -0
  30. package/types/SourceCodeEditor/SourceCodeEditorLocator.d.ts +607 -0
  31. package/types/SourceCodeEditor/SourceCodeEditorLocator.d.ts.map +1 -0
  32. package/types/SourceCodeEditor/customKeybinding.d.ts +4 -0
  33. package/types/SourceCodeEditor/customKeybinding.d.ts.map +1 -0
  34. package/types/SourceCodeEditor/index.d.ts +126 -0
  35. package/types/SourceCodeEditor/index.d.ts.map +1 -0
  36. package/types/SourceCodeEditor/props.d.ts +130 -0
  37. package/types/SourceCodeEditor/props.d.ts.map +1 -0
  38. package/types/SourceCodeEditor/styles.d.ts +14 -0
  39. package/types/SourceCodeEditor/styles.d.ts.map +1 -0
  40. package/types/SourceCodeEditor/theme.d.ts +10 -0
  41. package/types/SourceCodeEditor/theme.d.ts.map +1 -0
  42. package/types/index.d.ts +3 -0
  43. package/types/index.d.ts.map +1 -0
@@ -0,0 +1,291 @@
1
+ /*
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2015 - present Instructure, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ import PropTypes from 'prop-types'
26
+
27
+ import type { TagStyle } from '@codemirror/language'
28
+
29
+ import { controllable } from '@instructure/ui-prop-types'
30
+
31
+ import type {
32
+ PropValidators,
33
+ CodeEditorTheme,
34
+ OtherHTMLAttributes
35
+ } from '@instructure/shared-types'
36
+ import type {
37
+ WithStyleProps,
38
+ StyleObject,
39
+ ComponentStyle
40
+ } from '@instructure/emotion'
41
+ import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
42
+ import type { BidirectionalProps } from '@instructure/ui-i18n'
43
+
44
+ type SourceCodeEditorOwnProps = {
45
+ /**
46
+ * The label text that screen readers will read when this component gets
47
+ * focus.
48
+ */
49
+ label: string
50
+
51
+ /**
52
+ * The language to use (adds autocomplete and syntax highlighting).
53
+ */
54
+ language?:
55
+ | 'sh'
56
+ | 'js'
57
+ | 'json'
58
+ | 'javascript'
59
+ | 'jsx'
60
+ | 'shell'
61
+ | 'css'
62
+ | 'html'
63
+ | 'markdown'
64
+ | 'yaml'
65
+ | 'yml'
66
+ | 'bash'
67
+
68
+ /**
69
+ * This disables editing of the editor content by the user and API calls.
70
+ *
71
+ * __Note:__ The editor is still focusable in readOnly mode. Read more at the [codemirror documentation](https://codemirror.net/6/docs/ref/#state.EditorState%5EreadOnly).
72
+ */
73
+ readOnly?: boolean
74
+
75
+ /**
76
+ * Controls whether the editor content DOM is editable.
77
+ *
78
+ * __Note:__ When set to false, the editor is not focusable.
79
+ * (This doesn't affect API calls that change the editor content, e.g.: copy-paste,
80
+ * even when those are bound to keys or buttons.) Read more at the [codemirror documentation](https://codemirror.net/6/docs/ref/#view.EditorView%5Eeditable).
81
+ */
82
+ editable?: boolean
83
+
84
+ /**
85
+ * Whether to display the line numbers in the gutter
86
+ */
87
+ lineNumbers?: boolean
88
+
89
+ /**
90
+ * Whether to show a fold status indicator before foldable lines (which can be clicked to fold or unfold the line)
91
+ */
92
+ foldGutter?: boolean
93
+
94
+ /**
95
+ * Whether to highlight gutter elements on the active line (visible only when a gutter is visible)
96
+ */
97
+ highlightActiveLineGutter?: boolean
98
+
99
+ /**
100
+ * Highlights the lines that have a cursor on them
101
+ */
102
+ highlightActiveLine?: boolean
103
+
104
+ /**
105
+ * Whether it should scroll or wrap for long lines. Defaults to false (scroll)
106
+ */
107
+ lineWrapping?: boolean
108
+
109
+ /**
110
+ * Whether the editor should focus itself on initialization
111
+ */
112
+ autofocus?: boolean
113
+
114
+ /**
115
+ * Whether spellcheck will be enabled on the input
116
+ */
117
+ spellcheck?: boolean
118
+
119
+ /**
120
+ * Whether the editor should auto-indent the code on this initial load
121
+ * and when the `value` is changed
122
+ */
123
+ indentOnLoad?: boolean
124
+
125
+ /**
126
+ * 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.
127
+ *
128
+ * __Note__: Even if this feature is on, pressing Escape before tabbing will not handle indentation and will handle focus instead.
129
+ */
130
+ indentWithTab?: boolean
131
+
132
+ /**
133
+ * Overrides the unit by which indentation happens (defaults to 2 spaces).
134
+ * Should be a string consisting either entirely of spaces or entirely of tabs.
135
+ */
136
+ indentUnit?: string
137
+
138
+ /**
139
+ * Flips overall layout and selects base paragraph direction to be "LTR" or "RTL".
140
+ */
141
+ direction?: 'ltr' | 'rtl'
142
+
143
+ /**
144
+ * Whether horizontal cursor movement through "RTL" text is visual
145
+ * (pressing the left arrow moves the cursor left) or logical
146
+ * (pressing the left arrow moves to the next lower index in the string,
147
+ * which is visually right in "RTL" text)
148
+ */
149
+ rtlMoveVisually?: boolean
150
+
151
+ /**
152
+ * The default value of the editor (in uncontrolled mode)
153
+ */
154
+ defaultValue?: string
155
+
156
+ /**
157
+ * The selected value for the controlled version
158
+ * (needs an onChange handler to work)
159
+ */
160
+ value?: string
161
+
162
+ /**
163
+ * Called when the value of the component changes.
164
+ */
165
+ onChange?: (value: string) => void
166
+
167
+ /**
168
+ * Called when the editor receives focus
169
+ */
170
+ onFocus?: () => void
171
+
172
+ /**
173
+ * Called when the editor loses focus
174
+ */
175
+ onBlur?: () => void
176
+
177
+ /**
178
+ * Sets minor visual styles (border radius & top/bottom margin)
179
+ */
180
+ attachment?: 'bottom' | 'top'
181
+
182
+ // TODO: discuss the future of the dark theme with the Design theme
183
+ // We decided not to use the dark theme yet, the colors need to be configured
184
+ // (e.g. color contrast)
185
+ // Also, probably a `theme` oneOf prop would be better with more options
186
+ // darkTheme?: boolean
187
+
188
+ /**
189
+ * provides a reference to the underlying html root element
190
+ */
191
+ elementRef?: (element: HTMLDivElement | null) => void
192
+
193
+ /**
194
+ * provides a reference to the html element of the editor's container
195
+ */
196
+ containerRef?: (element: HTMLDivElement | null) => void
197
+ }
198
+
199
+ type PropKeys = keyof SourceCodeEditorOwnProps
200
+
201
+ type AllowedPropKeys = Readonly<Array<PropKeys>>
202
+
203
+ type SourceCodeEditorProps = SourceCodeEditorOwnProps &
204
+ WithStyleProps<
205
+ CodeEditorTheme,
206
+ // The highlightStyle is a unique one, not compatible with our style syntax,
207
+ // but isn't used for the css prop anyway
208
+ Record<keyof SourceCodeEditorStyle, any>
209
+ > &
210
+ BidirectionalProps &
211
+ OtherHTMLAttributes<SourceCodeEditorOwnProps> &
212
+ WithDeterministicIdProps
213
+
214
+ type SourceCodeEditorStyle = ComponentStyle<
215
+ 'codeEditor' | 'codeEditorContainer'
216
+ > & {
217
+ theme: StyleObject
218
+ highlightStyle: TagStyle[]
219
+ }
220
+
221
+ const propTypes: PropValidators<PropKeys> = {
222
+ label: PropTypes.string.isRequired,
223
+ language: PropTypes.oneOf([
224
+ 'sh',
225
+ 'js',
226
+ 'json',
227
+ 'javascript',
228
+ 'jsx',
229
+ 'shell',
230
+ 'css',
231
+ 'html',
232
+ 'markdown',
233
+ 'yaml',
234
+ 'yml',
235
+ 'bash'
236
+ ]),
237
+ readOnly: PropTypes.bool,
238
+ editable: PropTypes.bool,
239
+ lineNumbers: PropTypes.bool,
240
+ foldGutter: PropTypes.bool,
241
+ highlightActiveLineGutter: PropTypes.bool,
242
+ highlightActiveLine: PropTypes.bool,
243
+ lineWrapping: PropTypes.bool,
244
+ autofocus: PropTypes.bool,
245
+ spellcheck: PropTypes.bool,
246
+ direction: PropTypes.oneOf(['ltr', 'rtl']),
247
+ rtlMoveVisually: PropTypes.bool,
248
+ indentOnLoad: PropTypes.bool,
249
+ indentWithTab: PropTypes.bool,
250
+ indentUnit: PropTypes.string,
251
+ defaultValue: PropTypes.string,
252
+ value: controllable(PropTypes.string, 'onChange', 'defaultValue'),
253
+ onChange: PropTypes.func,
254
+ onFocus: PropTypes.func,
255
+ onBlur: PropTypes.func,
256
+ attachment: PropTypes.oneOf(['bottom', 'top']),
257
+ // darkTheme: PropTypes.bool,
258
+ elementRef: PropTypes.func,
259
+ containerRef: PropTypes.func
260
+ }
261
+
262
+ const allowedProps: AllowedPropKeys = [
263
+ 'label',
264
+ 'language',
265
+ 'readOnly',
266
+ 'editable',
267
+ 'lineNumbers',
268
+ 'foldGutter',
269
+ 'highlightActiveLineGutter',
270
+ 'highlightActiveLine',
271
+ 'lineWrapping',
272
+ 'autofocus',
273
+ 'spellcheck',
274
+ 'direction',
275
+ 'rtlMoveVisually',
276
+ 'indentOnLoad',
277
+ 'indentWithTab',
278
+ 'indentUnit',
279
+ 'defaultValue',
280
+ 'value',
281
+ 'onChange',
282
+ 'onFocus',
283
+ 'onBlur',
284
+ 'attachment',
285
+ // 'darkTheme',
286
+ 'elementRef',
287
+ 'containerRef'
288
+ ]
289
+
290
+ export type { SourceCodeEditorProps, SourceCodeEditorStyle }
291
+ export { propTypes, allowedProps }
@@ -0,0 +1,200 @@
1
+ /*
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2015 - present Instructure, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ import { tags } from '@lezer/highlight'
26
+
27
+ import type { SourceCodeEditorTheme } from '@instructure/shared-types'
28
+ import type { SourceCodeEditorProps, SourceCodeEditorStyle } from './props'
29
+
30
+ /**
31
+ * ---
32
+ * private: true
33
+ * ---
34
+ * Generates the style object from the theme and provided additional information
35
+ * @param {Object} componentTheme The theme variable object.
36
+ * @param {Object} props the props of the component, the style is applied to
37
+ * @return {Object} The final style object, which will be used in the component
38
+ */
39
+ const generateStyle = (
40
+ componentTheme: SourceCodeEditorTheme,
41
+ props: SourceCodeEditorProps
42
+ ): SourceCodeEditorStyle => {
43
+ const { attachment } = props
44
+
45
+ const attachmentBorderRadius = {
46
+ top: {
47
+ borderBottomLeftRadius: 0,
48
+ borderBottomRightRadius: 0
49
+ },
50
+ bottom: {
51
+ borderTopLeftRadius: 0,
52
+ borderTopRightRadius: 0
53
+ }
54
+ }
55
+
56
+ const attachmentVariants = {
57
+ top: {
58
+ marginBottom: 0,
59
+ marginTop: '0.25rem'
60
+ },
61
+ bottom: {
62
+ borderTopLeftRadius: 0,
63
+ borderTopRightRadius: 0,
64
+ marginBottom: '0.25rem'
65
+ }
66
+ }
67
+
68
+ return {
69
+ codeEditor: {
70
+ label: 'codeEditor',
71
+ position: 'relative'
72
+ },
73
+ codeEditorContainer: {
74
+ label: 'codeEditorContainer',
75
+ borderColor: componentTheme?.borderColor,
76
+ borderStyle: 'solid',
77
+ borderWidth: componentTheme?.borderWidth,
78
+ borderRadius: componentTheme.borderRadius,
79
+ marginBottom: '1rem',
80
+ ...(attachment && {
81
+ ...attachmentVariants[attachment],
82
+ ...attachmentBorderRadius[attachment]
83
+ })
84
+ },
85
+ theme: {
86
+ '&': {
87
+ overflow: 'hidden',
88
+ background: componentTheme.background,
89
+ height: 'auto',
90
+ fontFamily: componentTheme.fontFamily,
91
+ fontSize: componentTheme.fontSize,
92
+ color: componentTheme.color,
93
+ border: 0,
94
+ lineHeight: 1.4375,
95
+ minHeight: '1.4375rem',
96
+ borderRadius: componentTheme.borderRadius,
97
+ ...(attachment && {
98
+ ...attachmentBorderRadius[attachment]
99
+ })
100
+ },
101
+
102
+ '&.cm-editor.cm-focused': {
103
+ // Provide a simple default outline to make sure a focused
104
+ // editor is visually distinct. Can't leave the default behavior
105
+ // because that will apply to the content element, which is
106
+ // inside the scrollable container and doesn't include the
107
+ // gutters. We also can't use an 'auto' outline, since those
108
+ // are, for some reason, drawn behind the element content, which
109
+ // will cause things like the active line background to cover
110
+ // the outline (#297).
111
+ outline: `${componentTheme?.borderWidth} solid ${componentTheme?.focusBorderColor}`
112
+ },
113
+
114
+ '.cm-content': {
115
+ padding: `${componentTheme.verticalPadding} 0`
116
+ },
117
+
118
+ '.cm-scroller': {
119
+ fontFamily: componentTheme.fontFamily,
120
+ lineHeight: 1.4375
121
+ },
122
+
123
+ '.cm-gutters': {
124
+ background: componentTheme.gutterBackground,
125
+ borderColor: componentTheme.borderColor
126
+ },
127
+
128
+ '.cm-line': {
129
+ padding: `0 ${componentTheme.horizontalPadding}`
130
+ },
131
+
132
+ '.cm-selectionBackground': {
133
+ background: 'transparent'
134
+ },
135
+ '.cm-focused .cm-selectionBackground': {
136
+ background: '#d7d4f0'
137
+ },
138
+
139
+ '.cm-placeholder': {
140
+ // for better contrast
141
+ color: '#707070'
142
+ }
143
+ },
144
+
145
+ highlightStyle: [
146
+ /**
147
+ * Copy of `defaultHighlightStyle` from '@codemirror/language'
148
+ */
149
+ // { tag: tags.meta, color: '#7a757a' },
150
+ { tag: tags.link, textDecoration: 'underline' },
151
+ { tag: tags.heading, textDecoration: 'underline', fontWeight: 'bold' },
152
+ { tag: tags.emphasis, fontStyle: 'italic' },
153
+ { tag: tags.strong, fontWeight: 'bold' },
154
+ { tag: tags.strikethrough, textDecoration: 'line-through' },
155
+ { tag: tags.keyword, color: '#708' },
156
+ {
157
+ tag: [
158
+ tags.atom,
159
+ tags.bool,
160
+ tags.url,
161
+ tags.contentSeparator,
162
+ tags.labelName
163
+ ],
164
+ color: '#219'
165
+ },
166
+ { tag: [tags.literal, tags.inserted], color: '#164' },
167
+ { tag: [tags.string, tags.deleted], color: '#a11' },
168
+ // {
169
+ // tag: [tags.regexp, tags.escape, tags.special(tags.string)],
170
+ // color: '#e40'
171
+ // },
172
+ { tag: tags.definition(tags.variableName), color: '#00f' },
173
+ { tag: tags.local(tags.variableName), color: '#30a' },
174
+ // { tag: [tags.typeName, tags.namespace], color: '#085' },
175
+ { tag: tags.className, color: '#167' },
176
+ {
177
+ tag: [tags.special(tags.variableName), tags.macroName],
178
+ color: '#256'
179
+ },
180
+ { tag: tags.definition(tags.propertyName), color: '#00c' },
181
+ { tag: tags.comment, color: '#940' },
182
+ // { tag: tags.invalid, color: '#f00' },
183
+
184
+ /**
185
+ * Custom highlighting overrides
186
+ * (where original colors don't have enough contrast against #fff
187
+ * or active highlight background)
188
+ */
189
+ { tag: tags.meta, color: '#757075' },
190
+ {
191
+ tag: [tags.regexp, tags.escape, tags.special(tags.string)],
192
+ color: '#d13b00'
193
+ },
194
+ { tag: [tags.typeName, tags.namespace], color: '#008051' },
195
+ { tag: tags.invalid, color: '#e60000' }
196
+ ]
197
+ }
198
+ }
199
+
200
+ export default generateStyle
@@ -0,0 +1,55 @@
1
+ /*
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2015 - present Instructure, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+
25
+ import type { Theme } from '@instructure/ui-themes'
26
+ import type { SourceCodeEditorTheme } from '@instructure/shared-types'
27
+
28
+ /**
29
+ * Generates the theme object for the component from the theme and provided additional information
30
+ * @param {Object} theme The actual theme object.
31
+ * @return {Object} The final theme object with the overrides and component variables
32
+ */
33
+ const generateComponentTheme = (theme: Theme): SourceCodeEditorTheme => {
34
+ const { colors, borders, typography, spacing } = theme
35
+
36
+ const componentVariables: SourceCodeEditorTheme = {
37
+ fontFamily: typography?.fontFamilyMonospace,
38
+ fontSize: typography?.fontSizeSmall,
39
+ background: colors?.backgroundLightest,
40
+ color: colors?.textDarkest,
41
+ gutterBackground: colors?.backgroundLight,
42
+ borderWidth: borders?.widthSmall,
43
+ borderColor: colors?.borderMedium,
44
+ borderRadius: borders?.radiusMedium,
45
+ focusBorderColor: colors?.borderBrand,
46
+ horizontalPadding: spacing?.xSmall,
47
+ verticalPadding: spacing?.xxSmall
48
+ }
49
+
50
+ return {
51
+ ...componentVariables
52
+ }
53
+ }
54
+
55
+ export default generateComponentTheme
package/src/index.ts ADDED
@@ -0,0 +1,25 @@
1
+ /*
2
+ * The MIT License (MIT)
3
+ *
4
+ * Copyright (c) 2015 - present Instructure, Inc.
5
+ *
6
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ * of this software and associated documentation files (the "Software"), to deal
8
+ * in the Software without restriction, including without limitation the rights
9
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ * copies of the Software, and to permit persons to whom the Software is
11
+ * furnished to do so, subject to the following conditions:
12
+ *
13
+ * The above copyright notice and this permission notice shall be included in all
14
+ * copies or substantial portions of the Software.
15
+ *
16
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ * SOFTWARE.
23
+ */
24
+ export { SourceCodeEditor } from './SourceCodeEditor'
25
+ export type { SourceCodeEditorProps } from './SourceCodeEditor/props'
@@ -0,0 +1,25 @@
1
+ {
2
+ "extends": "../../tsconfig.build.json",
3
+ "compilerOptions": {
4
+ "outDir": "./types",
5
+ "composite": true,
6
+ "rootDir": "./src"
7
+ },
8
+ "include": ["src"],
9
+ "references": [
10
+ { "path": "../ui-babel-preset/tsconfig.build.json" },
11
+ { "path": "../ui-test-utils/tsconfig.build.json" },
12
+ { "path": "../ui-themes/tsconfig.build.json" },
13
+ { "path": "../emotion/tsconfig.build.json" },
14
+ { "path": "../shared-types/tsconfig.build.json" },
15
+ { "path": "../ui-a11y-content/tsconfig.build.json" },
16
+ { "path": "../ui-dom-utils/tsconfig.build.json" },
17
+ { "path": "../ui-i18n/tsconfig.build.json" },
18
+ { "path": "../ui-prop-types/tsconfig.build.json" },
19
+ { "path": "../ui-react-utils/tsconfig.build.json" },
20
+ { "path": "../ui-test-locator/tsconfig.build.json" },
21
+ { "path": "../ui-test-queries/tsconfig.build.json" },
22
+ { "path": "../ui-testable/tsconfig.build.json" },
23
+ { "path": "../ui-utils/tsconfig.build.json" }
24
+ ]
25
+ }