@lobehub/ui 5.24.0 → 5.26.0

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 (171) hide show
  1. package/es/A/index.mjs +2 -1
  2. package/es/A/index.mjs.map +1 -1
  3. package/es/Accordion/AccordionItem.mjs +0 -1
  4. package/es/Accordion/AccordionItem.mjs.map +1 -1
  5. package/es/ActionIcon/components/utils.mjs +7 -9
  6. package/es/ActionIcon/components/utils.mjs.map +1 -1
  7. package/es/Checkbox/CheckboxGroup.mjs +4 -2
  8. package/es/Checkbox/CheckboxGroup.mjs.map +1 -1
  9. package/es/CodeDiff/CodeDiff.mjs +20 -18
  10. package/es/CodeDiff/CodeDiff.mjs.map +1 -1
  11. package/es/CodeDiff/PatchDiff.mjs +18 -16
  12. package/es/CodeDiff/PatchDiff.mjs.map +1 -1
  13. package/es/CopyButton/CopyButton.mjs +2 -1
  14. package/es/CopyButton/CopyButton.mjs.map +1 -1
  15. package/es/Highlighter/LangSelect.mjs +41 -40
  16. package/es/Highlighter/LangSelect.mjs.map +1 -1
  17. package/es/Highlighter/SyntaxHighlighter/StaticRenderer.mjs +2 -1
  18. package/es/Highlighter/SyntaxHighlighter/StaticRenderer.mjs.map +1 -1
  19. package/es/HotkeyInput/HotkeyInput.mjs +3 -1
  20. package/es/HotkeyInput/HotkeyInput.mjs.map +1 -1
  21. package/es/HtmlPreview/const.mjs +1 -1
  22. package/es/HtmlPreview/const.mjs.map +1 -1
  23. package/es/Icon/components/utils.mjs +7 -9
  24. package/es/Icon/components/utils.mjs.map +1 -1
  25. package/es/Image/Image.mjs +138 -37
  26. package/es/Image/Image.mjs.map +1 -1
  27. package/es/Image/PreviewGroup.d.mts +1 -0
  28. package/es/Image/PreviewGroup.mjs +33 -10
  29. package/es/Image/PreviewGroup.mjs.map +1 -1
  30. package/es/Image/index.d.mts +2 -2
  31. package/es/Image/index.mjs +1 -1
  32. package/es/Image/style.mjs +126 -71
  33. package/es/Image/style.mjs.map +1 -1
  34. package/es/Image/type.d.mts +14 -17
  35. package/es/Image/viewer/GalleryNav.mjs +44 -0
  36. package/es/Image/viewer/GalleryNav.mjs.map +1 -0
  37. package/es/Image/viewer/ImageViewer.mjs +275 -0
  38. package/es/Image/viewer/ImageViewer.mjs.map +1 -0
  39. package/es/Image/viewer/PreviewOutlet.mjs +19 -0
  40. package/es/Image/viewer/PreviewOutlet.mjs.map +1 -0
  41. package/es/Image/viewer/Toolbar.mjs +184 -0
  42. package/es/Image/viewer/Toolbar.mjs.map +1 -0
  43. package/es/Image/viewer/ViewerChrome.mjs +54 -0
  44. package/es/Image/viewer/ViewerChrome.mjs.map +1 -0
  45. package/es/Image/viewer/geometry.mjs +85 -0
  46. package/es/Image/viewer/geometry.mjs.map +1 -0
  47. package/es/Image/viewer/registry.d.mts +2 -0
  48. package/es/Image/viewer/registry.mjs +52 -0
  49. package/es/Image/viewer/registry.mjs.map +1 -0
  50. package/es/Image/viewer/useChromeIdle.mjs +72 -0
  51. package/es/Image/viewer/useChromeIdle.mjs.map +1 -0
  52. package/es/Image/viewer/useFinalFocus.mjs +10 -0
  53. package/es/Image/viewer/useFinalFocus.mjs.map +1 -0
  54. package/es/Image/viewer/useFlipTransition.mjs +321 -0
  55. package/es/Image/viewer/useFlipTransition.mjs.map +1 -0
  56. package/es/Image/viewer/useGalleryNav.mjs +89 -0
  57. package/es/Image/viewer/useGalleryNav.mjs.map +1 -0
  58. package/es/Image/viewer/useRefitTransition.mjs +47 -0
  59. package/es/Image/viewer/useRefitTransition.mjs.map +1 -0
  60. package/es/Image/viewer/useViewerGestures.mjs +148 -0
  61. package/es/Image/viewer/useViewerGestures.mjs.map +1 -0
  62. package/es/Image/viewer/useZoomPan.mjs +346 -0
  63. package/es/Image/viewer/useZoomPan.mjs.map +1 -0
  64. package/es/Img/index.mjs +2 -1
  65. package/es/Img/index.mjs.map +1 -1
  66. package/es/Markdown/SyntaxMarkdown/StreamdownRender.mjs +2 -1
  67. package/es/Markdown/SyntaxMarkdown/StreamdownRender.mjs.map +1 -1
  68. package/es/Markdown/SyntaxMarkdown/useSmoothStreamContent.mjs +2 -2
  69. package/es/Markdown/SyntaxMarkdown/useSmoothStreamContent.mjs.map +1 -1
  70. package/es/Modal/RawModalStackItem.mjs +6 -5
  71. package/es/Modal/RawModalStackItem.mjs.map +1 -1
  72. package/es/Modal/imperative.mjs +4 -2
  73. package/es/Modal/imperative.mjs.map +1 -1
  74. package/es/NeuralNetworkLoading/NeuralNetworkLoading.mjs +1 -1
  75. package/es/NeuralNetworkLoading/NeuralNetworkLoading.mjs.map +1 -1
  76. package/es/ScrollShadow/ScrollShadow.mjs +13 -12
  77. package/es/ScrollShadow/ScrollShadow.mjs.map +1 -1
  78. package/es/Skeleton/SkeletonButton.mjs +2 -1
  79. package/es/Skeleton/SkeletonButton.mjs.map +1 -1
  80. package/es/SortableList/SortableList.mjs +5 -1
  81. package/es/SortableList/SortableList.mjs.map +1 -1
  82. package/es/Text/Text.mjs +22 -21
  83. package/es/Text/Text.mjs.map +1 -1
  84. package/es/ThemeProvider/ThemeProvider.mjs +3 -2
  85. package/es/ThemeProvider/ThemeProvider.mjs.map +1 -1
  86. package/es/awesome/GradientButton/GradientButton.mjs +1 -3
  87. package/es/awesome/GradientButton/GradientButton.mjs.map +1 -1
  88. package/es/awesome/Spotlight/Spotlight.mjs +2 -1
  89. package/es/awesome/Spotlight/Spotlight.mjs.map +1 -1
  90. package/es/base-ui/Button/Button.mjs +13 -11
  91. package/es/base-ui/Button/Button.mjs.map +1 -1
  92. package/es/base-ui/Button/SplitButton.mjs +2 -1
  93. package/es/base-ui/Button/SplitButton.mjs.map +1 -1
  94. package/es/base-ui/ContextMenu/ContextMenuTrigger.mjs +2 -1
  95. package/es/base-ui/ContextMenu/ContextMenuTrigger.mjs.map +1 -1
  96. package/es/base-ui/ContextMenu/renderItems.mjs +2 -1
  97. package/es/base-ui/ContextMenu/renderItems.mjs.map +1 -1
  98. package/es/base-ui/Drawer/Drawer.d.mts +6 -0
  99. package/es/base-ui/Drawer/Drawer.mjs +152 -0
  100. package/es/base-ui/Drawer/Drawer.mjs.map +1 -0
  101. package/es/base-ui/Drawer/DrawerLayerContext.mjs +10 -0
  102. package/es/base-ui/Drawer/DrawerLayerContext.mjs.map +1 -0
  103. package/es/base-ui/Drawer/DrawerPushContext.mjs +27 -0
  104. package/es/base-ui/Drawer/DrawerPushContext.mjs.map +1 -0
  105. package/es/base-ui/Drawer/atoms.d.mts +58 -0
  106. package/es/base-ui/Drawer/atoms.mjs +262 -0
  107. package/es/base-ui/Drawer/atoms.mjs.map +1 -0
  108. package/es/base-ui/Drawer/constants.d.mts +17 -0
  109. package/es/base-ui/Drawer/constants.mjs +72 -0
  110. package/es/base-ui/Drawer/constants.mjs.map +1 -0
  111. package/es/base-ui/Drawer/index.d.mts +5 -0
  112. package/es/base-ui/Drawer/style.mjs +295 -0
  113. package/es/base-ui/Drawer/style.mjs.map +1 -0
  114. package/es/base-ui/Drawer/type.d.mts +65 -0
  115. package/es/base-ui/DropdownMenu/DropdownMenu.mjs +2 -1
  116. package/es/base-ui/DropdownMenu/DropdownMenu.mjs.map +1 -1
  117. package/es/base-ui/DropdownMenu/atoms.mjs +2 -1
  118. package/es/base-ui/DropdownMenu/atoms.mjs.map +1 -1
  119. package/es/base-ui/DropdownMenu/renderItems.mjs +2 -1
  120. package/es/base-ui/DropdownMenu/renderItems.mjs.map +1 -1
  121. package/es/base-ui/FloatingSheet/FloatingSheet.mjs +4 -1
  122. package/es/base-ui/FloatingSheet/FloatingSheet.mjs.map +1 -1
  123. package/es/base-ui/Input/style.d.mts +1 -1
  124. package/es/base-ui/Modal/atoms.mjs +7 -5
  125. package/es/base-ui/Modal/atoms.mjs.map +1 -1
  126. package/es/base-ui/Modal/imperative.mjs +2 -1
  127. package/es/base-ui/Modal/imperative.mjs.map +1 -1
  128. package/es/base-ui/Popover/atoms.mjs +2 -1
  129. package/es/base-ui/Popover/atoms.mjs.map +1 -1
  130. package/es/base-ui/Popover/context.mjs +4 -2
  131. package/es/base-ui/Popover/context.mjs.map +1 -1
  132. package/es/base-ui/Select/atoms.mjs +2 -1
  133. package/es/base-ui/Select/atoms.mjs.map +1 -1
  134. package/es/base-ui/Toast/hostGuard.mjs +26 -0
  135. package/es/base-ui/Toast/hostGuard.mjs.map +1 -0
  136. package/es/base-ui/Toast/imperative.mjs +43 -20
  137. package/es/base-ui/Toast/imperative.mjs.map +1 -1
  138. package/es/base-ui/Toast/pendingQueue.mjs +30 -0
  139. package/es/base-ui/Toast/pendingQueue.mjs.map +1 -0
  140. package/es/base-ui/index.d.mts +6 -1
  141. package/es/base-ui/index.mjs +5 -2
  142. package/es/brand/LobeChat/index.mjs +0 -1
  143. package/es/brand/LobeChat/index.mjs.map +1 -1
  144. package/es/brand/LobeHub/index.mjs +0 -1
  145. package/es/brand/LobeHub/index.mjs.map +1 -1
  146. package/es/brand/Logo3d/index.mjs +2 -1
  147. package/es/brand/Logo3d/index.mjs.map +1 -1
  148. package/es/chat/ChatItem/components/Actions.mjs +5 -4
  149. package/es/chat/ChatItem/components/Actions.mjs.map +1 -1
  150. package/es/chat/ChatList/ChatList.mjs +2 -1
  151. package/es/chat/ChatList/ChatList.mjs.map +1 -1
  152. package/es/color/ColorScales/ScaleRow.mjs +0 -2
  153. package/es/color/ColorScales/ScaleRow.mjs.map +1 -1
  154. package/es/hooks/useMermaid.mjs +2 -1
  155. package/es/hooks/useMermaid.mjs.map +1 -1
  156. package/es/i18n/resources/en/image.d.mts +5 -0
  157. package/es/i18n/resources/en/image.mjs +6 -1
  158. package/es/i18n/resources/en/image.mjs.map +1 -1
  159. package/es/i18n/resources/zhCn/image.d.mts +5 -0
  160. package/es/i18n/resources/zhCn/image.mjs +6 -1
  161. package/es/i18n/resources/zhCn/image.mjs.map +1 -1
  162. package/es/index.mjs +8 -8
  163. package/package.json +1 -1
  164. package/es/Image/components/Preview.mjs +0 -23
  165. package/es/Image/components/Preview.mjs.map +0 -1
  166. package/es/Image/components/Toolbar.mjs +0 -128
  167. package/es/Image/components/Toolbar.mjs.map +0 -1
  168. package/es/Image/components/usePreview.mjs +0 -58
  169. package/es/Image/components/usePreview.mjs.map +0 -1
  170. package/es/Image/components/usePreviewGroup.mjs +0 -57
  171. package/es/Image/components/usePreviewGroup.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"imperative.mjs","names":["BaseToast"],"sources":["../../../src/base-ui/Toast/imperative.tsx"],"sourcesContent":["'use client';\n\nimport { Toast as BaseToast } from '@base-ui/react/toast';\nimport { cx } from 'antd-style';\nimport { memo, useEffect, useState } from 'react';\n\nimport { useIsClient } from '@/hooks/useIsClient';\nimport { useAppElement } from '@/ThemeProvider';\n\nimport { acquireLayerZIndex } from '../zIndex';\nimport { ToastContext } from './context';\nimport { viewportVariants } from './style';\nimport ToastItem from './Toast';\nimport {\n type ToastAPI,\n type ToastInstance,\n type ToastOptions,\n type ToastPosition,\n type ToastPromiseOptions,\n type ToastType,\n} from './type';\n\n// All possible positions\nconst ALL_POSITIONS: ToastPosition[] = [\n 'top',\n 'top-left',\n 'top-right',\n 'bottom',\n 'bottom-left',\n 'bottom-right',\n];\n\n// Global state management\ninterface ToastState {\n duration: number;\n limit: number;\n position: ToastPosition;\n swipeDirection: ('left' | 'right' | 'up' | 'down') | ('left' | 'right' | 'up' | 'down')[];\n}\n\nlet globalState: ToastState = {\n duration: 5000,\n limit: 5,\n position: 'bottom-right',\n swipeDirection: ['down', 'right'],\n};\n\n// Toast managers for each position\nconst toastManagers: Record<ToastPosition, ReturnType<typeof BaseToast.createToastManager>> = {\n 'bottom': BaseToast.createToastManager(),\n 'bottom-left': BaseToast.createToastManager(),\n 'bottom-right': BaseToast.createToastManager(),\n 'top': BaseToast.createToastManager(),\n 'top-left': BaseToast.createToastManager(),\n 'top-right': BaseToast.createToastManager(),\n};\n\nconst activeToastIds: Record<ToastPosition, Set<string>> = {\n 'bottom': new Set(),\n 'bottom-left': new Set(),\n 'bottom-right': new Set(),\n 'top': new Set(),\n 'top-left': new Set(),\n 'top-right': new Set(),\n};\n\nconst getManager = (position: ToastPosition) => toastManagers[position];\n\nconst normalizeOptions = (\n optionsOrMessage: Omit<ToastOptions, 'type'> | string,\n type: ToastType,\n): ToastOptions => {\n if (typeof optionsOrMessage === 'string') {\n return {\n description: optionsOrMessage,\n type,\n };\n }\n return {\n ...optionsOrMessage,\n type,\n };\n};\n\nconst createToastInstance = (id: string, position: ToastPosition): ToastInstance => ({\n close: () => getManager(position).close(id),\n id,\n update: (options) => {\n getManager(position).update(id, {\n data: options,\n description: options.description,\n title: options.title,\n });\n },\n});\n\nconst addToast = (options: ToastOptions): ToastInstance => {\n const position = options.placement ?? globalState.position;\n const manager = getManager(position);\n const onRemove = options.onRemove;\n const id = manager.add({\n data: options,\n description: options.description,\n onClose: options.onClose,\n onRemove: () => {\n activeToastIds[position].delete(id);\n onRemove?.();\n },\n timeout: options.duration ?? globalState.duration,\n title: options.title,\n });\n activeToastIds[position].add(id);\n return createToastInstance(id, position);\n};\n\nconst dismissToast = (id?: string) => {\n if (id) {\n // Try to close from all managers since we don't know which position the toast is in\n for (const [position, manager] of Object.entries(toastManagers)) {\n activeToastIds[position as ToastPosition].delete(id);\n manager.close(id);\n }\n } else {\n // Clear all toasts\n for (const [position, manager] of Object.entries(toastManagers)) {\n const ids = Array.from(activeToastIds[position as ToastPosition]);\n for (const toastId of ids) {\n manager.close(toastId);\n }\n activeToastIds[position as ToastPosition].clear();\n }\n }\n};\n\nconst createSuccessToast = (\n optionsOrMessage: Omit<ToastOptions, 'type'> | string,\n): ToastInstance => {\n return addToast(normalizeOptions(optionsOrMessage, 'success'));\n};\n\nconst createErrorToast = (optionsOrMessage: Omit<ToastOptions, 'type'> | string): ToastInstance => {\n return addToast(normalizeOptions(optionsOrMessage, 'error'));\n};\n\nconst createInfoToast = (optionsOrMessage: Omit<ToastOptions, 'type'> | string): ToastInstance => {\n return addToast(normalizeOptions(optionsOrMessage, 'info'));\n};\n\nconst createWarningToast = (\n optionsOrMessage: Omit<ToastOptions, 'type'> | string,\n): ToastInstance => {\n return addToast(normalizeOptions(optionsOrMessage, 'warning'));\n};\n\nconst createLoadingToast = (\n optionsOrMessage: Omit<ToastOptions, 'type'> | string,\n): ToastInstance => {\n const options = normalizeOptions(optionsOrMessage, 'loading');\n // Loading toasts don't auto-dismiss by default\n return addToast({ duration: 0, ...options });\n};\n\nasync function promiseToast<T>(promise: Promise<T>, options: ToastPromiseOptions<T>): Promise<T> {\n const loadingOptions =\n typeof options.loading === 'string'\n ? { description: options.loading }\n : (options.loading as ToastOptions);\n\n const loadingToast = addToast({\n closable: false,\n duration: 0,\n type: 'loading',\n ...loadingOptions,\n });\n\n try {\n const result = await promise;\n\n loadingToast.close();\n\n const successOptions = (() => {\n if (typeof options.success === 'string') {\n return { description: options.success };\n }\n if (typeof options.success === 'function') {\n return { description: options.success(result) };\n }\n return options.success as ToastOptions;\n })();\n\n addToast({ type: 'success', ...successOptions });\n\n return result;\n } catch (error) {\n loadingToast.close();\n\n const errorOptions = (() => {\n if (typeof options.error === 'string') {\n return { description: options.error };\n }\n if (typeof options.error === 'function') {\n return { description: options.error(error as Error) };\n }\n return options.error as ToastOptions;\n })();\n\n addToast({ type: 'error', ...errorOptions });\n\n throw error;\n }\n}\n\n// Base toast function\nconst baseToast = (options: ToastOptions): ToastInstance => {\n return addToast({ type: 'default', ...options });\n};\n\n// Toast API\nexport const toast: ToastAPI = Object.assign(baseToast, {\n dismiss: dismissToast,\n error: createErrorToast,\n info: createInfoToast,\n loading: createLoadingToast,\n promise: promiseToast,\n success: createSuccessToast,\n warning: createWarningToast,\n});\n\n// Toast List Component\nconst ToastList = memo(() => {\n const { toasts } = BaseToast.useToastManager();\n return toasts.map((t) => <ToastItem key={t.id} toast={t} />);\n});\n\nToastList.displayName = 'ToastList';\n\nexport interface ToastHostProps {\n className?: string;\n /**\n * Default duration for toasts\n * @default 5000\n */\n duration?: number;\n /**\n * Maximum number of toasts\n * @default 5\n */\n limit?: number;\n /**\n * Toast position\n * @default 'bottom-right'\n */\n position?: ToastPosition;\n /**\n * Root element for portal\n */\n root?: HTMLElement | ShadowRoot | null;\n /**\n * Swipe direction to dismiss\n * @default ['down', 'right']\n */\n swipeDirection?: ('left' | 'right' | 'up' | 'down') | ('left' | 'right' | 'up' | 'down')[];\n}\n\nexport const ToastHost = memo(\n ({\n root,\n className,\n duration = 5000,\n limit = 5,\n position = 'bottom-right',\n swipeDirection = ['down', 'right'],\n }: ToastHostProps) => {\n const isClient = useIsClient();\n const appElement = useAppElement();\n const [viewportZIndex, setViewportZIndex] = useState<number | undefined>(undefined);\n\n useEffect(() => {\n globalState = {\n duration,\n limit,\n position,\n swipeDirection,\n };\n }, [duration, limit, position, swipeDirection]);\n\n useEffect(() => {\n setViewportZIndex(acquireLayerZIndex('toast'));\n }, []);\n\n if (!isClient) return null;\n\n const container = root ?? appElement ?? document.body;\n\n return ALL_POSITIONS.map((pos) => (\n <ToastContext key={pos} value={{ position: pos, swipeDirection }}>\n <BaseToast.Provider limit={limit} timeout={duration} toastManager={getManager(pos)}>\n <BaseToast.Portal container={container}>\n <BaseToast.Viewport\n className={cx(viewportVariants({ position: pos }), className)}\n style={{ zIndex: viewportZIndex }}\n >\n <ToastList />\n </BaseToast.Viewport>\n </BaseToast.Portal>\n </BaseToast.Provider>\n </ToastContext>\n ));\n },\n);\n\nToastHost.displayName = 'ToastHost';\n\n// Hook to use toast manager\nexport const useToast = () => toast;\n"],"mappings":";;;;;;;;;;;;AAuBA,MAAM,gBAAiC;CACrC;CACA;CACA;CACA;CACA;CACA;AACF;AAUA,IAAI,cAA0B;CAC5B,UAAU;CACV,OAAO;CACP,UAAU;CACV,gBAAgB,CAAC,QAAQ,OAAO;AAClC;AAGA,MAAM,gBAAwF;CAC5F,UAAUA,MAAU,mBAAmB;CACvC,eAAeA,MAAU,mBAAmB;CAC5C,gBAAgBA,MAAU,mBAAmB;CAC7C,OAAOA,MAAU,mBAAmB;CACpC,YA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W,GAAG;GAC/E,UAAA,oBAACA,MAAU,QAAX;IAA6B;IAC3B,UAAA,oBAACA,MAAU,UAAX;KACE,WAAW,GAAG,iBAAiB,EAAE,UAAU,IAAI,CAAC,GAAG,SAAS;KAC5D,OAAO,EAAE,QAAQ,eAAe;KAEhC,UAAA,oBAAC,WAAD,CAAY,CAAA;IACM,CAAA;GACJ,CAAA;EACA,CAAA;CACR,GAXK,GAWL,CACf;AACH,CACF;AAEA,UAAU,cAAc;AAGxB,MAAa,iBAAiB"}
