@gravity-ui/dashkit 10.4.4 → 10.5.1

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 (49) hide show
  1. package/README.md +3 -1
  2. package/build/cjs/components/ActionPanel/ActionPanel.css +53 -24
  3. package/build/cjs/components/ActionPanel/ActionPanel.js +27 -1
  4. package/build/cjs/components/ActionPanel/ActionPanel.js.map +1 -1
  5. package/build/cjs/components/DashKitDnDWrapper/DashKitDnDWrapper.js +4 -2
  6. package/build/cjs/components/DashKitDnDWrapper/DashKitDnDWrapper.js.map +1 -1
  7. package/build/cjs/components/GridItem/GridItem.css +4 -2
  8. package/build/cjs/components/GridLayout/GridLayout.d.ts +1 -1
  9. package/build/cjs/components/GridLayout/GridLayout.js +25 -8
  10. package/build/cjs/components/GridLayout/GridLayout.js.map +1 -1
  11. package/build/cjs/components/GridLayout/ReactGridLayout.d.ts +1 -0
  12. package/build/cjs/components/GridLayout/ReactGridLayout.js +30 -0
  13. package/build/cjs/components/GridLayout/ReactGridLayout.js.map +1 -1
  14. package/build/cjs/components/GridLayout/utils.d.ts +1 -0
  15. package/build/cjs/components/GridLayout/utils.js +11 -0
  16. package/build/cjs/components/GridLayout/utils.js.map +1 -1
  17. package/build/cjs/context/DashKitDnDContext.d.ts +1 -1
  18. package/build/cjs/context/DashKitDnDContext.js.map +1 -1
  19. package/build/cjs/hooks/__tests__/useDnDItemProps.test.d.ts +2 -0
  20. package/build/cjs/hooks/__tests__/useDnDItemProps.test.js +45 -0
  21. package/build/cjs/hooks/__tests__/useDnDItemProps.test.js.map +1 -0
  22. package/build/cjs/hooks/useDnDItemProps.js +1 -1
  23. package/build/cjs/hooks/useDnDItemProps.js.map +1 -1
  24. package/build/cjs/package.json +1 -1
  25. package/build/docs/INDEX.md +3 -1
  26. package/build/esm/components/ActionPanel/ActionPanel.css +53 -24
  27. package/build/esm/components/ActionPanel/ActionPanel.js +27 -1
  28. package/build/esm/components/ActionPanel/ActionPanel.js.map +1 -1
  29. package/build/esm/components/DashKitDnDWrapper/DashKitDnDWrapper.js +4 -2
  30. package/build/esm/components/DashKitDnDWrapper/DashKitDnDWrapper.js.map +1 -1
  31. package/build/esm/components/GridItem/GridItem.css +4 -2
  32. package/build/esm/components/GridLayout/GridLayout.d.ts +1 -1
  33. package/build/esm/components/GridLayout/GridLayout.js +25 -8
  34. package/build/esm/components/GridLayout/GridLayout.js.map +1 -1
  35. package/build/esm/components/GridLayout/ReactGridLayout.d.ts +1 -0
  36. package/build/esm/components/GridLayout/ReactGridLayout.js +30 -0
  37. package/build/esm/components/GridLayout/ReactGridLayout.js.map +1 -1
  38. package/build/esm/components/GridLayout/utils.d.ts +1 -0
  39. package/build/esm/components/GridLayout/utils.js +10 -0
  40. package/build/esm/components/GridLayout/utils.js.map +1 -1
  41. package/build/esm/context/DashKitDnDContext.d.ts +1 -1
  42. package/build/esm/context/DashKitDnDContext.js.map +1 -1
  43. package/build/esm/hooks/__tests__/useDnDItemProps.test.d.ts +2 -0
  44. package/build/esm/hooks/__tests__/useDnDItemProps.test.js +42 -0
  45. package/build/esm/hooks/__tests__/useDnDItemProps.test.js.map +1 -0
  46. package/build/esm/hooks/useDnDItemProps.js +1 -1
  47. package/build/esm/hooks/useDnDItemProps.js.map +1 -1
  48. package/build/esm/package.json +1 -1
  49. package/package.json +1 -1
@@ -8,6 +8,7 @@ const react_dom_1 = require("react-dom");
8
8
  const react_grid_layout_1 = tslib_1.__importStar(require("react-grid-layout"));
9
9
  const resize_observer_polyfill_1 = tslib_1.__importDefault(require("resize-observer-polyfill"));
10
10
  const constants_1 = require("../../constants/index.js");
11
+ const utils_1 = require("./utils.js");
11
12
  const GRID_LAYOUT_CLASS_NAME = 'react-grid-layout';
12
13
  const SETTLED_WIDTH_COMMIT_DELAY = 150;
