@alifd/chat 0.1.11 → 0.1.13
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/es/core/variables.scss +2 -0
- package/es/feedback/index.js +1 -1
- package/es/feedback/main.scss +6 -3
- package/es/feedback/view/good.js +1 -1
- package/es/float-button/hooks/useDragable.js +0 -10
- package/es/index.js +1 -1
- package/lib/core/variables.scss +2 -0
- package/lib/feedback/index.js +1 -1
- package/lib/feedback/main.scss +6 -3
- package/lib/feedback/view/good.js +1 -1
- package/lib/float-button/hooks/useDragable.js +0 -10
- package/lib/index.js +1 -1
- package/package.json +1 -1
package/es/core/variables.scss
CHANGED
package/es/feedback/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import Good from './view/good';
|
|
|
12
12
|
* @when 需要获取用户针对显示内容的赞同或否定意见时
|
|
13
13
|
*/
|
|
14
14
|
function Feedback(props) {
|
|
15
|
-
const { className, order = ['
|
|
15
|
+
const { className, order = ['bad', 'good'], size, direction = 'hoz', defaultValue, value: _value, onChange: _onChange, renderItem } = props, rests = __rest(props, ["className", "order", "size", "direction", "defaultValue", "value", "onChange", "renderItem"]);
|
|
16
16
|
const cls = `${PREFIX_DEFAULT}feedback`;
|
|
17
17
|
const [value, onChange] = useControlable(props);
|
|
18
18
|
const defaultRenderItem = useCallback((status) => {
|
package/es/feedback/main.scss
CHANGED
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
padding: 0 4px;
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: row;
|
|
10
|
+
button:first-child {
|
|
11
|
+
margin-right: 16px;
|
|
12
|
+
}
|
|
10
13
|
}
|
|
11
14
|
&-item {
|
|
12
15
|
background-color: transparent;
|
|
@@ -15,10 +18,10 @@
|
|
|
15
18
|
display: inline-flex;
|
|
16
19
|
justify-content: center;
|
|
17
20
|
align-items: center;
|
|
18
|
-
padding: 0 4px;
|
|
19
21
|
cursor: pointer;
|
|
20
|
-
color:
|
|
22
|
+
color: $color-line1-3;
|
|
21
23
|
font-size: inherit;
|
|
24
|
+
padding: 0px;
|
|
22
25
|
transition:
|
|
23
26
|
color 0.15s,
|
|
24
27
|
opacity 0.15s;
|
|
@@ -35,7 +38,7 @@
|
|
|
35
38
|
line-height: 1;
|
|
36
39
|
|
|
37
40
|
&--bad {
|
|
38
|
-
transform:
|
|
41
|
+
transform: rotateX(180deg);
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
}
|
package/es/feedback/view/good.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
function Good(props) {
|
|
3
3
|
return (React.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, props),
|
|
4
|
-
React.createElement("path", { fill: "currentColor", d: "
|
|
4
|
+
React.createElement("path", { fill: "currentColor", d: "M925.2352 425.472h-215.7568c14.6432-52.3776 32.9216-134.656 21.9648-220.7232-7.3216-71.1168-47.5648-123.4944-106.0864-145.92-43.8784-14.9504-87.7568-7.4752-113.3568 18.688-29.2352 29.952-43.8784 89.8048-58.5216 149.6576-10.9568 41.1648-18.2784 82.2784-32.9216 104.7552C384 395.52 303.616 421.6832 288.9216 425.4208H182.784c-21.9136 0-36.5568 15.0016-36.5568 37.4272v523.776c0 22.4256 14.6432 37.376 36.5568 37.376h625.408C950.784 1024 1024 567.6032 1024 541.3888c0-67.328-51.2-115.968-98.7648-115.968z m-116.992 519.9872h-588.8V500.224H307.2c25.6-7.4752 124.3648-44.9024 171.8784-127.1808 18.2784-29.952 29.2864-74.8544 40.2432-123.4944 10.9568-44.8512 21.9136-100.9664 40.2432-115.968 3.6352-3.7376 21.9136-7.4752 43.8784 0 18.2784 3.7376 47.5136 22.4768 54.8352 78.592 14.6432 119.7056-36.5568 235.6736-36.5568 235.6736-3.6864 11.2128-3.6864 26.1632 3.6352 37.376 7.3216 11.264 18.2784 18.7392 29.2864 18.7392h270.592c7.3216 0 29.2864 14.9504 29.2864 37.376-3.6864 78.592-95.0784 404.0704-146.2784 404.0704zM36.5568 425.4208C14.6432 425.472 0 440.4224 0 462.848v523.776c0 22.4256 14.6432 37.376 36.5568 37.376 21.9648 0 36.608-14.9504 36.608-37.376V462.848c0-22.4256-14.6432-37.376-36.608-37.376z" })));
|
|
5
5
|
}
|
|
6
6
|
Good.displayName = 'FeedbackGood';
|
|
7
7
|
export default Good;
|
|
@@ -15,14 +15,8 @@ function parsePosition(position, element) {
|
|
|
15
15
|
const [widthRatio, heightRatio] = position;
|
|
16
16
|
const { width, height } = getScreenSize();
|
|
17
17
|
const rect = element.getBoundingClientRect();
|
|
18
|
-
console.log('getScreenSize', getScreenSize());
|
|
19
|
-
console.log('position', position);
|
|
20
|
-
debugger;
|
|
21
18
|
const maxLeft = width - rect.width;
|
|
22
19
|
const maxTop = height - rect.height;
|
|
23
|
-
console.log('maxLeft', maxLeft);
|
|
24
|
-
console.log('maxTop', maxTop);
|
|
25
|
-
debugger;
|
|
26
20
|
return {
|
|
27
21
|
transform: `translate(${Math.min(maxLeft, normalizePositionRatio(widthRatio) * width)}px, ${Math.min(maxTop, normalizePositionRatio(heightRatio) * height)}px)`,
|
|
28
22
|
left: 0,
|
|
@@ -35,7 +29,6 @@ function normalizePositionStyle(position) {
|
|
|
35
29
|
if (!position) {
|
|
36
30
|
return undefined;
|
|
37
31
|
}
|
|
38
|
-
debugger;
|
|
39
32
|
return {
|
|
40
33
|
transform: `translate(${position.left}px, ${position.top}px)`,
|
|
41
34
|
left: 0,
|
|
@@ -78,10 +71,8 @@ export function useDragable(dom, options) {
|
|
|
78
71
|
}
|
|
79
72
|
e.preventDefault();
|
|
80
73
|
isMoving = true;
|
|
81
|
-
debugger;
|
|
82
74
|
// do update dom position
|
|
83
75
|
const position = Object.assign({ left: e.clientX + leftOffset, top: e.clientY + topOffset }, domSize);
|
|
84
|
-
debugger;
|
|
85
76
|
const adjustPosition = adjustBySafeAreaMargin(position, domRect, optionsRef.current.safeAreaMargin);
|
|
86
77
|
const { left, top } = adjustPosition || position;
|
|
87
78
|
if (lastPosition && lastPosition.left === left && lastPosition.top === top) {
|
|
@@ -129,7 +120,6 @@ export function useDragable(dom, options) {
|
|
|
129
120
|
window.removeEventListener('up', up);
|
|
130
121
|
};
|
|
131
122
|
}, [dom, options.enable]);
|
|
132
|
-
debugger;
|
|
133
123
|
return {
|
|
134
124
|
className: '',
|
|
135
125
|
style: (position ? normalizePositionStyle(position) : undefined) ||
|
package/es/index.js
CHANGED
package/lib/core/variables.scss
CHANGED
package/lib/feedback/index.js
CHANGED
|
@@ -14,7 +14,7 @@ const good_1 = tslib_1.__importDefault(require("./view/good"));
|
|
|
14
14
|
* @when 需要获取用户针对显示内容的赞同或否定意见时
|
|
15
15
|
*/
|
|
16
16
|
function Feedback(props) {
|
|
17
|
-
const { className, order = ['
|
|
17
|
+
const { className, order = ['bad', 'good'], size, direction = 'hoz', defaultValue, value: _value, onChange: _onChange, renderItem } = props, rests = tslib_1.__rest(props, ["className", "order", "size", "direction", "defaultValue", "value", "onChange", "renderItem"]);
|
|
18
18
|
const cls = `${utils_1.PREFIX_DEFAULT}feedback`;
|
|
19
19
|
const [value, onChange] = (0, utils_1.useControlable)(props);
|
|
20
20
|
const defaultRenderItem = (0, react_1.useCallback)((status) => {
|
package/lib/feedback/main.scss
CHANGED
|
@@ -7,6 +7,9 @@
|
|
|
7
7
|
padding: 0 4px;
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: row;
|
|
10
|
+
button:first-child {
|
|
11
|
+
margin-right: 16px;
|
|
12
|
+
}
|
|
10
13
|
}
|
|
11
14
|
&-item {
|
|
12
15
|
background-color: transparent;
|
|
@@ -15,10 +18,10 @@
|
|
|
15
18
|
display: inline-flex;
|
|
16
19
|
justify-content: center;
|
|
17
20
|
align-items: center;
|
|
18
|
-
padding: 0 4px;
|
|
19
21
|
cursor: pointer;
|
|
20
|
-
color:
|
|
22
|
+
color: $color-line1-3;
|
|
21
23
|
font-size: inherit;
|
|
24
|
+
padding: 0px;
|
|
22
25
|
transition:
|
|
23
26
|
color 0.15s,
|
|
24
27
|
opacity 0.15s;
|
|
@@ -35,7 +38,7 @@
|
|
|
35
38
|
line-height: 1;
|
|
36
39
|
|
|
37
40
|
&--bad {
|
|
38
|
-
transform:
|
|
41
|
+
transform: rotateX(180deg);
|
|
39
42
|
}
|
|
40
43
|
}
|
|
41
44
|
}
|
|
@@ -4,7 +4,7 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
5
|
function Good(props) {
|
|
6
6
|
return (react_1.default.createElement("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 1024 1024" }, props),
|
|
7
|
-
react_1.default.createElement("path", { fill: "currentColor", d: "
|
|
7
|
+
react_1.default.createElement("path", { fill: "currentColor", d: "M925.2352 425.472h-215.7568c14.6432-52.3776 32.9216-134.656 21.9648-220.7232-7.3216-71.1168-47.5648-123.4944-106.0864-145.92-43.8784-14.9504-87.7568-7.4752-113.3568 18.688-29.2352 29.952-43.8784 89.8048-58.5216 149.6576-10.9568 41.1648-18.2784 82.2784-32.9216 104.7552C384 395.52 303.616 421.6832 288.9216 425.4208H182.784c-21.9136 0-36.5568 15.0016-36.5568 37.4272v523.776c0 22.4256 14.6432 37.376 36.5568 37.376h625.408C950.784 1024 1024 567.6032 1024 541.3888c0-67.328-51.2-115.968-98.7648-115.968z m-116.992 519.9872h-588.8V500.224H307.2c25.6-7.4752 124.3648-44.9024 171.8784-127.1808 18.2784-29.952 29.2864-74.8544 40.2432-123.4944 10.9568-44.8512 21.9136-100.9664 40.2432-115.968 3.6352-3.7376 21.9136-7.4752 43.8784 0 18.2784 3.7376 47.5136 22.4768 54.8352 78.592 14.6432 119.7056-36.5568 235.6736-36.5568 235.6736-3.6864 11.2128-3.6864 26.1632 3.6352 37.376 7.3216 11.264 18.2784 18.7392 29.2864 18.7392h270.592c7.3216 0 29.2864 14.9504 29.2864 37.376-3.6864 78.592-95.0784 404.0704-146.2784 404.0704zM36.5568 425.4208C14.6432 425.472 0 440.4224 0 462.848v523.776c0 22.4256 14.6432 37.376 36.5568 37.376 21.9648 0 36.608-14.9504 36.608-37.376V462.848c0-22.4256-14.6432-37.376-36.608-37.376z" })));
|
|
8
8
|
}
|
|
9
9
|
Good.displayName = 'FeedbackGood';
|
|
10
10
|
exports.default = Good;
|
|
@@ -18,14 +18,8 @@ function parsePosition(position, element) {
|
|
|
18
18
|
const [widthRatio, heightRatio] = position;
|
|
19
19
|
const { width, height } = (0, util_1.getScreenSize)();
|
|
20
20
|
const rect = element.getBoundingClientRect();
|
|
21
|
-
console.log('getScreenSize', (0, util_1.getScreenSize)());
|
|
22
|
-
console.log('position', position);
|
|
23
|
-
debugger;
|
|
24
21
|
const maxLeft = width - rect.width;
|
|
25
22
|
const maxTop = height - rect.height;
|
|
26
|
-
console.log('maxLeft', maxLeft);
|
|
27
|
-
console.log('maxTop', maxTop);
|
|
28
|
-
debugger;
|
|
29
23
|
return {
|
|
30
24
|
transform: `translate(${Math.min(maxLeft, normalizePositionRatio(widthRatio) * width)}px, ${Math.min(maxTop, normalizePositionRatio(heightRatio) * height)}px)`,
|
|
31
25
|
left: 0,
|
|
@@ -38,7 +32,6 @@ function normalizePositionStyle(position) {
|
|
|
38
32
|
if (!position) {
|
|
39
33
|
return undefined;
|
|
40
34
|
}
|
|
41
|
-
debugger;
|
|
42
35
|
return {
|
|
43
36
|
transform: `translate(${position.left}px, ${position.top}px)`,
|
|
44
37
|
left: 0,
|
|
@@ -81,10 +74,8 @@ function useDragable(dom, options) {
|
|
|
81
74
|
}
|
|
82
75
|
e.preventDefault();
|
|
83
76
|
isMoving = true;
|
|
84
|
-
debugger;
|
|
85
77
|
// do update dom position
|
|
86
78
|
const position = Object.assign({ left: e.clientX + leftOffset, top: e.clientY + topOffset }, domSize);
|
|
87
|
-
debugger;
|
|
88
79
|
const adjustPosition = (0, util_1.adjustBySafeAreaMargin)(position, domRect, optionsRef.current.safeAreaMargin);
|
|
89
80
|
const { left, top } = adjustPosition || position;
|
|
90
81
|
if (lastPosition && lastPosition.left === left && lastPosition.top === top) {
|
|
@@ -132,7 +123,6 @@ function useDragable(dom, options) {
|
|
|
132
123
|
window.removeEventListener('up', up);
|
|
133
124
|
};
|
|
134
125
|
}, [dom, options.enable]);
|
|
135
|
-
debugger;
|
|
136
126
|
return {
|
|
137
127
|
className: '',
|
|
138
128
|
style: (position ? normalizePositionStyle(position) : undefined) ||
|
package/lib/index.js
CHANGED
|
@@ -18,4 +18,4 @@ var tag_1 = require("./tag");
|
|
|
18
18
|
Object.defineProperty(exports, "Tag", { enumerable: true, get: function () { return __importDefault(tag_1).default; } });
|
|
19
19
|
var tab_1 = require("./tab");
|
|
20
20
|
Object.defineProperty(exports, "Tab", { enumerable: true, get: function () { return __importDefault(tab_1).default; } });
|
|
21
|
-
exports.version = '0.1.
|
|
21
|
+
exports.version = '0.1.12';
|