@intlayer/design-system 8.7.6-canary.0 → 8.7.7

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 (86) hide show
  1. package/dist/esm/components/Breadcrumb/index.mjs.map +1 -1
  2. package/dist/esm/components/Browser/Browser.mjs.map +1 -1
  3. package/dist/esm/components/Carousel/index.mjs.map +1 -1
  4. package/dist/esm/components/ContentEditor/ContentEditorTextArea.mjs +1 -1
  5. package/dist/esm/components/DictionaryEditor/NodeWrapper/BooleanWrapper.mjs.map +1 -1
  6. package/dist/esm/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs.map +1 -1
  7. package/dist/esm/components/DictionaryEditor/NodeWrapper/NumberWrapper.mjs.map +1 -1
  8. package/dist/esm/components/DictionaryEditor/NodeWrapper/index.mjs.map +1 -1
  9. package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +2 -2
  10. package/dist/esm/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +1 -1
  11. package/dist/esm/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +3 -3
  12. package/dist/esm/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +1 -1
  13. package/dist/esm/components/DictionaryFieldEditor/EnumKeyInput.mjs.map +1 -1
  14. package/dist/esm/components/DictionaryFieldEditor/KeyPathBreadcrumb.mjs.map +1 -1
  15. package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +1 -1
  16. package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs.map +1 -1
  17. package/dist/esm/components/DictionaryFieldEditor/NodeTypeSelector.mjs.map +1 -1
  18. package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +2 -2
  19. package/dist/esm/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
  20. package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs +1 -1
  21. package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs.map +1 -1
  22. package/dist/esm/components/EditableField/EditableFieldInput.mjs.map +1 -1
  23. package/dist/esm/components/Flags/Flag.mjs.map +1 -1
  24. package/dist/esm/components/Form/FormField.mjs.map +1 -1
  25. package/dist/esm/components/Form/FormItem.mjs.map +1 -1
  26. package/dist/esm/components/Form/elements/FormElementWrapper.mjs.map +1 -1
  27. package/dist/esm/components/Form/elements/OTPElement.mjs +1 -1
  28. package/dist/esm/components/HTMLRender/HTMLRender.mjs.map +1 -1
  29. package/dist/esm/components/Headers/index.mjs.map +1 -1
  30. package/dist/esm/components/IDE/CodeBlockServer.mjs.map +1 -1
  31. package/dist/esm/components/IDE/FileTree.mjs.map +1 -1
  32. package/dist/esm/components/IDE/IDE.mjs.map +1 -1
  33. package/dist/esm/components/Input/OTPInput.mjs.map +1 -1
  34. package/dist/esm/components/KeyboardShortcut/KeyboardShortcut.mjs.map +1 -1
  35. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +1 -1
  36. package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
  37. package/dist/esm/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs.map +1 -1
  38. package/dist/esm/components/MarkDownRender/MarkDownRender.mjs.map +1 -1
  39. package/dist/esm/components/Modal/Modal.mjs +2 -2
  40. package/dist/esm/components/Navbar/MobileNavbar.mjs +1 -1
  41. package/dist/esm/components/Navbar/index.mjs +1 -3
  42. package/dist/esm/components/Navbar/index.mjs.map +1 -1
  43. package/dist/esm/components/Navbar/useNavigation.mjs +3 -0
  44. package/dist/esm/components/Navbar/useNavigation.mjs.map +1 -1
  45. package/dist/esm/components/Pagination/Pagination.mjs +1 -1
  46. package/dist/esm/components/Popover/dynamic.mjs.map +1 -1
  47. package/dist/esm/components/RightDrawer/RightDrawer.mjs +3 -3
  48. package/dist/esm/components/Select/Multiselect.mjs.map +1 -1
  49. package/dist/esm/components/Tab/Tab.mjs.map +1 -1
  50. package/dist/esm/components/TechLogo/TechLogo.mjs.map +1 -1
  51. package/dist/esm/components/TextArea/AutocompleteTextArea.mjs.map +1 -1
  52. package/dist/esm/components/TextArea/ContentEditableTextArea.mjs.map +1 -1
  53. package/dist/esm/components/Toaster/Toast.mjs +6 -1
  54. package/dist/esm/components/Toaster/Toast.mjs.map +1 -1
  55. package/dist/esm/components/WithResizer/index.mjs.map +1 -1
  56. package/dist/esm/hooks/index.mjs +11 -11
  57. package/dist/esm/hooks/reactQuery.mjs +47 -2
  58. package/dist/esm/hooks/reactQuery.mjs.map +1 -1
  59. package/dist/esm/hooks/useAuth/useOAuth2.mjs.map +1 -1
  60. package/dist/esm/hooks/useAuth/useSession.mjs.map +1 -1
  61. package/dist/esm/hooks/useDevice.mjs.map +1 -1
  62. package/dist/esm/hooks/useHorizontalSwipe.mjs.map +1 -1
  63. package/dist/esm/hooks/useIsDarkMode.mjs.map +1 -1
  64. package/dist/esm/hooks/useKeyboardDetector.mjs.map +1 -1
  65. package/dist/esm/hooks/useScrollBlockage/useScrollBlockageStore.mjs.map +1 -1
  66. package/dist/esm/libs/auth.mjs.map +1 -1
  67. package/dist/esm/providers/ReactQueryProvider.mjs.map +1 -1
  68. package/dist/esm/tailwind.config.mjs.map +1 -1
  69. package/dist/types/components/Badge/index.d.ts +3 -3
  70. package/dist/types/components/Button/Button.d.ts +5 -5
  71. package/dist/types/components/CollapsibleTable/CollapsibleTable.d.ts +1 -1
  72. package/dist/types/components/Command/index.d.ts +2 -2
  73. package/dist/types/components/Container/index.d.ts +6 -6
  74. package/dist/types/components/Input/Checkbox.d.ts +3 -3
  75. package/dist/types/components/Input/Input.d.ts +1 -1
  76. package/dist/types/components/Link/Link.d.ts +4 -4
  77. package/dist/types/components/Pagination/Pagination.d.ts +1 -1
  78. package/dist/types/components/SwitchSelector/index.d.ts +1 -1
  79. package/dist/types/components/Tab/Tab.d.ts +1 -1
  80. package/dist/types/components/TabSelector/TabSelector.d.ts +1 -1
  81. package/dist/types/components/Tag/index.d.ts +3 -3
  82. package/dist/types/components/Toaster/Toast.d.ts +1 -1
  83. package/dist/types/hooks/index.d.ts +2 -2
  84. package/dist/types/hooks/reactQuery.d.ts +8 -1
  85. package/dist/types/hooks/reactQuery.d.ts.map +1 -1
  86. package/package.json +25 -25
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmKA,MAAa,eAAwD,EACnE,cACA,UACA,WAAW,GACX,iBAAiB,SACjB,eACI;CACJ,MAAM,eAAe,OAAuB,KAAK;CACjD,MAAM,CAAC,OAAO,YAAY,SAAS,aAAa;CAEhD,MAAM,cAAc,OAAO;EACzB,QAAQ;EACR,YAAY;EACZ,QAAQ;EACT,CAAC;CAGF,MAAM,SAAS,aACZ,mBAA4C;AAC3C,MAAI,YAAY,QAAQ,eAAe,EAAG;EAE1C,IAAI,UAAU;AACd,MAAI,0BAA0B,WAC5B,WAAU,eAAe;WAEzB,OAAO,eAAe,eACtB,0BAA0B,WAE1B,WAAU,eAAe,QAAQ,GAAG;EAGtC,MAAM,EAAE,QAAQ,YAAY,WAAW,YAAY;EACnD,MAAM,SAAS,UAAU,UAAU;EAGnC,MAAM,WAAW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C,OAAD;EACE,WAAW,GACT,sHACA,mBAAmB,UACf,CACE,kBACA,0QACD,GACD,CACE,kBACA,0QACD,EACL,yHACA,YAAY,UAAU,SAAS,MAC/B,YAAY,UAAU,SAAS,KAChC;EACD,OAAO,EACL,OAAO,GAAG,MAAM,KACjB;EACD,KAAK;EACL,aAAa;EACb,cAAc;EACd,iBAAe;EACf,iBAAe;EACf,iBAAe;EACf,cAAW;EACX,MAAK;EACL,UAAU;YAGV,oBAAC,OAAD;GACE,MAAK;GACL,WAAU;GACV,cAAc,MAAM,EAAE,iBAAiB;GACvC,eAAe,MAAM,EAAE,iBAAiB;GAEvC;GACG;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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmKA,MAAa,eAAwD,EACnE,cACA,UACA,WAAW,GACX,iBAAiB,SACjB,eACI;CACJ,MAAM,eAAe,OAAuB,KAAK;CACjD,MAAM,CAAC,OAAO,YAAY,SAAS,aAAa;CAEhD,MAAM,cAAc,OAAO;EACzB,QAAQ;EACR,YAAY;EACZ,QAAQ;EACT,CAAC;CAGF,MAAM,SAAS,aACZ,mBAA4C;AAC3C,MAAI,YAAY,QAAQ,eAAe,EAAG;EAE1C,IAAI,UAAU;AACd,MAAI,0BA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Aa;AACX,UAAO,oBAAoB,aAAa,OAAO;AAC/C,UAAO,oBAAoB,WAAW,aAAa;AACnD,UAAO,oBAAoB,aAAa,OAAO;AAC/C,UAAO,oBAAoB,YAAY,aAAa;;IAErD,CAAC,QAAQ,aAAa,CAAC;AAE1B,QACE,oBAAC,OAAD;EACE,WAAW,GACT,sHACA,mBAAmB,UACf,CACE,kBACA,0QACD,GACD,CACE,kBACA,0QACD,EACL,yHACA,YAAY,UAAU,SAAS,MAC/B,YAAY,UAAU,SAAS,KAChC;EACD,OAAO,EACL,OAAO,GAAG,MAAM,KACjB;EACD,KAAK;EACL,aAAa;EACb,cAAc;EACd,iBAAe;EACf,iBAAe;EACf,iBAAe;EACf,cAAW;EACX,MAAK;EACL,UAAU;YAGV,oBAAC,OAAD;GACE,MAAK;GACL,WAAU;GACV,cAAc,MAAM,EAAE,iBAAiB;GACvC,eAAe,MAAM,EAAE,iBAAiB;GAEvC;GACG;EACF"}
@@ -1,22 +1,22 @@
1
- import { useKeyboardDetector } from "./useKeyboardDetector.mjs";
2
- import { useGetElementOrWindow } from "./useGetElementOrWindow.mjs";
3
- import { useScrollY } from "./useScrollY.mjs";
4
- import { usePersistedStore } from "./usePersistedStore.mjs";
5
- import { useHorizontalSwipe } from "./useHorizontalSwipe.mjs";
6
- import { useItemSelector } from "./useItemSelector.mjs";
7
1
  import { calculateIsMobile, checkIsIOS, checkIsIphoneOrSafariDevice, checkIsMac, checkIsMobileScreen, checkIsMobileUserAgent, getBreakpointFromSize, useDevice } from "./useDevice.mjs";
2
+ import { useItemSelector } from "./useItemSelector.mjs";
3
+ import { usePersistedStore } from "./usePersistedStore.mjs";
8
4
  import { useOAuth2 } from "./useAuth/useOAuth2.mjs";
9
5
  import { useSession } from "./useAuth/useSession.mjs";
10
6
  import { useAuth } from "./useAuth/useAuth.mjs";
11
7
  import { useIntlayerAuth, useIntlayerOAuth } from "./useIntlayerAPI.mjs";
12
- import { useAddDictionary, useAddNewAccessKey, useAddOrganization, useAddOrganizationMember, useAddPasskey, useAddProject, useAddTag, useAppQuery, useAskDocQuestion, useAskResetPassword, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditScan, useAuditTag, useAutocomplete, useBitbucketAuth, useBitbucketCheckConfig, useBitbucketGetConfigFile, useBitbucketRepos, useCancelSubscription, useChangePassword, useCreateUser, useDeleteAccessKey, useDeleteDictionary, useDeleteOrganization, useDeletePasskey, useDeleteProject, useDeleteSSOProvider, useDeleteShowcaseProject, useDeleteTag, useDeleteUser, useDisableTwoFactor, useEnableTwoFactor, useGetCIConfig, useGetDictionaries, useGetDictionariesKeys, useGetDictionary, useGetDiscussions, useGetDiscussionsData, useGetEditorDictionaries, useGetNewsletterStatus, useGetOrganizations, useGetOtherShowcaseProjects, useGetPricing, useGetProjects, useGetRecursiveAuditStatus, useGetShowcaseProjectById, useGetShowcaseProjects, useGetSubscription, useGetTags, useGetUserByAccount, useGetUserById, useGetUsers, useGetVerifyEmailStatus, useGithubAuth, useGithubCheckConfig, useGithubGetAuthUrl, useGithubGetConfigFile, useGithubRepos, useGitlabAuth, useGitlabCheckConfig, useGitlabGetConfigFile, useGitlabProjects, useInfiniteGetDictionaries, useListPasskeys, useListSSOProviders, useLogin, useLogout, usePushCIConfig, usePushDictionaries, useQueryClient, useRefreshAccessKey, useRegister, useRegisterSSO, useResetPassword, useSearchDoc, useSelectOrganization, useSelectProject, useSignInMagicLink, useSignInPasskey, useSignInSSO, useStartRecursiveAudit, useSubmitShowcaseProject, useSubscribeToNewsletter, useToggleShowcaseDownvote, useToggleShowcaseUpvote, useTranslateJSONDeclaration, useTriggerBuild, useTriggerWebhook, useUnselectOrganization, useUnselectProject, useUnsubscribeFromNewsletter, useUpdateDictionary, useUpdateOrganization, useUpdateOrganizationMembers, useUpdateOrganizationMembersById, useUpdateProject, useUpdateProjectMembers, useUpdateShowcaseProject, useUpdateTag, useUpdateUser, useVerifyBackupCode, useVerifyEmail, useVerifyTotp, useWriteDictionary } from "./reactQuery.mjs";
13
- import { useSearch } from "./useSearch.mjs";
14
- import { useIsMounted } from "./useIsMounted.mjs";
8
+ import { useAddDictionary, useAddNewAccessKey, useAddOrganization, useAddOrganizationMember, useAddPasskey, useAddProject, useAddTag, useAppQuery, useAskDocQuestion, useAskResetPassword, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditScan, useAuditTag, useAutocomplete, useBitbucketAuth, useBitbucketCheckConfig, useBitbucketGetConfigFile, useBitbucketRepos, useCancelSubscription, useChangePassword, useCreateUser, useDeleteAccessKey, useDeleteDictionary, useDeleteOrganization, useDeletePasskey, useDeleteProject, useDeleteSSOProvider, useDeleteShowcaseProject, useDeleteTag, useDeleteUser, useDisableTwoFactor, useEnableTwoFactor, useFillAllTranslations, useGetCIConfig, useGetDictionaries, useGetDictionariesKeys, useGetDictionary, useGetDiscussions, useGetDiscussionsData, useGetEditorDictionaries, useGetNewsletterStatus, useGetOrganizations, useGetOtherShowcaseProjects, useGetPricing, useGetProjects, useGetRecursiveAuditStatus, useGetShowcaseProjectById, useGetShowcaseProjects, useGetSubscription, useGetTags, useGetUserByAccount, useGetUserById, useGetUsers, useGetVerifyEmailStatus, useGithubAuth, useGithubCheckConfig, useGithubGetAuthUrl, useGithubGetConfigFile, useGithubRepos, useGitlabAuth, useGitlabCheckConfig, useGitlabGetConfigFile, useGitlabProjects, useInfiniteGetDictionaries, useListPasskeys, useListSSOProviders, useLogin, useLogout, usePauseTranslationJob, usePushCIConfig, usePushDictionaries, useQueryClient, useRefreshAccessKey, useRegister, useRegisterSSO, useResetPassword, useResumeTranslationJob, useSearchDoc, useSelectOrganization, useSelectProject, useSignInMagicLink, useSignInPasskey, useSignInSSO, useStartRecursiveAudit, useStopTranslationJob, useSubmitShowcaseProject, useSubscribeToNewsletter, useToggleShowcaseDownvote, useToggleShowcaseUpvote, useTranslateJSONDeclaration, useTriggerBuild, useTriggerWebhook, useUnselectOrganization, useUnselectProject, useUnsubscribeFromNewsletter, useUpdateDictionary, useUpdateOrganization, useUpdateOrganizationMembers, useUpdateOrganizationMembersById, useUpdateProject, useUpdateProjectMembers, useUpdateShowcaseProject, useUpdateTag, useUpdateUser, useVerifyBackupCode, useVerifyEmail, useVerifyTotp, useWriteDictionary } from "./reactQuery.mjs";
9
+ import { useUser } from "./useUser/index.mjs";
10
+ import { useHorizontalSwipe } from "./useHorizontalSwipe.mjs";
15
11
  import { useGetElementById } from "./useGetElementById.mjs";