13
14
  const isRefObject = (value) => {
@@ -37,6 +38,7 @@ class DragOverLayout extends react_grid_layout_1.default {
37
38
  // Without this flag, our setState would trigger onLayoutChange back to the consumer
38
39
  // that just initiated the action, causing a spurious 'change' event.
39
40
  this._isRestoringExternalLayout = false;
41
+ this.touchTarget = null;
40
42
  this.gridItemChildren = new WeakMap();
41
43
  // Reset placeholder when item dragged from outside
42
44
  this.resetExternalPlaceholder = () => {
@@ -71,6 +73,9 @@ class DragOverLayout extends react_grid_layout_1.default {
71
73
  return savedLayout;
72
74
  };
73
75
  this.extendedOnDrag = (i, x, y, sintEv) => {
76
+ if ('touches' in sintEv.e) {
77
+ this.updateTouchTarget(sintEv.e);
78
+ }
74
79
  if (this.props.isDragCaptured) {
75
80
  if (!this._savedDraggedOutLayout) {
76
81
  this._savedDraggedOutLayout = this.hideLocalPlaceholder(i);
@@ -82,6 +87,14 @@ class DragOverLayout extends react_grid_layout_1.default {
82
87
  this.parentOnDrag(i, x, y, sintEv);
83
88
  };
84
89
  this.extendedOnDragStop = (i, x, y, sintEv) => {
90
+ var _a, _b;
91
+ if ('changedTouches' in sintEv.e) {
92
+ const position = (0, utils_1.getEventPosition)(sintEv.e, (_a = this.props.dragStateRef) === null || _a === void 0 ? void 0 : _a.current.touchIdentifier);
93
+ if (position) {
94
+ (_b = this.touchTarget) === null || _b === void 0 ? void 0 : _b.dispatchEvent(new MouseEvent('mouseup', position));
95
+ }
96
+ this.touchTarget = null;
97
+ }
85
98
  // Restoring layout if item was dropped outside of the grid
86
99
  if (this._savedDraggedOutLayout) {
87
100
  const savedLayout = this._savedDraggedOutLayout;
@@ -338,6 +351,23 @@ class DragOverLayout extends react_grid_layout_1.default {
338
351
  }
339
352
  return react_1.default.cloneElement(gridItem, { children: gridItemChild });
340
353
  }
354
+ updateTouchTarget(event) {
355
+ var _a, _b;
356
+ const position = (0, utils_1.getEventPosition)(event, (_a = this.props.dragStateRef) === null || _a === void 0 ? void 0 : _a.current.touchIdentifier);
357
+ if (!position) {
358
+ return;
359
+ }
360
+ const target = document
361
+ .elementsFromPoint(position.clientX, position.clientY)
362
+ .find((element) => element.classList.contains(GRID_LAYOUT_CLASS_NAME)) || null;
363
+ // Touch events keep their original target, so route group transitions explicitly.
364
+ if (target !== this.touchTarget) {
365
+ (_b = this.touchTarget) === null || _b === void 0 ? void 0 : _b.dispatchEvent(new MouseEvent('mouseleave', position));
366
+ target === null || target === void 0 ? void 0 : target.dispatchEvent(new MouseEvent('mouseenter', position));
367
+ this.touchTarget = target;
368
+ }
369
+ target === null || target === void 0 ? void 0 : target.dispatchEvent(new MouseEvent('mousemove', position));
370
+ }
341
371
  }
342
372
  class PassiveWidthProvider extends react_1.default.Component {
343
373
  constructor() {
@@ -1 +1 @@
1
- {"version":3,"file":"ReactGridLayout.js","sourceRoot":"../../../../src","sources":["components/GridLayout/ReactGridLayout.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAE1B,yCAAoC;AAEpC,+DAA+D;AAC/D,+EAAyD;AACzD,gGAA8D;AAE9D,wDAAgF;AAEhF,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AACnD,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAEvC,MAAM,WAAW,GAAG,CAChB,KAAgC,EACQ,EAAE;IAC1C,OAAO,CACH,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,SAAS,IAAI,KAAK;QAClB,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CACpC,CAAC;AACN,CAAC,CAAC;AAsCF,MAAM,gBAAgB,GAAG,CAAC,EACtB,IAAI,EACJ,gBAAgB,EAChB,MAAM,EACN,KAAK,EACL,CAAC,EACD,CAAC,EACD,CAAC,EACD,CAAC,EACD,SAAS,EACT,gBAAgB,GAYnB,EAAE,EAAE;IACD,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;IAClC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,gBAAgB,CAAC;IAC9C,MAAM,WAAW,GAAG,CAAC,KAAK,GAAG,OAAO,GAAG,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,QAAQ,GAAG,CA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,aAAa,EAAE,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;QAC/E,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACxB,CAAC;IAED,MAAM;QACF,MAAM,KAAiC,IAAI,CAAC,KAAK,EAA3C,EAAC,kBAAkB,OAAwB,EAAnB,KAAK,sBAA7B,sBAA8B,CAAa,CAAC;QAElD,IAAI,kBAAkB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;YAC9C,OAAO,CACH,uCACI,SAAS,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAC9E,GAAG,EAAE,IAAI,CAAC,UAAU,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,GACpB,CACL,CAAC;QACN,CAAC;QAED,OAAO,CACH,8BAAC,cAAc,oBACP,KAAK,IACT,QAAQ,EAAE,IAAI,CAAC,UAAU,EACzB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EACvC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,IAChC,CACL,CAAC;IACN,CAAC;CAmJJ;AAEY,QAAA,MAAM,GAAG,oBAAoB,CAAC","sourcesContent":["import React from 'react';\n\nimport {flushSync} from 'react-dom';\nimport type {Layout as RGLLayout} from 'react-grid-layout';\n// @ts-expect-error - utils is not exported in type definitions\nimport ReactGridLayout, {utils} from 'react-grid-layout';\nimport ResizeObserverPolyfill from 'resize-observer-polyfill';\n\nimport {DROPPING_ELEMENT_CLASS_NAME, OVERLAY_CLASS_NAME} from '../../constants';\n\nconst GRID_LAYOUT_CLASS_NAME = 'react-grid-layout';\nconst SETTLED_WIDTH_COMMIT_DELAY = 150;\n\nconst isRefObject = (\n value: React.Ref<HTMLDivElement>,\n): value is React.RefObject<HTMLDivElement> => {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'current' in value &&\n typeof value.current === 'object'\n );\n};\n\ntype SharedDragPosition = {\n offsetX: number;\n offsetY: number;\n};\n\ntype DragOverLayoutProps = ReactGridLayout.ReactGridLayoutProps & {\n innerRef?: React.Ref<HTMLDivElement>;\n isDragCaptured?: boolean;\n dragStateRef?: React.MutableRefObject<{isDragging: boolean; sourceGroup: string | null}>;\n sharedDragPositionRef?: React.MutableRefObject<SharedDragPosition | null>;\n group?: string;\n onDragTargetRestore?: () => void;\n transformScaleRef?: React.MutableRefObject<number>;\n groupResetRegistryRef?: React.MutableRefObject<Map<string, () => void>>;\n externalLayoutRevision?: number;\n onBeforeDragOver?: () => void;\n};\n\ntype DragOverLayoutState = {\n layout: RGLLayout[];\n activeDrag: RGLLayout | null;\n};\n\ntype RGLLayoutWithPlaceholder = RGLLayout & {placeholder?: boolean};\n\ntype PassiveWidthProviderProps = DragOverLayoutProps & {\n measureBeforeMount?: boolean;\n};\n\ntype OnDragMethod = (\n i: string,\n x: number,\n y: number,\n sintEv: {e: Event; node: HTMLElement},\n) => void;\n\nconst getGridItemStyle = ({\n cols,\n containerPadding,\n margin,\n width,\n x,\n y,\n w,\n h,\n rowHeight,\n useCSSTransforms,\n}: {\n cols: number;\n containerPadding: [number, number];\n h: number;\n margin: [number, number];\n rowHeight: number;\n useCSSTransforms: boolean;\n w: number;\n width: number;\n x: number;\n y: number;\n}) => {\n const [marginX, marginY] = margin;\n const [paddingX, paddingY] = containerPadding;\n const columnWidth = (width - marginX * (cols - 1) - paddingX * 2) / cols;\n const position = {\n height: Math.round(rowHeight * h + marginY * (h - 1)),\n left: Math.round((columnWidth + marginX) * x + paddingX),\n top: Math.round(paddingY + (rowHeight + marginY) * y),\n width: Math.round(columnWidth * w + marginX * (w - 1)),\n };\n\n return useCSSTransforms\n ? {...utils.setTransform(position), left: '', top: ''}\n : {\n ...utils.setTopLeft(position),\n MozTransform: '',\n OTransform: '',\n WebkitTransform: '',\n msTransform: '',\n transform: '',\n };\n};\n\nclass DragOverLayout extends ReactGridLayout {\n // @ts-expect-error - TypeScript doesn't allow direct property redeclaration in extending classes. We need to narrow the props type from ReactGridLayoutProps to DragOverLayoutProps for type safety in our custom methods\n props: DragOverLayoutProps;\n // @ts-expect-error - TypeScript doesn't allow direct property redeclaration in extending classes. State is initialized by parent constructor\n state: DragOverLayoutState;\n\n parentOnDrag: OnDragMethod;\n parentOnDragStop: OnDragMethod;\n parentOnDragOver: (e: MouseEvent) => false | void;\n _savedDraggedOutLayout: RGLLayout[] | null = null;\n // Suppresses onLayoutMaybeChanged during imperative layout restore actions.\n // Without this flag, our setState would trigger onLayoutChange back to the consumer\n // that just initiated the action, causing a spurious 'change' event.\n _isRestoringExternalLayout = false;\n private readonly gridItemChildren = new WeakMap<\n React.ReactElement,\n {child: React.ReactElement; metadata: Record<string, string>}\n >();\n\n constructor(props: DragOverLayoutProps, context?: unknown) {\n super(props, context);\n\n // @ts-expect-error - onDrag is a protected method in parent class\n this.parentOnDrag = this.onDrag;\n // @ts-expect-error - assigning custom method to parent's onDrag\n this.onDrag = this.extendedOnDrag;\n\n // @ts-expect-error - onDragStop is a protected method in parent class\n this.parentOnDragStop = this.onDragStop;\n // @ts-expect-error - assigning custom method to parent's onDragStop\n this.onDragStop = this.extendedOnDragStop;\n // @ts-expect-error - onDragOver is a protected method in parent class\n this.parentOnDragOver = this.onDragOver;\n // @ts-expect-error - assigning custom method to parent's onDragOver\n this.onDragOver = this.extendedOnDragOver;\n }\n\n componentDidMount(): void {\n super.componentDidMount?.();\n\n if (this.props.group !== undefined) {\n this.props.groupResetRegistryRef?.current.set(\n this.props.group,\n this.resetExternalPlaceholder,\n );\n }\n\n // If cursor is moved out of the window there is a bug\n // which leaves placeholder element in grid, this action needed to reset this state\n window.addEventListener('dragend', this.resetExternalPlaceholder);\n const innerElement = this.getInnerElement();\n\n if (innerElement) {\n innerElement.addEventListener('mouseup', this.mouseUpHandler);\n innerElement.addEventListener('mouseenter', this.mouseEnterHandler);\n innerElement.addEventListener('mouseleave', this.mouseLeaveHandler);\n innerElement.addEventListener('mousemove', this.mouseMoveHandler);\n }\n }\n\n componentDidUpdate(prevProps: DragOverLayoutProps, prevState: DragOverLayoutState): void {\n const revisionChanged =\n prevProps.externalLayoutRevision !== this.props.externalLayoutRevision;\n\n if (revisionChanged && this.props.layout) {\n const newLayout = utils.synchronizeLayoutWithChildren(\n this.props.layout,\n this.props.children,\n this.props.cols,\n utils.compactType(this.props),\n this.props.allowOverlap,\n );\n\n this._isRestoringExternalLayout = true;\n // Override both layout and propsLayout so getDerivedStateFromProps\n // doesn't revert our update on the next render cycle.\n this.setState(\n {\n layout: newLayout,\n propsLayout: this.props.layout,\n } as unknown as DragOverLayoutState,\n () => {\n this._isRestoringExternalLayout = false;\n },\n );\n // RGL's shouldComponentUpdate only tracks activeDrag/mounted/droppingPosition — not\n // state.layout. So setState({layout}) alone is silently ignored (no re-render).\n // forceUpdate bypasses SCU and is batched with the setState above, producing a\n // single render cycle with the merged state that includes the restored layout.\n this.forceUpdate();\n // Don't call super here: restoring is an external action, not a user drag/resize.\n // onLayoutMaybeChanged is suppressed via _isRestoringExternalLayout.\n return;\n }\n\n // Maintain parent behavior for all non-restore cycles (drag, resize, etc.).\n super.componentDidUpdate?.(prevProps, prevState);\n }\n\n onLayoutMaybeChanged(newLayout: RGLLayout[], oldLayout: RGLLayout[]): void {\n if (this._isRestoringExternalLayout) {\n return;\n }\n // @ts-expect-error — onLayoutMaybeChanged is not in ReactGridLayout's public types\n super.onLayoutMaybeChanged(newLayout, oldLayout);\n }\n\n componentWillUnmount(): void {\n if (this.props.group !== undefined) {\n this.props.groupResetRegistryRef?.current.delete(this.props.group);\n }\n\n window.removeEventListener('dragend', this.resetExternalPlaceholder);\n const innerElement = this.getInnerElement();\n\n if (innerElement) {\n innerElement.removeEventListener('mouseup', this.mouseUpHandler);\n innerElement.removeEventListener('mouseenter', this.mouseEnterHandler);\n innerElement.removeEventListener('mouseleave', this.mouseLeaveHandler);\n innerElement.removeEventListener('mousemove', this.mouseMoveHandler);\n }\n }\n\n // react-grid-layout doens't calculate it's height when last element is removed\n // and just keeps the previous value\n // so for autosize to work in that case we are resetting it's height value\n containerHeight(): string | undefined {\n if (this.props.autoSize && this.state.layout.length === 0) {\n return;\n }\n\n // eslint-disable-next-line consistent-return\n // @ts-expect-error - containerHeight is a protected method in parent class\n return super.containerHeight();\n }\n\n // innerRef is passed by WithProvider without this wrapper there are only\n // * findDOMNode - deprecated\n // * rewrite whole ReactGridLayout.render method\n // so in that case don't try to use this class on it's own\n // or pass innerRef: React.MutableRef as it's not optional prop\n getInnerElement(): HTMLDivElement | null {\n const {innerRef} = this.props;\n\n return innerRef && isRefObject(innerRef) && innerRef.current ? innerRef.current : null;\n }\n\n // Reset placeholder when item dragged from outside\n resetExternalPlaceholder = (): void => {\n // @ts-expect-error - dragEnterCounter is an internal property of parent class\n if (this.dragEnterCounter) {\n // @ts-expect-error - dragEnterCounter is an internal property of parent class\n this.dragEnterCounter = 0;\n // @ts-expect-error - removeDroppingPlaceholder is a protected method in parent class\n this.removeDroppingPlaceholder();\n }\n };\n\n // Hide placeholder when element is dragged out\n hideLocalPlaceholder = (i: string): RGLLayout[] => {\n const {layout} = this.state;\n const {cols} = this.props;\n const savedLayout = layout.map((item) => ({...item}));\n\n let hiddenElement: RGLLayout | undefined;\n const newLayout = utils.compact(\n layout.filter((item) => {\n if (item.i === i) {\n hiddenElement = item;\n return false;\n }\n\n return true;\n }),\n utils.compactType(this.props),\n cols,\n );\n\n if (hiddenElement) {\n newLayout.push(hiddenElement);\n }\n\n this.setState({\n activeDrag: null,\n layout: newLayout,\n });\n\n return savedLayout;\n };\n\n extendedOnDrag = (\n i: string,\n x: number,\n y: number,\n sintEv: {e: Event; node: HTMLElement},\n ): void => {\n if (this.props.isDragCaptured) {\n if (!this._savedDraggedOutLayout) {\n this._savedDraggedOutLayout = this.hideLocalPlaceholder(i);\n }\n\n return;\n }\n\n this._savedDraggedOutLayout = null;\n // parent onDrag will show new placeholder again\n this.parentOnDrag(i, x, y, sintEv);\n };\n\n extendedOnDragStop = (\n i: string,\n x: number,\n y: number,\n sintEv: {e: Event; node: HTMLElement},\n ): void => {\n // Restoring layout if item was dropped outside of the grid\n if (this._savedDraggedOutLayout) {\n const savedLayout = this._savedDraggedOutLayout;\n const l = utils.getLayoutItem(savedLayout, i);\n\n // Create placeholder (display only)\n const placeholder: RGLLayoutWithPlaceholder = {\n w: l.w,\n h: l.h,\n x: l.x,\n y: l.y,\n placeholder: true,\n i: i,\n };\n\n this.setState(\n {\n layout: savedLayout,\n activeDrag: placeholder,\n },\n () => {\n this.parentOnDragStop(i, x, y, sintEv);\n },\n );\n\n this._savedDraggedOutLayout = null;\n } else {\n this.parentOnDragStop(i, x, y, sintEv);\n }\n };\n\n extendedOnDragOver = (e: MouseEvent): false | void => {\n this.props.onBeforeDragOver?.();\n return this.parentOnDragOver(e);\n };\n\n isSharedDragTarget = (): boolean => {\n const drag = this.props.dragStateRef?.current;\n return Boolean(drag?.isDragging);\n };\n\n // Proxy mouse events -> drag methods for dnd between groups\n mouseEnterHandler = (e: MouseEvent): void => {\n if (this.isSharedDragTarget()) {\n // @ts-expect-error - onDragEnter is a protected method in parent class\n this.onDragEnter(e);\n } else if (this.props.isDragCaptured) {\n this.props.onDragTargetRestore?.();\n }\n };\n\n mouseLeaveHandler = (e: MouseEvent): void => {\n if (this.isSharedDragTarget()) {\n // @ts-expect-error - onDragLeave is a protected method in parent class\n this.onDragLeave(e);\n this.props.onDragTargetRestore?.();\n }\n };\n\n mouseMoveHandler = (e: MouseEvent): void => {\n if (\n this.isSharedDragTarget() &&\n this.props.group !== this.props.dragStateRef?.current.sourceGroup\n ) {\n if (!(e as MouseEvent & {nativeEvent?: MouseEvent}).nativeEvent) {\n // Emulate nativeEvent for firefox\n const target = this.getInnerElement() || (e.target as HTMLElement);\n\n (e as MouseEvent & {nativeEvent: Partial<MouseEvent>}).nativeEvent = {\n clientX: e.clientX,\n clientY: e.clientY,\n target,\n };\n }\n\n // @ts-expect-error - onDragOver is a protected method in parent class\n this.onDragOver(e);\n }\n };\n\n mouseUpHandler = (e: MouseEvent): void => {\n if (this.isSharedDragTarget()) {\n e.preventDefault();\n const {droppingItem} = this.props;\n const {layout} = this.state;\n const item = layout.find((l) => l.i === droppingItem?.i);\n\n // reset dragEnter counter on drop for all registered groups\n this.props.groupResetRegistryRef?.current.forEach((reset) => reset());\n\n if (item) {\n this.props.onDrop?.(layout, item, e);\n }\n }\n };\n\n calculateDroppingPosition(itemProps: {\n containerWidth: number;\n cols: number;\n w: number;\n h: number;\n rowHeight: number;\n margin: [number, number];\n transformScale: number;\n droppingPosition: {left: number; top: number};\n }): {left: number; top: number} {\n const {containerWidth, cols, w, h, rowHeight, margin, transformScale, droppingPosition} =\n itemProps;\n const sharedDragPosition = this.props.sharedDragPositionRef?.current;\n\n let offsetX: number, offsetY: number;\n\n if (sharedDragPosition) {\n offsetX = sharedDragPosition.offsetX;\n offsetY = sharedDragPosition.offsetY;\n } else {\n offsetX = (((containerWidth / cols) * w) / 2 || 0) * transformScale;\n offsetY = ((h * rowHeight + (h - 1) * margin[1]) / 2 || 0) * transformScale;\n }\n\n return {\n ...droppingPosition,\n left: droppingPosition.left - offsetX,\n top: droppingPosition.top - offsetY,\n };\n }\n\n // Drop item from outside gets 0,0 droppingPosition\n // centering cursor on newly creted grid item\n // And cause grid-layout using it's own GridItem to make it look\n // like overlay adding className\n processGridItem(\n child: React.ReactElement,\n isDroppingItem?: boolean,\n ): React.ReactElement | undefined {\n // @ts-expect-error - processGridItem is a protected method in parent class\n const gridItem = super.processGridItem?.(child, isDroppingItem);\n\n if (!gridItem) {\n return gridItem;\n }\n\n const {cols, containerPadding, h, margin, rowHeight, useCSSTransforms, w, x, y} =\n gridItem.props;\n const [marginX, marginY] = margin;\n const [paddingX, paddingY] = containerPadding;\n const gridItemMetadata: Record<string, string> = {\n 'data-dashkit-grid-cols': String(cols),\n 'data-dashkit-grid-h': String(h),\n 'data-dashkit-grid-margin-x': String(marginX),\n 'data-dashkit-grid-margin-y': String(marginY),\n 'data-dashkit-grid-padding-x': String(paddingX),\n 'data-dashkit-grid-padding-y': String(paddingY),\n 'data-dashkit-grid-row-height': String(rowHeight),\n 'data-dashkit-grid-use-css-transforms': String(useCSSTransforms),\n 'data-dashkit-grid-w': String(w),\n 'data-dashkit-grid-x': String(x),\n 'data-dashkit-grid-y': String(y),\n };\n // Lazy proxy for transformScaleRef so react-draggable reads fresh scale without re-render.\n const {transformScaleRef} = this.props;\n const lazyScale = transformScaleRef\n ? ({valueOf: () => transformScaleRef.current} as unknown as number)\n : undefined;\n\n if (isDroppingItem) {\n // React.cloneElement is just cleaner then copy-paste whole processGridItem method\n return React.cloneElement(gridItem, {\n ...(lazyScale !== undefined && {transformScale: lazyScale}),\n // hiding preview if dragging shared item\n style: this.isSharedDragTarget()\n ? {...gridItem.props.style, opacity: 0}\n : gridItem.props.style,\n className: `${OVERLAY_CLASS_NAME} ${DROPPING_ELEMENT_CLASS_NAME}`,\n droppingPosition: this.calculateDroppingPosition(gridItem.props),\n });\n }\n\n const gridChild = gridItem.props.children as React.ReactElement<Record<string, string>>;\n const cachedGridItemChild = this.gridItemChildren.get(gridChild);\n const gridItemChild =\n cachedGridItemChild &&\n Object.keys(gridItemMetadata).every(\n (key) => cachedGridItemChild.metadata[key] === gridItemMetadata[key],\n )\n ? cachedGridItemChild.child\n : React.cloneElement(gridChild, gridItemMetadata);\n\n if (gridItemChild !== cachedGridItemChild?.child) {\n this.gridItemChildren.set(gridChild, {\n child: gridItemChild,\n metadata: gridItemMetadata,\n });\n }\n\n if (lazyScale !== undefined) {\n return React.cloneElement(gridItem, {\n children: gridItemChild,\n transformScale: lazyScale,\n });\n }\n\n return React.cloneElement(gridItem, {children: gridItemChild});\n }\n}\n\nclass PassiveWidthProvider extends React.Component<\n PassiveWidthProviderProps,\n {interactionRevision: number; isMounted: boolean; settledWidth: number}\n> {\n state = {interactionRevision: 0, isMounted: false, settledWidth: 1280};\n\n private element: HTMLDivElement | null = null;\n private readonly elementRef = React.createRef<HTMLDivElement>();\n private readonly widthRef = {current: 1280};\n private gridItems: HTMLElement[] = [];\n private lastAppliedWidth?: number;\n private resizeObserver?: ResizeObserver;\n private settledWidthCommitTimer?: number;\n private isComponentMounted = false;\n\n componentDidMount() {\n this.isComponentMounted = true;\n this.syncElement();\n this.setState({isMounted: true, settledWidth: this.widthRef.current});\n }\n\n componentDidUpdate() {\n this.syncElement();\n this.cacheGridItems();\n this.updateGridItems(this.widthRef.current);\n }\n\n componentWillUnmount() {\n this.isComponentMounted = false;\n this.resizeObserver?.disconnect();\n this.resizeObserver = undefined;\n this.cancelSettledWidthCommit();\n this.element?.removeEventListener('pointerdown', this.handlePointerDown, true);\n this.element = null;\n }\n\n render() {\n const {measureBeforeMount, ...props} = this.props;\n\n if (measureBeforeMount && !this.state.isMounted) {\n return (\n <div\n className={[props.className, GRID_LAYOUT_CLASS_NAME].filter(Boolean).join(' ')}\n ref={this.elementRef}\n style={props.style}\n />\n );\n }\n\n return (\n <DragOverLayout\n {...props}\n innerRef={this.elementRef}\n onBeforeDragOver={this.syncSettledWidth}\n width={this.state.settledWidth}\n />\n );\n }\n\n private cacheGridItems = () => {\n const node = this.element;\n this.gridItems = node\n ? Array.from(node.children).filter(\n (child): child is HTMLElement =>\n child instanceof HTMLElement &&\n child.matches('.react-grid-item[data-dashkit-grid-cols]'),\n )\n : [];\n this.lastAppliedWidth = undefined;\n };\n\n private updateGridItems = (width: number) => {\n if (width === this.lastAppliedWidth) {\n return;\n }\n this.lastAppliedWidth = width;\n\n this.gridItems.forEach((item) => {\n if (\n item.classList.contains('react-draggable-dragging') ||\n item.classList.contains('resizing')\n ) {\n return;\n }\n\n const {dataset, style} = item;\n const cols = Number(dataset.dashkitGridCols);\n const x = Number(dataset.dashkitGridX);\n const y = Number(dataset.dashkitGridY);\n const w = Number(dataset.dashkitGridW);\n const h = Number(dataset.dashkitGridH);\n const marginX = Number(dataset.dashkitGridMarginX);\n const marginY = Number(dataset.dashkitGridMarginY);\n const paddingX = Number(dataset.dashkitGridPaddingX);\n const paddingY = Number(dataset.dashkitGridPaddingY);\n const rowHeight = Number(dataset.dashkitGridRowHeight);\n const useCSSTransforms = dataset.dashkitGridUseCssTransforms === 'true';\n\n if (\n [cols, x, y, w, h, marginX, marginY, paddingX, paddingY, rowHeight].some(\n (value) => !Number.isFinite(value),\n )\n ) {\n return;\n }\n\n Object.assign(\n style,\n getGridItemStyle({\n cols,\n containerPadding: [paddingX, paddingY],\n h,\n margin: [marginX, marginY],\n rowHeight,\n useCSSTransforms,\n w,\n width,\n x,\n y,\n }),\n );\n });\n };\n\n private handlePointerDown = () => {\n if (!this.props.isDraggable && !this.props.isResizable) {\n return;\n }\n\n this.cancelSettledWidthCommit();\n flushSync(() => {\n this.setState((state) => ({\n interactionRevision: state.interactionRevision + 1,\n settledWidth: this.widthRef.current,\n }));\n });\n };\n\n private syncSettledWidth = () => {\n this.cancelSettledWidthCommit();\n if (this.state.settledWidth === this.widthRef.current) {\n return;\n }\n\n flushSync(() => {\n this.setState({settledWidth: this.widthRef.current});\n });\n };\n\n private cancelSettledWidthCommit = () => {\n if (this.settledWidthCommitTimer === undefined) {\n return;\n }\n window.clearTimeout(this.settledWidthCommitTimer);\n this.settledWidthCommitTimer = undefined;\n };\n\n private scheduleSettledWidthCommit = () => {\n this.cancelSettledWidthCommit();\n // DOM grid items update in ResizeObserver; React reconciles only after resizing settles.\n this.settledWidthCommitTimer = window.setTimeout(() => {\n this.settledWidthCommitTimer = undefined;\n if (this.isComponentMounted && this.state.settledWidth !== this.widthRef.current) {\n this.setState({settledWidth: this.widthRef.current});\n }\n }, SETTLED_WIDTH_COMMIT_DELAY);\n };\n\n private syncElement = () => {\n const node = this.elementRef.current;\n if (node === this.element) {\n return;\n }\n\n if (this.element) {\n this.resizeObserver?.unobserve(this.element);\n this.element.removeEventListener('pointerdown', this.handlePointerDown, true);\n }\n\n this.element = node;\n if (node && this.isComponentMounted) {\n this.observeElement(node);\n }\n };\n\n private observeElement = (node: HTMLDivElement) => {\n this.widthRef.current = node.clientWidth;\n this.cacheGridItems();\n this.updateGridItems(this.widthRef.current);\n node.addEventListener('pointerdown', this.handlePointerDown, true);\n this.resizeObserver ??= new (\n typeof ResizeObserver === 'function' ? ResizeObserver : ResizeObserverPolyfill\n )((entries: ResizeObserverEntry[]) => {\n const entry = entries.find((currentEntry) => currentEntry.target === this.element);\n if (!entry) {\n return;\n }\n\n this.widthRef.current = entry.contentRect.width;\n this.updateGridItems(this.widthRef.current);\n this.scheduleSettledWidthCommit();\n });\n this.resizeObserver.observe(node);\n };\n}\n\nexport const Layout = PassiveWidthProvider;\n"]}
1
+ {"version":3,"file":"ReactGridLayout.js","sourceRoot":"../../../../src","sources":["components/GridLayout/ReactGridLayout.tsx"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAE1B,yCAAoC;AAEpC,+DAA+D;AAC/D,+EAAyD;AACzD,gGAA8D;AAE9D,wDAAgF;AAEhF,sCAAyC;AAEzC,MAAM,sBAAsB,GAAG,mBAAmB,CAAC;AACnD,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAEvC,MAAM,WAAW,GAAG,CAChB,KAAgC,EACQ,EAAE;IAC1C,OAAO,CACH,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,SAAS,IAAI,KAAK;QAClB,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CACpC,CAAC;AACN,CAAC,CAAC;AA0CF,MAAM,gBAAgB,GAAG,CAAC,EACtB,IAAI,EACJ,gBAAgB,EAChB,MAAM,EACN,KAAK,EACL,CAAC,EACD,CAAC,EACD,CAAC,EACD,CAAC,EACD,SAAS,EACT,gBAAgB,GAYnB,EAAE,EAAE;IACD,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;IAClC,MAAM,CAAC,QAAQ,EAAE,QAAQ,CAAC,GAAG,gBAAgB,CAAC;IAC9C,MAAM,WAAW,GAAG,CAAC,KAAK,GAAG,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AAe,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAChD,CAAC;IAED,oBAAoB;;QAChB,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAChC,MAAA,IAAI,CAAC,cAAc,0CAAE,UAAU,EAAE,CAAC;QAClC,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;QAChC,IAAI,CAAC,wBAAwB,EAAE,CAAC;QAChC,MAAA,IAAI,CAAC,OAAO,0CAAE,mBAAmB,CAAC,aAAa,EAAE,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC;QAC/E,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACxB,CAAC;IAED,MAAM;QACF,MAAM,KAAiC,IAAI,CAAC,KAAK,EAA3C,EAAC,kBAAkB,OAAwB,EAAnB,KAAK,sBAA7B,sBAA8B,CAAa,CAAC;QAElD,IAAI,kBAAkB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;YAC9C,OAAO,CACH,uCACI,SAAS,EAAE,CAAC,KAAK,CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,EAC9E,GAAG,EAAE,IAAI,CAAC,UAAU,EACpB,KAAK,EAAE,KAAK,CAAC,KAAK,GACpB,CACL,CAAC;QACN,CAAC;QAED,OAAO,CACH,8BAAC,cAAc,oBACP,KAAK,IACT,QAAQ,EAAE,IAAI,CAAC,UAAU,EACzB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,EACvC,KAAK,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,IAChC,CACL,CAAC;IACN,CAAC;CAmJJ;AAEY,QAAA,MAAM,GAAG,oBAAoB,CAAC","sourcesContent":["import React from 'react';\n\nimport {flushSync} from 'react-dom';\nimport type {Layout as RGLLayout} from 'react-grid-layout';\n// @ts-expect-error - utils is not exported in type definitions\nimport ReactGridLayout, {utils} from 'react-grid-layout';\nimport ResizeObserverPolyfill from 'resize-observer-polyfill';\n\nimport {DROPPING_ELEMENT_CLASS_NAME, OVERLAY_CLASS_NAME} from '../../constants';\n\nimport {getEventPosition} from './utils';\n\nconst GRID_LAYOUT_CLASS_NAME = 'react-grid-layout';\nconst SETTLED_WIDTH_COMMIT_DELAY = 150;\n\nconst isRefObject = (\n value: React.Ref<HTMLDivElement>,\n): value is React.RefObject<HTMLDivElement> => {\n return (\n typeof value === 'object' &&\n value !== null &&\n 'current' in value &&\n typeof value.current === 'object'\n );\n};\n\ntype SharedDragPosition = {\n offsetX: number;\n offsetY: number;\n};\n\ntype DragOverLayoutProps = ReactGridLayout.ReactGridLayoutProps & {\n innerRef?: React.Ref<HTMLDivElement>;\n isDragCaptured?: boolean;\n dragStateRef?: React.MutableRefObject<{\n isDragging: boolean;\n sourceGroup: string | null;\n touchIdentifier?: number;\n }>;\n sharedDragPositionRef?: React.MutableRefObject<SharedDragPosition | null>;\n group?: string;\n onDragTargetRestore?: () => void;\n transformScaleRef?: React.MutableRefObject<number>;\n groupResetRegistryRef?: React.MutableRefObject<Map<string, () => void>>;\n externalLayoutRevision?: number;\n onBeforeDragOver?: () => void;\n};\n\ntype DragOverLayoutState = {\n layout: RGLLayout[];\n activeDrag: RGLLayout | null;\n};\n\ntype RGLLayoutWithPlaceholder = RGLLayout & {placeholder?: boolean};\n\ntype PassiveWidthProviderProps = DragOverLayoutProps & {\n measureBeforeMount?: boolean;\n};\n\ntype OnDragMethod = (\n i: string,\n x: number,\n y: number,\n sintEv: {e: Event; node: HTMLElement},\n) => void;\n\nconst getGridItemStyle = ({\n cols,\n containerPadding,\n margin,\n width,\n x,\n y,\n w,\n h,\n rowHeight,\n useCSSTransforms,\n}: {\n cols: number;\n containerPadding: [number, number];\n h: number;\n margin: [number, number];\n rowHeight: number;\n useCSSTransforms: boolean;\n w: number;\n width: number;\n x: number;\n y: number;\n}) => {\n const [marginX, marginY] = margin;\n const [paddingX, paddingY] = containerPadding;\n const columnWidth = (width - marginX * (cols - 1) - paddingX * 2) / cols;\n const position = {\n height: Math.round(rowHeight * h + marginY * (h - 1)),\n left: Math.round((columnWidth + marginX) * x + paddingX),\n top: Math.round(paddingY + (rowHeight + marginY) * y),\n width: Math.round(columnWidth * w + marginX * (w - 1)),\n };\n\n return useCSSTransforms\n ? {...utils.setTransform(position), left: '', top: ''}\n : {\n ...utils.setTopLeft(position),\n MozTransform: '',\n OTransform: '',\n WebkitTransform: '',\n msTransform: '',\n transform: '',\n };\n};\n\nclass DragOverLayout extends ReactGridLayout {\n // @ts-expect-error - TypeScript doesn't allow direct property redeclaration in extending classes. We need to narrow the props type from ReactGridLayoutProps to DragOverLayoutProps for type safety in our custom methods\n props: DragOverLayoutProps;\n // @ts-expect-error - TypeScript doesn't allow direct property redeclaration in extending classes. State is initialized by parent constructor\n state: DragOverLayoutState;\n\n parentOnDrag: OnDragMethod;\n parentOnDragStop: OnDragMethod;\n parentOnDragOver: (e: MouseEvent) => false | void;\n _savedDraggedOutLayout: RGLLayout[] | null = null;\n // Suppresses onLayoutMaybeChanged during imperative layout restore actions.\n // Without this flag, our setState would trigger onLayoutChange back to the consumer\n // that just initiated the action, causing a spurious 'change' event.\n _isRestoringExternalLayout = false;\n private touchTarget: Element | null = null;\n private readonly gridItemChildren = new WeakMap<\n React.ReactElement,\n {child: React.ReactElement; metadata: Record<string, string>}\n >();\n\n constructor(props: DragOverLayoutProps, context?: unknown) {\n super(props, context);\n\n // @ts-expect-error - onDrag is a protected method in parent class\n this.parentOnDrag = this.onDrag;\n // @ts-expect-error - assigning custom method to parent's onDrag\n this.onDrag = this.extendedOnDrag;\n\n // @ts-expect-error - onDragStop is a protected method in parent class\n this.parentOnDragStop = this.onDragStop;\n // @ts-expect-error - assigning custom method to parent's onDragStop\n this.onDragStop = this.extendedOnDragStop;\n // @ts-expect-error - onDragOver is a protected method in parent class\n this.parentOnDragOver = this.onDragOver;\n // @ts-expect-error - assigning custom method to parent's onDragOver\n this.onDragOver = this.extendedOnDragOver;\n }\n\n componentDidMount(): void {\n super.componentDidMount?.();\n\n if (this.props.group !== undefined) {\n this.props.groupResetRegistryRef?.current.set(\n this.props.group,\n this.resetExternalPlaceholder,\n );\n }\n\n // If cursor is moved out of the window there is a bug\n // which leaves placeholder element in grid, this action needed to reset this state\n window.addEventListener('dragend', this.resetExternalPlaceholder);\n const innerElement = this.getInnerElement();\n\n if (innerElement) {\n innerElement.addEventListener('mouseup', this.mouseUpHandler);\n innerElement.addEventListener('mouseenter', this.mouseEnterHandler);\n innerElement.addEventListener('mouseleave', this.mouseLeaveHandler);\n innerElement.addEventListener('mousemove', this.mouseMoveHandler);\n }\n }\n\n componentDidUpdate(prevProps: DragOverLayoutProps, prevState: DragOverLayoutState): void {\n const revisionChanged =\n prevProps.externalLayoutRevision !== this.props.externalLayoutRevision;\n\n if (revisionChanged && this.props.layout) {\n const newLayout = utils.synchronizeLayoutWithChildren(\n this.props.layout,\n this.props.children,\n this.props.cols,\n utils.compactType(this.props),\n this.props.allowOverlap,\n );\n\n this._isRestoringExternalLayout = true;\n // Override both layout and propsLayout so getDerivedStateFromProps\n // doesn't revert our update on the next render cycle.\n this.setState(\n {\n layout: newLayout,\n propsLayout: this.props.layout,\n } as unknown as DragOverLayoutState,\n () => {\n this._isRestoringExternalLayout = false;\n },\n );\n // RGL's shouldComponentUpdate only tracks activeDrag/mounted/droppingPosition — not\n // state.layout. So setState({layout}) alone is silently ignored (no re-render).\n // forceUpdate bypasses SCU and is batched with the setState above, producing a\n // single render cycle with the merged state that includes the restored layout.\n this.forceUpdate();\n // Don't call super here: restoring is an external action, not a user drag/resize.\n // onLayoutMaybeChanged is suppressed via _isRestoringExternalLayout.\n return;\n }\n\n // Maintain parent behavior for all non-restore cycles (drag, resize, etc.).\n super.componentDidUpdate?.(prevProps, prevState);\n }\n\n onLayoutMaybeChanged(newLayout: RGLLayout[], oldLayout: RGLLayout[]): void {\n if (this._isRestoringExternalLayout) {\n return;\n }\n // @ts-expect-error — onLayoutMaybeChanged is not in ReactGridLayout's public types\n super.onLayoutMaybeChanged(newLayout, oldLayout);\n }\n\n componentWillUnmount(): void {\n if (this.props.group !== undefined) {\n this.props.groupResetRegistryRef?.current.delete(this.props.group);\n }\n\n window.removeEventListener('dragend', this.resetExternalPlaceholder);\n const innerElement = this.getInnerElement();\n\n if (innerElement) {\n innerElement.removeEventListener('mouseup', this.mouseUpHandler);\n innerElement.removeEventListener('mouseenter', this.mouseEnterHandler);\n innerElement.removeEventListener('mouseleave', this.mouseLeaveHandler);\n innerElement.removeEventListener('mousemove', this.mouseMoveHandler);\n }\n }\n\n // react-grid-layout doens't calculate it's height when last element is removed\n // and just keeps the previous value\n // so for autosize to work in that case we are resetting it's height value\n containerHeight(): string | undefined {\n if (this.props.autoSize && this.state.layout.length === 0) {\n return;\n }\n\n // eslint-disable-next-line consistent-return\n // @ts-expect-error - containerHeight is a protected method in parent class\n return super.containerHeight();\n }\n\n // innerRef is passed by WithProvider without this wrapper there are only\n // * findDOMNode - deprecated\n // * rewrite whole ReactGridLayout.render method\n // so in that case don't try to use this class on it's own\n // or pass innerRef: React.MutableRef as it's not optional prop\n getInnerElement(): HTMLDivElement | null {\n const {innerRef} = this.props;\n\n return innerRef && isRefObject(innerRef) && innerRef.current ? innerRef.current : null;\n }\n\n // Reset placeholder when item dragged from outside\n resetExternalPlaceholder = (): void => {\n // @ts-expect-error - dragEnterCounter is an internal property of parent class\n if (this.dragEnterCounter) {\n // @ts-expect-error - dragEnterCounter is an internal property of parent class\n this.dragEnterCounter = 0;\n // @ts-expect-error - removeDroppingPlaceholder is a protected method in parent class\n this.removeDroppingPlaceholder();\n }\n };\n\n // Hide placeholder when element is dragged out\n hideLocalPlaceholder = (i: string): RGLLayout[] => {\n const {layout} = this.state;\n const {cols} = this.props;\n const savedLayout = layout.map((item) => ({...item}));\n\n let hiddenElement: RGLLayout | undefined;\n const newLayout = utils.compact(\n layout.filter((item) => {\n if (item.i === i) {\n hiddenElement = item;\n return false;\n }\n\n return true;\n }),\n utils.compactType(this.props),\n cols,\n );\n\n if (hiddenElement) {\n newLayout.push(hiddenElement);\n }\n\n this.setState({\n activeDrag: null,\n layout: newLayout,\n });\n\n return savedLayout;\n };\n\n extendedOnDrag = (\n i: string,\n x: number,\n y: number,\n sintEv: {e: Event; node: HTMLElement},\n ): void => {\n if ('touches' in sintEv.e) {\n this.updateTouchTarget(sintEv.e as TouchEvent);\n }\n\n if (this.props.isDragCaptured) {\n if (!this._savedDraggedOutLayout) {\n this._savedDraggedOutLayout = this.hideLocalPlaceholder(i);\n }\n\n return;\n }\n\n this._savedDraggedOutLayout = null;\n // parent onDrag will show new placeholder again\n this.parentOnDrag(i, x, y, sintEv);\n };\n\n extendedOnDragStop = (\n i: string,\n x: number,\n y: number,\n sintEv: {e: Event; node: HTMLElement},\n ): void => {\n if ('changedTouches' in sintEv.e) {\n const position = getEventPosition(\n sintEv.e as TouchEvent,\n this.props.dragStateRef?.current.touchIdentifier,\n );\n if (position) {\n this.touchTarget?.dispatchEvent(new MouseEvent('mouseup', position));\n }\n this.touchTarget = null;\n }\n\n // Restoring layout if item was dropped outside of the grid\n if (this._savedDraggedOutLayout) {\n const savedLayout = this._savedDraggedOutLayout;\n const l = utils.getLayoutItem(savedLayout, i);\n\n // Create placeholder (display only)\n const placeholder: RGLLayoutWithPlaceholder = {\n w: l.w,\n h: l.h,\n x: l.x,\n y: l.y,\n placeholder: true,\n i: i,\n };\n\n this.setState(\n {\n layout: savedLayout,\n activeDrag: placeholder,\n },\n () => {\n this.parentOnDragStop(i, x, y, sintEv);\n },\n );\n\n this._savedDraggedOutLayout = null;\n } else {\n this.parentOnDragStop(i, x, y, sintEv);\n }\n };\n\n extendedOnDragOver = (e: MouseEvent): false | void => {\n this.props.onBeforeDragOver?.();\n return this.parentOnDragOver(e);\n };\n\n isSharedDragTarget = (): boolean => {\n const drag = this.props.dragStateRef?.current;\n return Boolean(drag?.isDragging);\n };\n\n // Proxy mouse events -> drag methods for dnd between groups\n mouseEnterHandler = (e: MouseEvent): void => {\n if (this.isSharedDragTarget()) {\n // @ts-expect-error - onDragEnter is a protected method in parent class\n this.onDragEnter(e);\n } else if (this.props.isDragCaptured) {\n this.props.onDragTargetRestore?.();\n }\n };\n\n mouseLeaveHandler = (e: MouseEvent): void => {\n if (this.isSharedDragTarget()) {\n // @ts-expect-error - onDragLeave is a protected method in parent class\n this.onDragLeave(e);\n this.props.onDragTargetRestore?.();\n }\n };\n\n mouseMoveHandler = (e: MouseEvent): void => {\n if (\n this.isSharedDragTarget() &&\n this.props.group !== this.props.dragStateRef?.current.sourceGroup\n ) {\n if (!(e as MouseEvent & {nativeEvent?: MouseEvent}).nativeEvent) {\n // Emulate nativeEvent for firefox\n const target = this.getInnerElement() || (e.target as HTMLElement);\n\n (e as MouseEvent & {nativeEvent: Partial<MouseEvent>}).nativeEvent = {\n clientX: e.clientX,\n clientY: e.clientY,\n target,\n };\n }\n\n // @ts-expect-error - onDragOver is a protected method in parent class\n this.onDragOver(e);\n }\n };\n\n mouseUpHandler = (e: MouseEvent): void => {\n if (this.isSharedDragTarget()) {\n e.preventDefault();\n const {droppingItem} = this.props;\n const {layout} = this.state;\n const item = layout.find((l) => l.i === droppingItem?.i);\n\n // reset dragEnter counter on drop for all registered groups\n this.props.groupResetRegistryRef?.current.forEach((reset) => reset());\n\n if (item) {\n this.props.onDrop?.(layout, item, e);\n }\n }\n };\n\n calculateDroppingPosition(itemProps: {\n containerWidth: number;\n cols: number;\n w: number;\n h: number;\n rowHeight: number;\n margin: [number, number];\n transformScale: number;\n droppingPosition: {left: number; top: number};\n }): {left: number; top: number} {\n const {containerWidth, cols, w, h, rowHeight, margin, transformScale, droppingPosition} =\n itemProps;\n const sharedDragPosition = this.props.sharedDragPositionRef?.current;\n\n let offsetX: number, offsetY: number;\n\n if (sharedDragPosition) {\n offsetX = sharedDragPosition.offsetX;\n offsetY = sharedDragPosition.offsetY;\n } else {\n offsetX = (((containerWidth / cols) * w) / 2 || 0) * transformScale;\n offsetY = ((h * rowHeight + (h - 1) * margin[1]) / 2 || 0) * transformScale;\n }\n\n return {\n ...droppingPosition,\n left: droppingPosition.left - offsetX,\n top: droppingPosition.top - offsetY,\n };\n }\n\n // Drop item from outside gets 0,0 droppingPosition\n // centering cursor on newly creted grid item\n // And cause grid-layout using it's own GridItem to make it look\n // like overlay adding className\n processGridItem(\n child: React.ReactElement,\n isDroppingItem?: boolean,\n ): React.ReactElement | undefined {\n // @ts-expect-error - processGridItem is a protected method in parent class\n const gridItem = super.processGridItem?.(child, isDroppingItem);\n\n if (!gridItem) {\n return gridItem;\n }\n\n const {cols, containerPadding, h, margin, rowHeight, useCSSTransforms, w, x, y} =\n gridItem.props;\n const [marginX, marginY] = margin;\n const [paddingX, paddingY] = containerPadding;\n const gridItemMetadata: Record<string, string> = {\n 'data-dashkit-grid-cols': String(cols),\n 'data-dashkit-grid-h': String(h),\n 'data-dashkit-grid-margin-x': String(marginX),\n 'data-dashkit-grid-margin-y': String(marginY),\n 'data-dashkit-grid-padding-x': String(paddingX),\n 'data-dashkit-grid-padding-y': String(paddingY),\n 'data-dashkit-grid-row-height': String(rowHeight),\n 'data-dashkit-grid-use-css-transforms': String(useCSSTransforms),\n 'data-dashkit-grid-w': String(w),\n 'data-dashkit-grid-x': String(x),\n 'data-dashkit-grid-y': String(y),\n };\n // Lazy proxy for transformScaleRef so react-draggable reads fresh scale without re-render.\n const {transformScaleRef} = this.props;\n const lazyScale = transformScaleRef\n ? ({valueOf: () => transformScaleRef.current} as unknown as number)\n : undefined;\n\n if (isDroppingItem) {\n // React.cloneElement is just cleaner then copy-paste whole processGridItem method\n return React.cloneElement(gridItem, {\n ...(lazyScale !== undefined && {transformScale: lazyScale}),\n // hiding preview if dragging shared item\n style: this.isSharedDragTarget()\n ? {...gridItem.props.style, opacity: 0}\n : gridItem.props.style,\n className: `${OVERLAY_CLASS_NAME} ${DROPPING_ELEMENT_CLASS_NAME}`,\n droppingPosition: this.calculateDroppingPosition(gridItem.props),\n });\n }\n\n const gridChild = gridItem.props.children as React.ReactElement<Record<string, string>>;\n const cachedGridItemChild = this.gridItemChildren.get(gridChild);\n const gridItemChild =\n cachedGridItemChild &&\n Object.keys(gridItemMetadata).every(\n (key) => cachedGridItemChild.metadata[key] === gridItemMetadata[key],\n )\n ? cachedGridItemChild.child\n : React.cloneElement(gridChild, gridItemMetadata);\n\n if (gridItemChild !== cachedGridItemChild?.child) {\n this.gridItemChildren.set(gridChild, {\n child: gridItemChild,\n metadata: gridItemMetadata,\n });\n }\n\n if (lazyScale !== undefined) {\n return React.cloneElement(gridItem, {\n children: gridItemChild,\n transformScale: lazyScale,\n });\n }\n\n return React.cloneElement(gridItem, {children: gridItemChild});\n }\n private updateTouchTarget(event: TouchEvent): void {\n const position = getEventPosition(event, this.props.dragStateRef?.current.touchIdentifier);\n if (!position) {\n return;\n }\n const target =\n document\n .elementsFromPoint(position.clientX, position.clientY)\n .find((element) => element.classList.contains(GRID_LAYOUT_CLASS_NAME)) || null;\n\n // Touch events keep their original target, so route group transitions explicitly.\n if (target !== this.touchTarget) {\n this.touchTarget?.dispatchEvent(new MouseEvent('mouseleave', position));\n target?.dispatchEvent(new MouseEvent('mouseenter', position));\n this.touchTarget = target;\n }\n\n target?.dispatchEvent(new MouseEvent('mousemove', position));\n }\n}\n\nclass PassiveWidthProvider extends React.Component<\n PassiveWidthProviderProps,\n {interactionRevision: number; isMounted: boolean; settledWidth: number}\n> {\n state = {interactionRevision: 0, isMounted: false, settledWidth: 1280};\n\n private element: HTMLDivElement | null = null;\n private readonly elementRef = React.createRef<HTMLDivElement>();\n private readonly widthRef = {current: 1280};\n private gridItems: HTMLElement[] = [];\n private lastAppliedWidth?: number;\n private resizeObserver?: ResizeObserver;\n private settledWidthCommitTimer?: number;\n private isComponentMounted = false;\n\n componentDidMount() {\n this.isComponentMounted = true;\n this.syncElement();\n this.setState({isMounted: true, settledWidth: this.widthRef.current});\n }\n\n componentDidUpdate() {\n this.syncElement();\n this.cacheGridItems();\n this.updateGridItems(this.widthRef.current);\n }\n\n componentWillUnmount() {\n this.isComponentMounted = false;\n this.resizeObserver?.disconnect();\n this.resizeObserver = undefined;\n this.cancelSettledWidthCommit();\n this.element?.removeEventListener('pointerdown', this.handlePointerDown, true);\n this.element = null;\n }\n\n render() {\n const {measureBeforeMount, ...props} = this.props;\n\n if (measureBeforeMount && !this.state.isMounted) {\n return (\n <div\n className={[props.className, GRID_LAYOUT_CLASS_NAME].filter(Boolean).join(' ')}\n ref={this.elementRef}\n style={props.style}\n />\n );\n }\n\n return (\n <DragOverLayout\n {...props}\n innerRef={this.elementRef}\n onBeforeDragOver={this.syncSettledWidth}\n width={this.state.settledWidth}\n />\n );\n }\n\n private cacheGridItems = () => {\n const node = this.element;\n this.gridItems = node\n ? Array.from(node.children).filter(\n (child): child is HTMLElement =>\n child instanceof HTMLElement &&\n child.matches('.react-grid-item[data-dashkit-grid-cols]'),\n )\n : [];\n this.lastAppliedWidth = undefined;\n };\n\n private updateGridItems = (width: number) => {\n if (width === this.lastAppliedWidth) {\n return;\n }\n this.lastAppliedWidth = width;\n\n this.gridItems.forEach((item) => {\n if (\n item.classList.contains('react-draggable-dragging') ||\n item.classList.contains('resizing')\n ) {\n return;\n }\n\n const {dataset, style} = item;\n const cols = Number(dataset.dashkitGridCols);\n const x = Number(dataset.dashkitGridX);\n const y = Number(dataset.dashkitGridY);\n const w = Number(dataset.dashkitGridW);\n const h = Number(dataset.dashkitGridH);\n const marginX = Number(dataset.dashkitGridMarginX);\n const marginY = Number(dataset.dashkitGridMarginY);\n const paddingX = Number(dataset.dashkitGridPaddingX);\n const paddingY = Number(dataset.dashkitGridPaddingY);\n const rowHeight = Number(dataset.dashkitGridRowHeight);\n const useCSSTransforms = dataset.dashkitGridUseCssTransforms === 'true';\n\n if (\n [cols, x, y, w, h, marginX, marginY, paddingX, paddingY, rowHeight].some(\n (value) => !Number.isFinite(value),\n )\n ) {\n return;\n }\n\n Object.assign(\n style,\n getGridItemStyle({\n cols,\n containerPadding: [paddingX, paddingY],\n h,\n margin: [marginX, marginY],\n rowHeight,\n useCSSTransforms,\n w,\n width,\n x,\n y,\n }),\n );\n });\n };\n\n private handlePointerDown = () => {\n if (!this.props.isDraggable && !this.props.isResizable) {\n return;\n }\n\n this.cancelSettledWidthCommit();\n flushSync(() => {\n this.setState((state) => ({\n interactionRevision: state.interactionRevision + 1,\n settledWidth: this.widthRef.current,\n }));\n });\n };\n\n private syncSettledWidth = () => {\n this.cancelSettledWidthCommit();\n if (this.state.settledWidth === this.widthRef.current) {\n return;\n }\n\n flushSync(() => {\n this.setState({settledWidth: this.widthRef.current});\n });\n };\n\n private cancelSettledWidthCommit = () => {\n if (this.settledWidthCommitTimer === undefined) {\n return;\n }\n window.clearTimeout(this.settledWidthCommitTimer);\n this.settledWidthCommitTimer = undefined;\n };\n\n private scheduleSettledWidthCommit = () => {\n this.cancelSettledWidthCommit();\n // DOM grid items update in ResizeObserver; React reconciles only after resizing settles.\n this.settledWidthCommitTimer = window.setTimeout(() => {\n this.settledWidthCommitTimer = undefined;\n if (this.isComponentMounted && this.state.settledWidth !== this.widthRef.current) {\n this.setState({settledWidth: this.widthRef.current});\n }\n }, SETTLED_WIDTH_COMMIT_DELAY);\n };\n\n private syncElement = () => {\n const node = this.elementRef.current;\n if (node === this.element) {\n return;\n }\n\n if (this.element) {\n this.resizeObserver?.unobserve(this.element);\n this.element.removeEventListener('pointerdown', this.handlePointerDown, true);\n }\n\n this.element = node;\n if (node && this.isComponentMounted) {\n this.observeElement(node);\n }\n };\n\n private observeElement = (node: HTMLDivElement) => {\n this.widthRef.current = node.clientWidth;\n this.cacheGridItems();\n this.updateGridItems(this.widthRef.current);\n node.addEventListener('pointerdown', this.handlePointerDown, true);\n this.resizeObserver ??= new (\n typeof ResizeObserver === 'function' ? ResizeObserver : ResizeObserverPolyfill\n )((entries: ResizeObserverEntry[]) => {\n const entry = entries.find((currentEntry) => currentEntry.target === this.element);\n if (!entry) {\n return;\n }\n\n this.widthRef.current = entry.contentRect.width;\n this.updateGridItems(this.widthRef.current);\n this.scheduleSettledWidthCommit();\n });\n this.resizeObserver.observe(node);\n };\n}\n\nexport const Layout = PassiveWidthProvider;\n"]}
@@ -1,2 +1,3 @@
1
1
  export declare function shallowArrayEqual<T>(a: T[], b: T[]): boolean;
2
2
  export declare function shallowObjectEqual<T extends object>(a: T, b: T): boolean;
3
+ export declare function getEventPosition(event: MouseEvent | TouchEvent, touchIdentifier?: number): MouseEvent | Touch | undefined;
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.shallowArrayEqual = shallowArrayEqual;
4
4
  exports.shallowObjectEqual = shallowObjectEqual;
5
+ exports.getEventPosition = getEventPosition;
5
6
  function shallowArrayEqual(a, b) {
6
7
  if (a === b) {
7
8
  return true;
@@ -22,4 +23,14 @@ function shallowObjectEqual(a, b) {
22
23
  }
23
24
  return keysA.every((key) => a[key] === b[key]);
24
25
  }
26
+ function getEventPosition(event, touchIdentifier) {
27
+ if (!('touches' in event)) {
28
+ return event;
29
+ }
30
+ if (touchIdentifier === undefined) {
31
+ return event.targetTouches[0] || event.changedTouches[0];
32
+ }
33
+ return (Array.from(event.touches).find((touch) => touch.identifier === touchIdentifier) ||
34
+ Array.from(event.changedTouches).find((touch) => touch.identifier === touchIdentifier));
35
+ }
25
36
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"../../../../src","sources":["components/GridLayout/utils.tsx"],"names":[],"mappings":";;AAAA,8CAQC;AAED,gDAUC;AApBD,SAAgB,iBAAiB,CAAI,CAAM,EAAE,CAAM;IAC/C,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACV,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;QACxB,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC/C,CAAC;AAED,SAAgB,kBAAkB,CAAmB,CAAI,EAAE,CAAI;IAC3D,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACV,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAmB,CAAC;IAC/C,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAmB,CAAC;IAC/C,IAAI,KAAK,CAAC,MAAM,KAAK,KAAK,CAAC,MAAM,EAAE,CAAC;QAChC,OAAO,KAAK,CAAC;IACjB,CAAC;IACD,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;AACnD,CAAC","sourcesContent":["export function shallowArrayEqual<T>(a: T[], b: T[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n return a.every((item, i) => item === b[i]);\n}\n\nexport function shallowObjectEqual<T extends object>(a: T, b: T): boolean {\n if (a === b) {\n return true;\n }\n const keysA = Object.keys(a) as Array<keyof T>;\n const keysB = Object.keys(b) as Array<keyof T>;\n if (keysA.length !== keysB.length) {\n return false;\n }\n return keysA.every((key) => a[key] === b[key]);\n}\n"]}
1
+ {"version":3,"file":"utils.js","sourceRoot":"../../../../src","sources":["components/GridLayout/utils.tsx"],"names":[],"mappings":";;AAAA,8CAQC;AAED,gDAUC;AAED,4CAgBC;AAtCD,SAAgB,iBAAiB,CAAI,CAAM,EAAE,CAAM;IAC/C,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACV,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;Q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CAAC,UAAU,KAAK,eAAe,CAAC,CACzF,CAAC;AACN,CAAC","sourcesContent":["export function shallowArrayEqual<T>(a: T[], b: T[]): boolean {\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n return a.every((item, i) => item === b[i]);\n}\n\nexport function shallowObjectEqual<T extends object>(a: T, b: T): boolean {\n if (a === b) {\n return true;\n }\n const keysA = Object.keys(a) as Array<keyof T>;\n const keysB = Object.keys(b) as Array<keyof T>;\n if (keysA.length !== keysB.length) {\n return false;\n }\n return keysA.every((key) => a[key] === b[key]);\n}\n\nexport function getEventPosition(\n event: MouseEvent | TouchEvent,\n touchIdentifier?: number,\n): MouseEvent | Touch | undefined {\n if (!('touches' in event)) {\n return event;\n }\n\n if (touchIdentifier === undefined) {\n return event.targetTouches[0] || event.changedTouches[0];\n }\n\n return (\n Array.from(event.touches).find((touch) => touch.identifier === touchIdentifier) ||\n Array.from(event.changedTouches).find((touch) => touch.identifier === touchIdentifier)\n );\n}\n"]}
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import type { DraggedOverItem, ItemDragProps } from "../shared/types/index.js";
3
3
  export type DashKitDnDCtxShape = {
4
4
  dragProps: ItemDragProps | null;
5
- dragImagePreview: HTMLImageElement;
5
+ dragImagePreview: HTMLImageElement | null;
6
6
  onDragStart: (e: React.DragEvent<Element>, itemDragProps: ItemDragProps) => void;
7
7
  onDragEnd: (e: React.DragEvent<Element>) => void;
8
8
  onDropDragOver?: (draggedItem: DraggedOverItem, sharedItem: DraggedOverItem | null) => void | boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"DashKitDnDContext.js","sourceRoot":"../../../src","sources":["context/DashKitDnDContext.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAeb,QAAA,iBAAiB,GAAG,eAAK,CAAC,aAAa,CAA4B,SAAS,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport type {DraggedOverItem, ItemDragProps} from '../shared/types';\n\nexport type DashKitDnDCtxShape = {\n dragProps: ItemDragProps | null;\n dragImagePreview: HTMLImageElement;\n onDragStart: (e: React.DragEvent<Element>, itemDragProps: ItemDragProps) => void;\n onDragEnd: (e: React.DragEvent<Element>) => void;\n onDropDragOver?: (\n draggedItem: DraggedOverItem,\n sharedItem: DraggedOverItem | null,\n ) => void | boolean;\n};\n\nexport const DashKitDnDContext = React.createContext<DashKitDnDCtxShape | void>(undefined);\n"]}
1
+ {"version":3,"file":"DashKitDnDContext.js","sourceRoot":"../../../src","sources":["context/DashKitDnDContext.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAeb,QAAA,iBAAiB,GAAG,eAAK,CAAC,aAAa,CAA4B,SAAS,CAAC,CAAC","sourcesContent":["import React from 'react';\n\nimport type {DraggedOverItem, ItemDragProps} from '../shared/types';\n\nexport type DashKitDnDCtxShape = {\n dragProps: ItemDragProps | null;\n dragImagePreview: HTMLImageElement | null;\n onDragStart: (e: React.DragEvent<Element>, itemDragProps: ItemDragProps) => void;\n onDragEnd: (e: React.DragEvent<Element>) => void;\n onDropDragOver?: (\n draggedItem: DraggedOverItem,\n sharedItem: DraggedOverItem | null,\n ) => void | boolean;\n};\n\nexport const DashKitDnDContext = React.createContext<DashKitDnDCtxShape | void>(undefined);\n"]}
@@ -0,0 +1,2 @@
1
+ /** @jest-environment jsdom */
2
+ export {};
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ /** @jest-environment jsdom */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ const tslib_1 = require("tslib");
5
+ const react_1 = tslib_1.__importDefault(require("react"));
6
+ const react_2 = require("@testing-library/react");
7
+ const ActionPanel_1 = require("../../components/ActionPanel/ActionPanel.js");
8
+ const DashKitDnDWrapper_1 = require("../../components/DashKitDnDWrapper/DashKitDnDWrapper.js");
9
+ const item = { id: 'chart', title: 'Chart', icon: 'icon', dragProps: { type: 'chart' } };
10
+ describe('ActionPanel drag preview', () => {
11
+ it('captures the solid item before disabling the panel source and restores it on drag end', () => {
12
+ jest.useFakeTimers();
13
+ const onDragStart = jest.fn();
14
+ const onDragEnd = jest.fn();
15
+ const setDragImage = jest.fn();
16
+ (0, react_2.render)(react_1.default.createElement(DashKitDnDWrapper_1.DashKitDnDWrapper, { onDragStart: onDragStart, onDragEnd: onDragEnd },
17
+ react_1.default.createElement(ActionPanel_1.ActionPanel, { items: [item] })));
18
+ const source = react_2.screen.getByRole('button', { name: /Chart/ });
19
+ const disabledSourceClassName = 'dashkit-action-panel__item_dragging-source-disabled';
20
+ setDragImage.mockImplementation(() => {
21
+ expect(source.classList.contains('dashkit-action-panel__item_dragging')).toBe(true);
22
+ expect(source.classList.contains(disabledSourceClassName)).toBe(false);
23
+ });
24
+ react_2.fireEvent.dragStart(source, { dataTransfer: { setDragImage } });
25
+ expect(setDragImage).toHaveBeenCalledWith(source, 0, 0);
26
+ expect(onDragStart).toHaveBeenCalledWith(item.dragProps);
27
+ (0, react_2.act)(() => jest.runOnlyPendingTimers());
28
+ expect(source.classList.contains(disabledSourceClassName)).toBe(true);
29
+ react_2.fireEvent.dragEnd(source);
30
+ expect(source.classList.contains('dashkit-action-panel__item_dragging')).toBe(false);
31
+ expect(source.classList.contains(disabledSourceClassName)).toBe(false);
32
+ expect(onDragEnd).toHaveBeenCalledTimes(1);
33
+ jest.useRealTimers();
34
+ });
35
+ it('respects a custom drag image', () => {
36
+ const setDragImage = jest.fn();
37
+ (0, react_2.render)(react_1.default.createElement(DashKitDnDWrapper_1.DashKitDnDWrapper, { dragImageSrc: "data:image/png;base64,AAAA" },
38
+ react_1.default.createElement(ActionPanel_1.ActionPanel, { items: [item] })));
39
+ react_2.fireEvent.dragStart(react_2.screen.getByRole('button', { name: /Chart/ }), {
40
+ dataTransfer: { setDragImage },
41
+ });
42
+ expect(setDragImage.mock.calls[0][0]).toBeInstanceOf(HTMLImageElement);
43
+ });
44
+ });
45
+ //# sourceMappingURL=useDnDItemProps.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDnDItemProps.test.js","sourceRo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AAC,CAAC;QACH,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["/** @jest-environment jsdom */\n\nimport React from 'react';\n\nimport {act, fireEvent, render, screen} from '@testing-library/react';\n\nimport {ActionPanel} from '../../components/ActionPanel/ActionPanel';\nimport {DashKitDnDWrapper} from '../../components/DashKitDnDWrapper/DashKitDnDWrapper';\n\nconst item = {id: 'chart', title: 'Chart', icon: 'icon', dragProps: {type: 'chart'}};\n\ndescribe('ActionPanel drag preview', () => {\n it('captures the solid item before disabling the panel source and restores it on drag end', () => {\n jest.useFakeTimers();\n const onDragStart = jest.fn();\n const onDragEnd = jest.fn();\n const setDragImage = jest.fn();\n\n render(\n <DashKitDnDWrapper onDragStart={onDragStart} onDragEnd={onDragEnd}>\n <ActionPanel items={[item]} />\n </DashKitDnDWrapper>,\n );\n const source = screen.getByRole('button', {name: /Chart/});\n const disabledSourceClassName = 'dashkit-action-panel__item_dragging-source-disabled';\n\n setDragImage.mockImplementation(() => {\n expect(source.classList.contains('dashkit-action-panel__item_dragging')).toBe(true);\n expect(source.classList.contains(disabledSourceClassName)).toBe(false);\n });\n fireEvent.dragStart(source, {dataTransfer: {setDragImage}});\n expect(setDragImage).toHaveBeenCalledWith(source, 0, 0);\n expect(onDragStart).toHaveBeenCalledWith(item.dragProps);\n act(() => jest.runOnlyPendingTimers());\n expect(source.classList.contains(disabledSourceClassName)).toBe(true);\n\n fireEvent.dragEnd(source);\n expect(source.classList.contains('dashkit-action-panel__item_dragging')).toBe(false);\n expect(source.classList.contains(disabledSourceClassName)).toBe(false);\n expect(onDragEnd).toHaveBeenCalledTimes(1);\n jest.useRealTimers();\n });\n\n it('respects a custom drag image', () => {\n const setDragImage = jest.fn();\n render(\n <DashKitDnDWrapper dragImageSrc=\"data:image/png;base64,AAAA\">\n <ActionPanel items={[item]} />\n </DashKitDnDWrapper>,\n );\n\n fireEvent.dragStart(screen.getByRole('button', {name: /Chart/}), {\n dataTransfer: {setDragImage},\n });\n expect(setDragImage.mock.calls[0][0]).toBeInstanceOf(HTMLImageElement);\n });\n});\n"]}
@@ -9,7 +9,7 @@ const useDnDItemProps = (item) => {
9
9
  const onDragStart = react_1.default.useCallback((e) => {
10
10
  if (dragContext && item.dragProps) {
11
11
  dragContext.onDragStart(e, item.dragProps);
12
- e.dataTransfer.setDragImage(dragContext.dragImagePreview, 0, 0);
12
+ e.dataTransfer.setDragImage(dragContext.dragImagePreview || e.currentTarget, 0, 0);
13
13
  }
14
14
  }, [dragContext, item.dragProps]);
15
15
  const onDragEnd = react_1.default.useCallback((e) => {
@@ -1 +1 @@
1
- {"version":3,"file":"useDnDItemProps.js","sourceRoot":"../../../src","sources":["hooks/useDnDItemProps.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAG1B,iDAA6C;AAStC,MAAM,eAAe,GAAG,CAAC,IAAqB,EAAY,EAAE;IAC/D,MAAM,WAAW,GAAG,eAAK,CAAC,UAAU,CAAC,2BAAiB,CAAC,CAAC;IAExD,MAAM,WAAW,GAAG,eAAK,CAAC,WAAW,CACjC,CAAC,CAAkB,EAAE,EAAE;QACnB,IAAI,WAAW,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YAChC,WAAW,CAAC,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;YAC3C,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,WAAW,CAAC,gBAAgB,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACpE,CAAC;IACL,CAAC,EACD,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,CAChC,CAAC;IAEF,MAAM,SAAS,GAAG,eAAK,CAAC,WAAW,CAC/B,CAAC,CAAC,EAAE,EAAE;QACF,IAAI,WAAW,EAAE,CAAC;YACd,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC7B,CAAC;IACL,CAAC,EACD,CAAC,WAAW,CAAC,CAChB,CAAC;IAEF,IAAI,WAAW,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;QAChC,OAAO;YACH,SAAS,EAAE,IAAI;YACf,YAAY,EAAE,IAAI;YAClB,WAAW;YACX,SAAS;SACZ,CAAC;IACN,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAhCW,QAAA,eAAe,mBAgC1B","sourcesContent":["import React from 'react';\n\nimport {ActionPanelItem} from '../components';\nimport {DashKitDnDContext} from '../context';\n\ntype DndProps = null | {\n draggable: true;\n unselectable: 'on';\n onDragStart: React.DragEventHandler<HTMLDivElement>;\n onDragEnd: React.DragEventHandler<HTMLDivElement>;\n};\n\nexport const useDnDItemProps = (item: ActionPanelItem): DndProps => {\n const dragContext = React.useContext(DashKitDnDContext);\n\n const onDragStart = React.useCallback(\n (e: React.DragEvent) => {\n if (dragContext && item.dragProps) {\n dragContext.onDragStart(e, item.dragProps);\n e.dataTransfer.setDragImage(dragContext.dragImagePreview, 0, 0);\n }\n },\n [dragContext, item.dragProps],\n );\n\n const onDragEnd = React.useCallback<React.DragEventHandler<HTMLDivElement>>(\n (e) => {\n if (dragContext) {\n dragContext.onDragEnd(e);\n }\n },\n [dragContext],\n );\n\n if (dragContext && item.dragProps) {\n return {\n draggable: true,\n unselectable: 'on',\n onDragStart,\n onDragEnd,\n };\n }\n\n return null;\n};\n"]}
1
+ {"version":3,"file":"useDnDItemProps.js","sourceRoot":"../../../src","sources":["hooks/useDnDItemProps.ts"],"names":[],"mappings":";;;;AAAA,0DAA0B;AAG1B,iDAA6C;AAStC,MAAM,eAAe,GAAG,CAAC,IAAqB,EAAY,EAAE;IAC/D,MAAM,WAAW,GAAG,eAAK,CAAC,UAAU,CAAC,2BAAiB,CAAC,CAAC;IAExD,MAAM,WAAW,GAAG,eAAK,CAAC,WAAW,CACjC,CAAC,CAAkB,EAAE,EAAE;QACnB,IAAI,WAAW,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YAChC,WAAW,CAAC,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;YAC3C,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,WAAW,CAAC,gBAAgB,IAAI,CAAC,CAAC,aAAa,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACvF,CAAC;IACL,CAAC,EACD,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC,CAChC,CAAC;IAEF,MAAM,SAAS,GAAG,eAAK,CAAC,WAAW,CAC/B,CAAC,CAAC,EAAE,EAAE;QACF,IAAI,WAAW,EAAE,CAAC;YACd,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC7B,CAAC;IACL,CAAC,EACD,CAAC,WAAW,CAAC,CAChB,CAAC;IAEF,IAAI,WAAW,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;QAChC,OAAO;YACH,SAAS,EAAE,IAAI;YACf,YAAY,EAAE,IAAI;YAClB,WAAW;YACX,SAAS;SACZ,CAAC;IACN,CAAC;IAED,OAAO,IAAI,CAAC;AAChB,CAAC,CAAC;AAhCW,QAAA,eAAe,mBAgC1B","sourcesContent":["import React from 'react';\n\nimport {ActionPanelItem} from '../components';\nimport {DashKitDnDContext} from '../context';\n\ntype DndProps = null | {\n draggable: true;\n unselectable: 'on';\n onDragStart: React.DragEventHandler<HTMLDivElement>;\n onDragEnd: React.DragEventHandler<HTMLDivElement>;\n};\n\nexport const useDnDItemProps = (item: ActionPanelItem): DndProps => {\n const dragContext = React.useContext(DashKitDnDContext);\n\n const onDragStart = React.useCallback(\n (e: React.DragEvent) => {\n if (dragContext && item.dragProps) {\n dragContext.onDragStart(e, item.dragProps);\n e.dataTransfer.setDragImage(dragContext.dragImagePreview || e.currentTarget, 0, 0);\n }\n },\n [dragContext, item.dragProps],\n );\n\n const onDragEnd = React.useCallback<React.DragEventHandler<HTMLDivElement>>(\n (e) => {\n if (dragContext) {\n dragContext.onDragEnd(e);\n }\n },\n [dragContext],\n );\n\n if (dragContext && item.dragProps) {\n return {\n draggable: true,\n unselectable: 'on',\n onDragStart,\n onDragEnd,\n };\n }\n\n return null;\n};\n"]}
@@ -1 +1 @@
1
- {"version":"10.4.4","type":"commonjs","sideEffects":["*.scss","*.css"]}
1
+ {"version":"10.5.1","type":"commonjs","sideEffects":["*.scss","*.css"]}
@@ -427,7 +427,7 @@ interface DashKitDnDWrapperProps {
427
427
  }
428
428
  ```
429
429
 
430
- - **dragImageSrc**: Drag image preview, by default used transparent 1px png base64
430
+ - **dragImageSrc**: Optional custom drag image. By default, the dragged ActionPanel item is shown as the preview.
431
431
  - **onDragStart**: Callback called when element is dragged from ActionPanel
432
432
  - **onDragEnd**: Callback called when element dropped or drag canceled
433
433
 
@@ -490,7 +490,9 @@ const onDrop = (dropProps: ItemDropProps) => {
490
490
  | `--dashkit-action-panel-item-color` | Backgroud color |
491
491
  | `--dashkit-action-panel-item-text-color` | Text color |
492
492
  | `--dashkit-action-panel-item-color-hover` | Hover backgroud color |
493
+ | `--dashkit-action-panel-item-color-dragging` | Drag background color |
493
494
  | `--dashkit-action-panel-item-text-color-hover` | Hover text color |
495
+ | `--dashkit-action-panel-item-text-color-dragging` | Drag text color |
494
496
  | Overlay variables | |
495
497
  | `--dashkit-overlay-border-color` | Border color |
496
498
  | `--dashkit-overlay-color` | Background color |
@@ -1,20 +1,25 @@
1
1
  .dashkit-action-panel {
2
- --_--dashkit-action-panel-color: var(--dashkit-action-panel-color, var(--g-color-base-float));
3
- --_--dashkit-action-panel-border-color: var(
4
- --dashkit-action-panel-border-color,
5
- var(--g-color-base-brand)
2
+ --_--dashkit-action-panel-color: var(
3
+ --dashkit-action-panel-color,
4
+ var(--g-color-base-float-heavy)
6
5
  );
6
+ --_--dashkit-action-panel-border-color: var(--dashkit-action-panel-border-color, transparent);
7
7
  --_--dashkit-action-panel-border-radius: var(
8
8
  --dashkit-action-panel-border-radius,
9
- var(--g-border-radius-xl)
9
+ var(--g-border-radius-2xl, 16px)
10
10
  );
11
11
  background-color: var(--_--dashkit-action-panel-color);
12
+ backdrop-filter: blur(18px);
12
13
  position: fixed;
13
14
  bottom: 20px;
14
15
  display: flex;
16
+ width: max-content;
17
+ max-width: calc(100vw - 40px);
18
+ overflow-x: auto;
15
19
  border-radius: var(--_--dashkit-action-panel-border-radius);
16
- border: 2px solid var(--_--dashkit-action-panel-border-color);
17
- padding: 8px;
20
+ outline: 2px solid var(--_--dashkit-action-panel-border-color);
21
+ outline-offset: -2px;
22
+ padding: 6px;
18
23
  gap: 0;
19
24
  left: 50%;
20
25
  transform: translateX(-50%) translateY(0);
@@ -40,46 +45,70 @@
40
45
  --_--dashkit-action-panel-item-color: var(--dashkit-action-panel-item-color, transparent);
41
46
  --_--dashkit-action-panel-item-text-color: var(
42
47
  --dashkit-action-panel-item-text-color,
43
- var(--g-color-text-primary)
48
+ var(--g-color-text-light-primary)
44
49
  );
45
50
  --_--dashkit-action-panel-item-color-hover: var(
46
51
  --dashkit-action-panel-item-color-hover,
47
- var(--g-color-base-simple-hover)
52
+ var(--g-color-base-light-simple-hover)
53
+ );
54
+ --_--dashkit-action-panel-item-color-dragging: var(
55
+ --dashkit-action-panel-item-color-dragging,
56
+ var(--g-color-base-float-heavy)
48
57
  );
49
58
  --_--dashkit-action-panel-item-text-color-hover: var(
50
59
  --dashkit-action-panel-item-text-color-hover,
51
- var(--g-color-text-primary)
60
+ var(--g-color-text-light-primary)
52
61
  );
53
- height: 68px;
54
- width: 98px;
62
+ min-height: 40px;
63
+ max-width: 200px;
64
+ flex: 0 0 auto;
55
65
  display: flex;
56
- flex-direction: column;
66
+ gap: 4px;
57
67
  justify-content: center;
58
68
  align-items: center;
59
- transition: 300ms color ease-in-out, 300ms background-color ease-in-out;
60
- border-radius: 6px;
61
- padding: 0 12px;
69
+ border-radius: var(--g-border-radius-xl);
70
+ padding: 0 16px;
62
71
  box-sizing: border-box;
63
72
  white-space: nowrap;
64
- overflow: hidden;
65
73
  background-color: var(--_--dashkit-action-panel-item-color);
66
74
  color: var(--_--dashkit-action-panel-item-text-color);
67
- will-change: color, backgroung-color;
68
- }
69
- .dashkit-action-panel__item:hover {
70
75
  cursor: pointer;
76
+ }
77
+ .dashkit-action-panel__item:hover, .dashkit-action-panel__item:focus-visible {
71
78
  background-color: var(--_--dashkit-action-panel-item-color-hover);
72
79
  color: var(--_--dashkit-action-panel-item-text-color-hover);
73
80
  }
81
+ .dashkit-action-panel__item_draggable {
82
+ transform: translate(0, 0);
83
+ cursor: grab;
84
+ }
85
+ .dashkit-action-panel__item_draggable:hover, .dashkit-action-panel__item_draggable:active {
86
+ transform: translateY(-2px);
87
+ box-shadow: 0 3px 5px rgba(0, 0, 0, 0.15);
88
+ }
89
+ .dashkit-action-panel__item_draggable:active {
90
+ cursor: grabbing;
91
+ }
92
+ .dashkit-action-panel__item_dragging, .dashkit-action-panel__item_dragging:hover {
93
+ transform: translate(0, 0);
94
+ background-color: var(--_--dashkit-action-panel-item-color-dragging);
95
+ color: var(--dashkit-action-panel-item-text-color-dragging, var(--g-color-text-light-primary));
96
+ }
97
+ .dashkit-action-panel__item_dragging-source-disabled, .dashkit-action-panel__item_dragging-source-disabled:hover {
98
+ opacity: 0.5;
99
+ box-shadow: none;
100
+ }
74
101
  .dashkit-action-panel__icon {
75
- margin-bottom: 4px;
102
+ display: flex;
103
+ flex: 0 0 auto;
104
+ align-items: center;
105
+ justify-content: center;
76
106
  }
77
107
  .dashkit-action-panel__title {
78
- font-size: 13px;
108
+ min-width: 0;
109
+ font-size: 12px;
79
110
  font-weight: 400;
80
111
  line-height: 16px;
81
- max-width: 100%;
82
- white-space: nowrap;
83
112
  overflow: hidden;
84
113
  text-overflow: ellipsis;
85
114
  }
@@ -7,7 +7,33 @@ import "./ActionPanel.css";
7
7
  const b = cn('dashkit-action-panel');
8
8
  export const ActionPanelItemContainer = ({ item }) => {
9
9
  const dndProps = useDnDItemProps(item);
10
- return (React.createElement("div", Object.assign({ role: "button", className: b('item', { draggable: Boolean(dndProps) }, item.className), onClick: item.onClick, "data-qa": item.qa }, dndProps),
10
+ const draggingClassName = `${b('item')}_dragging`;
11
+ const disabledSourceClassName = `${b('item')}_dragging-source-disabled`;
12
+ const disableSourceTimer = React.useRef(null);
13
+ React.useEffect(() => () => {
14
+ if (disableSourceTimer.current !== null) {
15
+ clearTimeout(disableSourceTimer.current);
16
+ }
17
+ }, []);
18
+ const onDragStart = (event) => {
19
+ const source = event.currentTarget;
20
+ source.classList.add(draggingClassName);
21
+ dndProps === null || dndProps === void 0 ? void 0 : dndProps.onDragStart(event);
22
+ // The native drag image captures the solid item before the panel source is disabled.
23
+ disableSourceTimer.current = setTimeout(() => {
24
+ source.classList.add(disabledSourceClassName);
25
+ disableSourceTimer.current = null;
26
+ }, 0);
27
+ };
28
+ const onDragEnd = (event) => {
29
+ if (disableSourceTimer.current !== null) {
30
+ clearTimeout(disableSourceTimer.current);
31
+ disableSourceTimer.current = null;
32
+ }
33
+ event.currentTarget.classList.remove(draggingClassName, disabledSourceClassName);
34
+ dndProps === null || dndProps === void 0 ? void 0 : dndProps.onDragEnd(event);
35
+ };
36
+ return (React.createElement("div", Object.assign({ role: "button", className: b('item', { draggable: Boolean(dndProps) }, item.className), onClick: item.onClick, "data-qa": item.qa }, dndProps, { onDragStart: dndProps ? onDragStart : undefined, onDragEnd: dndProps ? onDragEnd : undefined }),
11
37
  React.createElement("div", { className: b('icon') }, item.icon),
12
38
  React.createElement("div", { className: b('title'), title: item.title }, item.title)));
13
39
  };