@alifd/chat 0.3.0-beta.9 → 0.3.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/es/button/index.js +1 -1
- package/es/button/main.scss +1 -1
- package/es/button/style.d.ts +1 -1
- package/es/button/style.js +1 -1
- package/es/core/variables.scss +33 -11
- package/es/date-picker/style.d.ts +1 -1
- package/es/date-picker/style.js +1 -1
- package/es/drawer/index.js +2 -4
- package/es/drawer/main.scss +3 -1
- package/es/float-button/hooks/useNestleEdge.js +1 -0
- package/es/float-button/index.d.ts +1 -0
- package/es/float-button/index.js +2 -1
- package/es/float-button/main.scss +23 -0
- package/es/float-button/style.d.ts +2 -2
- package/es/float-button/style.js +2 -2
- package/es/float-button/types.d.ts +23 -0
- package/es/float-button/util.js +2 -0
- package/es/float-button/view/addon-after.d.ts +4 -0
- package/es/float-button/view/addon-after.js +10 -0
- package/es/float-button/view/backtop.js +3 -1
- package/es/html-render/index.js +2 -2
- package/es/html-render/main.scss +16 -11
- package/es/index.js +1 -1
- package/es/input/style.d.ts +1 -1
- package/es/input/style.js +1 -1
- package/es/markdown/index.js +2 -2
- package/es/markdown/main.scss +103 -108
- package/es/person-picker/style.d.ts +1 -1
- package/es/person-picker/style.js +1 -1
- package/es/tab/style.d.ts +1 -1
- package/es/tab/style.js +1 -1
- package/es/tag/style.d.ts +1 -1
- package/es/tag/style.js +1 -1
- package/es/time-picker/style.d.ts +1 -1
- package/es/time-picker/style.js +1 -1
- package/lib/button/index.js +1 -1
- package/lib/button/main.scss +1 -1
- package/lib/button/style.d.ts +1 -1
- package/lib/button/style.js +1 -1
- package/lib/core/variables.scss +33 -11
- package/lib/date-picker/style.d.ts +1 -1
- package/lib/date-picker/style.js +1 -1
- package/lib/drawer/index.js +2 -4
- package/lib/drawer/main.scss +3 -1
- package/lib/float-button/hooks/useNestleEdge.js +1 -0
- package/lib/float-button/index.d.ts +1 -0
- package/lib/float-button/index.js +2 -1
- package/lib/float-button/main.scss +23 -0
- package/lib/float-button/style.d.ts +2 -2
- package/lib/float-button/style.js +2 -2
- package/lib/float-button/types.d.ts +23 -0
- package/lib/float-button/util.js +2 -0
- package/lib/float-button/view/addon-after.d.ts +4 -0
- package/lib/float-button/view/addon-after.js +13 -0
- package/lib/float-button/view/backtop.js +3 -1
- package/lib/html-render/index.js +1 -1
- package/lib/html-render/main.scss +16 -11
- package/lib/index.js +1 -1
- package/lib/input/style.d.ts +1 -1
- package/lib/input/style.js +1 -1
- package/lib/markdown/index.js +1 -1
- package/lib/markdown/main.scss +103 -108
- package/lib/person-picker/style.d.ts +1 -1
- package/lib/person-picker/style.js +1 -1
- package/lib/tab/style.d.ts +1 -1
- package/lib/tab/style.js +1 -1
- package/lib/tag/style.d.ts +1 -1
- package/lib/tag/style.js +1 -1
- package/lib/time-picker/style.d.ts +1 -1
- package/lib/time-picker/style.js +1 -1
- package/package.json +1 -1
- package/es/html-render/index.less +0 -192
- package/lib/html-render/index.less +0 -192
package/es/markdown/main.scss
CHANGED
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
$primaryColor: $color-brand1-6;
|
|
4
4
|
$alternativePrimaryColor: $primaryColor;
|
|
5
5
|
$mistPrimaryColor: $color-brand1-1;
|
|
6
|
-
$mediumTextColor: $color-text1-3;
|
|
7
|
-
$subTextColor: $color-text1-2;
|
|
8
6
|
|
|
9
7
|
@mixin f-single-line() {
|
|
10
8
|
overflow: hidden;
|
|
@@ -12,18 +10,20 @@ $subTextColor: $color-text1-2;
|
|
|
12
10
|
text-overflow: ellipsis;
|
|
13
11
|
}
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
.#{$prefix}markdown {
|
|
14
|
+
img:only-child,
|
|
15
|
+
video:only-child,
|
|
16
|
+
.image:only-child
|
|
17
|
+
{
|
|
20
18
|
display: inline-block;
|
|
21
19
|
margin: 0;
|
|
22
20
|
font-size: inherit;
|
|
23
21
|
vertical-align: inherit;
|
|
24
|
-
}
|
|
25
22
|
|
|
26
|
-
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
max-width: 100%;
|
|
26
|
+
.emoji {
|
|
27
27
|
width: 1em;
|
|
28
28
|
height: 1em;
|
|
29
29
|
vertical-align: text-top;
|
|
@@ -31,124 +31,119 @@ $subTextColor: $color-text1-2;
|
|
|
31
31
|
pointer-events: none;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
.title {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.text > div {
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
.reference {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
34
|
+
.title {
|
|
35
|
+
font-size: 16px;
|
|
36
|
+
font-weight: bolder;
|
|
37
|
+
margin-bottom: 12px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.text > div {
|
|
41
|
+
color:$color-text1-2;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.reference {
|
|
45
|
+
margin-top: 6px;
|
|
46
|
+
font-size: 12px;
|
|
47
|
+
|
|
48
|
+
&-tip {
|
|
49
|
+
display: flex;
|
|
50
|
+
margin: 0 -16px 6px 0;
|
|
51
|
+
justify-content: flex-end;
|
|
52
|
+
|
|
53
|
+
&-inner {
|
|
54
|
+
@include f-single-line();
|
|
55
|
+
background: linear-gradient(to right, transparent, $mistPrimaryColor);
|
|
56
|
+
padding: 0 16px 0 32px;
|
|
57
|
+
color: $color-text1-3;
|
|
58
|
+
min-width: 0;
|
|
59
|
+
flex: 0 1 auto;
|
|
60
|
+
font-size: 12px;
|
|
61
|
+
line-height: 20px;
|
|
62
|
+
}
|
|
62
63
|
}
|
|
63
64
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
margin-bottom: 8px;
|
|
71
|
-
}
|
|
72
|
-
.code-block-header {
|
|
73
|
-
display: flex;
|
|
74
|
-
height:24px;
|
|
75
|
-
// margin-top: 8px;
|
|
76
|
-
justify-content: space-between;
|
|
77
|
-
align-items: center;
|
|
78
|
-
background-color: #EAECED;
|
|
79
|
-
padding: 5px 10px;
|
|
80
|
-
border-top-left-radius: 4px;
|
|
81
|
-
border-top-right-radius: 4px;
|
|
82
|
-
border-bottom: 1px solid #ddd;
|
|
65
|
+
|
|
66
|
+
.trustworthyRiskAlert {
|
|
67
|
+
font-size: 12px;
|
|
68
|
+
line-height: 18px;
|
|
69
|
+
color: $color-text1-2;
|
|
70
|
+
margin-bottom: 8px;
|
|
83
71
|
}
|
|
84
|
-
|
|
72
|
+
.code-block-header {
|
|
73
|
+
display: flex;
|
|
74
|
+
height:24px;
|
|
75
|
+
// margin-top: 8px;
|
|
76
|
+
justify-content: space-between;
|
|
77
|
+
align-items: center;
|
|
78
|
+
background-color: $color-fill1-2;
|
|
79
|
+
padding: 5px 10px;
|
|
80
|
+
border-top-left-radius: 4px;
|
|
81
|
+
border-top-right-radius: 4px;
|
|
82
|
+
border-bottom: 1px solid $color-line1-2;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
85
|
.code-block-language {
|
|
86
86
|
font-weight: bold;
|
|
87
87
|
}
|
|
88
|
-
|
|
88
|
+
|
|
89
89
|
.code-block-copy {
|
|
90
|
-
color:
|
|
90
|
+
color: $color-text1-2;
|
|
91
|
+
background-color: transparent;
|
|
91
92
|
border: none;
|
|
92
93
|
border-radius: 4px;
|
|
93
94
|
height: 20px;
|
|
94
95
|
cursor: pointer;
|
|
96
|
+
font-size: 12px;
|
|
95
97
|
}
|
|
96
|
-
|
|
98
|
+
|
|
97
99
|
pre {
|
|
98
|
-
background-color:
|
|
100
|
+
background-color: $color-fill1-2;
|
|
99
101
|
border-bottom-left-radius: 14px;
|
|
100
102
|
border-bottom-right-radius: 14px;
|
|
103
|
+
border-top-left-radius: 0;
|
|
104
|
+
border-top-right-radius: 0px;
|
|
101
105
|
padding: 10px;
|
|
102
106
|
margin-bottom: 10px;
|
|
103
107
|
}
|
|
104
108
|
|
|
105
109
|
.code-block-copy:hover {
|
|
106
|
-
|
|
110
|
+
color: $color-line1-4;
|
|
107
111
|
}
|
|
108
|
-
|
|
109
112
|
//https://done.alibaba-inc.com/dsm/16247/theme/style/font?type=theme&themeid=126576
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
--common_gray2_color: #{$color-line1-2};
|
|
148
|
-
--common_gray3_color: #{$color-line1-3};
|
|
149
|
-
--common_gray4_color: #{$color-line1-4};
|
|
150
|
-
|
|
151
|
-
--common_gray5_color: #{$color-fill1-2};
|
|
152
|
-
--common_gray6_color: #{$color-fill1-1};
|
|
153
|
-
}
|
|
154
|
-
|
|
113
|
+
|
|
114
|
+
// 暂时先把钉卡片用到的主题变量放在markdown组件内部进行覆盖
|
|
115
|
+
--common_hypertitle_text_style__font_size: #{$font-size-display-3};
|
|
116
|
+
--common_largetitle_text_style__font_size: #{$font-size-display-2};
|
|
117
|
+
--common_h1_text_style__font_size: #{$font-size-headline};
|
|
118
|
+
--common_h2_text_style__font_size: #{$font-size-title};
|
|
119
|
+
--common_h3_text_style__font_size: 18px;
|
|
120
|
+
--common_h4_text_style__font_size: #{$font-size-subhead};
|
|
121
|
+
--common_h5_text_style__font_size: 15px;
|
|
122
|
+
--common_body_text_style__font_size: #{$font-size-body-2};
|
|
123
|
+
--common_footnote_text_style__font_size: #{$font-size-body-1};
|
|
124
|
+
|
|
125
|
+
--common_yellow1_color: #{$color-data1-6}; // #F4C800
|
|
126
|
+
--common_orange1_color: #{$color-data1-5}; // #FF9200
|
|
127
|
+
--common_red1_color: #{$color-data1-4}; // #FF5219
|
|
128
|
+
// TODO 需要扩充主题
|
|
129
|
+
--common_pink1_color: #{$color-data1-9};; //
|
|
130
|
+
--common_purple1_color: #{$color-data1-3}; // #B963D3
|
|
131
|
+
--common_blue1_color: #{$color-data1-2}; // #007FFF
|
|
132
|
+
|
|
133
|
+
--common_water1_color: #{$color-data1-8}; //浅蓝 #5AC8FA
|
|
134
|
+
--common_olive1_color: #{$color-data1-10}; // #6F9200 通用草绿色
|
|
135
|
+
--common_green1_color: #{$color-data1-7}; // #00B042 通用绿色
|
|
136
|
+
|
|
137
|
+
--common_level1_base_color: #{$color-text1-4};
|
|
138
|
+
--common_level2_base_color: #{$color-text1-3};
|
|
139
|
+
--common_level3_base_color: #{$color-text1-2};
|
|
140
|
+
--common_level4_base_color: #{$color-text1-1};
|
|
141
|
+
|
|
142
|
+
--common_gray1_color: #{$color-line1-1};
|
|
143
|
+
--common_gray2_color: #{$color-line1-2};
|
|
144
|
+
--common_gray3_color: #{$color-line1-3};
|
|
145
|
+
--common_gray4_color: #{$color-line1-4};
|
|
146
|
+
|
|
147
|
+
--common_gray5_color: #{$color-fill1-2};
|
|
148
|
+
--common_gray6_color: #{$color-fill1-1};
|
|
149
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '@alifd/next/lib/select/
|
|
1
|
+
import '@alifd/next/lib/select/style2';
|
|
2
2
|
import './main.scss';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '@alifd/next/lib/select/
|
|
1
|
+
import '@alifd/next/lib/select/style2';
|
|
2
2
|
import './main.scss';
|
package/es/tab/style.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '@alifd/next/lib/tab/
|
|
1
|
+
import '@alifd/next/lib/tab/style2';
|
|
2
2
|
import './main.scss';
|
package/es/tab/style.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '@alifd/next/lib/tab/
|
|
1
|
+
import '@alifd/next/lib/tab/style2';
|
|
2
2
|
import './main.scss';
|
package/es/tag/style.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '@alifd/next/lib/tag/
|
|
1
|
+
import '@alifd/next/lib/tag/style2';
|
|
2
2
|
import './main.scss';
|
package/es/tag/style.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '@alifd/next/lib/tag/
|
|
1
|
+
import '@alifd/next/lib/tag/style2';
|
|
2
2
|
import './main.scss';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import '@alifd/next/lib/time-picker2/
|
|
1
|
+
import '@alifd/next/lib/time-picker2/style2';
|
package/es/time-picker/style.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import '@alifd/next/lib/time-picker2/
|
|
1
|
+
import '@alifd/next/lib/time-picker2/style2';
|
package/lib/button/index.js
CHANGED
|
@@ -26,7 +26,7 @@ const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
|
26
26
|
const utils_1 = require("../utils");
|
|
27
27
|
const Button = (0, react_1.forwardRef)((_a, ref) => {
|
|
28
28
|
var { className, size = 'small' } = _a, props = tslib_1.__rest(_a, ["className", "size"]);
|
|
29
|
-
return (react_1.default.createElement(next_1.Button, Object.assign({}, props, { className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}button`, className), size: size, ref: ref })));
|
|
29
|
+
return (react_1.default.createElement(next_1.Button, Object.assign({}, props, { className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}button ${size}`, className), size: size, ref: ref })));
|
|
30
30
|
});
|
|
31
31
|
const ButtonWithSub = (0, utils_1.assignSubComponent)(Button, {
|
|
32
32
|
displayName: 'Button',
|
package/lib/button/main.scss
CHANGED
package/lib/button/style.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import '@alifd/next/lib/button/
|
|
1
|
+
import '@alifd/next/lib/button/style2';
|
|
2
2
|
import './main.scss';
|
package/lib/button/style.js
CHANGED
package/lib/core/variables.scss
CHANGED
|
@@ -7,6 +7,17 @@ $shadow-2: 2px 4px 16px 0px rgba(0, 0, 0, 0.12) !default;
|
|
|
7
7
|
|
|
8
8
|
$font-size-display-3: var(--font-size-display-3, 56px) !default;
|
|
9
9
|
$font-size-display-2: var(--font-size-display-2, 48px) !default;
|
|
10
|
+
$s-1: var(---s-1, 4px) !default;
|
|
11
|
+
$s-2: var(---s-2, 8px) !default;
|
|
12
|
+
$s-3: var(---s-3, 12px) !default;
|
|
13
|
+
$s-4: var(---s-4, 16px) !default;
|
|
14
|
+
$s-5: var(---s-5, 20px) !default;
|
|
15
|
+
$s-6: var(---s-6, 24px) !default;
|
|
16
|
+
$s-7: var(---s-7, 28px) !default;
|
|
17
|
+
$s-8: var(---s-8, 32px) !default;
|
|
18
|
+
$s-9: var(---s-9, 36px) !default;
|
|
19
|
+
$s-10: var(---s-10, 40px) !default;
|
|
20
|
+
|
|
10
21
|
|
|
11
22
|
$font-size-headline: var(--font-size-headline, 24px) !default;
|
|
12
23
|
$font-size-title: var(--font-size-title, 20px) !default;
|
|
@@ -37,24 +48,35 @@ $color-line1-4: var(--color-line1-4, #a0a2ad) !default;
|
|
|
37
48
|
|
|
38
49
|
$color-brand1-1: var(--color-brand1-1, #DEE8FF) !default;
|
|
39
50
|
|
|
40
|
-
$color-fill1-
|
|
51
|
+
$color-fill1-1: var(--color-fill1-1, rgba(3, 11, 53, 0.03)) !default;
|
|
52
|
+
|
|
53
|
+
$color-fill1-2: var(--color-fill1-2, rgb(242, 243, 247)) !default;
|
|
54
|
+
|
|
55
|
+
$color-fill1-3: var(--color-fill1-3, rgb(235, 236, 240)) !default;
|
|
56
|
+
|
|
57
|
+
$color-fill1-4: var(--color-fill1-4, rgb(226, 228, 232)) !default;
|
|
58
|
+
|
|
59
|
+
$color-data1-1: var(--color-data1-1, #2d9c9c) !default; // ??
|
|
60
|
+
|
|
61
|
+
$color-data1-2: var(--color-data1-2, #0089ff) !default; // blue
|
|
62
|
+
|
|
63
|
+
$color-data1-3: var(--color-data1-3, #b963d3) !default; // purple
|
|
41
64
|
|
|
42
|
-
$color-
|
|
65
|
+
$color-data1-4: var(--color-data1-4, #ff5219) !default; // red
|
|
43
66
|
|
|
44
|
-
$color-data1-
|
|
67
|
+
$color-data1-5: var(--color-data1-5, #ff9200) !default; // orange
|
|
45
68
|
|
|
46
|
-
$color-data1-
|
|
69
|
+
$color-data1-6: var(--color-data1-6, #f4c800) !default; // yellow
|
|
47
70
|
|
|
48
|
-
$color-data1-
|
|
71
|
+
$color-data1-7: var(--color-data1-7, #00b042) !default; // ?
|
|
49
72
|
|
|
50
|
-
$color-data1-
|
|
73
|
+
$color-data1-8: var(--color-data1-8, #5ac8fa) !default; // water
|
|
51
74
|
|
|
52
|
-
$color-data1-
|
|
75
|
+
$color-data1-9: var(--color-data1-9, #ec4589) !default; // ?
|
|
53
76
|
|
|
54
|
-
$color-data1-
|
|
77
|
+
$color-data1-10: var(--color-data1-10, #6f9200) !default; // ?
|
|
55
78
|
|
|
56
|
-
$color-
|
|
79
|
+
$color-link-3: var(--color-link-3, #0056ff) !default; // ?
|
|
57
80
|
|
|
58
|
-
$color-
|
|
81
|
+
$color-bg-1: var(--color-bg-1, #ffffff) !default; // ?
|
|
59
82
|
|
|
60
|
-
$color-data1-9: var(--color-data1-9, #da5388) !default; // ?
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import '@alifd/next/lib/date-picker2/
|
|
1
|
+
import '@alifd/next/lib/date-picker2/style2';
|
package/lib/date-picker/style.js
CHANGED
package/lib/drawer/index.js
CHANGED
|
@@ -16,11 +16,9 @@ const Drawer = (0, react_1.forwardRef)((_a, ref) => {
|
|
|
16
16
|
var { className, headerStyle, children, footer, footerClassName } = _a, props = tslib_1.__rest(_a, ["className", "headerStyle", "children", "footer", "footerClassName"]);
|
|
17
17
|
// 对齐小蜜现有的底部
|
|
18
18
|
const defaultHeaderStyle = {
|
|
19
|
-
"border-bottom:": "1px solid var(--40gmM)"
|
|
20
|
-
"border-top-left-radius": "16px",
|
|
21
|
-
"border-top-right-radius": "16px",
|
|
19
|
+
"border-bottom:": "1px solid var(--40gmM)"
|
|
22
20
|
};
|
|
23
|
-
return (react_1.default.createElement(next_1.Drawer, Object.assign({}, props, { ref: ref, headerStyle: Object.assign(Object.assign({}, defaultHeaderStyle), headerStyle), className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}drawer`, className) }),
|
|
21
|
+
return (react_1.default.createElement(next_1.Drawer, Object.assign({}, props, { v2: true, ref: ref, headerStyle: Object.assign(Object.assign({}, defaultHeaderStyle), headerStyle), className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}drawer`, className) }),
|
|
24
22
|
react_1.default.createElement("div", { className: 'draw-content' }, children),
|
|
25
23
|
footer && footer.length && react_1.default.createElement("div", { className: (0, classnames_1.default)('draw-footer', footerClassName) }, footer)));
|
|
26
24
|
});
|
package/lib/drawer/main.scss
CHANGED
|
@@ -12,6 +12,7 @@ function useNestleEdge(dom, { enable, safeAreaMargin, interactiveEdges, onUpdate
|
|
|
12
12
|
if (!enable || !dom) {
|
|
13
13
|
return;
|
|
14
14
|
}
|
|
15
|
+
// 悬浮球的dom的结构
|
|
15
16
|
const rect = dom.getBoundingClientRect();
|
|
16
17
|
const { left, top, width, height } = rect;
|
|
17
18
|
const { width: screenWidth, height: screenHeight } = (0, util_1.getScreenSize)();
|
|
@@ -2,6 +2,7 @@ declare const FloatButtonWithSub: import("@alifd/next/types/config-provider/type
|
|
|
2
2
|
Backtop: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<import("./types").BacktopProps & import("react").RefAttributes<import("./types").BacktopRef>, "key" | keyof import("./types").BacktopProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("./types").BacktopRef, {}>;
|
|
3
3
|
Drawer: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<import("./types").FloatButtonDrawerProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, undefined, {}>;
|
|
4
4
|
InnerDrawer: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<import("./types").FloatButtonInnerDrawerProps & import("@alifd/next/types/config-provider/types").ComponentCommonProps, undefined, {}>;
|
|
5
|
+
AddonAfter: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<import("./types").AddonAfterProps & import("react").RefAttributes<import("./types").AddonAfterRef>, "key" | keyof import("./types").AddonAfterProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, import("./types").AddonAfterRef, {}>;
|
|
5
6
|
};
|
|
6
7
|
export type { BacktopRef, BacktopProps, FloatButtonRef, FloatButtonProps, FloatButtonDrawerProps, FloatButtonInnerDrawerProps, Edge, Margin, Position, RequiredParts, ScreenRatioPosition, Size, TriggerType, } from './types';
|
|
7
8
|
export default FloatButtonWithSub;
|
|
@@ -3,8 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const float_button_1 = tslib_1.__importDefault(require("./view/float-button"));
|
|
5
5
|
const backtop_1 = tslib_1.__importDefault(require("./view/backtop"));
|
|
6
|
+
const addon_after_1 = tslib_1.__importDefault(require("./view/addon-after"));
|
|
6
7
|
const inner_drawer_1 = tslib_1.__importDefault(require("./view/inner-drawer"));
|
|
7
8
|
const drawer_1 = tslib_1.__importDefault(require("./view/drawer"));
|
|
8
9
|
const index_1 = require("../utils/index");
|
|
9
|
-
const FloatButtonWithSub = (0, index_1.assignSubComponent)(float_button_1.default, { Backtop: backtop_1.default, Drawer: drawer_1.default, InnerDrawer: inner_drawer_1.default });
|
|
10
|
+
const FloatButtonWithSub = (0, index_1.assignSubComponent)(float_button_1.default, { Backtop: backtop_1.default, Drawer: drawer_1.default, InnerDrawer: inner_drawer_1.default, AddonAfter: addon_after_1.default });
|
|
10
11
|
exports.default = FloatButtonWithSub;
|
|
@@ -16,6 +16,29 @@
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
+
&-addon-after {
|
|
20
|
+
opacity: 1;
|
|
21
|
+
transition:
|
|
22
|
+
opacity 0.2s,
|
|
23
|
+
transform 0.2s;
|
|
24
|
+
cursor: pointer;
|
|
25
|
+
&--show-with-hover {
|
|
26
|
+
opacity: 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&:hover {
|
|
31
|
+
.ct-float-button-addon-after--show-with-hover{
|
|
32
|
+
opacity: 1;
|
|
33
|
+
}
|
|
34
|
+
&-addon-after {
|
|
35
|
+
&--show-with-hover {
|
|
36
|
+
opacity: 1;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
}
|
|
41
|
+
|
|
19
42
|
&-inner-drawer {
|
|
20
43
|
flex: 1;
|
|
21
44
|
overflow: hidden;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import '@alifd/next/lib/balloon/
|
|
2
|
-
import '@alifd/next/lib/drawer/
|
|
1
|
+
import '@alifd/next/lib/balloon/style2';
|
|
2
|
+
import '@alifd/next/lib/drawer/style2';
|
|
3
3
|
import './main.scss';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
require("@alifd/next/lib/balloon/
|
|
4
|
-
require("@alifd/next/lib/drawer/
|
|
3
|
+
require("@alifd/next/lib/balloon/style2");
|
|
4
|
+
require("@alifd/next/lib/drawer/style2");
|
|
5
5
|
require("./main.scss");
|
|
@@ -257,3 +257,26 @@ export interface FloatButtonDrawerProps extends FloatButtonProps {
|
|
|
257
257
|
beforeClose?: () => void;
|
|
258
258
|
afterClose?: () => void;
|
|
259
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* 底部额外区域 ref 对象
|
|
262
|
+
* @api
|
|
263
|
+
* @order 4
|
|
264
|
+
*/
|
|
265
|
+
export interface AddonAfterRef {
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* 底部额外区域
|
|
269
|
+
* @api FloatButton.AddonAfter
|
|
270
|
+
* @order 3
|
|
271
|
+
*/
|
|
272
|
+
export interface AddonAfterProps extends CommonProps {
|
|
273
|
+
/**
|
|
274
|
+
* 内容
|
|
275
|
+
*/
|
|
276
|
+
children: React.ReactNode;
|
|
277
|
+
/**
|
|
278
|
+
* 是否hover trigger 元素才出现
|
|
279
|
+
* @defaultValue 10
|
|
280
|
+
*/
|
|
281
|
+
showWithHover?: boolean;
|
|
282
|
+
}
|
package/lib/float-button/util.js
CHANGED
|
@@ -10,6 +10,7 @@ function getScreenSize() {
|
|
|
10
10
|
height: document.documentElement.clientHeight,
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
+
// 返回距离最近的边:top, right, left, bottom
|
|
13
14
|
function getNearlyEdge(el, interactiveEdges, rect = el.getBoundingClientRect()) {
|
|
14
15
|
if (!(interactiveEdges === null || interactiveEdges === void 0 ? void 0 : interactiveEdges.length)) {
|
|
15
16
|
return [];
|
|
@@ -51,6 +52,7 @@ function isInScreen(dom) {
|
|
|
51
52
|
const bottom = height - rect.top - rect.height;
|
|
52
53
|
return [left, top, right, bottom].every(n => n >= 0);
|
|
53
54
|
}
|
|
55
|
+
// 返回当前位置在安全区域内的安全位置
|
|
54
56
|
function adjustBySafeAreaMargin(position, rect, safeAreaMargin) {
|
|
55
57
|
if (!position || !rect || !safeAreaMargin) {
|
|
56
58
|
return undefined;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AddonAfterRef, AddonAfterProps } from '../types';
|
|
3
|
+
declare const _default: import("@alifd/next/types/config-provider/types").ConfiguredComponentClass<Pick<AddonAfterProps & React.RefAttributes<AddonAfterRef>, "key" | keyof AddonAfterProps> & import("@alifd/next/types/config-provider/types").ComponentCommonProps, AddonAfterRef, {}>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
+
const next_1 = require("@alifd/next");
|
|
6
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
7
|
+
const utils_1 = require("../../utils");
|
|
8
|
+
const AddonAfter = (0, react_1.forwardRef)(({ showWithHover = false, children }, ref) => {
|
|
9
|
+
// 页面没滚动的时候默认隐藏,如果要显示会由onScroll触发
|
|
10
|
+
const cls = `${utils_1.PREFIX_DEFAULT}float-button-addon-after`;
|
|
11
|
+
return (react_1.default.createElement("button", { className: (0, classnames_1.default)(cls, { [`${cls}--show-with-hover`]: showWithHover }) }, children));
|
|
12
|
+
});
|
|
13
|
+
exports.default = next_1.ConfigProvider.config(AddonAfter);
|
|
@@ -15,7 +15,8 @@ function getScroller(scroller) {
|
|
|
15
15
|
return scroller;
|
|
16
16
|
}
|
|
17
17
|
const Backtop = (0, react_1.forwardRef)(({ autoHide = true, scroller, offset = 10, smooth = true, children }, ref) => {
|
|
18
|
-
|
|
18
|
+
// 页面没滚动的时候默认隐藏,如果要显示会由onScroll触发
|
|
19
|
+
const [visible, setVisible] = (0, react_1.useState)(false);
|
|
19
20
|
const cls = `${utils_1.PREFIX_DEFAULT}float-button-backtop`;
|
|
20
21
|
const visibleRef = (0, react_1.useRef)(visible);
|
|
21
22
|
visibleRef.current = visible;
|
|
@@ -58,6 +59,7 @@ const Backtop = (0, react_1.forwardRef)(({ autoHide = true, scroller, offset = 1
|
|
|
58
59
|
if (!target) {
|
|
59
60
|
return;
|
|
60
61
|
}
|
|
62
|
+
// 滚动时候的显隐控制
|
|
61
63
|
const onScroll = (0, utils_1.debounce)(() => {
|
|
62
64
|
if (isAtTop(target)) {
|
|
63
65
|
visibleRef.current && setVisible(false);
|
package/lib/html-render/index.js
CHANGED
|
@@ -128,7 +128,7 @@ const HTMLRenderer = (0, react_1.memo)(function HTMLRenderer({ className, childr
|
|
|
128
128
|
const element = (0, react_1.useMemo)(() => {
|
|
129
129
|
return (0, html_react_parser_1.default)((0, sanitize_html_1.default)(children || '', sanitizeHtmlOptions), parserOptions);
|
|
130
130
|
}, [children]);
|
|
131
|
-
return (react_1.default.createElement("div", { className: (0, classnames_1.default)(
|
|
131
|
+
return (react_1.default.createElement("div", { className: (0, classnames_1.default)(`${utils_1.PREFIX_DEFAULT}html`, className, {
|
|
132
132
|
'loose': loose,
|
|
133
133
|
}) }, imagePreview ?
|
|
134
134
|
react_1.default.createElement(react_photo_view_1.PhotoProvider, null, element)
|