1
+ {"version":3,"file":"imperative.mjs","names":["BaseToast"],"sources":["../../../src/base-ui/Toast/imperative.tsx"],"sourcesContent":["'use client';\n\nimport { Toast as BaseToast } from '@base-ui/react/toast';\nimport { cx } from 'antd-style';\nimport { memo, useEffect, useId, useState, useSyncExternalStore } from 'react';\n\nimport { useIsClient } from '@/hooks/useIsClient';\nimport { useAppElement } from '@/ThemeProvider';\n\nimport { acquireLayerZIndex } from '../zIndex';\nimport { ToastContext } from './context';\nimport { isActiveToastHost, registerToastHost, subscribeToastHost } from './hostGuard';\nimport {\n __resetPendingToastQueueForTests,\n markToastHostNotReady,\n markToastHostReady,\n runWhenToastHostReady,\n} from './pendingQueue';\nimport { viewportVariants } from './style';\nimport ToastItem from './Toast';\nimport {\n type ToastAPI,\n type ToastInstance,\n type ToastOptions,\n type ToastPosition,\n type ToastPromiseOptions,\n type ToastType,\n} from './type';\n\n// All possible positions\nconst ALL_POSITIONS: ToastPosition[] = [\n 'top',\n 'top-left',\n 'top-right',\n 'bottom',\n 'bottom-left',\n 'bottom-right',\n];\n\n// Global state management\ninterface ToastState {\n duration: number;\n limit: number;\n position: ToastPosition;\n swipeDirection: ('left' | 'right' | 'up' | 'down') | ('left' | 'right' | 'up' | 'down')[];\n}\n\nlet globalState: ToastState = {\n duration: 5000,\n limit: 5,\n position: 'bottom-right',\n swipeDirection: ['down', 'right'],\n};\n\n// Toast managers for each position\nconst toastManagers: Record<ToastPosition, ReturnType<typeof BaseToast.createToastManager>> = {\n 'bottom': BaseToast.createToastManager(),\n 'bottom-left': BaseToast.createToastManager(),\n 'bottom-right': BaseToast.createToastManager(),\n 'top': BaseToast.createToastManager(),\n 'top-left': BaseToast.createToastManager(),\n 'top-right': BaseToast.createToastManager(),\n};\n\nconst activeToastIds: Record<ToastPosition, Set<string>> = {\n 'bottom': new Set(),\n 'bottom-left': new Set(),\n 'bottom-right': new Set(),\n 'top': new Set(),\n 'top-left': new Set(),\n 'top-right': new Set(),\n};\n\nconst getManager = (position: ToastPosition) => toastManagers[position];\n\nlet toastIdCounter = 0;\nconst generateToastId = (): string =>\n `toast-${Date.now().toString(36)}-${(toastIdCounter++).toString(36)}`;\n\nconst normalizeOptions = (\n optionsOrMessage: Omit<ToastOptions, 'type'> | string,\n type: ToastType,\n): ToastOptions => {\n if (typeof optionsOrMessage === 'string') {\n return {\n description: optionsOrMessage,\n type,\n };\n }\n return {\n ...optionsOrMessage,\n type,\n };\n};\n\nconst createToastInstance = (id: string, position: ToastPosition): ToastInstance => ({\n close: () => runWhenToastHostReady(() => getManager(position).close(id)),\n id,\n update: (options) => {\n runWhenToastHostReady(() =>\n getManager(position).update(id, {\n data: options,\n description: options.description,\n title: options.title,\n }),\n );\n },\n});\n\n// createToastManager() is a stateless emitter (see @base-ui/react/toast/createToastManager):\n// add/close/update just broadcast to whatever is currently subscribed, and the\n// ToastProvider that owns the real toast state only subscribes from a passive\n// useEffect. Calls made while no host is ready (e.g. mid-handoff between the\n// previously-active ToastHost unmounting and its successor's Provider\n// subscribing) would otherwise be silently dropped, so every manager call is\n// routed through runWhenToastHostReady to queue until a host is listening.\nconst addToast = (options: ToastOptions): ToastInstance => {\n const position = options.placement ?? globalState.position;\n const manager = getManager(position);\n const onRemove = options.onRemove;\n const id = generateToastId();\n activeToastIds[position].add(id);\n runWhenToastHostReady(() => {\n manager.add({\n id,\n data: options,\n description: options.description,\n onClose: options.onClose,\n onRemove: () => {\n activeToastIds[position].delete(id);\n onRemove?.();\n },\n timeout: options.duration ?? globalState.duration,\n title: options.title,\n });\n });\n return createToastInstance(id, position);\n};\n\nconst dismissToast = (id?: string) => {\n if (id) {\n // Try to close from all managers since we don't know which position the toast is in\n for (const [position, manager] of Object.entries(toastManagers)) {\n activeToastIds[position as ToastPosition].delete(id);\n runWhenToastHostReady(() => manager.close(id));\n }\n } else {\n // Clear all toasts\n for (const [position, manager] of Object.entries(toastManagers)) {\n const ids = Array.from(activeToastIds[position as ToastPosition]);\n activeToastIds[position as ToastPosition].clear();\n runWhenToastHostReady(() => {\n for (const toastId of ids) {\n manager.close(toastId);\n }\n });\n }\n }\n};\n\nconst createSuccessToast = (\n optionsOrMessage: Omit<ToastOptions, 'type'> | string,\n): ToastInstance => {\n return addToast(normalizeOptions(optionsOrMessage, 'success'));\n};\n\nconst createErrorToast = (optionsOrMessage: Omit<ToastOptions, 'type'> | string): ToastInstance => {\n return addToast(normalizeOptions(optionsOrMessage, 'error'));\n};\n\nconst createInfoToast = (optionsOrMessage: Omit<ToastOptions, 'type'> | string): ToastInstance => {\n return addToast(normalizeOptions(optionsOrMessage, 'info'));\n};\n\nconst createWarningToast = (\n optionsOrMessage: Omit<ToastOptions, 'type'> | string,\n): ToastInstance => {\n return addToast(normalizeOptions(optionsOrMessage, 'warning'));\n};\n\nconst createLoadingToast = (\n optionsOrMessage: Omit<ToastOptions, 'type'> | string,\n): ToastInstance => {\n const options = normalizeOptions(optionsOrMessage, 'loading');\n // Loading toasts don't auto-dismiss by default\n return addToast({ duration: 0, ...options });\n};\n\nasync function promiseToast<T>(promise: Promise<T>, options: ToastPromiseOptions<T>): Promise<T> {\n const loadingOptions =\n typeof options.loading === 'string'\n ? { description: options.loading }\n : (options.loading as ToastOptions);\n\n const loadingToast = addToast({\n closable: false,\n duration: 0,\n type: 'loading',\n ...loadingOptions,\n });\n\n try {\n const result = await promise;\n\n loadingToast.close();\n\n const successOptions = (() => {\n if (typeof options.success === 'string') {\n return { description: options.success };\n }\n if (typeof options.success === 'function') {\n return { description: options.success(result) };\n }\n return options.success as ToastOptions;\n })();\n\n addToast({ type: 'success', ...successOptions });\n\n return result;\n } catch (error) {\n loadingToast.close();\n\n const errorOptions = (() => {\n if (typeof options.error === 'string') {\n return { description: options.error };\n }\n if (typeof options.error === 'function') {\n return { description: options.error(error as Error) };\n }\n return options.error as ToastOptions;\n })();\n\n addToast({ type: 'error', ...errorOptions });\n\n throw error;\n }\n}\n\n// Base toast function\nconst baseToast = (options: ToastOptions): ToastInstance => {\n return addToast({ type: 'default', ...options });\n};\n\n// Toast API\nexport const toast: ToastAPI = Object.assign(baseToast, {\n dismiss: dismissToast,\n error: createErrorToast,\n info: createInfoToast,\n loading: createLoadingToast,\n promise: promiseToast,\n success: createSuccessToast,\n warning: createWarningToast,\n});\n\n// Toast List Component\nconst ToastList = memo(() => {\n const { toasts } = BaseToast.useToastManager();\n return toasts.map((t) => <ToastItem key={t.id} toast={t} />);\n});\n\nToastList.displayName = 'ToastList';\n\nexport interface ToastHostProps {\n className?: string;\n /**\n * Default duration for toasts\n * @default 5000\n */\n duration?: number;\n /**\n * Maximum number of toasts\n * @default 5\n */\n limit?: number;\n /**\n * Toast position\n * @default 'bottom-right'\n */\n position?: ToastPosition;\n /**\n * Root element for portal\n */\n root?: HTMLElement | ShadowRoot | null;\n /**\n * Swipe direction to dismiss\n * @default ['down', 'right']\n */\n swipeDirection?: ('left' | 'right' | 'up' | 'down') | ('left' | 'right' | 'up' | 'down')[];\n}\n\nexport const ToastHost = memo(\n ({\n root,\n className,\n duration = 5000,\n limit = 5,\n position = 'bottom-right',\n swipeDirection = ['down', 'right'],\n }: ToastHostProps) => {\n const isClient = useIsClient();\n const appElement = useAppElement();\n const [viewportZIndex, setViewportZIndex] = useState<number | undefined>(undefined);\n const hostId = useId();\n\n useEffect(() => registerToastHost(hostId), [hostId]);\n\n const isActive = useSyncExternalStore(\n subscribeToastHost,\n () => isActiveToastHost(hostId),\n () => false,\n );\n\n useEffect(() => {\n if (!isActive) return;\n globalState = {\n duration,\n limit,\n position,\n swipeDirection,\n };\n }, [duration, limit, position, swipeDirection, isActive]);\n\n useEffect(() => {\n if (!isActive) return;\n setViewportZIndex(acquireLayerZIndex('toast'));\n }, [isActive]);\n\n useEffect(() => {\n if (!isActive || !isClient) return undefined;\n // Runs after the six BaseToast.Provider children below have committed\n // and subscribed (child effects run before the parent's), so the\n // managers are guaranteed to have a live listener once this fires.\n markToastHostReady();\n return () => {\n markToastHostNotReady();\n };\n }, [isActive, isClient]);\n\n if (!isClient || !isActive) return null;\n\n const container = root ?? appElement ?? document.body;\n\n return ALL_POSITIONS.map((pos) => (\n <ToastContext key={pos} value={{ position: pos, swipeDirection }}>\n <BaseToast.Provider limit={limit} timeout={duration} toastManager={getManager(pos)}>\n <BaseToast.Portal container={container}>\n <BaseToast.Viewport\n className={cx(viewportVariants({ position: pos }), className)}\n style={{ zIndex: viewportZIndex }}\n >\n <ToastList />\n </BaseToast.Viewport>\n </BaseToast.Portal>\n </BaseToast.Provider>\n </ToastContext>\n ));\n },\n);\n\nToastHost.displayName = 'ToastHost';\n\n// Hook to use toast manager\nexport const useToast = () => toast;\n\nexport const __resetToastStateForTests = (): void => {\n globalState = {\n duration: 5000,\n limit: 5,\n position: 'bottom-right',\n swipeDirection: ['down', 'right'],\n };\n for (const position of ALL_POSITIONS) {\n toastManagers[position] = BaseToast.createToastManager();\n activeToastIds[position].clear();\n }\n __resetPendingToastQueueForTests();\n};\n"],"mappings":";;;;;;;;;;;;;;AA8BA,MAAM,gBAAiC;CACrC;CACA;CACA;CACA;CACA;CACA;AACF;AAUA,IAAI,cAA0B;CAC5B,UAAU;CACV,OAAO;CACP,UAAU;CACV,gBAAgB,CAAC,QAAQ,OAAO;AAClC;AAGA,MAAM,gBAAwF;CAC5F,UAAUA,MAAU,mBAAmB;CACvC,eAAeA,MAAU,mBAAmB;CAC5C,gBAAgBA,MAAU,mBAAmB;CAC7C,OAAOA,MAAU,mBAAmB;CACpC,YAAYA,MAAU,mBAAmB;CACzC,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ACZ;GACA;GACA;GACA;EACF;CACF,GAAG;EAAC;EAAU;EAAO;EAAU;EAAgB;CAAQ,CAAC;CAExD,gBAAgB;EACd,IAAI,CAAC,UAAU;EACf,kBAAkB,mBAAmB,OAAO,CAAC;CAC/C,GAAG,CAAC,QAAQ,CAAC;CAEb,gBAAgB;EACd,IAAI,CAAC,YAAY,CAAC,UAAU,OAAO,KAAA;EAInC,mBAAmB;EACnB,aAAa;GACX,sBAAsB;EACxB;CACF,GAAG,CAAC,UAAU,QAAQ,CAAC;CAEvB,IAAI,CAAC,YAAY,CAAC,UAAU,OAAO;CAEnC,MAAM,YAAY,QAAQ,cAAc,SAAS;CAEjD,OAAO,cAAc,KAAK,QACxB,oBAAC,cAAD;EAAwB,OAAO;GAAE,UAAU;GAAK;EAAe;EAC7D,UAAA,oBAACA,MAAU,UAAX;GAA2B;GAAO,SAAS;GAAU,cAAc,WAAW,GAAG;GAC/E,UAAA,oBAACA,MAAU,QAAX;IAA6B;IAC3B,UAAA,oBAACA,MAAU,UAAX;KACE,WAAW,GAAG,iBAAiB,EAAE,UAAU,IAAI,CAAC,GAAG,SAAS;KAC5D,OAAO,EAAE,QAAQ,eAAe;KAEhC,UAAA,oBAAC,WAAD,CAAY,CAAA;IACM,CAAA;GACJ,CAAA;EACA,CAAA;CACR,GAXK,GAWL,CACf;AACH,CACF;AAEA,UAAU,cAAc;AAGxB,MAAa,iBAAiB"}
@@ -0,0 +1,30 @@
1
+ //#region src/base-ui/Toast/pendingQueue.ts
2
+ const MAX_QUEUED_ACTIONS = 20;
3
+ const QUEUE_TTL_MS = 5e3;
4
+ let ready = false;
5
+ let queue = [];
6
+ const runWhenToastHostReady = (run) => {
7
+ if (ready) {
8
+ run();
9
+ return;
10
+ }
11
+ if (queue.length >= MAX_QUEUED_ACTIONS) queue.shift();
12
+ queue.push({
13
+ queuedAt: Date.now(),
14
+ run
15
+ });
16
+ };
17
+ const markToastHostReady = () => {
18
+ ready = true;
19
+ const pending = queue;
20
+ queue = [];
21
+ const now = Date.now();
22
+ for (const action of pending) if (now - action.queuedAt <= QUEUE_TTL_MS) action.run();
23
+ };
24
+ const markToastHostNotReady = () => {
25
+ ready = false;
26
+ };
27
+ //#endregion
28
+ export { markToastHostNotReady, markToastHostReady, runWhenToastHostReady };
29
+
30
+ //# sourceMappingURL=pendingQueue.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pendingQueue.mjs","names":[],"sources":["../../../src/base-ui/Toast/pendingQueue.ts"],"sourcesContent":["const MAX_QUEUED_ACTIONS = 20;\nconst QUEUE_TTL_MS = 5000;\n\ninterface QueuedAction {\n queuedAt: number;\n run: () => void;\n}\n\nlet ready = false;\nlet queue: QueuedAction[] = [];\n\nexport const runWhenToastHostReady = (run: () => void): void => {\n if (ready) {\n run();\n return;\n }\n if (queue.length >= MAX_QUEUED_ACTIONS) {\n queue.shift();\n }\n queue.push({ queuedAt: Date.now(), run });\n};\n\nexport const markToastHostReady = (): void => {\n ready = true;\n const pending = queue;\n queue = [];\n const now = Date.now();\n for (const action of pending) {\n if (now - action.queuedAt <= QUEUE_TTL_MS) action.run();\n }\n};\n\nexport const markToastHostNotReady = (): void => {\n ready = false;\n};\n\nexport const __resetPendingToastQueueForTests = (): void => {\n ready = false;\n queue = [];\n};\n"],"mappings":";AAAA,MAAM,qBAAqB;AAC3B,MAAM,eAAe;AAOrB,IAAI,QAAQ;AACZ,IAAI,QAAwB,CAAC;AAE7B,MAAa,yBAAyB,QAA0B;CAC9D,IAAI,OAAO;EACT,IAAI;EACJ;CACF;CACA,IAAI,MAAM,UAAU,oBAClB,MAAM,MAAM;CAEd,MAAM,KAAK;EAAE,UAAU,KAAK,IAAI;EAAG;CAAI,CAAC;AAC1C;AAEA,MAAa,2BAAiC;CAC5C,QAAQ;CACR,MAAM,UAAU;CAChB,QAAQ,CAAC;CACT,MAAM,MAAM,KAAK,IAAI;CACrB,KAAK,MAAM,UAAU,SACnB,IAAI,MAAM,OAAO,YAAY,cAAc,OAAO,IAAI;AAE1D;AAEA,MAAa,8BAAoC;CAC/C,QAAQ;AACV"}
@@ -52,6 +52,11 @@ import CheckboxGroup from "./Checkbox/CheckboxGroup.mjs";
52
52
  import { styles as styles$2 } from "./Checkbox/style.mjs";
