@sproutsocial/seeds-react-menu 1.6.0 → 1.6.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.
@@ -8,14 +8,14 @@ CLI Target: es2022
8
8
  CLI Cleaning output folder
9
9
  CJS Build start
10
10
  ESM Build start
11
- CJS dist/index.js 144.18 KB
12
- CJS dist/index.js.map 371.82 KB
13
- CJS ⚡️ Build success in 508ms
14
- ESM dist/esm/index.js 134.33 KB
15
- ESM dist/esm/index.js.map 370.55 KB
16
- ESM ⚡️ Build success in 509ms
11
+ CJS dist/index.js 144.30 KB
12
+ CJS dist/index.js.map 371.92 KB
13
+ CJS ⚡️ Build success in 706ms
14
+ ESM dist/esm/index.js 134.40 KB
15
+ ESM dist/esm/index.js.map 370.64 KB
16
+ ESM ⚡️ Build success in 709ms
17
17
  DTS Build start
18
- DTS ⚡️ Build success in 14218ms
19
- DTS dist/index.d.ts 38.87 KB
20
- DTS dist/index.d.mts 38.87 KB
21
- Done in 16.75s.
18
+ DTS ⚡️ Build success in 15887ms
19
+ DTS dist/index.d.ts 39.00 KB
20
+ DTS dist/index.d.mts 39.00 KB
21
+ Done in 19.66s.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @sproutsocial/seeds-react-menu
2
2
 
3
+ ## 1.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 70e4ee7: [DS-3753] Fix handling of conditional items in menu groups
8
+
3
9
  ## 1.6.0
4
10
 
5
11
  ### Minor Changes
package/dist/esm/index.js CHANGED
@@ -2139,10 +2139,11 @@ var walkAllChildren = (children, callback) => {
2139
2139
  if (element === null || element === void 0) return;
2140
2140
  callback(element, parents2);
2141
2141
  const newParents = [...parents2, element];
2142
- const children2 = element.props?.children;
2143
- React4.Children.toArray(children2).forEach((child) => {
2144
- walk(child, newParents);
2145
- });
2142
+ if (React4.isValidElement(element) && element.props?.children) {
2143
+ React4.Children.toArray(element.props.children).forEach((child) => {
2144
+ walk(child, newParents);
2145
+ });
2146
+ }
2146
2147
  };
2147
2148
  const parents = [];
2148
2149
  React4.Children.toArray(children).forEach((child) => {
@@ -2186,21 +2187,20 @@ var addItemsFromGroup = ({
2186
2187
  });
2187
2188
  });
2188
2189
  } else if (menuGroup.props.children) {
2189
- let children = menuGroup.props.children;
2190
- if (!Array.isArray(children)) {
2191
- children = [children];
2192
- }
2190
+ const children = React4.Children.toArray(menuGroup.props.children);
2193
2191
  children.forEach((menuItem) => {
2194
- addMenuItem({
2195
- itemProps: {
2196
- id: menuItem.props.id,
2197
- disabled: menuItem.props.disabled,
2198
- menuItemProps: menuItem.props,
2199
- menuGroupProps: menuGroup.props
2200
- },
2201
- allMenuItems,
2202
- menuItemsMap
2203
- });
2192
+ if (React4.isValidElement(menuItem)) {
2193
+ addMenuItem({
2194
+ itemProps: {
2195
+ id: menuItem.props.id,
2196
+ disabled: menuItem.props.disabled,
2197
+ menuItemProps: menuItem.props,
2198
+ menuGroupProps: menuGroup.props
2199
+ },
2200
+ allMenuItems,
2201
+ menuItemsMap
2202
+ });
2203
+ }
2204
2204
  });
2205
2205
  }
2206
2206
  };