caplink-saas-ui-shared-component-library 0.4.5 → 0.4.7

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,2 @@
1
+ /// <reference types="react" />
2
+ export declare function DagContainer(props: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ export type DagSidebarHeaderProps = {
2
+ title: string;
3
+ onClose?: () => void;
4
+ };
5
+ export declare function DagSidebarHeader(props: DagSidebarHeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { PropsWithChildren } from 'react';
2
+
3
+ export type DagSidebarProps = PropsWithChildren<{
4
+ isOpen: boolean;
5
+ onOpen: () => void;
6
+ closedTitle?: string;
7
+ }>;
8
+ export declare function DagSidebar(props: DagSidebarProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { DagSidebar, DagSidebarProps } from './dag-sidebar';
2
+ import { DagSidebarHeader, DagSidebarHeaderProps } from './dag-sidebar-header';
3
+
4
+ export { DagSidebar, DagSidebarHeader };
5
+ export type { DagSidebarProps, DagSidebarHeaderProps };
@@ -0,0 +1,7 @@
1
+ import { ReactFlowProps } from '@xyflow/react';
2
+
3
+ export type DagProps = {
4
+ initialNodes?: ReactFlowProps['nodes'];
5
+ initialEdges?: ReactFlowProps['edges'];
6
+ };
7
+ export declare function Dag(props: DagProps & Omit<ReactFlowProps, 'nodes' | 'edges'>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { EdgeProps } from '@xyflow/react';
2
+
3
+ export declare function DefaultEdge({ sourceX, sourceY, targetX, targetY, sourcePosition, targetPosition, style, markerEnd, source, target, }: EdgeProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { NodeProps, Node } from '@xyflow/react';
2
+
3
+ export type NodeDataProps = {
4
+ content: React.ReactNode;
5
+ className?: string;
6
+ } & Record<string, unknown>;
7
+ export declare function DefaultNode({ id, data }: NodeProps<Node<NodeDataProps>>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { DefaultNode, NodeDataProps } from './default-node';
2
+ import { DefaultEdge } from './default-edge';
3
+
4
+ export { DefaultNode, DefaultEdge };
5
+ export type { NodeDataProps };
@@ -0,0 +1,5 @@
1
+ import { Dag, DagProps } from './dag';
2
+ import { DagContainer } from './dag-container';
3
+
4
+ export { Dag, DagContainer };
5
+ export type { DagProps };
@@ -0,0 +1,4 @@
1
+ import { SearchNode, SearchNodeProps } from './search-node';
2
+
3
+ export { SearchNode };
4
+ export type { SearchNodeProps };
@@ -0,0 +1,6 @@
1
+ export type SearchNodeProps = {
2
+ placeholder?: string;
3
+ searchKeys: string[];
4
+ onSearch?: (value: string) => void;
5
+ };
6
+ export declare function SearchNode(props: SearchNodeProps): import("react/jsx-runtime").JSX.Element;
@@ -34,16 +34,16 @@ export declare function getPoint<T>(params: {
34
34
  /** Checks if the source and target point are equal */
35
35
  export declare function isSamePoint(source: Point, target: Point): boolean;
36
36
  /** Returns whether given point exists in given range */
37
- export declare function hasPointInRange(pointRange: PointRange, point: Point): boolean;
37
+ export declare function hasPointInRange(pointsRange: PointRange[], point: Point): boolean;
38
38
  /** Determines whether all columns are selected */
39
39
  export declare function hasEntireColumns(params: {
40
40
  matrix: Matrix<unknown>;
41
- pointRange: PointRange;
42
- }): boolean;
41
+ pointsRange: PointRange[];
42
+ }): true | undefined;
43
43
  /** Determines which row is entirely selected in given selection */
44
44
  export declare function hasEntireRows(params: {
45
45
  matrix: Matrix<unknown>;
46
- pointRange: PointRange;
46
+ pointsRange: PointRange[];
47
47
  row: number;
48
48
  }): boolean;
49
49
  /** Converts string value into an matrix */
@@ -60,6 +60,7 @@ export type DataEditor = {
60
60
  export type DataViewer = {
61
61
  width: number;
62
62
  mode: Mode;
63
+ setMode?: (mode: Mode) => void;
63
64
  /** Data viewer current value */
64
65
  value?: unknown;
65
66
  column: Column;
@@ -140,8 +141,8 @@ export type Context = {
140
141
  hasSomeEntireRow?: boolean;
141
142
  /** Whether last row is highlighted */
142
143
  highlightLastRow?: boolean;
143
- pointRange: Matrix.PointRange | null;
144
- setPointRange: (pointRange: Matrix.PointRange | null) => void;
144
+ pointsRange: Matrix.PointRange[];
145
+ setPointsRange: (pointRange: Matrix.PointRange[]) => void;
145
146
  containerDimensions: Dimensions;
146
147
  setContainerDimensions: (dimensions: Dimensions) => void;
147
148
  onPaste: (point: Matrix.Point, event: ClipboardEvent) => void;
package/dist/index.d.ts CHANGED
@@ -2,11 +2,22 @@ import { Spreadsheet } from './components/spreadsheet/ui';
2
2
  import { FileUploader, FileUploaderProps } from './components/file-uploader/ui';
3
3
  import { ImageUploader, ImageUploaderProps } from './components/image-uploader/ui';
4
4
  import { MatrixTypes, SpreadsheetTypes } from './types';
5
+ import { Dag, DagContainer, DagProps } from './components/dag/ui';
6
+ import { DagSidebar, DagSidebarHeader, DagSidebarHeaderProps, DagSidebarProps } from './components/dag/ui/dag-sidebar';
7
+ import { DefaultEdge, DefaultNode, NodeDataProps } from './components/dag/ui/defaults';
8
+ import { SearchNode, SearchNodeProps } from './components/dag/ui/search-node';
5
9
 
6
10
  export declare const CapLink: {
7
11
  Spreadsheet: typeof Spreadsheet;
8
12
  FileUploader: typeof FileUploader;
9
13
  WithPortalProvider: ({ children }: import('./components/spreadsheet/lib/with-portal-provider').IWithPortalProvider) => import("react/jsx-runtime").JSX.Element;
10
14
  ImageUploader: typeof ImageUploader;
15
+ Dag: typeof Dag;
16
+ DagContainer: typeof DagContainer;
17
+ DagSidebar: typeof DagSidebar;
18
+ DagSidebarHeader: typeof DagSidebarHeader;
19
+ DefaultNode: typeof DefaultNode;
20
+ DefaultEdge: typeof DefaultEdge;
21
+ SearchNode: typeof SearchNode;
11
22
  };
12
- export type { FileUploaderProps, ImageUploaderProps, MatrixTypes, SpreadsheetTypes };
23
+ export type { FileUploaderProps, ImageUploaderProps, MatrixTypes, SpreadsheetTypes, DagProps, DagSidebarHeaderProps, DagSidebarProps, NodeDataProps, SearchNodeProps };