@pipe0/react-sdk 0.0.29 → 0.0.31

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,26 +1,26 @@
1
- import { type PipeCatalogTableData, type PipeCategory, type PipeId } from "@pipe0/client-sdk";
1
+ import { type PipeEntryWithLatestVersion, type PipeCategory, type PipeId } from "@pipe0/client-sdk";
2
2
  import { type ColumnFilter } from "@tanstack/react-table";
3
3
  export type InputFieldEntries = Record<string, PipeId[]>;
4
4
  export type OutputFieldEntries = Record<string, PipeId[]>;
5
5
  export declare function usePipeCatalogTable(config?: {
6
6
  initialColumnFilters?: ColumnFilter[];
7
7
  }): {
8
- table: import("@tanstack/react-table").Table<PipeCatalogTableData>;
8
+ table: import("@tanstack/react-table").Table<PipeEntryWithLatestVersion>;
9
9
  sidebar: {
10
- sortedInputFieldEntries: [string, ("prompt:run@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:workemail:check@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "company:overview@1" | "json:extract@1" | "action:sendmail:resend@1" | "email:write@1" | "people:personalemail:profile:waterfall@1" | "company:identity@2" | "people:mobile:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]][];
11
- sortedOutputFieldEntries: [string, ("prompt:run@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:workemail:check@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "company:overview@1" | "json:extract@1" | "action:sendmail:resend@1" | "email:write@1" | "people:personalemail:profile:waterfall@1" | "company:identity@2" | "people:mobile:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]][];
12
- sortedTagEntries: [string, ("prompt:run@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:workemail:check@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "company:overview@1" | "json:extract@1" | "action:sendmail:resend@1" | "email:write@1" | "people:personalemail:profile:waterfall@1" | "company:identity@2" | "people:mobile:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]][];
13
- sortedProviderEntries: [string, ("prompt:run@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:workemail:check@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "company:overview@1" | "json:extract@1" | "action:sendmail:resend@1" | "email:write@1" | "people:personalemail:profile:waterfall@1" | "company:identity@2" | "people:mobile:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]][];
14
- pipeIdsByInputField: Record<string, ("prompt:run@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:workemail:check@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "company:overview@1" | "json:extract@1" | "action:sendmail:resend@1" | "email:write@1" | "people:personalemail:profile:waterfall@1" | "company:identity@2" | "people:mobile:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]>;
15
- pipeIdsByOutputField: Record<string, ("prompt:run@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:workemail:check@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "company:overview@1" | "json:extract@1" | "action:sendmail:resend@1" | "email:write@1" | "people:personalemail:profile:waterfall@1" | "company:identity@2" | "people:mobile:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]>;
16
- pipeIdsByProvider: Record<string, ("prompt:run@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:workemail:check@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "company:overview@1" | "json:extract@1" | "action:sendmail:resend@1" | "email:write@1" | "people:personalemail:profile:waterfall@1" | "company:identity@2" | "people:mobile:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]>;
17
- pipeIdsByTag: Record<string, ("prompt:run@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:workemail:check@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "company:overview@1" | "json:extract@1" | "action:sendmail:resend@1" | "email:write@1" | "people:personalemail:profile:waterfall@1" | "company:identity@2" | "people:mobile:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]>;
10
+ sortedInputFieldEntries: [string, ("prompt:run@1" | "company:newssummary:website@1" | "company:techstack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:email:iswork@1" | "people:name:split@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "people:name:join@1" | "company:overview@1" | "json:extract@1" | "email:send:resend@1" | "email:write@1" | "people:personalemail:profile:waterfall@1" | "people:email:validate:zerobounce@1" | "people:phone:email:waterfall@1" | "company:identity@2" | "people:phone:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]][];
11
+ sortedOutputFieldEntries: [string, ("prompt:run@1" | "company:newssummary:website@1" | "company:techstack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:email:iswork@1" | "people:name:split@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "people:name:join@1" | "company:overview@1" | "json:extract@1" | "email:send:resend@1" | "email:write@1" | "people:personalemail:profile:waterfall@1" | "people:email:validate:zerobounce@1" | "people:phone:email:waterfall@1" | "company:identity@2" | "people:phone:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]][];
12
+ sortedTagEntries: [string, ("prompt:run@1" | "company:newssummary:website@1" | "company:techstack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:email:iswork@1" | "people:name:split@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "people:name:join@1" | "company:overview@1" | "json:extract@1" | "email:send:resend@1" | "email:write@1" | "people:personalemail:profile:waterfall@1" | "people:email:validate:zerobounce@1" | "people:phone:email:waterfall@1" | "company:identity@2" | "people:phone:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]][];
13
+ sortedProviderEntries: [string, ("prompt:run@1" | "company:newssummary:website@1" | "company:techstack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:email:iswork@1" | "people:name:split@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "people:name:join@1" | "company:overview@1" | "json:extract@1" | "email:send:resend@1" | "email:write@1" | "people:personalemail:profile:waterfall@1" | "people:email:validate:zerobounce@1" | "people:phone:email:waterfall@1" | "company:identity@2" | "people:phone:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]][];
14
+ pipeIdsByInputField: Record<string, ("prompt:run@1" | "company:newssummary:website@1" | "company:techstack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:email:iswork@1" | "people:name:split@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "people:name:join@1" | "company:overview@1" | "json:extract@1" | "email:send:resend@1" | "email:write@1" | "people:personalemail:profile:waterfall@1" | "people:email:validate:zerobounce@1" | "people:phone:email:waterfall@1" | "company:identity@2" | "people:phone:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]>;
15
+ pipeIdsByOutputField: Record<string, ("prompt:run@1" | "company:newssummary:website@1" | "company:techstack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:email:iswork@1" | "people:name:split@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "people:name:join@1" | "company:overview@1" | "json:extract@1" | "email:send:resend@1" | "email:write@1" | "people:personalemail:profile:waterfall@1" | "people:email:validate:zerobounce@1" | "people:phone:email:waterfall@1" | "company:identity@2" | "people:phone:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]>;
16
+ pipeIdsByProvider: Record<string, ("prompt:run@1" | "company:newssummary:website@1" | "company:techstack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:email:iswork@1" | "people:name:split@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "people:name:join@1" | "company:overview@1" | "json:extract@1" | "email:send:resend@1" | "email:write@1" | "people:personalemail:profile:waterfall@1" | "people:email:validate:zerobounce@1" | "people:phone:email:waterfall@1" | "company:identity@2" | "people:phone:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]>;
17
+ pipeIdsByTag: Record<string, ("prompt:run@1" | "company:newssummary:website@1" | "company:techstack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:email:iswork@1" | "people:name:split@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "people:name:join@1" | "company:overview@1" | "json:extract@1" | "email:send:resend@1" | "email:write@1" | "people:personalemail:profile:waterfall@1" | "people:email:validate:zerobounce@1" | "people:phone:email:waterfall@1" | "company:identity@2" | "people:phone:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]>;
18
18
  expandedSidebarSections: string[];
19
19
  setExpandedSidebarSections: import("react").Dispatch<import("react").SetStateAction<string[]>>;
20
20
  removeColumnFilter: (id: "inputFields" | "outputFields" | "tags" | "providers") => void;
21
21
  addColumnFilter: (id: "inputFields" | "outputFields" | "tags" | "providers", value: string) => void;
22
22
  };
23
- pipeEntriesByBasePipe: Record<string, (import("@pipe0/client-sdk").PipeCatalogEntry<"prompt:run@1" | "company:newssummary:website@1" | "company:profile:builtwith@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:workemail:check@1" | "people:split:name@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "people:join:name@1" | "company:overview@1" | "json:extract@1" | "action:sendmail:resend@1" | "email:write@1" | "people:personalemail:profile:waterfall@1" | "company:identity@2" | "people:mobile:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1"> & {
23
+ pipeEntriesByBasePipe: Record<string, (import("@pipe0/client-sdk").PipeCatalogEntry<"prompt:run@1" | "company:newssummary:website@1" | "company:techstack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:email:iswork@1" | "people:name:split@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "people:name:join@1" | "company:overview@1" | "json:extract@1" | "email:send:resend@1" | "email:write@1" | "people:personalemail:profile:waterfall@1" | "people:email:validate:zerobounce@1" | "people:phone:email:waterfall@1" | "company:identity@2" | "people:phone:profile:waterfall@1" | "people:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "people:profileurl:name@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1"> & {
24
24
  pipeId: PipeId;
25
25
  })[]>;
26
26
  filterByField: (id: "inputFields" | "outputFields", fieldName: string) => void;
@@ -28,7 +28,7 @@ export declare function usePipeCatalogTable(config?: {
28
28
  setGlobalFilterInput: import("react").Dispatch<import("react").SetStateAction<string>>;
29
29
  isFilterChecked: (id: "inputFields" | "outputFields" | "tags" | "providers", value: string) => boolean;
30
30
  resetColumnFilters: () => void;
31
- category: PipeCategory;
31
+ category: PipeCategory | null;
32
32
  setCategory: (category: PipeCategory | null) => void;
33
33
  showFeaturedPipes: boolean;
34
34
  };
@@ -1 +1 @@
1
- {"version":3,"file":"usePipeCatalogTable.d.ts","sourceRoot":"","sources":["../../src/hooks/usePipeCatalogTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,MAAM,EACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,YAAY,EAOlB,MAAM,uBAAuB,CAAC;AA2C/B,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AACzD,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AAuC1D,wBAAgB,mBAAmB,CACjC,MAAM,GAAE;IACN,oBAAoB,CAAC,EAAE,YAAY,EAAE,CAAC;CAClC;;;;;;;;;;;;;iCA2FC,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW;8BAlBpD,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW,SAClD,MAAM;;;;;wBAkCV,aAAa,GAAG,cAAc,aAAa,MAAM;;;0BAThD,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW,SAClD,MAAM;;;4BAjDJ,YAAY,GAAG,IAAI;;EAsGjC"}
1
+ {"version":3,"file":"usePipeCatalogTable.d.ts","sourceRoot":"","sources":["../../src/hooks/usePipeCatalogTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EACjB,KAAK,MAAM,EACZ,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,YAAY,EAOlB,MAAM,uBAAuB,CAAC;AA2C/B,MAAM,MAAM,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AACzD,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;AAuC1D,wBAAgB,mBAAmB,CACjC,MAAM,GAAE;IACN,oBAAoB,CAAC,EAAE,YAAY,EAAE,CAAC;CAClC;;;;;;;;;;;;;iCAyGC,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW;8BA3BpD,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW,SAClD,MAAM;;;;;wBA2CV,aAAa,GAAG,cAAc,aAAa,MAAM;;;0BAThD,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW,SAClD,MAAM;;;4BAvBJ,YAAY,GAAG,IAAI;;EA4EjC"}
@@ -51,15 +51,16 @@ const columns = [
51
51
  filterFn: "arrIncludes",
52
52
  enableGlobalFilter: true,
53
53
  }),
54
- columnHelper.accessor((row) => row.categories || [], {
55
- id: "categories",
56
- filterFn: "arrIncludes",
57
- enableGlobalFilter: true,
58
- }),
54
+ // columnHelper.accessor((row) => row.categories || [], {
55
+ // id: "categories",
56
+ // filterFn: "arrIncludes",
57
+ // enableGlobalFilter: true,
58
+ // }),
59
59
  ];
60
60
  export function usePipeCatalogTable(config = {}) {
61
+ const [category, setCategory] = useState(null);
61
62
  const { initialColumnFilters: initialColumnFilters = [] } = config;
62
- const initialTableData = useMemo(() => getInitialTableData(), []);
63
+ const initialTableData = useMemo(() => getInitialTableData(category), [category]);
63
64
  const table = useReactTable({
64
65
  columns,
65
66
  data: initialTableData,
@@ -76,26 +77,33 @@ export function usePipeCatalogTable(config = {}) {
76
77
  },
77
78
  });
78
79
  const columnFilters = table.getState().columnFilters;
79
- const category = useMemo(() => columnFilters.find((e) => e.id === "categories" && e.value)
80
- ?.value || null, [columnFilters]);
80
+ // const category: PipeCategory | null = useMemo(
81
+ // () =>
82
+ // (columnFilters.find((e) => e.id === "categories" && e.value)
83
+ // ?.value as PipeCategory) || null,
84
+ // [columnFilters]
85
+ // );
81
86
  const { pipeIdsByInputField, pipeIdsByOutputField, pipeIdsByTag, pipeIdsByProvider, sortedTagEntries, sortedInputFieldEntries, sortedOutputFieldEntries, sortedProviderEntries, pipeEntriesByBasePipe, } = useMemo(() => {
82
87
  return getTableDataAggregates(initialTableData, category);
83
88
  }, [category, initialTableData]);
84
89
  const [expandedSidebarSections, setExpandedSidebarSections] = useState(["tags"]);
85
- const setCategory = useCallback((category) => {
86
- table.setGlobalFilter(null);
87
- if (category) {
88
- table.setColumnFilters([{ id: "categories", value: category }]);
89
- }
90
- else {
91
- table.setColumnFilters([]);
92
- }
93
- }, [table]);
90
+ // const setCategory = useCallback(
91
+ // (category: PipeCategory | null) => {
92
+ // table.setGlobalFilter(null);
93
+ // if (category) {
94
+ // table.setColumnFilters([{ id: "categories", value: category }]);
95
+ // } else {
96
+ // table.setColumnFilters([]);
97
+ // }
98
+ // },
99
+ // [table]
100
+ // );
94
101
  const [globalFilterInput, setGlobalFilterInput, setGlobalFilterImmediately] = useDebounce((v) => {
95
102
  if (v === table.getState().globalFilter)
96
103
  return;
97
104
  table.setGlobalFilter(v);
98
105
  if (v) {
106
+ setCategory(null);
99
107
  table.setColumnFilters([]);
100
108
  }
101
109
  });
@@ -106,6 +114,11 @@ export function usePipeCatalogTable(config = {}) {
106
114
  { id, value },
107
115
  ]);
108
116
  }, [category, setGlobalFilterImmediately, table]);
117
+ const handleCategoryChange = useCallback((category) => {
118
+ setCategory(category);
119
+ table.setColumnFilters([]);
120
+ setGlobalFilterImmediately("");
121
+ }, [table, setGlobalFilterImmediately]);
109
122
  const resetColumnFilters = useCallback(() => {
110
123
  setGlobalFilterImmediately("");
111
124
  table.setColumnFilters([{ id: "categories", value: null }]);
@@ -152,7 +165,7 @@ export function usePipeCatalogTable(config = {}) {
152
165
  isFilterChecked,
153
166
  resetColumnFilters,
154
167
  category,
155
- setCategory,
168
+ setCategory: handleCategoryChange,
156
169
  showFeaturedPipes,
157
170
  };
158
171
  }
@@ -23,7 +23,7 @@ export declare function useSearchCatalogTable(config?: {
23
23
  setGlobalFilterInput: import("react").Dispatch<import("react").SetStateAction<string>>;
24
24
  isFilterChecked: (id: "inputFields" | "outputFields" | "tags" | "providers", value: string) => boolean;
25
25
  resetColumnFilters: () => void;
26
- category: SearchCategory;
26
+ category: SearchCategory | null;
27
27
  setCategory: (category: SearchCategory | null) => void;
28
28
  showFeaturedSearches: boolean;
29
29
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useSearchCatalogTable.d.ts","sourceRoot":"","sources":["../../src/hooks/useSearchCatalogTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,QAAQ,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,YAAY,EAOlB,MAAM,uBAAuB,CAAC;AA2C/B,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;AA8BlE,wBAAgB,qBAAqB,CACnC,MAAM,GAAE;IACN,oBAAoB,CAAC,EAAE,YAAY,EAAE,CAAC;CAClC;;;;;;;;;;;iCAmFA,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW;8BAhBrD,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW,SAClD,MAAM;;;wBA4BT,aAAa,GAAG,cAAc,aACvB,MAAM;;;0BARb,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW,SAClD,MAAM;;;4BA1CgB,cAAc,GAAG,IAAI;;EA2FrD"}
1
+ {"version":3,"file":"useSearchCatalogTable.d.ts","sourceRoot":"","sources":["../../src/hooks/useSearchCatalogTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,QAAQ,EACd,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,KAAK,YAAY,EAOlB,MAAM,uBAAuB,CAAC;AA2C/B,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;AAyBlE,wBAAgB,qBAAqB,CACnC,MAAM,GAAE;IACN,oBAAoB,CAAC,EAAE,YAAY,EAAE,CAAC;CAClC;;;;;;;;;;;iCAyEA,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW;8BAhBrD,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW,SAClD,MAAM;;;wBA4BT,aAAa,GAAG,cAAc,aACvB,MAAM;;;0BARb,aAAa,GAAG,cAAc,GAAG,MAAM,GAAG,WAAW,SAClD,MAAM;;;4BA0BF,cAAc,GAAG,IAAI;;EAgCnC"}
@@ -45,15 +45,11 @@ const columns = [
45
45
  id: "providers",
46
46
  enableGlobalFilter: true,
47
47
  }),
48
- columnHelper.accessor((row) => row.categories || [], {
49
- id: "categories",
50
- filterFn: "arrIncludes",
51
- enableGlobalFilter: true,
52
- }),
53
48
  ];
54
49
  export function useSearchCatalogTable(config = {}) {
50
+ const [category, setCategory] = useState(null);
55
51
  const { initialColumnFilters: initialColumnFilters = [] } = config;
56
- const initialSearchTableData = useMemo(() => getInitialSearchTableData(), []);
52
+ const initialSearchTableData = useMemo(() => getInitialSearchTableData(category), [category]);
57
53
  const table = useReactTable({
58
54
  columns,
59
55
  data: initialSearchTableData,
@@ -70,26 +66,16 @@ export function useSearchCatalogTable(config = {}) {
70
66
  },
71
67
  });
72
68
  const columnFilters = table.getState().columnFilters;
73
- const category = useMemo(() => columnFilters.find((e) => e.id === "categories" && e.value)
74
- ?.value || null, [columnFilters]);
75
69
  const { searchIdsByOutputField, searchIdsByTag, searchIdsByProvider, sortedTagEntries, sortedOutputFieldEntries, sortedProviderEntries, searchEntriesByBaseSearch, } = useMemo(() => {
76
70
  return getSearchTableDataAggregates(initialSearchTableData, category);
77
71
  }, [category, initialSearchTableData]);
78
72
  const [expandedSidebarSections, setExpandedSidebarSections] = useState(["tags"]);
79
- const setCategory = (category) => {
80
- table.setGlobalFilter(null);
81
- if (category) {
82
- table.setColumnFilters([{ id: "categories", value: category }]);
83
- }
84
- else {
85
- table.setColumnFilters([]);
86
- }
87
- };
88
73
  const [globalFilterInput, setGlobalFilterInput, setGlobalFilterImmediately] = useDebounce((v) => {
89
74
  if (v === table.getState().globalFilter)
90
75
  return;
91
76
  table.setGlobalFilter(v);
92
77
  if (v) {
78
+ setCategory(null);
93
79
  table.setColumnFilters([]);
94
80
  }
95
81
  });
@@ -123,6 +109,11 @@ export function useSearchCatalogTable(config = {}) {
123
109
  category === null &&
124
110
  tableState.columnFilters.every((e) => e.id === "categories") &&
125
111
  tableState.pagination.pageIndex === 0;
112
+ const handleCategoryChange = useCallback((category) => {
113
+ setCategory(category);
114
+ table.setColumnFilters([]);
115
+ setGlobalFilterImmediately("");
116
+ }, [table, setGlobalFilterImmediately]);
126
117
  return {
127
118
  table,
128
119
  sidebar: {
@@ -144,7 +135,7 @@ export function useSearchCatalogTable(config = {}) {
144
135
  isFilterChecked,
145
136
  resetColumnFilters,
146
137
  category,
147
- setCategory,
138
+ setCategory: handleCategoryChange,
148
139
  showFeaturedSearches,
149
140
  };
150
141
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipe0/react-sdk",
3
- "version": "0.0.29",
3
+ "version": "0.0.31",
4
4
  "type": "module",
5
5
  "description": "React utils to work with pipe0",
6
6
  "keywords": [
@@ -29,7 +29,7 @@
29
29
  "lucide-react": "^0.475.0",
30
30
  "react": "^19.0.0",
31
31
  "react-dom": "^19.0.0",
32
- "@pipe0/client-sdk": "0.0.71"
32
+ "@pipe0/client-sdk": "0.0.73"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@types/node": "^22.13.2",