@theia/notebook 1.67.0-next.13 → 1.67.0-next.56

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 (244) hide show
  1. package/README.md +1 -1
  2. package/package.json +7 -7
  3. package/src/browser/contributions/notebook-actions-contribution.ts +25 -22
  4. package/src/browser/contributions/notebook-cell-actions-contribution.ts +20 -9
  5. package/src/browser/contributions/notebook-label-provider-contribution.ts +2 -1
  6. package/src/browser/contributions/notebook-outline-contribution.ts +8 -6
  7. package/src/browser/contributions/notebook-status-bar-contribution.ts +4 -6
  8. package/src/browser/index.ts +1 -0
  9. package/src/browser/notebook-cell-open-handler.ts +3 -3
  10. package/src/browser/notebook-editor-split-contribution.ts +51 -0
  11. package/src/browser/notebook-editor-widget-factory.ts +11 -1
  12. package/src/browser/notebook-editor-widget.tsx +18 -3
  13. package/src/browser/notebook-frontend-module.ts +5 -0
  14. package/src/browser/notebook-open-handler.ts +19 -11
  15. package/src/browser/notebook-types.ts +1 -0
  16. package/src/browser/service/notebook-context-manager.ts +17 -9
  17. package/src/browser/view/notebook-cell-editor.tsx +13 -5
  18. package/src/browser/view/notebook-cell-list-view.tsx +15 -12
  19. package/src/browser/view/notebook-cell-toolbar-factory.tsx +5 -4
  20. package/src/browser/view/notebook-code-cell-view.tsx +6 -1
  21. package/src/browser/view/notebook-markdown-cell-view.tsx +27 -7
  22. package/src/browser/view-model/notebook-cell-model.ts +8 -41
  23. package/src/browser/view-model/notebook-model.ts +2 -33
  24. package/src/browser/view-model/notebook-view-model.ts +138 -0
  25. package/lib/browser/contributions/cell-operations.d.ts +0 -8
  26. package/lib/browser/contributions/cell-operations.d.ts.map +0 -1
  27. package/lib/browser/contributions/cell-operations.js +0 -45
  28. package/lib/browser/contributions/cell-operations.js.map +0 -1
  29. package/lib/browser/contributions/notebook-actions-contribution.d.ts +0 -48
  30. package/lib/browser/contributions/notebook-actions-contribution.d.ts.map +0 -1
  31. package/lib/browser/contributions/notebook-actions-contribution.js +0 -341
  32. package/lib/browser/contributions/notebook-actions-contribution.js.map +0 -1
  33. package/lib/browser/contributions/notebook-cell-actions-contribution.d.ts +0 -66
  34. package/lib/browser/contributions/notebook-cell-actions-contribution.d.ts.map +0 -1
  35. package/lib/browser/contributions/notebook-cell-actions-contribution.js +0 -512
  36. package/lib/browser/contributions/notebook-cell-actions-contribution.js.map +0 -1
  37. package/lib/browser/contributions/notebook-color-contribution.d.ts +0 -6
  38. package/lib/browser/contributions/notebook-color-contribution.d.ts.map +0 -1
  39. package/lib/browser/contributions/notebook-color-contribution.js +0 -247
  40. package/lib/browser/contributions/notebook-color-contribution.js.map +0 -1
  41. package/lib/browser/contributions/notebook-context-keys.d.ts +0 -44
  42. package/lib/browser/contributions/notebook-context-keys.d.ts.map +0 -1
  43. package/lib/browser/contributions/notebook-context-keys.js +0 -108
  44. package/lib/browser/contributions/notebook-context-keys.js.map +0 -1
  45. package/lib/browser/contributions/notebook-label-provider-contribution.d.ts +0 -19
  46. package/lib/browser/contributions/notebook-label-provider-contribution.d.ts.map +0 -1
  47. package/lib/browser/contributions/notebook-label-provider-contribution.js +0 -85
  48. package/lib/browser/contributions/notebook-label-provider-contribution.js.map +0 -1
  49. package/lib/browser/contributions/notebook-outline-contribution.d.ts +0 -28
  50. package/lib/browser/contributions/notebook-outline-contribution.d.ts.map +0 -1
  51. package/lib/browser/contributions/notebook-outline-contribution.js +0 -113
  52. package/lib/browser/contributions/notebook-outline-contribution.js.map +0 -1
  53. package/lib/browser/contributions/notebook-output-action-contribution.d.ts +0 -16
  54. package/lib/browser/contributions/notebook-output-action-contribution.d.ts.map +0 -1
  55. package/lib/browser/contributions/notebook-output-action-contribution.js +0 -83
  56. package/lib/browser/contributions/notebook-output-action-contribution.js.map +0 -1
  57. package/lib/browser/contributions/notebook-status-bar-contribution.d.ts +0 -12
  58. package/lib/browser/contributions/notebook-status-bar-contribution.d.ts.map +0 -1
  59. package/lib/browser/contributions/notebook-status-bar-contribution.js +0 -63
  60. package/lib/browser/contributions/notebook-status-bar-contribution.js.map +0 -1
  61. package/lib/browser/contributions/notebook-undo-redo-handler.d.ts +0 -10
  62. package/lib/browser/contributions/notebook-undo-redo-handler.d.ts.map +0 -1
  63. package/lib/browser/contributions/notebook-undo-redo-handler.js +0 -49
  64. package/lib/browser/contributions/notebook-undo-redo-handler.js.map +0 -1
  65. package/lib/browser/index.d.ts +0 -13
  66. package/lib/browser/index.d.ts.map +0 -1
  67. package/lib/browser/index.js +0 -31
  68. package/lib/browser/index.js.map +0 -1
  69. package/lib/browser/notebook-cell-open-handler.d.ts +0 -10
  70. package/lib/browser/notebook-cell-open-handler.d.ts.map +0 -1
  71. package/lib/browser/notebook-cell-open-handler.js +0 -51
  72. package/lib/browser/notebook-cell-open-handler.js.map +0 -1
  73. package/lib/browser/notebook-cell-resource-resolver.d.ts +0 -26
  74. package/lib/browser/notebook-cell-resource-resolver.d.ts.map +0 -1
  75. package/lib/browser/notebook-cell-resource-resolver.js +0 -109
  76. package/lib/browser/notebook-cell-resource-resolver.js.map +0 -1
  77. package/lib/browser/notebook-editor-widget-factory.d.ts +0 -19
  78. package/lib/browser/notebook-editor-widget-factory.d.ts.map +0 -1
  79. package/lib/browser/notebook-editor-widget-factory.js +0 -93
  80. package/lib/browser/notebook-editor-widget-factory.js.map +0 -1
  81. package/lib/browser/notebook-editor-widget.d.ts +0 -99
  82. package/lib/browser/notebook-editor-widget.d.ts.map +0 -1
  83. package/lib/browser/notebook-editor-widget.js +0 -323
  84. package/lib/browser/notebook-editor-widget.js.map +0 -1
  85. package/lib/browser/notebook-frontend-module.d.ts +0 -5
  86. package/lib/browser/notebook-frontend-module.d.ts.map +0 -1
  87. package/lib/browser/notebook-frontend-module.js +0 -112
  88. package/lib/browser/notebook-frontend-module.js.map +0 -1
  89. package/lib/browser/notebook-open-handler.d.ts +0 -23
  90. package/lib/browser/notebook-open-handler.d.ts.map +0 -1
  91. package/lib/browser/notebook-open-handler.js +0 -113
  92. package/lib/browser/notebook-open-handler.js.map +0 -1
  93. package/lib/browser/notebook-output-utils.d.ts +0 -13
  94. package/lib/browser/notebook-output-utils.d.ts.map +0 -1
  95. package/lib/browser/notebook-output-utils.js +0 -112
  96. package/lib/browser/notebook-output-utils.js.map +0 -1
  97. package/lib/browser/notebook-renderer-registry.d.ts +0 -25
  98. package/lib/browser/notebook-renderer-registry.d.ts.map +0 -1
  99. package/lib/browser/notebook-renderer-registry.js +0 -72
  100. package/lib/browser/notebook-renderer-registry.js.map +0 -1
  101. package/lib/browser/notebook-type-registry.d.ts +0 -12
  102. package/lib/browser/notebook-type-registry.d.ts.map +0 -1
  103. package/lib/browser/notebook-type-registry.js +0 -60
  104. package/lib/browser/notebook-type-registry.js.map +0 -1
  105. package/lib/browser/notebook-types.d.ts +0 -130
  106. package/lib/browser/notebook-types.d.ts.map +0 -1
  107. package/lib/browser/notebook-types.js +0 -28
  108. package/lib/browser/notebook-types.js.map +0 -1
  109. package/lib/browser/renderers/cell-output-webview.d.ts +0 -26
  110. package/lib/browser/renderers/cell-output-webview.d.ts.map +0 -1
  111. package/lib/browser/renderers/cell-output-webview.js +0 -21
  112. package/lib/browser/renderers/cell-output-webview.js.map +0 -1
  113. package/lib/browser/service/notebook-cell-editor-service.d.ts +0 -23
  114. package/lib/browser/service/notebook-cell-editor-service.d.ts.map +0 -1
  115. package/lib/browser/service/notebook-cell-editor-service.js +0 -89
  116. package/lib/browser/service/notebook-cell-editor-service.js.map +0 -1
  117. package/lib/browser/service/notebook-cell-status-bar-service.d.ts +0 -39
  118. package/lib/browser/service/notebook-cell-status-bar-service.d.ts.map +0 -1
  119. package/lib/browser/service/notebook-cell-status-bar-service.js +0 -69
  120. package/lib/browser/service/notebook-cell-status-bar-service.js.map +0 -1
  121. package/lib/browser/service/notebook-clipboard-service.d.ts +0 -10
  122. package/lib/browser/service/notebook-clipboard-service.d.ts.map +0 -1
  123. package/lib/browser/service/notebook-clipboard-service.js +0 -42
  124. package/lib/browser/service/notebook-clipboard-service.js.map +0 -1
  125. package/lib/browser/service/notebook-context-manager.d.ts +0 -26
  126. package/lib/browser/service/notebook-context-manager.d.ts.map +0 -1
  127. package/lib/browser/service/notebook-context-manager.js +0 -131
  128. package/lib/browser/service/notebook-context-manager.js.map +0 -1
  129. package/lib/browser/service/notebook-editor-widget-service.d.ts +0 -27
  130. package/lib/browser/service/notebook-editor-widget-service.d.ts.map +0 -1
  131. package/lib/browser/service/notebook-editor-widget-service.js +0 -124
  132. package/lib/browser/service/notebook-editor-widget-service.js.map +0 -1
  133. package/lib/browser/service/notebook-execution-service.d.ts +0 -25
  134. package/lib/browser/service/notebook-execution-service.d.ts.map +0 -1
  135. package/lib/browser/service/notebook-execution-service.js +0 -150
  136. package/lib/browser/service/notebook-execution-service.js.map +0 -1
  137. package/lib/browser/service/notebook-execution-state-service.d.ts +0 -78
  138. package/lib/browser/service/notebook-execution-state-service.d.ts.map +0 -1
  139. package/lib/browser/service/notebook-execution-state-service.js +0 -247
  140. package/lib/browser/service/notebook-execution-state-service.js.map +0 -1
  141. package/lib/browser/service/notebook-kernel-history-service.d.ts +0 -28
  142. package/lib/browser/service/notebook-kernel-history-service.d.ts.map +0 -1
  143. package/lib/browser/service/notebook-kernel-history-service.js +0 -116
  144. package/lib/browser/service/notebook-kernel-history-service.js.map +0 -1
  145. package/lib/browser/service/notebook-kernel-quick-pick-service.d.ts +0 -61
  146. package/lib/browser/service/notebook-kernel-quick-pick-service.d.ts.map +0 -1
  147. package/lib/browser/service/notebook-kernel-quick-pick-service.js +0 -425
  148. package/lib/browser/service/notebook-kernel-quick-pick-service.js.map +0 -1
  149. package/lib/browser/service/notebook-kernel-service.d.ts +0 -125
  150. package/lib/browser/service/notebook-kernel-service.d.ts.map +0 -1
  151. package/lib/browser/service/notebook-kernel-service.js +0 -268
  152. package/lib/browser/service/notebook-kernel-service.js.map +0 -1
  153. package/lib/browser/service/notebook-model-resolver-service.d.ts +0 -28
  154. package/lib/browser/service/notebook-model-resolver-service.d.ts.map +0 -1
  155. package/lib/browser/service/notebook-model-resolver-service.js +0 -157
  156. package/lib/browser/service/notebook-model-resolver-service.js.map +0 -1
  157. package/lib/browser/service/notebook-monaco-text-model-service.d.ts +0 -21
  158. package/lib/browser/service/notebook-monaco-text-model-service.d.ts.map +0 -1
  159. package/lib/browser/service/notebook-monaco-text-model-service.js +0 -73
  160. package/lib/browser/service/notebook-monaco-text-model-service.js.map +0 -1
  161. package/lib/browser/service/notebook-options.d.ts +0 -30
  162. package/lib/browser/service/notebook-options.d.ts.map +0 -1
  163. package/lib/browser/service/notebook-options.js +0 -130
  164. package/lib/browser/service/notebook-options.js.map +0 -1
  165. package/lib/browser/service/notebook-renderer-messaging-service.d.ts +0 -35
  166. package/lib/browser/service/notebook-renderer-messaging-service.d.ts.map +0 -1
  167. package/lib/browser/service/notebook-renderer-messaging-service.js +0 -100
  168. package/lib/browser/service/notebook-renderer-messaging-service.js.map +0 -1
  169. package/lib/browser/service/notebook-service.d.ts +0 -68
  170. package/lib/browser/service/notebook-service.d.ts.map +0 -1
  171. package/lib/browser/service/notebook-service.js +0 -184
  172. package/lib/browser/service/notebook-service.js.map +0 -1
  173. package/lib/browser/view/notebook-cell-editor.d.ts +0 -44
  174. package/lib/browser/view/notebook-cell-editor.d.ts.map +0 -1
  175. package/lib/browser/view/notebook-cell-editor.js +0 -267
  176. package/lib/browser/view/notebook-cell-editor.js.map +0 -1
  177. package/lib/browser/view/notebook-cell-list-view.d.ts +0 -56
  178. package/lib/browser/view/notebook-cell-list-view.d.ts.map +0 -1
  179. package/lib/browser/view/notebook-cell-list-view.js +0 -222
  180. package/lib/browser/view/notebook-cell-list-view.js.map +0 -1
  181. package/lib/browser/view/notebook-cell-toolbar-factory.d.ts +0 -33
  182. package/lib/browser/view/notebook-cell-toolbar-factory.d.ts.map +0 -1
  183. package/lib/browser/view/notebook-cell-toolbar-factory.js +0 -110
  184. package/lib/browser/view/notebook-cell-toolbar-factory.js.map +0 -1
  185. package/lib/browser/view/notebook-cell-toolbar.d.ts +0 -25
  186. package/lib/browser/view/notebook-cell-toolbar.d.ts.map +0 -1
  187. package/lib/browser/view/notebook-cell-toolbar.js +0 -51
  188. package/lib/browser/view/notebook-cell-toolbar.js.map +0 -1
  189. package/lib/browser/view/notebook-code-cell-view.d.ts +0 -91
  190. package/lib/browser/view/notebook-code-cell-view.d.ts.map +0 -1
  191. package/lib/browser/view/notebook-code-cell-view.js +0 -333
  192. package/lib/browser/view/notebook-code-cell-view.js.map +0 -1
  193. package/lib/browser/view/notebook-find-widget.d.ts +0 -63
  194. package/lib/browser/view/notebook-find-widget.d.ts.map +0 -1
  195. package/lib/browser/view/notebook-find-widget.js +0 -225
  196. package/lib/browser/view/notebook-find-widget.js.map +0 -1
  197. package/lib/browser/view/notebook-main-toolbar.d.ts +0 -53
  198. package/lib/browser/view/notebook-main-toolbar.d.ts.map +0 -1
  199. package/lib/browser/view/notebook-main-toolbar.js +0 -184
  200. package/lib/browser/view/notebook-main-toolbar.js.map +0 -1
  201. package/lib/browser/view/notebook-markdown-cell-view.d.ts +0 -26
  202. package/lib/browser/view/notebook-markdown-cell-view.d.ts.map +0 -1
  203. package/lib/browser/view/notebook-markdown-cell-view.js +0 -198
  204. package/lib/browser/view/notebook-markdown-cell-view.js.map +0 -1
  205. package/lib/browser/view/notebook-viewport-service.d.ts +0 -17
  206. package/lib/browser/view/notebook-viewport-service.d.ts.map +0 -1
  207. package/lib/browser/view/notebook-viewport-service.js +0 -61
  208. package/lib/browser/view/notebook-viewport-service.js.map +0 -1
  209. package/lib/browser/view-model/notebook-cell-model.d.ts +0 -149
  210. package/lib/browser/view-model/notebook-cell-model.d.ts.map +0 -1
  211. package/lib/browser/view-model/notebook-cell-model.js +0 -391
  212. package/lib/browser/view-model/notebook-cell-model.js.map +0 -1
  213. package/lib/browser/view-model/notebook-cell-output-model.d.ts +0 -17
  214. package/lib/browser/view-model/notebook-cell-output-model.d.ts.map +0 -1
  215. package/lib/browser/view-model/notebook-cell-output-model.js +0 -87
  216. package/lib/browser/view-model/notebook-cell-output-model.js.map +0 -1
  217. package/lib/browser/view-model/notebook-model.d.ts +0 -93
  218. package/lib/browser/view-model/notebook-model.d.ts.map +0 -1
  219. package/lib/browser/view-model/notebook-model.js +0 -468
  220. package/lib/browser/view-model/notebook-model.js.map +0 -1
  221. package/lib/common/index.d.ts +0 -3
  222. package/lib/common/index.d.ts.map +0 -1
  223. package/lib/common/index.js +0 -21
  224. package/lib/common/index.js.map +0 -1
  225. package/lib/common/notebook-common.d.ts +0 -227
  226. package/lib/common/notebook-common.d.ts.map +0 -1
  227. package/lib/common/notebook-common.js +0 -151
  228. package/lib/common/notebook-common.js.map +0 -1
  229. package/lib/common/notebook-preferences.d.ts +0 -15
  230. package/lib/common/notebook-preferences.d.ts.map +0 -1
  231. package/lib/common/notebook-preferences.js +0 -89
  232. package/lib/common/notebook-preferences.js.map +0 -1
  233. package/lib/common/notebook-protocol.d.ts +0 -21
  234. package/lib/common/notebook-protocol.d.ts.map +0 -1
  235. package/lib/common/notebook-protocol.js +0 -18
  236. package/lib/common/notebook-protocol.js.map +0 -1
  237. package/lib/common/notebook-range.d.ts +0 -14
  238. package/lib/common/notebook-range.d.ts.map +0 -1
  239. package/lib/common/notebook-range.js +0 -18
  240. package/lib/common/notebook-range.js.map +0 -1
  241. package/lib/node/notebook-backend-module.d.ts +0 -4
  242. package/lib/node/notebook-backend-module.d.ts.map +0 -1
  243. package/lib/node/notebook-backend-module.js +0 -23
  244. package/lib/node/notebook-backend-module.js.map +0 -1
