@flexkit/studio 0.0.18 → 0.0.20

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.
Files changed (124) hide show
  1. package/dist/asset-Z32MEZ7V.js +2 -0
  2. package/dist/{asset-BDEGSRVW.js.map → asset-Z32MEZ7V.js.map} +1 -1
  3. package/dist/boolean-MTD44LXP.js +2 -0
  4. package/dist/{boolean-3ZHXDPHB.js.map → boolean-MTD44LXP.js.map} +1 -1
  5. package/dist/{chunk-4PHVU7DD.js → chunk-4KGH7PU7.js} +2 -2
  6. package/dist/{chunk-4PHVU7DD.js.map → chunk-4KGH7PU7.js.map} +1 -1
  7. package/dist/chunk-53TUQIKJ.js +2 -0
  8. package/dist/chunk-53TUQIKJ.js.map +1 -0
  9. package/dist/chunk-5CKMFBWH.js +2 -0
  10. package/dist/chunk-5CKMFBWH.js.map +1 -0
  11. package/dist/{chunk-7TF7ZVID.js → chunk-6UWY5AWG.js} +2 -2
  12. package/dist/chunk-6UWY5AWG.js.map +1 -0
  13. package/dist/{chunk-EELTSHST.js → chunk-6YHHL4XI.js} +2 -2
  14. package/dist/{chunk-EELTSHST.js.map → chunk-6YHHL4XI.js.map} +1 -1
  15. package/dist/chunk-7NQ6QCJD.js +2 -0
  16. package/dist/{chunk-6PYMDKS6.js.map → chunk-7NQ6QCJD.js.map} +1 -1
  17. package/dist/chunk-7WR64NTK.js +2 -0
  18. package/dist/chunk-7WR64NTK.js.map +1 -0
  19. package/dist/chunk-CQOWWQ3H.js +2 -0
  20. package/dist/chunk-CQOWWQ3H.js.map +1 -0
  21. package/dist/chunk-D4XLXU2H.js +2 -0
  22. package/dist/{chunk-M6EIBKCQ.js.map → chunk-D4XLXU2H.js.map} +1 -1
  23. package/dist/chunk-EYGOJ2ZN.js +2 -0
  24. package/dist/chunk-EYGOJ2ZN.js.map +1 -0
  25. package/dist/chunk-FPK7J4BP.js +2 -0
  26. package/dist/chunk-FPK7J4BP.js.map +1 -0
  27. package/dist/chunk-FRXGAPDR.js +2 -0
  28. package/dist/chunk-FRXGAPDR.js.map +1 -0
  29. package/dist/{chunk-665E4UDZ.js → chunk-H6LL44JH.js} +2 -2
  30. package/dist/chunk-H6LL44JH.js.map +1 -0
  31. package/dist/chunk-HIHVCQ4Z.js +2 -0
  32. package/dist/chunk-HIHVCQ4Z.js.map +1 -0
  33. package/dist/chunk-ND3OZVR5.js +2 -0
  34. package/dist/chunk-ND3OZVR5.js.map +1 -0
  35. package/dist/chunk-O2QMYUPS.js +2 -0
  36. package/dist/{chunk-AXB7FQV2.js.map → chunk-O2QMYUPS.js.map} +1 -1
  37. package/dist/chunk-OXTER7HO.js +2 -0
  38. package/dist/chunk-OXTER7HO.js.map +1 -0
  39. package/dist/chunk-Q6R7PGTC.js +2 -0
  40. package/dist/chunk-Q6R7PGTC.js.map +1 -0
  41. package/dist/chunk-R2HNLG6B.js +2 -0
  42. package/dist/chunk-R2HNLG6B.js.map +1 -0
  43. package/dist/chunk-SW6NNU5D.js +2 -0
  44. package/dist/chunk-SW6NNU5D.js.map +1 -0
  45. package/dist/{chunk-5ES3TTSY.js → chunk-SXZZFHMJ.js} +2 -2
  46. package/dist/{chunk-5ES3TTSY.js.map → chunk-SXZZFHMJ.js.map} +1 -1
  47. package/dist/chunk-Z5CZVKD4.js +2 -0
  48. package/dist/chunk-Z5CZVKD4.js.map +1 -0
  49. package/dist/datetime-VZJ7XF33.js +2 -0
  50. package/dist/{datetime-XX4YBITU.js.map → datetime-VZJ7XF33.js.map} +1 -1
  51. package/dist/editor-NFRMIYVJ.js +2 -0
  52. package/dist/{editor-F72NJQ25.js.map → editor-NFRMIYVJ.js.map} +1 -1
  53. package/dist/index.css +5817 -4831
  54. package/dist/index.d.ts +14 -6
  55. package/dist/index.js +201 -155
  56. package/dist/index.js.map +1 -1
  57. package/dist/{logo-LB22KTDD.js → logo-GCKKZP62.js} +3 -3
  58. package/dist/logo-GCKKZP62.js.map +1 -0
  59. package/dist/project-selector-UDFHGEZI.js +2 -0
  60. package/dist/project-selector-UDFHGEZI.js.map +1 -0
  61. package/dist/search-SCKUTN4R.js +2 -0
  62. package/dist/search-SCKUTN4R.js.map +1 -0
  63. package/dist/switch-Z3MY4CZA.js +2 -0
  64. package/dist/{switch-HXXPL3GZ.js.map → switch-Z3MY4CZA.js.map} +1 -1
  65. package/dist/tanstack-start.js +2 -2
  66. package/dist/text-FIBUDNGR.js +2 -0
  67. package/dist/{text-LNFBPXBT.js.map → text-FIBUDNGR.js.map} +1 -1
  68. package/dist/text-RZOXKHWE.js +2 -0
  69. package/dist/{text-XQO4VSS3.js.map → text-RZOXKHWE.js.map} +1 -1
  70. package/dist/textarea-I2MFID7I.js +2 -0
  71. package/dist/{textarea-JDQEV6HE.js.map → textarea-I2MFID7I.js.map} +1 -1
  72. package/dist/{types.d-D7S0yibv.d.ts → types.d-B-SE1ihC.d.ts} +14 -6
  73. package/dist/ui.d.ts +158 -244
  74. package/dist/ui.js +1 -1
  75. package/dist/ui.js.map +1 -1
  76. package/dist/user-nav-MRPKTEIJ.js +2 -0
  77. package/dist/user-nav-MRPKTEIJ.js.map +1 -0
  78. package/package.json +14 -31
  79. package/dist/asset-BDEGSRVW.js +0 -2
  80. package/dist/boolean-3ZHXDPHB.js +0 -2
  81. package/dist/chunk-2RBOTHKE.js +0 -2
  82. package/dist/chunk-2RBOTHKE.js.map +0 -1
  83. package/dist/chunk-5MTVN77Y.js +0 -2
  84. package/dist/chunk-5MTVN77Y.js.map +0 -1
  85. package/dist/chunk-5VMIFTZZ.js +0 -2
  86. package/dist/chunk-5VMIFTZZ.js.map +0 -1
  87. package/dist/chunk-64KAF6GA.js +0 -2
  88. package/dist/chunk-64KAF6GA.js.map +0 -1
  89. package/dist/chunk-665E4UDZ.js.map +0 -1
  90. package/dist/chunk-6PYMDKS6.js +0 -2
  91. package/dist/chunk-7TF7ZVID.js.map +0 -1
  92. package/dist/chunk-AXB7FQV2.js +0 -2
  93. package/dist/chunk-AYKEFG4H.js +0 -2
  94. package/dist/chunk-AYKEFG4H.js.map +0 -1
  95. package/dist/chunk-K5CEPNVI.js +0 -2
  96. package/dist/chunk-K5CEPNVI.js.map +0 -1
  97. package/dist/chunk-L4ER5RUF.js +0 -2
  98. package/dist/chunk-L4ER5RUF.js.map +0 -1
  99. package/dist/chunk-M6EIBKCQ.js +0 -2
  100. package/dist/chunk-OX6FVDUT.js +0 -2
  101. package/dist/chunk-OX6FVDUT.js.map +0 -1
  102. package/dist/chunk-PHGUSZ22.js +0 -2
  103. package/dist/chunk-PHGUSZ22.js.map +0 -1
  104. package/dist/chunk-RMSYYUQM.js +0 -2
  105. package/dist/chunk-RMSYYUQM.js.map +0 -1
  106. package/dist/chunk-SPWSXOXS.js +0 -2
  107. package/dist/chunk-SPWSXOXS.js.map +0 -1
  108. package/dist/chunk-TEKVBWRU.js +0 -2
  109. package/dist/chunk-TEKVBWRU.js.map +0 -1
  110. package/dist/chunk-ZOBZU47M.js +0 -2
  111. package/dist/chunk-ZOBZU47M.js.map +0 -1
  112. package/dist/datetime-XX4YBITU.js +0 -2
  113. package/dist/editor-F72NJQ25.js +0 -2
  114. package/dist/logo-LB22KTDD.js.map +0 -1
  115. package/dist/project-selector-FWU4PAAK.js +0 -2
  116. package/dist/project-selector-FWU4PAAK.js.map +0 -1
  117. package/dist/search-IM4OTYLW.js +0 -2
  118. package/dist/search-IM4OTYLW.js.map +0 -1
  119. package/dist/switch-HXXPL3GZ.js +0 -2
  120. package/dist/text-LNFBPXBT.js +0 -2
  121. package/dist/text-XQO4VSS3.js +0 -2
  122. package/dist/textarea-JDQEV6HE.js +0 -2
  123. package/dist/user-nav-UHNUTEUZ.js +0 -2
  124. package/dist/user-nav-UHNUTEUZ.js.map +0 -1
