@wix/editor-react-components 1.2406.0 → 1.2408.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.
@@ -2367,7 +2367,7 @@ const HamburgerMenu = ({
2367
2367
  /* @__PURE__ */ jsx(
2368
2368
  NavbarMenu,
2369
2369
  {
2370
- id: `${id}-hamburger-modal`,
2370
+ id,
2371
2371
  className: classes.navbar,
2372
2372
  ...navbarProps,
2373
2373
  onItemClick: (event, item2) => {
@@ -468,6 +468,12 @@ const LoadMoreButton = ({
468
468
  }
469
469
  );
470
470
  const DEFAULT_ITEMS = ["1", "2", "3"];
471
+ const getItemKey = (item2, index) => {
472
+ if (typeof item2 === "string") {
473
+ return `${item2}-${index}`;
474
+ }
475
+ return (item2 == null ? void 0 : item2._id) ?? (item2 == null ? void 0 : item2.id) ?? index;
476
+ };
471
477
  const Repeater = (props) => {
472
478
  var _a;
473
479
  const {
@@ -526,7 +532,7 @@ const Repeater = (props) => {
526
532
  className: clsx(semanticClassNames.item, styles.item),
527
533
  children: renderItem(item2, index, items.length)
528
534
  },
529
- item2
535
+ getItemKey(item2, index)
530
536
  )),
531
537
  isLoading && Array.from({ length: itemsPerRow }, (_, i) => /* @__PURE__ */ jsx(
532
538
  "li",
@@ -3,13 +3,18 @@ export interface EmptyState {
3
3
  title?: string;
4
4
  description?: string;
5
5
  }
6
+ export type RepeaterItem = string | {
7
+ _id?: string;
8
+ id?: string;
9
+ [key: string]: unknown;
10
+ };
6
11
  export interface RepeaterProps {
7
12
  id?: string;
8
13
  className?: string;
9
14
  direction?: Direction;
10
15
  a11y?: A11y;
11
- renderItem?: (itemId: string, itemIndex: number, itemLength: number) => React.JSX.Element;
12
- items?: Array<string>;
16
+ renderItem?: (item: RepeaterItem, itemIndex: number, itemLength: number) => React.JSX.Element;
17
+ items?: Array<RepeaterItem>;
13
18
  isLoading?: boolean;
14
19
  onLoadMore?: () => Promise<void>;
15
20
  emptyState?: EmptyState;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/editor-react-components",
3
- "version": "1.2406.0",
3
+ "version": "1.2408.0",
4
4
  "description": "React components for the Wix Editor",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -196,5 +196,5 @@
196
196
  "registry": "https://registry.npmjs.org/",
197
197
  "access": "public"
198
198
  },
199
- "falconPackageHash": "32d6c21cc6efa9073361678aba88b174b371e8a28135b3b555b20fe4"
199
+ "falconPackageHash": "dc8f96a2272389612367ae80c0b1068be9a80dead372cb57f78185d8"
200
200
  }