12
+ import { useGetElementOrWindow } from "./useGetElementOrWindow.mjs";
16
13
  import { useIsDarkMode } from "./useIsDarkMode.mjs";
14
+ import { useIsMounted } from "./useIsMounted.mjs";
15
+ import { useKeyboardDetector } from "./useKeyboardDetector.mjs";
17
16
  import { useScreenWidth } from "./useScreenWidth.mjs";
18
17
  import { useScrollBlockage } from "./useScrollBlockage/index.mjs";
19
18
  import { useScrollDetection } from "./useScrollDetection.mjs";
20
- import { useUser } from "./useUser/index.mjs";
19
+ import { useScrollY } from "./useScrollY.mjs";
20
+ import { useSearch } from "./useSearch.mjs";
21
21
 
22
- export { calculateIsMobile, checkIsIOS, checkIsIphoneOrSafariDevice, checkIsMac, checkIsMobileScreen, checkIsMobileUserAgent, getBreakpointFromSize, useAddDictionary, useAddNewAccessKey, useAddOrganization, useAddOrganizationMember, useAddPasskey, useAddProject, useAddTag, useAppQuery, useAskDocQuestion, useAskResetPassword, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditScan, useAuditTag, useAuth, useAutocomplete, useBitbucketAuth, useBitbucketCheckConfig, useBitbucketGetConfigFile, useBitbucketRepos, useCancelSubscription, useChangePassword, useCreateUser, useDeleteAccessKey, useDeleteDictionary, useDeleteOrganization, useDeletePasskey, useDeleteProject, useDeleteSSOProvider, useDeleteShowcaseProject, useDeleteTag, useDeleteUser, useDevice, useDisableTwoFactor, useEnableTwoFactor, useGetCIConfig, useGetDictionaries, useGetDictionariesKeys, useGetDictionary, useGetDiscussions, useGetDiscussionsData, useGetEditorDictionaries, useGetElementById, useGetElementOrWindow, useGetNewsletterStatus, useGetOrganizations, useGetOtherShowcaseProjects, useGetPricing, useGetProjects, useGetRecursiveAuditStatus, useGetShowcaseProjectById, useGetShowcaseProjects, useGetSubscription, useGetTags, useGetUserByAccount, useGetUserById, useGetUsers, useGetVerifyEmailStatus, useGithubAuth, useGithubCheckConfig, useGithubGetAuthUrl, useGithubGetConfigFile, useGithubRepos, useGitlabAuth, useGitlabCheckConfig, useGitlabGetConfigFile, useGitlabProjects, useHorizontalSwipe, useInfiniteGetDictionaries, useIntlayerAuth, useIntlayerOAuth, useIsDarkMode, useIsMounted, useItemSelector, useKeyboardDetector, useListPasskeys, useListSSOProviders, useLogin, useLogout, useOAuth2, usePersistedStore, usePushCIConfig, usePushDictionaries, useQueryClient, useRefreshAccessKey, useRegister, useRegisterSSO, useResetPassword, useScreenWidth, useScrollBlockage, useScrollDetection, useScrollY, useSearch, useSearchDoc, useSelectOrganization, useSelectProject, useSession, useSignInMagicLink, useSignInPasskey, useSignInSSO, useStartRecursiveAudit, useSubmitShowcaseProject, useSubscribeToNewsletter, useToggleShowcaseDownvote, useToggleShowcaseUpvote, useTranslateJSONDeclaration, useTriggerBuild, useTriggerWebhook, useUnselectOrganization, useUnselectProject, useUnsubscribeFromNewsletter, useUpdateDictionary, useUpdateOrganization, useUpdateOrganizationMembers, useUpdateOrganizationMembersById, useUpdateProject, useUpdateProjectMembers, useUpdateShowcaseProject, useUpdateTag, useUpdateUser, useUser, useVerifyBackupCode, useVerifyEmail, useVerifyTotp, useWriteDictionary };
22
+ export { calculateIsMobile, checkIsIOS, checkIsIphoneOrSafariDevice, checkIsMac, checkIsMobileScreen, checkIsMobileUserAgent, getBreakpointFromSize, useAddDictionary, useAddNewAccessKey, useAddOrganization, useAddOrganizationMember, useAddPasskey, useAddProject, useAddTag, useAppQuery, useAskDocQuestion, useAskResetPassword, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditScan, useAuditTag, useAuth, useAutocomplete, useBitbucketAuth, useBitbucketCheckConfig, useBitbucketGetConfigFile, useBitbucketRepos, useCancelSubscription, useChangePassword, useCreateUser, useDeleteAccessKey, useDeleteDictionary, useDeleteOrganization, useDeletePasskey, useDeleteProject, useDeleteSSOProvider, useDeleteShowcaseProject, useDeleteTag, useDeleteUser, useDevice, useDisableTwoFactor, useEnableTwoFactor, useFillAllTranslations, useGetCIConfig, useGetDictionaries, useGetDictionariesKeys, useGetDictionary, useGetDiscussions, useGetDiscussionsData, useGetEditorDictionaries, useGetElementById, useGetElementOrWindow, useGetNewsletterStatus, useGetOrganizations, useGetOtherShowcaseProjects, useGetPricing, useGetProjects, useGetRecursiveAuditStatus, useGetShowcaseProjectById, useGetShowcaseProjects, useGetSubscription, useGetTags, useGetUserByAccount, useGetUserById, useGetUsers, useGetVerifyEmailStatus, useGithubAuth, useGithubCheckConfig, useGithubGetAuthUrl, useGithubGetConfigFile, useGithubRepos, useGitlabAuth, useGitlabCheckConfig, useGitlabGetConfigFile, useGitlabProjects, useHorizontalSwipe, useInfiniteGetDictionaries, useIntlayerAuth, useIntlayerOAuth, useIsDarkMode, useIsMounted, useItemSelector, useKeyboardDetector, useListPasskeys, useListSSOProviders, useLogin, useLogout, useOAuth2, usePauseTranslationJob, usePersistedStore, usePushCIConfig, usePushDictionaries, useQueryClient, useRefreshAccessKey, useRegister, useRegisterSSO, useResetPassword, useResumeTranslationJob, useScreenWidth, useScrollBlockage, useScrollDetection, useScrollY, useSearch, useSearchDoc, useSelectOrganization, useSelectProject, useSession, useSignInMagicLink, useSignInPasskey, useSignInSSO, useStartRecursiveAudit, useStopTranslationJob, useSubmitShowcaseProject, useSubscribeToNewsletter, useToggleShowcaseDownvote, useToggleShowcaseUpvote, useTranslateJSONDeclaration, useTriggerBuild, useTriggerWebhook, useUnselectOrganization, useUnselectProject, useUnsubscribeFromNewsletter, useUpdateDictionary, useUpdateOrganization, useUpdateOrganizationMembers, useUpdateOrganizationMembersById, useUpdateProject, useUpdateProjectMembers, useUpdateShowcaseProject, useUpdateTag, useUpdateUser, useUser, useVerifyBackupCode, useVerifyEmail, useVerifyTotp, useWriteDictionary };
@@ -381,10 +381,18 @@ const useAddProject = () => {
381
381
  };
382
382
  const useUpdateProject = () => {
383
383
  const intlayerOAuth = useIntlayerOAuth();
384
+ const queryClient = useQueryClient();
384
385
  return useMutation({
385
386
  mutationKey: ["projects"],
386
387
  mutationFn: (args) => intlayerOAuth.project.updateProject(args),
387
- meta: { invalidateQueries: [["projects"], ["session"]] }
388
+ meta: { invalidateQueries: [["projects"]] },
389
+ onSuccess: (data) => {
390
+ const session = queryClient.getQueryData(["session"]);
391
+ if (session && data.data) queryClient.setQueryData(["session"], {
392
+ ...session,
393
+ project: data.data
394
+ });
395
+ }
388
396
  });
389
397
  };
390
398
  const useUpdateProjectMembers = () => {
@@ -1022,7 +1030,44 @@ const useUpdateShowcaseProject = (props) => {
1022
1030
  }
1023
1031
  });
1024
1032
  };
1033
+ /**
1034
+ * Translation
1035
+ */
1036
+ const useFillAllTranslations = () => {
1037
+ const intlayerOAuth = useIntlayerOAuth();
1038
+ return useMutation({
1039
+ mutationKey: ["fill-all-translations"],
1040
+ mutationFn: async (args) => {
1041
+ const dictionaryIds = ((await intlayerOAuth.dictionary.getDictionaries({ pageSize: 1e3 }))?.data ?? []).map((d) => d.id);
1042
+ return intlayerOAuth.translate.translateDictionaries({
1043
+ dictionaryIds,
1044
+ targetLocales: args.targetLocales
1045
+ });
1046
+ }
1047
+ });
1048
+ };
1049
+ const useStopTranslationJob = () => {
1050
+ const intlayerOAuth = useIntlayerOAuth();
1051
+ return useMutation({
1052
+ mutationKey: ["stop-translation-job"],
1053
+ mutationFn: (jobId) => intlayerOAuth.translate.stopTranslationJob(jobId)
1054
+ });
1055
+ };
1056
+ const usePauseTranslationJob = () => {
1057
+ const intlayerOAuth = useIntlayerOAuth();
1058
+ return useMutation({
1059
+ mutationKey: ["pause-translation-job"],
1060
+ mutationFn: (jobId) => intlayerOAuth.translate.pauseTranslationJob(jobId)
1061
+ });
1062
+ };
1063
+ const useResumeTranslationJob = () => {
1064
+ const intlayerOAuth = useIntlayerOAuth();
1065
+ return useMutation({
1066
+ mutationKey: ["resume-translation-job"],
1067
+ mutationFn: (jobId) => intlayerOAuth.translate.resumeTranslationJob(jobId)
1068
+ });
1069
+ };
1025
1070
 
1026
1071
  //#endregion
