@bigbinary/neeto-molecules 3.11.2 → 3.12.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.
package/README.md CHANGED
@@ -12,6 +12,7 @@ https://neeto-molecules.neeto.com/
12
12
  ## Exported Components
13
13
 
14
14
  - [AuditLogs](./docs/components/AuditLogs.md)
15
+ - [BoardView](./docs/components/BoardView.md)
15
16
  - [Breadcrumbs](./docs/components/Breadcrumbs.md)
16
17
  - [BrowserSupport](./docs/components/BrowserSupport.md)
17
18
  - [Builder](./docs/components/Builder.md)
@@ -0,0 +1,377 @@
1
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
2
+ import { useRef, useId, forwardRef, createElement, useState } from 'react';
3
+ import { DragOverlay, useDraggable, useDroppable, useSensors, useSensor, PointerSensor, DndContext } from '@dnd-kit/core';
4
+ import { n } from './inject-css-DmrvuTKK.js';
5
+ import { jsxs, jsx } from 'react/jsx-runtime';
6
+ import { P as PropTypes } from './index-DAYCJu79.js';
7
+ import _defineProperty from '@babel/runtime/helpers/defineProperty';
8
+ import classnames from 'classnames';
9
+ import { useInView } from 'react-intersection-observer';
10
+ import './_commonjsHelpers-BFTU3MAI.js';
11
+
12
+ var css = ".neeto-molecules-boardview-section{flex-shrink:0;width:320px}@media screen and (max-width:1024px){.neeto-molecules-boardview-section{width:300px}}@media screen and (max-width:768px){.neeto-molecules-boardview-section{width:280px}}";
13
+ n(css,{});
14
+
15
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
16
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
17
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
18
+ // Customised collision detection algorithm based on `closestCenter` implementation for dnd-kit
19
+ // Extracts collisions by respecting `accepts` property
20
+
21
+ var distanceBetween = function distanceBetween(p1, p2) {
22
+ return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
23
+ };
24
+ var centerOfRectangle = function centerOfRectangle(rect) {
25
+ var left = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : rect.left;
26
+ var top = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : rect.top;
27
+ return {
28
+ x: left + rect.width * 0.5,
29
+ y: top + rect.height * 0.5
30
+ };
31
+ };
32
+ var matchType = function matchType(draggable, droppable) {
33
+ return droppable.data.current.accepts.includes(draggable.data.current.type);
34
+ };
35
+
36
+ // `active` attribute from the `dnd-kit` is unreliable since the data can be lost on unmount during a drag.
37
+ var closestCenter = function closestCenter(_ref) {
38
+ var active = _ref.active;
39
+ return function (_ref2) {
40
+ var collisionRect = _ref2.collisionRect,
41
+ droppableRects = _ref2.droppableRects,
42
+ droppableContainers = _ref2.droppableContainers;
43
+ var centerRect = centerOfRectangle(collisionRect, collisionRect.left, collisionRect.top);
44
+ var minDistance = Number.POSITIVE_INFINITY;
45
+ var collision = {
46
+ id: undefined
47
+ };
48
+
49
+ // eslint-disable-next-line @bigbinary/neeto/use-array-methods
50
+ var _iterator = _createForOfIteratorHelper(droppableContainers),
51
+ _step;
52
+ try {
53
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
54
+ var droppableContainer = _step.value;
55
+ var rect = droppableRects.get(droppableContainer.id);
56
+ if (!rect || droppableContainer.id === active.id) continue;else if (!matchType(active, droppableContainer)) continue;
57
+ var distance = distanceBetween(centerOfRectangle(rect), centerRect);
58
+ if (distance < minDistance) {
59
+ minDistance = distance;
60
+ collision = {
61
+ id: droppableContainer.id,
62
+ data: {
63
+ droppableContainer: droppableContainer,
64
+ value: distance
65
+ }
66
+ };
67
+ }
68
+ }
69
+ } catch (err) {
70
+ _iterator.e(err);
71
+ } finally {
72
+ _iterator.f();
73
+ }
74
+ return [collision];
75
+ };
76
+ };
77
+
78
+ var DRAGGABLE_TYPES = {
79
+ SECTION: "section",
80
+ ITEM: "item"
81
+ };
82
+
83
+ var DndOverlay = function DndOverlay(_ref) {
84
+ var _state$active;
85
+ var props = _ref.props,
86
+ state = _ref.state;
87
+ var renderSectionOverlay = props.renderSectionOverlay,
88
+ renderItemOverlay = props.renderItemOverlay;
89
+ var data = ((_state$active = state.active) === null || _state$active === void 0 ? void 0 : _state$active.data.current) || {};
90
+ return /*#__PURE__*/jsxs(DragOverlay, {
91
+ children: [data.type === DRAGGABLE_TYPES.ITEM && (renderItemOverlay === null || renderItemOverlay === void 0 ? void 0 : renderItemOverlay(data)), data.type === DRAGGABLE_TYPES.SECTION && (renderSectionOverlay === null || renderSectionOverlay === void 0 ? void 0 : renderSectionOverlay(data))]
92
+ });
93
+ };
94
+
95
+ var DndIndicator = function DndIndicator(_ref) {
96
+ var _ref$layout = _ref.layout,
97
+ layout = _ref$layout === void 0 ? "vertical" : _ref$layout;
98
+ return /*#__PURE__*/jsx("div", {
99
+ className: classnames("neeto-ui-rounded-xl neeto-ui-bg-accent-600 absolute", {
100
+ "-bottom-3 left-0 right-0 h-1": layout === "horizontal",
101
+ "-right-2 bottom-0 top-0 w-1": layout === "vertical"
102
+ })
103
+ });
104
+ };
105
+
106
+ function ownKeys$3(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; }
107
+ function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
108
+ var ItemContainer = function ItemContainer(_ref) {
109
+ var id = _ref.id,
110
+ index = _ref.index,
111
+ data = _ref.data,
112
+ render = _ref.render;
113
+ var mutables = useRef({
114
+ containerHeight: 128
115
+ }).current;
116
+ var _useDraggable = useDraggable({
117
+ data: _objectSpread$3(_objectSpread$3({}, data), {}, {
118
+ index: index,
119
+ type: DRAGGABLE_TYPES.ITEM
120
+ }),
121
+ id: id
122
+ }),
123
+ attributes = _useDraggable.attributes,
124
+ listeners = _useDraggable.listeners,
125
+ isDragging = _useDraggable.isDragging,
126
+ setDraggableNodeRef = _useDraggable.setNodeRef;
127
+ var _useDroppable = useDroppable({
128
+ data: _objectSpread$3(_objectSpread$3({}, data), {}, {
129
+ accepts: [DRAGGABLE_TYPES.ITEM],
130
+ index: index + 1
131
+ }),
132
+ id: id
133
+ }),
134
+ isOver = _useDroppable.isOver,
135
+ setDroppableNodeRef = _useDroppable.setNodeRef;
136
+ var _useInView = useInView({
137
+ onChange: function onChange(inView, entry) {
138
+ if (inView) return; // We need the last height value when elements moves out.
139
+ mutables.containerHeight = entry.target.clientHeight;
140
+ }
141
+ }),
142
+ _useInView2 = _slicedToArray(_useInView, 2),
143
+ setViewRef = _useInView2[0],
144
+ inView = _useInView2[1];
145
+ var isIndicatorVisible = !isDragging && isOver;
146
+ return /*#__PURE__*/jsxs("div", _objectSpread$3(_objectSpread$3({
147
+ className: classnames("relative mt-4", {
148
+ "opacity-65": isDragging
149
+ }),
150
+ ref: function ref(node) {
151
+ setDraggableNodeRef(node);
152
+ setDroppableNodeRef(node);
153
+ setViewRef(node);
154
+ }
155
+ }, _objectSpread$3(_objectSpread$3({
156
+ id: id
157
+ }, attributes), listeners)), {}, {
158
+ style: {
159
+ height: inView ? undefined : mutables.containerHeight
160
+ },
161
+ children: [inView && render(), isIndicatorVisible && /*#__PURE__*/jsx(DndIndicator, {
162
+ layout: "horizontal"
163
+ })]
164
+ }));
165
+ };
166
+
167
+ function ownKeys$2(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; }
168
+ function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
169
+ var ItemPlaceholder = function ItemPlaceholder(_ref) {
170
+ var data = _ref.data,
171
+ _ref$index = _ref.index,
172
+ index = _ref$index === void 0 ? 0 : _ref$index;
173
+ var id = useId();
174
+ var _useDroppable = useDroppable({
175
+ data: _objectSpread$2(_objectSpread$2({}, data), {}, {
176
+ accepts: [DRAGGABLE_TYPES.ITEM],
177
+ index: index
178
+ }),
179
+ id: id
180
+ }),
181
+ isOver = _useDroppable.isOver,
182
+ setNodeRef = _useDroppable.setNodeRef;
183
+ return /*#__PURE__*/jsx("div", {
184
+ className: "relative",
185
+ ref: setNodeRef,
186
+ children: isOver && /*#__PURE__*/jsx(DndIndicator, {
187
+ layout: "horizontal"
188
+ })
189
+ });
190
+ };
191
+
192
+ var Section = /*#__PURE__*/forwardRef(function (_ref, ref) {
193
+ var section = _ref.section,
194
+ items = _ref.items,
195
+ renderItem = _ref.renderItem;
196
+ return /*#__PURE__*/jsxs("div", {
197
+ ref: ref,
198
+ className: "relative min-h-0 flex-1 basis-0 overflow-auto",
199
+ children: [/*#__PURE__*/jsx(ItemPlaceholder, {
200
+ data: {
201
+ section: section
202
+ }
203
+ }), items.map(function (item, index) {
204
+ return /*#__PURE__*/createElement(ItemContainer, {
205
+ index: index,
206
+ data: {
207
+ section: section,
208
+ item: item
209
+ },
210
+ id: item.id,
211
+ key: item.id,
212
+ render: function render() {
213
+ return renderItem({
214
+ index: index,
215
+ item: item,
216
+ section: section
217
+ });
218
+ }
219
+ });
220
+ })]
221
+ });
222
+ });
223
+ Section.displayName = "Section";
224
+ Section.propTypes = {
225
+ /** A reference to the section container element. */
226
+ ref: PropTypes.any,
227
+ /** The current section data */
228
+ section: PropTypes.shape({
229
+ id: PropTypes.string.isRequired
230
+ }).isRequired,
231
+ /** An array of items belonging to the current section. */
232
+ items: PropTypes.arrayOf(PropTypes.shape({
233
+ id: PropTypes.string.isRequired
234
+ })).isRequired,
235
+ /** A function that renders the content of each item in the list. */
236
+ renderItem: PropTypes.func.isRequired
237
+ };
238
+
239
+ function ownKeys$1(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; }
240
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
241
+ var SectionContainer = function SectionContainer(_ref) {
242
+ var id = _ref.id,
243
+ index = _ref.index,
244
+ data = _ref.data,
245
+ render = _ref.render;
246
+ var _useInView = useInView(),
247
+ _useInView2 = _slicedToArray(_useInView, 2),
248
+ setViewRef = _useInView2[0],
249
+ inView = _useInView2[1];
250
+ var _useDraggable = useDraggable({
251
+ data: _objectSpread$1(_objectSpread$1({}, data), {}, {
252
+ type: DRAGGABLE_TYPES.SECTION,
253
+ index: index
254
+ }),
255
+ id: id
256
+ }),
257
+ attributes = _useDraggable.attributes,
258
+ listeners = _useDraggable.listeners,
259
+ isDragging = _useDraggable.isDragging,
260
+ setDraggableNodeRef = _useDraggable.setNodeRef;
261
+ var _useDroppable = useDroppable({
262
+ data: _objectSpread$1(_objectSpread$1({}, data), {}, {
263
+ accepts: [DRAGGABLE_TYPES.SECTION],
264
+ index: index + 1
265
+ }),
266
+ id: id
267
+ }),
268
+ isOver = _useDroppable.isOver,
269
+ setDroppableNodeRef = _useDroppable.setNodeRef;
270
+ var isIndicatorVisible = !isDragging && isOver;
271
+ return /*#__PURE__*/jsxs("div", _objectSpread$1(_objectSpread$1(_objectSpread$1({}, listeners), attributes), {}, {
272
+ className: classnames("neeto-molecules-boardview-section relative ml-3 flex h-full flex-col", {
273
+ "opacity-65": isDragging
274
+ }),
275
+ ref: function ref(node) {
276
+ setDraggableNodeRef(node);
277
+ setDroppableNodeRef(node);
278
+ setViewRef(node);
279
+ },
280
+ children: [inView && render(), isIndicatorVisible && /*#__PURE__*/jsx(DndIndicator, {
281
+ layout: "vertical"
282
+ })]
283
+ }));
284
+ };
285
+
286
+ 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; }
287
+ 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; }
288
+ var SectionPlaceholder = function SectionPlaceholder(_ref) {
289
+ var data = _ref.data,
290
+ _ref$index = _ref.index,
291
+ index = _ref$index === void 0 ? 0 : _ref$index;
292
+ var id = useId();
293
+ var _useDroppable = useDroppable({
294
+ data: _objectSpread(_objectSpread({}, data), {}, {
295
+ accepts: [DRAGGABLE_TYPES.SECTION],
296
+ index: index
297
+ }),
298
+ id: id
299
+ }),
300
+ isOver = _useDroppable.isOver,
301
+ setNodeRef = _useDroppable.setNodeRef;
302
+ return /*#__PURE__*/jsx("div", {
303
+ className: "relative",
304
+ ref: setNodeRef,
305
+ children: isOver && /*#__PURE__*/jsx(DndIndicator, {
306
+ layout: "vertical"
307
+ })
308
+ });
309
+ };
310
+
311
+ var sensorConfig = {
312
+ activationConstraint: {
313
+ distance: 8
314
+ }
315
+ };
316
+ var measuringConfig = {
317
+ droppable: {
318
+ frequency: 500
319
+ }
320
+ };
321
+ var BoardView = /*#__PURE__*/forwardRef(function (props, ref) {
322
+ var sections = props.sections,
323
+ onMoveSection = props.onMoveSection,
324
+ onMoveItem = props.onMoveItem,
325
+ renderSection = props.renderSection;
326
+ var _useState = useState({}),
327
+ _useState2 = _slicedToArray(_useState, 2),
328
+ dragState = _useState2[0],
329
+ setDragState = _useState2[1];
330
+ var sensors = useSensors(useSensor(PointerSensor, sensorConfig));
331
+ var onDragEnd = function onDragEnd(drag) {
332
+ var _drag$over;
333
+ var active = dragState.active.data.current;
334
+ var over = (_drag$over = drag.over) === null || _drag$over === void 0 ? void 0 : _drag$over.data.current;
335
+ if (!active || !over) return;
336
+ if (active.type === DRAGGABLE_TYPES.ITEM) {
337
+ onMoveItem === null || onMoveItem === void 0 ? void 0 : onMoveItem(active, over);
338
+ } else if (active.type === DRAGGABLE_TYPES.SECTION) {
339
+ onMoveSection === null || onMoveSection === void 0 ? void 0 : onMoveSection(active, over);
340
+ }
341
+ };
342
+ return /*#__PURE__*/jsxs(DndContext, {
343
+ onDragEnd: onDragEnd,
344
+ sensors: sensors,
345
+ collisionDetection: closestCenter(dragState),
346
+ measuring: measuringConfig,
347
+ onDragStart: setDragState,
348
+ children: [/*#__PURE__*/jsxs("div", {
349
+ ref: ref,
350
+ className: "flex w-full flex-1 overflow-x-auto p-3",
351
+ children: [/*#__PURE__*/jsx(SectionPlaceholder, {}), sections.map(function (section, index) {
352
+ return /*#__PURE__*/createElement(SectionContainer, {
353
+ index: index,
354
+ data: {
355
+ section: section
356
+ },
357
+ id: section.id,
358
+ key: section.id,
359
+ render: function render() {
360
+ return renderSection({
361
+ index: index,
362
+ section: section
363
+ });
364
+ }
365
+ });
366
+ })]
367
+ }), /*#__PURE__*/jsx(DndOverlay, {
368
+ props: props,
369
+ state: dragState
370
+ })]
371
+ });
372
+ });
373
+ BoardView.displayName = "BoardView";
374
+ BoardView.Section = Section;
375
+
376
+ export { BoardView as default };
377
+ //# sourceMappingURL=BoardView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BoardView.js","sources":["../src/components/BoardView/closestCenter.js","../src/components/BoardView/constants.js","../src/components/BoardView/Overlay.jsx","../src/components/BoardView/Indicator.jsx","../src/components/BoardView/Item/Container.jsx","../src/components/BoardView/Item/Placeholder.jsx","../src/components/BoardView/Section/index.jsx","../src/components/BoardView/Section/Container.jsx","../src/components/BoardView/Section/Placeholder.jsx","../src/components/BoardView/index.jsx"],"sourcesContent":["// Customised collision detection algorithm based on `closestCenter` implementation for dnd-kit\n// Extracts collisions by respecting `accepts` property\n\nconst distanceBetween = (p1, p2) =>\n Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));\n\nconst centerOfRectangle = (rect, left = rect.left, top = rect.top) => ({\n x: left + rect.width * 0.5,\n y: top + rect.height * 0.5,\n});\n\nconst matchType = (draggable, droppable) =>\n droppable.data.current.accepts.includes(draggable.data.current.type);\n\n// `active` attribute from the `dnd-kit` is unreliable since the data can be lost on unmount during a drag.\nexport const closestCenter =\n ({ active }) =>\n ({ collisionRect, droppableRects, droppableContainers }) => {\n const centerRect = centerOfRectangle(\n collisionRect,\n collisionRect.left,\n collisionRect.top\n );\n\n let minDistance = Number.POSITIVE_INFINITY;\n let collision = { id: undefined };\n\n // eslint-disable-next-line @bigbinary/neeto/use-array-methods\n for (const droppableContainer of droppableContainers) {\n const rect = droppableRects.get(droppableContainer.id);\n\n if (!rect || droppableContainer.id === active.id) continue;\n else if (!matchType(active, droppableContainer)) continue;\n\n const distance = distanceBetween(centerOfRectangle(rect), centerRect);\n if (distance < minDistance) {\n minDistance = distance;\n collision = {\n id: droppableContainer.id,\n data: { droppableContainer, value: distance },\n };\n }\n }\n\n return [collision];\n };\n","export const DRAGGABLE_TYPES = { SECTION: \"section\", ITEM: \"item\" };\n","import { DragOverlay } from \"@dnd-kit/core\";\n\nimport { DRAGGABLE_TYPES } from \"./constants\";\n\nconst DndOverlay = ({ props, state }) => {\n const { renderSectionOverlay, renderItemOverlay } = props;\n const data = state.active?.data.current || {};\n\n return (\n <DragOverlay>\n {data.type === DRAGGABLE_TYPES.ITEM && renderItemOverlay?.(data)}\n {data.type === DRAGGABLE_TYPES.SECTION && renderSectionOverlay?.(data)}\n </DragOverlay>\n );\n};\n\nexport default DndOverlay;\n","import classNames from \"classnames\";\n\nconst DndIndicator = ({ layout = \"vertical\" }) => (\n <div\n className={classNames(\n \"neeto-ui-rounded-xl neeto-ui-bg-accent-600 absolute\",\n {\n \"-bottom-3 left-0 right-0 h-1\": layout === \"horizontal\",\n \"-right-2 bottom-0 top-0 w-1\": layout === \"vertical\",\n }\n )}\n />\n);\n\nexport default DndIndicator;\n","import { useRef } from \"react\";\n\nimport { useDraggable, useDroppable } from \"@dnd-kit/core\";\nimport classNames from \"classnames\";\nimport { useInView } from \"react-intersection-observer\";\n\nimport { DRAGGABLE_TYPES } from \"../constants\";\nimport DndIndicator from \"../Indicator\";\n\nconst ItemContainer = ({ id, index, data, render }) => {\n const mutables = useRef({ containerHeight: 128 }).current;\n\n const {\n attributes,\n listeners,\n isDragging,\n setNodeRef: setDraggableNodeRef,\n } = useDraggable({\n data: { ...data, index, type: DRAGGABLE_TYPES.ITEM },\n id,\n });\n\n const { isOver, setNodeRef: setDroppableNodeRef } = useDroppable({\n data: { ...data, accepts: [DRAGGABLE_TYPES.ITEM], index: index + 1 },\n id,\n });\n\n const [setViewRef, inView] = useInView({\n onChange: (inView, entry) => {\n if (inView) return; // We need the last height value when elements moves out.\n mutables.containerHeight = entry.target.clientHeight;\n },\n });\n\n const isIndicatorVisible = !isDragging && isOver;\n\n return (\n <div\n className={classNames(\"relative mt-4\", {\n \"opacity-65\": isDragging,\n })}\n ref={node => {\n setDraggableNodeRef(node);\n setDroppableNodeRef(node);\n setViewRef(node);\n }}\n {...{ id, ...attributes, ...listeners }}\n style={{ height: inView ? undefined : mutables.containerHeight }}\n >\n {inView && render()}\n {isIndicatorVisible && <DndIndicator layout=\"horizontal\" />}\n </div>\n );\n};\n\nexport default ItemContainer;\n","import { useId } from \"react\";\n\nimport { useDroppable } from \"@dnd-kit/core\";\n\nimport { DRAGGABLE_TYPES } from \"../constants\";\nimport DndIndicator from \"../Indicator\";\n\nconst ItemPlaceholder = ({ data, index = 0 }) => {\n const id = useId();\n\n const { isOver, setNodeRef } = useDroppable({\n data: { ...data, accepts: [DRAGGABLE_TYPES.ITEM], index },\n id,\n });\n\n return (\n <div className=\"relative\" ref={setNodeRef}>\n {isOver && <DndIndicator layout=\"horizontal\" />}\n </div>\n );\n};\n\nexport default ItemPlaceholder;\n","import { forwardRef } from \"react\";\n\nimport PropTypes from \"prop-types\";\n\nimport ItemContainer from \"../Item/Container\";\nimport ItemPlaceholder from \"../Item/Placeholder\";\n\nconst Section = forwardRef(({ section, items, renderItem }, ref) => (\n <div {...{ ref }} className=\"relative min-h-0 flex-1 basis-0 overflow-auto\">\n <ItemPlaceholder data={{ section }} />\n {items.map((item, index) => (\n <ItemContainer\n {...{ index }}\n data={{ section, item }}\n id={item.id}\n key={item.id}\n render={() => renderItem({ index, item, section })}\n />\n ))}\n </div>\n));\n\nSection.displayName = \"Section\";\nSection.propTypes = {\n /** A reference to the section container element. */\n ref: PropTypes.any,\n\n /** The current section data */\n section: PropTypes.shape({ id: PropTypes.string.isRequired }).isRequired,\n\n /** An array of items belonging to the current section. */\n items: PropTypes.arrayOf(PropTypes.shape({ id: PropTypes.string.isRequired }))\n .isRequired,\n\n /** A function that renders the content of each item in the list. */\n renderItem: PropTypes.func.isRequired,\n};\n\nexport default Section;\n","import { useDraggable, useDroppable } from \"@dnd-kit/core\";\nimport classNames from \"classnames\";\nimport { useInView } from \"react-intersection-observer\";\n\nimport { DRAGGABLE_TYPES } from \"../constants\";\nimport DndIndicator from \"../Indicator\";\n\nconst SectionContainer = ({ id, index, data, render }) => {\n const [setViewRef, inView] = useInView();\n\n const {\n attributes,\n listeners,\n isDragging,\n setNodeRef: setDraggableNodeRef,\n } = useDraggable({\n data: { ...data, type: DRAGGABLE_TYPES.SECTION, index },\n id,\n });\n\n const { isOver, setNodeRef: setDroppableNodeRef } = useDroppable({\n data: { ...data, accepts: [DRAGGABLE_TYPES.SECTION], index: index + 1 },\n id,\n });\n\n const isIndicatorVisible = !isDragging && isOver;\n\n return (\n <div\n {...listeners}\n {...attributes}\n className={classNames(\n \"neeto-molecules-boardview-section relative ml-3 flex h-full flex-col\",\n { \"opacity-65\": isDragging }\n )}\n ref={node => {\n setDraggableNodeRef(node);\n setDroppableNodeRef(node);\n setViewRef(node);\n }}\n >\n {inView && render()}\n {isIndicatorVisible && <DndIndicator layout=\"vertical\" />}\n </div>\n );\n};\n\nexport default SectionContainer;\n","import { useId } from \"react\";\n\nimport { useDroppable } from \"@dnd-kit/core\";\n\nimport { DRAGGABLE_TYPES } from \"../constants\";\nimport DndIndicator from \"../Indicator\";\n\nconst SectionPlaceholder = ({ data, index = 0 }) => {\n const id = useId();\n\n const { isOver, setNodeRef } = useDroppable({\n data: { ...data, accepts: [DRAGGABLE_TYPES.SECTION], index },\n id,\n });\n\n return (\n <div className=\"relative\" ref={setNodeRef}>\n {isOver && <DndIndicator layout=\"vertical\" />}\n </div>\n );\n};\n\nexport default SectionPlaceholder;\n","import { forwardRef, useState } from \"react\";\n\nimport {\n DndContext,\n PointerSensor,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport PropTypes from \"prop-types\";\n\nimport \"./boardview.scss\";\nimport { closestCenter } from \"./closestCenter\";\nimport { DRAGGABLE_TYPES } from \"./constants\";\nimport DndOverlay from \"./Overlay\";\nimport Section from \"./Section\";\nimport SectionContainer from \"./Section/Container\";\nimport SectionPlaceholder from \"./Section/Placeholder\";\n\nconst sensorConfig = { activationConstraint: { distance: 8 } };\nconst measuringConfig = { droppable: { frequency: 500 } };\n\nconst BoardView = forwardRef((props, ref) => {\n const { sections, onMoveSection, onMoveItem, renderSection } = props;\n\n const [dragState, setDragState] = useState({});\n const sensors = useSensors(useSensor(PointerSensor, sensorConfig));\n\n const onDragEnd = drag => {\n const active = dragState.active.data.current;\n const over = drag.over?.data.current;\n if (!active || !over) return;\n\n if (active.type === DRAGGABLE_TYPES.ITEM) {\n onMoveItem?.(active, over);\n } else if (active.type === DRAGGABLE_TYPES.SECTION) {\n onMoveSection?.(active, over);\n }\n };\n\n return (\n <DndContext\n {...{ onDragEnd, sensors }}\n collisionDetection={closestCenter(dragState)}\n measuring={measuringConfig}\n onDragStart={setDragState}\n >\n <div {...{ ref }} className=\"flex w-full flex-1 overflow-x-auto p-3\">\n <SectionPlaceholder />\n {sections.map((section, index) => (\n <SectionContainer\n {...{ index }}\n data={{ section }}\n id={section.id}\n key={section.id}\n render={() => renderSection({ index, section })}\n />\n ))}\n </div>\n <DndOverlay {...{ props }} state={dragState} />\n </DndContext>\n );\n});\n\nBoardView.displayName = \"BoardView\";\nBoardView.Section = Section;\nBoardView.propTypes = {\n /** A reference to the container element. */\n ref: PropTypes.any,\n\n /**\n An array of sections, each defined by an object with an `id` string.\n */\n sections: PropTypes.arrayOf(\n PropTypes.shape({ id: PropTypes.string.isRequired })\n ).isRequired,\n\n /** function to render each section content in the board view */\n renderSection: PropTypes.func.isRequired,\n\n /** A function to render a drag overlay for individual sections (drag preview) */\n renderSectionOverlay: PropTypes.func.isRequired,\n\n /** A function to render a drag overlay for individual items (drag preview) */\n renderItemOverlay: PropTypes.func.isRequired,\n\n /** Callback function triggered when a section is reordered */\n onMoveSection: PropTypes.func,\n\n /** Callback function triggered when an item is moved */\n onMoveItem: PropTypes.func,\n};\n\nexport default BoardView;\n"],"names":["distanceBetween","p1","p2","Math","sqrt","pow","x","y","centerOfRectangle","rect","left","arguments","length","undefined","top","width","height","matchType","draggable","droppable","data","current","accepts","includes","type","closestCenter","_ref","active","_ref2","collisionRect","droppableRects","droppableContainers","centerRect","minDistance","Number","POSITIVE_INFINITY","collision","id","_iterator","_createForOfIteratorHelper","_step","s","n","done","droppableContainer","value","get","distance","err","e","f","DRAGGABLE_TYPES","SECTION","ITEM","DndOverlay","_state$active","props","state","renderSectionOverlay","renderItemOverlay","_jsxs","DragOverlay","children","DndIndicator","_ref$layout","layout","_jsx","className","classNames","ItemContainer","index","render","mutables","useRef","containerHeight","_useDraggable","useDraggable","_objectSpread","attributes","listeners","isDragging","setDraggableNodeRef","setNodeRef","_useDroppable","useDroppable","isOver","setDroppableNodeRef","_useInView","useInView","onChange","inView","entry","target","clientHeight","_useInView2","_slicedToArray","setViewRef","isIndicatorVisible","ref","node","style","ItemPlaceholder","_ref$index","useId","Section","forwardRef","section","items","renderItem","map","item","_createElement","key","displayName","propTypes","PropTypes","any","shape","string","isRequired","arrayOf","func","SectionContainer","SectionPlaceholder","sensorConfig","activationConstraint","measuringConfig","frequency","BoardView","sections","onMoveSection","onMoveItem","renderSection","_useState","useState","_useState2","dragState","setDragState","sensors","useSensors","useSensor","PointerSensor","onDragEnd","drag","_drag$over","over","DndContext","collisionDetection","measuring","onDragStart"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AACA;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,EAAE,EAAEC,EAAE,EAAA;AAAA,EAAA,OAC7BC,IAAI,CAACC,IAAI,CAACD,IAAI,CAACE,GAAG,CAACJ,EAAE,CAACK,CAAC,GAAGJ,EAAE,CAACI,CAAC,EAAE,CAAC,CAAC,GAAGH,IAAI,CAACE,GAAG,CAACJ,EAAE,CAACM,CAAC,GAAGL,EAAE,CAACK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAAA,CAAA,CAAA;AAEhE,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAIC,IAAI,EAAA;AAAA,EAAA,IAAEC,IAAI,GAAAC,SAAA,CAAAC,MAAA,GAAAD,CAAAA,IAAAA,SAAA,CAAAE,CAAAA,CAAAA,KAAAA,SAAA,GAAAF,SAAA,CAAGF,CAAAA,CAAAA,GAAAA,IAAI,CAACC,IAAI,CAAA;AAAA,EAAA,IAAEI,GAAG,GAAAH,SAAA,CAAAC,MAAA,GAAAD,CAAAA,IAAAA,SAAA,CAAAE,CAAAA,CAAAA,KAAAA,SAAA,GAAAF,SAAA,CAAGF,CAAAA,CAAAA,GAAAA,IAAI,CAACK,GAAG,CAAA;EAAA,OAAM;AACrER,IAAAA,CAAC,EAAEI,IAAI,GAAGD,IAAI,CAACM,KAAK,GAAG,GAAG;AAC1BR,IAAAA,CAAC,EAAEO,GAAG,GAAGL,IAAI,CAACO,MAAM,GAAG,GAAA;GACxB,CAAA;AAAA,CAAC,CAAA;AAEF,IAAMC,SAAS,GAAG,SAAZA,SAASA,CAAIC,SAAS,EAAEC,SAAS,EAA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W,gBAAgB,EAAA;AACTpD,UAAAA,KAAK,EAALA,KAAK;AACXlD,UAAAA,IAAI,EAAE;AAAEsF,YAAAA,OAAO,EAAPA,OAAAA;WAAU;UAClBrE,EAAE,EAAEqE,OAAO,CAACrE,EAAG;UACf2E,GAAG,EAAEN,OAAO,CAACrE,EAAG;UAChBkC,MAAM,EAAE,SAARA,MAAMA,GAAA;AAAA,YAAA,OAAQ6D,aAAa,CAAC;AAAE9D,cAAAA,KAAK,EAALA,KAAK;AAAEoC,cAAAA,OAAO,EAAPA,OAAAA;AAAQ,aAAC,CAAC,CAAA;AAAA,WAAA;AAAC,SACjD,CAAC,CAAA;AAAA,OACH,CAAC,CAAA;AAAA,KACC,CAAC,eACNxC,GAAA,CAACZ,UAAU,EAAA;AAAOE,MAAAA,KAAK,EAALA,KAAK;AAAIC,MAAAA,KAAK,EAAE+E,SAAAA;AAAU,KAAE,CAAC,CAAA;AAAA,GACrC,CAAC,CAAA;AAEjB,CAAC,EAAC;AAEFR,SAAS,CAACf,WAAW,GAAG,WAAW,CAAA;AACnCe,SAAS,CAACxB,OAAO,GAAGA,OAAO;;;;"}
@@ -0,0 +1,379 @@
1
+ 'use strict';
2
+
3
+ var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
4
+ var React = require('react');
5
+ var core = require('@dnd-kit/core');
6
+ var injectCss = require('./inject-css-vQvjPR2x.js');
7
+ var jsxRuntime = require('react/jsx-runtime');
8
+ var index = require('./index-JY2zVpnv.js');
9
+ var _defineProperty = require('@babel/runtime/helpers/defineProperty');
10
+ var classnames = require('classnames');
11
+ var reactIntersectionObserver = require('react-intersection-observer');
12
+ require('./_commonjsHelpers-BJu3ubxk.js');
13
+
14
+ var css = ".neeto-molecules-boardview-section{flex-shrink:0;width:320px}@media screen and (max-width:1024px){.neeto-molecules-boardview-section{width:300px}}@media screen and (max-width:768px){.neeto-molecules-boardview-section{width:280px}}";
15
+ injectCss.n(css,{});
16
+
17
+ function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
18
+ function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
19
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
20
+ // Customised collision detection algorithm based on `closestCenter` implementation for dnd-kit
21
+ // Extracts collisions by respecting `accepts` property
22
+
23
+ var distanceBetween = function distanceBetween(p1, p2) {
24
+ return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));
25
+ };
26
+ var centerOfRectangle = function centerOfRectangle(rect) {
27
+ var left = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : rect.left;
28
+ var top = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : rect.top;
29
+ return {
30
+ x: left + rect.width * 0.5,
31
+ y: top + rect.height * 0.5
32
+ };
33
+ };
34
+ var matchType = function matchType(draggable, droppable) {
35
+ return droppable.data.current.accepts.includes(draggable.data.current.type);
36
+ };
37
+
38
+ // `active` attribute from the `dnd-kit` is unreliable since the data can be lost on unmount during a drag.
39
+ var closestCenter = function closestCenter(_ref) {
40
+ var active = _ref.active;
41
+ return function (_ref2) {
42
+ var collisionRect = _ref2.collisionRect,
43
+ droppableRects = _ref2.droppableRects,
44
+ droppableContainers = _ref2.droppableContainers;
45
+ var centerRect = centerOfRectangle(collisionRect, collisionRect.left, collisionRect.top);
46
+ var minDistance = Number.POSITIVE_INFINITY;
47
+ var collision = {
48
+ id: undefined
49
+ };
50
+
51
+ // eslint-disable-next-line @bigbinary/neeto/use-array-methods
52
+ var _iterator = _createForOfIteratorHelper(droppableContainers),
53
+ _step;
54
+ try {
55
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
56
+ var droppableContainer = _step.value;
57
+ var rect = droppableRects.get(droppableContainer.id);
58
+ if (!rect || droppableContainer.id === active.id) continue;else if (!matchType(active, droppableContainer)) continue;
59
+ var distance = distanceBetween(centerOfRectangle(rect), centerRect);
60
+ if (distance < minDistance) {
61
+ minDistance = distance;
62
+ collision = {
63
+ id: droppableContainer.id,
64
+ data: {
65
+ droppableContainer: droppableContainer,
66
+ value: distance
67
+ }
68
+ };
69
+ }
70
+ }
71
+ } catch (err) {
72
+ _iterator.e(err);
73
+ } finally {
74
+ _iterator.f();
75
+ }
76
+ return [collision];
77
+ };
78
+ };
79
+
80
+ var DRAGGABLE_TYPES = {
81
+ SECTION: "section",
82
+ ITEM: "item"
83
+ };
84
+
85
+ var DndOverlay = function DndOverlay(_ref) {
86
+ var _state$active;
87
+ var props = _ref.props,
88
+ state = _ref.state;
89
+ var renderSectionOverlay = props.renderSectionOverlay,
90
+ renderItemOverlay = props.renderItemOverlay;
91
+ var data = ((_state$active = state.active) === null || _state$active === void 0 ? void 0 : _state$active.data.current) || {};
92
+ return /*#__PURE__*/jsxRuntime.jsxs(core.DragOverlay, {
93
+ children: [data.type === DRAGGABLE_TYPES.ITEM && (renderItemOverlay === null || renderItemOverlay === void 0 ? void 0 : renderItemOverlay(data)), data.type === DRAGGABLE_TYPES.SECTION && (renderSectionOverlay === null || renderSectionOverlay === void 0 ? void 0 : renderSectionOverlay(data))]
94
+ });
95
+ };
96
+
97
+ var DndIndicator = function DndIndicator(_ref) {
98
+ var _ref$layout = _ref.layout,
99
+ layout = _ref$layout === void 0 ? "vertical" : _ref$layout;
100
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
101
+ className: classnames("neeto-ui-rounded-xl neeto-ui-bg-accent-600 absolute", {
102
+ "-bottom-3 left-0 right-0 h-1": layout === "horizontal",
103
+ "-right-2 bottom-0 top-0 w-1": layout === "vertical"
104
+ })
105
+ });
106
+ };
107
+
108
+ function ownKeys$3(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; }
109
+ function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
110
+ var ItemContainer = function ItemContainer(_ref) {
111
+ var id = _ref.id,
112
+ index = _ref.index,
113
+ data = _ref.data,
114
+ render = _ref.render;
115
+ var mutables = React.useRef({
116
+ containerHeight: 128
117
+ }).current;
118
+ var _useDraggable = core.useDraggable({
119
+ data: _objectSpread$3(_objectSpread$3({}, data), {}, {
120
+ index: index,
121
+ type: DRAGGABLE_TYPES.ITEM
122
+ }),
123
+ id: id
124
+ }),
125
+ attributes = _useDraggable.attributes,
126
+ listeners = _useDraggable.listeners,
127
+ isDragging = _useDraggable.isDragging,
128
+ setDraggableNodeRef = _useDraggable.setNodeRef;
129
+ var _useDroppable = core.useDroppable({
130
+ data: _objectSpread$3(_objectSpread$3({}, data), {}, {
131
+ accepts: [DRAGGABLE_TYPES.ITEM],
132
+ index: index + 1
133
+ }),
134
+ id: id
135
+ }),
136
+ isOver = _useDroppable.isOver,
137
+ setDroppableNodeRef = _useDroppable.setNodeRef;
138
+ var _useInView = reactIntersectionObserver.useInView({
139
+ onChange: function onChange(inView, entry) {
140
+ if (inView) return; // We need the last height value when elements moves out.
141
+ mutables.containerHeight = entry.target.clientHeight;
142
+ }
143
+ }),
144
+ _useInView2 = _slicedToArray(_useInView, 2),
145
+ setViewRef = _useInView2[0],
146
+ inView = _useInView2[1];
147
+ var isIndicatorVisible = !isDragging && isOver;
148
+ return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread$3(_objectSpread$3({
149
+ className: classnames("relative mt-4", {
150
+ "opacity-65": isDragging
151
+ }),
152
+ ref: function ref(node) {
153
+ setDraggableNodeRef(node);
154
+ setDroppableNodeRef(node);
155
+ setViewRef(node);
156
+ }
157
+ }, _objectSpread$3(_objectSpread$3({
158
+ id: id
159
+ }, attributes), listeners)), {}, {
160
+ style: {
161
+ height: inView ? undefined : mutables.containerHeight
162
+ },
163
+ children: [inView && render(), isIndicatorVisible && /*#__PURE__*/jsxRuntime.jsx(DndIndicator, {
164
+ layout: "horizontal"
165
+ })]
166
+ }));
167
+ };
168
+
169
+ function ownKeys$2(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; }
170
+ function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
171
+ var ItemPlaceholder = function ItemPlaceholder(_ref) {
172
+ var data = _ref.data,
173
+ _ref$index = _ref.index,
174
+ index = _ref$index === void 0 ? 0 : _ref$index;
175
+ var id = React.useId();
176
+ var _useDroppable = core.useDroppable({
177
+ data: _objectSpread$2(_objectSpread$2({}, data), {}, {
178
+ accepts: [DRAGGABLE_TYPES.ITEM],
179
+ index: index
180
+ }),
181
+ id: id
182
+ }),
183
+ isOver = _useDroppable.isOver,
184
+ setNodeRef = _useDroppable.setNodeRef;
185
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
186
+ className: "relative",
187
+ ref: setNodeRef,
188
+ children: isOver && /*#__PURE__*/jsxRuntime.jsx(DndIndicator, {
189
+ layout: "horizontal"
190
+ })
191
+ });
192
+ };
193
+
194
+ var Section = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
195
+ var section = _ref.section,
196
+ items = _ref.items,
197
+ renderItem = _ref.renderItem;
198
+ return /*#__PURE__*/jsxRuntime.jsxs("div", {
199
+ ref: ref,
200
+ className: "relative min-h-0 flex-1 basis-0 overflow-auto",
201
+ children: [/*#__PURE__*/jsxRuntime.jsx(ItemPlaceholder, {
202
+ data: {
203
+ section: section
204
+ }
205
+ }), items.map(function (item, index) {
206
+ return /*#__PURE__*/React.createElement(ItemContainer, {
207
+ index: index,
208
+ data: {
209
+ section: section,
210
+ item: item
211
+ },
212
+ id: item.id,
213
+ key: item.id,
214
+ render: function render() {
215
+ return renderItem({
216
+ index: index,
217
+ item: item,
218
+ section: section
219
+ });
220
+ }
221
+ });
222
+ })]
223
+ });
224
+ });
225
+ Section.displayName = "Section";
226
+ Section.propTypes = {
227
+ /** A reference to the section container element. */
228
+ ref: index.PropTypes.any,
229
+ /** The current section data */
230
+ section: index.PropTypes.shape({
231
+ id: index.PropTypes.string.isRequired
232
+ }).isRequired,
233
+ /** An array of items belonging to the current section. */
234
+ items: index.PropTypes.arrayOf(index.PropTypes.shape({
235
+ id: index.PropTypes.string.isRequired
236
+ })).isRequired,
237
+ /** A function that renders the content of each item in the list. */
238
+ renderItem: index.PropTypes.func.isRequired
239
+ };
240
+
241
+ function ownKeys$1(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; }
242
+ function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
243
+ var SectionContainer = function SectionContainer(_ref) {
244
+ var id = _ref.id,
245
+ index = _ref.index,
246
+ data = _ref.data,
247
+ render = _ref.render;
248
+ var _useInView = reactIntersectionObserver.useInView(),
249
+ _useInView2 = _slicedToArray(_useInView, 2),
250
+ setViewRef = _useInView2[0],
251
+ inView = _useInView2[1];
252
+ var _useDraggable = core.useDraggable({
253
+ data: _objectSpread$1(_objectSpread$1({}, data), {}, {
254
+ type: DRAGGABLE_TYPES.SECTION,
255
+ index: index
256
+ }),
257
+ id: id
258
+ }),
259
+ attributes = _useDraggable.attributes,
260
+ listeners = _useDraggable.listeners,
261
+ isDragging = _useDraggable.isDragging,
262
+ setDraggableNodeRef = _useDraggable.setNodeRef;
263
+ var _useDroppable = core.useDroppable({
264
+ data: _objectSpread$1(_objectSpread$1({}, data), {}, {
265
+ accepts: [DRAGGABLE_TYPES.SECTION],
266
+ index: index + 1
267
+ }),
268
+ id: id
269
+ }),
270
+ isOver = _useDroppable.isOver,
271
+ setDroppableNodeRef = _useDroppable.setNodeRef;
272
+ var isIndicatorVisible = !isDragging && isOver;
273
+ return /*#__PURE__*/jsxRuntime.jsxs("div", _objectSpread$1(_objectSpread$1(_objectSpread$1({}, listeners), attributes), {}, {
274
+ className: classnames("neeto-molecules-boardview-section relative ml-3 flex h-full flex-col", {
275
+ "opacity-65": isDragging
276
+ }),
277
+ ref: function ref(node) {
278
+ setDraggableNodeRef(node);
279
+ setDroppableNodeRef(node);
280
+ setViewRef(node);
281
+ },
282
+ children: [inView && render(), isIndicatorVisible && /*#__PURE__*/jsxRuntime.jsx(DndIndicator, {
283
+ layout: "vertical"
284
+ })]
285
+ }));
286
+ };
287
+
288
+ 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; }
289
+ 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; }
290
+ var SectionPlaceholder = function SectionPlaceholder(_ref) {
291
+ var data = _ref.data,
292
+ _ref$index = _ref.index,
293
+ index = _ref$index === void 0 ? 0 : _ref$index;
294
+ var id = React.useId();
295
+ var _useDroppable = core.useDroppable({
296
+ data: _objectSpread(_objectSpread({}, data), {}, {
297
+ accepts: [DRAGGABLE_TYPES.SECTION],
298
+ index: index
299
+ }),
300
+ id: id
301
+ }),
302
+ isOver = _useDroppable.isOver,
303
+ setNodeRef = _useDroppable.setNodeRef;
304
+ return /*#__PURE__*/jsxRuntime.jsx("div", {
305
+ className: "relative",
306
+ ref: setNodeRef,
307
+ children: isOver && /*#__PURE__*/jsxRuntime.jsx(DndIndicator, {
308
+ layout: "vertical"
309
+ })
310
+ });
311
+ };
312
+
313
+ var sensorConfig = {
314
+ activationConstraint: {
315
+ distance: 8
316
+ }
317
+ };
318
+ var measuringConfig = {
319
+ droppable: {
320
+ frequency: 500
321
+ }
322
+ };
323
+ var BoardView = /*#__PURE__*/React.forwardRef(function (props, ref) {
324
+ var sections = props.sections,
325
+ onMoveSection = props.onMoveSection,
326
+ onMoveItem = props.onMoveItem,
327
+ renderSection = props.renderSection;
328
+ var _useState = React.useState({}),
329
+ _useState2 = _slicedToArray(_useState, 2),
330
+ dragState = _useState2[0],
331
+ setDragState = _useState2[1];
332
+ var sensors = core.useSensors(core.useSensor(core.PointerSensor, sensorConfig));
333
+ var onDragEnd = function onDragEnd(drag) {
334
+ var _drag$over;
335
+ var active = dragState.active.data.current;
336
+ var over = (_drag$over = drag.over) === null || _drag$over === void 0 ? void 0 : _drag$over.data.current;
337
+ if (!active || !over) return;
338
+ if (active.type === DRAGGABLE_TYPES.ITEM) {
339
+ onMoveItem === null || onMoveItem === void 0 ? void 0 : onMoveItem(active, over);
340
+ } else if (active.type === DRAGGABLE_TYPES.SECTION) {
341
+ onMoveSection === null || onMoveSection === void 0 ? void 0 : onMoveSection(active, over);
342
+ }
343
+ };
344
+ return /*#__PURE__*/jsxRuntime.jsxs(core.DndContext, {
345
+ onDragEnd: onDragEnd,
346
+ sensors: sensors,
347
+ collisionDetection: closestCenter(dragState),
348
+ measuring: measuringConfig,
349
+ onDragStart: setDragState,
350
+ children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
351
+ ref: ref,
352
+ className: "flex w-full flex-1 overflow-x-auto p-3",
353
+ children: [/*#__PURE__*/jsxRuntime.jsx(SectionPlaceholder, {}), sections.map(function (section, index) {
354
+ return /*#__PURE__*/React.createElement(SectionContainer, {
355
+ index: index,
356
+ data: {
357
+ section: section
358
+ },
359
+ id: section.id,
360
+ key: section.id,
361
+ render: function render() {
362
+ return renderSection({
363
+ index: index,
364
+ section: section
365
+ });
366
+ }
367
+ });
368
+ })]
369
+ }), /*#__PURE__*/jsxRuntime.jsx(DndOverlay, {
370
+ props: props,
371
+ state: dragState
372
+ })]
373
+ });
374
+ });
375
+ BoardView.displayName = "BoardView";
376
+ BoardView.Section = Section;
377
+
378
+ module.exports = BoardView;
379
+ //# sourceMappingURL=BoardView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BoardView.js","sources":["../../src/components/BoardView/closestCenter.js","../../src/components/BoardView/constants.js","../../src/components/BoardView/Overlay.jsx","../../src/components/BoardView/Indicator.jsx","../../src/components/BoardView/Item/Container.jsx","../../src/components/BoardView/Item/Placeholder.jsx","../../src/components/BoardView/Section/index.jsx","../../src/components/BoardView/Section/Container.jsx","../../src/components/BoardView/Section/Placeholder.jsx","../../src/components/BoardView/index.jsx"],"sourcesContent":["// Customised collision detection algorithm based on `closestCenter` implementation for dnd-kit\n// Extracts collisions by respecting `accepts` property\n\nconst distanceBetween = (p1, p2) =>\n Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));\n\nconst centerOfRectangle = (rect, left = rect.left, top = rect.top) => ({\n x: left + rect.width * 0.5,\n y: top + rect.height * 0.5,\n});\n\nconst matchType = (draggable, droppable) =>\n droppable.data.current.accepts.includes(draggable.data.current.type);\n\n// `active` attribute from the `dnd-kit` is unreliable since the data can be lost on unmount during a drag.\nexport const closestCenter =\n ({ active }) =>\n ({ collisionRect, droppableRects, droppableContainers }) => {\n const centerRect = centerOfRectangle(\n collisionRect,\n collisionRect.left,\n collisionRect.top\n );\n\n let minDistance = Number.POSITIVE_INFINITY;\n let collision = { id: undefined };\n\n // eslint-disable-next-line @bigbinary/neeto/use-array-methods\n for (const droppableContainer of droppableContainers) {\n const rect = droppableRects.get(droppableContainer.id);\n\n if (!rect || droppableContainer.id === active.id) continue;\n else if (!matchType(active, droppableContainer)) continue;\n\n const distance = distanceBetween(centerOfRectangle(rect), centerRect);\n if (distance < minDistance) {\n minDistance = distance;\n collision = {\n id: droppableContainer.id,\n data: { droppableContainer, value: distance },\n };\n }\n }\n\n return [collision];\n };\n","export const DRAGGABLE_TYPES = { SECTION: \"section\", ITEM: \"item\" };\n","import { DragOverlay } from \"@dnd-kit/core\";\n\nimport { DRAGGABLE_TYPES } from \"./constants\";\n\nconst DndOverlay = ({ props, state }) => {\n const { renderSectionOverlay, renderItemOverlay } = props;\n const data = state.active?.data.current || {};\n\n return (\n <DragOverlay>\n {data.type === DRAGGABLE_TYPES.ITEM && renderItemOverlay?.(data)}\n {data.type === DRAGGABLE_TYPES.SECTION && renderSectionOverlay?.(data)}\n </DragOverlay>\n );\n};\n\nexport default DndOverlay;\n","import classNames from \"classnames\";\n\nconst DndIndicator = ({ layout = \"vertical\" }) => (\n <div\n className={classNames(\n \"neeto-ui-rounded-xl neeto-ui-bg-accent-600 absolute\",\n {\n \"-bottom-3 left-0 right-0 h-1\": layout === \"horizontal\",\n \"-right-2 bottom-0 top-0 w-1\": layout === \"vertical\",\n }\n )}\n />\n);\n\nexport default DndIndicator;\n","import { useRef } from \"react\";\n\nimport { useDraggable, useDroppable } from \"@dnd-kit/core\";\nimport classNames from \"classnames\";\nimport { useInView } from \"react-intersection-observer\";\n\nimport { DRAGGABLE_TYPES } from \"../constants\";\nimport DndIndicator from \"../Indicator\";\n\nconst ItemContainer = ({ id, index, data, render }) => {\n const mutables = useRef({ containerHeight: 128 }).current;\n\n const {\n attributes,\n listeners,\n isDragging,\n setNodeRef: setDraggableNodeRef,\n } = useDraggable({\n data: { ...data, index, type: DRAGGABLE_TYPES.ITEM },\n id,\n });\n\n const { isOver, setNodeRef: setDroppableNodeRef } = useDroppable({\n data: { ...data, accepts: [DRAGGABLE_TYPES.ITEM], index: index + 1 },\n id,\n });\n\n const [setViewRef, inView] = useInView({\n onChange: (inView, entry) => {\n if (inView) return; // We need the last height value when elements moves out.\n mutables.containerHeight = entry.target.clientHeight;\n },\n });\n\n const isIndicatorVisible = !isDragging && isOver;\n\n return (\n <div\n className={classNames(\"relative mt-4\", {\n \"opacity-65\": isDragging,\n })}\n ref={node => {\n setDraggableNodeRef(node);\n setDroppableNodeRef(node);\n setViewRef(node);\n }}\n {...{ id, ...attributes, ...listeners }}\n style={{ height: inView ? undefined : mutables.containerHeight }}\n >\n {inView && render()}\n {isIndicatorVisible && <DndIndicator layout=\"horizontal\" />}\n </div>\n );\n};\n\nexport default ItemContainer;\n","import { useId } from \"react\";\n\nimport { useDroppable } from \"@dnd-kit/core\";\n\nimport { DRAGGABLE_TYPES } from \"../constants\";\nimport DndIndicator from \"../Indicator\";\n\nconst ItemPlaceholder = ({ data, index = 0 }) => {\n const id = useId();\n\n const { isOver, setNodeRef } = useDroppable({\n data: { ...data, accepts: [DRAGGABLE_TYPES.ITEM], index },\n id,\n });\n\n return (\n <div className=\"relative\" ref={setNodeRef}>\n {isOver && <DndIndicator layout=\"horizontal\" />}\n </div>\n );\n};\n\nexport default ItemPlaceholder;\n","import { forwardRef } from \"react\";\n\nimport PropTypes from \"prop-types\";\n\nimport ItemContainer from \"../Item/Container\";\nimport ItemPlaceholder from \"../Item/Placeholder\";\n\nconst Section = forwardRef(({ section, items, renderItem }, ref) => (\n <div {...{ ref }} className=\"relative min-h-0 flex-1 basis-0 overflow-auto\">\n <ItemPlaceholder data={{ section }} />\n {items.map((item, index) => (\n <ItemContainer\n {...{ index }}\n data={{ section, item }}\n id={item.id}\n key={item.id}\n render={() => renderItem({ index, item, section })}\n />\n ))}\n </div>\n));\n\nSection.displayName = \"Section\";\nSection.propTypes = {\n /** A reference to the section container element. */\n ref: PropTypes.any,\n\n /** The current section data */\n section: PropTypes.shape({ id: PropTypes.string.isRequired }).isRequired,\n\n /** An array of items belonging to the current section. */\n items: PropTypes.arrayOf(PropTypes.shape({ id: PropTypes.string.isRequired }))\n .isRequired,\n\n /** A function that renders the content of each item in the list. */\n renderItem: PropTypes.func.isRequired,\n};\n\nexport default Section;\n","import { useDraggable, useDroppable } from \"@dnd-kit/core\";\nimport classNames from \"classnames\";\nimport { useInView } from \"react-intersection-observer\";\n\nimport { DRAGGABLE_TYPES } from \"../constants\";\nimport DndIndicator from \"../Indicator\";\n\nconst SectionContainer = ({ id, index, data, render }) => {\n const [setViewRef, inView] = useInView();\n\n const {\n attributes,\n listeners,\n isDragging,\n setNodeRef: setDraggableNodeRef,\n } = useDraggable({\n data: { ...data, type: DRAGGABLE_TYPES.SECTION, index },\n id,\n });\n\n const { isOver, setNodeRef: setDroppableNodeRef } = useDroppable({\n data: { ...data, accepts: [DRAGGABLE_TYPES.SECTION], index: index + 1 },\n id,\n });\n\n const isIndicatorVisible = !isDragging && isOver;\n\n return (\n <div\n {...listeners}\n {...attributes}\n className={classNames(\n \"neeto-molecules-boardview-section relative ml-3 flex h-full flex-col\",\n { \"opacity-65\": isDragging }\n )}\n ref={node => {\n setDraggableNodeRef(node);\n setDroppableNodeRef(node);\n setViewRef(node);\n }}\n >\n {inView && render()}\n {isIndicatorVisible && <DndIndicator layout=\"vertical\" />}\n </div>\n );\n};\n\nexport default SectionContainer;\n","import { useId } from \"react\";\n\nimport { useDroppable } from \"@dnd-kit/core\";\n\nimport { DRAGGABLE_TYPES } from \"../constants\";\nimport DndIndicator from \"../Indicator\";\n\nconst SectionPlaceholder = ({ data, index = 0 }) => {\n const id = useId();\n\n const { isOver, setNodeRef } = useDroppable({\n data: { ...data, accepts: [DRAGGABLE_TYPES.SECTION], index },\n id,\n });\n\n return (\n <div className=\"relative\" ref={setNodeRef}>\n {isOver && <DndIndicator layout=\"vertical\" />}\n </div>\n );\n};\n\nexport default SectionPlaceholder;\n","import { forwardRef, useState } from \"react\";\n\nimport {\n DndContext,\n PointerSensor,\n useSensor,\n useSensors,\n} from \"@dnd-kit/core\";\nimport PropTypes from \"prop-types\";\n\nimport \"./boardview.scss\";\nimport { closestCenter } from \"./closestCenter\";\nimport { DRAGGABLE_TYPES } from \"./constants\";\nimport DndOverlay from \"./Overlay\";\nimport Section from \"./Section\";\nimport SectionContainer from \"./Section/Container\";\nimport SectionPlaceholder from \"./Section/Placeholder\";\n\nconst sensorConfig = { activationConstraint: { distance: 8 } };\nconst measuringConfig = { droppable: { frequency: 500 } };\n\nconst BoardView = forwardRef((props, ref) => {\n const { sections, onMoveSection, onMoveItem, renderSection } = props;\n\n const [dragState, setDragState] = useState({});\n const sensors = useSensors(useSensor(PointerSensor, sensorConfig));\n\n const onDragEnd = drag => {\n const active = dragState.active.data.current;\n const over = drag.over?.data.current;\n if (!active || !over) return;\n\n if (active.type === DRAGGABLE_TYPES.ITEM) {\n onMoveItem?.(active, over);\n } else if (active.type === DRAGGABLE_TYPES.SECTION) {\n onMoveSection?.(active, over);\n }\n };\n\n return (\n <DndContext\n {...{ onDragEnd, sensors }}\n collisionDetection={closestCenter(dragState)}\n measuring={measuringConfig}\n onDragStart={setDragState}\n >\n <div {...{ ref }} className=\"flex w-full flex-1 overflow-x-auto p-3\">\n <SectionPlaceholder />\n {sections.map((section, index) => (\n <SectionContainer\n {...{ index }}\n data={{ section }}\n id={section.id}\n key={section.id}\n render={() => renderSection({ index, section })}\n />\n ))}\n </div>\n <DndOverlay {...{ props }} state={dragState} />\n </DndContext>\n );\n});\n\nBoardView.displayName = \"BoardView\";\nBoardView.Section = Section;\nBoardView.propTypes = {\n /** A reference to the container element. */\n ref: PropTypes.any,\n\n /**\n An array of sections, each defined by an object with an `id` string.\n */\n sections: PropTypes.arrayOf(\n PropTypes.shape({ id: PropTypes.string.isRequired })\n ).isRequired,\n\n /** function to render each section content in the board view */\n renderSection: PropTypes.func.isRequired,\n\n /** A function to render a drag overlay for individual sections (drag preview) */\n renderSectionOverlay: PropTypes.func.isRequired,\n\n /** A function to render a drag overlay for individual items (drag preview) */\n renderItemOverlay: PropTypes.func.isRequired,\n\n /** Callback function triggered when a section is reordered */\n onMoveSection: PropTypes.func,\n\n /** Callback function triggered when an item is moved */\n onMoveItem: PropTypes.func,\n};\n\nexport default BoardView;\n"],"names":["distanceBetween","p1","p2","Math","sqrt","pow","x","y","centerOfRectangle","rect","left","arguments","length","undefined","top","width","height","matchType","draggable","droppable","data","current","accepts","includes","type","closestCenter","_ref","active","_ref2","collisionRect","droppableRects","droppableContainers","centerRect","minDistance","Number","POSITIVE_INFINITY","collision","id","_iterator","_createForOfIteratorHelper","_step","s","n","done","droppableContainer","value","get","distance","err","e","f","DRAGGABLE_TYPES","SECTION","ITEM","DndOverlay","_state$active","props","state","renderSectionOverlay","renderItemOverlay","_jsxs","DragOverlay","children","DndIndicator","_ref$layout","layout","_jsx","className","classNames","ItemContainer","index","render","mutables","useRef","containerHeight","_useDraggable","useDraggable","_objectSpread","attributes","listeners","isDragging","setDraggableNodeRef","setNodeRef","_useDroppable","useDroppable","isOver","setDroppableNodeRef","_useInView","useInView","onChange","inView","entry","target","clientHeight","_useInView2","_slicedToArray","setViewRef","isIndicatorVisible","ref","node","style","ItemPlaceholder","_ref$index","useId","Section","forwardRef","section","items","renderItem","map","item","_createElement","key","displayName","propTypes","PropTypes","any","shape","string","isRequired","arrayOf","func","SectionContainer","SectionPlaceholder","sensorConfig","activationConstraint","measuringConfig","frequency","BoardView","sections","onMoveSection","onMoveItem","renderSection","_useState","useState","_useState2","dragState","setDragState","sensors","useSensors","useSensor","PointerSensor","onDragEnd","drag","_drag$over","over","DndContext","collisionDetection","measuring","onDragStart"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;AACA;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,EAAE,EAAEC,EAAE,EAAA;AAAA,EAAA,OAC7BC,IAAI,CAACC,IAAI,CAACD,IAAI,CAACE,GAAG,CAACJ,EAAE,CAACK,CAAC,GAAGJ,EAAE,CAACI,CAAC,EAAE,CAAC,CAAC,GAAGH,IAAI,CAACE,GAAG,CAACJ,EAAE,CAACM,CAAC,GAAGL,EAAE,CAACK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;AAAA,CAAA,CAAA;AAEhE,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAIC,IAAI,EAAA;AAAA,EAAA,IAAEC,IAAI,GAAAC,SAAA,CAAAC,MAAA,GAAAD,CAAAA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S,CAACxB,OAAO,GAAGA,OAAO;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bigbinary/neeto-molecules",
3
- "version": "3.11.2",
3
+ "version": "3.12.0",
4
4
  "description": "A package of reusable molecular components for neeto products.",
