@alifd/chat 0.1.12 → 0.1.14

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.
@@ -31,3 +31,5 @@ $color-line1-2: var(--color-line1-2, #dcdee3) !default;
31
31
  $color-line1-3: var(--color-line1-3, #c4c6cf) !default;
32
32
  /// 重
33
33
  $color-line1-4: var(--color-line1-4, #a0a2ad) !default;
34
+
35
+
@@ -12,7 +12,7 @@ import Good from './view/good';
12
12
  * @when 需要获取用户针对显示内容的赞同或否定意见时
13
13
  */
14
14
  function Feedback(props) {
15
- const { className, order = ['good', 'bad'], size, direction = 'hoz', defaultValue, value: _value, onChange: _onChange, renderItem } = props, rests = __rest(props, ["className", "order", "size", "direction", "defaultValue", "value", "onChange", "renderItem"]);
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) => {
@@ -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: inherit;
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: rotate(180deg);
41
+ transform: rotateX(180deg);
39
42
  }
40
43
  }
41
44
  }
@@ -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: "M832 364.8H684.8s19.2-64 32-179.2C723.2 128 678.4 70.4 614.4 64h-12.8c-51.2 0-83.2 32-102.4 76.8l-38.4 96c-32 64-57.6 102.4-76.8 115.2-25.6 12.8-121.6 12.8-128 12.8H128c-38.4 0-64 25.6-64 57.6v480c0 32 25.6 57.6 64 57.6h646.4c96 0 121.6-64 134.4-153.6L960 499.2c6.4-70.4-6.4-134.4-128-134.4zM256 902.4H128v-480h128v480zm640-409.6L844.8 800C832 857.6 832 902.4 768 902.4H320v-480c44.8 0 70.4-6.4 89.6-19.2 32-12.8 64-64 108.8-147.2 25.6-64 38.4-96 44.8-102.4 6.4-19.2 19.2-32 44.8-32h6.4c32 0 44.8 32 44.8 51.2-12.8 102.4-32 166.4-32 166.4l-25.6 83.2h243.2c19.2 0 32 0 44.8 12.8 12.8 12.8 6.4 38.4 6.4 57.6z" })));
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) ||
@@ -27,6 +27,7 @@
27
27
  }
28
28
  &-inner-start {
29
29
  flex: 1;
30
+ overflow: hidden;
30
31
  }
31
32
  &-inner-end {
32
33
  flex: none;
package/es/index.js CHANGED
@@ -5,4 +5,4 @@ export { default as FloatButton } from './float-button';
5
5
  export { default as Text } from './text';
6
6
  export { default as Tag } from './tag';
7
7
  export { default as Tab } from './tab';
8
- export const version = '0.1.10';
8
+ export const version = '0.1.13';
@@ -31,3 +31,5 @@ $color-line1-2: var(--color-line1-2, #dcdee3) !default;
31
31
  $color-line1-3: var(--color-line1-3, #c4c6cf) !default;
32
32
  /// 重
33
33
  $color-line1-4: var(--color-line1-4, #a0a2ad) !default;
34
+
35
+
@@ -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 = ['good', 'bad'], size, direction = 'hoz', defaultValue, value: _value, onChange: _onChange, renderItem } = props, rests = tslib_1.__rest(props, ["className", "order", "size", "direction", "defaultValue", "value", "onChange", "renderItem"]);
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) => {
@@ -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: inherit;
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: rotate(180deg);
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: "M832 364.8H684.8s19.2-64 32-179.2C723.2 128 678.4 70.4 614.4 64h-12.8c-51.2 0-83.2 32-102.4 76.8l-38.4 96c-32 64-57.6 102.4-76.8 115.2-25.6 12.8-121.6 12.8-128 12.8H128c-38.4 0-64 25.6-64 57.6v480c0 32 25.6 57.6 64 57.6h646.4c96 0 121.6-64 134.4-153.6L960 499.2c6.4-70.4-6.4-134.4-128-134.4zM256 902.4H128v-480h128v480zm640-409.6L844.8 800C832 857.6 832 902.4 768 902.4H320v-480c44.8 0 70.4-6.4 89.6-19.2 32-12.8 64-64 108.8-147.2 25.6-64 38.4-96 44.8-102.4 6.4-19.2 19.2-32 44.8-32h6.4c32 0 44.8 32 44.8 51.2-12.8 102.4-32 166.4-32 166.4l-25.6 83.2h243.2c19.2 0 32 0 44.8 12.8 12.8 12.8 6.4 38.4 6.4 57.6z" })));
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) ||
@@ -27,6 +27,7 @@
27
27
  }
28
28
  &-inner-start {
29
29
  flex: 1;
30
+ overflow: hidden;
30
31
  }
31
32
  &-inner-end {
32
33
  flex: none;
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.10';
21
+ exports.version = '0.1.13';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alifd/chat",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "description": "A configurable component library for chat built on React.",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",