@capillarytech/cap-ui-utils 1.4.6-alpha6.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-alpha6.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": {
@@ -37,25 +37,14 @@ const ResizablePIP = ({
37
37
  };
38
38
 
39
39
  const handleOpenDoc = () => window.open(footerContent.supportDoc, "_blank");
40
- console.log("NIKHIL hover: ", isHovering);
41
- const draggableStyle = {
42
- position: "relative",
43
- left: 24,
44
- // bottom: "-88vh",
45
- margin: 2,
46
- border: '1px solid black',
47
- };
48
40
  return (
49
- <Draggable
50
- style={draggableStyle}
51
- >
41
+ <Draggable handle="button">
52
42
  <div
53
43
  style={{
54
- zIndex: "100000",
55
- position: "fixed",
56
- fontSize: "14px",
57
- fontWeight: "200",
58
- lineHeight: "1.5",
44
+ zIndex: "1000",
45
+ position: "absolute",
46
+ left: showMaximised ? 168 : 24,
47
+ top: showMaximised ? 60 : 450,
59
48
  boxSizing: "content-box",
60
49
  boxShadow:
61
50
  "1px 3px 3px 0 rgb(0 0 0 / 20%), 1px 3px 15px 2px rgb(0 0 0 / 20%)",
@@ -63,6 +52,23 @@ const ResizablePIP = ({
63
52
  backgroundColor: "#fff",
64
53
  }}
65
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
+ )}
66
72
  <ResizableBox
67
73
  onMouseDown={(e) => {
68
74
  e.stopPropagation();
@@ -78,31 +84,12 @@ const ResizablePIP = ({
78
84
  opacity: isHovering ? 0.3 : 1,
79
85
  color: "#000",
80
86
  backgroundColor: "rgba(0, 0, 0, 0.3)",
81
- transition: "opacity 0.2s ease-in-out",
87
+ transition: "opacity 0.5s ease-in-out",
82
88
  }}
83
89
  onMouseEnter={handleMouseEnter}
84
90
  onMouseLeave={handleMouseLeave}
85
91
  >
86
92
  {children}
87
- {isHovering && (
88
- <>
89
- <div
90
- style={{
91
- float: "right",
92
- position: "fixed",
93
- top: 224,
94
- right: 16,
95
- }}
96
- >
97
- <CapIcon
98
- onClick={handleMaximiseView}
99
- size="m"
100
- type="open-in-new"
101
- style={{opacity: '1 !important'}}
102
- />
103
- </div>
104
- </>
105
- )}
106
93
  </div>
107
94
  <CapRow style={{ height: 56 }}>
108
95
  <CapColumn span={17}>
@@ -129,6 +116,37 @@ const ResizablePIP = ({
129
116
  />
130
117
  </CapRow>
131
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
+ )}
132
150
  </div>
133
151
  </Draggable>
134
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 && (