@intlayer/design-system 8.2.2 → 8.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (205) hide show
  1. package/dist/esm/components/Accordion/Accordion.mjs.map +1 -1
  2. package/dist/esm/components/Avatar/index.mjs.map +1 -1
  3. package/dist/esm/components/Badge/index.mjs.map +1 -1
  4. package/dist/esm/components/Breadcrumb/index.mjs.map +1 -1
  5. package/dist/esm/components/Browser/Browser.mjs.map +1 -1
  6. package/dist/esm/components/Button/Button.mjs.map +1 -1
  7. package/dist/esm/components/Carousel/index.mjs.map +1 -1
  8. package/dist/esm/components/ClickOutsideDiv/index.mjs.map +1 -1
  9. package/dist/esm/components/CollapsibleTable/CollapsibleTable.mjs.map +1 -1
  10. package/dist/esm/components/Command/index.mjs.map +1 -1
  11. package/dist/esm/components/Container/index.mjs.map +1 -1
  12. package/dist/esm/components/ContentEditor/ContentEditor.mjs.map +1 -1
  13. package/dist/esm/components/ContentEditor/ContentEditorInput.mjs.map +1 -1
  14. package/dist/esm/components/ContentEditor/ContentEditorTextArea.mjs.map +1 -1
  15. package/dist/esm/components/ContentSelector/ContentSelector.mjs.map +1 -1
  16. package/dist/esm/components/CopyButton/index.mjs.map +1 -1
  17. package/dist/esm/components/CopyToClipboard/index.mjs.map +1 -1
  18. package/dist/esm/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
  19. package/dist/esm/components/DictionaryEditor/ItemLayout.mjs.map +1 -1
  20. package/dist/esm/components/DictionaryEditor/NodeWrapper/ArrayWrapper.mjs.map +1 -1
  21. package/dist/esm/components/DictionaryEditor/NodeWrapper/ConditionWrapper.mjs.map +1 -1
  22. package/dist/esm/components/DictionaryEditor/NodeWrapper/EnumerationWrapper.mjs.map +1 -1
  23. package/dist/esm/components/DictionaryEditor/NodeWrapper/FileWrapper.mjs.map +1 -1
  24. package/dist/esm/components/DictionaryEditor/NodeWrapper/HtmlWrapper.mjs.map +1 -1
  25. package/dist/esm/components/DictionaryEditor/NodeWrapper/InsertionWrapper.mjs.map +1 -1
  26. package/dist/esm/components/DictionaryEditor/NodeWrapper/MarkdownWrapper.mjs.map +1 -1
  27. package/dist/esm/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs.map +1 -1
  28. package/dist/esm/components/DictionaryEditor/NodeWrapper/StringWrapper.mjs.map +1 -1
  29. package/dist/esm/components/DictionaryEditor/NodeWrapper/TranslationWrapper.mjs.map +1 -1
  30. package/dist/esm/components/DictionaryEditor/NodeWrapper/index.mjs.map +1 -1
  31. package/dist/esm/components/DictionaryFieldEditor/ContentEditor.mjs.map +1 -1
  32. package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
  33. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
  34. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
  35. package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
  36. package/dist/esm/components/DictionaryFieldEditor/EnumKeyInput.mjs.map +1 -1
  37. package/dist/esm/components/DictionaryFieldEditor/JSONEditor.mjs.map +1 -1
  38. package/dist/esm/components/DictionaryFieldEditor/KeyPathBreadcrumb.mjs.map +1 -1
  39. package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
  40. package/dist/esm/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
  41. package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  42. package/dist/esm/components/DictionaryFieldEditor/StructureEditor.mjs.map +1 -1
  43. package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs.map +1 -1
  44. package/dist/esm/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs.map +1 -1
  45. package/dist/esm/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs.map +1 -1
  46. package/dist/esm/components/DropDown/index.mjs.map +1 -1
  47. package/dist/esm/components/EditableField/EditableFieldInput.mjs.map +1 -1
  48. package/dist/esm/components/EditableField/EditableFieldLayout.mjs.map +1 -1
  49. package/dist/esm/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
  50. package/dist/esm/components/ExpandCollapse/ExpandCollapse.mjs.map +1 -1
  51. package/dist/esm/components/Flags/Flag.mjs.map +1 -1
  52. package/dist/esm/components/Footer/index.mjs.map +1 -1
  53. package/dist/esm/components/Form/FormBase.mjs.map +1 -1
  54. package/dist/esm/components/Form/FormControl.mjs.map +1 -1
  55. package/dist/esm/components/Form/FormDescription.mjs.map +1 -1
  56. package/dist/esm/components/Form/FormField.mjs.map +1 -1
  57. package/dist/esm/components/Form/FormItem.mjs.map +1 -1
  58. package/dist/esm/components/Form/FormLabel.mjs.map +1 -1
  59. package/dist/esm/components/Form/FormMessage.mjs.map +1 -1
  60. package/dist/esm/components/Form/elements/AutoSizeTextAreaElement.mjs.map +1 -1
  61. package/dist/esm/components/Form/elements/CheckboxElement.mjs.map +1 -1
  62. package/dist/esm/components/Form/elements/EditableFieldInputElement.mjs.map +1 -1
  63. package/dist/esm/components/Form/elements/EditableFieldTextAreaElement.mjs.map +1 -1
  64. package/dist/esm/components/Form/elements/FormElement.mjs.map +1 -1
  65. package/dist/esm/components/Form/elements/FormElementWrapper.mjs.map +1 -1
  66. package/dist/esm/components/Form/elements/InputElement.mjs.map +1 -1
  67. package/dist/esm/components/Form/elements/InputPasswordElement.mjs.map +1 -1
  68. package/dist/esm/components/Form/elements/MultiselectElement.mjs.map +1 -1
  69. package/dist/esm/components/Form/elements/OTPElement.mjs.map +1 -1
  70. package/dist/esm/components/Form/elements/SearchInputElement.mjs.map +1 -1
  71. package/dist/esm/components/Form/elements/SelectElement.mjs.map +1 -1
  72. package/dist/esm/components/Form/elements/SwitchSelectorElement.mjs.map +1 -1
  73. package/dist/esm/components/Form/elements/TextAreaElement.mjs.map +1 -1
  74. package/dist/esm/components/Form/layout/FormItemLayout.mjs.map +1 -1
  75. package/dist/esm/components/Form/layout/FormLabelLayout.mjs.map +1 -1
  76. package/dist/esm/components/Form/layout/RequiredStar.mjs.map +1 -1
  77. package/dist/esm/components/HTMLRender/HTMLRender.mjs.map +1 -1
  78. package/dist/esm/components/Headers/index.mjs.map +1 -1
  79. package/dist/esm/components/HeightResizer/index.mjs.map +1 -1
  80. package/dist/esm/components/HideShow/index.mjs.map +1 -1
  81. package/dist/esm/components/IDE/Code.mjs.map +1 -1
  82. package/dist/esm/components/IDE/CodeBlockClient.mjs.map +1 -1
  83. package/dist/esm/components/IDE/CodeBlockServer.mjs.map +1 -1
  84. package/dist/esm/components/IDE/CodeBlockShiki.mjs +1 -1
  85. package/dist/esm/components/IDE/CodeBlockShiki.mjs.map +1 -1
  86. package/dist/esm/components/IDE/CodeConditionalRenderer.mjs.map +1 -1
  87. package/dist/esm/components/IDE/CodeContext.mjs.map +1 -1
  88. package/dist/esm/components/IDE/CodeFormatSelector.mjs.map +1 -1
  89. package/dist/esm/components/IDE/ContentDeclarationFormatSelector.mjs.map +1 -1
  90. package/dist/esm/components/IDE/CopyCode.mjs.map +1 -1
  91. package/dist/esm/components/IDE/FileList.mjs.map +1 -1
  92. package/dist/esm/components/IDE/FileTree.mjs.map +1 -1
  93. package/dist/esm/components/IDE/IDE.mjs.map +1 -1
  94. package/dist/esm/components/IDE/MarkDownRender.mjs.map +1 -1
  95. package/dist/esm/components/IDE/MonacoCode.mjs.map +1 -1
  96. package/dist/esm/components/IDE/PackageManagerSelector.mjs.map +1 -1
  97. package/dist/esm/components/InformationTag/index.mjs.map +1 -1
  98. package/dist/esm/components/Input/Checkbox.mjs.map +1 -1
  99. package/dist/esm/components/Input/Input.mjs +1 -1
  100. package/dist/esm/components/Input/Input.mjs.map +1 -1
  101. package/dist/esm/components/Input/InputPassword.mjs.map +1 -1
  102. package/dist/esm/components/Input/OTPInput.mjs.map +1 -1
  103. package/dist/esm/components/Input/SearchInput.mjs.map +1 -1
  104. package/dist/esm/components/KeyboardScreenAdapter/index.mjs.map +1 -1
  105. package/dist/esm/components/KeyboardShortcut/KeyboardShortcut.mjs.map +1 -1
  106. package/dist/esm/components/Label/index.mjs +1 -1
  107. package/dist/esm/components/Label/index.mjs.map +1 -1
  108. package/dist/esm/components/LanguageBackground/index.mjs.map +1 -1
  109. package/dist/esm/components/Link/Link.mjs +1 -1
  110. package/dist/esm/components/Link/Link.mjs.map +1 -1
  111. package/dist/esm/components/Loader/index.mjs.map +1 -1
  112. package/dist/esm/components/Loader/spinner.mjs.map +1 -1
  113. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
  114. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs.map +1 -1
  115. package/dist/esm/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs.map +1 -1
  116. package/dist/esm/components/Logo/Logo.mjs.map +1 -1
  117. package/dist/esm/components/Logo/LogoTextOnly.mjs.map +1 -1
  118. package/dist/esm/components/Logo/LogoWithText.mjs.map +1 -1
  119. package/dist/esm/components/Logo/LogoWithTextBelow.mjs.map +1 -1
  120. package/dist/esm/components/MarkDownRender/MarkDownRender.mjs +1 -1
  121. package/dist/esm/components/MarkDownRender/MarkDownRender.mjs.map +1 -1
  122. package/dist/esm/components/MarkDownRender/index.mjs +1 -1
  123. package/dist/esm/components/MaxHeightSmoother/index.mjs.map +1 -1
  124. package/dist/esm/components/MaxWidthSmoother/index.mjs.map +1 -1
  125. package/dist/esm/components/Modal/Modal.mjs.map +1 -1
  126. package/dist/esm/components/Navbar/Burger.mjs.map +1 -1
  127. package/dist/esm/components/Navbar/DesktopNavbar.mjs.map +1 -1
  128. package/dist/esm/components/Navbar/MobileNavbar.mjs.map +1 -1
  129. package/dist/esm/components/Navbar/index.mjs.map +1 -1
  130. package/dist/esm/components/Pagination/NumberItemsSelector.mjs.map +1 -1
  131. package/dist/esm/components/Pagination/Pagination.mjs.map +1 -1
  132. package/dist/esm/components/Pagination/ShowingResultsNumberItems.mjs.map +1 -1
  133. package/dist/esm/components/Pattern/DotPattern.mjs.map +1 -1
  134. package/dist/esm/components/Pattern/GridPattern.mjs.map +1 -1
  135. package/dist/esm/components/Pattern/SpotLight.mjs.map +1 -1
  136. package/dist/esm/components/Popover/dynamic.mjs.map +1 -1
  137. package/dist/esm/components/Popover/static.mjs +1 -1
  138. package/dist/esm/components/Popover/static.mjs.map +1 -1
  139. package/dist/esm/components/PressableSpan/PressableSpan.mjs.map +1 -1
  140. package/dist/esm/components/RightDrawer/RightDrawer.mjs.map +1 -1
  141. package/dist/esm/components/Select/Multiselect.mjs.map +1 -1
  142. package/dist/esm/components/Select/Select.mjs +1 -1
  143. package/dist/esm/components/Select/Select.mjs.map +1 -1
  144. package/dist/esm/components/SocialNetworks/DiscordLogo.mjs.map +1 -1
  145. package/dist/esm/components/SocialNetworks/FacebookLogo.mjs.map +1 -1
  146. package/dist/esm/components/SocialNetworks/InstagramLogo.mjs.map +1 -1
  147. package/dist/esm/components/SocialNetworks/LinkedInLogo.mjs.map +1 -1
  148. package/dist/esm/components/SocialNetworks/ProductHuntLogo.mjs.map +1 -1
  149. package/dist/esm/components/SocialNetworks/TiktokLogo.mjs.map +1 -1
  150. package/dist/esm/components/SocialNetworks/XLogo.mjs.map +1 -1
  151. package/dist/esm/components/SocialNetworks/YoutubeLogo.mjs.map +1 -1
  152. package/dist/esm/components/SocialNetworks/index.mjs.map +1 -1
  153. package/dist/esm/components/SwitchSelector/index.mjs.map +1 -1
  154. package/dist/esm/components/Tab/Tab.mjs.map +1 -1
  155. package/dist/esm/components/Tab/TabContext.mjs.map +1 -1
  156. package/dist/esm/components/TabSelector/TabSelector.mjs.map +1 -1
  157. package/dist/esm/components/Table/Table.mjs.map +1 -1
  158. package/dist/esm/components/Tag/index.mjs.map +1 -1
  159. package/dist/esm/components/Terminal/Terminal.mjs.map +1 -1
  160. package/dist/esm/components/TextArea/AutoSizeTextArea.mjs.map +1 -1
  161. package/dist/esm/components/TextArea/AutocompleteTextArea.mjs.map +1 -1
  162. package/dist/esm/components/TextArea/TextArea.mjs.map +1 -1
  163. package/dist/esm/components/ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs.map +1 -1
  164. package/dist/esm/components/ThemeSwitcherDropDown/MobileThemeSwitcher.mjs.map +1 -1
  165. package/dist/esm/components/ThemeSwitcherDropDown/types.mjs.map +1 -1
  166. package/dist/esm/components/Toaster/Toast.mjs.map +1 -1
  167. package/dist/esm/components/Toaster/Toaster.mjs.map +1 -1
  168. package/dist/esm/components/Toaster/useToast.mjs.map +1 -1
  169. package/dist/esm/components/WithResizer/index.mjs.map +1 -1
  170. package/dist/esm/components/index.mjs +1 -1
  171. package/dist/esm/hooks/index.mjs +1 -1
  172. package/dist/esm/hooks/reactQuery.mjs +1 -1
  173. package/dist/esm/hooks/reactQuery.mjs.map +1 -1
  174. package/dist/esm/hooks/useIntlayerAPI.mjs.map +1 -1
  175. package/dist/esm/providers/ReactQueryProvider.mjs.map +1 -1
  176. package/dist/esm/utils/image.mjs.map +1 -1
  177. package/dist/types/components/Badge/index.d.ts +2 -2
  178. package/dist/types/components/Button/Button.d.ts +3 -3
  179. package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts +1 -1
  180. package/dist/types/components/Command/index.d.ts +1 -1
  181. package/dist/types/components/Container/index.d.ts +8 -8
  182. package/dist/types/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.d.ts +1 -1
  183. package/dist/types/components/IDE/CodeBlockClient.d.ts +2 -2
  184. package/dist/types/components/IDE/CodeBlockClient.d.ts.map +1 -1
  185. package/dist/types/components/IDE/CodeBlockShiki.d.ts.map +1 -1
  186. package/dist/types/components/IDE/index.d.ts +2 -2
  187. package/dist/types/components/Input/Checkbox.d.ts +3 -3
  188. package/dist/types/components/Input/Input.d.ts +1 -1
  189. package/dist/types/components/Link/Link.d.ts +4 -4
  190. package/dist/types/components/MarkDownRender/MarkDownRender.d.ts +142 -14
  191. package/dist/types/components/MarkDownRender/MarkDownRender.d.ts.map +1 -1
  192. package/dist/types/components/MarkDownRender/index.d.ts +2 -2
  193. package/dist/types/components/Pagination/Pagination.d.ts +2 -2
  194. package/dist/types/components/Popover/static.d.ts.map +1 -1
  195. package/dist/types/components/Select/Select.d.ts.map +1 -1
  196. package/dist/types/components/Tab/Tab.d.ts +1 -1
  197. package/dist/types/components/TabSelector/TabSelector.d.ts +1 -1
  198. package/dist/types/components/Tag/index.d.ts +3 -3
  199. package/dist/types/components/index.d.ts +3 -3
  200. package/dist/types/hooks/index.d.ts +3 -3
  201. package/dist/types/hooks/reactQuery.d.ts +21 -2
  202. package/dist/types/hooks/reactQuery.d.ts.map +1 -1
  203. package/dist/types/hooks/useIntlayerAPI.d.ts +1 -1
  204. package/dist/types/hooks/useIntlayerAPI.d.ts.map +1 -1
  205. package/package.json +27 -28
