@alifd/chat 0.1.10 → 0.1.12

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.
@@ -15,8 +15,14 @@ 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;
18
21
  const maxLeft = width - rect.width;
19
22
  const maxTop = height - rect.height;
23
+ console.log('maxLeft', maxLeft);
24
+ console.log('maxTop', maxTop);
25
+ debugger;
20
26
  return {
21
27
  transform: `translate(${Math.min(maxLeft, normalizePositionRatio(widthRatio) * width)}px, ${Math.min(maxTop, normalizePositionRatio(heightRatio) * height)}px)`,
22
28
  left: 0,
@@ -29,6 +35,7 @@ function normalizePositionStyle(position) {
29
35
  if (!position) {
30
36
  return undefined;
31
37
  }
38
+ debugger;
32
39
  return {
33
40
  transform: `translate(${position.left}px, ${position.top}px)`,
34
41
  left: 0,
@@ -71,8 +78,10 @@ export function useDragable(dom, options) {
71
78
  }
72
79
  e.preventDefault();
73
80
  isMoving = true;
81
+ debugger;
74
82
  // do update dom position
75
83
  const position = Object.assign({ left: e.clientX + leftOffset, top: e.clientY + topOffset }, domSize);
84
+ debugger;
76
85
  const adjustPosition = adjustBySafeAreaMargin(position, domRect, optionsRef.current.safeAreaMargin);
77
86
  const { left, top } = adjustPosition || position;
78
87
  if (lastPosition && lastPosition.left === left && lastPosition.top === top) {
@@ -120,6 +129,7 @@ export function useDragable(dom, options) {
120
129
  window.removeEventListener('up', up);
121
130
  };
122
131
  }, [dom, options.enable]);
132
+ debugger;
123
133
  return {
124
134
  className: '',
125
135
  style: (position ? normalizePositionStyle(position) : undefined) ||
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.9';
8
+ export const version = '0.1.10';
@@ -18,8 +18,14 @@ 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;
21
24
  const maxLeft = width - rect.width;
22
25
  const maxTop = height - rect.height;
26
+ console.log('maxLeft', maxLeft);
27
+ console.log('maxTop', maxTop);
28
+ debugger;
23
29
  return {
24
30
  transform: `translate(${Math.min(maxLeft, normalizePositionRatio(widthRatio) * width)}px, ${Math.min(maxTop, normalizePositionRatio(heightRatio) * height)}px)`,
25
31
  left: 0,
@@ -32,6 +38,7 @@ function normalizePositionStyle(position) {
32
38
  if (!position) {
33
39
  return undefined;
34
40
  }
41
+ debugger;
35
42
  return {
36
43
  transform: `translate(${position.left}px, ${position.top}px)`,
37
44
  left: 0,
@@ -74,8 +81,10 @@ function useDragable(dom, options) {
74
81
  }
75
82
  e.preventDefault();
76
83
  isMoving = true;
84
+ debugger;
77
85
  // do update dom position
78
86
  const position = Object.assign({ left: e.clientX + leftOffset, top: e.clientY + topOffset }, domSize);
87
+ debugger;
79
88
  const adjustPosition = (0, util_1.adjustBySafeAreaMargin)(position, domRect, optionsRef.current.safeAreaMargin);
80
89
  const { left, top } = adjustPosition || position;
81
90
  if (lastPosition && lastPosition.left === left && lastPosition.top === top) {
@@ -123,6 +132,7 @@ function useDragable(dom, options) {
123
132
  window.removeEventListener('up', up);
124
133
  };
125
134
  }, [dom, options.enable]);
135
+ debugger;
126
136
  return {
127
137
  className: '',
128
138
  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.9';
21
+ exports.version = '0.1.10';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alifd/chat",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "A configurable component library for chat built on React.",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",