@difizen/libro-core 0.3.3 → 1.0.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 (307) hide show
  1. package/es/add-cell/libro-add-cell-module.d.ts +1 -1
  2. package/es/add-cell/libro-add-cell-module.d.ts.map +1 -1
  3. package/es/add-cell/libro-add-cell-module.js +1 -1
  4. package/es/add-cell/libro-add-cell-slot-contribution.d.ts +1 -1
  5. package/es/add-cell/libro-add-cell-slot-contribution.d.ts.map +1 -1
  6. package/es/add-cell/libro-add-cell-slot-contribution.js +2 -2
  7. package/es/add-cell/libro-add-cell-view.d.ts +1 -1
  8. package/es/add-cell/libro-add-cell-view.d.ts.map +1 -1
  9. package/es/add-cell/libro-add-cell-view.js +1 -1
  10. package/es/cell/libro-cell-contribution.js +1 -1
  11. package/es/cell/libro-cell-model.d.ts +1 -1
  12. package/es/cell/libro-cell-model.d.ts.map +1 -1
  13. package/es/cell/libro-cell-model.js +2 -2
  14. package/es/cell/libro-cell-module.d.ts +1 -1
  15. package/es/cell/libro-cell-module.d.ts.map +1 -1
  16. package/es/cell/libro-cell-module.js +1 -1
  17. package/es/cell/libro-cell-protocol.d.ts +2 -2
  18. package/es/cell/libro-cell-protocol.d.ts.map +1 -1
  19. package/es/cell/libro-cell-protocol.js +1 -1
  20. package/es/cell/libro-cell-service.d.ts +2 -2
  21. package/es/cell/libro-cell-service.d.ts.map +1 -1
  22. package/es/cell/libro-cell-service.js +3 -3
  23. package/es/cell/libro-cell-view.d.ts +4 -4
  24. package/es/cell/libro-cell-view.d.ts.map +1 -1
  25. package/es/cell/libro-cell-view.js +6 -6
  26. package/es/cell/libro-edit-cell-view.d.ts +1 -1
  27. package/es/cell/libro-edit-cell-view.d.ts.map +1 -1
  28. package/es/cell/libro-edit-cell-view.js +1 -1
  29. package/es/cell/libro-executable-cell-model.d.ts +1 -1
  30. package/es/cell/libro-executable-cell-model.d.ts.map +1 -1
  31. package/es/cell/libro-executable-cell-view.js +3 -3
  32. package/es/collapse-service.js +1 -1
  33. package/es/command/document-commands.d.ts +1 -1
  34. package/es/command/document-commands.d.ts.map +1 -1
  35. package/es/command/kernel-command.d.ts +1 -1
  36. package/es/command/kernel-command.d.ts.map +1 -1
  37. package/es/command/kernel-command.js +1 -1
  38. package/es/command/libro-command-contribution.d.ts +2 -2
  39. package/es/command/libro-command-contribution.d.ts.map +1 -1
  40. package/es/command/libro-command-contribution.js +2 -2
  41. package/es/command/libro-command-register.d.ts +1 -1
  42. package/es/command/libro-command-register.d.ts.map +1 -1
  43. package/es/command/libro-command-register.js +1 -1
  44. package/es/command/module.d.ts +1 -1
  45. package/es/command/module.d.ts.map +1 -1
  46. package/es/command/module.js +1 -1
  47. package/es/command/notebook-commands.d.ts +1 -1
  48. package/es/command/notebook-commands.d.ts.map +1 -1
  49. package/es/command/notebook-commands.js +1 -1
  50. package/es/components/dnd-cell-item-render.js +2 -2
  51. package/es/components/dnd-component/default-dnd-content.d.ts.map +1 -1
  52. package/es/components/dnd-component/default-dnd-content.js +90 -167
  53. package/es/components/dnd-component/dnd-list.d.ts +12 -0
  54. package/es/components/dnd-component/dnd-list.d.ts.map +1 -1
  55. package/es/components/dnd-component/dnd-list.js +307 -63
  56. package/es/components/dnd-component/index.d.ts +0 -2
  57. package/es/components/dnd-component/index.d.ts.map +1 -1
  58. package/es/components/dnd-component/index.js +0 -2
  59. package/es/components/dnd-component/index.less +84 -0
  60. package/es/components/dnd-component/virtualized-manager.d.ts.map +1 -1
  61. package/es/components/dnd-component/virtualized-manager.js +3 -9
  62. package/es/components/libro-component.js +2 -2
  63. package/es/components/libro-side-toolbar-menu.js +2 -2
  64. package/es/components/libro-view-header.js +1 -1
  65. package/es/content/libro-content-contribution.js +1 -1
  66. package/es/content/libro-content-module.d.ts +1 -1
  67. package/es/content/libro-content-module.d.ts.map +1 -1
  68. package/es/content/libro-content-module.js +1 -1
  69. package/es/content/libro-content-protocol.d.ts +1 -1
  70. package/es/content/libro-content-protocol.d.ts.map +1 -1
  71. package/es/content/libro-content-protocol.js +1 -1
  72. package/es/content/libro-content-service.d.ts +1 -1
  73. package/es/content/libro-content-service.d.ts.map +1 -1
  74. package/es/content/libro-content-service.js +1 -1
  75. package/es/content/libro-save-content-contribution.js +1 -1
  76. package/es/formatter/libro-formatter-json-contribution.d.ts +1 -1
  77. package/es/formatter/libro-formatter-json-contribution.js +1 -1
  78. package/es/formatter/libro-formatter-manager.d.ts +1 -1
  79. package/es/formatter/libro-formatter-manager.d.ts.map +1 -1
  80. package/es/formatter/libro-formatter-manager.js +1 -1
  81. package/es/formatter/libro-formatter-module.d.ts +1 -1
  82. package/es/formatter/libro-formatter-module.d.ts.map +1 -1
  83. package/es/formatter/libro-formatter-module.js +1 -1
  84. package/es/formatter/libro-formatter-protocol.d.ts +1 -1
  85. package/es/formatter/libro-formatter-protocol.d.ts.map +1 -1
  86. package/es/formatter/libro-formatter-protocol.js +1 -1
  87. package/es/formatter/libro-formatter-string-contribution.d.ts +1 -1
  88. package/es/formatter/libro-formatter-string-contribution.js +1 -1
  89. package/es/formatter/libro-formatter-trans-default-contribution.js +1 -1
  90. package/es/index.d.ts +2 -0
  91. package/es/index.d.ts.map +1 -1
  92. package/es/index.js +2 -0
  93. package/es/index.less +0 -22
  94. package/es/libro-context-key.d.ts +3 -3
  95. package/es/libro-context-key.d.ts.map +1 -1
  96. package/es/libro-context-key.js +2 -2
  97. package/es/libro-keybind-registry.d.ts +1 -1
  98. package/es/libro-keybind-registry.d.ts.map +1 -1
  99. package/es/libro-keybind-registry.js +2 -2
  100. package/es/libro-model.d.ts +9 -9
  101. package/es/libro-model.d.ts.map +1 -1
  102. package/es/libro-model.js +4 -4
  103. package/es/libro-protocol.d.ts +2 -2
  104. package/es/libro-protocol.d.ts.map +1 -1
  105. package/es/libro-service.d.ts +13 -13
  106. package/es/libro-service.d.ts.map +1 -1
  107. package/es/libro-service.js +4 -4
  108. package/es/libro-setting-contribution.d.ts +2 -2
  109. package/es/libro-setting-contribution.d.ts.map +1 -1
  110. package/es/libro-setting-contribution.js +1 -1
  111. package/es/libro-setting.d.ts +1 -1
  112. package/es/libro-setting.d.ts.map +1 -1
  113. package/es/libro-setting.js +1 -1
  114. package/es/libro-view-tracker.js +1 -1
  115. package/es/libro-view.d.ts +9 -9
  116. package/es/libro-view.d.ts.map +1 -1
  117. package/es/libro-view.js +8 -12
  118. package/es/libro-workspace-service.d.ts +1 -1
  119. package/es/libro-workspace-service.d.ts.map +1 -1
  120. package/es/libro-workspace-service.js +2 -2
  121. package/es/module.d.ts +1 -1
  122. package/es/module.d.ts.map +1 -1
  123. package/es/module.js +2 -2
  124. package/es/output/output-area.d.ts +4 -4
  125. package/es/output/output-area.d.ts.map +1 -1
  126. package/es/output/output-area.js +2 -2
  127. package/es/output/output-contribution.d.ts +1 -1
  128. package/es/output/output-contribution.d.ts.map +1 -1
  129. package/es/output/output-contribution.js +1 -1
  130. package/es/output/output-model.d.ts +1 -1
  131. package/es/output/output-model.d.ts.map +1 -1
  132. package/es/output/output-model.js +2 -2
  133. package/es/output/output-module.d.ts +1 -1
  134. package/es/output/output-module.d.ts.map +1 -1
  135. package/es/output/output-module.js +1 -1
  136. package/es/output/output-protocol.d.ts +3 -3
  137. package/es/output/output-protocol.d.ts.map +1 -1
  138. package/es/output/output-protocol.js +1 -1
  139. package/es/settings/module.d.ts +1 -1
  140. package/es/settings/module.d.ts.map +1 -1
  141. package/es/settings/module.js +1 -1
  142. package/es/settings/setting-editor/configuration-panel-view.d.ts +2 -2
  143. package/es/settings/setting-editor/configuration-panel-view.d.ts.map +1 -1
  144. package/es/settings/setting-editor/configuration-panel-view.js +1 -1
  145. package/es/settings/setting-editor/configuration-render-contribution.d.ts +2 -2
  146. package/es/settings/setting-editor/configuration-render-contribution.d.ts.map +1 -1
  147. package/es/settings/setting-editor/configuration-render-contribution.js +1 -1
  148. package/es/settings/setting-editor/default-node-render.d.ts +1 -1
  149. package/es/settings/setting-editor/default-node-render.d.ts.map +1 -1
  150. package/es/settings/setting-editor/default-node-render.js +1 -1
  151. package/es/settings/setting-editor/module.d.ts +1 -1
  152. package/es/settings/setting-editor/module.d.ts.map +1 -1
  153. package/es/settings/setting-editor/module.js +1 -1
  154. package/es/settings/setting-editor/setting-editor-view.d.ts +1 -1
  155. package/es/settings/setting-editor/setting-editor-view.d.ts.map +1 -1
  156. package/es/settings/setting-editor/setting-editor-view.js +2 -2
  157. package/es/settings/setting-editor/setting-tree-service.d.ts +3 -3
  158. package/es/settings/setting-editor/setting-tree-service.d.ts.map +1 -1
  159. package/es/settings/setting-editor/setting-tree-service.js +2 -2
  160. package/es/settings/setting-editor/setting-tree-view.d.ts +2 -2
  161. package/es/settings/setting-editor/setting-tree-view.d.ts.map +1 -1
  162. package/es/settings/setting-editor/setting-tree-view.js +2 -2
  163. package/es/settings/settings-contribution.d.ts +3 -3
  164. package/es/settings/settings-contribution.d.ts.map +1 -1
  165. package/es/settings/settings-contribution.js +2 -2
  166. package/es/settings/settings-modal.d.ts +1 -1
  167. package/es/settings/settings-modal.d.ts.map +1 -1
  168. package/es/settings/settings-modal.js +3 -3
  169. package/es/settings/settings-protocol.d.ts +1 -1
  170. package/es/settings/settings-protocol.d.ts.map +1 -1
  171. package/es/slot/libro-slot-manager.d.ts +2 -2
  172. package/es/slot/libro-slot-manager.d.ts.map +1 -1
  173. package/es/slot/libro-slot-manager.js +2 -2
  174. package/es/slot/libro-slot-protocol.d.ts +2 -2
  175. package/es/slot/libro-slot-protocol.d.ts.map +1 -1
  176. package/es/slot/libro-slot-protocol.js +1 -1
  177. package/es/slot/libro-slot-view.d.ts +2 -2
  178. package/es/slot/libro-slot-view.d.ts.map +1 -1
  179. package/es/slot/libro-slot-view.js +3 -3
  180. package/es/slot/module.d.ts +1 -1
  181. package/es/slot/module.d.ts.map +1 -1
  182. package/es/slot/module.js +1 -1
  183. package/es/theme/libro-color-registry.d.ts +2 -2
  184. package/es/theme/libro-color-registry.d.ts.map +1 -1
  185. package/es/theme/libro-color-registry.js +2 -2
  186. package/es/toolbar/all-outputs-scroll-icon.js +1 -1
  187. package/es/toolbar/change-cell-to-selector.js +1 -1
  188. package/es/toolbar/hide-all-selector.js +2 -2
  189. package/es/toolbar/libro-toolbar.d.ts +2 -2
  190. package/es/toolbar/libro-toolbar.d.ts.map +1 -1
  191. package/es/toolbar/libro-toolbar.js +3 -3
  192. package/es/toolbar/module.d.ts +1 -1
  193. package/es/toolbar/module.d.ts.map +1 -1
  194. package/es/toolbar/module.js +1 -1
  195. package/es/toolbar/restart-clear-outputs-contribution.d.ts +2 -2
  196. package/es/toolbar/restart-clear-outputs-contribution.d.ts.map +1 -1
  197. package/es/toolbar/restart-clear-outputs-contribution.js +1 -1
  198. package/es/toolbar/restart-clear-outputs-modal.d.ts +1 -1
  199. package/es/toolbar/restart-clear-outputs-modal.d.ts.map +1 -1
  200. package/es/toolbar/restart-clear-outputs-modal.js +1 -1
  201. package/es/toolbar/save-icon.js +1 -1
  202. package/es/toolbar/shutdown-contribution.d.ts +2 -2
  203. package/es/toolbar/shutdown-contribution.d.ts.map +1 -1
  204. package/es/toolbar/shutdown-contribution.js +1 -1
  205. package/es/toolbar/shutdown-modal.d.ts +1 -1
  206. package/es/toolbar/shutdown-modal.d.ts.map +1 -1
  207. package/es/toolbar/side-toolar-more-select.js +4 -4
  208. package/es/utils/index.js +1 -1
  209. package/es/virtualized-manager-helper.js +1 -1
  210. package/es/virtualized-manager.d.ts.map +1 -1
  211. package/es/virtualized-manager.js +2 -9
  212. package/package.json +10 -9
  213. package/src/add-cell/libro-add-cell-module.ts +1 -1
  214. package/src/add-cell/libro-add-cell-slot-contribution.ts +2 -2
  215. package/src/add-cell/libro-add-cell-view.tsx +1 -1
  216. package/src/cell/libro-cell-contribution.ts +1 -1
  217. package/src/cell/libro-cell-model.ts +2 -2
  218. package/src/cell/libro-cell-module.ts +1 -1
  219. package/src/cell/libro-cell-protocol.ts +2 -2
  220. package/src/cell/libro-cell-service.ts +4 -4
  221. package/src/cell/libro-cell-view.tsx +7 -7
  222. package/src/cell/libro-edit-cell-view.tsx +1 -1
  223. package/src/cell/libro-executable-cell-model.ts +1 -1
  224. package/src/cell/libro-executable-cell-view.ts +3 -3
  225. package/src/collapse-service.ts +1 -1
  226. package/src/command/document-commands.ts +1 -1
  227. package/src/command/kernel-command.ts +2 -2
  228. package/src/command/libro-command-contribution.ts +3 -3
  229. package/src/command/libro-command-register.ts +2 -2
  230. package/src/command/module.ts +1 -1
  231. package/src/command/notebook-commands.ts +2 -2
  232. package/src/components/dnd-cell-item-render.tsx +2 -2
  233. package/src/components/dnd-component/default-dnd-content.tsx +101 -165
  234. package/src/components/dnd-component/dnd-list.tsx +309 -35
  235. package/src/components/dnd-component/index.less +84 -0
  236. package/src/components/dnd-component/index.tsx +0 -2
  237. package/src/components/dnd-component/virtualized-manager.ts +11 -8
  238. package/src/components/libro-component.tsx +2 -2
  239. package/src/components/libro-side-toolbar-menu.tsx +3 -3
  240. package/src/components/libro-view-header.tsx +1 -1
  241. package/src/content/libro-content-contribution.ts +1 -1
  242. package/src/content/libro-content-module.ts +1 -1
  243. package/src/content/libro-content-protocol.ts +1 -1
  244. package/src/content/libro-content-service.ts +2 -2
  245. package/src/content/libro-save-content-contribution.ts +1 -1
  246. package/src/formatter/libro-formatter-json-contribution.ts +1 -1
  247. package/src/formatter/libro-formatter-manager.ts +2 -2
  248. package/src/formatter/libro-formatter-module.ts +1 -1
  249. package/src/formatter/libro-formatter-protocol.ts +1 -1
  250. package/src/formatter/libro-formatter-string-contribution.ts +1 -1
  251. package/src/formatter/libro-formatter-trans-default-contribution.ts +1 -1
  252. package/src/index.less +0 -22
  253. package/src/index.tsx +3 -0
  254. package/src/libro-context-key.ts +4 -4
  255. package/src/libro-keybind-registry.ts +2 -2
  256. package/src/libro-model.ts +4 -4
  257. package/src/libro-protocol.ts +2 -2
  258. package/src/libro-service.ts +5 -5
  259. package/src/libro-setting-contribution.ts +1 -1
  260. package/src/libro-setting.ts +2 -2
  261. package/src/libro-view-tracker.ts +1 -1
  262. package/src/libro-view.tsx +8 -18
  263. package/src/libro-workspace-service.ts +2 -2
  264. package/src/module.ts +2 -2
  265. package/src/output/output-area.tsx +3 -3
  266. package/src/output/output-contribution.ts +1 -1
  267. package/src/output/output-model.tsx +2 -2
  268. package/src/output/output-module.ts +1 -1
  269. package/src/output/output-protocol.ts +3 -3
  270. package/src/settings/module.ts +1 -1
  271. package/src/settings/setting-editor/configuration-panel-view.tsx +2 -2
  272. package/src/settings/setting-editor/configuration-render-contribution.ts +2 -2
  273. package/src/settings/setting-editor/default-node-render.tsx +2 -2
  274. package/src/settings/setting-editor/module.ts +1 -1
  275. package/src/settings/setting-editor/setting-editor-view.tsx +2 -2
  276. package/src/settings/setting-editor/setting-tree-service.ts +3 -3
  277. package/src/settings/setting-editor/setting-tree-view.tsx +3 -3
  278. package/src/settings/settings-contribution.tsx +7 -3
  279. package/src/settings/settings-modal.tsx +4 -4
  280. package/src/settings/settings-protocol.ts +1 -1
  281. package/src/slot/libro-slot-manager.ts +3 -3
  282. package/src/slot/libro-slot-protocol.ts +2 -2
  283. package/src/slot/libro-slot-view.tsx +9 -4
  284. package/src/slot/module.ts +1 -1
  285. package/src/theme/libro-color-registry.ts +3 -3
  286. package/src/toolbar/all-outputs-scroll-icon.tsx +1 -1
  287. package/src/toolbar/change-cell-to-selector.tsx +2 -2
  288. package/src/toolbar/hide-all-selector.tsx +3 -3
  289. package/src/toolbar/libro-toolbar.tsx +4 -4
  290. package/src/toolbar/module.ts +1 -1
  291. package/src/toolbar/restart-clear-outputs-contribution.tsx +1 -1
  292. package/src/toolbar/restart-clear-outputs-modal.tsx +2 -2
  293. package/src/toolbar/save-icon.tsx +2 -2
  294. package/src/toolbar/shutdown-contribution.tsx +1 -1
  295. package/src/toolbar/shutdown-modal.tsx +1 -1
  296. package/src/toolbar/side-toolar-more-select.tsx +5 -5
  297. package/src/utils/index.ts +1 -1
  298. package/src/virtualized-manager-helper.ts +1 -1
  299. package/src/virtualized-manager.ts +10 -8
  300. package/es/components/dnd-component/custom-drag-layer.d.ts +0 -9
  301. package/es/components/dnd-component/custom-drag-layer.d.ts.map +0 -1
  302. package/es/components/dnd-component/custom-drag-layer.js +0 -140
  303. package/es/components/dnd-component/dnd-context.d.ts +0 -3
  304. package/es/components/dnd-component/dnd-context.d.ts.map +0 -1
  305. package/es/components/dnd-component/dnd-context.js +0 -20
  306. package/src/components/dnd-component/custom-drag-layer.tsx +0 -144
  307. package/src/components/dnd-component/dnd-context.tsx +0 -28
