@difizen/libro-core 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 (312) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +3 -0
  3. package/es/add-cell/index.d.ts +4 -0
  4. package/es/add-cell/index.d.ts.map +1 -0
  5. package/es/add-cell/index.js +3 -0
  6. package/es/add-cell/index.less +38 -0
  7. package/es/add-cell/libro-add-cell-module.d.ts +3 -0
  8. package/es/add-cell/libro-add-cell-module.d.ts.map +1 -0
  9. package/es/add-cell/libro-add-cell-module.js +4 -0
  10. package/es/add-cell/libro-add-cell-slot-contribution.d.ts +12 -0
  11. package/es/add-cell/libro-add-cell-slot-contribution.d.ts.map +1 -0
  12. package/es/add-cell/libro-add-cell-slot-contribution.js +53 -0
  13. package/es/add-cell/libro-add-cell-view.d.ts +21 -0
  14. package/es/add-cell/libro-add-cell-view.d.ts.map +1 -0
  15. package/es/add-cell/libro-add-cell-view.js +129 -0
  16. package/es/cell/index.d.ts +10 -0
  17. package/es/cell/index.d.ts.map +1 -0
  18. package/es/cell/index.js +9 -0
  19. package/es/cell/libro-cell-contribution.d.ts +13 -0
  20. package/es/cell/libro-cell-contribution.d.ts.map +1 -0
  21. package/es/cell/libro-cell-contribution.js +41 -0
  22. package/es/cell/libro-cell-model.d.ts +19 -0
  23. package/es/cell/libro-cell-model.d.ts.map +1 -0
  24. package/es/cell/libro-cell-model.js +103 -0
  25. package/es/cell/libro-cell-module.d.ts +10 -0
  26. package/es/cell/libro-cell-module.d.ts.map +1 -0
  27. package/es/cell/libro-cell-module.js +30 -0
  28. package/es/cell/libro-cell-protocol.d.ts +42 -0
  29. package/es/cell/libro-cell-protocol.d.ts.map +1 -0
  30. package/es/cell/libro-cell-protocol.js +11 -0
  31. package/es/cell/libro-cell-service.d.ts +28 -0
  32. package/es/cell/libro-cell-service.d.ts.map +1 -0
  33. package/es/cell/libro-cell-service.js +242 -0
  34. package/es/cell/libro-cell-view.d.ts +65 -0
  35. package/es/cell/libro-cell-view.d.ts.map +1 -0
  36. package/es/cell/libro-cell-view.js +191 -0
  37. package/es/cell/libro-edit-cell-view.d.ts +32 -0
  38. package/es/cell/libro-edit-cell-view.d.ts.map +1 -0
  39. package/es/cell/libro-edit-cell-view.js +72 -0
  40. package/es/cell/libro-executable-cell-model.d.ts +14 -0
  41. package/es/cell/libro-executable-cell-model.d.ts.map +1 -0
  42. package/es/cell/libro-executable-cell-model.js +7 -0
  43. package/es/cell/libro-executable-cell-view.d.ts +27 -0
  44. package/es/cell/libro-executable-cell-view.d.ts.map +1 -0
  45. package/es/cell/libro-executable-cell-view.js +66 -0
  46. package/es/cell/libro-markdown-cell-model.d.ts +9 -0
  47. package/es/cell/libro-markdown-cell-model.d.ts.map +1 -0
  48. package/es/cell/libro-markdown-cell-model.js +7 -0
  49. package/es/collapse-service.d.ts +36 -0
  50. package/es/collapse-service.d.ts.map +1 -0
  51. package/es/collapse-service.js +55 -0
  52. package/es/command/document-commands.d.ts +6 -0
  53. package/es/command/document-commands.d.ts.map +1 -0
  54. package/es/command/document-commands.js +13 -0
  55. package/es/command/index.d.ts +7 -0
  56. package/es/command/index.d.ts.map +1 -0
  57. package/es/command/index.js +6 -0
  58. package/es/command/kernel-command.d.ts +5 -0
  59. package/es/command/kernel-command.d.ts.map +1 -0
  60. package/es/command/kernel-command.js +39 -0
  61. package/es/command/libro-command-contribution.d.ts +14 -0
  62. package/es/command/libro-command-contribution.d.ts.map +1 -0
  63. package/es/command/libro-command-contribution.js +1751 -0
  64. package/es/command/libro-command-register.d.ts +22 -0
  65. package/es/command/libro-command-register.d.ts.map +1 -0
  66. package/es/command/libro-command-register.js +105 -0
  67. package/es/command/module.d.ts +3 -0
  68. package/es/command/module.d.ts.map +1 -0
  69. package/es/command/module.js +4 -0
  70. package/es/command/notebook-commands.d.ts +6 -0
  71. package/es/command/notebook-commands.d.ts.map +1 -0
  72. package/es/command/notebook-commands.js +468 -0
  73. package/es/components/cell-protocol.d.ts +20 -0
  74. package/es/components/cell-protocol.d.ts.map +1 -0
  75. package/es/components/cell-protocol.js +4 -0
  76. package/es/components/dnd-cell-item-render.d.ts +12 -0
  77. package/es/components/dnd-cell-item-render.d.ts.map +1 -0
  78. package/es/components/dnd-cell-item-render.js +253 -0
  79. package/es/components/dnd-component/custom-drag-layer.d.ts +9 -0
  80. package/es/components/dnd-component/custom-drag-layer.d.ts.map +1 -0
  81. package/es/components/dnd-component/custom-drag-layer.js +141 -0
  82. package/es/components/dnd-component/default-dnd-content.d.ts +10 -0
  83. package/es/components/dnd-component/default-dnd-content.d.ts.map +1 -0
  84. package/es/components/dnd-component/default-dnd-content.js +257 -0
  85. package/es/components/dnd-component/dnd-context.d.ts +3 -0
  86. package/es/components/dnd-component/dnd-context.d.ts.map +1 -0
  87. package/es/components/dnd-component/dnd-context.js +20 -0
  88. package/es/components/dnd-component/dnd-list.d.ts +10 -0
  89. package/es/components/dnd-component/dnd-list.d.ts.map +1 -0
  90. package/es/components/dnd-component/dnd-list.js +115 -0
  91. package/es/components/dnd-component/index.d.ts +5 -0
  92. package/es/components/dnd-component/index.d.ts.map +1 -0
  93. package/es/components/dnd-component/index.js +4 -0
  94. package/es/components/index.d.ts +6 -0
  95. package/es/components/index.d.ts.map +1 -0
  96. package/es/components/index.js +5 -0
  97. package/es/components/libro-component.d.ts +5 -0
  98. package/es/components/libro-component.d.ts.map +1 -0
  99. package/es/components/libro-component.js +35 -0
  100. package/es/components/libro-side-toolbar-menu.d.ts +21 -0
  101. package/es/components/libro-side-toolbar-menu.d.ts.map +1 -0
  102. package/es/components/libro-side-toolbar-menu.js +58 -0
  103. package/es/components/libro-view-header.d.ts +3 -0
  104. package/es/components/libro-view-header.d.ts.map +1 -0
  105. package/es/components/libro-view-header.js +37 -0
  106. package/es/configuration/libro-configuration-contribution.d.ts +5 -0
  107. package/es/configuration/libro-configuration-contribution.d.ts.map +1 -0
  108. package/es/configuration/libro-configuration-contribution.js +24 -0
  109. package/es/configuration/libro-configuration.d.ts +10 -0
  110. package/es/configuration/libro-configuration.d.ts.map +1 -0
  111. package/es/configuration/libro-configuration.js +81 -0
  112. package/es/content/index.d.ts +5 -0
  113. package/es/content/index.d.ts.map +1 -0
  114. package/es/content/index.js +4 -0
  115. package/es/content/libro-content-contribution.d.ts +11 -0
  116. package/es/content/libro-content-contribution.d.ts.map +1 -0
  117. package/es/content/libro-content-contribution.js +32 -0
  118. package/es/content/libro-content-module.d.ts +3 -0
  119. package/es/content/libro-content-module.d.ts.map +1 -0
  120. package/es/content/libro-content-module.js +5 -0
  121. package/es/content/libro-content-protocol.d.ts +8 -0
  122. package/es/content/libro-content-protocol.d.ts.map +1 -0
  123. package/es/content/libro-content-protocol.js +2 -0
  124. package/es/content/libro-content-service.d.ts +9 -0
  125. package/es/content/libro-content-service.d.ts.map +1 -0
  126. package/es/content/libro-content-service.js +35 -0
  127. package/es/index.d.ts +20 -0
  128. package/es/index.d.ts.map +1 -0
  129. package/es/index.js +19 -0
  130. package/es/index.less +682 -0
  131. package/es/libro-context-key.d.ts +22 -0
  132. package/es/libro-context-key.d.ts.map +1 -0
  133. package/es/libro-context-key.js +80 -0
  134. package/es/libro-keybind-registry.d.ts +5 -0
  135. package/es/libro-keybind-registry.d.ts.map +1 -0
  136. package/es/libro-keybind-registry.js +68 -0
  137. package/es/libro-model.d.ts +129 -0
  138. package/es/libro-model.d.ts.map +1 -0
  139. package/es/libro-model.js +803 -0
  140. package/es/libro-protocol.d.ts +241 -0
  141. package/es/libro-protocol.d.ts.map +1 -0
  142. package/es/libro-protocol.js +34 -0
  143. package/es/libro-service.d.ts +34 -0
  144. package/es/libro-service.d.ts.map +1 -0
  145. package/es/libro-service.js +180 -0
  146. package/es/libro-view-tracker.d.ts +6 -0
  147. package/es/libro-view-tracker.d.ts.map +1 -0
  148. package/es/libro-view-tracker.js +13 -0
  149. package/es/libro-view.d.ts +151 -0
  150. package/es/libro-view.d.ts.map +1 -0
  151. package/es/libro-view.js +1963 -0
  152. package/es/material-from-designer.d.ts +27 -0
  153. package/es/material-from-designer.d.ts.map +1 -0
  154. package/es/material-from-designer.js +550 -0
  155. package/es/module.d.ts +3 -0
  156. package/es/module.d.ts.map +1 -0
  157. package/es/module.js +55 -0
  158. package/es/output/index.d.ts +6 -0
  159. package/es/output/index.d.ts.map +1 -0
  160. package/es/output/index.js +5 -0
  161. package/es/output/output-area.d.ts +51 -0
  162. package/es/output/output-area.d.ts.map +1 -0
  163. package/es/output/output-area.js +346 -0
  164. package/es/output/output-contribution.d.ts +11 -0
  165. package/es/output/output-contribution.d.ts.map +1 -0
  166. package/es/output/output-contribution.js +31 -0
  167. package/es/output/output-model.d.ts +27 -0
  168. package/es/output/output-model.d.ts.map +1 -0
  169. package/es/output/output-model.js +95 -0
  170. package/es/output/output-module.d.ts +3 -0
  171. package/es/output/output-module.d.ts.map +1 -0
  172. package/es/output/output-module.js +6 -0
  173. package/es/output/output-protocol.d.ts +130 -0
  174. package/es/output/output-protocol.d.ts.map +1 -0
  175. package/es/output/output-protocol.js +18 -0
  176. package/es/slot/index.d.ts +5 -0
  177. package/es/slot/index.d.ts.map +1 -0
  178. package/es/slot/index.js +4 -0
  179. package/es/slot/libro-slot-manager.d.ts +13 -0
  180. package/es/slot/libro-slot-manager.d.ts.map +1 -0
  181. package/es/slot/libro-slot-manager.js +57 -0
  182. package/es/slot/libro-slot-protocol.d.ts +19 -0
  183. package/es/slot/libro-slot-protocol.d.ts.map +1 -0
  184. package/es/slot/libro-slot-protocol.js +5 -0
  185. package/es/slot/libro-slot-view.d.ts +9 -0
  186. package/es/slot/libro-slot-view.d.ts.map +1 -0
  187. package/es/slot/libro-slot-view.js +81 -0
  188. package/es/slot/module.d.ts +3 -0
  189. package/es/slot/module.d.ts.map +1 -0
  190. package/es/slot/module.js +5 -0
  191. package/es/theme/libro-color-registry.d.ts +6 -0
  192. package/es/theme/libro-color-registry.d.ts.map +1 -0
  193. package/es/theme/libro-color-registry.js +494 -0
  194. package/es/toolbar/change-cell-to-selector.d.ts +5 -0
  195. package/es/toolbar/change-cell-to-selector.d.ts.map +1 -0
  196. package/es/toolbar/change-cell-to-selector.js +48 -0
  197. package/es/toolbar/hide-all-selector.d.ts +5 -0
  198. package/es/toolbar/hide-all-selector.d.ts.map +1 -0
  199. package/es/toolbar/hide-all-selector.js +99 -0
  200. package/es/toolbar/index.d.ts +4 -0
  201. package/es/toolbar/index.d.ts.map +1 -0
  202. package/es/toolbar/index.js +3 -0
  203. package/es/toolbar/index.less +59 -0
  204. package/es/toolbar/libro-toolbar-protocol.d.ts +4 -0
  205. package/es/toolbar/libro-toolbar-protocol.d.ts.map +1 -0
  206. package/es/toolbar/libro-toolbar-protocol.js +1 -0
  207. package/es/toolbar/libro-toolbar.d.ts +8 -0
  208. package/es/toolbar/libro-toolbar.d.ts.map +1 -0
  209. package/es/toolbar/libro-toolbar.js +223 -0
  210. package/es/toolbar/module.d.ts +3 -0
  211. package/es/toolbar/module.d.ts.map +1 -0
  212. package/es/toolbar/module.js +5 -0
  213. package/es/toolbar/restart-clear-outputs-contribution.d.ts +5 -0
  214. package/es/toolbar/restart-clear-outputs-contribution.d.ts.map +1 -0
  215. package/es/toolbar/restart-clear-outputs-contribution.js +23 -0
  216. package/es/toolbar/restart-clear-outputs-modal.d.ts +6 -0
  217. package/es/toolbar/restart-clear-outputs-modal.d.ts.map +1 -0
  218. package/es/toolbar/restart-clear-outputs-modal.js +30 -0
  219. package/es/toolbar/save-icon.d.ts +3 -0
  220. package/es/toolbar/save-icon.d.ts.map +1 -0
  221. package/es/toolbar/save-icon.js +54 -0
  222. package/es/toolbar/shutdown-contribution.d.ts +5 -0
  223. package/es/toolbar/shutdown-contribution.d.ts.map +1 -0
  224. package/es/toolbar/shutdown-contribution.js +23 -0
  225. package/es/toolbar/shutdown-modal.d.ts +6 -0
  226. package/es/toolbar/shutdown-modal.d.ts.map +1 -0
  227. package/es/toolbar/shutdown-modal.js +30 -0
  228. package/es/toolbar/side-toolar-more-select.d.ts +4 -0
  229. package/es/toolbar/side-toolar-more-select.d.ts.map +1 -0
  230. package/es/toolbar/side-toolar-more-select.js +161 -0
  231. package/es/typings/index.d.ts +1 -0
  232. package/package.json +70 -0
  233. package/src/add-cell/index.less +38 -0
  234. package/src/add-cell/index.ts +3 -0
  235. package/src/add-cell/libro-add-cell-module.ts +9 -0
  236. package/src/add-cell/libro-add-cell-slot-contribution.ts +31 -0
  237. package/src/add-cell/libro-add-cell-view.tsx +101 -0
  238. package/src/cell/README.md +14 -0
  239. package/src/cell/index.ts +9 -0
  240. package/src/cell/libro-cell-contribution.ts +38 -0
  241. package/src/cell/libro-cell-model.ts +61 -0
  242. package/src/cell/libro-cell-module.ts +40 -0
  243. package/src/cell/libro-cell-protocol.ts +53 -0
  244. package/src/cell/libro-cell-service.ts +157 -0
  245. package/src/cell/libro-cell-view.tsx +128 -0
  246. package/src/cell/libro-edit-cell-view.tsx +60 -0
  247. package/src/cell/libro-executable-cell-model.ts +32 -0
  248. package/src/cell/libro-executable-cell-view.ts +74 -0
  249. package/src/cell/libro-markdown-cell-model.ts +20 -0
  250. package/src/collapse-service.ts +69 -0
  251. package/src/command/document-commands.ts +18 -0
  252. package/src/command/index.ts +6 -0
  253. package/src/command/kernel-command.ts +41 -0
  254. package/src/command/libro-command-contribution.ts +1339 -0
  255. package/src/command/libro-command-register.ts +171 -0
  256. package/src/command/module.ts +9 -0
  257. package/src/command/notebook-commands.ts +498 -0
  258. package/src/components/cell-protocol.ts +22 -0
  259. package/src/components/dnd-cell-item-render.tsx +308 -0
  260. package/src/components/dnd-component/custom-drag-layer.tsx +145 -0
  261. package/src/components/dnd-component/default-dnd-content.tsx +275 -0
  262. package/src/components/dnd-component/dnd-context.tsx +28 -0
  263. package/src/components/dnd-component/dnd-list.tsx +116 -0
  264. package/src/components/dnd-component/index.tsx +4 -0
  265. package/src/components/index.ts +5 -0
  266. package/src/components/libro-component.tsx +30 -0
  267. package/src/components/libro-side-toolbar-menu.tsx +82 -0
  268. package/src/components/libro-view-header.tsx +33 -0
  269. package/src/configuration/libro-configuration-contribution.ts +29 -0
  270. package/src/configuration/libro-configuration.ts +88 -0
  271. package/src/content/index.ts +4 -0
  272. package/src/content/libro-content-contribution.ts +17 -0
  273. package/src/content/libro-content-module.ts +9 -0
  274. package/src/content/libro-content-protocol.ts +8 -0
  275. package/src/content/libro-content-service.ts +30 -0
  276. package/src/index.less +682 -0
  277. package/src/index.tsx +19 -0
  278. package/src/libro-context-key.ts +80 -0
  279. package/src/libro-keybind-registry.ts +43 -0
  280. package/src/libro-model.ts +614 -0
  281. package/src/libro-protocol.ts +322 -0
  282. package/src/libro-service.ts +121 -0
  283. package/src/libro-view-tracker.ts +9 -0
  284. package/src/libro-view.tsx +1399 -0
  285. package/src/material-from-designer.tsx +457 -0
  286. package/src/module.ts +90 -0
  287. package/src/output/index.ts +5 -0
  288. package/src/output/output-area.tsx +255 -0
  289. package/src/output/output-contribution.ts +18 -0
  290. package/src/output/output-model.tsx +66 -0
  291. package/src/output/output-module.ts +10 -0
  292. package/src/output/output-protocol.ts +164 -0
  293. package/src/slot/index.ts +4 -0
  294. package/src/slot/libro-slot-manager.ts +37 -0
  295. package/src/slot/libro-slot-protocol.ts +28 -0
  296. package/src/slot/libro-slot-view.tsx +51 -0
  297. package/src/slot/module.ts +9 -0
  298. package/src/theme/libro-color-registry.ts +371 -0
  299. package/src/toolbar/change-cell-to-selector.tsx +58 -0
  300. package/src/toolbar/hide-all-selector.tsx +126 -0
  301. package/src/toolbar/index.less +59 -0
  302. package/src/toolbar/index.ts +3 -0
  303. package/src/toolbar/libro-toolbar-protocol.ts +4 -0
  304. package/src/toolbar/libro-toolbar.tsx +192 -0
  305. package/src/toolbar/module.ts +11 -0
  306. package/src/toolbar/restart-clear-outputs-contribution.tsx +10 -0
  307. package/src/toolbar/restart-clear-outputs-modal.tsx +37 -0
  308. package/src/toolbar/save-icon.tsx +47 -0
  309. package/src/toolbar/shutdown-contribution.tsx +10 -0
  310. package/src/toolbar/shutdown-modal.tsx +37 -0
  311. package/src/toolbar/side-toolar-more-select.tsx +172 -0
  312. package/src/typings/index.d.ts +1 -0
