@dxos/react-ui-editor 0.4.8-main.7d8f6a4 → 0.4.8-main.7ef1486

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.
@@ -5,10 +5,11 @@
5
5
  import { type Extension, Facet } from '@codemirror/state';
6
6
  import { keymap } from '@codemirror/view';
7
7
  import { vim } from '@replit/codemirror-vim';
8
+ import { vscodeKeymap } from '@replit/codemirror-vscode-keymap';
8
9
 
9
10
  export const focusEvent = 'focus.container';
10
11
 
11
- export type EditorMode = 'default' | 'vim' | undefined;
12
+ export type EditorMode = 'default' | 'vim' | 'vscode' | undefined;
12
13
 
13
14
  export type EditorConfig = {
14
15
  type: string;
@@ -21,7 +22,13 @@ export const editorMode = Facet.define<EditorConfig, EditorConfig>({
21
22
 
22
23
  export const EditorModes: { [mode: string]: Extension } = {
23
24
  default: [],
25
+ vscode: [
26
+ // https://github.com/replit/codemirror-vscode-keymap
27
+ editorMode.of({ type: 'vscode' }),
28
+ keymap.of(vscodeKeymap),
29
+ ],
24
30
  vim: [
31
+ // https://github.com/replit/codemirror-vim
25
32
  vim(),
26
33
  editorMode.of({ type: 'vim', noTabster: true }),
27
34
  keymap.of([
@@ -236,28 +236,44 @@ export const defaultTheme: ThemeStyles = {
236
236
  * </div>
237
237
  * </div
238
238
  */
239
- '.cm-panels': {
240
- border: `1px solid ${get(tokens, 'extend.colors.neutral.200')}`,
241
- },
239
+ '.cm-panels': {},
242
240
  '.cm-panel': {
243
- background: get(tokens, 'extend.colors.neutral.50'),
244
241
  fontFamily: get(tokens, 'fontFamily.body', []).join(','),
245
242
  },
243
+ '.cm-panel input[type=checkbox]': {
244
+ marginRight: '0.4rem !important',
245
+ },
246
+ '&light .cm-panel': {
247
+ background: get(tokens, 'extend.colors.neutral.50'),
248
+ },
249
+ '&dark .cm-panel': {
250
+ background: get(tokens, 'extend.colors.neutral.850'),
251
+ },
246
252
  '.cm-button': {
247
253
  margin: '4px',
248
254
  fontFamily: get(tokens, 'fontFamily.body', []).join(','),
249
- background: get(tokens, 'extend.colors.neutral.100'),
250
255
  backgroundImage: 'none',
251
256
  border: 'none',
257
+ '&:active': {
258
+ backgroundImage: 'none',
259
+ },
260
+ },
261
+ '&light .cm-button': {
262
+ background: get(tokens, 'extend.colors.neutral.100'),
252
263
  '&:hover': {
253
264
  background: get(tokens, 'extend.colors.neutral.200'),
254
265
  },
255
266
  '&:active': {
256
267
  background: get(tokens, 'extend.colors.neutral.300'),
257
- backgroundImage: 'none',
258
268
  },
259
269
  },
260
- '.cm-panel input[type=checkbox]': {
261
- marginRight: '0.4rem !important',
270
+ '&dark .cm-button': {
271
+ background: get(tokens, 'extend.colors.neutral.800'),
272
+ '&:hover': {
273
+ background: get(tokens, 'extend.colors.neutral.700'),
274
+ },
275
+ '&:active': {
276
+ background: get(tokens, 'extend.colors.neutral.600'),
277
+ },
262
278
  },
263
279
  };