@difizen/libro-codemirror 0.1.1 → 0.1.3

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 (84) hide show
  1. package/es/auto-complete/filter.d.ts.map +1 -1
  2. package/es/auto-complete/filter.js +1 -7
  3. package/es/auto-complete/index.d.ts.map +1 -1
  4. package/es/auto-complete/index.js +5 -9
  5. package/es/auto-complete/snippet.d.ts.map +1 -1
  6. package/es/auto-complete/snippet.js +2 -2
  7. package/es/auto-complete/state.d.ts.map +1 -1
  8. package/es/auto-complete/state.js +5 -16
  9. package/es/auto-complete/view.d.ts +5 -0
  10. package/es/auto-complete/view.d.ts.map +1 -1
  11. package/es/auto-complete/view.js +2 -13
  12. package/es/completion.js +1 -1
  13. package/es/config.d.ts +15 -10
  14. package/es/config.d.ts.map +1 -1
  15. package/es/config.js +15 -6
  16. package/es/editor-contribution.d.ts +8 -0
  17. package/es/editor-contribution.d.ts.map +1 -0
  18. package/es/editor-contribution.js +30 -0
  19. package/es/editor.d.ts +40 -10
  20. package/es/editor.d.ts.map +1 -1
  21. package/es/editor.js +241 -45
  22. package/es/indentation-markers/map.d.ts +9 -9
  23. package/es/indentation-markers/map.d.ts.map +1 -1
  24. package/es/index.d.ts +3 -1
  25. package/es/index.d.ts.map +1 -1
  26. package/es/index.js +3 -1
  27. package/es/libro-icon.d.ts +2 -2
  28. package/es/libro-icon.d.ts.map +1 -1
  29. package/es/libro-icon.js +2 -2
  30. package/es/lsp/completion.d.ts +5 -0
  31. package/es/lsp/completion.d.ts.map +1 -0
  32. package/es/lsp/completion.js +245 -0
  33. package/es/lsp/format.d.ts +7 -0
  34. package/es/lsp/format.d.ts.map +1 -0
  35. package/es/lsp/format.js +193 -0
  36. package/es/lsp/index.d.ts +7 -0
  37. package/es/lsp/index.d.ts.map +1 -0
  38. package/es/lsp/index.js +6 -0
  39. package/es/lsp/lint.d.ts +3 -0
  40. package/es/lsp/lint.d.ts.map +1 -0
  41. package/es/lsp/lint.js +114 -0
  42. package/es/lsp/protocol.d.ts +7 -0
  43. package/es/lsp/protocol.d.ts.map +1 -0
  44. package/es/lsp/protocol.js +1 -0
  45. package/es/lsp/tooltip.d.ts +3 -0
  46. package/es/lsp/tooltip.d.ts.map +1 -0
  47. package/es/lsp/tooltip.js +113 -0
  48. package/es/lsp/util.d.ts +15 -0
  49. package/es/lsp/util.d.ts.map +1 -0
  50. package/es/lsp/util.js +58 -0
  51. package/es/mode.d.ts.map +1 -1
  52. package/es/module.d.ts +3 -0
  53. package/es/module.d.ts.map +1 -0
  54. package/es/module.js +4 -0
  55. package/es/theme.js +4 -5
  56. package/es/tooltip.d.ts.map +1 -1
  57. package/es/tooltip.js +2 -4
  58. package/package.json +7 -5
  59. package/src/auto-complete/filter.ts +5 -7
  60. package/src/auto-complete/index.ts +6 -7
  61. package/src/auto-complete/snippet.ts +8 -2
  62. package/src/auto-complete/state.ts +13 -18
  63. package/src/auto-complete/view.ts +7 -13
  64. package/src/completion.ts +2 -2
  65. package/src/config.ts +40 -28
  66. package/src/editor-contribution.ts +17 -0
  67. package/src/editor.ts +226 -50
  68. package/src/hyperlink.ts +1 -1
  69. package/src/indentation-markers/index.ts +3 -3
  70. package/src/indentation-markers/map.ts +9 -9
  71. package/src/index.ts +4 -1
  72. package/src/libro-icon.tsx +4 -0
  73. package/src/lsp/completion.ts +175 -0
  74. package/src/lsp/format.ts +144 -0
  75. package/src/lsp/index.ts +6 -0
  76. package/src/lsp/lint.ts +125 -0
  77. package/src/lsp/protocol.ts +8 -0
  78. package/src/lsp/tooltip.ts +76 -0
  79. package/src/lsp/util.ts +69 -0
  80. package/src/mode.ts +1 -1
  81. package/src/module.ts +8 -0
  82. package/src/theme.ts +4 -4
  83. package/src/tooltip.ts +2 -4
  84. package/src/libro-icon.ts +0 -4
package/src/mode.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { markdown } from '@codemirror/lang-markdown';
2
- import { LanguageDescription } from '@codemirror/language';
3
2
  import type { LanguageSupport } from '@codemirror/language';
3
+ import { LanguageDescription } from '@codemirror/language';
4
4
  import { defaultMimeType } from '@difizen/libro-code-editor';
