@uipath/apollo-wind 2.66.1 → 2.67.1

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 (59) hide show
  1. package/dist/components/ui/attachment.cjs +174 -0
  2. package/dist/components/ui/attachment.d.ts +39 -0
  3. package/dist/components/ui/attachment.js +113 -0
  4. package/dist/components/ui/bubble.cjs +123 -0
  5. package/dist/components/ui/bubble.d.ts +28 -0
  6. package/dist/components/ui/bubble.js +77 -0
  7. package/dist/components/ui/index.cjs +268 -213
  8. package/dist/components/ui/index.d.ts +6 -1
  9. package/dist/components/ui/index.js +6 -1
  10. package/dist/components/ui/marker.cjs +89 -0
  11. package/dist/components/ui/marker.d.ts +16 -0
  12. package/dist/components/ui/marker.js +46 -0
  13. package/dist/components/ui/message-scroller/index.cjs +58 -0
  14. package/dist/components/ui/message-scroller/index.d.ts +1 -0
  15. package/dist/components/ui/message-scroller/index.js +1 -0
  16. package/dist/components/ui/message-scroller/message-scroller.cjs +137 -0
  17. package/dist/components/ui/message-scroller/message-scroller.d.ts +60 -0
  18. package/dist/components/ui/message-scroller/message-scroller.js +73 -0
  19. package/dist/components/ui/message-scroller/primitive/components.cjs +357 -0
  20. package/dist/components/ui/message-scroller/primitive/components.d.ts +28 -0
  21. package/dist/components/ui/message-scroller/primitive/components.js +299 -0
  22. package/dist/components/ui/message-scroller/primitive/geometry.cjs +232 -0
  23. package/dist/components/ui/message-scroller/primitive/geometry.d.ts +54 -0
  24. package/dist/components/ui/message-scroller/primitive/geometry.js +153 -0
  25. package/dist/components/ui/message-scroller/primitive/index.cjs +53 -0
  26. package/dist/components/ui/message-scroller/primitive/index.d.ts +23 -0
  27. package/dist/components/ui/message-scroller/primitive/index.js +10 -0
  28. package/dist/components/ui/message-scroller/primitive/stores.cjs +81 -0
  29. package/dist/components/ui/message-scroller/primitive/stores.d.ts +6 -0
  30. package/dist/components/ui/message-scroller/primitive/stores.js +38 -0
  31. package/dist/components/ui/message-scroller/primitive/types.cjs +82 -0
  32. package/dist/components/ui/message-scroller/primitive/types.d.ts +89 -0
  33. package/dist/components/ui/message-scroller/primitive/types.js +24 -0
  34. package/dist/components/ui/message-scroller/primitive/use-message-scroller-commands.cjs +213 -0
  35. package/dist/components/ui/message-scroller/primitive/use-message-scroller-commands.d.ts +18 -0
  36. package/dist/components/ui/message-scroller/primitive/use-message-scroller-commands.js +179 -0
  37. package/dist/components/ui/message-scroller/primitive/use-message-scroller-controller.cjs +474 -0
  38. package/dist/components/ui/message-scroller/primitive/use-message-scroller-controller.d.ts +6 -0
  39. package/dist/components/ui/message-scroller/primitive/use-message-scroller-controller.js +440 -0
  40. package/dist/components/ui/message-scroller/primitive/use-message-scroller-refs.cjs +124 -0
  41. package/dist/components/ui/message-scroller/primitive/use-message-scroller-refs.d.ts +52 -0
  42. package/dist/components/ui/message-scroller/primitive/use-message-scroller-refs.js +84 -0
  43. package/dist/components/ui/message-scroller/primitive/use-render.cjs +116 -0
  44. package/dist/components/ui/message-scroller/primitive/use-render.d.ts +21 -0
  45. package/dist/components/ui/message-scroller/primitive/use-render.js +76 -0
  46. package/dist/components/ui/message-scroller/primitive/utils.cjs +41 -0
  47. package/dist/components/ui/message-scroller/primitive/utils.d.ts +3 -0
  48. package/dist/components/ui/message-scroller/primitive/utils.js +7 -0
  49. package/dist/components/ui/message.cjs +96 -0
  50. package/dist/components/ui/message.d.ts +17 -0
  51. package/dist/components/ui/message.js +47 -0
  52. package/dist/components/ui/tree-view.cjs +19 -5
  53. package/dist/components/ui/tree-view.js +19 -5
  54. package/dist/index.cjs +164 -51
  55. package/dist/index.d.ts +10 -0
  56. package/dist/index.js +6 -1
  57. package/dist/styles.css +720 -0
  58. package/dist/tailwind.utilities.css +223 -0
  59. package/package.json +1 -1