53
53
  import "./Checkbox/index.mjs";
54
54
  import { ControlSize, controlHeight } from "./controlSize.mjs";
55
+ import { DrawerPlacement, DrawerProps, DrawerPush, DrawerSemanticNames, DrawerSemanticStyles } from "./Drawer/type.mjs";
56
+ import Drawer from "./Drawer/Drawer.mjs";
57
+ import { DrawerBackdrop, DrawerBackdropProps, DrawerClose, DrawerCloseProps, DrawerContent, DrawerContentProps, DrawerDescription, DrawerDescriptionProps, DrawerFooter, DrawerFooterProps, DrawerHeader, DrawerHeaderProps, DrawerPopup, DrawerPopupProps, DrawerPortal, DrawerPortalProps, DrawerRoot, DrawerRootProps, DrawerTitle, DrawerTitleProps, DrawerTrigger, DrawerTriggerProps, useDrawerActions, useDrawerOpen } from "./Drawer/atoms.mjs";
58
+ import { drawerBackdropTransition, getDrawerMotionConfig } from "./Drawer/constants.mjs";
59
+ import "./Drawer/index.mjs";
55
60
  import { ModalBackdrop, ModalBackdropProps, ModalClose, ModalCloseProps, ModalContent, ModalContentProps, ModalDescription, ModalDescriptionProps, ModalFooter, ModalFooterProps, ModalHeader, ModalHeaderProps, ModalPopup, ModalPopupProps, ModalPortal, ModalPortalProps, ModalRoot, ModalRootProps, ModalTitle, ModalTitleProps, ModalTrigger, ModalTriggerProps, ModalViewport, ModalViewportProps, useModalActions, useModalOpen } from "./Modal/atoms.mjs";
56
61
  import { backdropTransition, modalMotionConfig } from "./Modal/constants.mjs";
57
62
  import { BaseModalProps, ImperativeModalProps, ModalComponentProps, ModalConfirmConfig, ModalContextValue, ModalInstance } from "./Modal/type.mjs";
@@ -103,4 +108,4 @@ import { styles as styles$7 } from "./Tabs/style.mjs";
103
108
  import { TabsIndicator, TabsList, TabsPanel, TabsRoot, TabsTab, useTabsContext } from "./Tabs/atoms.mjs";
104
109
  import Tabs from "./Tabs/Tabs.mjs";
105
110
  import "./Tabs/index.mjs";
