@capillarytech/cap-ui-utils 1.4.6-alpha7.0 → 1.4.6-alpha8.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capillarytech/cap-ui-utils",
3
- "version": "1.4.6-alpha7.0",
3
+ "version": "1.4.6-alpha8.0",
4
4
  "description": "Utility functions shared accross all the modules",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -38,10 +38,10 @@ const ResizablePIP = ({
38
38
 
39
39
  const handleOpenDoc = () => window.open(footerContent.supportDoc, "_blank");
40
40
  return (
41
- <Draggable>
41
+ <Draggable handle="button">
42
42
  <div
43
43
  style={{
44
- zIndex: "100000",
44
+ zIndex: "1000",
45
45
  position: "absolute",
46
46
  left: showMaximised ? 168 : 24,
47
47
  top: showMaximised ? 60 : 450,
@@ -52,6 +52,23 @@ const ResizablePIP = ({
52
52
  backgroundColor: "#fff",
53
53
  }}
54
54
  >
55
+ {(isHovering || showMaximised) && (
56
+ <CapIcon
57
+ onClick={closePIPContainer}
58
+ size="m"
59
+ type="close"
60
+ style={{
61
+ position: "fixed",
62
+ top: showMaximised ? "-10px" : "10px",
63
+ left: showMaximised ? "1093px" : "365px",
64
+ backgroundColor: showMaximised ? "#dfe2e7" : "unset",
65
+ borderRadius: 48,
66
+ zIndex: 10001,
67
+ }}
68
+ onMouseEnter={handleMouseEnter}
69
+ onMouseLeave={handleMouseLeave}
70
+ />
71
+ )}
55
72
  <ResizableBox
56
73
  onMouseDown={(e) => {
57
74
  e.stopPropagation();
@@ -67,41 +84,12 @@ const ResizablePIP = ({
67
84
  opacity: isHovering ? 0.3 : 1,
68
85
  color: "#000",
69
86
  backgroundColor: "rgba(0, 0, 0, 0.3)",
70
- transition: "opacity 0.2s ease-in-out",
87
+ transition: "opacity 0.5s ease-in-out",
71
88
  }}
72
89
  onMouseEnter={handleMouseEnter}
73
90
  onMouseLeave={handleMouseLeave}
74
91
  >
75
- {isHovering && (
76
- <CapIcon
77
- onClick={closePIPContainer}
78
- size="m"
79
- type="close"
80
- style={{
81
- position: "fixed",
82
- top: showMaximised ? "-10px" : "10px",
83
- left: showMaximised ? "1093px" : "365px",
84
- backgroundColor: showMaximised ? "#dfe2e7" : "unset",
85
- borderRadius: 48,
86
- }}
87
- />
88
- )}
89
92
  {children}
90
- {isHovering && (
91
- <>
92
- <CapIcon
93
- onClick={handleMaximiseView}
94
- size="m"
95
- type="open-in-new"
96
- style={{
97
- float: "right",
98
- position: "fixed",
99
- top: showMaximised ? 635 : 224,
100
- right: 12,
101
- }}
102
- />
103
- </>
104
- )}
105
93
  </div>
106
94
  <CapRow style={{ height: 56 }}>
107
95
  <CapColumn span={17}>
@@ -128,6 +116,37 @@ const ResizablePIP = ({
128
116
  />
129
117
  </CapRow>
130
118
  </ResizableBox>
119
+ {isHovering && (
120
+ <div
121
+ style={{ position: "fixed" }}
122
+ onMouseEnter={handleMouseEnter}
123
+ onMouseLeave={handleMouseLeave}
124
+ >
125
+ <CapIcon
126
+ onClick={handleMaximiseView}
127
+ size="s"
128
+ type="open-in-new"
129
+ style={{
130
+ float: "right",
131
+ position: "fixed",
132
+ top: showMaximised ? 635 : 224,
133
+ right: 12,
134
+ }}
135
+ />
136
+ <button type="button">
137
+ <CapIcon
138
+ size="s"
139
+ type="draggable"
140
+ style={{
141
+ float: "right",
142
+ position: "fixed",
143
+ top: showMaximised ? 635 : 224,
144
+ right: 40,
145
+ }}
146
+ />
147
+ </button>
148
+ </div>
149
+ )}
131
150
  </div>
132
151
  </Draggable>
133
152
  );
@@ -142,7 +142,10 @@ const WithDemoVideosAndLinks = (props) => {
142
142
  const handleShowMaximised = (value) => {
143
143
  setShowMaximised(value);
144
144
  };
145
- const handleClosePIPContainer = () => setShowPIP(false);
145
+ const handleClosePIPContainer = () => {
146
+ setShowMaximised(false);
147
+ setShowPIP(false);
148
+ };
146
149
  return (
147
150
  <div>
148
151
  {showPIP && (