@difizen/libro-core 0.0.0-snapshot-20241017072317

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 (433) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +280 -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 +11 -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 +59 -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 +121 -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 +12 -0
  20. package/es/cell/libro-cell-contribution.d.ts.map +1 -0
  21. package/es/cell/libro-cell-contribution.js +47 -0
  22. package/es/cell/libro-cell-model.d.ts +29 -0
  23. package/es/cell/libro-cell-model.d.ts.map +1 -0
  24. package/es/cell/libro-cell-model.js +130 -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 +44 -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 +245 -0
  34. package/es/cell/libro-cell-view.d.ts +74 -0
  35. package/es/cell/libro-cell-view.d.ts.map +1 -0
  36. package/es/cell/libro-cell-view.js +239 -0
  37. package/es/cell/libro-edit-cell-view.d.ts +44 -0
  38. package/es/cell/libro-edit-cell-view.d.ts.map +1 -0
  39. package/es/cell/libro-edit-cell-view.js +256 -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 +34 -0
  44. package/es/cell/libro-executable-cell-view.d.ts.map +1 -0
  45. package/es/cell/libro-executable-cell-view.js +74 -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 +5 -0
  53. package/es/command/document-commands.d.ts.map +1 -0
  54. package/es/command/document-commands.js +21 -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 +40 -0
  61. package/es/command/libro-command-contribution.d.ts +13 -0
  62. package/es/command/libro-command-contribution.d.ts.map +1 -0
  63. package/es/command/libro-command-contribution.js +1842 -0
  64. package/es/command/libro-command-register.d.ts +21 -0
  65. package/es/command/libro-command-register.d.ts.map +1 -0
  66. package/es/command/libro-command-register.js +111 -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 +472 -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 +16 -0
  77. package/es/components/dnd-cell-item-render.d.ts.map +1 -0
  78. package/es/components/dnd-cell-item-render.js +364 -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 +140 -0
  82. package/es/components/dnd-component/default-dnd-content.d.ts +11 -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 +292 -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 +14 -0
  89. package/es/components/dnd-component/dnd-list.d.ts.map +1 -0
  90. package/es/components/dnd-component/dnd-list.js +182 -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/dnd-component/index.less +8 -0
  95. package/es/components/dnd-component/overscanIndices-getter.d.ts +22 -0
  96. package/es/components/dnd-component/overscanIndices-getter.d.ts.map +1 -0
  97. package/es/components/dnd-component/overscanIndices-getter.js +58 -0
  98. package/es/components/dnd-component/virtualized-manager.d.ts +19 -0
  99. package/es/components/dnd-component/virtualized-manager.d.ts.map +1 -0
  100. package/es/components/dnd-component/virtualized-manager.js +60 -0
  101. package/es/components/index.d.ts +6 -0
  102. package/es/components/index.d.ts.map +1 -0
  103. package/es/components/index.js +5 -0
  104. package/es/components/libro-component.d.ts +5 -0
  105. package/es/components/libro-component.d.ts.map +1 -0
  106. package/es/components/libro-component.js +35 -0
  107. package/es/components/libro-side-toolbar-menu.d.ts +21 -0
  108. package/es/components/libro-side-toolbar-menu.d.ts.map +1 -0
  109. package/es/components/libro-side-toolbar-menu.js +58 -0
  110. package/es/components/libro-view-header.d.ts +3 -0
  111. package/es/components/libro-view-header.d.ts.map +1 -0
  112. package/es/components/libro-view-header.js +37 -0
  113. package/es/components/libro-virtualized-render.d.ts +15 -0
  114. package/es/components/libro-virtualized-render.d.ts.map +1 -0
  115. package/es/components/libro-virtualized-render.js +174 -0
  116. package/es/content/index.d.ts +6 -0
  117. package/es/content/index.d.ts.map +1 -0
  118. package/es/content/index.js +5 -0
  119. package/es/content/libro-content-contribution.d.ts +11 -0
  120. package/es/content/libro-content-contribution.d.ts.map +1 -0
  121. package/es/content/libro-content-contribution.js +31 -0
  122. package/es/content/libro-content-module.d.ts +3 -0
  123. package/es/content/libro-content-module.d.ts.map +1 -0
  124. package/es/content/libro-content-module.js +6 -0
  125. package/es/content/libro-content-protocol.d.ts +13 -0
  126. package/es/content/libro-content-protocol.d.ts.map +1 -0
  127. package/es/content/libro-content-protocol.js +3 -0
  128. package/es/content/libro-content-service.d.ts +11 -0
  129. package/es/content/libro-content-service.d.ts.map +1 -0
  130. package/es/content/libro-content-service.js +63 -0
  131. package/es/content/libro-save-content-contribution.d.ts +6 -0
  132. package/es/content/libro-save-content-contribution.d.ts.map +1 -0
  133. package/es/content/libro-save-content-contribution.js +27 -0
  134. package/es/formatter/index.d.ts +6 -0
  135. package/es/formatter/index.d.ts.map +1 -0
  136. package/es/formatter/index.js +5 -0
  137. package/es/formatter/libro-formatter-json-contribution.d.ts +18 -0
  138. package/es/formatter/libro-formatter-json-contribution.d.ts.map +1 -0
  139. package/es/formatter/libro-formatter-json-contribution.js +41 -0
  140. package/es/formatter/libro-formatter-manager.d.ts +16 -0
  141. package/es/formatter/libro-formatter-manager.d.ts.map +1 -0
  142. package/es/formatter/libro-formatter-manager.js +86 -0
  143. package/es/formatter/libro-formatter-module.d.ts +3 -0
  144. package/es/formatter/libro-formatter-module.d.ts.map +1 -0
  145. package/es/formatter/libro-formatter-module.js +7 -0
  146. package/es/formatter/libro-formatter-protocol.d.ts +37 -0
  147. package/es/formatter/libro-formatter-protocol.d.ts.map +1 -0
  148. package/es/formatter/libro-formatter-protocol.js +18 -0
  149. package/es/formatter/libro-formatter-string-contribution.d.ts +18 -0
  150. package/es/formatter/libro-formatter-string-contribution.d.ts.map +1 -0
  151. package/es/formatter/libro-formatter-string-contribution.js +41 -0
  152. package/es/formatter/libro-formatter-trans-default-contribution.d.ts +7 -0
  153. package/es/formatter/libro-formatter-trans-default-contribution.d.ts.map +1 -0
  154. package/es/formatter/libro-formatter-trans-default-contribution.js +19 -0
  155. package/es/index.d.ts +26 -0
  156. package/es/index.d.ts.map +1 -0
  157. package/es/index.js +25 -0
  158. package/es/index.less +781 -0
  159. package/es/libro-context-key.d.ts +26 -0
  160. package/es/libro-context-key.d.ts.map +1 -0
  161. package/es/libro-context-key.js +84 -0
  162. package/es/libro-keybind-registry.d.ts +5 -0
  163. package/es/libro-keybind-registry.d.ts.map +1 -0
  164. package/es/libro-keybind-registry.js +68 -0
  165. package/es/libro-model.d.ts +145 -0
  166. package/es/libro-model.d.ts.map +1 -0
  167. package/es/libro-model.js +921 -0
  168. package/es/libro-protocol.d.ts +315 -0
  169. package/es/libro-protocol.d.ts.map +1 -0
  170. package/es/libro-protocol.js +47 -0
  171. package/es/libro-service.d.ts +69 -0
  172. package/es/libro-service.d.ts.map +1 -0
  173. package/es/libro-service.js +303 -0
  174. package/es/libro-setting-contribution.d.ts +5 -0
  175. package/es/libro-setting-contribution.d.ts.map +1 -0
  176. package/es/libro-setting-contribution.js +23 -0
  177. package/es/libro-setting.d.ts +12 -0
  178. package/es/libro-setting.d.ts.map +1 -0
  179. package/es/libro-setting.js +101 -0
  180. package/es/libro-view-tracker.d.ts +6 -0
  181. package/es/libro-view-tracker.d.ts.map +1 -0
  182. package/es/libro-view-tracker.js +13 -0
  183. package/es/libro-view.d.ts +170 -0
  184. package/es/libro-view.d.ts.map +1 -0
  185. package/es/libro-view.js +2077 -0
  186. package/es/libro-workspace-service.d.ts +17 -0
  187. package/es/libro-workspace-service.d.ts.map +1 -0
  188. package/es/libro-workspace-service.js +36 -0
  189. package/es/material-from-designer.d.ts +31 -0
  190. package/es/material-from-designer.d.ts.map +1 -0
  191. package/es/material-from-designer.js +697 -0
  192. package/es/module.d.ts +3 -0
  193. package/es/module.d.ts.map +1 -0
  194. package/es/module.js +71 -0
  195. package/es/output/index.d.ts +6 -0
  196. package/es/output/index.d.ts.map +1 -0
  197. package/es/output/index.js +5 -0
  198. package/es/output/output-area.d.ts +51 -0
  199. package/es/output/output-area.d.ts.map +1 -0
  200. package/es/output/output-area.js +399 -0
  201. package/es/output/output-contribution.d.ts +10 -0
  202. package/es/output/output-contribution.d.ts.map +1 -0
  203. package/es/output/output-contribution.js +36 -0
  204. package/es/output/output-model.d.ts +28 -0
  205. package/es/output/output-model.d.ts.map +1 -0
  206. package/es/output/output-model.js +105 -0
  207. package/es/output/output-module.d.ts +3 -0
  208. package/es/output/output-module.d.ts.map +1 -0
  209. package/es/output/output-module.js +6 -0
  210. package/es/output/output-protocol.d.ts +134 -0
  211. package/es/output/output-protocol.d.ts.map +1 -0
  212. package/es/output/output-protocol.js +16 -0
  213. package/es/settings/index.d.ts +5 -0
  214. package/es/settings/index.d.ts.map +1 -0
  215. package/es/settings/index.js +4 -0
  216. package/es/settings/index.less +3 -0
  217. package/es/settings/module.d.ts +3 -0
  218. package/es/settings/module.d.ts.map +1 -0
  219. package/es/settings/module.js +4 -0
  220. package/es/settings/setting-editor/configuration-panel-view.d.ts +13 -0
  221. package/es/settings/setting-editor/configuration-panel-view.d.ts.map +1 -0
  222. package/es/settings/setting-editor/configuration-panel-view.js +115 -0
  223. package/es/settings/setting-editor/configuration-render-contribution.d.ts +6 -0
  224. package/es/settings/setting-editor/configuration-render-contribution.d.ts.map +1 -0
  225. package/es/settings/setting-editor/configuration-render-contribution.js +77 -0
  226. package/es/settings/setting-editor/default-node-render.d.ts +9 -0
  227. package/es/settings/setting-editor/default-node-render.d.ts.map +1 -0
  228. package/es/settings/setting-editor/default-node-render.js +79 -0
  229. package/es/settings/setting-editor/index.d.ts +7 -0
  230. package/es/settings/setting-editor/index.d.ts.map +1 -0
  231. package/es/settings/setting-editor/index.js +6 -0
  232. package/es/settings/setting-editor/index.less +12 -0
  233. package/es/settings/setting-editor/module.d.ts +3 -0
  234. package/es/settings/setting-editor/module.d.ts.map +1 -0
  235. package/es/settings/setting-editor/module.js +11 -0
  236. package/es/settings/setting-editor/setting-editor-view.d.ts +15 -0
  237. package/es/settings/setting-editor/setting-editor-view.d.ts.map +1 -0
  238. package/es/settings/setting-editor/setting-editor-view.js +169 -0
  239. package/es/settings/setting-editor/setting-tree-service.d.ts +9 -0
  240. package/es/settings/setting-editor/setting-tree-service.d.ts.map +1 -0
  241. package/es/settings/setting-editor/setting-tree-service.js +118 -0
  242. package/es/settings/setting-editor/setting-tree-view.d.ts +19 -0
  243. package/es/settings/setting-editor/setting-tree-view.d.ts.map +1 -0
  244. package/es/settings/setting-editor/setting-tree-view.js +87 -0
  245. package/es/settings/settings-contribution.d.ts +7 -0
  246. package/es/settings/settings-contribution.d.ts.map +1 -0
  247. package/es/settings/settings-contribution.js +36 -0
  248. package/es/settings/settings-modal.d.ts +5 -0
  249. package/es/settings/settings-modal.d.ts.map +1 -0
  250. package/es/settings/settings-modal.js +53 -0
  251. package/es/settings/settings-modal.less +3 -0
  252. package/es/settings/settings-protocol.d.ts +4 -0
  253. package/es/settings/settings-protocol.d.ts.map +1 -0
  254. package/es/settings/settings-protocol.js +5 -0
  255. package/es/slot/index.d.ts +5 -0
  256. package/es/slot/index.d.ts.map +1 -0
  257. package/es/slot/index.js +4 -0
  258. package/es/slot/libro-slot-manager.d.ts +13 -0
  259. package/es/slot/libro-slot-manager.d.ts.map +1 -0
  260. package/es/slot/libro-slot-manager.js +66 -0
  261. package/es/slot/libro-slot-protocol.d.ts +19 -0
  262. package/es/slot/libro-slot-protocol.d.ts.map +1 -0
  263. package/es/slot/libro-slot-protocol.js +5 -0
  264. package/es/slot/libro-slot-view.d.ts +9 -0
  265. package/es/slot/libro-slot-view.d.ts.map +1 -0
  266. package/es/slot/libro-slot-view.js +81 -0
  267. package/es/slot/module.d.ts +3 -0
  268. package/es/slot/module.d.ts.map +1 -0
  269. package/es/slot/module.js +5 -0
  270. package/es/theme/libro-color-registry.d.ts +6 -0
  271. package/es/theme/libro-color-registry.d.ts.map +1 -0
  272. package/es/theme/libro-color-registry.js +515 -0
  273. package/es/toolbar/all-outputs-scroll-icon.d.ts +3 -0
  274. package/es/toolbar/all-outputs-scroll-icon.d.ts.map +1 -0
  275. package/es/toolbar/all-outputs-scroll-icon.js +10 -0
  276. package/es/toolbar/change-cell-to-selector.d.ts +5 -0
  277. package/es/toolbar/change-cell-to-selector.d.ts.map +1 -0
  278. package/es/toolbar/change-cell-to-selector.js +51 -0
  279. package/es/toolbar/hide-all-selector.d.ts +5 -0
  280. package/es/toolbar/hide-all-selector.d.ts.map +1 -0
  281. package/es/toolbar/hide-all-selector.js +99 -0
  282. package/es/toolbar/index.d.ts +4 -0
  283. package/es/toolbar/index.d.ts.map +1 -0
  284. package/es/toolbar/index.js +3 -0
  285. package/es/toolbar/index.less +59 -0
  286. package/es/toolbar/libro-toolbar-protocol.d.ts +4 -0
  287. package/es/toolbar/libro-toolbar-protocol.d.ts.map +1 -0
  288. package/es/toolbar/libro-toolbar-protocol.js +1 -0
  289. package/es/toolbar/libro-toolbar.d.ts +9 -0
  290. package/es/toolbar/libro-toolbar.d.ts.map +1 -0
  291. package/es/toolbar/libro-toolbar.js +275 -0
  292. package/es/toolbar/module.d.ts +3 -0
  293. package/es/toolbar/module.d.ts.map +1 -0
  294. package/es/toolbar/module.js +5 -0
  295. package/es/toolbar/restart-clear-outputs-contribution.d.ts +5 -0
  296. package/es/toolbar/restart-clear-outputs-contribution.d.ts.map +1 -0
  297. package/es/toolbar/restart-clear-outputs-contribution.js +23 -0
  298. package/es/toolbar/restart-clear-outputs-modal.d.ts +5 -0
  299. package/es/toolbar/restart-clear-outputs-modal.d.ts.map +1 -0
  300. package/es/toolbar/restart-clear-outputs-modal.js +30 -0
  301. package/es/toolbar/save-icon.d.ts +3 -0
  302. package/es/toolbar/save-icon.d.ts.map +1 -0
  303. package/es/toolbar/save-icon.js +54 -0
  304. package/es/toolbar/shutdown-contribution.d.ts +5 -0
  305. package/es/toolbar/shutdown-contribution.d.ts.map +1 -0
  306. package/es/toolbar/shutdown-contribution.js +23 -0
  307. package/es/toolbar/shutdown-modal.d.ts +5 -0
  308. package/es/toolbar/shutdown-modal.d.ts.map +1 -0
  309. package/es/toolbar/shutdown-modal.js +30 -0
  310. package/es/toolbar/side-toolar-more-select.d.ts +4 -0
  311. package/es/toolbar/side-toolar-more-select.d.ts.map +1 -0
  312. package/es/toolbar/side-toolar-more-select.js +161 -0
  313. package/es/typings/index.d.ts +1 -0
  314. package/es/virtualized-manager-helper.d.ts +11 -0
  315. package/es/virtualized-manager-helper.d.ts.map +1 -0
  316. package/es/virtualized-manager-helper.js +51 -0
  317. package/es/virtualized-manager.d.ts +23 -0
  318. package/es/virtualized-manager.d.ts.map +1 -0
  319. package/es/virtualized-manager.js +65 -0
  320. package/package.json +73 -0
  321. package/src/add-cell/index.less +38 -0
  322. package/src/add-cell/index.ts +3 -0
  323. package/src/add-cell/libro-add-cell-module.ts +9 -0
  324. package/src/add-cell/libro-add-cell-slot-contribution.ts +28 -0
  325. package/src/add-cell/libro-add-cell-view.tsx +99 -0
  326. package/src/cell/README.md +14 -0
  327. package/src/cell/index.ts +9 -0
  328. package/src/cell/libro-cell-contribution.ts +34 -0
  329. package/src/cell/libro-cell-model.ts +119 -0
  330. package/src/cell/libro-cell-module.ts +40 -0
  331. package/src/cell/libro-cell-protocol.ts +55 -0
  332. package/src/cell/libro-cell-service.ts +158 -0
  333. package/src/cell/libro-cell-view.tsx +156 -0
  334. package/src/cell/libro-edit-cell-view.tsx +205 -0
  335. package/src/cell/libro-executable-cell-model.ts +32 -0
  336. package/src/cell/libro-executable-cell-view.ts +86 -0
  337. package/src/cell/libro-markdown-cell-model.ts +20 -0
  338. package/src/collapse-service.ts +69 -0
  339. package/src/command/document-commands.ts +24 -0
  340. package/src/command/index.ts +6 -0
  341. package/src/command/kernel-command.ts +42 -0
  342. package/src/command/libro-command-contribution.ts +1346 -0
  343. package/src/command/libro-command-register.ts +168 -0
  344. package/src/command/module.ts +9 -0
  345. package/src/command/notebook-commands.ts +502 -0
  346. package/src/components/cell-protocol.ts +26 -0
  347. package/src/components/dnd-cell-item-render.tsx +465 -0
  348. package/src/components/dnd-component/custom-drag-layer.tsx +144 -0
  349. package/src/components/dnd-component/default-dnd-content.tsx +330 -0
  350. package/src/components/dnd-component/dnd-context.tsx +28 -0
  351. package/src/components/dnd-component/dnd-list.tsx +211 -0
  352. package/src/components/dnd-component/index.less +12 -0
  353. package/src/components/dnd-component/index.tsx +4 -0
  354. package/src/components/dnd-component/overscanIndices-getter.ts +92 -0
  355. package/src/components/dnd-component/virtualized-manager.ts +34 -0
  356. package/src/components/index.ts +5 -0
  357. package/src/components/libro-component.tsx +30 -0
  358. package/src/components/libro-side-toolbar-menu.tsx +82 -0
  359. package/src/components/libro-view-header.tsx +33 -0
  360. package/src/components/libro-virtualized-render.tsx +178 -0
  361. package/src/content/index.ts +5 -0
  362. package/src/content/libro-content-contribution.ts +16 -0
  363. package/src/content/libro-content-module.ts +17 -0
  364. package/src/content/libro-content-protocol.ts +14 -0
  365. package/src/content/libro-content-service.ts +48 -0
  366. package/src/content/libro-save-content-contribution.ts +12 -0
  367. package/src/formatter/index.ts +5 -0
  368. package/src/formatter/libro-formatter-json-contribution.ts +42 -0
  369. package/src/formatter/libro-formatter-manager.ts +85 -0
  370. package/src/formatter/libro-formatter-module.ts +19 -0
  371. package/src/formatter/libro-formatter-protocol.ts +63 -0
  372. package/src/formatter/libro-formatter-string-contribution.ts +41 -0
  373. package/src/formatter/libro-formatter-trans-default-contribution.ts +15 -0
  374. package/src/index.less +789 -0
  375. package/src/index.spec.ts +12 -0
  376. package/src/index.tsx +25 -0
  377. package/src/libro-context-key.ts +84 -0
  378. package/src/libro-keybind-registry.ts +43 -0
  379. package/src/libro-model.ts +710 -0
  380. package/src/libro-protocol.ts +435 -0
  381. package/src/libro-service.ts +234 -0
  382. package/src/libro-setting-contribution.ts +28 -0
  383. package/src/libro-setting.ts +110 -0
  384. package/src/libro-view-tracker.ts +9 -0
  385. package/src/libro-view.tsx +1532 -0
  386. package/src/libro-workspace-service.ts +28 -0
  387. package/src/material-from-designer.tsx +579 -0
  388. package/src/module.ts +121 -0
  389. package/src/output/index.ts +5 -0
  390. package/src/output/output-area.tsx +286 -0
  391. package/src/output/output-contribution.ts +14 -0
  392. package/src/output/output-model.tsx +70 -0
  393. package/src/output/output-module.ts +10 -0
  394. package/src/output/output-protocol.ts +168 -0
  395. package/src/settings/index.less +3 -0
  396. package/src/settings/index.ts +4 -0
  397. package/src/settings/module.ts +8 -0
  398. package/src/settings/setting-editor/configuration-panel-view.tsx +89 -0
  399. package/src/settings/setting-editor/configuration-render-contribution.ts +81 -0
  400. package/src/settings/setting-editor/default-node-render.tsx +65 -0
  401. package/src/settings/setting-editor/index.less +12 -0
  402. package/src/settings/setting-editor/index.ts +6 -0
  403. package/src/settings/setting-editor/module.ts +17 -0
  404. package/src/settings/setting-editor/setting-editor-view.tsx +93 -0
  405. package/src/settings/setting-editor/setting-tree-service.ts +82 -0
  406. package/src/settings/setting-editor/setting-tree-view.tsx +95 -0
  407. package/src/settings/settings-contribution.tsx +24 -0
  408. package/src/settings/settings-modal.less +3 -0
  409. package/src/settings/settings-modal.tsx +51 -0
  410. package/src/settings/settings-protocol.ts +7 -0
  411. package/src/slot/index.ts +4 -0
  412. package/src/slot/libro-slot-manager.ts +38 -0
  413. package/src/slot/libro-slot-protocol.ts +28 -0
  414. package/src/slot/libro-slot-view.tsx +48 -0
  415. package/src/slot/module.ts +9 -0
  416. package/src/theme/libro-color-registry.ts +386 -0
  417. package/src/toolbar/all-outputs-scroll-icon.tsx +19 -0
  418. package/src/toolbar/change-cell-to-selector.tsx +67 -0
  419. package/src/toolbar/hide-all-selector.tsx +126 -0
  420. package/src/toolbar/index.less +59 -0
  421. package/src/toolbar/index.ts +3 -0
  422. package/src/toolbar/libro-toolbar-protocol.ts +4 -0
  423. package/src/toolbar/libro-toolbar.tsx +231 -0
  424. package/src/toolbar/module.ts +11 -0
  425. package/src/toolbar/restart-clear-outputs-contribution.tsx +10 -0
  426. package/src/toolbar/restart-clear-outputs-modal.tsx +37 -0
  427. package/src/toolbar/save-icon.tsx +47 -0
  428. package/src/toolbar/shutdown-contribution.tsx +10 -0
  429. package/src/toolbar/shutdown-modal.tsx +37 -0
  430. package/src/toolbar/side-toolar-more-select.tsx +177 -0
  431. package/src/typings/index.d.ts +1 -0
  432. package/src/virtualized-manager-helper.ts +29 -0
  433. package/src/virtualized-manager.ts +47 -0