106
- export { AutoComplete, type AutoCompleteOption, type AutoCompleteProps, type BaseModalProps, Button, type ButtonIconPosition, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonType, Checkbox, CheckboxGroup, type CheckboxGroupOption, type CheckboxGroupProps, type CheckboxProps, type CheckboxShape, type ContextMenuCheckboxItem, ContextMenuHost, type ContextMenuInterceptor, type ContextMenuItem, ContextMenuTrigger, type ControlSize, type DropdownItem, DropdownMenu, type DropdownMenuCheckboxItem, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, type DropdownMenuCheckboxItemProps, DropdownMenuFooter, type DropdownMenuFooterProps, DropdownMenuGroup, DropdownMenuGroupLabel, type DropdownMenuGroupLabelProps, DropdownMenuHeader, type DropdownMenuHeaderProps, DropdownMenuItem, DropdownMenuItemContent, type DropdownMenuItemContentProps, DropdownMenuItemDesc, type DropdownMenuItemDescProps, DropdownMenuItemExtra, type DropdownMenuItemExtraProps, DropdownMenuItemIcon, type DropdownMenuItemIconProps, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, type DropdownMenuItemLabelGroupProps, type DropdownMenuItemLabelProps, type DropdownMenuItemProps, type DropdownMenuPlacement, DropdownMenuPopup, type DropdownMenuPopupProps, DropdownMenuPortal, type DropdownMenuPortalProps, DropdownMenuPositioner, type DropdownMenuPositionerProps, type DropdownMenuProps, DropdownMenuRoot, DropdownMenuScrollViewport, type DropdownMenuScrollViewportProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuSubmenuArrow, type DropdownMenuSubmenuArrowProps, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, type DropdownMenuSubmenuTriggerProps, DropdownMenuSwitchItem, type DropdownMenuSwitchItemProps, type DropdownMenuSwitchItem$1 as DropdownMenuSwitchItemType, DropdownMenuTrigger, type DropdownMenuTriggerProps, FloatingPanel, type FloatingPanelOffset, type FloatingPanelPlacement, type FloatingPanelProps, FloatingSheet, type FloatingSheetProps, Form, type FormContextValue, FormDivider, type FormDividerProps, FormField, type FormFieldProps, FormFlatGroup, type FormFlatGroupProps, FormFooter, type FormFooterProps, FormGroup, type FormGroupItemType, type FormGroupProps, type FormLayout, type FormProps, FormSubmitFooter, type FormSubmitFooterProps, FormTitle, type FormTitleProps, type FormValues, type FormVariant, type IconSpaceMode, type ImperativeModalProps, Input, type InputClassNames, InputNumber, type InputNumberProps, InputOTP, type InputOTPProps, InputPassword, type InputPasswordProps, type InputProps, type InputSize, type InputStyles, type InputVariant, type ItemsType, Modal, ModalBackdrop, type ModalBackdropProps, ModalClose, type ModalCloseProps, type ModalComponentProps, type ModalConfirmConfig, ModalContent, type ModalContentProps, ModalContext, type ModalContextValue, ModalDescription, type ModalDescriptionProps, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, ModalHost, type ModalHostProps, type ModalInstance, ModalPopup, type ModalPopupProps, ModalPortal, type ModalPortalProps, ModalRoot, type ModalRootProps, type ModalSystem, ModalTitle, type ModalTitleProps, ModalTrigger, type ModalTriggerProps, ModalViewport, type ModalViewportProps, Popover, PopoverArrow, type PopoverArrowAtomProps, PopoverArrowIcon, PopoverBackdrop, type PopoverBackdropProps, type PopoverContextValue, PopoverGroup, type PopoverPlacement, PopoverPopup, type PopoverPopupAtomProps, type PopoverPopupProps, PopoverPortal, type PopoverPortalAtomProps, type PopoverPortalProps, PopoverPositioner, type PopoverPositionerAtomProps, type PopoverPositionerProps, type PopoverProps, PopoverProvider, PopoverRoot, type PopoverTrigger, type PopoverTriggerComponentProps, PopoverTriggerElement, type PopoverTriggerElementProps, PopoverViewport, type PopoverViewportAtomProps, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, ScrollArea, ScrollAreaContent, type ScrollAreaContentProps, ScrollAreaCorner, type ScrollAreaCornerProps, type ScrollAreaProps, ScrollAreaRoot, type ScrollAreaRootProps, ScrollAreaScrollbar, type ScrollAreaScrollbarProps, ScrollAreaThumb, type ScrollAreaThumbProps, ScrollAreaViewport, type ScrollAreaViewportProps, Segmented, type SegmentedClassNames, SegmentedIndicator, type SegmentedIndicatorProps, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, type SegmentedItemProps, type SegmentedOption, type SegmentedOptions, type SegmentedOrientation, type SegmentedProps, SegmentedRoot, type SegmentedRootProps, type SegmentedSize, type SegmentedStyles, type SegmentedVariant, Select, SelectArrow, type SelectArrowProps, SelectBackdrop, type SelectBehaviorVariant, type SelectClassNames, SelectGroup, SelectGroupLabel, type SelectGroupLabelProps, type SelectGroupProps, SelectIcon, type SelectIconProps, type SelectIndicatorVariant, SelectItem, SelectItemIndicator, type SelectItemIndicatorProps, type SelectItemProps, SelectItemText, type SelectItemTextProps, SelectList, type SelectListProps, type SelectOption, type SelectOptionGroup, type SelectOptions, SelectPopup, type SelectPopupProps, SelectPortal, type SelectPortalProps, SelectPositioner, type SelectPositionerProps, type SelectProps, SelectRoot, type SelectRootChangeEventDetails, SelectScrollDownArrow, type SelectScrollDownArrowProps, SelectScrollUpArrow, type SelectScrollUpArrowProps, SelectSeparator, type SelectSize, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, type SelectVariant, Slider, type SliderProps, SliderWithInput, type SliderWithInputProps, _default as SplitButton, type SplitButtonMenuProps, type SplitButtonProps, Switch, type SwitchChangeEventHandler, type SwitchClassNames, type SwitchClickEventHandler, type SwitchContextType, SwitchIcon, type SwitchIconPosition, type SwitchIconProps, type SwitchProps, SwitchRoot, type SwitchRootProps, type SwitchSize, type SwitchStyles, SwitchThumb, type SwitchThumbProps, Tabs, type TabsClassNames, TabsIndicator, type TabsIndicatorProps, type TabsItem, TabsList, type TabsListProps, type TabsOrientation, TabsPanel, type TabsPanelProps, type TabsProps, TabsRoot, type TabsRootProps, type TabsSize, type TabsStyles, TabsTab, type TabsTabProps, type TabsVariant, TextArea, type TextAreaAutoSize, type TextAreaProps, type ToastAPI, ToastHost, type ToastHostProps, type ToastInstance, type ToastOptions, type ToastPosition, type ToastPromiseOptions, type ToastProps, type ToastType, Tooltip, TooltipGroup, type TooltipGroupProps, type TooltipPlacement, type TooltipPopupComponentProps, type TooltipPortalProps, type TooltipPositionerProps, type TooltipProps, type TooltipTriggerComponentProps, styles as autoCompleteStyles, backdropTransition, styles$1 as buttonStyles, styles$2 as checkboxStyles, closeContextMenu, confirmModal, controlHeight, createModal, createModalSystem, styles$3 as inputStyles, rootVariants as inputVariants, modalMotionConfig, parseTrigger, styles$4 as radioStyles, renderDropdownMenuItems, setContextMenuInterceptor, showContextMenu, styles$5 as sliderStyles, styles$6 as switchStyles, styles$7 as tabsStyles, toast, updateContextMenuItems, useFormContext, useModalActions, useModalContext, useModalOpen, usePopoverContext, usePopoverPortalContainer, useSwitchContext, useTabsContext, useToast };
111
+ export { AutoComplete, type AutoCompleteOption, type AutoCompleteProps, type BaseModalProps, Button, type ButtonIconPosition, type ButtonProps, type ButtonShape, type ButtonSize, type ButtonType, Checkbox, CheckboxGroup, type CheckboxGroupOption, type CheckboxGroupProps, type CheckboxProps, type CheckboxShape, type ContextMenuCheckboxItem, ContextMenuHost, type ContextMenuInterceptor, type ContextMenuItem, ContextMenuTrigger, type ControlSize, Drawer, DrawerBackdrop, type DrawerBackdropProps, DrawerClose, type DrawerCloseProps, DrawerContent, type DrawerContentProps, DrawerDescription, type DrawerDescriptionProps, DrawerFooter, type DrawerFooterProps, DrawerHeader, type DrawerHeaderProps, type DrawerPlacement, DrawerPopup, type DrawerPopupProps, DrawerPortal, type DrawerPortalProps, type DrawerProps, type DrawerPush, DrawerRoot, type DrawerRootProps, type DrawerSemanticNames, type DrawerSemanticStyles, DrawerTitle, type DrawerTitleProps, DrawerTrigger, type DrawerTriggerProps, type DropdownItem, DropdownMenu, type DropdownMenuCheckboxItem, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, type DropdownMenuCheckboxItemProps, DropdownMenuFooter, type DropdownMenuFooterProps, DropdownMenuGroup, DropdownMenuGroupLabel, type DropdownMenuGroupLabelProps, DropdownMenuHeader, type DropdownMenuHeaderProps, DropdownMenuItem, DropdownMenuItemContent, type DropdownMenuItemContentProps, DropdownMenuItemDesc, type DropdownMenuItemDescProps, DropdownMenuItemExtra, type DropdownMenuItemExtraProps, DropdownMenuItemIcon, type DropdownMenuItemIconProps, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, type DropdownMenuItemLabelGroupProps, type DropdownMenuItemLabelProps, type DropdownMenuItemProps, type DropdownMenuPlacement, DropdownMenuPopup, type DropdownMenuPopupProps, DropdownMenuPortal, type DropdownMenuPortalProps, DropdownMenuPositioner, type DropdownMenuPositionerProps, type DropdownMenuProps, DropdownMenuRoot, DropdownMenuScrollViewport, type DropdownMenuScrollViewportProps, DropdownMenuSeparator, type DropdownMenuSeparatorProps, DropdownMenuSubmenuArrow, type DropdownMenuSubmenuArrowProps, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, type DropdownMenuSubmenuTriggerProps, DropdownMenuSwitchItem, type DropdownMenuSwitchItemProps, type DropdownMenuSwitchItem$1 as DropdownMenuSwitchItemType, DropdownMenuTrigger, type DropdownMenuTriggerProps, FloatingPanel, type FloatingPanelOffset, type FloatingPanelPlacement, type FloatingPanelProps, FloatingSheet, type FloatingSheetProps, Form, type FormContextValue, FormDivider, type FormDividerProps, FormField, type FormFieldProps, FormFlatGroup, type FormFlatGroupProps, FormFooter, type FormFooterProps, FormGroup, type FormGroupItemType, type FormGroupProps, type FormLayout, type FormProps, FormSubmitFooter, type FormSubmitFooterProps, FormTitle, type FormTitleProps, type FormValues, type FormVariant, type IconSpaceMode, type ImperativeModalProps, Input, type InputClassNames, InputNumber, type InputNumberProps, InputOTP, type InputOTPProps, InputPassword, type InputPasswordProps, type InputProps, type InputSize, type InputStyles, type InputVariant, type ItemsType, Modal, ModalBackdrop, type ModalBackdropProps, ModalClose, type ModalCloseProps, type ModalComponentProps, type ModalConfirmConfig, ModalContent, type ModalContentProps, ModalContext, type ModalContextValue, ModalDescription, type ModalDescriptionProps, ModalFooter, type ModalFooterProps, ModalHeader, type ModalHeaderProps, ModalHost, type ModalHostProps, type ModalInstance, ModalPopup, type ModalPopupProps, ModalPortal, type ModalPortalProps, ModalRoot, type ModalRootProps, type ModalSystem, ModalTitle, type ModalTitleProps, ModalTrigger, type ModalTriggerProps, ModalViewport, type ModalViewportProps, Popover, PopoverArrow, type PopoverArrowAtomProps, PopoverArrowIcon, PopoverBackdrop, type PopoverBackdropProps, type PopoverContextValue, PopoverGroup, type PopoverPlacement, PopoverPopup, type PopoverPopupAtomProps, type PopoverPopupProps, PopoverPortal, type PopoverPortalAtomProps, type PopoverPortalProps, PopoverPositioner, type PopoverPositionerAtomProps, type PopoverPositionerProps, type PopoverProps, PopoverProvider, PopoverRoot, type PopoverTrigger, type PopoverTriggerComponentProps, PopoverTriggerElement, type PopoverTriggerElementProps, PopoverViewport, type PopoverViewportAtomProps, Radio, RadioGroup, type RadioGroupOption, type RadioGroupProps, type RadioProps, ScrollArea, ScrollAreaContent, type ScrollAreaContentProps, ScrollAreaCorner, type ScrollAreaCornerProps, type ScrollAreaProps, ScrollAreaRoot, type ScrollAreaRootProps, ScrollAreaScrollbar, type ScrollAreaScrollbarProps, ScrollAreaThumb, type ScrollAreaThumbProps, ScrollAreaViewport, type ScrollAreaViewportProps, Segmented, type SegmentedClassNames, SegmentedIndicator, type SegmentedIndicatorProps, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, type SegmentedItemProps, type SegmentedOption, type SegmentedOptions, type SegmentedOrientation, type SegmentedProps, SegmentedRoot, type SegmentedRootProps, type SegmentedSize, type SegmentedStyles, type SegmentedVariant, Select, SelectArrow, type SelectArrowProps, SelectBackdrop, type SelectBehaviorVariant, type SelectClassNames, SelectGroup, SelectGroupLabel, type SelectGroupLabelProps, type SelectGroupProps, SelectIcon, type SelectIconProps, type SelectIndicatorVariant, SelectItem, SelectItemIndicator, type SelectItemIndicatorProps, type SelectItemProps, SelectItemText, type SelectItemTextProps, SelectList, type SelectListProps, type SelectOption, type SelectOptionGroup, type SelectOptions, SelectPopup, type SelectPopupProps, SelectPortal, type SelectPortalProps, SelectPositioner, type SelectPositionerProps, type SelectProps, SelectRoot, type SelectRootChangeEventDetails, SelectScrollDownArrow, type SelectScrollDownArrowProps, SelectScrollUpArrow, type SelectScrollUpArrowProps, SelectSeparator, type SelectSize, SelectTrigger, type SelectTriggerProps, SelectValue, type SelectValueProps, type SelectVariant, Slider, type SliderProps, SliderWithInput, type SliderWithInputProps, _default as SplitButton, type SplitButtonMenuProps, type SplitButtonProps, Switch, type SwitchChangeEventHandler, type SwitchClassNames, type SwitchClickEventHandler, type SwitchContextType, SwitchIcon, type SwitchIconPosition, type SwitchIconProps, type SwitchProps, SwitchRoot, type SwitchRootProps, type SwitchSize, type SwitchStyles, SwitchThumb, type SwitchThumbProps, Tabs, type TabsClassNames, TabsIndicator, type TabsIndicatorProps, type TabsItem, TabsList, type TabsListProps, type TabsOrientation, TabsPanel, type TabsPanelProps, type TabsProps, TabsRoot, type TabsRootProps, type TabsSize, type TabsStyles, TabsTab, type TabsTabProps, type TabsVariant, TextArea, type TextAreaAutoSize, type TextAreaProps, type ToastAPI, ToastHost, type ToastHostProps, type ToastInstance, type ToastOptions, type ToastPosition, type ToastPromiseOptions, type ToastProps, type ToastType, Tooltip, TooltipGroup, type TooltipGroupProps, type TooltipPlacement, type TooltipPopupComponentProps, type TooltipPortalProps, type TooltipPositionerProps, type TooltipProps, type TooltipTriggerComponentProps, styles as autoCompleteStyles, backdropTransition, styles$1 as buttonStyles, styles$2 as checkboxStyles, closeContextMenu, confirmModal, controlHeight, createModal, createModalSystem, drawerBackdropTransition, getDrawerMotionConfig, styles$3 as inputStyles, rootVariants as inputVariants, modalMotionConfig, parseTrigger, styles$4 as radioStyles, renderDropdownMenuItems, setContextMenuInterceptor, showContextMenu, styles$5 as sliderStyles, styles$6 as switchStyles, styles$7 as tabsStyles, toast, updateContextMenuItems, useDrawerActions, useDrawerOpen, useFormContext, useModalActions, useModalContext, useModalOpen, usePopoverContext, usePopoverPortalContainer, useSwitchContext, useTabsContext, useToast };
@@ -16,9 +16,9 @@ import { PopoverArrow, PopoverBackdrop, PopoverPopup, PopoverPortal, PopoverPosi
16
16
  import { PopoverProvider, usePopoverContext } from "./Popover/context.mjs";
17
17
  import Popover from "./Popover/Popover.mjs";
18
18
  import PopoverGroup from "./Popover/PopoverGroup.mjs";
19
+ import { ToastHost, toast, useToast } from "./Toast/imperative.mjs";
19
20
  import { ScrollAreaContent, ScrollAreaCorner, ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport } from "./ScrollArea/atoms.mjs";
20
21
  import { ScrollArea } from "./ScrollArea/ScrollArea.mjs";
21
- import { ToastHost, toast, useToast } from "./Toast/imperative.mjs";
22
22
  import { controlHeight } from "./controlSize.mjs";
23
23
  import { rootVariants, styles as styles$3 } from "./Input/style.mjs";
24
24
  import Input from "./Input/Input.mjs";
@@ -34,6 +34,9 @@ import SplitButton from "./Button/SplitButton.mjs";
34
34
  import { styles as styles$2 } from "./Checkbox/style.mjs";
35
35
  import Checkbox from "./Checkbox/Checkbox.mjs";
36
36
  import CheckboxGroup from "./Checkbox/CheckboxGroup.mjs";
37
+ import { drawerBackdropTransition, getDrawerMotionConfig } from "./Drawer/constants.mjs";
38
+ import { DrawerBackdrop, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerPopup, DrawerPortal, DrawerRoot, DrawerTitle, DrawerTrigger, useDrawerActions, useDrawerOpen } from "./Drawer/atoms.mjs";
39
+ import Drawer from "./Drawer/Drawer.mjs";
37
40
  import { backdropTransition, modalMotionConfig } from "./Modal/constants.mjs";
38
41
  import { ModalBackdrop, ModalClose, ModalContent, ModalDescription, ModalFooter, ModalHeader, ModalPopup, ModalPortal, ModalRoot, ModalTitle, ModalTrigger, ModalViewport, useModalActions, useModalOpen } from "./Modal/atoms.mjs";
39
42
  import { ModalContext, useModalContext } from "./Modal/context.mjs";
@@ -63,4 +66,4 @@ import SliderWithInput from "./Slider/SliderWithInput.mjs";
63
66
  import { styles as styles$7 } from "./Tabs/style.mjs";
64
67
  import { TabsIndicator, TabsList, TabsPanel, TabsRoot, TabsTab, useTabsContext } from "./Tabs/atoms.mjs";
65
68
  import Tabs from "./Tabs/Tabs.mjs";
66
- export { AutoComplete, Button, Checkbox, CheckboxGroup, ContextMenuHost, ContextMenuTrigger, DropdownMenu, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuFooter, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuHeader, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemDesc, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuRoot, DropdownMenuScrollViewport, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSwitchItem, DropdownMenuTrigger, FloatingPanel, FloatingSheet, Form, FormDivider, FormField, FormFlatGroup, FormFooter, FormGroup, FormSubmitFooter, FormTitle, Input, InputNumber, InputOTP, InputPassword, Modal, ModalBackdrop, ModalClose, ModalContent, ModalContext, ModalDescription, ModalFooter, ModalHeader, ModalHost, ModalPopup, ModalPortal, ModalRoot, ModalTitle, ModalTrigger, ModalViewport, Popover, PopoverArrow, PopoverArrowIcon, PopoverBackdrop, PopoverGroup, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverProvider, PopoverRoot, PopoverTriggerElement, PopoverViewport, Radio, RadioGroup, ScrollArea, ScrollAreaContent, ScrollAreaCorner, ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Segmented, SegmentedIndicator, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, SegmentedRoot, Select, SelectArrow, SelectBackdrop, SelectGroup, SelectGroupLabel, SelectIcon, SelectItem, SelectItemIndicator, SelectItemText, SelectList, SelectPopup, SelectPortal, SelectPositioner, SelectRoot, SelectScrollDownArrow, SelectScrollUpArrow, SelectSeparator, SelectTrigger, SelectValue, Slider, SliderWithInput, SplitButton, Switch, SwitchIcon, SwitchRoot, SwitchThumb, Tabs, TabsIndicator, TabsList, TabsPanel, TabsRoot, TabsTab, TextArea, ToastHost, Tooltip, TooltipGroup, styles as autoCompleteStyles, backdropTransition, styles$1 as buttonStyles, styles$2 as checkboxStyles, closeContextMenu, confirmModal, controlHeight, createModal, createModalSystem, styles$3 as inputStyles, rootVariants as inputVariants, modalMotionConfig, parseTrigger, styles$4 as radioStyles, renderDropdownMenuItems, setContextMenuInterceptor, showContextMenu, styles$5 as sliderStyles, styles$6 as switchStyles, styles$7 as tabsStyles, toast, updateContextMenuItems, useFormContext, useModalActions, useModalContext, useModalOpen, usePopoverContext, usePopoverPortalContainer, useSwitchContext, useTabsContext, useToast };
69
+ export { AutoComplete, Button, Checkbox, CheckboxGroup, ContextMenuHost, ContextMenuTrigger, Drawer, DrawerBackdrop, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerPopup, DrawerPortal, DrawerRoot, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuFooter, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuHeader, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemDesc, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuItemLabelGroup, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuRoot, DropdownMenuScrollViewport, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuSwitchItem, DropdownMenuTrigger, FloatingPanel, FloatingSheet, Form, FormDivider, FormField, FormFlatGroup, FormFooter, FormGroup, FormSubmitFooter, FormTitle, Input, InputNumber, InputOTP, InputPassword, Modal, ModalBackdrop, ModalClose, ModalContent, ModalContext, ModalDescription, ModalFooter, ModalHeader, ModalHost, ModalPopup, ModalPortal, ModalRoot, ModalTitle, ModalTrigger, ModalViewport, Popover, PopoverArrow, PopoverArrowIcon, PopoverBackdrop, PopoverGroup, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverProvider, PopoverRoot, PopoverTriggerElement, PopoverViewport, Radio, RadioGroup, ScrollArea, ScrollAreaContent, ScrollAreaCorner, ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, Segmented, SegmentedIndicator, SegmentedItem, SegmentedItemIcon, SegmentedItemLabel, SegmentedRoot, Select, SelectArrow, SelectBackdrop, SelectGroup, SelectGroupLabel, SelectIcon, SelectItem, SelectItemIndicator, SelectItemText, SelectList, SelectPopup, SelectPortal, SelectPositioner, SelectRoot, SelectScrollDownArrow, SelectScrollUpArrow, SelectSeparator, SelectTrigger, SelectValue, Slider, SliderWithInput, SplitButton, Switch, SwitchIcon, SwitchRoot, SwitchThumb, Tabs, TabsIndicator, TabsList, TabsPanel, TabsRoot, TabsTab, TextArea, ToastHost, Tooltip, TooltipGroup, styles as autoCompleteStyles, backdropTransition, styles$1 as buttonStyles, styles$2 as checkboxStyles, closeContextMenu, confirmModal, controlHeight, createModal, createModalSystem, drawerBackdropTransition, getDrawerMotionConfig, styles$3 as inputStyles, rootVariants as inputVariants, modalMotionConfig, parseTrigger, styles$4 as radioStyles, renderDropdownMenuItems, setContextMenuInterceptor, showContextMenu, styles$5 as sliderStyles, styles$6 as switchStyles, styles$7 as tabsStyles, toast, updateContextMenuItems, useDrawerActions, useDrawerOpen, useFormContext, useModalActions, useModalContext, useModalOpen, usePopoverContext, usePopoverPortalContainer, useSwitchContext, useTabsContext, useToast };
@@ -56,7 +56,6 @@ const LobeChat = memo(({ type = "3d", size = 32, style, extra, className, ...res
56
56
  style,
57
57
  children: logoComponent
58
58
  });
59
- break;
60
59
  }
61
60
  if (!extra) return logoComponent;
62
61
  const extraSize = Math.round(size / 3 * 1.9);
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["LogoFlat","LogoMono","LogoText","Flexbox"],"sources":["../../../src/brand/LobeChat/index.tsx"],"sourcesContent":["'use client';\n\nimport { cssVar } from 'antd-style';\nimport { memo, type ReactNode } from 'react';\n\nimport Divider from '@/brand/components/Divider';\nimport LogoText from '@/brand/LobeChatText';\nimport { styles } from '@/brand/LobeHub/style';\nimport Logo3d from '@/brand/Logo3d';\nimport LogoFlat from '@/brand/LogoFlat';\nimport LogoMono from '@/brand/LogoMono';\nimport { Flexbox } from '@/Flex';\nimport { type DivProps } from '@/types';\n\nexport interface LobeChatProps extends DivProps {\n extra?: ReactNode;\n size?: number;\n type?: '3d' | 'flat' | 'mono' | 'text' | 'combine';\n}\n\nconst LobeChat = memo<LobeChatProps>(\n ({ type = '3d', size = 32, style, extra, className, ...rest }) => {\n let logoComponent: ReactNode;\n\n switch (type) {\n case '3d': {\n logoComponent = <Logo3d alt={'LobeChat'} size={size} {...rest} />;\n break;\n }\n case 'flat': {\n logoComponent = <LogoFlat size={size} style={style} />;\n break;\n }\n case 'mono': {\n logoComponent = <LogoMono size={size} style={style} />;\n break;\n }\n case 'text': {\n logoComponent = (\n <LogoText className={className} size={size} style={style} {...(rest as any)} />\n );\n break;\n }\n case 'combine': {\n logoComponent = (\n <>\n <Logo3d alt=\"LobeChat\" size={size} />\n <LogoText size={size} style={{ marginLeft: Math.round(size / 4) }} />\n </>\n );\n\n if (!extra)\n logoComponent = (\n <Flexbox horizontal align={'center'} className={className} flex={'none'} style={style}>\n {logoComponent}\n </Flexbox>\n );\n\n break;\n }\n }\n\n if (!extra) return logoComponent;\n\n const extraSize = Math.round((size / 3) * 1.9);\n\n return (\n <Flexbox\n horizontal\n align={'center'}\n className={className}\n flex={'none'}\n style={style}\n {...rest}\n >\n {logoComponent}\n <Divider size={extraSize} style={{ color: cssVar.colorFill }} />\n <div className={styles.extraTitle} style={{ fontSize: extraSize }}>\n {extra}\n </div>\n </Flexbox>\n );\n },\n);\n\nLobeChat.displayName = 'LobeChatBrand';\n\nexport default LobeChat;\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAM,WAAW,MACd,EAAE,OAAO,MAAM,OAAO,IAAI,OAAO,OAAO,WAAW,GAAG,WAAW;CAChE,IAAI;CAEJ,QAAQ,MAAR;EACE,KAAK;GACH,gBAAgB,oBAAC,QAAD;IAAQ,KAAK;IAAkB;IAAM,GAAI;GAAO,CAAA;GAChE;EAEF,KAAK;GACH,gBAAgB,oBAACA,kBAAD;IAAgB;IAAa;GAAQ,CAAA;GACrD;EAEF,KAAK;GACH,gBAAgB,oBAACC,eAAD;IAAgB;IAAa;GAAQ,CAAA;GACrD;EAEF,KAAK;GACH,gBACE,oBAACC,cAAD;IAAqB;IAAiB;IAAa;IAAO,GAAK;GAAe,CAAA;GAEhF;EAEF,KAAK;GACH,gBACE,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,QAAD;IAAQ,KAAI;IAAiB;GAAO,CAAA,GACpC,oBAACA,cAAD;IAAgB;IAAM,OAAO,EAAE,YAAY,KAAK,MAAM,OAAO,CAAC,EAAE;GAAI,CAAA,CACpE,EAAA,CAAA;GAGJ,IAAI,CAAC,OACH,gBACE,oBAACC,mBAAD;IAAS,YAAA;IAAW,OAAO;IAAqB;IAAW,MAAM;IAAe;IAC7E,UAAA;GACM,CAAA;GAGb;CAEJ;CAEA,IAAI,CAAC,OAAO,OAAO;CAEnB,MAAM,YAAY,KAAK,MAAO,OAAO,IAAK,GAAG;CAE7C,OACE,qBAACA,mBAAD;EACE,YAAA;EACA,OAAO;EACI;EACX,MAAM;EACC;EACP,GAAI;EANN,UAAA;GAQG;GACD,oBAAC,SAAD;IAAS,MAAM;IAAW,OAAO,EAAE,OAAO,OAAO,UAAU;GAAI,CAAA;GAC/D,oBAAC,OAAD;IAAK,WAAW,OAAO;IAAY,OAAO,EAAE,UAAU,UAAU;IAC7D,UAAA;GACE,CAAA;EACE;;AAEb,CACF;AAEA,SAAS,cAAc"}
1
+ {"version":3,"file":"index.mjs","names":["LogoFlat","LogoMono","LogoText","Flexbox"],"sources":["../../../src/brand/LobeChat/index.tsx"],"sourcesContent":["'use client';\n\nimport { cssVar } from 'antd-style';\nimport { memo, type ReactNode } from 'react';\n\nimport Divider from '@/brand/components/Divider';\nimport LogoText from '@/brand/LobeChatText';\nimport { styles } from '@/brand/LobeHub/style';\nimport Logo3d from '@/brand/Logo3d';\nimport LogoFlat from '@/brand/LogoFlat';\nimport LogoMono from '@/brand/LogoMono';\nimport { Flexbox } from '@/Flex';\nimport { type DivProps } from '@/types';\n\nexport interface LobeChatProps extends DivProps {\n extra?: ReactNode;\n size?: number;\n type?: '3d' | 'flat' | 'mono' | 'text' | 'combine';\n}\n\nconst LobeChat = memo<LobeChatProps>(\n ({ type = '3d', size = 32, style, extra, className, ...rest }) => {\n let logoComponent: ReactNode;\n\n switch (type) {\n case '3d': {\n logoComponent = <Logo3d alt={'LobeChat'} size={size} {...rest} />;\n break;\n }\n case 'flat': {\n logoComponent = <LogoFlat size={size} style={style} />;\n break;\n }\n case 'mono': {\n logoComponent = <LogoMono size={size} style={style} />;\n break;\n }\n case 'text': {\n logoComponent = (\n <LogoText className={className} size={size} style={style} {...(rest as any)} />\n );\n break;\n }\n case 'combine': {\n logoComponent = (\n <>\n <Logo3d alt=\"LobeChat\" size={size} />\n <LogoText size={size} style={{ marginLeft: Math.round(size / 4) }} />\n </>\n );\n\n if (!extra)\n logoComponent = (\n <Flexbox horizontal align={'center'} className={className} flex={'none'} style={style}>\n {logoComponent}\n </Flexbox>\n );\n\n break;\n }\n }\n\n if (!extra) return logoComponent;\n\n const extraSize = Math.round((size / 3) * 1.9);\n\n return (\n <Flexbox\n horizontal\n align={'center'}\n className={className}\n flex={'none'}\n style={style}\n {...rest}\n >\n {logoComponent}\n <Divider size={extraSize} style={{ color: cssVar.colorFill }} />\n <div className={styles.extraTitle} style={{ fontSize: extraSize }}>\n {extra}\n </div>\n </Flexbox>\n );\n },\n);\n\nLobeChat.displayName = 'LobeChatBrand';\n\nexport default LobeChat;\n"],"mappings":";;;;;;;;;;;;AAoBA,MAAM,WAAW,MACd,EAAE,OAAO,MAAM,OAAO,IAAI,OAAO,OAAO,WAAW,GAAG,WAAW;CAChE,IAAI;CAEJ,QAAQ,MAAR;EACE,KAAK;GACH,gBAAgB,oBAAC,QAAD;IAAQ,KAAK;IAAkB;IAAM,GAAI;GAAO,CAAA;GAChE;EAEF,KAAK;GACH,gBAAgB,oBAACA,kBAAD;IAAgB;IAAa;GAAQ,CAAA;GACrD;EAEF,KAAK;GACH,gBAAgB,oBAACC,eAAD;IAAgB;IAAa;GAAQ,CAAA;GACrD;EAEF,KAAK;GACH,gBACE,oBAACC,cAAD;IAAqB;IAAiB;IAAa;IAAO,GAAK;GAAe,CAAA;GAEhF;EAEF,KAAK;GACH,gBACE,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,QAAD;IAAQ,KAAI;IAAiB;GAAO,CAAA,GACpC,oBAACA,cAAD;IAAgB;IAAM,OAAO,EAAE,YAAY,KAAK,MAAM,OAAO,CAAC,EAAE;GAAI,CAAA,CACpE,EAAA,CAAA;GAGJ,IAAI,CAAC,OACH,gBACE,oBAACC,mBAAD;IAAS,YAAA;IAAW,OAAO;IAAqB;IAAW,MAAM;IAAe;IAC7E,UAAA;GACM,CAAA;CAKjB;CAEA,IAAI,CAAC,OAAO,OAAO;CAEnB,MAAM,YAAY,KAAK,MAAO,OAAO,IAAK,GAAG;CAE7C,OACE,qBAACA,mBAAD;EACE,YAAA;EACA,OAAO;EACI;EACX,MAAM;EACC;EACP,GAAI;EANN,UAAA;GAQG;GACD,oBAAC,SAAD;IAAS,MAAM;IAAW,OAAO,EAAE,OAAO,OAAO,UAAU;GAAI,CAAA;GAC/D,oBAAC,OAAD;IAAK,WAAW,OAAO;IAAY,OAAO,EAAE,UAAU,UAAU;IAC7D,UAAA;GACE,CAAA;EACE;;AAEb,CACF;AAEA,SAAS,cAAc"}
@@ -55,7 +55,6 @@ const LobeHub = memo(({ type = "3d", size = 32, style, extra, className, ...rest
55
55
  style,
56
56
  children: logoComponent
57
57
  });
58
- break;
59
58
  }
60
59
  if (!extra) return logoComponent;
61
60
  const extraSize = Math.round(size / 3 * 1.9);
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["LogoFlat","LogoMono","LogoText","Flexbox"],"sources":["../../../src/brand/LobeHub/index.tsx"],"sourcesContent":["'use client';\n\nimport { cssVar } from 'antd-style';\nimport { memo, type ReactNode } from 'react';\n\nimport Divider from '@/brand/components/Divider';\nimport LogoText from '@/brand/LobeHubText';\nimport Logo3d from '@/brand/Logo3d';\nimport LogoFlat from '@/brand/LogoFlat';\nimport LogoMono from '@/brand/LogoMono';\nimport { Flexbox } from '@/Flex';\nimport { type DivProps } from '@/types';\n\nimport { styles } from './style';\n\nexport interface LobeHubProps extends DivProps {\n extra?: ReactNode;\n size?: number;\n type?: '3d' | 'flat' | 'mono' | 'text' | 'combine';\n}\n\nconst LobeHub = memo<LobeHubProps>(\n ({ type = '3d', size = 32, style, extra, className, ...rest }) => {\n let logoComponent: ReactNode;\n\n switch (type) {\n case '3d': {\n logoComponent = <Logo3d size={size} {...rest} />;\n break;\n }\n case 'flat': {\n logoComponent = <LogoFlat size={size} style={style} />;\n break;\n }\n case 'mono': {\n logoComponent = <LogoMono size={size} style={style} />;\n break;\n }\n case 'text': {\n logoComponent = (\n <LogoText className={className} size={size} style={style} {...(rest as any)} />\n );\n break;\n }\n case 'combine': {\n logoComponent = (\n <>\n <Logo3d alt=\"LobeChat\" size={size} />\n <LogoText size={size} style={{ marginLeft: Math.round(size / 4) }} />\n </>\n );\n\n if (!extra)\n logoComponent = (\n <Flexbox horizontal align={'center'} className={className} flex={'none'} style={style}>\n {logoComponent}\n </Flexbox>\n );\n\n break;\n }\n }\n\n if (!extra) return logoComponent;\n\n const extraSize = Math.round((size / 3) * 1.9);\n\n return (\n <Flexbox\n horizontal\n align={'center'}\n className={className}\n flex={'none'}\n style={style}\n {...rest}\n >\n {logoComponent}\n <Divider size={extraSize} style={{ color: cssVar.colorFill }} />\n <div className={styles.extraTitle} style={{ fontSize: extraSize }}>\n {extra}\n </div>\n </Flexbox>\n );\n },\n);\n\nLobeHub.displayName = 'LobeHubBrand';\n\nexport default LobeHub;\n"],"mappings":";;;;;;;;;;;;AAqBA,MAAM,UAAU,MACb,EAAE,OAAO,MAAM,OAAO,IAAI,OAAO,OAAO,WAAW,GAAG,WAAW;CAChE,IAAI;CAEJ,QAAQ,MAAR;EACE,KAAK;GACH,gBAAgB,oBAAC,QAAD;IAAc;IAAM,GAAI;GAAO,CAAA;GAC/C;EAEF,KAAK;GACH,gBAAgB,oBAACA,kBAAD;IAAgB;IAAa;GAAQ,CAAA;GACrD;EAEF,KAAK;GACH,gBAAgB,oBAACC,eAAD;IAAgB;IAAa;GAAQ,CAAA;GACrD;EAEF,KAAK;GACH,gBACE,oBAACC,aAAD;IAAqB;IAAiB;IAAa;IAAO,GAAK;GAAe,CAAA;GAEhF;EAEF,KAAK;GACH,gBACE,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,QAAD;IAAQ,KAAI;IAAiB;GAAO,CAAA,GACpC,oBAACA,aAAD;IAAgB;IAAM,OAAO,EAAE,YAAY,KAAK,MAAM,OAAO,CAAC,EAAE;GAAI,CAAA,CACpE,EAAA,CAAA;GAGJ,IAAI,CAAC,OACH,gBACE,oBAACC,mBAAD;IAAS,YAAA;IAAW,OAAO;IAAqB;IAAW,MAAM;IAAe;IAC7E,UAAA;GACM,CAAA;GAGb;CAEJ;CAEA,IAAI,CAAC,OAAO,OAAO;CAEnB,MAAM,YAAY,KAAK,MAAO,OAAO,IAAK,GAAG;CAE7C,OACE,qBAACA,mBAAD;EACE,YAAA;EACA,OAAO;EACI;EACX,MAAM;EACC;EACP,GAAI;EANN,UAAA;GAQG;GACD,oBAAC,SAAD;IAAS,MAAM;IAAW,OAAO,EAAE,OAAO,OAAO,UAAU;GAAI,CAAA;GAC/D,oBAAC,OAAD;IAAK,WAAW,OAAO;IAAY,OAAO,EAAE,UAAU,UAAU;IAC7D,UAAA;GACE,CAAA;EACE;;AAEb,CACF;AAEA,QAAQ,cAAc"}
1
+ {"version":3,"file":"index.mjs","names":["LogoFlat","LogoMono","LogoText","Flexbox"],"sources":["../../../src/brand/LobeHub/index.tsx"],"sourcesContent":["'use client';\n\nimport { cssVar } from 'antd-style';\nimport { memo, type ReactNode } from 'react';\n\nimport Divider from '@/brand/components/Divider';\nimport LogoText from '@/brand/LobeHubText';\nimport Logo3d from '@/brand/Logo3d';\nimport LogoFlat from '@/brand/LogoFlat';\nimport LogoMono from '@/brand/LogoMono';\nimport { Flexbox } from '@/Flex';\nimport { type DivProps } from '@/types';\n\nimport { styles } from './style';\n\nexport interface LobeHubProps extends DivProps {\n extra?: ReactNode;\n size?: number;\n type?: '3d' | 'flat' | 'mono' | 'text' | 'combine';\n}\n\nconst LobeHub = memo<LobeHubProps>(\n ({ type = '3d', size = 32, style, extra, className, ...rest }) => {\n let logoComponent: ReactNode;\n\n switch (type) {\n case '3d': {\n logoComponent = <Logo3d size={size} {...rest} />;\n break;\n }\n case 'flat': {\n logoComponent = <LogoFlat size={size} style={style} />;\n break;\n }\n case 'mono': {\n logoComponent = <LogoMono size={size} style={style} />;\n break;\n }\n case 'text': {\n logoComponent = (\n <LogoText className={className} size={size} style={style} {...(rest as any)} />\n );\n break;\n }\n case 'combine': {\n logoComponent = (\n <>\n <Logo3d alt=\"LobeChat\" size={size} />\n <LogoText size={size} style={{ marginLeft: Math.round(size / 4) }} />\n </>\n );\n\n if (!extra)\n logoComponent = (\n <Flexbox horizontal align={'center'} className={className} flex={'none'} style={style}>\n {logoComponent}\n </Flexbox>\n );\n\n break;\n }\n }\n\n if (!extra) return logoComponent;\n\n const extraSize = Math.round((size / 3) * 1.9);\n\n return (\n <Flexbox\n horizontal\n align={'center'}\n className={className}\n flex={'none'}\n style={style}\n {...rest}\n >\n {logoComponent}\n <Divider size={extraSize} style={{ color: cssVar.colorFill }} />\n <div className={styles.extraTitle} style={{ fontSize: extraSize }}>\n {extra}\n </div>\n </Flexbox>\n );\n },\n);\n\nLobeHub.displayName = 'LobeHubBrand';\n\nexport default LobeHub;\n"],"mappings":";;;;;;;;;;;;AAqBA,MAAM,UAAU,MACb,EAAE,OAAO,MAAM,OAAO,IAAI,OAAO,OAAO,WAAW,GAAG,WAAW;CAChE,IAAI;CAEJ,QAAQ,MAAR;EACE,KAAK;GACH,gBAAgB,oBAAC,QAAD;IAAc;IAAM,GAAI;GAAO,CAAA;GAC/C;EAEF,KAAK;GACH,gBAAgB,oBAACA,kBAAD;IAAgB;IAAa;GAAQ,CAAA;GACrD;EAEF,KAAK;GACH,gBAAgB,oBAACC,eAAD;IAAgB;IAAa;GAAQ,CAAA;GACrD;EAEF,KAAK;GACH,gBACE,oBAACC,aAAD;IAAqB;IAAiB;IAAa;IAAO,GAAK;GAAe,CAAA;GAEhF;EAEF,KAAK;GACH,gBACE,qBAAA,YAAA,EAAA,UAAA,CACE,oBAAC,QAAD;IAAQ,KAAI;IAAiB;GAAO,CAAA,GACpC,oBAACA,aAAD;IAAgB;IAAM,OAAO,EAAE,YAAY,KAAK,MAAM,OAAO,CAAC,EAAE;GAAI,CAAA,CACpE,EAAA,CAAA;GAGJ,IAAI,CAAC,OACH,gBACE,oBAACC,mBAAD;IAAS,YAAA;IAAW,OAAO;IAAqB;IAAW,MAAM;IAAe;IAC7E,UAAA;GACM,CAAA;CAKjB;CAEA,IAAI,CAAC,OAAO,OAAO;CAEnB,MAAM,YAAY,KAAK,MAAO,OAAO,IAAK,GAAG;CAE7C,OACE,qBAACA,mBAAD;EACE,YAAA;EACA,OAAO;EACI;EACX,MAAM;EACC;EACP,GAAI;EANN,UAAA;GAQG;GACD,oBAAC,SAAD;IAAS,MAAM;IAAW,OAAO,EAAE,OAAO,OAAO,UAAU;GAAI,CAAA;GAC/D,oBAAC,OAAD;IAAK,WAAW,OAAO;IAAY,OAAO,EAAE,UAAU,UAAU;IAC7D,UAAA;GACE,CAAA;EACE;;AAEb,CACF;AAEA,QAAQ,cAAc"}
@@ -5,10 +5,11 @@ import { LOGO_3D } from "../LobeHub/style.mjs";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  //#region src/brand/Logo3d/index.tsx
7
7
  const Logo3d = ({ size = "1em", style, alt = "LobeHub", ...rest }) => {
8
+ const genCdnUrl = useCdnFn();
8
9
  return /* @__PURE__ */ jsx(Img, {
9
10
  alt,
10
11
  height: size,
11
- src: useCdnFn()(LOGO_3D),
12
+ src: genCdnUrl(LOGO_3D),
12
13
  style,
13
14
  width: size,
14
15
  ...rest
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/brand/Logo3d/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ImageProps } from 'antd';\nimport { type FC } from 'react';\n\nimport { useCdnFn } from '@/ConfigProvider';\nimport Img from '@/Img';\nimport type { ImgProps } from '@/types';\n\nimport { LOGO_3D } from '../LobeHub/style';\n\ntype Logo3dProps = Omit<ImgProps & ImageProps, 'width' | 'height' | 'src'> & {\n size?: number | string;\n};\n\nconst Logo3d: FC<Logo3dProps> = ({ size = '1em', style, alt = 'LobeHub', ...rest }) => {\n const genCdnUrl = useCdnFn();\n return (\n <Img alt={alt} height={size} src={genCdnUrl(LOGO_3D)} style={style} width={size} {...rest} />\n );\n};\n\nLogo3d.displayName = 'LobeHubLogo3d';\n\nexport default Logo3d;\n"],"mappings":";;;;;;AAeA,MAAM,UAA2B,EAAE,OAAO,OAAO,OAAO,MAAM,WAAW,GAAG,WAAW;CAErF,OACE,oBAAC,KAAD;EAAU;EAAK,QAAQ;EAAM,KAFb,SAE0B,CAAC,CAAC,OAAO;EAAU;EAAO,OAAO;EAAM,GAAI;CAAO,CAAA;AAEhG;AAEA,OAAO,cAAc"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../../src/brand/Logo3d/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ImageProps } from 'antd';\nimport { type FC } from 'react';\n\nimport { useCdnFn } from '@/ConfigProvider';\nimport Img from '@/Img';\nimport type { ImgProps } from '@/types';\n\nimport { LOGO_3D } from '../LobeHub/style';\n\ntype Logo3dProps = Omit<ImgProps & ImageProps, 'width' | 'height' | 'src'> & {\n size?: number | string;\n};\n\nconst Logo3d: FC<Logo3dProps> = ({ size = '1em', style, alt = 'LobeHub', ...rest }) => {\n const genCdnUrl = useCdnFn();\n return (\n <Img alt={alt} height={size} src={genCdnUrl(LOGO_3D)} style={style} width={size} {...rest} />\n );\n};\n\nLogo3d.displayName = 'LobeHubLogo3d';\n\nexport default Logo3d;\n"],"mappings":";;;;;;AAeA,MAAM,UAA2B,EAAE,OAAO,OAAO,OAAO,MAAM,WAAW,GAAG,WAAW;CACrF,MAAM,YAAY,SAAS;CAC3B,OACE,oBAAC,KAAD;EAAU;EAAK,QAAQ;EAAM,KAAK,UAAU,OAAO;EAAU;EAAO,OAAO;EAAM,GAAI;CAAO,CAAA;AAEhG;AAEA,OAAO,cAAc"}
@@ -5,12 +5,13 @@ import { jsx } from "react/jsx-runtime";
5
5
  import { cx } from "antd-style";