5
5
  import { PathExt } from '@difizen/libro-common';
6
6
  import { highlightTree } from '@lezer/highlight';
package/src/module.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { CodeEditorModule } from '@difizen/libro-code-editor';
2
+ import { ManaModule } from '@difizen/mana-app';
3
+
4
+ import { CodeMirrorEditorContribution } from './editor-contribution.js';
5
+
6
+ export const CodeMirrorEditorModule = ManaModule.create()
7
+ .register(CodeMirrorEditorContribution)
8
+ .dependOn(CodeEditorModule);
package/src/theme.ts CHANGED
@@ -14,7 +14,7 @@ export const jupyterEditorTheme = EditorView.theme({
14
14
  * these things differently.
15
15
  */
16
16
  '&': {
17
- background: 'var(--jp-layout-color0)',
17
+ background: 'var(--mana-libro-input-background)',
18
18
  color: 'var(--mana-libro-text-default-color)',
19
19
  },
20
20
 
@@ -88,9 +88,9 @@ export const jupyterEditorTheme = EditorView.theme({
88
88
  lineHeight: '20px',
89
89
  },
90
90
 
91
- // '.cm-editor': {
92
- // paddingTop: '24px',
93
- // },
91
+ '.cm-editor': {
92
+ background: 'var(--mana-libro-input-background)',
93
+ },
94
94
 
95
95
  '.cm-searchMatch': {
96
96
  backgroundColor: 'var(--jp-search-unselected-match-background-color)',
package/src/tooltip.ts CHANGED
@@ -43,7 +43,7 @@ const tooltipField = StateField.define<Tooltip | null>({
43
43
  return null;
44
44
  },
45
45
 
46
- update(_tooltips, tr) {
46
+ update(tooltips, tr) {
47
47
  const { effects } = tr;
48
48
  for (const effect of effects) {
49
49
  if (effect.is(closeTooltipEffect)) {
@@ -119,9 +119,7 @@ class TooltipPlugin implements PluginValue {
119
119
  });
120
120
  return undefined;
121
121
  })
122
- .catch(() => {
123
- //
124
- });
122
+ .catch(console.error);
125
123
  }
126
124
  }
127
125
  });
package/src/libro-icon.ts DELETED
@@ -1,4 +0,0 @@
1
- export const FoldIcon =
2
- '<svg width="8px" height="6px" viewBox="0 0 8 6" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>1.通用/2.Icon图标/Line/Down</title><g id="0424" stroke="none" stroke-width="1" fill="none" fillRule="evenodd"><g id="Notebook-cell-色阶" transform="translate(-2015.000000, -434.000000)" fill="#A4AECB"><g id="编组-15" transform="translate(2004.000000, 407.000000)"><g id="1.通用/2.Icon图标/Line/Down" transform="translate(11.250000, 27.500000)"><path d="M7.34387369,0 L6.61145181,0 C6.56164712,0 6.51477212,0.0244140625 6.48547525,0.064453125 L3.71106119,3.88867188 L0.936647123,0.064453125 C0.907350248,0.0244140625 0.860475248,0 0.81067056,0 L0.0782486852,0 C0.0147721227,0 -0.0223372523,0.072265625 0.0147721227,0.124023438 L3.4581315,4.87109375 C3.5831315,5.04296875 3.83899087,5.04296875 3.96301431,4.87109375 L7.40637369,0.124023437 C7.44445962,0.072265625 7.40735025,0 7.34387369,0 Z" id="Down"></path></g></g></g></g></svg>';
3
- export const UnFoldIcon =
4
- '<svg width="6px" height="8px" viewBox="0 0 6 8" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><title>1.通用/2.Icon图标/Line/Down收起</title><g id="0424" stroke="none" stroke-width="1" fill="none" fillRule="evenodd"><g id="Notebook-cell-色阶" transform="translate(-2094.000000, -433.000000)" fill="#A4AECB"><g id="编组-15备份" transform="translate(2082.000000, 407.000000)"><g id="1.通用/2.Icon图标/Line/Down" transform="translate(15.000000, 30.039124) rotate(270.000000) translate(-15.000000, -30.039124) translate(11.289124, 27.539124)"><path d="M7.34387369,1.77635684e-15 L6.61145181,1.77635684e-15 C6.56164712,1.77635684e-15 6.51477212,0.0244140625 6.48547525,0.064453125 L3.71106119,3.88867188 L0.936647123,0.064453125 C0.907350248,0.0244140625 0.860475248,1.77635684e-15 0.81067056,1.77635684e-15 L0.0782486852,1.77635684e-15 C0.0147721227,1.77635684e-15 -0.0223372523,0.072265625 0.0147721227,0.124023438 L3.4581315,4.87109375 C3.5831315,5.04296875 3.83899087,5.04296875 3.96301431,4.87109375 L7.40637369,0.124023438 C7.44445962,0.072265625 7.40735025,1.77635684e-15 7.34387369,1.77635684e-15 Z" id="Down"></path></g></g></g></g></svg>';