1027
- export { useAddDictionary, useAddNewAccessKey, useAddOrganization, useAddOrganizationMember, useAddPasskey, useAddProject, useAddTag, useAppQuery, useAskDocQuestion, useAskResetPassword, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditScan, useAuditTag, useAutocomplete, useBitbucketAuth, useBitbucketCheckConfig, useBitbucketGetConfigFile, useBitbucketRepos, useCancelSubscription, useChangePassword, useCreateUser, useDeleteAccessKey, useDeleteDictionary, useDeleteOrganization, useDeletePasskey, useDeleteProject, useDeleteSSOProvider, useDeleteShowcaseProject, useDeleteTag, useDeleteUser, useDisableTwoFactor, useEnableTwoFactor, useGetCIConfig, useGetDictionaries, useGetDictionariesKeys, useGetDictionary, useGetDiscussions, useGetDiscussionsData, useGetEditorDictionaries, useGetNewsletterStatus, useGetOrganizations, useGetOtherShowcaseProjects, useGetPricing, useGetProjects, useGetRecursiveAuditStatus, useGetShowcaseProjectById, useGetShowcaseProjects, useGetSubscription, useGetTags, useGetUserByAccount, useGetUserById, useGetUsers, useGetVerifyEmailStatus, useGithubAuth, useGithubCheckConfig, useGithubGetAuthUrl, useGithubGetConfigFile, useGithubRepos, useGitlabAuth, useGitlabCheckConfig, useGitlabGetConfigFile, useGitlabProjects, useInfiniteGetDictionaries, useListPasskeys, useListSSOProviders, useLogin, useLogout, usePushCIConfig, usePushDictionaries, useQueryClient, useRefreshAccessKey, useRegister, useRegisterSSO, useResetPassword, useSearchDoc, useSelectOrganization, useSelectProject, useSignInMagicLink, useSignInPasskey, useSignInSSO, useStartRecursiveAudit, useSubmitShowcaseProject, useSubscribeToNewsletter, useToggleShowcaseDownvote, useToggleShowcaseUpvote, useTranslateJSONDeclaration, useTriggerBuild, useTriggerWebhook, useUnselectOrganization, useUnselectProject, useUnsubscribeFromNewsletter, useUpdateDictionary, useUpdateOrganization, useUpdateOrganizationMembers, useUpdateOrganizationMembersById, useUpdateProject, useUpdateProjectMembers, useUpdateShowcaseProject, useUpdateTag, useUpdateUser, useVerifyBackupCode, useVerifyEmail, useVerifyTotp, useWriteDictionary };
1072
+ export { useAddDictionary, useAddNewAccessKey, useAddOrganization, useAddOrganizationMember, useAddPasskey, useAddProject, useAddTag, useAppQuery, useAskDocQuestion, useAskResetPassword, useAuditContentDeclaration, useAuditContentDeclarationField, useAuditContentDeclarationMetadata, useAuditScan, useAuditTag, useAutocomplete, useBitbucketAuth, useBitbucketCheckConfig, useBitbucketGetConfigFile, useBitbucketRepos, useCancelSubscription, useChangePassword, useCreateUser, useDeleteAccessKey, useDeleteDictionary, useDeleteOrganization, useDeletePasskey, useDeleteProject, useDeleteSSOProvider, useDeleteShowcaseProject, useDeleteTag, useDeleteUser, useDisableTwoFactor, useEnableTwoFactor, useFillAllTranslations, useGetCIConfig, useGetDictionaries, useGetDictionariesKeys, useGetDictionary, useGetDiscussions, useGetDiscussionsData, useGetEditorDictionaries, useGetNewsletterStatus, useGetOrganizations, useGetOtherShowcaseProjects, useGetPricing, useGetProjects, useGetRecursiveAuditStatus, useGetShowcaseProjectById, useGetShowcaseProjects, useGetSubscription, useGetTags, useGetUserByAccount, useGetUserById, useGetUsers, useGetVerifyEmailStatus, useGithubAuth, useGithubCheckConfig, useGithubGetAuthUrl, useGithubGetConfigFile, useGithubRepos, useGitlabAuth, useGitlabCheckConfig, useGitlabGetConfigFile, useGitlabProjects, useInfiniteGetDictionaries, useListPasskeys, useListSSOProviders, useLogin, useLogout, usePauseTranslationJob, usePushCIConfig, usePushDictionaries, useQueryClient, useRefreshAccessKey, useRegister, useRegisterSSO, useResetPassword, useResumeTranslationJob, useSearchDoc, useSelectOrganization, useSelectProject, useSignInMagicLink, useSignInPasskey, useSignInSSO, useStartRecursiveAudit, useStopTranslationJob, useSubmitShowcaseProject, useSubscribeToNewsletter, useToggleShowcaseDownvote, useToggleShowcaseUpvote, useTranslateJSONDeclaration, useTriggerBuild, useTriggerWebhook, useUnselectOrganization, useUnselectProject, useUnsubscribeFromNewsletter, useUpdateDictionary, useUpdateOrganization, useUpdateOrganizationMembers, useUpdateOrganizationMembersById, useUpdateProject, useUpdateProjectMembers, useUpdateShowcaseProject, useUpdateTag, useUpdateUser, useVerifyBackupCode, useVerifyEmail, useVerifyTotp, useWriteDictionary };
1028
1073
  //# sourceMappingURL=reactQuery.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"reactQuery.mjs","names":[],"sources":["../../../src/hooks/reactQuery.ts"],"sourcesContent":["'use client';\n\nimport type {} from '@better-fetch/fetch'; // Import for type inference\nimport type {\n GetRecursiveAuditStatusParams,\n ScanUrlBody,\n StartRecursiveAuditBody,\n} from '@intlayer/api';\nimport type {\n AddDictionaryBody,\n AddNewAccessKeyBody,\n AddOrganizationBody,\n AddOrganizationMemberBody,\n AddProjectBody,\n AddTagBody,\n AskDocQuestionBody,\n AuditContentDeclarationBody,\n AuditContentDeclarationFieldBody,\n AuditContentDeclarationMetadataBody,\n AuditTagBody,\n AutocompleteBody,\n CreateUserBody,\n DeleteAccessKeyBody,\n DeleteDictionaryParam,\n DeleteTagParams,\n GetCheckoutSessionBody,\n GetDictionariesParams,\n GetDictionaryParams,\n GetDictionaryQuery,\n GetOrganizationsParams,\n GetPricingBody,\n GetPricingResult,\n GetProjectsParams,\n GetShowcaseProjectByIdParams,\n GetShowcaseProjectsResult,\n GetTagsParams,\n GetUsersParams,\n NewsletterSubscriptionBody,\n NewsletterUnsubscriptionBody,\n OtherShowcaseProjectsQuery,\n PushDictionariesBody,\n RefreshAccessKeyBody,\n SearchDocUtilParams,\n SelectOrganizationParam,\n SelectProjectParam,\n ShowcaseProjectsQuery,\n SubmitShowcaseProjectBody,\n TranslateJSONBody,\n UpdateDictionaryBody,\n UpdateOrganizationBody,\n UpdateOrganizationMembersBody,\n UpdateProjectBody,\n UpdateProjectMembersBody,\n UpdateUserBody,\n} from '@intlayer/backend';\n\nimport { useConfiguration } from '@intlayer/editor-react';\nimport {\n type UseQueryOptions,\n useInfiniteQuery,\n useMutation,\n useQuery,\n useQueryClient,\n} from '@tanstack/react-query';\nimport type {} from 'better-auth'; // Import for type inference\n// @ts-ignore\nimport type { WriteContentDeclarationBody } from 'intlayer-editor';\nimport type { AuthAPI } from '../libs/auth';\nimport { useAuth } from './useAuth';\nimport {\n type UseIntlayerAuthProps,\n useIntlayerAuth,\n useIntlayerOAuth,\n} from './useIntlayerAPI';\n\nexport { useQueryClient };\n\ntype AuthEnableOptions = {\n requireUser?: boolean;\n requireProject?: boolean;\n requireOrganization?: boolean;\n};\n\n/**\n * Hook to enable authentication\n */\nconst useAuthEnable = ({\n requireUser,\n requireProject,\n requireOrganization,\n}: AuthEnableOptions) => {\n const configuration = useConfiguration();\n const { oAuth2AccessToken, session } = useAuth({\n intlayerConfiguration: configuration,\n });\n\n const user = session ? session.user : oAuth2AccessToken?.user;\n\n const organization = session\n ? session.organization\n : oAuth2AccessToken?.organization;\n\n const project = session ? session.project : oAuth2AccessToken?.project;\n\n const isUserEnabled = requireUser ? Boolean(user) : true;\n\n const isProjectEnabled = requireProject ? Boolean(project) : true;\n\n const isOrganizationEnabled = requireOrganization\n ? Boolean(organization)\n : true;\n\n const isEnabled = isUserEnabled && isProjectEnabled && isOrganizationEnabled;\n\n return {\n enable: isEnabled,\n };\n};\n\nexport const useAppQuery = (\n options: UseQueryOptions & {\n requireUser?: boolean;\n requireProject?: boolean;\n requireOrganization?: boolean;\n }\n) => {\n const { requireUser, requireProject, requireOrganization, ...rest } = options;\n const { enable } = useAuthEnable({\n requireUser,\n requireProject,\n requireOrganization,\n });\n\n const result = useQuery({\n enabled: rest?.enabled === false ? false : enable,\n ...rest,\n });\n\n return result;\n};\n\n// Removed unused useEditorMutation\n\n/**\n * Auth\n */\n\nexport const useLogin = () => {\n const intlayerAuth = useIntlayerAuth();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['login'],\n mutationFn: (args: Parameters<AuthAPI['signInEmail']>[0]) =>\n intlayerAuth.signInEmail(args),\n onSuccess: (data) => {\n const session = queryClient.getQueryData(['session']);\n\n if (session && data.data?.user) {\n queryClient.setQueryData(['session'], {\n ...session,\n user: data.data.user,\n });\n }\n },\n });\n};\n\nexport const useGetVerifyEmailStatus = () => {\n const intlayerAuth = useIntlayerAuth();\n\n return useMutation({\n mutationKey: ['getVerifyEmailStatus'],\n mutationFn: (args: Parameters<AuthAPI['verifyEmailSession']>) =>\n intlayerAuth.verifyEmailSession(...args),\n });\n};\n\nexport const useRegister = () => {\n const intlayerAuth = useIntlayerAuth();\n\n return useMutation({\n mutationKey: ['register'],\n mutationFn: (args: Parameters<AuthAPI['signUpEmail']>[0]) =>\n intlayerAuth.signUpEmail(args),\n });\n};\n\nexport const useLogout = () => {\n const intlayerAuth = useIntlayerAuth();\n\n return useMutation({\n mutationKey: ['logout'],\n mutationFn: () => intlayerAuth.signOut(),\n meta: {\n resetQueries: [\n ['session'],\n ['users'],\n ['organizations'],\n ['projects'],\n ['dictionaries'],\n ['tags'],\n ],\n },\n });\n};\n\nexport const useChangePassword = () => {\n const intlayerAuth = useIntlayerAuth();\n\n return useMutation({\n mutationKey: ['changePassword'],\n mutationFn: (args: Parameters<AuthAPI['changePasswordSession']>) =>\n intlayerAuth.changePasswordSession(...args),\n });\n};\n\nexport const useAskResetPassword = () => {\n const intlayerAuth = useIntlayerAuth();\n\n return useMutation({\n mutationKey: ['askResetPassword'],\n mutationFn: (args: Parameters<AuthAPI['requestPasswordResetSession']>[0]) =>\n intlayerAuth.requestPasswordResetSession(args),\n });\n};\n\nexport const useResetPassword = () => {\n const intlayerAuth = useIntlayerAuth();\n\n return useMutation({\n mutationKey: ['resetPassword'],\n mutationFn: (args: Parameters<AuthAPI['resetPassword']>[0]) =>\n intlayerAuth.resetPassword(args),\n });\n};\n\nexport const useVerifyEmail = () => {\n const intlayerAuth = useIntlayerAuth();\n\n return useMutation({\n mutationKey: ['verifyEmail'],\n mutationFn: (args: Parameters<AuthAPI['verifyEmailSession']>[0]) =>\n intlayerAuth.verifyEmailSession(args),\n });\n};\n\nexport const useGetUserByAccount = () => {\n const intlayerAuth = useIntlayerAuth();\n\n return useMutation({\n mutationKey: ['user'],\n mutationFn: (args: Parameters<AuthAPI['accountInfo']>[0]) =>\n intlayerAuth.accountInfo(args),\n });\n};\n\nexport const useEnableTwoFactor = () => {\n const intlayerAuth = useIntlayerAuth();\n return useMutation({\n mutationKey: ['enableTwoFactor'],\n mutationFn: (args: Parameters<AuthAPI['enableTwoFactor']>[0]) =>\n intlayerAuth.enableTwoFactor(args),\n });\n};\n\nexport const useDisableTwoFactor = () => {\n const intlayerAuth = useIntlayerAuth();\n return useMutation({\n mutationKey: ['disableTwoFactor'],\n mutationFn: (args: Parameters<AuthAPI['disableTwoFactor']>[0]) =>\n intlayerAuth.disableTwoFactor(args),\n });\n};\n\nexport const useVerifyTotp = () => {\n const intlayerAuth = useIntlayerAuth();\n return useMutation({\n mutationKey: ['verifyTotp'],\n mutationFn: (args: Parameters<AuthAPI['verifyTotp']>[0]) =>\n intlayerAuth.verifyTotp(args),\n });\n};\n\nexport const useVerifyBackupCode = () => {\n const intlayerAuth = useIntlayerAuth();\n return useMutation({\n mutationKey: ['verifyBackupCode'],\n mutationFn: (args: Parameters<AuthAPI['verifyBackupCode']>[0]) =>\n intlayerAuth.verifyBackupCode(args),\n });\n};\n\nexport const useAddPasskey = () => {\n const intlayerAuth = useIntlayerAuth();\n return useMutation({\n mutationKey: ['addPasskey'],\n mutationFn: (args: Parameters<AuthAPI['addPasskey']>[0]) =>\n intlayerAuth.addPasskey(args),\n });\n};\n\nexport const useSignInPasskey = () => {\n const intlayerAuth = useIntlayerAuth();\n return useMutation({\n mutationKey: ['signInPasskey'],\n mutationFn: (args?: Parameters<AuthAPI['signInPasskey']>[0]) =>\n intlayerAuth.signInPasskey(args),\n });\n};\n\nexport const useDeletePasskey = () => {\n const intlayerAuth = useIntlayerAuth();\n return useMutation({\n mutationKey: ['deletePasskey'],\n mutationFn: (args: Parameters<AuthAPI['deletePasskey']>[0]) =>\n intlayerAuth.deletePasskey(args),\n });\n};\n\nexport const useListPasskeys = () => {\n const intlayerAuth = useIntlayerAuth();\n return useQuery({\n queryKey: ['listPasskeys'],\n queryFn: () => intlayerAuth.listPasskeys(),\n });\n};\n\nexport const useSignInMagicLink = () => {\n const intlayerAuth = useIntlayerAuth();\n return useMutation({\n mutationKey: ['signInMagicLink'],\n mutationFn: (args?: any) => intlayerAuth.signInMagicLink(args),\n });\n};\n\nexport const useRegisterSSO = () => {\n const intlayerAuth = useIntlayerAuth();\n const queryClient = useQueryClient();\n return useMutation({\n mutationKey: ['registerSSO'],\n mutationFn: (args: Parameters<AuthAPI['registerSSO']>[0]) =>\n intlayerAuth.registerSSO(args),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['ssoProviders'] });\n },\n });\n};\n\nexport const useSignInSSO = () => {\n const intlayerAuth = useIntlayerAuth();\n return useMutation({\n mutationKey: ['signInSSO'],\n mutationFn: (args: Parameters<AuthAPI['signInSSO']>[0]) =>\n intlayerAuth.signInSSO(args),\n });\n};\n\nexport const useListSSOProviders = () => {\n const intlayerAuth = useIntlayerAuth();\n return useQuery({\n queryKey: ['ssoProviders'],\n queryFn: () => intlayerAuth.listSSOProviders(),\n });\n};\n\nexport const useDeleteSSOProvider = () => {\n const intlayerAuth = useIntlayerAuth();\n const queryClient = useQueryClient();\n return useMutation({\n mutationKey: ['deleteSSOProvider'],\n mutationFn: (args: Parameters<AuthAPI['deleteSSOProvider']>[0]) =>\n intlayerAuth.deleteSSOProvider(args),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['ssoProviders'] });\n },\n });\n};\n\n/**\n * User\n */\n\nexport const useGetUsers = (\n filters?: GetUsersParams,\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['users', filters],\n queryFn: () => intlayerOAuth.user.getUsers(filters),\n requireUser: true,\n // placeholderData: keepPreviousData,\n ...options,\n });\n};\n\nexport const useGetUserById = (userId: string) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['users', userId],\n queryFn: () => intlayerOAuth.user.getUserById(userId),\n requireUser: true,\n });\n};\n\nexport const useCreateUser = () => {\n const intlayerAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['users'],\n mutationFn: (args: CreateUserBody) => intlayerAuth.user.createUser(args),\n });\n};\n\nexport const useUpdateUser = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['users'],\n mutationFn: (args: UpdateUserBody) => intlayerOAuth.user.updateUser(args),\n });\n};\n\nexport const useDeleteUser = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['users'],\n mutationFn: (args: string) => intlayerOAuth.user.deleteUser(args),\n meta: {\n invalidateQueries: [['users']],\n },\n });\n};\n\n/**\n * Organization\n */\n\nexport const useGetOrganizations = (filters?: GetOrganizationsParams) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['organizations', filters],\n queryFn: ({ signal }) =>\n intlayerOAuth.organization.getOrganizations(filters, { signal }),\n // placeholderData: keepPreviousData,\n requireUser: true,\n });\n};\n\nexport const useAddOrganization = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (args: AddOrganizationBody) =>\n intlayerOAuth.organization.addOrganization(args),\n meta: {\n invalidateQueries: [['organizations']],\n },\n });\n};\n\nexport const useUpdateOrganization = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (args: UpdateOrganizationBody) =>\n intlayerOAuth.organization.updateOrganization(args),\n });\n};\n\nexport const useUpdateOrganizationMembers = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (args: UpdateOrganizationMembersBody) =>\n intlayerOAuth.organization.updateOrganizationMembers(args),\n meta: {\n invalidateQueries: [['organizations'], ['users']],\n },\n });\n};\n\nexport const useUpdateOrganizationMembersById = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: ({\n organizationId,\n ...body\n }: {\n organizationId: string;\n membersIds: string[];\n adminsIds?: string[];\n }) =>\n intlayerOAuth.organization.updateOrganizationMembersById(\n organizationId,\n body\n ),\n meta: {\n invalidateQueries: [['organizations'], ['users']],\n },\n });\n};\n\nexport const useAddOrganizationMember = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (args: AddOrganizationMemberBody) =>\n intlayerOAuth.organization.addOrganizationMember(args),\n meta: {\n invalidateQueries: [['organizations']],\n },\n });\n};\n\nexport const useDeleteOrganization = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: () => intlayerOAuth.organization.deleteOrganization(),\n meta: {\n invalidateQueries: [['organizations'], ['session']],\n },\n });\n};\n\nexport const useSelectOrganization = () => {\n const intlayerOAuth = useIntlayerOAuth();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['session-organizations'],\n mutationFn: (args: SelectOrganizationParam) =>\n intlayerOAuth.organization.selectOrganization(args),\n meta: {\n invalidateQueries: [\n ['session'],\n ['organizations'],\n ['projects'],\n ['dictionaries'],\n ['tags'],\n ['subscription'],\n ['users'],\n ],\n },\n onSuccess: (data) => {\n const session = queryClient.getQueryData(['session']);\n\n if (session) {\n queryClient.setQueryData(['session'], {\n ...session,\n organization: data.data,\n });\n }\n },\n });\n};\n\nexport const useUnselectOrganization = () => {\n const intlayerOAuth = useIntlayerOAuth();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['session-organizations'],\n mutationFn: () => intlayerOAuth.organization.unselectOrganization(),\n meta: {\n resetQueries: [\n ['session'],\n ['organizations'],\n ['projects'],\n ['dictionaries'],\n ['tags'],\n ['subscription'],\n ['users'],\n ],\n },\n onSuccess: () => {\n const session = queryClient.getQueryData(['session']);\n\n if (session) {\n queryClient.setQueryData(['session'], {\n ...session,\n organization: null,\n project: null,\n });\n }\n },\n });\n};\n\n/**\n * Project\n */\n\nexport const useGetProjects = (\n filters?: GetProjectsParams,\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['projects', filters],\n queryFn: ({ signal }) =>\n intlayerOAuth.project.getProjects(filters, { signal }),\n // placeholderData: keepPreviousData,\n requireUser: true,\n requireOrganization: true,\n ...options,\n });\n};\n\nexport const useAddProject = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: AddProjectBody) =>\n intlayerOAuth.project.addProject(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useUpdateProject = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: UpdateProjectBody) =>\n intlayerOAuth.project.updateProject(args),\n meta: {\n invalidateQueries: [['projects'], ['session']],\n },\n });\n};\n\nexport const useUpdateProjectMembers = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: UpdateProjectMembersBody) =>\n intlayerOAuth.project.updateProjectMembers(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useDeleteProject = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: () => intlayerOAuth.project.deleteProject(),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useSelectProject = () => {\n const intlayerOAuth = useIntlayerOAuth();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['session-projects'],\n mutationFn: (args: SelectProjectParam) =>\n intlayerOAuth.project.selectProject(args),\n meta: {\n invalidateQueries: [\n ['projects'],\n ['dictionaries'],\n ['tags'],\n ['subscription'],\n ['users'],\n ],\n },\n onSuccess: (data) => {\n const session = queryClient.getQueryData(['session']);\n\n if (session) {\n queryClient.setQueryData(['session'], {\n ...session,\n project: data.data,\n });\n }\n },\n });\n};\n\nexport const useUnselectProject = () => {\n const intlayerOAuth = useIntlayerOAuth();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['session-projects'],\n mutationFn: () => intlayerOAuth.project.unselectProject(),\n meta: {\n resetQueries: [\n ['projects'],\n ['dictionaries'],\n ['tags'],\n ['subscription'],\n ['users'],\n ],\n },\n onSuccess: () => {\n const session = queryClient.getQueryData(['session']);\n\n if (session) {\n queryClient.setQueryData(['session'], {\n ...session,\n project: null,\n });\n }\n },\n });\n};\n\nexport const useGetCIConfig = (options?: Partial<UseQueryOptions>) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['ci-config'],\n queryFn: ({ signal }) => intlayerOAuth.project.getCIConfig({ signal }),\n requireProject: true,\n ...options,\n });\n};\n\nexport const usePushCIConfig = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['ci-config'],\n mutationFn: () => intlayerOAuth.project.pushCIConfig(),\n meta: {\n invalidateQueries: [['ci-config']],\n },\n });\n};\n\nexport const useTriggerBuild = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['projects', 'build'],\n mutationFn: () => intlayerOAuth.project.triggerBuild(),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useTriggerWebhook = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['projects', 'webhook'],\n mutationFn: (webhookIndex: number) =>\n intlayerOAuth.project.triggerWebhook(webhookIndex),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useAddNewAccessKey = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: AddNewAccessKeyBody) =>\n intlayerOAuth.project.addNewAccessKey(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useDeleteAccessKey = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: DeleteAccessKeyBody) =>\n intlayerOAuth.project.deleteAccessKey(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useRefreshAccessKey = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: RefreshAccessKeyBody) =>\n intlayerOAuth.project.refreshAccessKey(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\n/**\n * Dictionary\n */\n\nexport const useGetDictionaries = (\n filters?: GetDictionariesParams,\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['dictionaries', filters],\n queryFn: ({ signal }) =>\n intlayerOAuth.dictionary.getDictionaries(filters, { signal }),\n // placeholderData: keepPreviousData,\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n ...options,\n });\n};\n\nexport const useInfiniteGetDictionaries = (\n filters?: Omit<GetDictionariesParams, 'page'>,\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n const { enable } = useAuthEnable({\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n });\n\n return useInfiniteQuery({\n queryKey: ['dictionaries', 'infinite', filters],\n queryFn: async ({ pageParam = 1, signal }) => {\n const res = await intlayerOAuth.dictionary.getDictionaries(\n { ...filters, page: pageParam },\n { signal }\n );\n return res;\n },\n getNextPageParam: (lastPage) => {\n if (lastPage.data.length === 0) return undefined;\n const currentPage = lastPage.page ?? 1;\n const totalPages = lastPage.total_pages ?? 1;\n return currentPage < totalPages ? currentPage + 1 : undefined;\n },\n initialPageParam: 1,\n enabled: options?.enabled === false ? false : enable,\n ...options,\n });\n};\n\nexport const useGetDictionariesKeys = (options?: Partial<UseQueryOptions>) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['dictionariesKeys'],\n queryFn: () => intlayerOAuth.dictionary.getDictionariesKeys(),\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n ...options,\n });\n};\n\nexport const useGetDictionary = (\n dictionaryKey: GetDictionaryParams['dictionaryKey'],\n version?: GetDictionaryQuery['version'],\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['dictionary', dictionaryKey],\n queryFn: ({ signal }) =>\n intlayerOAuth.dictionary.getDictionary(dictionaryKey, version, {\n signal,\n }),\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n ...options,\n });\n};\n\nexport const useAddDictionary = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['dictionaries'],\n mutationFn: (args: AddDictionaryBody) =>\n intlayerOAuth.dictionary.addDictionary(args),\n meta: {\n invalidateQueries: [['dictionaries'], ['dictionariesKeys']],\n },\n });\n};\n\nexport const usePushDictionaries = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['dictionaries'],\n mutationFn: (args: PushDictionariesBody) =>\n intlayerOAuth.dictionary.pushDictionaries(args.dictionaries),\n meta: {\n invalidateQueries: [['dictionaries'], ['dictionariesKeys']],\n },\n });\n};\n\nexport const useUpdateDictionary = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['dictionaries'],\n mutationFn: (args: UpdateDictionaryBody) =>\n intlayerOAuth.dictionary.updateDictionary(args),\n meta: {\n invalidateQueries: [['dictionaries'], ['dictionariesKeys']],\n },\n });\n};\n\nexport const useDeleteDictionary = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['dictionaries'],\n mutationFn: (args: DeleteDictionaryParam) =>\n intlayerOAuth.dictionary.deleteDictionary(args.dictionaryId),\n meta: {\n invalidateQueries: [['dictionaries'], ['dictionariesKeys']],\n },\n });\n};\n\n/**\n * Tag\n */\n\nexport const useGetTags = (\n filters?: GetTagsParams,\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['tags', filters],\n queryFn: ({ signal }) => intlayerOAuth.tag.getTags(filters, { signal }),\n // placeholderData: keepPreviousData,\n requireUser: true,\n requireOrganization: true,\n ...options,\n });\n};\n\nexport const useAddTag = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['tags'],\n mutationFn: (args: AddTagBody) => intlayerOAuth.tag.addTag(args),\n meta: {\n invalidateQueries: [['tags']],\n },\n });\n};\n\nexport const useUpdateTag = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['tags'],\n mutationFn: (v: { tagId: string; tag: any }) =>\n intlayerOAuth.tag.updateTag(v.tagId, v.tag),\n meta: {\n invalidateQueries: [['tags']],\n },\n });\n};\n\nexport const useDeleteTag = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['tags'],\n mutationFn: (args: DeleteTagParams) => intlayerOAuth.tag.deleteTag(args),\n meta: {\n invalidateQueries: [['tags']],\n },\n });\n};\n\n/**\n * Stripe\n */\n\nexport const useGetPricing = (\n body: GetPricingBody,\n options?: Partial<UseQueryOptions<GetPricingResult>>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useQuery({\n queryKey: ['pricing', body],\n queryFn: ({ signal }) => intlayerOAuth.stripe.getPricing(body, { signal }),\n ...options,\n });\n};\n\nexport const useGetSubscription = (\n body: GetCheckoutSessionBody,\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['subscription', body],\n queryFn: ({ signal }) =>\n intlayerOAuth.stripe.getSubscription(body, { signal }),\n requireUser: true,\n requireOrganization: true,\n ...options,\n });\n};\n\nexport const useCancelSubscription = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['subscription'],\n mutationFn: () => intlayerOAuth.stripe.cancelSubscription(),\n meta: {\n invalidateQueries: [['session'], ['subscription']],\n },\n });\n};\n\n/**\n * AI\n */\n\nexport const useTranslateJSONDeclaration = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['ai-translateJSON'],\n mutationFn: (args: TranslateJSONBody) =>\n intlayerOAuth.ai.translateJSON(args),\n });\n};\n\nexport const useAuditContentDeclaration = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['ai-auditContentDeclaration'],\n mutationFn: (args: AuditContentDeclarationBody) =>\n intlayerOAuth.ai.auditContentDeclaration(args),\n });\n};\n\nexport const useAuditContentDeclarationMetadata = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['ai-auditContentDeclarationMetadata'],\n mutationFn: (args: AuditContentDeclarationMetadataBody) =>\n intlayerOAuth.ai.auditContentDeclarationMetadata(args),\n });\n};\n\nexport const useAuditContentDeclarationField = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['ai-auditContentDeclarationField'],\n mutationFn: (args: AuditContentDeclarationFieldBody) =>\n intlayerOAuth.ai.auditContentDeclarationField(args),\n });\n};\n\nexport const useAuditTag = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['ai-auditTag'],\n mutationFn: (args: AuditTagBody) => intlayerOAuth.ai.auditTag(args),\n });\n};\n\nexport const useAskDocQuestion = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: [],\n mutationFn: (args?: AskDocQuestionBody) =>\n intlayerOAuth.ai.askDocQuestion(args),\n });\n};\n\nexport const useAutocomplete = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['ai-autocomplete'],\n mutationFn: (args?: AutocompleteBody) =>\n intlayerOAuth.ai.autocomplete(args),\n });\n};\n\n/**\n * Audit\n */\n\nexport const useAuditScan = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['audit-scan'],\n mutationFn: (args: ScanUrlBody) => intlayerOAuth.audit.scanUrl(args),\n });\n};\n\nexport const useStartRecursiveAudit = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['audit-recursive-start'],\n mutationFn: (args: StartRecursiveAuditBody) =>\n intlayerOAuth.audit.startRecursiveAudit(args),\n });\n};\n\nexport const useGetRecursiveAuditStatus = (\n params?: GetRecursiveAuditStatusParams,\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['audit-recursive-status', params?.jobId],\n queryFn: ({ signal }) =>\n intlayerOAuth.audit.getRecursiveAuditStatus(params, { signal }),\n enabled: Boolean(params?.jobId),\n ...options,\n });\n};\n\n/**\n * Discussions\n */\n\nexport const useGetDiscussions = (\n params?: Record<string, string | string[] | undefined>,\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['discussions', params],\n queryFn: ({ signal }) =>\n intlayerOAuth.ai.getDiscussions(params, { signal, cache: 'no-store' }),\n requireUser: true,\n ...options,\n });\n};\n\nexport const useGetDiscussionsData = (\n params?: Record<string, string | string[] | undefined>,\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['discussions-data', params],\n queryFn: ({ signal }) =>\n intlayerOAuth.ai.getDiscussions(\n { includeMessages: 'false', ...(params ?? {}) } as any,\n { signal, cache: 'no-store' }\n ),\n requireUser: true,\n ...options,\n });\n};\n\n/**\n * Search\n */\n\nexport const useSearchDoc = (params: SearchDocUtilParams) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useQuery({\n queryKey: ['search', params],\n queryFn: () => intlayerOAuth.search.searchDoc(params),\n enabled: (params?.input?.length ?? 0) > 3,\n });\n};\n\n/**\n * Newsletter\n */\n\nexport const useSubscribeToNewsletter = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['newsletter'],\n mutationFn: (args: NewsletterSubscriptionBody) =>\n intlayerOAuth.newsletter.subscribeToNewsletter(args),\n });\n};\n\nexport const useUnsubscribeFromNewsletter = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['newsletter'],\n mutationFn: (args: NewsletterUnsubscriptionBody) =>\n intlayerOAuth.newsletter.unsubscribeFromNewsletter(args),\n });\n};\n\nexport const useGetNewsletterStatus = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['newsletter'],\n mutationFn: () => intlayerOAuth.newsletter.getNewsletterStatus(),\n });\n};\n\n/**\n * GitHub\n */\n\nexport const useGithubGetAuthUrl = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['github', 'auth-url'],\n mutationFn: (redirectUri: string) =>\n intlayerOAuth.github.getAuthUrl(redirectUri),\n });\n};\n\nexport const useGithubAuth = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['github', 'auth'],\n mutationFn: (code: string) => intlayerOAuth.github.authenticate(code),\n });\n};\n\nexport const useGithubRepos = (enabled: boolean = true) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useQuery({\n queryKey: ['github', 'repos'],\n queryFn: () => intlayerOAuth.github.getRepositories(),\n enabled,\n });\n};\n\nexport const useGithubCheckConfig = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['github', 'check-config'],\n mutationFn: (args: {\n owner: string;\n repository: string;\n branch?: string;\n }) =>\n intlayerOAuth.github.checkIntlayerConfig(\n undefined,\n args.owner,\n args.repository,\n args.branch\n ),\n });\n};\n\nexport const useGithubGetConfigFile = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['github', 'get-config-file'],\n mutationFn: (args: {\n owner: string;\n repository: string;\n branch?: string;\n path?: string;\n }) =>\n intlayerOAuth.github.getConfigFile(\n undefined,\n args.owner,\n args.repository,\n args.branch,\n args.path\n ),\n });\n};\n\n/**\n * GitLab\n */\n\nexport const useGitlabAuth = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['gitlab', 'auth'],\n mutationFn: (args: {\n code: string;\n redirectUri: string;\n instanceUrl?: string;\n }) =>\n intlayerOAuth.gitlab.authenticate(\n args.code,\n args.redirectUri,\n args.instanceUrl\n ),\n });\n};\n\nexport const useGitlabProjects = (\n enabled: boolean = true,\n instanceUrl?: string\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useQuery({\n queryKey: ['gitlab', 'projects', instanceUrl],\n queryFn: () => intlayerOAuth.gitlab.getProjects(undefined, instanceUrl),\n enabled,\n });\n};\n\nexport const useGitlabCheckConfig = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['gitlab', 'check-config'],\n mutationFn: (args: {\n projectId: number;\n branch?: string;\n instanceUrl?: string;\n }) =>\n intlayerOAuth.gitlab.checkIntlayerConfig(\n undefined,\n args.projectId,\n args.branch,\n args.instanceUrl\n ),\n });\n};\n\nexport const useGitlabGetConfigFile = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['gitlab', 'get-config-file'],\n mutationFn: (args: {\n projectId: number;\n branch?: string;\n path?: string;\n instanceUrl?: string;\n }) =>\n intlayerOAuth.gitlab.getConfigFile(\n undefined,\n args.projectId,\n args.branch,\n args.path,\n args.instanceUrl\n ),\n });\n};\n\n/**\n * Bitbucket\n */\n\nexport const useBitbucketAuth = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['bitbucket', 'auth'],\n mutationFn: (code: string) => intlayerOAuth.bitbucket.authenticate(code),\n });\n};\n\nexport const useBitbucketRepos = (enabled: boolean = true) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useQuery({\n queryKey: ['bitbucket', 'repos'],\n queryFn: () => intlayerOAuth.bitbucket.getRepositories(),\n enabled,\n });\n};\n\nexport const useBitbucketCheckConfig = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['bitbucket', 'check-config'],\n mutationFn: (args: {\n workspace: string;\n repoSlug: string;\n branch?: string;\n }) =>\n intlayerOAuth.bitbucket.checkIntlayerConfig(\n undefined,\n args.workspace,\n args.repoSlug,\n args.branch\n ),\n });\n};\n\nexport const useBitbucketGetConfigFile = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['bitbucket', 'get-config-file'],\n mutationFn: (args: {\n workspace: string;\n repoSlug: string;\n branch?: string;\n path?: string;\n }) =>\n intlayerOAuth.bitbucket.getConfigFile(\n undefined,\n args.workspace,\n args.repoSlug,\n args.branch,\n args.path\n ),\n });\n};\n\n/**\n * Editor\n */\n\nexport const useGetEditorDictionaries = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useQuery({\n queryKey: ['editor', 'dictionaries'],\n queryFn: () => intlayerOAuth.editor.getDictionaries(),\n });\n};\n\nexport const useWriteDictionary = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['editor', 'dictionaries'],\n mutationFn: (args: WriteContentDeclarationBody) =>\n intlayerOAuth.editor.writeDictionary(args),\n });\n};\n\n/**\n * Showcase\n */\n\nexport const useGetShowcaseProjects = (\n query?: ShowcaseProjectsQuery,\n options?: Partial<UseQueryOptions<GetShowcaseProjectsResult>>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useQuery({\n queryKey: ['showcase', 'projects', query],\n queryFn: ({ signal }) =>\n intlayerOAuth.showcaseProject.getShowcaseProjects(query, { signal }),\n ...options,\n });\n};\n\nexport const useGetShowcaseProjectById = (\n projectId: GetShowcaseProjectByIdParams['projectId'],\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useQuery({\n queryKey: ['showcase', 'project', projectId],\n queryFn: ({ signal }) =>\n intlayerOAuth.showcaseProject.getShowcaseProjectById(projectId, {\n signal,\n }),\n enabled: Boolean(projectId),\n ...options,\n });\n};\n\nexport const useGetOtherShowcaseProjects = (\n query: OtherShowcaseProjectsQuery,\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useQuery({\n queryKey: ['showcase', 'other-projects', query],\n queryFn: ({ signal }) =>\n intlayerOAuth.showcaseProject.getOtherShowcaseProjects(query, {\n signal,\n }),\n enabled: Boolean(query.excludeId),\n ...options,\n });\n};\n\nexport const useSubmitShowcaseProject = (props?: UseIntlayerAuthProps) => {\n const intlayerOAuth = useIntlayerOAuth(props);\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['showcase', 'submit'],\n mutationFn: (body: SubmitShowcaseProjectBody) =>\n intlayerOAuth.showcaseProject.submitShowcaseProject(body),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['showcase'] });\n },\n });\n};\n\nexport const useDeleteShowcaseProject = (props?: UseIntlayerAuthProps) => {\n const intlayerOAuth = useIntlayerOAuth(props);\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['showcase', 'delete'],\n mutationFn: (projectId: string) =>\n intlayerOAuth.showcaseProject.deleteShowcaseProject(projectId),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['showcase'] });\n },\n });\n};\n\nexport const useToggleShowcaseUpvote = (props?: UseIntlayerAuthProps) => {\n const intlayerOAuth = useIntlayerOAuth(props);\n\n return useMutation({\n mutationKey: ['showcase', 'upvote'],\n mutationFn: (projectId: string) =>\n intlayerOAuth.showcaseProject.toggleShowcaseUpvote({ projectId }),\n });\n};\n\nexport const useToggleShowcaseDownvote = (props?: UseIntlayerAuthProps) => {\n const intlayerOAuth = useIntlayerOAuth(props);\n\n return useMutation({\n mutationKey: ['showcase', 'downvote'],\n mutationFn: (projectId: string) =>\n intlayerOAuth.showcaseProject.toggleShowcaseDownvote({ projectId }),\n });\n};\n\nexport const useUpdateShowcaseProject = (props?: UseIntlayerAuthProps) => {\n const intlayerOAuth = useIntlayerOAuth(props);\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['showcase', 'update'],\n mutationFn: ({\n projectId,\n ...body\n }: {\n projectId: string;\n name?: string;\n url?: string;\n githubUrl?: string;\n tagline?: string;\n description?: string;\n useCases?: string[];\n }) => intlayerOAuth.showcaseProject.updateShowcaseProject(projectId, body),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['showcase'] });\n },\n });\n};\n"],"mappings":";;;;;;;;;;;AAsFA,MAAM,iBAAiB,EACrB,aACA,gBACA,0BACuB;CAEvB,MAAM,EAAE,mBAAmB,YAAY,QAAQ,EAC7C,uBAFoB,kBAAkB,EAGvC,CAAC;CAEF,MAAM,OAAO,UAAU,QAAQ,OAAO,mBAAmB;CAEzD,MAAM,eAAe,UACjB,QAAQ,eACR,mBAAmB;CAEvB,MAAM,UAAU,UAAU,QAAQ,UAAU,mBAAmB;AAY/D,QAAO,EACL,SAXoB,cAAc,QAAQ,KAAK,GAAG,UAE3B,iBAAiB,QAAQ,QAAQ,GAAG,UAE/B,sBAC1B,QAAQ,aAAa,GACrB,OAMH;;AAGH,MAAa,eACX,YAKG;CACH,MAAM,EAAE,aAAa,gBAAgB,qBAAqB,GAAG,SAAS;CACtE,MAAM,EAAE,WAAW,cAAc;EAC/B;EACA;EACA;EACD,CAAC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BAA6B,UAAiC;CACzE,MAAM,gBAAgB,iBAAiB,MAAM;AAE7C,QAAO,YAAY;EACjB,aAAa,CAAC,YAAY,WAAW;EACrC,aAAa,cACX,cAAc,gBAAgB,uBAAuB,EAAE,WAAW,CAAC;EACtE,CAAC;;AAGJ,MAAa,4BAA4B,UAAiC;CACxE,MAAM,gBAAgB,iBAAiB,MAAM;CAC7C,MAAM,cAAc,gBAAgB;AAEpC,QAAO,YAAY;EACjB,aAAa,CAAC,YAAY,SAAS;EACnC,aAAa,EACX,WACA,GAAG,WASC,cAAc,gBAAgB,sBAAsB,WAAW,KAAK;EAC1E,iBAAiB;AACf,eAAY,kBAAkB,EAAE,UAAU,CAAC,WAAW,EAAE,CAAC;;EAE5D,CAAC"}