5
5
  "repository": "git@github.com:bigbinary/neeto-molecules.git",
6
6
  "author": "Amaljith K <amaljith.k@bigbinary.com>",
@@ -62,6 +62,7 @@
62
62
  "@bigbinary/neeto-team-members-frontend": "4.0.0",
63
63
  "@bigbinary/neeto-time-zones": "0.5.5",
64
64
  "@bigbinary/neetoui": "8.2.13",
65
+ "@dnd-kit/core": "^6.2.0",
65
66
  "@faker-js/faker": "8.2.0",
66
67
  "@fullcalendar/core": "^6.1.8",
67
68
  "@fullcalendar/daygrid": "^6.1.8",
@@ -169,6 +170,7 @@
169
170
  "react-dropzone": "14.2.3",
170
171
  "react-helmet": "^6.1.0",
171
172
  "react-i18next": "12.3.1",
173
+ "react-intersection-observer": "^9.13.1",
172
174
  "react-live": "^4.1.7",
173
175
  "react-monaco-editor": "^0.56.0",
174
176
  "react-resizable": "3.0.4",
@@ -211,6 +213,7 @@
211
213
  "@bigbinary/neeto-team-members-frontend": "4.0.0",
212
214
  "@bigbinary/neeto-time-zones": "0.5.5",
