@instructure/ui-source-code-editor 11.7.3-snapshot-43 → 11.7.4-pr-snapshot-1781695314229

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 (34) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/LICENSE.md +1 -0
  3. package/{lib/SourceCodeEditor/v2/props.js → babel.config.cjs} +12 -9
  4. package/es/SourceCodeEditor/v1/index.js +6 -6
  5. package/es/SourceCodeEditor/v2/index.js +5 -5
  6. package/es/exports/a.js +1 -1
  7. package/es/exports/b.js +1 -1
  8. package/package.json +15 -20
  9. package/src/SourceCodeEditor/v1/index.tsx +6 -5
  10. package/src/SourceCodeEditor/v2/index.tsx +5 -4
  11. package/src/exports/a.ts +1 -1
  12. package/src/exports/b.ts +1 -1
  13. package/tsconfig.build.tsbuildinfo +1 -1
  14. package/types/SourceCodeEditor/v1/index.d.ts +2 -1
  15. package/types/SourceCodeEditor/v1/index.d.ts.map +1 -1
  16. package/types/SourceCodeEditor/v2/index.d.ts +2 -1
  17. package/types/SourceCodeEditor/v2/index.d.ts.map +1 -1
  18. package/types/exports/a.d.ts +1 -1
  19. package/types/exports/a.d.ts.map +1 -1
  20. package/types/exports/b.d.ts +1 -1
  21. package/types/exports/b.d.ts.map +1 -1
  22. package/lib/SourceCodeEditor/v1/SearchPanel.js +0 -121
  23. package/lib/SourceCodeEditor/v1/customKeybinding.js +0 -105
  24. package/lib/SourceCodeEditor/v1/index.js +0 -552
  25. package/lib/SourceCodeEditor/v1/props.js +0 -33
  26. package/lib/SourceCodeEditor/v1/styles.js +0 -230
  27. package/lib/SourceCodeEditor/v1/theme.js +0 -60
  28. package/lib/SourceCodeEditor/v2/SearchPanel.js +0 -121
  29. package/lib/SourceCodeEditor/v2/customKeybinding.js +0 -105
  30. package/lib/SourceCodeEditor/v2/index.js +0 -559
  31. package/lib/SourceCodeEditor/v2/styles.js +0 -236
  32. package/lib/exports/a.js +0 -12
  33. package/lib/exports/b.js +0 -12
  34. package/lib/package.json +0 -1
