@xh/hoist 79.0.0-SNAPSHOT.1765828263630 → 79.0.0-SNAPSHOT.1765831120891

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.
@@ -11,17 +11,8 @@ import {
11
11
  foldGutter,
12
12
  foldKeymap,
13
13
  indentOnInput,
14
- LanguageSupport,
15
14
  syntaxHighlighting
16
15
  } from '@codemirror/language';
17
- // Import the languages you want to support
18
- import {javascript} from '@codemirror/lang-javascript';
19
- import {python} from '@codemirror/lang-python';
20
- import {html} from '@codemirror/lang-html';
21
- import {css} from '@codemirror/lang-css';
22
- import {json} from '@codemirror/lang-json';
23
- import {sql} from '@codemirror/lang-sql';
24
-
25
16
  import {linter, lintGutter} from '@codemirror/lint';
26
17
  import {highlightSelectionMatches, search} from '@codemirror/search';
27
18
  import {
@@ -61,17 +52,9 @@ import classNames from 'classnames';
61
52
  import {compact, isEmpty, isFunction, isObject} from 'lodash';
62
53
  import {ReactElement} from 'react';
63
54
  import './CodeInput.scss';
64
- // Map of supported language aliases to CodeMirror factories
65
- const LANGUAGE_EXTENSIONS: Record<string, () => LanguageSupport> = {
66
- js: javascript,
67
- javascript: javascript,
68
- py: python,
69
- python: python,
70
- html: html,
71
- css: css,
72
- json: json,
73
- sql: sql
74
- };
55
+ import {javascript} from '@codemirror/lang-javascript';
56
+
57
+ // import {languages} from '@codemirror/language-data';
75
58
 
76
59
  export interface CodeInputProps extends HoistProps, HoistInputProps, LayoutProps {
77
60
  /** True to focus the control on render. */
@@ -491,7 +474,7 @@ class CodeInputModel extends HoistInputModel {
491
474
  if (propsHighlightActiveLine)
492
475
  extensions.push(highlightActiveLine(), highlightActiveLineGutter());
493
476
  if (autoFocus) extensions.push(this.autofocusExtension);
494
- if (language) extensions.push(await this.getLanguageExtensionAsync(language));
477
+ if (language) extensions.push(javascript());
495
478
 
496
479
  return extensions.filter(it => !isEmpty(it));
497
480
  }
@@ -501,20 +484,19 @@ class CodeInputModel extends HoistInputModel {
501
484
  return XH.darkTheme ? oneDark : lightTheme;
502
485
  }
503
486
 
504
- private async getLanguageExtensionAsync(lang: string): Promise<LanguageSupport> {
505
- if (!lang) return null;
506
- const langFactory = LANGUAGE_EXTENSIONS[lang.toLowerCase()];
507
- if (!langFactory) {
508
- console.warn(`Language not found: ${lang}`);
509
- return null;
510
- }
511
- try {
512
- return langFactory();
513
- } catch (err) {
514
- console.error(`Failed to load language: ${lang}`, err);
515
- return null;
516
- }
517
- }
487
+ // private async getLanguageExtensionAsync(lang: string): Promise<LanguageSupport> {
488
+ // try {
489
+ // const langDesc: LanguageDescription | undefined = find(
490
+ // languages,
491
+ // it => includes(it.alias, lang) || it.name.toLowerCase() === lang.toLowerCase()
492
+ // );
493
+ // if (!langDesc) return null;
494
+ // return await langDesc.load();
495
+ // } catch (err) {
496
+ // console.error(`Failed to load language: ${lang}`, err);
497
+ // return null;
498
+ // }
499
+ // }
518
500
 
519
501
  private autofocusExtension = ViewPlugin.fromClass(
520
502
  class {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xh/hoist",
3
- "version": "79.0.0-SNAPSHOT.1765828263630",
3
+ "version": "79.0.0-SNAPSHOT.1765831120891",
4
4
  "description": "Hoist add-on for building and deploying React Applications.",
5
5
  "repository": "github:xh/hoist-react",
6
6
  "homepage": "https://xh.io",
@@ -34,12 +34,7 @@
34
34
  "@blueprintjs/datetime": "^5.3.7",
35
35
  "@blueprintjs/datetime2": "^2.3.7",
36
36
  "@codemirror/commands": "6.9.0",
37
- "@codemirror/lang-css": "^6.2.0",
38
- "@codemirror/lang-html": "^6.2.0",
39
37
  "@codemirror/lang-javascript": "^6.2.4",
40
- "@codemirror/lang-json": "^6.0.1",
41
- "@codemirror/lang-python": "^6.2.0",
42
- "@codemirror/lang-sql": "^6.2.0",
43
38
  "@codemirror/language": "6.11.3",
44
39
  "@codemirror/lint": "6.9.0",
45
40
  "@codemirror/search": "6.5.11",