@topconsultnpm/sdkui-react 6.20.0-dev1.82 → 6.20.0-dev1.83
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.
- package/lib/assets/Toppy-help-center.png +0 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.d.ts +15 -0
- package/lib/components/features/assistant/TMToppyDraggableHelpCenter.js +460 -0
- package/lib/components/features/assistant/TMToppySpeechBubble.d.ts +11 -0
- package/lib/components/features/assistant/TMToppySpeechBubble.js +126 -0
- package/lib/components/features/documents/TMDcmtForm.js +3 -2
- package/lib/components/features/search/TMSearchResult.js +2 -2
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.js +1 -1
- package/package.json +1 -1
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.d.ts +0 -30
- package/lib/components/features/assistant/ToppyDraggableHelpCenter.js +0 -482
- package/lib/components/features/assistant/ToppySpeechBubble.d.ts +0 -9
- package/lib/components/features/assistant/ToppySpeechBubble.js +0 -117
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, { forwardRef } from 'react';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
|
-
import { SDKUI_Localizator } from '../../../helper';
|
|
5
|
-
import { IconWindowMinimize } from '../../../helper/TMIcons';
|
|
6
|
-
// Styled component
|
|
7
|
-
const Bubble = styled.div `
|
|
8
|
-
position: absolute;
|
|
9
|
-
bottom: 145px;
|
|
10
|
-
${({ $align }) => ($align === 'left' ? 'left: 0px;' : 'right: 0px;')}
|
|
11
|
-
width: max-content;
|
|
12
|
-
padding: 10px;
|
|
13
|
-
background: linear-gradient(180deg, rgba(0, 113, 188, 0.45) 0%,rgba(27, 20, 100, 0.65) 100%);
|
|
14
|
-
border-radius: 18px;
|
|
15
|
-
box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
|
|
16
|
-
font-size: 14px;
|
|
17
|
-
line-height: 1.4;
|
|
18
|
-
color: #333;
|
|
19
|
-
z-index: 10000;
|
|
20
|
-
|
|
21
|
-
&::after {
|
|
22
|
-
transform: ${({ $align }) => ($align === 'left' ? 'skewX(15deg)' : 'skewX(-15deg)')};
|
|
23
|
-
content: "";
|
|
24
|
-
position: absolute;
|
|
25
|
-
top: 100%;
|
|
26
|
-
${({ $align }) => ($align === 'left' ? 'left: 20px;' : 'right: 15px;')}
|
|
27
|
-
border-width: 32px 32px 0 0;
|
|
28
|
-
border-style: solid;
|
|
29
|
-
border-color: #FFFFFF transparent;
|
|
30
|
-
display: block;
|
|
31
|
-
width: 0;
|
|
32
|
-
height: 0;
|
|
33
|
-
z-index: 1;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
&::before {
|
|
37
|
-
transform: ${({ $align }) => ($align === 'left' ? 'skewX(15deg)' : 'skewX(-15deg)')};
|
|
38
|
-
content: "";
|
|
39
|
-
position: absolute;
|
|
40
|
-
top: 100%;
|
|
41
|
-
${({ $align }) => ($align === 'left' ? 'left: 20px;' : 'right: 15px;')}
|
|
42
|
-
border-width: 32px 32px 0 0;
|
|
43
|
-
border-style: solid;
|
|
44
|
-
border-color: rgba(27, 20, 100, 0.65) transparent;
|
|
45
|
-
display: block;
|
|
46
|
-
width: 0;
|
|
47
|
-
height: 0;
|
|
48
|
-
z-index: 2;
|
|
49
|
-
}
|
|
50
|
-
`;
|
|
51
|
-
const CloseButton = styled.button `
|
|
52
|
-
position: absolute;
|
|
53
|
-
top: -8px;
|
|
54
|
-
right: -8px;
|
|
55
|
-
width: 24px;
|
|
56
|
-
height: 24px;
|
|
57
|
-
border-radius: 50%;
|
|
58
|
-
border: 2px solid rgba(255, 255, 255, 0.9);
|
|
59
|
-
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
60
|
-
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4), 0 0 20px rgba(118, 75, 162, 0.2);
|
|
61
|
-
cursor: pointer;
|
|
62
|
-
display: flex;
|
|
63
|
-
align-items: center;
|
|
64
|
-
justify-content: center;
|
|
65
|
-
transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
|
|
66
|
-
z-index: 10001;
|
|
67
|
-
color: white;
|
|
68
|
-
font-size: 14px;
|
|
69
|
-
|
|
70
|
-
&:hover {
|
|
71
|
-
background: linear-gradient(135deg, #764ba2 0%, #f093fb 100%);
|
|
72
|
-
box-shadow: 0 6px 20px rgba(118, 75, 162, 0.6), 0 0 30px rgba(240, 147, 251, 0.4);
|
|
73
|
-
border-color: rgba(255, 255, 255, 1);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
&:active {
|
|
77
|
-
transform: scale(0.95);
|
|
78
|
-
box-shadow: 0 2px 8px rgba(102, 126, 234, 0.4);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
&:focus {
|
|
82
|
-
outline: none;
|
|
83
|
-
box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4), 0 0 0 3px rgba(102, 126, 234, 0.2);
|
|
84
|
-
}
|
|
85
|
-
`;
|
|
86
|
-
// Componente con forwardRef
|
|
87
|
-
const ToppySpeechBubble = forwardRef(({ align = 'right', children, className, onClose }, ref) => {
|
|
88
|
-
const isDraggingRef = React.useRef(false);
|
|
89
|
-
const mouseDownPosRef = React.useRef(null);
|
|
90
|
-
const handleMouseDown = (e) => {
|
|
91
|
-
isDraggingRef.current = false;
|
|
92
|
-
mouseDownPosRef.current = { x: e.clientX, y: e.clientY };
|
|
93
|
-
};
|
|
94
|
-
const handleMouseMove = (e) => {
|
|
95
|
-
if (!mouseDownPosRef.current)
|
|
96
|
-
return;
|
|
97
|
-
const deltaX = Math.abs(e.clientX - mouseDownPosRef.current.x);
|
|
98
|
-
const deltaY = Math.abs(e.clientY - mouseDownPosRef.current.y);
|
|
99
|
-
// Considera drag solo se il movimento supera 3px
|
|
100
|
-
if (deltaX > 3 || deltaY > 3) {
|
|
101
|
-
isDraggingRef.current = true;
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
const handleClick = (e) => {
|
|
105
|
-
if (isDraggingRef.current) {
|
|
106
|
-
e.stopPropagation();
|
|
107
|
-
e.preventDefault();
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
onClose?.();
|
|
111
|
-
};
|
|
112
|
-
const handleMouseUp = () => {
|
|
113
|
-
mouseDownPosRef.current = null;
|
|
114
|
-
};
|
|
115
|
-
return (_jsxs(Bubble, { ref: ref, "$align": align, className: className, children: [onClose && (_jsx(CloseButton, { onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, onMouseUp: handleMouseUp, onClick: handleClick, "aria-label": SDKUI_Localizator.Minimize, title: SDKUI_Localizator.Minimize, type: "button", children: _jsx(IconWindowMinimize, {}) })), children] }));
|
|
116
|
-
});
|
|
117
|
-
export default ToppySpeechBubble;
|