@pipe0/react 0.2.0 → 0.2.2
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.
- package/CHANGELOG.md +17 -0
- package/dist/components/compound/pipe-form/errors.d.mts.map +1 -1
- package/dist/components/compound/pipe-form/errors.mjs +5 -4
- package/dist/components/compound/pipe-form/errors.mjs.map +1 -1
- package/dist/components/compound/pipe-form/root.d.mts +3 -1
- package/dist/components/compound/pipe-form/root.d.mts.map +1 -1
- package/dist/components/compound/pipe-form/root.mjs +5 -3
- package/dist/components/compound/pipe-form/root.mjs.map +1 -1
- package/dist/components/compound/search-form/errors.d.mts.map +1 -1
- package/dist/components/compound/search-form/errors.mjs +5 -4
- package/dist/components/compound/search-form/errors.mjs.map +1 -1
- package/dist/components/compound/search-form/root.d.mts +3 -1
- package/dist/components/compound/search-form/root.d.mts.map +1 -1
- package/dist/components/compound/search-form/root.mjs +5 -3
- package/dist/components/compound/search-form/root.mjs.map +1 -1
- package/dist/components/defaults/adapters/context-select-input.mjs +1 -1
- package/dist/components/defaults/adapters/context-select-input.mjs.map +1 -1
- package/dist/components/defaults/adapters/index.d.mts.map +1 -1
- package/dist/components/defaults/adapters/index.mjs +8 -5
- package/dist/components/defaults/adapters/index.mjs.map +1 -1
- package/dist/components/defaults/adapters/int-input.mjs.map +1 -1
- package/dist/components/defaults/adapters/loose-object-input.mjs +111 -0
- package/dist/components/defaults/adapters/loose-object-input.mjs.map +1 -0
- package/dist/components/defaults/adapters/pipes-run-if-input.mjs +146 -74
- package/dist/components/defaults/adapters/pipes-run-if-input.mjs.map +1 -1
- package/dist/components/defaults/adapters/providers-input.mjs.map +1 -1
- package/dist/components/defaults/adapters/search-payload-input.mjs +18 -0
- package/dist/components/defaults/adapters/search-payload-input.mjs.map +1 -0
- package/dist/components/defaults/adapters/select-input.mjs +46 -27
- package/dist/components/defaults/adapters/select-input.mjs.map +1 -1
- package/dist/components/defaults/catalog/card-derived.d.mts +1 -1
- package/dist/components/defaults/catalog/card-derived.d.mts.map +1 -1
- package/dist/components/defaults/catalog/card-derived.mjs +6 -2
- package/dist/components/defaults/catalog/card-derived.mjs.map +1 -1
- package/dist/components/defaults/layout/field-wrapper.d.mts.map +1 -1
- package/dist/components/defaults/layout/field-wrapper.mjs +11 -5
- package/dist/components/defaults/layout/field-wrapper.mjs.map +1 -1
- package/dist/components/defaults/layout/group.mjs +1 -1
- package/dist/components/internal/LiquidEditor/LiquidEditor.mjs.map +1 -1
- package/dist/components/internal/form-level-errors.mjs +4 -3
- package/dist/components/internal/form-level-errors.mjs.map +1 -1
- package/dist/components/internal/icons.mjs +27 -1
- package/dist/components/internal/icons.mjs.map +1 -1
- package/dist/components/ui/alert.d.mts +47 -0
- package/dist/components/ui/alert.d.mts.map +1 -0
- package/dist/components/ui/alert.mjs +66 -0
- package/dist/components/ui/alert.mjs.map +1 -0
- package/dist/context/form-context.d.mts +21 -0
- package/dist/context/form-context.d.mts.map +1 -0
- package/dist/context/form-context.mjs +11 -1
- package/dist/context/form-context.mjs.map +1 -1
- package/dist/context/form-provider.d.mts +3 -1
- package/dist/context/form-provider.d.mts.map +1 -1
- package/dist/context/form-provider.mjs +8 -2
- package/dist/context/form-provider.mjs.map +1 -1
- package/dist/hooks/use-effect-catalog-table.d.mts.map +1 -1
- package/dist/hooks/use-effect-catalog-table.mjs +2 -2
- package/dist/hooks/use-effect-catalog-table.mjs.map +1 -1
- package/dist/hooks/use-form-core.mjs +7 -4
- package/dist/hooks/use-form-core.mjs.map +1 -1
- package/dist/hooks/use-pipe-catalog-table.d.mts +8 -8
- package/dist/hooks/use-pipe-catalog-table.d.mts.map +1 -1
- package/dist/hooks/use-pipe-catalog-table.mjs +2 -2
- package/dist/hooks/use-pipe-catalog-table.mjs.map +1 -1
- package/dist/hooks/use-pipe-form.d.mts.map +1 -1
- package/dist/hooks/use-pipe-form.mjs +18 -19
- package/dist/hooks/use-pipe-form.mjs.map +1 -1
- package/dist/hooks/use-search-catalog-table.d.mts +6 -6
- package/dist/hooks/use-search-form.d.mts.map +1 -1
- package/dist/hooks/use-search-form.mjs +18 -18
- package/dist/hooks/use-search-form.mjs.map +1 -1
- package/dist/hooks/use-sheet-effect-form.d.mts.map +1 -1
- package/dist/hooks/use-sheet-effect-form.mjs +18 -19
- package/dist/hooks/use-sheet-effect-form.mjs.map +1 -1
- package/dist/index.d.mts +4 -2
- package/dist/index.mjs +3 -1
- package/dist/styles/pipe0-form.css +1 -1
- package/dist/types/adapters.d.mts +22 -1
- package/dist/types/adapters.d.mts.map +1 -1
- package/dist/types/catalog-adapters.d.mts +1 -1
- package/dist/types/field-props.d.mts +23 -13
- package/dist/types/field-props.d.mts.map +1 -1
- package/dist/types/form-customization.d.mts +2 -25
- package/dist/utils/build-section-handlers.mjs +8 -74
- package/dist/utils/build-section-handlers.mjs.map +1 -1
- package/dist/widgets/token-pricing-badge.d.mts +1 -0
- package/dist/widgets/token-pricing-badge.mjs +55 -0
- package/dist/widgets/token-pricing-badge.mjs.map +1 -0
- package/dist/widgets/widget-strip.d.mts.map +1 -1
- package/dist/widgets/widget-strip.mjs +1 -0
- package/dist/widgets/widget-strip.mjs.map +1 -1
- package/dist/widgets/widget-view.d.mts.map +1 -1
- package/dist/widgets/widget-view.mjs +6 -0
- package/dist/widgets/widget-view.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/components/defaults/adapters/key-value-list-input.mjs +0 -102
- package/dist/components/defaults/adapters/key-value-list-input.mjs.map +0 -1
- package/dist/types/form-customization.d.mts.map +0 -1
|
@@ -32,14 +32,14 @@ declare function usePipeCatalogTable(config?: {
|
|
|
32
32
|
removeColumnFilter: (id: "inputFields" | "outputFields" | "tags" | "providers") => void;
|
|
33
33
|
resetFilters: () => void;
|
|
34
34
|
getColumnFilterValue: (id: "inputFields" | "outputFields" | "tags" | "providers") => string;
|
|
35
|
-
sortedInputFieldEntries: [string, ("prompt:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "
|
|
36
|
-
sortedOutputFieldEntries: [string, ("prompt:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "
|
|
37
|
-
sortedTagEntries: [string, ("prompt:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "
|
|
38
|
-
sortedProviderEntries: [string, ("prompt:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "
|
|
39
|
-
pipeIdsByInputField: Record<string, ("prompt:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "
|
|
40
|
-
pipeIdsByOutputField: Record<string, ("prompt:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "
|
|
41
|
-
pipeIdsByProvider: Record<string, ("prompt:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "
|
|
42
|
-
pipeIdsByTag: Record<string, ("prompt:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "
|
|
35
|
+
sortedInputFieldEntries: [string, ("prompt:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]][];
|
|
36
|
+
sortedOutputFieldEntries: [string, ("prompt:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]][];
|
|
37
|
+
sortedTagEntries: [string, ("prompt:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]][];
|
|
38
|
+
sortedProviderEntries: [string, ("prompt:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]][];
|
|
39
|
+
pipeIdsByInputField: Record<string, ("prompt:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]>;
|
|
40
|
+
pipeIdsByOutputField: Record<string, ("prompt:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]>;
|
|
41
|
+
pipeIdsByProvider: Record<string, ("prompt:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]>;
|
|
42
|
+
pipeIdsByTag: Record<string, ("prompt:run@1" | "company:newssummary:website@1" | "company:newssummary:domain@1" | "company:techstack:builtwith@1" | "company:techstack:builtwith@2" | "company:websiteurl:email@1" | "company:domain:workemail@1" | "company:funding:leadmagic@1" | "company:funding:leadmagic@2" | "people:workemail:waterfall@1" | "person:workemail:waterfall@1" | "people:email:iswork@1" | "email:iswork@1" | "people:name:split@1" | "person:name:split@1" | "person:name:join@1" | "people:validate:email:zerobounce@1" | "people:email:validate:zerobounce@2" | "email:validate:zerobounce@1" | "people:mobilenumber:workemail:waterfall@1" | "company:overview@1" | "company:overview@2" | "company:overview@3" | "json:extract:multi@1" | "email:write@1" | "message:write@1" | "email:send:resend@1" | "email:send:gmail@1" | "message:send:slack@1" | "template:fill@1" | "contact:create:resend@1" | "lead:enroll:lemlist@1" | "people:match:role:waterfall@1" | "person:match:role:waterfall@1" | "person:identity:amplemarket@1" | "company:identity@2" | "company:identity@3" | "company:identity:crustdata@1" | "person:match:amplemarket@1" | "people:phone:profile:waterfall@1" | "person:mobile:profileurl:waterfall@1" | "people:personalemail:profile:waterfall@1" | "person:personalemail:profileurl:waterfall@1" | "people:profile:waterfall@1" | "person:profile:waterfall@1" | "people:profileurl:email:waterfall@1" | "person:profileurl:email:waterfall@1" | "person:profileurl:name@1" | "people:email:validate:zerobounce@1" | "person:email:validate:millionverifier@1" | "people:phone:workemail:waterfall@1" | "person:mobile:workemail:waterfall@1" | "fields:merge@1" | "field:slugify@1" | "field:domainify@1" | "website:scrape:firecrawl@1" | "website:scrapelist:firecrawl@1" | "website:extract:firecrawl@1" | "website:extract:parallel@1" | "website:maplinks:firecrawl@1" | "row:append:sheet@1" | "row:expandappend:sheet@1" | "rows:find:sheet@1" | "rows:find:postgres@1" | "rows:find:databricks@1" | "company:lookalikes:companyenrich@1" | "company:lookalikes:companyenrich@2" | "company:match:logodev@1" | "company:match:logodev@2" | "person:posts:content:crustdata@1" | "company:match:crustdata@1" | "company:match:crustdata@2" | "people:profile:workemail:crustdata@1" | "person:profile:workemail:crustdata@1" | "people:workemail:profileurl:waterfall@1" | "person:workemail:profileurl:waterfall@1" | "people:identity:email:waterfall@1" | "person:identity:email:waterfall@1" | "person:devprofileurl:profileurl:waterfall@1" | "http:request@1" | "company:identity@1" | "people:professionalprofile:waterfall@1" | "people:professionalprofileurl:name@1" | "people:professionalprofileurl:email:waterfall@1" | "people:mobilenumber:professionalprofile:waterfall@1")[]>;
|
|
43
43
|
};
|
|
44
44
|
type UsePipeCatalogTableReturn = ReturnType<typeof usePipeCatalogTable>;
|
|
45
45
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-pipe-catalog-table.d.mts","names":[],"sources":["../../src/hooks/use-pipe-catalog-table.ts"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"use-pipe-catalog-table.d.mts","names":[],"sources":["../../src/hooks/use-pipe-catalog-table.ts"],"mappings":";;;;;;;KA4BY,iBAAA,GAAoB,MAAA,SAAe,MAAA;AAAA,KACnC,kBAAA,GAAqB,MAAA,SAAe,MAAA;AAAA,iBA6ChC,mBAAA,CACd,MAAA;EACE,oBAAA,GAAuB,YAAA;EAhDf;;;;EAqDR,MAAA,GAAS,aAAA;AAAA;;;;cA+HiC,YAAA;WAAqB,YAAA;EAAA;;;;;0BAjEpD,YAAA;;yCAAY,OAAA,CAAA,cAAA;+EARmC,KAAA;;;;;;;;;;;;;KAsJlD,yBAAA,GAA4B,UAAA,QAAkB,mBAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { fuzzyFilter } from "../utils/catalog-helpers.mjs";
|
|
2
2
|
import { useDebounce } from "./use-debounce.mjs";
|
|
3
3
|
import { useCallback, useMemo, useState } from "react";
|
|
4
|
-
import { collectRequirementFields, filterPipeEntries, getDefaultOutputFields, getDefaultPipeProviders, getInitialTableData, getLowestPipeCreditAmount, getStartingCostPerPipesProvider, getTableDataAggregates } from "@pipe0/base";
|
|
4
|
+
import { collectRequirementFields, filterPipeEntries, getDefaultOutputFields, getDefaultPipeProviders, getInitialTableData, getLowestPipeCreditAmount, getStartingCostPerPipesProvider, getTableDataAggregates, isTokenBilledOperations } from "@pipe0/base";
|
|
5
5
|
import { createColumnHelper, getCoreRowModel, getFilteredRowModel, useReactTable } from "@tanstack/react-table";
|
|
6
6
|
|
|
7
7
|
//#region src/hooks/use-pipe-catalog-table.ts
|
|
@@ -103,7 +103,7 @@ function usePipeCatalogTable(config = {}) {
|
|
|
103
103
|
providers,
|
|
104
104
|
startingCostPerProvider: getStartingCostPerPipesProvider(latestEntry.pipeId),
|
|
105
105
|
startingCreditAmount: getLowestPipeCreditAmount(latestEntry),
|
|
106
|
-
costMode: "per_result",
|
|
106
|
+
costMode: isTokenBilledOperations(latestEntry.billableOperations) ? "usage" : "per_result",
|
|
107
107
|
defaultInputFields: latestEntry.defaultInputRequirement ? collectRequirementFields(latestEntry.defaultInputRequirement).map(({ field }) => ({ name: field.name })) : [],
|
|
108
108
|
defaultOutputFields: getDefaultOutputFields(latestEntry) ?? [],
|
|
109
109
|
docPath: latestEntry.docPath,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-pipe-catalog-table.mjs","names":[],"sources":["../../src/hooks/use-pipe-catalog-table.ts"],"sourcesContent":["import {\n type CatalogFilter,\n collectRequirementFields,\n filterPipeEntries,\n getDefaultOutputFields,\n getDefaultPipeProviders,\n getInitialTableData,\n getLowestPipeCreditAmount,\n getStartingCostPerPipesProvider,\n getTableDataAggregates,\n type PipeCatalogEntry,\n type PipeCategory,\n type PipeEntryWithLatestVersion,\n type PipeId,\n} from \"@pipe0/base\";\nimport {\n type ColumnFilter,\n createColumnHelper,\n getCoreRowModel,\n getFilteredRowModel,\n useReactTable,\n} from \"@tanstack/react-table\";\nimport { useCallback, useMemo, useState } from \"react\";\nimport type { PipeCardData } from \"../types/catalog-adapters.js\";\nimport { fuzzyFilter } from \"../utils/catalog-helpers.js\";\nimport { useDebounce } from \"./use-debounce.js\";\n\nexport type InputFieldEntries = Record<string, PipeId[]>;\nexport type OutputFieldEntries = Record<string, PipeId[]>;\n\nconst columnHelper = createColumnHelper<PipeEntryWithLatestVersion>();\n\nconst columns = [\n columnHelper.accessor(\"pipeId\", {\n filterFn: \"includesString\",\n enableGlobalFilter: true,\n }),\n columnHelper.accessor(\"label\", {\n filterFn: \"fuzzy\" as any,\n enableGlobalFilter: true,\n }),\n columnHelper.accessor(\"description\", {\n filterFn: \"fuzzy\" as any,\n enableGlobalFilter: true,\n }),\n columnHelper.accessor(\n (row) =>\n row.defaultInputRequirement\n ? collectRequirementFields(row.defaultInputRequirement).map(({ field }) => field.name)\n : [],\n {\n id: \"inputFields\",\n filterFn: \"arrIncludes\",\n enableGlobalFilter: false,\n },\n ),\n columnHelper.accessor((row) => getDefaultOutputFields(row) || [], {\n id: \"outputFields\",\n filterFn: \"arrIncludes\",\n enableGlobalFilter: false,\n }),\n columnHelper.accessor((row) => row.tags || [], {\n id: \"tags\",\n filterFn: \"arrIncludes\",\n enableGlobalFilter: true,\n }),\n columnHelper.accessor((row) => getDefaultPipeProviders(row.pipeId) || [], {\n id: \"providers\",\n filterFn: \"arrIncludes\",\n enableGlobalFilter: true,\n }),\n];\n\nexport function usePipeCatalogTable(\n config: {\n initialColumnFilters?: ColumnFilter[];\n /**\n * Optional whitelist/blacklist of pipes and providers. Memoize to avoid\n * recomputing the table data on every render.\n */\n filter?: CatalogFilter;\n } = {},\n) {\n const [category, setCategory] = useState<PipeCategory | null>(null);\n const { initialColumnFilters = [] as ColumnFilter[], filter } = config;\n\n const initialTableData = useMemo(\n () => filterPipeEntries(getInitialTableData(category), filter),\n [category, filter],\n );\n\n // Baseline (config.filter applied, but no category / column / global filter).\n // Drives the stable category-button counts so the row doesn't jump when the\n // user changes a filter.\n const baselineTableData = useMemo(\n () => filterPipeEntries(getInitialTableData(null), filter),\n [filter],\n );\n\n const table = useReactTable({\n columns,\n data: initialTableData,\n getCoreRowModel: getCoreRowModel(),\n getFilteredRowModel: getFilteredRowModel(),\n globalFilterFn: fuzzyFilter,\n filterFns: {\n fuzzy: fuzzyFilter,\n },\n getColumnCanGlobalFilter: (column) => column.columnDef.enableGlobalFilter !== false,\n initialState: {\n columnFilters: initialColumnFilters,\n pagination: {\n pageSize: 10,\n },\n },\n });\n\n const columnFilters = table.getState().columnFilters;\n\n const aggregates = useMemo(\n () => getTableDataAggregates(initialTableData, category),\n [category, initialTableData],\n );\n\n const [globalFilterInput, setGlobalFilterInput, setGlobalFilterImmediately] = useDebounce((v) => {\n if (v === table.getState().globalFilter) return;\n table.setGlobalFilter(v);\n if (v) {\n setCategory(null);\n table.setColumnFilters([]);\n }\n });\n\n const addColumnFilter = useCallback(\n (id: \"inputFields\" | \"outputFields\" | \"tags\" | \"providers\", value: string) => {\n setGlobalFilterImmediately(\"\");\n table.setColumnFilters([{ id, value }]);\n },\n [setGlobalFilterImmediately, table],\n );\n\n const handleCategoryChange = useCallback(\n (category: PipeCategory | null) => {\n setCategory(category);\n table.setColumnFilters([]);\n setGlobalFilterImmediately(\"\");\n },\n [table, setGlobalFilterImmediately],\n );\n\n const resetFilters = useCallback(() => {\n setGlobalFilterImmediately(\"\");\n setCategory(null);\n }, [setGlobalFilterImmediately]);\n\n const removeColumnFilter = useCallback(\n (id: \"inputFields\" | \"outputFields\" | \"tags\" | \"providers\") => {\n table.getColumn(id)?.setFilterValue(null);\n },\n [table],\n );\n\n const getColumnFilterValue = useCallback(\n (id: \"inputFields\" | \"outputFields\" | \"tags\" | \"providers\") => {\n const res = columnFilters.find((f) => f.id === id)?.value;\n return res as string;\n },\n [columnFilters],\n );\n\n // Pre-compute card display data so consumers don't have to. Memoized on\n // the filtered rows + aggregate map (both stable references from tanstack).\n const rows = table.getRowModel().rows;\n const cards = useMemo<PipeCardData[]>(\n () =>\n rows.map((row) => {\n const entry = row.original;\n const latestEntry = (aggregates.pipeEntriesByBasePipe[entry.basePipe]?.[0] ??\n entry) as PipeCatalogEntry & { pipeId: PipeId };\n const providers = getDefaultPipeProviders(latestEntry.pipeId);\n return {\n pipeId: latestEntry.pipeId,\n basePipe: entry.basePipe,\n label: entry.label,\n description: entry.description,\n providers,\n startingCostPerProvider: getStartingCostPerPipesProvider(latestEntry.pipeId),\n startingCreditAmount: getLowestPipeCreditAmount(latestEntry),\n costMode: \"per_result\",\n defaultInputFields: latestEntry.defaultInputRequirement\n ? collectRequirementFields(latestEntry.defaultInputRequirement).map(({ field }) => ({\n name: field.name,\n }))\n : [],\n defaultOutputFields: getDefaultOutputFields(latestEntry) ?? [],\n docPath: latestEntry.docPath,\n entry,\n latestEntry,\n };\n }),\n [rows, aggregates.pipeEntriesByBasePipe],\n );\n\n // Group cards by category. Pipes can belong to multiple categories — they\n // appear once per matching category. Order: insertion (first-seen).\n const cardsByCategory = useMemo<{ category: PipeCategory; cards: PipeCardData[] }[]>(() => {\n const groups = new Map<PipeCategory, PipeCardData[]>();\n for (const card of cards) {\n const cats = (card.entry.categories ?? []) as PipeCategory[];\n for (const cat of cats) {\n const arr = groups.get(cat);\n if (arr) arr.push(card);\n else groups.set(cat, [card]);\n }\n }\n return Array.from(groups, ([category, group]) => ({\n category,\n cards: group,\n }));\n }, [cards]);\n\n // Count of cards per category (a pipe in N categories counts N times).\n const categoryCounts = useMemo<Partial<Record<PipeCategory, number>>>(() => {\n const counts: Partial<Record<PipeCategory, number>> = {};\n for (const card of cards) {\n const cats = (card.entry.categories ?? []) as PipeCategory[];\n for (const cat of cats) {\n counts[cat] = (counts[cat] ?? 0) + 1;\n }\n }\n return counts;\n }, [cards]);\n\n // Stable counts based on the baseline (no category / column / global filter\n // applied). Use these to render category-selector counts that don't jump as\n // the user clicks around.\n const baselineCardCount = baselineTableData.length;\n const baselineCategoryCounts = useMemo<Partial<Record<PipeCategory, number>>>(() => {\n const counts: Partial<Record<PipeCategory, number>> = {};\n for (const entry of baselineTableData) {\n const cats = (entry.categories ?? []) as PipeCategory[];\n for (const cat of cats) {\n counts[cat] = (counts[cat] ?? 0) + 1;\n }\n }\n return counts;\n }, [baselineTableData]);\n\n return {\n table,\n cards,\n cardsByCategory,\n categoryCounts,\n baselineCardCount,\n baselineCategoryCounts,\n\n // category + global filter\n category,\n setCategory: handleCategoryChange,\n globalFilterInput,\n setGlobalFilterInput,\n\n // mutators\n addColumnFilter,\n removeColumnFilter,\n resetFilters,\n getColumnFilterValue,\n\n // aggregates for filter UI\n sortedInputFieldEntries: aggregates.sortedInputFieldEntries,\n sortedOutputFieldEntries: aggregates.sortedOutputFieldEntries,\n sortedTagEntries: aggregates.sortedTagEntries,\n sortedProviderEntries: aggregates.sortedProviderEntries,\n\n // reverse indexes (power-user / inverted-filter UX)\n pipeIdsByInputField: aggregates.pipeIdsByInputField,\n pipeIdsByOutputField: aggregates.pipeIdsByOutputField,\n pipeIdsByProvider: aggregates.pipeIdsByProvider,\n pipeIdsByTag: aggregates.pipeIdsByTag,\n };\n}\n\nexport type UsePipeCatalogTableReturn = ReturnType<typeof usePipeCatalogTable>;\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"use-pipe-catalog-table.mjs","names":[],"sources":["../../src/hooks/use-pipe-catalog-table.ts"],"sourcesContent":["import {\n type CatalogFilter,\n collectRequirementFields,\n filterPipeEntries,\n getDefaultOutputFields,\n getDefaultPipeProviders,\n getInitialTableData,\n getLowestPipeCreditAmount,\n getStartingCostPerPipesProvider,\n getTableDataAggregates,\n isTokenBilledOperations,\n type PipeCatalogEntry,\n type PipeCategory,\n type PipeEntryWithLatestVersion,\n type PipeId,\n} from \"@pipe0/base\";\nimport {\n type ColumnFilter,\n createColumnHelper,\n getCoreRowModel,\n getFilteredRowModel,\n useReactTable,\n} from \"@tanstack/react-table\";\nimport { useCallback, useMemo, useState } from \"react\";\nimport type { PipeCardData } from \"../types/catalog-adapters.js\";\nimport { fuzzyFilter } from \"../utils/catalog-helpers.js\";\nimport { useDebounce } from \"./use-debounce.js\";\n\nexport type InputFieldEntries = Record<string, PipeId[]>;\nexport type OutputFieldEntries = Record<string, PipeId[]>;\n\nconst columnHelper = createColumnHelper<PipeEntryWithLatestVersion>();\n\nconst columns = [\n columnHelper.accessor(\"pipeId\", {\n filterFn: \"includesString\",\n enableGlobalFilter: true,\n }),\n columnHelper.accessor(\"label\", {\n filterFn: \"fuzzy\" as any,\n enableGlobalFilter: true,\n }),\n columnHelper.accessor(\"description\", {\n filterFn: \"fuzzy\" as any,\n enableGlobalFilter: true,\n }),\n columnHelper.accessor(\n (row) =>\n row.defaultInputRequirement\n ? collectRequirementFields(row.defaultInputRequirement).map(({ field }) => field.name)\n : [],\n {\n id: \"inputFields\",\n filterFn: \"arrIncludes\",\n enableGlobalFilter: false,\n },\n ),\n columnHelper.accessor((row) => getDefaultOutputFields(row) || [], {\n id: \"outputFields\",\n filterFn: \"arrIncludes\",\n enableGlobalFilter: false,\n }),\n columnHelper.accessor((row) => row.tags || [], {\n id: \"tags\",\n filterFn: \"arrIncludes\",\n enableGlobalFilter: true,\n }),\n columnHelper.accessor((row) => getDefaultPipeProviders(row.pipeId) || [], {\n id: \"providers\",\n filterFn: \"arrIncludes\",\n enableGlobalFilter: true,\n }),\n];\n\nexport function usePipeCatalogTable(\n config: {\n initialColumnFilters?: ColumnFilter[];\n /**\n * Optional whitelist/blacklist of pipes and providers. Memoize to avoid\n * recomputing the table data on every render.\n */\n filter?: CatalogFilter;\n } = {},\n) {\n const [category, setCategory] = useState<PipeCategory | null>(null);\n const { initialColumnFilters = [] as ColumnFilter[], filter } = config;\n\n const initialTableData = useMemo(\n () => filterPipeEntries(getInitialTableData(category), filter),\n [category, filter],\n );\n\n // Baseline (config.filter applied, but no category / column / global filter).\n // Drives the stable category-button counts so the row doesn't jump when the\n // user changes a filter.\n const baselineTableData = useMemo(\n () => filterPipeEntries(getInitialTableData(null), filter),\n [filter],\n );\n\n const table = useReactTable({\n columns,\n data: initialTableData,\n getCoreRowModel: getCoreRowModel(),\n getFilteredRowModel: getFilteredRowModel(),\n globalFilterFn: fuzzyFilter,\n filterFns: {\n fuzzy: fuzzyFilter,\n },\n getColumnCanGlobalFilter: (column) => column.columnDef.enableGlobalFilter !== false,\n initialState: {\n columnFilters: initialColumnFilters,\n pagination: {\n pageSize: 10,\n },\n },\n });\n\n const columnFilters = table.getState().columnFilters;\n\n const aggregates = useMemo(\n () => getTableDataAggregates(initialTableData, category),\n [category, initialTableData],\n );\n\n const [globalFilterInput, setGlobalFilterInput, setGlobalFilterImmediately] = useDebounce((v) => {\n if (v === table.getState().globalFilter) return;\n table.setGlobalFilter(v);\n if (v) {\n setCategory(null);\n table.setColumnFilters([]);\n }\n });\n\n const addColumnFilter = useCallback(\n (id: \"inputFields\" | \"outputFields\" | \"tags\" | \"providers\", value: string) => {\n setGlobalFilterImmediately(\"\");\n table.setColumnFilters([{ id, value }]);\n },\n [setGlobalFilterImmediately, table],\n );\n\n const handleCategoryChange = useCallback(\n (category: PipeCategory | null) => {\n setCategory(category);\n table.setColumnFilters([]);\n setGlobalFilterImmediately(\"\");\n },\n [table, setGlobalFilterImmediately],\n );\n\n const resetFilters = useCallback(() => {\n setGlobalFilterImmediately(\"\");\n setCategory(null);\n }, [setGlobalFilterImmediately]);\n\n const removeColumnFilter = useCallback(\n (id: \"inputFields\" | \"outputFields\" | \"tags\" | \"providers\") => {\n table.getColumn(id)?.setFilterValue(null);\n },\n [table],\n );\n\n const getColumnFilterValue = useCallback(\n (id: \"inputFields\" | \"outputFields\" | \"tags\" | \"providers\") => {\n const res = columnFilters.find((f) => f.id === id)?.value;\n return res as string;\n },\n [columnFilters],\n );\n\n // Pre-compute card display data so consumers don't have to. Memoized on\n // the filtered rows + aggregate map (both stable references from tanstack).\n const rows = table.getRowModel().rows;\n const cards = useMemo<PipeCardData[]>(\n () =>\n rows.map((row) => {\n const entry = row.original;\n const latestEntry = (aggregates.pipeEntriesByBasePipe[entry.basePipe]?.[0] ??\n entry) as PipeCatalogEntry & { pipeId: PipeId };\n const providers = getDefaultPipeProviders(latestEntry.pipeId);\n return {\n pipeId: latestEntry.pipeId,\n basePipe: entry.basePipe,\n label: entry.label,\n description: entry.description,\n providers,\n startingCostPerProvider: getStartingCostPerPipesProvider(latestEntry.pipeId),\n startingCreditAmount: getLowestPipeCreditAmount(latestEntry),\n costMode: isTokenBilledOperations(latestEntry.billableOperations)\n ? \"usage\"\n : \"per_result\",\n defaultInputFields: latestEntry.defaultInputRequirement\n ? collectRequirementFields(latestEntry.defaultInputRequirement).map(({ field }) => ({\n name: field.name,\n }))\n : [],\n defaultOutputFields: getDefaultOutputFields(latestEntry) ?? [],\n docPath: latestEntry.docPath,\n entry,\n latestEntry,\n };\n }),\n [rows, aggregates.pipeEntriesByBasePipe],\n );\n\n // Group cards by category. Pipes can belong to multiple categories — they\n // appear once per matching category. Order: insertion (first-seen).\n const cardsByCategory = useMemo<{ category: PipeCategory; cards: PipeCardData[] }[]>(() => {\n const groups = new Map<PipeCategory, PipeCardData[]>();\n for (const card of cards) {\n const cats = (card.entry.categories ?? []) as PipeCategory[];\n for (const cat of cats) {\n const arr = groups.get(cat);\n if (arr) arr.push(card);\n else groups.set(cat, [card]);\n }\n }\n return Array.from(groups, ([category, group]) => ({\n category,\n cards: group,\n }));\n }, [cards]);\n\n // Count of cards per category (a pipe in N categories counts N times).\n const categoryCounts = useMemo<Partial<Record<PipeCategory, number>>>(() => {\n const counts: Partial<Record<PipeCategory, number>> = {};\n for (const card of cards) {\n const cats = (card.entry.categories ?? []) as PipeCategory[];\n for (const cat of cats) {\n counts[cat] = (counts[cat] ?? 0) + 1;\n }\n }\n return counts;\n }, [cards]);\n\n // Stable counts based on the baseline (no category / column / global filter\n // applied). Use these to render category-selector counts that don't jump as\n // the user clicks around.\n const baselineCardCount = baselineTableData.length;\n const baselineCategoryCounts = useMemo<Partial<Record<PipeCategory, number>>>(() => {\n const counts: Partial<Record<PipeCategory, number>> = {};\n for (const entry of baselineTableData) {\n const cats = (entry.categories ?? []) as PipeCategory[];\n for (const cat of cats) {\n counts[cat] = (counts[cat] ?? 0) + 1;\n }\n }\n return counts;\n }, [baselineTableData]);\n\n return {\n table,\n cards,\n cardsByCategory,\n categoryCounts,\n baselineCardCount,\n baselineCategoryCounts,\n\n // category + global filter\n category,\n setCategory: handleCategoryChange,\n globalFilterInput,\n setGlobalFilterInput,\n\n // mutators\n addColumnFilter,\n removeColumnFilter,\n resetFilters,\n getColumnFilterValue,\n\n // aggregates for filter UI\n sortedInputFieldEntries: aggregates.sortedInputFieldEntries,\n sortedOutputFieldEntries: aggregates.sortedOutputFieldEntries,\n sortedTagEntries: aggregates.sortedTagEntries,\n sortedProviderEntries: aggregates.sortedProviderEntries,\n\n // reverse indexes (power-user / inverted-filter UX)\n pipeIdsByInputField: aggregates.pipeIdsByInputField,\n pipeIdsByOutputField: aggregates.pipeIdsByOutputField,\n pipeIdsByProvider: aggregates.pipeIdsByProvider,\n pipeIdsByTag: aggregates.pipeIdsByTag,\n };\n}\n\nexport type UsePipeCatalogTableReturn = ReturnType<typeof usePipeCatalogTable>;\n"],"mappings":";;;;;;;AA+BA,MAAM,eAAe,oBAAgD;AAErE,MAAM,UAAU;CACd,aAAa,SAAS,UAAU;EAC9B,UAAU;EACV,oBAAoB;EACrB,CAAC;CACF,aAAa,SAAS,SAAS;EAC7B,UAAU;EACV,oBAAoB;EACrB,CAAC;CACF,aAAa,SAAS,eAAe;EACnC,UAAU;EACV,oBAAoB;EACrB,CAAC;CACF,aAAa,UACV,QACC,IAAI,0BACA,yBAAyB,IAAI,wBAAwB,CAAC,KAAK,EAAE,YAAY,MAAM,KAAK,GACpF,EAAE,EACR;EACE,IAAI;EACJ,UAAU;EACV,oBAAoB;EACrB,CACF;CACD,aAAa,UAAU,QAAQ,uBAAuB,IAAI,IAAI,EAAE,EAAE;EAChE,IAAI;EACJ,UAAU;EACV,oBAAoB;EACrB,CAAC;CACF,aAAa,UAAU,QAAQ,IAAI,QAAQ,EAAE,EAAE;EAC7C,IAAI;EACJ,UAAU;EACV,oBAAoB;EACrB,CAAC;CACF,aAAa,UAAU,QAAQ,wBAAwB,IAAI,OAAO,IAAI,EAAE,EAAE;EACxE,IAAI;EACJ,UAAU;EACV,oBAAoB;EACrB,CAAC;CACH;AAED,SAAgB,oBACd,SAOI,EAAE,EACN;CACA,MAAM,CAAC,UAAU,eAAe,SAA8B,KAAK;CACnE,MAAM,EAAE,uBAAuB,EAAE,EAAoB,WAAW;CAEhE,MAAM,mBAAmB,cACjB,kBAAkB,oBAAoB,SAAS,EAAE,OAAO,EAC9D,CAAC,UAAU,OAAO,CACnB;CAKD,MAAM,oBAAoB,cAClB,kBAAkB,oBAAoB,KAAK,EAAE,OAAO,EAC1D,CAAC,OAAO,CACT;CAED,MAAM,QAAQ,cAAc;EAC1B;EACA,MAAM;EACN,iBAAiB,iBAAiB;EAClC,qBAAqB,qBAAqB;EAC1C,gBAAgB;EAChB,WAAW,EACT,OAAO,aACR;EACD,2BAA2B,WAAW,OAAO,UAAU,uBAAuB;EAC9E,cAAc;GACZ,eAAe;GACf,YAAY,EACV,UAAU,IACX;GACF;EACF,CAAC;CAEF,MAAM,gBAAgB,MAAM,UAAU,CAAC;CAEvC,MAAM,aAAa,cACX,uBAAuB,kBAAkB,SAAS,EACxD,CAAC,UAAU,iBAAiB,CAC7B;CAED,MAAM,CAAC,mBAAmB,sBAAsB,8BAA8B,aAAa,MAAM;AAC/F,MAAI,MAAM,MAAM,UAAU,CAAC,aAAc;AACzC,QAAM,gBAAgB,EAAE;AACxB,MAAI,GAAG;AACL,eAAY,KAAK;AACjB,SAAM,iBAAiB,EAAE,CAAC;;GAE5B;CAEF,MAAM,kBAAkB,aACrB,IAA2D,UAAkB;AAC5E,6BAA2B,GAAG;AAC9B,QAAM,iBAAiB,CAAC;GAAE;GAAI;GAAO,CAAC,CAAC;IAEzC,CAAC,4BAA4B,MAAM,CACpC;CAED,MAAM,uBAAuB,aAC1B,aAAkC;AACjC,cAAY,SAAS;AACrB,QAAM,iBAAiB,EAAE,CAAC;AAC1B,6BAA2B,GAAG;IAEhC,CAAC,OAAO,2BAA2B,CACpC;CAED,MAAM,eAAe,kBAAkB;AACrC,6BAA2B,GAAG;AAC9B,cAAY,KAAK;IAChB,CAAC,2BAA2B,CAAC;CAEhC,MAAM,qBAAqB,aACxB,OAA8D;AAC7D,QAAM,UAAU,GAAG,EAAE,eAAe,KAAK;IAE3C,CAAC,MAAM,CACR;CAED,MAAM,uBAAuB,aAC1B,OAA8D;AAE7D,SADY,cAAc,MAAM,MAAM,EAAE,OAAO,GAAG,EAAE;IAGtD,CAAC,cAAc,CAChB;CAID,MAAM,OAAO,MAAM,aAAa,CAAC;CACjC,MAAM,QAAQ,cAEV,KAAK,KAAK,QAAQ;EAChB,MAAM,QAAQ,IAAI;EAClB,MAAM,cAAe,WAAW,sBAAsB,MAAM,YAAY,MACtE;EACF,MAAM,YAAY,wBAAwB,YAAY,OAAO;AAC7D,SAAO;GACL,QAAQ,YAAY;GACpB,UAAU,MAAM;GAChB,OAAO,MAAM;GACb,aAAa,MAAM;GACnB;GACA,yBAAyB,gCAAgC,YAAY,OAAO;GAC5E,sBAAsB,0BAA0B,YAAY;GAC5D,UAAU,wBAAwB,YAAY,mBAAmB,GAC7D,UACA;GACJ,oBAAoB,YAAY,0BAC5B,yBAAyB,YAAY,wBAAwB,CAAC,KAAK,EAAE,aAAa,EAChF,MAAM,MAAM,MACb,EAAE,GACH,EAAE;GACN,qBAAqB,uBAAuB,YAAY,IAAI,EAAE;GAC9D,SAAS,YAAY;GACrB;GACA;GACD;GACD,EACJ,CAAC,MAAM,WAAW,sBAAsB,CACzC;AA+CD,QAAO;EACL;EACA;EACA,iBA9CsB,cAAmE;GACzF,MAAM,yBAAS,IAAI,KAAmC;AACtD,QAAK,MAAM,QAAQ,OAAO;IACxB,MAAM,OAAQ,KAAK,MAAM,cAAc,EAAE;AACzC,SAAK,MAAM,OAAO,MAAM;KACtB,MAAM,MAAM,OAAO,IAAI,IAAI;AAC3B,SAAI,IAAK,KAAI,KAAK,KAAK;SAClB,QAAO,IAAI,KAAK,CAAC,KAAK,CAAC;;;AAGhC,UAAO,MAAM,KAAK,SAAS,CAAC,UAAU,YAAY;IAChD;IACA,OAAO;IACR,EAAE;KACF,CAAC,MAAM,CAAC;EAiCT,gBA9BqB,cAAqD;GAC1E,MAAM,SAAgD,EAAE;AACxD,QAAK,MAAM,QAAQ,OAAO;IACxB,MAAM,OAAQ,KAAK,MAAM,cAAc,EAAE;AACzC,SAAK,MAAM,OAAO,KAChB,QAAO,QAAQ,OAAO,QAAQ,KAAK;;AAGvC,UAAO;KACN,CAAC,MAAM,CAAC;EAsBT,mBAjBwB,kBAAkB;EAkB1C,wBAjB6B,cAAqD;GAClF,MAAM,SAAgD,EAAE;AACxD,QAAK,MAAM,SAAS,mBAAmB;IACrC,MAAM,OAAQ,MAAM,cAAc,EAAE;AACpC,SAAK,MAAM,OAAO,KAChB,QAAO,QAAQ,OAAO,QAAQ,KAAK;;AAGvC,UAAO;KACN,CAAC,kBAAkB,CAAC;EAWrB;EACA,aAAa;EACb;EACA;EAGA;EACA;EACA;EACA;EAGA,yBAAyB,WAAW;EACpC,0BAA0B,WAAW;EACrC,kBAAkB,WAAW;EAC7B,uBAAuB,WAAW;EAGlC,qBAAqB,WAAW;EAChC,sBAAsB,WAAW;EACjC,mBAAmB,WAAW;EAC9B,cAAc,WAAW;EAC1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-pipe-form.d.mts","names":[],"sources":["../../src/hooks/use-pipe-form.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"use-pipe-form.d.mts","names":[],"sources":["../../src/hooks/use-pipe-form.ts"],"mappings":";;;;;;UAkBiB,kBAAA;EACf,MAAA,EAAQ,MAAA;EACR,SAAA;EACA,aAAA,GAAgB,WAAA;EAChB,SAAA,GAAY,aAAA;EACZ,eAAA;IAAoB,SAAA;IAAmB,QAAA;EAAA;EACvC,iBAAA,GAAoB,iBAAA;EACpB,KAAA,GAAQ,SAAA;EAUE;;;;;EAJV,UAAA,GAAa,UAAA;EAVb;EAYA,QAAA,GAAW,QAAA;EAXX;EAaA,OAAA,GAAU,OAAA;EAZV;;;;EAiBA,MAAA;EAfA;;;;EAoBA,MAAA;AAAA;AAAA,iBAGc,WAAA,CAAY,OAAA,EAAS,kBAAA,GAAqB,eAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { asFormHandle } from "../utils/internal-form.mjs";
|
|
2
|
-
import { applyFormCustomization } from "../utils/build-section-handlers.mjs";
|
|
3
2
|
import { useFormCore } from "./use-form-core.mjs";
|
|
4
3
|
import { useMemo, useState } from "react";
|
|
5
4
|
import { getPipeDefaultPayload, getPipePayloadFormConfig, getPipePayloadSchema } from "@pipe0/base";
|
|
@@ -9,6 +8,7 @@ function usePipeForm(options) {
|
|
|
9
8
|
const { pipeId, publicKey, defaultValues, resolvers, validationContext, store: defaultFormStore, sectionMap, groupMap, pathMap, scopes, teamId } = options;
|
|
10
9
|
const schema = useMemo(() => getPipePayloadSchema(pipeId), [pipeId]);
|
|
11
10
|
const [store, setStore] = useState(defaultFormStore ?? { field_options: {} });
|
|
11
|
+
const hasGetConnections = resolvers?.getConnections != null;
|
|
12
12
|
const core = useFormCore({
|
|
13
13
|
pipeOrSearchId: pipeId,
|
|
14
14
|
kind: "pipe",
|
|
@@ -24,34 +24,33 @@ function usePipeForm(options) {
|
|
|
24
24
|
pipePayload: defaultPayload,
|
|
25
25
|
store,
|
|
26
26
|
validationContext,
|
|
27
|
-
formResolvers: resolvers
|
|
27
|
+
formResolvers: resolvers,
|
|
28
|
+
customization: {
|
|
29
|
+
sectionMap,
|
|
30
|
+
groupMap: hasGetConnections ? groupMap : {
|
|
31
|
+
...groupMap,
|
|
32
|
+
connector: null
|
|
33
|
+
},
|
|
34
|
+
pathMap
|
|
35
|
+
}
|
|
28
36
|
});
|
|
29
37
|
}, [
|
|
30
38
|
pipeId,
|
|
31
|
-
defaultValues,
|
|
32
39
|
validationContext,
|
|
33
|
-
store
|
|
40
|
+
store,
|
|
41
|
+
JSON.stringify({
|
|
42
|
+
sectionMap,
|
|
43
|
+
groupMap,
|
|
44
|
+
pathMap,
|
|
45
|
+
hasGetConnections
|
|
46
|
+
})
|
|
34
47
|
]),
|
|
35
48
|
resolvers,
|
|
36
49
|
environment: validationContext?.environment,
|
|
37
50
|
scopes,
|
|
38
51
|
teamId
|
|
39
52
|
});
|
|
40
|
-
const
|
|
41
|
-
const customization = useMemo(() => ({
|
|
42
|
-
sectionMap: hasGetConnections ? sectionMap ?? {} : {
|
|
43
|
-
...sectionMap ?? {},
|
|
44
|
-
connector: null
|
|
45
|
-
},
|
|
46
|
-
groupMap: groupMap ?? {},
|
|
47
|
-
pathMap: pathMap ?? {}
|
|
48
|
-
}), [
|
|
49
|
-
sectionMap,
|
|
50
|
-
groupMap,
|
|
51
|
-
pathMap,
|
|
52
|
-
hasGetConnections
|
|
53
|
-
]);
|
|
54
|
-
const sections = useMemo(() => applyFormCustomization(core.sections, customization), [core.sections, customization]);
|
|
53
|
+
const sections = core.sections;
|
|
55
54
|
const fields = useMemo(() => sections.flatMap((s) => s.groups.flatMap((g) => g.fields)), [sections]);
|
|
56
55
|
const fieldPaths = useMemo(() => new Set(sections.flatMap((s) => s.groups.flatMap((g) => g.fields.map((f) => f.path)))), [sections]);
|
|
57
56
|
return useMemo(() => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-pipe-form.mjs","names":[],"sources":["../../src/hooks/use-pipe-form.ts"],"sourcesContent":["import {\n type FormResolvers,\n type FormStore,\n getPipeDefaultPayload,\n getPipePayloadFormConfig,\n getPipePayloadSchema,\n type PipeId,\n type PipePayload,\n type ValidationContext,\n} from \"@pipe0/base\";\nimport { useMemo, useState } from \"react\";\nimport type { PipeFormContext } from \"../context/pipe-form-context.js\";\nimport type {
|
|
1
|
+
{"version":3,"file":"use-pipe-form.mjs","names":[],"sources":["../../src/hooks/use-pipe-form.ts"],"sourcesContent":["import {\n type FormResolvers,\n type FormStore,\n getPipeDefaultPayload,\n getPipePayloadFormConfig,\n getPipePayloadSchema,\n type PipeId,\n type PipePayload,\n type ValidationContext,\n} from \"@pipe0/base\";\nimport { useMemo, useState } from \"react\";\nimport type { PipeFormContext } from \"../context/pipe-form-context.js\";\nimport type { GroupMap, PathMap, SectionMap } from \"../types/form-customization.js\";\nimport { asFormHandle } from \"../utils/internal-form.js\";\nimport { type ResourceStatus, useFormCore } from \"./use-form-core.js\";\n\nexport type { PipeFormContext, ResourceStatus };\n\nexport interface UsePipeFormOptions {\n pipeId: PipeId;\n publicKey: string;\n defaultValues?: PipePayload;\n resolvers?: FormResolvers;\n userConnections?: { public_id: string; provider: string }[];\n validationContext?: ValidationContext;\n store?: FormStore;\n /**\n * Hide / relabel / reorder sections by section key. `null` hides a section.\n * Note: when `resolvers.getConnections` is omitted, the `connector` section\n * is hidden automatically — there's no value to render without a resolver.\n */\n sectionMap?: SectionMap;\n /** Hide / relabel / reorder groups by group path. `null` hides a group. */\n groupMap?: GroupMap;\n /** Hide / relabel fields by field path. `null` hides a field. */\n pathMap?: PathMap;\n /**\n * Form-level scope tags. Bundled into every `resolvers.getSecrets` call so\n * the backend can return only the secrets allowed in the declared scopes.\n */\n scopes?: string[];\n /**\n * Current team context. Bundled into every `resolvers.getSecrets` call so\n * the backend can restrict team-level secrets to this team only.\n */\n teamId?: string;\n}\n\nexport function usePipeForm(options: UsePipeFormOptions): PipeFormContext {\n const {\n pipeId,\n publicKey,\n defaultValues,\n resolvers,\n validationContext,\n store: defaultFormStore,\n sectionMap,\n groupMap,\n pathMap,\n scopes,\n teamId,\n } = options;\n\n const schema = useMemo(() => getPipePayloadSchema(pipeId), [pipeId]);\n\n const [store, setStore] = useState<FormStore>(defaultFormStore ?? { field_options: {} });\n\n // Customization is applied while the form config is built (in `@pipe0/base`'s\n // `extractFormMetadata`), so `core.sections` is already filtered/relabeled.\n // Connector auto-hides without a `getConnections` resolver — it's a *group*\n // (groupPath \"connector\"), so hide it via `groupMap`.\n const hasGetConnections = resolvers?.getConnections != null;\n // Stable content key: callers pass fresh inline customization objects every\n // render, so key on contents to avoid re-walking the schema needlessly.\n const customizationKey = JSON.stringify({ sectionMap, groupMap, pathMap, hasGetConnections });\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: customization inputs + resolver flag are tracked by value via `customizationKey` to keep the config stable across inline-object renders.\n const formConfig = useMemo(() => {\n const defaultPayload = getPipeDefaultPayload(pipeId);\n if (!defaultPayload) throw new Error(\"No default payload\");\n\n return getPipePayloadFormConfig({\n pipePayload: defaultPayload,\n store,\n validationContext,\n formResolvers: resolvers,\n customization: {\n sectionMap,\n groupMap: hasGetConnections ? groupMap : { ...groupMap, connector: null },\n pathMap,\n },\n });\n }, [pipeId, validationContext, store, customizationKey]);\n\n const core = useFormCore<PipePayload>({\n pipeOrSearchId: pipeId,\n kind: \"pipe\",\n schema,\n publicKey,\n defaultValues,\n store,\n setStore,\n formConfig,\n resolvers,\n environment: validationContext?.environment,\n scopes,\n teamId,\n });\n\n // `core.sections` is already customized (hidden/relabeled) by the metadata\n // extractor, so the hook exposes it directly.\n const sections = core.sections;\n\n const fields = useMemo(\n () => sections.flatMap((s) => s.groups.flatMap((g) => g.fields)),\n [sections],\n );\n\n const fieldPaths = useMemo(\n () => new Set(sections.flatMap((s) => s.groups.flatMap((g) => g.fields.map((f) => f.path)))),\n [sections],\n );\n\n return useMemo<PipeFormContext>(\n () => ({\n id: pipeId,\n publicKey,\n form: asFormHandle(core.form),\n sections,\n fields,\n fieldPaths,\n connectionsStatus: core.connectionsStatus,\n fieldLoadStates: core.fieldLoadStates,\n fieldLoaderErrors: core.fieldLoaderErrors,\n loadingFieldLoaders: core.loadingFieldLoaders,\n hasFieldLoaderError: core.hasFieldLoaderError,\n isFieldLoaderLoading: core.isFieldLoaderLoading,\n resolvers,\n store,\n reset: core.reset,\n }),\n [\n pipeId,\n publicKey,\n core.form,\n sections,\n fields,\n fieldPaths,\n core.connectionsStatus,\n core.fieldLoadStates,\n core.fieldLoaderErrors,\n core.loadingFieldLoaders,\n core.hasFieldLoaderError,\n core.isFieldLoaderLoading,\n resolvers,\n store,\n core.reset,\n ],\n );\n}\n"],"mappings":";;;;;;AAgDA,SAAgB,YAAY,SAA8C;CACxE,MAAM,EACJ,QACA,WACA,eACA,WACA,mBACA,OAAO,kBACP,YACA,UACA,SACA,QACA,WACE;CAEJ,MAAM,SAAS,cAAc,qBAAqB,OAAO,EAAE,CAAC,OAAO,CAAC;CAEpE,MAAM,CAAC,OAAO,YAAY,SAAoB,oBAAoB,EAAE,eAAe,EAAE,EAAE,CAAC;CAMxF,MAAM,oBAAoB,WAAW,kBAAkB;CAuBvD,MAAM,OAAO,YAAyB;EACpC,gBAAgB;EAChB,MAAM;EACN;EACA;EACA;EACA;EACA;EACA,YAzBiB,cAAc;GAC/B,MAAM,iBAAiB,sBAAsB,OAAO;AACpD,OAAI,CAAC,eAAgB,OAAM,IAAI,MAAM,qBAAqB;AAE1D,UAAO,yBAAyB;IAC9B,aAAa;IACb;IACA;IACA,eAAe;IACf,eAAe;KACb;KACA,UAAU,oBAAoB,WAAW;MAAE,GAAG;MAAU,WAAW;MAAM;KACzE;KACD;IACF,CAAC;KACD;GAAC;GAAQ;GAAmB;GAlBN,KAAK,UAAU;IAAE;IAAY;IAAU;IAAS;IAAmB,CAAC;GAkBtC,CAAC;EAWtD;EACA,aAAa,mBAAmB;EAChC;EACA;EACD,CAAC;CAIF,MAAM,WAAW,KAAK;CAEtB,MAAM,SAAS,cACP,SAAS,SAAS,MAAM,EAAE,OAAO,SAAS,MAAM,EAAE,OAAO,CAAC,EAChE,CAAC,SAAS,CACX;CAED,MAAM,aAAa,cACX,IAAI,IAAI,SAAS,SAAS,MAAM,EAAE,OAAO,SAAS,MAAM,EAAE,OAAO,KAAK,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAC5F,CAAC,SAAS,CACX;AAED,QAAO,eACE;EACL,IAAI;EACJ;EACA,MAAM,aAAa,KAAK,KAAK;EAC7B;EACA;EACA;EACA,mBAAmB,KAAK;EACxB,iBAAiB,KAAK;EACtB,mBAAmB,KAAK;EACxB,qBAAqB,KAAK;EAC1B,qBAAqB,KAAK;EAC1B,sBAAsB,KAAK;EAC3B;EACA;EACA,OAAO,KAAK;EACb,GACD;EACE;EACA;EACA,KAAK;EACL;EACA;EACA;EACA,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL;EACA;EACA,KAAK;EACN,CACF"}
|
|
@@ -27,12 +27,12 @@ declare function useSearchCatalogTable(config?: {
|
|
|
27
27
|
removeColumnFilter: (id: "inputFields" | "outputFields" | "tags" | "providers") => void;
|
|
28
28
|
resetFilters: () => void;
|
|
29
29
|
getColumnFilterValue: (id: "inputFields" | "outputFields" | "tags" | "providers") => string;
|
|
30
|
-
sortedOutputFieldEntries: [string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "query:postgres@1" | "query:databricks@1")[]][];
|
|
31
|
-
sortedTagEntries: [string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "query:postgres@1" | "query:databricks@1")[]][];
|
|
32
|
-
sortedProviderEntries: [string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "query:postgres@1" | "query:databricks@1")[]][];
|
|
33
|
-
searchIdsByOutputField: Record<string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "query:postgres@1" | "query:databricks@1")[]>;
|
|
34
|
-
searchIdsByProvider: Record<string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "query:postgres@1" | "query:databricks@1")[]>;
|
|
35
|
-
searchIdsByTag: Record<string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "query:postgres@1" | "query:databricks@1")[]>;
|
|
30
|
+
sortedOutputFieldEntries: [string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:crustdata@3" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "query:postgres@1" | "query:databricks@1" | "posts:content:crustdata@1")[]][];
|
|
31
|
+
sortedTagEntries: [string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:crustdata@3" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "query:postgres@1" | "query:databricks@1" | "posts:content:crustdata@1")[]][];
|
|
32
|
+
sortedProviderEntries: [string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:crustdata@3" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "query:postgres@1" | "query:databricks@1" | "posts:content:crustdata@1")[]][];
|
|
33
|
+
searchIdsByOutputField: Record<string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:crustdata@3" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "query:postgres@1" | "query:databricks@1" | "posts:content:crustdata@1")[]>;
|
|
34
|
+
searchIdsByProvider: Record<string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:crustdata@3" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "query:postgres@1" | "query:databricks@1" | "posts:content:crustdata@1")[]>;
|
|
35
|
+
searchIdsByTag: Record<string, ("companies:profiles:crustdata@1" | "companies:profiles:crustdata@2" | "companies:profiles:amplemarket@1" | "companies:profiles:amplemarket@2" | "people:profiles:crustdata@1" | "people:profiles:crustdata@2" | "people:profiles:crustdata@3" | "people:profiles:amplemarket@1" | "people:profiles:amplemarket@2" | "companies:entitysearch:parallel@1" | "people:entitysearch:parallel@1" | "people:eventguests:luma@1" | "sheet:rows@1" | "query:postgres@1" | "query:databricks@1" | "posts:content:crustdata@1")[]>;
|
|
36
36
|
};
|
|
37
37
|
type UseSearchCatalogTableReturn = ReturnType<typeof useSearchCatalogTable>;
|
|
38
38
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-search-form.d.mts","names":[],"sources":["../../src/hooks/use-search-form.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"use-search-form.d.mts","names":[],"sources":["../../src/hooks/use-search-form.ts"],"mappings":";;;;;;UAiBiB,oBAAA;EACf,QAAA,EAAU,QAAA;EACV,SAAA;EACA,aAAA,GAAgB,aAAA;EAChB,SAAA,GAAY,aAAA;EACZ,WAAA,GAAc,gBAAA;EACd,KAAA,GAAQ,SAAA;EADM;;;;;EAOd,UAAA,GAAa,UAAA;EAII;EAFjB,QAAA,GAAW,QAAA;EAbD;EAeV,OAAA,GAAU,OAAA;AAAA;AAAA,iBAGI,aAAA,CAAc,OAAA,EAAS,oBAAA,GAAuB,iBAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { asFormHandle } from "../utils/internal-form.mjs";
|
|
2
|
-
import { applyFormCustomization } from "../utils/build-section-handlers.mjs";
|
|
3
2
|
import { useFormCore } from "./use-form-core.mjs";
|
|
4
3
|
import { useMemo, useState } from "react";
|
|
5
4
|
import { getSearchPayloadFormConfig, getSearchPayloadSchema } from "@pipe0/base";
|
|
@@ -9,6 +8,7 @@ function useSearchForm(options) {
|
|
|
9
8
|
const { searchId, publicKey, defaultValues, resolvers, environment, store: defaultStore, sectionMap, groupMap, pathMap } = options;
|
|
10
9
|
const schema = useMemo(() => getSearchPayloadSchema(searchId), [searchId]);
|
|
11
10
|
const [store, setStore] = useState(defaultStore ?? { field_options: {} });
|
|
11
|
+
const hasGetConnections = resolvers?.getConnections != null;
|
|
12
12
|
const core = useFormCore({
|
|
13
13
|
pipeOrSearchId: searchId,
|
|
14
14
|
kind: "search",
|
|
@@ -20,31 +20,31 @@ function useSearchForm(options) {
|
|
|
20
20
|
formConfig: useMemo(() => {
|
|
21
21
|
return getSearchPayloadFormConfig({
|
|
22
22
|
searchPayload: defaultValues ?? { search_id: searchId },
|
|
23
|
-
formContext: store
|
|
23
|
+
formContext: store,
|
|
24
|
+
customization: {
|
|
25
|
+
sectionMap,
|
|
26
|
+
groupMap: hasGetConnections ? groupMap : {
|
|
27
|
+
...groupMap,
|
|
28
|
+
connector: null
|
|
29
|
+
},
|
|
30
|
+
pathMap
|
|
31
|
+
}
|
|
24
32
|
});
|
|
25
33
|
}, [
|
|
26
34
|
searchId,
|
|
27
35
|
defaultValues,
|
|
28
|
-
store
|
|
36
|
+
store,
|
|
37
|
+
JSON.stringify({
|
|
38
|
+
sectionMap,
|
|
39
|
+
groupMap,
|
|
40
|
+
pathMap,
|
|
41
|
+
hasGetConnections
|
|
42
|
+
})
|
|
29
43
|
]),
|
|
30
44
|
resolvers,
|
|
31
45
|
environment
|
|
32
46
|
});
|
|
33
|
-
const
|
|
34
|
-
const customization = useMemo(() => ({
|
|
35
|
-
sectionMap: hasGetConnections ? sectionMap ?? {} : {
|
|
36
|
-
...sectionMap ?? {},
|
|
37
|
-
connector: null
|
|
38
|
-
},
|
|
39
|
-
groupMap: groupMap ?? {},
|
|
40
|
-
pathMap: pathMap ?? {}
|
|
41
|
-
}), [
|
|
42
|
-
sectionMap,
|
|
43
|
-
groupMap,
|
|
44
|
-
pathMap,
|
|
45
|
-
hasGetConnections
|
|
46
|
-
]);
|
|
47
|
-
const sections = useMemo(() => applyFormCustomization(core.sections, customization), [core.sections, customization]);
|
|
47
|
+
const sections = core.sections;
|
|
48
48
|
const fields = useMemo(() => sections.flatMap((s) => s.groups.flatMap((g) => g.fields)), [sections]);
|
|
49
49
|
const fieldPaths = useMemo(() => new Set(sections.flatMap((s) => s.groups.flatMap((g) => g.fields.map((f) => f.path)))), [sections]);
|
|
50
50
|
return useMemo(() => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-search-form.mjs","names":[],"sources":["../../src/hooks/use-search-form.ts"],"sourcesContent":["import {\n type FormResolvers,\n type FormStore,\n getSearchPayloadFormConfig,\n getSearchPayloadSchema,\n type PipesEnvironment,\n type SearchId,\n type SearchPayload,\n} from \"@pipe0/base\";\nimport { useMemo, useState } from \"react\";\nimport type { SearchFormContext } from \"../context/search-form-context.js\";\nimport type {
|
|
1
|
+
{"version":3,"file":"use-search-form.mjs","names":[],"sources":["../../src/hooks/use-search-form.ts"],"sourcesContent":["import {\n type FormResolvers,\n type FormStore,\n getSearchPayloadFormConfig,\n getSearchPayloadSchema,\n type PipesEnvironment,\n type SearchId,\n type SearchPayload,\n} from \"@pipe0/base\";\nimport { useMemo, useState } from \"react\";\nimport type { SearchFormContext } from \"../context/search-form-context.js\";\nimport type { GroupMap, PathMap, SectionMap } from \"../types/form-customization.js\";\nimport { asFormHandle } from \"../utils/internal-form.js\";\nimport { type ResourceStatus, useFormCore } from \"./use-form-core.js\";\n\nexport type { ResourceStatus, SearchFormContext };\n\nexport interface UseSearchFormOptions {\n searchId: SearchId;\n publicKey: string;\n defaultValues?: SearchPayload;\n resolvers?: FormResolvers;\n environment?: PipesEnvironment;\n store?: FormStore;\n /**\n * Hide / relabel / reorder sections by section key. `null` hides a section.\n * Note: when `resolvers.getConnections` is omitted, the `connector` section\n * is hidden automatically — there's no value to render without a resolver.\n */\n sectionMap?: SectionMap;\n /** Hide / relabel / reorder groups by group path. `null` hides a group. */\n groupMap?: GroupMap;\n /** Hide / relabel fields by field path. `null` hides a field. */\n pathMap?: PathMap;\n}\n\nexport function useSearchForm(options: UseSearchFormOptions): SearchFormContext {\n const {\n searchId,\n publicKey,\n defaultValues,\n resolvers,\n environment,\n store: defaultStore,\n sectionMap,\n groupMap,\n pathMap,\n } = options;\n\n const schema = useMemo(() => getSearchPayloadSchema(searchId), [searchId]);\n\n const [store, setStore] = useState<FormStore>(defaultStore ?? { field_options: {} });\n\n // Connector auto-hides without a `getConnections` resolver — it's a *group*\n // (groupPath \"connector\"), so hide it via `groupMap`. Customization is applied\n // while the form config is built, so `core.sections` is already filtered.\n const hasGetConnections = resolvers?.getConnections != null;\n const customizationKey = JSON.stringify({ sectionMap, groupMap, pathMap, hasGetConnections });\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: customization inputs + resolver flag are tracked by value via `customizationKey` to keep the config stable across inline-object renders.\n const formConfig = useMemo(() => {\n return getSearchPayloadFormConfig({\n searchPayload: defaultValues ?? ({ search_id: searchId } as SearchPayload),\n formContext: store,\n customization: {\n sectionMap,\n groupMap: hasGetConnections ? groupMap : { ...groupMap, connector: null },\n pathMap,\n },\n });\n }, [searchId, defaultValues, store, customizationKey]);\n\n const core = useFormCore<SearchPayload>({\n pipeOrSearchId: searchId,\n kind: \"search\",\n schema,\n publicKey,\n defaultValues,\n store,\n setStore,\n formConfig,\n resolvers,\n environment,\n });\n\n const sections = core.sections;\n\n const fields = useMemo(\n () => sections.flatMap((s) => s.groups.flatMap((g) => g.fields)),\n [sections],\n );\n\n const fieldPaths = useMemo(\n () => new Set(sections.flatMap((s) => s.groups.flatMap((g) => g.fields.map((f) => f.path)))),\n [sections],\n );\n\n return useMemo<SearchFormContext>(\n () => ({\n id: searchId,\n publicKey,\n form: asFormHandle(core.form),\n sections,\n fields,\n fieldPaths,\n connectionsStatus: core.connectionsStatus,\n fieldLoadStates: core.fieldLoadStates,\n fieldLoaderErrors: core.fieldLoaderErrors,\n loadingFieldLoaders: core.loadingFieldLoaders,\n hasFieldLoaderError: core.hasFieldLoaderError,\n isFieldLoaderLoading: core.isFieldLoaderLoading,\n resolvers,\n store,\n reset: core.reset,\n }),\n [\n searchId,\n publicKey,\n core.form,\n sections,\n fields,\n fieldPaths,\n core.connectionsStatus,\n core.fieldLoadStates,\n core.fieldLoaderErrors,\n core.loadingFieldLoaders,\n core.hasFieldLoaderError,\n core.isFieldLoaderLoading,\n resolvers,\n store,\n core.reset,\n ],\n );\n}\n"],"mappings":";;;;;;AAoCA,SAAgB,cAAc,SAAkD;CAC9E,MAAM,EACJ,UACA,WACA,eACA,WACA,aACA,OAAO,cACP,YACA,UACA,YACE;CAEJ,MAAM,SAAS,cAAc,uBAAuB,SAAS,EAAE,CAAC,SAAS,CAAC;CAE1E,MAAM,CAAC,OAAO,YAAY,SAAoB,gBAAgB,EAAE,eAAe,EAAE,EAAE,CAAC;CAKpF,MAAM,oBAAoB,WAAW,kBAAkB;CAgBvD,MAAM,OAAO,YAA2B;EACtC,gBAAgB;EAChB,MAAM;EACN;EACA;EACA;EACA;EACA;EACA,YApBiB,cAAc;AAC/B,UAAO,2BAA2B;IAChC,eAAe,iBAAkB,EAAE,WAAW,UAAU;IACxD,aAAa;IACb,eAAe;KACb;KACA,UAAU,oBAAoB,WAAW;MAAE,GAAG;MAAU,WAAW;MAAM;KACzE;KACD;IACF,CAAC;KACD;GAAC;GAAU;GAAe;GAbJ,KAAK,UAAU;IAAE;IAAY;IAAU;IAAS;IAAmB,CAAC;GAaxC,CAAC;EAWpD;EACA;EACD,CAAC;CAEF,MAAM,WAAW,KAAK;CAEtB,MAAM,SAAS,cACP,SAAS,SAAS,MAAM,EAAE,OAAO,SAAS,MAAM,EAAE,OAAO,CAAC,EAChE,CAAC,SAAS,CACX;CAED,MAAM,aAAa,cACX,IAAI,IAAI,SAAS,SAAS,MAAM,EAAE,OAAO,SAAS,MAAM,EAAE,OAAO,KAAK,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAC5F,CAAC,SAAS,CACX;AAED,QAAO,eACE;EACL,IAAI;EACJ;EACA,MAAM,aAAa,KAAK,KAAK;EAC7B;EACA;EACA;EACA,mBAAmB,KAAK;EACxB,iBAAiB,KAAK;EACtB,mBAAmB,KAAK;EACxB,qBAAqB,KAAK;EAC1B,qBAAqB,KAAK;EAC1B,sBAAsB,KAAK;EAC3B;EACA;EACA,OAAO,KAAK;EACb,GACD;EACE;EACA;EACA,KAAK;EACL;EACA;EACA;EACA,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL;EACA;EACA,KAAK;EACN,CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-sheet-effect-form.d.mts","names":[],"sources":["../../src/hooks/use-sheet-effect-form.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"use-sheet-effect-form.d.mts","names":[],"sources":["../../src/hooks/use-sheet-effect-form.ts"],"mappings":";;;;;UAgBiB,yBAAA;EACf,QAAA,EAAU,aAAA;EACV,SAAA;EACA,aAAA,GAAgB,kBAAA;EAChB,SAAA,GAAY,aAAA;EACZ,iBAAA,GAAoB,iBAAA;EACpB,KAAA,GAAQ,SAAA;EAFI;EAIZ,UAAA,GAAa,UAAA;EAFL;EAIR,QAAA,GAAW,QAAA;EAAA;EAEX,OAAA,GAAU,OAAA;EACV,MAAA;EACA,MAAA;AAAA;;;;;;;;;;;iBAac,kBAAA,CAAmB,OAAA,EAAS,yBAAA,GAA4B,eAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { asFormHandle } from "../utils/internal-form.mjs";
|
|
2
|
-
import { applyFormCustomization } from "../utils/build-section-handlers.mjs";
|
|
3
2
|
import { useFormCore } from "./use-form-core.mjs";
|
|
4
3
|
import { useMemo, useState } from "react";
|
|
5
4
|
import { getSheetEffectDefaultPayload, getSheetEffectPayloadFormConfig, getSheetEffectPayloadSchema } from "@pipe0/base";
|
|
@@ -19,6 +18,7 @@ function useSheetEffectForm(options) {
|
|
|
19
18
|
const { effectId, publicKey, defaultValues, resolvers, validationContext, store: defaultFormStore, sectionMap, groupMap, pathMap, scopes, teamId } = options;
|
|
20
19
|
const schema = useMemo(() => getSheetEffectPayloadSchema(effectId), [effectId]);
|
|
21
20
|
const [store, setStore] = useState(defaultFormStore ?? { field_options: {} });
|
|
21
|
+
const hasGetConnections = resolvers?.getConnections != null;
|
|
22
22
|
const core = useFormCore({
|
|
23
23
|
pipeOrSearchId: effectId,
|
|
24
24
|
kind: "effect",
|
|
@@ -34,34 +34,33 @@ function useSheetEffectForm(options) {
|
|
|
34
34
|
effectPayload: defaultPayload,
|
|
35
35
|
store,
|
|
36
36
|
validationContext,
|
|
37
|
-
formResolvers: resolvers
|
|
37
|
+
formResolvers: resolvers,
|
|
38
|
+
customization: {
|
|
39
|
+
sectionMap,
|
|
40
|
+
groupMap: hasGetConnections ? groupMap : {
|
|
41
|
+
...groupMap,
|
|
42
|
+
connector: null
|
|
43
|
+
},
|
|
44
|
+
pathMap
|
|
45
|
+
}
|
|
38
46
|
});
|
|
39
47
|
}, [
|
|
40
48
|
effectId,
|
|
41
|
-
defaultValues,
|
|
42
49
|
validationContext,
|
|
43
|
-
store
|
|
50
|
+
store,
|
|
51
|
+
JSON.stringify({
|
|
52
|
+
sectionMap,
|
|
53
|
+
groupMap,
|
|
54
|
+
pathMap,
|
|
55
|
+
hasGetConnections
|
|
56
|
+
})
|
|
44
57
|
]),
|
|
45
58
|
resolvers,
|
|
46
59
|
environment: validationContext?.environment,
|
|
47
60
|
scopes,
|
|
48
61
|
teamId
|
|
49
62
|
});
|
|
50
|
-
const
|
|
51
|
-
const customization = useMemo(() => ({
|
|
52
|
-
sectionMap: hasGetConnections ? sectionMap ?? {} : {
|
|
53
|
-
...sectionMap ?? {},
|
|
54
|
-
connector: null
|
|
55
|
-
},
|
|
56
|
-
groupMap: groupMap ?? {},
|
|
57
|
-
pathMap: pathMap ?? {}
|
|
58
|
-
}), [
|
|
59
|
-
sectionMap,
|
|
60
|
-
groupMap,
|
|
61
|
-
pathMap,
|
|
62
|
-
hasGetConnections
|
|
63
|
-
]);
|
|
64
|
-
const sections = useMemo(() => applyFormCustomization(core.sections, customization), [core.sections, customization]);
|
|
63
|
+
const sections = core.sections;
|
|
65
64
|
const fields = useMemo(() => sections.flatMap((s) => s.groups.flatMap((g) => g.fields)), [sections]);
|
|
66
65
|
const fieldPaths = useMemo(() => new Set(sections.flatMap((s) => s.groups.flatMap((g) => g.fields.map((f) => f.path)))), [sections]);
|
|
67
66
|
return useMemo(() => ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-sheet-effect-form.mjs","names":[],"sources":["../../src/hooks/use-sheet-effect-form.ts"],"sourcesContent":["import {\n type FormResolvers,\n type FormStore,\n getSheetEffectDefaultPayload,\n getSheetEffectPayloadFormConfig,\n getSheetEffectPayloadSchema,\n type SheetEffectId,\n type SheetEffectPayload,\n type ValidationContext,\n} from \"@pipe0/base\";\nimport { useMemo, useState } from \"react\";\nimport type { PipeFormContext } from \"../context/pipe-form-context.js\";\nimport type {
|
|
1
|
+
{"version":3,"file":"use-sheet-effect-form.mjs","names":[],"sources":["../../src/hooks/use-sheet-effect-form.ts"],"sourcesContent":["import {\n type FormResolvers,\n type FormStore,\n getSheetEffectDefaultPayload,\n getSheetEffectPayloadFormConfig,\n getSheetEffectPayloadSchema,\n type SheetEffectId,\n type SheetEffectPayload,\n type ValidationContext,\n} from \"@pipe0/base\";\nimport { useMemo, useState } from \"react\";\nimport type { PipeFormContext } from \"../context/pipe-form-context.js\";\nimport type { GroupMap, PathMap, SectionMap } from \"../types/form-customization.js\";\nimport { asFormHandle } from \"../utils/internal-form.js\";\nimport { useFormCore } from \"./use-form-core.js\";\n\nexport interface UseSheetEffectFormOptions {\n effectId: SheetEffectId;\n publicKey: string;\n defaultValues?: SheetEffectPayload;\n resolvers?: FormResolvers;\n validationContext?: ValidationContext;\n store?: FormStore;\n /** Hide / relabel / reorder sections by section key. `null` hides a section. */\n sectionMap?: SectionMap;\n /** Hide / relabel / reorder groups by group path. `null` hides a group. */\n groupMap?: GroupMap;\n /** Hide / relabel fields by field path. `null` hides a field. */\n pathMap?: PathMap;\n scopes?: string[];\n teamId?: string;\n}\n\n/**\n * Effect analog of `usePipeForm` — drives a form for a sheet-effect payload\n * (e.g. `sheet:rows:dedupe@1`) from `getSheetEffectPayloadFormConfig`.\n *\n * Returns a `PipeFormContext`-shaped object so the existing `<PipeForm>`\n * compound components render it unchanged (the context interface is\n * structural; only the `id`/payload generics differ). A dedicated\n * `SheetEffectForm` compound family can be split out once effect forms need\n * to diverge visually.\n */\nexport function useSheetEffectForm(options: UseSheetEffectFormOptions): PipeFormContext {\n const {\n effectId,\n publicKey,\n defaultValues,\n resolvers,\n validationContext,\n store: defaultFormStore,\n sectionMap,\n groupMap,\n pathMap,\n scopes,\n teamId,\n } = options;\n\n const schema = useMemo(() => getSheetEffectPayloadSchema(effectId), [effectId]);\n\n const [store, setStore] = useState<FormStore>(defaultFormStore ?? { field_options: {} });\n\n // Connector auto-hides without a `getConnections` resolver — it's a *group*\n // (groupPath \"connector\"), so hide it via `groupMap`. Mirrors `usePipeForm`.\n const hasGetConnections = resolvers?.getConnections != null;\n const customizationKey = JSON.stringify({ sectionMap, groupMap, pathMap, hasGetConnections });\n\n // biome-ignore lint/correctness/useExhaustiveDependencies: customization inputs + resolver flag are tracked by value via `customizationKey` to keep the config stable across inline-object renders.\n const formConfig = useMemo(() => {\n const defaultPayload = getSheetEffectDefaultPayload(effectId);\n if (!defaultPayload) throw new Error(\"No default payload\");\n\n return getSheetEffectPayloadFormConfig({\n effectPayload: defaultPayload as SheetEffectPayload,\n store,\n validationContext,\n formResolvers: resolvers,\n customization: {\n sectionMap,\n groupMap: hasGetConnections ? groupMap : { ...groupMap, connector: null },\n pathMap,\n },\n });\n }, [effectId, validationContext, store, customizationKey]);\n\n const core = useFormCore<SheetEffectPayload>({\n pipeOrSearchId: effectId,\n kind: \"effect\",\n schema,\n publicKey,\n defaultValues,\n store,\n setStore,\n formConfig,\n resolvers,\n environment: validationContext?.environment,\n scopes,\n teamId,\n });\n\n const sections = core.sections;\n\n const fields = useMemo(\n () => sections.flatMap((s) => s.groups.flatMap((g) => g.fields)),\n [sections],\n );\n\n const fieldPaths = useMemo(\n () => new Set(sections.flatMap((s) => s.groups.flatMap((g) => g.fields.map((f) => f.path)))),\n [sections],\n );\n\n return useMemo<PipeFormContext>(\n () => ({\n // Structural reuse of PipeFormContext — see the function docblock.\n id: effectId as unknown as PipeFormContext[\"id\"],\n publicKey,\n form: asFormHandle(core.form) as unknown as PipeFormContext[\"form\"],\n sections,\n fields,\n fieldPaths,\n connectionsStatus: core.connectionsStatus,\n fieldLoadStates: core.fieldLoadStates,\n fieldLoaderErrors: core.fieldLoaderErrors,\n loadingFieldLoaders: core.loadingFieldLoaders,\n hasFieldLoaderError: core.hasFieldLoaderError,\n isFieldLoaderLoading: core.isFieldLoaderLoading,\n resolvers,\n store,\n reset: core.reset as unknown as PipeFormContext[\"reset\"],\n }),\n [\n effectId,\n publicKey,\n core.form,\n sections,\n fields,\n fieldPaths,\n core.connectionsStatus,\n core.fieldLoadStates,\n core.fieldLoaderErrors,\n core.loadingFieldLoaders,\n core.hasFieldLoaderError,\n core.isFieldLoaderLoading,\n resolvers,\n store,\n core.reset,\n ],\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;AA2CA,SAAgB,mBAAmB,SAAqD;CACtF,MAAM,EACJ,UACA,WACA,eACA,WACA,mBACA,OAAO,kBACP,YACA,UACA,SACA,QACA,WACE;CAEJ,MAAM,SAAS,cAAc,4BAA4B,SAAS,EAAE,CAAC,SAAS,CAAC;CAE/E,MAAM,CAAC,OAAO,YAAY,SAAoB,oBAAoB,EAAE,eAAe,EAAE,EAAE,CAAC;CAIxF,MAAM,oBAAoB,WAAW,kBAAkB;CAqBvD,MAAM,OAAO,YAAgC;EAC3C,gBAAgB;EAChB,MAAM;EACN;EACA;EACA;EACA;EACA;EACA,YAzBiB,cAAc;GAC/B,MAAM,iBAAiB,6BAA6B,SAAS;AAC7D,OAAI,CAAC,eAAgB,OAAM,IAAI,MAAM,qBAAqB;AAE1D,UAAO,gCAAgC;IACrC,eAAe;IACf;IACA;IACA,eAAe;IACf,eAAe;KACb;KACA,UAAU,oBAAoB,WAAW;MAAE,GAAG;MAAU,WAAW;MAAM;KACzE;KACD;IACF,CAAC;KACD;GAAC;GAAU;GAAmB;GAlBR,KAAK,UAAU;IAAE;IAAY;IAAU;IAAS;IAAmB,CAAC;GAkBpC,CAAC;EAWxD;EACA,aAAa,mBAAmB;EAChC;EACA;EACD,CAAC;CAEF,MAAM,WAAW,KAAK;CAEtB,MAAM,SAAS,cACP,SAAS,SAAS,MAAM,EAAE,OAAO,SAAS,MAAM,EAAE,OAAO,CAAC,EAChE,CAAC,SAAS,CACX;CAED,MAAM,aAAa,cACX,IAAI,IAAI,SAAS,SAAS,MAAM,EAAE,OAAO,SAAS,MAAM,EAAE,OAAO,KAAK,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,EAC5F,CAAC,SAAS,CACX;AAED,QAAO,eACE;EAEL,IAAI;EACJ;EACA,MAAM,aAAa,KAAK,KAAK;EAC7B;EACA;EACA;EACA,mBAAmB,KAAK;EACxB,iBAAiB,KAAK;EACtB,mBAAmB,KAAK;EACxB,qBAAqB,KAAK;EAC1B,qBAAqB,KAAK;EAC1B,sBAAsB,KAAK;EAC3B;EACA;EACA,OAAO,KAAK;EACb,GACD;EACE;EACA;EACA,KAAK;EACL;EACA;EACA;EACA,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL,KAAK;EACL;EACA;EACA,KAAK;EACN,CACF"}
|