@difizen/libro-jupyter 0.0.2-alpha.0

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 (267) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/es/add-between-cell/add-between-cell-command-contribution.d.ts +14 -0
  4. package/es/add-between-cell/add-between-cell-command-contribution.d.ts.map +1 -0
  5. package/es/add-between-cell/add-between-cell-command-contribution.js +97 -0
  6. package/es/add-between-cell/add-between-cell.d.ts +5 -0
  7. package/es/add-between-cell/add-between-cell.d.ts.map +1 -0
  8. package/es/add-between-cell/add-between-cell.js +243 -0
  9. package/es/add-between-cell/index.d.ts +3 -0
  10. package/es/add-between-cell/index.d.ts.map +1 -0
  11. package/es/add-between-cell/index.js +2 -0
  12. package/es/add-between-cell/index.less +103 -0
  13. package/es/add-between-cell/module.d.ts +3 -0
  14. package/es/add-between-cell/module.d.ts.map +1 -0
  15. package/es/add-between-cell/module.js +8 -0
  16. package/es/cell/index.d.ts +3 -0
  17. package/es/cell/index.d.ts.map +1 -0
  18. package/es/cell/index.js +2 -0
  19. package/es/cell/jupyter-code-cell-model.d.ts +12 -0
  20. package/es/cell/jupyter-code-cell-model.d.ts.map +1 -0
  21. package/es/cell/jupyter-code-cell-model.js +56 -0
  22. package/es/cell/jupyter-code-cell-view.d.ts +18 -0
  23. package/es/cell/jupyter-code-cell-view.d.ts.map +1 -0
  24. package/es/cell/jupyter-code-cell-view.js +280 -0
  25. package/es/command/command-contribution.d.ts +10 -0
  26. package/es/command/command-contribution.d.ts.map +1 -0
  27. package/es/command/command-contribution.js +161 -0
  28. package/es/command/index.d.ts +3 -0
  29. package/es/command/index.d.ts.map +1 -0
  30. package/es/command/index.js +2 -0
  31. package/es/command/keybinding-contribution.d.ts +8 -0
  32. package/es/command/keybinding-contribution.d.ts.map +1 -0
  33. package/es/command/keybinding-contribution.js +37 -0
  34. package/es/components/cell-execution-tip.d.ts +6 -0
  35. package/es/components/cell-execution-tip.d.ts.map +1 -0
  36. package/es/components/cell-execution-tip.js +69 -0
  37. package/es/components/cell-input-bottom-blank.d.ts +5 -0
  38. package/es/components/cell-input-bottom-blank.d.ts.map +1 -0
  39. package/es/components/cell-input-bottom-blank.js +21 -0
  40. package/es/components/icons.d.ts +5 -0
  41. package/es/components/icons.d.ts.map +1 -0
  42. package/es/components/icons.js +154 -0
  43. package/es/components/index.d.ts +4 -0
  44. package/es/components/index.d.ts.map +1 -0
  45. package/es/components/index.js +3 -0
  46. package/es/components/index.less +82 -0
  47. package/es/config/config-contribution.d.ts +10 -0
  48. package/es/config/config-contribution.d.ts.map +1 -0
  49. package/es/config/config-contribution.js +50 -0
  50. package/es/config/config.d.ts +3 -0
  51. package/es/config/config.d.ts.map +1 -0
  52. package/es/config/config.js +11 -0
  53. package/es/config/index.d.ts +2 -0
  54. package/es/config/index.d.ts.map +1 -0
  55. package/es/config/index.js +1 -0
  56. package/es/configuration/index.d.ts +3 -0
  57. package/es/configuration/index.d.ts.map +1 -0
  58. package/es/configuration/index.js +2 -0
  59. package/es/configuration/libro-configuration-contribution.d.ts +5 -0
  60. package/es/configuration/libro-configuration-contribution.d.ts.map +1 -0
  61. package/es/configuration/libro-configuration-contribution.js +24 -0
  62. package/es/configuration/libro-configuration.d.ts +3 -0
  63. package/es/configuration/libro-configuration.d.ts.map +1 -0
  64. package/es/configuration/libro-configuration.js +12 -0
  65. package/es/contents/content-contribution.d.ts +7 -0
  66. package/es/contents/content-contribution.d.ts.map +1 -0
  67. package/es/contents/content-contribution.js +63 -0
  68. package/es/contents/index.d.ts +2 -0
  69. package/es/contents/index.d.ts.map +1 -0
  70. package/es/contents/index.js +1 -0
  71. package/es/file/file-name-alias.d.ts +7 -0
  72. package/es/file/file-name-alias.d.ts.map +1 -0
  73. package/es/file/file-name-alias.js +26 -0
  74. package/es/file/file-protocol.d.ts +8 -0
  75. package/es/file/file-protocol.d.ts.map +1 -0
  76. package/es/file/file-protocol.js +7 -0
  77. package/es/file/file-service.d.ts +31 -0
  78. package/es/file/file-service.d.ts.map +1 -0
  79. package/es/file/file-service.js +329 -0
  80. package/es/file/file-tree-label-provider.d.ts +13 -0
  81. package/es/file/file-tree-label-provider.d.ts.map +1 -0
  82. package/es/file/file-tree-label-provider.js +62 -0
  83. package/es/file/file-view/index.d.ts +14 -0
  84. package/es/file/file-view/index.d.ts.map +1 -0
  85. package/es/file/file-view/index.js +101 -0
  86. package/es/file/file-view/index.less +5 -0
  87. package/es/file/index.d.ts +7 -0
  88. package/es/file/index.d.ts.map +1 -0
  89. package/es/file/index.js +6 -0
  90. package/es/file/module.d.ts +3 -0
  91. package/es/file/module.d.ts.map +1 -0
  92. package/es/file/module.js +8 -0
  93. package/es/file/navigatable-view.d.ts +24 -0
  94. package/es/file/navigatable-view.d.ts.map +1 -0
  95. package/es/file/navigatable-view.js +151 -0
  96. package/es/file/open-handler-contribution.d.ts +11 -0
  97. package/es/file/open-handler-contribution.d.ts.map +1 -0
  98. package/es/file/open-handler-contribution.js +102 -0
  99. package/es/index.d.ts +32 -0
  100. package/es/index.d.ts.map +1 -0
  101. package/es/index.js +31 -0
  102. package/es/keybind-instructions/index.d.ts +6 -0
  103. package/es/keybind-instructions/index.d.ts.map +1 -0
  104. package/es/keybind-instructions/index.js +5 -0
  105. package/es/keybind-instructions/index.less +177 -0
  106. package/es/keybind-instructions/keybind-instructions-contribution.d.ts +11 -0
  107. package/es/keybind-instructions/keybind-instructions-contribution.d.ts.map +1 -0
  108. package/es/keybind-instructions/keybind-instructions-contribution.js +84 -0
  109. package/es/keybind-instructions/keybind-instructions-icon.d.ts +3 -0
  110. package/es/keybind-instructions/keybind-instructions-icon.d.ts.map +1 -0
  111. package/es/keybind-instructions/keybind-instructions-icon.js +23 -0
  112. package/es/keybind-instructions/keybind-instructions-items.d.ts +14 -0
  113. package/es/keybind-instructions/keybind-instructions-items.d.ts.map +1 -0
  114. package/es/keybind-instructions/keybind-instructions-items.js +589 -0
  115. package/es/keybind-instructions/keybind-instructions-view.d.ts +16 -0
  116. package/es/keybind-instructions/keybind-instructions-view.d.ts.map +1 -0
  117. package/es/keybind-instructions/keybind-instructions-view.js +224 -0
  118. package/es/keybind-instructions/module.d.ts +3 -0
  119. package/es/keybind-instructions/module.d.ts.map +1 -0
  120. package/es/keybind-instructions/module.js +5 -0
  121. package/es/libro-jupyter-file-service.d.ts +106 -0
  122. package/es/libro-jupyter-file-service.d.ts.map +1 -0
  123. package/es/libro-jupyter-file-service.js +127 -0
  124. package/es/libro-jupyter-model.d.ts +49 -0
  125. package/es/libro-jupyter-model.d.ts.map +1 -0
  126. package/es/libro-jupyter-model.js +505 -0
  127. package/es/libro-jupyter-protocol.d.ts +38 -0
  128. package/es/libro-jupyter-protocol.d.ts.map +1 -0
  129. package/es/libro-jupyter-protocol.js +9 -0
  130. package/es/libro-jupyter-server-launch-manager.d.ts +11 -0
  131. package/es/libro-jupyter-server-launch-manager.d.ts.map +1 -0
  132. package/es/libro-jupyter-server-launch-manager.js +59 -0
  133. package/es/libro-jupyter-view.d.ts +10 -0
  134. package/es/libro-jupyter-view.d.ts.map +1 -0
  135. package/es/libro-jupyter-view.js +42 -0
  136. package/es/module.d.ts +3 -0
  137. package/es/module.d.ts.map +1 -0
  138. package/es/module.js +48 -0
  139. package/es/output/index.d.ts +2 -0
  140. package/es/output/index.d.ts.map +1 -0
  141. package/es/output/index.js +1 -0
  142. package/es/output/libro-jupyter-outputarea.d.ts +8 -0
  143. package/es/output/libro-jupyter-outputarea.d.ts.map +1 -0
  144. package/es/output/libro-jupyter-outputarea.js +77 -0
  145. package/es/rendermime/assets/plotly.svg +31 -0
  146. package/es/rendermime/index.d.ts +5 -0
  147. package/es/rendermime/index.d.ts.map +1 -0
  148. package/es/rendermime/index.js +4 -0
  149. package/es/rendermime/index.less +22 -0
  150. package/es/rendermime/module.d.ts +3 -0
  151. package/es/rendermime/module.d.ts.map +1 -0
  152. package/es/rendermime/module.js +3 -0
  153. package/es/rendermime/plotly-render.d.ts +7 -0
  154. package/es/rendermime/plotly-render.d.ts.map +1 -0
  155. package/es/rendermime/plotly-render.js +30 -0
  156. package/es/rendermime/plotly-renderers.d.ts +58 -0
  157. package/es/rendermime/plotly-renderers.d.ts.map +1 -0
  158. package/es/rendermime/plotly-renderers.js +211 -0
  159. package/es/rendermime/plotly-rendermime-contribution.d.ts +12 -0
  160. package/es/rendermime/plotly-rendermime-contribution.d.ts.map +1 -0
  161. package/es/rendermime/plotly-rendermime-contribution.js +22 -0
  162. package/es/theme/color-registry.d.ts +6 -0
  163. package/es/theme/color-registry.d.ts.map +1 -0
  164. package/es/theme/color-registry.js +393 -0
  165. package/es/theme/index.d.ts +2 -0
  166. package/es/theme/index.d.ts.map +1 -0
  167. package/es/theme/index.js +1 -0
  168. package/es/toolbar/index.d.ts +6 -0
  169. package/es/toolbar/index.d.ts.map +1 -0
  170. package/es/toolbar/index.js +5 -0
  171. package/es/toolbar/index.less +194 -0
  172. package/es/toolbar/kernel-selector-dropdown.d.ts +13 -0
  173. package/es/toolbar/kernel-selector-dropdown.d.ts.map +1 -0
  174. package/es/toolbar/kernel-selector-dropdown.js +165 -0
  175. package/es/toolbar/kernel-status-and-selector.d.ts +18 -0
  176. package/es/toolbar/kernel-status-and-selector.d.ts.map +1 -0
  177. package/es/toolbar/kernel-status-and-selector.js +164 -0
  178. package/es/toolbar/run-selector.d.ts +3 -0
  179. package/es/toolbar/run-selector.d.ts.map +1 -0
  180. package/es/toolbar/run-selector.js +98 -0
  181. package/es/toolbar/save-file-error-contribution.d.ts +5 -0
  182. package/es/toolbar/save-file-error-contribution.d.ts.map +1 -0
  183. package/es/toolbar/save-file-error-contribution.js +23 -0
  184. package/es/toolbar/save-file-error.d.ts +5 -0
  185. package/es/toolbar/save-file-error.d.ts.map +1 -0
  186. package/es/toolbar/save-file-error.js +27 -0
  187. package/es/toolbar/side-toolbar-run-selector.d.ts +3 -0
  188. package/es/toolbar/side-toolbar-run-selector.d.ts.map +1 -0
  189. package/es/toolbar/side-toolbar-run-selector.js +67 -0
  190. package/es/toolbar/toolbar-contribution.d.ts +9 -0
  191. package/es/toolbar/toolbar-contribution.d.ts.map +1 -0
  192. package/es/toolbar/toolbar-contribution.js +67 -0
  193. package/es/typings/index.d.ts +31 -0
  194. package/es/utils/index.d.ts +11 -0
  195. package/es/utils/index.d.ts.map +1 -0
  196. package/es/utils/index.js +47 -0
  197. package/package.json +75 -0
  198. package/src/add-between-cell/add-between-cell-command-contribution.ts +63 -0
  199. package/src/add-between-cell/add-between-cell.tsx +201 -0
  200. package/src/add-between-cell/index.less +103 -0
  201. package/src/add-between-cell/index.ts +2 -0
  202. package/src/add-between-cell/module.ts +13 -0
  203. package/src/cell/index.ts +2 -0
  204. package/src/cell/jupyter-code-cell-model.ts +36 -0
  205. package/src/cell/jupyter-code-cell-view.tsx +221 -0
  206. package/src/command/command-contribution.ts +163 -0
  207. package/src/command/index.ts +2 -0
  208. package/src/command/keybinding-contribution.ts +25 -0
  209. package/src/components/cell-execution-tip.tsx +107 -0
  210. package/src/components/cell-input-bottom-blank.tsx +24 -0
  211. package/src/components/icons.tsx +117 -0
  212. package/src/components/index.less +82 -0
  213. package/src/components/index.ts +3 -0
  214. package/src/config/config-contribution.ts +21 -0
  215. package/src/config/config.ts +14 -0
  216. package/src/config/index.ts +1 -0
  217. package/src/configuration/index.ts +2 -0
  218. package/src/configuration/libro-configuration-contribution.ts +11 -0
  219. package/src/configuration/libro-configuration.ts +14 -0
  220. package/src/contents/content-contribution.ts +32 -0
  221. package/src/contents/index.ts +1 -0
  222. package/src/file/file-name-alias.ts +15 -0
  223. package/src/file/file-protocol.ts +7 -0
  224. package/src/file/file-service.ts +179 -0
  225. package/src/file/file-tree-label-provider.ts +42 -0
  226. package/src/file/file-view/index.less +5 -0
  227. package/src/file/file-view/index.tsx +90 -0
  228. package/src/file/index.ts +6 -0
  229. package/src/file/module.ts +19 -0
  230. package/src/file/navigatable-view.tsx +93 -0
  231. package/src/file/open-handler-contribution.ts +44 -0
  232. package/src/index.ts +32 -0
  233. package/src/keybind-instructions/index.less +177 -0
  234. package/src/keybind-instructions/index.ts +5 -0
  235. package/src/keybind-instructions/keybind-instructions-contribution.ts +47 -0
  236. package/src/keybind-instructions/keybind-instructions-icon.tsx +28 -0
  237. package/src/keybind-instructions/keybind-instructions-items.tsx +597 -0
  238. package/src/keybind-instructions/keybind-instructions-view.tsx +239 -0
  239. package/src/keybind-instructions/module.ts +11 -0
  240. package/src/libro-jupyter-file-service.ts +158 -0
  241. package/src/libro-jupyter-model.ts +289 -0
  242. package/src/libro-jupyter-protocol.ts +59 -0
  243. package/src/libro-jupyter-server-launch-manager.ts +36 -0
  244. package/src/libro-jupyter-view.tsx +24 -0
  245. package/src/module.ts +105 -0
  246. package/src/output/index.ts +1 -0
  247. package/src/output/libro-jupyter-outputarea.tsx +71 -0
  248. package/src/rendermime/assets/plotly.svg +31 -0
  249. package/src/rendermime/index.less +13 -0
  250. package/src/rendermime/index.ts +4 -0
  251. package/src/rendermime/module.ts +7 -0
  252. package/src/rendermime/plotly-render.tsx +35 -0
  253. package/src/rendermime/plotly-renderers.ts +191 -0
  254. package/src/rendermime/plotly-rendermime-contribution.ts +15 -0
  255. package/src/theme/color-registry.ts +301 -0
  256. package/src/theme/index.ts +1 -0
  257. package/src/toolbar/index.less +194 -0
  258. package/src/toolbar/index.ts +5 -0
  259. package/src/toolbar/kernel-selector-dropdown.tsx +204 -0
  260. package/src/toolbar/kernel-status-and-selector.tsx +195 -0
  261. package/src/toolbar/run-selector.tsx +110 -0
  262. package/src/toolbar/save-file-error-contribution.ts +10 -0
  263. package/src/toolbar/save-file-error.tsx +35 -0
  264. package/src/toolbar/side-toolbar-run-selector.tsx +77 -0
  265. package/src/toolbar/toolbar-contribution.tsx +62 -0
  266. package/src/typings/index.d.ts +31 -0
  267. package/src/utils/index.ts +65 -0