6
6
  //#region src/chat/ChatItem/components/Actions.tsx
7
7
  const Actions = ({ actions, placement = "left", variant = "bubble", editing, ref }) => {
8
+ const actionsClassName = useMemo(() => {
9
+ if (variant === "bubble") return placement === "left" ? styles.actionsBubbleLeft : styles.actionsBubbleRight;
10
+ return placement === "left" ? styles.actionsDocsLeft : styles.actionsDocsRight;
11
+ }, [placement, variant]);
8
12
  return /* @__PURE__ */ jsx(FlexBasic_default, {
9
13
  align: "flex-start",
10
- className: cx(useMemo(() => {
11
- if (variant === "bubble") return placement === "left" ? styles.actionsBubbleLeft : styles.actionsBubbleRight;
12
- return placement === "left" ? styles.actionsDocsLeft : styles.actionsDocsRight;
13
- }, [placement, variant]), editing && styles.actionsEditing),
14
+ className: cx(actionsClassName, editing && styles.actionsEditing),
14
15
  ref,
15
16
  role: "menubar",
16
17
  children: actions
@@ -1 +1 @@
1
- {"version":3,"file":"Actions.mjs","names":["Flexbox"],"sources":["../../../../src/chat/ChatItem/components/Actions.tsx"],"sourcesContent":["import { cx } from 'antd-style';\nimport { type FC, type Ref, useMemo } from 'react';\n\nimport { type ChatItemProps } from '@/chat/ChatItem';\nimport { Flexbox } from '@/Flex';\n\nimport { styles } from '../style';\n\nexport interface ActionsProps {\n actions: ChatItemProps['actions'];\n editing?: boolean;\n placement?: ChatItemProps['placement'];\n ref?: Ref<HTMLDivElement>;\n variant?: ChatItemProps['variant'];\n}\n\nconst Actions: FC<ActionsProps> = ({\n actions,\n placement = 'left',\n variant = 'bubble',\n editing,\n ref,\n}) => {\n const actionsClassName = useMemo(() => {\n if (variant === 'bubble') {\n return placement === 'left' ? styles.actionsBubbleLeft : styles.actionsBubbleRight;\n }\n return placement === 'left' ? styles.actionsDocsLeft : styles.actionsDocsRight;\n }, [placement, variant]);\n\n return (\n <Flexbox\n align={'flex-start'}\n className={cx(actionsClassName, editing && styles.actionsEditing)}\n ref={ref}\n role=\"menubar\"\n >\n {actions}\n </Flexbox>\n );\n};\n\nexport default Actions;\n"],"mappings":";;;;;;AAgBA,MAAM,WAA6B,EACjC,SACA,YAAY,QACZ,UAAU,UACV,SACA,UACI;CAQJ,OACE,oBAACA,mBAAD;EACE,OAAO;EACP,WAAW,GAVU,cAAc;GACrC,IAAI,YAAY,UACd,OAAO,cAAc,SAAS,OAAO,oBAAoB,OAAO;GAElE,OAAO,cAAc,SAAS,OAAO,kBAAkB,OAAO;EAChE,GAAG,CAAC,WAAW,OAAO,CAKW,GAAG,WAAW,OAAO,cAAc;EAC3D;EACL,MAAK;EAEJ,UAAA;CACM,CAAA;AAEb"}
1
+ {"version":3,"file":"Actions.mjs","names":["Flexbox"],"sources":["../../../../src/chat/ChatItem/components/Actions.tsx"],"sourcesContent":["import { cx } from 'antd-style';\nimport { type FC, type Ref, useMemo } from 'react';\n\nimport { type ChatItemProps } from '@/chat/ChatItem';\nimport { Flexbox } from '@/Flex';\n\nimport { styles } from '../style';\n\nexport interface ActionsProps {\n actions: ChatItemProps['actions'];\n editing?: boolean;\n placement?: ChatItemProps['placement'];\n ref?: Ref<HTMLDivElement>;\n variant?: ChatItemProps['variant'];\n}\n\nconst Actions: FC<ActionsProps> = ({\n actions,\n placement = 'left',\n variant = 'bubble',\n editing,\n ref,\n}) => {\n const actionsClassName = useMemo(() => {\n if (variant === 'bubble') {\n return placement === 'left' ? styles.actionsBubbleLeft : styles.actionsBubbleRight;\n }\n return placement === 'left' ? styles.actionsDocsLeft : styles.actionsDocsRight;\n }, [placement, variant]);\n\n return (\n <Flexbox\n align={'flex-start'}\n className={cx(actionsClassName, editing && styles.actionsEditing)}\n ref={ref}\n role=\"menubar\"\n >\n {actions}\n </Flexbox>\n );\n};\n\nexport default Actions;\n"],"mappings":";;;;;;AAgBA,MAAM,WAA6B,EACjC,SACA,YAAY,QACZ,UAAU,UACV,SACA,UACI;CACJ,MAAM,mBAAmB,cAAc;EACrC,IAAI,YAAY,UACd,OAAO,cAAc,SAAS,OAAO,oBAAoB,OAAO;EAElE,OAAO,cAAc,SAAS,OAAO,kBAAkB,OAAO;CAChE,GAAG,CAAC,WAAW,OAAO,CAAC;CAEvB,OACE,oBAACA,mBAAD;EACE,OAAO;EACP,WAAW,GAAG,kBAAkB,WAAW,OAAO,cAAc;EAC3D;EACL,MAAK;EAEJ,UAAA;CACM,CAAA;AAEb"}
@@ -27,8 +27,9 @@ const ChatList = memo(({ onActionsClick, onAvatarsClick, renderMessagesExtra, cl
27
27
  variant
28
28
  };
29
29
  const historyLength = data.length;
30
+ const enableHistoryDivider = enableHistoryCount && historyLength > historyCount && historyCount === historyLength - index + 1;
30
31
  return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(HistoryDivider, {
31
- enable: enableHistoryCount && historyLength > historyCount && historyCount === historyLength - index + 1,
32
+ enable: enableHistoryDivider,
32
33
  text: text?.history
33
34
  }), /* @__PURE__ */ jsx(ChatListItem, {
34
35
  ...itemProps,
@@ -1 +1 @@
1
- {"version":3,"file":"ChatList.mjs","names":[],"sources":["../../../src/chat/ChatList/ChatList.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { Fragment, memo } from 'react';\n\nimport ChatListItem from './components/ChatListItem';\nimport HistoryDivider from './components/HistoryDivider';\nimport { styles } from './style';\nimport type { ChatListProps } from './type';\n\nconst ChatList = memo<ChatListProps>(\n ({\n onActionsClick,\n onAvatarsClick,\n renderMessagesExtra,\n className,\n data,\n variant = 'bubble',\n text,\n showTitle,\n onMessageChange,\n renderMessages,\n renderErrorMessages,\n loadingId,\n renderItems,\n enableHistoryCount,\n renderActions,\n historyCount = 0,\n showAvatar,\n ...rest\n }) => {\n return (\n <div className={cx(styles.container, className)} {...rest}>\n {data.map((item, index) => {\n const itemProps = {\n loading: loadingId === item.id,\n onActionsClick,\n onAvatarsClick,\n onMessageChange,\n renderActions,\n renderErrorMessages,\n renderItems,\n renderMessages,\n renderMessagesExtra,\n showAvatar,\n showTitle,\n text,\n variant,\n };\n\n const historyLength = data.length;\n const enableHistoryDivider =\n enableHistoryCount &&\n historyLength > historyCount &&\n historyCount === historyLength - index + 1;\n\n return (\n <Fragment key={item.id}>\n <HistoryDivider enable={enableHistoryDivider} text={text?.history} />\n <ChatListItem {...itemProps} {...item} />\n </Fragment>\n );\n })}\n </div>\n );\n },\n);\n\nexport default ChatList;\n"],"mappings":";;;;;;;;AAUA,MAAM,WAAW,MACd,EACC,gBACA,gBACA,qBACA,WACA,MACA,UAAU,UACV,MACA,WACA,iBACA,gBACA,qBACA,WACA,aACA,oBACA,eACA,eAAe,GACf,YACA,GAAG,WACC;CACJ,OACE,oBAAC,OAAD;EAAK,WAAW,GAAG,OAAO,WAAW,SAAS;EAAG,GAAI;EAClD,UAAA,KAAK,KAAK,MAAM,UAAU;GACzB,MAAM,YAAY;IAChB,SAAS,cAAc,KAAK;IAC5B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GAEA,MAAM,gBAAgB,KAAK;GAM3B,OACE,qBAAC,UAAD,EAAA,UAAA,CACE,oBAAC,gBAAD;IAAgB,QANlB,sBACA,gBAAgB,gBAChB,iBAAiB,gBAAgB,QAAQ;IAIO,MAAM,MAAM;GAAU,CAAA,GACpE,oBAAC,cAAD;IAAc,GAAI;IAAW,GAAI;GAAO,CAAA,CAChC,EAAA,GAHK,KAAK,EAGV;EAEd,CAAC;CACE,CAAA;AAET,CACF"}
1
+ {"version":3,"file":"ChatList.mjs","names":[],"sources":["../../../src/chat/ChatList/ChatList.tsx"],"sourcesContent":["'use client';\n\nimport { cx } from 'antd-style';\nimport { Fragment, memo } from 'react';\n\nimport ChatListItem from './components/ChatListItem';\nimport HistoryDivider from './components/HistoryDivider';\nimport { styles } from './style';\nimport type { ChatListProps } from './type';\n\nconst ChatList = memo<ChatListProps>(\n ({\n onActionsClick,\n onAvatarsClick,\n renderMessagesExtra,\n className,\n data,\n variant = 'bubble',\n text,\n showTitle,\n onMessageChange,\n renderMessages,\n renderErrorMessages,\n loadingId,\n renderItems,\n enableHistoryCount,\n renderActions,\n historyCount = 0,\n showAvatar,\n ...rest\n }) => {\n return (\n <div className={cx(styles.container, className)} {...rest}>\n {data.map((item, index) => {\n const itemProps = {\n loading: loadingId === item.id,\n onActionsClick,\n onAvatarsClick,\n onMessageChange,\n renderActions,\n renderErrorMessages,\n renderItems,\n renderMessages,\n renderMessagesExtra,\n showAvatar,\n showTitle,\n text,\n variant,\n };\n\n const historyLength = data.length;\n const enableHistoryDivider =\n enableHistoryCount &&\n historyLength > historyCount &&\n historyCount === historyLength - index + 1;\n\n return (\n <Fragment key={item.id}>\n <HistoryDivider enable={enableHistoryDivider} text={text?.history} />\n <ChatListItem {...itemProps} {...item} />\n </Fragment>\n );\n })}\n </div>\n );\n },\n);\n\nexport default ChatList;\n"],"mappings":";;;;;;;;AAUA,MAAM,WAAW,MACd,EACC,gBACA,gBACA,qBACA,WACA,MACA,UAAU,UACV,MACA,WACA,iBACA,gBACA,qBACA,WACA,aACA,oBACA,eACA,eAAe,GACf,YACA,GAAG,WACC;CACJ,OACE,oBAAC,OAAD;EAAK,WAAW,GAAG,OAAO,WAAW,SAAS;EAAG,GAAI;EAClD,UAAA,KAAK,KAAK,MAAM,UAAU;GACzB,MAAM,YAAY;IAChB,SAAS,cAAc,KAAK;IAC5B;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;IACA;GACF;GAEA,MAAM,gBAAgB,KAAK;GAC3B,MAAM,uBACJ,sBACA,gBAAgB,gBAChB,iBAAiB,gBAAgB,QAAQ;GAE3C,OACE,qBAAC,UAAD,EAAA,UAAA,CACE,oBAAC,gBAAD;IAAgB,QAAQ;IAAsB,MAAM,MAAM;GAAU,CAAA,GACpE,oBAAC,cAAD;IAAc,GAAI;IAAW,GAAI;GAAO,CAAA,CAChC,EAAA,GAHK,KAAK,EAGV;EAEd,CAAC;CACE,CAAA;AAET,CACF"}
@@ -22,8 +22,6 @@ const ScaleRow = memo(({ name, title, scale }) => {
22
22
  backgroundColor: "#000"
23
23
  };
24
24
  isAlpha = true;
25
- break;
26
- default: break;
27
25
  }
28
26
  return /* @__PURE__ */ jsxs(Space, {
29
27
  size: 2,
@@ -1 +1 @@
1
- {"version":3,"file":"ScaleRow.mjs","names":["Flexbox"],"sources":["../../../src/color/ColorScales/ScaleRow.tsx"],"sourcesContent":["import { message, Space } from 'antd';\nimport { memo } from 'react';\n\nimport { Flexbox } from '@/Flex';\nimport { copyToClipboard } from '@/utils/copyToClipboard';\n\nimport { alphaBg, styles } from './style';\n\nexport interface IScaleRow {\n name: string;\n scale: string[];\n title: 'light' | 'lightA' | 'dark' | 'darkA';\n}\n\nconst ScaleRow = memo<IScaleRow>(({ name, title, scale }) => {\n let style = {};\n let isAlpha = false;\n\n switch (title) {\n case 'lightA': {\n style = { background: alphaBg.light, backgroundColor: '#fff' };\n isAlpha = true;\n break;\n }\n case 'darkA': {\n style = { background: alphaBg.dark, backgroundColor: '#000' };\n isAlpha = true;\n break;\n }\n default: {\n break;\n }\n }\n\n return (\n <Space size={2}>\n <div className={styles.scaleRowTitle} key={title}>\n <div className={styles.text}>{title}</div>\n </div>\n {scale.map((color, index) => {\n if (index === 0 || index === 12) return false;\n\n return (\n <div\n className={styles.scaleBox}\n key={index}\n style={style}\n title={color}\n onClick={async () => {\n const content = `token.${name}${index}${isAlpha ? 'A' : ''} /* ${color} */`;\n\n await copyToClipboard(content);\n message.success(content);\n }}\n >\n <Flexbox\n horizontal\n align={'center'}\n className={styles.scaleItem}\n justify={'center'}\n style={{ backgroundColor: color }}\n />\n </div>\n );\n })}\n </Space>\n );\n});\n\nexport default ScaleRow;\n"],"mappings":";;;;;;;AAcA,MAAM,WAAW,MAAiB,EAAE,MAAM,OAAO,YAAY;CAC3D,IAAI,QAAQ,CAAC;CACb,IAAI,UAAU;CAEd,QAAQ,OAAR;EACE,KAAK;GACH,QAAQ;IAAE,YAAY,QAAQ;IAAO,iBAAiB;GAAO;GAC7D,UAAU;GACV;EAEF,KAAK;GACH,QAAQ;IAAE,YAAY,QAAQ;IAAM,iBAAiB;GAAO;GAC5D,UAAU;GACV;EAEF,SACE;CAEJ;CAEA,OACE,qBAAC,OAAD;EAAO,MAAM;EAAb,UAAA,CACE,oBAAC,OAAD;GAAK,WAAW,OAAO;GACrB,UAAA,oBAAC,OAAD;IAAK,WAAW,OAAO;IAAO,UAAA;GAAW,CAAA;EACtC,GAFsC,KAEtC,GACJ,MAAM,KAAK,OAAO,UAAU;GAC3B,IAAI,UAAU,KAAK,UAAU,IAAI,OAAO;GAExC,OACE,oBAAC,OAAD;IACE,WAAW,OAAO;IAEX;IACP,OAAO;IACP,SAAS,YAAY;KACnB,MAAM,UAAU,SAAS,OAAO,QAAQ,UAAU,MAAM,GAAG,MAAM,MAAM;KAEvE,MAAM,gBAAgB,OAAO;KAC7B,QAAQ,QAAQ,OAAO;IACzB;IAEA,UAAA,oBAACA,mBAAD;KACE,YAAA;KACA,OAAO;KACP,WAAW,OAAO;KAClB,SAAS;KACT,OAAO,EAAE,iBAAiB,MAAM;IACjC,CAAA;GACE,GAjBE,KAiBF;EAET,CAAC,CACI;;AAEX,CAAC"}
1
+ {"version":3,"file":"ScaleRow.mjs","names":["Flexbox"],"sources":["../../../src/color/ColorScales/ScaleRow.tsx"],"sourcesContent":["import { message, Space } from 'antd';\nimport { memo } from 'react';\n\nimport { Flexbox } from '@/Flex';\nimport { copyToClipboard } from '@/utils/copyToClipboard';\n\nimport { alphaBg, styles } from './style';\n\nexport interface IScaleRow {\n name: string;\n scale: string[];\n title: 'light' | 'lightA' | 'dark' | 'darkA';\n}\n\nconst ScaleRow = memo<IScaleRow>(({ name, title, scale }) => {\n let style = {};\n let isAlpha = false;\n\n switch (title) {\n case 'lightA': {\n style = { background: alphaBg.light, backgroundColor: '#fff' };\n isAlpha = true;\n break;\n }\n case 'darkA': {\n style = { background: alphaBg.dark, backgroundColor: '#000' };\n isAlpha = true;\n break;\n }\n default: {\n break;\n }\n }\n\n return (\n <Space size={2}>\n <div className={styles.scaleRowTitle} key={title}>\n <div className={styles.text}>{title}</div>\n </div>\n {scale.map((color, index) => {\n if (index === 0 || index === 12) return false;\n\n return (\n <div\n className={styles.scaleBox}\n key={index}\n style={style}\n title={color}\n onClick={async () => {\n const content = `token.${name}${index}${isAlpha ? 'A' : ''} /* ${color} */`;\n\n await copyToClipboard(content);\n message.success(content);\n }}\n >\n <Flexbox\n horizontal\n align={'center'}\n className={styles.scaleItem}\n justify={'center'}\n style={{ backgroundColor: color }}\n />\n </div>\n );\n })}\n </Space>\n );\n});\n\nexport default ScaleRow;\n"],"mappings":";;;;;;;AAcA,MAAM,WAAW,MAAiB,EAAE,MAAM,OAAO,YAAY;CAC3D,IAAI,QAAQ,CAAC;CACb,IAAI,UAAU;CAEd,QAAQ,OAAR;EACE,KAAK;GACH,QAAQ;IAAE,YAAY,QAAQ;IAAO,iBAAiB;GAAO;GAC7D,UAAU;GACV;EAEF,KAAK;GACH,QAAQ;IAAE,YAAY,QAAQ;IAAM,iBAAiB;GAAO;GAC5D,UAAU;CAMd;CAEA,OACE,qBAAC,OAAD;EAAO,MAAM;EAAb,UAAA,CACE,oBAAC,OAAD;GAAK,WAAW,OAAO;GACrB,UAAA,oBAAC,OAAD;IAAK,WAAW,OAAO;IAAO,UAAA;GAAW,CAAA;EACtC,GAFsC,KAEtC,GACJ,MAAM,KAAK,OAAO,UAAU;GAC3B,IAAI,UAAU,KAAK,UAAU,IAAI,OAAO;GAExC,OACE,oBAAC,OAAD;IACE,WAAW,OAAO;IAEX;IACP,OAAO;IACP,SAAS,YAAY;KACnB,MAAM,UAAU,SAAS,OAAO,QAAQ,UAAU,MAAM,GAAG,MAAM,MAAM;KAEvE,MAAM,gBAAgB,OAAO;KAC7B,QAAQ,QAAQ,OAAO;IACzB;IAEA,UAAA,oBAACA,mBAAD;KACE,YAAA;KACA,OAAO;KACP,WAAW,OAAO;KAClB,SAAS;KACT,OAAO,EAAE,iBAAiB,MAAM;IACjC,CAAA;GACE,GAjBE,KAiBF;EAET,CAAC,CACI;;AAEX,CAAC"}
@@ -30,7 +30,8 @@ const createMermaidOptions = (customTheme) => isNamedTheme(customTheme) ? THEMES
30
30
  const renderMermaid = (content, scopeId, customTheme) => {
31
31
  if (!content) return { svg: "" };
32
32
  try {
33
- return { svg: prepareInlineMermaidSvg(renderMermaidSVG(content, createMermaidOptions(customTheme)), scopeId) };
33
+ const svg = renderMermaidSVG(content, createMermaidOptions(customTheme));
34
+ return { svg: prepareInlineMermaidSvg(svg, scopeId) };
34
35
  } catch {
35
36
  return {
36
37
  error: "unsupported",
@@ -1 +1 @@
1
- {"version":3,"file":"useMermaid.mjs","names":[],"sources":["../../src/hooks/useMermaid.ts"],"sourcesContent":["'use client';\n\nimport { useThemeMode } from 'antd-style';\nimport { renderMermaidSVG, type RenderOptions, type ThemeName, THEMES } from 'beautiful-mermaid';\nimport { useEffect, useId, useMemo, useState } from 'react';\n\nimport { prepareInlineMermaidSvg } from '@/Mermaid/SyntaxMermaid/prepareInlineSvg';\n\nimport { createCdnMermaidConfig, renderWithCdnMermaid } from './useMermaidCdn';\n\nexport type MermaidThemeName = 'lobe-theme' | ThemeName;\n\nexport interface MermaidRenderResult {\n error?: string;\n loading?: boolean;\n svg: string;\n}\n\n/**\n * beautiful-mermaid emits these as CSS custom properties on the SVG root and\n * derives the rest with color-mix(), so pointing them at antd's variables lets\n * the diagram follow the theme through CSS alone — no token subscription, and\n * no re-render (or re-layout) when the appearance changes.\n */\nconst LOBE_THEME_OPTIONS: RenderOptions = {\n accent: 'var(--ant-color-primary)',\n bg: 'var(--ant-color-bg-container)',\n border: 'var(--ant-color-border)',\n fg: 'var(--ant-color-text)',\n line: 'var(--ant-color-text-secondary)',\n muted: 'var(--ant-color-text-description)',\n surface: 'var(--ant-color-fill-tertiary)',\n transparent: true,\n};\n\nconst isNamedTheme = (theme?: MermaidThemeName): theme is ThemeName =>\n !!theme && theme !== 'lobe-theme' && theme in THEMES;\n\nexport const createMermaidOptions = (customTheme?: MermaidThemeName): RenderOptions =>\n isNamedTheme(customTheme) ? THEMES[customTheme]! : LOBE_THEME_OPTIONS;\n\n/**\n * beautiful-mermaid covers six diagram types; anything else throws here and is\n * handed to the CDN-loaded upstream mermaid instead.\n */\nexport const renderMermaid = (\n content: string,\n scopeId: string,\n customTheme?: MermaidThemeName,\n): MermaidRenderResult => {\n if (!content) return { svg: '' };\n try {\n const svg = renderMermaidSVG(content, createMermaidOptions(customTheme));\n return { svg: prepareInlineMermaidSvg(svg, scopeId) };\n } catch {\n return { error: 'unsupported', svg: '' };\n }\n};\n\nexport const useCdnMermaidFallback = (\n content: string,\n { enabled, theme: customTheme }: { enabled: boolean; theme?: MermaidThemeName },\n): MermaidRenderResult => {\n const { isDarkMode } = useThemeMode();\n const reactId = useId();\n const [result, setResult] = useState<MermaidRenderResult>({ svg: '' });\n\n useEffect(() => {\n if (!enabled || !content) {\n setResult({ svg: '' });\n return;\n }\n\n let active = true;\n setResult({ loading: true, svg: '' });\n\n const config = createCdnMermaidConfig(\n isDarkMode,\n isNamedTheme(customTheme) ? customTheme : undefined,\n );\n\n renderWithCdnMermaid(content, `mermaid-cdn-${reactId.replaceAll(':', '')}`, config)\n .then((svg) => {\n if (!active) return;\n setResult(svg ? { svg } : { error: 'Failed to render diagram', svg: '' });\n })\n .catch(() => {\n if (active) setResult({ error: 'Failed to render diagram', svg: '' });\n });\n\n return () => {\n active = false;\n };\n }, [enabled, content, isDarkMode, customTheme, reactId]);\n\n return result;\n};\n\nexport const useMermaid = (\n content: string,\n { theme: customTheme }: { theme?: MermaidThemeName } = {},\n): MermaidRenderResult => {\n const reactId = useId();\n const scopeId = useMemo(() => `mermaid-${reactId.replaceAll(':', '')}`, [reactId]);\n\n const primary = useMemo(\n () => renderMermaid(content, scopeId, customTheme),\n [content, scopeId, customTheme],\n );\n\n const fallback = useCdnMermaidFallback(content, {\n enabled: Boolean(primary.error),\n theme: customTheme,\n });\n\n return primary.error ? fallback : primary;\n};\n"],"mappings":";;;;;;;;;;;;;AAwBA,MAAM,qBAAoC;CACxC,QAAQ;CACR,IAAI;CACJ,QAAQ;CACR,IAAI;CACJ,MAAM;CACN,OAAO;CACP,SAAS;CACT,aAAa;AACf;AAEA,MAAM,gBAAgB,UACpB,CAAC,CAAC,SAAS,UAAU,gBAAgB,SAAS;AAEhD,MAAa,wBAAwB,gBACnC,aAAa,WAAW,IAAI,OAAO,eAAgB;;;;;AAMrD,MAAa,iBACX,SACA,SACA,gBACwB;CACxB,IAAI,CAAC,SAAS,OAAO,EAAE,KAAK,GAAG;CAC/B,IAAI;EAEF,OAAO,EAAE,KAAK,wBADF,iBAAiB,SAAS,qBAAqB,WAAW,CAC9B,GAAG,OAAO,EAAE;CACtD,QAAQ;EACN,OA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ources":["../../src/hooks/useMermaid.ts"],"sourcesContent":["'use client';\n\nimport { useThemeMode } from 'antd-style';\nimport { renderMermaidSVG, type RenderOptions, type ThemeName, THEMES } from 'beautiful-mermaid';\nimport { useEffect, useId, useMemo, useState } from 'react';\n\nimport { prepareInlineMermaidSvg } from '@/Mermaid/SyntaxMermaid/prepareInlineSvg';\n\nimport { createCdnMermaidConfig, renderWithCdnMermaid } from './useMermaidCdn';\n\nexport type MermaidThemeName = 'lobe-theme' | ThemeName;\n\nexport interface MermaidRenderResult {\n error?: string;\n loading?: boolean;\n svg: string;\n}\n\n/**\n * beautiful-mermaid emits these as CSS custom properties on the SVG root and\n * derives the rest with color-mix(), so pointing them at antd's variables lets\n * the diagram follow the theme through CSS alone — no token subscription, and\n * no re-render (or re-layout) when the appearance changes.\n */\nconst LOBE_THEME_OPTIONS: RenderOptions = {\n accent: 'var(--ant-color-primary)',\n bg: 'var(--ant-color-bg-container)',\n border: 'var(--ant-color-border)',\n fg: 'var(--ant-color-text)',\n line: 'var(--ant-color-text-secondary)',\n muted: 'var(--ant-color-text-description)',\n surface: 'var(--ant-color-fill-tertiary)',\n transparent: true,\n};\n\nconst isNamedTheme = (theme?: MermaidThemeName): theme is ThemeName =>\n !!theme && theme !== 'lobe-theme' && theme in THEMES;\n\nexport const createMermaidOptions = (customTheme?: MermaidThemeName): RenderOptions =>\n isNamedTheme(customTheme) ? THEMES[customTheme]! : LOBE_THEME_OPTIONS;\n\n/**\n * beautiful-mermaid covers six diagram types; anything else throws here and is\n * handed to the CDN-loaded upstream mermaid instead.\n */\nexport const renderMermaid = (\n content: string,\n scopeId: string,\n customTheme?: MermaidThemeName,\n): MermaidRenderResult => {\n if (!content) return { svg: '' };\n try {\n const svg = renderMermaidSVG(content, createMermaidOptions(customTheme));\n return { svg: prepareInlineMermaidSvg(svg, scopeId) };\n } catch {\n return { error: 'unsupported', svg: '' };\n }\n};\n\nexport const useCdnMermaidFallback = (\n content: string,\n { enabled, theme: customTheme }: { enabled: boolean; theme?: MermaidThemeName },\n): MermaidRenderResult => {\n const { isDarkMode } = useThemeMode();\n const reactId = useId();\n const [result, setResult] = useState<MermaidRenderResult>({ svg: '' });\n\n useEffect(() => {\n if (!enabled || !content) {\n setResult({ svg: '' });\n return;\n }\n\n let active = true;\n setResult({ loading: true, svg: '' });\n\n const config = createCdnMermaidConfig(\n isDarkMode,\n isNamedTheme(customTheme) ? customTheme : undefined,\n );\n\n renderWithCdnMermaid(content, `mermaid-cdn-${reactId.replaceAll(':', '')}`, config)\n .then((svg) => {\n if (!active) return;\n setResult(svg ? { svg } : { error: 'Failed to render diagram', svg: '' });\n })\n .catch(() => {\n if (active) setResult({ error: 'Failed to render diagram', svg: '' });\n });\n\n return () => {\n active = false;\n };\n }, [enabled, content, isDarkMode, customTheme, reactId]);\n\n return result;\n};\n\nexport const useMermaid = (\n content: string,\n { theme: customTheme }: { theme?: MermaidThemeName } = {},\n): MermaidRenderResult => {\n const reactId = useId();\n const scopeId = useMemo(() => `mermaid-${reactId.replaceAll(':', '')}`, [reactId]);\n\n const primary = useMemo(\n () => renderMermaid(content, scopeId, customTheme),\n [content, scopeId, customTheme],\n );\n\n const fallback = useCdnMermaidFallback(content, {\n enabled: Boolean(primary.error),\n theme: customTheme,\n });\n\n return primary.error ? fallback : primary;\n};\n"],"mappings":";;;;;;;;;;;;;AAwBA,MAAM,qBAAoC;CACxC,QAAQ;CACR,IAAI;CACJ,QAAQ;CACR,IAAI;CACJ,MAAM;CACN,OAAO;CACP,SAAS;CACT,aAAa;AACf;AAEA,MAAM,gBAAgB,UACpB,CAAC,CAAC,SAAS,UAAU,gBAAgB,SAAS;AAEhD,MAAa,wBAAwB,gBACnC,aAAa,WAAW,IAAI,OAAO,eAAgB;;;;;AAMrD,MAAa,iBACX,SACA,SACA,gBACwB;CACxB,IAAI,CAAC,SAAS,OAAO,EAAE,KAAK,GAAG;CAC/B,IAAI;EACF,MAAM,MAAM,iBAAiB,SAAS,qBAAqB,WAAW,CAAC;E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AAO,QAAQ,QAAQ,WAAW;AACpC"}
@@ -1,5 +1,6 @@
1
1
  //#region src/i18n/resources/en/image.d.ts
2
2
  declare const _default: {
3
+ readonly 'image.close': "Close";
3
4
  readonly 'image.copy': "Copy";
4
5
  readonly 'image.copyFailed': "Copy Failed";
5
6
  readonly 'image.copySuccess': "Copy Success";
@@ -8,10 +9,14 @@ declare const _default: {
8
9
  readonly 'image.downloadSuccess': "Download Success";
9
10
  readonly 'image.flipHorizontal': "Flip Horizontal";
10
11
  readonly 'image.flipVertical': "Flip Vertical";
12
+ readonly 'image.more': "More";
13
+ readonly 'image.next': "Next";
14
+ readonly 'image.prev': "Previous";
11
15
  readonly 'image.rotateLeft': "Rotate Left";
12
16
  readonly 'image.rotateRight': "Rotate Right";
13
17
  readonly 'image.zoomIn': "Zoom In";
14
18
  readonly 'image.zoomOut': "Zoom Out";
19
+ readonly 'image.zoomReset': "Reset Zoom";
15
20
  };
16
21
  //#endregion
17
22
  export { _default as default };
@@ -1,5 +1,6 @@
1
1
  //#region src/i18n/resources/en/image.ts
2
2
  var image_default = {
3
+ "image.close": "Close",
3
4
  "image.copy": "Copy",
4
5
  "image.copyFailed": "Copy Failed",
5
6
  "image.copySuccess": "Copy Success",
@@ -8,10 +9,14 @@ var image_default = {
8
9
  "image.downloadSuccess": "Download Success",
9
10
  "image.flipHorizontal": "Flip Horizontal",
10
11
  "image.flipVertical": "Flip Vertical",
12
+ "image.more": "More",
13
+ "image.next": "Next",
14
+ "image.prev": "Previous",
11
15
  "image.rotateLeft": "Rotate Left",
12
16
  "image.rotateRight": "Rotate Right",
13
17
  "image.zoomIn": "Zoom In",
14
- "image.zoomOut": "Zoom Out"
18
+ "image.zoomOut": "Zoom Out",
19
+ "image.zoomReset": "Reset Zoom"
15
20
  };
16
21
  //#endregion
17
22
  export { image_default as default };
@@ -1 +1 @@
1
- {"version":3,"file":"image.mjs","names":[],"sources":["../../../../src/i18n/resources/en/image.ts"],"sourcesContent":["export default {\n 'image.copy': 'Copy',\n 'image.copyFailed': 'Copy Failed',\n 'image.copySuccess': 'Copy Success',\n 'image.download': 'Download',\n 'image.downloadFailed': 'Download Failed',\n 'image.downloadSuccess': 'Download Success',\n 'image.flipHorizontal': 'Flip Horizontal',\n 'image.flipVertical': 'Flip Vertical',\n 'image.rotateLeft': 'Rotate Left',\n 'image.rotateRight': 'Rotate Right',\n 'image.zoomIn': 'Zoom In',\n 'image.zoomOut': 'Zoom Out',\n} as const;\n"],"mappings":";AAAA,IAAA,gBAAe;CACb,cAAc;CACd,oBAAoB;CACpB,qBAAqB;CACrB,kBAAkB;CAClB,wBAAwB;CACxB,yBAAyB;CACzB,wBAAwB;CACxB,sBAAsB;CACtB,oBAAoB;CACpB,qBAAqB;CACrB,gBAAgB;CAChB,iBAAiB;AACnB"}
1
+ {"version":3,"file":"image.mjs","names":[],"sources":["../../../../src/i18n/resources/en/image.ts"],"sourcesContent":["export default {\n 'image.close': 'Close',\n 'image.copy': 'Copy',\n 'image.copyFailed': 'Copy Failed',\n 'image.copySuccess': 'Copy Success',\n 'image.download': 'Download',\n 'image.downloadFailed': 'Download Failed',\n 'image.downloadSuccess': 'Download Success',\n 'image.flipHorizontal': 'Flip Horizontal',\n 'image.flipVertical': 'Flip Vertical',\n 'image.more': 'More',\n 'image.next': 'Next',\n 'image.prev': 'Previous',\n 'image.rotateLeft': 'Rotate Left',\n 'image.rotateRight': 'Rotate Right',\n 'image.zoomIn': 'Zoom In',\n 'image.zoomOut': 'Zoom Out',\n 'image.zoomReset': 'Reset Zoom',\n} as const;\n"],"mappings":";AAAA,IAAA,gBAAe;CACb,eAAe;CACf,cAAc;CACd,oBAAoB;CACpB,qBAAqB;CACrB,kBAAkB;CAClB,wBAAwB;CACxB,yBAAyB;CACzB,wBAAwB;CACxB,sBAAsB;CACtB,cAAc;CACd,cAAc;CACd,cAAc;CACd,oBAAoB;CACpB,qBAAqB;CACrB,gBAAgB;CAChB,iBAAiB;CACjB,mBAAmB;AACrB"}
@@ -1,5 +1,6 @@
1
1
  //#region src/i18n/resources/zhCn/image.d.ts
2
2
  declare const _default: {
3
+ readonly 'image.close': "关闭";
3
4
  readonly 'image.copy': "复制";
4
5
  readonly 'image.copyFailed': "复制失败";
5
6
  readonly 'image.copySuccess': "复制成功";
@@ -8,10 +9,14 @@ declare const _default: {
8
9
  readonly 'image.downloadSuccess': "下载成功";
9
10
  readonly 'image.flipHorizontal': "水平翻转";
10
11
  readonly 'image.flipVertical': "垂直翻转";
12
+ readonly 'image.more': "更多";
13
+ readonly 'image.next': "下一张";
14
+ readonly 'image.prev': "上一张";
11
15
  readonly 'image.rotateLeft': "向左旋转";
12
16
  readonly 'image.rotateRight': "向右旋转";
13
17
  readonly 'image.zoomIn': "放大";
14
18
  readonly 'image.zoomOut': "缩小";
19
+ readonly 'image.zoomReset': "重置缩放";
15
20
  };
16
21
  //#endregion
17
22
  export { _default as default };
@@ -1,5 +1,6 @@
1
1
  //#region src/i18n/resources/zhCn/image.ts
2
2
  var image_default = {
3
+ "image.close": "关闭",
3
4
  "image.copy": "复制",
4
5
  "image.copyFailed": "复制失败",
5
6
  "image.copySuccess": "复制成功",
@@ -8,10 +9,14 @@ var image_default = {
8
9
  "image.downloadSuccess": "下载成功",
9
10
  "image.flipHorizontal": "水平翻转",
10
11
  "image.flipVertical": "垂直翻转",
12
+ "image.more": "更多",
13
+ "image.next": "下一张",
14
+ "image.prev": "上一张",
11
15
  "image.rotateLeft": "向左旋转",
12
16
  "image.rotateRight": "向右旋转",
13
17
  "image.zoomIn": "放大",
14
- "image.zoomOut": "缩小"
18
+ "image.zoomOut": "缩小",
19
+ "image.zoomReset": "重置缩放"
15
20
  };
16
21
  //#endregion
17
22
  export { image_default as default };
@@ -1 +1 @@
1
- {"version":3,"file":"image.mjs","names":[],"sources":["../../../../src/i18n/resources/zhCn/image.ts"],"sourcesContent":["export default {\n 'image.copy': '复制',\n 'image.copyFailed': '复制失败',\n 'image.copySuccess': '复制成功',\n 'image.download': '下载',\n 'image.downloadFailed': '下载失败',\n 'image.downloadSuccess': '下载成功',\n 'image.flipHorizontal': '水平翻转',\n 'image.flipVertical': '垂直翻转',\n 'image.rotateLeft': '向左旋转',\n 'image.rotateRight': '向右旋转',\n 'image.zoomIn': '放大',\n 'image.zoomOut': '缩小',\n} as const;\n"],"mappings":";AAAA,IAAA,gBAAe;CACb,cAAc;CACd,oBAAoB;CACpB,qBAAqB;CACrB,kBAAkB;CAClB,wBAAwB;CACxB,yBAAyB;CACzB,wBAAwB;CACxB,sBAAsB;CACtB,oBAAoB;CACpB,qBAAqB;CACrB,gBAAgB;CAChB,iBAAiB;AACnB"}
1
+ {"version":3,"file":"image.mjs","names":[],"sources":["../../../../src/i18n/resources/zhCn/image.ts"],"sourcesContent":["export default {\n 'image.close': '关闭',\n 'image.copy': '复制',\n 'image.copyFailed': '复制失败',\n 'image.copySuccess': '复制成功',\n 'image.download': '下载',\n 'image.downloadFailed': '下载失败',\n 'image.downloadSuccess': '下载成功',\n 'image.flipHorizontal': '水平翻转',\n 'image.flipVertical': '垂直翻转',\n 'image.more': '更多',\n 'image.next': '下一张',\n 'image.prev': '上一张',\n 'image.rotateLeft': '向左旋转',\n 'image.rotateRight': '向右旋转',\n 'image.zoomIn': '放大',\n 'image.zoomOut': '缩小',\n 'image.zoomReset': '重置缩放',\n} as const;\n"],"mappings":";AAAA,IAAA,gBAAe;CACb,eAAe;CACf,cAAc;CACd,oBAAoB;CACpB,qBAAqB;CACrB,kBAAkB;CAClB,wBAAwB;CACxB,yBAAyB;CACzB,wBAAwB;CACxB,sBAAsB;CACtB,cAAc;CACd,cAAc;CACd,cAAc;CACd,oBAAoB;CACpB,qBAAqB;CACrB,gBAAgB;CAChB,iBAAiB;CACjB,mBAAmB;AACrB"}
package/es/index.mjs CHANGED
@@ -112,7 +112,15 @@ import Segmented from "./Segmented/Segmented.mjs";
112
112
  import { AUTO_HEIGHT_MESSAGE_TYPE } from "./HtmlPreview/injectAutoHeightScript.mjs";
113
113
  import { HtmlPreviewIframe } from "./HtmlPreview/Iframe.mjs";
114
114
  import HtmlPreview from "./HtmlPreview/HtmlPreview.mjs";
115
+ import SkeletonBlock from "./Skeleton/SkeletonBlock.mjs";
116
+ import SkeletonAvatar from "./Skeleton/SkeletonAvatar.mjs";
117
+ import SkeletonParagraph from "./Skeleton/SkeletonParagraph.mjs";
118
+ import SkeletonTitle from "./Skeleton/SkeletonTitle.mjs";
119
+ import SkeletonButton from "./Skeleton/SkeletonButton.mjs";
120
+ import SkeletonTags from "./Skeleton/SkeletonTags.mjs";
121
+ import Skeleton from "./Skeleton/index.mjs";
115
122
  import PreviewGroup from "./Image/PreviewGroup.mjs";
123
+ import { ToastHost, toast, useToast } from "./base-ui/Toast/imperative.mjs";
116
124
  import Image from "./Image/index.mjs";
117
125
  import ImageSelect from "./ImageSelect/ImageSelect.mjs";
118
126
  import { LayoutFooter } from "./Layout/components/LayoutFooter.mjs";
@@ -147,17 +155,9 @@ import { ScrollArea } from "./base-ui/ScrollArea/ScrollArea.mjs";
147
155
  import SearchBar from "./SearchBar/SearchBar.mjs";
148
156
  import Select from "./Select/Select.mjs";
149
157
  import SideNav from "./SideNav/SideNav.mjs";
150
- import SkeletonBlock from "./Skeleton/SkeletonBlock.mjs";
151
- import SkeletonAvatar from "./Skeleton/SkeletonAvatar.mjs";
152
- import SkeletonParagraph from "./Skeleton/SkeletonParagraph.mjs";
153
- import SkeletonTitle from "./Skeleton/SkeletonTitle.mjs";
154
- import SkeletonButton from "./Skeleton/SkeletonButton.mjs";
155
- import SkeletonTags from "./Skeleton/SkeletonTags.mjs";
156
- import Skeleton from "./Skeleton/index.mjs";
157
158
  import SliderWithInput from "./SliderWithInput/SliderWithInput.mjs";
158
159
  import SortableList from "./SortableList/SortableList.mjs";
159
160
  import ThemeSwitch from "./ThemeSwitch/ThemeSwitch.mjs";
160
- import { ToastHost, toast, useToast } from "./base-ui/Toast/imperative.mjs";
161
161
  import Toc from "./Toc/Toc.mjs";
162
162
  import { ErrorBoundary } from "react-error-boundary";
163
163
  export { A, Accordion, AccordionItem, ActionIcon, ActionIconGroup, Alert, AutoComplete, Avatar, AvatarGroup, Block, Burger, Button, CLASSNAMES, Center, Checkbox, CheckboxGroup, CodeDiff, CodeEditor, Collapse, ColorSwatches, ConfigProvider, ContextMenuHost, ContextMenuTrigger, CopyButton, DatePicker, DownloadButton, DraggablePanel, DraggablePanelBody, DraggablePanelContainer, DraggablePanelFooter, DraggablePanelHeader, DraggableSideNav, Drawer, Dropdown, DropdownMenu, DropdownMenuCheckboxItemIndicator, DropdownMenuCheckboxItemPrimitive, DropdownMenuFooter, DropdownMenuGroup, DropdownMenuGroupLabel, DropdownMenuHeader, DropdownMenuItem, DropdownMenuItemContent, DropdownMenuItemExtra, DropdownMenuItemIcon, DropdownMenuItemLabel, DropdownMenuPopup, DropdownMenuPortal, DropdownMenuPositioner, DropdownMenuRoot, DropdownMenuScrollViewport, DropdownMenuSeparator, DropdownMenuSubmenuArrow, DropdownMenuSubmenuRoot, DropdownMenuSubmenuTrigger, DropdownMenuTrigger, EditableText, EditorSlashMenu, EmojiPicker, Empty, ErrorBoundary, FileTypeIcon, FlexBasic_default as FlexBasic, FlexBasic_default as Flexbox, FluentEmoji, FontLoader, Footer, Form, FormGroup, FormItem, FormModal, FormSubmitFooter, FormTitle, Freeze, Grid, GroupAvatar, GuideCard, DEFAULT_HEIGHT as HTML_PREVIEW_DEFAULT_HEIGHT, DEFAULT_SANDBOX as HTML_PREVIEW_DEFAULT_SANDBOX, AUTO_HEIGHT_MESSAGE_TYPE as HTML_PREVIEW_RESIZE_MESSAGE, Header, Highlighter, Hotkey, HotkeyInput, HtmlPreview, HtmlPreviewIframe, I18nProvider, Icon, IconProvider, Image, ImageSelect, Input, InputNumber, InputOPT, InputPassword, KeyMapEnum, LOBE_THEME_APP_ID, Layout, LayoutFooter, LayoutHeader, LayoutMain, LayoutSidebar, LayoutSidebarInner, LayoutToc, List, ListItem, I18nProvider as LobeUIProvider, Markdown, MaskShadow, MaterialFileTypeIcon, Menu, Mermaid, Meta, Modal, ModalHost, ModalProvider, MotionComponent, MotionProvider, NeuralNetworkLoading, PatchDiff, Popover, PopoverArrow, PopoverArrowIcon, PopoverBackdrop, PopoverGroup, PopoverPopup, PopoverPortal, PopoverPositioner, PopoverProvider, PopoverRoot, PopoverTriggerElement, PopoverViewport, PreviewGroup, ScrollArea, ScrollAreaContent, ScrollAreaCorner, ScrollAreaRoot, ScrollAreaScrollbar, ScrollAreaThumb, ScrollAreaViewport, ScrollShadow, SearchBar, SearchResultCards, Segmented, Select, lobe_theme_default as ShikiLobeTheme, SideNav, Skeleton, SkeletonAvatar, SkeletonBlock, SkeletonButton, SkeletonParagraph, SkeletonTags, SkeletonTitle, SliderWithInput, Snippet, SortableList, SyntaxHighlighter, SyntaxMermaid, Tabs, Tag, Text, TextArea, ThemeProvider, ThemeSwitch, ToastHost, Toc, Tooltip, TooltipGroup, Typography, Video, closeContextMenu, combineKeys, copyToClipboard, createModal, createRawModal, findCustomThemeName, genCdnUrl, generateColorNeutralPalette, generateColorPalette, highlighterThemes, containsScript as htmlPreviewContainsScript, isFullHtmlDocument, isHtmlContentClosed, generateCustomStylish as lobeCustomStylish, generateCustomToken as lobeCustomToken, staticStylish as lobeStaticStylish, styles as menuSharedStyles, mermaidThemes, neutralColors, neutralColorsSwatches, placementMap, preprocessMarkdownContent, preventDefault, preventDefaultAndStopPropagation, primaryColors, primaryColorsSwatches, rehypeCustomFootnotes, rehypeKatexDir, rehypeStreamAnimated, remarkBr, remarkColor, remarkCustomFootnotes, remarkGfmPlus, remarkVideo, renderDropdownMenuItems, setContextMenuInterceptor, showContextMenu, stopPropagation, toFloatingUIPlacement, toast, updateContextMenuItems, useAppElement, useCdnFn, useModalContext, useMotionComponent, usePopoverContext, usePopoverPortalContainer, useToast, useTranslation };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lobehub/ui",
3
- "version": "5.24.0",
3
+ "version": "5.26.0",
4
4
  "description": "Lobe UI is an open-source UI component library for building AIGC web apps",
5
5
  "keywords": [
6
6
  "lobehub",