@@ -1,236 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _highlight = require("@lezer/highlight");
8
- /*
9
- * The MIT License (MIT)
10
- *
11
- * Copyright (c) 2015 - present Instructure, Inc.
12
- *
13
- * Permission is hereby granted, free of charge, to any person obtaining a copy
14
- * of this software and associated documentation files (the "Software"), to deal
15
- * in the Software without restriction, including without limitation the rights
16
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
17
- * copies of the Software, and to permit persons to whom the Software is
18
- * furnished to do so, subject to the following conditions:
19
- *
20
- * The above copyright notice and this permission notice shall be included in all
21
- * copies or substantial portions of the Software.
22
- *
23
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
24
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
26
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
28
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
29
- * SOFTWARE.
30
- */
31
-
32
- /**
33
- * ---
34
- * private: true
35
- * ---
36
- * Generates the style object from the theme and provided additional information
37
- * @param {Object} componentTheme The theme variable object.
38
- * @param {Object} props the props of the component, the style is applied to
39
- * @return {Object} The final style object, which will be used in the component
40
- */
41
- const generateStyle = (componentTheme, props, sharedTokens) => {
42
- const {
43
- attachment,
44
- height,
45
- width
46
- } = props;
47
- const attachmentBorderRadius = {
48
- top: {
49
- borderBottomLeftRadius: 0,
50
- borderBottomRightRadius: 0
51
- },
52
- bottom: {
53
- borderTopLeftRadius: 0,
54
- borderTopRightRadius: 0
55
- }
56
- };
57
- const attachmentVariants = {
58
- top: {
59
- marginBottom: 0,
60
- marginTop: '0.25rem'
61
- },
62
- bottom: {
63
- borderTopLeftRadius: 0,
64
- borderTopRightRadius: 0,
65
- marginBottom: '0.25rem'
66
- }
67
- };
68
- const lineHeight = 1.4375;
69
- return {
70
- codeEditor: {
71
- label: 'codeEditor',
72
- position: 'relative',
73
- boxSizing: 'border-box',
74
- height: height || 'auto',
75
- width
76
- },
77
- label: {
78
- label: 'label',
79
- height: '100%',
80
- width: '100%'
81
- },
82
- codeEditorContainer: {
83
- label: 'codeEditorContainer',
84
- height: '100%',
85
- width: '100%',
86
- borderColor: componentTheme?.borderColor,
87
- borderStyle: 'solid',
88
- borderWidth: componentTheme?.borderWidth,
89
- borderRadius: componentTheme.borderRadius,
90
- marginBottom: '1rem',
91
- ...(attachment && {
92
- ...attachmentVariants[attachment],
93
- ...attachmentBorderRadius[attachment]
94
- })
95
- },
96
- theme: {
97
- '&': {
98
- overflow: 'hidden',
99
- background: componentTheme.background,
100
- fontFamily: componentTheme.fontFamily,
101
- fontSize: componentTheme.fontSize,
102
- color: componentTheme.color,
103
- border: 0,
104
- height: '100%',
105
- width: '100%',
106
- minHeight: `${lineHeight}rem`,
107
- lineHeight,
108
- borderRadius: componentTheme.borderRadius,
109
- ...(attachment && {
110
- ...attachmentBorderRadius[attachment]
111
- })
112
- },
113
- '&.cm-editor.cm-focused': {
114
- // Provide a simple default outline to make sure a focused
115
- // editor is visually distinct. Can't leave the default behavior
116
- // because that will apply to the content element, which is
117
- // inside the scrollable container and doesn't include the
118
- // gutters. We also can't use an 'auto' outline, since those
119
- // are, for some reason, drawn behind the element content, which
120
- // will cause things like the active line background to cover
121
- // the outline (#297).
122
- outline: `${componentTheme?.borderWidth} solid ${sharedTokens.focusOutline.infoColor}`
123
- },
124
- '.cm-content': {
125
- padding: `${componentTheme.verticalPadding} 0`
126
- },
127
- '.cm-scroller': {
128
- fontFamily: componentTheme.fontFamily,
129
- lineHeight: 1.4375
130
- },
131
- '.cm-gutters': {
132
- background: componentTheme.gutterBackground,
133
- borderColor: componentTheme.borderColor
134
- },
135
- '.cm-line': {
136
- padding: `0 ${componentTheme.horizontalPadding}`
137
- },
138
- '.cm-activeLine': {
139
- backgroundColor: componentTheme.activeLineColor
140
- },
141
- '&.cm-focused .cm-cursor': {
142
- borderLeftColor: componentTheme.color
143
- },
144
- '.cm-selectionBackground': {
145
- background: 'transparent'
146
- },
147
- '.cm-selectionBackground, .cm-editor::selection': {
148
- backgroundColor: componentTheme.focusedSelectionBackgroundColor + ' !important'
149
- },
150
- '.cm-placeholder': {
151
- // for better contrast
152
- color: componentTheme.placeholderBackgroundColor
153
- }
154
- },
155
- highlightStyle: [
156
- /**
157
- * Copy of `defaultHighlightStyle` from '@codemirror/language'
158
- */
159
- // { tag: tags.meta, color: '#7a757a' },
160
- {
161
- tag: _highlight.tags.link,
162
- textDecoration: 'underline'
163
- }, {
164
- tag: _highlight.tags.heading,
165
- textDecoration: 'underline',
166
- fontWeight: 'bold'
167
- }, {
168
- tag: _highlight.tags.emphasis,
169
- fontStyle: 'italic'
170
- }, {
171
- tag: _highlight.tags.strong,
172
- fontWeight: 'bold'
173
- }, {
174
- tag: _highlight.tags.strikethrough,
175
- textDecoration: 'line-through'
176
- }, {
177
- tag: _highlight.tags.keyword,
178
- color: componentTheme.tagKeywordColor
179
- }, {
180
- tag: [_highlight.tags.atom, _highlight.tags.bool, _highlight.tags.url, _highlight.tags.contentSeparator, _highlight.tags.labelName],
181
- color: componentTheme.tagAtomColor
182
- }, {
183
- tag: [_highlight.tags.literal, _highlight.tags.inserted],
184
- color: componentTheme.tagLiteralColor
185
- }, {
186
- tag: [_highlight.tags.string, _highlight.tags.deleted],
187
- color: componentTheme.tagStringColor
188
- },
189
- // {
190
- // tag: [tags.regexp, tags.escape, tags.special(tags.string)],
191
- // color: '#e40'
192
- // },
193
- {
194
- tag: _highlight.tags.definition(_highlight.tags.variableName),
195
- color: componentTheme.tagDefinitionVariableNameColor
196
- }, {
197
- tag: _highlight.tags.local(_highlight.tags.variableName),
198
- color: componentTheme.tagLocalVariableNameColor
199
- },
200
- // { tag: [tags.typeName, tags.namespace], color: '#085' },
201
- {
202
- tag: _highlight.tags.className,
203
- color: componentTheme.tagClassNameColor
204
- }, {
205
- tag: [_highlight.tags.special(_highlight.tags.variableName), _highlight.tags.macroName],
206
- color: componentTheme.tagSpecialVariableNameColor
207
- }, {
208
- tag: _highlight.tags.definition(_highlight.tags.propertyName),
209
- color: componentTheme.tagDefinitionPropertyNameColor
210
- }, {
211
- tag: _highlight.tags.comment,
212
- color: componentTheme.tagCommentColor
213
- },
214
- // { tag: tags.invalid, color: '#f00' },
215
-
216
- /**
217
- * Custom highlighting overrides
218
- * (where original colors don't have enough contrast against #fff
219
- * or active highlight background)
220
- */
221
- {
222
- tag: _highlight.tags.meta,
223
- color: componentTheme.tagMetaColor
224
- }, {
225
- tag: [_highlight.tags.regexp, _highlight.tags.escape, _highlight.tags.special(_highlight.tags.string)],
226
- color: componentTheme.tagRegExpColor
227
- }, {
228
- tag: [_highlight.tags.typeName, _highlight.tags.namespace],
229
- color: componentTheme.tagTypeNameColor
230
- }, {
231
- tag: _highlight.tags.invalid,
232
- color: componentTheme.tagInvalidColor
233
- }]
234
- };
235
- };
236
- var _default = exports.default = generateStyle;
package/lib/exports/a.js DELETED
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "SourceCodeEditor", {
7
- enumerable: true,
8
- get: function () {
9
- return _v.SourceCodeEditor;
10
- }
11
- });
12
- var _v = require("../SourceCodeEditor/v1");
package/lib/exports/b.js DELETED
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "SourceCodeEditor", {
7
- enumerable: true,
8
- get: function () {
9
- return _v.SourceCodeEditor;
10
- }
11
- });
12
- var _v = require("../SourceCodeEditor/v2");
package/lib/package.json DELETED
@@ -1 +0,0 @@
1
- {"type":"commonjs"}