@prismicio/editor-ui 0.4.50 → 0.4.51

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.
@@ -7,7 +7,7 @@ export interface GroupProps<ITEM> {
7
7
  maxItems?: number;
8
8
  getItemKey: (item: ITEM) => string;
9
9
  children: (item: ITEM, index: number) => ReactNode;
10
- onAddItem?: () => void;
10
+ onAddItem?: (atIndex: number) => void;
11
11
  dnd?: {
12
12
  scrollOffsetTop?: number;
13
13
  /**
@@ -1,15 +1,13 @@
1
- import type { ReactNode } from "react";
1
+ import { type ReactNode } from "react";
2
2
  interface Props {
3
- index?: number;
3
+ index: number;
4
4
  title?: string;
5
- onMove?: (params: {
5
+ children?: ReactNode;
6
+ onMove?: (args: {
6
7
  index: number;
7
8
  offset: number;
8
9
  }) => void;
9
- onDelete?: (params: {
10
- index: number;
11
- }) => void;
12
- children?: ReactNode;
10
+ onDelete?: (index: number) => void;
13
11
  }
14
12
  export declare function GroupItem(props: Props): JSX.Element;
15
13
  export {};
@@ -1,13 +1,17 @@
1
- import { type ComponentProps } from "react";
2
- declare const GroupContext: import("react").Context<{
3
- itemsCount: number;
4
- }>;
5
- export declare const GroupContextProvider: ({ itemsCount, children }: Pick<import("react").ProviderProps<{
6
- itemsCount: number;
7
- }>, "children"> & {
8
- itemsCount: number;
9
- }) => JSX.Element;
10
- export declare const useGroupContext: () => {
11
- itemsCount: number;
12
- };
1
+ import { type ReactNode } from "react";
2
+ interface GroupProviderProps {
3
+ children: ReactNode;
4
+ itemCount: number;
5
+ draggable: boolean;
6
+ onAddItem?: (atIndex: number) => void;
7
+ }
8
+ export declare function GroupProvider(props: GroupProviderProps): JSX.Element;
9
+ interface GroupContextValue {
10
+ itemCount: number;
11
+ draggable: boolean;
12
+ activeItem?: number;
13
+ onActiveItemChange: (index: number, active: boolean) => void;
14
+ onAddItem?: (atIndex: number) => void;
15
+ }
16
+ export declare function useGroup(): GroupContextValue;
13
17
  export {};