@flexkit/studio 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/dist/chat-page-YWENJEUP.js +4 -0
- package/dist/chat-page-YWENJEUP.js.map +1 -0
- package/dist/chunk-2FQWBOU6.js +6 -0
- package/dist/chunk-2FQWBOU6.js.map +1 -0
- package/dist/chunk-3FIKCGSP.js +4 -0
- package/dist/{chunk-DQ6Z333C.js.map → chunk-3FIKCGSP.js.map} +1 -1
- package/dist/{chunk-LX7Q56OS.js → chunk-4BX7OJJ6.js} +2 -2
- package/dist/{chunk-LX7Q56OS.js.map → chunk-4BX7OJJ6.js.map} +1 -1
- package/dist/{chunk-DPCMOWK4.js → chunk-66N44IKJ.js} +3 -3
- package/dist/chunk-66N44IKJ.js.map +1 -0
- package/dist/{chunk-LMVJWCOM.js → chunk-7ZDMZVDA.js} +5 -5
- package/dist/{chunk-LMVJWCOM.js.map → chunk-7ZDMZVDA.js.map} +1 -1
- package/dist/{chunk-G4PYYHI3.js → chunk-GW37ZTR2.js} +2 -2
- package/dist/{chunk-G4PYYHI3.js.map → chunk-GW37ZTR2.js.map} +1 -1
- package/dist/chunk-H6TOYVW2.js +3 -0
- package/dist/chunk-H6TOYVW2.js.map +1 -0
- package/dist/{chunk-WBZKCRQK.js → chunk-LYGHDJ5A.js} +2 -2
- package/dist/{chunk-WBZKCRQK.js.map → chunk-LYGHDJ5A.js.map} +1 -1
- package/dist/chunk-OFLU53AC.js +2 -0
- package/dist/{chunk-BKJ2DBRK.js.map → chunk-OFLU53AC.js.map} +1 -1
- package/dist/chunk-YIGEER6B.js +7 -0
- package/dist/chunk-YIGEER6B.js.map +1 -0
- package/dist/chunk-Z6IEBNKV.js +2 -0
- package/dist/{chunk-QJWY4XIM.js.map → chunk-Z6IEBNKV.js.map} +1 -1
- package/dist/index.css +378 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/dist/list-3K2PBGML.js +2 -0
- package/dist/{list-GALFFS5F.js.map → list-3K2PBGML.js.map} +1 -1
- package/dist/pages-BDZ4ZXBS.js +3 -0
- package/dist/{pages-IA7GOMMS.js.map → pages-BDZ4ZXBS.js.map} +1 -1
- package/dist/plugin-pages-Q77CBW45.js +2 -0
- package/dist/{plugin-pages-Q63UBSKH.js.map → plugin-pages-Q77CBW45.js.map} +1 -1
- package/dist/root-4TME2KMP.js +2 -0
- package/dist/{root-VSTE2THV.js.map → root-4TME2KMP.js.map} +1 -1
- package/dist/root-4ZVGVCYY.js +23 -0
- package/dist/{root-5TCUJI6Q.js.map → root-4ZVGVCYY.js.map} +1 -1
- package/dist/{root-SMHRBFGW.js → root-EZWV5VA4.js} +3 -3
- package/dist/{root-SMHRBFGW.js.map → root-EZWV5VA4.js.map} +1 -1
- package/dist/{root-VYZYDWIB.js → root-YKNISFWH.js} +2 -2
- package/dist/{root-VYZYDWIB.js.map → root-YKNISFWH.js.map} +1 -1
- package/dist/{search-K75Q65A6.js → search-7NX232AW.js} +2 -2
- package/dist/{search-K75Q65A6.js.map → search-7NX232AW.js.map} +1 -1
- package/dist/{skills-pages-KDG2NOQJ.js → skills-pages-SMJ4EWZW.js} +2 -2
- package/dist/{skills-pages-KDG2NOQJ.js.map → skills-pages-SMJ4EWZW.js.map} +1 -1
- package/dist/spec-renderer-5YGDRF52.js +2 -0
- package/dist/spec-renderer-5YGDRF52.js.map +1 -0
- package/dist/ui.d.ts +28 -4
- package/dist/ui.js +1 -1
- package/package.json +4 -4
- package/dist/chat-page-ZFPMTRLD.js +0 -2
- package/dist/chat-page-ZFPMTRLD.js.map +0 -1
- package/dist/chunk-6LYEDKFY.js +0 -7
- package/dist/chunk-6LYEDKFY.js.map +0 -1
- package/dist/chunk-BKJ2DBRK.js +0 -2
- package/dist/chunk-DPCMOWK4.js.map +0 -1
- package/dist/chunk-DQ6Z333C.js +0 -4
- package/dist/chunk-HROHAMPM.js +0 -3
- package/dist/chunk-HROHAMPM.js.map +0 -1
- package/dist/chunk-MKEIZ5ZQ.js +0 -5
- package/dist/chunk-MKEIZ5ZQ.js.map +0 -1
- package/dist/chunk-QJWY4XIM.js +0 -2
- package/dist/list-GALFFS5F.js +0 -2
- package/dist/pages-IA7GOMMS.js +0 -3
- package/dist/plugin-pages-Q63UBSKH.js +0 -2
- package/dist/root-5TCUJI6Q.js +0 -23
- package/dist/root-VSTE2THV.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/data-grid/data-table-row-actions.tsx","../src/data-grid/data-table-view-options.tsx","../src/data-grid/data-table-toolbar.tsx"],"names":["DataTableRowActions","entityName","entityNamePlural","row","options","actionDispatch","useDispatch","canMutate","useCanMutate","entityId","canDelete","canEdit","handleEdit","handleDelete","jsxs","Button","jsx","PencilIcon","Trash2Icon","DropdownMenu","DropdownMenuTrigger","Ellipsis","DropdownMenuContent","DropdownMenuItem","DropdownMenuSeparator","DataTableViewOptions","table","Settings2","DropdownMenuLabel","column","DropdownMenuCheckboxItem","value","DataTableToolbar","isReloading","onReload","appDispatch","useAppDispatch","appContext","useAppContext","apolloClient","useApolloClient","currentProject","currentProjectId","useConfig","schema","scopes","runMutation","setMutation","setOptions","useEntityMutation","isDeleting","setIsDeleting","useState","selectedIds","handleCreate","handleScopeChange","deleteSelected","ids","mutation","getEntityDeleteMutation","resolve","reject","gql","getEntityDeleteWhere","cache","id","error","handleBatchDelete","itemLabel","idsToDelete","scheduleEntityListRemoval","getEntityListQueryName","toast","Select","SelectTrigger","SelectValue","find","propEq","SelectContent","scopeItem","SelectItem","RefreshCw","DataTableSortedBy","PermissionTooltip","Loader2","Trash2"],"mappings":"isBA0BO,SAASA,EAAAA,CAA2B,CACzC,UAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,GAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CAAU,CAAE,SAAA,CAAW,IAAA,CAAM,OAAA,CAAS,IAAK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CQ,EACClB,GAAAA,CAACD,CAAAA,CAAA,CACC,YAAA,CAAW,QAAA,CACX,UAAU,QAAA,CACV,QAAA,CAAUmC,KAAcjB,GAAAA,CACxB,OAAA,CAASC,EACT,IAAA,CAAK,SAAA,CACL,QAAQ,SAAA,CAER,QAAA,CAAAlB,GAAAA,CAACiE,SAAAA,CAAA,CAAU,SAAA,CAAWhD,GAAAA,CAAc,kBAAoB,MAAA,CAAW,CAAA,CACrE,EACE,IAAA,CACJjB,GAAAA,CAACkE,CAAAA,CAAA,CAAkB,MAAOxD,CAAAA,CAAO,CAAA,CAAA,CACnC,EACC2B,CAAAA,CAAY,MAAA,CAAS,EACpBrC,GAAAA,CAACmE,EAAAA,CAAA,CAAkB,QAAA,CAAU,CAAC5E,CAAAA,CAC5B,QAAA,CAAAO,KAACC,CAAAA,CAAA,CACC,UAAU,2BAAA,CACV,QAAA,CAAUmC,KAAc,CAAC3C,CAAAA,CACzB,QAAS4D,EAAAA,CACT,IAAA,CAAK,KACL,OAAA,CAAQ,aAAA,CAEP,UAAAjB,GAAAA,CACClC,GAAAA,CAACoE,OAAAA,CAAA,CAAQ,UAAU,uCAAA,CAAwC,CAAA,CAE3DpE,IAACqE,MAAAA,CAAA,CAAO,UAAU,uBAAA,CAAwB,CAAA,CAC1C,UAAA,CACOhC,CAAAA,CAAY,OAAO,GAAA,CAAA,CAC9B,CAAA,CACF,EACE,IAAA,CACJrC,GAAAA,CAACmE,GAAA,CAAkB,QAAA,CAAU,CAAC5E,CAAAA,CAC5B,SAAAS,GAAAA,CAACD,CAAAA,CAAA,CACC,SAAA,CAAU,8BAAA,CACV,SAAUmC,GAAAA,EAAc,CAAC3C,EACzB,OAAA,CAAS+C,EAAAA,CACT,KAAK,IAAA,CACL,OAAA,CAAQ,UACT,QAAA,CAAA,QAAA,CAED,CAAA,CACF,GACF,CAEJ","file":"chunk-DQ6Z333C.js","sourcesContent":["'use client';\n\nimport type { JSX } from 'react';\nimport { Ellipsis, PencilIcon, Trash2Icon } from 'lucide-react';\nimport type { Row } from '@tanstack/react-table';\nimport { Button } from '../ui/primitives/button';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '../ui/primitives/dropdown-menu';\nimport { useDispatch } from '../entities/actions-context';\nimport { useCanMutate } from '../core/permissions';\n\ninterface DataTableRowActionsProps<TData> {\n entityName: string;\n entityNamePlural: string;\n row: Row<TData>;\n options?: {\n canDelete?: boolean;\n canEdit?: boolean;\n };\n}\n\nexport function DataTableRowActions<TData>({\n entityName,\n entityNamePlural,\n row,\n options = { canDelete: true, canEdit: true },\n}: DataTableRowActionsProps<TData>): JSX.Element {\n const actionDispatch = useDispatch();\n const canMutate = useCanMutate();\n // @ts-expect-error -- the DataGrid's original type doesn't know about the _id property\n const entityId = row.original._id;\n // Read-only roles keep the pencil (the drawer doubles as their read view)\n // but lose the delete affordance entirely.\n const canDelete = (options.canDelete ?? true) && canMutate;\n const canEdit = options.canEdit ?? true;\n\n function handleEdit(): void {\n actionDispatch({ type: 'EditEntity', payload: { entityId, entityNamePlural } });\n }\n\n function handleDelete(): void {\n actionDispatch({ type: 'DeleteEntity', payload: { entityId, entityName } });\n }\n\n return (\n <div className=\"fk:flex\">\n {canEdit && (\n <Button className=\"fk:flex fk:h-7 fk:w-7 fk:p-0 fk:mr-1\" onClick={handleEdit} variant=\"ghost\">\n <PencilIcon className=\"fk:h-4 fk:w-4\" />\n <span className=\"fk:sr-only\">Edit</span>\n </Button>\n )}\n {canDelete && !canEdit && (\n <Button className=\"fk:flex fk:h-7 fk:w-7 fk:p-0 fk:mr-1\" onClick={handleDelete} variant=\"ghost\">\n <Trash2Icon className=\"fk:h-4 fk:w-4\" />\n <span className=\"fk:sr-only\">Delete</span>\n </Button>\n )}\n {canEdit && canDelete && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button className=\"fk:flex fk:h-7 fk:w-7 fk:p-0\" variant=\"ghost\">\n <Ellipsis className=\"fk:h-4 fk:w-4\" />\n <span className=\"fk:sr-only\">Additional actions</span>\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-[160px]\">\n <DropdownMenuItem onClick={handleEdit}>\n <PencilIcon className=\"fk:mr-2 fk:h-4 fk:w-4\" />\n Edit\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem className=\"fk:text-destructive\" onClick={handleDelete}>\n <Trash2Icon className=\"fk:mr-2 fk:h-4 fk:w-4\" />\n Delete\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n );\n}\n","'use client';\n\nimport type { JSX } from 'react';\nimport { Settings2 } from 'lucide-react';\nimport type { Table } from '@tanstack/react-table';\nimport { Button } from '../ui/primitives/button';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '../ui/primitives/dropdown-menu';\n\ninterface DataTableViewOptionsProps<TData> {\n table: Table<TData>;\n}\n\nexport function DataTableViewOptions<TData>({ table }: DataTableViewOptionsProps<TData>): JSX.Element {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button className=\"fk:hidden fk:h-8 fk:lg:flex\" size=\"sm\" variant=\"outline\">\n <Settings2 className=\"fk:mr-2 fk:h-4 fk:w-4\" />\n View\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"fk:w-[150px]\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter((column) => typeof column.accessorFn !== 'undefined' && column.getCanHide())\n .map((column) => {\n return (\n <DropdownMenuCheckboxItem\n checked={column.getIsVisible()}\n className=\"capitalize\"\n key={column.id}\n onCheckedChange={(value) => {\n column.toggleVisibility(Boolean(value));\n }}\n >\n {column.id}\n </DropdownMenuCheckboxItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n","'use client';\n\nimport { useState } from 'react';\nimport type { JSX } from 'react';\nimport { find, propEq } from 'ramda';\nimport type { Table } from '@tanstack/react-table';\nimport { Loader2, RefreshCw, Trash2 } from 'lucide-react';\nimport { gql } from '@apollo/client';\nimport { useApolloClient } from '@apollo/client/react';\nimport { toast } from 'sonner';\nimport { Button } from '../ui/primitives/button';\nimport { PermissionTooltip } from '../ui/components/permission-tooltip';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/primitives/select';\nimport { useDispatch } from '../entities/actions-context';\nimport { useAppContext, useAppDispatch } from '../core/app-context';\nimport { useCanMutate } from '../core/permissions';\nimport { useConfig } from '../core/config/config-context';\nimport { DataTableViewOptions } from './data-table-view-options';\nimport { DataTableSortedBy } from './data-table-sorted-by';\nimport { useEntityMutation } from '../graphql-client/use-entity-mutation';\nimport { getEntityDeleteMutation, getEntityDeleteWhere } from '../graphql-client/queries';\nimport { getEntityListQueryName, scheduleEntityListRemoval } from '../graphql-client/refetch-entity-lists';\n\ninterface DataTableToolbarProps<TData> {\n entityName: string;\n isReloading?: boolean;\n onReload?: () => void;\n table: Table<TData>;\n}\n\nexport function DataTableToolbar<TData>({\n entityName,\n isReloading = false,\n onReload,\n table,\n}: DataTableToolbarProps<TData>): JSX.Element {\n const actionDispatch = useDispatch();\n const appDispatch = useAppDispatch();\n const appContext = useAppContext();\n const apolloClient = useApolloClient();\n const { currentProject, currentProjectId } = useConfig();\n const schema = currentProject?.schema ?? [];\n const scopes = currentProject?.scopes;\n const [runMutation, setMutation, setOptions] = useEntityMutation();\n const [isDeleting, setIsDeleting] = useState(false);\n const canMutate = useCanMutate();\n\n // Collect selected entity ids from the table\n // @ts-expect-error -- the DataGrid's original type doesn't know about the _id property\n const selectedIds: string[] = table.getSelectedRowModel().rows.map((row) => row.original._id as string);\n\n function handleCreate(): void {\n actionDispatch({ type: 'AddEntity', payload: { entityName } });\n }\n\n function handleScopeChange(value: string): void {\n appDispatch({ type: 'setScope', payload: { projectId: currentProjectId, scope: value } });\n }\n\n async function deleteSelected(ids: string[]): Promise<void> {\n if (ids.length === 0) {\n return;\n }\n\n const mutation = getEntityDeleteMutation(entityName, schema, ids);\n\n await new Promise<void>((resolve, reject) => {\n setMutation(gql`\n ${mutation}\n `);\n\n setOptions({\n variables: { where: getEntityDeleteWhere(ids) },\n update(cache: { evict: (arg0: { id: string }) => void }) {\n for (const id of ids) {\n cache.evict({ id });\n }\n },\n onCompleted: () => {\n resolve();\n },\n onError: (error: Error) => {\n reject(error);\n },\n });\n\n runMutation(true);\n });\n }\n\n function handleBatchDelete(): void {\n const itemLabel = entityName === '_asset' ? 'asset' : entityName.toLowerCase();\n\n actionDispatch({\n type: 'AlertDialog',\n payload: {\n options: {\n dialogTitle: `Delete ${selectedIds.length} ${itemLabel}${selectedIds.length > 1 ? 's' : ''}`,\n dialogMessage:\n selectedIds.length > 1\n ? `Are you sure you want to delete the selected ${itemLabel}s? They will be deleted permanently.`\n : `Are you sure you want to delete the selected ${itemLabel}? The item will be deleted permanently.`,\n dialogCancelTitle: 'Cancel',\n dialogActionLabel: 'Delete',\n isDestructive: true,\n dialogActionSubmit: async () => {\n setIsDeleting(true);\n\n try {\n const idsToDelete = [...selectedIds];\n\n await deleteSelected(idsToDelete);\n\n table.resetRowSelection();\n // Drop rows immediately, then soft-refetch counts/pages.\n await scheduleEntityListRemoval(\n apolloClient,\n getEntityListQueryName(entityName, schema),\n idsToDelete\n );\n toast.success(idsToDelete.length > 1 ? 'Items successfully deleted.' : 'Item successfully deleted.');\n } catch {\n toast.error('Failed to delete selected items.');\n } finally {\n setIsDeleting(false);\n }\n },\n dialogActionCancel: () => {\n // no-op\n },\n },\n },\n });\n }\n\n return (\n <div className=\"fk:flex fk:items-center fk:justify-between\">\n <div className=\"fk:flex fk:flex-1 fk:items-center fk:space-x-2\">\n {scopes && scopes.length > 0 ? (\n <Select\n defaultValue={appContext.scope}\n onValueChange={(value) => {\n handleScopeChange(value);\n }}\n value={appContext.scope}\n >\n <SelectTrigger className=\"fk:w-48!\" id=\"project\" size=\"sm\">\n <span className=\"fk:text-muted-foreground\">Scope:</span>\n <SelectValue>\n {\n ((find(propEq(appContext.scope ?? '', 'name'))(scopes) as { name: string; label: string }) || null)\n ?.label\n }\n </SelectValue>\n </SelectTrigger>\n <SelectContent>\n {scopes.map((scopeItem) => (\n <SelectItem key={scopeItem.name} value={scopeItem.name}>\n {scopeItem.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n ) : null}\n <DataTableViewOptions table={table} />\n {onReload ? (\n <Button\n aria-label=\"Reload\"\n className=\"fk:h-8\"\n disabled={isDeleting || isReloading}\n onClick={onReload}\n size=\"icon-sm\"\n variant=\"outline\"\n >\n <RefreshCw className={isReloading ? 'fk:animate-spin' : undefined} />\n </Button>\n ) : null}\n <DataTableSortedBy table={table} />\n </div>\n {selectedIds.length > 0 ? (\n <PermissionTooltip disabled={!canMutate}>\n <Button\n className=\"fk:h-8 fk:mr-2 fk:lg:flex\"\n disabled={isDeleting || !canMutate}\n onClick={handleBatchDelete}\n size=\"sm\"\n variant=\"destructive\"\n >\n {isDeleting ? (\n <Loader2 className=\"fk:mr-2 fk:h-4 fk:w-4 fk:animate-spin\" />\n ) : (\n <Trash2 className=\"fk:mr-2 fk:h-4 fk:w-4\" />\n )}\n Delete ({selectedIds.length})\n </Button>\n </PermissionTooltip>\n ) : null}\n <PermissionTooltip disabled={!canMutate}>\n <Button\n className=\"fk:ml-auto fk:h-8 fk:lg:flex\"\n disabled={isDeleting || !canMutate}\n onClick={handleCreate}\n size=\"sm\"\n variant=\"default\"\n >\n Create\n </Button>\n </PermissionTooltip>\n </div>\n );\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/data-grid/data-table-row-actions.tsx","../src/data-grid/data-table-view-options.tsx","../src/data-grid/data-table-toolbar.tsx"],"names":["DataTableRowActions","entityName","entityNamePlural","row","options","actionDispatch","useDispatch","canMutate","useCanMutate","entityId","canDelete","canEdit","handleEdit","handleDelete","jsxs","Button","jsx","PencilIcon","Trash2Icon","DropdownMenu","DropdownMenuTrigger","Ellipsis","DropdownMenuContent","DropdownMenuItem","DropdownMenuSeparator","DataTableViewOptions","table","Settings2","DropdownMenuLabel","column","DropdownMenuCheckboxItem","value","DataTableToolbar","isReloading","onReload","appDispatch","useAppDispatch","appContext","useAppContext","apolloClient","useApolloClient","currentProject","currentProjectId","useConfig","schema","scopes","runMutation","setMutation","setOptions","useEntityMutation","isDeleting","setIsDeleting","useState","selectedIds","handleCreate","handleScopeChange","deleteSelected","ids","mutation","getEntityDeleteMutation","resolve","reject","gql","getEntityDeleteWhere","cache","id","error","handleBatchDelete","itemLabel","idsToDelete","scheduleEntityListRemoval","getEntityListQueryName","toast","Select","SelectTrigger","SelectValue","find","propEq","SelectContent","scopeItem","SelectItem","RefreshCw","DataTableSortedBy","PermissionTooltip","Loader2","Trash2"],"mappings":"0rBA0BO,SAASA,EAAAA,CAA2B,CACzC,UAAA,CAAAC,CAAAA,CACA,gBAAA,CAAAC,CAAAA,CACA,GAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CAAU,CAAE,SAAA,CAAW,IAAA,CAAM,OAAA,CAAS,IAAK,CAC7C,CAAA,CAAiD,CAC/C,IAAMC,CAAAA,CAAiBC,CAAAA,EAAY,CAC7BC,CAAAA,CAAYC,CAAAA,EAAa,CAEzBC,CAAAA,CAAWN,CAAAA,CAAI,QAAA,CAAS,GAAA,CAGxBO,CAAAA,CAAAA,CAAaN,CAAAA,CAAQ,SAAA,EAAa,IAAA,GAASG,CAAAA,CAC3CI,CAAAA,CAAUP,CAAAA,CAAQ,OAAA,EAAW,IAAA,CAEnC,SAASQ,GAAAA,EAAmB,CAC1BP,CAAAA,CAAe,CAAE,IAAA,CAAM,YAAA,CAAc,OAAA,CAAS,CAAE,QAAA,CAAAI,CAAAA,CAAU,gBAAA,CAAAP,CAAiB,CAAE,CAAC,EAChF,CAEA,SAASW,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,CAAC5E,CAAAA,CAC5B,QAAA,CAAAO,KAACC,CAAAA,CAAA,CACC,UAAU,2BAAA,CACV,QAAA,CAAUmC,KAAc,CAAC3C,CAAAA,CACzB,QAAS4D,EAAAA,CACT,IAAA,CAAK,KACL,OAAA,CAAQ,aAAA,CAEP,UAAAjB,GAAAA,CACClC,GAAAA,CAACoE,OAAAA,CAAA,CAAQ,UAAU,uCAAA,CAAwC,CAAA,CAE3DpE,IAACqE,MAAAA,CAAA,CAAO,UAAU,uBAAA,CAAwB,CAAA,CAC1C,UAAA,CACOhC,CAAAA,CAAY,OAAO,GAAA,CAAA,CAC9B,CAAA,CACF,EACE,IAAA,CACJrC,GAAAA,CAACmE,GAAA,CAAkB,QAAA,CAAU,CAAC5E,CAAAA,CAC5B,SAAAS,GAAAA,CAACD,CAAAA,CAAA,CACC,SAAA,CAAU,8BAAA,CACV,SAAUmC,GAAAA,EAAc,CAAC3C,EACzB,OAAA,CAAS+C,EAAAA,CACT,KAAK,IAAA,CACL,OAAA,CAAQ,UACT,QAAA,CAAA,QAAA,CAED,CAAA,CACF,GACF,CAEJ","file":"chunk-3FIKCGSP.js","sourcesContent":["'use client';\n\nimport type { JSX } from 'react';\nimport { Ellipsis, PencilIcon, Trash2Icon } from 'lucide-react';\nimport type { Row } from '@tanstack/react-table';\nimport { Button } from '../ui/primitives/button';\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '../ui/primitives/dropdown-menu';\nimport { useDispatch } from '../entities/actions-context';\nimport { useCanMutate } from '../core/permissions';\n\ninterface DataTableRowActionsProps<TData> {\n entityName: string;\n entityNamePlural: string;\n row: Row<TData>;\n options?: {\n canDelete?: boolean;\n canEdit?: boolean;\n };\n}\n\nexport function DataTableRowActions<TData>({\n entityName,\n entityNamePlural,\n row,\n options = { canDelete: true, canEdit: true },\n}: DataTableRowActionsProps<TData>): JSX.Element {\n const actionDispatch = useDispatch();\n const canMutate = useCanMutate();\n // @ts-expect-error -- the DataGrid's original type doesn't know about the _id property\n const entityId = row.original._id;\n // Read-only roles keep the pencil (the drawer doubles as their read view)\n // but lose the delete affordance entirely.\n const canDelete = (options.canDelete ?? true) && canMutate;\n const canEdit = options.canEdit ?? true;\n\n function handleEdit(): void {\n actionDispatch({ type: 'EditEntity', payload: { entityId, entityNamePlural } });\n }\n\n function handleDelete(): void {\n actionDispatch({ type: 'DeleteEntity', payload: { entityId, entityName } });\n }\n\n return (\n <div className=\"fk:flex\">\n {canEdit && (\n <Button className=\"fk:flex fk:h-7 fk:w-7 fk:p-0 fk:mr-1\" onClick={handleEdit} variant=\"ghost\">\n <PencilIcon className=\"fk:h-4 fk:w-4\" />\n <span className=\"fk:sr-only\">Edit</span>\n </Button>\n )}\n {canDelete && !canEdit && (\n <Button className=\"fk:flex fk:h-7 fk:w-7 fk:p-0 fk:mr-1\" onClick={handleDelete} variant=\"ghost\">\n <Trash2Icon className=\"fk:h-4 fk:w-4\" />\n <span className=\"fk:sr-only\">Delete</span>\n </Button>\n )}\n {canEdit && canDelete && (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button className=\"fk:flex fk:h-7 fk:w-7 fk:p-0\" variant=\"ghost\">\n <Ellipsis className=\"fk:h-4 fk:w-4\" />\n <span className=\"fk:sr-only\">Additional actions</span>\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"w-[160px]\">\n <DropdownMenuItem onClick={handleEdit}>\n <PencilIcon className=\"fk:mr-2 fk:h-4 fk:w-4\" />\n Edit\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n <DropdownMenuItem className=\"fk:text-destructive\" onClick={handleDelete}>\n <Trash2Icon className=\"fk:mr-2 fk:h-4 fk:w-4\" />\n Delete\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n )}\n </div>\n );\n}\n","'use client';\n\nimport type { JSX } from 'react';\nimport { Settings2 } from 'lucide-react';\nimport type { Table } from '@tanstack/react-table';\nimport { Button } from '../ui/primitives/button';\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '../ui/primitives/dropdown-menu';\n\ninterface DataTableViewOptionsProps<TData> {\n table: Table<TData>;\n}\n\nexport function DataTableViewOptions<TData>({ table }: DataTableViewOptionsProps<TData>): JSX.Element {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <Button className=\"fk:hidden fk:h-8 fk:lg:flex\" size=\"sm\" variant=\"outline\">\n <Settings2 className=\"fk:mr-2 fk:h-4 fk:w-4\" />\n View\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"end\" className=\"fk:w-[150px]\">\n <DropdownMenuLabel>Toggle columns</DropdownMenuLabel>\n <DropdownMenuSeparator />\n {table\n .getAllColumns()\n .filter((column) => typeof column.accessorFn !== 'undefined' && column.getCanHide())\n .map((column) => {\n return (\n <DropdownMenuCheckboxItem\n checked={column.getIsVisible()}\n className=\"capitalize\"\n key={column.id}\n onCheckedChange={(value) => {\n column.toggleVisibility(Boolean(value));\n }}\n >\n {column.id}\n </DropdownMenuCheckboxItem>\n );\n })}\n </DropdownMenuContent>\n </DropdownMenu>\n );\n}\n","'use client';\n\nimport { useState } from 'react';\nimport type { JSX } from 'react';\nimport { find, propEq } from 'ramda';\nimport type { Table } from '@tanstack/react-table';\nimport { Loader2, RefreshCw, Trash2 } from 'lucide-react';\nimport { gql } from '@apollo/client';\nimport { useApolloClient } from '@apollo/client/react';\nimport { toast } from 'sonner';\nimport { Button } from '../ui/primitives/button';\nimport { PermissionTooltip } from '../ui/components/permission-tooltip';\nimport { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/primitives/select';\nimport { useDispatch } from '../entities/actions-context';\nimport { useAppContext, useAppDispatch } from '../core/app-context';\nimport { useCanMutate } from '../core/permissions';\nimport { useConfig } from '../core/config/config-context';\nimport { DataTableViewOptions } from './data-table-view-options';\nimport { DataTableSortedBy } from './data-table-sorted-by';\nimport { useEntityMutation } from '../graphql-client/use-entity-mutation';\nimport { getEntityDeleteMutation, getEntityDeleteWhere } from '../graphql-client/queries';\nimport { getEntityListQueryName, scheduleEntityListRemoval } from '../graphql-client/refetch-entity-lists';\n\ninterface DataTableToolbarProps<TData> {\n entityName: string;\n isReloading?: boolean;\n onReload?: () => void;\n table: Table<TData>;\n}\n\nexport function DataTableToolbar<TData>({\n entityName,\n isReloading = false,\n onReload,\n table,\n}: DataTableToolbarProps<TData>): JSX.Element {\n const actionDispatch = useDispatch();\n const appDispatch = useAppDispatch();\n const appContext = useAppContext();\n const apolloClient = useApolloClient();\n const { currentProject, currentProjectId } = useConfig();\n const schema = currentProject?.schema ?? [];\n const scopes = currentProject?.scopes;\n const [runMutation, setMutation, setOptions] = useEntityMutation();\n const [isDeleting, setIsDeleting] = useState(false);\n const canMutate = useCanMutate();\n\n // Collect selected entity ids from the table\n // @ts-expect-error -- the DataGrid's original type doesn't know about the _id property\n const selectedIds: string[] = table.getSelectedRowModel().rows.map((row) => row.original._id as string);\n\n function handleCreate(): void {\n actionDispatch({ type: 'AddEntity', payload: { entityName } });\n }\n\n function handleScopeChange(value: string): void {\n appDispatch({ type: 'setScope', payload: { projectId: currentProjectId, scope: value } });\n }\n\n async function deleteSelected(ids: string[]): Promise<void> {\n if (ids.length === 0) {\n return;\n }\n\n const mutation = getEntityDeleteMutation(entityName, schema, ids);\n\n await new Promise<void>((resolve, reject) => {\n setMutation(gql`\n ${mutation}\n `);\n\n setOptions({\n variables: { where: getEntityDeleteWhere(ids) },\n update(cache: { evict: (arg0: { id: string }) => void }) {\n for (const id of ids) {\n cache.evict({ id });\n }\n },\n onCompleted: () => {\n resolve();\n },\n onError: (error: Error) => {\n reject(error);\n },\n });\n\n runMutation(true);\n });\n }\n\n function handleBatchDelete(): void {\n const itemLabel = entityName === '_asset' ? 'asset' : entityName.toLowerCase();\n\n actionDispatch({\n type: 'AlertDialog',\n payload: {\n options: {\n dialogTitle: `Delete ${selectedIds.length} ${itemLabel}${selectedIds.length > 1 ? 's' : ''}`,\n dialogMessage:\n selectedIds.length > 1\n ? `Are you sure you want to delete the selected ${itemLabel}s? They will be deleted permanently.`\n : `Are you sure you want to delete the selected ${itemLabel}? The item will be deleted permanently.`,\n dialogCancelTitle: 'Cancel',\n dialogActionLabel: 'Delete',\n isDestructive: true,\n dialogActionSubmit: async () => {\n setIsDeleting(true);\n\n try {\n const idsToDelete = [...selectedIds];\n\n await deleteSelected(idsToDelete);\n\n table.resetRowSelection();\n // Drop rows immediately, then soft-refetch counts/pages.\n await scheduleEntityListRemoval(\n apolloClient,\n getEntityListQueryName(entityName, schema),\n idsToDelete\n );\n toast.success(idsToDelete.length > 1 ? 'Items successfully deleted.' : 'Item successfully deleted.');\n } catch {\n toast.error('Failed to delete selected items.');\n } finally {\n setIsDeleting(false);\n }\n },\n dialogActionCancel: () => {\n // no-op\n },\n },\n },\n });\n }\n\n return (\n <div className=\"fk:flex fk:items-center fk:justify-between\">\n <div className=\"fk:flex fk:flex-1 fk:items-center fk:space-x-2\">\n {scopes && scopes.length > 0 ? (\n <Select\n defaultValue={appContext.scope}\n onValueChange={(value) => {\n handleScopeChange(value);\n }}\n value={appContext.scope}\n >\n <SelectTrigger className=\"fk:w-48!\" id=\"project\" size=\"sm\">\n <span className=\"fk:text-muted-foreground\">Scope:</span>\n <SelectValue>\n {\n ((find(propEq(appContext.scope ?? '', 'name'))(scopes) as { name: string; label: string }) || null)\n ?.label\n }\n </SelectValue>\n </SelectTrigger>\n <SelectContent>\n {scopes.map((scopeItem) => (\n <SelectItem key={scopeItem.name} value={scopeItem.name}>\n {scopeItem.label}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n ) : null}\n <DataTableViewOptions table={table} />\n {onReload ? (\n <Button\n aria-label=\"Reload\"\n className=\"fk:h-8\"\n disabled={isDeleting || isReloading}\n onClick={onReload}\n size=\"icon-sm\"\n variant=\"outline\"\n >\n <RefreshCw className={isReloading ? 'fk:animate-spin' : undefined} />\n </Button>\n ) : null}\n <DataTableSortedBy table={table} />\n </div>\n {selectedIds.length > 0 ? (\n <PermissionTooltip disabled={!canMutate}>\n <Button\n className=\"fk:h-8 fk:mr-2 fk:lg:flex\"\n disabled={isDeleting || !canMutate}\n onClick={handleBatchDelete}\n size=\"sm\"\n variant=\"destructive\"\n >\n {isDeleting ? (\n <Loader2 className=\"fk:mr-2 fk:h-4 fk:w-4 fk:animate-spin\" />\n ) : (\n <Trash2 className=\"fk:mr-2 fk:h-4 fk:w-4\" />\n )}\n Delete ({selectedIds.length})\n </Button>\n </PermissionTooltip>\n ) : null}\n <PermissionTooltip disabled={!canMutate}>\n <Button\n className=\"fk:ml-auto fk:h-8 fk:lg:flex\"\n disabled={isDeleting || !canMutate}\n onClick={handleCreate}\n size=\"sm\"\n variant=\"default\"\n >\n Create\n </Button>\n </PermissionTooltip>\n </div>\n );\n}\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import'./index.css';import {f,b as b$1,d as d$2}from'./chunk-HROHAMPM.js';import {g as g$1}from'./chunk-DPCMOWK4.js';import {L,M,S as S$1,O,la,ma,na,Oc,Qc,ta,s,p,q,r}from'./chunk-6LYEDKFY.js';import {e,g,h,i,j,t,d as d$1,a,b as b$2,c,o}from'./chunk-SZEGGBOC.js';import {w,b}from'./chunk-ODORXGGY.js';import {d}from'./chunk-5DHOBLAE.js';import {useState,useMemo,useRef,useEffect}from'react';import {useNavigate,useLocation,useParams,Link}from'react-router-dom';import V,{useSWRConfig}from'swr';import {Plug,ArrowLeft,ExternalLink,RefreshCw,ChevronLeft,ChevronRight,Plus,CheckIcon,XIcon,MoreHorizontal}from'lucide-react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var ye="/plugins/oauth/start",S=class extends Error{code="account_mismatch";constructor(){super('You signed in with a different account. Use "Connect another account" to add it.'),this.name="PluginAccountMismatchError";}};function fe(n){let a;try{a=new URL(n);}catch{return null}return a.protocol!=="https:"||a.username!==""||a.password!==""?null:a}function Ce(n,a){let t=b$1(),s=fe(n),i=fe(a);return !s||!i||s.origin!==t||s.pathname!==ye||i.origin!==t||i.pathname!=="/"?null:{href:s.href,origin:t}}async function U(n,a,t,s){let i=window.open("about:blank",`flexkit-plugin-${crypto.randomUUID()}`,"popup,width=560,height=720");if(!i)throw new Error("Allow popups for Studio, then connect again.");let f;try{f=await n.connectPlugins({pluginId:a,scope:t,studioOrigin:window.location.origin,...s?.connectionId?{connectionId:s.connectionId}:{}});}catch(p){throw i.close(),p}let d=Ce(f.authorizeUrl,f.completionOrigin);if(!d)throw i.close(),new Error("Connection could not be started.");let c=d.origin;await new Promise((p,x)=>{let l=false,w=false,u=m=>{if(!w){if(w=true,window.clearInterval(r),window.clearTimeout(k),window.removeEventListener("message",N),i.close(),m){x(m);return}p();}},g=async()=>{if(l||w)return;l=true;let m;try{m=await n.pluginOAuthStatus(f.transactionId);}catch{l=false;return}if(l=false,m.status==="complete"){u();return}if(i.closed&&m.status==="pending"){u(new Error("Connection window was closed."));return}(m.status==="failed"||new Date(m.expires_at).getTime()<Date.now())&&u(new Error("Connection was not completed. Please try again."));},N=m=>{if(m.origin!==c||m.source!==i||!m.data||typeof m.data!="object")return;let v=m.data;if(v.type==="flexkit:plugin-oauth-ready"&&v.transactionId===f.transactionId){i.postMessage({type:"flexkit:plugin-oauth-start",transactionId:f.transactionId,ticket:f.launchTicket},c);return}if(v.type==="flexkit:plugin-oauth"&&v.transactionId===f.transactionId){if(v.status==="failed"&&v.error==="account_mismatch"){u(new S);return}g();}},r=window.setInterval(()=>{g();},2e3),k=window.setTimeout(()=>u(new Error("Connection timed out. Please try again.")),6e5);window.addEventListener("message",N),i.location.href=d.href;});}function ze(n){let a;try{a=new URL(n);}catch{return null}return a.protocol!=="https:"||a.username!==""||a.password!==""?null:a.href}function be(){let{currentProjectId:n}=g$1();return {api:useMemo(()=>n?d$2(n):null,[n]),base:n?`/api/flexkit/${n}`:null}}function Ue(n){return n.length===2?"Project & Personal":n[0]==="project"?"Project":"Personal"}function $e(n){return n.length===2?"fk:bg-indigo-100 fk:text-indigo-800 fk:dark:bg-indigo-950 fk:dark:text-indigo-300":n[0]==="project"?"fk:bg-sky-100 fk:text-sky-800 fk:dark:bg-sky-950 fk:dark:text-sky-300":"fk:bg-teal-100 fk:text-teal-800 fk:dark:bg-teal-950 fk:dark:text-teal-300"}function A(n){return n.connections.length>0}function je(n){return n==="project"?"Project":"Personal"}function $(n,a,t){return t==="personal"?n.allowPersonal:a}function Ne(n,a){return n.connections.filter(t=>t.scope===a).sort((t,s)=>Number(s.isPrimary)-Number(t.isPrimary)||t.createdAt.localeCompare(s.createdAt))}function Be(n){let a=n.connections.filter(t=>t.isPrimary&&t.status==="connected");return a.find(t=>t.scope==="personal")??a.find(t=>t.scope==="project")??null}function We({busy:n,canManage:a,plugin:t,onConnect:s}){let i$1=t.scopes.filter(c=>Ne(t,c).length===0),[f]=i$1;if(!f)return null;if(t.scopes.length===1)return jsxs(d,{disabled:n||!t.enabled||!$(t,a,f),size:"sm",type:"button",onClick:()=>s(f),children:[jsx(Plug,{}),"Connect"]});let d$1=i$1.some(c=>$(t,a,c));return jsxs(e,{children:[jsx(g,{asChild:true,children:jsxs(d,{disabled:n||!t.enabled||!d$1,size:"sm",type:"button",children:[jsx(Plug,{}),"Connect"]})}),jsx(h,{align:"end",className:"fk:w-72",children:jsx(i,{children:i$1.map(c=>jsx(j,{disabled:!$(t,a,c),onSelect:()=>s(c),children:jsxs("span",{className:"fk:flex fk:flex-col fk:gap-0.5",children:[jsx("span",{children:je(c)}),jsx("span",{className:"fk:text-xs fk:text-muted-foreground",children:c==="personal"?"Only you can use this connection in this project.":"Shared with project members who can use this plugin."})]})},c))})})]})}function T(n,a){let t=/^(.*\/ai)(?:\/|$)/.exec(n);return t?`${t[1]}/${a}`:a}function F(n){return n.split(/[\s_-]+/).filter(Boolean).map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function _e(n){let a={};for(let t of n){let s=a[t.category];if(s){s.push(t);continue}a[t.category]=[t];}return Object.entries(a).sort(([t],[s])=>F(t).localeCompare(F(s))).map(([t,s])=>({category:t,plugins:s}))}var de=[{id:"first",rows:[{descriptionWidth:"fk:w-44",id:"first-a",nameWidth:"fk:w-24"},{descriptionWidth:"fk:w-52",id:"first-b",nameWidth:"fk:w-16"},{descriptionWidth:"fk:w-40",id:"first-c",nameWidth:"fk:w-28"},{descriptionWidth:"fk:w-48",id:"first-d",nameWidth:"fk:w-20"}]},{id:"second",rows:[{descriptionWidth:"fk:w-36",id:"second-a",nameWidth:"fk:w-32"},{descriptionWidth:"fk:w-56",id:"second-b",nameWidth:"fk:w-24"}]}];function pe({action:n,row:a}){return jsxs("div",{className:"fk:-mx-3 fk:flex fk:min-w-0 fk:items-center fk:gap-3 fk:px-3 fk:py-2",children:[jsx(t,{className:"fk:size-10 fk:shrink-0 fk:rounded-lg"}),jsxs("span",{className:"fk:flex fk:min-w-0 fk:flex-1 fk:flex-col fk:gap-1.5",children:[jsx(t,{className:`fk:h-4 ${a.nameWidth}`}),jsx(t,{className:`fk:h-4 ${a.descriptionWidth}`})]}),n?jsx(t,{className:"fk:size-4 fk:shrink-0"}):null]})}var K="fk:grid fk:grid-cols-1 fk:gap-x-16 fk:gap-y-1 fk:lg:grid-cols-2";function Xe({grouped:n=true}){let a=de.flatMap(t=>t.rows);return n?jsxs("div",{"aria-busy":"true",className:"fk:flex fk:flex-col fk:gap-8",children:[jsx("span",{className:"fk:sr-only",children:"Loading plugins"}),de.map(t$1=>jsxs("section",{children:[jsx(t,{className:"fk:mb-1 fk:h-4 fk:w-28"}),jsx("div",{className:K,children:t$1.rows.map(s=>jsx(pe,{action:true,row:s},s.id))})]},t$1.id))]}):jsxs("div",{"aria-busy":"true",className:K,children:[jsx("span",{className:"fk:sr-only",children:"Loading plugins"}),a.map(t=>jsx(pe,{action:true,row:t},t.id))]})}function Je(){let n=useNavigate(),{pathname:a}=useLocation(),t=/\/ai\/plugins\/?$/.test(a),s=a.includes("/ai/skills");return jsxs("div",{className:"fk:mb-2 fk:flex fk:shrink-0 fk:items-center fk:gap-2",children:[jsxs(L,{children:[jsx(M,{asChild:true,children:jsx(S$1,{className:"fk:-ml-1 fk:h-4 fk:w-4"})}),jsx(O,{children:"Toggle Sidebar"})]}),jsx(la,{value:s?"skills":"plugins",onValueChange:f=>{let d=f==="skills"?"skills":"plugins";(f==="skills"?s:t)||n(T(a,d));},children:jsxs(ma,{children:[jsx(na,{value:"plugins",onClick:()=>{t||n(T(a,"plugins"));},children:"Plugins"}),jsx(na,{value:"skills",children:"Skills"})]})})]})}function Oe({onOpen:n,plugin:a}){let t=A(a);return jsxs("button",{type:"button",onClick:n,className:"fk:-mx-3 fk:flex fk:min-w-0 fk:items-center fk:gap-3 fk:rounded-lg fk:px-3 fk:py-2 fk:text-left fk:transition-colors fk:hover:bg-accent fk:focus-visible:bg-accent fk:focus-visible:outline-none fk:corner-squircle",children:[jsx("img",{src:a.logoUrl,alt:"",className:"fk:size-10 fk:shrink-0 fk:rounded-lg fk:corner-squircle"}),jsxs("span",{className:"fk:min-w-0 fk:flex-1",children:[jsx("span",{className:"fk:block fk:truncate fk:text-sm fk:font-medium",children:a.name}),jsx("span",{className:"fk:block fk:truncate fk:text-sm fk:text-muted-foreground",children:a.description})]}),t?jsx(CheckIcon,{className:"fk:size-4 fk:shrink-0 fk:text-success"}):jsx(Plus,{className:"fk:size-4 fk:shrink-0 fk:text-muted-foreground"})]})}function me({onOpen:n,plugins:a}){return jsx("div",{className:K,children:a.map(t=>jsx(Oe,{plugin:t,onOpen:()=>n(t.id)},t.id))})}function ve({installedOnly:n=false}){let{base:a$1}=be(),{data:t$1,error:s$1,isLoading:i}=V(a$1?`${a$1}/plugins`:null,f),[f$1,d]=useState(""),c$1=useNavigate(),{pathname:p}=useLocation(),x=f$1.trim().toLowerCase(),l=(t$1?.plugins??[]).filter(k=>(!n||A(k))&&`${k.name} ${k.description}`.toLowerCase().includes(x)),w$1=(t$1?.plugins??[]).filter(A),u=n?[]:_e(l),g="Plugins are being prepared. Check back soon.";n&&!x?g="No plugins installed yet.":(t$1?.catalogSha||n)&&(g="No plugins match your search.");function N(k){c$1(T(p,`plugins/${k}`));}let r=jsx("div",{className:"fk:flex fk:flex-col fk:gap-8",children:u.map(k=>jsxs("section",{children:[jsx("h3",{className:"fk:mb-1 fk:text-sm fk:font-medium",children:F(k.category)}),jsx(me,{plugins:k.plugins,onOpen:N})]},k.category))});return n&&(r=jsx(me,{plugins:l,onOpen:N})),(i||s$1||l.length===0)&&(r=null),jsxs("main",{className:"fk:flex fk:min-h-0 fk:flex-1 fk:flex-col",children:[jsx(Je,{}),jsx(w,{className:"fk:h-0 fk:min-h-0 fk:flex-1",children:jsxs("div",{className:"fk:mx-auto fk:flex fk:w-full fk:max-w-4xl fk:flex-col fk:gap-8 fk:py-6 fk:pl-4 fk:pr-6",children:[jsxs("div",{children:[jsx("h2",{className:"fk:text-2xl fk:font-semibold",children:"Plugins"}),jsx("p",{className:"fk:mt-2 fk:text-muted-foreground",children:"Connect the tools you use and add skills to your workflows."})]}),jsxs("div",{className:"fk:flex fk:flex-wrap fk:items-center fk:gap-3",children:[jsx(s,{"aria-label":"Search plugins",className:"fk:mr-auto fk:w-full fk:max-w-xs",placeholder:"Search plugins\u2026",value:f$1,onChange:k=>d(k.target.value)}),!n&&i?jsxs("div",{className:"fk:flex fk:items-center fk:gap-3",children:[jsx("div",{className:"fk:flex fk:-space-x-2",children:["installed-a","installed-b","installed-c"].map(k=>jsx(t,{className:"fk:size-8 fk:rounded-md fk:ring-2 fk:ring-background"},k))}),jsx(t,{className:"fk:h-4 fk:w-20"})]}):null,!n&&!i&&w$1.length>0?jsx(d$1,{children:w$1.slice(0,9).map(k=>jsxs(a,{className:"fk:rounded-md",children:[jsx(b$2,{src:k.logoUrl,alt:""}),jsx(c,{children:k.name.charAt(0)})]},k.id))}):null,n?jsxs(Link,{to:T(p,"plugins"),className:"fk:inline-flex fk:items-center fk:gap-1 fk:text-sm fk:text-muted-foreground fk:hover:text-foreground",children:[jsx(ChevronLeft,{className:"fk:size-4"}),"Show all"]}):null,!n&&!i?jsxs(Link,{to:T(p,"plugins/installed"),className:"fk:inline-flex fk:items-center fk:gap-1 fk:text-sm fk:text-muted-foreground fk:hover:text-foreground",children:[w$1.length," installed",jsx(ChevronRight,{className:"fk:size-4"})]}):null]}),s$1?jsx(Oc,{variant:"destructive",children:jsx(Qc,{children:"Unable to load plugins. Please try again."})}):null,i?jsx(Xe,{grouped:!n}):null,!i&&!s$1&&l.length===0?jsx(Oc,{children:jsx(Qc,{children:g})}):null,r]})})]})}function rn(){return jsx(ve,{})}function fn(){return jsx(ve,{installedOnly:true})}function Ge({base:n,connectionId:a}){let{data:t$1,error:s}=V(`${n}/plugin-connections/${a}/tools`,f);return s?jsx("p",{className:"fk:text-sm fk:text-muted-foreground",children:"Unable to discover tools. Reconnect or try again."}):t$1?jsx("div",{className:"fk:flex fk:flex-col fk:gap-3",children:t$1.servers.map(i=>jsxs("section",{className:"fk:flex fk:flex-col fk:gap-2",children:[jsx("h4",{className:"fk:font-medium",children:i.name}),i.error?jsx("p",{children:i.error}):null,i.tools.length>0?jsxs(p,{className:"fk:group",children:[jsxs(q,{className:"fk:flex fk:w-fit fk:items-center fk:gap-1 fk:text-sm fk:text-muted-foreground",children:[jsx(ChevronRight,{className:"fk:size-4 fk:transition-transform fk:group-data-[state=open]:rotate-90"}),He(i.tools.length)]}),jsx(r,{children:jsx("ul",{className:"fk:mt-2 fk:flex fk:flex-col fk:gap-2",children:i.tools.map(f=>jsxs("li",{children:[jsx("span",{className:"fk:text-sm fk:font-medium",children:f.name}),jsx("p",{className:"fk:text-sm fk:text-muted-foreground",children:f.description})]},f.name))})})]}):null]},i.name))}):jsx(t,{className:"fk:h-12 fk:w-full"})}function He(n){return n===1?"1 tool":`${n.toString()} tools`}function qe(n){return n.accountName&&n.accountName!==n.displayName?n.accountName:n.scope==="project"?"Shared with this project":"Only you can use this account"}function Fe({actionable:n,actions:a$1,busy:t,connection:s$1,pluginEnabled:i$1}){let[f,d$1]=useState(false),[c$1,p]=useState(""),x=useRef(null),l=s$1.status==="needs_auth",w=async()=>{let u=c$1.trim();await a$1.onRename(s$1,u||null),d$1(false);};return useEffect(()=>{if(!f)return;let u=window.setTimeout(()=>x.current?.focus(),0);return ()=>window.clearTimeout(u)},[f]),jsxs("li",{className:"fk:flex fk:min-w-0 fk:items-center fk:gap-3 fk:py-2",children:[jsx(a,{className:"fk:size-8",children:jsx(c,{children:s$1.displayName.charAt(0).toUpperCase()})}),f?jsxs("form",{className:"fk:flex fk:min-w-0 fk:flex-1 fk:items-center fk:gap-2",onSubmit:u=>{u.preventDefault(),w();},children:[jsx(s,{"aria-label":"Account name",ref:x,className:"fk:h-8 fk:max-w-xs",disabled:t,placeholder:s$1.accountName??"Account name",value:c$1,onChange:u=>p(u.target.value),onKeyDown:u=>{u.key==="Escape"&&d$1(false);}}),jsx(d,{"aria-label":"Save name",disabled:t,size:"icon",type:"submit",variant:"ghost",children:jsx(CheckIcon,{})}),jsx(d,{"aria-label":"Cancel rename",size:"icon",type:"button",variant:"ghost",onClick:()=>d$1(false),children:jsx(XIcon,{})})]}):jsxs("span",{className:"fk:flex fk:min-w-0 fk:flex-1 fk:flex-col",children:[jsxs("span",{className:"fk:flex fk:min-w-0 fk:items-center fk:gap-2",children:[jsx("span",{className:"fk:truncate fk:text-sm fk:font-medium",children:s$1.displayName}),s$1.isPrimary?jsx(b,{variant:"secondary",children:"Primary"}):null,l?jsx(b,{variant:"destructive",children:"Needs reconnect"}):null]}),jsx("span",{className:"fk:truncate fk:text-sm fk:text-muted-foreground",children:qe(s$1)})]}),n&&!f?jsxs(e,{children:[jsx(g,{asChild:true,children:jsx(d,{"aria-label":`Manage ${s$1.displayName}`,disabled:t,size:"icon",variant:"ghost",children:jsx(MoreHorizontal,{})})}),jsxs(h,{align:"end",children:[jsxs(i,{children:[!s$1.isPrimary&&!l?jsx(j,{onSelect:()=>a$1.onMakePrimary(s$1),children:"Make primary"}):null,jsx(j,{onSelect:()=>{p(s$1.label??""),d$1(true);},children:"Rename"}),jsx(j,{disabled:!i$1,onSelect:()=>a$1.onReconnect(s$1),children:"Reconnect"})]}),jsx(o,{}),jsx(j,{variant:"destructive",onSelect:()=>a$1.onDisconnect(s$1),children:"Disconnect"})]})]}):null]})}function Ke({actions:n,busy:a,canManage:t,onConnect:s,plugin:i}){let f=i.scopes.length>1;return jsxs("section",{className:"fk:flex fk:flex-col fk:gap-3",children:[jsx("h2",{className:"fk:text-xl fk:font-semibold",children:"Connected accounts"}),i.scopes.map(d=>{let c=Ne(i,d),p=$(i,t,d),x=d==="personal"||t;return c.length===0&&!p?null:jsxs("div",{className:"fk:flex fk:flex-col",children:[f?jsx("h3",{className:"fk:text-sm fk:font-medium fk:text-muted-foreground",children:d==="project"?"Project accounts":"Your accounts"}):null,jsxs("ul",{className:"fk:flex fk:flex-col fk:divide-y",children:[c.map(l=>jsx(Fe,{actionable:x,actions:n,busy:a,connection:l,pluginEnabled:i.enabled},l.id)),p?jsx("li",{children:jsxs("button",{className:"fk:flex fk:w-full fk:items-center fk:gap-3 fk:py-2 fk:text-left fk:text-sm fk:text-muted-foreground fk:transition-colors fk:hover:text-foreground fk:disabled:pointer-events-none fk:disabled:opacity-50",disabled:a||!i.enabled,type:"button",onClick:()=>s(d),children:[jsx("span",{className:"fk:flex fk:size-8 fk:shrink-0 fk:items-center fk:justify-center fk:rounded-full fk:border fk:border-dashed",children:jsx(Plus,{className:"fk:size-4"})}),c.length>0?"Connect another account":"Connect an account"]})}):null]})]},d)})]})}function cn(){let{pluginId:n}=useParams(),{api:a,base:t$1}=be(),{data:s,error:i,mutate:f$1}=V(t$1&&n?`${t$1}/plugins/${n}`:null,f),{mutate:d$1}=useSWRConfig(),c=useNavigate(),[p,x]=useState(false),l=s?.plugin,w$1=l?ze(l.sourceUrl):null,u=async r=>{x(true);try{await r(),await f$1();}catch(k){if(k instanceof S){ta.error('You signed in with a different account. Use "Connect another account" to add it.');return}ta.error(k instanceof Error?k.message:"Unable to complete this action.");}finally{x(false);}};if(i)return jsx("div",{className:"fk:p-6",children:jsx(Oc,{variant:"destructive",children:jsx(Qc,{children:"Unable to load this plugin."})})});if(!l||!s||!a||!t$1)return jsxs("main",{className:"fk:flex fk:min-h-0 fk:flex-1 fk:flex-col",children:[jsxs("div",{className:"fk:mb-2 fk:flex fk:shrink-0 fk:items-center fk:gap-2",children:[jsxs(L,{children:[jsx(M,{asChild:true,children:jsx(S$1,{className:"fk:-ml-1 fk:h-4 fk:w-4"})}),jsx(O,{children:"Toggle Sidebar"})]}),jsxs(d,{variant:"ghost",size:"sm",onClick:()=>c("..",{relative:"path"}),children:[jsx(ArrowLeft,{}),"Plugins"]})]}),jsx(w,{className:"fk:h-0 fk:min-h-0 fk:flex-1",children:jsxs("div",{"aria-busy":"true",className:"fk:mx-auto fk:flex fk:w-full fk:max-w-4xl fk:flex-col fk:gap-8 fk:py-6 fk:pl-4 fk:pr-6",children:[jsx("span",{className:"fk:sr-only",children:"Loading plugin"}),jsxs("section",{className:"fk:flex fk:flex-col fk:gap-3",children:[jsxs("div",{className:"fk:flex fk:items-center fk:gap-4",children:[jsx(t,{className:"fk:size-14 fk:shrink-0 fk:rounded-lg"}),jsx(t,{className:"fk:h-7 fk:w-40"}),jsx(t,{className:"fk:ml-auto fk:h-9 fk:w-28"})]}),jsx(t,{className:"fk:h-4 fk:w-full"}),jsx(t,{className:"fk:h-4 fk:w-2/3"}),jsx(t,{className:"fk:h-6 fk:w-24 fk:rounded-full"})]})]})})]});let g=Be(l),N={onDisconnect:r=>{u(()=>a.disconnectPlugin(r.id));},onMakePrimary:r=>{u(()=>a.updatePluginConnection(r.id,{primary:!0}));},onReconnect:r=>{u(()=>U(a,l.id,r.scope,{connectionId:r.id}));},onRename:(r,k)=>u(()=>a.updatePluginConnection(r.id,{label:k}))};return jsxs("main",{className:"fk:flex fk:min-h-0 fk:flex-1 fk:flex-col",children:[jsxs("div",{className:"fk:mb-2 fk:flex fk:shrink-0 fk:items-center fk:gap-2",children:[jsxs(L,{children:[jsx(M,{asChild:true,children:jsx(S$1,{className:"fk:-ml-1 fk:h-4 fk:w-4"})}),jsx(O,{children:"Toggle Sidebar"})]}),jsxs(d,{variant:"ghost",size:"sm",onClick:()=>c("..",{relative:"path"}),children:[jsx(ArrowLeft,{}),"Plugins"]})]}),jsx(w,{className:"fk:h-0 fk:min-h-0 fk:flex-1",children:jsxs("div",{className:"fk:mx-auto fk:flex fk:w-full fk:max-w-4xl fk:flex-col fk:gap-8 fk:py-6 fk:pl-4 fk:pr-6",children:[jsxs("section",{className:"fk:flex fk:flex-col fk:gap-3",children:[jsxs("div",{className:"fk:flex fk:flex-wrap fk:items-center fk:gap-4",children:[jsx("img",{src:l.logoUrl,alt:"",className:"fk:size-14 fk:shrink-0 fk:rounded-lg fk:corner-squircle"}),jsxs("div",{className:"fk:flex fk:min-w-0 fk:flex-col fk:gap-0.5",children:[jsx("h1",{className:"fk:text-xl fk:font-semibold",children:l.name}),w$1?jsxs("a",{href:w$1,target:"_blank",rel:"noopener noreferrer",className:"fk:inline-flex fk:w-fit fk:items-center fk:gap-1 fk:text-sm fk:hover:underline fk:text-muted-foreground",children:["View source",jsx(ExternalLink,{className:"fk:size-3"})]}):null]}),jsx("div",{className:"fk:ml-auto fk:flex fk:shrink-0 fk:flex-wrap fk:items-center fk:justify-end fk:gap-2",children:A(l)?null:jsx(We,{busy:p,canManage:s.canManage,plugin:l,onConnect:r=>{u(()=>U(a,l.id,r));}})})]}),jsx("p",{className:"fk:text-muted-foreground",children:l.description}),jsx("div",{className:"fk:flex fk:flex-wrap fk:items-center fk:gap-3",children:jsx(b,{className:`fk:border-0 fk:text-[0.625rem] fk:leading-4.5 fk:font-normal fk:py-0 fk:px-2 ${$e(l.scopes)}`,variant:"default",children:Ue(l.scopes)})}),l.scopes.map(r=>(r==="personal"?l.allowPersonal:s.canManage)?null:jsx("p",{className:"fk:text-sm fk:text-muted-foreground",children:r==="project"?"Ask an owner or developer to connect.":"Personal connections are disabled by project policy."},r))]}),l.enabled?null:jsx(Oc,{children:jsx(Qc,{children:"This plugin is disabled by project policy."})}),A(l)?jsx(Ke,{actions:N,busy:p,canManage:s.canManage,plugin:l,onConnect:r=>{u(()=>U(a,l.id,r));}}):null,jsxs("section",{className:"fk:flex fk:flex-col fk:gap-3",children:[jsxs("div",{className:"fk:flex fk:items-center fk:gap-3",children:[jsx("h2",{className:"fk:text-xl fk:font-semibold",children:"Included tools"}),l.capabilities.agentTools&&g?jsxs(d,{className:"fk:ml-auto",disabled:p,size:"sm",variant:"ghost",onClick:()=>{u(async()=>{await a.refreshPluginTools(g.id),await d$1(`${t$1}/plugin-connections/${g.id}/tools`);});},children:[jsx(RefreshCw,{}),"Refresh"]}):null]}),l.capabilities.automationDelivery?jsx("p",{className:"fk:text-sm fk:text-muted-foreground",children:"Automation delivery to selected channels. This plugin does not expose MCP messaging tools."}):null,l.capabilities.agentTools&&!g?jsx("p",{className:"fk:text-sm fk:text-muted-foreground",children:"Connect to discover available tools."}):null,l.capabilities.agentTools&&g?jsxs(Fragment,{children:[jsxs("p",{className:"fk:text-sm fk:text-muted-foreground",children:["Tools \xB7 via ",g.displayName]}),jsx(Ge,{base:t$1,connectionId:g.id},g.id)]}):null]}),jsxs("section",{className:"fk:flex fk:flex-col fk:gap-3",children:[jsx("h2",{className:"fk:text-xl fk:font-semibold",children:"Included skills"}),s.skills.length===0?jsx("p",{className:"fk:text-sm fk:text-muted-foreground",children:"This plugin includes no skills."}):s.skills.map(r=>jsxs("div",{children:[jsx("h3",{className:"fk:font-medium",children:r.name}),jsx("p",{className:"fk:text-sm fk:text-muted-foreground",children:r.description})]},r.key))]}),jsxs("section",{className:"fk:space-y-3",children:[jsx("h2",{className:"fk:text-xl fk:font-semibold",children:"Used by"}),l.usedBy.length===0?jsx("p",{className:"fk:text-sm fk:text-muted-foreground",children:"No automations visible to you use this plugin yet."}):jsx("ul",{children:l.usedBy.map(r=>jsx("li",{children:jsx(d,{className:"fk:pl-0!",variant:"link",onClick:()=>c(`../../automations/${r.id}`,{relative:"path"}),children:r.name})},r.id))})]})]})})]})}export{U as a,We as b,Je as c,rn as d,fn as e,cn as f};//# sourceMappingURL=chunk-LX7Q56OS.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import'./index.css';import {f,b as b$1,d as d$2}from'./chunk-H6TOYVW2.js';import {f as f$1}from'./chunk-66N44IKJ.js';import {L,M,S as S$1,O,la,ma,na,Wc,Yc,ta,s,p,q,r}from'./chunk-YIGEER6B.js';import {w,b}from'./chunk-ODORXGGY.js';import {e,g,h,i,j,t,d as d$1,a,b as b$2,c,o}from'./chunk-SZEGGBOC.js';import {d}from'./chunk-5DHOBLAE.js';import {useState,useMemo,useRef,useEffect}from'react';import {useNavigate,useLocation,useParams,Link}from'react-router-dom';import V,{useSWRConfig}from'swr';import {Plug,ArrowLeft,ExternalLink,RefreshCw,ChevronLeft,ChevronRight,Plus,CheckIcon,XIcon,MoreHorizontal}from'lucide-react';import {jsxs,jsx,Fragment}from'react/jsx-runtime';var ye="/plugins/oauth/start",S=class extends Error{code="account_mismatch";constructor(){super('You signed in with a different account. Use "Connect another account" to add it.'),this.name="PluginAccountMismatchError";}};function fe(n){let a;try{a=new URL(n);}catch{return null}return a.protocol!=="https:"||a.username!==""||a.password!==""?null:a}function Ce(n,a){let t=b$1(),s=fe(n),i=fe(a);return !s||!i||s.origin!==t||s.pathname!==ye||i.origin!==t||i.pathname!=="/"?null:{href:s.href,origin:t}}async function U(n,a,t,s){let i=window.open("about:blank",`flexkit-plugin-${crypto.randomUUID()}`,"popup,width=560,height=720");if(!i)throw new Error("Allow popups for Studio, then connect again.");let f;try{f=await n.connectPlugins({pluginId:a,scope:t,studioOrigin:window.location.origin,...s?.connectionId?{connectionId:s.connectionId}:{}});}catch(p){throw i.close(),p}let d=Ce(f.authorizeUrl,f.completionOrigin);if(!d)throw i.close(),new Error("Connection could not be started.");let c=d.origin;await new Promise((p,x)=>{let l=false,w=false,u=m=>{if(!w){if(w=true,window.clearInterval(r),window.clearTimeout(k),window.removeEventListener("message",N),i.close(),m){x(m);return}p();}},g=async()=>{if(l||w)return;l=true;let m;try{m=await n.pluginOAuthStatus(f.transactionId);}catch{l=false;return}if(l=false,m.status==="complete"){u();return}if(i.closed&&m.status==="pending"){u(new Error("Connection window was closed."));return}(m.status==="failed"||new Date(m.expires_at).getTime()<Date.now())&&u(new Error("Connection was not completed. Please try again."));},N=m=>{if(m.origin!==c||m.source!==i||!m.data||typeof m.data!="object")return;let v=m.data;if(v.type==="flexkit:plugin-oauth-ready"&&v.transactionId===f.transactionId){i.postMessage({type:"flexkit:plugin-oauth-start",transactionId:f.transactionId,ticket:f.launchTicket},c);return}if(v.type==="flexkit:plugin-oauth"&&v.transactionId===f.transactionId){if(v.status==="failed"&&v.error==="account_mismatch"){u(new S);return}g();}},r=window.setInterval(()=>{g();},2e3),k=window.setTimeout(()=>u(new Error("Connection timed out. Please try again.")),6e5);window.addEventListener("message",N),i.location.href=d.href;});}function ze(n){let a;try{a=new URL(n);}catch{return null}return a.protocol!=="https:"||a.username!==""||a.password!==""?null:a.href}function be(){let{currentProjectId:n}=f$1();return {api:useMemo(()=>n?d$2(n):null,[n]),base:n?`/api/flexkit/${n}`:null}}function Ue(n){return n.length===2?"Project & Personal":n[0]==="project"?"Project":"Personal"}function $e(n){return n.length===2?"fk:bg-indigo-100 fk:text-indigo-800 fk:dark:bg-indigo-950 fk:dark:text-indigo-300":n[0]==="project"?"fk:bg-sky-100 fk:text-sky-800 fk:dark:bg-sky-950 fk:dark:text-sky-300":"fk:bg-teal-100 fk:text-teal-800 fk:dark:bg-teal-950 fk:dark:text-teal-300"}function A(n){return n.connections.length>0}function je(n){return n==="project"?"Project":"Personal"}function $(n,a,t){return t==="personal"?n.allowPersonal:a}function Ne(n,a){return n.connections.filter(t=>t.scope===a).sort((t,s)=>Number(s.isPrimary)-Number(t.isPrimary)||t.createdAt.localeCompare(s.createdAt))}function Be(n){let a=n.connections.filter(t=>t.isPrimary&&t.status==="connected");return a.find(t=>t.scope==="personal")??a.find(t=>t.scope==="project")??null}function We({busy:n,canManage:a,plugin:t,onConnect:s}){let i$1=t.scopes.filter(c=>Ne(t,c).length===0),[f]=i$1;if(!f)return null;if(t.scopes.length===1)return jsxs(d,{disabled:n||!t.enabled||!$(t,a,f),size:"sm",type:"button",onClick:()=>s(f),children:[jsx(Plug,{}),"Connect"]});let d$1=i$1.some(c=>$(t,a,c));return jsxs(e,{children:[jsx(g,{asChild:true,children:jsxs(d,{disabled:n||!t.enabled||!d$1,size:"sm",type:"button",children:[jsx(Plug,{}),"Connect"]})}),jsx(h,{align:"end",className:"fk:w-72",children:jsx(i,{children:i$1.map(c=>jsx(j,{disabled:!$(t,a,c),onSelect:()=>s(c),children:jsxs("span",{className:"fk:flex fk:flex-col fk:gap-0.5",children:[jsx("span",{children:je(c)}),jsx("span",{className:"fk:text-xs fk:text-muted-foreground",children:c==="personal"?"Only you can use this connection in this project.":"Shared with project members who can use this plugin."})]})},c))})})]})}function T(n,a){let t=/^(.*\/ai)(?:\/|$)/.exec(n);return t?`${t[1]}/${a}`:a}function F(n){return n.split(/[\s_-]+/).filter(Boolean).map(a=>a.charAt(0).toUpperCase()+a.slice(1)).join(" ")}function _e(n){let a={};for(let t of n){let s=a[t.category];if(s){s.push(t);continue}a[t.category]=[t];}return Object.entries(a).sort(([t],[s])=>F(t).localeCompare(F(s))).map(([t,s])=>({category:t,plugins:s}))}var de=[{id:"first",rows:[{descriptionWidth:"fk:w-44",id:"first-a",nameWidth:"fk:w-24"},{descriptionWidth:"fk:w-52",id:"first-b",nameWidth:"fk:w-16"},{descriptionWidth:"fk:w-40",id:"first-c",nameWidth:"fk:w-28"},{descriptionWidth:"fk:w-48",id:"first-d",nameWidth:"fk:w-20"}]},{id:"second",rows:[{descriptionWidth:"fk:w-36",id:"second-a",nameWidth:"fk:w-32"},{descriptionWidth:"fk:w-56",id:"second-b",nameWidth:"fk:w-24"}]}];function pe({action:n,row:a}){return jsxs("div",{className:"fk:-mx-3 fk:flex fk:min-w-0 fk:items-center fk:gap-3 fk:px-3 fk:py-2",children:[jsx(t,{className:"fk:size-10 fk:shrink-0 fk:rounded-lg"}),jsxs("span",{className:"fk:flex fk:min-w-0 fk:flex-1 fk:flex-col fk:gap-1.5",children:[jsx(t,{className:`fk:h-4 ${a.nameWidth}`}),jsx(t,{className:`fk:h-4 ${a.descriptionWidth}`})]}),n?jsx(t,{className:"fk:size-4 fk:shrink-0"}):null]})}var K="fk:grid fk:grid-cols-1 fk:gap-x-16 fk:gap-y-1 fk:lg:grid-cols-2";function Xe({grouped:n=true}){let a=de.flatMap(t=>t.rows);return n?jsxs("div",{"aria-busy":"true",className:"fk:flex fk:flex-col fk:gap-8",children:[jsx("span",{className:"fk:sr-only",children:"Loading plugins"}),de.map(t$1=>jsxs("section",{children:[jsx(t,{className:"fk:mb-1 fk:h-4 fk:w-28"}),jsx("div",{className:K,children:t$1.rows.map(s=>jsx(pe,{action:true,row:s},s.id))})]},t$1.id))]}):jsxs("div",{"aria-busy":"true",className:K,children:[jsx("span",{className:"fk:sr-only",children:"Loading plugins"}),a.map(t=>jsx(pe,{action:true,row:t},t.id))]})}function Je(){let n=useNavigate(),{pathname:a}=useLocation(),t=/\/ai\/plugins\/?$/.test(a),s=a.includes("/ai/skills");return jsxs("div",{className:"fk:mb-2 fk:flex fk:shrink-0 fk:items-center fk:gap-2",children:[jsxs(L,{children:[jsx(M,{asChild:true,children:jsx(S$1,{className:"fk:-ml-1 fk:h-4 fk:w-4"})}),jsx(O,{children:"Toggle Sidebar"})]}),jsx(la,{value:s?"skills":"plugins",onValueChange:f=>{let d=f==="skills"?"skills":"plugins";(f==="skills"?s:t)||n(T(a,d));},children:jsxs(ma,{children:[jsx(na,{value:"plugins",onClick:()=>{t||n(T(a,"plugins"));},children:"Plugins"}),jsx(na,{value:"skills",children:"Skills"})]})})]})}function Oe({onOpen:n,plugin:a}){let t=A(a);return jsxs("button",{type:"button",onClick:n,className:"fk:-mx-3 fk:flex fk:min-w-0 fk:items-center fk:gap-3 fk:rounded-lg fk:px-3 fk:py-2 fk:text-left fk:transition-colors fk:hover:bg-accent fk:focus-visible:bg-accent fk:focus-visible:outline-none fk:corner-squircle",children:[jsx("img",{src:a.logoUrl,alt:"",className:"fk:size-10 fk:shrink-0 fk:rounded-lg fk:corner-squircle"}),jsxs("span",{className:"fk:min-w-0 fk:flex-1",children:[jsx("span",{className:"fk:block fk:truncate fk:text-sm fk:font-medium",children:a.name}),jsx("span",{className:"fk:block fk:truncate fk:text-sm fk:text-muted-foreground",children:a.description})]}),t?jsx(CheckIcon,{className:"fk:size-4 fk:shrink-0 fk:text-success"}):jsx(Plus,{className:"fk:size-4 fk:shrink-0 fk:text-muted-foreground"})]})}function me({onOpen:n,plugins:a}){return jsx("div",{className:K,children:a.map(t=>jsx(Oe,{plugin:t,onOpen:()=>n(t.id)},t.id))})}function ve({installedOnly:n=false}){let{base:a$1}=be(),{data:t$1,error:s$1,isLoading:i}=V(a$1?`${a$1}/plugins`:null,f),[f$1,d]=useState(""),c$1=useNavigate(),{pathname:p}=useLocation(),x=f$1.trim().toLowerCase(),l=(t$1?.plugins??[]).filter(k=>(!n||A(k))&&`${k.name} ${k.description}`.toLowerCase().includes(x)),w$1=(t$1?.plugins??[]).filter(A),u=n?[]:_e(l),g="Plugins are being prepared. Check back soon.";n&&!x?g="No plugins installed yet.":(t$1?.catalogSha||n)&&(g="No plugins match your search.");function N(k){c$1(T(p,`plugins/${k}`));}let r=jsx("div",{className:"fk:flex fk:flex-col fk:gap-8",children:u.map(k=>jsxs("section",{children:[jsx("h3",{className:"fk:mb-1 fk:text-sm fk:font-medium",children:F(k.category)}),jsx(me,{plugins:k.plugins,onOpen:N})]},k.category))});return n&&(r=jsx(me,{plugins:l,onOpen:N})),(i||s$1||l.length===0)&&(r=null),jsxs("main",{className:"fk:flex fk:min-h-0 fk:flex-1 fk:flex-col",children:[jsx(Je,{}),jsx(w,{className:"fk:h-0 fk:min-h-0 fk:flex-1",children:jsxs("div",{className:"fk:mx-auto fk:flex fk:w-full fk:max-w-4xl fk:flex-col fk:gap-8 fk:py-6 fk:pl-4 fk:pr-6",children:[jsxs("div",{children:[jsx("h2",{className:"fk:text-2xl fk:font-semibold",children:"Plugins"}),jsx("p",{className:"fk:mt-2 fk:text-muted-foreground",children:"Connect the tools you use and add skills to your workflows."})]}),jsxs("div",{className:"fk:flex fk:flex-wrap fk:items-center fk:gap-3",children:[jsx(s,{"aria-label":"Search plugins",className:"fk:mr-auto fk:w-full fk:max-w-xs",placeholder:"Search plugins\u2026",value:f$1,onChange:k=>d(k.target.value)}),!n&&i?jsxs("div",{className:"fk:flex fk:items-center fk:gap-3",children:[jsx("div",{className:"fk:flex fk:-space-x-2",children:["installed-a","installed-b","installed-c"].map(k=>jsx(t,{className:"fk:size-8 fk:rounded-md fk:ring-2 fk:ring-background"},k))}),jsx(t,{className:"fk:h-4 fk:w-20"})]}):null,!n&&!i&&w$1.length>0?jsx(d$1,{children:w$1.slice(0,9).map(k=>jsxs(a,{className:"fk:rounded-md",children:[jsx(b$2,{src:k.logoUrl,alt:""}),jsx(c,{children:k.name.charAt(0)})]},k.id))}):null,n?jsxs(Link,{to:T(p,"plugins"),className:"fk:inline-flex fk:items-center fk:gap-1 fk:text-sm fk:text-muted-foreground fk:hover:text-foreground",children:[jsx(ChevronLeft,{className:"fk:size-4"}),"Show all"]}):null,!n&&!i?jsxs(Link,{to:T(p,"plugins/installed"),className:"fk:inline-flex fk:items-center fk:gap-1 fk:text-sm fk:text-muted-foreground fk:hover:text-foreground",children:[w$1.length," installed",jsx(ChevronRight,{className:"fk:size-4"})]}):null]}),s$1?jsx(Wc,{variant:"destructive",children:jsx(Yc,{children:"Unable to load plugins. Please try again."})}):null,i?jsx(Xe,{grouped:!n}):null,!i&&!s$1&&l.length===0?jsx(Wc,{children:jsx(Yc,{children:g})}):null,r]})})]})}function rn(){return jsx(ve,{})}function fn(){return jsx(ve,{installedOnly:true})}function Ge({base:n,connectionId:a}){let{data:t$1,error:s}=V(`${n}/plugin-connections/${a}/tools`,f);return s?jsx("p",{className:"fk:text-sm fk:text-muted-foreground",children:"Unable to discover tools. Reconnect or try again."}):t$1?jsx("div",{className:"fk:flex fk:flex-col fk:gap-3",children:t$1.servers.map(i=>jsxs("section",{className:"fk:flex fk:flex-col fk:gap-2",children:[jsx("h4",{className:"fk:font-medium",children:i.name}),i.error?jsx("p",{children:i.error}):null,i.tools.length>0?jsxs(p,{className:"fk:group",children:[jsxs(q,{className:"fk:flex fk:w-fit fk:items-center fk:gap-1 fk:text-sm fk:text-muted-foreground",children:[jsx(ChevronRight,{className:"fk:size-4 fk:transition-transform fk:group-data-[state=open]:rotate-90"}),He(i.tools.length)]}),jsx(r,{children:jsx("ul",{className:"fk:mt-2 fk:flex fk:flex-col fk:gap-2",children:i.tools.map(f=>jsxs("li",{children:[jsx("span",{className:"fk:text-sm fk:font-medium",children:f.name}),jsx("p",{className:"fk:text-sm fk:text-muted-foreground",children:f.description})]},f.name))})})]}):null]},i.name))}):jsx(t,{className:"fk:h-12 fk:w-full"})}function He(n){return n===1?"1 tool":`${n.toString()} tools`}function qe(n){return n.accountName&&n.accountName!==n.displayName?n.accountName:n.scope==="project"?"Shared with this project":"Only you can use this account"}function Fe({actionable:n,actions:a$1,busy:t,connection:s$1,pluginEnabled:i$1}){let[f,d$1]=useState(false),[c$1,p]=useState(""),x=useRef(null),l=s$1.status==="needs_auth",w=async()=>{let u=c$1.trim();await a$1.onRename(s$1,u||null),d$1(false);};return useEffect(()=>{if(!f)return;let u=window.setTimeout(()=>x.current?.focus(),0);return ()=>window.clearTimeout(u)},[f]),jsxs("li",{className:"fk:flex fk:min-w-0 fk:items-center fk:gap-3 fk:py-2",children:[jsx(a,{className:"fk:size-8",children:jsx(c,{children:s$1.displayName.charAt(0).toUpperCase()})}),f?jsxs("form",{className:"fk:flex fk:min-w-0 fk:flex-1 fk:items-center fk:gap-2",onSubmit:u=>{u.preventDefault(),w();},children:[jsx(s,{"aria-label":"Account name",ref:x,className:"fk:h-8 fk:max-w-xs",disabled:t,placeholder:s$1.accountName??"Account name",value:c$1,onChange:u=>p(u.target.value),onKeyDown:u=>{u.key==="Escape"&&d$1(false);}}),jsx(d,{"aria-label":"Save name",disabled:t,size:"icon",type:"submit",variant:"ghost",children:jsx(CheckIcon,{})}),jsx(d,{"aria-label":"Cancel rename",size:"icon",type:"button",variant:"ghost",onClick:()=>d$1(false),children:jsx(XIcon,{})})]}):jsxs("span",{className:"fk:flex fk:min-w-0 fk:flex-1 fk:flex-col",children:[jsxs("span",{className:"fk:flex fk:min-w-0 fk:items-center fk:gap-2",children:[jsx("span",{className:"fk:truncate fk:text-sm fk:font-medium",children:s$1.displayName}),s$1.isPrimary?jsx(b,{variant:"secondary",children:"Primary"}):null,l?jsx(b,{variant:"destructive",children:"Needs reconnect"}):null]}),jsx("span",{className:"fk:truncate fk:text-sm fk:text-muted-foreground",children:qe(s$1)})]}),n&&!f?jsxs(e,{children:[jsx(g,{asChild:true,children:jsx(d,{"aria-label":`Manage ${s$1.displayName}`,disabled:t,size:"icon",variant:"ghost",children:jsx(MoreHorizontal,{})})}),jsxs(h,{align:"end",children:[jsxs(i,{children:[!s$1.isPrimary&&!l?jsx(j,{onSelect:()=>a$1.onMakePrimary(s$1),children:"Make primary"}):null,jsx(j,{onSelect:()=>{p(s$1.label??""),d$1(true);},children:"Rename"}),jsx(j,{disabled:!i$1,onSelect:()=>a$1.onReconnect(s$1),children:"Reconnect"})]}),jsx(o,{}),jsx(j,{variant:"destructive",onSelect:()=>a$1.onDisconnect(s$1),children:"Disconnect"})]})]}):null]})}function Ke({actions:n,busy:a,canManage:t,onConnect:s,plugin:i}){let f=i.scopes.length>1;return jsxs("section",{className:"fk:flex fk:flex-col fk:gap-3",children:[jsx("h2",{className:"fk:text-xl fk:font-semibold",children:"Connected accounts"}),i.scopes.map(d=>{let c=Ne(i,d),p=$(i,t,d),x=d==="personal"||t;return c.length===0&&!p?null:jsxs("div",{className:"fk:flex fk:flex-col",children:[f?jsx("h3",{className:"fk:text-sm fk:font-medium fk:text-muted-foreground",children:d==="project"?"Project accounts":"Your accounts"}):null,jsxs("ul",{className:"fk:flex fk:flex-col fk:divide-y",children:[c.map(l=>jsx(Fe,{actionable:x,actions:n,busy:a,connection:l,pluginEnabled:i.enabled},l.id)),p?jsx("li",{children:jsxs("button",{className:"fk:flex fk:w-full fk:items-center fk:gap-3 fk:py-2 fk:text-left fk:text-sm fk:text-muted-foreground fk:transition-colors fk:hover:text-foreground fk:disabled:pointer-events-none fk:disabled:opacity-50",disabled:a||!i.enabled,type:"button",onClick:()=>s(d),children:[jsx("span",{className:"fk:flex fk:size-8 fk:shrink-0 fk:items-center fk:justify-center fk:rounded-full fk:border fk:border-dashed",children:jsx(Plus,{className:"fk:size-4"})}),c.length>0?"Connect another account":"Connect an account"]})}):null]})]},d)})]})}function cn(){let{pluginId:n}=useParams(),{api:a,base:t$1}=be(),{data:s,error:i,mutate:f$1}=V(t$1&&n?`${t$1}/plugins/${n}`:null,f),{mutate:d$1}=useSWRConfig(),c=useNavigate(),[p,x]=useState(false),l=s?.plugin,w$1=l?ze(l.sourceUrl):null,u=async r=>{x(true);try{await r(),await f$1();}catch(k){if(k instanceof S){ta.error('You signed in with a different account. Use "Connect another account" to add it.');return}ta.error(k instanceof Error?k.message:"Unable to complete this action.");}finally{x(false);}};if(i)return jsx("div",{className:"fk:p-6",children:jsx(Wc,{variant:"destructive",children:jsx(Yc,{children:"Unable to load this plugin."})})});if(!l||!s||!a||!t$1)return jsxs("main",{className:"fk:flex fk:min-h-0 fk:flex-1 fk:flex-col",children:[jsxs("div",{className:"fk:mb-2 fk:flex fk:shrink-0 fk:items-center fk:gap-2",children:[jsxs(L,{children:[jsx(M,{asChild:true,children:jsx(S$1,{className:"fk:-ml-1 fk:h-4 fk:w-4"})}),jsx(O,{children:"Toggle Sidebar"})]}),jsxs(d,{variant:"ghost",size:"sm",onClick:()=>c("..",{relative:"path"}),children:[jsx(ArrowLeft,{}),"Plugins"]})]}),jsx(w,{className:"fk:h-0 fk:min-h-0 fk:flex-1",children:jsxs("div",{"aria-busy":"true",className:"fk:mx-auto fk:flex fk:w-full fk:max-w-4xl fk:flex-col fk:gap-8 fk:py-6 fk:pl-4 fk:pr-6",children:[jsx("span",{className:"fk:sr-only",children:"Loading plugin"}),jsxs("section",{className:"fk:flex fk:flex-col fk:gap-3",children:[jsxs("div",{className:"fk:flex fk:items-center fk:gap-4",children:[jsx(t,{className:"fk:size-14 fk:shrink-0 fk:rounded-lg"}),jsx(t,{className:"fk:h-7 fk:w-40"}),jsx(t,{className:"fk:ml-auto fk:h-9 fk:w-28"})]}),jsx(t,{className:"fk:h-4 fk:w-full"}),jsx(t,{className:"fk:h-4 fk:w-2/3"}),jsx(t,{className:"fk:h-6 fk:w-24 fk:rounded-full"})]})]})})]});let g=Be(l),N={onDisconnect:r=>{u(()=>a.disconnectPlugin(r.id));},onMakePrimary:r=>{u(()=>a.updatePluginConnection(r.id,{primary:!0}));},onReconnect:r=>{u(()=>U(a,l.id,r.scope,{connectionId:r.id}));},onRename:(r,k)=>u(()=>a.updatePluginConnection(r.id,{label:k}))};return jsxs("main",{className:"fk:flex fk:min-h-0 fk:flex-1 fk:flex-col",children:[jsxs("div",{className:"fk:mb-2 fk:flex fk:shrink-0 fk:items-center fk:gap-2",children:[jsxs(L,{children:[jsx(M,{asChild:true,children:jsx(S$1,{className:"fk:-ml-1 fk:h-4 fk:w-4"})}),jsx(O,{children:"Toggle Sidebar"})]}),jsxs(d,{variant:"ghost",size:"sm",onClick:()=>c("..",{relative:"path"}),children:[jsx(ArrowLeft,{}),"Plugins"]})]}),jsx(w,{className:"fk:h-0 fk:min-h-0 fk:flex-1",children:jsxs("div",{className:"fk:mx-auto fk:flex fk:w-full fk:max-w-4xl fk:flex-col fk:gap-8 fk:py-6 fk:pl-4 fk:pr-6",children:[jsxs("section",{className:"fk:flex fk:flex-col fk:gap-3",children:[jsxs("div",{className:"fk:flex fk:flex-wrap fk:items-center fk:gap-4",children:[jsx("img",{src:l.logoUrl,alt:"",className:"fk:size-14 fk:shrink-0 fk:rounded-lg fk:corner-squircle"}),jsxs("div",{className:"fk:flex fk:min-w-0 fk:flex-col fk:gap-0.5",children:[jsx("h1",{className:"fk:text-xl fk:font-semibold",children:l.name}),w$1?jsxs("a",{href:w$1,target:"_blank",rel:"noopener noreferrer",className:"fk:inline-flex fk:w-fit fk:items-center fk:gap-1 fk:text-sm fk:hover:underline fk:text-muted-foreground",children:["View source",jsx(ExternalLink,{className:"fk:size-3"})]}):null]}),jsx("div",{className:"fk:ml-auto fk:flex fk:shrink-0 fk:flex-wrap fk:items-center fk:justify-end fk:gap-2",children:A(l)?null:jsx(We,{busy:p,canManage:s.canManage,plugin:l,onConnect:r=>{u(()=>U(a,l.id,r));}})})]}),jsx("p",{className:"fk:text-muted-foreground",children:l.description}),jsx("div",{className:"fk:flex fk:flex-wrap fk:items-center fk:gap-3",children:jsx(b,{className:`fk:border-0 fk:text-[0.625rem] fk:leading-4.5 fk:font-normal fk:py-0 fk:px-2 ${$e(l.scopes)}`,variant:"default",children:Ue(l.scopes)})}),l.scopes.map(r=>(r==="personal"?l.allowPersonal:s.canManage)?null:jsx("p",{className:"fk:text-sm fk:text-muted-foreground",children:r==="project"?"Ask an owner or developer to connect.":"Personal connections are disabled by project policy."},r))]}),l.enabled?null:jsx(Wc,{children:jsx(Yc,{children:"This plugin is disabled by project policy."})}),A(l)?jsx(Ke,{actions:N,busy:p,canManage:s.canManage,plugin:l,onConnect:r=>{u(()=>U(a,l.id,r));}}):null,jsxs("section",{className:"fk:flex fk:flex-col fk:gap-3",children:[jsxs("div",{className:"fk:flex fk:items-center fk:gap-3",children:[jsx("h2",{className:"fk:text-xl fk:font-semibold",children:"Included tools"}),l.capabilities.agentTools&&g?jsxs(d,{className:"fk:ml-auto",disabled:p,size:"sm",variant:"ghost",onClick:()=>{u(async()=>{await a.refreshPluginTools(g.id),await d$1(`${t$1}/plugin-connections/${g.id}/tools`);});},children:[jsx(RefreshCw,{}),"Refresh"]}):null]}),l.capabilities.automationDelivery?jsx("p",{className:"fk:text-sm fk:text-muted-foreground",children:"Automation delivery to selected channels. This plugin does not expose MCP messaging tools."}):null,l.capabilities.agentTools&&!g?jsx("p",{className:"fk:text-sm fk:text-muted-foreground",children:"Connect to discover available tools."}):null,l.capabilities.agentTools&&g?jsxs(Fragment,{children:[jsxs("p",{className:"fk:text-sm fk:text-muted-foreground",children:["Tools \xB7 via ",g.displayName]}),jsx(Ge,{base:t$1,connectionId:g.id},g.id)]}):null]}),jsxs("section",{className:"fk:flex fk:flex-col fk:gap-3",children:[jsx("h2",{className:"fk:text-xl fk:font-semibold",children:"Included skills"}),s.skills.length===0?jsx("p",{className:"fk:text-sm fk:text-muted-foreground",children:"This plugin includes no skills."}):s.skills.map(r=>jsxs("div",{children:[jsx("h3",{className:"fk:font-medium",children:r.name}),jsx("p",{className:"fk:text-sm fk:text-muted-foreground",children:r.description})]},r.key))]}),jsxs("section",{className:"fk:space-y-3",children:[jsx("h2",{className:"fk:text-xl fk:font-semibold",children:"Used by"}),l.usedBy.length===0?jsx("p",{className:"fk:text-sm fk:text-muted-foreground",children:"No automations visible to you use this plugin yet."}):jsx("ul",{children:l.usedBy.map(r=>jsx("li",{children:jsx(d,{className:"fk:pl-0!",variant:"link",onClick:()=>c(`../../automations/${r.id}`,{relative:"path"}),children:r.name})},r.id))})]})]})})]})}export{U as a,We as b,Je as c,rn as d,fn as e,cn as f};//# sourceMappingURL=chunk-4BX7OJJ6.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-4BX7OJJ6.js.map
|