@@ -1,73 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2024 TypeFox and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.NotebookMonacoTextModelService = exports.NotebookMonacoEditorModelFilter = void 0;
19
- const tslib_1 = require("tslib");
20
- const core_1 = require("@theia/core");
21
- const inversify_1 = require("@theia/core/shared/inversify");
22
- const monaco_text_model_service_1 = require("@theia/monaco/lib/browser/monaco-text-model-service");
23
- const notebook_common_1 = require("../../common/notebook-common");
24
- let NotebookMonacoEditorModelFilter = class NotebookMonacoEditorModelFilter {
25
- constructor() {
26
- this.onDidCreateCellModelEmitter = new core_1.Emitter();
27
- }
28
- get onDidCreateCellModel() {
29
- return this.onDidCreateCellModelEmitter.event;
30
- }
31
- filter(model) {
32
- const applies = model.uri.startsWith(notebook_common_1.CellUri.cellUriScheme);
33
- if (applies) {
34
- // If the model is for a notebook cell, we emit the event to notify the listeners.
35
- // We create our own event here, as we don't want to propagate the creation of the cell to the plugin host.
36
- // Instead, we want to do that ourselves once the notebook model is completely initialized.
37
- this.onDidCreateCellModelEmitter.fire(model);
38
- }
39
- return applies;
40
- }
41
- };
42
- exports.NotebookMonacoEditorModelFilter = NotebookMonacoEditorModelFilter;
43
- exports.NotebookMonacoEditorModelFilter = NotebookMonacoEditorModelFilter = tslib_1.__decorate([
44
- (0, inversify_1.injectable)()
45
- ], NotebookMonacoEditorModelFilter);
46
- /**
47
- * special service for creating monaco textmodels for notebook cells.
48
- * Its for optimization purposes since there is alot of overhead otherwise with calling the backend to create a document for each cell and other smaller things.
49
- */
50
- let NotebookMonacoTextModelService = class NotebookMonacoTextModelService {
51
- getOrCreateNotebookCellModelReference(uri) {
52
- return this.monacoTextModelService.createModelReference(uri);
53
- }
54
- async createTextModelsForNotebook(notebook) {
55
- await Promise.all(notebook.cells.map(cell => cell.resolveTextModel()));
56
- }
57
- get onDidCreateNotebookCellModel() {
58
- return this.notebookMonacoEditorModelFilter.onDidCreateCellModel;
59
- }
60
- };
61
- exports.NotebookMonacoTextModelService = NotebookMonacoTextModelService;
62
- tslib_1.__decorate([
63
- (0, inversify_1.inject)(monaco_text_model_service_1.MonacoTextModelService),
64
- tslib_1.__metadata("design:type", monaco_text_model_service_1.MonacoTextModelService)
65
- ], NotebookMonacoTextModelService.prototype, "monacoTextModelService", void 0);
66
- tslib_1.__decorate([
67
- (0, inversify_1.inject)(NotebookMonacoEditorModelFilter),
68
- tslib_1.__metadata("design:type", NotebookMonacoEditorModelFilter)
69
- ], NotebookMonacoTextModelService.prototype, "notebookMonacoEditorModelFilter", void 0);
70
- exports.NotebookMonacoTextModelService = NotebookMonacoTextModelService = tslib_1.__decorate([
71
- (0, inversify_1.injectable)()
72
- ], NotebookMonacoTextModelService);
73
- //# sourceMappingURL=notebook-monaco-text-model-service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notebook-monaco-text-model-service.js","sourceRoot":"","sources":["../../../src/browser/service/notebook-monaco-text-model-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,sCAA6D;AAC7D,4DAAkE;AAClE,mGAAsH;AAGtH,kEAAuD;AAGhD,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;IAArC;QAEgB,gCAA2B,GAAG,IAAI,cAAO,EAAqB,CAAC;IAgBtF,CAAC;IAdG,IAAI,oBAAoB;QACpB,OAAO,IAAI,CAAC,2BAA2B,CAAC,KAAK,CAAC;IAClD,CAAC;IAED,MAAM,CAAC,KAAwB;QAC3B,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,yBAAO,CAAC,aAAa,CAAC,CAAC;QAC5D,IAAI,OAAO,EAAE,CAAC;YACV,kFAAkF;YAClF,2GAA2G;YAC3G,2FAA2F;YAC3F,IAAI,CAAC,2BAA2B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACjD,CAAC;QACD,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ,CAAA;AAlBY,0EAA+B;0CAA/B,+BAA+B;IAD3C,IAAA,sBAAU,GAAE;GACA,+BAA+B,CAkB3C;AAED;;;GAGG;AAEI,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IAQvC,qCAAqC,CAAC,GAAQ;QAC1C,OAAO,IAAI,CAAC,sBAAsB,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;IACjE,CAAC;IAED,KAAK,CAAC,2BAA2B,CAAC,QAAuB;QACrD,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAC;IAC3E,CAAC;IAED,IAAI,4BAA4B;QAC5B,OAAO,IAAI,CAAC,+BAA+B,CAAC,oBAAoB,CAAC;IACrE,CAAC;CACJ,CAAA;AAnBY,wEAA8B;AAGpB;IADlB,IAAA,kBAAM,EAAC,kDAAsB,CAAC;sCACY,kDAAsB;8EAAC;AAG/C;IADlB,IAAA,kBAAM,EAAC,+BAA+B,CAAC;sCACY,+BAA+B;uFAAC;yCAN3E,8BAA8B;IAD1C,IAAA,sBAAU,GAAE;GACA,8BAA8B,CAmB1C"}
@@ -1,30 +0,0 @@
1
- import { PreferenceService } from '@theia/core/lib/common';
2
- import { Emitter } from '@theia/core';
3
- import { EditorPreferences } from '@theia/editor/lib/common/editor-preferences';
4
- import { BareFontInfo } from '@theia/monaco-editor-core/esm/vs/editor/common/config/fontInfo';
5
- export interface NotebookOutputOptions {
6
- readonly outputNodeLeftPadding: number;
7
- readonly fontSize: number;
8
- readonly outputFontSize?: number;
9
- readonly fontFamily: string;
10
- readonly outputFontFamily?: string;
11
- readonly outputLineHeight: number;
12
- readonly outputScrolling: boolean;
13
- readonly outputWordWrap: boolean;
14
- readonly outputLineLimit: number;
15
- }
16
- export declare class NotebookOptionsService {
17
- protected readonly preferenceService: PreferenceService;
18
- protected readonly editorPreferences: EditorPreferences;
19
- protected outputOptionsChangedEmitter: Emitter<NotebookOutputOptions>;
20
- onDidChangeOutputOptions: import("@theia/core/lib/common").Event<NotebookOutputOptions>;
21
- protected fontInfo?: BareFontInfo;
22
- get editorFontInfo(): BareFontInfo;
23
- protected init(): void;
24
- computeOutputOptions(): NotebookOutputOptions;
25
- protected getNotebookPreferenceWithDefault<T>(key: string): T;
26
- protected computeOutputLineHeight(lineHeight: number, outputFontSize: number): number;
27
- protected getOrCreateMonacoFontInfo(): BareFontInfo;
28
- protected createFontInfo(): BareFontInfo;
29
- }
30
- //# sourceMappingURL=notebook-options.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notebook-options.d.ts","sourceRoot":"","sources":["../../../src/browser/service/notebook-options.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,6CAA6C,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,gEAAgE,CAAC;AAe9F,MAAM,WAAW,qBAAqB;IAElC,QAAQ,CAAC,qBAAqB,EAAE,MAAM,CAAC;IAOvC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAGnC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,QAAQ,CAAC,cAAc,EAAE,OAAO,CAAC;IACjC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;CAIpC;AAED,qBACa,sBAAsB;IAG/B,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAGxD,SAAS,CAAC,QAAQ,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;IAExD,SAAS,CAAC,2BAA2B,iCAAwC;IAC7E,wBAAwB,gEAA0C;IAElE,SAAS,CAAC,QAAQ,CAAC,EAAE,YAAY,CAAC;IAClC,IAAI,cAAc,IAAI,YAAY,CAEjC;IAGD,SAAS,CAAC,IAAI,IAAI,IAAI;IAQtB,oBAAoB,IAAI,qBAAqB;IAmB7C,SAAS,CAAC,gCAAgC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,CAAC;IAI7D,SAAS,CAAC,uBAAuB,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM;IAyBrF,SAAS,CAAC,yBAAyB,IAAI,YAAY;IAQnD,SAAS,CAAC,cAAc,IAAI,YAAY;CAW3C"}
@@ -1,130 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2024 TypeFox and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- Object.defineProperty(exports, "__esModule", { value: true });
18
- exports.NotebookOptionsService = void 0;
19
- const tslib_1 = require("tslib");
20
- const inversify_1 = require("@theia/core/shared/inversify");
21
- const common_1 = require("@theia/core/lib/common");
22
- const core_1 = require("@theia/core");
23
- const notebook_preferences_1 = require("../../common/notebook-preferences");
24
- const editor_preferences_1 = require("@theia/editor/lib/common/editor-preferences");
25
- const fontInfo_1 = require("@theia/monaco-editor-core/esm/vs/editor/common/config/fontInfo");
26
- const pixelRatio_1 = require("@theia/monaco-editor-core/esm/vs/base/browser/pixelRatio");
27
- const notebookOutputOptionsRelevantPreferences = [
28
- 'editor.fontSize',
29
- 'editor.fontFamily',
30
- notebook_preferences_1.NotebookPreferences.NOTEBOOK_LINE_NUMBERS,
31
- notebook_preferences_1.NotebookPreferences.OUTPUT_LINE_HEIGHT,
32
- notebook_preferences_1.NotebookPreferences.OUTPUT_FONT_SIZE,
33
- notebook_preferences_1.NotebookPreferences.OUTPUT_FONT_FAMILY,
34
- notebook_preferences_1.NotebookPreferences.OUTPUT_SCROLLING,
35
- notebook_preferences_1.NotebookPreferences.OUTPUT_WORD_WRAP,
36
- notebook_preferences_1.NotebookPreferences.OUTPUT_LINE_LIMIT
37
- ];
38
- let NotebookOptionsService = class NotebookOptionsService {
39
- constructor() {
40
- this.outputOptionsChangedEmitter = new core_1.Emitter();
41
- this.onDidChangeOutputOptions = this.outputOptionsChangedEmitter.event;
42
- }
43
- get editorFontInfo() {
44
- return this.getOrCreateMonacoFontInfo();
45
- }
46
- init() {
47
- this.preferenceService.onPreferencesChanged(async (preferenceChanges) => {
48
- if (notebookOutputOptionsRelevantPreferences.some(p => p in preferenceChanges)) {
49
- this.outputOptionsChangedEmitter.fire(this.computeOutputOptions());
50
- }
51
- });
52
- }
53
- computeOutputOptions() {
54
- const outputLineHeight = this.getNotebookPreferenceWithDefault(notebook_preferences_1.NotebookPreferences.OUTPUT_LINE_HEIGHT);
55
- const fontSize = this.preferenceService.get('editor.fontSize');
56
- const outputFontSize = this.getNotebookPreferenceWithDefault(notebook_preferences_1.NotebookPreferences.OUTPUT_FONT_SIZE);
57
- return {
58
- fontSize,
59
- outputFontSize: outputFontSize,
60
- fontFamily: this.preferenceService.get('editor.fontFamily'),
61
- outputNodeLeftPadding: 8,
62
- outputFontFamily: this.getNotebookPreferenceWithDefault(notebook_preferences_1.NotebookPreferences.OUTPUT_FONT_FAMILY),
63
- outputLineHeight: this.computeOutputLineHeight(outputLineHeight, outputFontSize !== null && outputFontSize !== void 0 ? outputFontSize : fontSize),
64
- outputScrolling: this.getNotebookPreferenceWithDefault(notebook_preferences_1.NotebookPreferences.OUTPUT_SCROLLING),
65
- outputWordWrap: this.getNotebookPreferenceWithDefault(notebook_preferences_1.NotebookPreferences.OUTPUT_WORD_WRAP),
66
- outputLineLimit: this.getNotebookPreferenceWithDefault(notebook_preferences_1.NotebookPreferences.OUTPUT_LINE_LIMIT)
67
- };
68
- }
69
- getNotebookPreferenceWithDefault(key) {
70
- var _a, _b;
71
- return this.preferenceService.get(key, (_b = (_a = notebook_preferences_1.notebookPreferenceSchema.properties) === null || _a === void 0 ? void 0 : _a[key]) === null || _b === void 0 ? void 0 : _b.default);
72
- }
73
- computeOutputLineHeight(lineHeight, outputFontSize) {
74
- const minimumLineHeight = 9;
75
- if (lineHeight === 0) {
76
- // use editor line height
77
- lineHeight = this.editorFontInfo.lineHeight;
78
- }
79
- else if (lineHeight < minimumLineHeight) {
80
- // Values too small to be line heights in pixels are in ems.
81
- let fontSize = outputFontSize;
82
- if (fontSize === 0) {
83
- fontSize = this.preferenceService.get('editor.fontSize');
84
- }
85
- lineHeight = lineHeight * fontSize;
86
- }
87
- // Enforce integer, minimum constraints
88
- lineHeight = Math.round(lineHeight);
89
- if (lineHeight < minimumLineHeight) {
90
- lineHeight = minimumLineHeight;
91
- }
92
- return lineHeight;
93
- }
94
- getOrCreateMonacoFontInfo() {
95
- if (!this.fontInfo) {
96
- this.fontInfo = this.createFontInfo();
97
- this.editorPreferences.onPreferenceChanged(e => this.fontInfo = this.createFontInfo());
98
- }
99
- return this.fontInfo;
100
- }
101
- createFontInfo() {
102
- return fontInfo_1.BareFontInfo.createFromRawSettings({
103
- fontFamily: this.editorPreferences['editor.fontFamily'],
104
- fontWeight: String(this.editorPreferences['editor.fontWeight']),
105
- fontSize: this.editorPreferences['editor.fontSize'],
106
- fontLigatures: this.editorPreferences['editor.fontLigatures'],
107
- lineHeight: this.editorPreferences['editor.lineHeight'],
108
- letterSpacing: this.editorPreferences['editor.letterSpacing'],
109
- }, pixelRatio_1.PixelRatio.getInstance(window).value);
110
- }
111
- };
112
- exports.NotebookOptionsService = NotebookOptionsService;
113
- tslib_1.__decorate([
114
- (0, inversify_1.inject)(common_1.PreferenceService),
115
- tslib_1.__metadata("design:type", Object)
116
- ], NotebookOptionsService.prototype, "preferenceService", void 0);
117
- tslib_1.__decorate([
118
- (0, inversify_1.inject)(editor_preferences_1.EditorPreferences),
119
- tslib_1.__metadata("design:type", Object)
120
- ], NotebookOptionsService.prototype, "editorPreferences", void 0);
121
- tslib_1.__decorate([
122
- (0, inversify_1.postConstruct)(),
123
- tslib_1.__metadata("design:type", Function),
124
- tslib_1.__metadata("design:paramtypes", []),
125
- tslib_1.__metadata("design:returntype", void 0)
126
- ], NotebookOptionsService.prototype, "init", null);
127
- exports.NotebookOptionsService = NotebookOptionsService = tslib_1.__decorate([
128
- (0, inversify_1.injectable)()
129
- ], NotebookOptionsService);
130
- //# sourceMappingURL=notebook-options.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notebook-options.js","sourceRoot":"","sources":["../../../src/browser/service/notebook-options.ts"],"names":[],"mappings":";AACA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;;AAEhF,4DAAiF;AACjF,mDAA2D;AAC3D,sCAAsC;AACtC,4EAAkG;AAClG,oFAAgF;AAChF,6FAA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core';
2
- import { Disposable } from '@theia/core/shared/vscode-languageserver-protocol';
3
- import { NotebookEditorWidgetService } from './notebook-editor-widget-service';
4
- interface RendererMessage {
5
- editorId: string;
6
- rendererId: string;
7
- message: unknown;
8
- }
9
- export interface RendererMessaging extends Disposable {
10
- /**
11
- * Method called when a message is received. Should return a boolean
12
- * indicating whether a renderer received it.
13
- */
14
- receiveMessage?: (rendererId: string, message: unknown) => Promise<boolean>;
15
- /**
16
- * Sends a message to an extension from a renderer.
17
- */
18
- postMessage(rendererId: string, message: unknown): void;
19
- }
20
- export declare class NotebookRendererMessagingService implements Disposable {
21
- protected readonly postMessageEmitter: Emitter<RendererMessage>;
22
- readonly onPostMessage: import("@theia/core").Event<RendererMessage>;
23
- protected readonly willActivateRendererEmitter: Emitter<string>;
24
- readonly onWillActivateRenderer: import("@theia/core").Event<string>;
25
- protected readonly editorWidgetService: NotebookEditorWidgetService;
26
- protected readonly activations: Map<string, RendererMessage[] | undefined>;
27
- protected readonly scopedMessaging: Map<string, RendererMessaging>;
28
- receiveMessage(editorId: string | undefined, rendererId: string, message: unknown): Promise<boolean>;
29
- prepare(rendererId: string): void;
30
- getScoped(editorId: string): RendererMessaging;
31
- protected postMessage(editorId: string, rendererId: string, message: unknown): void;
32
- dispose(): void;
33
- }
34
- export {};
35
- //# sourceMappingURL=notebook-renderer-messaging-service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notebook-renderer-messaging-service.d.ts","sourceRoot":"","sources":["../../../src/browser/service/notebook-renderer-messaging-service.ts"],"names":[],"mappings":"AAoBA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,mDAAmD,CAAC;AAC/E,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E,UAAU,eAAe;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,OAAO,CAAA;CACnB;AAED,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACjD;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAE5E;;OAEG;IACH,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;CAC3D;AAED,qBACa,gCAAiC,YAAW,UAAU;IAE/D,SAAS,CAAC,QAAQ,CAAC,kBAAkB,2BAAkC;IACvE,QAAQ,CAAC,aAAa,+CAAiC;IAEvD,SAAS,CAAC,QAAQ,CAAC,2BAA2B,kBAAyB;IACvE,QAAQ,CAAC,sBAAsB,sCAA0C;IAGzE,SAAS,CAAC,QAAQ,CAAC,mBAAmB,EAAE,2BAA2B,CAAC;IAEpE,SAAS,CAAC,QAAQ,CAAC,WAAW,6CAAqE;IACnG,SAAS,CAAC,QAAQ,CAAC,eAAe,iCAAuD;IAEzF,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IASpG,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAgB1B,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,iBAAiB;IAmBrD,SAAS,CAAC,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAcnF,OAAO,IAAI,IAAI;CAGlB"}
@@ -1,100 +0,0 @@
1
- "use strict";
2
- // *****************************************************************************
3
- // Copyright (C) 2023 TypeFox and others.
4
- //
5
- // This program and the accompanying materials are made available under the
6
- // terms of the Eclipse Public License v. 2.0 which is available at
7
- // http://www.eclipse.org/legal/epl-2.0.
8
- //
9
- // This Source Code may also be made available under the following Secondary
10
- // Licenses when the conditions for such availability set forth in the Eclipse
11
- // Public License v. 2.0 are satisfied: GNU General Public License, version 2
12
- // with the GNU Classpath Exception which is available at
13
- // https://www.gnu.org/software/classpath/license.html.
14
- //
15
- // SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
16
- // *****************************************************************************
17
- /*---------------------------------------------------------------------------------------------
18
- * Copyright (c) Microsoft Corporation. All rights reserved.
19
- * Licensed under the MIT License. See License.txt in the project root for license information.
20
- *--------------------------------------------------------------------------------------------*/
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.NotebookRendererMessagingService = void 0;
23
- const tslib_1 = require("tslib");
24
- const core_1 = require("@theia/core");
25
- const inversify_1 = require("@theia/core/shared/inversify");
26
- const notebook_editor_widget_service_1 = require("./notebook-editor-widget-service");
27
- ;
28
- let NotebookRendererMessagingService = class NotebookRendererMessagingService {
29
- constructor() {
30
- this.postMessageEmitter = new core_1.Emitter();
31
- this.onPostMessage = this.postMessageEmitter.event;
32
- this.willActivateRendererEmitter = new core_1.Emitter();
33
- this.onWillActivateRenderer = this.willActivateRendererEmitter.event;
34
- this.activations = new Map();
35
- this.scopedMessaging = new Map();
36
- }
37
- receiveMessage(editorId, rendererId, message) {
38
- var _a, _b, _c;
39
- if (editorId === undefined) {
40
- const sends = [...this.scopedMessaging.values()].map(e => { var _a; return (_a = e.receiveMessage) === null || _a === void 0 ? void 0 : _a.call(e, rendererId, message); });
41
- return Promise.all(sends).then(values => values.some(value => !!value));
42
- }
43
- return (_c = (_b = (_a = this.scopedMessaging.get(editorId)) === null || _a === void 0 ? void 0 : _a.receiveMessage) === null || _b === void 0 ? void 0 : _b.call(_a, rendererId, message)) !== null && _c !== void 0 ? _c : Promise.resolve(false);
44
- }
45
- prepare(rendererId) {
46
- if (this.activations.has(rendererId)) {
47
- return;
48
- }
49
- const queue = [];
50
- this.activations.set(rendererId, queue);
51
- Promise.all(this.willActivateRendererEmitter.fire(rendererId)).then(() => {
52
- for (const message of queue) {
53
- this.postMessageEmitter.fire(message);
54
- }
55
- this.activations.set(rendererId, undefined);
56
- });
57
- }
58
- getScoped(editorId) {
59
- const existing = this.scopedMessaging.get(editorId);
60
- if (existing) {
61
- return existing;
62
- }
63
- const messaging = {
64
- postMessage: (rendererId, message) => this.postMessage(editorId, rendererId, message),
65
- receiveMessage: async (rendererId, message) => {
66
- var _a;
67
- (_a = this.editorWidgetService.getNotebookEditor(editorId)) === null || _a === void 0 ? void 0 : _a.postRendererMessage(rendererId, message);
68
- return true;
69
- },
70
- dispose: () => this.scopedMessaging.delete(editorId),
71
- };
72
- this.scopedMessaging.set(editorId, messaging);
73
- return messaging;
74
- }
75
- postMessage(editorId, rendererId, message) {
76
- if (!this.activations.has(rendererId)) {
77
- this.prepare(rendererId);
78
- }
79
- const activation = this.activations.get(rendererId);
80
- const toSend = { rendererId, editorId, message };
81
- if (activation === undefined) {
82
- this.postMessageEmitter.fire(toSend);
83
- }
84
- else {
85
- activation.push(toSend);
86
- }
87
- }
88
- dispose() {
89
- this.postMessageEmitter.dispose();
90
- }
91
- };
92
- exports.NotebookRendererMessagingService = NotebookRendererMessagingService;
93
- tslib_1.__decorate([
94
- (0, inversify_1.inject)(notebook_editor_widget_service_1.NotebookEditorWidgetService),
95
- tslib_1.__metadata("design:type", notebook_editor_widget_service_1.NotebookEditorWidgetService)
96
- ], NotebookRendererMessagingService.prototype, "editorWidgetService", void 0);
97
- exports.NotebookRendererMessagingService = NotebookRendererMessagingService = tslib_1.__decorate([
98
- (0, inversify_1.injectable)()
99
- ], NotebookRendererMessagingService);
100
- //# sourceMappingURL=notebook-renderer-messaging-service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notebook-renderer-messaging-service.js","sourceRoot":"","sources":["../../../src/browser/service/notebook-renderer-messaging-service.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E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EAAE,SAAS,CAAC,CAAC;QAC9C,OAAO,SAAS,CAAC;IACrB,CAAC;IAES,WAAW,CAAC,QAAgB,EAAE,UAAkB,EAAE,OAAgB;QACxE,IAAI,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC;YACpC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;QAC7B,CAAC;QAED,MAAM,UAAU,GAAG,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACpD,MAAM,MAAM,GAAG,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC;QACjD,IAAI,UAAU,KAAK,SAAS,EAAE,CAAC;YAC3B,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACzC,CAAC;aAAM,CAAC;YACJ,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC5B,CAAC;IACL,CAAC;IAED,OAAO;QACH,IAAI,CAAC,kBAAkB,CAAC,OAAO,EAAE,CAAC;IACtC,CAAC;CACJ,CAAA;AA3EY,4EAAgC;AAStB;IADlB,IAAA,kBAAM,EAAC,4DAA2B,CAAC;sCACI,4DAA2B;6EAAC;2CAT3D,gCAAgC;IAD5C,IAAA,sBAAU,GAAE;GACA,gCAAgC,CA2E5C"}
@@ -1,68 +0,0 @@
1
- import { Disposable, DisposableCollection, Emitter, Resource, URI } from '@theia/core';
2
- import { BinaryBuffer } from '@theia/core/lib/common/buffer';
3
- import { NotebookData, TransientOptions } from '../../common';
4
- import { NotebookModel, NotebookModelProps } from '../view-model/notebook-model';
5
- import { FileService } from '@theia/filesystem/lib/browser/file-service';
6
- import { NotebookCellModel, NotebookCellModelProps } from '../view-model/notebook-cell-model';
7
- import { Deferred } from '@theia/core/lib/common/promise-util';
8
- import { NotebookMonacoTextModelService } from './notebook-monaco-text-model-service';
9
- import { CellEditOperation } from '../notebook-types';
10
- export declare const NotebookProvider: unique symbol;
11
- export interface NotebookProviderInfo {
12
- readonly notebookType: string;
13
- readonly serializer: NotebookSerializer;
14
- }
15
- export interface NotebookSerializer {
16
- options: TransientOptions;
17
- toNotebook(data: BinaryBuffer): Promise<NotebookData>;
18
- fromNotebook(data: NotebookData): Promise<BinaryBuffer>;
19
- }
20
- export interface NotebookWorkspaceEdit {
21
- edits: {
22
- resource: URI;
23
- edit: CellEditOperation;
24
- }[];
25
- }
26
- export declare class NotebookService implements Disposable {
27
- protected fileService: FileService;
28
- protected notebookModelFactory: (props: NotebookModelProps) => NotebookModel;
29
- protected notebookCellModelFactory: (props: NotebookCellModelProps) => NotebookCellModel;
30
- protected textModelService: NotebookMonacoTextModelService;
31
- protected willUseNotebookSerializerEmitter: Emitter<string>;
32
- readonly onWillUseNotebookSerializer: import("@theia/core").Event<string>;
33
- protected readonly disposables: DisposableCollection;
34
- protected readonly notebookProviders: Map<string, NotebookProviderInfo>;
35
- protected readonly notebookModels: Map<string, NotebookModel>;
36
- protected readonly didRegisterNotebookSerializerEmitter: Emitter<string>;
37
- readonly onDidRegisterNotebookSerializer: import("@theia/core").Event<string>;
38
- protected readonly didRemoveViewTypeEmitter: Emitter<string>;
39
- readonly onDidRemoveViewType: import("@theia/core").Event<string>;
40
- protected readonly willOpenNotebookTypeEmitter: Emitter<string>;
41
- readonly onWillOpenNotebook: import("@theia/core").Event<string>;
42
- protected readonly didAddNotebookDocumentEmitter: Emitter<NotebookModel>;
43
- readonly onDidAddNotebookDocument: import("@theia/core").Event<NotebookModel>;
44
- protected readonly didRemoveNotebookDocumentEmitter: Emitter<NotebookModel>;
45
- readonly onDidRemoveNotebookDocument: import("@theia/core").Event<NotebookModel>;
46
- dispose(): void;
47
- protected readonly ready: Deferred<void>;
48
- /**
49
- * Marks the notebook service as ready. From this point on, the service will start dispatching the `onNotebookSerializer` event.
50
- */
51
- markReady(): void;
52
- registerNotebookSerializer(viewType: string, serializer: NotebookSerializer): Disposable;
53
- createNotebookModel(data: NotebookData, viewType: string, resource: Resource): Promise<NotebookModel>;
54
- getNotebookDataProvider(viewType: string): Promise<NotebookProviderInfo>;
55
- /**
56
- * When the application starts up, notebook providers from plugins are not registered yet.
57
- * It takes a few seconds for the plugin host to start so that notebook data providers can be registered.
58
- * This methods waits until the notebook provider is registered.
59
- */
60
- protected waitForNotebookProvider(type: string): Promise<NotebookProviderInfo>;
61
- getNotebookEditorModel(uri: URI): NotebookModel | undefined;
62
- getNotebookModels(): Iterable<NotebookModel>;
63
- willOpenNotebook(type: string): Promise<void>;
64
- listNotebookDocuments(): NotebookModel[];
65
- applyWorkspaceEdit(workspaceEdit: NotebookWorkspaceEdit): boolean;
66
- getCodeCellLanguage(model: NotebookModel): string;
67
- }
68
- //# sourceMappingURL=notebook-service.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"notebook-service.d.ts","sourceRoot":"","sources":["../../../src/browser/service/notebook-service.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAEvF,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAY,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACxE,OAAO,EAAE,aAAa,EAAwB,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvG,OAAO,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAA4B,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AACxH,OAAO,EAAE,QAAQ,EAAE,MAAM,qCAAqC,CAAC;AAC/D,OAAO,EAAE,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AACtF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,gBAAgB,eAA8B,CAAC;AAE5D,MAAM,WAAW,oBAAoB;IACjC,QAAQ,CAAC,YAAY,EA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