@@ -0,0 +1,2 @@
1
+ import'./index.css';export{a as Asset}from'./chunk-Q6R7PGTC.js';import'./chunk-5CKMFBWH.js';import'./chunk-TMK5LKFR.js';import'./chunk-WIUPQHZ5.js';import'./chunk-O2QMYUPS.js';//# sourceMappingURL=asset-Z32MEZ7V.js.map
2
+ //# sourceMappingURL=asset-Z32MEZ7V.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"asset-BDEGSRVW.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"asset-Z32MEZ7V.js"}
@@ -0,0 +1,2 @@
1
+ import'./index.css';export{a as Boolean}from'./chunk-D4XLXU2H.js';//# sourceMappingURL=boolean-MTD44LXP.js.map
2
+ //# sourceMappingURL=boolean-MTD44LXP.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":[],"names":[],"mappings":"","file":"boolean-3ZHXDPHB.js"}
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"boolean-MTD44LXP.js"}
@@ -1,2 +1,2 @@
1
- import'./index.css';import {jsx}from'react/jsx-runtime';function i({value:t}){let n=typeof t=="object"||Array.isArray(t)?JSON.stringify(t):t;return n=n==="null"?"":n,jsx("div",{className:"fk-truncate",children:n})}export{i as a};//# sourceMappingURL=chunk-4PHVU7DD.js.map
2
- //# sourceMappingURL=chunk-4PHVU7DD.js.map
1
+ import'./index.css';import {jsx}from'react/jsx-runtime';function i({value:t}){let n=typeof t=="object"||Array.isArray(t)?JSON.stringify(t):t;return n=n==="null"?"":n,jsx("div",{className:"fk:truncate",children:n})}export{i as a};//# sourceMappingURL=chunk-4KGH7PU7.js.map
2
+ //# sourceMappingURL=chunk-4KGH7PU7.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/data-grid/preview-components/text.tsx"],"names":["Text","value","displayValue","jsx"],"mappings":"wDAAO,SAASA,CAAAA,CAAK,CAAE,KAAA,CAAAC,CAAM,CAAA,CAA2C,CACtE,IAAIC,CAAAA,CAAe,OAAOD,CAAAA,EAAU,QAAA,EAAY,MAAM,OAAA,CAAQA,CAAK,CAAA,CAAI,IAAA,CAAK,UAAUA,CAAK,CAAA,CAAIA,CAAAA,CAC/F,OAAAC,EAAeA,CAAAA,GAAiB,MAAA,CAAS,EAAA,CAAKA,CAAAA,CAEvCC,IAAC,KAAA,CAAA,CAAI,SAAA,CAAU,aAAA,CAAe,QAAA,CAAAD,EAAa,CACpD","file":"chunk-4PHVU7DD.js","sourcesContent":["export function Text({ value }: { value: string | object | unknown[] }) {\n let displayValue = typeof value === 'object' || Array.isArray(value) ? JSON.stringify(value) : value;\n displayValue = displayValue === 'null' ? '' : displayValue;\n\n return <div className=\"fk-truncate\">{displayValue}</div>;\n}\n"]}
1
+ {"version":3,"sources":["../src/data-grid/preview-components/text.tsx"],"names":["Text","value","displayValue","jsx"],"mappings":"wDAAO,SAASA,CAAAA,CAAK,CAAE,KAAA,CAAAC,CAAM,CAAA,CAA2C,CACtE,IAAIC,CAAAA,CAAe,OAAOD,CAAAA,EAAU,QAAA,EAAY,MAAM,OAAA,CAAQA,CAAK,CAAA,CAAI,IAAA,CAAK,UAAUA,CAAK,CAAA,CAAIA,CAAAA,CAC/F,OAAAC,EAAeA,CAAAA,GAAiB,MAAA,CAAS,EAAA,CAAKA,CAAAA,CAEvCC,IAAC,KAAA,CAAA,CAAI,SAAA,CAAU,aAAA,CAAe,QAAA,CAAAD,EAAa,CACpD","file":"chunk-4KGH7PU7.js","sourcesContent":["export function Text({ value }: { value: string | object | unknown[] }) {\n let displayValue = typeof value === 'object' || Array.isArray(value) ? JSON.stringify(value) : value;\n displayValue = displayValue === 'null' ? '' : displayValue;\n\n return <div className=\"fk:truncate\">{displayValue}</div>;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import'./index.css';import {a as a$1}from'./chunk-O2QMYUPS.js';import {Label,Slot}from'radix-ui';import {jsx}from'react/jsx-runtime';import*as a from'react';import {FormProvider,Controller,useFormContext,useFormState}from'react-hook-form';function d({className:e,...t}){return jsx(Label.Root,{"data-slot":"label",className:a$1("fk:flex fk:items-center fk:gap-2 fk:text-sm fk:leading-none fk:font-medium fk:select-none fk:group-data-[disabled=true]:pointer-events-none fk:group-data-[disabled=true]:opacity-50 fk:peer-disabled:cursor-not-allowed fk:peer-disabled:opacity-50",e),...t})}var L=FormProvider,c=a.createContext({}),N=({...e})=>jsx(c.Provider,{value:{name:e.name},children:jsx(Controller,{...e})}),l=()=>{let e=a.useContext(c),t=a.useContext(f),{getFieldState:o}=useFormContext(),r=useFormState({name:e.name}),m=o(e.name,r);if(!e)throw new Error("useFormField should be used within <FormField>");let{id:s}=t;return {id:s,name:e.name,formItemId:`${s}-form-item`,formDescriptionId:`${s}-form-item-description`,formMessageId:`${s}-form-item-message`,...m}},f=a.createContext({});function S({className:e,...t}){let o=a.useId();return jsx(f.Provider,{value:{id:o},children:jsx("div",{"data-slot":"form-item",className:a$1("fk:grid fk:gap-2",e),...t})})}function $({className:e,...t}){let{error:o,formItemId:r}=l();return jsx(d,{"data-slot":"form-label","data-error":!!o,className:a$1("fk:data-[error=true]:text-destructive",e),htmlFor:r,...t})}function w({...e}){let{error:t,formItemId:o,formDescriptionId:r,formMessageId:m}=l();return jsx(Slot.Root,{"data-slot":"form-control",id:o,"aria-describedby":t?`${r} ${m}`:`${r}`,"aria-invalid":!!t,...e})}function D({className:e,...t}){let{formDescriptionId:o}=l();return jsx("p",{"data-slot":"form-description",id:o,className:a$1("fk:text-sm fk:text-muted-foreground",e),...t})}function M({className:e,...t}){let{error:o,formMessageId:r}=l(),m=o?String(o?.message??""):t.children;return m?jsx("p",{"data-slot":"form-message",id:r,className:a$1("fk:text-sm fk:text-destructive",e),...t,children:m}):null}export{d as a,L as b,N as c,l as d,S as e,$ as f,w as g,D as h,M as i};//# sourceMappingURL=chunk-53TUQIKJ.js.map
2
+ //# sourceMappingURL=chunk-53TUQIKJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/primitives/label.tsx","../src/ui/primitives/form.tsx"],"names":["Label","className","props","jsx","LabelPrimitive","cn","Form","FormProvider","FormFieldContext","FormField","Controller","useFormField","fieldContext","itemContext","FormItemContext","getFieldState","useFormContext","formState","useFormState","fieldState","id","FormItem","FormLabel","error","formItemId","FormContro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AA,CAAc,CAAC,CAACH,CAAAA,CACf,GAAGrB,CAAAA,CACN,CAEJ,CAEA,SAAS2B,EAAgB,CAAE,SAAA,CAAA5B,EAAW,GAAGC,CAAM,EAA8B,CAC3E,GAAM,CAAE,iBAAA,CAAAwB,CAAkB,CAAA,CAAIf,CAAAA,GAE9B,OACER,GAAAA,CAAC,KACC,WAAA,CAAU,kBAAA,CACV,GAAIuB,CAAAA,CACJ,SAAA,CAAWrB,IAAG,qCAAA,CAAuCJ,CAAS,EAC7D,GAAGC,CAAAA,CACN,CAEJ,CAEA,SAAS4B,CAAAA,CAAY,CAAE,UAAA7B,CAAAA,CAAW,GAAGC,CAAM,CAAA,CAA8B,CACvE,GAAM,CAAE,KAAA,CAAAqB,EAAO,aAAA,CAAAI,CAAc,EAAIhB,CAAAA,EAAa,CACxCoB,EAAOR,CAAAA,CAAQ,MAAA,CAAOA,GAAO,OAAA,EAAW,EAAE,CAAA,CAAIrB,CAAAA,CAAM,SAE1D,OAAK6B,CAAAA,CAKH5B,IAAC,GAAA,CAAA,CACC,WAAA,CAAU,eACV,EAAA,CAAIwB,CAAAA,CACJ,UAAWtB,GAAAA,CAAG,gCAAA,CAAkCJ,CAAS,CAAA,CACxD,GAAGC,EAEH,QAAA,CAAA6B,CAAAA,CACH,EAXO,IAaX","file":"chunk-53TUQIKJ.js","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Label as LabelPrimitive } from 'radix-ui';\nimport { cn } from 'src/ui/lib/utils';\n\nfunction Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {\n return (\n <LabelPrimitive.Root\n data-slot=\"label\"\n className={cn(\n 'fk:flex fk:items-center fk:gap-2 fk:text-sm fk:leading-none fk:font-medium fk:select-none fk:group-data-[disabled=true]:pointer-events-none fk:group-data-[disabled=true]:opacity-50 fk:peer-disabled:cursor-not-allowed fk:peer-disabled:opacity-50',\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Label };\n","import * as React from 'react';\nimport { Label as LabelPrimitive, Slot } from 'radix-ui';\nimport {\n Controller,\n FormProvider,\n useFormContext,\n useFormState,\n type ControllerProps,\n type FieldPath,\n type FieldValues,\n} from 'react-hook-form';\nimport { cn } from 'src/ui/lib/utils';\nimport { Label } from 'src/ui/primitives/label';\n\nconst Form = FormProvider;\n\ntype FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = {\n name: TName;\n};\n\nconst FormFieldContext = React.createContext<FormFieldContextValue>({} as FormFieldContextValue);\n\nconst FormField = <\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({\n ...props\n}: ControllerProps<TFieldValues, TName>) => {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n};\n\nconst useFormField = () => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState } = useFormContext();\n const formState = useFormState({ name: fieldContext.name });\n const fieldState = getFieldState(fieldContext.name, formState);\n\n if (!fieldContext) {\n throw new Error('useFormField should be used within <FormField>');\n }\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `${id}-form-item`,\n formDescriptionId: `${id}-form-item-description`,\n formMessageId: `${id}-form-item-message`,\n ...fieldState,\n };\n};\n\ntype FormItemContextValue = {\n id: string;\n};\n\nconst FormItemContext = React.createContext<FormItemContextValue>({} as FormItemContextValue);\n\nfunction FormItem({ className, ...props }: React.ComponentProps<'div'>) {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div data-slot=\"form-item\" className={cn('fk:grid fk:gap-2', className)} {...props} />\n </FormItemContext.Provider>\n );\n}\n\nfunction FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>) {\n const { error, formItemId } = useFormField();\n\n return (\n <Label\n data-slot=\"form-label\"\n data-error={!!error}\n className={cn('fk:data-[error=true]:text-destructive', className)}\n htmlFor={formItemId}\n {...props}\n />\n );\n}\n\nfunction FormControl({ ...props }: React.ComponentProps<typeof Slot.Root>) {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot.Root\n data-slot=\"form-control\"\n id={formItemId}\n aria-describedby={!error ? `${formDescriptionId}` : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={!!error}\n {...props}\n />\n );\n}\n\nfunction FormDescription({ className, ...props }: React.ComponentProps<'p'>) {\n const { formDescriptionId } = useFormField();\n\n return (\n <p\n data-slot=\"form-description\"\n id={formDescriptionId}\n className={cn('fk:text-sm fk:text-muted-foreground', className)}\n {...props}\n />\n );\n}\n\nfunction FormMessage({ className, ...props }: React.ComponentProps<'p'>) {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error?.message ?? '') : props.children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p\n data-slot=\"form-message\"\n id={formMessageId}\n className={cn('fk:text-sm fk:text-destructive', className)}\n {...props}\n >\n {body}\n </p>\n );\n}\n\nexport { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField };\n"]}
@@ -0,0 +1,2 @@
1
+ import'./index.css';import {a}from'./chunk-O2QMYUPS.js';import {Tooltip}from'radix-ui';import {jsx,jsxs}from'react/jsx-runtime';function d({delayDuration:t=0,...e}){return jsx(Tooltip.Provider,{"data-slot":"tooltip-provider",delayDuration:t,...e})}function s({...t}){return jsx(Tooltip.Root,{"data-slot":"tooltip",...t})}function m({...t}){return jsx(Tooltip.Trigger,{"data-slot":"tooltip-trigger",...t})}function k({...t}){return jsx(Tooltip.Portal,{...t})}function c({className:t,sideOffset:e=0,children:n,...a$1}){return jsx(Tooltip.Portal,{children:jsxs(Tooltip.Content,{"data-slot":"tooltip-content",sideOffset:e,className:a("fk:z-50 fk:w-fit fk:origin-(--radix-tooltip-content-transform-origin) fk:animate-in fk:rounded-md fk:bg-foreground fk:px-3 fk:py-1.5 fk:text-xs fk:text-balance fk:text-background fk:fade-in-0 fk:zoom-in-95 fk:data-[side=bottom]:slide-in-from-top-2 fk:data-[side=left]:slide-in-from-right-2 fk:data-[side=right]:slide-in-from-left-2 fk:data-[side=top]:slide-in-from-bottom-2 fk:data-[state=closed]:animate-out fk:data-[state=closed]:fade-out-0 fk:data-[state=closed]:zoom-out-95",t),...a$1,children:[n,jsx(Tooltip.Arrow,{className:"fk:z-50 fk:size-2.5 fk:translate-y-[calc(-50%-2px)] fk:rotate-45 fk:rounded-[2px] fk:bg-foreground fk:fill-foreground"})]})})}export{d as a,s as b,m as c,k as d,c as e};//# sourceMappingURL=chunk-5CKMFBWH.js.map
2
+ //# sourceMappingURL=chunk-5CKMFBWH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/primitives/tooltip.tsx"],"names":["TooltipProvider","delayDuration","props","jsx","TooltipPrimitive","Tooltip","TooltipTrigger","TooltipPortal","TooltipContent","className","sideOffset","children","jsxs","cn"],"mappings":"gIAMA,SAASA,CAAAA,CAAgB,CAAE,aAAA,CAAAC,CAAAA,CAAgB,CAAA,CAAG,GAAGC,CAAM,CAAA,CAA2D,CAChH,OAAOC,GAAAA,CAACC,OAAAA,CAAiB,QAAA,CAAjB,CAA0B,WAAA,CAAU,kBAAA,CAAmB,aAAA,CAAeH,CAAAA,CAAgB,GAAGC,EAAO,CAC1G,CAEA,SAASG,CAAAA,CAAQ,CAAE,GAAGH,CAAM,CAAA,CAAuD,CACjF,OAAOC,GAAAA,CAACC,OAAAA,CAAiB,IAAA,CAAjB,CAAsB,WAAA,CAAU,SAAA,CAAW,GAAGF,CAAAA,CAAO,CAC/D,CAEA,SAASI,CAAAA,CAAe,CAAE,GAAGJ,CAAM,CAAA,CAA0D,CAC3F,OAAOC,GAAAA,CAACC,OAAAA,CAAiB,OAAA,CAAjB,CAAyB,YAAU,iBAAA,CAAmB,GAAGF,CAAAA,CAAO,CAC1E,CAEA,SAASK,CAAAA,CAAc,CAAE,GAAGL,CAAM,CAAA,CAAyD,CACzF,OAAOC,GAAAA,CAACC,OAAAA,CAAiB,MAAA,CAAjB,CAAyB,GAAGF,CAAAA,CAAO,CAC7C,CAEA,SAASM,CAAAA,CAAe,CACtB,SAAA,CAAAC,CAAAA,CACA,UAAA,CAAAC,CAAAA,CAAa,CAAA,CACb,QAAA,CAAAC,CAAAA,CACA,GAAGT,GACL,CAAA,CAA0D,CACxD,OACEC,GAAAA,CAACC,OAAAA,CAAiB,MAAA,CAAjB,CACC,QAAA,CAAAQ,IAAAA,CAACR,OAAAA,CAAiB,OAAA,CAAjB,CACC,WAAA,CAAU,iBAAA,CACV,UAAA,CAAYM,CAAAA,CACZ,SAAA,CAAWG,CAAAA,CACT,+dAAA,CACAJ,CACF,CAAA,CACC,GAAGP,GAAAA,CAEH,QAAA,CAAA,CAAAS,CAAAA,CACDR,GAAAA,CAACC,OAAAA,CAAiB,KAAA,CAAjB,CAAuB,SAAA,CAAU,uHAAA,CAAwH,CAAA,CAAA,CAC5J,EACF,CAEJ","file":"chunk-5CKMFBWH.js","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Tooltip as TooltipPrimitive } from 'radix-ui';\nimport { cn } from 'src/ui/lib/utils';\n\nfunction TooltipProvider({ delayDuration = 0, ...props }: React.ComponentProps<typeof TooltipPrimitive.Provider>) {\n return <TooltipPrimitive.Provider data-slot=\"tooltip-provider\" delayDuration={delayDuration} {...props} />;\n}\n\nfunction Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) {\n return <TooltipPrimitive.Root data-slot=\"tooltip\" {...props} />;\n}\n\nfunction TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {\n return <TooltipPrimitive.Trigger data-slot=\"tooltip-trigger\" {...props} />;\n}\n\nfunction TooltipPortal({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Portal>) {\n return <TooltipPrimitive.Portal {...props} />;\n}\n\nfunction TooltipContent({\n className,\n sideOffset = 0,\n children,\n ...props\n}: React.ComponentProps<typeof TooltipPrimitive.Content>) {\n return (\n <TooltipPrimitive.Portal>\n <TooltipPrimitive.Content\n data-slot=\"tooltip-content\"\n sideOffset={sideOffset}\n className={cn(\n 'fk:z-50 fk:w-fit fk:origin-(--radix-tooltip-content-transform-origin) fk:animate-in fk:rounded-md fk:bg-foreground fk:px-3 fk:py-1.5 fk:text-xs fk:text-balance fk:text-background fk:fade-in-0 fk:zoom-in-95 fk:data-[side=bottom]:slide-in-from-top-2 fk:data-[side=left]:slide-in-from-right-2 fk:data-[side=right]:slide-in-from-left-2 fk:data-[side=top]:slide-in-from-bottom-2 fk:data-[state=closed]:animate-out fk:data-[state=closed]:fade-out-0 fk:data-[state=closed]:zoom-out-95',\n className\n )}\n {...props}\n >\n {children}\n <TooltipPrimitive.Arrow className=\"fk:z-50 fk:size-2.5 fk:translate-y-[calc(-50%-2px)] fk:rotate-45 fk:rounded-[2px] fk:bg-foreground fk:fill-foreground\" />\n </TooltipPrimitive.Content>\n </TooltipPrimitive.Portal>\n );\n}\n\nexport { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider, TooltipPortal };\n"]}
@@ -1,2 +1,2 @@
1
- import'./index.css';import {d}from'./chunk-EELTSHST.js';import {c}from'./chunk-TMK5LKFR.js';import {createContext,useReducer,useContext}from'react';import {jsx}from'react/jsx-runtime';import $ from'swr';import {find,propEq}from'ramda';var D="core.context.scope:",x={breadcrumbs:[],isRouteLoading:false,pageTitle:"",scope:"",relationships:{}},C=createContext(x),b=createContext(()=>{});function O(t,e){let{type:o,payload:r}=e;switch(o){case "setScope":return typeof localStorage<"u"&&r.projectId&&localStorage.setItem(`${D}${r.projectId}`,r.scope),{...t,scope:r.scope};case "setRelationship":return {...t,relationships:{...t.relationships,...r}};default:throw Error(`Unknown action: ${o}`)}}function q({children:t}){let[e,o]=useReducer(O,x);return jsx(C.Provider,{value:e,children:jsx(b.Provider,{value:o,children:t})})}function I(){return useContext(C)}function K(){return useContext(b)}function B(t,e){let{scope:o}=I(),{projects:r,currentProjectId:u}=d(),{schema:s,scopes:l}=find(propEq(u??"","projectId"))(r),p=l?.find(m=>m.isDefault)?.name??"default",a=e?.commonParams.q?JSON.stringify(e):null,{data:n,error:h,isLoading:i}=$(a,()=>fetch(c(t).search,{headers:{"Content-Type":"application/json"},body:JSON.stringify(e),method:"POST",mode:"cors"}).then(m=>m.json()));return {results:J(n?.results??[],t,s,o,p)??[],error:h,isLoading:i}}function v(t){return t.find(e=>e.isPrimary)?.name??t[0]?.name}function J(t,e,o,r,u){return t?.filter(s=>s?.hits?.length>0).map(s=>{let l=s,p=l.collection.replace(`${e}_`,"").replace(/_\d+$/,""),a=find(propEq(p,"plural"))(o);if(!a)return [];let n=v(a?.attributes??[]),h=a?.name??p;return l.hits.map(({document:i})=>{let c=i[n],w=(c&&typeof c!="string"?c[r]??c[u]:null)??i[n],E=Object.entries(i).reduce((y,[d,f])=>{if(d!==n&&d!=="id"&&d!=="_updatedAt"){let T=typeof f!="string"?f[r]??f[u]:f;y[d]=T;}return y},{});return {_id:i.id,_entityName:h,_entityNamePlural:p,[n]:w,...E}})}).flat()}export{D as a,q as b,I as c,K as d,B as e};//# sourceMappingURL=chunk-7TF7ZVID.js.map
2
- //# sourceMappingURL=chunk-7TF7ZVID.js.map
1
+ import'./index.css';import {d}from'./chunk-6YHHL4XI.js';import {c}from'./chunk-TMK5LKFR.js';import {createContext,useReducer,useContext}from'react';import {jsx}from'react/jsx-runtime';import $ from'swr';import {find,propEq}from'ramda';var D="core.context.scope:",x={breadcrumbs:[],isRouteLoading:false,pageTitle:"",scope:"",relationships:{}},C=createContext(x),b=createContext(()=>{});function O(t,e){let{type:o,payload:r}=e;switch(o){case "setScope":return typeof localStorage<"u"&&r.projectId&&localStorage.setItem(`${D}${r.projectId}`,r.scope),{...t,scope:r.scope};case "setRelationship":return {...t,relationships:{...t.relationships,...r}};default:throw Error(`Unknown action: ${o}`)}}function q({children:t}){let[e,o]=useReducer(O,x);return jsx(C.Provider,{value:e,children:jsx(b.Provider,{value:o,children:t})})}function I(){return useContext(C)}function K(){return useContext(b)}function B(t,e){let{scope:o}=I(),{projects:r,currentProjectId:u}=d(),{schema:s,scopes:l}=find(propEq(u??"","projectId"))(r),p=l?.find(m=>m.isDefault)?.name??"default",a=e?.commonParams.q?JSON.stringify(e):null,{data:n,error:S,isLoading:i}=$(a,()=>fetch(c(t).search,{headers:{"Content-Type":"application/json"},body:JSON.stringify(e),method:"POST",mode:"cors"}).then(m=>m.json()));return {results:J(n?.results??[],t,s,o,p)??[],error:S,isLoading:i}}function v(t){return t.find(e=>e.isPrimary)?.name??t[0]?.name}function J(t,e,o,r,u){return t?.filter(s=>s?.hits?.length>0).map(s=>{let l=s,p=l.collection.replace(`${e}_`,"").replace(/_\d+$/,""),a=find(propEq(p,"plural"))(o);if(!a)return [];let n=v(a?.attributes??[]),S=a?.name??p;return l.hits.map(({document:i})=>{let c=i[n],w=(c&&typeof c!="string"?c[r]??c[u]:null)??i[n],E=Object.entries(i).reduce((h,[d,f])=>{if(d!==n&&d!=="id"&&d!=="_updatedAt"){let T=typeof f!="string"?f[r]??f[u]:f;h[d]=T;}return h},{});return {_id:i.id,_entityName:S,_entityNamePlural:p,[n]:w,...E}})}).flat()}export{D as a,q as b,I as c,K as d,B as e};//# sourceMappingURL=chunk-6UWY5AWG.js.map
2
+ //# sourceMappingURL=chunk-6UWY5AWG.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/core/app-context.tsx","../src/core/use-search.tsx"],"names":["SCOPE_STORAGE_KEY","initialState","AppContext","createContext","AppDispatchContext","reducer","state","action","type","payload","AppProvider","children","dispatch","useReducer","jsx","useAppContext","useContext","useAppDispatch","useSearch","projectId","searchRequest","scope","projects","currentProjectId","useConfig","schema","scopes","find","propEq","defaultScope","s","swrKey","data","error","isLoading","useSWR","apiPaths","res","mapResults","getPrimaryAttributeName","schemaAttributes","attr","results","result","item","entityNamePlural","entitySchema","primaryAttributeName","entityName","document","primary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AK,CAAA,EAAK6B,CAAAA,CAAiBrB,CAAY,CAAA,CACzD,IAAA,GACkDoB,CAAAA,CAASF,CAAoB,CAAA,CAC/EK,CAAAA,CAAa,MAAA,CAAO,OAAA,CAAQH,CAAQ,CAAA,CAAE,MAAA,CAC1C,CAACI,CAAAA,CAA0E,CAACC,EAAKC,CAAK,CAAA,GAAM,CAC1F,GAAID,CAAAA,GAAQP,CAAAA,EAAwBO,IAAQ,IAAA,EAAQA,CAAAA,GAAQ,YAAA,CAAc,CACxE,IAAME,CAAAA,CAAc,OAAOD,CAAAA,EAAU,QAAA,CAAYA,CAAAA,CAAMlC,CAAK,CAAA,EAAKkC,CAAAA,CAAM1B,CAAY,CAAA,CAAK0B,CAAAA,CAExFF,CAAAA,CAAIC,CAAG,CAAA,CAAIE,EACb,CAEA,OAAOH,CACT,CAAA,CACA,EACF,CAAA,CAEA,OAAO,CACL,GAAA,CAAKJ,CAAAA,CAAS,EAAA,CACd,WAAA,CAAaD,CAAAA,CACb,iBAAA,CAAmBH,EACnB,CAACE,CAAoB,EAAGI,CAAAA,CACxB,GAAGC,CACL,CACF,CAAC,CACH,CAAC,CAAA,CACA,IAAA,EACL","file":"chunk-6UWY5AWG.js","sourcesContent":["'use client';\n\nimport { createContext, useContext, useReducer } from 'react';\nimport type { Dispatch, JSX, ReactNode } from 'react';\nimport type { ActionSetRelationship, ActionSetScope, AppContextType } from './types';\n\nexport const SCOPE_STORAGE_KEY = 'core.context.scope:';\n\nconst initialState = {\n breadcrumbs: [],\n isRouteLoading: false,\n pageTitle: '',\n scope: '',\n relationships: {},\n};\n\nconst AppContext = createContext<AppContextType>(initialState);\n\nconst AppDispatchContext = createContext<Dispatch<ActionSetRelationship | ActionSetScope>>(() => {\n /* void */\n});\n\nfunction reducer(state: AppContextType, action: ActionSetRelationship | ActionSetScope): AppContextType {\n const { type, payload } = action;\n\n switch (type) {\n case 'setScope':\n if (typeof localStorage !== 'undefined' && payload.projectId) {\n localStorage.setItem(`${SCOPE_STORAGE_KEY}${payload.projectId}`, payload.scope);\n }\n\n return {\n ...state,\n scope: payload.scope,\n };\n case 'setRelationship':\n return {\n ...state,\n relationships: { ...state.relationships, ...payload },\n };\n default:\n throw Error(`Unknown action: ${type as string}`);\n }\n}\n\nexport function AppProvider({ children }: { children: ReactNode }): JSX.Element {\n const [state, dispatch] = useReducer(reducer, initialState);\n\n return (\n <AppContext.Provider value={state}>\n <AppDispatchContext.Provider value={dispatch}>{children}</AppDispatchContext.Provider>\n </AppContext.Provider>\n );\n}\n\nexport function useAppContext(): AppContextType {\n return useContext(AppContext);\n}\n\nexport function useAppDispatch(): Dispatch<ActionSetRelationship | ActionSetScope> {\n return useContext(AppDispatchContext);\n}\n","'use client';\n\nimport useSWR from 'swr';\nimport { find, propEq } from 'ramda';\nimport { apiPaths } from './api-paths';\nimport { useAppContext } from './app-context';\nimport { useConfig } from './config/config-context';\nimport type { SingleProject } from './config/types';\nimport type {\n Attribute,\n Entity,\n RawResultItem,\n RawSearchResultItems,\n SearchRequestProps,\n SearchResultItem,\n} from './types';\n\nexport function useSearch(\n projectId: string,\n searchRequest: SearchRequestProps | null\n): { results: SearchResultItem[] | []; error: Error; isLoading: boolean } {\n const { scope } = useAppContext();\n const { projects, currentProjectId } = useConfig();\n const { schema, scopes } = find(propEq(currentProjectId ?? '', 'projectId'))(projects) as SingleProject;\n const defaultScope = scopes?.find((s) => s.isDefault)?.name ?? 'default';\n const swrKey = searchRequest?.commonParams.q ? JSON.stringify(searchRequest) : null;\n const { data, error, isLoading } = useSWR(swrKey, () =>\n fetch(apiPaths(projectId).search, {\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(searchRequest),\n method: 'POST',\n mode: 'cors',\n }).then((res) => res.json() as Promise<{ results: RawSearchResultItems }>)\n );\n const results = mapResults(data?.results ?? [], projectId, schema, scope, defaultScope);\n\n return { results: results ?? [], error, isLoading };\n}\n\n/**\n * Find the name of the attribute of an entity with isPrimary === true.\n * The value of that attribute is returned as the value for the relationship attribute\n */\nfunction getPrimaryAttributeName(schemaAttributes: Attribute[]): string {\n return schemaAttributes.find((attr) => attr.isPrimary)?.name ?? schemaAttributes[0]?.name;\n}\n\nfunction mapResults(\n results: RawSearchResultItems | undefined,\n projectId: string,\n schema: Entity[],\n scope: string,\n defaultScope: string\n): SearchResultItem[] | undefined {\n return results\n ?.filter((result) => (result as RawResultItem)?.hits?.length > 0)\n .map((result) => {\n const item = result as RawResultItem;\n const entityNamePlural = item.collection.replace(`${projectId}_`, '').replace(/_\\d+$/, '');\n const entitySchema = find<Entity>(propEq(entityNamePlural, 'plural'))(schema);\n\n if (!entitySchema) {\n return [];\n }\n\n const primaryAttributeName = getPrimaryAttributeName(entitySchema?.attributes ?? []);\n const entityName = entitySchema?.name ?? entityNamePlural;\n\n // iterate over the hits and return an object with the primary attribute value first and then the rest of the attributes.\n return item.hits.map(({ document }) => {\n const primaryAttribute = document[primaryAttributeName];\n const scopedPrimaryAttribute =\n primaryAttribute && typeof primaryAttribute !== 'string'\n ? (primaryAttribute[scope] ?? primaryAttribute[defaultScope])\n : null;\n const primaryAttributeValue = scopedPrimaryAttribute ?? document[primaryAttributeName];\n const attributes = Object.entries(document).reduce(\n (acc: Omit<SearchResultItem, '_id' | '_entityName' | '_entityNamePlural'>, [key, value]) => {\n if (key !== primaryAttributeName && key !== 'id' && key !== '_updatedAt') {\n const scopedValue = typeof value !== 'string' ? (value[scope] ?? value[defaultScope]) : value;\n\n acc[key] = scopedValue;\n }\n\n return acc;\n },\n {}\n );\n\n return {\n _id: document.id,\n _entityName: entityName,\n _entityNamePlural: entityNamePlural,\n [primaryAttributeName]: primaryAttributeValue as string,\n ...attributes,\n };\n });\n })\n .flat();\n}\n"]}
@@ -1,2 +1,2 @@
1
- import'./index.css';import {createContext,useMemo,useContext}from'react';import {path,has}from'ramda';import {useParams}from'react-router-dom';import {jsx}from'react/jsx-runtime';var g={name:"_asset",plural:"_assets",menu:{hidden:true},attributes:[{name:"path",label:"Asset",scope:"global",options:{size:140},isEditable:true,dataType:"string",inputType:"text",previewType:"assetPreviewField",defaultValue:""},{name:"originalFilename",label:"Filename",scope:"global",options:{size:280},isEditable:true,dataType:"string",inputType:"text",previewType:"text",isPrimary:true,defaultValue:""},{name:"size",label:"Size",scope:"global",options:{size:120},isEditable:true,dataType:"int",inputType:"text",previewType:"text",defaultValue:""},{name:"width",label:"Width",scope:"global",options:{size:80},isEditable:true,dataType:"int",inputType:"text",previewType:"text",defaultValue:""},{name:"height",label:"Height",scope:"global",options:{size:80},isEditable:true,dataType:"int",inputType:"text",previewType:"text",defaultValue:""},{name:"mimeType",label:"Mime Type",scope:"global",options:{size:160},isEditable:true,dataType:"string",inputType:"text",previewType:"text",defaultValue:""},{name:"lqip",label:"lqip",scope:"global",isHidden:true,isEditable:true,dataType:"string",inputType:"text",previewType:"text",defaultValue:""},{name:"_updatedAt",label:"Last Updated",scope:"global",options:{size:140},isEditable:true,dataType:"string",inputType:"text",previewType:"text",defaultValue:""},{name:"tags",label:"Tags",scope:"relationship",dataType:"string",inputType:"relationship",defaultValue:"",previewType:"tags",options:{size:300},relationship:{mode:"multiple",field:"name",entity:"_tag"}}]};var d={name:"_tag",plural:"_tags",menu:{hidden:true},attributes:[{name:"name",label:"Tag Name",scope:"global",options:{size:220},isEditable:true,dataType:"string",inputType:"text",previewType:"text",isPrimary:true,defaultValue:""},{name:"_updatedAt",label:"Last Updated",scope:"global",options:{size:140},isEditable:true,dataType:"string",inputType:"text",previewType:"text",defaultValue:""},{name:"assets",label:"Assets",scope:"relationship",dataType:"string",inputType:"relationship",defaultValue:"",relationship:{mode:"multiple",field:"originalFilename",entity:"_asset"}}]};var T=createContext({contributions:{apps:[]},currentProjectId:void 0,currentProjectSchema:[],getContributionPointConfig:()=>[],plugins:[],projects:[]}),l=i=>Object.prototype.hasOwnProperty.call(i,"projectId"),y=i=>Object.prototype.hasOwnProperty.call(i,"contributes");function F({config:i,children:o}){let{projectId:n}=useParams(),t=useMemo(()=>{let e=s=>[...s.filter(f=>f.name!==g.name&&f.name!==d.name),g,d];return i.map(s=>({...s,schema:e(s.schema)}))},[i]),p=useMemo(()=>r(["plugins"],t),[t]),O=useMemo(()=>r(["plugins"],t.filter(e=>e.projectId===n)),[t,n]),m=p.filter(e=>!l(e)&&y(e)),u=O.filter(e=>!l(e)&&y(e)),c=useMemo(()=>({contributions:{apps:b("apps",[],u)},currentProjectId:n,currentProjectSchema:t.find(e=>e.projectId===n)?.schema??[],getContributionPointConfig:(e,s=[])=>b(e,s,u),plugins:m,projects:p.filter(e=>l(e))}),[m,n,u,p]);return jsx(T.Provider,{value:{...c,contributions:{...c.contributions,apps:c.contributions.apps}},children:o})}function R(){return useContext(T)}function r(i,o){return Array.isArray(o)?o.reduce((n,t)=>path(i,t)?[...n,t,...r(i,path(i,t)??[])]:[...n,t],[]):[o]}function b(i,o=[],n){let t=["contributes",i,...o];return r(t.flat(),n).filter(p=>has("component",p))}function N(i){let n=r(["plugins"],i).filter(t=>!l(t)&&y(t));return b("apps",[],n)}export{g as a,d as b,F as c,R as d,N as e};//# sourceMappingURL=chunk-EELTSHST.js.map
2
- //# sourceMappingURL=chunk-EELTSHST.js.map
1
+ import'./index.css';import {createContext,useMemo,useContext}from'react';import {path,has}from'ramda';import {useParams}from'react-router-dom';import {jsx}from'react/jsx-runtime';var g={name:"_asset",plural:"_assets",menu:{hidden:true},attributes:[{name:"path",label:"Asset",scope:"global",options:{size:140},isEditable:true,dataType:"string",inputType:"text",previewType:"assetPreviewField",defaultValue:""},{name:"originalFilename",label:"Filename",scope:"global",options:{size:280},isEditable:true,dataType:"string",inputType:"text",previewType:"text",isPrimary:true,defaultValue:""},{name:"size",label:"Size",scope:"global",options:{size:120},isEditable:true,dataType:"int",inputType:"text",previewType:"text",defaultValue:""},{name:"width",label:"Width",scope:"global",options:{size:80},isEditable:true,dataType:"int",inputType:"text",previewType:"text",defaultValue:""},{name:"height",label:"Height",scope:"global",options:{size:80},isEditable:true,dataType:"int",inputType:"text",previewType:"text",defaultValue:""},{name:"mimeType",label:"Mime Type",scope:"global",options:{size:160},isEditable:true,dataType:"string",inputType:"text",previewType:"text",defaultValue:""},{name:"lqip",label:"lqip",scope:"global",isHidden:true,isEditable:true,dataType:"string",inputType:"text",previewType:"text",defaultValue:""},{name:"_updatedAt",label:"Last Updated",scope:"global",options:{size:140},isEditable:true,dataType:"string",inputType:"text",previewType:"text",defaultValue:""},{name:"tags",label:"Tags",scope:"relationship",dataType:"string",inputType:"relationship",defaultValue:"",previewType:"tags",options:{size:300},relationship:{mode:"multiple",field:"name",entity:"_tag"}}]};var d={name:"_tag",plural:"_tags",menu:{hidden:true},attributes:[{name:"name",label:"Tag Name",scope:"global",options:{size:220},isEditable:true,dataType:"string",inputType:"text",previewType:"text",isPrimary:true,defaultValue:""},{name:"_updatedAt",label:"Last Updated",scope:"global",options:{size:140},isEditable:true,dataType:"string",inputType:"text",previewType:"text",defaultValue:""},{name:"assets",label:"Assets",scope:"relationship",dataType:"string",inputType:"relationship",defaultValue:"",relationship:{mode:"multiple",field:"originalFilename",entity:"_asset"}}]};var T=createContext({contributions:{apps:[]},currentProjectId:void 0,currentProjectSchema:[],getContributionPointConfig:()=>[],plugins:[],projects:[]}),l=i=>Object.prototype.hasOwnProperty.call(i,"projectId"),y=i=>Object.prototype.hasOwnProperty.call(i,"contributes");function F({config:i,children:o}){let{projectId:n}=useParams(),t=useMemo(()=>{let e=s=>[...s.filter(f=>f.name!==g.name&&f.name!==d.name),g,d];return i.map(s=>({...s,schema:e(s.schema)}))},[i]),p=useMemo(()=>r(["plugins"],t),[t]),O=useMemo(()=>r(["plugins"],t.filter(e=>e.projectId===n)),[t,n]),m=p.filter(e=>!l(e)&&y(e)),u=O.filter(e=>!l(e)&&y(e)),c=useMemo(()=>({contributions:{apps:b("apps",[],u)},currentProjectId:n,currentProjectSchema:t.find(e=>e.projectId===n)?.schema??[],getContributionPointConfig:(e,s=[])=>b(e,s,u),plugins:m,projects:p.filter(e=>l(e))}),[m,n,u,p]);return jsx(T.Provider,{value:{...c,contributions:{...c.contributions,apps:c.contributions.apps}},children:o})}function R(){return useContext(T)}function r(i,o){return Array.isArray(o)?o.reduce((n,t)=>path(i,t)?[...n,t,...r(i,path(i,t)??[])]:[...n,t],[]):[o]}function b(i,o=[],n){let t=["contributes",i,...o];return r(t.flat(),n).filter(p=>has("component",p))}function N(i){let n=r(["plugins"],i).filter(t=>!l(t)&&y(t));return b("apps",[],n)}export{g as a,d as b,F as c,R as d,N as e};//# sourceMappingURL=chunk-6YHHL4XI.js.map
2
+ //# sourceMappingURL=chunk-6YHHL4XI.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/entities/assets-schema.ts","../src/entities/tags-schema.ts","../src/core/config/config-context.tsx"],"names":["assetSchema","tagSchema","ConfigContext","createContext","hasProjectIdProperty","configItem","hasContributesProperty","ConfigProvider","config","children","currentProjectId","useParams","enhancedConfig","useMemo","upsertReservedEntities","schema","entity","project","globalFlattenedConfig","flattenConfigByProperty","currentProjectFlattenedConfig","item","allPlugins","currentProjectPlugins","globalConfig","_getContributionPointConfig","contributionPoint","subPath","jsx","useConfig","useContext","property","acc","curr","path","pathArray","has","getApps","plugins"],"mappings":"mLAEO,IAAMA,EAAsB,CACjC,IAAA,CAAM,QAAA,CACN,MAAA,CAAQ,UACR,IAAA,CAAM,CACJ,MAAA,CAAQ,IACV,EACA,UAAA,CAAY,CACV,CACE,IAAA,CAAM,MAAA,CACN,MAAO,OAAA,CACP,KAAA,CAAO,QAAA,CACP,OAAA,CAAS,CACP,IAAA,CAAM,GACR,EACA,UAAA,CAAY,IAAA,CACZ,SAAU,QAAA,CACV,SAAA,CAAW,MAAA,CACX,WAAA,CAAa,oBACb,YAAA,CAAc,EAChB,EACA,CACE,IAAA,CAAM,mBACN,KAAA,CAAO,UAAA,CACP,KAAA,CAAO,QAAA,CACP,QAAS,CACP,IAAA,CAAM,GACR,CAAA,CACA,WAAY,IAAA,CACZ,QAAA,CAAU,QAAA,CACV,SAAA,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D,CAAAA,CAAKC,EAAM,GAAGd,CAAAA,CAAwBY,CAAAA,CAAUG,IAAAA,CAAKH,EAAUE,CAAI,CAAA,EAAK,EAAE,CAAC,CAAA,CAGjF,CAAC,GAAGD,CAAAA,CAAKC,CAAI,EACnB,EAAE,CAAA,CATI,CAACzB,CAAM,CAUlB,CAEA,SAASiB,CAAAA,CACPC,CAAAA,CACAC,EAAoB,EAAC,CACrBnB,CAAAA,CACgB,CAChB,IAAM2B,CAAAA,CAAY,CAAC,cAAeT,CAAAA,CAAmB,GAAGC,CAAO,CAAA,CAE/D,OAAOR,CAAAA,CAAwBgB,CAAAA,CAAU,MAAK,CAAG3B,CAAM,EAAE,MAAA,CAAQa,CAAAA,EAASe,IAAI,WAAA,CAAaf,CAAI,CAAC,CAClG,CAEO,SAASgB,CAAAA,CAAQ7B,EAA6C,CAEnE,IAAM8B,EADkBnB,CAAAA,CAAwB,CAAC,SAAS,CAAA,CAAGX,CAAM,CAAA,CACnC,MAAA,CAC7Ba,GAAyC,CAACjB,CAAAA,CAAqBiB,CAAI,CAAA,EAAKf,CAAAA,CAAuBe,CAAI,CACtG,EACA,OAAOI,CAAAA,CAA4B,OAAQ,EAAC,CAAGa,CAAO,CACxD","file":"chunk-EELTSHST.js","sourcesContent":["import type { Entity } from '../core/types';\n\nexport const assetSchema: Entity = {\n name: '_asset',\n plural: '_assets',\n menu: {\n hidden: true,\n },\n attributes: [\n {\n name: 'path',\n label: 'Asset',\n scope: 'global',\n options: {\n size: 140,\n },\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'assetPreviewField',\n defaultValue: '',\n },\n {\n name: 'originalFilename',\n label: 'Filename',\n scope: 'global',\n options: {\n size: 280,\n },\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'text',\n isPrimary: true,\n defaultValue: '',\n },\n {\n name: 'size',\n label: 'Size',\n scope: 'global',\n options: {\n size: 120,\n },\n isEditable: true,\n dataType: 'int',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: 'width',\n label: 'Width',\n scope: 'global',\n options: {\n size: 80,\n },\n isEditable: true,\n dataType: 'int',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: 'height',\n label: 'Height',\n scope: 'global',\n options: {\n size: 80,\n },\n isEditable: true,\n dataType: 'int',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: 'mimeType',\n label: 'Mime Type',\n scope: 'global',\n options: {\n size: 160,\n },\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: 'lqip',\n label: 'lqip',\n scope: 'global',\n isHidden: true,\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: '_updatedAt',\n label: 'Last Updated',\n scope: 'global',\n options: {\n size: 140,\n },\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: 'tags',\n label: 'Tags',\n scope: 'relationship',\n dataType: 'string',\n inputType: 'relationship',\n defaultValue: '',\n previewType: 'tags',\n options: {\n size: 300,\n },\n relationship: {\n mode: 'multiple',\n field: 'name',\n entity: '_tag',\n },\n },\n ],\n};\n","import type { Entity } from '../core/types';\n\nexport const tagSchema: Entity = {\n name: '_tag',\n plural: '_tags',\n menu: {\n hidden: true,\n },\n attributes: [\n {\n name: 'name',\n label: 'Tag Name',\n scope: 'global',\n options: {\n size: 220,\n },\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'text',\n isPrimary: true,\n defaultValue: '',\n },\n {\n name: '_updatedAt',\n label: 'Last Updated',\n scope: 'global',\n options: {\n size: 140,\n },\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: 'assets',\n label: 'Assets',\n scope: 'relationship',\n dataType: 'string',\n inputType: 'relationship',\n defaultValue: '',\n relationship: {\n mode: 'multiple',\n field: 'originalFilename',\n entity: '_asset',\n },\n },\n ],\n};\n","'use client';\n\nimport { createContext, useContext, useMemo } from 'react';\nimport { has, path } from 'ramda';\nimport { useParams } from 'react-router-dom';\nimport { assetSchema } from '../../entities/assets-schema';\nimport { tagSchema } from '../../entities/tags-schema';\nimport type { AppOptions, PluginOptions, ProjectOptions } from './types';\nimport type { Entity } from '../types';\n\ntype Contributes = NonNullable<PluginOptions['contributes']>;\nexport interface ConfigContext {\n contributions: {\n apps: AppOptions[] | [];\n };\n currentProjectId?: string;\n currentProjectSchema: Entity[];\n getContributionPointConfig: <T extends keyof Contributes>(\n contributionPoint: T,\n subPath?: string[]\n ) => Contributes[T][] | [];\n plugins: PluginOptions[];\n projects: ProjectOptions[];\n}\n\nconst ConfigContext = createContext<ConfigContext>({\n contributions: {\n apps: [],\n },\n currentProjectId: undefined,\n currentProjectSchema: [],\n getContributionPointConfig: () => [],\n plugins: [] as PluginOptions[],\n projects: [] as ProjectOptions[],\n});\nconst hasProjectIdProperty = (configItem: ProjectOptions | PluginOptions): boolean =>\n Object.prototype.hasOwnProperty.call(configItem, 'projectId');\nconst hasContributesProperty = (configItem: ProjectOptions | PluginOptions): boolean =>\n Object.prototype.hasOwnProperty.call(configItem, 'contributes');\n\nexport function ConfigProvider({\n config,\n children,\n}: {\n config: ProjectOptions[];\n children: React.ReactNode;\n}): JSX.Element {\n /**\n * Getting the projectId from the URL via react-router-dom's useParams hook triggers a rerender of this Context\n * every time the URL changes.\n */\n const { projectId: currentProjectId } = useParams<{ projectId: string }>();\n const enhancedConfig = useMemo(() => {\n const upsertReservedEntities = (schema: Entity[]): Entity[] => {\n const withoutReserved = schema.filter(\n (entity) => entity.name !== assetSchema.name && entity.name !== tagSchema.name\n );\n\n return [...withoutReserved, assetSchema, tagSchema];\n };\n\n return config.map((project) => ({\n ...project,\n schema: upsertReservedEntities(project.schema),\n }));\n }, [config]);\n\n const globalFlattenedConfig = useMemo(() => flattenConfigByProperty(['plugins'], enhancedConfig), [enhancedConfig]);\n const currentProjectFlattenedConfig = useMemo(\n () =>\n flattenConfigByProperty(\n ['plugins'],\n enhancedConfig.filter((item) => item.projectId === currentProjectId)\n ),\n [enhancedConfig, currentProjectId]\n );\n const allPlugins = globalFlattenedConfig.filter(\n (item: ProjectOptions | PluginOptions) => !hasProjectIdProperty(item) && hasContributesProperty(item)\n ) as PluginOptions[];\n const currentProjectPlugins = currentProjectFlattenedConfig.filter(\n (item: ProjectOptions | PluginOptions) => !hasProjectIdProperty(item) && hasContributesProperty(item)\n ) as PluginOptions[];\n\n const globalConfig = useMemo(\n () => ({\n contributions: {\n apps: _getContributionPointConfig('apps', [], currentProjectPlugins),\n },\n currentProjectId,\n currentProjectSchema: enhancedConfig.find((item) => item.projectId === currentProjectId)?.schema ?? [],\n getContributionPointConfig: <T extends keyof Contributes>(\n contributionPoint: T,\n subPath: string[] = []\n ): Contributes[T][] =>\n _getContributionPointConfig(contributionPoint, subPath, currentProjectPlugins) as Contributes[T][],\n plugins: allPlugins,\n projects: globalFlattenedConfig.filter((item: ProjectOptions | PluginOptions) =>\n hasProjectIdProperty(item)\n ) as ProjectOptions[],\n }),\n [allPlugins, currentProjectId, currentProjectPlugins, globalFlattenedConfig]\n );\n\n return (\n <ConfigContext.Provider\n value={{\n ...globalConfig,\n contributions: {\n ...globalConfig.contributions,\n apps: globalConfig.contributions.apps as AppOptions[] | [],\n },\n }}\n >\n {children}\n </ConfigContext.Provider>\n );\n}\n\nexport function useConfig(): ConfigContext {\n return useContext(ConfigContext);\n}\n\nfunction flattenConfigByProperty(\n property: string[],\n config: (ProjectOptions | PluginOptions)[]\n): (ProjectOptions | PluginOptions)[] | [] {\n if (!Array.isArray(config)) {\n return [config];\n }\n\n return config.reduce<(ProjectOptions | PluginOptions)[]>((acc, curr) => {\n if (path(property, curr)) {\n return [...acc, curr, ...flattenConfigByProperty(property, path(property, curr) ?? [])];\n }\n\n return [...acc, curr];\n }, []);\n}\n\nfunction _getContributionPointConfig<T extends keyof Contributes>(\n contributionPoint: T,\n subPath: string[] = [],\n config: PluginOptions[]\n): Contributes[T] {\n const pathArray = ['contributes', contributionPoint, ...subPath];\n\n return flattenConfigByProperty(pathArray.flat(), config).filter((item) => has('component', item)) as Contributes[T];\n}\n\nexport function getApps(config: ProjectOptions[]): AppOptions[] | [] {\n const flattenedConfig = flattenConfigByProperty(['plugins'], config);\n const plugins = flattenedConfig.filter(\n (item: ProjectOptions | PluginOptions) => !hasProjectIdProperty(item) && hasContributesProperty(item)\n ) as PluginOptions[];\n return _getContributionPointConfig('apps', [], plugins) as AppOptions[] | [];\n}\n"]}
1
+ {"version":3,"sources":["../src/entities/assets-schema.ts","../src/entities/tags-schema.ts","../src/core/config/config-context.tsx"],"names":["assetSchema","tagSchema","ConfigContext","createContext","hasProjectIdProperty","configItem","hasContributesProperty","ConfigProvider","config","children","currentProjectId","useParams","enhancedConfig","useMemo","upsertReservedEntities","schema","entity","project","globalFlattenedConfig","flattenConfigByProperty","currentProjectFlattenedConfig","item","allPlugins","currentProjectPlugins","globalConfig","_getContributionPointConfig","contributionPoint","subPath","jsx","useConfig","useContext","property","acc","curr","path","pathArray","has","getApps","plugins"],"mappings":"mLAEO,IAAMA,EAAsB,CACjC,IAAA,CAAM,QAAA,CACN,MAAA,CAAQ,UACR,IAAA,CAAM,CACJ,MAAA,CAAQ,IACV,EACA,UAAA,CAAY,CACV,CACE,IAAA,CAAM,MAAA,CACN,MAAO,OAAA,CACP,KAAA,CAAO,QAAA,CACP,OAAA,CAAS,CACP,IAAA,CAAM,GACR,EACA,UAAA,CAAY,IAAA,CACZ,SAAU,QAAA,CACV,SAAA,CAAW,MAAA,CACX,WAAA,CAAa,oBACb,YAAA,CAAc,EAChB,EACA,CACE,IAAA,CAAM,mBACN,KAAA,CAAO,UAAA,CACP,KAAA,CAAO,QAAA,CACP,QAAS,CACP,IAAA,CAAM,GACR,CAAA,CACA,WAAY,IAAA,CACZ,QAAA,CAAU,QAAA,CACV,SAAA,CAAW,OACX,WAAA,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EAAM,GAAGd,CAAAA,CAAwBY,CAAAA,CAAUG,IAAAA,CAAKH,EAAUE,CAAI,CAAA,EAAK,EAAE,CAAC,CAAA,CAGjF,CAAC,GAAGD,CAAAA,CAAKC,CAAI,EACnB,EAAE,CAAA,CATI,CAACzB,CAAM,CAUlB,CAEA,SAASiB,CAAAA,CACPC,CAAAA,CACAC,EAAoB,EAAC,CACrBnB,CAAAA,CACgB,CAChB,IAAM2B,CAAAA,CAAY,CAAC,cAAeT,CAAAA,CAAmB,GAAGC,CAAO,CAAA,CAE/D,OAAOR,CAAAA,CAAwBgB,CAAAA,CAAU,MAAK,CAAG3B,CAAM,EAAE,MAAA,CAAQa,CAAAA,EAASe,IAAI,WAAA,CAAaf,CAAI,CAAC,CAClG,CAEO,SAASgB,CAAAA,CAAQ7B,EAA6C,CAEnE,IAAM8B,EADkBnB,CAAAA,CAAwB,CAAC,SAAS,CAAA,CAAGX,CAAM,CAAA,CACnC,MAAA,CAC7Ba,GAAyC,CAACjB,CAAAA,CAAqBiB,CAAI,CAAA,EAAKf,CAAAA,CAAuBe,CAAI,CACtG,EACA,OAAOI,CAAAA,CAA4B,OAAQ,EAAC,CAAGa,CAAO,CACxD","file":"chunk-6YHHL4XI.js","sourcesContent":["import type { Entity } from '../core/types';\n\nexport const assetSchema: Entity = {\n name: '_asset',\n plural: '_assets',\n menu: {\n hidden: true,\n },\n attributes: [\n {\n name: 'path',\n label: 'Asset',\n scope: 'global',\n options: {\n size: 140,\n },\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'assetPreviewField',\n defaultValue: '',\n },\n {\n name: 'originalFilename',\n label: 'Filename',\n scope: 'global',\n options: {\n size: 280,\n },\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'text',\n isPrimary: true,\n defaultValue: '',\n },\n {\n name: 'size',\n label: 'Size',\n scope: 'global',\n options: {\n size: 120,\n },\n isEditable: true,\n dataType: 'int',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: 'width',\n label: 'Width',\n scope: 'global',\n options: {\n size: 80,\n },\n isEditable: true,\n dataType: 'int',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: 'height',\n label: 'Height',\n scope: 'global',\n options: {\n size: 80,\n },\n isEditable: true,\n dataType: 'int',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: 'mimeType',\n label: 'Mime Type',\n scope: 'global',\n options: {\n size: 160,\n },\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: 'lqip',\n label: 'lqip',\n scope: 'global',\n isHidden: true,\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: '_updatedAt',\n label: 'Last Updated',\n scope: 'global',\n options: {\n size: 140,\n },\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: 'tags',\n label: 'Tags',\n scope: 'relationship',\n dataType: 'string',\n inputType: 'relationship',\n defaultValue: '',\n previewType: 'tags',\n options: {\n size: 300,\n },\n relationship: {\n mode: 'multiple',\n field: 'name',\n entity: '_tag',\n },\n },\n ],\n};\n","import type { Entity } from '../core/types';\n\nexport const tagSchema: Entity = {\n name: '_tag',\n plural: '_tags',\n menu: {\n hidden: true,\n },\n attributes: [\n {\n name: 'name',\n label: 'Tag Name',\n scope: 'global',\n options: {\n size: 220,\n },\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'text',\n isPrimary: true,\n defaultValue: '',\n },\n {\n name: '_updatedAt',\n label: 'Last Updated',\n scope: 'global',\n options: {\n size: 140,\n },\n isEditable: true,\n dataType: 'string',\n inputType: 'text',\n previewType: 'text',\n defaultValue: '',\n },\n {\n name: 'assets',\n label: 'Assets',\n scope: 'relationship',\n dataType: 'string',\n inputType: 'relationship',\n defaultValue: '',\n relationship: {\n mode: 'multiple',\n field: 'originalFilename',\n entity: '_asset',\n },\n },\n ],\n};\n","'use client';\n\nimport { createContext, useContext, useMemo } from 'react';\nimport type { JSX } from 'react';\nimport { has, path } from 'ramda';\nimport { useParams } from 'react-router-dom';\nimport { assetSchema } from '../../entities/assets-schema';\nimport { tagSchema } from '../../entities/tags-schema';\nimport type { AppOptions, PluginOptions, ProjectOptions } from './types';\nimport type { Entity } from '../types';\n\ntype Contributes = NonNullable<PluginOptions['contributes']>;\nexport interface ConfigContext {\n contributions: {\n apps: AppOptions[] | [];\n };\n currentProjectId?: string;\n currentProjectSchema: Entity[];\n getContributionPointConfig: <T extends keyof Contributes>(\n contributionPoint: T,\n subPath?: string[]\n ) => Contributes[T][] | [];\n plugins: PluginOptions[];\n projects: ProjectOptions[];\n}\n\nconst ConfigContext = createContext<ConfigContext>({\n contributions: {\n apps: [],\n },\n currentProjectId: undefined,\n currentProjectSchema: [],\n getContributionPointConfig: () => [],\n plugins: [] as PluginOptions[],\n projects: [] as ProjectOptions[],\n});\nconst hasProjectIdProperty = (configItem: ProjectOptions | PluginOptions): boolean =>\n Object.prototype.hasOwnProperty.call(configItem, 'projectId');\nconst hasContributesProperty = (configItem: ProjectOptions | PluginOptions): boolean =>\n Object.prototype.hasOwnProperty.call(configItem, 'contributes');\n\nexport function ConfigProvider({\n config,\n children,\n}: {\n config: ProjectOptions[];\n children: React.ReactNode;\n}): JSX.Element {\n /**\n * Getting the projectId from the URL via react-router-dom's useParams hook triggers a rerender of this Context\n * every time the URL changes.\n */\n const { projectId: currentProjectId } = useParams<{ projectId: string }>();\n const enhancedConfig = useMemo(() => {\n const upsertReservedEntities = (schema: Entity[]): Entity[] => {\n const withoutReserved = schema.filter(\n (entity) => entity.name !== assetSchema.name && entity.name !== tagSchema.name\n );\n\n return [...withoutReserved, assetSchema, tagSchema];\n };\n\n return config.map((project) => ({\n ...project,\n schema: upsertReservedEntities(project.schema),\n }));\n }, [config]);\n\n const globalFlattenedConfig = useMemo(() => flattenConfigByProperty(['plugins'], enhancedConfig), [enhancedConfig]);\n const currentProjectFlattenedConfig = useMemo(\n () =>\n flattenConfigByProperty(\n ['plugins'],\n enhancedConfig.filter((item) => item.projectId === currentProjectId)\n ),\n [enhancedConfig, currentProjectId]\n );\n const allPlugins = globalFlattenedConfig.filter(\n (item: ProjectOptions | PluginOptions) => !hasProjectIdProperty(item) && hasContributesProperty(item)\n ) as PluginOptions[];\n const currentProjectPlugins = currentProjectFlattenedConfig.filter(\n (item: ProjectOptions | PluginOptions) => !hasProjectIdProperty(item) && hasContributesProperty(item)\n ) as PluginOptions[];\n\n const globalConfig = useMemo(\n () => ({\n contributions: {\n apps: _getContributionPointConfig('apps', [], currentProjectPlugins),\n },\n currentProjectId,\n currentProjectSchema: enhancedConfig.find((item) => item.projectId === currentProjectId)?.schema ?? [],\n getContributionPointConfig: <T extends keyof Contributes>(\n contributionPoint: T,\n subPath: string[] = []\n ): Contributes[T][] =>\n _getContributionPointConfig(contributionPoint, subPath, currentProjectPlugins) as Contributes[T][],\n plugins: allPlugins,\n projects: globalFlattenedConfig.filter((item: ProjectOptions | PluginOptions) =>\n hasProjectIdProperty(item)\n ) as ProjectOptions[],\n }),\n [allPlugins, currentProjectId, currentProjectPlugins, globalFlattenedConfig]\n );\n\n return (\n <ConfigContext.Provider\n value={{\n ...globalConfig,\n contributions: {\n ...globalConfig.contributions,\n apps: globalConfig.contributions.apps as AppOptions[] | [],\n },\n }}\n >\n {children}\n </ConfigContext.Provider>\n );\n}\n\nexport function useConfig(): ConfigContext {\n return useContext(ConfigContext);\n}\n\nfunction flattenConfigByProperty(\n property: string[],\n config: (ProjectOptions | PluginOptions)[]\n): (ProjectOptions | PluginOptions)[] | [] {\n if (!Array.isArray(config)) {\n return [config];\n }\n\n return config.reduce<(ProjectOptions | PluginOptions)[]>((acc, curr) => {\n if (path(property, curr)) {\n return [...acc, curr, ...flattenConfigByProperty(property, path(property, curr) ?? [])];\n }\n\n return [...acc, curr];\n }, []);\n}\n\nfunction _getContributionPointConfig<T extends keyof Contributes>(\n contributionPoint: T,\n subPath: string[] = [],\n config: PluginOptions[]\n): Contributes[T] {\n const pathArray = ['contributes', contributionPoint, ...subPath];\n\n return flattenConfigByProperty(pathArray.flat(), config).filter((item) => has('component', item)) as Contributes[T];\n}\n\nexport function getApps(config: ProjectOptions[]): AppOptions[] | [] {\n const flattenedConfig = flattenConfigByProperty(['plugins'], config);\n const plugins = flattenedConfig.filter(\n (item: ProjectOptions | PluginOptions) => !hasProjectIdProperty(item) && hasContributesProperty(item)\n ) as PluginOptions[];\n return _getContributionPointConfig('apps', [], plugins) as AppOptions[] | [];\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import'./index.css';import {generateText}from'@tiptap/core';import {TiptapLink,TiptapImage,UploadImagesPlugin,TaskList,TaskItem,HorizontalRule,StarterKit,CodeBlockLowlight,Youtube,Twitter,Mathematics,CharacterCount,Placeholder,AIHighlight,TiptapUnderline,HighlightExtension,TextStyle,Color,CustomKeymap,GlobalDragHandle}from'novel';import {Markdown}from'tiptap-markdown';import {cx}from'class-variance-authority';import {createLowlight,common}from'lowlight';import {jsx}from'react/jsx-runtime';var C=AIHighlight,I=Placeholder,B=TiptapLink.configure({HTMLAttributes:{class:cx("fk:text-muted-foreground fk:underline fk:underline-offset-[3px] fk:hover:text-primary fk:transition-colors fk:cursor-pointer")}}),P=Markdown.configure({html:true,tightLists:true,tightListClass:"tight",bulletListMarker:"-",linkify:false,breaks:false,transformPastedText:false,transformCopiedText:false}),v=TiptapImage.extend({addProseMirrorPlugins(){return [UploadImagesPlugin({imageClass:cx("fk:opacity-40 fk:rounded-lg fk:border fk:border-stone-200")})]}}).configure({allowBase64:true,HTMLAttributes:{class:cx("fk:rounded-lg fk:border fk:border-muted")}}),z=TaskList.configure({HTMLAttributes:{class:cx("fk:not-prose fk:pl-2 ")}}),K=TaskItem.configure({HTMLAttributes:{class:cx("fk:flex gap-2 fk:items-start fk:my-2")},nested:true}),N=HorizontalRule.configure({HTMLAttributes:{class:cx("mt-4 mb-6 border-t border-muted-foreground")}}),O=StarterKit.configure({bulletList:{HTMLAttributes:{class:cx("fk:list-disc fk:list-outside fk:leading-3 fk:-mt-2")}},orderedList:{HTMLAttributes:{class:cx("fk:list-decimal fk:list-outside fk:leading-3 fk:-mt-2")}},listItem:{HTMLAttributes:{class:cx("fk:leading-normal fk:-mb-2")}},blockquote:{HTMLAttributes:{class:cx("fk:border-l-4 fk:border-primary")}},codeBlock:false,code:{HTMLAttributes:{class:cx("fk:rounded-md fk:bg-muted fk:px-1.5 fk:py-1 fk:font-mono fk:font-medium"),spellcheck:"false"}},horizontalRule:false,dropcursor:{color:"#DBEAFE",width:4},gapcursor:false}),R=CodeBlockLowlight.configure({lowlight:createLowlight(common)}),S=Youtube.configure({HTMLAttributes:{class:cx("fk:rounded-lg fk:border fk:border-muted")},inline:false}),D=Twitter.configure({HTMLAttributes:{class:cx("fk:not-prose")},inline:false}),G=Mathematics.configure({HTMLAttributes:{class:cx("fk:text-foreground fk:rounded-sm fk:p-1 fk:hover:bg-muted fk:cursor-pointer")},katexOptions:{throwOnError:false}}),U=CharacterCount.configure(),o=[O,I,B,v,z,K,N,C,R,S,D,G,U,TiptapUnderline,P,HighlightExtension,TextStyle,Color,CustomKeymap,GlobalDragHandle];var s=100;function Z({value:r}){let e;try{e=generateText(JSON.parse(r),o).substring(0,s);}catch{e=r?.substring(0,s)??"";}return jsx("div",{className:"fk:truncate",children:e})}export{o as a,Z as b};//# sourceMappingURL=chunk-7NQ6QCJD.js.map
2
+ //# sourceMappingURL=chunk-7NQ6QCJD.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/form/fields/editor/extensions.ts","../src/data-grid/preview-components/editor.tsx"],"names":["aiHighlight","AIHighlight","placeholder","Placeholder","tiptapLink","TiptapLink","cx","markdownExtension","Markdown","tiptapImage","TiptapImage","UploadImagesPlugin","taskList","TaskList","taskItem","TaskItem","horizontalRule","HorizontalRule","starterKit","StarterKit","codeBlockLowlight","CodeBlockLowlight","createLowlight","common","youtube","Youtube","twitter","Twitter","mathematics","Mathematics","characterCount","CharacterCount","defaultExtensions","TiptapUnderline","HighlightExtension","TextStyle","Color","CustomKeymap","GlobalDragHandle","MAX_LENGTH","Editor","value","textValue","generateText","jsx"],"mappings":"kfA2BMA,CAAAA,CAAcC,WAAAA,CAEdC,EAAcC,WAAAA,CACdC,CAAAA,CAAaC,WAAW,SAAA,CAAU,CACtC,eAAgB,CACd,KAAA,CAASC,GACP,8HACF,CACF,CACF,CAAC,CAAA,CAEKC,EAAoBC,QAAAA,CAAS,SAAA,CAAU,CAC3C,IAAA,CAAM,IAAA,CACN,WAAY,IAAA,CACZ,cAAA,CAAgB,QAChB,gBAAA,CAAkB,GAAA,CAClB,QAAS,KAAA,CACT,MAAA,CAAQ,KAAA,CACR,mBAAA,CAAqB,MACrB,mBAAA,CAAqB,KACvB,CAAC,CAAA,CAEKC,CAAAA,CAAcC,YAAY,MAAA,CAAO,CACrC,uBAAwB,CACtB,OAAO,CACLC,kBAAAA,CAAmB,CACjB,WAAYL,EAAAA,CAAG,2DAA2D,CAC5E,CAAC,CACH,CACF,CACF,CAAC,EAAE,SAAA,CAAU,CACX,YAAa,IAAA,CACb,cAAA,CAAgB,CACd,KAAA,CAAOA,EAAAA,CAAG,yCAAyC,CACrD,CACF,CAAC,CAAA,CAEKM,CAAAA,CAAWC,SAAS,SAAA,CAAU,CAClC,eAAgB,CACd,KAAA,CAAOP,GAAG,uBAAuB,CACnC,CACF,CAAC,CAAA,CACKQ,EAAWC,QAAAA,CAAS,SAAA,CAAU,CAClC,cAAA,CAAgB,CACd,MAAST,EAAAA,CAAG,sCAAsC,CACpD,CAAA,CACA,MAAA,CAAQ,IACV,CAAC,CAAA,CAEKU,EAAiBC,cAAAA,CAAe,SAAA,CAAU,CAC9C,cAAA,CAAgB,CACd,MAASX,EAAAA,CAAG,4CAA4C,CAC1D,CACF,CAAC,EAEKY,CAAAA,CAAaC,UAAAA,CAAW,UAAU,CACtC,UAAA,CAAY,CACV,cAA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AE,CAAAA,CACAE,EACAG,eAAAA,CACA1B,CAAAA,CACA2B,mBACAC,SAAAA,CACAC,KAAAA,CACAC,aACAC,gBACF,ECtKA,IAAMC,CAAAA,CAAa,GAAA,CAKZ,SAASC,CAAAA,CAAO,CAAE,MAAAC,CAAM,CAAA,CAAsB,CACnD,IAAIC,CAAAA,CAEJ,GAAI,CACFA,CAAAA,CAAYC,aAAa,IAAA,CAAK,KAAA,CAAMF,CAAK,CAAA,CAAGT,CAA+B,EAAE,SAAA,CAAU,CAAA,CAAGO,CAAU,EACtG,CAAA,KAAQ,CACNG,CAAAA,CAAYD,CAAAA,EAAO,UAAU,CAAA,CAAGF,CAAU,GAAK,GACjD,CAEA,OAAOK,GAAAA,CAAC,KAAA,CAAA,CAAI,UAAU,aAAA,CAAe,QAAA,CAAAF,EAAU,CACjD","file":"chunk-6PYMDKS6.js","sourcesContent":["import {\n AIHighlight,\n CharacterCount,\n CodeBlockLowlight,\n Color,\n CustomKeymap,\n GlobalDragHandle,\n HighlightExtension,\n HorizontalRule,\n Placeholder,\n StarterKit,\n TaskItem,\n TaskList,\n TextStyle,\n TiptapImage,\n TiptapLink,\n TiptapUnderline,\n Twitter,\n Youtube,\n Mathematics,\n UploadImagesPlugin,\n} from 'novel';\nimport { Markdown } from 'tiptap-markdown';\nimport { cx } from 'class-variance-authority';\nimport { common, createLowlight } from 'lowlight';\n\n//TODO I am using cx here to get tailwind autocomplete working, idk if someone else can write a regex to just capture the class key in objects\nconst aiHighlight = AIHighlight;\n//You can overwrite the placeholder with your own configuration\nconst placeholder = Placeholder;\nconst tiptapLink = TiptapLink.configure({\n HTMLAttributes: {\n 'class': cx(\n 'fk-text-muted-foreground fk-underline fk-underline-offset-[3px] hover:fk-text-primary fk-transition-colors fk-cursor-pointer'\n ),\n },\n});\n\nconst markdownExtension = Markdown.configure({\n html: true,\n tightLists: true,\n tightListClass: 'tight',\n bulletListMarker: '-',\n linkify: false,\n breaks: false,\n transformPastedText: false,\n transformCopiedText: false,\n});\n\nconst tiptapImage = TiptapImage.extend({\n addProseMirrorPlugins() {\n return [\n UploadImagesPlugin({\n imageClass: cx('fk-opacity-40 fk-rounded-lg fk-border fk-border-stone-200'),\n }),\n ];\n },\n}).configure({\n allowBase64: true,\n HTMLAttributes: {\n class: cx('fk-rounded-lg fk-border fk-border-muted'),\n },\n});\n\nconst taskList = TaskList.configure({\n HTMLAttributes: {\n class: cx('fk-not-prose fk-pl-2 '),\n },\n});\nconst taskItem = TaskItem.configure({\n HTMLAttributes: {\n 'class': cx('fk-flex gap-2 fk-items-start fk-my-2'),\n },\n nested: true,\n});\n\nconst horizontalRule = HorizontalRule.configure({\n HTMLAttributes: {\n 'class': cx('mt-4 mb-6 border-t border-muted-foreground'),\n },\n});\n\nconst starterKit = StarterKit.configure({\n bulletList: {\n HTMLAttributes: {\n 'class': cx('fk-list-disc fk-list-outside fk-leading-3 -fk-mt-2'),\n },\n },\n orderedList: {\n HTMLAttributes: {\n 'class': cx('fk-list-decimal fk-list-outside fk-leading-3 -fk-mt-2'),\n },\n },\n listItem: {\n HTMLAttributes: {\n 'class': cx('fk-leading-normal -fk-mb-2'),\n },\n },\n blockquote: {\n HTMLAttributes: {\n 'class': cx('fk-border-l-4 fk-border-primary'),\n },\n },\n codeBlock: false,\n code: {\n HTMLAttributes: {\n 'class': cx('fk-rounded-md fk-bg-muted fk-px-1.5 fk-py-1 fk-font-mono fk-font-medium'),\n spellcheck: 'false',\n },\n },\n horizontalRule: false,\n dropcursor: {\n color: '#DBEAFE',\n width: 4,\n },\n gapcursor: false,\n});\n\nconst codeBlockLowlight = CodeBlockLowlight.configure({\n // configure lowlight: common / all / use highlightJS in case there is a need to specify certain language grammars only\n // common: covers 37 language grammars which should be good enough in most cases\n lowlight: createLowlight(common),\n});\n\nconst youtube = Youtube.configure({\n HTMLAttributes: {\n 'class': cx('fk-rounded-lg fk-border fk-border-muted'),\n },\n inline: false,\n});\n\nconst twitter = Twitter.configure({\n HTMLAttributes: {\n 'class': cx('fk-not-prose'),\n },\n inline: false,\n});\n\nconst mathematics = Mathematics.configure({\n HTMLAttributes: {\n 'class': cx('fk-text-foreground fk-rounded fk-p-1 hover:fk-bg-muted fk-cursor-pointer'),\n },\n katexOptions: {\n throwOnError: false,\n },\n});\n\nconst characterCount = CharacterCount.configure();\n\nexport const defaultExtensions: readonly unknown[] = [\n starterKit,\n placeholder,\n tiptapLink,\n tiptapImage,\n taskList,\n taskItem,\n horizontalRule,\n aiHighlight,\n codeBlockLowlight,\n youtube,\n twitter,\n mathematics,\n characterCount,\n TiptapUnderline,\n markdownExtension,\n HighlightExtension,\n TextStyle,\n Color,\n CustomKeymap,\n GlobalDragHandle,\n];\n","import { generateText } from '@tiptap/core';\nimport { defaultExtensions } from '../../form/fields/editor/extensions';\nimport { Extensions } from '@tiptap/core';\n\nconst MAX_LENGTH = 100;\n\n/**\n * Renders a preview of the editor content.\n */\nexport function Editor({ value }: { value: string }) {\n let textValue;\n\n try {\n textValue = generateText(JSON.parse(value), defaultExtensions as Extensions).substring(0, MAX_LENGTH);\n } catch {\n textValue = value?.substring(0, MAX_LENGTH) ?? '';\n }\n\n return <div className=\"fk-truncate\">{textValue}</div>;\n}\n"]}
1
+ {"version":3,"sources":["../src/form/fields/editor/extensions.ts","../src/data-grid/preview-components/editor.tsx"],"names":["aiHighlight","AIHighlight","placeholder","Placeholder","tiptapLink","TiptapLink","cx","markdownExtension","Markdown","tiptapImage","TiptapImage","UploadImagesPlugin","taskList","TaskList","taskItem","TaskItem","horizontalRule","HorizontalRule","starterKit","StarterKit","codeBlockLowlight","CodeBlockLowlight","createLowlight","common","youtube","Youtube","twitter","Twitter","mathematics","Mathematics","characterCount","CharacterCount","defaultExtensions","TiptapUnderline","HighlightExtension","TextStyle","Color","CustomKeymap","GlobalDragHandle","MAX_LENGTH","Editor","value","textValue","generateText","jsx"],"mappings":"kfA2BMA,CAAAA,CAAcC,WAAAA,CAEdC,EAAcC,WAAAA,CACdC,CAAAA,CAAaC,WAAW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,CAAAA,CAAYC,aAAa,IAAA,CAAK,KAAA,CAAMF,CAAK,CAAA,CAAGT,CAA+B,EAAE,SAAA,CAAU,CAAA,CAAGO,CAAU,EACtG,CAAA,KAAQ,CACNG,CAAAA,CAAYD,CAAAA,EAAO,UAAU,CAAA,CAAGF,CAAU,GAAK,GACjD,CAEA,OAAOK,GAAAA,CAAC,KAAA,CAAA,CAAI,UAAU,aAAA,CAAe,QAAA,CAAAF,EAAU,CACjD","file":"chunk-7NQ6QCJD.js","sourcesContent":["import {\n AIHighlight,\n CharacterCount,\n CodeBlockLowlight,\n Color,\n CustomKeymap,\n GlobalDragHandle,\n HighlightExtension,\n HorizontalRule,\n Placeholder,\n StarterKit,\n TaskItem,\n TaskList,\n TextStyle,\n TiptapImage,\n TiptapLink,\n TiptapUnderline,\n Twitter,\n Youtube,\n Mathematics,\n UploadImagesPlugin,\n} from 'novel';\nimport { Markdown } from 'tiptap-markdown';\nimport { cx } from 'class-variance-authority';\nimport { common, createLowlight } from 'lowlight';\n\n//TODO I am using cx here to get tailwind autocomplete working, idk if someone else can write a regex to just capture the class key in objects\nconst aiHighlight = AIHighlight;\n//You can overwrite the placeholder with your own configuration\nconst placeholder = Placeholder;\nconst tiptapLink = TiptapLink.configure({\n HTMLAttributes: {\n 'class': cx(\n 'fk:text-muted-foreground fk:underline fk:underline-offset-[3px] fk:hover:text-primary fk:transition-colors fk:cursor-pointer'\n ),\n },\n});\n\nconst markdownExtension = Markdown.configure({\n html: true,\n tightLists: true,\n tightListClass: 'tight',\n bulletListMarker: '-',\n linkify: false,\n breaks: false,\n transformPastedText: false,\n transformCopiedText: false,\n});\n\nconst tiptapImage = TiptapImage.extend({\n addProseMirrorPlugins() {\n return [\n UploadImagesPlugin({\n imageClass: cx('fk:opacity-40 fk:rounded-lg fk:border fk:border-stone-200'),\n }),\n ];\n },\n}).configure({\n allowBase64: true,\n HTMLAttributes: {\n class: cx('fk:rounded-lg fk:border fk:border-muted'),\n },\n});\n\nconst taskList = TaskList.configure({\n HTMLAttributes: {\n class: cx('fk:not-prose fk:pl-2 '),\n },\n});\nconst taskItem = TaskItem.configure({\n HTMLAttributes: {\n 'class': cx('fk:flex gap-2 fk:items-start fk:my-2'),\n },\n nested: true,\n});\n\nconst horizontalRule = HorizontalRule.configure({\n HTMLAttributes: {\n 'class': cx('mt-4 mb-6 border-t border-muted-foreground'),\n },\n});\n\nconst starterKit = StarterKit.configure({\n bulletList: {\n HTMLAttributes: {\n 'class': cx('fk:list-disc fk:list-outside fk:leading-3 fk:-mt-2'),\n },\n },\n orderedList: {\n HTMLAttributes: {\n 'class': cx('fk:list-decimal fk:list-outside fk:leading-3 fk:-mt-2'),\n },\n },\n listItem: {\n HTMLAttributes: {\n 'class': cx('fk:leading-normal fk:-mb-2'),\n },\n },\n blockquote: {\n HTMLAttributes: {\n 'class': cx('fk:border-l-4 fk:border-primary'),\n },\n },\n codeBlock: false,\n code: {\n HTMLAttributes: {\n 'class': cx('fk:rounded-md fk:bg-muted fk:px-1.5 fk:py-1 fk:font-mono fk:font-medium'),\n spellcheck: 'false',\n },\n },\n horizontalRule: false,\n dropcursor: {\n color: '#DBEAFE',\n width: 4,\n },\n gapcursor: false,\n});\n\nconst codeBlockLowlight = CodeBlockLowlight.configure({\n // configure lowlight: common / all / use highlightJS in case there is a need to specify certain language grammars only\n // common: covers 37 language grammars which should be good enough in most cases\n lowlight: createLowlight(common),\n});\n\nconst youtube = Youtube.configure({\n HTMLAttributes: {\n 'class': cx('fk:rounded-lg fk:border fk:border-muted'),\n },\n inline: false,\n});\n\nconst twitter = Twitter.configure({\n HTMLAttributes: {\n 'class': cx('fk:not-prose'),\n },\n inline: false,\n});\n\nconst mathematics = Mathematics.configure({\n HTMLAttributes: {\n 'class': cx('fk:text-foreground fk:rounded-sm fk:p-1 fk:hover:bg-muted fk:cursor-pointer'),\n },\n katexOptions: {\n throwOnError: false,\n },\n});\n\nconst characterCount = CharacterCount.configure();\n\nexport const defaultExtensions: readonly unknown[] = [\n starterKit,\n placeholder,\n tiptapLink,\n tiptapImage,\n taskList,\n taskItem,\n horizontalRule,\n aiHighlight,\n codeBlockLowlight,\n youtube,\n twitter,\n mathematics,\n characterCount,\n TiptapUnderline,\n markdownExtension,\n HighlightExtension,\n TextStyle,\n Color,\n CustomKeymap,\n GlobalDragHandle,\n];\n","import { generateText } from '@tiptap/core';\nimport { defaultExtensions } from '../../form/fields/editor/extensions';\nimport { Extensions } from '@tiptap/core';\n\nconst MAX_LENGTH = 100;\n\n/**\n * Renders a preview of the editor content.\n */\nexport function Editor({ value }: { value: string }) {\n let textValue;\n\n try {\n textValue = generateText(JSON.parse(value), defaultExtensions as Extensions).substring(0, MAX_LENGTH);\n } catch {\n textValue = value?.substring(0, MAX_LENGTH) ?? '';\n }\n\n return <div className=\"fk:truncate\">{textValue}</div>;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import'./index.css';import {a}from'./chunk-O2QMYUPS.js';import {Select}from'radix-ui';import {ChevronDownIcon,CheckIcon,ChevronUpIcon}from'lucide-react';import {jsx,jsxs}from'react/jsx-runtime';function g({...e}){return jsx(Select.Root,{"data-slot":"select",...e})}function S({...e}){return jsx(Select.Group,{"data-slot":"select-group",...e})}function x({...e}){return jsx(Select.Value,{"data-slot":"select-value",...e})}function P({className:e,size:a$1="default",children:r,...s}){return jsxs(Select.Trigger,{"data-slot":"select-trigger","data-size":a$1,className:a("fk:flex fk:w-fit fk:items-center fk:justify-between fk:gap-2 fk:rounded-md fk:border fk:border-input fk:bg-background fk:px-3 fk:py-2 fk:text-sm fk:whitespace-nowrap fk:shadow-xs fk:transition-[color,box-shadow] fk:outline-none fk:focus-visible:border-ring fk:focus-visible:ring-[3px] fk:focus-visible:ring-ring/50 fk:disabled:cursor-not-allowed fk:disabled:opacity-50 fk:aria-invalid:border-destructive fk:aria-invalid:ring-destructive/20 fk:data-placeholder:text-muted-foreground fk:data-[size=default]:h-9 fk:data-[size=sm]:h-8 fk:*:data-[slot=select-value]:line-clamp-1 fk:*:data-[slot=select-value]:flex fk:*:data-[slot=select-value]:items-center fk:*:data-[slot=select-value]:gap-2 fk:hover:bg-accent fk:dark:aria-invalid:ring-destructive/40 fk:*[_svg]:pointer-events-none fk:*[_svg]:shrink-0 fk:*[_svg:not([class*='size-'])]:size-4 fk:*[_svg:not([class*='text-'])]:text-muted-foreground",e),...s,children:[r,jsx(Select.Icon,{asChild:true,children:jsx(ChevronDownIcon,{className:"fk:size-4 fk:opacity-50"})})]})}function b({className:e,children:a$1,position:r="item-aligned",align:s="center",...f}){return jsx(Select.Portal,{children:jsxs(Select.Content,{"data-slot":"select-content",className:a("fk:relative fk:z-50 fk:max-h-(--radix-select-content-available-height) fk:min-w-[8rem] fk:origin-(--radix-select-content-transform-origin) fk:overflow-x-hidden fk:overflow-y-auto fk:rounded-md fk:border fk:bg-popover fk:text-popover-foreground fk:shadow-md fk:data-[side=bottom]:slide-in-from-top-2 fk:data-[side=left]:slide-in-from-right-2 fk:data-[side=right]:slide-in-from-left-2 fk:data-[side=top]:slide-in-from-bottom-2 fk:data-[state=closed]:animate-out fk:data-[state=closed]:fade-out-0 fk:data-[state=closed]:zoom-out-95 fk:data-[state=open]:animate-in fk:data-[state=open]:fade-in-0 fk:data-[state=open]:zoom-in-95",r==="popper"&&"fk:data-[side=bottom]:translate-y-1 fk:data-[side=left]:-translate-x-1 fk:data-[side=right]:translate-x-1 fk:data-[side=top]:-translate-y-1",e),position:r,align:s,...f,children:[jsx(d,{}),jsx(Select.Viewport,{className:a("fk:p-1",r==="popper"&&"fk:h-(--radix-select-trigger-height) fk:w-full fk:min-w-(--radix-select-trigger-width) fk:scroll-my-1"),children:a$1}),jsx(m,{})]})})}function h({className:e,...a$1}){return jsx(Select.Label,{"data-slot":"select-label",className:a("fk:px-2 fk:py-1.5 fk:text-xs fk:text-muted-foreground",e),...a$1})}function y({className:e,children:a$1,...r}){return jsxs(Select.Item,{"data-slot":"select-item",className:a("fk:relative fk:flex fk:w-full fk:cursor-default fk:items-center fk:gap-2 fk:rounded-sm fk:py-1.5 fk:pr-8 fk:pl-2 fk:text-sm fk:outline-hidden fk:select-none fk:focus:bg-accent fk:focus:text-accent-foreground fk:data-[disabled]:pointer-events-none fk:data-[disabled]:opacity-50 fk:*[_svg]:pointer-events-none fk:*[_svg]:shrink-0 fk:*[_svg:not([class*='size-'])]:size-4 fk:*[_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",e),...r,children:[jsx("span",{"data-slot":"select-item-indicator",className:"fk:absolute fk:right-2 fk:flex fk:size-3.5 fk:items-center fk:justify-center",children:jsx(Select.ItemIndicator,{children:jsx(CheckIcon,{className:"fk:size-4"})})}),jsx(Select.ItemText,{children:a$1})]})}function w({className:e,...a$1}){return jsx(Select.Separator,{"data-slot":"select-separator",className:a("fk:pointer-events-none fk:-mx-1 fk:my-1 fk:h-px fk:bg-border",e),...a$1})}function d({className:e,...a$1}){return jsx(Select.ScrollUpButton,{"data-slot":"select-scroll-up-button",className:a("fk:flex fk:cursor-default fk:items-center fk:justify-center fk:py-1",e),...a$1,children:jsx(ChevronUpIcon,{className:"size-4"})})}function m({className:e,...a$1}){return jsx(Select.ScrollDownButton,{"data-slot":"select-scroll-down-button",className:a("fk:flex fk:cursor-default fk:items-center fk:justify-center fk:py-1",e),...a$1,children:jsx(ChevronDownIcon,{className:"size-4"})})}export{g as a,S as b,x as c,P as d,b as e,h as f,y as g,w as h,d as i,m as j};//# sourceMappingURL=chunk-7WR64NTK.js.map
2
+ //# sourceMappingURL=chunk-7WR64NTK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/primitives/select.tsx"],"names":["Select","props","jsx","SelectPrimitive","SelectGroup","SelectValue","SelectTrigger","className","size","children","jsxs","cn","ChevronDownIcon","SelectContent","position","align","SelectScrollUpButton","SelectScrollDownButton","SelectLabel","SelectItem","CheckIcon","SelectSeparator","ChevronUpIcon"],"mappings":"kMAOA,SAASA,EAAO,CAAE,GAA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,GAAAA,CAACC,MAAAA,CAAgB,UAAhB,CACC,WAAA,CAAU,mBACV,SAAA,CAAWQ,CAAAA,CAAG,+DAAgEJ,CAAS,CAAA,CACtF,GAAGN,GAAAA,CACN,CAEJ,CAEA,SAASe,EAAqB,CAAE,SAAA,CAAAT,EAAW,GAAGN,GAAM,EAAgE,CAClH,OACEC,IAACC,MAAAA,CAAgB,cAAA,CAAhB,CACC,WAAA,CAAU,yBAAA,CACV,UAAWQ,CAAAA,CAAG,qEAAA,CAAuEJ,CAAS,CAAA,CAC7F,GAAGN,GAAAA,CAEJ,QAAA,CAAAC,IAACoB,aAAAA,CAAA,CAAc,UAAU,QAAA,CAAS,CAAA,CACpC,CAEJ,CAEA,SAASL,CAAAA,CAAuB,CAC9B,UAAAV,CAAAA,CACA,GAAGN,GACL,CAAA,CAAkE,CAChE,OACEC,GAAAA,CAACC,OAAgB,gBAAA,CAAhB,CACC,YAAU,2BAAA,CACV,SAAA,CAAWQ,EAAG,qEAAA,CAAuEJ,CAAS,EAC7F,GAAGN,GAAAA,CAEJ,SAAAC,GAAAA,CAACU,eAAAA,CAAA,CAAgB,SAAA,CAAU,QAAA,CAAS,EACtC,CAEJ","file":"chunk-7WR64NTK.js","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Select as SelectPrimitive } from 'radix-ui';\nimport { CheckIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react';\nimport { cn } from 'src/ui/lib/utils';\n\nfunction Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />;\n}\n\nfunction SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>) {\n return <SelectPrimitive.Group data-slot=\"select-group\" {...props} />;\n}\n\nfunction SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} />;\n}\n\nfunction SelectTrigger({\n className,\n size = 'default',\n children,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {\n size?: 'sm' | 'default';\n}) {\n return (\n <SelectPrimitive.Trigger\n data-slot=\"select-trigger\"\n data-size={size}\n className={cn(\n \"fk:flex fk:w-fit fk:items-center fk:justify-between fk:gap-2 fk:rounded-md fk:border fk:border-input fk:bg-background fk:px-3 fk:py-2 fk:text-sm fk:whitespace-nowrap fk:shadow-xs fk:transition-[color,box-shadow] fk:outline-none fk:focus-visible:border-ring fk:focus-visible:ring-[3px] fk:focus-visible:ring-ring/50 fk:disabled:cursor-not-allowed fk:disabled:opacity-50 fk:aria-invalid:border-destructive fk:aria-invalid:ring-destructive/20 fk:data-placeholder:text-muted-foreground fk:data-[size=default]:h-9 fk:data-[size=sm]:h-8 fk:*:data-[slot=select-value]:line-clamp-1 fk:*:data-[slot=select-value]:flex fk:*:data-[slot=select-value]:items-center fk:*:data-[slot=select-value]:gap-2 fk:hover:bg-accent fk:dark:aria-invalid:ring-destructive/40 fk:*[_svg]:pointer-events-none fk:*[_svg]:shrink-0 fk:*[_svg:not([class*='size-'])]:size-4 fk:*[_svg:not([class*='text-'])]:text-muted-foreground\",\n className\n )}\n {...props}\n >\n {children}\n <SelectPrimitive.Icon asChild>\n <ChevronDownIcon className=\"fk:size-4 fk:opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n );\n}\n\nfunction SelectContent({\n className,\n children,\n position = 'item-aligned',\n align = 'center',\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.Content>) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Content\n data-slot=\"select-content\"\n className={cn(\n 'fk:relative fk:z-50 fk:max-h-(--radix-select-content-available-height) fk:min-w-[8rem] fk:origin-(--radix-select-content-transform-origin) fk:overflow-x-hidden fk:overflow-y-auto fk:rounded-md fk:border fk:bg-popover fk:text-popover-foreground fk:shadow-md fk:data-[side=bottom]:slide-in-from-top-2 fk:data-[side=left]:slide-in-from-right-2 fk:data-[side=right]:slide-in-from-left-2 fk:data-[side=top]:slide-in-from-bottom-2 fk:data-[state=closed]:animate-out fk:data-[state=closed]:fade-out-0 fk:data-[state=closed]:zoom-out-95 fk:data-[state=open]:animate-in fk:data-[state=open]:fade-in-0 fk:data-[state=open]:zoom-in-95',\n position === 'popper' &&\n 'fk:data-[side=bottom]:translate-y-1 fk:data-[side=left]:-translate-x-1 fk:data-[side=right]:translate-x-1 fk:data-[side=top]:-translate-y-1',\n className\n )}\n position={position}\n align={align}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'fk:p-1',\n position === 'popper' &&\n 'fk:h-(--radix-select-trigger-height) fk:w-full fk:min-w-(--radix-select-trigger-width) fk:scroll-my-1'\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n );\n}\n\nfunction SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>) {\n return (\n <SelectPrimitive.Label\n data-slot=\"select-label\"\n className={cn('fk:px-2 fk:py-1.5 fk:text-xs fk:text-muted-foreground', className)}\n {...props}\n />\n );\n}\n\nfunction SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={cn(\n \"fk:relative fk:flex fk:w-full fk:cursor-default fk:items-center fk:gap-2 fk:rounded-sm fk:py-1.5 fk:pr-8 fk:pl-2 fk:text-sm fk:outline-hidden fk:select-none fk:focus:bg-accent fk:focus:text-accent-foreground fk:data-[disabled]:pointer-events-none fk:data-[disabled]:opacity-50 fk:*[_svg]:pointer-events-none fk:*[_svg]:shrink-0 fk:*[_svg:not([class*='size-'])]:size-4 fk:*[_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2\",\n className\n )}\n {...props}\n >\n <span\n data-slot=\"select-item-indicator\"\n className=\"fk:absolute fk:right-2 fk:flex fk:size-3.5 fk:items-center fk:justify-center\"\n >\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"fk:size-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n );\n}\n\nfunction SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={cn('fk:pointer-events-none fk:-mx-1 fk:my-1 fk:h-px fk:bg-border', className)}\n {...props}\n />\n );\n}\n\nfunction SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {\n return (\n <SelectPrimitive.ScrollUpButton\n data-slot=\"select-scroll-up-button\"\n className={cn('fk:flex fk:cursor-default fk:items-center fk:justify-center fk:py-1', className)}\n {...props}\n >\n <ChevronUpIcon className=\"size-4\" />\n </SelectPrimitive.ScrollUpButton>\n );\n}\n\nfunction SelectScrollDownButton({\n className,\n ...props\n}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {\n return (\n <SelectPrimitive.ScrollDownButton\n data-slot=\"select-scroll-down-button\"\n className={cn('fk:flex fk:cursor-default fk:items-center fk:justify-center fk:py-1', className)}\n {...props}\n >\n <ChevronDownIcon className=\"size-4\" />\n </SelectPrimitive.ScrollDownButton>\n );\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n};\n"]}
@@ -0,0 +1,2 @@
1
+ import'./index.css';import {b}from'./chunk-Z5CZVKD4.js';import {c,e,f,h,g,i}from'./chunk-53TUQIKJ.js';import {a}from'./chunk-O2QMYUPS.js';import {Switch}from'radix-ui';import {jsx,jsxs}from'react/jsx-runtime';function w({className:i,size:r="default",...o}){return jsx(Switch.Root,{"data-slot":"switch","data-size":r,className:a("fk:peer fk:group/switch fk:inline-flex fk:shrink-0 fk:items-center fk:rounded-full fk:border fk:border-transparent fk:shadow-xs fk:transition-all fk:outline-none fk:focus-visible:border-ring fk:focus-visible:ring-[3px] fk:focus-visible:ring-ring/50 fk:disabled:cursor-not-allowed fk:disabled:opacity-50 fk:data-[size=default]:h-[1.15rem] fk:data-[size=default]:w-8 fk:data-[size=sm]:h-3.5 fk:data-[size=sm]:w-6 fk:data-[state=checked]:bg-primary fk:data-[state=unchecked]:bg-input fk:dark:data-[state=unchecked]:bg-input/80",i),...o,children:jsx(Switch.Thumb,{"data-slot":"switch-thumb",className:a("fk:pointer-events-none fk:block fk:rounded-full fk:bg-background fk:ring-0 fk:transition-transform fk:group-data-[size=default]/switch:size-4 fk:group-data-[size=sm]/switch:size-3 fk:data-[state=checked]:translate-x-[calc(100%-2px)] fk:data-[state=unchecked]:translate-x-0 fk:dark:data-[state=checked]:bg-primary-foreground fk:dark:data-[state=unchecked]:bg-foreground")})})}function D({control:i$1,fieldSchema:r,setValue:o}){let{name:n,label:v,isEditable:F,options:d}=r;function y(e,t){o(n,{...t,value:e});}function z(e,t){o(n,{...t,disabled:e});}return jsx(c,{control:i$1,name:n,render:({field:e$1})=>jsxs(e,{children:[jsxs("div",{className:"fk:flex fk:flex-row fk:items-center fk:justify-between fk:rounded-lg fk:border fk:border-input fk:p-3 fk:ring-offset-background fk:focus-within:outline-hidden fk:focus-within:ring-2 fk:focus-within:ring-ring fk:focus-within:ring-offset-2 fk:disabled:cursor-not-allowed fk:disabled:opacity-50",children:[jsxs("div",{className:"fk:space-y-0.5",children:[jsx(f,{children:v}),d?.comment?jsx(h,{children:d.comment}):null]}),jsx(g,{children:jsx(w,{checked:e$1.value?.value?!!e$1.value.value:false,disabled:F===false||e$1.value?.disabled,onCheckedChange:t=>{y(t,e$1.value);}})})]}),jsx(b,{checked:e$1.value?.disabled??false,onChange:t=>{z(t,e$1.value);},scope:e$1.value?.scope}),jsx(i,{})]})})}export{D as a};//# sourceMappingURL=chunk-CQOWWQ3H.js.map
2
+ //# sourceMappingURL=chunk-CQOWWQ3H.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/primitives/switch.tsx","../src/form/fields/switch.tsx"],"names":["Switch","className","size","props","jsx","SwitchPrimitive","cn","control","fieldSchema","setValue","name","label","isEditable","options","handleInput","checked","previousValue","handleCheckbox","value","FormField","field","jsxs","FormItem","FormLabel","FormDescription","FormControl","DefaultValueSwitch","FormMessage"],"mappings":"iNAMA,SAASA,CAAAA,CAAO,CACd,SAAA,CAAAC,CAAAA,CACA,KAAAC,CAAAA,CAAO,SAAA,CACP,GAAGC,CACL,CAAA,CAEG,CACD,OACEC,GAAAA,CAACC,MAAAA,CAAgB,IAAA,CAAhB,CACC,WAAA,CAAU,QAAA,CACV,YAAWH,CAAAA,CACX,SAAA,CAAWI,EACT,6gBAAA,CACAL,CACF,EACC,GAAGE,CAAAA,CAEJ,QAAA,CAAAC,GAAAA,CAACC,MAAAA,CAAgB,KAAA,CAAhB,CACC,WAAA,CAAU,cAAA,CACV,SAAA,CAAWC,CAAAA,CACT,kXACF,CAAA,CACF,EACF,CAEJ,CCzBO,SAASN,EAAO,CAAE,OAAA,CAAAO,IAAS,WAAA,CAAAC,CAAAA,CAAa,QAAA,CAAAC,CAAS,CAAA,CAA2C,CACjG,GAAM,CAAE,IAAA,CAAAC,CAAAA,CAAM,KAAA,CAAAC,CAAAA,CAAO,UAAA,CAAAC,EAAY,OAAA,CAAAC,CAAQ,CAAA,CAAIL,CAAAA,CAE7C,SAASM,CAAAA,CAAYC,EAAkBC,CAAAA,CAAiD,CACtFP,EAASC,CAAAA,CAAM,CACb,GAAGM,CAAAA,CACH,KAAA,CAAOD,CACT,CAAC,EACH,CAEA,SAASE,CAAAA,CAAeF,CAAAA,CAAkBG,CAAAA,CAAyC,CACjFT,CAAAA,CAASC,CAAAA,CAAM,CACb,GAAGQ,CAAAA,CACH,QAAA,CAAUH,CACZ,CAAC,EACH,CAEA,OACEX,GAAAA,CAACe,EA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\nimport { Switch as SwitchPrimitive } from 'radix-ui';\nimport { cn } from 'src/ui/lib/utils';\n\nfunction Switch({\n className,\n size = 'default',\n ...props\n}: React.ComponentProps<typeof SwitchPrimitive.Root> & {\n size?: 'sm' | 'default';\n}) {\n return (\n <SwitchPrimitive.Root\n data-slot=\"switch\"\n data-size={size}\n className={cn(\n 'fk:peer fk:group/switch fk:inline-flex fk:shrink-0 fk:items-center fk:rounded-full fk:border fk:border-transparent fk:shadow-xs fk:transition-all fk:outline-none fk:focus-visible:border-ring fk:focus-visible:ring-[3px] fk:focus-visible:ring-ring/50 fk:disabled:cursor-not-allowed fk:disabled:opacity-50 fk:data-[size=default]:h-[1.15rem] fk:data-[size=default]:w-8 fk:data-[size=sm]:h-3.5 fk:data-[size=sm]:w-6 fk:data-[state=checked]:bg-primary fk:data-[state=unchecked]:bg-input fk:dark:data-[state=unchecked]:bg-input/80',\n className\n )}\n {...props}\n >\n <SwitchPrimitive.Thumb\n data-slot=\"switch-thumb\"\n className={cn(\n 'fk:pointer-events-none fk:block fk:rounded-full fk:bg-background fk:ring-0 fk:transition-transform fk:group-data-[size=default]/switch:size-4 fk:group-data-[size=sm]/switch:size-3 fk:data-[state=checked]:translate-x-[calc(100%-2px)] fk:data-[state=unchecked]:translate-x-0 fk:dark:data-[state=checked]:bg-primary-foreground fk:dark:data-[state=unchecked]:bg-foreground'\n )}\n />\n </SwitchPrimitive.Root>\n );\n}\n\nexport { Switch };\n","import type { FormFieldValue } from '../../graphql-client/types';\nimport { FormControl, FormDescription, FormField, FormLabel, FormMessage, FormItem } from '../../ui/primitives/form';\nimport { Switch as SwitchPrimitive } from '../../ui/primitives/switch';\nimport type { FormFieldParams } from '../types';\nimport { DefaultValueSwitch } from './default-value-switch';\n\nexport function Switch({ control, fieldSchema, setValue }: FormFieldParams<'switch'>): JSX.Element {\n const { name, label, isEditable, options } = fieldSchema;\n\n function handleInput(checked: boolean, previousValue: FormFieldValue | undefined): void {\n setValue(name, {\n ...previousValue,\n value: checked,\n });\n }\n\n function handleCheckbox(checked: boolean, value: FormFieldValue | undefined): void {\n setValue(name, {\n ...value,\n disabled: checked,\n });\n }\n\n return (\n <FormField\n control={control}\n name={name}\n render={({ field }: { field: { value?: FormFieldValue } }) => (\n <FormItem>\n <div className=\"fk:flex fk:flex-row fk:items-center fk:justify-between fk:rounded-lg fk:border fk:border-input fk:p-3 fk:ring-offset-background fk:focus-within:outline-hidden fk:focus-within:ring-2 fk:focus-within:ring-ring fk:focus-within:ring-offset-2 fk:disabled:cursor-not-allowed fk:disabled:opacity-50\">\n <div className=\"fk:space-y-0.5\">\n <FormLabel>{label}</FormLabel>\n {options?.comment ? <FormDescription>{options.comment}</FormDescription> : null}\n </div>\n <FormControl>\n <SwitchPrimitive\n checked={field.value?.value ? Boolean(field.value.value) : false}\n disabled={isEditable === false || field.value?.disabled}\n onCheckedChange={(checked) => {\n handleInput(checked, field.value);\n }}\n />\n </FormControl>\n </div>\n <DefaultValueSwitch\n checked={field.value?.disabled ?? false}\n onChange={(checked) => {\n handleCheckbox(checked, field.value);\n }}\n scope={field.value?.scope}\n />\n <FormMessage />\n </FormItem>\n )}\n />\n );\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import'./index.css';import {CircleCheck,CircleX}from'lucide-react';import {jsx}from'react/jsx-runtime';function a({value:f}){return jsx("div",{className:"fk:flex fk:w-full fk:justify-center",children:f?jsx(CircleCheck,{className:"fk:w-4 fk:h-4 fk:text-emerald-500"}):jsx(CircleX,{className:"fk:w-4 fk:h-4 fk:text-muted-foreground"})})}export{a};//# sourceMappingURL=chunk-D4XLXU2H.js.map
2
+ //# sourceMappingURL=chunk-D4XLXU2H.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/data-grid/preview-components/boolean.tsx"],"names":["Boolean","value","jsx","CircleCheck","CircleX"],"mappings":"uGAEO,SAASA,EAAQ,CAAE,KAAA,CAAAC,CAAM,CAAA,CAAuB,CACrD,OACEC,GAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,qCAAA,CACZ,QAAA,CAAAD,CAAAA,CACCC,GAAAA,CAACC,YAAA,CAAY,SAAA,CAAU,mCAAA,CAAoC,CAAA,CAE3DD,IAACE,OAAAA,CAAA,CAAQ,SAAA,CAAU,wCAAA,CAAyC,EAEhE,CAEJ","file":"chunk-M6EIBKCQ.js","sourcesContent":["import { CircleCheck, CircleX } from 'lucide-react';\n\nexport function Boolean({ value }: { value: boolean }) {\n return (\n <div className=\"fk-flex fk-w-full fk-justify-center\">\n {value ? (\n <CircleCheck className=\"fk-w-4 fk-h-4 fk-text-emerald-500\" />\n ) : (\n <CircleX className=\"fk-w-4 fk-h-4 fk-text-muted-foreground\" />\n )}\n </div>\n );\n}\n"]}
1
+ {"version":3,"sources":["../src/data-grid/preview-components/boolean.tsx"],"names":["Boolean","value","jsx","CircleCheck","CircleX"],"mappings":"uGAEO,SAASA,EAAQ,CAAE,KAAA,CAAAC,CAAM,CAAA,CAAuB,CACrD,OACEC,GAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,qCAAA,CACZ,QAAA,CAAAD,CAAAA,CACCC,GAAAA,CAACC,YAAA,CAAY,SAAA,CAAU,mCAAA,CAAoC,CAAA,CAE3DD,IAACE,OAAAA,CAAA,CAAQ,SAAA,CAAU,wCAAA,CAAyC,EAEhE,CAEJ","file":"chunk-D4XLXU2H.js","sourcesContent":["import { CircleCheck, CircleX } from 'lucide-react';\n\nexport function Boolean({ value }: { value: boolean }) {\n return (\n <div className=\"fk:flex fk:w-full fk:justify-center\">\n {value ? (\n <CircleCheck className=\"fk:w-4 fk:h-4 fk:text-emerald-500\" />\n ) : (\n <CircleX className=\"fk:w-4 fk:h-4 fk:text-muted-foreground\" />\n )}\n </div>\n );\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import'./index.css';import {a}from'./chunk-O2QMYUPS.js';import {Slot}from'radix-ui';import {cva}from'class-variance-authority';import {jsx}from'react/jsx-runtime';var k=cva("fk:inline-flex fk:shrink-0 fk:items-center fk:justify-center fk:gap-1 fk:rounded-md fk:text-sm fk:font-medium fk:whitespace-nowrap fk:transition-all fk:outline-none fk:focus-visible:border-ring fk:focus-visible:ring-[3px] fk:focus-visible:ring-ring/50 fk:disabled:pointer-events-none fk:disabled:opacity-50 fk:aria-invalid:border-destructive fk:aria-invalid:ring-destructive/20 fk:dark:aria-invalid:ring-destructive/40 fk:[&_svg]:pointer-events-none fk:[&_svg]:shrink-0 fk:[&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"fk:bg-primary fk:text-primary-foreground fk:hover:bg-primary/90",destructive:"fk:bg-destructive fk:text-white fk:hover:bg-destructive/90 fk:focus-visible:ring-destructive/20 fk:dark:bg-destructive/60 fk:dark:focus-visible:ring-destructive/40",outline:"fk:border fk:bg-background fk:shadow-xs fk:hover:bg-accent fk:hover:text-accent-foreground fk:dark:border-input",secondary:"fk:bg-secondary fk:text-secondary-foreground fk:hover:bg-secondary/80",ghost:"fk:hover:bg-accent fk:hover:text-accent-foreground fk:dark:hover:bg-accent/50",link:"fk:text-primary fk:underline-offset-4 fk:hover:underline"},size:{default:"fk:h-9 fk:px-4 fk:py-2 fk:has-[>svg]:px-3",xs:"fk:h-6 fk:rounded-md fk:px-2 fk:text-xs fk:has-[>svg]:px-1.5 fk:[&_svg:not([class*='size-'])]:size-3",sm:"fk:h-8 fk:rounded-md fk:px-3 fk:has-[>svg]:px-2.5",lg:"fk:h-10 fk:rounded-md fk:px-6 fk:has-[>svg]:px-4",icon:"fk:size-9","icon-xs":"fk:size-6 fk:rounded-md fk:[&_svg:not([class*='size-'])]:size-3","icon-sm":"fk:size-8","icon-lg":"fk:size-10"}},defaultVariants:{variant:"default",size:"default"}});function g({className:r,variant:e="default",size:t="default",asChild:i=false,...o}){let s=i?Slot.Root:"button";return jsx(s,{"data-slot":"button","data-variant":e,"data-size":t,className:a(k({variant:e,size:t,className:r})),...o})}export{k as a,g as b};//# sourceMappingURL=chunk-EYGOJ2ZN.js.map
2
+ //# sourceMappingURL=chunk-EYGOJ2ZN.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/primitives/button.tsx"],"names":["buttonVariants","cva","Button","className","variant","size","asChild","props","Comp","Slot","jsx","cn"],"mappings":"mKAKA,IAAMA,CAAAA,CAAiBC,IACrB,+fAAA,CACA,CACE,QAAA,CAAU,CACR,OAAA,CAAS,CACP,QAAS,iEAAA,CACT,WAAA,CACE,qKAAA,CACF,OAAA,CACE,iHAAA,CACF,SAAA,CAAW,wEACX,KAAA,CAAO,+EAAA,CACP,IAAA,CAAM,0DACR,CAAA,CACA,IAAA,CAAM,CACJ,OAAA,CAAS,2CAAA,CACT,EAAA,CAAI,sGAAA,CACJ,EAAA,CAAI,mDAAA,CACJ,GAAI,kDAAA,CACJ,IAAA,CAAM,WAAA,CACN,SAAA,CAAW,iEAAA,CACX,SAAA,CAAW,WAAA,CACX,SAAA,CAAW,YACb,CACF,CAAA,CACA,eAAA,CAAiB,CACf,OAAA,CAAS,UACT,IAAA,CAAM,SACR,CACF,CACF,EAEA,SAASC,EAAO,CACd,SAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CAAU,SAAA,CACV,KAAAC,CAAAA,CAAO,SAAA,CACP,OAAA,CAAAC,CAAAA,CAAU,KAAA,CACV,GAAGC,CACL,CAAA,CAGK,CACH,IAAMC,CAAAA,CAAOF,CAAAA,CAAUG,IAAAA,CAAK,KAAO,QAAA,CAEnC,OACEC,GAAAA,CAACF,CAAAA,CAAA,CACC,WAAA,CAAU,SACV,cAAA,CAAcJ,CAAAA,CACd,WAAA,CAAWC,CAAAA,CACX,SAAA,CAAWM,CAAAA,CAAGX,EAAe,CAAE,OAAA,CAAAI,CAAAA,CAAS,IAAA,CAAAC,CAAAA,CAAM,SAAA,CAAAF,CAAU,CAAC,CAAC,CAAA,CACzD,GAAGI,CAAAA,CACN,CAEJ","file":"chunk-EYGOJ2ZN.js","sourcesContent":["import * as React from 'react';\nimport { Slot } from 'radix-ui';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/utils';\n\nconst buttonVariants = cva(\n \"fk:inline-flex fk:shrink-0 fk:items-center fk:justify-center fk:gap-1 fk:rounded-md fk:text-sm fk:font-medium fk:whitespace-nowrap fk:transition-all fk:outline-none fk:focus-visible:border-ring fk:focus-visible:ring-[3px] fk:focus-visible:ring-ring/50 fk:disabled:pointer-events-none fk:disabled:opacity-50 fk:aria-invalid:border-destructive fk:aria-invalid:ring-destructive/20 fk:dark:aria-invalid:ring-destructive/40 fk:[&_svg]:pointer-events-none fk:[&_svg]:shrink-0 fk:[&_svg:not([class*='size-'])]:size-4\",\n {\n variants: {\n variant: {\n default: 'fk:bg-primary fk:text-primary-foreground fk:hover:bg-primary/90',\n destructive:\n 'fk:bg-destructive fk:text-white fk:hover:bg-destructive/90 fk:focus-visible:ring-destructive/20 fk:dark:bg-destructive/60 fk:dark:focus-visible:ring-destructive/40',\n outline:\n 'fk:border fk:bg-background fk:shadow-xs fk:hover:bg-accent fk:hover:text-accent-foreground fk:dark:border-input',\n secondary: 'fk:bg-secondary fk:text-secondary-foreground fk:hover:bg-secondary/80',\n ghost: 'fk:hover:bg-accent fk:hover:text-accent-foreground fk:dark:hover:bg-accent/50',\n link: 'fk:text-primary fk:underline-offset-4 fk:hover:underline',\n },\n size: {\n default: 'fk:h-9 fk:px-4 fk:py-2 fk:has-[>svg]:px-3',\n xs: \"fk:h-6 fk:rounded-md fk:px-2 fk:text-xs fk:has-[>svg]:px-1.5 fk:[&_svg:not([class*='size-'])]:size-3\",\n sm: 'fk:h-8 fk:rounded-md fk:px-3 fk:has-[>svg]:px-2.5',\n lg: 'fk:h-10 fk:rounded-md fk:px-6 fk:has-[>svg]:px-4',\n icon: 'fk:size-9',\n 'icon-xs': \"fk:size-6 fk:rounded-md fk:[&_svg:not([class*='size-'])]:size-3\",\n 'icon-sm': 'fk:size-8',\n 'icon-lg': 'fk:size-10',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n);\n\nfunction Button({\n className,\n variant = 'default',\n size = 'default',\n asChild = false,\n ...props\n}: React.ComponentProps<'button'> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean;\n }) {\n const Comp = asChild ? Slot.Root : 'button';\n\n return (\n <Comp\n data-slot=\"button\"\n data-variant={variant}\n data-size={size}\n className={cn(buttonVariants({ variant, size, className }))}\n {...props}\n />\n );\n}\n\nexport { Button, buttonVariants };\n"]}
@@ -0,0 +1,2 @@
1
+ import'./index.css';import {a}from'./chunk-O2QMYUPS.js';import {jsx}from'react/jsx-runtime';function n({className:i,type:f,...r}){return jsx("input",{type:f,"data-slot":"input",className:a("fk:h-9 fk:w-full fk:min-w-0 fk:rounded-md fk:border fk:border-input fk:bg-background fk:px-3 fk:py-1 fk:text-base fk:shadow-xs fk:transition-[color,box-shadow] fk:outline-none fk:selection:bg-primary fk:selection:text-primary-foreground fk:file:inline-flex fk:file:h-7 fk:file:border-0 fk:file:bg-transparent fk:file:text-sm fk:file:font-medium fk:file:text-foreground fk:placeholder:text-muted-foreground fk:disabled:pointer-events-none fk:disabled:cursor-not-allowed fk:disabled:opacity-50 fk:md:text-sm fk:dark:bg-input/30","fk:focus-visible:border-ring fk:focus-visible:ring-[3px] fk:focus-visible:ring-ring/50","fk:aria-invalid:border-destructive fk:aria-invalid:ring-destructive/20 fk:dark:aria-invalid:ring-destructive/40",i),...r})}export{n as a};//# sourceMappingURL=chunk-FPK7J4BP.js.map
2
+ //# sourceMappingURL=chunk-FPK7J4BP.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/primitives/input.tsx"],"names":["Input","className","type","props","jsx","cn"],"mappings":"4FAGA,SAASA,CAAAA,CAAM,CAAE,SAAA,CAAAC,CAAAA,CAAW,IAAA,CAAAC,CAAAA,CAAM,GAAGC,CAAM,CAAA,CAAkC,CAC3E,OACEC,GAAAA,CAAC,OAAA,CAAA,CACC,IAAA,CAAMF,CAAAA,CACN,WAAA,CAAU,OAAA,CACV,SAAA,CAAWG,CAAAA,CACT,+gBAAA,CACA,wFAAA,CACA,iHAAA,CACAJ,CACF,CAAA,CACC,GAAGE,EACN,CAEJ","file":"chunk-FPK7J4BP.js","sourcesContent":["import * as React from 'react';\nimport { cn } from 'src/ui/lib/utils';\n\nfunction Input({ className, type, ...props }: React.ComponentProps<'input'>) {\n return (\n <input\n type={type}\n data-slot=\"input\"\n className={cn(\n 'fk:h-9 fk:w-full fk:min-w-0 fk:rounded-md fk:border fk:border-input fk:bg-background fk:px-3 fk:py-1 fk:text-base fk:shadow-xs fk:transition-[color,box-shadow] fk:outline-none fk:selection:bg-primary fk:selection:text-primary-foreground fk:file:inline-flex fk:file:h-7 fk:file:border-0 fk:file:bg-transparent fk:file:text-sm fk:file:font-medium fk:file:text-foreground fk:placeholder:text-muted-foreground fk:disabled:pointer-events-none fk:disabled:cursor-not-allowed fk:disabled:opacity-50 fk:md:text-sm fk:dark:bg-input/30',\n 'fk:focus-visible:border-ring fk:focus-visible:ring-[3px] fk:focus-visible:ring-ring/50',\n 'fk:aria-invalid:border-destructive fk:aria-invalid:ring-destructive/20 fk:dark:aria-invalid:ring-destructive/40',\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Input };\n"]}
@@ -0,0 +1,2 @@
1
+ import'./index.css';import {a}from'./chunk-O2QMYUPS.js';import {Toggle,ToggleGroup,Separator}from'radix-ui';import {cva}from'class-variance-authority';import {jsx}from'react/jsx-runtime';import*as f from'react';var l=cva("fk:inline-flex fk:items-center fk:justify-center fk:gap-2 fk:rounded-md fk:text-sm fk:font-medium fk:whitespace-nowrap fk:transition-[color,box-shadow] fk:outline-none fk:hover:bg-muted fk:hover:text-muted-foreground fk:focus-visible:border-ring fk:focus-visible:ring-[3px] fk:focus-visible:ring-ring/50 fk:disabled:pointer-events-none fk:disabled:opacity-50 fk:aria-invalid:border-destructive fk:aria-invalid:ring-destructive/20 fk:data-[state=on]:bg-accent fk:data-[state=on]:text-accent-foreground fk:dark:aria-invalid:ring-destructive/40 fk:[&_svg]:pointer-events-none fk:[&_svg]:shrink-0 fk:[&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"fk:bg-transparent",outline:"fk:border fk:border-input fk:bg-transparent fk:shadow-xs fk:hover:bg-accent fk:hover:text-accent-foreground"},size:{default:"fk:h-9 fk:min-w-9 fk:px-2",sm:"fk:h-8 fk:min-w-8 fk:px-1.5",lg:"fk:h-10 fk:min-w-10 fk:px-2.5"}},defaultVariants:{variant:"default",size:"default"}});function P({className:e,variant:t,size:r,...o}){return jsx(Toggle.Root,{"data-slot":"toggle",className:a(l({variant:t,size:r,className:e})),...o})}var c=f.createContext({size:"default",variant:"default",spacing:0});function z({className:e,variant:t,size:r,spacing:o=0,children:s,...i}){return jsx(ToggleGroup.Root,{"data-slot":"toggle-group","data-variant":t,"data-size":r,"data-spacing":o,style:{"--gap":o},className:a("fk:group/toggle-group fk:flex fk:w-fit fk:items-center fk:gap-[--spacing(var(--gap))] fk:rounded-md fk:data-[spacing=default]:data-[variant=outline]:shadow-xs",e),...i,children:jsx(c.Provider,{value:{variant:t,size:r,spacing:o},children:s})})}function N({className:e,children:t,variant:r,size:o,...s}){let i=f.useContext(c);return jsx(ToggleGroup.Item,{"data-slot":"toggle-group-item","data-variant":i.variant||r,"data-size":i.size||o,"data-spacing":i.spacing,className:a(l({variant:i.variant||r,size:i.size||o}),"fk:w-auto fk:min-w-0 fk:shrink-0 fk:px-3 fk:focus:z-10 fk:focus-visible:z-10","fk:data-[spacing=0]:rounded-none fk:data-[spacing=0]:shadow-none fk:data-[spacing=0]:first:rounded-l-md fk:data-[spacing=0]:last:rounded-r-md fk:data-[spacing=0]:data-[variant=outline]:border-l-0 fk:data-[spacing=0]:data-[variant=outline]:first:border-l",e),...s,children:t})}function I({className:e,orientation:t="horizontal",decorative:r=true,...o}){return jsx(Separator.Root,{"data-slot":"separator",decorative:r,orientation:t,className:a("fk:shrink-0 fk:bg-border fk:data-[orientation=horizontal]:h-px fk:data-[orientation=horizontal]:w-full fk:data-[orientation=vertical]:h-full fk:data-[orientation=vertical]:w-px",e),...o})}function E({className:e,onScroll:t,ref:r,...o}){return jsx("div",{ref:r,"data-slot":"table-container",className:"fk:relative fk:h-full fk:w-full fk:overflow-x-auto fk:rounded-t-md fk:border-border fk:border",onScroll:t,children:jsx("table",{"data-slot":"table",className:a("fk:w-full fk:caption-bottom fk:text-sm",e),...o})})}function F({className:e,...t}){return jsx("thead",{"data-slot":"table-header",className:a("fk:[&_tr]:border-b",e),...t})}function L({className:e,...t}){return jsx("tbody",{"data-slot":"table-body",className:a("fk:[&_tr:last-child]:border-0",e),...t})}function M({className:e,...t}){return jsx("tfoot",{"data-slot":"table-footer",className:a("fk:border-t fk:bg-muted/50 fk:font-medium fk:[&>tr]:last:border-b-0",e),...t})}function O({className:e,...t}){return jsx("tr",{"data-slot":"table-row",className:a("fk:border-b fk:transition-colors fk:hover:bg-muted/50 fk:has-aria-expanded:bg-muted/50 fk:data-[state=selected]:bg-muted",e),...t})}function q({className:e,...t}){return jsx("th",{"data-slot":"table-head",className:a("fk:h-10 fk:px-4 fk:text-left fk:align-middle fk:font-medium fk:whitespace-nowrap fk:text-foreground fk:[&:has([role=checkbox])]:pr-0 fk:*:[[role=checkbox]]:translate-y-[2px]",e),...t})}function A({className:e,...t}){return jsx("td",{"data-slot":"table-cell",className:a("fk:px-4 fk:py-1 fk:align-middle fk:whitespace-nowrap fk:[&:has([role=checkbox])]:pr-0 fk:*:[[role=checkbox]]:translate-y-[2px]",e),...t})}function J({className:e,...t}){return jsx("caption",{"data-slot":"table-caption",className:a("fk:mt-4 fk:text-sm fk:text-muted-foreground",e),...t})}export{l as a,P as b,z as c,N as d,I as e,E as f,F as g,L as h,M as i,O as j,q as k,A as l,J as m};//# sourceMappingURL=chunk-FRXGAPDR.js.map
2
+ //# sourceMappingURL=chunk-FRXGAPDR.js.map
@@ -0,0 +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","className","variant","size","props","jsx","TogglePrimitive","cn","ToggleGroupContext","ToggleGroup","spacing","children","ToggleGroupPrimitive","ToggleGroupItem","context","Separator","orientation","decorative","SeparatorPrimitive","Table","onScroll","ref","TableHeader","TableBody","TableFooter","TableRow","TableHead","TableCell","TableCaption"],"mappings":"mNAOA,IAAMA,CAAAA,CAAiBC,IACrB,0nBAAA,CACA,CACE,QAAA,CAAU,CACR,OAAA,CAAS,CACP,OAAA,CAAS,mBAAA,CACT,OAAA,CACE,6GACJ,CAAA,CACA,IAAA,CAAM,CACJ,OAAA,CAAS,4BACT,EAAA,CAAI,6BAAA,CACJ,EAAA,CAAI,+BACN,CACF,CAAA,CACA,eAAA,CAAiB,CACf,OAAA,CAAS,SAAA,CACT,IAAA,CAAM,SACR,CACF,CACF,EAEA,SAASC,CAAAA,CAAO,CACd,SAAA,CAAAC,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,GAAGC,CACL,CAAA,CAA4F,CAC1F,OACEC,IAACC,MAAAA,CAAgB,IAAA,CAAhB,CAAqB,WAAA,CAAU,QAAA,CAAS,SAAA,CAAWC,EAAGT,CAAAA,CAAe,CAAE,OAAA,CAAAI,CAAAA,CAAS,IAAA,CAAAC,CAAAA,CAAM,UAAAF,CAAU,CAAC,CAAC,CAAA,CAAI,GAAGG,CAAAA,CAAO,CAErH,CC9BA,IAAMI,CAAAA,CAA2B,CAAA,CAAA,aAAA,CAI/B,CACA,IAAA,CAAM,SAAA,CACN,OAAA,CAAS,SAAA,CACT,OAAA,CAAS,CACX,CAAC,EAED,SAASC,CAAAA,CAAY,CACnB,SAAA,CAAAR,CAAAA,CACA,OAAA,CAAAC,CAAAA,CACA,IAAA,CAAAC,CAAAA,CACA,OAAA,CAAAO,CAAAA,CAAU,CAAA,CACV,QAAA,CAAAC,CAAAA,CACA,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AAY,CAAE,UAAAvB,CAAAA,CAAW,GAAGG,CAAM,CAAA,CAAkC,CAC3E,OACEC,IAAC,OAAA,CAAA,CACC,WAAA,CAAU,cAAA,CACV,SAAA,CAAWE,CAAAA,CAAG,qEAAA,CAAuEN,CAAS,CAAA,CAC7F,GAAGG,CAAAA,CACN,CAEJ,CAEA,SAASqB,CAAAA,CAAS,CAAE,SAAA,CAAAxB,CAAAA,CAAW,GAAGG,CAAM,CAAA,CAA+B,CACrE,OACEC,GAAAA,CAAC,IAAA,CAAA,CACC,WAAA,CAAU,WAAA,CACV,SAAA,CAAWE,CAAAA,CACT,0HAAA,CACAN,CACF,CAAA,CACC,GAAGG,CAAAA,CACN,CAEJ,CAEA,SAASsB,CAAAA,CAAU,CAAE,SAAA,CAAAzB,CAAAA,CAAW,GAAGG,CAAM,CAAA,CAA+B,CACtE,OACEC,GAAAA,CAAC,IAAA,CAAA,CACC,WAAA,CAAU,YAAA,CACV,SAAA,CAAWE,CAAAA,CACT,+KAAA,CACAN,CACF,CAAA,CACC,GAAGG,CAAAA,CACN,CAEJ,CAEA,SAASuB,EAAU,CAAE,SAAA,CAAA1B,CAAAA,CAAW,GAAGG,CAAM,CAAA,CAA+B,CACtE,OACEC,GAAAA,CAAC,IAAA,CAAA,CACC,WAAA,CAAU,YAAA,CACV,SAAA,CAAWE,CAAAA,CACT,iIACAN,CACF,CAAA,CACC,GAAGG,CAAAA,CACN,CAEJ,CAEA,SAASwB,CAAAA,CAAa,CAAE,SAAA,CAAA3B,CAAAA,CAAW,GAAGG,CAAM,CAAA,CAAoC,CAC9E,OACEC,GAAAA,CAAC,SAAA,CAAA,CACC,WAAA,CAAU,eAAA,CACV,SAAA,CAAWE,CAAAA,CAAG,6CAAA,CAA+CN,CAAS,CAAA,CACrE,GAAGG,CAAAA,CACN,CAEJ","file":"chunk-FRXGAPDR.js","sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { Toggle as TogglePrimitive } from 'radix-ui';\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:gap-2 fk:rounded-md fk:text-sm fk:font-medium fk:whitespace-nowrap fk:transition-[color,box-shadow] fk:outline-none fk:hover:bg-muted fk:hover:text-muted-foreground fk:focus-visible:border-ring fk:focus-visible:ring-[3px] fk:focus-visible:ring-ring/50 fk:disabled:pointer-events-none fk:disabled:opacity-50 fk:aria-invalid:border-destructive fk:aria-invalid:ring-destructive/20 fk:data-[state=on]:bg-accent fk:data-[state=on]:text-accent-foreground fk:dark:aria-invalid:ring-destructive/40 fk:[&_svg]:pointer-events-none fk:[&_svg]:shrink-0 fk:[&_svg:not([class*='size-'])]:size-4\",\n {\n variants: {\n variant: {\n default: 'fk:bg-transparent',\n outline:\n 'fk:border fk:border-input fk:bg-transparent fk:shadow-xs fk:hover:bg-accent fk:hover:text-accent-foreground',\n },\n size: {\n default: 'fk:h-9 fk:min-w-9 fk:px-2',\n sm: 'fk:h-8 fk:min-w-8 fk:px-1.5',\n lg: 'fk:h-10 fk:min-w-10 fk:px-2.5',\n },\n },\n defaultVariants: {\n variant: 'default',\n size: 'default',\n },\n }\n);\n\nfunction Toggle({\n className,\n variant,\n size,\n ...props\n}: React.ComponentProps<typeof TogglePrimitive.Root> & VariantProps<typeof toggleVariants>) {\n return (\n <TogglePrimitive.Root data-slot=\"toggle\" className={cn(toggleVariants({ variant, size, className }))} {...props} />\n );\n}\n\nexport { Toggle, toggleVariants };\n","'use client';\n\nimport * as React from 'react';\nimport { ToggleGroup as ToggleGroupPrimitive } from 'radix-ui';\nimport type { VariantProps } from 'class-variance-authority';\nimport { cn } from '../lib/utils';\nimport { toggleVariants } from './toggle';\n\nconst ToggleGroupContext = React.createContext<\n VariantProps<typeof toggleVariants> & {\n spacing?: number;\n }\n>({\n size: 'default',\n variant: 'default',\n spacing: 0,\n});\n\nfunction ToggleGroup({\n className,\n variant,\n size,\n spacing = 0,\n children,\n ...props\n}: React.ComponentProps<typeof ToggleGroupPrimitive.Root> &\n VariantProps<typeof toggleVariants> & {\n spacing?: number;\n }) {\n return (\n <ToggleGroupPrimitive.Root\n data-slot=\"toggle-group\"\n data-variant={variant}\n data-size={size}\n data-spacing={spacing}\n style={{ '--gap': spacing } as React.CSSProperties}\n className={cn(\n 'fk:group/toggle-group fk:flex fk:w-fit fk:items-center fk:gap-[--spacing(var(--gap))] fk:rounded-md fk:data-[spacing=default]:data-[variant=outline]:shadow-xs',\n className\n )}\n {...props}\n >\n <ToggleGroupContext.Provider value={{ variant, size, spacing }}>{children}</ToggleGroupContext.Provider>\n </ToggleGroupPrimitive.Root>\n );\n}\n\nfunction ToggleGroupItem({\n className,\n children,\n variant,\n size,\n ...props\n}: React.ComponentProps<typeof ToggleGroupPrimitive.Item> & VariantProps<typeof toggleVariants>) {\n const context = React.useContext(ToggleGroupContext);\n\n return (\n <ToggleGroupPrimitive.Item\n data-slot=\"toggle-group-item\"\n data-variant={context.variant || variant}\n data-size={context.size || size}\n data-spacing={context.spacing}\n className={cn(\n toggleVariants({\n variant: context.variant || variant,\n size: context.size || size,\n }),\n 'fk:w-auto fk:min-w-0 fk:shrink-0 fk:px-3 fk:focus:z-10 fk:focus-visible:z-10',\n 'fk:data-[spacing=0]:rounded-none fk:data-[spacing=0]:shadow-none fk:data-[spacing=0]:first:rounded-l-md fk:data-[spacing=0]:last:rounded-r-md fk:data-[spacing=0]:data-[variant=outline]:border-l-0 fk:data-[spacing=0]:data-[variant=outline]:first:border-l',\n className\n )}\n {...props}\n >\n {children}\n </ToggleGroupPrimitive.Item>\n );\n}\n\nexport { ToggleGroup, ToggleGroupItem };\n","'use client';\n\nimport * as React from 'react';\nimport { Separator as SeparatorPrimitive } from 'radix-ui';\nimport { cn } from 'src/ui/lib/utils';\n\nfunction Separator({\n className,\n orientation = 'horizontal',\n decorative = true,\n ...props\n}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {\n return (\n <SeparatorPrimitive.Root\n data-slot=\"separator\"\n decorative={decorative}\n orientation={orientation}\n className={cn(\n 'fk:shrink-0 fk:bg-border fk:data-[orientation=horizontal]:h-px fk:data-[orientation=horizontal]:w-full fk:data-[orientation=vertical]:h-full fk:data-[orientation=vertical]:w-px',\n className\n )}\n {...props}\n />\n );\n}\n\nexport { Separator };\n","import * as React from 'react';\nimport { cn } from 'src/ui/lib/utils';\n\ntype TableProps = Omit<React.ComponentProps<'table'>, 'ref'> & {\n ref?: React.Ref<HTMLDivElement>;\n};\n\nfunction Table({ className, onScroll, ref, ...props }: TableProps) {\n return (\n <div\n ref={ref}\n data-slot=\"table-container\"\n className=\"fk:relative fk:h-full fk:w-full fk:overflow-x-auto fk:rounded-t-md fk:border-border fk:border\"\n onScroll={onScroll}\n >\n <table data-slot=\"table\" className={cn('fk:w-full fk:caption-bottom fk:text-sm', className)} {...props} />\n </div>\n );\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {\n return <thead data-slot=\"table-header\" className={cn('fk:[&_tr]:border-b', className)} {...props} />;\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {\n return <tbody data-slot=\"table-body\" className={cn('fk:[&_tr:last-child]:border-0', className)} {...props} />;\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {\n return (\n <tfoot\n data-slot=\"table-footer\"\n className={cn('fk:border-t fk:bg-muted/50 fk:font-medium fk:[&>tr]:last:border-b-0', className)}\n {...props}\n />\n );\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<'tr'>) {\n return (\n <tr\n data-slot=\"table-row\"\n className={cn(\n 'fk:border-b fk:transition-colors fk:hover:bg-muted/50 fk:has-aria-expanded:bg-muted/50 fk:data-[state=selected]:bg-muted',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction TableHead({ className, ...props }: React.ComponentProps<'th'>) {\n return (\n <th\n data-slot=\"table-head\"\n className={cn(\n 'fk:h-10 fk:px-4 fk:text-left fk:align-middle fk:font-medium fk:whitespace-nowrap fk:text-foreground fk:[&:has([role=checkbox])]:pr-0 fk:*:[[role=checkbox]]:translate-y-[2px]',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction TableCell({ className, ...props }: React.ComponentProps<'td'>) {\n return (\n <td\n data-slot=\"table-cell\"\n className={cn(\n 'fk:px-4 fk:py-1 fk:align-middle fk:whitespace-nowrap fk:[&:has([role=checkbox])]:pr-0 fk:*:[[role=checkbox]]:translate-y-[2px]',\n className\n )}\n {...props}\n />\n );\n}\n\nfunction TableCaption({ className, ...props }: React.ComponentProps<'caption'>) {\n return (\n <caption\n data-slot=\"table-caption\"\n className={cn('fk:mt-4 fk:text-sm fk:text-muted-foreground', className)}\n {...props}\n />\n );\n}\n\nexport { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };\n"]}
@@ -1,2 +1,2 @@
1
- import'./index.css';import {d}from'./chunk-EELTSHST.js';import {c}from'./chunk-TMK5LKFR.js';import {createContext,useState,useCallback,useEffect,useMemo,useContext}from'react';import {jsx}from'react/jsx-runtime';import _ from'swr';import {useParams}from'react-router-dom';var Q=["light","dark"],C="(prefers-color-scheme: dark)",U=createContext(void 0);function W({attribute:e="data-theme",children:r,defaultTheme:t,disableTransitionOnChange:u=false,enableColorScheme:l=true,enableSystem:i=true,forcedTheme:n,storageKey:d="theme",themes:c=Q,value:f}){let[a,k]=useState(()=>J(d,t,i)),[m,w]=useState(()=>O()),v=E(n??a,i,m),P=useCallback(o=>{if(!n&&(k(o),!!h()))try{window.localStorage.setItem(d,o);}catch{}},[n,d]);useEffect(()=>{if(!h()||!i)return;let o=window.matchMedia(C);function g(s){w(s.matches?"dark":"light");}return w(o.matches?"dark":"light"),o.addEventListener("change",g),()=>{o.removeEventListener("change",g);}},[i]),useEffect(()=>{if(!h())return;let o=window.document.documentElement,s=E(n??a??t,i,m);if(!s)return;let b=u?D():void 0,I=f?Object.values(f):c,y=f?.[s]??s;e==="class"&&(o.classList.remove(...I),o.classList.add(y)),e!=="class"&&o.setAttribute(e,y),l&&(s==="dark"||s==="light")&&(o.style.colorScheme=s),b?.();},[e,t,u,l,i,n,m,a,c,f]);let R=useMemo(()=>({forcedTheme:n,resolvedTheme:v,setTheme:P,systemTheme:m,theme:n??a,themes:i?[...c,"system"]:c}),[i,n,v,P,m,a,c]);return jsx(U.Provider,{value:R,children:r})}function Y(){let e=useContext(U);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function D(){let e=window.document.createElement("style");return e.appendChild(window.document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),window.document.head.appendChild(e),()=>{window.getComputedStyle(window.document.body),window.setTimeout(()=>{e.remove();},0);}}function J(e,r,t){if(!h())return r??(t?"system":"light");try{let u=window.localStorage.getItem(e);if(u)return u}catch{}return r??(t?"system":"light")}function O(){if(h())return window.matchMedia(C).matches?"dark":"light"}function h(){return typeof window<"u"}function E(e,r,t){if(e)return e!=="system"?e:r?t??"light":"light"}function T(){let{projectId:e}=useParams(),{projects:r}=d(),t=r.find(n=>n.projectId===e)??r[0],{data:u,isLoading:l}=_(c(e??"").currentUser,n=>fetch(n,{mode:"cors",credentials:"include"}).then(d=>d.json()));return [l,{user:u,logout:async()=>{await fetch(c(e??"").logout(t?.basePath??"/"),{method:"POST",mode:"cors",credentials:"include"}),await fetch("/api/flexkit/logout",{method:"GET",credentials:"include"}),window.location.reload();}}]}var L=createContext([true,{user:null,logout:()=>Promise.resolve()}]);function ie({children:e}){let[r,t]=T();return jsx(L.Provider,{value:[r,t],children:e})}function se(){return useContext(L)}export{W as a,Y as b,ie as c,se as d};//# sourceMappingURL=chunk-665E4UDZ.js.map
2
- //# sourceMappingURL=chunk-665E4UDZ.js.map
1
+ import'./index.css';import {d}from'./chunk-6YHHL4XI.js';import {c}from'./chunk-TMK5LKFR.js';import {createContext,useState,useCallback,useEffect,useMemo,useContext}from'react';import {jsx}from'react/jsx-runtime';import _ from'swr';import {useParams}from'react-router-dom';var V=["light","dark"],C="(prefers-color-scheme: dark)",U=createContext(void 0);function W({attribute:e="data-theme",children:r,defaultTheme:t,disableTransitionOnChange:u=false,enableColorScheme:l=true,enableSystem:i=true,forcedTheme:n,storageKey:c="theme",themes:d=V,value:f}){let[a,k]=useState(()=>Q(c,t,i)),[m,w]=useState(()=>D()),v=E(n??a,i,m),y=useCallback(o=>{if(!n&&(k(o),!!h()))try{window.localStorage.setItem(c,o);}catch{}},[n,c]);useEffect(()=>{if(!h()||!i)return;let o=window.matchMedia(C);function g(s){w(s.matches?"dark":"light");}return w(o.matches?"dark":"light"),o.addEventListener("change",g),()=>{o.removeEventListener("change",g);}},[i]),useEffect(()=>{if(!h())return;let o=window.document.documentElement,s=E(n??a??t,i,m);if(!s)return;let b=u?X():void 0,I=f?Object.values(f):d,P=f?.[s]??s;e==="class"&&(o.classList.remove(...I),o.classList.add(P)),e!=="class"&&o.setAttribute(e,P),l&&(s==="dark"||s==="light")&&(o.style.colorScheme=s),b?.();},[e,t,u,l,i,n,m,a,d,f]);let R=useMemo(()=>({forcedTheme:n,resolvedTheme:v,setTheme:y,systemTheme:m,theme:n??a,themes:i?[...d,"system"]:d}),[i,n,v,y,m,a,d]);return jsx(U.Provider,{value:R,children:r})}function Y(){let e=useContext(U);if(!e)throw new Error("useTheme must be used within ThemeProvider");return e}function X(){let e=window.document.createElement("style");return e.appendChild(window.document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),window.document.head.appendChild(e),()=>{window.getComputedStyle(window.document.body),window.setTimeout(()=>{e.remove();},0);}}function Q(e,r,t){if(!h())return r??(t?"system":"light");try{let u=window.localStorage.getItem(e);if(u)return u}catch{}return r??(t?"system":"light")}function D(){if(h())return window.matchMedia(C).matches?"dark":"light"}function h(){return typeof window<"u"}function E(e,r,t){if(e)return e!=="system"?e:r?t??"light":"light"}function T(){let{projectId:e}=useParams(),{projects:r}=d(),t=r.find(n=>n.projectId===e)??r[0],{data:u,isLoading:l}=_(c(e??"").currentUser,n=>fetch(n,{mode:"cors",credentials:"include"}).then(c=>c.json()));return [l,{user:u,logout:async()=>{await fetch(c(e??"").logout(t?.basePath??"/"),{method:"POST",mode:"cors",credentials:"include"}),await fetch("/api/flexkit/logout",{method:"GET",credentials:"include"}),window.location.reload();}}]}var L=createContext([true,{user:null,logout:()=>Promise.resolve()}]);function se({children:e}){let[r,t]=T();return jsx(L.Provider,{value:[r,t],children:e})}function ue(){return useContext(L)}export{W as a,Y as b,se as c,ue as d};//# sourceMappingURL=chunk-H6LL44JH.js.map
2
+ //# sourceMappingURL=chunk-H6LL44JH.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/ui/theme-context.tsx","../src/auth/use-auth-service.ts","../src/auth/auth-context.tsx"],"names":["DEFAULT_THEMES","MEDIA_QUERY","ThemeContext","createContext","ThemeProvider","attribute","children","defaultTheme","disableTransitionOnChange","enableColorScheme","enableSystem","forcedTheme","storageKey","themes","value","theme","setThemeState","useState","getInitialTheme","systemTheme","setSystemTheme","getSystemTheme","resolvedTheme","resolveTheme","setTheme","useCallback","nextTheme","isBrowser","useEffect","mediaQuery","handleChange","event","root","nextResolvedTheme","cleanupTransitions","disableTransitions","themeValues","attributeValue","context","useMemo","jsx","useTheme","useContext","style","storedTheme","useAuthService","projectId","useParams","projects","useConfig","currentProject","project","user","isLoadingUser","useSWR","apiPaths","url","res","AuthContext","AuthProvider","isLoading","auth","useAuth"],"mappings":"gRAiCA,IAAMA,CAAAA,CAAiB,CAAC,OAAA,CAAS,MAAM,CAAA,CACjCC,CAAAA,CAAc,+BACdC,CAAAA,CAAeC,aAAAA,CAAyC,MAAS,CAAA,CAEhE,SAASC,CAAAA,CAAc,CAC5B,SAAA,CAAAC,CAAAA,CAAY,aACZ,QAAA,CAAAC,CAAAA,CACA,YAAA,CAAAC,CAAAA,CACA,yBAAA,CAAAC,CAAAA,CAA4B,KAAA,CAC5B,iBAAA,CAAAC,EA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SAAU,CAAC,CAAA,CAE5E,MAAA,CAAO,SAAS,MAAA,GAClB,CACF,CACF,CACF,CC9BA,IAAMQ,CAAAA,CAAcvD,aAAAA,CAAc,CAChC,IAAA,CACA,CACE,IAAA,CAAM,IAAA,CACN,MAAA,CAAQ,IAAM,QAAQ,OAAA,EACxB,CACF,CAAC,CAAA,CAEM,SAASwD,EAAAA,CAAa,CAAE,SAAArD,CAAS,CAAA,CAA+C,CACrF,GAAM,CAACsD,CAAAA,CAAWC,CAAI,CAAA,CAAIhB,CAAAA,GAE1B,OAAOL,GAAAA,CAACkB,CAAAA,CAAY,QAAA,CAAZ,CAAqB,KAAA,CAAO,CAACE,CAAAA,CAAWC,CAAI,EAAI,QAAA,CAAAvD,CAAAA,CAAS,CACnE,CAEO,SAASwD,EAAAA,EAAuB,CACrC,OAAOpB,UAAAA,CAAWgB,CAAW,CAC/B","file":"chunk-H6LL44JH.js","sourcesContent":["'use client';\n\nimport { createContext, useCallback, useContext, useEffect, useMemo, useState } from 'react';\nimport type { JSX } from 'react';\n\ntype SystemTheme = 'dark' | 'light';\n\ninterface ThemeValue {\n [themeName: string]: string;\n}\n\nexport interface UseThemeProps {\n themes: string[];\n forcedTheme?: string;\n setTheme: (theme: string) => void;\n theme?: string;\n resolvedTheme?: string;\n systemTheme?: SystemTheme;\n}\n\nexport interface ThemeProviderProps {\n themes?: string[];\n forcedTheme?: string;\n enableSystem?: boolean;\n disableTransitionOnChange?: boolean;\n enableColorScheme?: boolean;\n storageKey?: string;\n defaultTheme?: string;\n attribute?: string | 'class';\n value?: ThemeValue;\n children?: React.ReactNode;\n}\n\nconst DEFAULT_THEMES = ['light', 'dark'];\nconst MEDIA_QUERY = '(prefers-color-scheme: dark)';\nconst ThemeContext = createContext<UseThemeProps | undefined>(undefined);\n\nexport function ThemeProvider({\n attribute = 'data-theme',\n children,\n defaultTheme,\n disableTransitionOnChange = false,\n enableColorScheme = true,\n enableSystem = true,\n forcedTheme,\n storageKey = 'theme',\n themes = DEFAULT_THEMES,\n value,\n}: ThemeProviderProps): JSX.Element {\n const [theme, setThemeState] = useState<string | undefined>(() =>\n getInitialTheme(storageKey, defaultTheme, enableSystem)\n );\n const [systemTheme, setSystemTheme] = useState<SystemTheme | undefined>(() => getSystemTheme());\n const resolvedTheme = resolveTheme(forcedTheme ?? theme, enableSystem, systemTheme);\n\n const setTheme = useCallback(\n (nextTheme: string) => {\n if (forcedTheme) {\n return;\n }\n\n setThemeState(nextTheme);\n\n if (!isBrowser()) {\n return;\n }\n\n try {\n window.localStorage.setItem(storageKey, nextTheme);\n } catch {\n //\n }\n },\n [forcedTheme, storageKey]\n );\n\n useEffect(() => {\n if (!isBrowser() || !enableSystem) {\n return;\n }\n\n const mediaQuery = window.matchMedia(MEDIA_QUERY);\n\n function handleChange(event: MediaQueryListEvent): void {\n setSystemTheme(event.matches ? 'dark' : 'light');\n }\n\n setSystemTheme(mediaQuery.matches ? 'dark' : 'light');\n mediaQuery.addEventListener('change', handleChange);\n\n return () => {\n mediaQuery.removeEventListener('change', handleChange);\n };\n }, [enableSystem]);\n\n useEffect(() => {\n if (!isBrowser()) {\n return;\n }\n\n const root = window.document.documentElement;\n const selectedTheme = forcedTheme ?? theme ?? defaultTheme;\n const nextResolvedTheme = resolveTheme(selectedTheme, enableSystem, systemTheme);\n\n if (!nextResolvedTheme) {\n return;\n }\n\n const cleanupTransitions = disableTransitionOnChange ? disableTransitions() : undefined;\n const themeValues = value ? Object.values(value) : themes;\n const attributeValue = value?.[nextResolvedTheme] ?? nextResolvedTheme;\n\n if (attribute === 'class') {\n root.classList.remove(...themeValues);\n root.classList.add(attributeValue);\n }\n\n if (attribute !== 'class') {\n root.setAttribute(attribute, attributeValue);\n }\n\n if (enableColorScheme && (nextResolvedTheme === 'dark' || nextResolvedTheme === 'light')) {\n root.style.colorScheme = nextResolvedTheme;\n }\n\n cleanupTransitions?.();\n }, [\n attribute,\n defaultTheme,\n disableTransitionOnChange,\n enableColorScheme,\n enableSystem,\n forcedTheme,\n systemTheme,\n theme,\n themes,\n value,\n ]);\n\n const context = useMemo<UseThemeProps>(() => {\n return {\n forcedTheme,\n resolvedTheme,\n setTheme,\n systemTheme,\n theme: forcedTheme ?? theme,\n themes: enableSystem ? [...themes, 'system'] : themes,\n };\n }, [enableSystem, forcedTheme, resolvedTheme, setTheme, systemTheme, theme, themes]);\n\n return <ThemeContext.Provider value={context}>{children}</ThemeContext.Provider>;\n}\n\nexport function useTheme(): UseThemeProps {\n const context = useContext(ThemeContext);\n\n if (!context) {\n throw new Error('useTheme must be used within ThemeProvider');\n }\n\n return context;\n}\n\nfunction disableTransitions(): () => void {\n const style = window.document.createElement('style');\n style.appendChild(\n window.document.createTextNode(\n '*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}'\n )\n );\n window.document.head.appendChild(style);\n\n return () => {\n window.getComputedStyle(window.document.body);\n\n window.setTimeout(() => {\n style.remove();\n }, 0);\n };\n}\n\nfunction getInitialTheme(storageKey: string, defaultTheme: string | undefined, enableSystem: boolean): string {\n if (!isBrowser()) {\n return defaultTheme ?? (enableSystem ? 'system' : 'light');\n }\n\n try {\n const storedTheme = window.localStorage.getItem(storageKey);\n\n if (storedTheme) {\n return storedTheme;\n }\n } catch {\n //\n }\n\n return defaultTheme ?? (enableSystem ? 'system' : 'light');\n}\n\nfunction getSystemTheme(): SystemTheme | undefined {\n if (!isBrowser()) {\n return undefined;\n }\n\n return window.matchMedia(MEDIA_QUERY).matches ? 'dark' : 'light';\n}\n\nfunction isBrowser(): boolean {\n return typeof window !== 'undefined';\n}\n\nfunction resolveTheme(\n theme: string | undefined,\n enableSystem: boolean,\n systemTheme: SystemTheme | undefined\n): string | undefined {\n if (!theme) {\n return undefined;\n }\n\n if (theme !== 'system') {\n return theme;\n }\n\n if (!enableSystem) {\n return 'light';\n }\n\n return systemTheme ?? 'light';\n}\n","'use client';\n\nimport useSWR from 'swr';\nimport { useParams } from 'react-router-dom';\nimport { apiPaths } from '../core/api-paths';\nimport { useConfig } from '../core/config/config-context';\nimport type { AuthService, User } from './types';\n\nexport default function useAuthService(): AuthService {\n const { projectId } = useParams();\n const { projects } = useConfig();\n const currentProject = projects.find((project) => project.projectId === projectId) ?? projects[0];\n const { data: user, isLoading: isLoadingUser } = useSWR(apiPaths(projectId ?? '').currentUser, (url: string) =>\n fetch(url, { mode: 'cors', credentials: 'include' }).then((res) => res.json() as Promise<User>)\n );\n const isLoading = isLoadingUser;\n\n return [\n isLoading,\n {\n user,\n logout: async () => {\n // wipe remote session\n await fetch(apiPaths(projectId ?? '').logout(currentProject?.basePath ?? '/'), {\n method: 'POST',\n mode: 'cors',\n credentials: 'include',\n });\n\n // delete first-party auth cookie\n await fetch('/api/flexkit/logout', { method: 'GET', credentials: 'include' });\n\n window.location.reload();\n },\n },\n ];\n}\n","'use client';\n\nimport { createContext, JSX, useContext } from 'react';\nimport useAuthService from './use-auth-service';\nimport type { Auth, AuthService, User } from './types';\n\nconst AuthContext = createContext([\n true,\n {\n user: null as User | null,\n logout: () => Promise.resolve(),\n } as Auth,\n]);\n\nexport function AuthProvider({ children }: { children: React.ReactNode }): JSX.Element {\n const [isLoading, auth] = useAuthService();\n\n return <AuthContext.Provider value={[isLoading, auth]}>{children}</AuthContext.Provider>;\n}\n\nexport function useAuth(): AuthService {\n return useContext(AuthContext) as AuthService;\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import'./index.css';import {a}from'./chunk-O2QMYUPS.js';import {DropdownMenu}from'radix-ui';import {CheckIcon,CircleIcon,ChevronRightIcon}from'lucide-react';import {jsx,jsxs}from'react/jsx-runtime';function l({...e}){return jsx(DropdownMenu.Root,{"data-slot":"dropdown-menu",...e})}function v({...e}){return jsx(DropdownMenu.Portal,{"data-slot":"dropdown-menu-portal",...e})}function g({...e}){return jsx(DropdownMenu.Trigger,{"data-slot":"dropdown-menu-trigger",...e})}function w({className:e,sideOffset:o=4,...a$1}){return jsx(DropdownMenu.Portal,{children:jsx(DropdownMenu.Content,{"data-slot":"dropdown-menu-content",sideOffset:o,className:a("fk:z-50 fk:max-h-(--radix-dropdown-menu-content-available-height) fk:min-w-32 fk:origin-(--radix-dropdown-menu-content-transform-origin) fk:overflow-x-hidden fk:overflow-y-auto fk:rounded-md fk:border fk:bg-popover fk:p-1 fk:text-popover-foreground fk:shadow-md fk:data-[side=bottom]:slide-in-from-top-2 fk:data-[side=left]:slide-in-from-right-2 fk:data-[side=right]:slide-in-from-left-2 fk:data-[side=top]:slide-in-from-bottom-2 fk:data-[state=closed]:animate-out fk:data-[state=closed]:fade-out-0 fk:data-[state=closed]:zoom-out-95 fk:data-[state=open]:animate-in fk:data-[state=open]:fade-in-0 fk:data-[state=open]:zoom-in-95",e),...a$1})})}function b({...e}){return jsx(DropdownMenu.Group,{"data-slot":"dropdown-menu-group",...e})}function x({className:e,inset:o,variant:a$1="default",...d}){return jsx(DropdownMenu.Item,{"data-slot":"dropdown-menu-item","data-inset":o,"data-variant":a$1,className:a("fk:relative fk:flex fk:cursor-default fk:items-center fk:gap-2 fk:rounded-sm fk:px-2 fk:py-1.5 fk:text-sm fk:outline-hidden fk:select-none fk:focus:bg-accent fk:focus:text-accent-foreground fk:data-[disabled]:pointer-events-none fk:data-[disabled]:opacity-50 fk:data-[inset]:pl-8 fk:data-[variant=destructive]:text-destructive fk:data-[variant=destructive]:focus:bg-destructive/10 fk:data-[variant=destructive]:focus:text-destructive fk:dark:data-[variant=destructive]:focus:bg-destructive/20 fk:[&_svg]:pointer-events-none fk:[&_svg]:shrink-0 fk:[&_svg:not([class*='size-'])]:size-4 fk:[&_svg:not([class*='text-'])]:text-muted-foreground fk:data-[variant=destructive]:*:[svg]:text-destructive!",e),...d})}function P({className:e,children:o,checked:a$1,...d}){return jsxs(DropdownMenu.CheckboxItem,{"data-slot":"dropdown-menu-checkbox-item",className:a("fk:relative fk:flex fk:cursor-default fk:items-center fk:gap-2 fk:rounded-sm fk:py-1.5 fk:pr-2 fk:pl-8 fk:text-sm fk:outline-hidden fk:select-none fk:focus:bg-accent fk:focus:text-accent-foreground fk:data-[disabled]:pointer-events-none fk:data-[disabled]:opacity-50 fk:[&_svg]:pointer-events-none fk:[&_svg]:shrink-0 fk:[&_svg:not([class*='size-'])]:size-4",e),checked:a$1,...d,children:[jsx("span",{className:"fk:pointer-events-none fk:absolute fk:left-2 fk:flex fk:size-3.5 fk:items-center fk:justify-center",children:jsx(DropdownMenu.ItemIndicator,{children:jsx(CheckIcon,{className:"size-4"})})}),o]})}function D({...e}){return jsx(DropdownMenu.RadioGroup,{"data-slot":"dropdown-menu-radio-group",...e})}function M({className:e,children:o,...a$1}){return jsxs(DropdownMenu.RadioItem,{"data-slot":"dropdown-menu-radio-item",className:a("fk:relative fk:flex fk:cursor-default fk:items-center fk:gap-2 fk:rounded-sm fk:py-1.5 fk:pr-2 fk:pl-8 fk:text-sm fk:outline-hidden fk:select-none fk:focus:bg-accent fk:focus:text-accent-foreground fk:data-[disabled]:pointer-events-none fk:data-[disabled]:opacity-50 fk:[&_svg]:pointer-events-none fk:[&_svg]:shrink-0 fk:[&_svg:not([class*='size-'])]:size-4",e),...a$1,children:[jsx("span",{className:"fk:pointer-events-none fk:absolute fk:left-2 fk:flex fk:size-3.5 fk:items-center fk:justify-center",children:jsx(DropdownMenu.ItemIndicator,{children:jsx(CircleIcon,{className:"size-2 fill-current"})})}),o]})}function h({className:e,inset:o,...a$1}){return jsx(DropdownMenu.Label,{"data-slot":"dropdown-menu-label","data-inset":o,className:a("fk:px-2 fk:py-1.5 fk:text-sm fk:font-medium fk:data-[inset]:pl-8",e),...a$1})}function C({className:e,...o}){return jsx(DropdownMenu.Separator,{"data-slot":"dropdown-menu-separator",className:a("fk:-mx-1 fk:my-1 fk:h-px fk:bg-border",e),...o})}function R({className:e,...o}){return jsx("span",{"data-slot":"dropdown-menu-shortcut",className:a("fk:ml-auto fk:text-xs fk:tracking-widest fk:text-muted-foreground",e),...o})}function y({...e}){return jsx(DropdownMenu.Sub,{"data-slot":"dropdown-menu-sub",...e})}function I({className:e,inset:o,children:a$1,...d}){return jsxs(DropdownMenu.SubTrigger,{"data-slot":"dropdown-menu-sub-trigger","data-inset":o,className:a("fk:flex fk:cursor-default fk:items-center fk:gap-2 fk:rounded-sm fk:px-2 fk:py-1.5 fk:text-sm fk:outline-hidden fk:select-none fk:focus:bg-accent fk:focus:text-accent-foreground fk:data-[inset]:pl-8 fk:data-[state=open]:bg-accent fk:data-[state=open]:text-accent-foreground fk:[&_svg]:pointer-events-none fk:[&_svg]:shrink-0 fk:[&_svg:not([class*='size-'])]:size-4 fk:[&_svg:not([class*='text-'])]:text-muted-foreground",e),...d,children:[a$1,jsx(ChevronRightIcon,{className:"fk:ml-auto fk:size-4"})]})}function z({className:e,...o}){return jsx(DropdownMenu.SubContent,{"data-slot":"dropdown-menu-sub-content",className:a("fk:z-50 fk:min-w-32 fk:origin-(--radix-dropdown-menu-content-transform-origin) fk:overflow-hidden fk:rounded-md fk:border fk:bg-popover fk:p-1 fk:text-popover-foreground fk:shadow-lg fk:data-[side=bottom]:slide-in-from-top-2 fk:data-[side=left]:slide-in-from-right-2 fk:data-[side=right]:slide-in-from-left-2 fk:data-[side=top]:slide-in-from-bottom-2 fk:data-[state=closed]:animate-out fk:data-[state=closed]:fade-out-0 fk:data-[state=closed]:zoom-out-95 fk:data-[state=open]:animate-in fk:data-[state=open]:fade-in-0 fk:data-[state=open]:zoom-in-95",e),...o})}function T({className:e,...o}){return jsx("div",{"data-slot":"skeleton",className:a("fk:animate-pulse fk:rounded-md fk:bg-accent",e),...o})}export{l as a,v as b,g as c,w as d,b as e,x as f,P as g,D as h,M as i,h as j,C as k,R as l,y as m,I as n,z as o,T as p};//# sourceMappingURL=chunk-HIHVCQ4Z.js.map
2
+ //# sourceMappingURL=chunk-HIHVCQ4Z.js.map