@@ -0,0 +1,59 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ var _dec, _class;
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 exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
11
+ import { ServerManager, ServerConnection } from '@difizen/libro-kernel';
12
+ import { inject, singleton } from '@difizen/mana-app';
13
+ import { ApplicationContribution } from '@difizen/mana-app';
14
+ import { ServerLaunchManager } from "./libro-jupyter-protocol.js";
15
+ export var JupyterServerLaunchManager = (_dec = singleton({
16
+ contrib: [ServerLaunchManager, ApplicationContribution]
17
+ }), _dec(_class = /*#__PURE__*/function () {
18
+ function JupyterServerLaunchManager(serverManager, serverConnection) {
19
+ _classCallCheck(this, JupyterServerLaunchManager);
20
+ this.serverManager = void 0;
21
+ this.serverConnection = void 0;
22
+ this.serverManager = serverManager;
23
+ this.serverConnection = serverConnection;
24
+ }
25
+ JupyterServerLaunchManager = inject(ServerConnection)(JupyterServerLaunchManager, undefined, 1) || JupyterServerLaunchManager;
26
+ JupyterServerLaunchManager = inject(ServerManager)(JupyterServerLaunchManager, undefined, 0) || JupyterServerLaunchManager;
27
+ _createClass(JupyterServerLaunchManager, [{
28
+ key: "onStart",
29
+ value: function () {
30
+ var _onStart = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
31
+ var host;
32
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
33
+ while (1) switch (_context.prev = _context.next) {
34
+ case 0:
35
+ host = location.host;
36
+ this.serverConnection.updateSettings({
37
+ baseUrl: "http://".concat(host),
38
+ wsUrl: "ws://".concat(host)
39
+ });
40
+ this.launch();
41
+ case 3:
42
+ case "end":
43
+ return _context.stop();
44
+ }
45
+ }, _callee, this);
46
+ }));
47
+ function onStart() {
48
+ return _onStart.apply(this, arguments);
49
+ }
50
+ return onStart;
51
+ }()
52
+ }, {
53
+ key: "launch",
54
+ value: function launch() {
55
+ return this.serverManager.launch();
56
+ }
57
+ }]);
58
+ return JupyterServerLaunchManager;
59
+ }()) || _class);
@@ -0,0 +1,10 @@
1
+ import type { NotebookOption } from '@difizen/libro-core';
2
+ import { CollapseServiceFactory, NotebookService } from '@difizen/libro-core';
3
+ import { LibroView } from '@difizen/libro-core';
4
+ import { URI } from '@difizen/mana-app';
5
+ export declare class LibroJupyterView extends LibroView {
6
+ uri: URI;
7
+ constructor(options: NotebookOption, collapseServiceFactory: CollapseServiceFactory, notebookService: NotebookService);
8
+ get options(): import("@difizen/libro-core").Options;
9
+ }
10
+ //# sourceMappingURL=libro-jupyter-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"libro-jupyter-view.d.ts","sourceRoot":"","sources":["../src/libro-jupyter-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,EAAE,SAAS,EAAyB,MAAM,qBAAqB,CAAC;AACvE,OAAO,EAAE,GAAG,EAAoB,MAAM,mBAAmB,CAAC;AAG1D,qBAEa,gBAAiB,SAAQ,SAAS;IAC7C,GAAG,EAAE,GAAG,CAAC;gBAEa,OAAO,EAAE,cAAc,EACX,sBAAsB,EAAE,sBAAsB,EACrD,eAAe,EAAE,eAAe;IAO3D,IAAI,OAAO,0CAEV;CACF"}
@@ -0,0 +1,42 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ var _dec, _dec2, _class;
3
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
+ 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); } }
5
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
6
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
7
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
9
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
10
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
11
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
12
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
13
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
14
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
15
+ import { CollapseServiceFactory, NotebookService } from '@difizen/libro-core';
16
+ import { LibroView, notebookViewFactoryId } from '@difizen/libro-core';
17
+ import { URI, view, ViewOption } from '@difizen/mana-app';
18
+ import { inject, transient } from '@difizen/mana-app';
19
+ export var LibroJupyterView = (_dec = transient(), _dec2 = view(notebookViewFactoryId), _dec(_class = _dec2(_class = /*#__PURE__*/function (_LibroView) {
20
+ _inherits(LibroJupyterView, _LibroView);
21
+ var _super = _createSuper(LibroJupyterView);
22
+ function LibroJupyterView(options, collapseServiceFactory, notebookService) {
23
+ var _this;
24
+ _classCallCheck(this, LibroJupyterView);
25
+ _this = _super.call(this, options, collapseServiceFactory, notebookService);
26
+ _this.uri = void 0;
27
+ var uri = new URI(options['resource']);
28
+ _this.uri = uri;
29
+ _this.title.label = uri.displayName;
30
+ return _this;
31
+ }
32
+ LibroJupyterView = inject(NotebookService)(LibroJupyterView, undefined, 2) || LibroJupyterView;
33
+ LibroJupyterView = inject(CollapseServiceFactory)(LibroJupyterView, undefined, 1) || LibroJupyterView;
34
+ LibroJupyterView = inject(ViewOption)(LibroJupyterView, undefined, 0) || LibroJupyterView;
35
+ _createClass(LibroJupyterView, [{
36
+ key: "options",
37
+ get: function get() {
38
+ return this.model.options;
39
+ }
40
+ }]);
41
+ return LibroJupyterView;
42
+ }(LibroView)) || _class) || _class);
package/es/module.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import { ManaModule } from '@difizen/mana-app';
2
+ export declare const LibroJupyterModule: ManaModule;
3
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../src/module.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AA4B/C,eAAO,MAAM,kBAAkB,YAoD5B,CAAC"}
package/es/module.js ADDED
@@ -0,0 +1,48 @@
1
+ import { LibroCodeCellModel, LibroCodeCellView, CodeCellModule } from '@difizen/libro-codemirror-code-cell';
2
+ import { MarkdownCellModule } from '@difizen/libro-codemirror-markdown-cell';
3
+ import { RawCellModule } from '@difizen/libro-codemirror-raw-cell';
4
+ import { LibroModule, LibroToolbarModule, LibroKeybindRegistry, LibroModel, LibroAddCellModule, CellExecutionTimeProvider, CellInputBottonBlankProvider } from '@difizen/libro-core';
5
+ import { LibroKernelManageModule } from '@difizen/libro-kernel';
6
+ import { DisplayDataOutputModule, ErrorOutputModule, StreamOutputModule } from '@difizen/libro-output';
7
+ import { LibroSearchModule } from '@difizen/libro-search';
8
+ import { SearchCodemirrorCellModule } from '@difizen/libro-search-codemirror-cell';
9
+ import { ManaModule } from '@difizen/mana-app';
10
+ import { LibroBetweenCellModule } from "./add-between-cell/index.js";
11
+ import { JupyterCodeCellModel, JupyterCodeCellView } from "./cell/index.js";
12
+ import { LibroJupyterCommandContribution, LibroJupyterKeybindingContribution } from "./command/index.js";
13
+ import { CellExecutionTip, CellInputBottomBlank } from "./components/index.js";
14
+ import { ConfigAppContribution } from "./config/index.js";
15
+ import { LibroConfigurationContribution } from "./configuration/libro-configuration-contribution.js";
16
+ import { LibroJupyterContentContribution } from "./contents/index.js";
17
+ import { LibroJupyterFileModule } from "./file/index.js";
18
+ import { KeybindInstructionsModule } from "./keybind-instructions/index.js";
19
+ import { LibroJupyterFileService } from "./libro-jupyter-file-service.js";
20
+ import { LibroJupyterModel } from "./libro-jupyter-model.js";
21
+ import { KernelStatusAndSelectorProvider } from "./libro-jupyter-protocol.js";
22
+ import { JupyterServerLaunchManager } from "./libro-jupyter-server-launch-manager.js";
23
+ import { LibroJupyterView } from "./libro-jupyter-view.js";
24
+ import { LibroJupyterOutputArea } from "./output/index.js";
25
+ import { PlotlyModule } from "./rendermime/index.js";
26
+ import { LibroJupyterColorContribution } from "./theme/index.js";
27
+ import { LibroJupyterToolbarContribution, SaveFileErrorContribution, KernelStatusSelector } from "./toolbar/index.js";
28
+ export var LibroJupyterModule = ManaModule.create().register(LibroJupyterFileService, LibroJupyterCommandContribution, LibroJupyterKeybindingContribution, LibroJupyterToolbarContribution, ConfigAppContribution, SaveFileErrorContribution, LibroKeybindRegistry, LibroJupyterContentContribution, LibroJupyterOutputArea, LibroJupyterColorContribution, JupyterServerLaunchManager, LibroJupyterView, LibroConfigurationContribution, {
29
+ token: CellExecutionTimeProvider,
30
+ useValue: CellExecutionTip
31
+ }, {
32
+ token: CellInputBottonBlankProvider,
33
+ useValue: CellInputBottomBlank
34
+ }, {
35
+ token: KernelStatusAndSelectorProvider,
36
+ useValue: KernelStatusSelector
37
+ }, {
38
+ token: LibroModel,
39
+ useClass: LibroJupyterModel
40
+ }, {
41
+ token: LibroCodeCellModel,
42
+ useClass: JupyterCodeCellModel
43
+ }, {
44
+ token: LibroCodeCellView,
45
+ useClass: JupyterCodeCellView
46
+ }).dependOn(LibroModule, CodeCellModule, MarkdownCellModule, RawCellModule, StreamOutputModule, ErrorOutputModule, DisplayDataOutputModule, LibroToolbarModule, LibroKernelManageModule, LibroSearchModule, SearchCodemirrorCellModule, LibroAddCellModule,
47
+ // custom module
48
+ LibroBetweenCellModule, KeybindInstructionsModule, PlotlyModule, LibroJupyterFileModule);
@@ -0,0 +1,2 @@
1
+ export * from './libro-jupyter-outputarea.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/output/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC"}
@@ -0,0 +1 @@
1
+ export * from "./libro-jupyter-outputarea.js";
@@ -0,0 +1,8 @@
1
+ import type { LibroExecutableCellView, IOutputAreaOption } from '@difizen/libro-core';
2
+ import { LibroOutputArea } from '@difizen/libro-core';
3
+ export declare class LibroJupyterOutputArea extends LibroOutputArea {
4
+ cell: LibroExecutableCellView;
5
+ constructor(option: IOutputAreaOption);
6
+ handleMsg(): void;
7
+ }
8
+ //# sourceMappingURL=libro-jupyter-outputarea.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"libro-jupyter-outputarea.d.ts","sourceRoot":"","sources":["../../src/output/libro-jupyter-outputarea.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,uBAAuB,EAEvB,iBAAiB,EAClB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAUtD,qBAEa,sBAAuB,SAAQ,eAAe;IACjD,IAAI,EAAE,uBAAuB,CAAC;gBAEN,MAAM,EAAE,iBAAiB;IAKzD,SAAS;CA4CV"}
@@ -0,0 +1,77 @@
1
+ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
+ var _dec, _dec2, _class;
3
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
11
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
12
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
13
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
14
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
15
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
16
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
17
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
18
+ import { LibroOutputArea } from '@difizen/libro-core';
19
+ import { isDisplayDataMsg, isStreamMsg, isErrorMsg, isExecuteResultMsg, isExecuteReplyMsg } from '@difizen/libro-kernel';
20
+ import { view, inject, transient, ViewOption } from '@difizen/mana-app';
21
+ export var LibroJupyterOutputArea = (_dec = transient(), _dec2 = view('libro-output-area'), _dec(_class = _dec2(_class = /*#__PURE__*/function (_LibroOutputArea) {
22
+ _inherits(LibroJupyterOutputArea, _LibroOutputArea);
23
+ var _super = _createSuper(LibroJupyterOutputArea);
24
+ function LibroJupyterOutputArea(option) {
25
+ var _this;
26
+ _classCallCheck(this, LibroJupyterOutputArea);
27
+ _this = _super.call(this, option);
28
+ _this.handleMsg();
29
+ return _this;
30
+ }
31
+ LibroJupyterOutputArea = inject(ViewOption)(LibroJupyterOutputArea, undefined, 0) || LibroJupyterOutputArea;
32
+ _createClass(LibroJupyterOutputArea, [{
33
+ key: "handleMsg",
34
+ value: function handleMsg() {
35
+ var _this2 = this;
36
+ var cellModel = this.cell.model;
37
+ cellModel.msgChangeEmitter.event(function (msg) {
38
+ if (msg.header.msg_type !== 'status') {
39
+ if (msg.header.msg_type === 'execute_input') {
40
+ cellModel.executeCount = msg.content.execution_count;
41
+ }
42
+ if (isDisplayDataMsg(msg) || isStreamMsg(msg) || isErrorMsg(msg) || isExecuteResultMsg(msg)) {
43
+ var output = _objectSpread(_objectSpread({}, msg.content), {}, {
44
+ output_type: msg.header.msg_type
45
+ });
46
+ _this2.add(output);
47
+ }
48
+ //Handle an execute reply message.
49
+ if (isExecuteReplyMsg(msg)) {
50
+ var content = msg.content;
51
+ if (content.status !== 'ok') {
52
+ return;
53
+ }
54
+ var payload = content && content.payload;
55
+ if (!payload || !payload.length) {
56
+ return;
57
+ }
58
+ var pages = payload.filter(function (i) {
59
+ return i.source === 'page';
60
+ });
61
+ if (!pages.length) {
62
+ return;
63
+ }
64
+ var page = JSON.parse(JSON.stringify(pages[0]));
65
+ var _output = {
66
+ output_type: 'display_data',
67
+ data: page.data,
68
+ metadata: {}
69
+ };
70
+ _this2.add(_output);
71
+ }
72
+ }
73
+ });
74
+ }
75
+ }]);
76
+ return LibroJupyterOutputArea;
77
+ }(LibroOutputArea)) || _class) || _class);
@@ -0,0 +1,31 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 132 132">
2
+ <defs>
3
+ <style>
4
+ .cls-1 {
5
+ fill: #119dff;
6
+ }
7
+
8
+ .cls-2 {
9
+ fill: #25fefd;
10
+ }
11
+
12
+ .cls-3 {
13
+ fill: #fff;
14
+ }
15
+ </style>
16
+ </defs>
17
+ <title>plotly-logomark</title>
18
+ <g id="symbol">
19
+ <rect class="cls-1" width="132" height="132" rx="6" ry="6"/>
20
+ <circle class="cls-2" cx="78" cy="54" r="6"/>
21
+ <circle class="cls-2" cx="102" cy="30" r="6"/>
22
+ <circle class="cls-2" cx="78" cy="30" r="6"/>
23
+ <circle class="cls-2" cx="54" cy="30" r="6"/>
24
+ <circle class="cls-2" cx="30" cy="30" r="6"/>
25
+ <circle class="cls-2" cx="30" cy="54" r="6"/>
26
+ <path class="cls-3" d="M30,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,30,72Z"/>
27
+ <path class="cls-3" d="M78,72a6,6,0,0,0-6,6v24a6,6,0,0,0,12,0V78A6,6,0,0,0,78,72Z"/>
28
+ <path class="cls-3" d="M54,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,54,48Z"/>
29
+ <path class="cls-3" d="M102,48a6,6,0,0,0-6,6v48a6,6,0,0,0,12,0V54A6,6,0,0,0,102,48Z"/>
30
+ </g>
31
+ </svg>
@@ -0,0 +1,5 @@
1
+ export * from './module.js';
2
+ export * from './plotly-renderers.js';
3
+ export * from './plotly-render.js';
4
+ export * from './plotly-rendermime-contribution.js';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rendermime/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qCAAqC,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from "./module.js";
2
+ export * from "./plotly-renderers.js";
3
+ export * from "./plotly-render.js";
4
+ export * from "./plotly-rendermime-contribution.js";
@@ -0,0 +1,22 @@
1
+ /* Base styles */
2
+ .libro-plotly-render {
3
+ width: 100%;
4
+ height: 100%;
5
+ padding: 0;
6
+ overflow: hidden;
7
+ }
8
+
9
+ /* Document styles */
10
+ .libro-plotly-render {
11
+ overflow: hidden;
12
+ }
13
+
14
+ /* Output styles */
15
+ .libro-plotly-render {
16
+ min-height: 360px;
17
+ }
18
+
19
+ /* Document icon */
20
+ .libro-PlotlyIcon {
21
+ background-image: url('./assets/plotly.svg');
22
+ }
@@ -0,0 +1,3 @@
1
+ import { ManaModule } from '@difizen/mana-app';
2
+ export declare const PlotlyModule: ManaModule;
3
+ //# sourceMappingURL=module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/rendermime/module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAI/C,eAAO,MAAM,YAAY,YAExB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ManaModule } from '@difizen/mana-app';
2
+ import { LibroPlotlyMimeTypeContribution } from "./plotly-rendermime-contribution.js";
3
+ export var PlotlyModule = ManaModule.create().register(LibroPlotlyMimeTypeContribution);
@@ -0,0 +1,7 @@
1
+ import type { BaseOutputView } from '@difizen/libro-core';
2
+ import type { FC } from 'react';
3
+ import './index.less';
4
+ export declare const PlotlyRender: FC<{
5
+ model: BaseOutputView;
6
+ }>;
7
+ //# sourceMappingURL=plotly-render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plotly-render.d.ts","sourceRoot":"","sources":["../../src/rendermime/plotly-render.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAK1D,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAGhC,OAAO,cAAc,CAAC;AAEtB,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC;IAAE,KAAK,EAAE,cAAc,CAAA;CAAE,CAwBtD,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { RenderMimeRegistry } from '@difizen/libro-rendermime';
2
+ import { useInject } from '@difizen/mana-app';
3
+ import { useEffect, useRef } from 'react';
4
+ import { renderPlotly } from "./plotly-renderers.js";
5
+ import "./index.less";
6
+ import { jsx as _jsx } from "react/jsx-runtime";
7
+ export var PlotlyRender = function PlotlyRender(props) {
8
+ var model = props.model;
9
+ var renderPlotlyRef = useRef(null);
10
+ var defaultRenderMime = useInject(RenderMimeRegistry);
11
+ var mimeType = defaultRenderMime.preferredMimeType(model);
12
+ useEffect(function () {
13
+ if (mimeType) {
14
+ renderPlotly({
15
+ model: model,
16
+ host: renderPlotlyRef.current,
17
+ source: model.data[mimeType],
18
+ mimeType: mimeType
19
+ });
20
+ }
21
+ // eslint-disable-next-line react-hooks/exhaustive-deps
22
+ }, []);
23
+ return /*#__PURE__*/_jsx("div", {
24
+ className: "libro-plotly-render-container",
25
+ children: /*#__PURE__*/_jsx("div", {
26
+ className: "libro-plotly-render",
27
+ ref: renderPlotlyRef
28
+ })
29
+ });
30
+ };
@@ -0,0 +1,58 @@
1
+ import type { JSONValue } from '@difizen/libro-common';
2
+ import type { BaseOutputView } from '@difizen/libro-core';
3
+ /**
4
+ * The options used to create a renderer.
5
+ */
6
+ export interface IRendererPlotlyOptions {
7
+ /**
8
+ * The host node for the text content.
9
+ */
10
+ host: HTMLElement;
11
+ /**
12
+ * The source text to render.
13
+ */
14
+ source: JSONValue;
15
+ /**
16
+ * The preferred mimeType to render.
17
+ */
18
+ mimeType: string;
19
+ model: BaseOutputView;
20
+ }
21
+ /**
22
+ * The MIME type for Plotly.
23
+ * The version of this follows the major version of Plotly.
24
+ */
25
+ export declare const MIME_TYPE = "application/vnd.plotly.v1+json";
26
+ export declare class RenderedPlotly {
27
+ /**
28
+ * Create a new widget for rendering Plotly.
29
+ */
30
+ constructor(options: IRendererPlotlyOptions);
31
+ /**
32
+ * Render Plotly into this widget's node.
33
+ */
34
+ renderModel(model: BaseOutputView): Promise<void>;
35
+ private hasGraphElement;
36
+ private updateImage;
37
+ private hideGraph;
38
+ private showGraph;
39
+ private hideImage;
40
+ private showImage;
41
+ private createGraph;
42
+ private _mimeType;
43
+ private _img_el;
44
+ private _model;
45
+ private node;
46
+ private static Plotly;
47
+ private static _resolveLoadingPlotly;
48
+ private static loadingPlotly;
49
+ }
50
+ /**
51
+ * Render an plotly into a host node.
52
+ *
53
+ * @param options - The options for rendering.
54
+ *
55
+ * @returns A promise which resolves when rendering is complete.
56
+ */
57
+ export declare function renderPlotly(options: IRendererPlotlyOptions): Promise<void>;
58
+ //# sourceMappingURL=plotly-renderers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plotly-renderers.d.ts","sourceRoot":"","sources":["../../src/rendermime/plotly-renderers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;OAEG;IACH,IAAI,EAAE,WAAW,CAAC;IAClB;;OAEG;IACH,MAAM,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB,KAAK,EAAE,cAAc,CAAC;CACvB;AACD;;;GAGG;AACH,eAAO,MAAM,SAAS,mCAAmC,CAAC;AAO1D,qBAAa,cAAc;IACzB;;OAEG;gBACS,OAAO,EAAE,sBAAsB;IAc3C;;OAEG;IACH,WAAW,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAqBjD,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,WAAW;IAMnB,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,WAAW;IAiDnB,OAAO,CAAC,SAAS,CAAS;IAC1B,OAAO,CAAC,OAAO,CAAmB;IAClC,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,IAAI,CAAc;IAC1B,OAAO,CAAC,MAAM,CAAC,MAAM,CAAkC;IACvD,OAAO,CAAC,MAAM,CAAC,qBAAqB,CAAa;IACjD,OAAO,CAAC,MAAM,CAAC,aAAa,CAEzB;CACJ;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAI3E"}