@@ -1,140 +0,0 @@
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
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- 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; }
5
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
- 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); }
7
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
- 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); }
10
- 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; }
11
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
- /* eslint-disable react-hooks/exhaustive-deps */
14
- import { useInject, ViewInstance } from '@difizen/mana-app';
15
- import { ViewRender } from '@difizen/mana-app';
16
- import { useState, useEffect, memo } from 'react';
17
- import { useDragLayer } from 'react-dnd';
18
- import { LibroCellService } from "../../cell/index.js";
19
- import { jsx as _jsx } from "react/jsx-runtime";
20
- import { jsxs as _jsxs } from "react/jsx-runtime";
21
- import { Fragment as _Fragment } from "react/jsx-runtime";
22
- var layerStyles = {
23
- position: 'fixed',
24
- pointerEvents: 'none',
25
- zIndex: 1000,
26
- left: 0,
27
- top: 0,
28
- width: '300px',
29
- height: '50px'
30
- };
31
- var getItemStyles = function getItemStyles(currentOffset) {
32
- if (!currentOffset) {
33
- return {
34
- display: 'none'
35
- };
36
- }
37
- var x = currentOffset.x,
38
- y = currentOffset.y;
39
- var transform = "translate(".concat(x, "px, ").concat(y, "px)");
40
- return {
41
- transform: transform,
42
- WebkitTransform: transform
43
- };
44
- };
45
- var MultipleSelectionPreview = function MultipleSelectionPreview(_ref) {
46
- var activeCell = _ref.activeCell;
47
- var cellService = useInject(LibroCellService);
48
- var _useState = useState(),
49
- _useState2 = _slicedToArray(_useState, 2),
50
- multipleSelectionPreview = _useState2[0],
51
- setMultipleSelectionPreview = _useState2[1];
52
- useEffect(function () {
53
- cellService.getOrCreateView(activeCell.model.options, activeCell.parent.id).then(function (view) {
54
- setMultipleSelectionPreview(view);
55
- return;
56
- }).catch(function (e) {
57
- //
58
- });
59
- }, []);
60
- return /*#__PURE__*/_jsxs("div", {
61
- className: "libro-dnd-multiple-selection-preview",
62
- children: [/*#__PURE__*/_jsx("div", {
63
- className: "libro-dnd-active-selection",
64
- children: multipleSelectionPreview && /*#__PURE__*/_jsx(ViewRender, {
65
- view: multipleSelectionPreview
66
- })
67
- }), /*#__PURE__*/_jsx("div", {
68
- className: "libro-dnd-cascading-multiple-selection"
69
- })]
70
- });
71
- };
72
- export var MultipleSelectionPreviewMemo = /*#__PURE__*/memo(MultipleSelectionPreview);
73
- var SingleSelectionDragPreview = function SingleSelectionDragPreview(_ref2) {
74
- var activeCell = _ref2.activeCell;
75
- var cellService = useInject(LibroCellService);
76
- var _useState3 = useState(),
77
- _useState4 = _slicedToArray(_useState3, 2),
78
- singleSelectionPreview = _useState4[0],
79
- setSingleSelectionPreview = _useState4[1];
80
- useEffect(function () {
81
- cellService.getOrCreateView(_objectSpread(_objectSpread({}, activeCell.model.options), {}, {
82
- modelId: activeCell.model.id,
83
- singleSelectionDragPreview: true
84
- }), activeCell.parent.id).then(function (view) {
85
- setSingleSelectionPreview(view);
86
- return;
87
- }).catch(function (e) {
88
- //
89
- });
90
- }, []);
91
- return /*#__PURE__*/_jsx("div", {
92
- className: "libro-dnd-active-selection",
93
- children: singleSelectionPreview && /*#__PURE__*/_jsx(ViewRender, {
94
- view: singleSelectionPreview
95
- })
96
- });
97
- };
98
- export var SingleSelectionPreviewMemo = /*#__PURE__*/memo(SingleSelectionDragPreview);
99
- export var CustomDragLayer = function CustomDragLayer() {
100
- var _useDragLayer = useDragLayer(function (monitor) {
101
- return {
102
- item: monitor.getItem(),
103
- itemType: monitor.getItemType(),
104
- currentOffset: monitor.getClientOffset(),
105
- isDragging: monitor.isDragging()
106
- };
107
- }),
108
- isDragging = _useDragLayer.isDragging,
109
- item = _useDragLayer.item,
110
- currentOffset = _useDragLayer.currentOffset;
111
- var instance = useInject(ViewInstance);
112
- function renderItem() {
113
- var isItemSelected = instance.model.selections.findIndex(function (select) {
114
- return select.id === item.cell.id;
115
- }) >= 0;
116
- if (instance.model.selections.length !== 0 && isItemSelected) {
117
- return /*#__PURE__*/_jsx(_Fragment, {
118
- children: instance.model.active && /*#__PURE__*/_jsx(MultipleSelectionPreviewMemo, {
119
- activeCell: instance.model.active
120
- })
121
- });
122
- }
123
- return /*#__PURE__*/_jsx(_Fragment, {
124
- children: instance.model.active && /*#__PURE__*/_jsx(SingleSelectionPreviewMemo, {
125
- activeCell: instance.model.active
126
- })
127
- });
128
- }
129
- if (!isDragging) {
130
- return null;
131
- }
132
- return /*#__PURE__*/_jsx("div", {
133
- className: "libro-custom-drag-layer",
134
- style: layerStyles,
135
- children: /*#__PURE__*/_jsx("div", {
136
- style: getItemStyles(currentOffset),
137
- children: renderItem()
138
- })
139
- });
140
- };
@@ -1,3 +0,0 @@
1
- import type { FC } from 'react';
2
- export declare const DndContext: FC<any>;
3
- //# sourceMappingURL=dnd-context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dnd-context.d.ts","sourceRoot":"","sources":["../../../src/components/dnd-component/dnd-context.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,GAAG,CAmB9B,CAAC"}
@@ -1,20 +0,0 @@
1
- import { getOrigin, useInject } from '@difizen/mana-app';
2
- import { ViewInstance } from '@difizen/mana-app';
3
- import { DndProvider } from 'react-dnd';
4
- import { HTML5Backend } from 'react-dnd-html5-backend';
5
- import { jsx as _jsx } from "react/jsx-runtime";
6
- export var DndContext = function DndContext(_ref) {
7
- var _getOrigin$container;
8
- var children = _ref.children;
9
- var instance = useInject(ViewInstance);
10
- if (!instance.isVisible && !instance.model.dndAreaNullEnable) {
11
- return null;
12
- }
13
- return /*#__PURE__*/_jsx(DndProvider, {
14
- backend: HTML5Backend,
15
- options: {
16
- rootElement: instance.isVisible || !instance.model.dndAreaNullEnable ? (_getOrigin$container = getOrigin(instance).container) === null || _getOrigin$container === void 0 ? void 0 : _getOrigin$container.current : null
17
- },
18
- children: children
19
- });
20
- };
@@ -1,144 +0,0 @@
1
- /* eslint-disable react-hooks/exhaustive-deps */
2
- import { useInject, ViewInstance } from '@difizen/mana-app';
3
- import { ViewRender } from '@difizen/mana-app';
4
- import type { FC, CSSProperties } from 'react';
5
- import { useState, useEffect, memo } from 'react';
6
- import type { XYCoord } from 'react-dnd';
7
- import { useDragLayer } from 'react-dnd';
8
-
9
- import type { CellService } from '../../cell/index.js';
10
- import { LibroCellService } from '../../cell/index.js';
11
- import type { CellView } from '../../libro-protocol.js';
12
- import type { LibroView } from '../../libro-view.js';
13
-
14
- export interface SelectionPreviewProps {
15
- activeCell: CellView;
16
- }
17
- const layerStyles: CSSProperties = {
18
- position: 'fixed',
19
- pointerEvents: 'none',
20
- zIndex: 1000,
21
- left: 0,
22
- top: 0,
23
- width: '300px',
24
- height: '50px',
25
- };
26
-
27
- const getItemStyles = (currentOffset: XYCoord | null) => {
28
- if (!currentOffset) {
29
- return {
30
- display: 'none',
31
- };
32
- }
33
-
34
- const { x, y } = currentOffset;
35
-
36
- const transform = `translate(${x}px, ${y}px)`;
37
- return {
38
- transform,
39
- WebkitTransform: transform,
40
- };
41
- };
42
-
43
- const MultipleSelectionPreview: FC<{ activeCell: CellView }> = ({ activeCell }) => {
44
- const cellService = useInject<CellService>(LibroCellService);
45
- const [multipleSelectionPreview, setMultipleSelectionPreview] = useState<CellView>();
46
- useEffect(() => {
47
- cellService
48
- .getOrCreateView(activeCell.model.options, activeCell.parent.id)
49
- .then((view) => {
50
- setMultipleSelectionPreview(view);
51
- return;
52
- })
53
- .catch((e) => {
54
- //
55
- });
56
- }, []);
57
-
58
- return (
59
- <div className="libro-dnd-multiple-selection-preview">
60
- <div className="libro-dnd-active-selection">
61
- {multipleSelectionPreview && <ViewRender view={multipleSelectionPreview} />}
62
- </div>
63
- <div className="libro-dnd-cascading-multiple-selection" />
64
- </div>
65
- );
66
- };
67
-
68
- export const MultipleSelectionPreviewMemo: FC<SelectionPreviewProps> = memo(
69
- MultipleSelectionPreview,
70
- );
71
-
72
- const SingleSelectionDragPreview: FC<{ activeCell: CellView }> = ({ activeCell }) => {
73
- const cellService = useInject<CellService>(LibroCellService);
74
- const [singleSelectionPreview, setSingleSelectionPreview] = useState<CellView>();
75
- useEffect(() => {
76
- cellService
77
- .getOrCreateView(
78
- {
79
- ...activeCell.model.options,
80
- modelId: activeCell.model.id,
81
- singleSelectionDragPreview: true,
82
- },
83
- activeCell.parent.id,
84
- )
85
- .then((view) => {
86
- setSingleSelectionPreview(view);
87
- return;
88
- })
89
- .catch((e) => {
90
- //
91
- });
92
- }, []);
93
-
94
- return (
95
- <div className="libro-dnd-active-selection">
96
- {singleSelectionPreview && <ViewRender view={singleSelectionPreview} />}
97
- </div>
98
- );
99
- };
100
-
101
- export const SingleSelectionPreviewMemo: FC<SelectionPreviewProps> = memo(
102
- SingleSelectionDragPreview,
103
- );
104
-
105
- export const CustomDragLayer = () => {
106
- const { isDragging, item, currentOffset } = useDragLayer((monitor) => ({
107
- item: monitor.getItem(),
108
- itemType: monitor.getItemType(),
109
- currentOffset: monitor.getClientOffset(),
110
- isDragging: monitor.isDragging(),
111
- }));
112
-
113
- const instance = useInject<LibroView>(ViewInstance);
114
-
115
- function renderItem() {
116
- const isItemSelected =
117
- instance.model.selections.findIndex((select) => select.id === item.cell.id) >= 0;
118
- if (instance.model.selections.length !== 0 && isItemSelected) {
119
- return (
120
- <>
121
- {instance.model.active && (
122
- <MultipleSelectionPreviewMemo activeCell={instance.model.active} />
123
- )}
124
- </>
125
- );
126
- }
127
- return (
128
- <>
129
- {instance.model.active && (
130
- <SingleSelectionPreviewMemo activeCell={instance.model.active} />
131
- )}
132
- </>
133
- );
134
- }
135
-
136
- if (!isDragging) {
137
- return null;
138
- }
139
- return (
140
- <div className="libro-custom-drag-layer" style={layerStyles}>
141
- <div style={getItemStyles(currentOffset)}>{renderItem()}</div>
142
- </div>
143
- );
144
- };
@@ -1,28 +0,0 @@
1
- import { getOrigin, useInject } from '@difizen/mana-app';
2
- import { ViewInstance } from '@difizen/mana-app';
3
- import type { FC } from 'react';
4
- import { DndProvider } from 'react-dnd';
5
- import { HTML5Backend } from 'react-dnd-html5-backend';
6
-
7
- import type { LibroView } from '../../libro-view.js';
8
-
9
- export const DndContext: FC<any> = ({ children }) => {
10
- const instance = useInject<LibroView>(ViewInstance);
11
-
12
- if (!instance.isVisible && !instance.model.dndAreaNullEnable) {
13
- return null;
14
- }
15
- return (
16
- <DndProvider
17
- backend={HTML5Backend}
18
- options={{
19
- rootElement:
20
- instance.isVisible || !instance.model.dndAreaNullEnable
21
- ? getOrigin(instance).container?.current
22
- : null,
23
- }}
24
- >
25
- {children}
26
- </DndProvider>
27
- );
28
- };