@difizen/libro-jupyter 0.2.0 → 0.2.1

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 (146) hide show
  1. package/es/add-between-cell/add-between-cell.js +1 -1
  2. package/es/cell/jupyter-code-cell-view.d.ts +3 -1
  3. package/es/cell/jupyter-code-cell-view.d.ts.map +1 -1
  4. package/es/cell/jupyter-code-cell-view.js +12 -5
  5. package/es/command/command-contribution.d.ts.map +1 -1
  6. package/es/command/command-contribution.js +5 -5
  7. package/es/components/icons.js +1 -1
  8. package/es/contents/content-contribution.js +1 -1
  9. package/es/contents/save-content-contribution.d.ts +10 -0
  10. package/es/contents/save-content-contribution.d.ts.map +1 -0
  11. package/es/contents/save-content-contribution.js +110 -0
  12. package/es/file/file-create-modal.d.ts.map +1 -1
  13. package/es/file/file-create-modal.js +16 -5
  14. package/es/file/file-service.js +1 -1
  15. package/es/file/index.d.ts +1 -0
  16. package/es/file/index.d.ts.map +1 -1
  17. package/es/file/index.js +2 -1
  18. package/es/index.d.ts +1 -0
  19. package/es/index.d.ts.map +1 -1
  20. package/es/index.js +2 -1
  21. package/es/keybind-instructions/index.less +9 -9
  22. package/es/keybind-instructions/keybind-instructions-view.d.ts +2 -2
  23. package/es/keybind-instructions/keybind-instructions-view.d.ts.map +1 -1
  24. package/es/keybind-instructions/keybind-instructions-view.js +69 -63
  25. package/es/libro-jupyter-model.d.ts +2 -4
  26. package/es/libro-jupyter-model.d.ts.map +1 -1
  27. package/es/libro-jupyter-model.js +35 -120
  28. package/es/libro-jupyter-workspace.d.ts +18 -0
  29. package/es/libro-jupyter-workspace.d.ts.map +1 -0
  30. package/es/libro-jupyter-workspace.js +108 -0
  31. package/es/module.d.ts.map +1 -1
  32. package/es/module.js +5 -2
  33. package/es/output/libro-jupyter-outputarea.d.ts.map +1 -1
  34. package/es/output/libro-jupyter-outputarea.js +60 -56
  35. package/es/toolbar/save-file-error.d.ts.map +1 -1
  36. package/es/toolbar/save-file-error.js +20 -13
  37. package/es/widget/box/contribution.d.ts +10 -0
  38. package/es/widget/box/contribution.d.ts.map +1 -0
  39. package/es/widget/box/contribution.js +48 -0
  40. package/es/widget/box/index.d.ts +3 -0
  41. package/es/widget/box/index.d.ts.map +1 -0
  42. package/es/widget/box/index.js +2 -0
  43. package/es/widget/box/index.less +3 -0
  44. package/es/widget/box/view.d.ts +19 -0
  45. package/es/widget/box/view.d.ts.map +1 -0
  46. package/es/widget/box/view.js +114 -0
  47. package/es/widget/comm.d.ts +65 -0
  48. package/es/widget/comm.d.ts.map +1 -0
  49. package/es/widget/comm.js +153 -0
  50. package/es/widget/index.d.ts +10 -0
  51. package/es/widget/index.d.ts.map +1 -0
  52. package/es/widget/index.js +9 -0
  53. package/es/widget/index.less +7 -0
  54. package/es/widget/instance-progress/contribution.d.ts +10 -0
  55. package/es/widget/instance-progress/contribution.d.ts.map +1 -0
  56. package/es/widget/instance-progress/contribution.js +39 -0
  57. package/es/widget/instance-progress/index.d.ts +3 -0
  58. package/es/widget/instance-progress/index.d.ts.map +1 -0
  59. package/es/widget/instance-progress/index.js +2 -0
  60. package/es/widget/instance-progress/view.d.ts +30 -0
  61. package/es/widget/instance-progress/view.d.ts.map +1 -0
  62. package/es/widget/instance-progress/view.js +180 -0
  63. package/es/widget/libro-widgets.d.ts +84 -0
  64. package/es/widget/libro-widgets.d.ts.map +1 -0
  65. package/es/widget/libro-widgets.js +307 -0
  66. package/es/widget/module.d.ts +4 -0
  67. package/es/widget/module.d.ts.map +1 -0
  68. package/es/widget/module.js +38 -0
  69. package/es/widget/progress/contribution.d.ts +10 -0
  70. package/es/widget/progress/contribution.d.ts.map +1 -0
  71. package/es/widget/progress/contribution.js +39 -0
  72. package/es/widget/progress/index.d.ts +3 -0
  73. package/es/widget/progress/index.d.ts.map +1 -0
  74. package/es/widget/progress/index.js +2 -0
  75. package/es/widget/progress/progressBar.d.ts +15 -0
  76. package/es/widget/progress/progressBar.d.ts.map +1 -0
  77. package/es/widget/progress/progressBar.js +20 -0
  78. package/es/widget/progress/view.d.ts +19 -0
  79. package/es/widget/progress/view.d.ts.map +1 -0
  80. package/es/widget/progress/view.js +74 -0
  81. package/es/widget/protocol.d.ts +193 -0
  82. package/es/widget/protocol.d.ts.map +1 -0
  83. package/es/widget/protocol.js +33 -0
  84. package/es/widget/utils.d.ts +27 -0
  85. package/es/widget/utils.d.ts.map +1 -0
  86. package/es/widget/utils.js +59 -0
  87. package/es/widget/version.d.ts +3 -0
  88. package/es/widget/version.d.ts.map +1 -0
  89. package/es/widget/version.js +2 -0
  90. package/es/widget/widget-manager.d.ts +19 -0
  91. package/es/widget/widget-manager.d.ts.map +1 -0
  92. package/es/widget/widget-manager.js +77 -0
  93. package/es/widget/widget-render.d.ts +7 -0
  94. package/es/widget/widget-render.d.ts.map +1 -0
  95. package/es/widget/widget-render.js +46 -0
  96. package/es/widget/widget-rendermime-contribution.d.ts +16 -0
  97. package/es/widget/widget-rendermime-contribution.d.ts.map +1 -0
  98. package/es/widget/widget-rendermime-contribution.js +50 -0
  99. package/es/widget/widget-view-contribution.d.ts +10 -0
  100. package/es/widget/widget-view-contribution.d.ts.map +1 -0
  101. package/es/widget/widget-view-contribution.js +36 -0
  102. package/es/widget/widget-view.d.ts +71 -0
  103. package/es/widget/widget-view.d.ts.map +1 -0
  104. package/es/widget/widget-view.js +273 -0
  105. package/package.json +18 -18
  106. package/src/add-between-cell/add-between-cell.tsx +1 -1
  107. package/src/cell/jupyter-code-cell-view.tsx +14 -6
  108. package/src/command/command-contribution.ts +11 -10
  109. package/src/components/icons.tsx +1 -1
  110. package/src/contents/content-contribution.ts +1 -1
  111. package/src/contents/save-content-contribution.ts +67 -0
  112. package/src/file/file-create-modal.tsx +10 -1
  113. package/src/file/file-service.ts +1 -1
  114. package/src/file/index.ts +1 -0
  115. package/src/index.ts +1 -0
  116. package/src/keybind-instructions/index.less +9 -9
  117. package/src/keybind-instructions/keybind-instructions-view.tsx +72 -62
  118. package/src/libro-jupyter-model.ts +1 -69
  119. package/src/libro-jupyter-workspace.ts +49 -0
  120. package/src/module.ts +6 -0
  121. package/src/output/libro-jupyter-outputarea.tsx +56 -49
  122. package/src/toolbar/save-file-error.tsx +25 -15
  123. package/src/widget/box/contribution.ts +29 -0
  124. package/src/widget/box/index.less +3 -0
  125. package/src/widget/box/index.ts +2 -0
  126. package/src/widget/box/view.tsx +112 -0
  127. package/src/widget/comm.ts +152 -0
  128. package/src/widget/index.less +7 -0
  129. package/src/widget/index.ts +9 -0
  130. package/src/widget/instance-progress/contribution.ts +20 -0
  131. package/src/widget/instance-progress/index.ts +2 -0
  132. package/src/widget/instance-progress/view.tsx +155 -0
  133. package/src/widget/libro-widgets.ts +223 -0
  134. package/src/widget/module.ts +73 -0
  135. package/src/widget/progress/contribution.ts +24 -0
  136. package/src/widget/progress/index.ts +2 -0
  137. package/src/widget/progress/progressBar.tsx +29 -0
  138. package/src/widget/progress/view.tsx +70 -0
  139. package/src/widget/protocol.ts +255 -0
  140. package/src/widget/utils.ts +67 -0
  141. package/src/widget/version.ts +2 -0
  142. package/src/widget/widget-manager.ts +45 -0
  143. package/src/widget/widget-render.tsx +52 -0
  144. package/src/widget/widget-rendermime-contribution.ts +36 -0
  145. package/src/widget/widget-view-contribution.ts +14 -0
  146. package/src/widget/widget-view.tsx +259 -0
