@flexkit/studio 0.0.18 → 0.0.19
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/asset-TJGJREGN.js +2 -0
- package/dist/{asset-BDEGSRVW.js.map → asset-TJGJREGN.js.map} +1 -1
- package/dist/chunk-6TSWBOSZ.js +2 -0
- package/dist/{chunk-5MTVN77Y.js.map → chunk-6TSWBOSZ.js.map} +1 -1
- package/dist/chunk-R4MPNNRN.js +2 -0
- package/dist/chunk-R4MPNNRN.js.map +1 -0
- package/dist/index.css +78 -14
- package/dist/index.d.ts +13 -5
- package/dist/index.js +210 -164
- package/dist/index.js.map +1 -1
- package/dist/{types.d-D7S0yibv.d.ts → types.d-DLhjvcTC.d.ts} +13 -5
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +1 -1
- package/package.json +7 -7
- package/dist/asset-BDEGSRVW.js +0 -2
- package/dist/chunk-5MTVN77Y.js +0 -2
- package/dist/chunk-5VMIFTZZ.js +0 -2
- package/dist/chunk-5VMIFTZZ.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"asset-
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"asset-TJGJREGN.js"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import'./index.css';import {a}from'./chunk-AXB7FQV2.js';import*as f from'react';import*as c from'@radix-ui/react-toggle';import {cva}from'class-variance-authority';import {jsx}from'react/jsx-runtime';import*as s from'@radix-ui/react-toggle-group';import*as k from'@radix-ui/react-separator';var p=cva("fk-inline-flex fk-items-center fk-justify-center fk-rounded-md fk-text-sm fk-font-medium fk-ring-offset-background fk-transition-colors hover:fk-bg-muted hover:fk-text-muted-foreground focus-visible:fk-outline-none focus-visible:fk-ring-2 focus-visible:fk-ring-ring focus-visible:fk-ring-offset-2 disabled:fk-pointer-events-none disabled:fk-opacity-50 data-[state=on]:fk-bg-accent data-[state=on]:fk-text-accent-foreground",{variants:{variant:{default:"fk-bg-transparent",outline:"fk-border fk-border-input fk-bg-transparent hover:fk-bg-accent hover:fk-text-accent-foreground"},size:{default:"fk-h-10 fk-px-3",sm:"fk-h-9 fk-px-2.5",lg:"fk-h-11 fk-px-5"}},defaultVariants:{variant:"default",size:"default"}}),v=f.forwardRef(({className:t,variant:e,size:o,...r},l)=>jsx(c.Root,{className:a(p({variant:e,size:o,className:t})),ref:l,...r}));v.displayName=c.Root.displayName;var T=f.createContext({size:"default",variant:"default"}),P=f.forwardRef(({className:t,variant:e,size:o,children:r,...l},m)=>jsx(s.Root,{className:a("fk-flex fk-items-center fk-justify-center fk-gap-1",t),ref:m,...l,children:jsx(T.Provider,{value:{variant:e,size:o},children:r})}));P.displayName=s.Root.displayName;var N=f.forwardRef(({className:t,children:e,variant:o,size:r,...l},m)=>{let b=f.useContext(T);return jsx(s.Item,{className:a(p({variant:b.variant||o,size:b.size||r}),t),ref:m,...l,children:e})});N.displayName=s.Item.displayName;var h=f.forwardRef(({className:t,orientation:e="horizontal",decorative:o=true,...r},l)=>jsx(k.Root,{className:a("fk-shrink-0 fk-bg-border",e==="horizontal"?"fk-h-[1px] fk-w-full":"fk-h-full fk-w-[1px]",t),decorative:o,orientation:e,ref:l,...r}));h.displayName=k.Root.displayName;var x=f.forwardRef(({className:t,onScroll:e,...o},r)=>jsx("div",{className:"fk-relative fk-h-full fk-w-full fk-overflow-auto fk-rounded-md fk-border-border fk-border",onScroll:e,ref:r,children:jsx("table",{className:a("fk-w-full fk-caption-bottom fk-text-sm",t),...o})}));x.displayName="Table";var L=f.forwardRef(({className:t,...e},o)=>jsx("thead",{className:a("fk-sticky fk-z-[1] fk-top-0 fk-bg-background/90 fk-backdrop-blur-[1px] [&_tr]:fk-border-border [&_tr]:fk-border-b",t),ref:o,...e}));L.displayName="TableHeader";var M=f.forwardRef(({className:t,...e},o)=>jsx("tbody",{className:a("[&_tr:last-child]:fk-border-0",t),ref:o,...e}));M.displayName="TableBody";var w=f.forwardRef(({className:t,...e},o)=>jsx("tfoot",{className:a("fk-border-border fk-border-t fk-bg-muted/50 fk-font-medium [&>tr]:last:fk-border-b-0",t),ref:o,...e}));w.displayName="TableFooter";var E=f.forwardRef(({className:t,...e},o)=>jsx("tr",{className:a("fk-border-border fk-border-b fk-transition-colors hover:fk-bg-muted/50 data-[state=selected]:fk-bg-muted",t),ref:o,...e}));E.displayName="TableRow";var C=f.forwardRef(({className:t,style:e,...o},r)=>jsx("th",{className:a("fk-h-10 fk-px-4 fk-text-left fk-align-middle fk-font-medium fk-text-muted-foreground [&:has([role=checkbox])]:fk-pr-0",t),ref:r,...o,style:e}));C.displayName="TableHead";var G=f.forwardRef(({className:t,...e},o)=>jsx("td",{className:a("fk-px-4 fk-py-1 fk-align-middle [&:has([role=checkbox])]:fk-pr-0",t),ref:o,...e}));G.displayName="TableCell";var S=f.forwardRef(({className:t,...e},o)=>jsx("caption",{className:a("fk-mt-4 fk-text-sm fk-text-muted-foreground",t),ref:o,...e}));S.displayName="TableCaption";export{p as a,v as b,P as c,N as d,h as e,x as f,L as g,M as h,w as i,E as j,C as k,G as l,S as m};//# sourceMappingURL=chunk-6TSWBOSZ.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-6TSWBOSZ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/ui/primitives/toggle.tsx","../src/ui/primitives/toggle-group.tsx","../src/ui/primitives/separator.tsx","../src/ui/primitives/table.tsx"],"names":["toggleVariants","cva","Toggle","g","className","variant","size","props","ref","jsx","cn","ToggleGroupContext","n","ToggleGroup","children","ToggleGroupItem","context","Separator","u","orientation","decorative","Table","onScroll","TableHeader","TableBody","TableFooter","TableRow","TableHead","style","TableCell","TableCaption"],"mappings":"mSAOA,IAAMA,CAAAA,CAAiBC,GAAAA,CACrB,waAAA,CACA,CACE,QAAA,CAAU,CACR,OAAA,CAAS,CACP,OAAA,CAAW,mBAAA,CACX,OAAA,CAAS,gGAC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AAqB,CAAA,CAAA,UAAA,CACzB,CAAC,CAAE,SAAA,CAAA1B,CAAAA,CAAW,GAAGG,CAAM,CAAA,CAAGC,CAAAA,GACxBC,GAAAA,CAAC,SAAA,CAAA,CAAQ,SAAA,CAAWC,CAAAA,CAAG,6CAAA,CAA+CN,CAAS,CAAA,CAAG,GAAA,CAAKI,CAAAA,CAAM,GAAGD,CAAAA,CAAO,CAE3G,EACAuB,CAAAA,CAAa,WAAA,CAAc,cAAA","file":"chunk-5MTVN77Y.js","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as TogglePrimitive from '@radix-ui/react-toggle';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/utils';\n\nconst toggleVariants = cva(\n 'fk-inline-flex fk-items-center fk-justify-center fk-rounded-md fk-text-sm fk-font-medium fk-ring-offset-background fk-transition-colors hover:fk-bg-muted hover:fk-text-muted-foreground focus-visible:fk-outline-none focus-visible:fk-ring-2 focus-visible:fk-ring-ring focus-visible:fk-ring-offset-2 disabled:fk-pointer-events-none disabled:fk-opacity-50 data-[state=on]:fk-bg-accent data-[state=on]:fk-text-accent-foreground',\n {\n variants: {\n variant: {\n 'default': 'fk-bg-transparent',\n outline: 'fk-border fk-border-input fk-bg-transparent hover:fk-bg-accent hover:fk-text-accent-foreground',\n },\n size: {\n 'default': 'fk-h-10 fk-px-3',\n sm: 'fk-h-9 fk-px-2.5',\n lg: 'fk-h-11 fk-px-5',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n);\n\nconst Toggle = React.forwardRef<\n React.ElementRef<typeof TogglePrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>\n>(({ className, variant, size, ...props }, ref) => (\n <TogglePrimitive.Root className={cn(toggleVariants({ variant, size, className }))} ref={ref} {...props} />\n));\n\nToggle.displayName = TogglePrimitive.Root.displayName;\n\nexport { Toggle, toggleVariants };\n","'use client';\n\nimport * as React from 'react';\nimport * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport type { VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/utils';\nimport { toggleVariants } from './toggle';\n\nconst ToggleGroupContext = React.createContext<VariantProps<typeof toggleVariants>>({\n size: 'default',\n variant: 'default',\n});\n\nconst ToggleGroup = React.forwardRef<\n React.ElementRef<typeof ToggleGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants>\n>(({ className, variant, size, children, ...props }, ref) => (\n <ToggleGroupPrimitive.Root\n className={cn('fk-flex fk-items-center fk-justify-center fk-gap-1', className)}\n ref={ref}\n {...props}\n >\n <ToggleGroupContext.Provider value={{ variant, size }}>{children}</ToggleGroupContext.Provider>\n </ToggleGroupPrimitive.Root>\n));\n\nToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;\n\nconst ToggleGroupItem = React.forwardRef<\n React.ElementRef<typeof ToggleGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>\n>(({ className, children, variant, size, ...props }, ref) => {\n const context = React.useContext(ToggleGroupContext);\n\n return (\n <ToggleGroupPrimitive.Item\n className={cn(\n toggleVariants({\n variant: context.variant || variant,\n size: context.size || size,\n }),\n className\n )}\n ref={ref}\n {...props}\n >\n {children}\n </ToggleGroupPrimitive.Item>\n );\n});\n\nToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;\n\nexport { ToggleGroup, ToggleGroupItem };\n","'use client';\n\nimport * as React from 'react';\nimport * as SeparatorPrimitive from '@radix-ui/react-separator';\nimport { cn } from 'src/ui/lib/utils';\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n className={cn(\n 'fk-shrink-0 fk-bg-border',\n orientation === 'horizontal' ? 'fk-h-[1px] fk-w-full' : 'fk-h-full fk-w-[1px]',\n className\n )}\n decorative={decorative}\n orientation={orientation}\n ref={ref}\n {...props}\n />\n));\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\nexport { Separator };\n","import * as React from 'react';\nimport { cn } from 'src/ui/lib/utils';\n\nconst Table = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLTableElement>>(\n ({ className, onScroll, ...props }, ref) => (\n <div\n className=\"fk-relative fk-h-full fk-w-full fk-overflow-x-auto fk-rounded-md fk-border-border fk-border\"\n onScroll={onScroll}\n ref={ref}\n >\n <table className={cn('fk-w-full fk-caption-bottom fk-text-sm', className)} {...props} />\n </div>\n )\n);\nTable.displayName = 'Table';\n\nconst TableHeader = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => (\n <thead\n className={cn(\n 'fk-sticky fk-z-[1] fk-top-0 fk-bg-background/90 fk-backdrop-blur-[1px] [&_tr]:fk-border-border [&_tr]:fk-border-border [&_tr]:fk-border-b',\n className\n )}\n ref={ref}\n {...props}\n />\n )\n);\nTableHeader.displayName = 'TableHeader';\n\nconst TableBody = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => (\n <tbody className={cn('[&_tr:last-child]:fk-border-0', className)} ref={ref} {...props} />\n )\n);\nTableBody.displayName = 'TableBody';\n\nconst TableFooter = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => (\n <tfoot\n className={cn('fk-border-border fk-border-t fk-bg-muted/50 fk-font-medium [&>tr]:last:fk-border-b-0', className)}\n ref={ref}\n {...props}\n />\n )\n);\nTableFooter.displayName = 'TableFooter';\n\nconst TableRow = React.forwardRef<HTMLTableRowElement, React.HTMLAttributes<HTMLTableRowElement>>(\n ({ className, ...props }, ref) => (\n <tr\n className={cn(\n 'fk-border-border fk-border-b fk-transition-colors hover:fk-bg-muted/50 data-[state=selected]:fk-bg-muted',\n className\n )}\n ref={ref}\n {...props}\n />\n )\n);\nTableRow.displayName = 'TableRow';\n\nconst TableHead = React.forwardRef<HTMLTableCellElement, React.ThHTMLAttributes<HTMLTableCellElement>>(\n ({ className, style, ...props }, ref) => {\n return (\n <th\n className={cn(\n 'fk-h-10 fk-px-4 fk-text-left fk-align-middle fk-font-medium fk-text-muted-foreground [&:has([role=checkbox])]:fk-pr-0',\n className\n )}\n ref={ref}\n {...props}\n style={style}\n />\n );\n }\n);\nTableHead.displayName = 'TableHead';\n\nconst TableCell = React.forwardRef<HTMLTableCellElement, React.TdHTMLAttributes<HTMLTableCellElement>>(\n ({ className, ...props }, ref) => (\n <td\n className={cn('fk-px-4 fk-py-1 fk-align-middle [&:has([role=checkbox])]:fk-pr-0', className)}\n ref={ref}\n {...props}\n />\n )\n);\nTableCell.displayName = 'TableCell';\n\nconst TableCaption = React.forwardRef<HTMLTableCaptionElement, React.HTMLAttributes<HTMLTableCaptionElement>>(\n ({ className, ...props }, ref) => (\n <caption className={cn('fk-mt-4 fk-text-sm fk-text-muted-foreground', className)} ref={ref} {...props} />\n )\n);\nTableCaption.displayName = 'TableCaption';\n\nexport { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/ui/primitives/toggle.tsx","../src/ui/primitives/toggle-group.tsx","../src/ui/primitives/separator.tsx","../src/ui/primitives/table.tsx"],"names":["toggleVariants","cva","Toggle","g","className","variant","size","props","ref","jsx","cn","ToggleGroupContext","n","ToggleGroup","children","ToggleGroupItem","context","Separator","u","orientation","decorative","Table","onScroll","TableHeader","TableBody","TableFooter","TableRow","TableHead","style","TableCell","TableCaption"],"mappings":"mSAOA,IAAMA,CAAAA,CAAiBC,GAAAA,CACrB,waAAA,CACA,CACE,QAAA,CAAU,CACR,OAAA,CAAS,CACP,OAAA,CAAW,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WAAA,CAExB,IAAMC,CAAAA,CAAqB,CAAA,CAAA,UAAA,CACzB,CAAC,CAAE,SAAA,CAAA1B,CAAAA,CAAW,GAAGG,CAAM,CAAA,CAAGC,CAAAA,GACxBC,GAAAA,CAAC,SAAA,CAAA,CAAQ,SAAA,CAAWC,CAAAA,CAAG,6CAAA,CAA+CN,CAAS,CAAA,CAAG,GAAA,CAAKI,CAAAA,CAAM,GAAGD,CAAAA,CAAO,CAE3G,EACAuB,CAAAA,CAAa,WAAA,CAAc,cAAA","file":"chunk-6TSWBOSZ.js","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport * as TogglePrimitive from '@radix-ui/react-toggle';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/utils';\n\nconst toggleVariants = cva(\n 'fk-inline-flex fk-items-center fk-justify-center fk-rounded-md fk-text-sm fk-font-medium fk-ring-offset-background fk-transition-colors hover:fk-bg-muted hover:fk-text-muted-foreground focus-visible:fk-outline-none focus-visible:fk-ring-2 focus-visible:fk-ring-ring focus-visible:fk-ring-offset-2 disabled:fk-pointer-events-none disabled:fk-opacity-50 data-[state=on]:fk-bg-accent data-[state=on]:fk-text-accent-foreground',\n {\n variants: {\n variant: {\n 'default': 'fk-bg-transparent',\n outline: 'fk-border fk-border-input fk-bg-transparent hover:fk-bg-accent hover:fk-text-accent-foreground',\n },\n size: {\n 'default': 'fk-h-10 fk-px-3',\n sm: 'fk-h-9 fk-px-2.5',\n lg: 'fk-h-11 fk-px-5',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n);\n\nconst Toggle = React.forwardRef<\n React.ElementRef<typeof TogglePrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>\n>(({ className, variant, size, ...props }, ref) => (\n <TogglePrimitive.Root className={cn(toggleVariants({ variant, size, className }))} ref={ref} {...props} />\n));\n\nToggle.displayName = TogglePrimitive.Root.displayName;\n\nexport { Toggle, toggleVariants };\n","'use client';\n\nimport * as React from 'react';\nimport * as ToggleGroupPrimitive from '@radix-ui/react-toggle-group';\nimport type { VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/utils';\nimport { toggleVariants } from './toggle';\n\nconst ToggleGroupContext = React.createContext<VariantProps<typeof toggleVariants>>({\n size: 'default',\n variant: 'default',\n});\n\nconst ToggleGroup = React.forwardRef<\n React.ElementRef<typeof ToggleGroupPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> & VariantProps<typeof toggleVariants>\n>(({ className, variant, size, children, ...props }, ref) => (\n <ToggleGroupPrimitive.Root\n className={cn('fk-flex fk-items-center fk-justify-center fk-gap-1', className)}\n ref={ref}\n {...props}\n >\n <ToggleGroupContext.Provider value={{ variant, size }}>{children}</ToggleGroupContext.Provider>\n </ToggleGroupPrimitive.Root>\n));\n\nToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;\n\nconst ToggleGroupItem = React.forwardRef<\n React.ElementRef<typeof ToggleGroupPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>\n>(({ className, children, variant, size, ...props }, ref) => {\n const context = React.useContext(ToggleGroupContext);\n\n return (\n <ToggleGroupPrimitive.Item\n className={cn(\n toggleVariants({\n variant: context.variant || variant,\n size: context.size || size,\n }),\n className\n )}\n ref={ref}\n {...props}\n >\n {children}\n </ToggleGroupPrimitive.Item>\n );\n});\n\nToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;\n\nexport { ToggleGroup, ToggleGroupItem };\n","'use client';\n\nimport * as React from 'react';\nimport * as SeparatorPrimitive from '@radix-ui/react-separator';\nimport { cn } from 'src/ui/lib/utils';\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive.Root>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive.Root>\n>(({ className, orientation = 'horizontal', decorative = true, ...props }, ref) => (\n <SeparatorPrimitive.Root\n className={cn(\n 'fk-shrink-0 fk-bg-border',\n orientation === 'horizontal' ? 'fk-h-[1px] fk-w-full' : 'fk-h-full fk-w-[1px]',\n className\n )}\n decorative={decorative}\n orientation={orientation}\n ref={ref}\n {...props}\n />\n));\nSeparator.displayName = SeparatorPrimitive.Root.displayName;\n\nexport { Separator };\n","import * as React from 'react';\nimport { cn } from 'src/ui/lib/utils';\n\nconst Table = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLTableElement>>(\n ({ className, onScroll, ...props }, ref) => (\n <div\n className=\"fk-relative fk-h-full fk-w-full fk-overflow-auto fk-rounded-md fk-border-border fk-border\"\n onScroll={onScroll}\n ref={ref}\n >\n <table className={cn('fk-w-full fk-caption-bottom fk-text-sm', className)} {...props} />\n </div>\n )\n);\nTable.displayName = 'Table';\n\nconst TableHeader = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => (\n <thead\n className={cn(\n 'fk-sticky fk-z-[1] fk-top-0 fk-bg-background/90 fk-backdrop-blur-[1px] [&_tr]:fk-border-border [&_tr]:fk-border-b',\n className\n )}\n ref={ref}\n {...props}\n />\n )\n);\nTableHeader.displayName = 'TableHeader';\n\nconst TableBody = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => (\n <tbody className={cn('[&_tr:last-child]:fk-border-0', className)} ref={ref} {...props} />\n )\n);\nTableBody.displayName = 'TableBody';\n\nconst TableFooter = React.forwardRef<HTMLTableSectionElement, React.HTMLAttributes<HTMLTableSectionElement>>(\n ({ className, ...props }, ref) => (\n <tfoot\n className={cn('fk-border-border fk-border-t fk-bg-muted/50 fk-font-medium [&>tr]:last:fk-border-b-0', className)}\n ref={ref}\n {...props}\n />\n )\n);\nTableFooter.displayName = 'TableFooter';\n\nconst TableRow = React.forwardRef<HTMLTableRowElement, React.HTMLAttributes<HTMLTableRowElement>>(\n ({ className, ...props }, ref) => (\n <tr\n className={cn(\n 'fk-border-border fk-border-b fk-transition-colors hover:fk-bg-muted/50 data-[state=selected]:fk-bg-muted',\n className\n )}\n ref={ref}\n {...props}\n />\n )\n);\nTableRow.displayName = 'TableRow';\n\nconst TableHead = React.forwardRef<HTMLTableCellElement, React.ThHTMLAttributes<HTMLTableCellElement>>(\n ({ className, style, ...props }, ref) => {\n return (\n <th\n className={cn(\n 'fk-h-10 fk-px-4 fk-text-left fk-align-middle fk-font-medium fk-text-muted-foreground [&:has([role=checkbox])]:fk-pr-0',\n className\n )}\n ref={ref}\n {...props}\n style={style}\n />\n );\n }\n);\nTableHead.displayName = 'TableHead';\n\nconst TableCell = React.forwardRef<HTMLTableCellElement, React.TdHTMLAttributes<HTMLTableCellElement>>(\n ({ className, ...props }, ref) => (\n <td\n className={cn('fk-px-4 fk-py-1 fk-align-middle [&:has([role=checkbox])]:fk-pr-0', className)}\n ref={ref}\n {...props}\n />\n )\n);\nTableCell.displayName = 'TableCell';\n\nconst TableCaption = React.forwardRef<HTMLTableCaptionElement, React.HTMLAttributes<HTMLTableCaptionElement>>(\n ({ className, ...props }, ref) => (\n <caption className={cn('fk-mt-4 fk-text-sm fk-text-muted-foreground', className)} ref={ref} {...props} />\n )\n);\nTableCaption.displayName = 'TableCaption';\n\nexport { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };\n"]}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import'./index.css';import {a,b as b$1,c,d as d$1,e}from'./chunk-RMSYYUQM.js';import {b}from'./chunk-TMK5LKFR.js';import {defaultStyles,FileIcon}from'react-file-icon';import {useMemo,useState,useEffect}from'react';import {jsx,jsxs}from'react/jsx-runtime';var _=250,I=25e5,i=new Map,v=new Map,w=new Set,A=new Map;function d(e){if(A.has(e))return;let t=new Image;t.decoding="async",t.src=e,A.set(e,t);}function g(e){let t=i.get(e);t&&i.set(e,{...t,lastUsedAt:Date.now()});}function j(){if(i.size<=_)return;let e=Array.from(i.entries()).sort((n,r)=>n[1].lastUsedAt-r[1].lastUsedAt),t=Math.max(1,Math.ceil(_*.1));for(let n=0;n<t&&n<e.length;n+=1){let[r,o]=e[n];i.delete(r),URL.revokeObjectURL(o.objectUrl);}}async function N(e){if(w.has(e)){d(e);return}if(i.has(e)){g(e);return}let t=v.get(e);if(t){await t;return}let n=(async()=>{try{let r=await fetch(e,{mode:"cors",cache:"force-cache"});if(!r.ok){d(e);return}let o=await r.blob();if(o.size>I)return;let a=URL.createObjectURL(o);i.set(e,{objectUrl:a,byteSize:o.size,lastUsedAt:Date.now()}),j();}catch(r){r instanceof TypeError&&w.add(e),d(e);}})();v.set(e,n),await n,v.delete(e);}function U(e){let t=useMemo(()=>{if(!e)return null;let o=i.get(e);return o?(g(e),o.objectUrl):null},[e]),[n,r]=useState(t);return useEffect(()=>{if(!e){r(null);return}if(w.has(e)){d(e),r(null);return}let o=i.get(e);if(o){g(e),r(o.objectUrl);return}r(null);let a=false;return N(e).then(()=>{let f=i.get(e);f&&(a||(g(e),r(f.objectUrl)));}),()=>{a=true;}},[e]),n}var x="fk-bg-[#fafafa] [--asset-checker:#f0f0f0] [background-image:linear-gradient(45deg,var(--asset-checker)_25%,transparent_25%),linear-gradient(-45deg,var(--asset-checker)_25%,transparent_25%),linear-gradient(45deg,transparent_75%,var(--asset-checker)_75%),linear-gradient(-45deg,transparent_75%,var(--asset-checker)_75%)] [background-position:0_0,0_4px,4px_-4px,-4px_0px] [background-size:8px_8px] dark:fk-bg-[#222] dark:[--asset-checker:#2a2a2a]";function G({value:e}){return Array.isArray(e)?jsx(z,{value:e}):jsx(M,{value:e})}function M({value:e$1}){let t=e$1?.path??"",n=!!t,r=n&&/\.(png|jpe?g|gif|webp|avif|svg)$/i.test(t),o=l=>{let[u]=l.split("?"),y=u.split(".");return y.length>1?y.pop().toLowerCase():"file"},a$1=n?t.endsWith(".svg")?`${b}${t}`:`${b}${t}?w=84&h=84&f=webp`:null,f=n?t.endsWith(".svg")?`${b}${t}`:`${b}${t}?w=624&h=624&f=webp`:"",S=U(a$1);return n?jsx("div",{className:"fk-z-10",children:jsx(a,{children:r?jsxs(b$1,{children:[jsx(c,{asChild:true,children:jsx("img",{alt:"asset",className:`fk-w-7 fk-h-7 fk-cursor-zoom-in fk-overflow-hidden fk-rounded-md fk-object-contain ${x}`,decoding:"async",src:S??void 0})}),jsx(d$1,{children:jsx(e,{children:jsx("img",{alt:"asset",className:`fk-w-52 fk-h-52 fk-overflow-hidden fk-rounded-md fk-object-contain ${x}`,decoding:"async",src:f})})})]}):jsxs(b$1,{children:[jsx(c,{asChild:true,children:jsx("div",{className:"fk-w-7 fk-h-7 fk-rounded fk-bg-transparent fk-flex fk-items-center fk-justify-center [&>svg]:fk-h-full [&>svg]:fk-w-auto",children:(()=>{let l=o(t),u=defaultStyles[l];return jsx(FileIcon,{extension:l,...u||{}})})()})}),jsx(d$1,{children:jsx(e,{children:jsx("div",{className:"fk-text-sm fk-text-muted-foreground",children:"Preview not available"})})})]})})}):null}function z({value:e}){let t=e.filter(n=>!!n.path).slice(0,3);return t.length===0?null:jsxs("div",{className:"fk-flex fk-items-center",children:[jsx("div",{className:"fk-flex -fk-space-x-2",children:t.map(n=>jsx("img",{alt:"asset",className:`fk-h-7 fk-w-7 fk-overflow-hidden fk-rounded-md fk-object-contain ${x}`,decoding:"async",src:`${b}${n.path}?w=84&h=84&f=webp`},n._id))}),e.length>3?jsxs("span",{className:"fk-ml-2 fk-text-xs fk-text-muted-foreground",children:["+",e.length-3]}):null]})}export{G as a};//# sourceMappingURL=chunk-R4MPNNRN.js.map
|
|
2
|
+
//# sourceMappingURL=chunk-R4MPNNRN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/ui/hooks/use-cached-image-src.ts","../src/data-grid/preview-components/asset.tsx"],"names":["MAX_CACHE_ENTRIES","MAX_SINGLE_BLOB_BYTES","blobUrlCache","inFlightLoads","corsBlockedUrls","preloadedImages","ensurePreloaded","url","img","touch","entry","evictIfNeeded","entries","a","b","evictCount","i","loadToCache","existing","promise","res","blob","objectUrl","err","useCachedImageSrc","initial","useMemo","cached","src","setSrc","useState","useEffect","isStale","next","transparentImageBackground","Asset","value","jsx","AssetStack","SingleAsset","path","hasPath","isImage","getExtensionFromPath","p","clean","parts","thumbnaillUrl","IMAGES_BASE_URL","fullUrl","cachedThumbnailSrc","TooltipProvider","jsxs","Tooltip","TooltipTrigger","TooltipPortal","TooltipContent","ext","style","defaultStyles","FileTypeIcon","assets","asset"],"mappings":"+PAQA,IAAMA,EAAoB,GAAA,CACpBC,CAAAA,CAAwB,KAExBC,CAAAA,CAAe,IAAI,GAAA,CACnBC,CAAAA,CAAgB,IAAI,GAAA,CACpBC,CAAAA,CAAkB,IAAI,GAAA,CACtBC,CAAAA,CAAkB,IAAI,GAAA,CAE5B,SAASC,EAAgBC,CAAAA,CAAmB,CAC1C,GAAIF,CAAAA,CAAgB,GAAA,CAAIE,CAAG,CAAA,CACzB,OAGF,IAAMC,CAAAA,CAAM,IAAI,KAAA,CAChBA,CAAAA,CAAI,SAAW,OAAA,CACfA,CAAAA,CAAI,IAAMD,CAAAA,CACVF,CAAAA,CAAgB,IAAIE,CAAAA,CAAKC,CAAG,EAC9B,CAEA,SAASC,CAAAA,CAAMF,CAAAA,CAAmB,CAChC,IAAMG,CAAAA,CAAQR,EAAa,GAAA,CAAIK,CAAG,CAAA,CAE7BG,CAAAA,EAILR,EAAa,GAAA,CAAIK,CAAAA,CAAK,CAAE,GAAGG,CAAAA,CAAO,WAAY,IAAA,CAAK,GAAA,EAAM,CAAC,EAC5D,CAEA,SAASC,CAAAA,EAAsB,CAC7B,GAAIT,CAAAA,CAAa,MAAQF,CAAAA,CACvB,OAGF,IAAMY,CAAAA,CAAU,MAAM,IAAA,CAAKV,CAAAA,CAAa,SAAS,CAAA,CAAE,KAAK,CAACW,CAAAA,CAAGC,CAAAA,GAAMD,CAAAA,CAAE,CAAC,CAAA,CAAE,UAAA,CAAaC,EAAE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B,GAAAA,CAAA,CACC,QAAA,CAAAlB,GAAAA,CAACmB,CAAAA,CAAA,CACC,SAAAnB,GAAAA,CAAC,KAAA,CAAA,CAAI,UAAU,qCAAA,CAAsC,QAAA,CAAA,uBAAA,CAAqB,EAC5E,CAAA,CACF,CAAA,CAAA,CACF,CAAA,CAEJ,CAAA,CACF,EAjDO,IAmDX,CAEA,SAASC,CAAAA,CAAW,CAAE,MAAAF,CAAM,CAAA,CAA2C,CACrE,IAAMyB,EAASzB,CAAAA,CAAM,MAAA,CAAQ0B,GAAU,CAAA,CAAQA,CAAAA,CAAM,IAAK,CAAA,CAAE,KAAA,CAAM,EAAG,CAAC,CAAA,CAEtE,OAAID,CAAAA,CAAO,MAAA,GAAW,EACb,IAAA,CAIPT,IAAAA,CAAC,OAAI,SAAA,CAAU,yBAAA,CACb,QAAA,CAAA,CAAAf,GAAAA,CAAC,OAAI,SAAA,CAAU,uBAAA,CACZ,SAAAwB,CAAAA,CAAO,GAAA,CAAKC,GACXzB,GAAAA,CAAC,KAAA,CAAA,CACC,IAAI,OAAA,CACJ,SAAA,CAAW,oEAAoEH,CAA0B,CAAA,CAAA,CACzG,SAAS,OAAA,CAET,GAAA,CAAK,GAAGc,CAAe,CAAA,EAAGc,CAAAA,CAAM,IAAI,qBAD/BA,CAAAA,CAAM,GAEb,CACD,CAAA,CACH,CAAA,CACC1B,EAAM,MAAA,CAAS,CAAA,CACdgB,KAAC,MAAA,CAAA,CAAK,SAAA,CAAU,8CAA8C,QAAA,CAAA,CAAA,GAAA,CAAEhB,CAAAA,CAAM,OAAS,CAAA,CAAA,CAAE,CAAA,CAC/E,MACN,CAEJ","file":"chunk-R4MPNNRN.js","sourcesContent":["import { useEffect, useMemo, useState } from 'react';\n\ntype CacheEntry = {\n objectUrl: string;\n byteSize: number;\n lastUsedAt: number;\n};\n\nconst MAX_CACHE_ENTRIES = 250;\nconst MAX_SINGLE_BLOB_BYTES = 2_500_000; // ~2.5MB\n\nconst blobUrlCache = new Map<string, CacheEntry>();\nconst inFlightLoads = new Map<string, Promise<void>>();\nconst corsBlockedUrls = new Set<string>();\nconst preloadedImages = new Map<string, HTMLImageElement>();\n\nfunction ensurePreloaded(url: string): void {\n if (preloadedImages.has(url)) {\n return;\n }\n\n const img = new Image();\n img.decoding = 'async';\n img.src = url;\n preloadedImages.set(url, img);\n}\n\nfunction touch(url: string): void {\n const entry = blobUrlCache.get(url);\n\n if (!entry) {\n return;\n }\n\n blobUrlCache.set(url, { ...entry, lastUsedAt: Date.now() });\n}\n\nfunction evictIfNeeded(): void {\n if (blobUrlCache.size <= MAX_CACHE_ENTRIES) {\n return;\n }\n\n const entries = Array.from(blobUrlCache.entries()).sort((a, b) => a[1].lastUsedAt - b[1].lastUsedAt);\n const evictCount = Math.max(1, Math.ceil(MAX_CACHE_ENTRIES * 0.1));\n\n for (let i = 0; i < evictCount && i < entries.length; i += 1) {\n const [url, entry] = entries[i];\n blobUrlCache.delete(url);\n\n URL.revokeObjectURL(entry.objectUrl);\n }\n}\n\nasync function loadToCache(url: string): Promise<void> {\n if (corsBlockedUrls.has(url)) {\n ensurePreloaded(url);\n\n return;\n }\n\n if (blobUrlCache.has(url)) {\n touch(url);\n\n return;\n }\n\n const existing = inFlightLoads.get(url);\n\n if (existing) {\n await existing;\n\n return;\n }\n\n const promise = (async () => {\n try {\n const res = await fetch(url, {\n mode: 'cors',\n cache: 'force-cache',\n });\n\n if (!res.ok) {\n ensurePreloaded(url);\n\n return;\n }\n\n const blob = await res.blob();\n\n if (blob.size > MAX_SINGLE_BLOB_BYTES) {\n return;\n }\n\n const objectUrl = URL.createObjectURL(blob);\n blobUrlCache.set(url, { objectUrl, byteSize: blob.size, lastUsedAt: Date.now() });\n evictIfNeeded();\n } catch (err: unknown) {\n // Most common failure is CORS (TypeError: Failed to fetch). If so, avoid retrying.\n if (err instanceof TypeError) {\n corsBlockedUrls.add(url);\n }\n\n ensurePreloaded(url);\n }\n })();\n\n inFlightLoads.set(url, promise);\n\n await promise;\n\n inFlightLoads.delete(url);\n}\n\n/**\n * Keeps a stable, in-memory cached image src across virtualized unmount/remount cycles.\n * Falls back to the original URL if the image can’t be fetched (e.g. due to CORS).\n */\nexport function useCachedImageSrc(url: string | null | undefined): string | null {\n const initial = useMemo(() => {\n if (!url) {\n return null;\n }\n\n const cached = blobUrlCache.get(url);\n\n if (!cached) {\n return null;\n }\n\n touch(url);\n\n return cached.objectUrl;\n }, [url]);\n\n const [src, setSrc] = useState<string | null>(initial);\n\n useEffect(() => {\n if (!url) {\n setSrc(null);\n\n return;\n }\n\n if (corsBlockedUrls.has(url)) {\n ensurePreloaded(url);\n setSrc(null);\n\n return;\n }\n\n const cached = blobUrlCache.get(url);\n\n if (cached) {\n touch(url);\n setSrc(cached.objectUrl);\n\n return;\n }\n\n setSrc(null);\n let isStale = false;\n\n loadToCache(url).then(() => {\n const next = blobUrlCache.get(url);\n\n if (!next) {\n return;\n }\n\n if (isStale) {\n return;\n }\n\n touch(url);\n setSrc(next.objectUrl);\n });\n\n return () => {\n isStale = true;\n };\n }, [url]);\n\n return src;\n}\n","import { Tooltip, TooltipContent, TooltipPortal, TooltipProvider, TooltipTrigger } from '../../ui/primitives/tooltip';\nimport { IMAGES_BASE_URL } from '../../core/api-paths';\nimport { FileIcon as FileTypeIcon, defaultStyles } from 'react-file-icon';\nimport { useCachedImageSrc } from '../../ui/hooks/use-cached-image-src';\n\nexport type Asset = {\n _id: string;\n path: string;\n};\n\nconst transparentImageBackground =\n 'fk-bg-[#fafafa] [--asset-checker:#f0f0f0] [background-image:linear-gradient(45deg,var(--asset-checker)_25%,transparent_25%),linear-gradient(-45deg,var(--asset-checker)_25%,transparent_25%),linear-gradient(45deg,transparent_75%,var(--asset-checker)_75%),linear-gradient(-45deg,transparent_75%,var(--asset-checker)_75%)] [background-position:0_0,0_4px,4px_-4px,-4px_0px] [background-size:8px_8px] dark:fk-bg-[#222] dark:[--asset-checker:#2a2a2a]';\n\nexport function Asset({ value }: { value: Asset | Asset[] }) {\n if (Array.isArray(value)) {\n return <AssetStack value={value} />;\n }\n\n return <SingleAsset value={value} />;\n}\n\nfunction SingleAsset({ value }: { value: Asset }) {\n const path = value?.path ?? '';\n const hasPath = Boolean(path);\n const isImage = hasPath && /\\.(png|jpe?g|gif|webp|avif|svg)$/i.test(path);\n\n const getExtensionFromPath = (p: string): string => {\n const [clean] = p.split('?');\n const parts = clean.split('.');\n\n if (parts.length > 1) {\n return parts.pop()!.toLowerCase();\n }\n\n return 'file';\n };\n\n const thumbnaillUrl = hasPath\n ? path.endsWith('.svg')\n ? `${IMAGES_BASE_URL}${path}`\n : `${IMAGES_BASE_URL}${path}?w=84&h=84&f=webp`\n : null;\n\n const fullUrl = hasPath\n ? path.endsWith('.svg')\n ? `${IMAGES_BASE_URL}${path}`\n : `${IMAGES_BASE_URL}${path}?w=624&h=624&f=webp`\n : '';\n\n const cachedThumbnailSrc = useCachedImageSrc(thumbnaillUrl);\n\n if (!hasPath) {\n return null;\n }\n\n return (\n <div className=\"fk-z-10\">\n <TooltipProvider>\n {isImage ? (\n <Tooltip>\n <TooltipTrigger asChild>\n <img\n alt=\"asset\"\n className={`fk-w-7 fk-h-7 fk-cursor-zoom-in fk-overflow-hidden fk-rounded-md fk-object-contain ${transparentImageBackground}`}\n decoding=\"async\"\n src={cachedThumbnailSrc ?? undefined}\n />\n </TooltipTrigger>\n <TooltipPortal>\n <TooltipContent>\n <img\n alt=\"asset\"\n className={`fk-w-52 fk-h-52 fk-overflow-hidden fk-rounded-md fk-object-contain ${transparentImageBackground}`}\n decoding=\"async\"\n src={fullUrl}\n />\n </TooltipContent>\n </TooltipPortal>\n </Tooltip>\n ) : (\n <Tooltip>\n <TooltipTrigger asChild>\n <div className=\"fk-w-7 fk-h-7 fk-rounded fk-bg-transparent fk-flex fk-items-center fk-justify-center [&>svg]:fk-h-full [&>svg]:fk-w-auto\">\n {(() => {\n const ext = getExtensionFromPath(path);\n const style = (\n defaultStyles as Record<string, Record<string, string | number | boolean | undefined>>\n )[ext];\n\n return <FileTypeIcon extension={ext} {...(style || {})} />;\n })()}\n </div>\n </TooltipTrigger>\n <TooltipPortal>\n <TooltipContent>\n <div className=\"fk-text-sm fk-text-muted-foreground\">Preview not available</div>\n </TooltipContent>\n </TooltipPortal>\n </Tooltip>\n )}\n </TooltipProvider>\n </div>\n );\n}\n\nfunction AssetStack({ value }: { value: Asset[] }): JSX.Element | null {\n const assets = value.filter((asset) => Boolean(asset.path)).slice(0, 3);\n\n if (assets.length === 0) {\n return null;\n }\n\n return (\n <div className=\"fk-flex fk-items-center\">\n <div className=\"fk-flex -fk-space-x-2\">\n {assets.map((asset) => (\n <img\n alt=\"asset\"\n className={`fk-h-7 fk-w-7 fk-overflow-hidden fk-rounded-md fk-object-contain ${transparentImageBackground}`}\n decoding=\"async\"\n key={asset._id}\n src={`${IMAGES_BASE_URL}${asset.path}?w=84&h=84&f=webp`}\n />\n ))}\n </div>\n {value.length > 3 ? (\n <span className=\"fk-ml-2 fk-text-xs fk-text-muted-foreground\">+{value.length - 3}</span>\n ) : null}\n </div>\n );\n}\n"]}
|
package/dist/index.css
CHANGED
|
@@ -1868,6 +1868,10 @@ body{
|
|
|
1868
1868
|
height: 20px;
|
|
1869
1869
|
}
|
|
1870
1870
|
|
|
1871
|
+
.fk-h-\[28rem\]{
|
|
1872
|
+
height: 28rem;
|
|
1873
|
+
}
|
|
1874
|
+
|
|
1871
1875
|
.fk-h-\[30vh\]{
|
|
1872
1876
|
height: 30vh;
|
|
1873
1877
|
}
|
|
@@ -1880,6 +1884,10 @@ body{
|
|
|
1880
1884
|
height: calc(100svh - 3.5rem);
|
|
1881
1885
|
}
|
|
1882
1886
|
|
|
1887
|
+
.fk-h-\[calc\(100vh-10rem\)\]{
|
|
1888
|
+
height: calc(100vh - 10rem);
|
|
1889
|
+
}
|
|
1890
|
+
|
|
1883
1891
|
.fk-h-\[calc\(100vh-3rem\)\]{
|
|
1884
1892
|
height: calc(100vh - 3rem);
|
|
1885
1893
|
}
|
|
@@ -1940,6 +1948,10 @@ body{
|
|
|
1940
1948
|
min-height: 0px;
|
|
1941
1949
|
}
|
|
1942
1950
|
|
|
1951
|
+
.fk-min-h-9{
|
|
1952
|
+
min-height: 2.25rem;
|
|
1953
|
+
}
|
|
1954
|
+
|
|
1943
1955
|
.fk-min-h-\[150px\]{
|
|
1944
1956
|
min-height: 150px;
|
|
1945
1957
|
}
|
|
@@ -1960,10 +1972,6 @@ body{
|
|
|
1960
1972
|
min-height: 80px;
|
|
1961
1973
|
}
|
|
1962
1974
|
|
|
1963
|
-
.fk-min-h-full{
|
|
1964
|
-
min-height: 100%;
|
|
1965
|
-
}
|
|
1966
|
-
|
|
1967
1975
|
.fk-w-1\.5{
|
|
1968
1976
|
width: 0.375rem;
|
|
1969
1977
|
}
|
|
@@ -2326,6 +2334,10 @@ body{
|
|
|
2326
2334
|
grid-template-columns: repeat(1, minmax(0, 1fr));
|
|
2327
2335
|
}
|
|
2328
2336
|
|
|
2337
|
+
.fk-grid-cols-\[repeat\(auto-fill\,minmax\(8rem\,1fr\)\)\]{
|
|
2338
|
+
grid-template-columns: repeat(auto-fill,minmax(8rem,1fr));
|
|
2339
|
+
}
|
|
2340
|
+
|
|
2329
2341
|
.fk-flex-row{
|
|
2330
2342
|
flex-direction: row;
|
|
2331
2343
|
}
|
|
@@ -2382,6 +2394,10 @@ body{
|
|
|
2382
2394
|
gap: 0.625rem;
|
|
2383
2395
|
}
|
|
2384
2396
|
|
|
2397
|
+
.fk-gap-3{
|
|
2398
|
+
gap: 0.75rem;
|
|
2399
|
+
}
|
|
2400
|
+
|
|
2385
2401
|
.fk-gap-4{
|
|
2386
2402
|
gap: 1rem;
|
|
2387
2403
|
}
|
|
@@ -2395,6 +2411,12 @@ body{
|
|
|
2395
2411
|
row-gap: 1.25rem;
|
|
2396
2412
|
}
|
|
2397
2413
|
|
|
2414
|
+
.-fk-space-x-2 > :not([hidden]) ~ :not([hidden]){
|
|
2415
|
+
--tw-space-x-reverse: 0;
|
|
2416
|
+
margin-right: calc(-0.5rem * var(--tw-space-x-reverse));
|
|
2417
|
+
margin-left: calc(-0.5rem * calc(1 - var(--tw-space-x-reverse)));
|
|
2418
|
+
}
|
|
2419
|
+
|
|
2398
2420
|
.fk-space-x-1 > :not([hidden]) ~ :not([hidden]){
|
|
2399
2421
|
--tw-space-x-reverse: 0;
|
|
2400
2422
|
margin-right: calc(0.25rem * var(--tw-space-x-reverse));
|
|
@@ -2437,12 +2459,6 @@ body{
|
|
|
2437
2459
|
margin-bottom: calc(0.75rem * var(--tw-space-y-reverse));
|
|
2438
2460
|
}
|
|
2439
2461
|
|
|
2440
|
-
.fk-space-y-4 > :not([hidden]) ~ :not([hidden]){
|
|
2441
|
-
--tw-space-y-reverse: 0;
|
|
2442
|
-
margin-top: calc(1rem * calc(1 - var(--tw-space-y-reverse)));
|
|
2443
|
-
margin-bottom: calc(1rem * var(--tw-space-y-reverse));
|
|
2444
|
-
}
|
|
2445
|
-
|
|
2446
2462
|
.fk-space-y-6 > :not([hidden]) ~ :not([hidden]){
|
|
2447
2463
|
--tw-space-y-reverse: 0;
|
|
2448
2464
|
margin-top: calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));
|
|
@@ -2465,10 +2481,6 @@ body{
|
|
|
2465
2481
|
overflow: visible;
|
|
2466
2482
|
}
|
|
2467
2483
|
|
|
2468
|
-
.fk-overflow-x-auto{
|
|
2469
|
-
overflow-x: auto;
|
|
2470
|
-
}
|
|
2471
|
-
|
|
2472
2484
|
.fk-overflow-y-auto{
|
|
2473
2485
|
overflow-y: auto;
|
|
2474
2486
|
}
|
|
@@ -2635,6 +2647,11 @@ body{
|
|
|
2635
2647
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity)) !important;
|
|
2636
2648
|
}
|
|
2637
2649
|
|
|
2650
|
+
.fk-bg-\[\#fafafa\]{
|
|
2651
|
+
--tw-bg-opacity: 1;
|
|
2652
|
+
background-color: rgb(250 250 250 / var(--tw-bg-opacity));
|
|
2653
|
+
}
|
|
2654
|
+
|
|
2638
2655
|
.fk-bg-accent{
|
|
2639
2656
|
background-color: hsl(var(--accent));
|
|
2640
2657
|
}
|
|
@@ -2743,6 +2760,16 @@ body{
|
|
|
2743
2760
|
background-color: transparent;
|
|
2744
2761
|
}
|
|
2745
2762
|
|
|
2763
|
+
.fk-object-contain{
|
|
2764
|
+
-o-object-fit: contain;
|
|
2765
|
+
object-fit: contain;
|
|
2766
|
+
}
|
|
2767
|
+
|
|
2768
|
+
.fk-object-cover{
|
|
2769
|
+
-o-object-fit: cover;
|
|
2770
|
+
object-fit: cover;
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2746
2773
|
.fk-object-scale-down{
|
|
2747
2774
|
-o-object-fit: scale-down;
|
|
2748
2775
|
object-fit: scale-down;
|
|
@@ -2902,6 +2929,10 @@ body{
|
|
|
2902
2929
|
padding-left: 0.75rem;
|
|
2903
2930
|
}
|
|
2904
2931
|
|
|
2932
|
+
.fk-pl-4{
|
|
2933
|
+
padding-left: 1rem;
|
|
2934
|
+
}
|
|
2935
|
+
|
|
2905
2936
|
.fk-pl-8{
|
|
2906
2937
|
padding-left: 2rem;
|
|
2907
2938
|
}
|
|
@@ -2918,6 +2949,10 @@ body{
|
|
|
2918
2949
|
padding-right: 0.5rem;
|
|
2919
2950
|
}
|
|
2920
2951
|
|
|
2952
|
+
.fk-pr-3{
|
|
2953
|
+
padding-right: 0.75rem;
|
|
2954
|
+
}
|
|
2955
|
+
|
|
2921
2956
|
.fk-pr-4{
|
|
2922
2957
|
padding-right: 1rem;
|
|
2923
2958
|
}
|
|
@@ -2926,6 +2961,10 @@ body{
|
|
|
2926
2961
|
padding-right: 1.5rem;
|
|
2927
2962
|
}
|
|
2928
2963
|
|
|
2964
|
+
.fk-pr-9{
|
|
2965
|
+
padding-right: 2.25rem;
|
|
2966
|
+
}
|
|
2967
|
+
|
|
2929
2968
|
.fk-pt-0\.5{
|
|
2930
2969
|
padding-top: 0.125rem;
|
|
2931
2970
|
}
|
|
@@ -3382,10 +3421,26 @@ body{
|
|
|
3382
3421
|
animation-timing-function: linear;
|
|
3383
3422
|
}
|
|
3384
3423
|
|
|
3424
|
+
.\[--asset-checker\:\#f0f0f0\]{
|
|
3425
|
+
--asset-checker: #f0f0f0;
|
|
3426
|
+
}
|
|
3427
|
+
|
|
3385
3428
|
.\[--cell-size\:2rem\]{
|
|
3386
3429
|
--cell-size: 2rem;
|
|
3387
3430
|
}
|
|
3388
3431
|
|
|
3432
|
+
.\[background-image\:linear-gradient\(45deg\2c var\(--asset-checker\)_25\%\2c transparent_25\%\)\2c linear-gradient\(-45deg\2c var\(--asset-checker\)_25\%\2c transparent_25\%\)\2c linear-gradient\(45deg\2c transparent_75\%\2c var\(--asset-checker\)_75\%\)\2c linear-gradient\(-45deg\2c transparent_75\%\2c var\(--asset-checker\)_75\%\)\]{
|
|
3433
|
+
background-image: linear-gradient(45deg,var(--asset-checker) 25%,transparent 25%),linear-gradient(-45deg,var(--asset-checker) 25%,transparent 25%),linear-gradient(45deg,transparent 75%,var(--asset-checker) 75%),linear-gradient(-45deg,transparent 75%,var(--asset-checker) 75%);
|
|
3434
|
+
}
|
|
3435
|
+
|
|
3436
|
+
.\[background-position\:0_0\2c 0_4px\2c 4px_-4px\2c -4px_0px\]{
|
|
3437
|
+
background-position: 0 0,0 4px,4px -4px,-4px 0px;
|
|
3438
|
+
}
|
|
3439
|
+
|
|
3440
|
+
.\[background-size\:8px_8px\]{
|
|
3441
|
+
background-size: 8px 8px;
|
|
3442
|
+
}
|
|
3443
|
+
|
|
3389
3444
|
.\[fk-animation-delay\:-0\.15s\]{
|
|
3390
3445
|
fk-animation-delay: -0.15s;
|
|
3391
3446
|
}
|
|
@@ -4595,6 +4650,11 @@ pre {
|
|
|
4595
4650
|
color: hsl(var(--sidebar-accent-foreground));
|
|
4596
4651
|
}
|
|
4597
4652
|
|
|
4653
|
+
.dark\:fk-bg-\[\#222\]:is([style="color-scheme: dark;"] *){
|
|
4654
|
+
--tw-bg-opacity: 1;
|
|
4655
|
+
background-color: rgb(34 34 34 / var(--tw-bg-opacity));
|
|
4656
|
+
}
|
|
4657
|
+
|
|
4598
4658
|
.dark\:fk-text-background:is([style="color-scheme: dark;"] *){
|
|
4599
4659
|
color: hsl(var(--background));
|
|
4600
4660
|
}
|
|
@@ -4608,6 +4668,10 @@ pre {
|
|
|
4608
4668
|
color: rgb(255 255 255 / 0.9);
|
|
4609
4669
|
}
|
|
4610
4670
|
|
|
4671
|
+
.dark\:\[--asset-checker\:\#2a2a2a\]:is([style="color-scheme: dark;"] *){
|
|
4672
|
+
--asset-checker: #2a2a2a;
|
|
4673
|
+
}
|
|
4674
|
+
|
|
4611
4675
|
.dark\:hover\:fk-bg-red-800:hover:is([style="color-scheme: dark;"] *){
|
|
4612
4676
|
--tw-bg-opacity: 1;
|
|
4613
4677
|
background-color: rgb(153 27 27 / var(--tw-bg-opacity));
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as React$1 from 'react';
|
|
2
2
|
import React__default, { Dispatch, SetStateAction, UIEvent, ReactElement } from 'react';
|
|
3
|
-
import { A as AppContextType, a as ActionSetRelationship, b as ActionSetScope, C as Config, c as AppOptions, E as Entity, P as PluginOptions, d as ProjectOptions, e as SearchRequestProps, f as SearchResultItem, U as UseEntityQueryParams, M as MappedEntityItem, F as FormEntityItem, I as ImageValue, g as Schema, h as EntityData, i as AttributeValue, j as Attribute, k as MultipleRelationshipConnection } from './types.d-
|
|
4
|
-
export { D as DataType,
|
|
3
|
+
import { A as AppContextType, a as ActionSetRelationship, b as ActionSetScope, C as Config, c as AppOptions, E as Entity, P as PluginOptions, d as ProjectOptions, O as OrderedAssetValue, e as SearchRequestProps, f as SearchResultItem, U as UseEntityQueryParams, M as MappedEntityItem, F as FormEntityItem, I as ImageValue, g as Schema, h as EntityData, i as AttributeValue, j as Attribute, k as MultipleRelationshipConnection, l as SingleRelationshipConnection } from './types.d-DLhjvcTC.js';
|
|
4
|
+
export { D as DataType, m as FormFieldParams, n as FormFieldProps, o as FormFieldValue, L as LogoProps, p as ScopeType, S as SingleProject } from './types.d-DLhjvcTC.js';
|
|
5
5
|
export { Outlet, useLocation, useParams } from 'react-router-dom';
|
|
6
|
-
import { DocumentNode, ErrorLike } from '@apollo/client';
|
|
6
|
+
import { OperationVariables, DocumentNode, ErrorLike } from '@apollo/client';
|
|
7
7
|
export { gql } from '@apollo/client';
|
|
8
8
|
import { Column, Row, ColumnDef, Table, RowSelectionState } from '@tanstack/react-table';
|
|
9
9
|
export { ColumnDef, ColumnFiltersState, Table as ReactTable, Row, RowSelectionState, SortingState, TableMeta, Updater, VisibilityState, flexRender, getCoreRowModel, getFacetedRowModel, getFacetedUniqueValues, getFilteredRowModel, getPaginationRowModel, getSortedRowModel, useReactTable } from '@tanstack/react-table';
|
|
@@ -60,13 +60,17 @@ type UploadedFileResult = {
|
|
|
60
60
|
width?: number;
|
|
61
61
|
height?: number;
|
|
62
62
|
};
|
|
63
|
+
type UploadedAssetResult = UploadedFileResult & {
|
|
64
|
+
asset: OrderedAssetValue;
|
|
65
|
+
_id: string;
|
|
66
|
+
};
|
|
63
67
|
type OpenFileDialogAndUploadOptions = {
|
|
64
68
|
projectId: string | undefined;
|
|
65
69
|
accept?: string;
|
|
66
70
|
multiple?: boolean;
|
|
67
71
|
maxBytes?: number;
|
|
68
72
|
};
|
|
69
|
-
declare function useUploadAssets(): (options: OpenFileDialogAndUploadOptions) => Promise<
|
|
73
|
+
declare function useUploadAssets(): (options: OpenFileDialogAndUploadOptions) => Promise<UploadedAssetResult[]>;
|
|
70
74
|
|
|
71
75
|
declare function ProjectDisabled(): JSX.Element;
|
|
72
76
|
|
|
@@ -113,7 +117,7 @@ type Props$1 = {
|
|
|
113
117
|
declare function DefaultValueSwitch({ scope, checked, onChange }: Props$1): JSX.Element | null;
|
|
114
118
|
|
|
115
119
|
type FetchMoreOptions = {
|
|
116
|
-
variables: {
|
|
120
|
+
variables: OperationVariables & {
|
|
117
121
|
options: {
|
|
118
122
|
offset: number;
|
|
119
123
|
limit: number;
|
|
@@ -127,6 +131,7 @@ declare function useEntityQuery({ entityNamePlural, schema, scope, variables, is
|
|
|
127
131
|
isLoading: boolean;
|
|
128
132
|
isProjectDisabled: boolean;
|
|
129
133
|
isProjectReadOnly: boolean;
|
|
134
|
+
schemaErrorMessage: string | null;
|
|
130
135
|
};
|
|
131
136
|
|
|
132
137
|
type EntityMutationResponse = [
|
|
@@ -249,8 +254,11 @@ type ActionEditRelationship = {
|
|
|
249
254
|
connectionName?: string;
|
|
250
255
|
entityId?: string;
|
|
251
256
|
entityName: string;
|
|
257
|
+
initialAssetPath?: string;
|
|
258
|
+
initialConnection?: SingleRelationshipConnection;
|
|
252
259
|
relationshipId: string;
|
|
253
260
|
mode: 'single' | 'multiple';
|
|
261
|
+
assetAccept?: string;
|
|
254
262
|
};
|
|
255
263
|
};
|
|
256
264
|
type ActionDeleteEntity = {
|