@@ -1 +1 @@
1
- {"version":3,"file":"MobileThemeSwitcher.mjs","names":[],"sources":["../../../../src/components/ThemeSwitcherDropDown/MobileThemeSwitcher.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@utils/cn';\nimport { CircleDashed, Moon, Sun } from 'lucide-react';\nimport { type FC, useState } from 'react';\nimport { Modes } from './types';\n\ntype MobileThemeSwitcherProps = {\n theme: Modes;\n systemTheme: Modes;\n setTheme: (theme: Modes) => void;\n};\n\nconst getIconStyle = ({\n isCurrentMode,\n isNextMode,\n}: {\n isCurrentMode: boolean;\n isNextMode: boolean;\n}) =>\n cn(\n `absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2`,\n `opacity-0 transition-opacity duration-300 ease-in-out`,\n isCurrentMode && `opacity-100 group-hover:opacity-0`,\n isNextMode && `group-hover:opacity-100`\n );\n\nexport const MobileThemeSwitcher: FC<MobileThemeSwitcherProps> = ({\n theme,\n systemTheme,\n setTheme,\n}) => {\n const isThemeSystemTheme = systemTheme === theme;\n const defaultMode = isThemeSystemTheme ? Modes.system : theme;\n\n const [mode, setMode] = useState<Modes>(defaultMode);\n\n const nextMode =\n // Start loop\n // If mode is system, toggle the theme inverse of the system theme\n mode === Modes.system\n ? theme === Modes.dark\n ? Modes.light\n : Modes.dark\n : // Close loop\n // If current theme same as system theme, reset by toggle the system theme\n isThemeSystemTheme\n ? Modes.system\n : // Go to next step\n // Otherwise, toggle the remaining theme\n mode === Modes.light\n ? Modes.dark\n : Modes.light;\n\n const toggleMode = () => {\n if (nextMode === Modes.system) {\n setTheme(systemTheme ?? Modes.light);\n } else {\n setTheme(nextMode);\n }\n setMode(nextMode);\n };\n\n return (\n <button className=\"group relative size-10\" aria-label=\"Theme selector\">\n <CircleDashed\n className={getIconStyle({\n isCurrentMode: mode === Modes.system,\n isNextMode: nextMode === Modes.system,\n })}\n onClick={toggleMode}\n data-mode=\"system\"\n />\n\n <Moon\n className={getIconStyle({\n isCurrentMode: mode === Modes.light,\n isNextMode: nextMode === Modes.light,\n })}\n onClick={toggleMode}\n data-mode=\"light\"\n />\n\n <Sun\n className={getIconStyle({\n isCurrentMode: mode === Modes.dark,\n isNextMode: nextMode === Modes.dark,\n })}\n onClick={toggleMode}\n data-mode=\"dark\"\n />\n </button>\n );\n};\n"],"mappings":"2OAaA,MAAM,GAAgB,CACpB,gBACA,gBAKA,EACE,8DACA,wDACA,GAAiB,oCACjB,GAAc,0BACf,CAEU,GAAqD,CAChE,QACA,cACA,cACI,CACJ,IAAM,EAAqB,IAAgB,EAGrC,CAAC,EAAM,GAAW,EAFJ,EAAqB,EAAM,OAAS,EAEJ,CAE9C,EAGJ,IAAS,EAAM,OACX,IAAU,EAAM,KACd,EAAM,MACN,EAAM,KAGR,EACE,EAAM,OAGN,IAAS,EAAM,MACb,EAAM,KACN,EAAM,MAEV,MAAmB,CACnB,IAAa,EAAM,OACrB,EAAS,GAAe,EAAM,MAAM,CAEpC,EAAS,EAAS,CAEpB,EAAQ,EAAS,EAGnB,OACE,EAAC,SAAA,CAAO,UAAU,yBAAyB,aAAW,2BACpD,EAAC,EAAA,CACC,UAAW,EAAa,CACtB,cAAe,IAAS,EAAM,OAC9B,WAAY,IAAa,EAAM,OAChC,CAAC,CACF,QAAS,EACT,YAAU,UACV,CAEF,EAAC,EAAA,CACC,UAAW,EAAa,CACtB,cAAe,IAAS,EAAM,MAC9B,WAAY,IAAa,EAAM,MAChC,CAAC,CACF,QAAS,EACT,YAAU,SACV,CAEF,EAAC,EAAA,CACC,UAAW,EAAa,CACtB,cAAe,IAAS,EAAM,KAC9B,WAAY,IAAa,EAAM,KAChC,CAAC,CACF,QAAS,EACT,YAAU,QACV,GACK"}
1
+ {"version":3,"file":"MobileThemeSwitcher.mjs","names":[],"sources":["../../../../src/components/ThemeSwitcherDropDown/MobileThemeSwitcher.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@utils/cn';\nimport { CircleDashed, Moon, Sun } from 'lucide-react';\nimport { type FC, useState } from 'react';\nimport { Modes } from './types';\n\ntype MobileThemeSwitcherProps = {\n theme: Modes;\n systemTheme: Modes;\n setTheme: (theme: Modes) => void;\n};\n\nconst getIconStyle = ({\n isCurrentMode,\n isNextMode,\n}: {\n isCurrentMode: boolean;\n isNextMode: boolean;\n}) =>\n cn(\n `absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2`,\n `opacity-0 transition-opacity duration-300 ease-in-out`,\n isCurrentMode && `opacity-100 group-hover:opacity-0`,\n isNextMode && `group-hover:opacity-100`\n );\n\nexport const MobileThemeSwitcher: FC<MobileThemeSwitcherProps> = ({\n theme,\n systemTheme,\n setTheme,\n}) => {\n const isThemeSystemTheme = systemTheme === theme;\n const defaultMode = isThemeSystemTheme ? Modes.system : theme;\n\n const [mode, setMode] = useState<Modes>(defaultMode);\n\n const nextMode =\n // Start loop\n // If mode is system, toggle the theme inverse of the system theme\n mode === Modes.system\n ? theme === Modes.dark\n ? Modes.light\n : Modes.dark\n : // Close loop\n // If current theme same as system theme, reset by toggle the system theme\n isThemeSystemTheme\n ? Modes.system\n : // Go to next step\n // Otherwise, toggle the remaining theme\n mode === Modes.light\n ? Modes.dark\n : Modes.light;\n\n const toggleMode = () => {\n if (nextMode === Modes.system) {\n setTheme(systemTheme ?? Modes.light);\n } else {\n setTheme(nextMode);\n }\n setMode(nextMode);\n };\n\n return (\n <button className=\"group relative size-10\" aria-label=\"Theme selector\">\n <CircleDashed\n className={getIconStyle({\n isCurrentMode: mode === Modes.system,\n isNextMode: nextMode === Modes.system,\n })}\n onClick={toggleMode}\n data-mode=\"system\"\n />\n\n <Moon\n className={getIconStyle({\n isCurrentMode: mode === Modes.light,\n isNextMode: nextMode === Modes.light,\n })}\n onClick={toggleMode}\n data-mode=\"light\"\n />\n\n <Sun\n className={getIconStyle({\n isCurrentMode: mode === Modes.dark,\n isNextMode: nextMode === Modes.dark,\n })}\n onClick={toggleMode}\n data-mode=\"dark\"\n />\n </button>\n );\n};\n"],"mappings":"2OAaA,MAAM,GAAgB,CACpB,gBACA,gBAKA,EACE,8DACA,wDACA,GAAiB,oCACjB,GAAc,0BACf,CAEU,GAAqD,CAChE,QACA,cACA,cACI,CACJ,IAAM,EAAqB,IAAgB,EAGrC,CAAC,EAAM,GAAW,EAFJ,EAAqB,EAAM,OAAS,EAEJ,CAE9C,EAGJ,IAAS,EAAM,OACX,IAAU,EAAM,KACd,EAAM,MACN,EAAM,KAGR,EACE,EAAM,OAGN,IAAS,EAAM,MACb,EAAM,KACN,EAAM,MAEV,MAAmB,CACnB,IAAa,EAAM,OACrB,EAAS,GAAe,EAAM,MAAM,CAEpC,EAAS,EAAS,CAEpB,EAAQ,EAAS,EAGnB,OACE,EAAC,SAAD,CAAQ,UAAU,yBAAyB,aAAW,0BAAtD,CACE,EAAC,EAAD,CACE,UAAW,EAAa,CACtB,cAAe,IAAS,EAAM,OAC9B,WAAY,IAAa,EAAM,OAChC,CAAC,CACF,QAAS,EACT,YAAU,SACV,CAAA,CAEF,EAAC,EAAD,CACE,UAAW,EAAa,CACtB,cAAe,IAAS,EAAM,MAC9B,WAAY,IAAa,EAAM,MAChC,CAAC,CACF,QAAS,EACT,YAAU,QACV,CAAA,CAEF,EAAC,EAAD,CACE,UAAW,EAAa,CACtB,cAAe,IAAS,EAAM,KAC9B,WAAY,IAAa,EAAM,KAChC,CAAC,CACF,QAAS,EACT,YAAU,OACV,CAAA,CACK"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.mjs","names":[],"sources":["../../../../src/components/ThemeSwitcherDropDown/types.ts"],"sourcesContent":["export enum Modes {\n dark = 'dark',\n light = 'light',\n system = 'system',\n}\n"],"mappings":"AAAA,IAAY,EAAA,SAAA,EAAL,OACL,GAAA,KAAA,OACA,EAAA,MAAA,QACA,EAAA,OAAA"}
1
+ {"version":3,"file":"types.mjs","names":[],"sources":["../../../../src/components/ThemeSwitcherDropDown/types.ts"],"sourcesContent":["export enum Modes {\n dark = 'dark',\n light = 'light',\n system = 'system',\n}\n"],"mappings":"AAAA,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,KAAA,OACA,EAAA,MAAA,QACA,EAAA,OAAA,eACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"Toast.mjs","names":[],"sources":["../../../../src/components/Toaster/Toast.tsx"],"sourcesContent":["'use client';\n\nimport * as ToastPrimitives from '@radix-ui/react-toast';\nimport { cn } from '@utils/cn';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\nimport type { ComponentProps, FC, ReactElement } from 'react';\n\nconst ToastProvider = ToastPrimitives;\n\nconst ToastViewport: FC<ComponentProps<typeof ToastPrimitives.Viewport>> = ({\n className,\n ...props\n}) => (\n <ToastPrimitives.Viewport\n className={cn(\n 'fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]',\n className\n )}\n {...props}\n />\n);\n\n/**\n * Toast variant styles using class-variance-authority.\n *\n * Defines visual styles for different toast types with semantic colors,\n * animations, and responsive behavior.\n *\n * @example\n * ```tsx\n * // Error toast with red background\n * <Toast variant=\"error\">Error message</Toast>\n *\n * // Success toast with green background\n * <Toast variant=\"success\">Success message</Toast>\n *\n * // Default toast with neutral styling\n * <Toast variant=\"default\">Info message</Toast>\n * ```\n */\nconst toastVariants = cva(\n 'group data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md p-4 pr-6 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[state=closed]:animate-out data-[state=open]:animate-in data-[swipe=end]:animate-out data-[swipe=move]:transition-none',\n {\n variants: {\n /** Toast visual variants for different message types */\n variant: {\n /** Error state with red styling for failures and warnings */\n error: 'bg-error/40 text-text',\n /** Success state with green styling for confirmations */\n success: 'bg-success/30 text-text',\n /** Default neutral styling for general information */\n default: 'bg-card/80 text-text',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n);\n\n/**\n * Toast Component\n *\n * A notification component that displays temporary messages to users using Radix UI primitives.\n * Supports different visual variants, animations, and user interactions including swipe-to-dismiss.\n *\n * ## Features\n * - **Visual Variants**: Error, success, and default styling themes\n * - **Animations**: Smooth slide-in/slide-out transitions with fade effects\n * - **Swipe Gestures**: Touch-friendly swipe-to-dismiss functionality\n * - **Accessibility**: Full screen reader support and keyboard navigation\n * - **Positioning**: Smart positioning with responsive viewport handling\n * - **Auto-dismiss**: Configurable automatic dismissal timing\n *\n * ## Technical Implementation\n * - Built on Radix UI Toast primitives for accessibility compliance\n * - Uses Framer Motion for smooth animations and gestures\n * - CVA (class-variance-authority) for consistent styling variants\n * - Backdrop blur effects for modern visual appeal\n * - CSS transforms for hardware-accelerated animations\n *\n * @example\n * ```tsx\n * // Basic toast with title and description\n * <Toast variant=\"default\">\n * <ToastTitle>Notification</ToastTitle>\n * <ToastDescription>Your action was completed successfully.</ToastDescription>\n * <ToastClose />\n * </Toast>\n *\n * // Error toast with action button\n * <Toast variant=\"error\">\n * <ToastTitle>Upload Failed</ToastTitle>\n * <ToastDescription>Could not upload file. Please try again.</ToastDescription>\n * <ToastAction altText=\"Retry upload\">Retry</ToastAction>\n * <ToastClose />\n * </Toast>\n * ```\n */\nconst Toast: FC<\n ComponentProps<typeof ToastPrimitives.Root> &\n VariantProps<typeof toastVariants>\n> = ({ className, variant, ...props }) => {\n return (\n <ToastPrimitives.Root\n className={cn(toastVariants({ variant }), className)}\n {...props}\n />\n );\n};\n\n/**\n * ToastAction Component\n *\n * An interactive button component for toast notifications that allows users to take\n * actions related to the notification message.\n *\n * ## Features\n * - **Accessibility**: Requires `altText` prop for screen readers\n * - **Visual States**: Hover, focus, and disabled state styling\n * - **Theme Integration**: Supports destructive and default themes\n * - **Keyboard Navigation**: Full keyboard accessibility support\n *\n * ## Usage Guidelines\n * - Use for actionable notifications (retry, undo, view details)\n * - Keep action text short and descriptive\n * - Provide meaningful `altText` for accessibility\n * - Limit to one primary action per toast\n *\n * @example\n * ```tsx\n * // Retry action for failed operations\n * <ToastAction altText=\"Retry the failed operation\">\n * Retry\n * </ToastAction>\n *\n * // Undo action for reversible operations\n * <ToastAction altText=\"Undo the last action\">\n * Undo\n * </ToastAction>\n *\n * // Navigation action\n * <ToastAction altText=\"View the uploaded file\">\n * View File\n * </ToastAction>\n * ```\n */\nconst ToastAction: FC<ComponentProps<typeof ToastPrimitives.Action>> = ({\n className,\n ...props\n}) => (\n <ToastPrimitives.Action\n className={cn(\n 'inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 font-medium text-sm transition-colors hover:bg-text focus:outline-hidden focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:focus:ring-destructive group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground',\n className\n )}\n {...props}\n />\n);\n\nconst ToastClose: FC<ComponentProps<typeof ToastPrimitives.Close>> = ({\n className,\n ...props\n}) => (\n <ToastPrimitives.Close\n className={cn(\n 'absolute top-1 right-1 rounded-md p-1 text-text/50 opacity-0 transition-opacity hover:text-text/80 focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600 group-[.destructive]:hover:text-red-50',\n className\n )}\n toast-close=\"\"\n {...props}\n >\n <X className=\"size-5\" />\n </ToastPrimitives.Close>\n);\n/**\n * ToastTitle Component\n *\n * The primary heading text for toast notifications. Provides semantic structure\n * and proper typography hierarchy within the toast.\n *\n * ## Styling Features\n * - Semi-bold font weight for emphasis\n * - Automatic text sizing adjustments for descriptions\n * - Proper spacing relationships with other toast elements\n *\n * @example\n * ```tsx\n * <ToastTitle>File Upload Complete</ToastTitle>\n * <ToastTitle>Error: Connection Failed</ToastTitle>\n * <ToastTitle>Settings Saved</ToastTitle>\n * ```\n */\nconst ToastTitle: FC<ComponentProps<typeof ToastPrimitives.Title>> = ({\n className,\n ...props\n}) => (\n <ToastPrimitives.Title\n className={cn('font-semibold text-sm [&+div]:text-xs', className)}\n {...props}\n />\n);\n\n/**\n * ToastDescription Component\n *\n * Supporting text that provides additional context or details for the toast notification.\n * Complements the ToastTitle with more detailed information.\n *\n * ## Styling Features\n * - Slightly reduced opacity for visual hierarchy\n * - Smaller text size than title\n * - Optimal line height for readability\n *\n * ## Content Guidelines\n * - Keep descriptions concise but informative\n * - Provide actionable information when possible\n * - Use plain language for better accessibility\n *\n * @example\n * ```tsx\n * <ToastDescription>\n * Your document has been uploaded successfully and is now available for sharing.\n * </ToastDescription>\n *\n * <ToastDescription>\n * Please check your internet connection and try again.\n * </ToastDescription>\n * ```\n */\nconst ToastDescription: FC<\n ComponentProps<typeof ToastPrimitives.Description>\n> = ({ className, ...props }) => (\n <ToastPrimitives.Description\n className={cn('text-sm opacity-90', className)}\n {...props}\n />\n);\n/**\n * Props type for Toast component including all Radix UI Toast.Root props\n * and variant styling options.\n */\ntype ToastProps = ComponentProps<typeof Toast>;\n\n/**\n * Type for ToastAction elements used in toast configurations.\n * Ensures type safety when passing action elements to toast functions.\n */\ntype ToastActionElement = ReactElement<typeof ToastAction>;\n\nexport {\n Toast,\n ToastAction,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n type ToastActionElement,\n type ToastProps,\n};\n"],"mappings":"qNAQA,MAAM,EAAgB,EAEhB,GAAsE,CAC1E,YACA,GAAG,KAEH,EAAC,EAAgB,SAAA,CACf,UAAW,EACT,kIACA,EACD,CACD,GAAI,GACJ,CAqBE,EAAgB,EACpB,ioBACA,CACE,SAAU,CAER,QAAS,CAEP,MAAO,wBAEP,QAAS,0BAET,QAAS,uBACV,CACF,CACD,gBAAiB,CACf,QAAS,UACV,CACF,CACF,CAyCK,GAGD,CAAE,YAAW,UAAS,GAAG,KAE1B,EAAC,EAAgB,KAAA,CACf,UAAW,EAAG,EAAc,CAAE,UAAS,CAAC,CAAE,EAAU,CACpD,GAAI,GACJ,CAwCA,GAAkE,CACtE,YACA,GAAG,KAEH,EAAC,EAAgB,OAAA,CACf,UAAW,EACT,udACA,EACD,CACD,GAAI,GACJ,CAGE,GAAgE,CACpE,YACA,GAAG,KAEH,EAAC,EAAgB,MAAA,CACf,UAAW,EACT,iVACA,EACD,CACD,cAAY,GACZ,GAAI,WAEJ,EAAC,EAAA,CAAE,UAAU,SAAA,CAAW,EACF,CAoBpB,GAAgE,CACpE,YACA,GAAG,KAEH,EAAC,EAAgB,MAAA,CACf,UAAW,EAAG,wCAAyC,EAAU,CACjE,GAAI,GACJ,CA8BE,GAED,CAAE,YAAW,GAAG,KACnB,EAAC,EAAgB,YAAA,CACf,UAAW,EAAG,qBAAsB,EAAU,CAC9C,GAAI,GACJ"}
1
+ {"version":3,"file":"Toast.mjs","names":[],"sources":["../../../../src/components/Toaster/Toast.tsx"],"sourcesContent":["'use client';\n\nimport * as ToastPrimitives from '@radix-ui/react-toast';\nimport { cn } from '@utils/cn';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { X } from 'lucide-react';\nimport type { ComponentProps, FC, ReactElement } from 'react';\n\nconst ToastProvider = ToastPrimitives;\n\nconst ToastViewport: FC<ComponentProps<typeof ToastPrimitives.Viewport>> = ({\n className,\n ...props\n}) => (\n <ToastPrimitives.Viewport\n className={cn(\n 'fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-[420px]',\n className\n )}\n {...props}\n />\n);\n\n/**\n * Toast variant styles using class-variance-authority.\n *\n * Defines visual styles for different toast types with semantic colors,\n * animations, and responsive behavior.\n *\n * @example\n * ```tsx\n * // Error toast with red background\n * <Toast variant=\"error\">Error message</Toast>\n *\n * // Success toast with green background\n * <Toast variant=\"success\">Success message</Toast>\n *\n * // Default toast with neutral styling\n * <Toast variant=\"default\">Info message</Toast>\n * ```\n */\nconst toastVariants = cva(\n 'group data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md p-4 pr-6 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[state=closed]:animate-out data-[state=open]:animate-in data-[swipe=end]:animate-out data-[swipe=move]:transition-none',\n {\n variants: {\n /** Toast visual variants for different message types */\n variant: {\n /** Error state with red styling for failures and warnings */\n error: 'bg-error/40 text-text',\n /** Success state with green styling for confirmations */\n success: 'bg-success/30 text-text',\n /** Default neutral styling for general information */\n default: 'bg-card/80 text-text',\n },\n },\n defaultVariants: {\n variant: 'default',\n },\n }\n);\n\n/**\n * Toast Component\n *\n * A notification component that displays temporary messages to users using Radix UI primitives.\n * Supports different visual variants, animations, and user interactions including swipe-to-dismiss.\n *\n * ## Features\n * - **Visual Variants**: Error, success, and default styling themes\n * - **Animations**: Smooth slide-in/slide-out transitions with fade effects\n * - **Swipe Gestures**: Touch-friendly swipe-to-dismiss functionality\n * - **Accessibility**: Full screen reader support and keyboard navigation\n * - **Positioning**: Smart positioning with responsive viewport handling\n * - **Auto-dismiss**: Configurable automatic dismissal timing\n *\n * ## Technical Implementation\n * - Built on Radix UI Toast primitives for accessibility compliance\n * - Uses Framer Motion for smooth animations and gestures\n * - CVA (class-variance-authority) for consistent styling variants\n * - Backdrop blur effects for modern visual appeal\n * - CSS transforms for hardware-accelerated animations\n *\n * @example\n * ```tsx\n * // Basic toast with title and description\n * <Toast variant=\"default\">\n * <ToastTitle>Notification</ToastTitle>\n * <ToastDescription>Your action was completed successfully.</ToastDescription>\n * <ToastClose />\n * </Toast>\n *\n * // Error toast with action button\n * <Toast variant=\"error\">\n * <ToastTitle>Upload Failed</ToastTitle>\n * <ToastDescription>Could not upload file. Please try again.</ToastDescription>\n * <ToastAction altText=\"Retry upload\">Retry</ToastAction>\n * <ToastClose />\n * </Toast>\n * ```\n */\nconst Toast: FC<\n ComponentProps<typeof ToastPrimitives.Root> &\n VariantProps<typeof toastVariants>\n> = ({ className, variant, ...props }) => {\n return (\n <ToastPrimitives.Root\n className={cn(toastVariants({ variant }), className)}\n {...props}\n />\n );\n};\n\n/**\n * ToastAction Component\n *\n * An interactive button component for toast notifications that allows users to take\n * actions related to the notification message.\n *\n * ## Features\n * - **Accessibility**: Requires `altText` prop for screen readers\n * - **Visual States**: Hover, focus, and disabled state styling\n * - **Theme Integration**: Supports destructive and default themes\n * - **Keyboard Navigation**: Full keyboard accessibility support\n *\n * ## Usage Guidelines\n * - Use for actionable notifications (retry, undo, view details)\n * - Keep action text short and descriptive\n * - Provide meaningful `altText` for accessibility\n * - Limit to one primary action per toast\n *\n * @example\n * ```tsx\n * // Retry action for failed operations\n * <ToastAction altText=\"Retry the failed operation\">\n * Retry\n * </ToastAction>\n *\n * // Undo action for reversible operations\n * <ToastAction altText=\"Undo the last action\">\n * Undo\n * </ToastAction>\n *\n * // Navigation action\n * <ToastAction altText=\"View the uploaded file\">\n * View File\n * </ToastAction>\n * ```\n */\nconst ToastAction: FC<ComponentProps<typeof ToastPrimitives.Action>> = ({\n className,\n ...props\n}) => (\n <ToastPrimitives.Action\n className={cn(\n 'inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 font-medium text-sm transition-colors hover:bg-text focus:outline-hidden focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:focus:ring-destructive group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground',\n className\n )}\n {...props}\n />\n);\n\nconst ToastClose: FC<ComponentProps<typeof ToastPrimitives.Close>> = ({\n className,\n ...props\n}) => (\n <ToastPrimitives.Close\n className={cn(\n 'absolute top-1 right-1 rounded-md p-1 text-text/50 opacity-0 transition-opacity hover:text-text/80 focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600 group-[.destructive]:hover:text-red-50',\n className\n )}\n toast-close=\"\"\n {...props}\n >\n <X className=\"size-5\" />\n </ToastPrimitives.Close>\n);\n/**\n * ToastTitle Component\n *\n * The primary heading text for toast notifications. Provides semantic structure\n * and proper typography hierarchy within the toast.\n *\n * ## Styling Features\n * - Semi-bold font weight for emphasis\n * - Automatic text sizing adjustments for descriptions\n * - Proper spacing relationships with other toast elements\n *\n * @example\n * ```tsx\n * <ToastTitle>File Upload Complete</ToastTitle>\n * <ToastTitle>Error: Connection Failed</ToastTitle>\n * <ToastTitle>Settings Saved</ToastTitle>\n * ```\n */\nconst ToastTitle: FC<ComponentProps<typeof ToastPrimitives.Title>> = ({\n className,\n ...props\n}) => (\n <ToastPrimitives.Title\n className={cn('font-semibold text-sm [&+div]:text-xs', className)}\n {...props}\n />\n);\n\n/**\n * ToastDescription Component\n *\n * Supporting text that provides additional context or details for the toast notification.\n * Complements the ToastTitle with more detailed information.\n *\n * ## Styling Features\n * - Slightly reduced opacity for visual hierarchy\n * - Smaller text size than title\n * - Optimal line height for readability\n *\n * ## Content Guidelines\n * - Keep descriptions concise but informative\n * - Provide actionable information when possible\n * - Use plain language for better accessibility\n *\n * @example\n * ```tsx\n * <ToastDescription>\n * Your document has been uploaded successfully and is now available for sharing.\n * </ToastDescription>\n *\n * <ToastDescription>\n * Please check your internet connection and try again.\n * </ToastDescription>\n * ```\n */\nconst ToastDescription: FC<\n ComponentProps<typeof ToastPrimitives.Description>\n> = ({ className, ...props }) => (\n <ToastPrimitives.Description\n className={cn('text-sm opacity-90', className)}\n {...props}\n />\n);\n/**\n * Props type for Toast component including all Radix UI Toast.Root props\n * and variant styling options.\n */\ntype ToastProps = ComponentProps<typeof Toast>;\n\n/**\n * Type for ToastAction elements used in toast configurations.\n * Ensures type safety when passing action elements to toast functions.\n */\ntype ToastActionElement = ReactElement<typeof ToastAction>;\n\nexport {\n Toast,\n ToastAction,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n type ToastActionElement,\n type ToastProps,\n};\n"],"mappings":"qNAQA,MAAM,EAAgB,EAEhB,GAAsE,CAC1E,YACA,GAAG,KAEH,EAAC,EAAgB,SAAjB,CACE,UAAW,EACT,kIACA,EACD,CACD,GAAI,EACJ,CAAA,CAqBE,EAAgB,EACpB,ioBACA,CACE,SAAU,CAER,QAAS,CAEP,MAAO,wBAEP,QAAS,0BAET,QAAS,uBACV,CACF,CACD,gBAAiB,CACf,QAAS,UACV,CACF,CACF,CAyCK,GAGD,CAAE,YAAW,UAAS,GAAG,KAE1B,EAAC,EAAgB,KAAjB,CACE,UAAW,EAAG,EAAc,CAAE,UAAS,CAAC,CAAE,EAAU,CACpD,GAAI,EACJ,CAAA,CAwCA,GAAkE,CACtE,YACA,GAAG,KAEH,EAAC,EAAgB,OAAjB,CACE,UAAW,EACT,udACA,EACD,CACD,GAAI,EACJ,CAAA,CAGE,GAAgE,CACpE,YACA,GAAG,KAEH,EAAC,EAAgB,MAAjB,CACE,UAAW,EACT,iVACA,EACD,CACD,cAAY,GACZ,GAAI,WAEJ,EAAC,EAAD,CAAG,UAAU,SAAW,CAAA,CACF,CAAA,CAoBpB,GAAgE,CACpE,YACA,GAAG,KAEH,EAAC,EAAgB,MAAjB,CACE,UAAW,EAAG,wCAAyC,EAAU,CACjE,GAAI,EACJ,CAAA,CA8BE,GAED,CAAE,YAAW,GAAG,KACnB,EAAC,EAAgB,YAAjB,CACE,UAAW,EAAG,qBAAsB,EAAU,CAC9C,GAAI,EACJ,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"Toaster.mjs","names":[],"sources":["../../../../src/components/Toaster/Toaster.tsx"],"sourcesContent":["'use client';\n\nimport {\n Toast,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n} from './Toast';\nimport { useToast } from './useToast';\n\n/**\n * Toast notification provider component that renders active toast notifications.\n *\n * This component serves as the visual layer for the toast system, rendering all\n * active toasts and handling their animations and positioning. It should be placed\n * at a high level in your component tree to ensure toasts appear above other content.\n *\n * ## Features\n * - **Global Toast Rendering**: Renders all toasts from the global state\n * - **Automatic Positioning**: Uses Radix UI positioning system\n * - **Animation Integration**: Handles enter/exit animations for toasts\n * - **Accessibility**: Provides proper ARIA landmarks and focus management\n * - **Portal Rendering**: Renders toasts in a portal for z-index safety\n *\n * ## Positioning\n * Toasts are positioned at the bottom-right of the viewport by default.\n * This can be customized through the ToastViewport component styling.\n *\n * ## Integration\n * Place this component near the root of your application, typically:\n * - Next.js: In _app.tsx or layout.tsx\n * - React: In your main App component\n * - Ensure it's outside any containers that might clip overflow\n *\n * ## Usage Example\n * Place Toaster component at the root level of your application to ensure\n * toast notifications appear above all other content. Components throughout\n * your app can then use the useToast hook to display notifications.\n *\n * ## Styling Notes\n * - Toasts use fixed positioning to appear above all other content\n * - The viewport is styled for bottom-right positioning by default\n * - Animations are handled automatically through Radix UI primitives\n * - Custom positioning can be achieved by styling the ToastViewport\n *\n * ## Performance\n * - Only active toasts are rendered (dismissed toasts are cleaned up)\n * - Animations are hardware-accelerated where possible\n * - Memory usage is minimal due to automatic cleanup\n *\n * @returns JSX element rendering the toast viewport and active toasts\n */\nexport const Toaster = () => {\n const { toasts } = useToast();\n\n return (\n <ToastProvider.Provider>\n {toasts.map(({ id, title, description, action, ...props }) => (\n <Toast key={id} {...props}>\n <div className=\"grid gap-1\">\n {title && <ToastTitle>{title}</ToastTitle>}\n {description && <ToastDescription>{description}</ToastDescription>}\n </div>\n {action}\n <ToastClose />\n </Toast>\n ))}\n <ToastViewport />\n </ToastProvider.Provider>\n );\n};\n"],"mappings":"yOAsDA,MAAa,MAAgB,CAC3B,GAAM,CAAE,UAAW,GAAU,CAE7B,OACE,EAAC,EAAc,SAAA,CAAA,SAAA,CACZ,EAAO,KAAK,CAAE,KAAI,QAAO,cAAa,SAAQ,GAAG,KAChD,EAAC,EAAA,CAAe,GAAI,YAClB,EAAC,MAAA,CAAI,UAAU,uBACZ,GAAS,EAAC,EAAA,CAAA,SAAY,EAAA,CAAmB,CACzC,GAAe,EAAC,EAAA,CAAA,SAAkB,EAAA,CAA+B,CAAA,EAC9D,CACL,EACD,EAAC,EAAA,EAAA,CAAa,GANJ,EAOJ,CACR,CACF,EAAC,EAAA,EAAA,CAAgB,CAAA,CAAA,CACM"}
1
+ {"version":3,"file":"Toaster.mjs","names":[],"sources":["../../../../src/components/Toaster/Toaster.tsx"],"sourcesContent":["'use client';\n\nimport {\n Toast,\n ToastClose,\n ToastDescription,\n ToastProvider,\n ToastTitle,\n ToastViewport,\n} from './Toast';\nimport { useToast } from './useToast';\n\n/**\n * Toast notification provider component that renders active toast notifications.\n *\n * This component serves as the visual layer for the toast system, rendering all\n * active toasts and handling their animations and positioning. It should be placed\n * at a high level in your component tree to ensure toasts appear above other content.\n *\n * ## Features\n * - **Global Toast Rendering**: Renders all toasts from the global state\n * - **Automatic Positioning**: Uses Radix UI positioning system\n * - **Animation Integration**: Handles enter/exit animations for toasts\n * - **Accessibility**: Provides proper ARIA landmarks and focus management\n * - **Portal Rendering**: Renders toasts in a portal for z-index safety\n *\n * ## Positioning\n * Toasts are positioned at the bottom-right of the viewport by default.\n * This can be customized through the ToastViewport component styling.\n *\n * ## Integration\n * Place this component near the root of your application, typically:\n * - Next.js: In _app.tsx or layout.tsx\n * - React: In your main App component\n * - Ensure it's outside any containers that might clip overflow\n *\n * ## Usage Example\n * Place Toaster component at the root level of your application to ensure\n * toast notifications appear above all other content. Components throughout\n * your app can then use the useToast hook to display notifications.\n *\n * ## Styling Notes\n * - Toasts use fixed positioning to appear above all other content\n * - The viewport is styled for bottom-right positioning by default\n * - Animations are handled automatically through Radix UI primitives\n * - Custom positioning can be achieved by styling the ToastViewport\n *\n * ## Performance\n * - Only active toasts are rendered (dismissed toasts are cleaned up)\n * - Animations are hardware-accelerated where possible\n * - Memory usage is minimal due to automatic cleanup\n *\n * @returns JSX element rendering the toast viewport and active toasts\n */\nexport const Toaster = () => {\n const { toasts } = useToast();\n\n return (\n <ToastProvider.Provider>\n {toasts.map(({ id, title, description, action, ...props }) => (\n <Toast key={id} {...props}>\n <div className=\"grid gap-1\">\n {title && <ToastTitle>{title}</ToastTitle>}\n {description && <ToastDescription>{description}</ToastDescription>}\n </div>\n {action}\n <ToastClose />\n </Toast>\n ))}\n <ToastViewport />\n </ToastProvider.Provider>\n );\n};\n"],"mappings":"yOAsDA,MAAa,MAAgB,CAC3B,GAAM,CAAE,UAAW,GAAU,CAE7B,OACE,EAAC,EAAc,SAAf,CAAA,SAAA,CACG,EAAO,KAAK,CAAE,KAAI,QAAO,cAAa,SAAQ,GAAG,KAChD,EAAC,EAAD,CAAgB,GAAI,WAApB,CACE,EAAC,MAAD,CAAK,UAAU,sBAAf,CACG,GAAS,EAAC,EAAD,CAAA,SAAa,EAAmB,CAAA,CACzC,GAAe,EAAC,EAAD,CAAA,SAAmB,EAA+B,CAAA,CAC9D,GACL,EACD,EAAC,EAAD,EAAc,CAAA,CACR,EAPI,EAOJ,CACR,CACF,EAAC,EAAD,EAAiB,CAAA,CACM,CAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useToast.mjs","names":[],"sources":["../../../../src/components/Toaster/useToast.tsx"],"sourcesContent":["'use client';\n\nimport { type ReactNode, useEffect, useState } from 'react';\nimport type { ToastActionElement, ToastProps } from './Toast';\n\n/**\n * Maximum number of toasts that can be displayed simultaneously.\n * Prevents UI overflow and maintains clean notification experience.\n */\nconst TOAST_LIMIT = 1;\n\n/**\n * Delay before automatically removing dismissed toasts from memory.\n * Set to 15 minutes (900,000ms) to allow for potential undo actions.\n */\nconst TOAST_REMOVE_DELAY = 15 * 60 * 1000; // 15 seconds\n\n/**\n * Extended toast configuration with additional properties for the toast system.\n *\n * Combines base ToastProps with specific fields needed for toast management\n * including unique identification and content elements.\n *\n * @example\n * ```tsx\n * const toast: ToasterToast = {\n * id: '1',\n * variant: 'success',\n * title: 'Success!',\n * description: 'Your action completed successfully.',\n * action: <ToastAction altText=\"View details\">View</ToastAction>\n * };\n * ```\n */\ntype ToasterToast = ToastProps & {\n /** Unique identifier for the toast instance */\n id: string;\n /** Optional title text or React element */\n title?: ReactNode;\n /** Optional description text or React element */\n description?: ReactNode;\n /** Optional action button element */\n action?: ToastActionElement;\n};\n\n/**\n * Action types for toast state management using reducer pattern.\n *\n * Defines all possible actions that can be performed on the toast state,\n * enabling predictable state updates and better debugging.\n */\nenum ActionTypes {\n /** Add a new toast to the display queue */\n ADD_TOAST = 'ADD_TOAST',\n /** Update properties of an existing toast */\n UPDATE_TOAST = 'UPDATE_TOAST',\n /** Mark a toast as dismissed (triggers exit animation) */\n DISMISS_TOAST = 'DISMISS_TOAST',\n /** Completely remove a toast from memory */\n REMOVE_TOAST = 'REMOVE_TOAST',\n}\n\nlet count = 0;\n\nconst genId = () => {\n count = (count + 1) % Number.MAX_SAFE_INTEGER;\n return count.toString();\n};\n\ntype Action =\n | {\n type: ActionTypes.ADD_TOAST;\n toast: ToasterToast;\n }\n | {\n type: ActionTypes.UPDATE_TOAST;\n toast: Partial<ToasterToast>;\n }\n | {\n type: ActionTypes.DISMISS_TOAST;\n toastId?: ToasterToast['id'];\n }\n | {\n type: ActionTypes.REMOVE_TOAST;\n toastId?: ToasterToast['id'];\n };\n\ntype State = {\n toasts: ToasterToast[];\n};\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n\nconst addToRemoveQueue = (toastId: string) => {\n if (toastTimeouts.has(toastId)) {\n return;\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: ActionTypes.REMOVE_TOAST,\n toastId: toastId,\n });\n }, TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n};\n\n/**\n * Toast state reducer function that handles all toast state transitions.\n *\n * Implements predictable state updates using the reducer pattern, ensuring\n * consistent behavior across all toast operations.\n *\n * ## State Management\n * - **ADD_TOAST**: Adds new toast and enforces limit by removing excess toasts\n * - **UPDATE_TOAST**: Updates existing toast properties while preserving identity\n * - **DISMISS_TOAST**: Marks toasts as closed and schedules removal\n * - **REMOVE_TOAST**: Permanently removes toasts from state\n *\n * ## Side Effects\n * The DISMISS_TOAST action includes side effects for scheduling toast removal,\n * which could be extracted but is kept here for simplicity.\n *\n * @param state - Current toast state\n * @param action - Action to perform on the state\n * @returns Updated toast state\n *\n * @example\n * ```tsx\n * // Add a new toast\n * const newState = reducer(state, {\n * type: ActionTypes.ADD_TOAST,\n * toast: { id: '1', title: 'Hello', variant: 'default' }\n * });\n *\n * // Dismiss a specific toast\n * const dismissedState = reducer(state, {\n * type: ActionTypes.DISMISS_TOAST,\n * toastId: '1'\n * });\n * ```\n */\nexport const reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case ActionTypes.ADD_TOAST:\n return {\n ...state,\n toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),\n };\n\n case ActionTypes.UPDATE_TOAST:\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === action.toast.id ? { ...t, ...action.toast } : t\n ),\n };\n\n case ActionTypes.DISMISS_TOAST: {\n const { toastId } = action;\n\n // ! Side effects ! - This could be extracted into a dismissToast() action,\n // but I'll keep it here for simplicity\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.toasts.forEach((toast) => {\n addToRemoveQueue(toast.id);\n });\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t\n ),\n };\n }\n case ActionTypes.REMOVE_TOAST:\n if (action.toastId === undefined) {\n return {\n ...state,\n toasts: [],\n };\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\n };\n }\n};\n\nconst listeners: ((state: State) => void)[] = [];\n\nlet memoryState: State = { toasts: [] };\n\nconst dispatch = (action: Action) => {\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => {\n listener(memoryState);\n });\n};\n\n/**\n * Toast configuration type for creating new toasts.\n * Omits the 'id' field as it's automatically generated.\n */\ntype Toast = Omit<ToasterToast, 'id'>;\n\n/**\n * Creates and displays a new toast notification.\n *\n * This is the primary function for showing toast notifications to users.\n * It automatically generates unique IDs, handles state updates, and provides\n * control functions for managing the toast lifecycle.\n *\n * ## Features\n * - **Automatic ID Generation**: Each toast gets a unique identifier\n * - **State Management**: Integrates with global toast state\n * - **Lifecycle Control**: Returns functions to update or dismiss the toast\n * - **Auto-dismiss**: Automatically closes when user dismisses\n *\n * ## Return Value\n * Returns an object with control functions:\n * - `id`: Unique identifier for the toast\n * - `dismiss()`: Function to manually dismiss the toast\n * - `update()`: Function to update toast properties\n *\n * @param props - Toast configuration (title, description, variant, etc.)\n * @returns Object with toast ID and control functions\n *\n * @example\n * ```tsx\n * // Basic success toast\n * const { dismiss } = toast({\n * title: 'Success!',\n * description: 'Your file was uploaded successfully.',\n * variant: 'success'\n * });\n *\n * // Error toast with retry action\n * const errorToast = toast({\n * title: 'Upload Failed',\n * description: 'Could not upload file. Please try again.',\n * variant: 'error',\n * action: <ToastAction altText=\"Retry upload\">Retry</ToastAction>\n * });\n *\n * // Update toast content dynamically\n * errorToast.update({\n * title: 'Retrying...',\n * description: 'Please wait while we retry the upload.',\n * variant: 'default'\n * });\n *\n * // Manually dismiss toast\n * setTimeout(() => errorToast.dismiss(), 5000);\n * ```\n */\nconst toast = ({ ...props }: Toast) => {\n const id = genId();\n\n const update = (props: ToasterToast) =>\n dispatch({\n type: ActionTypes.UPDATE_TOAST,\n toast: { ...props, id },\n });\n const dismiss = () =>\n dispatch({ type: ActionTypes.DISMISS_TOAST, toastId: id });\n\n dispatch({\n type: ActionTypes.ADD_TOAST,\n toast: {\n ...props,\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n },\n },\n });\n\n return {\n id: id,\n dismiss,\n update,\n };\n};\n\n/**\n * React hook for managing toast notifications.\n *\n * Provides access to the global toast state and functions for creating and\n * managing toast notifications. This hook connects components to the toast\n * system and ensures reactive updates when toasts change.\n *\n * ## Features\n * - **State Synchronization**: Automatically updates when toast state changes\n * - **Toast Creation**: Provides the `toast()` function for creating notifications\n * - **Batch Dismissal**: Can dismiss all toasts or specific toasts by ID\n * - **Memory Management**: Handles proper cleanup of listeners\n *\n * ## Return Value\n * - `toasts`: Array of current toast objects\n * - `toast()`: Function to create new toast notifications\n * - `dismiss()`: Function to dismiss toasts (all or by ID)\n *\n * @returns Toast state and control functions\n *\n * @example\n * ```tsx\n * function NotificationButton() {\n * const { toast, toasts, dismiss } = useToast();\n *\n * const showSuccess = () => {\n * toast({\n * title: 'Success!',\n * description: 'Operation completed successfully.',\n * variant: 'success'\n * });\n * };\n *\n * const clearAll = () => {\n * dismiss(); // Dismisses all toasts\n * };\n *\n * return (\n * <div>\n * <button onClick={showSuccess}>Show Success</button>\n * <button onClick={clearAll}>Clear All ({toasts.length})</button>\n * </div>\n * );\n * }\n *\n * // Usage in a form component\n * function ContactForm() {\n * const { toast } = useToast();\n *\n * const handleSubmit = async (data) => {\n * try {\n * await submitForm(data);\n * toast({\n * title: 'Form Submitted',\n * description: 'We\\'ll get back to you soon!',\n * variant: 'success'\n * });\n * } catch (error) {\n * toast({\n * title: 'Submission Failed',\n * description: 'Please check your connection and try again.',\n * variant: 'error',\n * action: <ToastAction altText=\"Retry\">Retry</ToastAction>\n * });\n * }\n * };\n *\n * // ... form JSX\n * }\n * ```\n *\n * ## Usage Notes\n * - Must be used within a component tree that includes `<Toaster />`\n * - Toast state is global - changes affect all components using this hook\n * - Toasts are automatically cleaned up after the configured delay\n * - Consider UX best practices: don't overwhelm users with too many toasts\n */\nconst useToast = () => {\n const [state, setState] = useState<State>(memoryState);\n\n useEffect(() => {\n listeners.push(setState);\n return () => {\n const index = listeners.indexOf(setState);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n }, [state]);\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) =>\n dispatch({ type: ActionTypes.DISMISS_TOAST, toastId }),\n };\n};\n\nexport { toast, useToast };\n"],"mappings":"6DAmDA,IAAK,EAAA,SAAA,EAAL,OAEE,GAAA,UAAA,YAEA,EAAA,aAAA,eAEA,EAAA,cAAA,gBAEA,EAAA,aAAA,kBARG,GAAA,EAAA,CAAA,CAWL,IAAI,EAAQ,EAEZ,MAAM,OACJ,GAAS,EAAQ,aACV,EAAM,UAAU,EAyBnB,EAAgB,IAAI,IAEpB,EAAoB,GAAoB,CAC5C,GAAI,EAAc,IAAI,EAAQ,CAC5B,OAGF,IAAM,EAAU,eAAiB,CAC/B,EAAc,OAAO,EAAQ,CAC7B,EAAS,CACP,KAAM,EAAY,aACT,UACV,CAAC,EACD,IAAmB,CAEtB,EAAc,IAAI,EAAS,EAAQ,EAsCxB,GAAW,EAAc,IAA0B,CAC9D,OAAQ,EAAO,KAAf,CACE,KAAK,EAAY,UACf,MAAO,CACL,GAAG,EACH,OAAQ,CAAC,EAAO,MAAO,GAAG,EAAM,OAAO,CAAC,MAAM,EAAG,EAAY,CAC9D,CAEH,KAAK,EAAY,aACf,MAAO,CACL,GAAG,EACH,OAAQ,EAAM,OAAO,IAAK,GACxB,EAAE,KAAO,EAAO,MAAM,GAAK,CAAE,GAAG,EAAG,GAAG,EAAO,MAAO,CAAG,EACxD,CACF,CAEH,KAAK,EAAY,cAAe,CAC9B,GAAM,CAAE,WAAY,EAYpB,OARI,EACF,EAAiB,EAAQ,CAEzB,EAAM,OAAO,QAAS,GAAU,CAC9B,EAAiB,EAAM,GAAG,EAC1B,CAGG,CACL,GAAG,EACH,OAAQ,EAAM,OAAO,IAAK,GACxB,EAAE,KAAO,GAAW,IAAY,IAAA,GAC5B,CACE,GAAG,EACH,KAAM,GACP,CACD,EACL,CACF,CAEH,KAAK,EAAY,aAOf,OANI,EAAO,UAAY,IAAA,GACd,CACL,GAAG,EACH,OAAQ,EAAE,CACX,CAEI,CACL,GAAG,EACH,OAAQ,EAAM,OAAO,OAAQ,GAAM,EAAE,KAAO,EAAO,QAAQ,CAC5D,GAID,EAAwC,EAAE,CAEhD,IAAI,EAAqB,CAAE,OAAQ,EAAE,CAAE,CAEvC,MAAM,EAAY,GAAmB,CACnC,EAAc,EAAQ,EAAa,EAAO,CAC1C,EAAU,QAAS,GAAa,CAC9B,EAAS,EAAY,EACrB,EA2DE,GAAS,CAAE,GAAG,KAAmB,CACrC,IAAM,EAAK,GAAO,CAEZ,EAAU,GACd,EAAS,CACP,KAAM,EAAY,aAClB,MAAO,CAAE,GAAG,EAAO,KAAI,CACxB,CAAC,CACE,MACJ,EAAS,CAAE,KAAM,EAAY,cAAe,QAAS,EAAI,CAAC,CAc5D,OAZA,EAAS,CACP,KAAM,EAAY,UAClB,MAAO,CACL,GAAG,EACH,KACA,KAAM,GACN,aAAe,GAAS,CACjB,GAAM,GAAS,EAEvB,CACF,CAAC,CAEK,CACD,KACJ,UACA,SACD,EAgFG,MAAiB,CACrB,GAAM,CAAC,EAAO,GAAY,EAAgB,EAAY,CAYtD,OAVA,OACE,EAAU,KAAK,EAAS,KACX,CACX,IAAM,EAAQ,EAAU,QAAQ,EAAS,CACrC,EAAQ,IACV,EAAU,OAAO,EAAO,EAAE,GAG7B,CAAC,EAAM,CAAC,CAEJ,CACL,GAAG,EACH,QACA,QAAU,GACR,EAAS,CAAE,KAAM,EAAY,cAAe,UAAS,CAAC,CACzD"}
1
+ {"version":3,"file":"useToast.mjs","names":[],"sources":["../../../../src/components/Toaster/useToast.tsx"],"sourcesContent":["'use client';\n\nimport { type ReactNode, useEffect, useState } from 'react';\nimport type { ToastActionElement, ToastProps } from './Toast';\n\n/**\n * Maximum number of toasts that can be displayed simultaneously.\n * Prevents UI overflow and maintains clean notification experience.\n */\nconst TOAST_LIMIT = 1;\n\n/**\n * Delay before automatically removing dismissed toasts from memory.\n * Set to 15 minutes (900,000ms) to allow for potential undo actions.\n */\nconst TOAST_REMOVE_DELAY = 15 * 60 * 1000; // 15 seconds\n\n/**\n * Extended toast configuration with additional properties for the toast system.\n *\n * Combines base ToastProps with specific fields needed for toast management\n * including unique identification and content elements.\n *\n * @example\n * ```tsx\n * const toast: ToasterToast = {\n * id: '1',\n * variant: 'success',\n * title: 'Success!',\n * description: 'Your action completed successfully.',\n * action: <ToastAction altText=\"View details\">View</ToastAction>\n * };\n * ```\n */\ntype ToasterToast = ToastProps & {\n /** Unique identifier for the toast instance */\n id: string;\n /** Optional title text or React element */\n title?: ReactNode;\n /** Optional description text or React element */\n description?: ReactNode;\n /** Optional action button element */\n action?: ToastActionElement;\n};\n\n/**\n * Action types for toast state management using reducer pattern.\n *\n * Defines all possible actions that can be performed on the toast state,\n * enabling predictable state updates and better debugging.\n */\nenum ActionTypes {\n /** Add a new toast to the display queue */\n ADD_TOAST = 'ADD_TOAST',\n /** Update properties of an existing toast */\n UPDATE_TOAST = 'UPDATE_TOAST',\n /** Mark a toast as dismissed (triggers exit animation) */\n DISMISS_TOAST = 'DISMISS_TOAST',\n /** Completely remove a toast from memory */\n REMOVE_TOAST = 'REMOVE_TOAST',\n}\n\nlet count = 0;\n\nconst genId = () => {\n count = (count + 1) % Number.MAX_SAFE_INTEGER;\n return count.toString();\n};\n\ntype Action =\n | {\n type: ActionTypes.ADD_TOAST;\n toast: ToasterToast;\n }\n | {\n type: ActionTypes.UPDATE_TOAST;\n toast: Partial<ToasterToast>;\n }\n | {\n type: ActionTypes.DISMISS_TOAST;\n toastId?: ToasterToast['id'];\n }\n | {\n type: ActionTypes.REMOVE_TOAST;\n toastId?: ToasterToast['id'];\n };\n\ntype State = {\n toasts: ToasterToast[];\n};\n\nconst toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();\n\nconst addToRemoveQueue = (toastId: string) => {\n if (toastTimeouts.has(toastId)) {\n return;\n }\n\n const timeout = setTimeout(() => {\n toastTimeouts.delete(toastId);\n dispatch({\n type: ActionTypes.REMOVE_TOAST,\n toastId: toastId,\n });\n }, TOAST_REMOVE_DELAY);\n\n toastTimeouts.set(toastId, timeout);\n};\n\n/**\n * Toast state reducer function that handles all toast state transitions.\n *\n * Implements predictable state updates using the reducer pattern, ensuring\n * consistent behavior across all toast operations.\n *\n * ## State Management\n * - **ADD_TOAST**: Adds new toast and enforces limit by removing excess toasts\n * - **UPDATE_TOAST**: Updates existing toast properties while preserving identity\n * - **DISMISS_TOAST**: Marks toasts as closed and schedules removal\n * - **REMOVE_TOAST**: Permanently removes toasts from state\n *\n * ## Side Effects\n * The DISMISS_TOAST action includes side effects for scheduling toast removal,\n * which could be extracted but is kept here for simplicity.\n *\n * @param state - Current toast state\n * @param action - Action to perform on the state\n * @returns Updated toast state\n *\n * @example\n * ```tsx\n * // Add a new toast\n * const newState = reducer(state, {\n * type: ActionTypes.ADD_TOAST,\n * toast: { id: '1', title: 'Hello', variant: 'default' }\n * });\n *\n * // Dismiss a specific toast\n * const dismissedState = reducer(state, {\n * type: ActionTypes.DISMISS_TOAST,\n * toastId: '1'\n * });\n * ```\n */\nexport const reducer = (state: State, action: Action): State => {\n switch (action.type) {\n case ActionTypes.ADD_TOAST:\n return {\n ...state,\n toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),\n };\n\n case ActionTypes.UPDATE_TOAST:\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === action.toast.id ? { ...t, ...action.toast } : t\n ),\n };\n\n case ActionTypes.DISMISS_TOAST: {\n const { toastId } = action;\n\n // ! Side effects ! - This could be extracted into a dismissToast() action,\n // but I'll keep it here for simplicity\n if (toastId) {\n addToRemoveQueue(toastId);\n } else {\n state.toasts.forEach((toast) => {\n addToRemoveQueue(toast.id);\n });\n }\n\n return {\n ...state,\n toasts: state.toasts.map((t) =>\n t.id === toastId || toastId === undefined\n ? {\n ...t,\n open: false,\n }\n : t\n ),\n };\n }\n case ActionTypes.REMOVE_TOAST:\n if (action.toastId === undefined) {\n return {\n ...state,\n toasts: [],\n };\n }\n return {\n ...state,\n toasts: state.toasts.filter((t) => t.id !== action.toastId),\n };\n }\n};\n\nconst listeners: ((state: State) => void)[] = [];\n\nlet memoryState: State = { toasts: [] };\n\nconst dispatch = (action: Action) => {\n memoryState = reducer(memoryState, action);\n listeners.forEach((listener) => {\n listener(memoryState);\n });\n};\n\n/**\n * Toast configuration type for creating new toasts.\n * Omits the 'id' field as it's automatically generated.\n */\ntype Toast = Omit<ToasterToast, 'id'>;\n\n/**\n * Creates and displays a new toast notification.\n *\n * This is the primary function for showing toast notifications to users.\n * It automatically generates unique IDs, handles state updates, and provides\n * control functions for managing the toast lifecycle.\n *\n * ## Features\n * - **Automatic ID Generation**: Each toast gets a unique identifier\n * - **State Management**: Integrates with global toast state\n * - **Lifecycle Control**: Returns functions to update or dismiss the toast\n * - **Auto-dismiss**: Automatically closes when user dismisses\n *\n * ## Return Value\n * Returns an object with control functions:\n * - `id`: Unique identifier for the toast\n * - `dismiss()`: Function to manually dismiss the toast\n * - `update()`: Function to update toast properties\n *\n * @param props - Toast configuration (title, description, variant, etc.)\n * @returns Object with toast ID and control functions\n *\n * @example\n * ```tsx\n * // Basic success toast\n * const { dismiss } = toast({\n * title: 'Success!',\n * description: 'Your file was uploaded successfully.',\n * variant: 'success'\n * });\n *\n * // Error toast with retry action\n * const errorToast = toast({\n * title: 'Upload Failed',\n * description: 'Could not upload file. Please try again.',\n * variant: 'error',\n * action: <ToastAction altText=\"Retry upload\">Retry</ToastAction>\n * });\n *\n * // Update toast content dynamically\n * errorToast.update({\n * title: 'Retrying...',\n * description: 'Please wait while we retry the upload.',\n * variant: 'default'\n * });\n *\n * // Manually dismiss toast\n * setTimeout(() => errorToast.dismiss(), 5000);\n * ```\n */\nconst toast = ({ ...props }: Toast) => {\n const id = genId();\n\n const update = (props: ToasterToast) =>\n dispatch({\n type: ActionTypes.UPDATE_TOAST,\n toast: { ...props, id },\n });\n const dismiss = () =>\n dispatch({ type: ActionTypes.DISMISS_TOAST, toastId: id });\n\n dispatch({\n type: ActionTypes.ADD_TOAST,\n toast: {\n ...props,\n id,\n open: true,\n onOpenChange: (open) => {\n if (!open) dismiss();\n },\n },\n });\n\n return {\n id: id,\n dismiss,\n update,\n };\n};\n\n/**\n * React hook for managing toast notifications.\n *\n * Provides access to the global toast state and functions for creating and\n * managing toast notifications. This hook connects components to the toast\n * system and ensures reactive updates when toasts change.\n *\n * ## Features\n * - **State Synchronization**: Automatically updates when toast state changes\n * - **Toast Creation**: Provides the `toast()` function for creating notifications\n * - **Batch Dismissal**: Can dismiss all toasts or specific toasts by ID\n * - **Memory Management**: Handles proper cleanup of listeners\n *\n * ## Return Value\n * - `toasts`: Array of current toast objects\n * - `toast()`: Function to create new toast notifications\n * - `dismiss()`: Function to dismiss toasts (all or by ID)\n *\n * @returns Toast state and control functions\n *\n * @example\n * ```tsx\n * function NotificationButton() {\n * const { toast, toasts, dismiss } = useToast();\n *\n * const showSuccess = () => {\n * toast({\n * title: 'Success!',\n * description: 'Operation completed successfully.',\n * variant: 'success'\n * });\n * };\n *\n * const clearAll = () => {\n * dismiss(); // Dismisses all toasts\n * };\n *\n * return (\n * <div>\n * <button onClick={showSuccess}>Show Success</button>\n * <button onClick={clearAll}>Clear All ({toasts.length})</button>\n * </div>\n * );\n * }\n *\n * // Usage in a form component\n * function ContactForm() {\n * const { toast } = useToast();\n *\n * const handleSubmit = async (data) => {\n * try {\n * await submitForm(data);\n * toast({\n * title: 'Form Submitted',\n * description: 'We\\'ll get back to you soon!',\n * variant: 'success'\n * });\n * } catch (error) {\n * toast({\n * title: 'Submission Failed',\n * description: 'Please check your connection and try again.',\n * variant: 'error',\n * action: <ToastAction altText=\"Retry\">Retry</ToastAction>\n * });\n * }\n * };\n *\n * // ... form JSX\n * }\n * ```\n *\n * ## Usage Notes\n * - Must be used within a component tree that includes `<Toaster />`\n * - Toast state is global - changes affect all components using this hook\n * - Toasts are automatically cleaned up after the configured delay\n * - Consider UX best practices: don't overwhelm users with too many toasts\n */\nconst useToast = () => {\n const [state, setState] = useState<State>(memoryState);\n\n useEffect(() => {\n listeners.push(setState);\n return () => {\n const index = listeners.indexOf(setState);\n if (index > -1) {\n listeners.splice(index, 1);\n }\n };\n }, [state]);\n\n return {\n ...state,\n toast,\n dismiss: (toastId?: string) =>\n dispatch({ type: ActionTypes.DISMISS_TOAST, toastId }),\n };\n};\n\nexport { toast, useToast };\n"],"mappings":"6DAmDA,IAAK,EAAL,SAAA,EAAA,OAEE,GAAA,UAAA,YAEA,EAAA,aAAA,eAEA,EAAA,cAAA,gBAEA,EAAA,aAAA,kBARG,GAAA,EAAA,CASJ,CAED,IAAI,EAAQ,EAEZ,MAAM,OACJ,GAAS,EAAQ,aACV,EAAM,UAAU,EAyBnB,EAAgB,IAAI,IAEpB,EAAoB,GAAoB,CAC5C,GAAI,EAAc,IAAI,EAAQ,CAC5B,OAGF,IAAM,EAAU,eAAiB,CAC/B,EAAc,OAAO,EAAQ,CAC7B,EAAS,CACP,KAAM,EAAY,aACT,UACV,CAAC,EACD,IAAmB,CAEtB,EAAc,IAAI,EAAS,EAAQ,EAsCxB,GAAW,EAAc,IAA0B,CAC9D,OAAQ,EAAO,KAAf,CACE,KAAK,EAAY,UACf,MAAO,CACL,GAAG,EACH,OAAQ,CAAC,EAAO,MAAO,GAAG,EAAM,OAAO,CAAC,MAAM,EAAG,EAAY,CAC9D,CAEH,KAAK,EAAY,aACf,MAAO,CACL,GAAG,EACH,OAAQ,EAAM,OAAO,IAAK,GACxB,EAAE,KAAO,EAAO,MAAM,GAAK,CAAE,GAAG,EAAG,GAAG,EAAO,MAAO,CAAG,EACxD,CACF,CAEH,KAAK,EAAY,cAAe,CAC9B,GAAM,CAAE,WAAY,EAYpB,OARI,EACF,EAAiB,EAAQ,CAEzB,EAAM,OAAO,QAAS,GAAU,CAC9B,EAAiB,EAAM,GAAG,EAC1B,CAGG,CACL,GAAG,EACH,OAAQ,EAAM,OAAO,IAAK,GACxB,EAAE,KAAO,GAAW,IAAY,IAAA,GAC5B,CACE,GAAG,EACH,KAAM,GACP,CACD,EACL,CACF,CAEH,KAAK,EAAY,aAOf,OANI,EAAO,UAAY,IAAA,GACd,CACL,GAAG,EACH,OAAQ,EAAE,CACX,CAEI,CACL,GAAG,EACH,OAAQ,EAAM,OAAO,OAAQ,GAAM,EAAE,KAAO,EAAO,QAAQ,CAC5D,GAID,EAAwC,EAAE,CAEhD,IAAI,EAAqB,CAAE,OAAQ,EAAE,CAAE,CAEvC,MAAM,EAAY,GAAmB,CACnC,EAAc,EAAQ,EAAa,EAAO,CAC1C,EAAU,QAAS,GAAa,CAC9B,EAAS,EAAY,EACrB,EA2DE,GAAS,CAAE,GAAG,KAAmB,CACrC,IAAM,EAAK,GAAO,CAEZ,EAAU,GACd,EAAS,CACP,KAAM,EAAY,aAClB,MAAO,CAAE,GAAG,EAAO,KAAI,CACxB,CAAC,CACE,MACJ,EAAS,CAAE,KAAM,EAAY,cAAe,QAAS,EAAI,CAAC,CAc5D,OAZA,EAAS,CACP,KAAM,EAAY,UAClB,MAAO,CACL,GAAG,EACH,KACA,KAAM,GACN,aAAe,GAAS,CACjB,GAAM,GAAS,EAEvB,CACF,CAAC,CAEK,CACD,KACJ,UACA,SACD,EAgFG,MAAiB,CACrB,GAAM,CAAC,EAAO,GAAY,EAAgB,EAAY,CAYtD,OAVA,OACE,EAAU,KAAK,EAAS,KACX,CACX,IAAM,EAAQ,EAAU,QAAQ,EAAS,CACrC,EAAQ,IACV,EAAU,OAAO,EAAO,EAAE,GAG7B,CAAC,EAAM,CAAC,CAEJ,CACL,GAAG,EACH,QACA,QAAU,GACR,EAAS,CAAE,KAAM,EAAY,cAAe,UAAS,CAAC,CACzD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/WithResizer/index.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@utils/cn';\nimport React, {\n type FC,\n type PropsWithChildren,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\n/**\n * Props for the WithResizer component.\n *\n * Defines the configuration for a resizable container with drag-based width adjustment.\n *\n * @example\n * ```tsx\n * // Basic resizable container\n * <WithResizer initialWidth={300} minWidth={200} maxWidth={600}>\n * <div className=\"p-4\">Resizable content</div>\n * </WithResizer>\n *\n * // Sidebar with resizing\n * <WithResizer\n * initialWidth={250}\n * minWidth={180}\n * maxWidth={400}\n * >\n * <nav className=\"h-full p-4\">\n * <SidebarContent />\n * </nav>\n * </WithResizer>\n *\n * // Panel with unlimited growth\n * <WithResizer initialWidth={400} minWidth={300}>\n * <div className=\"h-full overflow-auto\">\n * <PanelContent />\n * </div>\n * </WithResizer>\n * ```\n */\ntype WithResizerProps = {\n /** Initial width of the resizable container in pixels */\n initialWidth: number;\n /** Maximum allowed width in pixels (optional, no limit if not specified) */\n maxWidth?: number;\n /** Minimum allowed width in pixels */\n minWidth?: number;\n /** Position of the resize handle (default: 'right') */\n handlePosition?: 'left' | 'right';\n};\n\n/**\n * WithResizer Component\n *\n * A flexible container component that allows users to dynamically resize its width\n * through mouse or touch drag interactions. Perfect for creating adjustable panels,\n * sidebars, and split-pane layouts.\n *\n * ## Features\n * - **Mouse & Touch Support**: Works with both mouse drag and touch interactions\n * - **Constraint Enforcement**: Respects minimum and maximum width boundaries\n * - **Visual Feedback**: Clear resize handle with hover and active states\n * - **Smooth Interactions**: Passive event listeners for optimal performance\n * - **Accessibility**: ARIA slider role with proper value announcements\n * - **Responsive Design**: Adapts to different screen sizes and containers\n *\n * ## Technical Implementation\n * - **Event Handling**: Uses `useCallback` for optimal performance\n * - **Boundary Calculation**: Real-time width calculation based on mouse/touch position\n * - **State Management**: Tracks resizing state for visual feedback\n * - **Memory Management**: Proper cleanup of global event listeners\n * - **Touch Events**: Full support for mobile touch interactions\n *\n * ## Visual Design\n * - **Resize Handle**: Rounded handle positioned on the right border\n * - **Border Indicator**: Visual border showing resizable edge\n * - **State Feedback**: Different colors for normal, hover, and active states\n * - **Dark Mode**: Full support with appropriate color scheme\n * - **Smooth Transitions**: CSS transitions for visual polish\n *\n * ## Use Cases\n * - **Application Sidebars**: Collapsible navigation and tool panels\n * - **Content Panels**: Adjustable content areas in complex layouts\n * - **Split Panes**: Dividing screen space between multiple content areas\n * - **Inspector Panels**: Debugging tools and property inspectors\n * - **File Explorers**: Tree views with adjustable column widths\n * - **Dashboard Widgets**: Customizable widget sizes for dashboards\n *\n * ## Accessibility Features\n * - **ARIA Slider**: Proper slider role for screen readers\n * - **Value Announcements**: Current, minimum, and maximum values announced\n * - **Keyboard Focus**: Focusable with tab navigation\n * - **Clear Affordances**: Visual indicators for interactive elements\n *\n * @example\n * ```tsx\n * // Application sidebar with resizing\n * const [sidebarWidth, setSidebarWidth] = useState(250);\n *\n * <div className=\"flex h-screen\">\n * <WithResizer\n * initialWidth={sidebarWidth}\n * minWidth={200}\n * maxWidth={400}\n * >\n * <aside className=\"h-full bg-gray-100 p-4\">\n * <nav>\n * <NavItems />\n * </nav>\n * </aside>\n * </WithResizer>\n *\n * <main className=\"flex-1 p-6\">\n * <MainContent />\n * </main>\n * </div>\n *\n * // Developer tools panel\n * <WithResizer\n * initialWidth={350}\n * minWidth={250}\n * maxWidth={600}\n * >\n * <div className=\"h-full flex flex-col\">\n * <div className=\"flex-1 overflow-auto p-4\">\n * <InspectorContent />\n * </div>\n * <div className=\"border-t p-2\">\n * <Controls />\n * </div>\n * </div>\n * </WithResizer>\n *\n * // Multi-column layout\n * <div className=\"flex h-full\">\n * <WithResizer initialWidth={300} minWidth={200} maxWidth={500}>\n * <FileExplorer />\n * </WithResizer>\n *\n * <WithResizer initialWidth={400} minWidth={300}>\n * <CodeEditor />\n * </WithResizer>\n *\n * <div className=\"flex-1 min-w-0\">\n * <OutputPanel />\n * </div>\n * </div>\n * ```\n *\n * ## Performance Considerations\n * - Uses passive event listeners to prevent scroll blocking\n * - Optimized with `useCallback` to prevent unnecessary re-renders\n * - Efficient boundary calculations using `getBoundingClientRect`\n * - Minimal DOM manipulation for smooth drag interactions\n *\n * ## Browser Support\n * - Modern browsers with support for touch events\n * - Graceful degradation for older browsers\n * - Mobile-first touch interaction handling\n */\nexport const WithResizer: FC<PropsWithChildren<WithResizerProps>> = ({\n initialWidth,\n maxWidth,\n minWidth = 0,\n handlePosition = 'right',\n children,\n}) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const [width, setWidth] = useState(initialWidth);\n\n const resizeState = useRef({\n startX: 0,\n startWidth: 0,\n factor: 1,\n });\n\n // Handler to resize the div\n const resize = useCallback(\n (mouseMoveEvent: MouseEvent | TouchEvent) => {\n if (resizeState.current.startWidth === 0) return;\n\n let clientX = 0;\n if (mouseMoveEvent instanceof MouseEvent) {\n clientX = mouseMoveEvent.clientX;\n } else if (\n typeof TouchEvent !== 'undefined' &&\n mouseMoveEvent instanceof TouchEvent\n ) {\n clientX = mouseMoveEvent.touches[0].clientX;\n }\n\n const { startX, startWidth, factor } = resizeState.current;\n const delta = (clientX - startX) / factor;\n // Invert delta for left handle (moving left decreases width, moving right increases width)\n const adjustedDelta = handlePosition === 'left' ? -delta : delta;\n const newWidth = startWidth + adjustedDelta;\n\n const constrainedWidth = Math.max(\n Math.min(newWidth, maxWidth ?? Infinity),\n minWidth\n );\n\n setWidth(constrainedWidth);\n },\n [maxWidth, minWidth, handlePosition]\n );\n\n // Handler to stop resizing\n const stopResizing = useCallback(() => {\n document.body.style.cursor = '';\n document.body.style.userSelect = '';\n window.removeEventListener('mousemove', resize);\n window.removeEventListener('mouseup', stopResizing);\n window.removeEventListener('touchmove', resize);\n window.removeEventListener('touchend', stopResizing);\n }, [resize]);\n\n // Handler to start resizing\n const startResizing = useCallback(\n (\n mouseDownEvent:\n | React.MouseEvent<HTMLDivElement>\n | React.TouchEvent<HTMLDivElement>\n ) => {\n mouseDownEvent.preventDefault();\n const container = containerRef.current;\n\n if (!container) return;\n\n const { width: rectWidth } = container.getBoundingClientRect();\n const offsetWidth = container.offsetWidth;\n const factor = offsetWidth > 0 ? rectWidth / offsetWidth : 1;\n\n let clientX = 0;\n if ('touches' in mouseDownEvent) {\n clientX = mouseDownEvent.touches[0].clientX;\n } else {\n clientX = mouseDownEvent.clientX;\n }\n\n resizeState.current = {\n startX: clientX,\n startWidth: offsetWidth,\n factor,\n };\n\n document.body.style.cursor = 'ew-resize';\n document.body.style.userSelect = 'none';\n\n window.addEventListener('mousemove', resize, { passive: true });\n window.addEventListener('mouseup', stopResizing);\n window.addEventListener('touchmove', resize, { passive: true });\n window.addEventListener('touchend', stopResizing);\n },\n [resize, stopResizing]\n );\n\n useEffect(() => {\n return () => {\n window.removeEventListener('mousemove', resize);\n window.removeEventListener('mouseup', stopResizing);\n window.removeEventListener('touchmove', resize);\n window.removeEventListener('touchend', stopResizing);\n };\n }, [resize, stopResizing]);\n\n return (\n <div\n className={cn(\n 'relative h-full w-full max-w-[80%] shrink-0 cursor-ew-resize border-neutral-200 transition dark:border-neutral-950',\n handlePosition === 'right'\n ? [\n 'border-r-[2px]',\n 'after:absolute after:top-1/2 after:right-0 after:block after:h-10 after:w-2 after:translate-x-1/2 after:-translate-y-1/2 after:transform after:cursor-ew-resize after:rounded-full after:bg-neutral-200 after:transition after:content-[\"\"] dark:after:bg-neutral-950',\n ]\n : [\n 'border-l-[2px]',\n 'after:absolute after:top-1/2 after:left-0 after:block after:h-10 after:w-2 after:-translate-x-1/2 after:-translate-y-1/2 after:transform after:cursor-ew-resize after:rounded-full after:bg-neutral-200 after:transition after:content-[\"\"] dark:after:bg-neutral-950',\n ],\n 'active:border-neutral-400 active:after:bg-neutral-400 dark:active:border-neutral-600 active:dark:after:bg-neutral-600',\n minWidth && `min-w-[${minWidth}px]`,\n maxWidth && `max-w-[${maxWidth}px]`\n )}\n style={{\n width: `${width}px`,\n }}\n ref={containerRef}\n onMouseDown={startResizing}\n onTouchStart={startResizing}\n aria-valuemin={minWidth}\n aria-valuemax={maxWidth}\n aria-valuenow={width}\n aria-label=\"Resizable component\"\n role=\"slider\"\n tabIndex={0}\n >\n {/* biome-ignore lint/a11y/noStaticElementInteractions: This div stops event propagation to prevent content clicks from triggering resize */}\n <div\n role=\"presentation\"\n className=\"absolute top-0 left-0 size-full cursor-default overflow-hidden\"\n onMouseDown={(e) => e.stopPropagation()}\n onTouchStart={(e) => e.stopPropagation()}\n >\n {children}\n </div>\n </div>\n );\n};\n"],"mappings":"0KAmKA,MAAa,GAAwD,CACnE,eACA,WACA,WAAW,EACX,iBAAiB,QACjB,cACI,CACJ,IAAM,EAAe,EAAuB,KAAK,CAC3C,CAAC,EAAO,GAAY,EAAS,EAAa,CAE1C,EAAc,EAAO,CACzB,OAAQ,EACR,WAAY,EACZ,OAAQ,EACT,CAAC,CAGI,EAAS,EACZ,GAA4C,CAC3C,GAAI,EAAY,QAAQ,aAAe,EAAG,OAE1C,IAAI,EAAU,EACV,aAA0B,WAC5B,EAAU,EAAe,QAEzB,OAAO,WAAe,KACtB,aAA0B,aAE1B,EAAU,EAAe,QAAQ,GAAG,SAGtC,GAAM,CAAE,SAAQ,aAAY,UAAW,EAAY,QAC7C,GAAS,EAAU,GAAU,EAG7B,EAAW,GADK,IAAmB,OAAS,CAAC,EAAQ,GAQ3D,EALyB,KAAK,IAC5B,KAAK,IAAI,EAAU,GAAY,IAAS,CACxC,EACD,CAEyB,EAE5B,CAAC,EAAU,EAAU,EAAe,CACrC,CAGK,EAAe,MAAkB,CACrC,SAAS,KAAK,MAAM,OAAS,GAC7B,SAAS,KAAK,MAAM,WAAa,GACjC,OAAO,oBAAoB,YAAa,EAAO,CAC/C,OAAO,oBAAoB,UAAW,EAAa,CACnD,OAAO,oBAAoB,YAAa,EAAO,CAC/C,OAAO,oBAAoB,WAAY,EAAa,EACnD,CAAC,EAAO,CAAC,CAGN,EAAgB,EAElB,GAGG,CACH,EAAe,gBAAgB,CAC/B,IAAM,EAAY,EAAa,QAE/B,GAAI,CAAC,EAAW,OAEhB,GAAM,CAAE,MAAO,GAAc,EAAU,uBAAuB,CACxD,EAAc,EAAU,YACxB,EAAS,EAAc,EAAI,EAAY,EAAc,EAEvD,EAAU,EACd,AAGE,EAHE,YAAa,EACL,EAAe,QAAQ,GAAG,QAE1B,EAAe,QAG3B,EAAY,QAAU,CACpB,OAAQ,EACR,WAAY,EACZ,SACD,CAED,SAAS,KAAK,MAAM,OAAS,YAC7B,SAAS,KAAK,MAAM,WAAa,OAEjC,OAAO,iBAAiB,YAAa,EAAQ,CAAE,QAAS,GAAM,CAAC,CAC/D,OAAO,iBAAiB,UAAW,EAAa,CAChD,OAAO,iBAAiB,YAAa,EAAQ,CAAE,QAAS,GAAM,CAAC,CAC/D,OAAO,iBAAiB,WAAY,EAAa,EAEnD,CAAC,EAAQ,EAAa,CACvB,CAWD,OATA,UACe,CACX,OAAO,oBAAoB,YAAa,EAAO,CAC/C,OAAO,oBAAoB,UAAW,EAAa,CACnD,OAAO,oBAAoB,YAAa,EAAO,CAC/C,OAAO,oBAAoB,WAAY,EAAa,EAErD,CAAC,EAAQ,EAAa,CAAC,CAGxB,EAAC,MAAA,CACC,UAAW,EACT,qHACA,IAAmB,QACf,CACE,iBACA,wQACD,CACD,CACE,iBACA,wQACD,CACL,wHACA,GAAY,UAAU,EAAS,KAC/B,GAAY,UAAU,EAAS,KAChC,CACD,MAAO,CACL,MAAO,GAAG,EAAM,IACjB,CACD,IAAK,EACL,YAAa,EACb,aAAc,EACd,gBAAe,EACf,gBAAe,EACf,gBAAe,EACf,aAAW,sBACX,KAAK,SACL,SAAU,WAGV,EAAC,MAAA,CACC,KAAK,eACL,UAAU,iEACV,YAAc,GAAM,EAAE,iBAAiB,CACvC,aAAe,GAAM,EAAE,iBAAiB,CAEvC,YACG,EACF"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/WithResizer/index.tsx"],"sourcesContent":["'use client';\n\nimport { cn } from '@utils/cn';\nimport React, {\n type FC,\n type PropsWithChildren,\n useCallback,\n useEffect,\n useRef,\n useState,\n} from 'react';\n\n/**\n * Props for the WithResizer component.\n *\n * Defines the configuration for a resizable container with drag-based width adjustment.\n *\n * @example\n * ```tsx\n * // Basic resizable container\n * <WithResizer initialWidth={300} minWidth={200} maxWidth={600}>\n * <div className=\"p-4\">Resizable content</div>\n * </WithResizer>\n *\n * // Sidebar with resizing\n * <WithResizer\n * initialWidth={250}\n * minWidth={180}\n * maxWidth={400}\n * >\n * <nav className=\"h-full p-4\">\n * <SidebarContent />\n * </nav>\n * </WithResizer>\n *\n * // Panel with unlimited growth\n * <WithResizer initialWidth={400} minWidth={300}>\n * <div className=\"h-full overflow-auto\">\n * <PanelContent />\n * </div>\n * </WithResizer>\n * ```\n */\ntype WithResizerProps = {\n /** Initial width of the resizable container in pixels */\n initialWidth: number;\n /** Maximum allowed width in pixels (optional, no limit if not specified) */\n maxWidth?: number;\n /** Minimum allowed width in pixels */\n minWidth?: number;\n /** Position of the resize handle (default: 'right') */\n handlePosition?: 'left' | 'right';\n};\n\n/**\n * WithResizer Component\n *\n * A flexible container component that allows users to dynamically resize its width\n * through mouse or touch drag interactions. Perfect for creating adjustable panels,\n * sidebars, and split-pane layouts.\n *\n * ## Features\n * - **Mouse & Touch Support**: Works with both mouse drag and touch interactions\n * - **Constraint Enforcement**: Respects minimum and maximum width boundaries\n * - **Visual Feedback**: Clear resize handle with hover and active states\n * - **Smooth Interactions**: Passive event listeners for optimal performance\n * - **Accessibility**: ARIA slider role with proper value announcements\n * - **Responsive Design**: Adapts to different screen sizes and containers\n *\n * ## Technical Implementation\n * - **Event Handling**: Uses `useCallback` for optimal performance\n * - **Boundary Calculation**: Real-time width calculation based on mouse/touch position\n * - **State Management**: Tracks resizing state for visual feedback\n * - **Memory Management**: Proper cleanup of global event listeners\n * - **Touch Events**: Full support for mobile touch interactions\n *\n * ## Visual Design\n * - **Resize Handle**: Rounded handle positioned on the right border\n * - **Border Indicator**: Visual border showing resizable edge\n * - **State Feedback**: Different colors for normal, hover, and active states\n * - **Dark Mode**: Full support with appropriate color scheme\n * - **Smooth Transitions**: CSS transitions for visual polish\n *\n * ## Use Cases\n * - **Application Sidebars**: Collapsible navigation and tool panels\n * - **Content Panels**: Adjustable content areas in complex layouts\n * - **Split Panes**: Dividing screen space between multiple content areas\n * - **Inspector Panels**: Debugging tools and property inspectors\n * - **File Explorers**: Tree views with adjustable column widths\n * - **Dashboard Widgets**: Customizable widget sizes for dashboards\n *\n * ## Accessibility Features\n * - **ARIA Slider**: Proper slider role for screen readers\n * - **Value Announcements**: Current, minimum, and maximum values announced\n * - **Keyboard Focus**: Focusable with tab navigation\n * - **Clear Affordances**: Visual indicators for interactive elements\n *\n * @example\n * ```tsx\n * // Application sidebar with resizing\n * const [sidebarWidth, setSidebarWidth] = useState(250);\n *\n * <div className=\"flex h-screen\">\n * <WithResizer\n * initialWidth={sidebarWidth}\n * minWidth={200}\n * maxWidth={400}\n * >\n * <aside className=\"h-full bg-gray-100 p-4\">\n * <nav>\n * <NavItems />\n * </nav>\n * </aside>\n * </WithResizer>\n *\n * <main className=\"flex-1 p-6\">\n * <MainContent />\n * </main>\n * </div>\n *\n * // Developer tools panel\n * <WithResizer\n * initialWidth={350}\n * minWidth={250}\n * maxWidth={600}\n * >\n * <div className=\"h-full flex flex-col\">\n * <div className=\"flex-1 overflow-auto p-4\">\n * <InspectorContent />\n * </div>\n * <div className=\"border-t p-2\">\n * <Controls />\n * </div>\n * </div>\n * </WithResizer>\n *\n * // Multi-column layout\n * <div className=\"flex h-full\">\n * <WithResizer initialWidth={300} minWidth={200} maxWidth={500}>\n * <FileExplorer />\n * </WithResizer>\n *\n * <WithResizer initialWidth={400} minWidth={300}>\n * <CodeEditor />\n * </WithResizer>\n *\n * <div className=\"flex-1 min-w-0\">\n * <OutputPanel />\n * </div>\n * </div>\n * ```\n *\n * ## Performance Considerations\n * - Uses passive event listeners to prevent scroll blocking\n * - Optimized with `useCallback` to prevent unnecessary re-renders\n * - Efficient boundary calculations using `getBoundingClientRect`\n * - Minimal DOM manipulation for smooth drag interactions\n *\n * ## Browser Support\n * - Modern browsers with support for touch events\n * - Graceful degradation for older browsers\n * - Mobile-first touch interaction handling\n */\nexport const WithResizer: FC<PropsWithChildren<WithResizerProps>> = ({\n initialWidth,\n maxWidth,\n minWidth = 0,\n handlePosition = 'right',\n children,\n}) => {\n const containerRef = useRef<HTMLDivElement>(null);\n const [width, setWidth] = useState(initialWidth);\n\n const resizeState = useRef({\n startX: 0,\n startWidth: 0,\n factor: 1,\n });\n\n // Handler to resize the div\n const resize = useCallback(\n (mouseMoveEvent: MouseEvent | TouchEvent) => {\n if (resizeState.current.startWidth === 0) return;\n\n let clientX = 0;\n if (mouseMoveEvent instanceof MouseEvent) {\n clientX = mouseMoveEvent.clientX;\n } else if (\n typeof TouchEvent !== 'undefined' &&\n mouseMoveEvent instanceof TouchEvent\n ) {\n clientX = mouseMoveEvent.touches[0].clientX;\n }\n\n const { startX, startWidth, factor } = resizeState.current;\n const delta = (clientX - startX) / factor;\n // Invert delta for left handle (moving left decreases width, moving right increases width)\n const adjustedDelta = handlePosition === 'left' ? -delta : delta;\n const newWidth = startWidth + adjustedDelta;\n\n const constrainedWidth = Math.max(\n Math.min(newWidth, maxWidth ?? Infinity),\n minWidth\n );\n\n setWidth(constrainedWidth);\n },\n [maxWidth, minWidth, handlePosition]\n );\n\n // Handler to stop resizing\n const stopResizing = useCallback(() => {\n document.body.style.cursor = '';\n document.body.style.userSelect = '';\n window.removeEventListener('mousemove', resize);\n window.removeEventListener('mouseup', stopResizing);\n window.removeEventListener('touchmove', resize);\n window.removeEventListener('touchend', stopResizing);\n }, [resize]);\n\n // Handler to start resizing\n const startResizing = useCallback(\n (\n mouseDownEvent:\n | React.MouseEvent<HTMLDivElement>\n | React.TouchEvent<HTMLDivElement>\n ) => {\n mouseDownEvent.preventDefault();\n const container = containerRef.current;\n\n if (!container) return;\n\n const { width: rectWidth } = container.getBoundingClientRect();\n const offsetWidth = container.offsetWidth;\n const factor = offsetWidth > 0 ? rectWidth / offsetWidth : 1;\n\n let clientX = 0;\n if ('touches' in mouseDownEvent) {\n clientX = mouseDownEvent.touches[0].clientX;\n } else {\n clientX = mouseDownEvent.clientX;\n }\n\n resizeState.current = {\n startX: clientX,\n startWidth: offsetWidth,\n factor,\n };\n\n document.body.style.cursor = 'ew-resize';\n document.body.style.userSelect = 'none';\n\n window.addEventListener('mousemove', resize, { passive: true });\n window.addEventListener('mouseup', stopResizing);\n window.addEventListener('touchmove', resize, { passive: true });\n window.addEventListener('touchend', stopResizing);\n },\n [resize, stopResizing]\n );\n\n useEffect(() => {\n return () => {\n window.removeEventListener('mousemove', resize);\n window.removeEventListener('mouseup', stopResizing);\n window.removeEventListener('touchmove', resize);\n window.removeEventListener('touchend', stopResizing);\n };\n }, [resize, stopResizing]);\n\n return (\n <div\n className={cn(\n 'relative h-full w-full max-w-[80%] shrink-0 cursor-ew-resize border-neutral-200 transition dark:border-neutral-950',\n handlePosition === 'right'\n ? [\n 'border-r-[2px]',\n 'after:absolute after:top-1/2 after:right-0 after:block after:h-10 after:w-2 after:translate-x-1/2 after:-translate-y-1/2 after:transform after:cursor-ew-resize after:rounded-full after:bg-neutral-200 after:transition after:content-[\"\"] dark:after:bg-neutral-950',\n ]\n : [\n 'border-l-[2px]',\n 'after:absolute after:top-1/2 after:left-0 after:block after:h-10 after:w-2 after:-translate-x-1/2 after:-translate-y-1/2 after:transform after:cursor-ew-resize after:rounded-full after:bg-neutral-200 after:transition after:content-[\"\"] dark:after:bg-neutral-950',\n ],\n 'active:border-neutral-400 active:after:bg-neutral-400 dark:active:border-neutral-600 active:dark:after:bg-neutral-600',\n minWidth && `min-w-[${minWidth}px]`,\n maxWidth && `max-w-[${maxWidth}px]`\n )}\n style={{\n width: `${width}px`,\n }}\n ref={containerRef}\n onMouseDown={startResizing}\n onTouchStart={startResizing}\n aria-valuemin={minWidth}\n aria-valuemax={maxWidth}\n aria-valuenow={width}\n aria-label=\"Resizable component\"\n role=\"slider\"\n tabIndex={0}\n >\n {/* biome-ignore lint/a11y/noStaticElementInteractions: This div stops event propagation to prevent content clicks from triggering resize */}\n <div\n role=\"presentation\"\n className=\"absolute top-0 left-0 size-full cursor-default overflow-hidden\"\n onMouseDown={(e) => e.stopPropagation()}\n onTouchStart={(e) => e.stopPropagation()}\n >\n {children}\n </div>\n </div>\n );\n};\n"],"mappings":"0KAmKA,MAAa,GAAwD,CACnE,eACA,WACA,WAAW,EACX,iBAAiB,QACjB,cACI,CACJ,IAAM,EAAe,EAAuB,KAAK,CAC3C,CAAC,EAAO,GAAY,EAAS,EAAa,CAE1C,EAAc,EAAO,CACzB,OAAQ,EACR,WAAY,EACZ,OAAQ,EACT,CAAC,CAGI,EAAS,EACZ,GAA4C,CAC3C,GAAI,EAAY,QAAQ,aAAe,EAAG,OAE1C,IAAI,EAAU,EACV,aAA0B,WAC5B,EAAU,EAAe,QAEzB,OAAO,WAAe,KACtB,aAA0B,aAE1B,EAAU,EAAe,QAAQ,GAAG,SAGtC,GAAM,CAAE,SAAQ,aAAY,UAAW,EAAY,QAC7C,GAAS,EAAU,GAAU,EAG7B,EAAW,GADK,IAAmB,OAAS,CAAC,EAAQ,GAQ3D,EALyB,KAAK,IAC5B,KAAK,IAAI,EAAU,GAAY,IAAS,CACxC,EACD,CAEyB,EAE5B,CAAC,EAAU,EAAU,EAAe,CACrC,CAGK,EAAe,MAAkB,CACrC,SAAS,KAAK,MAAM,OAAS,GAC7B,SAAS,KAAK,MAAM,WAAa,GACjC,OAAO,oBAAoB,YAAa,EAAO,CAC/C,OAAO,oBAAoB,UAAW,EAAa,CACnD,OAAO,oBAAoB,YAAa,EAAO,CAC/C,OAAO,oBAAoB,WAAY,EAAa,EACnD,CAAC,EAAO,CAAC,CAGN,EAAgB,EAElB,GAGG,CACH,EAAe,gBAAgB,CAC/B,IAAM,EAAY,EAAa,QAE/B,GAAI,CAAC,EAAW,OAEhB,GAAM,CAAE,MAAO,GAAc,EAAU,uBAAuB,CACxD,EAAc,EAAU,YACxB,EAAS,EAAc,EAAI,EAAY,EAAc,EAEvD,EAAU,EACd,AAGE,EAHE,YAAa,EACL,EAAe,QAAQ,GAAG,QAE1B,EAAe,QAG3B,EAAY,QAAU,CACpB,OAAQ,EACR,WAAY,EACZ,SACD,CAED,SAAS,KAAK,MAAM,OAAS,YAC7B,SAAS,KAAK,MAAM,WAAa,OAEjC,OAAO,iBAAiB,YAAa,EAAQ,CAAE,QAAS,GAAM,CAAC,CAC/D,OAAO,iBAAiB,UAAW,EAAa,CAChD,OAAO,iBAAiB,YAAa,EAAQ,CAAE,QAAS,GAAM,CAAC,CAC/D,OAAO,iBAAiB,WAAY,EAAa,EAEnD,CAAC,EAAQ,EAAa,CACvB,CAWD,OATA,UACe,CACX,OAAO,oBAAoB,YAAa,EAAO,CAC/C,OAAO,oBAAoB,UAAW,EAAa,CACnD,OAAO,oBAAoB,YAAa,EAAO,CAC/C,OAAO,oBAAoB,WAAY,EAAa,EAErD,CAAC,EAAQ,EAAa,CAAC,CAGxB,EAAC,MAAD,CACE,UAAW,EACT,qHACA,IAAmB,QACf,CACE,iBACA,wQACD,CACD,CACE,iBACA,wQACD,CACL,wHACA,GAAY,UAAU,EAAS,KAC/B,GAAY,UAAU,EAAS,KAChC,CACD,MAAO,CACL,MAAO,GAAG,EAAM,IACjB,CACD,IAAK,EACL,YAAa,EACb,aAAc,EACd,gBAAe,EACf,gBAAe,EACf,gBAAe,EACf,aAAW,sBACX,KAAK,SACL,SAAU,WAGV,EAAC,MAAD,CACE,KAAK,eACL,UAAU,iEACV,YAAc,GAAM,EAAE,iBAAiB,CACvC,aAAe,GAAM,EAAE,iBAAiB,CAEvC,WACG,CAAA,CACF,CAAA"}
@@ -1 +1 @@
1
- import{Container as e,ContainerBackground as t,ContainerBorderColor as n,ContainerGap as r,ContainerPadding as i,ContainerRoundedSize as a,ContainerSeparator as o,ContainerTransparency as s,containerVariants as c}from"./Container/index.mjs";import{Loader as l}from"./Loader/index.mjs";import{Button as u,ButtonColor as d,ButtonSize as f,ButtonTextAlign as p,ButtonVariant as m,buttonVariants as h}from"./Button/Button.mjs";import{MaxHeightSmoother as g}from"./MaxHeightSmoother/index.mjs";import{Accordion as _}from"./Accordion/Accordion.mjs";import{Avatar as v,getCapitals as y}from"./Avatar/index.mjs";import{Badge as b,BadgeColor as x,BadgeSize as S,BadgeVariant as C,badgeVariants as w}from"./Badge/index.mjs";import{Link as T,LinkColor as E,LinkRoundedSize as D,LinkSize as O,LinkUnderlined as k,LinkVariant as A,checkIsExternalLink as j,isTextChildren as M,linkVariants as N}from"./Link/Link.mjs";import{Breadcrumb as P}from"./Breadcrumb/index.mjs";import{Checkbox as F,CheckboxColor as I,CheckboxSize as L,checkboxVariants as R}from"./Input/Checkbox.mjs";import{Input as z,InputSize as B,InputVariant as V,inputVariants as H}from"./Input/Input.mjs";import{InputPassword as U}from"./Input/InputPassword.mjs";import{InputIndicator as W,InputOTP as G,InputOTPGroup as K,InputOTPSeparator as q,InputOTPSlot as J,OTPInput as Y,OTPInputContext as X,inputSlotVariants as Z,usePasswordManagerBadge as Q,usePrevious as $}from"./Input/OTPInput.mjs";import{SearchInput as ee}from"./Input/SearchInput.mjs";import{Browser as te}from"./Browser/Browser.mjs";import{KeyList as ne,KeyboardShortcut as re}from"./KeyboardShortcut/KeyboardShortcut.mjs";import{Detail as ie,PopoverStatic as ae,PopoverXAlign as oe,PopoverYAlign as se}from"./Popover/static.mjs";import{Popover as ce}from"./Popover/dynamic.mjs";import{Carousel as le}from"./Carousel/index.mjs";import{ClickOutsideDiv as ue}from"./ClickOutsideDiv/index.mjs";import{CollapsibleTable as de}from"./CollapsibleTable/CollapsibleTable.mjs";import{Command as fe,CommandRoot as pe}from"./Command/index.mjs";import{PressableSpan as me}from"./PressableSpan/PressableSpan.mjs";import{ContentSelector as he}from"./ContentSelector/ContentSelector.mjs";import{CopyButton as ge}from"./CopyButton/index.mjs";import{CopyToClipboard as _e,useCopyToClipboard as ve}from"./CopyToClipboard/index.mjs";import{EditableFieldInput as ye}from"./EditableField/EditableFieldInput.mjs";import{TextArea as be}from"./TextArea/TextArea.mjs";import{AutoSizedTextArea as xe}from"./TextArea/AutoSizeTextArea.mjs";import{AutoCompleteTextarea as Se,useDebounce as Ce}from"./TextArea/AutocompleteTextArea.mjs";import{EditableFieldTextArea as we}from"./EditableField/EditableFieldTextArea.mjs";import{DictionaryEditor as Te}from"./DictionaryEditor/DictionaryEditor.mjs";import{DropDown as Ee,DropDownAlign as De,DropDownYAlign as Oe}from"./DropDown/index.mjs";import{SwitchSelector as ke,SwitchSelectorColor as Ae,SwitchSelectorSize as je}from"./SwitchSelector/index.mjs";import{LocaleSwitcherContentProvider as Me,useLocaleSwitcherContent as Ne}from"./LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs";import{LocaleSwitcherContent as Pe}from"./LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs";import{Label as Fe}from"./Label/index.mjs";import{H1 as Ie,H2 as Le,H3 as Re,H4 as ze,H5 as Be,H6 as Ve}from"./Headers/index.mjs";import{ExpandCollapse as He}from"./ExpandCollapse/ExpandCollapse.mjs";import{CodeBlock as Ue,CodeDefault as We}from"./IDE/CodeBlockClient.mjs";import{MultiSelect as Ge}from"./Select/Multiselect.mjs";import{Select as Ke,SelectContent as qe,SelectContentPosition as Je,SelectLabel as Ye,SelectSeparator as Xe}from"./Select/Select.mjs";import{Code as Ze}from"./IDE/Code.mjs";import{TabSelector as Qe,TabSelectorColor as $e}from"./TabSelector/TabSelector.mjs";import{Tab as et}from"./Tab/Tab.mjs";import{Modal as tt,ModalSize as nt}from"./Modal/Modal.mjs";import{Table as rt}from"./Table/Table.mjs";import{MarkdownRenderer as it,getIntlayerMarkdownOptions as at}from"./MarkDownRender/MarkDownRender.mjs";import{TextEditor as ot,TextEditorContainer as st,traceKeys as ct}from"./DictionaryFieldEditor/ContentEditorView/TextEditor.mjs";import{KeyPathBreadcrumb as lt}from"./DictionaryFieldEditor/KeyPathBreadcrumb.mjs";import{ContentEditor as ut}from"./DictionaryFieldEditor/ContentEditor.mjs";import{useFormField as dt}from"./Form/FormField.mjs";import{InformationTag as ft}from"./InformationTag/index.mjs";import{useForm as pt}from"./Form/FormBase.mjs";import{Form as mt}from"./Form/Form.mjs";import{DictionaryCreationForm as ht}from"./DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs";import{SaveForm as gt}from"./DictionaryFieldEditor/SaveForm/SaveForm.mjs";import{DictionaryFieldEditor as _t}from"./DictionaryFieldEditor/DictionaryFieldEditor.mjs";import{VersionSwitcherProvider as vt,useVersionSwitcher as yt}from"./DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs";import{VersionSwitcher as bt}from"./DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs";import{Flag as xt}from"./Flags/Flag.mjs";import{flags_exports as St}from"./Flags/flags.mjs";import{Logo as Ct}from"./Logo/Logo.mjs";import{LogoTextOnly as wt}from"./Logo/LogoTextOnly.mjs";import{LogoWithText as Tt}from"./Logo/LogoWithText.mjs";import{LogoWithTextBelow as Et}from"./Logo/LogoWithTextBelow.mjs";import{DiscordLogo as Dt}from"./SocialNetworks/DiscordLogo.mjs";import{InstagramLogo as Ot}from"./SocialNetworks/InstagramLogo.mjs";import{LinkedInLogo as kt}from"./SocialNetworks/LinkedInLogo.mjs";import{ProductHuntLogo as At}from"./SocialNetworks/ProductHuntLogo.mjs";import{TiktokLogo as jt}from"./SocialNetworks/TiktokLogo.mjs";import{XLogo as Mt}from"./SocialNetworks/XLogo.mjs";import{YoutubeLogo as Nt}from"./SocialNetworks/YoutubeLogo.mjs";import{FacebookLogo as Pt}from"./SocialNetworks/FacebookLogo.mjs";import{SocialNetworks as Ft}from"./SocialNetworks/index.mjs";import{Footer as It}from"./Footer/index.mjs";import{HeightResizer as Lt}from"./HeightResizer/index.mjs";import{HideShow as Rt}from"./HideShow/index.mjs";import{HTMLRenderer as zt,getIntlayerHTMLOptions as Bt}from"./HTMLRender/HTMLRender.mjs";import{FileList as Vt}from"./IDE/FileList.mjs";import{WithResizer as Ht}from"./WithResizer/index.mjs";import{IDE as Ut}from"./IDE/IDE.mjs";import{KeyboardScreenAdapter as Wt}from"./KeyboardScreenAdapter/index.mjs";import{LanguageBackground as Gt,LanguageSection as Kt}from"./LanguageBackground/index.mjs";import{LocaleSwitcher as qt}from"./LocaleSwitcherDropDown/LocaleSwitcher.mjs";import{MaxWidthSmoother as Jt}from"./MaxWidthSmoother/index.mjs";import{Navbar as Yt}from"./Navbar/index.mjs";import{NumberItemsSelector as Xt}from"./Pagination/NumberItemsSelector.mjs";import{Pagination as Zt,PaginationSize as Qt,PaginationVariant as $t,paginationVariants as en}from"./Pagination/Pagination.mjs";import{ShowingResultsNumberItems as tn}from"./Pagination/ShowingResultsNumberItems.mjs";import{DotPattern as nn}from"./Pattern/DotPattern.mjs";import{GridPattern as rn}from"./Pattern/GridPattern.mjs";import{Spotlight as an}from"./Pattern/SpotLight.mjs";import{drawerManager as on,useRightDrawer as sn}from"./RightDrawer/useRightDrawer.mjs";import{RightDrawer as cn}from"./RightDrawer/RightDrawer.mjs";import{Tag as ln,TagBackground as un,TagBorder as dn,TagColor as fn,TagRoundedSize as pn,TagSize as mn}from"./Tag/index.mjs";import{Terminal as hn}from"./Terminal/Terminal.mjs";import{Modes as gn}from"./ThemeSwitcherDropDown/types.mjs";import{DesktopThemeSwitcher as _n}from"./ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs";import{MobileThemeSwitcher as vn}from"./ThemeSwitcherDropDown/MobileThemeSwitcher.mjs";import{Toast as yn,ToastAction as bn,ToastClose as xn,ToastDescription as Sn,ToastProvider as Cn,ToastTitle as wn,ToastViewport as Tn}from"./Toaster/Toast.mjs";import{reducer as En,toast as Dn,useToast as On}from"./Toaster/useToast.mjs";import{Toaster as kn}from"./Toaster/Toaster.mjs";export{_ as Accordion,Se as AutoCompleteTextarea,xe as AutoSizedTextArea,v as Avatar,b as Badge,x as BadgeColor,S as BadgeSize,C as BadgeVariant,P as Breadcrumb,te as Browser,u as Button,d as ButtonColor,f as ButtonSize,p as ButtonTextAlign,m as ButtonVariant,le as Carousel,F as Checkbox,I as CheckboxColor,L as CheckboxSize,ue as ClickOutsideDiv,Ze as Code,Ue as CodeBlock,We as CodeDefault,de as CollapsibleTable,fe as Command,pe as CommandRoot,e as Container,t as ContainerBackground,n as ContainerBorderColor,r as ContainerGap,i as ContainerPadding,a as ContainerRoundedSize,o as ContainerSeparator,s as ContainerTransparency,ut as ContentEditor,he as ContentSelector,ge as CopyButton,_e as CopyToClipboard,_n as DesktopThemeSwitcher,ie as Detail,ht as DictionaryCreationForm,Te as DictionaryEditor,_t as DictionaryFieldEditor,Dt as DiscordLogo,nn as DotPattern,Ee as DropDown,De as DropDownAlign,Oe as DropDownYAlign,ye as EditableFieldInput,we as EditableFieldTextArea,He as ExpandCollapse,Pt as FacebookLogo,Vt as FileList,xt as Flag,St as Flags,It as Footer,mt as Form,rn as GridPattern,Ie as H1,Le as H2,Re as H3,ze as H4,Be as H5,Ve as H6,zt as HTMLRenderer,Lt as HeightResizer,Rt as HideShow,Ut as IDE,ft as InformationTag,z as Input,W as InputIndicator,G as InputOTP,K as InputOTPGroup,q as InputOTPSeparator,J as InputOTPSlot,U as InputPassword,B as InputSize,V as InputVariant,Ot as InstagramLogo,ne as KeyList,lt as KeyPathBreadcrumb,Wt as KeyboardScreenAdapter,re as KeyboardShortcut,Fe as Label,Gt as LanguageBackground,Kt as LanguageSection,T as Link,E as LinkColor,D as LinkRoundedSize,O as LinkSize,k as LinkUnderlined,A as LinkVariant,kt as LinkedInLogo,l as Loader,qt as LocaleSwitcher,Pe as LocaleSwitcherContent,Me as LocaleSwitcherContentProvider,Ct as Logo,wt as LogoTextOnly,Tt as LogoWithText,Et as LogoWithTextBelow,it as MarkdownRenderer,g as MaxHeightSmoother,Jt as MaxWidthSmoother,vn as MobileThemeSwitcher,tt as Modal,nt as ModalSize,gn as Modes,Ge as MultiSelect,Yt as Navbar,Xt as NumberItemsSelector,Y as OTPInput,X as OTPInputContext,Zt as Pagination,Qt as PaginationSize,$t as PaginationVariant,ce as Popover,ae as PopoverStatic,oe as PopoverXAlign,se as PopoverYAlign,me as PressableSpan,At as ProductHuntLogo,cn as RightDrawer,gt as SaveForm,ee as SearchInput,Ke as Select,qe as SelectContent,Je as SelectContentPosition,Ye as SelectLabel,Xe as SelectSeparator,tn as ShowingResultsNumberItems,Ft as SocialNetworks,an as Spotlight,ke as SwitchSelector,Ae as SwitchSelectorColor,je as SwitchSelectorSize,et as Tab,Qe as TabSelector,$e as TabSelectorColor,rt as Table,ln as Tag,un as TagBackground,dn as TagBorder,fn as TagColor,pn as TagRoundedSize,mn as TagSize,hn as Terminal,be as TextArea,ot as TextEditor,st as TextEditorContainer,jt as TiktokLogo,yn as Toast,bn as ToastAction,xn as ToastClose,Sn as ToastDescription,Cn as ToastProvider,wn as ToastTitle,Tn as ToastViewport,kn as Toaster,bt as VersionSwitcher,vt as VersionSwitcherProvider,Ht as WithResizer,Mt as XLogo,Nt as YoutubeLogo,w as badgeVariants,h as buttonVariants,j as checkIsExternalLink,R as checkboxVariants,c as containerVariants,on as drawerManager,y as getCapitals,Bt as getIntlayerHTMLOptions,at as getIntlayerMarkdownOptions,Z as inputSlotVariants,H as inputVariants,M as isTextChildren,N as linkVariants,en as paginationVariants,En as reducer,Dn as toast,ct as traceKeys,ve as useCopyToClipboard,Ce as useDebounce,pt as useForm,dt as useFormField,Ne as useLocaleSwitcherContent,Q as usePasswordManagerBadge,$ as usePrevious,sn as useRightDrawer,On as useToast,yt as useVersionSwitcher};
1
+ import{Container as e,ContainerBackground as t,ContainerBorderColor as n,ContainerGap as r,ContainerPadding as i,ContainerRoundedSize as a,ContainerSeparator as o,ContainerTransparency as s,containerVariants as c}from"./Container/index.mjs";import{Loader as l}from"./Loader/index.mjs";import{Button as u,ButtonColor as d,ButtonSize as f,ButtonTextAlign as p,ButtonVariant as m,buttonVariants as h}from"./Button/Button.mjs";import{MaxHeightSmoother as g}from"./MaxHeightSmoother/index.mjs";import{Accordion as _}from"./Accordion/Accordion.mjs";import{Avatar as v,getCapitals as y}from"./Avatar/index.mjs";import{Badge as b,BadgeColor as x,BadgeSize as S,BadgeVariant as C,badgeVariants as w}from"./Badge/index.mjs";import{Link as T,LinkColor as E,LinkRoundedSize as D,LinkSize as O,LinkUnderlined as k,LinkVariant as A,checkIsExternalLink as j,isTextChildren as M,linkVariants as N}from"./Link/Link.mjs";import{Breadcrumb as P}from"./Breadcrumb/index.mjs";import{Checkbox as F,CheckboxColor as I,CheckboxSize as L,checkboxVariants as R}from"./Input/Checkbox.mjs";import{Input as z,InputSize as B,InputVariant as V,inputVariants as H}from"./Input/Input.mjs";import{InputPassword as U}from"./Input/InputPassword.mjs";import{InputIndicator as W,InputOTP as G,InputOTPGroup as K,InputOTPSeparator as q,InputOTPSlot as J,OTPInput as Y,OTPInputContext as X,inputSlotVariants as Z,usePasswordManagerBadge as Q,usePrevious as $}from"./Input/OTPInput.mjs";import{SearchInput as ee}from"./Input/SearchInput.mjs";import{Browser as te}from"./Browser/Browser.mjs";import{KeyList as ne,KeyboardShortcut as re}from"./KeyboardShortcut/KeyboardShortcut.mjs";import{Detail as ie,PopoverStatic as ae,PopoverXAlign as oe,PopoverYAlign as se}from"./Popover/static.mjs";import{Popover as ce}from"./Popover/dynamic.mjs";import{Carousel as le}from"./Carousel/index.mjs";import{ClickOutsideDiv as ue}from"./ClickOutsideDiv/index.mjs";import{CollapsibleTable as de}from"./CollapsibleTable/CollapsibleTable.mjs";import{Command as fe,CommandRoot as pe}from"./Command/index.mjs";import{PressableSpan as me}from"./PressableSpan/PressableSpan.mjs";import{ContentSelector as he}from"./ContentSelector/ContentSelector.mjs";import{CopyButton as ge}from"./CopyButton/index.mjs";import{CopyToClipboard as _e,useCopyToClipboard as ve}from"./CopyToClipboard/index.mjs";import{EditableFieldInput as ye}from"./EditableField/EditableFieldInput.mjs";import{TextArea as be}from"./TextArea/TextArea.mjs";import{AutoSizedTextArea as xe}from"./TextArea/AutoSizeTextArea.mjs";import{AutoCompleteTextarea as Se,useDebounce as Ce}from"./TextArea/AutocompleteTextArea.mjs";import{EditableFieldTextArea as we}from"./EditableField/EditableFieldTextArea.mjs";import{DictionaryEditor as Te}from"./DictionaryEditor/DictionaryEditor.mjs";import{DropDown as Ee,DropDownAlign as De,DropDownYAlign as Oe}from"./DropDown/index.mjs";import{SwitchSelector as ke,SwitchSelectorColor as Ae,SwitchSelectorSize as je}from"./SwitchSelector/index.mjs";import{LocaleSwitcherContentProvider as Me,useLocaleSwitcherContent as Ne}from"./LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs";import{LocaleSwitcherContent as Pe}from"./LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs";import{Label as Fe}from"./Label/index.mjs";import{H1 as Ie,H2 as Le,H3 as Re,H4 as ze,H5 as Be,H6 as Ve}from"./Headers/index.mjs";import{ExpandCollapse as He}from"./ExpandCollapse/ExpandCollapse.mjs";import{CodeBlock as Ue,CodeDefault as We}from"./IDE/CodeBlockClient.mjs";import{MultiSelect as Ge}from"./Select/Multiselect.mjs";import{Select as Ke,SelectContent as qe,SelectContentPosition as Je,SelectLabel as Ye,SelectSeparator as Xe}from"./Select/Select.mjs";import{Code as Ze}from"./IDE/Code.mjs";import{TabSelector as Qe,TabSelectorColor as $e}from"./TabSelector/TabSelector.mjs";import{Tab as et}from"./Tab/Tab.mjs";import{Modal as tt,ModalSize as nt}from"./Modal/Modal.mjs";import{Table as rt}from"./Table/Table.mjs";import{MarkdownRenderer as it,baseMarkdownComponents as at,getIntlayerMarkdownOptions as ot}from"./MarkDownRender/MarkDownRender.mjs";import{TextEditor as st,TextEditorContainer as ct,traceKeys as lt}from"./DictionaryFieldEditor/ContentEditorView/TextEditor.mjs";import{KeyPathBreadcrumb as ut}from"./DictionaryFieldEditor/KeyPathBreadcrumb.mjs";import{ContentEditor as dt}from"./DictionaryFieldEditor/ContentEditor.mjs";import{useFormField as ft}from"./Form/FormField.mjs";import{InformationTag as pt}from"./InformationTag/index.mjs";import{useForm as mt}from"./Form/FormBase.mjs";import{Form as ht}from"./Form/Form.mjs";import{DictionaryCreationForm as gt}from"./DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs";import{SaveForm as _t}from"./DictionaryFieldEditor/SaveForm/SaveForm.mjs";import{DictionaryFieldEditor as vt}from"./DictionaryFieldEditor/DictionaryFieldEditor.mjs";import{VersionSwitcherProvider as yt,useVersionSwitcher as bt}from"./DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs";import{VersionSwitcher as xt}from"./DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs";import{Flag as St}from"./Flags/Flag.mjs";import{flags_exports as Ct}from"./Flags/flags.mjs";import{Logo as wt}from"./Logo/Logo.mjs";import{LogoTextOnly as Tt}from"./Logo/LogoTextOnly.mjs";import{LogoWithText as Et}from"./Logo/LogoWithText.mjs";import{LogoWithTextBelow as Dt}from"./Logo/LogoWithTextBelow.mjs";import{DiscordLogo as Ot}from"./SocialNetworks/DiscordLogo.mjs";import{InstagramLogo as kt}from"./SocialNetworks/InstagramLogo.mjs";import{LinkedInLogo as At}from"./SocialNetworks/LinkedInLogo.mjs";import{ProductHuntLogo as jt}from"./SocialNetworks/ProductHuntLogo.mjs";import{TiktokLogo as Mt}from"./SocialNetworks/TiktokLogo.mjs";import{XLogo as Nt}from"./SocialNetworks/XLogo.mjs";import{YoutubeLogo as Pt}from"./SocialNetworks/YoutubeLogo.mjs";import{FacebookLogo as Ft}from"./SocialNetworks/FacebookLogo.mjs";import{SocialNetworks as It}from"./SocialNetworks/index.mjs";import{Footer as Lt}from"./Footer/index.mjs";import{HeightResizer as Rt}from"./HeightResizer/index.mjs";import{HideShow as zt}from"./HideShow/index.mjs";import{HTMLRenderer as Bt,getIntlayerHTMLOptions as Vt}from"./HTMLRender/HTMLRender.mjs";import{FileList as Ht}from"./IDE/FileList.mjs";import{WithResizer as Ut}from"./WithResizer/index.mjs";import{IDE as Wt}from"./IDE/IDE.mjs";import{KeyboardScreenAdapter as Gt}from"./KeyboardScreenAdapter/index.mjs";import{LanguageBackground as Kt,LanguageSection as qt}from"./LanguageBackground/index.mjs";import{LocaleSwitcher as Jt}from"./LocaleSwitcherDropDown/LocaleSwitcher.mjs";import{MaxWidthSmoother as Yt}from"./MaxWidthSmoother/index.mjs";import{Navbar as Xt}from"./Navbar/index.mjs";import{NumberItemsSelector as Zt}from"./Pagination/NumberItemsSelector.mjs";import{Pagination as Qt,PaginationSize as $t,PaginationVariant as en,paginationVariants as tn}from"./Pagination/Pagination.mjs";import{ShowingResultsNumberItems as nn}from"./Pagination/ShowingResultsNumberItems.mjs";import{DotPattern as rn}from"./Pattern/DotPattern.mjs";import{GridPattern as an}from"./Pattern/GridPattern.mjs";import{Spotlight as on}from"./Pattern/SpotLight.mjs";import{drawerManager as sn,useRightDrawer as cn}from"./RightDrawer/useRightDrawer.mjs";import{RightDrawer as ln}from"./RightDrawer/RightDrawer.mjs";import{Tag as un,TagBackground as dn,TagBorder as fn,TagColor as pn,TagRoundedSize as mn,TagSize as hn}from"./Tag/index.mjs";import{Terminal as gn}from"./Terminal/Terminal.mjs";import{Modes as _n}from"./ThemeSwitcherDropDown/types.mjs";import{DesktopThemeSwitcher as vn}from"./ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs";import{MobileThemeSwitcher as yn}from"./ThemeSwitcherDropDown/MobileThemeSwitcher.mjs";import{Toast as bn,ToastAction as xn,ToastClose as Sn,ToastDescription as Cn,ToastProvider as wn,ToastTitle as Tn,ToastViewport as En}from"./Toaster/Toast.mjs";import{reducer as Dn,toast as On,useToast as kn}from"./Toaster/useToast.mjs";import{Toaster as An}from"./Toaster/Toaster.mjs";export{_ as Accordion,Se as AutoCompleteTextarea,xe as AutoSizedTextArea,v as Avatar,b as Badge,x as BadgeColor,S as BadgeSize,C as BadgeVariant,P as Breadcrumb,te as Browser,u as Button,d as ButtonColor,f as ButtonSize,p as ButtonTextAlign,m as ButtonVariant,le as Carousel,F as Checkbox,I as CheckboxColor,L as CheckboxSize,ue as ClickOutsideDiv,Ze as Code,Ue as CodeBlock,We as CodeDefault,de as CollapsibleTable,fe as Command,pe as CommandRoot,e as Container,t as ContainerBackground,n as ContainerBorderColor,r as ContainerGap,i as ContainerPadding,a as ContainerRoundedSize,o as ContainerSeparator,s as ContainerTransparency,dt as ContentEditor,he as ContentSelector,ge as CopyButton,_e as CopyToClipboard,vn as DesktopThemeSwitcher,ie as Detail,gt as DictionaryCreationForm,Te as DictionaryEditor,vt as DictionaryFieldEditor,Ot as DiscordLogo,rn as DotPattern,Ee as DropDown,De as DropDownAlign,Oe as DropDownYAlign,ye as EditableFieldInput,we as EditableFieldTextArea,He as ExpandCollapse,Ft as FacebookLogo,Ht as FileList,St as Flag,Ct as Flags,Lt as Footer,ht as Form,an as GridPattern,Ie as H1,Le as H2,Re as H3,ze as H4,Be as H5,Ve as H6,Bt as HTMLRenderer,Rt as HeightResizer,zt as HideShow,Wt as IDE,pt as InformationTag,z as Input,W as InputIndicator,G as InputOTP,K as InputOTPGroup,q as InputOTPSeparator,J as InputOTPSlot,U as InputPassword,B as InputSize,V as InputVariant,kt as InstagramLogo,ne as KeyList,ut as KeyPathBreadcrumb,Gt as KeyboardScreenAdapter,re as KeyboardShortcut,Fe as Label,Kt as LanguageBackground,qt as LanguageSection,T as Link,E as LinkColor,D as LinkRoundedSize,O as LinkSize,k as LinkUnderlined,A as LinkVariant,At as LinkedInLogo,l as Loader,Jt as LocaleSwitcher,Pe as LocaleSwitcherContent,Me as LocaleSwitcherContentProvider,wt as Logo,Tt as LogoTextOnly,Et as LogoWithText,Dt as LogoWithTextBelow,it as MarkdownRenderer,g as MaxHeightSmoother,Yt as MaxWidthSmoother,yn as MobileThemeSwitcher,tt as Modal,nt as ModalSize,_n as Modes,Ge as MultiSelect,Xt as Navbar,Zt as NumberItemsSelector,Y as OTPInput,X as OTPInputContext,Qt as Pagination,$t as PaginationSize,en as PaginationVariant,ce as Popover,ae as PopoverStatic,oe as PopoverXAlign,se as PopoverYAlign,me as PressableSpan,jt as ProductHuntLogo,ln as RightDrawer,_t as SaveForm,ee as SearchInput,Ke as Select,qe as SelectContent,Je as SelectContentPosition,Ye as SelectLabel,Xe as SelectSeparator,nn as ShowingResultsNumberItems,It as SocialNetworks,on as Spotlight,ke as SwitchSelector,Ae as SwitchSelectorColor,je as SwitchSelectorSize,et as Tab,Qe as TabSelector,$e as TabSelectorColor,rt as Table,un as Tag,dn as TagBackground,fn as TagBorder,pn as TagColor,mn as TagRoundedSize,hn as TagSize,gn as Terminal,be as TextArea,st as TextEditor,ct as TextEditorContainer,Mt as TiktokLogo,bn as Toast,xn as ToastAction,Sn as ToastClose,Cn as ToastDescription,wn as ToastProvider,Tn as ToastTitle,En as ToastViewport,An as Toaster,xt as VersionSwitcher,yt as VersionSwitcherProvider,Ut as WithResizer,Nt as XLogo,Pt as YoutubeLogo,w as badgeVariants,at as baseMarkdownComponents,h as buttonVariants,j as checkIsExternalLink,R as checkboxVariants,c as containerVariants,sn as drawerManager,y as getCapitals,Vt as getIntlayerHTMLOptions,ot as getIntlayerMarkdownOptions,Z as inputSlotVariants,H as inputVariants,M as isTextChildren,N as linkVariants,tn as paginationVariants,Dn as reducer,On as toast,lt as traceKeys,ve as useCopyToClipboard,Ce as useDebounce,mt as useForm,ft as useFormField,Ne as useLocaleSwitcherContent,Q as usePasswordManagerBadge,$ as usePrevious,cn as useRightDrawer,kn as useToast,bt as useVersionSwitcher};
@@ -1 +1 @@
1
- import{calculateIsMobile as e,checkIsIOS as t,checkIsIphoneOrSafariDevice as n,checkIsMac as r,checkIsMobileScreen as i,checkIsMobileUserAgent as a,getBreakpointFromSize as o,useDevice as s}from"./useDevice.mjs";import{useOAuth2 as c}from"./useAuth/useOAuth2.mjs";import{useSession as l}from"./useAuth/useSession.mjs";import{useAuth as u}from"./useAuth/useAuth.mjs";import{useIntlayerAuth as d,useIntlayerOAuth as f}from"./useIntlayerAPI.mjs";import{useAddDictionary as p,useAddNewAccessKey as m,useAddOrganization as h,useAddOrganizationMember as g,useAddPasskey as _,useAddProject as v,useAddTag as y,useAppQuery as b,useAskDocQuestion as x,useAskResetPassword as S,useAuditContentDeclaration as C,useAuditContentDeclarationField as w,useAuditContentDeclarationMetadata as T,useAuditTag as E,useAutocomplete as D,useBitbucketAuth as O,useBitbucketCheckConfig as k,useBitbucketGetConfigFile as A,useBitbucketRepos as j,useCancelSubscription as M,useChangePassword as N,useCreateUser as P,useDeleteAccessKey as F,useDeleteDictionary as I,useDeleteOrganization as L,useDeletePasskey as R,useDeleteProject as z,useDeleteSSOProvider as B,useDeleteTag as V,useDeleteUser as H,useDisableTwoFactor as U,useEnableTwoFactor as W,useGetCIConfig as G,useGetDictionaries as K,useGetDictionariesKeys as q,useGetDictionary as J,useGetDiscussions as Y,useGetDiscussionsData as X,useGetEditorDictionaries as Z,useGetNewsletterStatus as Q,useGetOrganizations as $,useGetPricing as ee,useGetProjects as te,useGetSubscription as ne,useGetTags as re,useGetUserByAccount as ie,useGetUserById as ae,useGetUsers as oe,useGetVerifyEmailStatus as se,useGithubAuth as ce,useGithubCheckConfig as le,useGithubGetAuthUrl as ue,useGithubGetConfigFile as de,useGithubRepos as fe,useGitlabAuth as pe,useGitlabCheckConfig as me,useGitlabGetConfigFile as he,useGitlabProjects as ge,useInfiniteGetDictionaries as _e,useListPasskeys as ve,useListSSOProviders as ye,useLogin as be,useLogout as xe,usePushCIConfig as Se,usePushDictionaries as Ce,useQueryClient as we,useRefreshAccessKey as Te,useRegister as Ee,useRegisterSSO as De,useResetPassword as Oe,useSearchDoc as ke,useSelectOrganization as Ae,useSelectProject as je,useSignInMagicLink as Me,useSignInPasskey as Ne,useSignInSSO as Pe,useSubscribeToNewsletter as Fe,useTranslateJSONDeclaration as Ie,useTriggerBuild as Le,useTriggerWebhook as Re,useUnselectOrganization as ze,useUnselectProject as Be,useUnsubscribeFromNewsletter as Ve,useUpdateDictionary as He,useUpdateOrganization as Ue,useUpdateOrganizationMembers as We,useUpdateOrganizationMembersById as Ge,useUpdateProject as Ke,useUpdateProjectMembers as qe,useUpdateTag as Je,useUpdateUser as Ye,useVerifyBackupCode as Xe,useVerifyEmail as Ze,useVerifyTotp as Qe,useWriteDictionary as $e}from"./reactQuery.mjs";import{usePersistedStore as et}from"./usePersistedStore.mjs";import{useItemSelector as tt}from"./useItemSelector.mjs";import{useUser as nt}from"./useUser/index.mjs";import{useHorizontalSwipe as rt}from"./useHorizontalSwipe.mjs";import{useGetElementById as it}from"./useGetElementById.mjs";import{useGetElementOrWindow as at}from"./useGetElementOrWindow.mjs";import{useIsDarkMode as ot}from"./useIsDarkMode.mjs";import{useIsMounted as st}from"./useIsMounted.mjs";import{useKeyboardDetector as ct}from"./useKeyboardDetector.mjs";import{useScreenWidth as lt}from"./useScreenWidth.mjs";import{useScrollBlockage as ut}from"./useScrollBlockage/index.mjs";import{useScrollDetection as dt}from"./useScrollDetection.mjs";import{useScrollY as ft}from"./useScrollY.mjs";import{useSearch as pt}from"./useSearch.mjs";export{e as calculateIsMobile,t as checkIsIOS,n as checkIsIphoneOrSafariDevice,r as checkIsMac,i as checkIsMobileScreen,a as checkIsMobileUserAgent,o as getBreakpointFromSize,p as useAddDictionary,m as useAddNewAccessKey,h as useAddOrganization,g as useAddOrganizationMember,_ as useAddPasskey,v as useAddProject,y as useAddTag,b as useAppQuery,x as useAskDocQuestion,S as useAskResetPassword,C as useAuditContentDeclaration,w as useAuditContentDeclarationField,T as useAuditContentDeclarationMetadata,E as useAuditTag,u as useAuth,D as useAutocomplete,O as useBitbucketAuth,k as useBitbucketCheckConfig,A as useBitbucketGetConfigFile,j as useBitbucketRepos,M as useCancelSubscription,N as useChangePassword,P as useCreateUser,F as useDeleteAccessKey,I as useDeleteDictionary,L as useDeleteOrganization,R as useDeletePasskey,z as useDeleteProject,B as useDeleteSSOProvider,V as useDeleteTag,H as useDeleteUser,s as useDevice,U as useDisableTwoFactor,W as useEnableTwoFactor,G as useGetCIConfig,K as useGetDictionaries,q as useGetDictionariesKeys,J as useGetDictionary,Y as useGetDiscussions,X as useGetDiscussionsData,Z as useGetEditorDictionaries,it as useGetElementById,at as useGetElementOrWindow,Q as useGetNewsletterStatus,$ as useGetOrganizations,ee as useGetPricing,te as useGetProjects,ne as useGetSubscription,re as useGetTags,ie as useGetUserByAccount,ae as useGetUserById,oe as useGetUsers,se as useGetVerifyEmailStatus,ce as useGithubAuth,le as useGithubCheckConfig,ue as useGithubGetAuthUrl,de as useGithubGetConfigFile,fe as useGithubRepos,pe as useGitlabAuth,me as useGitlabCheckConfig,he as useGitlabGetConfigFile,ge as useGitlabProjects,rt as useHorizontalSwipe,_e as useInfiniteGetDictionaries,d as useIntlayerAuth,f as useIntlayerOAuth,ot as useIsDarkMode,st as useIsMounted,tt as useItemSelector,ct as useKeyboardDetector,ve as useListPasskeys,ye as useListSSOProviders,be as useLogin,xe as useLogout,c as useOAuth2,et as usePersistedStore,Se as usePushCIConfig,Ce as usePushDictionaries,we as useQueryClient,Te as useRefreshAccessKey,Ee as useRegister,De as useRegisterSSO,Oe as useResetPassword,lt as useScreenWidth,ut as useScrollBlockage,dt as useScrollDetection,ft as useScrollY,pt as useSearch,ke as useSearchDoc,Ae as useSelectOrganization,je as useSelectProject,l as useSession,Me as useSignInMagicLink,Ne as useSignInPasskey,Pe as useSignInSSO,Fe as useSubscribeToNewsletter,Ie as useTranslateJSONDeclaration,Le as useTriggerBuild,Re as useTriggerWebhook,ze as useUnselectOrganization,Be as useUnselectProject,Ve as useUnsubscribeFromNewsletter,He as useUpdateDictionary,Ue as useUpdateOrganization,We as useUpdateOrganizationMembers,Ge as useUpdateOrganizationMembersById,Ke as useUpdateProject,qe as useUpdateProjectMembers,Je as useUpdateTag,Ye as useUpdateUser,nt as useUser,Xe as useVerifyBackupCode,Ze as useVerifyEmail,Qe as useVerifyTotp,$e as useWriteDictionary};
1
+ import{calculateIsMobile as e,checkIsIOS as t,checkIsIphoneOrSafariDevice as n,checkIsMac as r,checkIsMobileScreen as i,checkIsMobileUserAgent as a,getBreakpointFromSize as o,useDevice as s}from"./useDevice.mjs";import{useOAuth2 as c}from"./useAuth/useOAuth2.mjs";import{useSession as l}from"./useAuth/useSession.mjs";import{useAuth as u}from"./useAuth/useAuth.mjs";import{useIntlayerAuth as d,useIntlayerOAuth as f}from"./useIntlayerAPI.mjs";import{useAddDictionary as p,useAddNewAccessKey as m,useAddOrganization as h,useAddOrganizationMember as g,useAddPasskey as _,useAddProject as v,useAddTag as y,useAppQuery as b,useAskDocQuestion as x,useAskResetPassword as S,useAuditContentDeclaration as C,useAuditContentDeclarationField as w,useAuditContentDeclarationMetadata as T,useAuditScan as E,useAuditTag as D,useAutocomplete as O,useBitbucketAuth as k,useBitbucketCheckConfig as A,useBitbucketGetConfigFile as j,useBitbucketRepos as M,useCancelSubscription as N,useChangePassword as P,useCreateUser as F,useDeleteAccessKey as I,useDeleteDictionary as L,useDeleteOrganization as R,useDeletePasskey as z,useDeleteProject as B,useDeleteSSOProvider as V,useDeleteShowcaseProject as H,useDeleteTag as U,useDeleteUser as W,useDisableTwoFactor as G,useEnableTwoFactor as K,useGetCIConfig as q,useGetDictionaries as J,useGetDictionariesKeys as Y,useGetDictionary as X,useGetDiscussions as Z,useGetDiscussionsData as Q,useGetEditorDictionaries as $,useGetNewsletterStatus as ee,useGetOrganizations as te,useGetOtherShowcaseProjects as ne,useGetPricing as re,useGetProjects as ie,useGetRecursiveAuditStatus as ae,useGetShowcaseProjectById as oe,useGetShowcaseProjects as se,useGetSubscription as ce,useGetTags as le,useGetUserByAccount as ue,useGetUserById as de,useGetUsers as fe,useGetVerifyEmailStatus as pe,useGithubAuth as me,useGithubCheckConfig as he,useGithubGetAuthUrl as ge,useGithubGetConfigFile as _e,useGithubRepos as ve,useGitlabAuth as ye,useGitlabCheckConfig as be,useGitlabGetConfigFile as xe,useGitlabProjects as Se,useInfiniteGetDictionaries as Ce,useListPasskeys as we,useListSSOProviders as Te,useLogin as Ee,useLogout as De,usePushCIConfig as Oe,usePushDictionaries as ke,useQueryClient as Ae,useRefreshAccessKey as je,useRegister as Me,useRegisterSSO as Ne,useResetPassword as Pe,useSearchDoc as Fe,useSelectOrganization as Ie,useSelectProject as Le,useSignInMagicLink as Re,useSignInPasskey as ze,useSignInSSO as Be,useStartRecursiveAudit as Ve,useSubmitShowcaseProject as He,useSubscribeToNewsletter as Ue,useToggleShowcaseDownvote as We,useToggleShowcaseUpvote as Ge,useTranslateJSONDeclaration as Ke,useTriggerBuild as qe,useTriggerWebhook as Je,useUnselectOrganization as Ye,useUnselectProject as Xe,useUnsubscribeFromNewsletter as Ze,useUpdateDictionary as Qe,useUpdateOrganization as $e,useUpdateOrganizationMembers as et,useUpdateOrganizationMembersById as tt,useUpdateProject as nt,useUpdateProjectMembers as rt,useUpdateShowcaseProject as it,useUpdateTag as at,useUpdateUser as ot,useVerifyBackupCode as st,useVerifyEmail as ct,useVerifyTotp as lt,useWriteDictionary as ut}from"./reactQuery.mjs";import{usePersistedStore as dt}from"./usePersistedStore.mjs";import{useItemSelector as ft}from"./useItemSelector.mjs";import{useUser as pt}from"./useUser/index.mjs";import{useHorizontalSwipe as mt}from"./useHorizontalSwipe.mjs";import{useGetElementById as ht}from"./useGetElementById.mjs";import{useGetElementOrWindow as gt}from"./useGetElementOrWindow.mjs";import{useIsDarkMode as _t}from"./useIsDarkMode.mjs";import{useIsMounted as vt}from"./useIsMounted.mjs";import{useKeyboardDetector as yt}from"./useKeyboardDetector.mjs";import{useScreenWidth as bt}from"./useScreenWidth.mjs";import{useScrollBlockage as xt}from"./useScrollBlockage/index.mjs";import{useScrollDetection as St}from"./useScrollDetection.mjs";import{useScrollY as Ct}from"./useScrollY.mjs";import{useSearch as wt}from"./useSearch.mjs";export{e as calculateIsMobile,t as checkIsIOS,n as checkIsIphoneOrSafariDevice,r as checkIsMac,i as checkIsMobileScreen,a as checkIsMobileUserAgent,o as getBreakpointFromSize,p as useAddDictionary,m as useAddNewAccessKey,h as useAddOrganization,g as useAddOrganizationMember,_ as useAddPasskey,v as useAddProject,y as useAddTag,b as useAppQuery,x as useAskDocQuestion,S as useAskResetPassword,C as useAuditContentDeclaration,w as useAuditContentDeclarationField,T as useAuditContentDeclarationMetadata,E as useAuditScan,D as useAuditTag,u as useAuth,O as useAutocomplete,k as useBitbucketAuth,A as useBitbucketCheckConfig,j as useBitbucketGetConfigFile,M as useBitbucketRepos,N as useCancelSubscription,P as useChangePassword,F as useCreateUser,I as useDeleteAccessKey,L as useDeleteDictionary,R as useDeleteOrganization,z as useDeletePasskey,B as useDeleteProject,V as useDeleteSSOProvider,H as useDeleteShowcaseProject,U as useDeleteTag,W as useDeleteUser,s as useDevice,G as useDisableTwoFactor,K as useEnableTwoFactor,q as useGetCIConfig,J as useGetDictionaries,Y as useGetDictionariesKeys,X as useGetDictionary,Z as useGetDiscussions,Q as useGetDiscussionsData,$ as useGetEditorDictionaries,ht as useGetElementById,gt as useGetElementOrWindow,ee as useGetNewsletterStatus,te as useGetOrganizations,ne as useGetOtherShowcaseProjects,re as useGetPricing,ie as useGetProjects,ae as useGetRecursiveAuditStatus,oe as useGetShowcaseProjectById,se as useGetShowcaseProjects,ce as useGetSubscription,le as useGetTags,ue as useGetUserByAccount,de as useGetUserById,fe as useGetUsers,pe as useGetVerifyEmailStatus,me as useGithubAuth,he as useGithubCheckConfig,ge as useGithubGetAuthUrl,_e as useGithubGetConfigFile,ve as useGithubRepos,ye as useGitlabAuth,be as useGitlabCheckConfig,xe as useGitlabGetConfigFile,Se as useGitlabProjects,mt as useHorizontalSwipe,Ce as useInfiniteGetDictionaries,d as useIntlayerAuth,f as useIntlayerOAuth,_t as useIsDarkMode,vt as useIsMounted,ft as useItemSelector,yt as useKeyboardDetector,we as useListPasskeys,Te as useListSSOProviders,Ee as useLogin,De as useLogout,c as useOAuth2,dt as usePersistedStore,Oe as usePushCIConfig,ke as usePushDictionaries,Ae as useQueryClient,je as useRefreshAccessKey,Me as useRegister,Ne as useRegisterSSO,Pe as useResetPassword,bt as useScreenWidth,xt as useScrollBlockage,St as useScrollDetection,Ct as useScrollY,wt as useSearch,Fe as useSearchDoc,Ie as useSelectOrganization,Le as useSelectProject,l as useSession,Re as useSignInMagicLink,ze as useSignInPasskey,Be as useSignInSSO,Ve as useStartRecursiveAudit,He as useSubmitShowcaseProject,Ue as useSubscribeToNewsletter,We as useToggleShowcaseDownvote,Ge as useToggleShowcaseUpvote,Ke as useTranslateJSONDeclaration,qe as useTriggerBuild,Je as useTriggerWebhook,Ye as useUnselectOrganization,Xe as useUnselectProject,Ze as useUnsubscribeFromNewsletter,Qe as useUpdateDictionary,$e as useUpdateOrganization,et as useUpdateOrganizationMembers,tt as useUpdateOrganizationMembersById,nt as useUpdateProject,rt as useUpdateProjectMembers,it as useUpdateShowcaseProject,at as useUpdateTag,ot as useUpdateUser,pt as useUser,st as useVerifyBackupCode,ct as useVerifyEmail,lt as useVerifyTotp,ut as useWriteDictionary};
@@ -1,2 +1,2 @@
1
- "use client";import{useAuth as e}from"./useAuth/useAuth.mjs";import{useIntlayerAuth as t,useIntlayerOAuth as n}from"./useIntlayerAPI.mjs";import{useConfiguration as r}from"@intlayer/editor-react";import{useInfiniteQuery as i,useMutation as a,useQuery as o,useQueryClient as s}from"@tanstack/react-query";const c=({requireUser:t,requireProject:n,requireOrganization:i})=>{let{oAuth2AccessToken:a,session:o}=e({intlayerConfiguration:r()}),s=o?o.user:a?.user,c=o?o.organization:a?.organization,l=o?o.project:a?.project;return{enable:(t?!!s:!0)&&(n?!!l:!0)&&(i?!!c:!0)}},l=e=>{let{requireUser:t,requireProject:n,requireOrganization:r,...i}=e,{enable:a}=c({requireUser:t,requireProject:n,requireOrganization:r});return o({enabled:i?.enabled===!1?!1:a,...i})},ee=()=>{let e=t(),n=s();return a({mutationKey:[`login`],mutationFn:t=>e.signInEmail(t),onSuccess:e=>{let t=n.getQueryData([`session`]);t&&e.data?.user&&n.setQueryData([`session`],{...t,user:e.data.user})}})},te=()=>{let e=t();return a({mutationKey:[`getVerifyEmailStatus`],mutationFn:t=>e.verifyEmailSession(...t)})},u=()=>{let e=t();return a({mutationKey:[`register`],mutationFn:t=>e.signUpEmail(t),meta:{resetQueries:[[`session`]]}})},d=()=>{let e=t();return a({mutationKey:[`logout`],mutationFn:()=>e.signOut(),meta:{resetQueries:[[`session`],[`users`],[`organizations`],[`projects`],[`dictionaries`],[`tags`]]}})},f=()=>{let e=t();return a({mutationKey:[`changePassword`],mutationFn:t=>e.changePasswordSession(...t)})},p=()=>{let e=t();return a({mutationKey:[`askResetPassword`],mutationFn:t=>e.requestPasswordResetSession(t)})},m=()=>{let e=t();return a({mutationKey:[`resetPassword`],mutationFn:t=>e.resetPassword(t)})},h=()=>{let e=t();return a({mutationKey:[`verifyEmail`],mutationFn:t=>e.verifyEmailSession(t)})},g=()=>{let e=t();return a({mutationKey:[`user`],mutationFn:t=>e.accountInfo(t)})},_=()=>{let e=t();return a({mutationKey:[`enableTwoFactor`],mutationFn:t=>e.enableTwoFactor(t)})},v=()=>{let e=t();return a({mutationKey:[`disableTwoFactor`],mutationFn:t=>e.disableTwoFactor(t)})},y=()=>{let e=t();return a({mutationKey:[`verifyTotp`],mutationFn:t=>e.verifyTotp(t)})},b=()=>{let e=t();return a({mutationKey:[`verifyBackupCode`],mutationFn:t=>e.verifyBackupCode(t)})},x=()=>{let e=t();return a({mutationKey:[`addPasskey`],mutationFn:t=>e.addPasskey(t)})},S=()=>{let e=t();return a({mutationKey:[`signInPasskey`],mutationFn:t=>e.signInPasskey(t)})},C=()=>{let e=t();return a({mutationKey:[`deletePasskey`],mutationFn:t=>e.deletePasskey(t)})},w=()=>{let e=t();return o({queryKey:[`listPasskeys`],queryFn:()=>e.listPasskeys()})},T=()=>{let e=t();return a({mutationKey:[`signInMagicLink`],mutationFn:t=>e.signInMagicLink(t)})},E=()=>{let e=t(),n=s();return a({mutationKey:[`registerSSO`],mutationFn:t=>e.registerSSO(t),onSuccess:()=>{n.invalidateQueries({queryKey:[`ssoProviders`]})}})},D=()=>{let e=t();return a({mutationKey:[`signInSSO`],mutationFn:t=>e.signInSSO(t)})},O=()=>{let e=t();return o({queryKey:[`ssoProviders`],queryFn:()=>e.listSSOProviders()})},k=()=>{let e=t(),n=s();return a({mutationKey:[`deleteSSOProvider`],mutationFn:t=>e.deleteSSOProvider(t),onSuccess:()=>{n.invalidateQueries({queryKey:[`ssoProviders`]})}})},A=(e,t)=>{let r=n();return l({queryKey:[`users`,e],queryFn:()=>r.user.getUsers(e),requireUser:!0,...t})},j=e=>{let t=n();return l({queryKey:[`users`,e],queryFn:()=>t.user.getUserById(e),requireUser:!0})},M=()=>{let e=n();return a({mutationKey:[`users`],mutationFn:t=>e.user.createUser(t)})},N=()=>{let e=n();return a({mutationKey:[`users`],mutationFn:t=>e.user.updateUser(t)})},P=()=>{let e=n();return a({mutationKey:[`users`],mutationFn:t=>e.user.deleteUser(t),meta:{invalidateQueries:[[`users`]]}})},F=e=>{let t=n();return l({queryKey:[`organizations`,e],queryFn:({signal:n})=>t.organization.getOrganizations(e,{signal:n}),requireUser:!0})},I=()=>{let e=n();return a({mutationKey:[`organizations`],mutationFn:t=>e.organization.addOrganization(t),meta:{invalidateQueries:[[`organizations`]]}})},L=()=>{let e=n();return a({mutationKey:[`organizations`],mutationFn:t=>e.organization.updateOrganization(t)})},R=()=>{let e=n();return a({mutationKey:[`organizations`],mutationFn:t=>e.organization.updateOrganizationMembers(t),meta:{invalidateQueries:[[`organizations`],[`users`]]}})},z=()=>{let e=n();return a({mutationKey:[`organizations`],mutationFn:({organizationId:t,...n})=>e.organization.updateOrganizationMembersById(t,n),meta:{invalidateQueries:[[`organizations`],[`users`]]}})},B=()=>{let e=n();return a({mutationKey:[`organizations`],mutationFn:t=>e.organization.addOrganizationMember(t),meta:{invalidateQueries:[[`organizations`]]}})},V=()=>{let e=n();return a({mutationKey:[`organizations`],mutationFn:()=>e.organization.deleteOrganization(),meta:{invalidateQueries:[[`organizations`],[`session`]]}})},H=()=>{let e=n(),t=s();return a({mutationKey:[`session-organizations`],mutationFn:t=>e.organization.selectOrganization(t),meta:{invalidateQueries:[[`session`],[`organizations`],[`projects`],[`dictionaries`],[`tags`],[`subscription`],[`users`]]},onSuccess:e=>{let n=t.getQueryData([`session`]);n&&t.setQueryData([`session`],{...n,organization:e.data})}})},U=()=>{let e=n(),t=s();return a({mutationKey:[`session-organizations`],mutationFn:()=>e.organization.unselectOrganization(),meta:{resetQueries:[[`session`],[`organizations`],[`projects`],[`dictionaries`],[`tags`],[`subscription`],[`users`]]},onSuccess:()=>{let e=t.getQueryData([`session`]);e&&t.setQueryData([`session`],{...e,organization:null,project:null})}})},W=(e,t)=>{let r=n();return l({queryKey:[`projects`,e],queryFn:({signal:t})=>r.project.getProjects(e,{signal:t}),requireUser:!0,requireOrganization:!0,...t})},G=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:t=>e.project.addProject(t),meta:{invalidateQueries:[[`projects`]]}})},K=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:t=>e.project.updateProject(t),meta:{invalidateQueries:[[`projects`],[`session`]]}})},q=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:t=>e.project.updateProjectMembers(t),meta:{invalidateQueries:[[`projects`]]}})},J=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:()=>e.project.deleteProject(),meta:{invalidateQueries:[[`projects`]]}})},Y=()=>{let e=n(),t=s();return a({mutationKey:[`session-projects`],mutationFn:t=>e.project.selectProject(t),meta:{invalidateQueries:[[`projects`],[`dictionaries`],[`tags`],[`subscription`],[`users`]]},onSuccess:e=>{let n=t.getQueryData([`session`]);n&&t.setQueryData([`session`],{...n,project:e.data})}})},X=()=>{let e=n(),t=s();return a({mutationKey:[`session-projects`],mutationFn:()=>e.project.unselectProject(),meta:{resetQueries:[[`projects`],[`dictionaries`],[`tags`],[`subscription`],[`users`]]},onSuccess:()=>{let e=t.getQueryData([`session`]);e&&t.setQueryData([`session`],{...e,project:null})}})},Z=e=>{let t=n();return l({queryKey:[`ci-config`],queryFn:({signal:e})=>t.project.getCIConfig({signal:e}),requireProject:!0,...e})},Q=()=>{let e=n();return a({mutationKey:[`ci-config`],mutationFn:()=>e.project.pushCIConfig(),meta:{invalidateQueries:[[`ci-config`]]}})},ne=()=>{let e=n();return a({mutationKey:[`projects`,`build`],mutationFn:()=>e.project.triggerBuild(),meta:{invalidateQueries:[[`projects`]]}})},re=()=>{let e=n();return a({mutationKey:[`projects`,`webhook`],mutationFn:t=>e.project.triggerWebhook(t),meta:{invalidateQueries:[[`projects`]]}})},ie=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:t=>e.project.addNewAccessKey(t),meta:{invalidateQueries:[[`projects`]]}})},ae=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:t=>e.project.deleteAccessKey(t),meta:{invalidateQueries:[[`projects`]]}})},oe=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:t=>e.project.refreshAccessKey(t),meta:{invalidateQueries:[[`projects`]]}})},se=(e,t)=>{let r=n();return l({queryKey:[`dictionaries`,e],queryFn:({signal:t})=>r.dictionary.getDictionaries(e,{signal:t}),requireUser:!0,requireOrganization:!0,requireProject:!0,...t})},ce=(e,t)=>{let r=n(),{enable:a}=c({requireUser:!0,requireOrganization:!0,requireProject:!0});return i({queryKey:[`dictionaries`,`infinite`,e],queryFn:async({pageParam:t=1,signal:n})=>await r.dictionary.getDictionaries({...e,page:t},{signal:n}),getNextPageParam:e=>{if(e.data.length===0)return;let t=e.page??1;return t<(e.total_pages??1)?t+1:void 0},initialPageParam:1,enabled:t?.enabled===!1?!1:a,...t})},le=e=>{let t=n();return l({queryKey:[`dictionariesKeys`],queryFn:()=>t.dictionary.getDictionariesKeys(),requireUser:!0,requireOrganization:!0,requireProject:!0,...e})},ue=(e,t,r)=>{let i=n();return l({queryKey:[`dictionary`,e],queryFn:({signal:n})=>i.dictionary.getDictionary(e,t,{signal:n}),requireUser:!0,requireOrganization:!0,requireProject:!0,...r})},de=()=>{let e=n();return a({mutationKey:[`dictionaries`],mutationFn:t=>e.dictionary.addDictionary(t),meta:{invalidateQueries:[[`dictionaries`],[`dictionariesKeys`]]}})},fe=()=>{let e=n();return a({mutationKey:[`dictionaries`],mutationFn:t=>e.dictionary.pushDictionaries(t.dictionaries),meta:{invalidateQueries:[[`dictionaries`],[`dictionariesKeys`]]}})},pe=()=>{let e=n();return a({mutationKey:[`dictionaries`],mutationFn:t=>e.dictionary.updateDictionary(t),meta:{invalidateQueries:[[`dictionaries`],[`dictionariesKeys`]]}})},me=()=>{let e=n();return a({mutationKey:[`dictionaries`],mutationFn:t=>e.dictionary.deleteDictionary(t.dictionaryId),meta:{invalidateQueries:[[`dictionaries`],[`dictionariesKeys`]]}})},he=(e,t)=>{let r=n();return l({queryKey:[`tags`,e],queryFn:({signal:t})=>r.tag.getTags(e,{signal:t}),requireUser:!0,requireOrganization:!0,requireProject:!0,...t})},ge=()=>{let e=n();return a({mutationKey:[`tags`],mutationFn:t=>e.tag.addTag(t),meta:{invalidateQueries:[[`tags`]]}})},_e=()=>{let e=n();return a({mutationKey:[`tags`],mutationFn:t=>e.tag.updateTag(t.tagId,t.tag),meta:{invalidateQueries:[[`tags`]]}})},ve=()=>{let e=n();return a({mutationKey:[`tags`],mutationFn:t=>e.tag.deleteTag(t),meta:{invalidateQueries:[[`tags`]]}})},ye=(e,t)=>{let r=n();return o({queryKey:[`pricing`,e],queryFn:({signal:t})=>r.stripe.getPricing(e,{signal:t}),...t})},be=(e,t)=>{let r=n();return l({queryKey:[`subscription`,e],queryFn:({signal:t})=>r.stripe.getSubscription(e,{signal:t}),requireUser:!0,requireOrganization:!0,...t})},xe=()=>{let e=n();return a({mutationKey:[`subscription`],mutationFn:()=>e.stripe.cancelSubscription(),meta:{invalidateQueries:[[`session`],[`subscription`]]}})},Se=()=>{let e=n();return a({mutationKey:[`ai-translateJSON`],mutationFn:t=>e.ai.translateJSON(t)})},Ce=()=>{let e=n();return a({mutationKey:[`ai-auditContentDeclaration`],mutationFn:t=>e.ai.auditContentDeclaration(t)})},we=()=>{let e=n();return a({mutationKey:[`ai-auditContentDeclarationMetadata`],mutationFn:t=>e.ai.auditContentDeclarationMetadata(t)})},Te=()=>{let e=n();return a({mutationKey:[`ai-auditContentDeclarationField`],mutationFn:t=>e.ai.auditContentDeclarationField(t)})},Ee=()=>{let e=n();return a({mutationKey:[`ai-auditTag`],mutationFn:t=>e.ai.auditTag(t)})},De=()=>{let e=n();return a({mutationKey:[],mutationFn:t=>e.ai.askDocQuestion(t)})},Oe=()=>{let e=n();return a({mutationKey:[`ai-autocomplete`],mutationFn:t=>e.ai.autocomplete(t)})},ke=(e,t)=>{let r=n();return l({queryKey:[`discussions`,e],queryFn:({signal:t})=>r.ai.getDiscussions(e,{signal:t,cache:`no-store`}),requireUser:!0,...t})},Ae=(e,t)=>{let r=n();return l({queryKey:[`discussions-data`,e],queryFn:({signal:t})=>r.ai.getDiscussions({includeMessages:`false`,...e??{}},{signal:t,cache:`no-store`}),requireUser:!0,...t})},je=e=>{let t=n();return o({queryKey:[`search`,e],queryFn:()=>t.search.searchDoc(e),enabled:(e?.input?.length??0)>3})},Me=()=>{let e=n();return a({mutationKey:[`newsletter`],mutationFn:t=>e.newsletter.subscribeToNewsletter(t)})},Ne=()=>{let e=n();return a({mutationKey:[`newsletter`],mutationFn:t=>e.newsletter.unsubscribeFromNewsletter(t)})},Pe=()=>{let e=n();return a({mutationKey:[`newsletter`],mutationFn:()=>e.newsletter.getNewsletterStatus()})},$=()=>{let e=n();return a({mutationKey:[`github`,`auth-url`],mutationFn:t=>e.github.getAuthUrl(t)})},Fe=()=>{let e=n();return a({mutationKey:[`github`,`auth`],mutationFn:t=>e.github.authenticate(t)})},Ie=(e=!0)=>{let t=n();return o({queryKey:[`github`,`repos`],queryFn:()=>t.github.getRepositories(),enabled:e})},Le=()=>{let e=n();return a({mutationKey:[`github`,`check-config`],mutationFn:t=>e.github.checkIntlayerConfig(void 0,t.owner,t.repository,t.branch)})},Re=()=>{let e=n();return a({mutationKey:[`github`,`get-config-file`],mutationFn:t=>e.github.getConfigFile(void 0,t.owner,t.repository,t.branch,t.path)})},ze=()=>{let e=n();return a({mutationKey:[`gitlab`,`auth`],mutationFn:t=>e.gitlab.authenticate(t.code,t.redirectUri,t.instanceUrl)})},Be=(e=!0,t)=>{let r=n();return o({queryKey:[`gitlab`,`projects`,t],queryFn:()=>r.gitlab.getProjects(void 0,t),enabled:e})},Ve=()=>{let e=n();return a({mutationKey:[`gitlab`,`check-config`],mutationFn:t=>e.gitlab.checkIntlayerConfig(void 0,t.projectId,t.branch,t.instanceUrl)})},He=()=>{let e=n();return a({mutationKey:[`gitlab`,`get-config-file`],mutationFn:t=>e.gitlab.getConfigFile(void 0,t.projectId,t.branch,t.path,t.instanceUrl)})},Ue=()=>{let e=n();return a({mutationKey:[`bitbucket`,`auth`],mutationFn:t=>e.bitbucket.authenticate(t)})},We=(e=!0)=>{let t=n();return o({queryKey:[`bitbucket`,`repos`],queryFn:()=>t.bitbucket.getRepositories(),enabled:e})},Ge=()=>{let e=n();return a({mutationKey:[`bitbucket`,`check-config`],mutationFn:t=>e.bitbucket.checkIntlayerConfig(void 0,t.workspace,t.repoSlug,t.branch)})},Ke=()=>{let e=n();return a({mutationKey:[`bitbucket`,`get-config-file`],mutationFn:t=>e.bitbucket.getConfigFile(void 0,t.workspace,t.repoSlug,t.branch,t.path)})},qe=()=>{let e=n();return o({queryKey:[`editor`,`dictionaries`],queryFn:()=>e.editor.getDictionaries()})},Je=()=>{let e=n();return a({mutationKey:[`editor`,`dictionaries`],mutationFn:t=>e.editor.writeDictionary(t)})};export{de as useAddDictionary,ie as useAddNewAccessKey,I as useAddOrganization,B as useAddOrganizationMember,x as useAddPasskey,G as useAddProject,ge as useAddTag,l as useAppQuery,De as useAskDocQuestion,p as useAskResetPassword,Ce as useAuditContentDeclaration,Te as useAuditContentDeclarationField,we as useAuditContentDeclarationMetadata,Ee as useAuditTag,Oe as useAutocomplete,Ue as useBitbucketAuth,Ge as useBitbucketCheckConfig,Ke as useBitbucketGetConfigFile,We as useBitbucketRepos,xe as useCancelSubscription,f as useChangePassword,M as useCreateUser,ae as useDeleteAccessKey,me as useDeleteDictionary,V as useDeleteOrganization,C as useDeletePasskey,J as useDeleteProject,k as useDeleteSSOProvider,ve as useDeleteTag,P as useDeleteUser,v as useDisableTwoFactor,_ as useEnableTwoFactor,Z as useGetCIConfig,se as useGetDictionaries,le as useGetDictionariesKeys,ue as useGetDictionary,ke as useGetDiscussions,Ae as useGetDiscussionsData,qe as useGetEditorDictionaries,Pe as useGetNewsletterStatus,F as useGetOrganizations,ye as useGetPricing,W as useGetProjects,be as useGetSubscription,he as useGetTags,g as useGetUserByAccount,j as useGetUserById,A as useGetUsers,te as useGetVerifyEmailStatus,Fe as useGithubAuth,Le as useGithubCheckConfig,$ as useGithubGetAuthUrl,Re as useGithubGetConfigFile,Ie as useGithubRepos,ze as useGitlabAuth,Ve as useGitlabCheckConfig,He as useGitlabGetConfigFile,Be as useGitlabProjects,ce as useInfiniteGetDictionaries,w as useListPasskeys,O as useListSSOProviders,ee as useLogin,d as useLogout,Q as usePushCIConfig,fe as usePushDictionaries,s as useQueryClient,oe as useRefreshAccessKey,u as useRegister,E as useRegisterSSO,m as useResetPassword,je as useSearchDoc,H as useSelectOrganization,Y as useSelectProject,T as useSignInMagicLink,S as useSignInPasskey,D as useSignInSSO,Me as useSubscribeToNewsletter,Se as useTranslateJSONDeclaration,ne as useTriggerBuild,re as useTriggerWebhook,U as useUnselectOrganization,X as useUnselectProject,Ne as useUnsubscribeFromNewsletter,pe as useUpdateDictionary,L as useUpdateOrganization,R as useUpdateOrganizationMembers,z as useUpdateOrganizationMembersById,K as useUpdateProject,q as useUpdateProjectMembers,_e as useUpdateTag,N as useUpdateUser,b as useVerifyBackupCode,h as useVerifyEmail,y as useVerifyTotp,Je as useWriteDictionary};
1
+ "use client";import{useAuth as e}from"./useAuth/useAuth.mjs";import{useIntlayerAuth as t,useIntlayerOAuth as n}from"./useIntlayerAPI.mjs";import{useConfiguration as r}from"@intlayer/editor-react";import{useInfiniteQuery as i,useMutation as a,useQuery as o,useQueryClient as s}from"@tanstack/react-query";const c=({requireUser:t,requireProject:n,requireOrganization:i})=>{let{oAuth2AccessToken:a,session:o}=e({intlayerConfiguration:r()}),s=o?o.user:a?.user,c=o?o.organization:a?.organization,l=o?o.project:a?.project;return{enable:(t?!!s:!0)&&(n?!!l:!0)&&(i?!!c:!0)}},l=e=>{let{requireUser:t,requireProject:n,requireOrganization:r,...i}=e,{enable:a}=c({requireUser:t,requireProject:n,requireOrganization:r});return o({enabled:i?.enabled===!1?!1:a,...i})},ee=()=>{let e=t(),n=s();return a({mutationKey:[`login`],mutationFn:t=>e.signInEmail(t),onSuccess:e=>{let t=n.getQueryData([`session`]);t&&e.data?.user&&n.setQueryData([`session`],{...t,user:e.data.user})}})},te=()=>{let e=t();return a({mutationKey:[`getVerifyEmailStatus`],mutationFn:t=>e.verifyEmailSession(...t)})},u=()=>{let e=t();return a({mutationKey:[`register`],mutationFn:t=>e.signUpEmail(t),meta:{resetQueries:[[`session`]]}})},d=()=>{let e=t();return a({mutationKey:[`logout`],mutationFn:()=>e.signOut(),meta:{resetQueries:[[`session`],[`users`],[`organizations`],[`projects`],[`dictionaries`],[`tags`]]}})},f=()=>{let e=t();return a({mutationKey:[`changePassword`],mutationFn:t=>e.changePasswordSession(...t)})},p=()=>{let e=t();return a({mutationKey:[`askResetPassword`],mutationFn:t=>e.requestPasswordResetSession(t)})},m=()=>{let e=t();return a({mutationKey:[`resetPassword`],mutationFn:t=>e.resetPassword(t)})},h=()=>{let e=t();return a({mutationKey:[`verifyEmail`],mutationFn:t=>e.verifyEmailSession(t)})},g=()=>{let e=t();return a({mutationKey:[`user`],mutationFn:t=>e.accountInfo(t)})},_=()=>{let e=t();return a({mutationKey:[`enableTwoFactor`],mutationFn:t=>e.enableTwoFactor(t)})},v=()=>{let e=t();return a({mutationKey:[`disableTwoFactor`],mutationFn:t=>e.disableTwoFactor(t)})},y=()=>{let e=t();return a({mutationKey:[`verifyTotp`],mutationFn:t=>e.verifyTotp(t)})},b=()=>{let e=t();return a({mutationKey:[`verifyBackupCode`],mutationFn:t=>e.verifyBackupCode(t)})},x=()=>{let e=t();return a({mutationKey:[`addPasskey`],mutationFn:t=>e.addPasskey(t)})},S=()=>{let e=t();return a({mutationKey:[`signInPasskey`],mutationFn:t=>e.signInPasskey(t)})},C=()=>{let e=t();return a({mutationKey:[`deletePasskey`],mutationFn:t=>e.deletePasskey(t)})},w=()=>{let e=t();return o({queryKey:[`listPasskeys`],queryFn:()=>e.listPasskeys()})},T=()=>{let e=t();return a({mutationKey:[`signInMagicLink`],mutationFn:t=>e.signInMagicLink(t)})},E=()=>{let e=t(),n=s();return a({mutationKey:[`registerSSO`],mutationFn:t=>e.registerSSO(t),onSuccess:()=>{n.invalidateQueries({queryKey:[`ssoProviders`]})}})},D=()=>{let e=t();return a({mutationKey:[`signInSSO`],mutationFn:t=>e.signInSSO(t)})},O=()=>{let e=t();return o({queryKey:[`ssoProviders`],queryFn:()=>e.listSSOProviders()})},k=()=>{let e=t(),n=s();return a({mutationKey:[`deleteSSOProvider`],mutationFn:t=>e.deleteSSOProvider(t),onSuccess:()=>{n.invalidateQueries({queryKey:[`ssoProviders`]})}})},A=(e,t)=>{let r=n();return l({queryKey:[`users`,e],queryFn:()=>r.user.getUsers(e),requireUser:!0,...t})},j=e=>{let t=n();return l({queryKey:[`users`,e],queryFn:()=>t.user.getUserById(e),requireUser:!0})},M=()=>{let e=n();return a({mutationKey:[`users`],mutationFn:t=>e.user.createUser(t)})},N=()=>{let e=n();return a({mutationKey:[`users`],mutationFn:t=>e.user.updateUser(t)})},P=()=>{let e=n();return a({mutationKey:[`users`],mutationFn:t=>e.user.deleteUser(t),meta:{invalidateQueries:[[`users`]]}})},F=e=>{let t=n();return l({queryKey:[`organizations`,e],queryFn:({signal:n})=>t.organization.getOrganizations(e,{signal:n}),requireUser:!0})},I=()=>{let e=n();return a({mutationKey:[`organizations`],mutationFn:t=>e.organization.addOrganization(t),meta:{invalidateQueries:[[`organizations`]]}})},L=()=>{let e=n();return a({mutationKey:[`organizations`],mutationFn:t=>e.organization.updateOrganization(t)})},R=()=>{let e=n();return a({mutationKey:[`organizations`],mutationFn:t=>e.organization.updateOrganizationMembers(t),meta:{invalidateQueries:[[`organizations`],[`users`]]}})},z=()=>{let e=n();return a({mutationKey:[`organizations`],mutationFn:({organizationId:t,...n})=>e.organization.updateOrganizationMembersById(t,n),meta:{invalidateQueries:[[`organizations`],[`users`]]}})},B=()=>{let e=n();return a({mutationKey:[`organizations`],mutationFn:t=>e.organization.addOrganizationMember(t),meta:{invalidateQueries:[[`organizations`]]}})},V=()=>{let e=n();return a({mutationKey:[`organizations`],mutationFn:()=>e.organization.deleteOrganization(),meta:{invalidateQueries:[[`organizations`],[`session`]]}})},H=()=>{let e=n(),t=s();return a({mutationKey:[`session-organizations`],mutationFn:t=>e.organization.selectOrganization(t),meta:{invalidateQueries:[[`session`],[`organizations`],[`projects`],[`dictionaries`],[`tags`],[`subscription`],[`users`]]},onSuccess:e=>{let n=t.getQueryData([`session`]);n&&t.setQueryData([`session`],{...n,organization:e.data})}})},U=()=>{let e=n(),t=s();return a({mutationKey:[`session-organizations`],mutationFn:()=>e.organization.unselectOrganization(),meta:{resetQueries:[[`session`],[`organizations`],[`projects`],[`dictionaries`],[`tags`],[`subscription`],[`users`]]},onSuccess:()=>{let e=t.getQueryData([`session`]);e&&t.setQueryData([`session`],{...e,organization:null,project:null})}})},W=(e,t)=>{let r=n();return l({queryKey:[`projects`,e],queryFn:({signal:t})=>r.project.getProjects(e,{signal:t}),requireUser:!0,requireOrganization:!0,...t})},G=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:t=>e.project.addProject(t),meta:{invalidateQueries:[[`projects`]]}})},K=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:t=>e.project.updateProject(t),meta:{invalidateQueries:[[`projects`],[`session`]]}})},q=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:t=>e.project.updateProjectMembers(t),meta:{invalidateQueries:[[`projects`]]}})},J=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:()=>e.project.deleteProject(),meta:{invalidateQueries:[[`projects`]]}})},Y=()=>{let e=n(),t=s();return a({mutationKey:[`session-projects`],mutationFn:t=>e.project.selectProject(t),meta:{invalidateQueries:[[`projects`],[`dictionaries`],[`tags`],[`subscription`],[`users`]]},onSuccess:e=>{let n=t.getQueryData([`session`]);n&&t.setQueryData([`session`],{...n,project:e.data})}})},X=()=>{let e=n(),t=s();return a({mutationKey:[`session-projects`],mutationFn:()=>e.project.unselectProject(),meta:{resetQueries:[[`projects`],[`dictionaries`],[`tags`],[`subscription`],[`users`]]},onSuccess:()=>{let e=t.getQueryData([`session`]);e&&t.setQueryData([`session`],{...e,project:null})}})},Z=e=>{let t=n();return l({queryKey:[`ci-config`],queryFn:({signal:e})=>t.project.getCIConfig({signal:e}),requireProject:!0,...e})},Q=()=>{let e=n();return a({mutationKey:[`ci-config`],mutationFn:()=>e.project.pushCIConfig(),meta:{invalidateQueries:[[`ci-config`]]}})},ne=()=>{let e=n();return a({mutationKey:[`projects`,`build`],mutationFn:()=>e.project.triggerBuild(),meta:{invalidateQueries:[[`projects`]]}})},re=()=>{let e=n();return a({mutationKey:[`projects`,`webhook`],mutationFn:t=>e.project.triggerWebhook(t),meta:{invalidateQueries:[[`projects`]]}})},ie=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:t=>e.project.addNewAccessKey(t),meta:{invalidateQueries:[[`projects`]]}})},ae=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:t=>e.project.deleteAccessKey(t),meta:{invalidateQueries:[[`projects`]]}})},oe=()=>{let e=n();return a({mutationKey:[`projects`],mutationFn:t=>e.project.refreshAccessKey(t),meta:{invalidateQueries:[[`projects`]]}})},se=(e,t)=>{let r=n();return l({queryKey:[`dictionaries`,e],queryFn:({signal:t})=>r.dictionary.getDictionaries(e,{signal:t}),requireUser:!0,requireOrganization:!0,requireProject:!0,...t})},ce=(e,t)=>{let r=n(),{enable:a}=c({requireUser:!0,requireOrganization:!0,requireProject:!0});return i({queryKey:[`dictionaries`,`infinite`,e],queryFn:async({pageParam:t=1,signal:n})=>await r.dictionary.getDictionaries({...e,page:t},{signal:n}),getNextPageParam:e=>{if(e.data.length===0)return;let t=e.page??1;return t<(e.total_pages??1)?t+1:void 0},initialPageParam:1,enabled:t?.enabled===!1?!1:a,...t})},le=e=>{let t=n();return l({queryKey:[`dictionariesKeys`],queryFn:()=>t.dictionary.getDictionariesKeys(),requireUser:!0,requireOrganization:!0,requireProject:!0,...e})},ue=(e,t,r)=>{let i=n();return l({queryKey:[`dictionary`,e],queryFn:({signal:n})=>i.dictionary.getDictionary(e,t,{signal:n}),requireUser:!0,requireOrganization:!0,requireProject:!0,...r})},de=()=>{let e=n();return a({mutationKey:[`dictionaries`],mutationFn:t=>e.dictionary.addDictionary(t),meta:{invalidateQueries:[[`dictionaries`],[`dictionariesKeys`]]}})},fe=()=>{let e=n();return a({mutationKey:[`dictionaries`],mutationFn:t=>e.dictionary.pushDictionaries(t.dictionaries),meta:{invalidateQueries:[[`dictionaries`],[`dictionariesKeys`]]}})},pe=()=>{let e=n();return a({mutationKey:[`dictionaries`],mutationFn:t=>e.dictionary.updateDictionary(t),meta:{invalidateQueries:[[`dictionaries`],[`dictionariesKeys`]]}})},me=()=>{let e=n();return a({mutationKey:[`dictionaries`],mutationFn:t=>e.dictionary.deleteDictionary(t.dictionaryId),meta:{invalidateQueries:[[`dictionaries`],[`dictionariesKeys`]]}})},he=(e,t)=>{let r=n();return l({queryKey:[`tags`,e],queryFn:({signal:t})=>r.tag.getTags(e,{signal:t}),requireUser:!0,requireOrganization:!0,requireProject:!0,...t})},ge=()=>{let e=n();return a({mutationKey:[`tags`],mutationFn:t=>e.tag.addTag(t),meta:{invalidateQueries:[[`tags`]]}})},_e=()=>{let e=n();return a({mutationKey:[`tags`],mutationFn:t=>e.tag.updateTag(t.tagId,t.tag),meta:{invalidateQueries:[[`tags`]]}})},ve=()=>{let e=n();return a({mutationKey:[`tags`],mutationFn:t=>e.tag.deleteTag(t),meta:{invalidateQueries:[[`tags`]]}})},ye=(e,t)=>{let r=n();return o({queryKey:[`pricing`,e],queryFn:({signal:t})=>r.stripe.getPricing(e,{signal:t}),...t})},be=(e,t)=>{let r=n();return l({queryKey:[`subscription`,e],queryFn:({signal:t})=>r.stripe.getSubscription(e,{signal:t}),requireUser:!0,requireOrganization:!0,...t})},xe=()=>{let e=n();return a({mutationKey:[`subscription`],mutationFn:()=>e.stripe.cancelSubscription(),meta:{invalidateQueries:[[`session`],[`subscription`]]}})},Se=()=>{let e=n();return a({mutationKey:[`ai-translateJSON`],mutationFn:t=>e.ai.translateJSON(t)})},Ce=()=>{let e=n();return a({mutationKey:[`ai-auditContentDeclaration`],mutationFn:t=>e.ai.auditContentDeclaration(t)})},we=()=>{let e=n();return a({mutationKey:[`ai-auditContentDeclarationMetadata`],mutationFn:t=>e.ai.auditContentDeclarationMetadata(t)})},Te=()=>{let e=n();return a({mutationKey:[`ai-auditContentDeclarationField`],mutationFn:t=>e.ai.auditContentDeclarationField(t)})},Ee=()=>{let e=n();return a({mutationKey:[`ai-auditTag`],mutationFn:t=>e.ai.auditTag(t)})},De=()=>{let e=n();return a({mutationKey:[],mutationFn:t=>e.ai.askDocQuestion(t)})},Oe=()=>{let e=n();return a({mutationKey:[`ai-autocomplete`],mutationFn:t=>e.ai.autocomplete(t)})},ke=()=>{let e=n();return a({mutationKey:[`audit-scan`],mutationFn:t=>e.audit.scanUrl(t)})},Ae=()=>{let e=n();return a({mutationKey:[`audit-recursive-start`],mutationFn:t=>e.audit.startRecursiveAudit(t)})},je=(e,t)=>{let r=n();return l({queryKey:[`audit-recursive-status`,e?.jobId],queryFn:({signal:t})=>r.audit.getRecursiveAuditStatus(e,{signal:t}),enabled:!!e?.jobId,...t})},Me=(e,t)=>{let r=n();return l({queryKey:[`discussions`,e],queryFn:({signal:t})=>r.ai.getDiscussions(e,{signal:t,cache:`no-store`}),requireUser:!0,...t})},Ne=(e,t)=>{let r=n();return l({queryKey:[`discussions-data`,e],queryFn:({signal:t})=>r.ai.getDiscussions({includeMessages:`false`,...e??{}},{signal:t,cache:`no-store`}),requireUser:!0,...t})},Pe=e=>{let t=n();return o({queryKey:[`search`,e],queryFn:()=>t.search.searchDoc(e),enabled:(e?.input?.length??0)>3})},Fe=()=>{let e=n();return a({mutationKey:[`newsletter`],mutationFn:t=>e.newsletter.subscribeToNewsletter(t)})},Ie=()=>{let e=n();return a({mutationKey:[`newsletter`],mutationFn:t=>e.newsletter.unsubscribeFromNewsletter(t)})},Le=()=>{let e=n();return a({mutationKey:[`newsletter`],mutationFn:()=>e.newsletter.getNewsletterStatus()})},Re=()=>{let e=n();return a({mutationKey:[`github`,`auth-url`],mutationFn:t=>e.github.getAuthUrl(t)})},ze=()=>{let e=n();return a({mutationKey:[`github`,`auth`],mutationFn:t=>e.github.authenticate(t)})},Be=(e=!0)=>{let t=n();return o({queryKey:[`github`,`repos`],queryFn:()=>t.github.getRepositories(),enabled:e})},Ve=()=>{let e=n();return a({mutationKey:[`github`,`check-config`],mutationFn:t=>e.github.checkIntlayerConfig(void 0,t.owner,t.repository,t.branch)})},He=()=>{let e=n();return a({mutationKey:[`github`,`get-config-file`],mutationFn:t=>e.github.getConfigFile(void 0,t.owner,t.repository,t.branch,t.path)})},Ue=()=>{let e=n();return a({mutationKey:[`gitlab`,`auth`],mutationFn:t=>e.gitlab.authenticate(t.code,t.redirectUri,t.instanceUrl)})},We=(e=!0,t)=>{let r=n();return o({queryKey:[`gitlab`,`projects`,t],queryFn:()=>r.gitlab.getProjects(void 0,t),enabled:e})},Ge=()=>{let e=n();return a({mutationKey:[`gitlab`,`check-config`],mutationFn:t=>e.gitlab.checkIntlayerConfig(void 0,t.projectId,t.branch,t.instanceUrl)})},Ke=()=>{let e=n();return a({mutationKey:[`gitlab`,`get-config-file`],mutationFn:t=>e.gitlab.getConfigFile(void 0,t.projectId,t.branch,t.path,t.instanceUrl)})},qe=()=>{let e=n();return a({mutationKey:[`bitbucket`,`auth`],mutationFn:t=>e.bitbucket.authenticate(t)})},Je=(e=!0)=>{let t=n();return o({queryKey:[`bitbucket`,`repos`],queryFn:()=>t.bitbucket.getRepositories(),enabled:e})},$=()=>{let e=n();return a({mutationKey:[`bitbucket`,`check-config`],mutationFn:t=>e.bitbucket.checkIntlayerConfig(void 0,t.workspace,t.repoSlug,t.branch)})},Ye=()=>{let e=n();return a({mutationKey:[`bitbucket`,`get-config-file`],mutationFn:t=>e.bitbucket.getConfigFile(void 0,t.workspace,t.repoSlug,t.branch,t.path)})},Xe=()=>{let e=n();return o({queryKey:[`editor`,`dictionaries`],queryFn:()=>e.editor.getDictionaries()})},Ze=()=>{let e=n();return a({mutationKey:[`editor`,`dictionaries`],mutationFn:t=>e.editor.writeDictionary(t)})},Qe=(e,t)=>{let r=n();return o({queryKey:[`showcase`,`projects`,e],queryFn:({signal:t})=>r.showcaseProject.getShowcaseProjects(e,{signal:t}),...t})},$e=(e,t)=>{let r=n();return o({queryKey:[`showcase`,`project`,e],queryFn:({signal:t})=>r.showcaseProject.getShowcaseProjectById(e,{signal:t}),enabled:!!e,...t})},et=(e,t)=>{let r=n();return o({queryKey:[`showcase`,`other-projects`,e],queryFn:({signal:t})=>r.showcaseProject.getOtherShowcaseProjects(e,{signal:t}),enabled:!!e.excludeId,...t})},tt=e=>{let t=n(e),r=s();return a({mutationKey:[`showcase`,`submit`],mutationFn:e=>t.showcaseProject.submitShowcaseProject(e),onSuccess:()=>{r.invalidateQueries({queryKey:[`showcase`]})}})},nt=e=>{let t=n(e),r=s();return a({mutationKey:[`showcase`,`delete`],mutationFn:e=>t.showcaseProject.deleteShowcaseProject(e),onSuccess:()=>{r.invalidateQueries({queryKey:[`showcase`]})}})},rt=e=>{let t=n(e);return a({mutationKey:[`showcase`,`upvote`],mutationFn:e=>t.showcaseProject.toggleShowcaseUpvote({projectId:e})})},it=e=>{let t=n(e);return a({mutationKey:[`showcase`,`downvote`],mutationFn:e=>t.showcaseProject.toggleShowcaseDownvote({projectId:e})})},at=e=>{let t=n(e),r=s();return a({mutationKey:[`showcase`,`update`],mutationFn:({projectId:e,...n})=>t.showcaseProject.updateShowcaseProject(e,n),onSuccess:()=>{r.invalidateQueries({queryKey:[`showcase`]})}})};export{de as useAddDictionary,ie as useAddNewAccessKey,I as useAddOrganization,B as useAddOrganizationMember,x as useAddPasskey,G as useAddProject,ge as useAddTag,l as useAppQuery,De as useAskDocQuestion,p as useAskResetPassword,Ce as useAuditContentDeclaration,Te as useAuditContentDeclarationField,we as useAuditContentDeclarationMetadata,ke as useAuditScan,Ee as useAuditTag,Oe as useAutocomplete,qe as useBitbucketAuth,$ as useBitbucketCheckConfig,Ye as useBitbucketGetConfigFile,Je as useBitbucketRepos,xe as useCancelSubscription,f as useChangePassword,M as useCreateUser,ae as useDeleteAccessKey,me as useDeleteDictionary,V as useDeleteOrganization,C as useDeletePasskey,J as useDeleteProject,k as useDeleteSSOProvider,nt as useDeleteShowcaseProject,ve as useDeleteTag,P as useDeleteUser,v as useDisableTwoFactor,_ as useEnableTwoFactor,Z as useGetCIConfig,se as useGetDictionaries,le as useGetDictionariesKeys,ue as useGetDictionary,Me as useGetDiscussions,Ne as useGetDiscussionsData,Xe as useGetEditorDictionaries,Le as useGetNewsletterStatus,F as useGetOrganizations,et as useGetOtherShowcaseProjects,ye as useGetPricing,W as useGetProjects,je as useGetRecursiveAuditStatus,$e as useGetShowcaseProjectById,Qe as useGetShowcaseProjects,be as useGetSubscription,he as useGetTags,g as useGetUserByAccount,j as useGetUserById,A as useGetUsers,te as useGetVerifyEmailStatus,ze as useGithubAuth,Ve as useGithubCheckConfig,Re as useGithubGetAuthUrl,He as useGithubGetConfigFile,Be as useGithubRepos,Ue as useGitlabAuth,Ge as useGitlabCheckConfig,Ke as useGitlabGetConfigFile,We as useGitlabProjects,ce as useInfiniteGetDictionaries,w as useListPasskeys,O as useListSSOProviders,ee as useLogin,d as useLogout,Q as usePushCIConfig,fe as usePushDictionaries,s as useQueryClient,oe as useRefreshAccessKey,u as useRegister,E as useRegisterSSO,m as useResetPassword,Pe as useSearchDoc,H as useSelectOrganization,Y as useSelectProject,T as useSignInMagicLink,S as useSignInPasskey,D as useSignInSSO,Ae as useStartRecursiveAudit,tt as useSubmitShowcaseProject,Fe as useSubscribeToNewsletter,it as useToggleShowcaseDownvote,rt as useToggleShowcaseUpvote,Se as useTranslateJSONDeclaration,ne as useTriggerBuild,re as useTriggerWebhook,U as useUnselectOrganization,X as useUnselectProject,Ie as useUnsubscribeFromNewsletter,pe as useUpdateDictionary,L as useUpdateOrganization,R as useUpdateOrganizationMembers,z as useUpdateOrganizationMembersById,K as useUpdateProject,q as useUpdateProjectMembers,at as useUpdateShowcaseProject,_e as useUpdateTag,N as useUpdateUser,b as useVerifyBackupCode,h as useVerifyEmail,y as useVerifyTotp,Ze as useWriteDictionary};
2
2
  //# sourceMappingURL=reactQuery.mjs.map