@@ -0,0 +1,23 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _dec, _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(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ import { ModalContribution, singleton } from '@difizen/mana-app';
9
+ import { ShutdownModal } from "./shutdown-modal.js";
10
+ export var ShutdownContribution = (_dec = singleton({
11
+ contrib: ModalContribution
12
+ }), _dec(_class = /*#__PURE__*/function () {
13
+ function ShutdownContribution() {
14
+ _classCallCheck(this, ShutdownContribution);
15
+ }
16
+ _createClass(ShutdownContribution, [{
17
+ key: "registerModal",
18
+ value: function registerModal() {
19
+ return ShutdownModal;
20
+ }
21
+ }]);
22
+ return ShutdownContribution;
23
+ }()) || _class);
@@ -0,0 +1,5 @@
1
+ import type { ModalItemProps, ModalItem } from '@difizen/mana-app';
2
+ import type { LibroView } from '../libro-view.js';
3
+ export declare function ShutdownModalComponent({ visible, close, data, }: ModalItemProps<LibroView>): import("react/jsx-runtime").JSX.Element;
4
+ export declare const ShutdownModal: ModalItem<LibroView>;
5
+ //# sourceMappingURL=shutdown-modal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shutdown-modal.d.ts","sourceRoot":"","sources":["../../src/toolbar/shutdown-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAKnE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAElD,wBAAgB,sBAAsB,CAAC,EACrC,OAAO,EACP,KAAK,EACL,IAAI,GACL,EAAE,cAAc,CAAC,SAAS,CAAC,2CAoB3B;AAED,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC,SAAS,CAG9C,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { Modal } from 'antd';
2
+ import { useCallback } from 'react';
3
+ import { NotebookCommands } from "../command/index.js";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ export function ShutdownModalComponent(_ref) {
6
+ var visible = _ref.visible,
7
+ close = _ref.close,
8
+ data = _ref.data;
9
+ var handleShutdown = useCallback(function () {
10
+ data === null || data === void 0 || data.closeAndShutdown();
11
+ close();
12
+ // eslint-disable-next-line react-hooks/exhaustive-deps
13
+ }, [data]);
14
+ return /*#__PURE__*/_jsx(Modal, {
15
+ title: "Shutdown Kernel?",
16
+ open: visible,
17
+ onOk: handleShutdown,
18
+ onCancel: function onCancel() {
19
+ return close();
20
+ },
21
+ width: '400px',
22
+ centered: true,
23
+ className: "libro-shut-down-kernel-modal",
24
+ children: "Do you want to shutdown the current kernel?."
25
+ });
26
+ }
27
+ export var ShutdownModal = {
28
+ id: NotebookCommands['CloseAndShutdown'].id,
29
+ component: ShutdownModalComponent
30
+ };
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" resolution-mode="require"/>
2
+ export declare const LibroSideToolbarMoreMenu: React.FC;
3
+ export declare const SideToolbarMoreSelect: React.FC;
4
+ //# sourceMappingURL=side-toolar-more-select.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"side-toolar-more-select.d.ts","sourceRoot":"","sources":["../../src/toolbar/side-toolar-more-select.tsx"],"names":[],"mappings":";AA2FA,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAkE5C,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAazC,CAAC"}
@@ -0,0 +1,161 @@
1
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
2
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
7
+ import { CommandRegistry, getOrigin, ToolbarInstance, useInject, useObserve } from '@difizen/mana-app';
8
+ import { l10n } from '@difizen/mana-l10n';
9
+ import { Menu, MenuContext } from '@difizen/mana-react';
10
+ import { Popover } from 'antd';
11
+ import { ExecutableCellModel, ExecutableCellView } from "../cell/index.js";
12
+ import { NotebookCommands } from "../command/index.js";
13
+ import { MoreOutlined } from "../material-from-designer.js";
14
+ import { jsx as _jsx } from "react/jsx-runtime";
15
+ import { Fragment as _Fragment } from "react/jsx-runtime";
16
+ import { jsxs as _jsxs } from "react/jsx-runtime";
17
+ var codeItems = [{
18
+ id: NotebookCommands['HideCellCode'].id,
19
+ label: /*#__PURE__*/_jsxs(_Fragment, {
20
+ children: [/*#__PURE__*/_jsx("span", {
21
+ className: "libro-menu-item-label",
22
+ children: l10n.t('隐藏 Code')
23
+ }), /*#__PURE__*/_jsx("span", {
24
+ className: "libro-menu-item-keybind",
25
+ children: "Cmd + '"
26
+ })]
27
+ })
28
+ }, {
29
+ id: NotebookCommands['ShowCellCode'].id,
30
+ label: /*#__PURE__*/_jsxs(_Fragment, {
31
+ children: [/*#__PURE__*/_jsx("span", {
32
+ className: "libro-menu-item-label",
33
+ children: l10n.t('显示 Code')
34
+ }), /*#__PURE__*/_jsx("span", {
35
+ className: "libro-menu-item-keybind",
36
+ children: "Cmd + '"
37
+ })]
38
+ })
39
+ }];
40
+ var outputItems = [{
41
+ id: NotebookCommands['HideCellOutputs'].id,
42
+ label: /*#__PURE__*/_jsxs(_Fragment, {
43
+ children: [/*#__PURE__*/_jsx("span", {
44
+ className: "libro-menu-item-label",
45
+ children: l10n.t('隐藏 Output')
46
+ }), /*#__PURE__*/_jsx("span", {
47
+ className: "libro-menu-item-keybind",
48
+ children: "Cmd + O"
49
+ })]
50
+ })
51
+ }, {
52
+ id: NotebookCommands['ShowCellOutputs'].id,
53
+ label: /*#__PURE__*/_jsxs(_Fragment, {
54
+ children: [/*#__PURE__*/_jsx("span", {
55
+ className: "libro-menu-item-label",
56
+ children: l10n.t('显示 Output')
57
+ }), /*#__PURE__*/_jsx("span", {
58
+ className: "libro-menu-item-keybind",
59
+ children: "Cmd + O"
60
+ })]
61
+ })
62
+ }];
63
+ var moreItems = [{
64
+ id: NotebookCommands['CopyCell'].id,
65
+ label: /*#__PURE__*/_jsxs(_Fragment, {
66
+ children: [/*#__PURE__*/_jsx("span", {
67
+ className: "libro-menu-item-label",
68
+ children: l10n.t('复制')
69
+ }), /*#__PURE__*/_jsx("span", {
70
+ className: "libro-menu-item-keybind",
71
+ children: "C"
72
+ })]
73
+ })
74
+ }, {
75
+ id: NotebookCommands['CutCell'].id,
76
+ label: /*#__PURE__*/_jsxs(_Fragment, {
77
+ children: [/*#__PURE__*/_jsx("span", {
78
+ className: "libro-menu-item-label",
79
+ children: l10n.t('剪切')
80
+ }), /*#__PURE__*/_jsx("span", {
81
+ className: "libro-menu-item-keybind",
82
+ children: "X"
83
+ })]
84
+ })
85
+ }, {
86
+ id: NotebookCommands['PasteCellBelow'].id,
87
+ label: /*#__PURE__*/_jsxs(_Fragment, {
88
+ children: [/*#__PURE__*/_jsx("span", {
89
+ className: "libro-menu-item-label",
90
+ children: l10n.t('粘贴')
91
+ }), /*#__PURE__*/_jsx("span", {
92
+ className: "libro-menu-item-keybind",
93
+ children: "V"
94
+ })]
95
+ })
96
+ }];
97
+ export var LibroSideToolbarMoreMenu = function LibroSideToolbarMoreMenu() {
98
+ var _cell$outputArea;
99
+ var command = useInject(CommandRegistry);
100
+ var toolbar = useInject(ToolbarInstance);
101
+ var data = toolbar.currentArgs;
102
+ var args = getOrigin(data) || [];
103
+ var cell = useObserve(args[0]);
104
+ if (!cell) {
105
+ return null;
106
+ }
107
+ var hasOutput = ExecutableCellView.is(cell) && (_cell$outputArea = cell.outputArea) !== null && _cell$outputArea !== void 0 && _cell$outputArea.length && cell.outputArea.length > 0 ? true : false;
108
+ var nodes = [];
109
+ var baseCls = 'mana-menu';
110
+ var contextValue = {
111
+ prefixCls: baseCls
112
+ };
113
+ var codeMenuItem = cell.hasInputHidden ? 1 : 0;
114
+ nodes.push( /*#__PURE__*/_jsx(Menu.Item, {
115
+ onClick: function onClick() {
116
+ command.executeCommand.apply(command, [codeItems[codeMenuItem].id].concat(_toConsumableArray(args)));
117
+ cell.hasInputHidden = !cell.hasInputHidden;
118
+ },
119
+ children: codeItems[codeMenuItem].label
120
+ }, codeItems[codeMenuItem].id));
121
+ var outputMenuItem = ExecutableCellModel.is(cell.model) && cell.model.hasOutputHidden ? 1 : 0;
122
+ nodes.push( /*#__PURE__*/_jsx(Menu.Item, {
123
+ onClick: function onClick() {
124
+ if (hasOutput) {
125
+ command.executeCommand.apply(command, [outputItems[outputMenuItem].id].concat(_toConsumableArray(args)));
126
+ if (ExecutableCellModel.is(cell.model)) {
127
+ cell.model.hasOutputHidden = !cell.model.hasOutputHidden;
128
+ }
129
+ }
130
+ },
131
+ disabled: !hasOutput,
132
+ children: outputItems[outputMenuItem].label
133
+ }, outputItems[outputMenuItem].id));
134
+ nodes.push( /*#__PURE__*/_jsx(Menu.Divider, {}, "libro-menu-divider"));
135
+ moreItems.forEach(function (item) {
136
+ nodes.push( /*#__PURE__*/_jsx(Menu.Item, {
137
+ onClick: function onClick() {
138
+ command.executeCommand.apply(command, [item.id].concat(_toConsumableArray(args)));
139
+ },
140
+ children: item.label
141
+ }, item.id));
142
+ });
143
+ return /*#__PURE__*/_jsx("div", {
144
+ className: "libro-side-toolbar-menu",
145
+ children: /*#__PURE__*/_jsxs(MenuContext.Provider, {
146
+ value: contextValue,
147
+ children: [nodes, " "]
148
+ })
149
+ });
150
+ };
151
+ export var SideToolbarMoreSelect = function SideToolbarMoreSelect() {
152
+ return /*#__PURE__*/_jsx(Popover, {
153
+ placement: "leftTop",
154
+ content: /*#__PURE__*/_jsx(LibroSideToolbarMoreMenu, {}),
155
+ trigger: "click",
156
+ overlayClassName: "libro-popover-side-toolbar-menu libro-side-toolbar-more-select-menu",
157
+ children: /*#__PURE__*/_jsx("span", {
158
+ children: /*#__PURE__*/_jsx(MoreOutlined, {})
159
+ })
160
+ });
161
+ };
@@ -0,0 +1 @@
1
+ declare module '*.less';
@@ -0,0 +1,11 @@
1
+ import type { NotebookModel } from './libro-protocol.js';
2
+ import { VirtualizedManagerOptionFactory } from './libro-protocol.js';
3
+ import type { VirtualizedManager } from './virtualized-manager.js';
4
+ export declare class VirtualizedManagerHelper {
5
+ factory: VirtualizedManagerOptionFactory;
6
+ current?: VirtualizedManager;
7
+ protected virtualizedManagerHelperMap: Map<string, VirtualizedManager>;
8
+ setCurrent(libroModel: NotebookModel): void;
9
+ getOrCreate(libroModel: NotebookModel): VirtualizedManager;
10
+ }
11
+ //# sourceMappingURL=virtualized-manager-helper.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"virtualized-manager-helper.d.ts","sourceRoot":"","sources":["../src/virtualized-manager-helper.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AACtE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE,qBACa,wBAAwB;IACM,OAAO,EAAE,+BAA+B,CAAC;IAGlF,OAAO,CAAC,EAAE,kBAAkB,CAAC;IAC7B,SAAS,CAAC,2BAA2B,kCAAyC;IAE9E,UAAU,CAAC,UAAU,EAAE,aAAa;IAKpC,WAAW,CAAC,UAAU,EAAE,aAAa,GAAG,kBAAkB;CAS3D"}
@@ -0,0 +1,51 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2;
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(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
8
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
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, singleton } from '@difizen/mana-app';
12
+ import { VirtualizedManagerOptionFactory } from "./libro-protocol.js";
13
+ export var VirtualizedManagerHelper = (_dec = singleton(), _dec2 = inject(VirtualizedManagerOptionFactory), _dec3 = prop(), _dec(_class = (_class2 = /*#__PURE__*/function () {
14
+ function VirtualizedManagerHelper() {
15
+ _classCallCheck(this, VirtualizedManagerHelper);
16
+ _initializerDefineProperty(this, "factory", _descriptor, this);
17
+ _initializerDefineProperty(this, "current", _descriptor2, this);
18
+ this.virtualizedManagerHelperMap = new Map();
19
+ }
20
+ _createClass(VirtualizedManagerHelper, [{
21
+ key: "setCurrent",
22
+ value: function setCurrent(libroModel) {
23
+ var virtualizedManagerHelper = this.getOrCreate(libroModel);
24
+ this.current = virtualizedManagerHelper;
25
+ }
26
+ }, {
27
+ key: "getOrCreate",
28
+ value: function getOrCreate(libroModel) {
29
+ var exist = this.virtualizedManagerHelperMap.get(libroModel.id);
30
+ if (exist) {
31
+ return exist;
32
+ }
33
+ var virtualizedManagerHelper = this.factory({
34
+ libroModel: libroModel
35
+ });
36
+ this.virtualizedManagerHelperMap.set(libroModel.id, virtualizedManagerHelper);
37
+ return virtualizedManagerHelper;
38
+ }
39
+ }]);
40
+ return VirtualizedManagerHelper;
41
+ }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "factory", [_dec2], {
42
+ configurable: true,
43
+ enumerable: true,
44
+ writable: true,
45
+ initializer: null
46
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "current", [_dec3], {
47
+ configurable: true,
48
+ enumerable: true,
49
+ writable: true,
50
+ initializer: null
51
+ })), _class2)) || _class);
@@ -0,0 +1,23 @@
1
+ import type { NotebookModel } from './libro-protocol.js';
2
+ import { VirtualizedManagerOption } from './libro-protocol.js';
3
+ export interface IVirtualizedManager {
4
+ openVirtualized: (length: number, size?: number, path?: string) => Promise<boolean>;
5
+ isVirtualized: boolean;
6
+ }
7
+ export declare class VirtualizedManager implements IVirtualizedManager {
8
+ /**
9
+ * 因为进行isVirtualized判断过后才会渲染list
10
+ * 所以它用于滚动到某个cell的判断依据是没有问题的。
11
+ */
12
+ isVirtualized: boolean;
13
+ libroModel: NotebookModel;
14
+ constructor(virtualizedManagerOption: VirtualizedManagerOption);
15
+ /**
16
+ *
17
+ * @param length cell个数
18
+ * @param size undefined 或者 单位 为B
19
+ * @returns 是否使用虚拟滚动
20
+ */
21
+ openVirtualized: (length: number, size?: number, path?: string) => Promise<boolean>;
22
+ }
23
+ //# sourceMappingURL=virtualized-manager.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"virtualized-manager.d.ts","sourceRoot":"","sources":["../src/virtualized-manager.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE/D,MAAM,WAAW,mBAAmB;IAClC,eAAe,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IACpF,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,qBACa,kBAAmB,YAAW,mBAAmB;IAC5D;;;OAGG;IAEH,aAAa,UAAS;IAEtB,UAAU,EAAE,aAAa,CAAC;gBAIxB,wBAAwB,EAAE,wBAAwB;IAKpD;;;;;OAKG;IAEH,eAAe,WAAkB,MAAM,SAAS,MAAM,SAAS,MAAM,sBAUnE;CACH"}
@@ -0,0 +1,65 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _dec, _dec2, _class, _class2, _descriptor;
3
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
4
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
5
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
6
+ function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
7
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
8
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
9
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
+ function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
13
+ function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
14
+ import { transient, prop, inject } from '@difizen/mana-app';
15
+ import { VirtualizedManagerOption } from "./libro-protocol.js";
16
+ export var VirtualizedManager = (_dec = transient(), _dec2 = prop(), _dec(_class = (_class2 = /*#__PURE__*/_createClass(function VirtualizedManager(virtualizedManagerOption) {
17
+ var _this = this;
18
+ _classCallCheck(this, VirtualizedManager);
19
+ /**
20
+ * 因为进行isVirtualized判断过后才会渲染list
21
+ * 所以它用于滚动到某个cell的判断依据是没有问题的。
22
+ */
23
+ _initializerDefineProperty(this, "isVirtualized", _descriptor, this);
24
+ this.libroModel = void 0;
25
+ /**
26
+ *
27
+ * @param length cell个数
28
+ * @param size undefined 或者 单位 为B
29
+ * @returns 是否使用虚拟滚动
30
+ */
31
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
32
+ this.openVirtualized = /*#__PURE__*/function () {
33
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(length, size, path) {
34
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
35
+ while (1) switch (_context.prev = _context.next) {
36
+ case 0:
37
+ if (!(length > 100 || size && size > 4)) {
38
+ _context.next = 5;
39
+ break;
40
+ }
41
+ _this.isVirtualized = true;
42
+ return _context.abrupt("return", true);
43
+ case 5:
44
+ _this.isVirtualized = false;
45
+ return _context.abrupt("return", false);
46
+ case 7:
47
+ case "end":
48
+ return _context.stop();
49
+ }
50
+ }, _callee);
51
+ }));
52
+ return function (_x, _x2, _x3) {
53
+ return _ref.apply(this, arguments);
54
+ };
55
+ }();
56
+ this.libroModel = virtualizedManagerOption.libroModel;
57
+ }), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "isVirtualized", [_dec2], {
58
+ configurable: true,
59
+ enumerable: true,
60
+ writable: true,
61
+ initializer: function initializer() {
62
+ return false;
63
+ }
64
+ })), _class2)) || _class);
65
+ VirtualizedManager = inject(VirtualizedManagerOption)(VirtualizedManager, undefined, 0) || VirtualizedManager;
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "@difizen/libro-core",
3
+ "version": "0.0.0-snapshot-20241017072317",
4
+ "description": "",
5
+ "keywords": [
6
+ "libro",
7
+ "core",
8
+ "notebook"
9
+ ],
10
+ "type": "module",
11
+ "repository": "git@github.com:difizen/libro.git",
12
+ "license": "MIT",
13
+ "exports": {
14
+ ".": {
15
+ "typings": "./es/index.d.ts",
16
+ "default": "./es/index.js"
17
+ },
18
+ "./mock": {
19
+ "typings": "./es/mock/index.d.ts",
20
+ "default": "./es/mock/index.js"
21
+ },
22
+ "./es/mock": {
23
+ "typings": "./es/mock/index.d.ts",
24
+ "default": "./es/mock/index.js"
25
+ },
26
+ "./package.json": "./package.json"
27
+ },
28
+ "main": "es/index.js",
29
+ "module": "es/index.js",
30
+ "typings": "es/index.d.ts",
31
+ "files": [
32
+ "es",
33
+ "src"
34
+ ],
35
+ "dependencies": {
36
+ "@ant-design/icons": "^5.1.0",
37
+ "@difizen/libro-code-editor": "0.0.0-snapshot-20241017072317",
38
+ "@difizen/libro-common": "0.0.0-snapshot-20241017072317",
39
+ "@difizen/libro-shared-model": "0.0.0-snapshot-20241017072317",
40
+ "@difizen/libro-virtualized": "0.0.0-snapshot-20241017072317",
41
+ "@difizen/mana-app": "latest",
42
+ "@difizen/mana-l10n": "latest",
43
+ "@difizen/mana-react": "latest",
44
+ "classnames": "^2.3.2",
45
+ "dayjs": "^1.11.10",
46
+ "dnd-core": "^16.0.1",
47
+ "react-dnd": "^16.0.1",
48
+ "react-dnd-html5-backend": "^16.0.1",
49
+ "resize-observer-polyfill": "^1.5.1",
50
+ "uuid": "^9.0.0"
51
+ },
52
+ "devDependencies": {
53
+ "@types/react": "^18.2.25",
54
+ "@types/uuid": "^9.0.2"
55
+ },
56
+ "peerDependencies": {
57
+ "antd": "^5.8.6",
58
+ "react": ">=16"
59
+ },
60
+ "scripts": {
61
+ "setup": "father build",
62
+ "build": "father build",
63
+ "test": ": Note: lint task is delegated to test:* scripts",
64
+ "test:vitest": "vitest run",
65
+ "test:jest": "jest",
66
+ "coverage": ": Note: lint task is delegated to coverage:* scripts",
67
+ "coverage:vitest": "vitest run --coverage",
68
+ "coverage:jest": "jest --coverage",
69
+ "lint": ": Note: lint task is delegated to lint:* scripts",
70
+ "lint:eslint": "eslint src",
71
+ "typecheck:tsc": "tsc --noEmit"
72
+ }
73
+ }
@@ -0,0 +1,38 @@
1
+ /* stylelint-disable declaration-property-value-disallowed-list */
2
+ .default-add-cell-container {
3
+ display: flex;
4
+ align-items: center;
5
+ justify-content: start;
6
+ height: 90px;
7
+ padding-bottom: 30px;
8
+ margin: 0 72px;
9
+
10
+ .libro-add-cell-container-item {
11
+ margin-right: 16px;
12
+ padding-left: 12px;
13
+ border-radius: 6px;
14
+ font-family: PingFangSC;
15
+ font-weight: 400;
16
+ font-size: 14px;
17
+ background: var(--mana-libro-bottom-btn-background-color) !important;
18
+ border-color: var(--mana-libro-bottom-btn-border-color) !important;
19
+ line-height: 22px;
20
+
21
+ .libro-add-cell-icon {
22
+ display: flex;
23
+ color: var(--mana-libro-bottom-btn-icon-color) !important;
24
+ }
25
+
26
+ span:not(.libro-add-cell-icon) {
27
+ color: var(--mana-libro-bottom-btn-text-color);
28
+ }
29
+
30
+ path {
31
+ // position: absolute;
32
+ // top: 11px;
33
+ // left: 12px;
34
+ height: 9.8px;
35
+ width: 9.4px;
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,3 @@
1
+ export * from './libro-add-cell-slot-contribution.js';
2
+ export * from './libro-add-cell-module.js';
3
+ export * from './libro-add-cell-view.js';
@@ -0,0 +1,9 @@
1
+ import { ManaModule } from '@difizen/mana-app';
2
+
3
+ import { LibroAddCellSlotContribution } from './libro-add-cell-slot-contribution.js';
4
+ import { LibroAddCellView } from './libro-add-cell-view.js';
5
+
6
+ export const LibroAddCellModule = ManaModule.create().register(
7
+ LibroAddCellSlotContribution,
8
+ LibroAddCellView,
9
+ );
@@ -0,0 +1,28 @@
1
+ import { ViewManager } from '@difizen/mana-app';
2
+ import { inject, singleton } from '@difizen/mana-app';
3
+
4
+ import type { LibroView } from '../libro-view.js';
5
+ import { LibroExtensionSlotContribution } from '../slot/index.js';
6
+ import type { LibroExtensionSlotFactory, LibroSlot } from '../slot/index.js';
7
+
8
+ import { LibroAddCellView } from './libro-add-cell-view.js';
9
+
10
+ @singleton({ contrib: LibroExtensionSlotContribution })
11
+ export class LibroAddCellSlotContribution implements LibroExtensionSlotContribution {
12
+ @inject(ViewManager) viewManager: ViewManager;
13
+ protected viewMap: Map<string, LibroAddCellView> = new Map();
14
+
15
+ public readonly slot: LibroSlot = 'list';
16
+
17
+ factory: LibroExtensionSlotFactory = async (libro: LibroView) => {
18
+ const view = await this.viewManager.getOrCreateView(LibroAddCellView, {
19
+ parentId: libro.id,
20
+ });
21
+ view.parent = libro;
22
+ this.viewMap.set(libro.id, view);
23
+ view.onDisposed(() => {
24
+ this.viewMap.delete(libro.id);
25
+ });
26
+ return view;
27
+ };
28
+ }