213
215
  "@bigbinary/neetoui": "8.2.13",
216
+ "@dnd-kit/core": "^6.2.0",
214
217
  "@fullcalendar/core": "^6.1.8",
215
218
  "@fullcalendar/daygrid": "^6.1.8",
216
219
  "@fullcalendar/interaction": "^6.1.8",
@@ -246,6 +249,7 @@
246
249
  "react-dropzone": "14.2.3",
247
250
  "react-helmet": "^6.1.0",
248
251
  "react-i18next": "12.3.1",
252
+ "react-intersection-observer": "^9.13.1",
249
253
  "react-resizable": "3.0.4",
250
254
  "react-router-dom": "5.3.3",
251
255
  "react-syntax-highlighter": "^15.5.0",
@@ -0,0 +1,148 @@
1
+ type SectionData = {
2
+ id: string;
3
+ };
4
+ type ItemData = {
5
+ id: string;
6
+ };
7
+ type SectionArgs = {
8
+ section: SectionData;
9
+ index: number;
10
+ };
11
+ type ItemArgs = {
12
+ Item: ItemData;
13
+ section: SectionData;
14
+ index: number;
15
+ };
16
+ /**
17
+ *
18
+ * The BoardView component renders a Kanban board with draggable sections and
19
+ *
20
+ * cards. It supports bi-directional auto-scrolling and lazy loading for improved
21
+ *
22
+ * performance.
23
+ *
24
+ * The main container component for the Kanban board, which wraps all sections.
25
+ *
26
+ * A component used within the BoardView to render individual sections.
27
+ *
28
+ * @example
29
+ *
30
+ * import BoardView from "neetomolecules/BoardView";
31
+ *
32
+ * // custom Item component
33
+ * const Item = ({ item }) => (
34
+ * <div className=" neeto-ui-bg-white neeto-ui-rounded-sm flex min-h-10 items-center justify-center">
35
+ * <h5>Item {item.name}</h5>
36
+ * </div>
37
+ * );
38
+ *
39
+ * // custom Section component.
40
+ * const Section = ({ section }) => (
41
+ * <div className="neeto-ui-bg-gray-300 neeto-ui-rounded-sm p-4">
42
+ * <h4 className="text-center">Section {section.name}</h4>
43
+ * <BoardView.Section
44
+ * {...{ section }}
45
+ * items={section.items}
46
+ * renderItem={({ item }) => <Item {...{ item }} />}
47
+ * />
48
+ * </div>
49
+ * );
50
+ *
51
+ * const Main = () => {
52
+ * const [sections, setSections] = useState([
53
+ * {
54
+ * id: "s1",
55
+ * name: "S1",
56
+ * items: [
57
+ * { id: "s1t1", name: "S1T1" },
58
+ * { id: "s1t2", name: "S1T2" },
59
+ * { id: "s1t3", name: "S1T3" },
60
+ * ],
61
+ * },
62
+ * {
63
+ * id: "s2",
64
+ * name: "S2",
65
+ * items: [
66
+ * { id: "s2t1", name: "S2T1" },
67
+ * { id: "s2t2", name: "S2T2" },
68
+ * { id: "s2t3", name: "S2T3" },
69
+ * ],
70
+ * },
71
+ * {
72
+ * id: "s3",
73
+ * name: "S3",
74
+ * items: [
75
+ * { id: "s3t1", name: "S3T1" },
76
+ * { id: "s3t2", name: "S3T2" },
77
+ * { id: "s3t3", name: "S3T3" },
78
+ * ],
79
+ * },
80
+ * ]);
81
+ *
82
+ * const onMoveSection = (source, destination) => {
83
+ * setSections(([...sections]) => {
84
+ * // destination index may change after removal of source section from list.
85
+ * const destinationIndex =
86
+ * source.index >= destination.index
87
+ * ? destination.index
88
+ * : destination.index - 1;
89
+ *
90
+ * const [section] = sections.splice(source.index, 1);
91
+ * sections.splice(destinationIndex, 0, section);
92
+ *
93
+ * return sections;
94
+ * });
95
+ * };
96
+ *
97
+ * const onMoveItem = (source, destination) => {
98
+ * setSections(([...sections]) => {
99
+ * // destination index may change after removal of item if same section.
100
+ * const destinationIndex =
101
+ * source.section.id === destination.section.id &&
102
+ * source.index >= destination.index
103
+ * ? destination.index - 1
104
+ * : destination.index;
105
+ *
106
+ * sections.forEach(section => {
107
+ * if (section.id === source.section.id) {
108
+ * section.items.splice(source.index, 1);
109
+ * }
110
+ *
111
+ * if (section.id === destination.section.id) {
112
+ * section.items.splice(destinationIndex, 0, source.item);
113
+ * }
114
+ * });
115
+ *
116
+ * return sections;
117
+ * });
118
+ * };
119
+ *
120
+ * return (
121
+ * <BoardView
122
+ * {...{ onMoveItem, onMoveSection, sections }}
123
+ * renderItemOverlay={({ item }) => <Item {...{ item }} />}
124
+ * renderSection={({ section }) => <Section {...{ section }} />}
125
+ * renderSectionOverlay={({ section }) => <Section {...{ section }} />}
126
+ * />
127
+ * );
128
+ * };
129
+ * @endexample
130
+ */
131
+ declare const BoardView: React.FC<{
132
+ ref?: React.Ref<HTMLDivElement>;
133
+ sections: SectionData[];
134
+ renderSection: (args: SectionArgs) => React.ReactNode;
135
+ renderSectionOverlay: (args: SectionArgs) => React.ReactNode;
136
+ renderItemOverlay: (args: ItemArgs) => React.ReactNode;
137
+ onMoveSection?: (source: SectionArgs, destination: SectionArgs) => void;
138
+ onMoveItem?: (source: ItemArgs, destination: ItemArgs) => void;
139
+ }> & {
140
+ Section: React.FC<{
141
+ ref?: React.Ref<HTMLDivElement>;
142
+ section: SectionData;
143
+ items: ItemData[];
144
+ renderItem: (args: ItemArgs) => React.ReactNode;
145
+ }>;
146
+ };
147
+
148
+ export { BoardView as default };