@pipe0/react-sdk 0.0.8 → 0.0.10

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.
@@ -1,9 +1,5 @@
1
- import { type PipeCategory, type PipeId } from "@pipe0/client-sdk";
1
+ import { type PipeCatalogTableData, type PipeCategory, type PipeId } from "@pipe0/client-sdk";
2
2
  import { type ColumnFilter } from "@tanstack/react-table";
3
- export declare function useDebounce(cb: (v: string) => unknown, config?: {
4
- initialValue?: string;
5
- timeout?: number;
6
- }): readonly [string, import("react").Dispatch<import("react").SetStateAction<string>>, (v: string) => void];
7
3
  export type InputFieldEntries = Record<string, PipeId[]>;
8
4
  export type OutputFieldEntries = Record<string, PipeId[]>;
9
5
  export declare function usePipeCatalogTable(config?: {
@@ -11,26 +7,28 @@ export declare function usePipeCatalogTable(config?: {
11
7
  }): {
12
8
  table: import("@tanstack/react-table").Table<PipeCatalogTableData>;
13
9
  sidebar: {
14
- sortedInputFieldEntries: any;
15
- sortedOutputFieldEntries: any;
16
- sortedTagEntries: any;
17
- sortedProviderEntries: any;
18
- pipeIdsByInputField: any;
19
- pipeIdsByOutputField: any;
20
- pipeIdsByProvider: any;
21
- pipeIdsByTag: any;
10
+ sortedInputFieldEntries: [string, ("people:workemail:waterfall@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:is:workemail@1" | "company:websiteurl:email@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1" | "website:technologystack:builtwith@1" | "run:prompt@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1")[]][];
11
+ sortedOutputFieldEntries: [string, ("people:workemail:waterfall@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:is:workemail@1" | "company:websiteurl:email@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1" | "website:technologystack:builtwith@1" | "run:prompt@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1")[]][];
12
+ sortedTagEntries: [string, ("people:workemail:waterfall@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:is:workemail@1" | "company:websiteurl:email@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1" | "website:technologystack:builtwith@1" | "run:prompt@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1")[]][];
13
+ sortedProviderEntries: [string, ("people:workemail:waterfall@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:is:workemail@1" | "company:websiteurl:email@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1" | "website:technologystack:builtwith@1" | "run:prompt@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1")[]][];
14
+ pipeIdsByInputField: Record<string, ("people:workemail:waterfall@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:is:workemail@1" | "company:websiteurl:email@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1" | "website:technologystack:builtwith@1" | "run:prompt@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1")[]>;
15
+ pipeIdsByOutputField: Record<string, ("people:workemail:waterfall@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:is:workemail@1" | "company:websiteurl:email@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1" | "website:technologystack:builtwith@1" | "run:prompt@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1")[]>;
16
+ pipeIdsByProvider: Record<string, ("people:workemail:waterfall@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:is:workemail@1" | "company:websiteurl:email@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1" | "website:technologystack:builtwith@1" | "run:prompt@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1")[]>;
17
+ pipeIdsByTag: Record<string, ("people:workemail:waterfall@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:is:workemail@1" | "company:websiteurl:email@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1" | "website:technologystack:builtwith@1" | "run:prompt@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1")[]>;
22
18
  expandedSidebarSections: string[];
23
19
  setExpandedSidebarSections: import("react").Dispatch<import("react").SetStateAction<string[]>>;
24
20
  removeColumnFilter: (id: "inputFields" | "outputFields" | "tags" | "providers") => void;
25
21
  addColumnFilter: (id: "inputFields" | "outputFields" | "tags" | "providers", value: string) => void;
26
22
  };
27
- pipeEntriesByBasePipe: any;
23
+ pipeEntriesByBasePipe: Record<string, (import("@pipe0/client-sdk").PipeMetaCatalogEntry<"people:workemail:waterfall@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:is:workemail@1" | "company:websiteurl:email@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1" | "website:technologystack:builtwith@1" | "run:prompt@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1"> & {
24
+ pipeId: PipeId;
25
+ })[]>;
28
26
  filterByField: (id: "inputFields" | "outputFields", fieldName: string) => void;
29
27
  globalFilterInput: string;
30
28
  setGlobalFilterInput: import("react").Dispatch<import("react").SetStateAction<string>>;
31
29
  isFilterChecked: (id: "inputFields" | "outputFields" | "tags" | "providers", value: string) => boolean;
32
30
  resetColumnFilters: () => void;
33
- category: any;
31
+ category: PipeCategory;
34
32
  setCategory: (category: PipeCategory | null) => void;
35
33
  showFeaturedPipes: boolean;
36
34
  };
@@ -1 +1 @@
1
- {"version":3,"file":"usePipeCatalogTable.d.ts","sourceRoot":"","sources":["../../src/hooks/usePipeCatalogTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,MAAM,EACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,YAAY,EAMlB,MAAM,uBAAuB,CAAC;AAG/B,wBAAgB,WAAW,CACzB,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,EAC1B,MAAM,GAAE;IAAE,YAAY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W,SAClD,MAAM;;;;;wBA4BT,aAAa,GAAG,cAAc,aACvB,MAAM;;;0BARb,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW,SAClD,MAAM;;;4BA1CgB,YAAY,GAAG,IAAI;;EA6FnD"}
@@ -1,7 +1,14 @@
1
1
  import { getInitialTableData, getTableDataAggregates, } from "@pipe0/client-sdk";
2
2
  import { createColumnHelper, getCoreRowModel, getFilteredRowModel, getPaginationRowModel, useReactTable, } from "@tanstack/react-table";
3
3
  import { useCallback, useEffect, useMemo, useRef, useState } from "react";
4
- export function useDebounce(cb, config = {}) {
4
+ const globalFilterFn = (row, columnId, filterValue) => {
5
+ const value = row.getValue(columnId);
6
+ if (Array.isArray(value)) {
7
+ return value.some((item) => String(item).toLowerCase().includes(filterValue.toLowerCase()));
8
+ }
9
+ return String(value).toLowerCase().includes(filterValue.toLowerCase());
10
+ };
11
+ function useDebounce(cb, config = {}) {
5
12
  const { initialValue = "", timeout = 400 } = config;
6
13
  const [value, setValue] = useState(initialValue);
7
14
  const cbRef = useRef(cb);
@@ -20,21 +27,34 @@ export function useDebounce(cb, config = {}) {
20
27
  }
21
28
  const columnHelper = createColumnHelper();
22
29
  const columns = [
23
- columnHelper.accessor("pipeId", {}),
24
- columnHelper.accessor((row) => row.inputGroups.flatMap((g) => Object.keys(g.fields)).join(", "), {
30
+ columnHelper.accessor("pipeId", {
31
+ filterFn: "includesString",
32
+ enableGlobalFilter: true,
33
+ }),
34
+ columnHelper.accessor((row) => row.inputGroups.flatMap((g) => Object.keys(g.fields)) || [], {
25
35
  id: "inputFields",
36
+ filterFn: "arrIncludes",
37
+ enableGlobalFilter: true,
26
38
  }),
27
- columnHelper.accessor((row) => row.outputFields.join(", "), {
39
+ columnHelper.accessor((row) => row.outputFields || [], {
28
40
  id: "outputFields",
41
+ filterFn: "arrIncludes",
42
+ enableGlobalFilter: true,
29
43
  }),
30
- columnHelper.accessor((row) => row.tags.join(", "), {
44
+ columnHelper.accessor((row) => row.tags || [], {
31
45
  id: "tags",
46
+ filterFn: "arrIncludes",
47
+ enableGlobalFilter: true,
32
48
  }),
33
- columnHelper.accessor((row) => row.providers.join(", "), {
49
+ columnHelper.accessor((row) => row.providers || [], {
34
50
  id: "providers",
51
+ filterFn: "arrIncludes",
52
+ enableGlobalFilter: true,
35
53
  }),
36
- columnHelper.accessor((row) => row.categories.join(", "), {
54
+ columnHelper.accessor((row) => row.categories || [], {
37
55
  id: "categories",
56
+ filterFn: "arrIncludes",
57
+ enableGlobalFilter: true,
38
58
  }),
39
59
  ];
40
60
  export function usePipeCatalogTable(config = {}) {
@@ -46,6 +66,8 @@ export function usePipeCatalogTable(config = {}) {
46
66
  getCoreRowModel: getCoreRowModel(),
47
67
  getPaginationRowModel: getPaginationRowModel(),
48
68
  getFilteredRowModel: getFilteredRowModel(),
69
+ globalFilterFn: globalFilterFn,
70
+ getColumnCanGlobalFilter: (column) => column.columnDef.enableGlobalFilter !== false,
49
71
  initialState: {
50
72
  columnFilters: initialColumnFilters,
51
73
  pagination: {
@@ -102,9 +124,11 @@ export function usePipeCatalogTable(config = {}) {
102
124
  { id, value: fieldName },
103
125
  ]);
104
126
  };
127
+ const tableState = table.getState();
105
128
  const showFeaturedPipes = !globalFilterInput &&
106
129
  category === null &&
107
- table.getState().columnFilters.every((e) => e.id === "categories");
130
+ tableState.columnFilters.every((e) => e.id === "categories") &&
131
+ tableState.pagination.pageIndex === 0;
108
132
  return {
109
133
  table,
110
134
  sidebar: {
package/dist/index.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export * from "./hooks/usePipeCatalogTable.js";
1
+ export { usePipeCatalogTable, type InputFieldEntries, type OutputFieldEntries, } from "./hooks/usePipeCatalogTable.js";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,gCAAgC,CAAC"}
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export * from "./hooks/usePipeCatalogTable.js";
1
+ export { usePipeCatalogTable, } from "./hooks/usePipeCatalogTable.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipe0/react-sdk",
3
- "version": "0.0.8",
3
+ "version": "0.0.10",
4
4
  "type": "module",
5
5
  "description": "React utils to work with pipe0",
6
6
  "keywords": [
@@ -25,22 +25,23 @@
25
25
  "author": "",
26
26
  "license": "MIT",
27
27
  "dependencies": {
28
+ "@tanstack/react-table": "^8.21.2",
28
29
  "react": "^19.0.0",
29
30
  "react-dom": "^19.0.0",
30
- "@tanstack/react-table": "^8.21.2",
31
- "@pipe0/client-sdk": "0.0.51"
31
+ "@pipe0/client-sdk": "0.0.52"
32
32
  },
33
33
  "devDependencies": {
34
- "@types/react": "^19.0.8",
35
34
  "@types/node": "^22.13.2",
36
- "eslint": "^9.30.0",
35
+ "@types/react": "^19.0.8",
37
36
  "@types/react-dom": "^19.0.3",
37
+ "eslint": "^9.30.1",
38
+ "rimraf": "^6.0.1",
38
39
  "@pipe0/eslint-config": "0.0.0"
39
40
  },
40
41
  "scripts": {
41
42
  "lint": "eslint . --max-warnings 0",
42
43
  "check-types": "tsc --noEmit",
43
- "dev": " tsc --watch",
44
- "build": "rm -rf ./dist && tsc"
44
+ "dev": "tsc --watch",
45
+ "build": "rimraf dist && tsc"
45
46
  }
46
47
  }