@@ -0,0 +1,84 @@
1
+ import { useRef } from "react";
2
+ import { areScrollStatesEqual, createMessageScrollerStore, createMessageScrollerVisibilityStore } from "./stores.js";
3
+ import { EMPTY_MESSAGE_SCROLLER_SCROLLABLE } from "./types.js";
4
+ function useMessageScrollerRefs({ autoScroll, defaultScrollPosition, scrollEdgeThreshold, scrollMargin, scrollPreviousItemPeek }) {
5
+ const autoScrollRef = useRef(autoScroll);
6
+ const autoscrollingRef = useRef(false);
7
+ const contentRef = useRef(null);
8
+ const defaultScrollPositionAppliedRef = useRef(false);
9
+ const scrollEdgeThresholdRef = useRef(scrollEdgeThreshold);
10
+ const itemCountRef = useRef(0);
11
+ const firstItemRef = useRef(null);
12
+ const lastScrollTopRef = useRef(0);
13
+ const modeRef = useRef(autoScroll ? 'following-bottom' : 'free-scrolling');
14
+ const messageElementsRef = useRef(new Map());
15
+ const pendingScrollToMessageRef = useRef(null);
16
+ const prependRestoreRef = useRef(null);
17
+ const streamingTurnRef = useRef(null);
18
+ const scrollPreviousItemPeekRef = useRef(scrollPreviousItemPeek);
19
+ const preserveScrollOnPrependRef = useRef(true);
20
+ const rootRef = useRef(null);
21
+ const scrollMarginRef = useRef(scrollMargin);
22
+ const pendingScrollFrameRef = useRef(null);
23
+ const spacerGapRef = useRef(0);
24
+ const spacerHeightRef = useRef(0);
25
+ const spacerRef = useRef(null);
26
+ const stateFrameRef = useRef(null);
27
+ const pendingDefaultScrollStoreRef = useRef(null);
28
+ const stateStoreRef = useRef(null);
29
+ const autoscrollingTimeoutRef = useRef(null);
30
+ const viewportRef = useRef(null);
31
+ const visibilityFrameRef = useRef(null);
32
+ const visibilityObserverRef = useRef(null);
33
+ const visibilityStoreRef = useRef(null);
34
+ const visibleMessageIdsRef = useRef(new Set());
35
+ const handledScrollAnchorsRef = useRef(new WeakSet());
36
+ if (null === pendingDefaultScrollStoreRef.current) pendingDefaultScrollStoreRef.current = createMessageScrollerStore('end' === defaultScrollPosition || 'last-anchor' === defaultScrollPosition, (current, next)=>current === next);
37
+ if (null === stateStoreRef.current) stateStoreRef.current = createMessageScrollerStore(EMPTY_MESSAGE_SCROLLER_SCROLLABLE, areScrollStatesEqual);
38
+ if (null === visibilityStoreRef.current) visibilityStoreRef.current = createMessageScrollerVisibilityStore();
39
+ autoScrollRef.current = autoScroll;
40
+ scrollEdgeThresholdRef.current = scrollEdgeThreshold;
41
+ scrollMarginRef.current = scrollMargin;
42
+ scrollPreviousItemPeekRef.current = scrollPreviousItemPeek;
43
+ return {
44
+ autoScrollRef,
45
+ autoscrollingRef,
46
+ autoscrollingTimeoutRef,
47
+ streamingTurnRef,
48
+ contentRef,
49
+ defaultScrollPositionAppliedRef,
50
+ firstItemRef,
51
+ itemCountRef,
52
+ lastScrollTopRef,
53
+ messageElementsRef,
54
+ modeRef,
55
+ pendingScrollFrameRef,
56
+ pendingScrollToMessageRef,
57
+ prependRestoreRef,
58
+ preserveScrollOnPrependRef,
59
+ pendingDefaultScrollStore: pendingDefaultScrollStoreRef.current,
60
+ rootRef,
61
+ scrollEdgeThresholdRef,
62
+ scrollMarginRef,
63
+ scrollPreviousItemPeekRef,
64
+ spacerGapRef,
65
+ spacerHeightRef,
66
+ spacerRef,
67
+ stateFrameRef,
68
+ stateStore: stateStoreRef.current,
69
+ viewportRef,
70
+ visibilityFrameRef,
71
+ visibilityObserverRef,
72
+ visibilityStore: visibilityStoreRef.current,
73
+ visibleMessageIdsRef,
74
+ handledScrollAnchorsRef
75
+ };
76
+ }
77
+ function clearPendingDefaultScroll(refs) {
78
+ refs.pendingDefaultScrollStore.setSnapshot(false);
79
+ }
80
+ function markDefaultScrollPositionApplied(refs) {
81
+ refs.defaultScrollPositionAppliedRef.current = true;
82
+ clearPendingDefaultScroll(refs);
83
+ }
84
+ export { clearPendingDefaultScroll, markDefaultScrollPositionApplied, useMessageScrollerRefs };
@@ -0,0 +1,116 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ composeRefs: ()=>composeRefs,
28
+ mergeProps: ()=>mergeProps,
29
+ useRender: ()=>useRender
30
+ });
31
+ const external_react_namespaceObject = require("react");
32
+ function useRender({ defaultTagName, props, render, state = {}, stateAttributesMapping }) {
33
+ const elementProps = mergeProps(getStateAttributes(state, stateAttributesMapping), props);
34
+ if (!render) return external_react_namespaceObject.createElement(defaultTagName, elementProps);
35
+ if ('function' == typeof render) return render(elementProps, state);
36
+ if (!external_react_namespaceObject.isValidElement(render)) return null;
37
+ const renderProps = render.props;
38
+ const renderRef = renderProps.ref ?? render.ref;
39
+ const propsWithRenderProps = mergeProps(elementProps, renderProps);
40
+ const propsWithRef = {
41
+ ...propsWithRenderProps,
42
+ ref: composeRefs(elementProps.ref, renderRef)
43
+ };
44
+ return external_react_namespaceObject.cloneElement(render, propsWithRef);
45
+ }
46
+ function mergeProps(...sources) {
47
+ const result = {};
48
+ for (const source of sources){
49
+ if (!source) continue;
50
+ const sourceProps = source;
51
+ for (const key of Object.keys(sourceProps)){
52
+ const value = sourceProps[key];
53
+ if (void 0 === value) continue;
54
+ const current = result[key];
55
+ if ('className' === key) result[key] = [
56
+ current,
57
+ value
58
+ ].filter(Boolean).join(' ');
59
+ else if ('style' === key) result[key] = {
60
+ ...current,
61
+ ...value
62
+ };
63
+ else if ('ref' === key) result[key] = composeRefs(current, value);
64
+ else if (isEventHandler(key) && 'function' == typeof current && 'function' == typeof value) result[key] = composeEventHandlers(value, current);
65
+ else result[key] = value;
66
+ }
67
+ }
68
+ return result;
69
+ }
70
+ function getStateAttributes(state, mapping) {
71
+ const props = {};
72
+ for (const key of Object.keys(state)){
73
+ const value = state[key];
74
+ const attributes = mapping?.[key]?.(value);
75
+ if (attributes) {
76
+ Object.assign(props, attributes);
77
+ continue;
78
+ }
79
+ if ('slot' === key) {
80
+ props['data-slot'] = value;
81
+ continue;
82
+ }
83
+ const attribute = `data-${String(key).replace(/[A-Z]/g, (letter)=>`-${letter.toLowerCase()}`)}`;
84
+ if ('boolean' == typeof value) props[attribute] = value ? '' : void 0;
85
+ else if (null != value) props[attribute] = String(value);
86
+ }
87
+ return props;
88
+ }
89
+ function composeEventHandlers(theirs, ours) {
90
+ return function(event) {
91
+ theirs(event);
92
+ if (!event.defaultPrevented) ours(event);
93
+ };
94
+ }
95
+ function isEventHandler(key) {
96
+ return /^on[A-Z]/.test(key);
97
+ }
98
+ function composeRefs(...refs) {
99
+ const validRefs = refs.filter(Boolean);
100
+ if (0 === validRefs.length) return;
101
+ return (value)=>{
102
+ for (const ref of validRefs)if ('function' == typeof ref) ref(value);
103
+ else if (ref) ref.current = value;
104
+ };
105
+ }
106
+ exports.composeRefs = __webpack_exports__.composeRefs;
107
+ exports.mergeProps = __webpack_exports__.mergeProps;
108
+ exports.useRender = __webpack_exports__.useRender;
109
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
110
+ "composeRefs",
111
+ "mergeProps",
112
+ "useRender"
113
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
114
+ Object.defineProperty(exports, '__esModule', {
115
+ value: true
116
+ });
@@ -0,0 +1,21 @@
1
+ import * as React from 'react';
2
+ type RenderState = Record<string, unknown>;
3
+ type RenderFunction<TState extends RenderState> = (props: Record<string, unknown>, state: TState) => React.ReactElement | null;
4
+ type RenderProp<TState extends RenderState> = React.ReactElement | RenderFunction<TState>;
5
+ type StateAttributesMapping<TState extends RenderState> = Partial<{
6
+ [K in keyof TState]: (value: TState[K]) => Record<string, string | undefined> | null | undefined;
7
+ }>;
8
+ type UseRenderComponentProps<TElement extends React.ElementType, TState extends RenderState = RenderState> = React.ComponentPropsWithoutRef<TElement> & {
9
+ render?: RenderProp<TState>;
10
+ };
11
+ type UseRenderOptions<TElement extends React.ElementType, TState extends RenderState> = {
12
+ defaultTagName: TElement;
13
+ props?: React.ComponentPropsWithRef<TElement>;
14
+ render?: RenderProp<TState>;
15
+ state?: TState;
16
+ stateAttributesMapping?: StateAttributesMapping<TState>;
17
+ };
18
+ declare function useRender<TElement extends React.ElementType, TState extends RenderState = RenderState>({ defaultTagName, props, render, state, stateAttributesMapping, }: UseRenderOptions<TElement, TState>): React.ReactElement<any, string | React.JSXElementConstructor<any>> | null;
19
+ declare function mergeProps<TElement extends React.ElementType>(...sources: Array<React.ComponentPropsWithRef<TElement> | Record<string, unknown> | undefined>): React.ComponentPropsWithRef<TElement>;
20
+ declare function composeRefs<T>(...refs: Array<React.Ref<T> | undefined>): React.RefCallback<T> | undefined;
21
+ export { composeRefs, mergeProps, useRender, type UseRenderComponentProps };
@@ -0,0 +1,76 @@
1
+ import { cloneElement, createElement, isValidElement } from "react";
2
+ function useRender({ defaultTagName, props, render, state = {}, stateAttributesMapping }) {
3
+ const elementProps = mergeProps(getStateAttributes(state, stateAttributesMapping), props);
4
+ if (!render) return createElement(defaultTagName, elementProps);
5
+ if ('function' == typeof render) return render(elementProps, state);
6
+ if (!isValidElement(render)) return null;
7
+ const renderProps = render.props;
8
+ const renderRef = renderProps.ref ?? render.ref;
9
+ const propsWithRenderProps = mergeProps(elementProps, renderProps);
10
+ const propsWithRef = {
11
+ ...propsWithRenderProps,
12
+ ref: composeRefs(elementProps.ref, renderRef)
13
+ };
14
+ return cloneElement(render, propsWithRef);
15
+ }
16
+ function mergeProps(...sources) {
17
+ const result = {};
18
+ for (const source of sources){
19
+ if (!source) continue;
20
+ const sourceProps = source;
21
+ for (const key of Object.keys(sourceProps)){
22
+ const value = sourceProps[key];
23
+ if (void 0 === value) continue;
24
+ const current = result[key];
25
+ if ('className' === key) result[key] = [
26
+ current,
27
+ value
28
+ ].filter(Boolean).join(' ');
29
+ else if ('style' === key) result[key] = {
30
+ ...current,
31
+ ...value
32
+ };
33
+ else if ('ref' === key) result[key] = composeRefs(current, value);
34
+ else if (isEventHandler(key) && 'function' == typeof current && 'function' == typeof value) result[key] = composeEventHandlers(value, current);
35
+ else result[key] = value;
36
+ }
37
+ }
38
+ return result;
39
+ }
40
+ function getStateAttributes(state, mapping) {
41
+ const props = {};
42
+ for (const key of Object.keys(state)){
43
+ const value = state[key];
44
+ const attributes = mapping?.[key]?.(value);
45
+ if (attributes) {
46
+ Object.assign(props, attributes);
47
+ continue;
48
+ }
49
+ if ('slot' === key) {
50
+ props['data-slot'] = value;
51
+ continue;
52
+ }
53
+ const attribute = `data-${String(key).replace(/[A-Z]/g, (letter)=>`-${letter.toLowerCase()}`)}`;
54
+ if ('boolean' == typeof value) props[attribute] = value ? '' : void 0;
55
+ else if (null != value) props[attribute] = String(value);
56
+ }
57
+ return props;
58
+ }
59
+ function composeEventHandlers(theirs, ours) {
60
+ return function(event) {
61
+ theirs(event);
62
+ if (!event.defaultPrevented) ours(event);
63
+ };
64
+ }
65
+ function isEventHandler(key) {
66
+ return /^on[A-Z]/.test(key);
67
+ }
68
+ function composeRefs(...refs) {
69
+ const validRefs = refs.filter(Boolean);
70
+ if (0 === validRefs.length) return;
71
+ return (value)=>{
72
+ for (const ref of validRefs)if ('function' == typeof ref) ref(value);
73
+ else if (ref) ref.current = value;
74
+ };
75
+ }
76
+ export { composeRefs, mergeProps, useRender };
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ useLatest: ()=>useLatest
28
+ });
29
+ const external_react_namespaceObject = require("react");
30
+ function useLatest(value) {
31
+ const ref = external_react_namespaceObject.useRef(value);
32
+ ref.current = value;
33
+ return ref;
34
+ }
35
+ exports.useLatest = __webpack_exports__.useLatest;
36
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
37
+ "useLatest"
38
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
39
+ Object.defineProperty(exports, '__esModule', {
40
+ value: true
41
+ });
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ declare function useLatest<T>(value: T): React.RefObject<T>;
3
+ export { useLatest };
@@ -0,0 +1,7 @@
1
+ import { useRef } from "react";
2
+ function useLatest(value) {
3
+ const ref = useRef(value);
4
+ ref.current = value;
5
+ return ref;
6
+ }
7
+ export { useLatest };
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.d = (exports1, definition)=>{
5
+ for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
6
+ enumerable: true,
7
+ get: definition[key]
8
+ });
9
+ };
10
+ })();
11
+ (()=>{
12
+ __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
13
+ })();
14
+ (()=>{
15
+ __webpack_require__.r = (exports1)=>{
16
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
17
+ value: 'Module'
18
+ });
19
+ Object.defineProperty(exports1, '__esModule', {
20
+ value: true
21
+ });
22
+ };
23
+ })();
24
+ var __webpack_exports__ = {};
25
+ __webpack_require__.r(__webpack_exports__);
26
+ __webpack_require__.d(__webpack_exports__, {
27
+ MessageContent: ()=>MessageContent,
28
+ MessageAvatar: ()=>MessageAvatar,
29
+ MessageFooter: ()=>MessageFooter,
30
+ MessageGroup: ()=>MessageGroup,
31
+ Message: ()=>Message,
32
+ MessageHeader: ()=>MessageHeader
33
+ });
34
+ const jsx_runtime_namespaceObject = require("react/jsx-runtime");
35
+ const external_react_namespaceObject = require("react");
36
+ const index_cjs_namespaceObject = require("../../lib/index.cjs");
37
+ const MessageGroup = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
38
+ ref: ref,
39
+ "data-slot": "message-group",
40
+ className: (0, index_cjs_namespaceObject.cn)('flex min-w-0 flex-col gap-2', className),
41
+ ...props
42
+ }));
43
+ MessageGroup.displayName = 'MessageGroup';
44
+ const Message = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, align = 'start', ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
45
+ ref: ref,
46
+ "data-slot": "message",
47
+ "data-align": align,
48
+ className: (0, index_cjs_namespaceObject.cn)('group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse', className),
49
+ ...props
50
+ }));
51
+ Message.displayName = 'Message';
52
+ const MessageAvatar = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
53
+ ref: ref,
54
+ "data-slot": "message-avatar",
55
+ className: (0, index_cjs_namespaceObject.cn)('flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-[[data-slot=message-footer]]/message:-translate-y-8', className),
56
+ ...props
57
+ }));
58
+ MessageAvatar.displayName = 'MessageAvatar';
59
+ const MessageContent = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
60
+ ref: ref,
61
+ "data-slot": "message-content",
62
+ className: (0, index_cjs_namespaceObject.cn)('flex w-full min-w-0 flex-col gap-2.5 break-words group-data-[align=end]/message:*:self-end', className),
63
+ ...props
64
+ }));
65
+ MessageContent.displayName = 'MessageContent';
66
+ const MessageHeader = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
67
+ ref: ref,
68
+ "data-slot": "message-header",
69
+ className: (0, index_cjs_namespaceObject.cn)('flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground', className),
70
+ ...props
71
+ }));
72
+ MessageHeader.displayName = 'MessageHeader';
73
+ const MessageFooter = /*#__PURE__*/ external_react_namespaceObject.forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
74
+ ref: ref,
75
+ "data-slot": "message-footer",
76
+ className: (0, index_cjs_namespaceObject.cn)('flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-data-[align=end]/message:justify-end', className),
77
+ ...props
78
+ }));
79
+ MessageFooter.displayName = 'MessageFooter';
80
+ exports.Message = __webpack_exports__.Message;
81
+ exports.MessageAvatar = __webpack_exports__.MessageAvatar;
82
+ exports.MessageContent = __webpack_exports__.MessageContent;
83
+ exports.MessageFooter = __webpack_exports__.MessageFooter;
84
+ exports.MessageGroup = __webpack_exports__.MessageGroup;
85
+ exports.MessageHeader = __webpack_exports__.MessageHeader;
86
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
87
+ "Message",
88
+ "MessageAvatar",
89
+ "MessageContent",
90
+ "MessageFooter",
91
+ "MessageGroup",
92
+ "MessageHeader"
93
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
94
+ Object.defineProperty(exports, '__esModule', {
95
+ value: true
96
+ });
@@ -0,0 +1,17 @@
1
+ import * as React from 'react';
2
+ /**
3
+ * Chat conversation row primitives, ported from shadcn/ui's chat components. A `Message` lays out
4
+ * one turn: an optional `MessageAvatar`, then `MessageContent` holding a `MessageHeader`, the body
5
+ * (usually a `Bubble`) and a `MessageFooter`. `align="end"` mirrors the row for the current user.
6
+ */
7
+ declare const MessageGroup: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
8
+ export interface MessageProps extends React.HTMLAttributes<HTMLDivElement> {
9
+ /** `end` mirrors the row so the avatar and bubble sit on the trailing edge. */
10
+ align?: 'start' | 'end';
11
+ }
12
+ declare const Message: React.ForwardRefExoticComponent<MessageProps & React.RefAttributes<HTMLDivElement>>;
13
+ declare const MessageAvatar: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
14
+ declare const MessageContent: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
15
+ declare const MessageHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
16
+ declare const MessageFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
17
+ export { MessageGroup, Message, MessageAvatar, MessageContent, MessageHeader, MessageFooter };
@@ -0,0 +1,47 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { cn } from "../../lib/index.js";
4
+ const MessageGroup = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
5
+ ref: ref,
6
+ "data-slot": "message-group",
7
+ className: cn('flex min-w-0 flex-col gap-2', className),
8
+ ...props
9
+ }));
10
+ MessageGroup.displayName = 'MessageGroup';
11
+ const Message = /*#__PURE__*/ forwardRef(({ className, align = 'start', ...props }, ref)=>/*#__PURE__*/ jsx("div", {
12
+ ref: ref,
13
+ "data-slot": "message",
14
+ "data-align": align,
15
+ className: cn('group/message relative flex w-full min-w-0 gap-2 text-sm data-[align=end]:flex-row-reverse', className),
16
+ ...props
17
+ }));
18
+ Message.displayName = 'Message';
19
+ const MessageAvatar = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
20
+ ref: ref,
21
+ "data-slot": "message-avatar",
22
+ className: cn('flex w-fit min-w-8 shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-[[data-slot=message-footer]]/message:-translate-y-8', className),
23
+ ...props
24
+ }));
25
+ MessageAvatar.displayName = 'MessageAvatar';
26
+ const MessageContent = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
27
+ ref: ref,
28
+ "data-slot": "message-content",
29
+ className: cn('flex w-full min-w-0 flex-col gap-2.5 break-words group-data-[align=end]/message:*:self-end', className),
30
+ ...props
31
+ }));
32
+ MessageContent.displayName = 'MessageContent';
33
+ const MessageHeader = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
34
+ ref: ref,
35
+ "data-slot": "message-header",
36
+ className: cn('flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground', className),
37
+ ...props
38
+ }));
39
+ MessageHeader.displayName = 'MessageHeader';
40
+ const MessageFooter = /*#__PURE__*/ forwardRef(({ className, ...props }, ref)=>/*#__PURE__*/ jsx("div", {
41
+ ref: ref,
42
+ "data-slot": "message-footer",
43
+ className: cn('flex max-w-full min-w-0 items-center px-3 text-xs font-medium text-muted-foreground group-data-[align=end]/message:justify-end', className),
44
+ ...props
45
+ }));
46
+ MessageFooter.displayName = 'MessageFooter';
47
+ export { Message, MessageAvatar, MessageContent, MessageFooter, MessageGroup, MessageHeader };
@@ -50,6 +50,7 @@ const buildItemMap = (items)=>{
50
50
  items.forEach(processItem);
51
51
  return map;
52
52
  };
