@wix/editor-react-components 1.2400.0 → 1.2401.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.
@@ -5,7 +5,7 @@ import { d as directionStyles } from "../chunks/direction.module.js";
5
5
  import { p as presetWrapperStyles } from "../chunks/presetWrapper.module.js";
6
6
  import { D as DEFAULT_ITEMS_PER_ROW, C as COLUMN_COUNT_CSS_VAR, T as TestIds, s as semanticClassNames } from "../chunks/constants23.js";
7
7
  import React__default, { useState, useRef, useEffect, useCallback, forwardRef } from "react";
8
- const useAsyncLoadMore = (onLoadMore, itemsLength) => {
8
+ const useAsyncLoadMore = (onLoadMore, itemsLength, isLoadingProp) => {
9
9
  const [isLoading, setIsLoading] = useState(false);
10
10
  const [hasMore, setHasMore] = useState(true);
11
11
  const itemsLengthAtLastLoad = useRef(null);
@@ -32,7 +32,7 @@ const useAsyncLoadMore = (onLoadMore, itemsLength) => {
32
32
  }
33
33
  }
34
34
  }, [onLoadMore, itemsLength]);
35
- return { isLoading, handleLoadMore, hasMore };
35
+ return { isLoading: isLoadingProp ?? isLoading, handleLoadMore, hasMore };
36
36
  };
37
37
  const useLoadMoreObserver = ({
38
38
  enabled,
@@ -477,13 +477,15 @@ const Repeater = (props) => {
477
477
  a11y,
478
478
  renderItem = () => /* @__PURE__ */ jsx(Fragment, {}),
479
479
  items = DEFAULT_ITEMS,
480
+ isLoading: isLoadingProp,
480
481
  onLoadMore,
481
482
  emptyState
482
483
  } = props;
483
484
  const presetsWrapperProps = ((_a = props.wix) == null ? void 0 : _a.presetsWrapperProps) || {};
484
485
  const { isLoading, handleLoadMore, hasMore } = useAsyncLoadMore(
485
486
  onLoadMore,
486
- items.length
487
+ items.length,
488
+ isLoadingProp
487
489
  );
488
490
  const [ulRef, itemsPerRow] = useItemsPerRow(!!onLoadMore);
489
491
  const sentinelRef = useLoadMoreObserver({
@@ -58,6 +58,7 @@ export declare const DisplayNames: {
58
58
  readonly emptyState: "Empty State";
59
59
  readonly emptyState_title: "Title";
60
60
  readonly emptyState_description: "Description";
61
+ readonly isLoading: "Loading State";
61
62
  readonly loadMore: "Load More";
62
63
  };
63
64
  readonly customActions: {
@@ -1,4 +1,4 @@
1
- export declare const useAsyncLoadMore: (onLoadMore: (() => Promise<void>) | undefined, itemsLength: number) => {
1
+ export declare const useAsyncLoadMore: (onLoadMore: (() => Promise<void>) | undefined, itemsLength: number, isLoadingProp?: boolean) => {
2
2
  isLoading: boolean;
3
3
  handleLoadMore: () => Promise<void>;
4
4
  hasMore: boolean;
@@ -36,7 +36,7 @@ const manifest = {
36
36
  hide: [presets.slider_vertical, presets.cards_off]
37
37
  },
38
38
  data: {
39
- hide: ["emptyState", "direction", "activeItem"]
39
+ hide: ["emptyState", "direction", "activeItem", "isLoading"]
40
40
  },
41
41
  actions: {
42
42
  hide: ["manageItems"]
@@ -72,6 +72,10 @@ const manifest = {
72
72
  }
73
73
  }
74
74
  },
75
+ isLoading: {
76
+ displayName: DisplayNames.root.data.isLoading,
77
+ dataType: DATA.DATA_TYPE.booleanValue
78
+ },
75
79
  onLoadMore: {
76
80
  displayName: DisplayNames.root.data.loadMore,
77
81
  dataType: DATA.DATA_TYPE.function,
@@ -10,6 +10,7 @@ export interface RepeaterProps {
10
10
  a11y?: A11y;
11
11
  renderItem?: (itemId: string, itemIndex: number, itemLength: number) => React.JSX.Element;
12
12
  items?: Array<string>;
13
+ isLoading?: boolean;
13
14
  onLoadMore?: () => Promise<void>;
14
15
  emptyState?: EmptyState;
15
16
  wix?: {
@@ -27,6 +27,7 @@ const DisplayNames = {
27
27
  emptyState: "Empty State",
28
28
  emptyState_title: "Title",
29
29
  emptyState_description: "Description",
30
+ isLoading: "Loading State",
30
31
  loadMore: "Load More"
31
32
  },
32
33
  customActions: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/editor-react-components",
3
- "version": "1.2400.0",
3
+ "version": "1.2401.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": "299cd329f5f53606d39889a8155fb3c553781a880b7e09b2c577f308"
199
+ "falconPackageHash": "8a86db11e6d53840acbb40494b00a8f6dda06f71b121a8f2a9d390b2"
200
200
  }