@@ -234,7 +234,7 @@ export var LibroWrappedBetweenCellContent = function LibroWrappedBetweenCellCont
234
234
  addCell = props.addCell;
235
235
  var instance = useInject(ViewInstance);
236
236
  return /*#__PURE__*/_jsx(DisplayWrapComponent, {
237
- mode: instance.model.readOnly,
237
+ mode: instance.model.cellsEditable,
238
238
  children: /*#__PURE__*/_jsx(LibroCommonBetweenCellContent, {
239
239
  index: index,
240
240
  addCell: addCell
@@ -4,7 +4,9 @@ import type { CodeEditorViewOptions, CompletionProvider, TooltipProvider } from
4
4
  import type { LibroJupyterView } from '../libro-jupyter-view.js';
5
5
  import type { JupyterCodeCellModel } from './jupyter-code-cell-model.js';
6
6
  export declare class JupyterCodeCellView extends LibroCodeCellView {
7
- parent: LibroJupyterView;
7
+ protected _parent: LibroJupyterView;
8
+ get parent(): LibroJupyterView;
9
+ set parent(value: LibroJupyterView);
8
10
  view: import("react").ForwardRefExoticComponent<import("react").RefAttributes<HTMLDivElement>>;
9
11
  model: JupyterCodeCellModel;
10
12
  clearExecution: () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"jupyter-code-cell-view.d.ts","sourceRoot":"","sources":["../../src/cell/jupyter-code-cell-view.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkB,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,KAAK,EACV,qBAAqB,EACrB,kBAAkB,EAElB,eAAe,EAEhB,MAAM,4BAA4B,CAAC;AAWpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAkBzE,qBAEa,mBAAoB,SAAQ,iBAAiB;IAChD,MAAM,EAAE,gBAAgB,CAAC;IACxB,IAAI,2FAA4B;IACjC,KAAK,EAAE,oBAAoB,CAAC;IAE3B,cAAc,aAQrB;cAEiB,eAAe,IAAI,qBAAqB;IAgB3D,eAAe,EAAE,eAAe,CAqB9B;IAEF,kBAAkB,EAAE,kBAAkB,CA8BpC;IAEa,GAAG;CA8EnB"}
1
+ {"version":3,"file":"jupyter-code-cell-view.d.ts","sourceRoot":"","sources":["../../src/cell/jupyter-code-cell-view.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAkB,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,KAAK,EACV,qBAAqB,EACrB,kBAAkB,EAElB,eAAe,EAEhB,MAAM,4BAA4B,CAAC;AAWpC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AAEjE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAkBzE,qBAEa,mBAAoB,SAAQ,iBAAiB;IACxD,UAAkB,OAAO,EAAE,gBAAgB,CAAC;IAE5C,IAAa,MAAM,IAGQ,gBAAgB,CAD1C;IACD,IAAa,MAAM,CAAC,KAAK,EAAE,gBAAgB,EAG1C;IAEQ,IAAI,2FAA4B;IACjC,KAAK,EAAE,oBAAoB,CAAC;IAE3B,cAAc,aAQrB;cAEiB,eAAe,IAAI,qBAAqB;IAe3D,eAAe,EAAE,eAAe,CAqB9B;IAEF,kBAAkB,EAAE,kBAAkB,CA8BpC;IAEa,GAAG;CA8EnB"}
@@ -22,8 +22,8 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
22
22
  function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
23
23
  import { CellEditorMemo, LibroCodeCellView } from '@difizen/libro-code-cell';
24
24
  import { KernelError } from '@difizen/libro-kernel';
25
- import { LibroCellURIScheme } from '@difizen/libro-language-client';
26
- import { transient, URI } from '@difizen/mana-app';
25
+ import { getCellURI } from '@difizen/libro-language-client';
26
+ import { transient } from '@difizen/mana-app';
27
27
  import { view, ViewInstance } from '@difizen/mana-app';
28
28
  import { getOrigin, useInject } from '@difizen/mana-app';
29
29
  import { l10n } from '@difizen/mana-l10n';
@@ -153,12 +153,19 @@ export var JupyterCodeCellView = (_dec = transient(), _dec2 = view('jupyter-code
153
153
  return _this;
154
154
  }
155
155
  _createClass(JupyterCodeCellView, [{
156
+ key: "parent",
157
+ get: function get() {
158
+ return this._parent;
159
+ },
160
+ set: function set(value) {
161
+ this._parent = value;
162
+ this.parentDefer.resolve(this.parent);
163
+ }
164
+ }, {
156
165
  key: "getEditorOption",
157
166
  value: function getEditorOption() {
158
167
  var options = _get(_getPrototypeOf(JupyterCodeCellView.prototype), "getEditorOption", this).call(this);
159
- var uri = new URI(this.parent.model.filePath);
160
- uri = URI.withScheme(uri, LibroCellURIScheme);
161
- uri = URI.withQuery(uri, "cellid=".concat(this.model.id));
168
+ var uri = getCellURI(this.parent.model, this.model);
162
169
  return _objectSpread(_objectSpread({}, options), {}, {
163
170
  uuid: uri.toString(),
164
171
  tooltipProvider: this.tooltipProvider,
@@ -1 +1 @@
1
- {"version":3,"file":"command-contribution.d.ts","sourceRoot":"","sources":["../../src/command/command-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,oBAAoB,EACpB,YAAY,EAMb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,mBAAmB,EAEnB,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAK3B,qBACa,+BAAgC,YAAW,mBAAmB;IACnD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACtC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAC;IAC9D,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAEpE,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;CA2IjD"}
1
+ {"version":3,"file":"command-contribution.d.ts","sourceRoot":"","sources":["../../src/command/command-contribution.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,oBAAoB,EACpB,YAAY,EAMb,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EACL,mBAAmB,EAEnB,YAAY,EAEb,MAAM,mBAAmB,CAAC;AAK3B,qBACa,+BAAgC,YAAW,mBAAmB;IACnD,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACtC,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAC;IAC9D,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAEpE,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;CA2IjD"}
@@ -53,7 +53,7 @@ export var LibroJupyterCommandContribution = (_dec = singleton({
53
53
  if (!libro || !(libro instanceof LibroView)) {
54
54
  return false;
55
55
  }
56
- return !(libro !== null && libro !== void 0 && libro.model.quickEditMode) && !(libro !== null && libro !== void 0 && libro.model.readOnly) && path === LibroToolbarArea.HeaderLeft;
56
+ return (libro === null || libro === void 0 ? void 0 : libro.model).executable && path === LibroToolbarArea.HeaderLeft;
57
57
  },
58
58
  isEnabled: function isEnabled(cell, libro) {
59
59
  if (!libro || !(libro instanceof LibroView)) {
@@ -70,7 +70,7 @@ export var LibroJupyterCommandContribution = (_dec = singleton({
70
70
  if (!cell || !libro || !(cell instanceof LibroCellView) || !(libro instanceof LibroView)) {
71
71
  return false;
72
72
  }
73
- if (path !== LibroToolbarArea.HeaderCenter || libro.model.quickEditMode || libro.model.readOnly) {
73
+ if (path !== LibroToolbarArea.HeaderCenter || !(libro === null || libro === void 0 ? void 0 : libro.model).executable) {
74
74
  return false;
75
75
  }
76
76
  return !!cell;
@@ -90,7 +90,7 @@ export var LibroJupyterCommandContribution = (_dec = singleton({
90
90
  if (!cell || !libro || !ExecutableCellView.is(cell) || !(libro instanceof LibroView)) {
91
91
  return false;
92
92
  }
93
- return !(libro !== null && libro !== void 0 && libro.model.quickEditMode) && !(libro !== null && libro !== void 0 && libro.model.readOnly) && path === LibroToolbarArea.CellRight;
93
+ return (libro === null || libro === void 0 ? void 0 : libro.model).executable && path === LibroToolbarArea.CellRight;
94
94
  },
95
95
  isEnabled: function isEnabled(cell, libro) {
96
96
  if (!libro || !(libro instanceof LibroView)) {
@@ -129,10 +129,10 @@ export var LibroJupyterCommandContribution = (_dec = singleton({
129
129
  if (!libro || !(libro instanceof LibroView)) {
130
130
  return false;
131
131
  }
132
- return !(libro !== null && libro !== void 0 && libro.model.quickEditMode) && path === LibroToolbarArea.HeaderCenter && !libro.model.readOnly;
132
+ return (libro === null || libro === void 0 ? void 0 : libro.model).executable && path === LibroToolbarArea.HeaderCenter;
133
133
  },
134
134
  isEnabled: function isEnabled(cell, libro) {
135
- if (!libro || !(libro instanceof LibroView) || libro.model.readOnly) {
135
+ if (!libro || !(libro instanceof LibroView) || !(libro === null || libro === void 0 ? void 0 : libro.model).executable) {
136
136
  return false;
137
137
  }
138
138
  return libro.model.getCells().findIndex(function (item) {
@@ -134,7 +134,7 @@ export var Location = function Location() {
134
134
  children: /*#__PURE__*/_jsx("g", {
135
135
  id: "2.0-kernel-\u542F\u52A8\u524D",
136
136
  transform: "translate(-738.000000, -80.000000)",
137
- fill: "#7B7B7B"
137
+ fill: "currentColor"
138
138
  // fillRule="nonzero"
139
139
  ,
140
140
  children: /*#__PURE__*/_jsx("g", {
@@ -43,7 +43,7 @@ export var LibroJupyterContentContribution = (_dec = singleton({
43
43
  jupyterModel.currentFileContents = currentFileContents;
44
44
  jupyterModel.filePath = currentFileContents.path;
45
45
  jupyterModel.lastModified = jupyterModel.currentFileContents.last_modified;
46
- if (!jupyterModel.quickEditMode && !jupyterModel.readOnly) {
46
+ if (jupyterModel.executable) {
47
47
  jupyterModel.startKernelConnection();
48
48
  }
49
49
  return _context.abrupt("return", jupyterModel.currentFileContents.content);
@@ -0,0 +1,10 @@
1
+ import type { NotebookOption } from '@difizen/libro-core';
2
+ import { ContentSaveContribution } from '@difizen/libro-core';
3
+ import { ModalService } from '@difizen/mana-app';
4
+ import type { LibroJupyterModel } from '../libro-jupyter-model.js';
5
+ export declare class LibroJupyterContentSaveContribution implements ContentSaveContribution {
6
+ protected readonly modalService: ModalService;
7
+ canHandle: () => number;
8
+ saveContent: (options: NotebookOption, model: LibroJupyterModel) => Promise<void>;
9
+ }
10
+ //# sourceMappingURL=save-content-contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"save-content-contribution.d.ts","sourceRoot":"","sources":["../../src/contents/save-content-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,EAAE,YAAY,EAAqB,MAAM,mBAAmB,CAAC;AAEpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGnE,qBACa,mCAAoC,YAAW,uBAAuB;IAC3D,SAAS,CAAC,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IAEpE,SAAS,eAEP;IACF,WAAW,YAAmB,cAAc,SAAS,iBAAiB,mBAkDpE;CACH"}
@@ -0,0 +1,110 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _dec, _dec2, _class, _class2, _descriptor;
3
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
4
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
5
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
6
+ function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
7
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
8
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
9
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
+ function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
13
+ function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
14
+ import { ContentSaveContribution } from '@difizen/libro-core';
15
+ import { ModalService, inject, singleton } from '@difizen/mana-app';
16
+ import { SaveFileErrorModal } from "../toolbar/save-file-error.js";
17
+ export var LibroJupyterContentSaveContribution = (_dec = singleton({
18
+ contrib: ContentSaveContribution
19
+ }), _dec2 = inject(ModalService), _dec(_class = (_class2 = /*#__PURE__*/_createClass(function LibroJupyterContentSaveContribution() {
20
+ var _this = this;
21
+ _classCallCheck(this, LibroJupyterContentSaveContribution);
22
+ _initializerDefineProperty(this, "modalService", _descriptor, this);
23
+ this.canHandle = function () {
24
+ return 2;
25
+ };
26
+ this.saveContent = /*#__PURE__*/function () {
27
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(options, model) {
28
+ var notebookContent, res, _res, errorMsg;
29
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
30
+ while (1) switch (_context.prev = _context.next) {
31
+ case 0:
32
+ notebookContent = model.toJSON();
33
+ if (model.currentFileContents) {
34
+ _context.next = 3;
35
+ break;
36
+ }
37
+ throw new Error('currentFileContents is undefined');
38
+ case 3:
39
+ res = {};
40
+ _context.prev = 4;
41
+ _context.next = 7;
42
+ return model.fileService.write(notebookContent, model.currentFileContents);
43
+ case 7:
44
+ res = _context.sent;
45
+ if (res) {
46
+ _context.next = 10;
47
+ break;
48
+ }
49
+ return _context.abrupt("return");
50
+ case 10:
51
+ if (!(res.last_modified === model.lastModified || res.size === 0)) {
52
+ _context.next = 15;
53
+ break;
54
+ }
55
+ errorMsg = "File Save Error: ".concat((_res = res) === null || _res === void 0 ? void 0 : _res.message, " ");
56
+ model.fileService.fileSaveErrorEmitter.fire({
57
+ cause: res.message,
58
+ msg: errorMsg,
59
+ name: res.name,
60
+ path: res.path,
61
+ created: res.created,
62
+ last_modified: res.last_modified,
63
+ size: res.size,
64
+ type: res.type
65
+ });
66
+ _this.modalService.openModal(SaveFileErrorModal);
67
+ throw new Error(errorMsg);
68
+ case 15:
69
+ _context.next = 24;
70
+ break;
71
+ case 17:
72
+ _context.prev = 17;
73
+ _context.t0 = _context["catch"](4);
74
+ if (res) {
75
+ _context.next = 21;
76
+ break;
77
+ }
78
+ return _context.abrupt("return");
79
+ case 21:
80
+ model.fileService.fileSaveErrorEmitter.fire({
81
+ cause: _context.t0.errorCause,
82
+ msg: _context.t0.message,
83
+ name: res.name || model.currentFileContents.name,
84
+ path: res.path || model.currentFileContents.path,
85
+ created: res.created || model.currentFileContents.created,
86
+ last_modified: res.last_modified || model.currentFileContents.last_modified,
87
+ size: res.size || model.currentFileContents.size,
88
+ type: res.type || model.currentFileContents.type
89
+ });
90
+ _this.modalService.openModal(SaveFileErrorModal);
91
+ throw new Error('File Save Error');
92
+ case 24:
93
+ _context.next = 26;
94
+ return model.createCheckpoint();
95
+ case 26:
96
+ case "end":
97
+ return _context.stop();
98
+ }
99
+ }, _callee, null, [[4, 17]]);
100
+ }));
101
+ return function (_x, _x2) {
102
+ return _ref.apply(this, arguments);
103
+ };
104
+ }();
105
+ }), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "modalService", [_dec2], {
106
+ configurable: true,
107
+ enumerable: true,
108
+ writable: true,
109
+ initializer: null
110
+ })), _class2)) || _class);
@@ -1 +1 @@
1
- {"version":3,"file":"file-create-modal.d.ts","sourceRoot":"","sources":["../../src/file/file-create-modal.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAKnE,OAAO,cAAc,CAAC;AAWtB,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,KAAK,QAAQ,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAEhE,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,aAAa,CAAC,CA0J5E,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,aAAa,CAGpD,CAAC"}
1
+ {"version":3,"file":"file-create-modal.d.ts","sourceRoot":"","sources":["../../src/file/file-create-modal.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAMnE,OAAO,cAAc,CAAC;AAWtB,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,KAAK,QAAQ,GAAG,QAAQ,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;AAEhE,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAAC,aAAa,CAAC,CAkK5E,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,SAAS,CAAC,aAAa,CAGpD,CAAC"}
@@ -8,6 +8,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
8
8
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
9
9
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
10
10
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
+ import { CommandRegistry } from '@difizen/mana-app';
11
12
  import { URI, useInject, ViewManager } from '@difizen/mana-app';
12
13
  import { Col, Form, message, Row, Input, Modal } from 'antd';
13
14
  import { useEffect, useRef, useState } from 'react';
@@ -20,6 +21,7 @@ export var FileCreateModalComponent = function FileCreateModalComponent(_ref) {
20
21
  close = _ref.close,
21
22
  data = _ref.data;
22
23
  var fileService = useInject(JupyterFileService);
24
+ var commands = useInject(CommandRegistry);
23
25
  var viewManager = useInject(ViewManager);
24
26
  var _useState = useState(data === null || data === void 0 ? void 0 : data.fileType),
25
27
  _useState2 = _slicedToArray(_useState, 2),
@@ -35,6 +37,7 @@ export var FileCreateModalComponent = function FileCreateModalComponent(_ref) {
35
37
  form = _Form$useForm2[0];
36
38
  var onFinish = /*#__PURE__*/function () {
37
39
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(values) {
40
+ var stat;
38
41
  return _regeneratorRuntime().wrap(function _callee$(_context) {
39
42
  while (1) switch (_context.prev = _context.next) {
40
43
  case 0:
@@ -46,20 +49,28 @@ export var FileCreateModalComponent = function FileCreateModalComponent(_ref) {
46
49
  _context.next = 6;
47
50
  return fileService.newFile(values.fileName + (fileType || ''), new URI(data === null || data === void 0 ? void 0 : data.path));
48
51
  case 6:
52
+ stat = _context.sent;
49
53
  if (fileView) {
50
54
  fileView.model.refresh();
51
55
  }
52
- _context.next = 12;
56
+ if (stat.isFile) {
57
+ commands.executeCommand('fileTree.command.openfile', {
58
+ fileStat: stat,
59
+ uri: stat.resource
60
+ });
61
+ }
62
+ // message.success('新建文件成功');
63
+ _context.next = 14;
53
64
  break;
54
- case 9:
55
- _context.prev = 9;
65
+ case 11:
66
+ _context.prev = 11;
56
67
  _context.t0 = _context["catch"](3);
57
68
  message.error('新建文件失败');
58
- case 12:
69
+ case 14:
59
70
  case "end":
60
71
  return _context.stop();
61
72
  }
62
- }, _callee, null, [[3, 9]]);
73
+ }, _callee, null, [[3, 11]]);
63
74
  }));
64
75
  return function onFinish(_x) {
65
76
  return _ref2.apply(this, arguments);
@@ -390,7 +390,7 @@ export var JupyterFileService = (_dec = singleton({
390
390
  _context10.next = 13;
391
391
  return this.rename(new URI(res.path.toString()), fileName);
392
392
  case 13:
393
- return _context10.abrupt("return", this.resolve(target));
393
+ return _context10.abrupt("return", this.resolve(targetFileUri));
394
394
  case 14:
395
395
  case "end":
396
396
  return _context10.stop();
@@ -7,4 +7,5 @@ export * from './file-protocol.js';
7
7
  export * from './file-icon.js';
8
8
  export * from './file-create-modal.js';
9
9
  export * from './file-createdir-modal.js';
10
+ export * from './file-command.js';
10
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/file/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/file/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC"}
package/es/file/index.js CHANGED
@@ -6,4 +6,5 @@ export * from "./file-service.js";
6
6
  export * from "./file-protocol.js";
7
7
  export * from "./file-icon.js";
8
8
  export * from "./file-create-modal.js";
9
- export * from "./file-createdir-modal.js";
9
+ export * from "./file-createdir-modal.js";
10
+ export * from "./file-command.js";
package/es/index.d.ts CHANGED
@@ -32,4 +32,5 @@ export * from './toolbar/index.js';
32
32
  export * from './file/index.js';
33
33
  export * from './libro-jupyter-view.js';
34
34
  export * from './config/index.js';
35
+ export * from './widget/index.js';
35
36
  //# sourceMappingURL=index.d.ts.map
package/es/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0CAA0C,CAAC;AACzD,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0CAA0C,CAAC;AACzD,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
package/es/index.js CHANGED
@@ -31,4 +31,5 @@ export * from "./theme/index.js";
31
31
  export * from "./toolbar/index.js";
32
32
  export * from "./file/index.js";
33
33
  export * from "./libro-jupyter-view.js";
34
- export * from "./config/index.js";
34
+ export * from "./config/index.js";
35
+ export * from "./widget/index.js";
@@ -7,6 +7,13 @@
7
7
  .@{ant-prefix}-input-group-wrapper {
8
8
  background-color: var(--mana-libro-filtered-background-color) !important;
9
9
  border-radius: 6px;
10
+ .@{ant-prefix}-input {
11
+ color: var(--mana-libro-drawer-title-color);
12
+
13
+ &::placeholder {
14
+ color: var(--mana-libro-keybind-tag-text-color);
15
+ }
16
+ }
10
17
  }
11
18
 
12
19
  .@{ant-prefix}-input-group-addon {
@@ -19,6 +26,7 @@
19
26
  }
20
27
 
21
28
  .libro-keybind-instructions-drawer {
29
+ background: var(--mana-libro-popover-background-color) !important;
22
30
  .@{ant-prefix}-drawer-content-wrapper {
23
31
  box-shadow:
24
32
  0 0 16px -8px rgba(0, 0, 0, 8%),
@@ -34,17 +42,9 @@
34
42
  .@{ant-prefix}-segmented-item-label {
35
43
  color: var(--mana-libro-drawer-title-color);
36
44
  }
37
- .@{ant-prefix}-segmented-item-selected {
38
- .@{ant-prefix}-segmented-item-label {
39
- color: rgba(0, 10, 26, 89%);
40
- }
41
- }
42
45
  .@{ant-prefix}-drawer-mask {
43
46
  opacity: 0;
44
47
  }
45
- .@{ant-prefix}-drawer-content {
46
- background: var(--mana-libro-popover-background-color);
47
- }
48
48
  .@{ant-prefix}-drawer-close {
49
49
  color: var(--mana-libro-drawer-close-color);
50
50
  }
@@ -135,6 +135,7 @@
135
135
  .libro-magic-table {
136
136
  .@{ant-prefix}-table-thead > tr > th {
137
137
  background: var(--mana-libro-popover-background-color);
138
+ color: var(--mana-libro-table-title-color);
138
139
  }
139
140
 
140
141
  .@{ant-prefix}-table-tbody > tr.@{ant-prefix}-table-row:hover > td {
@@ -148,7 +149,6 @@
148
149
 
149
150
  thead tr th {
150
151
  height: 30px;
151
- color: var(--mana-libro-table-title-color);
152
152
  font-weight: 600;
153
153
  font-size: 14px;
154
154
  font-family: PingFangSC;
@@ -1,11 +1,11 @@
1
1
  /// <reference types="react" resolution-mode="require"/>
2
- import { LirboContextKey } from '@difizen/libro-core';
2
+ import { LibroContextKey } from '@difizen/libro-core';
3
3
  import type { ModalItem, ModalItemProps } from '@difizen/mana-app';
4
4
  import type { Disposable } from '@difizen/mana-app';
5
5
  import type { DataType } from './keybind-instructions-items.js';
6
6
  import './index.less';
7
7
  export declare class KeybindInstrutionsService implements Disposable {
8
- contextKey: LirboContextKey;
8
+ contextKey: LibroContextKey;
9
9
  isKeybindInstructionsMask: boolean;
10
10
  searchCommandModeData: DataType[];
11
11
  searchEditModeData: DataType[];
@@ -1 +1 @@
1
- {"version":3,"file":"keybind-instructions-view.d.ts","sourceRoot":"","sources":["../../src/keybind-instructions/keybind-instructions-view.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAKpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,cAAc,CAAC;AAsCtB,qBACa,yBAA0B,YAAW,UAAU;IACjC,UAAU,EAAE,eAAe,CAAC;IACrD,yBAAyB,UAAS;IAC1B,qBAAqB,EAAE,QAAQ,EAAE,CAAM;IACvC,kBAAkB,EAAE,QAAQ,EAAE,CAAM;IAE5C,OAAO;CAIR;AAiED,eAAO,MAAM,2BAA2B,iHA4GtC,CAAC;AAEH,eAAO,MAAM,sBAAsB,EAAE,SAGpC,CAAC"}
1
+ {"version":3,"file":"keybind-instructions-view.d.ts","sourceRoot":"","sources":["../../src/keybind-instructions/keybind-instructions-view.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAGtD,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAKpD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAEhE,OAAO,cAAc,CAAC;AAsCtB,qBACa,yBAA0B,YAAW,UAAU;IACjC,UAAU,EAAE,eAAe,CAAC;IACrD,yBAAyB,UAAS;IAC1B,qBAAqB,EAAE,QAAQ,EAAE,CAAM;IACvC,kBAAkB,EAAE,QAAQ,EAAE,CAAM;IAE5C,OAAO;CAIR;AAiED,eAAO,MAAM,2BAA2B,iHAsHtC,CAAC;AAEH,eAAO,MAAM,sBAAsB,EAAE,SAGpC,CAAC"}