53
+ const toAriaChecked = (state)=>'indeterminate' === state ? 'mixed' : 'checked' === state;
53
54
  const getCheckState = (item, itemMap)=>{
54
55
  const originalItem = itemMap.get(item.id);
55
56
  if (!originalItem) return 'unchecked';
@@ -155,12 +156,17 @@ function TreeItem({ item, depth = 0, selectedIds, lastSelectedId, onSelect, expa
155
156
  };
156
157
  const handleAccessClick = (e)=>{
157
158
  e.stopPropagation();
159
+ if (isDisabled) return;
158
160
  if (onAccessChange) {
159
161
  const currentState = getCheckState(item, itemMap);
160
162
  const newChecked = 'checked' !== currentState;
161
163
  onAccessChange(item, newChecked);
162
164
  }
163
165
  };
166
+ const renderName = ()=>showAccessRights ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
167
+ onClick: handleAccessClick,
168
+ children: item.name
169
+ }) : item.name;
164
170
  const renderIcon = ()=>{
165
171
  if (getIcon) return getIcon(item, depth);
166
172
  return iconMap[item.type] || iconMap.folder || defaultIconMap.folder;
@@ -195,6 +201,7 @@ function TreeItem({ item, depth = 0, selectedIds, lastSelectedId, onSelect, expa
195
201
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_context_menu_cjs_namespaceObject.ContextMenu, {
196
202
  children: [
197
203
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_context_menu_cjs_namespaceObject.ContextMenuTrigger, {
204
+ disabled: !menuItems?.length,
198
205
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div", {
199
206
  children: [
200
207
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
@@ -203,6 +210,7 @@ function TreeItem({ item, depth = 0, selectedIds, lastSelectedId, onSelect, expa
203
210
  "aria-expanded": item.children ? isOpen : void 0,
204
211
  "aria-selected": isSelected && 'none' !== selectionMode,
205
212
  "aria-disabled": isDisabled,
213
+ "aria-checked": showAccessRights ? toAriaChecked(getCheckState(item, itemMap)) : void 0,
206
214
  tabIndex: 0,
207
215
  "data-tree-item": true,
208
216
  "data-id": item.id,
@@ -215,10 +223,16 @@ function TreeItem({ item, depth = 0, selectedIds, lastSelectedId, onSelect, expa
215
223
  },
216
224
  onClick: handleClick,
217
225
  onKeyDown: (e)=>{
218
- if ('Enter' === e.key || ' ' === e.key) {
219
- e.preventDefault();
220
- handleClick(e);
226
+ if (e.target !== e.currentTarget) return;
227
+ if ('Enter' !== e.key && ' ' !== e.key) return;
228
+ e.preventDefault();
229
+ if ('none' === selectionMode) {
230
+ e.stopPropagation();
231
+ if (' ' === e.key && showAccessRights) handleAccessClick(e);
232
+ else if (item.children && !isDisabled) onToggleExpand(item.id, !isOpen);
233
+ return;
221
234
  }
235
+ handleClick(e);
222
236
  },
223
237
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
224
238
  className: "flex items-center h-8 min-w-0",
@@ -286,7 +300,7 @@ function TreeItem({ item, depth = 0, selectedIds, lastSelectedId, onSelect, expa
286
300
  renderIcon(),
287
301
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
288
302
  className: "flex-1 min-w-0 truncate",
289
- children: item.name
303
+ children: renderName()
290
304
  }),
291
305
  item.badge && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
292
306
  className: "shrink-0 ml-1",
@@ -522,7 +536,7 @@ function TreeItem({ item, depth = 0, selectedIds, lastSelectedId, onSelect, expa
522
536
  renderIcon(),
523
537
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
524
538
  className: "flex-1 min-w-0 truncate",
525
- children: item.name
539
+ children: renderName()
526
540
  }),
527
541
  item.badge && /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
528
542
  className: "shrink-0 ml-1",