1
+ {"version":3,"file":"reactQuery.mjs","names":[],"sources":["../../../src/hooks/reactQuery.ts"],"sourcesContent":["'use client';\n\nimport type {} from '@better-fetch/fetch'; // Import for type inference\nimport type {\n GetRecursiveAuditStatusParams,\n ScanUrlBody,\n StartRecursiveAuditBody,\n} from '@intlayer/api';\nimport type {\n AddDictionaryBody,\n AddNewAccessKeyBody,\n AddOrganizationBody,\n AddOrganizationMemberBody,\n AddProjectBody,\n AddTagBody,\n AskDocQuestionBody,\n AuditContentDeclarationBody,\n AuditContentDeclarationFieldBody,\n AuditContentDeclarationMetadataBody,\n AuditTagBody,\n AutocompleteBody,\n CreateUserBody,\n DeleteAccessKeyBody,\n DeleteDictionaryParam,\n DeleteTagParams,\n GetCheckoutSessionBody,\n GetDictionariesParams,\n GetDictionaryParams,\n GetDictionaryQuery,\n GetOrganizationsParams,\n GetPricingBody,\n GetPricingResult,\n GetProjectsParams,\n GetShowcaseProjectByIdParams,\n GetShowcaseProjectsResult,\n GetTagsParams,\n GetUsersParams,\n NewsletterSubscriptionBody,\n NewsletterUnsubscriptionBody,\n OtherShowcaseProjectsQuery,\n PushDictionariesBody,\n RefreshAccessKeyBody,\n SearchDocUtilParams,\n SelectOrganizationParam,\n SelectProjectParam,\n ShowcaseProjectsQuery,\n SubmitShowcaseProjectBody,\n TranslateDictionariesBody,\n TranslateJSONBody,\n UpdateDictionaryBody,\n UpdateOrganizationBody,\n UpdateOrganizationMembersBody,\n UpdateProjectBody,\n UpdateProjectMembersBody,\n UpdateUserBody,\n} from '@intlayer/backend';\n\nimport { useConfiguration } from '@intlayer/editor-react';\nimport {\n type UseQueryOptions,\n useInfiniteQuery,\n useMutation,\n useQuery,\n useQueryClient,\n} from '@tanstack/react-query';\nimport type {} from 'better-auth'; // Import for type inference\n// @ts-ignore\nimport type { WriteContentDeclarationBody } from 'intlayer-editor';\nimport type { AuthAPI } from '../libs/auth';\nimport { useAuth } from './useAuth';\nimport {\n type UseIntlayerAuthProps,\n useIntlayerAuth,\n useIntlayerOAuth,\n} from './useIntlayerAPI';\n\nexport { useQueryClient };\n\ntype AuthEnableOptions = {\n requireUser?: boolean;\n requireProject?: boolean;\n requireOrganization?: boolean;\n};\n\n/**\n * Hook to enable authentication\n */\nconst useAuthEnable = ({\n requireUser,\n requireProject,\n requireOrganization,\n}: AuthEnableOptions) => {\n const configuration = useConfiguration();\n const { oAuth2AccessToken, session } = useAuth({\n intlayerConfiguration: configuration,\n });\n\n const user = session ? session.user : oAuth2AccessToken?.user;\n\n const organization = session\n ? session.organization\n : oAuth2AccessToken?.organization;\n\n const project = session ? session.project : oAuth2AccessToken?.project;\n\n const isUserEnabled = requireUser ? Boolean(user) : true;\n\n const isProjectEnabled = requireProject ? Boolean(project) : true;\n\n const isOrganizationEnabled = requireOrganization\n ? Boolean(organization)\n : true;\n\n const isEnabled = isUserEnabled && isProjectEnabled && isOrganizationEnabled;\n\n return {\n enable: isEnabled,\n };\n};\n\nexport const useAppQuery = (\n options: UseQueryOptions & {\n requireUser?: boolean;\n requireProject?: boolean;\n requireOrganization?: boolean;\n }\n) => {\n const { requireUser, requireProject, requireOrganization, ...rest } = options;\n const { enable } = useAuthEnable({\n requireUser,\n requireProject,\n requireOrganization,\n });\n\n const result = useQuery({\n enabled: rest?.enabled === false ? false : enable,\n ...rest,\n });\n\n return result;\n};\n\n// Removed unused useEditorMutation\n\n/**\n * Auth\n */\n\nexport const useLogin = () => {\n const intlayerAuth = useIntlayerAuth();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['login'],\n mutationFn: (args: Parameters<AuthAPI['signInEmail']>[0]) =>\n intlayerAuth.signInEmail(args),\n onSuccess: (data) => {\n const session = queryClient.getQueryData(['session']);\n\n if (session && data.data?.user) {\n queryClient.setQueryData(['session'], {\n ...session,\n user: data.data.user,\n });\n }\n },\n });\n};\n\nexport const useGetVerifyEmailStatus = () => {\n const intlayerAuth = useIntlayerAuth();\n\n return useMutation({\n mutationKey: ['getVerifyEmailStatus'],\n mutationFn: (args: Parameters<AuthAPI['verifyEmailSession']>) =>\n intlayerAuth.verifyEmailSession(...args),\n });\n};\n\nexport const useRegister = () => {\n const intlayerAuth = useIntlayerAuth();\n\n return useMutation({\n mutationKey: ['register'],\n mutationFn: (args: Parameters<AuthAPI['signUpEmail']>[0]) =>\n intlayerAuth.signUpEmail(args),\n });\n};\n\nexport const useLogout = () => {\n const intlayerAuth = useIntlayerAuth();\n\n return useMutation({\n mutationKey: ['logout'],\n mutationFn: () => intlayerAuth.signOut(),\n meta: {\n resetQueries: [\n ['session'],\n ['users'],\n ['organizations'],\n ['projects'],\n ['dictionaries'],\n ['tags'],\n ],\n },\n });\n};\n\nexport const useChangePassword = () => {\n const intlayerAuth = useIntlayerAuth();\n\n return useMutation({\n mutationKey: ['changePassword'],\n mutationFn: (args: Parameters<AuthAPI['changePasswordSession']>) =>\n intlayerAuth.changePasswordSession(...args),\n });\n};\n\nexport const useAskResetPassword = () => {\n const intlayerAuth = useIntlayerAuth();\n\n return useMutation({\n mutationKey: ['askResetPassword'],\n mutationFn: (args: Parameters<AuthAPI['requestPasswordResetSession']>[0]) =>\n intlayerAuth.requestPasswordResetSession(args),\n });\n};\n\nexport const useResetPassword = () => {\n const intlayerAuth = useIntlayerAuth();\n\n return useMutation({\n mutationKey: ['resetPassword'],\n mutationFn: (args: Parameters<AuthAPI['resetPassword']>[0]) =>\n intlayerAuth.resetPassword(args),\n });\n};\n\nexport const useVerifyEmail = () => {\n const intlayerAuth = useIntlayerAuth();\n\n return useMutation({\n mutationKey: ['verifyEmail'],\n mutationFn: (args: Parameters<AuthAPI['verifyEmailSession']>[0]) =>\n intlayerAuth.verifyEmailSession(args),\n });\n};\n\nexport const useGetUserByAccount = () => {\n const intlayerAuth = useIntlayerAuth();\n\n return useMutation({\n mutationKey: ['user'],\n mutationFn: (args: Parameters<AuthAPI['accountInfo']>[0]) =>\n intlayerAuth.accountInfo(args),\n });\n};\n\nexport const useEnableTwoFactor = () => {\n const intlayerAuth = useIntlayerAuth();\n return useMutation({\n mutationKey: ['enableTwoFactor'],\n mutationFn: (args: Parameters<AuthAPI['enableTwoFactor']>[0]) =>\n intlayerAuth.enableTwoFactor(args),\n });\n};\n\nexport const useDisableTwoFactor = () => {\n const intlayerAuth = useIntlayerAuth();\n return useMutation({\n mutationKey: ['disableTwoFactor'],\n mutationFn: (args: Parameters<AuthAPI['disableTwoFactor']>[0]) =>\n intlayerAuth.disableTwoFactor(args),\n });\n};\n\nexport const useVerifyTotp = () => {\n const intlayerAuth = useIntlayerAuth();\n return useMutation({\n mutationKey: ['verifyTotp'],\n mutationFn: (args: Parameters<AuthAPI['verifyTotp']>[0]) =>\n intlayerAuth.verifyTotp(args),\n });\n};\n\nexport const useVerifyBackupCode = () => {\n const intlayerAuth = useIntlayerAuth();\n return useMutation({\n mutationKey: ['verifyBackupCode'],\n mutationFn: (args: Parameters<AuthAPI['verifyBackupCode']>[0]) =>\n intlayerAuth.verifyBackupCode(args),\n });\n};\n\nexport const useAddPasskey = () => {\n const intlayerAuth = useIntlayerAuth();\n return useMutation({\n mutationKey: ['addPasskey'],\n mutationFn: (args: Parameters<AuthAPI['addPasskey']>[0]) =>\n intlayerAuth.addPasskey(args),\n });\n};\n\nexport const useSignInPasskey = () => {\n const intlayerAuth = useIntlayerAuth();\n return useMutation({\n mutationKey: ['signInPasskey'],\n mutationFn: (args?: Parameters<AuthAPI['signInPasskey']>[0]) =>\n intlayerAuth.signInPasskey(args),\n });\n};\n\nexport const useDeletePasskey = () => {\n const intlayerAuth = useIntlayerAuth();\n return useMutation({\n mutationKey: ['deletePasskey'],\n mutationFn: (args: Parameters<AuthAPI['deletePasskey']>[0]) =>\n intlayerAuth.deletePasskey(args),\n });\n};\n\nexport const useListPasskeys = () => {\n const intlayerAuth = useIntlayerAuth();\n return useQuery({\n queryKey: ['listPasskeys'],\n queryFn: () => intlayerAuth.listPasskeys(),\n });\n};\n\nexport const useSignInMagicLink = () => {\n const intlayerAuth = useIntlayerAuth();\n return useMutation({\n mutationKey: ['signInMagicLink'],\n mutationFn: (args?: any) => intlayerAuth.signInMagicLink(args),\n });\n};\n\nexport const useRegisterSSO = () => {\n const intlayerAuth = useIntlayerAuth();\n const queryClient = useQueryClient();\n return useMutation({\n mutationKey: ['registerSSO'],\n mutationFn: (args: Parameters<AuthAPI['registerSSO']>[0]) =>\n intlayerAuth.registerSSO(args),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['ssoProviders'] });\n },\n });\n};\n\nexport const useSignInSSO = () => {\n const intlayerAuth = useIntlayerAuth();\n return useMutation({\n mutationKey: ['signInSSO'],\n mutationFn: (args: Parameters<AuthAPI['signInSSO']>[0]) =>\n intlayerAuth.signInSSO(args),\n });\n};\n\nexport const useListSSOProviders = () => {\n const intlayerAuth = useIntlayerAuth();\n return useQuery({\n queryKey: ['ssoProviders'],\n queryFn: () => intlayerAuth.listSSOProviders(),\n });\n};\n\nexport const useDeleteSSOProvider = () => {\n const intlayerAuth = useIntlayerAuth();\n const queryClient = useQueryClient();\n return useMutation({\n mutationKey: ['deleteSSOProvider'],\n mutationFn: (args: Parameters<AuthAPI['deleteSSOProvider']>[0]) =>\n intlayerAuth.deleteSSOProvider(args),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['ssoProviders'] });\n },\n });\n};\n\n/**\n * User\n */\n\nexport const useGetUsers = (\n filters?: GetUsersParams,\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['users', filters],\n queryFn: () => intlayerOAuth.user.getUsers(filters),\n requireUser: true,\n // placeholderData: keepPreviousData,\n ...options,\n });\n};\n\nexport const useGetUserById = (userId: string) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['users', userId],\n queryFn: () => intlayerOAuth.user.getUserById(userId),\n requireUser: true,\n });\n};\n\nexport const useCreateUser = () => {\n const intlayerAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['users'],\n mutationFn: (args: CreateUserBody) => intlayerAuth.user.createUser(args),\n });\n};\n\nexport const useUpdateUser = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['users'],\n mutationFn: (args: UpdateUserBody) => intlayerOAuth.user.updateUser(args),\n });\n};\n\nexport const useDeleteUser = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['users'],\n mutationFn: (args: string) => intlayerOAuth.user.deleteUser(args),\n meta: {\n invalidateQueries: [['users']],\n },\n });\n};\n\n/**\n * Organization\n */\n\nexport const useGetOrganizations = (filters?: GetOrganizationsParams) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['organizations', filters],\n queryFn: ({ signal }) =>\n intlayerOAuth.organization.getOrganizations(filters, { signal }),\n // placeholderData: keepPreviousData,\n requireUser: true,\n });\n};\n\nexport const useAddOrganization = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (args: AddOrganizationBody) =>\n intlayerOAuth.organization.addOrganization(args),\n meta: {\n invalidateQueries: [['organizations']],\n },\n });\n};\n\nexport const useUpdateOrganization = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (args: UpdateOrganizationBody) =>\n intlayerOAuth.organization.updateOrganization(args),\n });\n};\n\nexport const useUpdateOrganizationMembers = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (args: UpdateOrganizationMembersBody) =>\n intlayerOAuth.organization.updateOrganizationMembers(args),\n meta: {\n invalidateQueries: [['organizations'], ['users']],\n },\n });\n};\n\nexport const useUpdateOrganizationMembersById = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: ({\n organizationId,\n ...body\n }: {\n organizationId: string;\n membersIds: string[];\n adminsIds?: string[];\n }) =>\n intlayerOAuth.organization.updateOrganizationMembersById(\n organizationId,\n body\n ),\n meta: {\n invalidateQueries: [['organizations'], ['users']],\n },\n });\n};\n\nexport const useAddOrganizationMember = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: (args: AddOrganizationMemberBody) =>\n intlayerOAuth.organization.addOrganizationMember(args),\n meta: {\n invalidateQueries: [['organizations']],\n },\n });\n};\n\nexport const useDeleteOrganization = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['organizations'],\n mutationFn: () => intlayerOAuth.organization.deleteOrganization(),\n meta: {\n invalidateQueries: [['organizations'], ['session']],\n },\n });\n};\n\nexport const useSelectOrganization = () => {\n const intlayerOAuth = useIntlayerOAuth();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['session-organizations'],\n mutationFn: (args: SelectOrganizationParam) =>\n intlayerOAuth.organization.selectOrganization(args),\n meta: {\n invalidateQueries: [\n ['session'],\n ['organizations'],\n ['projects'],\n ['dictionaries'],\n ['tags'],\n ['subscription'],\n ['users'],\n ],\n },\n onSuccess: (data) => {\n const session = queryClient.getQueryData(['session']);\n\n if (session) {\n queryClient.setQueryData(['session'], {\n ...session,\n organization: data.data,\n });\n }\n },\n });\n};\n\nexport const useUnselectOrganization = () => {\n const intlayerOAuth = useIntlayerOAuth();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['session-organizations'],\n mutationFn: () => intlayerOAuth.organization.unselectOrganization(),\n meta: {\n resetQueries: [\n ['session'],\n ['organizations'],\n ['projects'],\n ['dictionaries'],\n ['tags'],\n ['subscription'],\n ['users'],\n ],\n },\n onSuccess: () => {\n const session = queryClient.getQueryData(['session']);\n\n if (session) {\n queryClient.setQueryData(['session'], {\n ...session,\n organization: null,\n project: null,\n });\n }\n },\n });\n};\n\n/**\n * Project\n */\n\nexport const useGetProjects = (\n filters?: GetProjectsParams,\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['projects', filters],\n queryFn: ({ signal }) =>\n intlayerOAuth.project.getProjects(filters, { signal }),\n // placeholderData: keepPreviousData,\n requireUser: true,\n requireOrganization: true,\n ...options,\n });\n};\n\nexport const useAddProject = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: AddProjectBody) =>\n intlayerOAuth.project.addProject(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useUpdateProject = () => {\n const intlayerOAuth = useIntlayerOAuth();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: UpdateProjectBody) =>\n intlayerOAuth.project.updateProject(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n onSuccess: (data) => {\n const session = queryClient.getQueryData(['session']);\n\n if (session && data.data) {\n queryClient.setQueryData(['session'], {\n ...session,\n project: data.data,\n });\n }\n },\n });\n};\n\nexport const useUpdateProjectMembers = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: UpdateProjectMembersBody) =>\n intlayerOAuth.project.updateProjectMembers(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useDeleteProject = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: () => intlayerOAuth.project.deleteProject(),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useSelectProject = () => {\n const intlayerOAuth = useIntlayerOAuth();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['session-projects'],\n mutationFn: (args: SelectProjectParam) =>\n intlayerOAuth.project.selectProject(args),\n meta: {\n invalidateQueries: [\n ['projects'],\n ['dictionaries'],\n ['tags'],\n ['subscription'],\n ['users'],\n ],\n },\n onSuccess: (data) => {\n const session = queryClient.getQueryData(['session']);\n\n if (session) {\n queryClient.setQueryData(['session'], {\n ...session,\n project: data.data,\n });\n }\n },\n });\n};\n\nexport const useUnselectProject = () => {\n const intlayerOAuth = useIntlayerOAuth();\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['session-projects'],\n mutationFn: () => intlayerOAuth.project.unselectProject(),\n meta: {\n resetQueries: [\n ['projects'],\n ['dictionaries'],\n ['tags'],\n ['subscription'],\n ['users'],\n ],\n },\n onSuccess: () => {\n const session = queryClient.getQueryData(['session']);\n\n if (session) {\n queryClient.setQueryData(['session'], {\n ...session,\n project: null,\n });\n }\n },\n });\n};\n\nexport const useGetCIConfig = (options?: Partial<UseQueryOptions>) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['ci-config'],\n queryFn: ({ signal }) => intlayerOAuth.project.getCIConfig({ signal }),\n requireProject: true,\n ...options,\n });\n};\n\nexport const usePushCIConfig = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['ci-config'],\n mutationFn: () => intlayerOAuth.project.pushCIConfig(),\n meta: {\n invalidateQueries: [['ci-config']],\n },\n });\n};\n\nexport const useTriggerBuild = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['projects', 'build'],\n mutationFn: () => intlayerOAuth.project.triggerBuild(),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useTriggerWebhook = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['projects', 'webhook'],\n mutationFn: (webhookIndex: number) =>\n intlayerOAuth.project.triggerWebhook(webhookIndex),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useAddNewAccessKey = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: AddNewAccessKeyBody) =>\n intlayerOAuth.project.addNewAccessKey(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useDeleteAccessKey = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: DeleteAccessKeyBody) =>\n intlayerOAuth.project.deleteAccessKey(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\nexport const useRefreshAccessKey = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['projects'],\n mutationFn: (args: RefreshAccessKeyBody) =>\n intlayerOAuth.project.refreshAccessKey(args),\n meta: {\n invalidateQueries: [['projects']],\n },\n });\n};\n\n/**\n * Dictionary\n */\n\nexport const useGetDictionaries = (\n filters?: GetDictionariesParams,\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['dictionaries', filters],\n queryFn: ({ signal }) =>\n intlayerOAuth.dictionary.getDictionaries(filters, { signal }),\n // placeholderData: keepPreviousData,\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n ...options,\n });\n};\n\nexport const useInfiniteGetDictionaries = (\n filters?: Omit<GetDictionariesParams, 'page'>,\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n const { enable } = useAuthEnable({\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n });\n\n return useInfiniteQuery({\n queryKey: ['dictionaries', 'infinite', filters],\n queryFn: async ({ pageParam = 1, signal }) => {\n const res = await intlayerOAuth.dictionary.getDictionaries(\n { ...filters, page: pageParam },\n { signal }\n );\n return res;\n },\n getNextPageParam: (lastPage) => {\n if (lastPage.data.length === 0) return undefined;\n const currentPage = lastPage.page ?? 1;\n const totalPages = lastPage.total_pages ?? 1;\n return currentPage < totalPages ? currentPage + 1 : undefined;\n },\n initialPageParam: 1,\n enabled: options?.enabled === false ? false : enable,\n ...options,\n });\n};\n\nexport const useGetDictionariesKeys = (options?: Partial<UseQueryOptions>) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['dictionariesKeys'],\n queryFn: () => intlayerOAuth.dictionary.getDictionariesKeys(),\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n ...options,\n });\n};\n\nexport const useGetDictionary = (\n dictionaryKey: GetDictionaryParams['dictionaryKey'],\n version?: GetDictionaryQuery['version'],\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['dictionary', dictionaryKey],\n queryFn: ({ signal }) =>\n intlayerOAuth.dictionary.getDictionary(dictionaryKey, version, {\n signal,\n }),\n requireUser: true,\n requireOrganization: true,\n requireProject: true,\n ...options,\n });\n};\n\nexport const useAddDictionary = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['dictionaries'],\n mutationFn: (args: AddDictionaryBody) =>\n intlayerOAuth.dictionary.addDictionary(args),\n meta: {\n invalidateQueries: [['dictionaries'], ['dictionariesKeys']],\n },\n });\n};\n\nexport const usePushDictionaries = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['dictionaries'],\n mutationFn: (args: PushDictionariesBody) =>\n intlayerOAuth.dictionary.pushDictionaries(args.dictionaries),\n meta: {\n invalidateQueries: [['dictionaries'], ['dictionariesKeys']],\n },\n });\n};\n\nexport const useUpdateDictionary = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['dictionaries'],\n mutationFn: (args: UpdateDictionaryBody) =>\n intlayerOAuth.dictionary.updateDictionary(args),\n meta: {\n invalidateQueries: [['dictionaries'], ['dictionariesKeys']],\n },\n });\n};\n\nexport const useDeleteDictionary = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['dictionaries'],\n mutationFn: (args: DeleteDictionaryParam) =>\n intlayerOAuth.dictionary.deleteDictionary(args.dictionaryId),\n meta: {\n invalidateQueries: [['dictionaries'], ['dictionariesKeys']],\n },\n });\n};\n\n/**\n * Tag\n */\n\nexport const useGetTags = (\n filters?: GetTagsParams,\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['tags', filters],\n queryFn: ({ signal }) => intlayerOAuth.tag.getTags(filters, { signal }),\n // placeholderData: keepPreviousData,\n requireUser: true,\n requireOrganization: true,\n ...options,\n });\n};\n\nexport const useAddTag = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['tags'],\n mutationFn: (args: AddTagBody) => intlayerOAuth.tag.addTag(args),\n meta: {\n invalidateQueries: [['tags']],\n },\n });\n};\n\nexport const useUpdateTag = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['tags'],\n mutationFn: (v: { tagId: string; tag: any }) =>\n intlayerOAuth.tag.updateTag(v.tagId, v.tag),\n meta: {\n invalidateQueries: [['tags']],\n },\n });\n};\n\nexport const useDeleteTag = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['tags'],\n mutationFn: (args: DeleteTagParams) => intlayerOAuth.tag.deleteTag(args),\n meta: {\n invalidateQueries: [['tags']],\n },\n });\n};\n\n/**\n * Stripe\n */\n\nexport const useGetPricing = (\n body: GetPricingBody,\n options?: Partial<UseQueryOptions<GetPricingResult>>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useQuery({\n queryKey: ['pricing', body],\n queryFn: ({ signal }) => intlayerOAuth.stripe.getPricing(body, { signal }),\n ...options,\n });\n};\n\nexport const useGetSubscription = (\n body: GetCheckoutSessionBody,\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['subscription', body],\n queryFn: ({ signal }) =>\n intlayerOAuth.stripe.getSubscription(body, { signal }),\n requireUser: true,\n requireOrganization: true,\n ...options,\n });\n};\n\nexport const useCancelSubscription = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['subscription'],\n mutationFn: () => intlayerOAuth.stripe.cancelSubscription(),\n meta: {\n invalidateQueries: [['session'], ['subscription']],\n },\n });\n};\n\n/**\n * AI\n */\n\nexport const useTranslateJSONDeclaration = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['ai-translateJSON'],\n mutationFn: (args: TranslateJSONBody) =>\n intlayerOAuth.ai.translateJSON(args),\n });\n};\n\nexport const useAuditContentDeclaration = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['ai-auditContentDeclaration'],\n mutationFn: (args: AuditContentDeclarationBody) =>\n intlayerOAuth.ai.auditContentDeclaration(args),\n });\n};\n\nexport const useAuditContentDeclarationMetadata = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['ai-auditContentDeclarationMetadata'],\n mutationFn: (args: AuditContentDeclarationMetadataBody) =>\n intlayerOAuth.ai.auditContentDeclarationMetadata(args),\n });\n};\n\nexport const useAuditContentDeclarationField = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['ai-auditContentDeclarationField'],\n mutationFn: (args: AuditContentDeclarationFieldBody) =>\n intlayerOAuth.ai.auditContentDeclarationField(args),\n });\n};\n\nexport const useAuditTag = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['ai-auditTag'],\n mutationFn: (args: AuditTagBody) => intlayerOAuth.ai.auditTag(args),\n });\n};\n\nexport const useAskDocQuestion = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: [],\n mutationFn: (args?: AskDocQuestionBody) =>\n intlayerOAuth.ai.askDocQuestion(args),\n });\n};\n\nexport const useAutocomplete = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['ai-autocomplete'],\n mutationFn: (args?: AutocompleteBody) =>\n intlayerOAuth.ai.autocomplete(args),\n });\n};\n\n/**\n * Audit\n */\n\nexport const useAuditScan = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['audit-scan'],\n mutationFn: (args: ScanUrlBody) => intlayerOAuth.audit.scanUrl(args),\n });\n};\n\nexport const useStartRecursiveAudit = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['audit-recursive-start'],\n mutationFn: (args: StartRecursiveAuditBody) =>\n intlayerOAuth.audit.startRecursiveAudit(args),\n });\n};\n\nexport const useGetRecursiveAuditStatus = (\n params?: GetRecursiveAuditStatusParams,\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['audit-recursive-status', params?.jobId],\n queryFn: ({ signal }) =>\n intlayerOAuth.audit.getRecursiveAuditStatus(params, { signal }),\n enabled: Boolean(params?.jobId),\n ...options,\n });\n};\n\n/**\n * Discussions\n */\n\nexport const useGetDiscussions = (\n params?: Record<string, string | string[] | undefined>,\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['discussions', params],\n queryFn: ({ signal }) =>\n intlayerOAuth.ai.getDiscussions(params, { signal, cache: 'no-store' }),\n requireUser: true,\n ...options,\n });\n};\n\nexport const useGetDiscussionsData = (\n params?: Record<string, string | string[] | undefined>,\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useAppQuery({\n queryKey: ['discussions-data', params],\n queryFn: ({ signal }) =>\n intlayerOAuth.ai.getDiscussions(\n { includeMessages: 'false', ...(params ?? {}) } as any,\n { signal, cache: 'no-store' }\n ),\n requireUser: true,\n ...options,\n });\n};\n\n/**\n * Search\n */\n\nexport const useSearchDoc = (params: SearchDocUtilParams) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useQuery({\n queryKey: ['search', params],\n queryFn: () => intlayerOAuth.search.searchDoc(params),\n enabled: (params?.input?.length ?? 0) > 3,\n });\n};\n\n/**\n * Newsletter\n */\n\nexport const useSubscribeToNewsletter = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['newsletter'],\n mutationFn: (args: NewsletterSubscriptionBody) =>\n intlayerOAuth.newsletter.subscribeToNewsletter(args),\n });\n};\n\nexport const useUnsubscribeFromNewsletter = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['newsletter'],\n mutationFn: (args: NewsletterUnsubscriptionBody) =>\n intlayerOAuth.newsletter.unsubscribeFromNewsletter(args),\n });\n};\n\nexport const useGetNewsletterStatus = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['newsletter'],\n mutationFn: () => intlayerOAuth.newsletter.getNewsletterStatus(),\n });\n};\n\n/**\n * GitHub\n */\n\nexport const useGithubGetAuthUrl = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['github', 'auth-url'],\n mutationFn: (redirectUri: string) =>\n intlayerOAuth.github.getAuthUrl(redirectUri),\n });\n};\n\nexport const useGithubAuth = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['github', 'auth'],\n mutationFn: (code: string) => intlayerOAuth.github.authenticate(code),\n });\n};\n\nexport const useGithubRepos = (enabled: boolean = true) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useQuery({\n queryKey: ['github', 'repos'],\n queryFn: () => intlayerOAuth.github.getRepositories(),\n enabled,\n });\n};\n\nexport const useGithubCheckConfig = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['github', 'check-config'],\n mutationFn: (args: {\n owner: string;\n repository: string;\n branch?: string;\n }) =>\n intlayerOAuth.github.checkIntlayerConfig(\n undefined,\n args.owner,\n args.repository,\n args.branch\n ),\n });\n};\n\nexport const useGithubGetConfigFile = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['github', 'get-config-file'],\n mutationFn: (args: {\n owner: string;\n repository: string;\n branch?: string;\n path?: string;\n }) =>\n intlayerOAuth.github.getConfigFile(\n undefined,\n args.owner,\n args.repository,\n args.branch,\n args.path\n ),\n });\n};\n\n/**\n * GitLab\n */\n\nexport const useGitlabAuth = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['gitlab', 'auth'],\n mutationFn: (args: {\n code: string;\n redirectUri: string;\n instanceUrl?: string;\n }) =>\n intlayerOAuth.gitlab.authenticate(\n args.code,\n args.redirectUri,\n args.instanceUrl\n ),\n });\n};\n\nexport const useGitlabProjects = (\n enabled: boolean = true,\n instanceUrl?: string\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useQuery({\n queryKey: ['gitlab', 'projects', instanceUrl],\n queryFn: () => intlayerOAuth.gitlab.getProjects(undefined, instanceUrl),\n enabled,\n });\n};\n\nexport const useGitlabCheckConfig = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['gitlab', 'check-config'],\n mutationFn: (args: {\n projectId: number;\n branch?: string;\n instanceUrl?: string;\n }) =>\n intlayerOAuth.gitlab.checkIntlayerConfig(\n undefined,\n args.projectId,\n args.branch,\n args.instanceUrl\n ),\n });\n};\n\nexport const useGitlabGetConfigFile = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['gitlab', 'get-config-file'],\n mutationFn: (args: {\n projectId: number;\n branch?: string;\n path?: string;\n instanceUrl?: string;\n }) =>\n intlayerOAuth.gitlab.getConfigFile(\n undefined,\n args.projectId,\n args.branch,\n args.path,\n args.instanceUrl\n ),\n });\n};\n\n/**\n * Bitbucket\n */\n\nexport const useBitbucketAuth = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['bitbucket', 'auth'],\n mutationFn: (code: string) => intlayerOAuth.bitbucket.authenticate(code),\n });\n};\n\nexport const useBitbucketRepos = (enabled: boolean = true) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useQuery({\n queryKey: ['bitbucket', 'repos'],\n queryFn: () => intlayerOAuth.bitbucket.getRepositories(),\n enabled,\n });\n};\n\nexport const useBitbucketCheckConfig = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['bitbucket', 'check-config'],\n mutationFn: (args: {\n workspace: string;\n repoSlug: string;\n branch?: string;\n }) =>\n intlayerOAuth.bitbucket.checkIntlayerConfig(\n undefined,\n args.workspace,\n args.repoSlug,\n args.branch\n ),\n });\n};\n\nexport const useBitbucketGetConfigFile = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['bitbucket', 'get-config-file'],\n mutationFn: (args: {\n workspace: string;\n repoSlug: string;\n branch?: string;\n path?: string;\n }) =>\n intlayerOAuth.bitbucket.getConfigFile(\n undefined,\n args.workspace,\n args.repoSlug,\n args.branch,\n args.path\n ),\n });\n};\n\n/**\n * Editor\n */\n\nexport const useGetEditorDictionaries = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useQuery({\n queryKey: ['editor', 'dictionaries'],\n queryFn: () => intlayerOAuth.editor.getDictionaries(),\n });\n};\n\nexport const useWriteDictionary = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['editor', 'dictionaries'],\n mutationFn: (args: WriteContentDeclarationBody) =>\n intlayerOAuth.editor.writeDictionary(args),\n });\n};\n\n/**\n * Showcase\n */\n\nexport const useGetShowcaseProjects = (\n query?: ShowcaseProjectsQuery,\n options?: Partial<UseQueryOptions<GetShowcaseProjectsResult>>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useQuery({\n queryKey: ['showcase', 'projects', query],\n queryFn: ({ signal }) =>\n intlayerOAuth.showcaseProject.getShowcaseProjects(query, { signal }),\n ...options,\n });\n};\n\nexport const useGetShowcaseProjectById = (\n projectId: GetShowcaseProjectByIdParams['projectId'],\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useQuery({\n queryKey: ['showcase', 'project', projectId],\n queryFn: ({ signal }) =>\n intlayerOAuth.showcaseProject.getShowcaseProjectById(projectId, {\n signal,\n }),\n enabled: Boolean(projectId),\n ...options,\n });\n};\n\nexport const useGetOtherShowcaseProjects = (\n query: OtherShowcaseProjectsQuery,\n options?: Partial<UseQueryOptions>\n) => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useQuery({\n queryKey: ['showcase', 'other-projects', query],\n queryFn: ({ signal }) =>\n intlayerOAuth.showcaseProject.getOtherShowcaseProjects(query, {\n signal,\n }),\n enabled: Boolean(query.excludeId),\n ...options,\n });\n};\n\nexport const useSubmitShowcaseProject = (props?: UseIntlayerAuthProps) => {\n const intlayerOAuth = useIntlayerOAuth(props);\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['showcase', 'submit'],\n mutationFn: (body: SubmitShowcaseProjectBody) =>\n intlayerOAuth.showcaseProject.submitShowcaseProject(body),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['showcase'] });\n },\n });\n};\n\nexport const useDeleteShowcaseProject = (props?: UseIntlayerAuthProps) => {\n const intlayerOAuth = useIntlayerOAuth(props);\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['showcase', 'delete'],\n mutationFn: (projectId: string) =>\n intlayerOAuth.showcaseProject.deleteShowcaseProject(projectId),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['showcase'] });\n },\n });\n};\n\nexport const useToggleShowcaseUpvote = (props?: UseIntlayerAuthProps) => {\n const intlayerOAuth = useIntlayerOAuth(props);\n\n return useMutation({\n mutationKey: ['showcase', 'upvote'],\n mutationFn: (projectId: string) =>\n intlayerOAuth.showcaseProject.toggleShowcaseUpvote({ projectId }),\n });\n};\n\nexport const useToggleShowcaseDownvote = (props?: UseIntlayerAuthProps) => {\n const intlayerOAuth = useIntlayerOAuth(props);\n\n return useMutation({\n mutationKey: ['showcase', 'downvote'],\n mutationFn: (projectId: string) =>\n intlayerOAuth.showcaseProject.toggleShowcaseDownvote({ projectId }),\n });\n};\n\nexport const useUpdateShowcaseProject = (props?: UseIntlayerAuthProps) => {\n const intlayerOAuth = useIntlayerOAuth(props);\n const queryClient = useQueryClient();\n\n return useMutation({\n mutationKey: ['showcase', 'update'],\n mutationFn: ({\n projectId,\n ...body\n }: {\n projectId: string;\n name?: string;\n url?: string;\n githubUrl?: string;\n tagline?: string;\n description?: string;\n useCases?: string[];\n }) => intlayerOAuth.showcaseProject.updateShowcaseProject(projectId, body),\n onSuccess: () => {\n queryClient.invalidateQueries({ queryKey: ['showcase'] });\n },\n });\n};\n\n/**\n * Translation\n */\n\nexport const useFillAllTranslations = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['fill-all-translations'],\n mutationFn: async (\n args: Pick<TranslateDictionariesBody, 'targetLocales'>\n ) => {\n const result = await intlayerOAuth.dictionary.getDictionaries({\n pageSize: 1000,\n });\n const dictionaryIds = (result?.data ?? []).map((d) => d.id);\n return intlayerOAuth.translate.translateDictionaries({\n dictionaryIds,\n targetLocales: args.targetLocales,\n });\n },\n });\n};\n\nexport const useStopTranslationJob = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['stop-translation-job'],\n mutationFn: (jobId: string) =>\n intlayerOAuth.translate.stopTranslationJob(jobId),\n });\n};\n\nexport const usePauseTranslationJob = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['pause-translation-job'],\n mutationFn: (jobId: string) =>\n intlayerOAuth.translate.pauseTranslationJob(jobId),\n });\n};\n\nexport const useResumeTranslationJob = () => {\n const intlayerOAuth = useIntlayerOAuth();\n\n return useMutation({\n mutationKey: ['resume-translation-job'],\n mutationFn: (jobId: string) =>\n intlayerOAuth.translate.resumeTranslationJob(jobId),\n });\n};\n"],"mappings":";;;;;;;;;;;AAuFA,MAAM,iBAAiB,EACrB,aACA,gBACA,0BACuB;CAEvB,MAAM,EAAE,mBAAmB,YAAY,QAAQ,EAC7C,uBAFoB,kBAEgB,EACrC,CAAC;CAEF,MAAM,OAAO,UAAU,QAAQ,OAAO,mBAAmB;CAEzD,MAAM,eAAe,UACjB,QAAQ,eACR,mBAAmB;CAEvB,MAAM,UAAU,UAAU,QAAQ,UAAU,mBAAmB;AAY/D,QAAO,EACL,SAXoB,cAAc,QAAQ,KAAK,GAAG,UAE3B,iBAAiB,QAAQ,QAAQ,GAAG,UAE/B,sBAC1B,QAAQ,aAAa,GACrB,OAMH;;AAGH,MAAa,eACX,YAKG;CACH,MAAM,EAAE,aAAa,gBAAgB,qBAAqB,GAAG,SAAS;CACtE,MAAM,EAAE,WAAW,cAAc;EAC/B;EACA;EACA;EACD,CAAC;AAOF,QALe,SAAS;EACtB,SAAS,MAAM,YAAY,QAAQ,QAAQ;EAC3C,GAAG;EACJ,CAEY;;;;;AASf,MAAa,iBAAiB;CAC5B,MAAM,eAAe,iBAAiB;CACtC,MAAM,cAAc,gBAAgB;AAEpC,QAAO,YAAY;EACjB,aAAa,CAAC,QAAQ;EACtB,aAAa,SACX,aAAa,YAAY,KAAK;EAChC,YAAY,SAAS;GACnB,MAAM,UAAU,YAAY,aAAa,CAAC,UAAU,CAAC;AAErD,O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AAE,WAAW,CAAC;EACtE,CAAC;;AAGJ,MAAa,4BAA4B,UAAiC;CACxE,MAAM,gBAAgB,iBAAiB,MAAM;CAC7C,MAAM,cAAc,gBAAgB;AAEpC,QAAO,YAAY;EACjB,aAAa,CAAC,YAAY,SAAS;EACnC,aAAa,EACX,WACA,GAAG,WASC,cAAc,gBAAgB,sBAAsB,WAAW,KAAK;EAC1E,iBAAiB;AACf,eAAY,kBAAkB,EAAE,UAAU,CAAC,WAAW,EAAE,CAAC;;EAE5D,CAAC;;;;;AAOJ,MAAa,+BAA+B;CAC1C,MAAM,gBAAgB,kBAAkB;AAExC,QAAO,YAAY;EACjB,aAAa,CAAC,wBAAwB;EACtC,YAAY,OACV,SACG;GAIH,MAAM,kBAAiB,MAHF,cAAc,WAAW,gBAAgB,EAC5D,UAAU,KACX,CAAC,GAC6B,QAAQ,EAAE,EAAE,KAAK,MAAM,EAAE,GAAG;AAC3D,UAAO,cAAc,UAAU,sBAAsB;IACnD;IACA,eAAe,KAAK;IACrB,CAAC;;EAEL,CAAC;;AAGJ,MAAa,8BAA8B;CACzC,MAAM,gBAAgB,kBAAkB;AAExC,QAAO,YAAY;EACjB,aAAa,CAAC,uBAAuB;EACrC,aAAa,UACX,cAAc,UAAU,mBAAmB,MAAM;EACpD,CAAC;;AAGJ,MAAa,+BAA+B;CAC1C,MAAM,gBAAgB,kBAAkB;AAExC,QAAO,YAAY;EACjB,aAAa,CAAC,wBAAwB;EACtC,aAAa,UACX,cAAc,UAAU,oBAAoB,MAAM;EACrD,CAAC;;AAGJ,MAAa,gCAAgC;CAC3C,MAAM,gBAAgB,kBAAkB;AAExC,QAAO,YAAY;EACjB,aAAa,CAAC,yBAAyB;EACvC,aAAa,UACX,cAAc,UAAU,qBAAqB,MAAM;EACtD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"useOAuth2.mjs","names":["configuration","defaultConfiguration"],"sources":["../../../../src/hooks/useAuth/useOAuth2.ts"],"sourcesContent":["'use client';\n\nimport { getOAuthAPI } from '@intlayer/api';\nimport { default as defaultConfiguration } from '@intlayer/config/built';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { useQuery } from '@tanstack/react-query';\n\nexport const useOAuth2 = (intlayerConfiguration?: IntlayerConfig) => {\n const configuration = useConfiguration();\n const config = intlayerConfiguration ?? configuration ?? defaultConfiguration;\n const intlayerAPI = getOAuthAPI(config);\n\n const { data } = useQuery({\n queryKey: ['oAuth2AccessToken'],\n queryFn: intlayerAPI.getOAuth2AccessToken,\n enabled: !!(config.editor.clientId && config.editor.clientSecret),\n staleTime: 0,\n gcTime: 0,\n refetchOnWindowFocus: false,\n refetchOnMount: false,\n refetchOnReconnect: false,\n refetchInterval: false,\n refetchIntervalInBackground: false,\n });\n\n const oAuth2AccessToken = data?.data;\n\n return {\n oAuth2AccessToken,\n };\n};\n"],"mappings":";;;;;;;;AAQA,MAAa,aAAa,0BAA2C;CACnE,MAAMA,kBAAgB,kBAAkB;CACxC,MAAM,SAAS,yBAAyBA,mBAAiBC;CAGzD,MAAM,EAAE,SAAS,SAAS;EACxB,UAAU,CAAC,oBAAoB;EAC/B,SAJkB,YAAY,OAAO,CAIhB;EACrB,SAAS,CAAC,EAAE,OAAO,OAAO,YAAY,OAAO,OAAO;EACpD,WAAW;EACX,QAAQ;EACR,sBAAsB;EACtB,gBAAgB;EAChB,oBAAoB;EACpB,iBAAiB;EACjB,6BAA6B;EAC9B,CAAC;AAIF,QAAO,EACL,mBAHwB,MAAM,MAI/B"}
1
+ {"version":3,"file":"useOAuth2.mjs","names":["configuration","defaultConfiguration"],"sources":["../../../../src/hooks/useAuth/useOAuth2.ts"],"sourcesContent":["'use client';\n\nimport { getOAuthAPI } from '@intlayer/api';\nimport { default as defaultConfiguration } from '@intlayer/config/built';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { useQuery } from '@tanstack/react-query';\n\nexport const useOAuth2 = (intlayerConfiguration?: IntlayerConfig) => {\n const configuration = useConfiguration();\n const config = intlayerConfiguration ?? configuration ?? defaultConfiguration;\n const intlayerAPI = getOAuthAPI(config);\n\n const { data } = useQuery({\n queryKey: ['oAuth2AccessToken'],\n queryFn: intlayerAPI.getOAuth2AccessToken,\n enabled: !!(config.editor.clientId && config.editor.clientSecret),\n staleTime: 0,\n gcTime: 0,\n refetchOnWindowFocus: false,\n refetchOnMount: false,\n refetchOnReconnect: false,\n refetchInterval: false,\n refetchIntervalInBackground: false,\n });\n\n const oAuth2AccessToken = data?.data;\n\n return {\n oAuth2AccessToken,\n };\n};\n"],"mappings":";;;;;;;;AAQA,MAAa,aAAa,0BAA2C;CACnE,MAAMA,kBAAgB,kBAAkB;CACxC,MAAM,SAAS,yBAAyBA,mBAAiBC;CAGzD,MAAM,EAAE,SAAS,SAAS;EACxB,UAAU,CAAC,oBAAoB;EAC/B,SAJkB,YAAY,OAIV,CAAC;EACrB,SAAS,CAAC,EAAE,OAAO,OAAO,YAAY,OAAO,OAAO;EACpD,WAAW;EACX,QAAQ;EACR,sBAAsB;EACtB,gBAAgB;EAChB,oBAAoB;EACpB,iBAAiB;EACjB,6BAA6B;EAC9B,CAAC;AAIF,QAAO,EACL,mBAHwB,MAAM,MAI/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"useSession.mjs","names":["configuration","defaultConfiguration"],"sources":["../../../../src/hooks/useAuth/useSession.ts"],"sourcesContent":["'use client';\n\nimport { useQueryClient } from '@hooks/reactQuery';\nimport type { SessionAPI } from '@intlayer/backend';\nimport { default as defaultConfiguration } from '@intlayer/config/built';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { getAuthAPI } from '@libs/auth';\nimport { useQuery } from '@tanstack/react-query';\n\nexport type UseSessionResult = {\n /** The current session: `undefined` while loading, `null` if fetched and no session, otherwise the session. */\n session: SessionAPI | null | undefined;\n /** Refetches the session and returns it (undefined while loading). */\n fetchSession: () => Promise<SessionAPI | null | undefined>;\n /** Alias of `fetchSession` for ergonomics. */\n revalidateSession: () => Promise<SessionAPI | null | undefined>;\n /** Manually set the session cache. */\n setSession: (nextSession: SessionAPI | null) => void;\n};\n\nexport const useSession = (\n sessionProp?: SessionAPI | null,\n intlayerConfiguration?: IntlayerConfig\n): UseSessionResult => {\n const configuration = useConfiguration();\n const config = (intlayerConfiguration ??\n configuration ??\n defaultConfiguration) as IntlayerConfig;\n\n const queryClient = useQueryClient();\n\n // Keep TanStack generics internal so they don't leak into the d.ts\n const { data, isFetched, refetch } = useQuery({\n queryKey: ['session'],\n queryFn: async () => {\n const intlayerAPI = getAuthAPI(config);\n const result = await intlayerAPI.getSession();\n // Narrow to the public shape we want to expose\n return result.data as unknown as SessionAPI;\n },\n // Session data rarely changes during navigation, so keep it fresh for 1 minute\n // This prevents unnecessary refetches when navigating between pages\n staleTime: 60 * 1000,\n gcTime: 5 * 60 * 1000,\n // Only refetch if data is stale (not on every mount)\n refetchOnMount: true,\n refetchOnWindowFocus: false,\n refetchOnReconnect: false,\n enabled: !sessionProp,\n });\n\n const session = data ?? (isFetched ? null : undefined);\n\n const setSession = (nextSession: SessionAPI | null) => {\n queryClient.setQueryData(['session'], nextSession);\n };\n\n const fetchSession = async (): Promise<SessionAPI | null | undefined> => {\n const res = await refetch();\n return res.data as SessionAPI | null | undefined;\n };\n\n const revalidateSession = fetchSession;\n\n return {\n session,\n fetchSession,\n revalidateSession,\n setSession,\n };\n};\n"],"mappings":";;;;;;;;;AAqBA,MAAa,cACX,aACA,0BACqB;CACrB,MAAMA,kBAAgB,kBAAkB;CACxC,MAAM,SAAU,yBACdA,mBACAC;CAEF,MAAM,cAAc,gBAAgB;CAGpC,MAAM,EAAE,MAAM,WAAW,YAAY,SAAS;EAC5C,UAAU,CAAC,UAAU;EACrB,SAAS,YAAY;AAInB,WAFe,MADK,WAAW,OAAO,CACL,YAAY,EAE/B;;EAIhB,WAAW,KAAK;EAChB,QAAQ,MAAS;EAEjB,gBAAgB;EAChB,sBAAsB;EACtB,oBAAoB;EACpB,SAAS,CAAC;EACX,CAAC;CAEF,MAAM,UAAU,SAAS,YAAY,OAAO;CAE5C,MAAM,cAAc,gBAAmC;AACrD,cAAY,aAAa,CAAC,UAAU,EAAE,YAAY;;CAGpD,MAAM,eAAe,YAAoD;AAEvE,UADY,MAAM,SAAS,EAChB;;AAKb,QAAO;EACL;EACA;EACA,mBALwB;EAMxB;EACD"}
1
+ {"version":3,"file":"useSession.mjs","names":["configuration","defaultConfiguration"],"sources":["../../../../src/hooks/useAuth/useSession.ts"],"sourcesContent":["'use client';\n\nimport { useQueryClient } from '@hooks/reactQuery';\nimport type { SessionAPI } from '@intlayer/backend';\nimport { default as defaultConfiguration } from '@intlayer/config/built';\nimport { useConfiguration } from '@intlayer/editor-react';\nimport type { IntlayerConfig } from '@intlayer/types/config';\nimport { getAuthAPI } from '@libs/auth';\nimport { useQuery } from '@tanstack/react-query';\n\nexport type UseSessionResult = {\n /** The current session: `undefined` while loading, `null` if fetched and no session, otherwise the session. */\n session: SessionAPI | null | undefined;\n /** Refetches the session and returns it (undefined while loading). */\n fetchSession: () => Promise<SessionAPI | null | undefined>;\n /** Alias of `fetchSession` for ergonomics. */\n revalidateSession: () => Promise<SessionAPI | null | undefined>;\n /** Manually set the session cache. */\n setSession: (nextSession: SessionAPI | null) => void;\n};\n\nexport const useSession = (\n sessionProp?: SessionAPI | null,\n intlayerConfiguration?: IntlayerConfig\n): UseSessionResult => {\n const configuration = useConfiguration();\n const config = (intlayerConfiguration ??\n configuration ??\n defaultConfiguration) as IntlayerConfig;\n\n const queryClient = useQueryClient();\n\n // Keep TanStack generics internal so they don't leak into the d.ts\n const { data, isFetched, refetch } = useQuery({\n queryKey: ['session'],\n queryFn: async () => {\n const intlayerAPI = getAuthAPI(config);\n const result = await intlayerAPI.getSession();\n // Narrow to the public shape we want to expose\n return result.data as unknown as SessionAPI;\n },\n // Session data rarely changes during navigation, so keep it fresh for 1 minute\n // This prevents unnecessary refetches when navigating between pages\n staleTime: 60 * 1000,\n gcTime: 5 * 60 * 1000,\n // Only refetch if data is stale (not on every mount)\n refetchOnMount: true,\n refetchOnWindowFocus: false,\n refetchOnReconnect: false,\n enabled: !sessionProp,\n });\n\n const session = data ?? (isFetched ? null : undefined);\n\n const setSession = (nextSession: SessionAPI | null) => {\n queryClient.setQueryData(['session'], nextSession);\n };\n\n const fetchSession = async (): Promise<SessionAPI | null | undefined> => {\n const res = await refetch();\n return res.data as SessionAPI | null | undefined;\n };\n\n const revalidateSession = fetchSession;\n\n return {\n session,\n fetchSession,\n revalidateSession,\n setSession,\n };\n};\n"],"mappings":";;;;;;;;;AAqBA,MAAa,cACX,aACA,0BACqB;CACrB,MAAMA,kBAAgB,kBAAkB;CACxC,MAAM,SAAU,yBACdA,mBACAC;CAEF,MAAM,cAAc,gBAAgB;CAGpC,MAAM,EAAE,MAAM,WAAW,YAAY,SAAS;EAC5C,UAAU,CAAC,UAAU;EACrB,SAAS,YAAY;AAInB,WAAO,MAHa,WAAW,OACC,CAAC,YAAY,EAE/B;;EAIhB,WAAW,KAAK;EAChB,QAAQ,MAAS;EAEjB,gBAAgB;EAChB,sBAAsB;EACtB,oBAAoB;EACpB,SAAS,CAAC;EACX,CAAC;CAEF,MAAM,UAAU,SAAS,YAAY,OAAO;CAE5C,MAAM,cAAc,gBAAmC;AACrD,cAAY,aAAa,CAAC,UAAU,EAAE,YAAY;;CAGpD,MAAM,eAAe,YAAoD;AAEvE,UAAO,MADW,SAAS,EAChB;;AAKb,QAAO;EACL;EACA;EACA;EACA;EACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"useDevice.mjs","names":[],"sources":["../../../src/hooks/useDevice.ts"],"sourcesContent":["'use client';\n\nimport { useEffect, useState } from 'react';\n\nexport type SizeType = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\nexport const getBreakpointFromSize = (breakpoint: SizeType | number) => {\n switch (breakpoint) {\n case 'xs':\n return 480;\n case 'sm':\n return 640;\n case 'md':\n return 768;\n case 'lg':\n return 1024;\n case 'xl':\n return 1280;\n case '2xl':\n return 1536;\n default:\n return breakpoint;\n }\n};\n\nexport const checkIsMobileUserAgent = (): boolean | undefined => {\n if (typeof window === 'undefined') return;\n\n const userAgent = window.navigator?.userAgent;\n\n if (typeof userAgent === 'undefined') return;\n\n return /android|bb\\d+|meego|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(?:hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(?:ob|in)i|palm(?: os)?|phone|p(?:ixi|re)\\/|plucker|pocket|psp|series(?:4|6)0|symbian|treo|up\\.(?:browser|link)|vodafone|wap|windows ce|windows phone|xda|xiino|zte-/i.test(\n userAgent\n );\n};\n\nexport const checkIsIphoneOrSafariDevice = (): boolean | undefined => {\n if (typeof window === 'undefined') return;\n\n const userAgent = window.navigator?.userAgent;\n\n /* 1 . is it Safari? (Chrome & co. also contain “Safari/…”, so exclude them) */\n const isSafari =\n /Safari\\/\\d/i.test(userAgent) && // has “Safari/xxx”\n !/Chrome|CriOS|FxiOS|Edg|OPR/i.test(userAgent); // …but not the other browsers\n\n /* 2. is it an Apple device? (macOS or iOS/iPadOS) */\n const isAppleDevice = /Macintosh|iP(?:hone|ad|od)/.test(userAgent);\n\n return isSafari && isAppleDevice; // true for mac-Safari & iOS-Safari\n};\n\nexport const checkIsIOS = (): boolean | undefined => {\n if (typeof window === 'undefined') return;\n\n const userAgent = window.navigator?.userAgent;\n\n if (typeof userAgent === 'undefined') return;\n\n // Check for iOS devices: iPhone, iPad, iPod\n return /iP(?:hone|ad|od)/.test(userAgent);\n};\n\nexport const checkIsMac = (): boolean | undefined => {\n if (typeof window === 'undefined') return;\n\n const userAgent = window.navigator?.userAgent;\n\n if (typeof userAgent === 'undefined') return;\n\n // Check for macOS/Mac devices\n return /Macintosh|MacIntel|Mac OS X/.test(userAgent);\n};\n\nexport const checkIsMobileScreen = (\n breakpoint: number\n): boolean | undefined => {\n if (typeof window === 'undefined') return;\n\n return (window?.innerWidth ?? 0) <= breakpoint;\n};\n\ntype UseDeviceState = {\n isMobileScreen: boolean | undefined;\n isMobileUserAgent: boolean | undefined;\n isMobile: boolean | undefined;\n isIOS: boolean | undefined;\n isMac: boolean | undefined;\n};\n\nexport const calculateIsMobile = (breakpoint: SizeType | number = 'md') => {\n const breakpointValue = getBreakpointFromSize(breakpoint);\n\n const isMobileUserAgent = checkIsMobileUserAgent();\n const isMobileScreen = checkIsMobileScreen(breakpointValue);\n const isMobile = isMobileScreen ?? isMobileUserAgent;\n const isIOS = checkIsIOS();\n const isMac = checkIsMac();\n\n return {\n isMobileScreen, // Is the screen width within a mobile breakpoint.\n isMobileUserAgent, // Is the user agent indicative of a mobile device.\n isMobile, // Combines both checks to determine if the device is mobile.\n isIOS, // Is the device running iOS (iPhone, iPad, iPod).\n isMac, // Is the device a Mac computer (macOS).\n };\n};\n\nexport const useDevice = (breakpoint: SizeType | number = 'md') => {\n const [result, setResult] = useState<UseDeviceState>(\n calculateIsMobile(breakpoint)\n );\n\n useEffect(() => {\n const handleResize = () => {\n setResult(calculateIsMobile(breakpoint));\n };\n\n window.addEventListener('resize', handleResize, { passive: true });\n\n // Cleanup listener on unmount\n return () => window.removeEventListener('resize', handleResize);\n }, [breakpoint]); // Empty dependency array ensures this effect runs only once on mount\n\n return result;\n};\n"],"mappings":";;;;;AAMA,MAAa,yBAAyB,eAAkC;AACtE,SAAQ,YAAR;EACE,KAAK,KACH,QAAO;EACT,KAAK,KACH,QAAO;EACT,KAAK,KACH,QAAO;EACT,KAAK,KACH,QAAO;EACT,KAAK,KACH,QAAO;EACT,KAAK,MACH,QAAO;EACT,QACE,QAAO;;;AAIb,MAAa,+BAAoD;AAC/D,KAAI,OAAO,WAAW,YAAa;CAEnC,MAAM,YAAY,OAAO,WAAW;AAEpC,KAAI,OAAO,cAAc,YAAa;AAEtC,QAAO,mVAAmV,KACxV,UACD;;AAGH,MAAa,oCAAyD;AACpE,KAAI,OAAO,WAAW,YAAa;CAEnC,MAAM,YAAY,OAAO,WAAW;CAGpC,MAAM,WACJ,cAAc,KAAK,UAAU,IAC7B,CAAC,8BAA8B,KAAK,UAAU;CAGhD,MAAM,gBAAgB,6BAA6B,KAAK,UAAU;AAElE,QAAO,YAAY;;AAGrB,MAAa,mBAAwC;AACnD,KAAI,OAAO,WAAW,YAAa;CAEnC,MAAM,YAAY,OAAO,WAAW;AAEpC,KAAI,OAAO,cAAc,YAAa;AAGtC,QAAO,mBAAmB,KAAK,UAAU;;AAG3C,MAAa,mBAAwC;AACnD,KAAI,OAAO,WAAW,YAAa;CAEnC,MAAM,YAAY,OAAO,WAAW;AAEpC,KAAI,OAAO,cAAc,YAAa;AAGtC,QAAO,8BAA8B,KAAK,UAAU;;AAGtD,MAAa,uBACX,eACwB;AACxB,KAAI,OAAO,WAAW,YAAa;AAEnC,SAAQ,QAAQ,cAAc,MAAM;;AAWtC,MAAa,qBAAqB,aAAgC,SAAS;CACzE,MAAM,kBAAkB,sBAAsB,WAAW;CAEzD,MAAM,oBAAoB,wBAAwB;CAClD,MAAM,iBAAiB,oBAAoB,gBAAgB;AAK3D,QAAO;EACL;EACA;EACA,UAPe,kBAAkB;EAQjC,OAPY,YAAY;EAQxB,OAPY,YAAY;EAQzB;;AAGH,MAAa,aAAa,aAAgC,SAAS;CACjE,MAAM,CAAC,QAAQ,aAAa,SAC1B,kBAAkB,WAAW,CAC9B;AAED,iBAAgB;EACd,MAAM,qBAAqB;AACzB,aAAU,kBAAkB,WAAW,CAAC;;AAG1C,SAAO,iBAAiB,UAAU,cAAc,EAAE,SAAS,MAAM,CAAC;AAGlE,eAAa,OAAO,oBAAoB,UAAU,aAAa;IAC9D,CAAC,WAAW,CAAC;AAEhB,QAAO"}
1
+ {"version":3,"file":"useDevice.mjs","names":[],"sources":["../../../src/hooks/useDevice.ts"],"sourcesContent":["'use client';\n\nimport { useEffect, useState } from 'react';\n\nexport type SizeType = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl';\n\nexport const getBreakpointFromSize = (breakpoint: SizeType | number) => {\n switch (breakpoint) {\n case 'xs':\n return 480;\n case 'sm':\n return 640;\n case 'md':\n return 768;\n case 'lg':\n return 1024;\n case 'xl':\n return 1280;\n case '2xl':\n return 1536;\n default:\n return breakpoint;\n }\n};\n\nexport const checkIsMobileUserAgent = (): boolean | undefined => {\n if (typeof window === 'undefined') return;\n\n const userAgent = window.navigator?.userAgent;\n\n if (typeof userAgent === 'undefined') return;\n\n return /android|bb\\d+|meego|avantgo|bada\\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(?:hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(?:ob|in)i|palm(?: os)?|phone|p(?:ixi|re)\\/|plucker|pocket|psp|series(?:4|6)0|symbian|treo|up\\.(?:browser|link)|vodafone|wap|windows ce|windows phone|xda|xiino|zte-/i.test(\n userAgent\n );\n};\n\nexport const checkIsIphoneOrSafariDevice = (): boolean | undefined => {\n if (typeof window === 'undefined') return;\n\n const userAgent = window.navigator?.userAgent;\n\n /* 1 . is it Safari? (Chrome & co. also contain “Safari/…”, so exclude them) */\n const isSafari =\n /Safari\\/\\d/i.test(userAgent) && // has “Safari/xxx”\n !/Chrome|CriOS|FxiOS|Edg|OPR/i.test(userAgent); // …but not the other browsers\n\n /* 2. is it an Apple device? (macOS or iOS/iPadOS) */\n const isAppleDevice = /Macintosh|iP(?:hone|ad|od)/.test(userAgent);\n\n return isSafari && isAppleDevice; // true for mac-Safari & iOS-Safari\n};\n\nexport const checkIsIOS = (): boolean | undefined => {\n if (typeof window === 'undefined') return;\n\n const userAgent = window.navigator?.userAgent;\n\n if (typeof userAgent === 'undefined') return;\n\n // Check for iOS devices: iPhone, iPad, iPod\n return /iP(?:hone|ad|od)/.test(userAgent);\n};\n\nexport const checkIsMac = (): boolean | undefined => {\n if (typeof window === 'undefined') return;\n\n const userAgent = window.navigator?.userAgent;\n\n if (typeof userAgent === 'undefined') return;\n\n // Check for macOS/Mac devices\n return /Macintosh|MacIntel|Mac OS X/.test(userAgent);\n};\n\nexport const checkIsMobileScreen = (\n breakpoint: number\n): boolean | undefined => {\n if (typeof window === 'undefined') return;\n\n return (window?.innerWidth ?? 0) <= breakpoint;\n};\n\ntype UseDeviceState = {\n isMobileScreen: boolean | undefined;\n isMobileUserAgent: boolean | undefined;\n isMobile: boolean | undefined;\n isIOS: boolean | undefined;\n isMac: boolean | undefined;\n};\n\nexport const calculateIsMobile = (breakpoint: SizeType | number = 'md') => {\n const breakpointValue = getBreakpointFromSize(breakpoint);\n\n const isMobileUserAgent = checkIsMobileUserAgent();\n const isMobileScreen = checkIsMobileScreen(breakpointValue);\n const isMobile = isMobileScreen ?? isMobileUserAgent;\n const isIOS = checkIsIOS();\n const isMac = checkIsMac();\n\n return {\n isMobileScreen, // Is the screen width within a mobile breakpoint.\n isMobileUserAgent, // Is the user agent indicative of a mobile device.\n isMobile, // Combines both checks to determine if the device is mobile.\n isIOS, // Is the device running iOS (iPhone, iPad, iPod).\n isMac, // Is the device a Mac computer (macOS).\n };\n};\n\nexport const useDevice = (breakpoint: SizeType | number = 'md') => {\n const [result, setResult] = useState<UseDeviceState>(\n calculateIsMobile(breakpoint)\n );\n\n useEffect(() => {\n const handleResize = () => {\n setResult(calculateIsMobile(breakpoint));\n };\n\n window.addEventListener('resize', handleResize, { passive: true });\n\n // Cleanup listener on unmount\n return () => window.removeEventListener('resize', handleResize);\n }, [breakpoint]); // Empty dependency array ensures this effect runs only once on mount\n\n return result;\n};\n"],"mappings":";;;;;AAMA,MAAa,yBAAyB,eAAkC;AACtE,SAAQ,YAAR;EACE,KAAK,KACH,QAAO;EACT,KAAK,KACH,QAAO;EACT,KAAK,KACH,QAAO;EACT,KAAK,KACH,QAAO;EACT,KAAK,KACH,QAAO;EACT,KAAK,MACH,QAAO;EACT,QACE,QAAO;;;AAIb,MAAa,+BAAoD;AA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