@pipe0/react-sdk 0.0.2 → 0.0.4

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,38 @@
1
+ import { type PipeCatalogTableData, type PipeCategory, type PipeId } from "@pipe0/client-sdk";
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
+ export type InputFieldEntries = Record<string, PipeId[]>;
8
+ export type OutputFieldEntries = Record<string, PipeId[]>;
9
+ export declare function usePipeCatalogTable(config?: {
10
+ initialColumnFilters?: ColumnFilter[];
11
+ }): {
12
+ table: import("@tanstack/react-table").Table<PipeCatalogTableData>;
13
+ sidebar: {
14
+ sortedInputFieldEntries: [string, ("run:prompt@1" | "company:newssummary:website@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:is:workemail@1" | "people:split:name@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1")[]][];
15
+ sortedOutputFieldEntries: [string, ("run:prompt@1" | "company:newssummary:website@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:is:workemail@1" | "people:split:name@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1")[]][];
16
+ sortedTagEntries: [string, ("run:prompt@1" | "company:newssummary:website@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:is:workemail@1" | "people:split:name@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1")[]][];
17
+ sortedProviderEntries: [string, ("run:prompt@1" | "company:newssummary:website@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:is:workemail@1" | "people:split:name@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1")[]][];
18
+ pipeIdsByInputField: Record<string, ("run:prompt@1" | "company:newssummary:website@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:is:workemail@1" | "people:split:name@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1")[]>;
19
+ pipeIdsByOutputField: Record<string, ("run:prompt@1" | "company:newssummary:website@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:is:workemail@1" | "people:split:name@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1")[]>;
20
+ pipeIdsByProvider: Record<string, ("run:prompt@1" | "company:newssummary:website@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:is:workemail@1" | "people:split:name@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1")[]>;
21
+ pipeIdsByTag: Record<string, ("run:prompt@1" | "company:newssummary:website@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:is:workemail@1" | "people:split:name@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1")[]>;
22
+ expandedSidebarSections: string[];
23
+ setExpandedSidebarSections: import("react").Dispatch<import("react").SetStateAction<string[]>>;
24
+ removeColumnFilter: (id: "inputFields" | "outputFields" | "tags" | "providers") => void;
25
+ addColumnFilter: (id: "inputFields" | "outputFields" | "tags" | "providers", value: string) => void;
26
+ };
27
+ pipeEntriesByBasePipe: Record<string, (import("@pipe0/client-sdk").PipeMetaCatalogEntry<"run:prompt@1" | "company:newssummary:website@1" | "website:technologystack:builtwith@1" | "company:websiteurl:email@1" | "people:workemail:waterfall@1" | "people:is:workemail@1" | "people:split:name@1" | "people:join:name@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:personalemail:professionalprofile:waterfall@1" | "people:validate:email:zerobounce@1" | "people:mobilenumber:professionalprofile:waterfall@1" | "people:mobilenumber:workemail:waterfall@1" | "company:profile:builtwith@1" | "company:identity@1" | "company:overview@1"> & {
28
+ pipeId: PipeId;
29
+ })[]>;
30
+ filterByField: (id: "inputFields" | "outputFields", fieldName: string) => void;
31
+ globalFilterInput: string;
32
+ setGlobalFilterInput: import("react").Dispatch<import("react").SetStateAction<string>>;
33
+ isFilterChecked: (id: "inputFields" | "outputFields" | "tags" | "providers", value: string) => boolean;
34
+ resetColumnFilters: () => void;
35
+ category: PipeCategory;
36
+ setCategory: (category: PipeCategory | null) => void;
37
+ };
38
+ //# sourceMappingURL=usePipeCatalogTable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePipeCatalogTable.d.ts","sourceRoot":"","sources":["../../src/hooks/usePipeCatalogTable.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,oBAAoB,EACzB,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,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,2FAQjB,MAAM,WAc9C;AAED,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;AA0B1D,wBAAgB,mBAAmB,CACjC,MAAM,GAAE;IACN,oBAAoB,CAAC,EAAE,YAAY,EAAE,CAAC;CAClC;;;;;;;;;;;;;iCAqFA,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,YAAY,GAAG,IAAI;EAoFnD"}
@@ -0,0 +1,132 @@
1
+ import { getInitialTableData, getTableDataAggregates, } from "@pipe0/client-sdk";
2
+ import { createColumnHelper, getCoreRowModel, getFilteredRowModel, getPaginationRowModel, useReactTable, } from "@tanstack/react-table";
3
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
4
+ export function useDebounce(cb, config = {}) {
5
+ const { initialValue = "", timeout = 400 } = config;
6
+ const [value, setValue] = useState(initialValue);
7
+ const cbRef = useRef(cb);
8
+ cbRef.current = cb;
9
+ const setImmediately = useCallback((v) => {
10
+ setValue(v);
11
+ cbRef.current(v);
12
+ }, []);
13
+ useEffect(() => {
14
+ const handle = setTimeout(() => {
15
+ cbRef.current(value);
16
+ }, timeout);
17
+ return () => clearTimeout(handle);
18
+ }, [value, timeout]);
19
+ return [value, setValue, setImmediately];
20
+ }
21
+ const columnHelper = createColumnHelper();
22
+ const columns = [
23
+ columnHelper.accessor("pipeId", {}),
24
+ columnHelper.accessor((row) => row.inputGroups.flatMap((g) => Object.keys(g.fields)).join(", "), {
25
+ id: "inputFields",
26
+ }),
27
+ columnHelper.accessor((row) => row.outputFields.join(", "), {
28
+ id: "outputFields",
29
+ }),
30
+ columnHelper.accessor((row) => row.tags.join(", "), {
31
+ id: "tags",
32
+ }),
33
+ columnHelper.accessor((row) => row.providers.join(", "), {
34
+ id: "providers",
35
+ }),
36
+ columnHelper.accessor((row) => row.categories.join(", "), {
37
+ id: "categories",
38
+ }),
39
+ ];
40
+ export function usePipeCatalogTable(config = {}) {
41
+ const { initialColumnFilters: initialColumnFilters = [
42
+ { id: "category", value: "enrichment" },
43
+ ], } = config;
44
+ const initialTableData = useMemo(() => getInitialTableData(), []);
45
+ const table = useReactTable({
46
+ columns,
47
+ data: initialTableData,
48
+ getCoreRowModel: getCoreRowModel(),
49
+ getPaginationRowModel: getPaginationRowModel(),
50
+ getFilteredRowModel: getFilteredRowModel(),
51
+ initialState: {
52
+ columnFilters: initialColumnFilters,
53
+ pagination: {
54
+ pageSize: 10,
55
+ },
56
+ },
57
+ });
58
+ const columnFilters = table.getState().columnFilters;
59
+ const category = useMemo(() => columnFilters.find((e) => e.id === "categories" && e.value)
60
+ ?.value || null, [columnFilters]);
61
+ const { pipeIdsByInputField, pipeIdsByOutputField, pipeIdsByTag, pipeIdsByProvider, sortedTagEntries, sortedInputFieldEntries, sortedOutputFieldEntries, sortedProviderEntries, pipeEntriesByBasePipe, } = useMemo(() => {
62
+ return getTableDataAggregates(initialTableData, category);
63
+ }, [category, initialTableData]);
64
+ const [expandedSidebarSections, setExpandedSidebarSections] = useState(["tags"]);
65
+ const setCategory = (category) => {
66
+ table.setGlobalFilter(null);
67
+ if (category) {
68
+ table.setColumnFilters([{ id: "categories", value: category }]);
69
+ }
70
+ else {
71
+ table.setColumnFilters([]);
72
+ }
73
+ };
74
+ const [globalFilterInput, setGlobalFilterInput, setGlobalFilterImmediately] = useDebounce((v) => {
75
+ if (v === table.getState().globalFilter)
76
+ return;
77
+ table.setGlobalFilter(v);
78
+ if (v) {
79
+ table.setColumnFilters([]);
80
+ }
81
+ });
82
+ const addColumnFilter = (id, value) => {
83
+ setGlobalFilterImmediately("");
84
+ table.setColumnFilters([
85
+ { id: "categories", value: category },
86
+ { id, value },
87
+ ]);
88
+ };
89
+ const resetColumnFilters = () => {
90
+ setGlobalFilterImmediately("");
91
+ table.setColumnFilters([{ id: "categories", value: null }]);
92
+ };
93
+ const removeColumnFilter = (id) => {
94
+ table.getColumn(id)?.setFilterValue(null);
95
+ };
96
+ const isFilterChecked = (id, value) => {
97
+ return columnFilters.some((f) => f.id === id && f.value === value);
98
+ };
99
+ const filterByField = (id, fieldName) => {
100
+ setExpandedSidebarSections([id]);
101
+ setGlobalFilterImmediately("");
102
+ table.setColumnFilters([
103
+ { id: "categories", value: null },
104
+ { id, value: fieldName },
105
+ ]);
106
+ };
107
+ return {
108
+ table,
109
+ sidebar: {
110
+ sortedInputFieldEntries,
111
+ sortedOutputFieldEntries,
112
+ sortedTagEntries,
113
+ sortedProviderEntries,
114
+ pipeIdsByInputField,
115
+ pipeIdsByOutputField,
116
+ pipeIdsByProvider,
117
+ pipeIdsByTag,
118
+ expandedSidebarSections,
119
+ setExpandedSidebarSections,
120
+ removeColumnFilter,
121
+ addColumnFilter,
122
+ },
123
+ pipeEntriesByBasePipe,
124
+ filterByField,
125
+ globalFilterInput,
126
+ setGlobalFilterInput,
127
+ isFilterChecked,
128
+ resetColumnFilters,
129
+ category,
130
+ setCategory,
131
+ };
132
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./hooks/usePipeCatalogTable.js";
2
+ export * from "@pipe0/client-sdk";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,mBAAmB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export * from "./hooks/usePipeCatalogTable.js";
2
+ export * from "@pipe0/client-sdk";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pipe0/react-sdk",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "type": "module",
5
5
  "description": "React utils to work with pipe0",
6
6
  "keywords": [
@@ -15,27 +15,32 @@
15
15
  "provenance": false,
16
16
  "access": "public"
17
17
  },
18
+ "files": [
19
+ "dist"
20
+ ],
18
21
  "exports": {
19
- ".": "./src/index.ts"
22
+ ".": "./dist/index.js"
20
23
  },
21
24
  "private": false,
22
- "scripts": {
23
- "lint": "eslint . --max-warnings 0",
24
- "check-types": "tsc --noEmit"
25
- },
26
25
  "author": "",
27
26
  "license": "MIT",
28
27
  "dependencies": {
29
- "@pipe0/client-sdk": "workspace:*",
30
- "react": "catalog:",
31
- "react-dom": "catalog:",
32
- "@tanstack/react-table": "catalog:"
28
+ "react": "^19.0.0",
29
+ "react-dom": "^19.0.0",
30
+ "@tanstack/react-table": "^8.21.2",
31
+ "@pipe0/client-sdk": "0.0.48"
33
32
  },
34
33
  "devDependencies": {
35
- "@pipe0/eslint-config": "workspace:*",
36
- "@types/react": "catalog:",
34
+ "@types/react": "^19.0.8",
37
35
  "@types/node": "^22.13.2",
38
- "eslint": "catalog:",
39
- "@types/react-dom": "catalog:"
36
+ "eslint": "^9.30.0",
37
+ "@types/react-dom": "^19.0.3",
38
+ "@pipe0/eslint-config": "0.0.0"
39
+ },
40
+ "scripts": {
41
+ "lint": "eslint . --max-warnings 0",
42
+ "check-types": "tsc --noEmit",
43
+ "dev": " tsc --watch",
44
+ "build": "rm -rf ./dist && tsc"
40
45
  }
41
- }
46
+ }
package/CHANGELOG.md DELETED
@@ -1,9 +0,0 @@
1
- # @pipe0/react-sdk
2
-
3
- ## 0.0.2
4
-
5
- ### Patch Changes
6
-
7
- - Updates
8
- - Updated dependencies
9
- - @pipe0/client-sdk@0.0.47
package/eslint.config.mjs DELETED
@@ -1,4 +0,0 @@
1
- import { config } from "@pipe0/eslint-config/react-internal";
2
-
3
- /** @type {import("eslint").Linter.Config} */
4
- export default config;
@@ -1,210 +0,0 @@
1
- import {
2
- getInitialTableData,
3
- getTableDataAggregates,
4
- type PipeCatalogTableData,
5
- type PipeCategory,
6
- type PipeId,
7
- } from "@pipe0/client-sdk";
8
- import {
9
- type ColumnFilter,
10
- createColumnHelper,
11
- getCoreRowModel,
12
- getFilteredRowModel,
13
- getPaginationRowModel,
14
- useReactTable,
15
- } from "@tanstack/react-table";
16
- import { useCallback, useEffect, useMemo, useRef, useState } from "react";
17
-
18
- export function useDebounce(
19
- cb: (v: string) => unknown,
20
- config: { initialValue?: string; timeout?: number } = {}
21
- ) {
22
- const { initialValue = "", timeout = 400 } = config;
23
- const [value, setValue] = useState(initialValue);
24
-
25
- const cbRef = useRef(cb);
26
-
27
- const setImmediately = useCallback((v: string) => {
28
- setValue(v);
29
- cb(v);
30
- }, []);
31
-
32
- useEffect(() => {
33
- if (!cbRef.current) return;
34
- cbRef.current = cb;
35
- const handle = setTimeout(() => {
36
- cbRef.current(value);
37
- }, timeout);
38
-
39
- return () => clearTimeout(handle);
40
- }, [value, timeout]);
41
-
42
- return [value, setValue, setImmediately] as const;
43
- }
44
-
45
- export type InputFieldEntries = Record<string, PipeId[]>;
46
- export type OutputFieldEntries = Record<string, PipeId[]>;
47
-
48
- const columnHelper = createColumnHelper<PipeCatalogTableData>();
49
-
50
- const columns = [
51
- columnHelper.accessor("pipeId", {}),
52
- columnHelper.accessor(
53
- (row) => row.inputGroups.flatMap((g) => Object.keys(g.fields)).join(", "),
54
- {
55
- id: "inputFields",
56
- }
57
- ),
58
- columnHelper.accessor((row) => row.outputFields.join(", "), {
59
- id: "outputFields",
60
- }),
61
- columnHelper.accessor((row) => row.tags.join(", "), {
62
- id: "tags",
63
- }),
64
- columnHelper.accessor((row) => row.providers.join(", "), {
65
- id: "providers",
66
- }),
67
- columnHelper.accessor((row) => row.categories.join(", "), {
68
- id: "categories",
69
- }),
70
- ];
71
-
72
- export function usePipeCatalogTable(
73
- config: {
74
- initialColumnFilters?: ColumnFilter[];
75
- } = {}
76
- ) {
77
- const {
78
- initialColumnFilters: initialColumnFilters = [
79
- { id: "category", value: "enrichment" },
80
- ] as ColumnFilter[],
81
- } = config;
82
-
83
- const initialTableData = useMemo(() => getInitialTableData(), []);
84
-
85
- const table = useReactTable({
86
- columns,
87
- data: initialTableData,
88
- getCoreRowModel: getCoreRowModel(),
89
- getPaginationRowModel: getPaginationRowModel(),
90
- getFilteredRowModel: getFilteredRowModel(),
91
- initialState: {
92
- columnFilters: initialColumnFilters,
93
- pagination: {
94
- pageSize: 10,
95
- },
96
- },
97
- });
98
-
99
- const columnFilters = table.getState().columnFilters;
100
- const x = "lsdfj";
101
- const category: PipeCategory | null = useMemo(
102
- () =>
103
- (columnFilters.find((e) => e.id === "categories" && e.value)
104
- ?.value as PipeCategory) || null,
105
- [columnFilters]
106
- );
107
-
108
- const {
109
- pipeIdsByInputField,
110
- pipeIdsByOutputField,
111
- pipeIdsByTag,
112
- pipeIdsByProvider,
113
- sortedTagEntries,
114
- sortedInputFieldEntries,
115
- sortedOutputFieldEntries,
116
- sortedProviderEntries,
117
- pipeEntriesByBasePipe,
118
- } = useMemo(() => {
119
- return getTableDataAggregates(initialTableData, category);
120
- }, [category]);
121
-
122
- const [expandedSidebarSections, setExpandedSidebarSections] = useState<
123
- string[]
124
- >(["tags"]);
125
-
126
- const setCategory = (category: PipeCategory | null) => {
127
- table.setGlobalFilter(null);
128
- if (category) {
129
- table.setColumnFilters([{ id: "categories", value: category }]);
130
- } else {
131
- table.setColumnFilters([]);
132
- }
133
- };
134
-
135
- const [globalFilterInput, setGlobalFilterInput, setGlobalFilterImmediately] =
136
- useDebounce((v) => {
137
- if (v === table.getState().globalFilter) return;
138
- table.setGlobalFilter(v);
139
- if (v) {
140
- table.setColumnFilters([]);
141
- }
142
- });
143
-
144
- const addColumnFilter = (
145
- id: "inputFields" | "outputFields" | "tags" | "providers",
146
- value: string
147
- ) => {
148
- setGlobalFilterImmediately("");
149
- table.setColumnFilters([
150
- { id: "categories", value: category },
151
- { id, value },
152
- ]);
153
- };
154
-
155
- const resetColumnFilters = () => {
156
- setGlobalFilterImmediately("");
157
- table.setColumnFilters([{ id: "categories", value: null }]);
158
- };
159
-
160
- const removeColumnFilter = (
161
- id: "inputFields" | "outputFields" | "tags" | "providers"
162
- ) => {
163
- table.getColumn(id)?.setFilterValue(null);
164
- };
165
-
166
- const isFilterChecked = (
167
- id: "inputFields" | "outputFields" | "tags" | "providers",
168
- value: string
169
- ) => {
170
- return columnFilters.some((f) => f.id === id && f.value === value);
171
- };
172
-
173
- const filterByField = (
174
- id: "inputFields" | "outputFields",
175
- fieldName: string
176
- ) => {
177
- setExpandedSidebarSections([id]);
178
- setGlobalFilterImmediately("");
179
- table.setColumnFilters([
180
- { id: "categories", value: null },
181
- { id, value: fieldName },
182
- ]);
183
- };
184
-
185
- return {
186
- table,
187
- sidebar: {
188
- sortedInputFieldEntries,
189
- sortedOutputFieldEntries,
190
- sortedTagEntries,
191
- sortedProviderEntries,
192
- pipeIdsByInputField,
193
- pipeIdsByOutputField,
194
- pipeIdsByProvider,
195
- pipeIdsByTag,
196
- expandedSidebarSections,
197
- setExpandedSidebarSections,
198
- removeColumnFilter,
199
- addColumnFilter,
200
- },
201
- pipeEntriesByBasePipe,
202
- filterByField,
203
- globalFilterInput,
204
- setGlobalFilterInput,
205
- isFilterChecked,
206
- resetColumnFilters,
207
- category,
208
- setCategory,
209
- };
210
- }
package/src/index.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./hooks/usePipeCatalogTable";
package/tsconfig.json DELETED
@@ -1,29 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "es2023",
4
- "lib": ["ES2020", "DOM", "DOM.Iterable"],
5
- "rootDir": "src",
6
- "moduleDetection": "force",
7
- "useDefineForClassFields": true,
8
- "module": "esnext",
9
- "moduleResolution": "bundler",
10
- "noUncheckedIndexedAccess": true,
11
- "resolveJsonModule": true,
12
- "types": ["node"],
13
- "noFallthroughCasesInSwitch": true,
14
- "noUnusedLocals": false,
15
- "noUnusedParameters": true,
16
- "verbatimModuleSyntax": true,
17
- "isolatedModules": true,
18
- "skipLibCheck": true,
19
- "noUncheckedSideEffectImports": true,
20
- "outDir": "./dist",
21
- "noEmit": false,
22
- "declaration": true,
23
- "declarationMap": true,
24
- "esModuleInterop": true,
25
- "strict": true,
26
- "jsx": "react-jsx"
27
- },
28
- "include": ["./src"]
29
- }