@cloudscape-design/board-components 3.0.11 → 3.0.13

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/board/internal.js CHANGED
@@ -186,14 +186,14 @@ export function InternalBoard({ items, renderItem, onItemsChange, empty, i18nStr
186
186
  else {
187
187
  delete itemContainerRef.current[item.id];
188
188
  }
189
- }, item: item, transform: transforms[item.id], inTransition: !!layoutShift, placed: true, acquired: item.id === (acquiredItem === null || acquiredItem === void 0 ? void 0 : acquiredItem.id), getItemSize: () => ({
189
+ }, item: item, transform: transforms[item.id], inTransition: !!transition || !!removeTransition, placed: true, acquired: item.id === (acquiredItem === null || acquiredItem === void 0 ? void 0 : acquiredItem.id), getItemSize: () => ({
190
190
  width: gridContext.getWidth(itemSize.width),
191
191
  minWidth: gridContext.getWidth(getMinColumnSpan(item, columns)),
192
192
  maxWidth: gridContext.getWidth(itemMaxSize.width),
193
193
  height: gridContext.getHeight(itemSize.height),
194
194
  minHeight: gridContext.getHeight(getMinRowSpan(item)),
195
195
  maxHeight: gridContext.getHeight(itemMaxSize.height),
196
- }), onKeyMove: onItemMove, children: renderItem(item, { removeItem: () => removeItemAction(item) }) }, item.id));
196
+ }), onKeyMove: onItemMove, children: () => renderItem(item, { removeItem: () => removeItemAction(item) }) }, item.id));
197
197
  });
198
198
  return children;
199
199
  } })) : (empty) }), _jsx(LiveRegion, { children: announcement })] }));
@@ -1,4 +1,4 @@
1
1
  export var PACKAGE_SOURCE = "board-components";
2
- export var PACKAGE_VERSION = "3.0.0 (80489570)";
2
+ export var PACKAGE_VERSION = "3.0.0 (17387551)";
3
3
  export var THEME = "open-source-visual-refresh";
4
4
  export var ALWAYS_VISUAL_REFRESH = true;
@@ -44,7 +44,7 @@ export interface ItemContainerProps {
44
44
  maxHeight: number;
45
45
  };
46
46
  onKeyMove?(direction: Direction): void;
47
- children: ReactNode;
47
+ children: () => ReactNode;
48
48
  }
49
49
  export declare const ItemContainer: import("react").ForwardRefExoticComponent<ItemContainerProps & import("react").RefAttributes<ItemContainerRef>>;
50
50
  export {};
@@ -253,8 +253,13 @@ function ItemContainerComponent({ item, placed, acquired, inTransition, transfor
253
253
  useImperativeHandle(ref, () => ({
254
254
  focusDragHandle: () => { var _a; return (_a = dragHandleRef.current) === null || _a === void 0 ? void 0 : _a.focus(); },
255
255
  }));
256
+ const isActive = (!!transition && !transition.isBorrowed) || !!acquired;
257
+ const childrenRef = useRef(null);
258
+ if (!inTransition || isActive) {
259
+ childrenRef.current = children();
260
+ }
256
261
  return (_jsx("div", { ref: itemRef, className: clsx(styles.root, ...itemTransitionClassNames), style: itemTransitionStyle, "data-item-id": item.id, onBlur: onBlur, children: _jsx(ItemContext.Provider, { value: {
257
- isActive: (!!transition && !transition.isBorrowed) || !!acquired,
262
+ isActive,
258
263
  dragHandle: {
259
264
  ref: dragHandleRef,
260
265
  onPointerDown: onDragHandlePointerDown,
@@ -266,5 +271,5 @@ function ItemContainerComponent({ item, placed, acquired, inTransition, transfor
266
271
  onKeyDown: onResizeHandleKeyDown,
267
272
  }
268
273
  : null,
269
- }, children: children }) }));
274
+ }, children: childrenRef.current }) }));
270
275
  }
@@ -1,3 +1,3 @@
1
1
  {
2
- "commit": "80489570231464cdf039fe26f27deedddecb1858"
2
+ "commit": "17387551fab301debab95e32addc9385e2196c84"
3
3
  }
@@ -68,7 +68,7 @@ export function InternalItemsPalette({ items, renderItem, i18nStrings, __interna
68
68
  }
69
69
  const { width, height } = dropContext.scale(item);
70
70
  return { width, minWidth: width, maxWidth: width, height, minHeight: height, maxHeight: height };
71
- }, children: renderItem(item, {
71
+ }, children: () => renderItem(item, {
72
72
  showPreview: (dropState === null || dropState === void 0 ? void 0 : dropState.id) === item.id && dropState.isExpanded,
73
73
  }) }, item.id))) }) }), _jsx(LiveRegion, { children: announcement })] }));
74
74
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudscape-design/board-components",
3
- "version": "3.0.11",
3
+ "version": "3.0.13",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/cloudscape-design/board-components.git"