@@ -0,0 +1,191 @@
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, _dec3, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5;
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 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; }
7
+ 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; }
8
+ 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; }
9
+ 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 }); }
10
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
+ 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); } }
12
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
13
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
14
+ 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); }
15
+ function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }
16
+ function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }
17
+ 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); }
18
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
19
+ 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); }; }
20
+ 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); }
21
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
22
+ 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; } }
23
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
24
+ 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; }
25
+ 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.'); }
26
+ import { useInject, watch } from '@difizen/mana-app';
27
+ import { BaseView, view, ViewInstance, ViewOption } from '@difizen/mana-app';
28
+ import { inject } from '@difizen/mana-app';
29
+ import { DisposableCollection } from '@difizen/mana-app';
30
+ import { prop } from '@difizen/mana-app';
31
+ import React from 'react';
32
+ import { CellService } from "./libro-cell-protocol.js";
33
+ import { ExecutableCellModel } from "./libro-executable-cell-model.js";
34
+ import { Fragment as _Fragment } from "react/jsx-runtime";
35
+ import { jsx as _jsx } from "react/jsx-runtime";
36
+ export var LibroCellComponent = /*#__PURE__*/React.forwardRef(function LibroCellComponent() {
37
+ var instance = useInject(ViewInstance);
38
+ return /*#__PURE__*/_jsx(_Fragment, {
39
+ children: instance.model.value
40
+ });
41
+ });
42
+ export var LibroCellView = (_dec = view('libro-cell-view'), _dec2 = prop(), _dec3 = prop(), _dec4 = prop(), _dec5 = prop(), _dec6 = prop(), _dec(_class = (_class2 = /*#__PURE__*/function (_BaseView) {
43
+ _inherits(LibroCellView, _BaseView);
44
+ var _super = _createSuper(LibroCellView);
45
+ function LibroCellView(options, cellService) {
46
+ var _this;
47
+ _classCallCheck(this, LibroCellView);
48
+ _this = _super.call(this);
49
+ _this.toDispose = new DisposableCollection();
50
+ _this.options = void 0;
51
+ _initializerDefineProperty(_this, "model", _descriptor, _assertThisInitialized(_this));
52
+ _this.cellService = void 0;
53
+ _this.view = LibroCellComponent;
54
+ _this.parent = void 0;
55
+ _initializerDefineProperty(_this, "className", _descriptor2, _assertThisInitialized(_this));
56
+ _initializerDefineProperty(_this, "hasInputHidden", _descriptor3, _assertThisInitialized(_this));
57
+ _initializerDefineProperty(_this, "collapsedHidden", _descriptor4, _assertThisInitialized(_this));
58
+ _initializerDefineProperty(_this, "hasModal", _descriptor5, _assertThisInitialized(_this));
59
+ _this.disposed = false;
60
+ _this.toJSONWithoutId = function () {
61
+ var JsonObject = _this.toJSON();
62
+ delete JsonObject.id;
63
+ return _objectSpread({}, JsonObject);
64
+ };
65
+ _this.cellService = cellService;
66
+ _this.options = options;
67
+ _this.hasInputHidden = false;
68
+ var model = cellService.getModelFromCache(options.parentId, options.modelId);
69
+ if (!model) {
70
+ console.warn('cell model does not exist');
71
+ throw new Error('cell model does not exist');
72
+ }
73
+ _this.model = model;
74
+ _this.cellWatch();
75
+ return _this;
76
+ }
77
+ LibroCellView = inject(CellService)(LibroCellView, undefined, 1) || LibroCellView;
78
+ LibroCellView = inject(ViewOption)(LibroCellView, undefined, 0) || LibroCellView;
79
+ _createClass(LibroCellView, [{
80
+ key: "cellWatch",
81
+ value: function cellWatch() {
82
+ var _this2 = this;
83
+ this.toDispose.push(watch(this.model, 'value', function () {
84
+ var _this2$parent$model$o, _this2$parent$model;
85
+ (_this2$parent$model$o = (_this2$parent$model = _this2.parent.model).onChange) === null || _this2$parent$model$o === void 0 ? void 0 : _this2$parent$model$o.call(_this2$parent$model);
86
+ }));
87
+ this.toDispose.push(watch(this.model, 'type', function () {
88
+ var _this2$parent$model$o2, _this2$parent$model2;
89
+ (_this2$parent$model$o2 = (_this2$parent$model2 = _this2.parent.model).onChange) === null || _this2$parent$model$o2 === void 0 ? void 0 : _this2$parent$model$o2.call(_this2$parent$model2);
90
+ }));
91
+ if (ExecutableCellModel.is(this.model)) {
92
+ this.toDispose.push(watch(this.model, 'executeCount', function () {
93
+ var _this2$parent$model$o3, _this2$parent$model3;
94
+ (_this2$parent$model$o3 = (_this2$parent$model3 = _this2.parent.model).onChange) === null || _this2$parent$model$o3 === void 0 ? void 0 : _this2$parent$model$o3.call(_this2$parent$model3);
95
+ }));
96
+ }
97
+ }
98
+ }, {
99
+ key: "hasCellHidden",
100
+ value: function hasCellHidden() {
101
+ return this.hasInputHidden;
102
+ }
103
+ }, {
104
+ key: "run",
105
+ value: function () {
106
+ var _run = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
107
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
108
+ while (1) switch (_context.prev = _context.next) {
109
+ case 0:
110
+ return _context.abrupt("return", Promise.resolve(true));
111
+ case 1:
112
+ case "end":
113
+ return _context.stop();
114
+ }
115
+ }, _callee);
116
+ }));
117
+ function run() {
118
+ return _run.apply(this, arguments);
119
+ }
120
+ return run;
121
+ }() // eslint-disable-next-line @typescript-eslint/no-unused-vars
122
+ }, {
123
+ key: "shouldEnterEditorMode",
124
+ value: function shouldEnterEditorMode(_e) {
125
+ return false;
126
+ }
127
+ }, {
128
+ key: "blur",
129
+ value: function blur() {
130
+ //
131
+ }
132
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
133
+ }, {
134
+ key: "focus",
135
+ value: function focus(_isEdit) {
136
+ //
137
+ }
138
+ }, {
139
+ key: "dispose",
140
+ value: function dispose() {
141
+ if (!this.disposed) {
142
+ this.toDispose.dispose();
143
+ _get(_getPrototypeOf(LibroCellView.prototype), "dispose", this).call(this);
144
+ }
145
+ this.disposed = true;
146
+ }
147
+ }, {
148
+ key: "toJSON",
149
+ value: function toJSON() {
150
+ var meta = _objectSpread({}, this.model.toJSON());
151
+ var modelContribution = this.cellService.findModelProvider(this.model.options);
152
+ if (modelContribution !== null && modelContribution !== void 0 && modelContribution.cellMeta.nbformatType) {
153
+ meta.metadata.libroCellType = modelContribution === null || modelContribution === void 0 ? void 0 : modelContribution.cellMeta.type;
154
+ meta.cell_type = modelContribution === null || modelContribution === void 0 ? void 0 : modelContribution.cellMeta.nbformatType;
155
+ }
156
+ return meta;
157
+ }
158
+ }]);
159
+ return LibroCellView;
160
+ }(BaseView), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "model", [_dec2], {
161
+ configurable: true,
162
+ enumerable: true,
163
+ writable: true,
164
+ initializer: null
165
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "className", [_dec3], {
166
+ configurable: true,
167
+ enumerable: true,
168
+ writable: true,
169
+ initializer: function initializer() {
170
+ return 'libro-cell-view-container';
171
+ }
172
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "hasInputHidden", [_dec4], {
173
+ configurable: true,
174
+ enumerable: true,
175
+ writable: true,
176
+ initializer: null
177
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "collapsedHidden", [_dec5], {
178
+ configurable: true,
179
+ enumerable: true,
180
+ writable: true,
181
+ initializer: function initializer() {
182
+ return false;
183
+ }
184
+ }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "hasModal", [_dec6], {
185
+ configurable: true,
186
+ enumerable: true,
187
+ writable: true,
188
+ initializer: function initializer() {
189
+ return false;
190
+ }
191
+ })), _class2)) || _class);
@@ -0,0 +1,32 @@
1
+ import type { IEditor, IRange } from '@difizen/libro-code-editor';
2
+ import type { CellView } from '../libro-protocol.js';
3
+ import { LibroCellView } from './libro-cell-view.js';
4
+ export interface EditorCellView extends CellView {
5
+ editor: IEditor | undefined;
6
+ redo: () => void;
7
+ undo: () => void;
8
+ getSelections: () => IRange[];
9
+ getSelectionsOffsetAt: (selection: IRange) => {
10
+ start: number;
11
+ end: number;
12
+ };
13
+ }
14
+ export declare const EditorCellView: {
15
+ is: (arg: Record<any, any> | undefined) => arg is EditorCellView;
16
+ };
17
+ /**
18
+ * 带有编辑器能力的cell view,例如raw、markdown、python、sql等
19
+ * 超出编辑器的相关能力放在其他的更高抽象中
20
+ */
21
+ export declare abstract class LibroEditorCellView extends LibroCellView implements EditorCellView {
22
+ editor: IEditor | undefined;
23
+ abstract getSelections: () => IRange[];
24
+ abstract getSelectionsOffsetAt: (selection: IRange) => {
25
+ start: number;
26
+ end: number;
27
+ };
28
+ get wrapperCls(): string;
29
+ redo(): void;
30
+ undo(): void;
31
+ }
32
+ //# sourceMappingURL=libro-edit-cell-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"libro-edit-cell-view.d.ts","sourceRoot":"","sources":["../../src/cell/libro-edit-cell-view.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AAGlE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGrD,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAErD,MAAM,WAAW,cAAe,SAAQ,QAAQ;IAC9C,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAE5B,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,aAAa,EAAE,MAAM,MAAM,EAAE,CAAC;IAC9B,qBAAqB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK;QAC5C,KAAK,EAAE,MAAM,CAAC;QACd,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AAED,eAAO,MAAM,cAAc;cACf,OAAO,GAAG,EAAE,GAAG,CAAC,GAAG,SAAS;CAWvC,CAAC;AAEF;;;GAGG;AACH,8BAAsB,mBACpB,SAAQ,aACR,YAAW,cAAc;IAGzB,MAAM,EAAE,OAAO,GAAG,SAAS,CAAC;IAE5B,QAAQ,CAAC,aAAa,EAAE,MAAM,MAAM,EAAE,CAAC;IACvC,QAAQ,CAAC,qBAAqB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACtF,IAAI,UAAU,WAEb;IAED,IAAI,IAAI,IAAI;IAIZ,IAAI,IAAI,IAAI;CAGb"}
@@ -0,0 +1,72 @@
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, _descriptor;
3
+ 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 }); }
4
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5
+ 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); } }
6
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
7
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
8
+ 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); }
9
+ 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); }
10
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
11
+ 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); }; }
12
+ 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); }
13
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
14
+ 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; } }
15
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
16
+ 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; }
17
+ 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.'); }
18
+ import { prop } from '@difizen/mana-app';
19
+ import { isCellView } from "../libro-protocol.js";
20
+ import { LibroCellView } from "./libro-cell-view.js";
21
+ export var EditorCellView = {
22
+ is: function is(arg) {
23
+ return !!arg && isCellView(arg) &&
24
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
+ 'redo' in arg && typeof arg.redo === 'function' && 'undo' in arg && typeof arg.undo === 'function';
26
+ }
27
+ };
28
+
29
+ /**
30
+ * 带有编辑器能力的cell view,例如raw、markdown、python、sql等
31
+ * 超出编辑器的相关能力放在其他的更高抽象中
32
+ */
33
+ export var LibroEditorCellView = (_dec = prop(), (_class = /*#__PURE__*/function (_LibroCellView) {
34
+ _inherits(LibroEditorCellView, _LibroCellView);
35
+ var _super = _createSuper(LibroEditorCellView);
36
+ function LibroEditorCellView() {
37
+ var _this;
38
+ _classCallCheck(this, LibroEditorCellView);
39
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
40
+ args[_key] = arguments[_key];
41
+ }
42
+ _this = _super.call.apply(_super, [this].concat(args));
43
+ _initializerDefineProperty(_this, "editor", _descriptor, _assertThisInitialized(_this));
44
+ _this.getSelections = void 0;
45
+ _this.getSelectionsOffsetAt = void 0;
46
+ return _this;
47
+ }
48
+ _createClass(LibroEditorCellView, [{
49
+ key: "wrapperCls",
50
+ get: function get() {
51
+ return '';
52
+ }
53
+ }, {
54
+ key: "redo",
55
+ value: function redo() {
56
+ var _this$editor;
57
+ (_this$editor = this.editor) === null || _this$editor === void 0 ? void 0 : _this$editor.redo();
58
+ }
59
+ }, {
60
+ key: "undo",
61
+ value: function undo() {
62
+ var _this$editor2;
63
+ (_this$editor2 = this.editor) === null || _this$editor2 === void 0 ? void 0 : _this$editor2.undo();
64
+ }
65
+ }]);
66
+ return LibroEditorCellView;
67
+ }(LibroCellView), (_descriptor = _applyDecoratedDescriptor(_class.prototype, "editor", [_dec], {
68
+ configurable: true,
69
+ enumerable: true,
70
+ writable: true,
71
+ initializer: null
72
+ })), _class));
@@ -0,0 +1,14 @@
1
+ import type { ExecutionCount } from '@difizen/libro-common';
2
+ import type { Emitter } from '@difizen/mana-app';
3
+ export interface ExecutableCellModel {
4
+ executing: boolean;
5
+ executeCount: ExecutionCount;
6
+ hasOutputHidden: boolean;
7
+ hasOutputsScrolled: boolean;
8
+ msgChangeEmitter: Emitter<any>;
9
+ clearExecution: () => void;
10
+ }
11
+ export declare const ExecutableCellModel: {
12
+ is: (arg: Record<any, any> | undefined) => arg is ExecutableCellModel;
13
+ };
14
+ //# sourceMappingURL=libro-executable-cell-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"libro-executable-cell-model.d.ts","sourceRoot":"","sources":["../../src/cell/libro-executable-cell-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,MAAM,WAAW,mBAAmB;IAElC,SAAS,EAAE,OAAO,CAAC;IAGnB,YAAY,EAAE,cAAc,CAAC;IAE7B,eAAe,EAAE,OAAO,CAAC;IAEzB,kBAAkB,EAAE,OAAO,CAAC;IAG5B,gBAAgB,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC;IAE/B,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AAED,eAAO,MAAM,mBAAmB;cACpB,OAAO,GAAG,EAAE,GAAG,CAAC,GAAG,SAAS;CAUvC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export var ExecutableCellModel = {
2
+ is: function is(arg) {
3
+ return !!arg &&
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
+ 'executing' in arg && typeof arg.executing === 'boolean' && 'executeCount' in arg && (typeof arg.executeCount === 'number' || !arg.executeCount);
6
+ }
7
+ };
@@ -0,0 +1,27 @@
1
+ import type { CellModel } from '../libro-protocol.js';
2
+ import type { CellViewOptions } from '../libro-protocol.js';
3
+ import type { BaseOutputArea } from '../output/index.js';
4
+ import { CellService } from './libro-cell-protocol.js';
5
+ import { EditorCellView, LibroEditorCellView } from './libro-edit-cell-view.js';
6
+ import { ExecutableCellModel } from './libro-executable-cell-model.js';
7
+ interface ExecutableCellView extends EditorCellView {
8
+ clearExecution: () => void;
9
+ outputArea: BaseOutputArea;
10
+ }
11
+ export declare const ExecutableCellView: {
12
+ is: (arg: Record<any, any> | undefined) => arg is ExecutableCellView;
13
+ };
14
+ /**
15
+ * 带有编辑器、执行、output相关能力的cell view,例如python、sql
16
+ * model 必须为 ExecutableCellModel
17
+ */
18
+ export declare abstract class LibroExecutableCellView extends LibroEditorCellView implements ExecutableCellView {
19
+ model: CellModel & ExecutableCellModel;
20
+ outputArea: BaseOutputArea;
21
+ constructor(options: CellViewOptions, cellService: CellService);
22
+ clearExecution: () => void;
23
+ hasCellHidden(): boolean;
24
+ outputWatch(): void;
25
+ }
26
+ export {};
27
+ //# sourceMappingURL=libro-executable-cell-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"libro-executable-cell-view.d.ts","sourceRoot":"","sources":["../../src/cell/libro-executable-cell-view.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChF,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvE,UAAU,kBAAmB,SAAQ,cAAc;IACjD,cAAc,EAAE,MAAM,IAAI,CAAC;IAE3B,UAAU,EAAE,cAAc,CAAC;CAC5B;AAED,eAAO,MAAM,kBAAkB;cACnB,OAAO,GAAG,EAAE,GAAG,CAAC,GAAG,SAAS;CAWvC,CAAC;AAEF;;;GAGG;AACH,8BAAsB,uBACpB,SAAQ,mBACR,YAAW,kBAAkB;IAErB,KAAK,EAAE,SAAS,GAAG,mBAAmB,CAAC;IAEvC,UAAU,EAAE,cAAc,CAAC;gBAGb,OAAO,EAAE,eAAe,EACvB,WAAW,EAAE,WAAW;IAM/C,cAAc,EAAE,MAAM,IAAI,CAExB;IAEO,aAAa;IAUtB,WAAW;CAOZ"}
@@ -0,0 +1,66 @@
1
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
2
+ 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); } }
3
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
4
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
5
+ 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); }
6
+ 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); }
7
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
8
+ 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); }; }
9
+ 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); }
10
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
11
+ 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; } }
12
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
13
+ 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); }
14
+ import { watch } from '@difizen/mana-app';
15
+ import { ViewOption } from '@difizen/mana-app';
16
+ import { inject } from '@difizen/mana-app';
17
+ import { CellService } from "./libro-cell-protocol.js";
18
+ import { EditorCellView, LibroEditorCellView } from "./libro-edit-cell-view.js";
19
+ import { ExecutableCellModel } from "./libro-executable-cell-model.js";
20
+ export var ExecutableCellView = {
21
+ is: function is(arg) {
22
+ return !!arg && EditorCellView.is(arg) &&
23
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
+ 'outputArea' in arg && _typeof(arg.outputArea) === 'object' && 'clearExecution' in arg && typeof arg.clearExecution === 'function';
25
+ }
26
+ };
27
+
28
+ /**
29
+ * 带有编辑器、执行、output相关能力的cell view,例如python、sql
30
+ * model 必须为 ExecutableCellModel
31
+ */
32
+ export var LibroExecutableCellView = /*#__PURE__*/function (_LibroEditorCellView) {
33
+ _inherits(LibroExecutableCellView, _LibroEditorCellView);
34
+ var _super = _createSuper(LibroExecutableCellView);
35
+ function LibroExecutableCellView(options, cellService) {
36
+ var _this;
37
+ _classCallCheck(this, LibroExecutableCellView);
38
+ _this = _super.call(this, options, cellService);
39
+ _this.clearExecution = function () {
40
+ //
41
+ };
42
+ _this.outputWatch();
43
+ return _this;
44
+ }
45
+ LibroExecutableCellView = inject(CellService)(LibroExecutableCellView, undefined, 1) || LibroExecutableCellView;
46
+ LibroExecutableCellView = inject(ViewOption)(LibroExecutableCellView, undefined, 0) || LibroExecutableCellView;
47
+ _createClass(LibroExecutableCellView, [{
48
+ key: "hasCellHidden",
49
+ value: function hasCellHidden() {
50
+ if (!ExecutableCellModel.is(this.model) || this.outputArea && this.outputArea.length < 1) {
51
+ return this.hasInputHidden;
52
+ }
53
+ return this.hasInputHidden && this.model.hasOutputHidden;
54
+ }
55
+ }, {
56
+ key: "outputWatch",
57
+ value: function outputWatch() {
58
+ var _this2 = this;
59
+ this.toDispose.push(watch(this.outputArea, 'outputs', function () {
60
+ var _this2$parent$model$o, _this2$parent$model;
61
+ (_this2$parent$model$o = (_this2$parent$model = _this2.parent.model).onChange) === null || _this2$parent$model$o === void 0 ? void 0 : _this2$parent$model$o.call(_this2$parent$model);
62
+ }));
63
+ }
64
+ }]);
65
+ return LibroExecutableCellView;
66
+ }(LibroEditorCellView);
@@ -0,0 +1,9 @@
1
+ import type { CellModel } from '../libro-protocol.js';
2
+ export interface LibroMarkdownCellModel extends CellModel {
3
+ isEdit: boolean;
4
+ preview: string;
5
+ }
6
+ export declare const LibroMarkdownCellModel: {
7
+ is: (arg: Record<any, any> | undefined) => arg is LibroMarkdownCellModel;
8
+ };
9
+ //# sourceMappingURL=libro-markdown-cell-model.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"libro-markdown-cell-model.d.ts","sourceRoot":"","sources":["../../src/cell/libro-markdown-cell-model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAEtD,MAAM,WAAW,sBAAuB,SAAQ,SAAS;IACvD,MAAM,EAAE,OAAO,CAAC;IAEhB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,sBAAsB;cACvB,OAAO,GAAG,EAAE,GAAG,CAAC,GAAG,SAAS;CAUvC,CAAC"}
@@ -0,0 +1,7 @@
1
+ export var LibroMarkdownCellModel = {
2
+ is: function is(arg) {
3
+ return !!arg &&
4
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
5
+ 'isEdit' in arg && typeof arg.isEdit === 'boolean' && 'preview' in arg && typeof arg.preview === 'string';
6
+ }
7
+ };
@@ -0,0 +1,36 @@
1
+ import type { CellView } from './libro-protocol.js';
2
+ import type { LibroView } from './libro-view.js';
3
+ export interface CollapseServiceOption {
4
+ view: LibroView;
5
+ }
6
+ export declare const CollapseServiceOption: unique symbol;
7
+ export type CollapseServiceFactory = (option: CollapseServiceOption) => CollapseService;
8
+ export declare const CollapseServiceFactory: unique symbol;
9
+ export interface CellCollapsible {
10
+ /**
11
+ * 是否折叠子项
12
+ */
13
+ headingCollapsed: boolean;
14
+ /**
15
+ * 折叠的子项的数量
16
+ */
17
+ collapsibleChildNumber: number;
18
+ }
19
+ export declare const CellCollapsible: {
20
+ is: (arg: Record<any, any> | undefined) => arg is CellCollapsible;
21
+ };
22
+ export interface CollapseService {
23
+ collapserVisible: boolean;
24
+ view: LibroView;
25
+ setHeadingCollapse: (cell: CellView, collapsing: boolean) => void;
26
+ getCollapsibleChildNumber: (cell: CellView) => number;
27
+ }
28
+ export declare const CollapseService: unique symbol;
29
+ export declare class DefaultCollapseService implements CollapseService {
30
+ collapserVisible: boolean;
31
+ view: LibroView;
32
+ constructor(option: CollapseServiceOption);
33
+ setHeadingCollapse(cell: CellView, collapsing: boolean): void;
34
+ getCollapsibleChildNumber(_cell: CellView): number;
35
+ }
36
+ //# sourceMappingURL=collapse-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collapse-service.d.ts","sourceRoot":"","sources":["../src/collapse-service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,SAAS,CAAC;CACjB;AACD,eAAO,MAAM,qBAAqB,eAAkC,CAAC;AAErE,MAAM,MAAM,sBAAsB,GAAG,CAAC,MAAM,EAAE,qBAAqB,KAAK,eAAe,CAAC;AACxF,eAAO,MAAM,sBAAsB,eAAmC,CAAC;AAEvE,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,gBAAgB,EAAE,OAAO,CAAC;IAC1B;;OAEG;IACH,sBAAsB,EAAE,MAAM,CAAC;CAChC;AAED,eAAO,MAAM,eAAe;cAChB,OAAO,GAAG,EAAE,GAAG,CAAC,GAAG,SAAS;CAQvC,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,gBAAgB,EAAE,OAAO,CAAC;IAE1B,IAAI,EAAE,SAAS,CAAC;IAEhB,kBAAkB,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;IAElE,yBAAyB,EAAE,CAAC,IAAI,EAAE,QAAQ,KAAK,MAAM,CAAC;CACvD;AAED,eAAO,MAAM,eAAe,eAA4B,CAAC;AAEzD,qBACa,sBAAuB,YAAW,eAAe;IAE5D,gBAAgB,UAAS;IAEzB,IAAI,EAAE,SAAS,CAAC;gBAE2B,MAAM,EAAE,qBAAqB;IAIxE,kBAAkB,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,OAAO;IAOtD,yBAAyB,CAAC,KAAK,EAAE,QAAQ;CAG1C"}
@@ -0,0 +1,55 @@
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, _class2, _descriptor;
3
+ 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 }); }
4
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5
+ 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); } }
6
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
7
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
8
+ 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); }
9
+ 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; }
10
+ 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.'); }
11
+ import { inject, prop, transient } from '@difizen/mana-app';
12
+ export var CollapseServiceOption = Symbol('CollapseServiceOption');
13
+ export var CollapseServiceFactory = Symbol('CollapseServiceFactory');
14
+ export var CellCollapsible = {
15
+ is: function is(arg) {
16
+ return !!arg &&
17
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
18
+ 'headingCollapsed' in arg && typeof arg.headingCollapsed === 'boolean';
19
+ }
20
+ };
21
+ export var CollapseService = Symbol('CollapseService');
22
+ export var DefaultCollapseService = (_dec = transient({
23
+ token: CollapseService
24
+ }), _dec2 = prop(), _dec(_class = (_class2 = /*#__PURE__*/function () {
25
+ function DefaultCollapseService(option) {
26
+ _classCallCheck(this, DefaultCollapseService);
27
+ _initializerDefineProperty(this, "collapserVisible", _descriptor, this);
28
+ this.view = void 0;
29
+ this.view = option.view;
30
+ }
31
+ DefaultCollapseService = inject(CollapseServiceOption)(DefaultCollapseService, undefined, 0) || DefaultCollapseService;
32
+ _createClass(DefaultCollapseService, [{
33
+ key: "setHeadingCollapse",
34
+ value: function setHeadingCollapse(cell, collapsing) {
35
+ if (CellCollapsible.is(cell)) {
36
+ cell.headingCollapsed = collapsing;
37
+ }
38
+ }
39
+
40
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
41
+ }, {
42
+ key: "getCollapsibleChildNumber",
43
+ value: function getCollapsibleChildNumber(_cell) {
44
+ return 0;
45
+ }
46
+ }]);
47
+ return DefaultCollapseService;
48
+ }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "collapserVisible", [_dec2], {
49
+ configurable: true,
50
+ enumerable: true,
51
+ writable: true,
52
+ initializer: function initializer() {
53
+ return false;
54
+ }
55
+ })), _class2)) || _class);
@@ -0,0 +1,6 @@
1
+ import type { Command } from '@difizen/mana-app';
2
+ export declare const DocumentCommands: Record<string, Command & {
3
+ keybind?: string | string[] | undefined;
4
+ when?: string | undefined;
5
+ }>;
6
+ //# sourceMappingURL=document-commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-commands.d.ts","sourceRoot":"","sources":["../../src/command/document-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAEjD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,MAAM,EACN,OAAO,GAAG;IAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,SAAS,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAYjF,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { SaveOutlined, SettingOutlined } from '@ant-design/icons';
2
+ export var DocumentCommands = {
3
+ Save: {
4
+ id: 'document:save',
5
+ icon: SaveOutlined,
6
+ label: 'SAVE',
7
+ keybind: 'ctrlcmd+s'
8
+ },
9
+ OpenSettings: {
10
+ id: 'document.notebook.open_setting',
11
+ icon: SettingOutlined
12
+ }
13
+ };
@@ -0,0 +1,7 @@
1
+ export * from './notebook-commands.js';
2
+ export * from './document-commands.js';
3
+ export * from './kernel-command.js';
4
+ export * from './libro-command-contribution.js';
5
+ export * from './libro-command-register.js';
6
+ export * from './module.js';
7
+ //# sourceMappingURL=index.d.ts.map