@indigoai/indigo-design-system 0.10.24 → 0.10.25

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.
@@ -0,0 +1,5 @@
1
+ declare function ProductsBlockIcon({ hideRect, ...props }: {
2
+ [x: string]: any;
3
+ hideRect: any;
4
+ }): import("react/jsx-runtime").JSX.Element;
5
+ export default ProductsBlockIcon;
@@ -1,9 +1,9 @@
1
- import { Blocks, BuilderBlockToolbarProps } from './types';
2
1
  import { default as React } from 'react';
2
+ import { BuilderBlockToolbarProps, ToolbarButtonProps } from './types';
3
3
 
4
- export declare const BuilderBlockToolbarContext: React.NamedExoticComponent<import('@dnd-kit/core').DndContextProps>;
4
+ declare const ToolbarButton: React.ForwardRefExoticComponent<ToolbarButtonProps & React.RefAttributes<HTMLButtonElement>>;
5
5
  /**
6
6
  * Builder block toolbar component
7
7
  */
8
- export declare const BuilderBlockToolbar: React.ForwardRefExoticComponent<Omit<BuilderBlockToolbarProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
- export declare function renderBlockIcon(type: Blocks): import("react/jsx-runtime").JSX.Element | undefined;
8
+ declare const BuilderBlockToolbar: React.ForwardRefExoticComponent<Omit<BuilderBlockToolbarProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
+ export { BuilderBlockToolbar, ToolbarButton };
@@ -0,0 +1,5 @@
1
+ import { default as React } from 'react';
2
+
3
+ export declare function getDefaultBlockTooltip(type: string): React.ReactElement;
4
+ export declare function getBlockIcon(type: string): React.ElementType;
5
+ export declare function getDefaultBlocklabel(type: string): string;
@@ -1,2 +1,3 @@
1
- export { BuilderBlockToolbar, BuilderBlockToolbarContext } from './builder-block-toolbar';
1
+ export { BuilderBlockToolbar, ToolbarButton } from './builder-block-toolbar';
2
+ export { getBlockIcon } from './helpers';
2
3
  export type { ToolbarSection, BuilderBlockToolbarProps, DraggedToolbarBlock, BlockNames, Blocks, ToolbarBlocks, } from './types';
@@ -0,0 +1,17 @@
1
+ import { default as React } from 'react';
2
+
3
+ type Placement = 'top' | 'bottom' | 'left' | 'right';
4
+ type InfoProps = {
5
+ text: React.ReactElement;
6
+ disabled?: boolean;
7
+ preferPlace?: Placement;
8
+ offset?: number;
9
+ active?: boolean;
10
+ wait?: number;
11
+ children: React.ReactElement;
12
+ className?: string;
13
+ hover?: boolean;
14
+ leaveOpen?: number;
15
+ };
16
+ declare const Info: React.FC<InfoProps>;
17
+ export default Info;
@@ -1,29 +1,76 @@
1
1
  import { MESSAGE_BLOCKS, LOGIC_BLOCK } from './constants';
2
- import { QualityMetricIconProps } from '../quality-metric-icon';
3
- import { ComponentPropsWithRef } from 'react';
2
+ import { default as React, ComponentPropsWithRef } from 'react';
4
3
 
5
- export type BlockNames = 'message' | 'logic';
4
+ export type BlockNames = 'message' | 'logic' | 'action' | 'utilities';
6
5
  export type MessageBlocks = (typeof MESSAGE_BLOCKS)[number];
7
6
  export type LogicBlocks = (typeof LOGIC_BLOCK)[number];
8
7
  export type Blocks = MessageBlocks | LogicBlocks;
9
- export type ToolbarBlocks = {
8
+ export type ToolbarBlocks = string;
9
+ export type ToolbarSection = {
10
+ name: BlockNames;
10
11
  label: string;
11
- type: Blocks;
12
+ blocks?: ToolbarBlocks[];
13
+ };
14
+ type BlockPermissions = {
15
+ text: boolean;
16
+ image: boolean;
17
+ video: boolean;
18
+ videods: boolean;
19
+ note: boolean;
20
+ generative: boolean;
21
+ agent: boolean;
22
+ card: boolean;
23
+ redirect: boolean;
24
+ api: boolean;
25
+ capture: boolean;
26
+ setValues: boolean;
27
+ conditional: boolean;
28
+ contactRequest: boolean;
29
+ agentTakeover: boolean;
30
+ products: boolean;
31
+ mail: boolean;
32
+ upload: boolean;
33
+ quickReply: boolean;
12
34
  };
13
35
  export type BuilderBlockToolbarProps = {
14
- qualityMetricIcon?: QualityMetricIconProps;
15
- onQualityMetricIconClicked?: () => void;
16
- onToggleToolbarLock?: (isLocked: boolean) => void;
17
- isToolbarLocked?: boolean;
18
- inputPlaceholder?: string;
36
+ className?: string;
37
+ addBlock: (type: string) => void;
38
+ blockPermissions: BlockPermissions;
39
+ renderDraggableButton: (props: DraggableButtonProps) => React.ReactNode;
19
40
  sections: ToolbarSection[];
41
+ searchPlaceholder?: string;
42
+ itemBeingDragged: string;
20
43
  } & ComponentPropsWithRef<'div'>;
21
- export type ToolbarSection = {
22
- name: BlockNames;
23
- label: string;
24
- blocks?: ToolbarBlocks[];
44
+ export type ToolbarSectionProps = {
45
+ name: string;
46
+ renderDraggableButton: (props: DraggableButtonProps) => React.ReactNode;
47
+ sections: ToolbarSection[];
48
+ blocks: ToolbarBlocks[];
49
+ addBlock: (type: string) => void;
50
+ dragIndex: number;
51
+ };
52
+ export type ToolbarButtonProps = {
53
+ type: string;
54
+ section: string;
55
+ addBlock: (type: string) => void;
56
+ dragAttributes?: any;
57
+ dragListeners?: any;
58
+ isDragging?: boolean;
59
+ dragOverlay?: boolean;
60
+ getBlockTooltip?: (type: string) => React.ReactElement;
61
+ getBlockLabel?: (type: string) => React.ReactElement;
62
+ noInfo?: boolean;
63
+ index?: number;
64
+ activeIndex?: number;
25
65
  };
66
+ export type DraggableButtonProps = {
67
+ type: ToolbarBlocks;
68
+ section: string;
69
+ addBlock: (type: string) => void;
70
+ activeIndex: number;
71
+ } & Omit<Partial<ToolbarButtonProps>, 'type'>;
26
72
  export type DraggedToolbarBlock = {
27
73
  block: ToolbarBlocks;
28
74
  name: BlockNames;
29
75
  };
76
+ export {};
package/dist/index.d.ts CHANGED
@@ -21,7 +21,7 @@ export { Block } from './components/block-builders/block';
21
21
  export type { BlockProps } from './components/block-builders/block';
22
22
  export { Breadcrumb } from './components/breadcrumb';
23
23
  export type { BreadcrumbItem, BreadcrumbProps } from './components/breadcrumb';
24
- export { BuilderBlockToolbar, BuilderBlockToolbarContext } from './components/builder-block-toolbar';
24
+ export { BuilderBlockToolbar, ToolbarButton, getBlockIcon } from './components/builder-block-toolbar';
25
25
  export type { ToolbarSection, BuilderBlockToolbarProps, DraggedToolbarBlock, BlockNames, Blocks, ToolbarBlocks, } from './components/builder-block-toolbar';
26
26
  export { Button } from './components/button';
27
27
  export type { ButtonProps } from './components/button';