@lark-apaas/miaoda-core 0.1.0-alpha.16 → 0.1.0-alpha.18
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/lib/apis/utils/registerChinaMap.js +34 -34
- package/lib/components/AppContainer/IframeBridge.js +87 -58
- package/lib/components/AppContainer/PageHoc.js +1 -1
- package/lib/components/ErrorRender/index.js +4 -4
- package/lib/components/NotFoundRender/index.js +3 -3
- package/lib/components/TopNav/BottomNav.js +1 -1
- package/lib/components/TopNav/TitleBar.js +3 -3
- package/lib/components/TopNav/TopNav.js +1 -1
- package/lib/components/User/UserProfile/UserProfileUI.js +4 -4
- package/lib/components/User/UserProfile/utils.js +1 -1
- package/lib/components/User/UserSelect.js +1 -1
- package/lib/components/User/UserWithAvatar.js +1 -1
- package/lib/components/Welcome/index.js +3 -3
- package/lib/components/common/LogoInfo.js +1 -1
- package/lib/components/common/NavItem.js +1 -1
- package/lib/components/common/UserAvatarMenu.js +1 -1
- package/lib/components/theme/constants.js +3 -3
- package/lib/components/theme/util.js +2 -2
- package/lib/hooks/useLogout.js +3 -3
- package/lib/hooks/useTheme.js +1 -1
- package/lib/integrations/generateTextStream.js +4 -4
- package/lib/utils/copyToClipboard.js +2 -2
- package/package.json +2 -2
@@ -6,7 +6,7 @@ const chinaGeoJson = {
|
|
6
6
|
type: 'Feature',
|
7
7
|
properties: {
|
8
8
|
adcode: 110000,
|
9
|
-
name:
|
9
|
+
name: '北京市',
|
10
10
|
center: [
|
11
11
|
116.405285,
|
12
12
|
39.904989
|
@@ -1011,7 +1011,7 @@ const chinaGeoJson = {
|
|
1011
1011
|
type: 'Feature',
|
1012
1012
|
properties: {
|
1013
1013
|
adcode: 120000,
|
1014
|
-
name:
|
1014
|
+
name: '天津市',
|
1015
1015
|
center: [
|
1016
1016
|
117.190182,
|
1017
1017
|
39.125596
|
@@ -2064,7 +2064,7 @@ const chinaGeoJson = {
|
|
2064
2064
|
type: 'Feature',
|
2065
2065
|
properties: {
|
2066
2066
|
adcode: 130000,
|
2067
|
-
name:
|
2067
|
+
name: '河北省',
|
2068
2068
|
center: [
|
2069
2069
|
114.502461,
|
2070
2070
|
38.045474
|
@@ -6653,7 +6653,7 @@ const chinaGeoJson = {
|
|
6653
6653
|
type: 'Feature',
|
6654
6654
|
properties: {
|
6655
6655
|
adcode: 140000,
|
6656
|
-
name:
|
6656
|
+
name: '山西省',
|
6657
6657
|
center: [
|
6658
6658
|
112.549248,
|
6659
6659
|
37.857014
|
@@ -8558,7 +8558,7 @@ const chinaGeoJson = {
|
|
8558
8558
|
type: 'Feature',
|
8559
8559
|
properties: {
|
8560
8560
|
adcode: 150000,
|
8561
|
-
name:
|
8561
|
+
name: '内蒙古自治区',
|
8562
8562
|
center: [
|
8563
8563
|
111.670801,
|
8564
8564
|
40.818311
|
@@ -16241,7 +16241,7 @@ const chinaGeoJson = {
|
|
16241
16241
|
type: 'Feature',
|
16242
16242
|
properties: {
|
16243
16243
|
adcode: 210000,
|
16244
|
-
name:
|
16244
|
+
name: '辽宁省',
|
16245
16245
|
center: [
|
16246
16246
|
123.429096,
|
16247
16247
|
41.796767
|
@@ -19370,7 +19370,7 @@ const chinaGeoJson = {
|
|
19370
19370
|
type: 'Feature',
|
19371
19371
|
properties: {
|
19372
19372
|
adcode: 220000,
|
19373
|
-
name:
|
19373
|
+
name: '吉林省',
|
19374
19374
|
center: [
|
19375
19375
|
125.3245,
|
19376
19376
|
43.886841
|
@@ -22867,7 +22867,7 @@ const chinaGeoJson = {
|
|
22867
22867
|
type: 'Feature',
|
22868
22868
|
properties: {
|
22869
22869
|
adcode: 230000,
|
22870
|
-
name:
|
22870
|
+
name: '黑龙江省',
|
22871
22871
|
center: [
|
22872
22872
|
126.642464,
|
22873
22873
|
45.756967
|
@@ -28240,7 +28240,7 @@ const chinaGeoJson = {
|
|
28240
28240
|
type: 'Feature',
|
28241
28241
|
properties: {
|
28242
28242
|
adcode: 310000,
|
28243
|
-
name:
|
28243
|
+
name: '上海市',
|
28244
28244
|
center: [
|
28245
28245
|
121.472644,
|
28246
28246
|
31.231706
|
@@ -28769,7 +28769,7 @@ const chinaGeoJson = {
|
|
28769
28769
|
type: 'Feature',
|
28770
28770
|
properties: {
|
28771
28771
|
adcode: 320000,
|
28772
|
-
name:
|
28772
|
+
name: '江苏省',
|
28773
28773
|
center: [
|
28774
28774
|
118.767413,
|
28775
28775
|
32.041544
|
@@ -30594,7 +30594,7 @@ const chinaGeoJson = {
|
|
30594
30594
|
type: 'Feature',
|
30595
30595
|
properties: {
|
30596
30596
|
adcode: 330000,
|
30597
|
-
name:
|
30597
|
+
name: '浙江省',
|
30598
30598
|
center: [
|
30599
30599
|
120.153576,
|
30600
30600
|
30.287459
|
@@ -33439,7 +33439,7 @@ const chinaGeoJson = {
|
|
33439
33439
|
type: 'Feature',
|
33440
33440
|
properties: {
|
33441
33441
|
adcode: 340000,
|
33442
|
-
name:
|
33442
|
+
name: '安徽省',
|
33443
33443
|
center: [
|
33444
33444
|
117.283042,
|
33445
33445
|
31.86119
|
@@ -35876,7 +35876,7 @@ const chinaGeoJson = {
|
|
35876
35876
|
type: 'Feature',
|
35877
35877
|
properties: {
|
35878
35878
|
adcode: 350000,
|
35879
|
-
name:
|
35879
|
+
name: '福建省',
|
35880
35880
|
center: [
|
35881
35881
|
119.306239,
|
35882
35882
|
26.075302
|
@@ -38501,7 +38501,7 @@ const chinaGeoJson = {
|
|
38501
38501
|
type: 'Feature',
|
38502
38502
|
properties: {
|
38503
38503
|
adcode: 360000,
|
38504
|
-
name:
|
38504
|
+
name: '江西省',
|
38505
38505
|
center: [
|
38506
38506
|
115.892151,
|
38507
38507
|
28.676493
|
@@ -40654,7 +40654,7 @@ const chinaGeoJson = {
|
|
40654
40654
|
type: 'Feature',
|
40655
40655
|
properties: {
|
40656
40656
|
adcode: 370000,
|
40657
|
-
name:
|
40657
|
+
name: '山东省',
|
40658
40658
|
center: [
|
40659
40659
|
117.000923,
|
40660
40660
|
36.675807
|
@@ -43351,7 +43351,7 @@ const chinaGeoJson = {
|
|
43351
43351
|
type: 'Feature',
|
43352
43352
|
properties: {
|
43353
43353
|
adcode: 410000,
|
43354
|
-
name:
|
43354
|
+
name: '河南省',
|
43355
43355
|
center: [
|
43356
43356
|
113.665412,
|
43357
43357
|
34.757975
|
@@ -45848,7 +45848,7 @@ const chinaGeoJson = {
|
|
45848
45848
|
type: 'Feature',
|
45849
45849
|
properties: {
|
45850
45850
|
adcode: 420000,
|
45851
|
-
name:
|
45851
|
+
name: '湖北省',
|
45852
45852
|
center: [
|
45853
45853
|
114.298572,
|
45854
45854
|
30.584355
|
@@ -48589,7 +48589,7 @@ const chinaGeoJson = {
|
|
48589
48589
|
type: 'Feature',
|
48590
48590
|
properties: {
|
48591
48591
|
adcode: 430000,
|
48592
|
-
name:
|
48592
|
+
name: '湖南省',
|
48593
48593
|
center: [
|
48594
48594
|
112.982279,
|
48595
48595
|
28.19409
|
@@ -51138,7 +51138,7 @@ const chinaGeoJson = {
|
|
51138
51138
|
type: 'Feature',
|
51139
51139
|
properties: {
|
51140
51140
|
adcode: 440000,
|
51141
|
-
name:
|
51141
|
+
name: '广东省',
|
51142
51142
|
center: [
|
51143
51143
|
113.280637,
|
51144
51144
|
23.125178
|
@@ -54463,7 +54463,7 @@ const chinaGeoJson = {
|
|
54463
54463
|
type: 'Feature',
|
54464
54464
|
properties: {
|
54465
54465
|
adcode: 450000,
|
54466
|
-
name:
|
54466
|
+
name: '广西壮族自治区',
|
54467
54467
|
center: [
|
54468
54468
|
108.320004,
|
54469
54469
|
22.82402
|
@@ -57300,7 +57300,7 @@ const chinaGeoJson = {
|
|
57300
57300
|
type: 'Feature',
|
57301
57301
|
properties: {
|
57302
57302
|
adcode: 460000,
|
57303
|
-
name:
|
57303
|
+
name: '海南省',
|
57304
57304
|
center: [
|
57305
57305
|
110.33119,
|
57306
57306
|
20.031971
|
@@ -61253,7 +61253,7 @@ const chinaGeoJson = {
|
|
61253
61253
|
type: 'Feature',
|
61254
61254
|
properties: {
|
61255
61255
|
adcode: 500000,
|
61256
|
-
name:
|
61256
|
+
name: '重庆市',
|
61257
61257
|
center: [
|
61258
61258
|
106.504962,
|
61259
61259
|
29.533155
|
@@ -63662,7 +63662,7 @@ const chinaGeoJson = {
|
|
63662
63662
|
type: 'Feature',
|
63663
63663
|
properties: {
|
63664
63664
|
adcode: 510000,
|
63665
|
-
name:
|
63665
|
+
name: '四川省',
|
63666
63666
|
center: [
|
63667
63667
|
104.065735,
|
63668
63668
|
30.659462
|
@@ -68455,7 +68455,7 @@ const chinaGeoJson = {
|
|
68455
68455
|
type: 'Feature',
|
68456
68456
|
properties: {
|
68457
68457
|
adcode: 520000,
|
68458
|
-
name:
|
68458
|
+
name: '贵州省',
|
68459
68459
|
center: [
|
68460
68460
|
106.713478,
|
68461
68461
|
26.578343
|
@@ -71152,7 +71152,7 @@ const chinaGeoJson = {
|
|
71152
71152
|
type: 'Feature',
|
71153
71153
|
properties: {
|
71154
71154
|
adcode: 530000,
|
71155
|
-
name:
|
71155
|
+
name: '云南省',
|
71156
71156
|
center: [
|
71157
71157
|
102.712251,
|
71158
71158
|
25.040609
|
@@ -75397,7 +75397,7 @@ const chinaGeoJson = {
|
|
75397
75397
|
type: 'Feature',
|
75398
75398
|
properties: {
|
75399
75399
|
adcode: 540000,
|
75400
|
-
name:
|
75400
|
+
name: '西藏自治区',
|
75401
75401
|
center: [
|
75402
75402
|
91.132212,
|
75403
75403
|
29.660361
|
@@ -80934,7 +80934,7 @@ const chinaGeoJson = {
|
|
80934
80934
|
type: 'Feature',
|
80935
80935
|
properties: {
|
80936
80936
|
adcode: 610000,
|
80937
|
-
name:
|
80937
|
+
name: '陕西省',
|
80938
80938
|
center: [
|
80939
80939
|
108.948024,
|
80940
80940
|
34.263161
|
@@ -83983,7 +83983,7 @@ const chinaGeoJson = {
|
|
83983
83983
|
type: 'Feature',
|
83984
83984
|
properties: {
|
83985
83985
|
adcode: 620000,
|
83986
|
-
name:
|
83986
|
+
name: '甘肃省',
|
83987
83987
|
center: [
|
83988
83988
|
103.823557,
|
83989
83989
|
36.058039
|
@@ -89176,7 +89176,7 @@ const chinaGeoJson = {
|
|
89176
89176
|
type: 'Feature',
|
89177
89177
|
properties: {
|
89178
89178
|
adcode: 630000,
|
89179
|
-
name:
|
89179
|
+
name: '青海省',
|
89180
89180
|
center: [
|
89181
89181
|
101.778916,
|
89182
89182
|
36.623178
|
@@ -93665,7 +93665,7 @@ const chinaGeoJson = {
|
|
93665
93665
|
type: 'Feature',
|
93666
93666
|
properties: {
|
93667
93667
|
adcode: 640000,
|
93668
|
-
name:
|
93668
|
+
name: '宁夏回族自治区',
|
93669
93669
|
center: [
|
93670
93670
|
106.278179,
|
93671
93671
|
38.46637
|
@@ -95162,7 +95162,7 @@ const chinaGeoJson = {
|
|
95162
95162
|
type: 'Feature',
|
95163
95163
|
properties: {
|
95164
95164
|
adcode: 650000,
|
95165
|
-
name:
|
95165
|
+
name: '新疆维吾尔自治区',
|
95166
95166
|
center: [
|
95167
95167
|
87.617733,
|
95168
95168
|
43.792818
|
@@ -100731,7 +100731,7 @@ const chinaGeoJson = {
|
|
100731
100731
|
type: 'Feature',
|
100732
100732
|
properties: {
|
100733
100733
|
adcode: 710000,
|
100734
|
-
name:
|
100734
|
+
name: '台湾省',
|
100735
100735
|
center: [
|
100736
100736
|
121.509062,
|
100737
100737
|
25.044332
|
@@ -101512,7 +101512,7 @@ const chinaGeoJson = {
|
|
101512
101512
|
type: 'Feature',
|
101513
101513
|
properties: {
|
101514
101514
|
adcode: 810000,
|
101515
|
-
name:
|
101515
|
+
name: '香港特别行政区',
|
101516
101516
|
center: [
|
101517
101517
|
114.173355,
|
101518
101518
|
22.320048
|
@@ -102013,7 +102013,7 @@ const chinaGeoJson = {
|
|
102013
102013
|
type: 'Feature',
|
102014
102014
|
properties: {
|
102015
102015
|
adcode: 820000,
|
102016
|
-
name:
|
102016
|
+
name: '澳门特别行政区',
|
102017
102017
|
center: [
|
102018
102018
|
113.54909,
|
102019
102019
|
22.198951
|
@@ -1,68 +1,97 @@
|
|
1
|
-
import "react/jsx-runtime";
|
2
|
-
import "react";
|
3
|
-
import "react-router-dom";
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
2
|
+
import { useCallback, useEffect, useMemo, useRef } from "react";
|
3
|
+
import { useLocation, useNavigate } from "react-router-dom";
|
4
4
|
import { connectToParent } from "penpal";
|
5
|
-
import "../../hooks/useUpdatingRef.js";
|
5
|
+
import { useUpdatingRef } from "../../hooks/useUpdatingRef.js";
|
6
6
|
import { postMessage } from "../../utils/postMessage.js";
|
7
7
|
import { getPreviewParentOrigin } from "../../utils/getParentOrigin.js";
|
8
8
|
import { childApi } from "./childApi.js";
|
9
9
|
import "./LogInterceptor.js";
|
10
|
-
var
|
11
|
-
"
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
});
|
10
|
+
var IframeBridge_RouteMessageType = /*#__PURE__*/ function(RouteMessageType) {
|
11
|
+
RouteMessageType["RouteChange"] = "RouteChange";
|
12
|
+
RouteMessageType["RouteBack"] = "RouteBack";
|
13
|
+
RouteMessageType["RouteForward"] = "RouteForward";
|
14
|
+
return RouteMessageType;
|
15
|
+
}(IframeBridge_RouteMessageType || {});
|
16
|
+
function isRouteMessageType(type) {
|
17
|
+
return Object.values(IframeBridge_RouteMessageType).includes(type);
|
18
|
+
}
|
19
|
+
function listenHot() {}
|
20
|
+
async function connectParent() {
|
21
|
+
const connection = connectToParent({
|
22
|
+
parentOrigin: getPreviewParentOrigin(),
|
23
|
+
methods: {
|
24
|
+
...childApi
|
26
25
|
}
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
26
|
+
});
|
27
|
+
await connection.promise;
|
28
|
+
}
|
29
|
+
if ('production' !== process.env.NODE_ENV) {
|
30
|
+
listenHot();
|
31
|
+
connectParent();
|
32
|
+
}
|
33
|
+
function IframeBridge() {
|
34
|
+
const location = useLocation();
|
35
|
+
const navigate = useNavigate();
|
36
|
+
const navigateRef = useUpdatingRef(navigate);
|
37
|
+
const isActive = useRef(false);
|
38
|
+
const historyBack = useCallback(()=>{
|
39
|
+
navigateRef.current(-1);
|
40
|
+
isActive.current = true;
|
41
|
+
}, [
|
42
|
+
navigateRef
|
43
|
+
]);
|
44
|
+
const historyForward = useCallback(()=>{
|
45
|
+
navigateRef.current(1);
|
46
|
+
isActive.current = true;
|
47
|
+
}, [
|
48
|
+
navigateRef
|
49
|
+
]);
|
50
|
+
const operatorMessage = useMemo(()=>({
|
51
|
+
["RouteBack"]: historyBack,
|
52
|
+
["RouteForward"]: historyForward,
|
53
|
+
["RouteChange"]: navigateRef.current
|
54
|
+
}), [
|
55
|
+
historyBack,
|
56
|
+
historyForward,
|
57
|
+
navigateRef
|
58
|
+
]);
|
59
|
+
useEffect(()=>{
|
60
|
+
postMessage({
|
61
|
+
type: 'PreviewReady',
|
62
|
+
data: {}
|
63
|
+
});
|
64
|
+
}, []);
|
65
|
+
useEffect(()=>{
|
66
|
+
if (isActive.current) {
|
67
|
+
isActive.current = false;
|
68
|
+
return;
|
34
69
|
}
|
35
|
-
|
36
|
-
|
37
|
-
|
70
|
+
postMessage({
|
71
|
+
type: 'ChildLocationChange',
|
72
|
+
data: location
|
73
|
+
});
|
74
|
+
}, [
|
75
|
+
location
|
76
|
+
]);
|
77
|
+
const handleMessage = useCallback((event)=>{
|
78
|
+
const { data } = event;
|
79
|
+
if (isRouteMessageType(data?.type)) operatorMessage[data?.type](data?.data);
|
80
|
+
}, [
|
81
|
+
operatorMessage
|
82
|
+
]);
|
83
|
+
useEffect(()=>{
|
84
|
+
window.addEventListener('message', handleMessage);
|
85
|
+
return ()=>{
|
86
|
+
window.removeEventListener('message', handleMessage);
|
87
|
+
};
|
88
|
+
}, [
|
89
|
+
handleMessage
|
90
|
+
]);
|
91
|
+
return /*#__PURE__*/ jsx("div", {
|
92
|
+
style: {
|
93
|
+
display: 'none'
|
38
94
|
}
|
39
|
-
}
|
40
|
-
};
|
41
|
-
var __webpack_module_cache__ = {};
|
42
|
-
function __webpack_require__(moduleId) {
|
43
|
-
var cachedModule = __webpack_module_cache__[moduleId];
|
44
|
-
if (void 0 !== cachedModule) return cachedModule.exports;
|
45
|
-
var module = __webpack_module_cache__[moduleId] = {
|
46
|
-
id: moduleId,
|
47
|
-
loaded: false,
|
48
|
-
exports: {}
|
49
|
-
};
|
50
|
-
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
51
|
-
module.loaded = true;
|
52
|
-
return module.exports;
|
95
|
+
});
|
53
96
|
}
|
54
|
-
(()=>{
|
55
|
-
__webpack_require__.hmd = (module)=>{
|
56
|
-
module = Object.create(module);
|
57
|
-
if (!module.children) module.children = [];
|
58
|
-
Object.defineProperty(module, 'exports', {
|
59
|
-
enumerable: true,
|
60
|
-
set: ()=>{
|
61
|
-
throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);
|
62
|
-
}
|
63
|
-
});
|
64
|
-
return module;
|
65
|
-
};
|
66
|
-
})();
|
67
|
-
__webpack_require__("./src/components/AppContainer/IframeBridge.tsx");
|
68
97
|
export { IframeBridge as default };
|
@@ -50,11 +50,11 @@ const RenderError = (props)=>{
|
|
50
50
|
}),
|
51
51
|
/*#__PURE__*/ jsx("p", {
|
52
52
|
className: "text-l/[22px] text-[#1F2329] font-medium mb-2",
|
53
|
-
children: "
|
53
|
+
children: "哎呀,写错代码了"
|
54
54
|
}),
|
55
55
|
/*#__PURE__*/ jsx("p", {
|
56
56
|
className: "text-sm/[22px] text-[#646A73] font-normal mb-2",
|
57
|
-
children: "
|
57
|
+
children: "可复制错误信息,或告诉妙搭进行修复"
|
58
58
|
}),
|
59
59
|
/*#__PURE__*/ jsxs("div", {
|
60
60
|
className: "flex space-x-4",
|
@@ -62,12 +62,12 @@ const RenderError = (props)=>{
|
|
62
62
|
/*#__PURE__*/ jsx(Button, {
|
63
63
|
className: "bg-white text-gray-600 font-[400] border rounded-[6px] shadow-xs hover:bg-gray-100 active:bg-gray-200 focus:outline-hidden h-[32px] border-[#D0D3D6]",
|
64
64
|
onClick: onClickCopy,
|
65
|
-
children: "
|
65
|
+
children: "复制错误信息"
|
66
66
|
}),
|
67
67
|
/*#__PURE__*/ jsx(Button, {
|
68
68
|
className: "h-[32px] text-sm font-medium text-white bg-blue-600 border border-transparent rounded-[6px] shadow-xs hover:bg-blue-600 active:bg-blue-700 focus:outline-hidden ",
|
69
69
|
onClick: onClickRepair,
|
70
|
-
children: "
|
70
|
+
children: "告诉妙搭修复"
|
71
71
|
})
|
72
72
|
]
|
73
73
|
})
|
@@ -30,13 +30,13 @@ const NotFound = ()=>{
|
|
30
30
|
}),
|
31
31
|
/*#__PURE__*/ jsx("p", {
|
32
32
|
className: "text-l/[22px] text-[14px] text-[#1F2329] font-medium",
|
33
|
-
children: 'production' !== process.env.NODE_ENV ?
|
33
|
+
children: 'production' !== process.env.NODE_ENV ? '哎呀,这个页面尚未生成' : '404'
|
34
34
|
}),
|
35
35
|
'production' !== process.env.NODE_ENV ? /*#__PURE__*/ jsxs(Fragment, {
|
36
36
|
children: [
|
37
37
|
/*#__PURE__*/ jsx("p", {
|
38
38
|
className: "text-sm/[22px] text-[14px] text-[#646A73] font-normal mt-1",
|
39
|
-
children: "
|
39
|
+
children: "戳下方按钮,我可以根据上下文帮你生成一个"
|
40
40
|
}),
|
41
41
|
/*#__PURE__*/ jsxs("button", {
|
42
42
|
className: "h-[32px] text-sm font-medium text-white bg-blue-600 border border-transparent rounded-md shadow-xs hover:bg-blue-600 active:bg-blue-700 focus:outline-hidden focus:ring-2 focus:ring-blue-500 px-3 flex flex-row items-center mt-3",
|
@@ -47,7 +47,7 @@ const NotFound = ()=>{
|
|
47
47
|
alt: "Icon",
|
48
48
|
className: "w-[14px] h-[14px] mr-1"
|
49
49
|
}),
|
50
|
-
"
|
50
|
+
"告诉妙搭生成一个"
|
51
51
|
]
|
52
52
|
})
|
53
53
|
]
|
@@ -68,7 +68,7 @@ function BottomNav({ navList = [], className, maxBottomItems = 6 }) {
|
|
68
68
|
hasMoreItems ? /*#__PURE__*/ jsx(MoreNavItem, {
|
69
69
|
direction: "vertical",
|
70
70
|
className: "text-xs",
|
71
|
-
name: "
|
71
|
+
name: "更多",
|
72
72
|
onClick: toggleExpanded,
|
73
73
|
isExpanded: isExpanded,
|
74
74
|
expandedNavItemsPath: expandedNavItemsPath
|
@@ -67,7 +67,7 @@ const TitleBar = ({ navList, className })=>{
|
|
67
67
|
}) : null,
|
68
68
|
/*#__PURE__*/ jsx("span", {
|
69
69
|
className: "text-xl text-center font-medium w-full text-ellipsis overflow-hidden whitespace-nowrap ",
|
70
|
-
children: appName ||
|
70
|
+
children: appName || '新应用'
|
71
71
|
}),
|
72
72
|
/*#__PURE__*/ jsx("div", {
|
73
73
|
className: "text-center justify-center text-token-text-title font-medium leading-relaxed"
|
@@ -80,7 +80,7 @@ const TitleBar = ({ navList, className })=>{
|
|
80
80
|
className: "flex items-center justify-between border-gray-200 border-t py-4 ",
|
81
81
|
children: [
|
82
82
|
/*#__PURE__*/ jsx("div", {
|
83
|
-
children: "
|
83
|
+
children: "当前用户"
|
84
84
|
}),
|
85
85
|
/*#__PURE__*/ jsxs("div", {
|
86
86
|
className: "flex items-center",
|
@@ -109,7 +109,7 @@ const TitleBar = ({ navList, className })=>{
|
|
109
109
|
},
|
110
110
|
children: [
|
111
111
|
/*#__PURE__*/ jsx("div", {
|
112
|
-
children: "
|
112
|
+
children: "退出登录"
|
113
113
|
}),
|
114
114
|
/*#__PURE__*/ jsx("div", {
|
115
115
|
className: "flex items-center",
|
@@ -34,7 +34,7 @@ function TopNav({ navList = [], align = 'left', className, activeClassName }) {
|
|
34
34
|
/*#__PURE__*/ jsx("span", {
|
35
35
|
className: "max-w-[240px] font-medium w-full truncate",
|
36
36
|
title: appName,
|
37
|
-
children: appName ||
|
37
|
+
children: appName || '新应用'
|
38
38
|
})
|
39
39
|
]
|
40
40
|
})
|
@@ -41,7 +41,7 @@ function UserProfileUI({ user }) {
|
|
41
41
|
style: {
|
42
42
|
marginRight: 0
|
43
43
|
},
|
44
|
-
children: "
|
44
|
+
children: "暂停使用"
|
45
45
|
})
|
46
46
|
]
|
47
47
|
}),
|
@@ -65,7 +65,7 @@ function UserProfileUI({ user }) {
|
|
65
65
|
href: getChatAppLink(user.feishu_open_id),
|
66
66
|
target: "_blank",
|
67
67
|
rel: "noopener noreferrer",
|
68
|
-
children: "
|
68
|
+
children: "消息"
|
69
69
|
})
|
70
70
|
}) : null
|
71
71
|
]
|
@@ -78,7 +78,7 @@ function UserProfileUI({ user }) {
|
|
78
78
|
children: [
|
79
79
|
/*#__PURE__*/ jsx("span", {
|
80
80
|
className: "text-sm text-[#646A73] min-w-[74px]",
|
81
|
-
children: "
|
81
|
+
children: "部门"
|
82
82
|
}),
|
83
83
|
/*#__PURE__*/ jsx("span", {
|
84
84
|
className: clsxWithTw('text-sm text-[#1F2329] flex-1 break-all', {
|
@@ -93,7 +93,7 @@ function UserProfileUI({ user }) {
|
|
93
93
|
children: [
|
94
94
|
/*#__PURE__*/ jsx("span", {
|
95
95
|
className: "text-sm text-[#646A73] min-w-[74px]",
|
96
|
-
children: "
|
96
|
+
children: "邮箱"
|
97
97
|
}),
|
98
98
|
user.email ? /*#__PURE__*/ jsx("a", {
|
99
99
|
href: `mailto:${user.email}`,
|
@@ -16,7 +16,7 @@ const formatI18nProfile = (profile)=>({
|
|
16
16
|
});
|
17
17
|
const getChatAppLink = (openId)=>`https://applink.feishu.cn/client/chat/open?openId=${openId}`;
|
18
18
|
const INVALID_USER = {
|
19
|
-
name:
|
19
|
+
name: '无效人员',
|
20
20
|
avatar: 'https://lf3-static.bytednsdoc.com/obj/eden-cn/LMfspH/ljhwZthlaukjlkulzlp/miao/no-person.svg',
|
21
21
|
email: '',
|
22
22
|
department: '',
|
@@ -141,7 +141,7 @@ const UserSelect = ({ mode = 'single', defaultValue, value, onChange, placeholde
|
|
141
141
|
})
|
142
142
|
}) : /*#__PURE__*/ jsx("span", {
|
143
143
|
className: "py-[1px] px-1 text-[#8F959E]",
|
144
|
-
children: "
|
144
|
+
children: "无结果,建议更换搜索词"
|
145
145
|
}),
|
146
146
|
optionRender: optionRender,
|
147
147
|
options: options,
|
@@ -14,7 +14,7 @@ const textVariantMap = {
|
|
14
14
|
};
|
15
15
|
function UserWithAvatar({ data, size = 'medium', mode = 'tag', className }) {
|
16
16
|
const { avatar, name } = data;
|
17
|
-
const displayName = name ||
|
17
|
+
const displayName = name || '无效人员';
|
18
18
|
return /*#__PURE__*/ jsxs("div", {
|
19
19
|
className: clsxWithTw('flex items-center gap-1 rounded-full', {
|
20
20
|
'bg-[rgba(31,35,41,0.1)]': 'tag' === mode,
|
@@ -8,15 +8,15 @@ const Welcome = ()=>/*#__PURE__*/ jsxs("div", {
|
|
8
8
|
children: [
|
9
9
|
/*#__PURE__*/ jsx("div", {
|
10
10
|
className: "text-2xl font-bold mb-3",
|
11
|
-
children: "
|
11
|
+
children: "欢迎使用妙搭 \uD83D\uDC4B"
|
12
12
|
}),
|
13
13
|
/*#__PURE__*/ jsx("div", {
|
14
14
|
className: "text-[#646A73] text-sm",
|
15
|
-
children: "1.
|
15
|
+
children: "1. 随时发送消息,开始构建你的专属应用"
|
16
16
|
}),
|
17
17
|
/*#__PURE__*/ jsx("div", {
|
18
18
|
className: "text-[#646A73] text-sm",
|
19
|
-
children: "2.
|
19
|
+
children: "2. 无需担心代码实现,妙搭帮你一一解决"
|
20
20
|
})
|
21
21
|
]
|
22
22
|
}),
|
@@ -80,7 +80,7 @@ const NavItem = /*#__PURE__*/ react.forwardRef((props, ref)=>{
|
|
80
80
|
});
|
81
81
|
});
|
82
82
|
NavItem.displayName = 'NavItem';
|
83
|
-
const MoreNavItem = ({ expandedNavItemsPath, onClick, isExpanded, name =
|
83
|
+
const MoreNavItem = ({ expandedNavItemsPath, onClick, isExpanded, name = '更多', ...restProps })=>{
|
84
84
|
const { pathname } = useLocation();
|
85
85
|
const isActive = useMemo(()=>{
|
86
86
|
const matched = expandedNavItemsPath.some((path)=>{
|
@@ -1,6 +1,6 @@
|
|
1
1
|
const themeMetaOptions = {
|
2
2
|
themeColors: {
|
3
|
-
title:
|
3
|
+
title: '主题色',
|
4
4
|
options: [
|
5
5
|
{
|
6
6
|
value: '--blue-700',
|
@@ -33,7 +33,7 @@ const themeMetaOptions = {
|
|
33
33
|
]
|
34
34
|
},
|
35
35
|
themeRadius: {
|
36
|
-
title:
|
36
|
+
title: '圆角',
|
37
37
|
options: [
|
38
38
|
{
|
39
39
|
value: {
|
@@ -70,7 +70,7 @@ const themeMetaOptions = {
|
|
70
70
|
]
|
71
71
|
},
|
72
72
|
themeSpaces: {
|
73
|
-
title:
|
73
|
+
title: '间距',
|
74
74
|
options: [
|
75
75
|
{
|
76
76
|
value: {
|
@@ -70,7 +70,7 @@ const generateTailwindRadiusToken = (radiusRemValue)=>{
|
|
70
70
|
options: [
|
71
71
|
{
|
72
72
|
value: 'rounded-none',
|
73
|
-
label:
|
73
|
+
label: 'none(0px)',
|
74
74
|
rawValue: '0'
|
75
75
|
},
|
76
76
|
{
|
@@ -119,7 +119,7 @@ const generateTailwindRadiusToken = (radiusRemValue)=>{
|
|
119
119
|
options: [
|
120
120
|
{
|
121
121
|
value: 'rounded-none',
|
122
|
-
label:
|
122
|
+
label: 'none(0px)',
|
123
123
|
rawValue: '0'
|
124
124
|
},
|
125
125
|
{
|
package/lib/hooks/useLogout.js
CHANGED
@@ -4,14 +4,14 @@ import { isSanboxMode } from "../utils/utils.js";
|
|
4
4
|
function useLogout() {
|
5
5
|
const [isLoading, setIsLoading] = useState(false);
|
6
6
|
async function handlerLogout() {
|
7
|
-
if ('production' !== process.env.NODE_ENV) return void console.log(
|
7
|
+
if ('production' !== process.env.NODE_ENV) return void console.log('只有生产环境才执行登出');
|
8
8
|
if (isSanboxMode()) {
|
9
9
|
setIsLoading(true);
|
10
10
|
try {
|
11
11
|
const dataloom = await getDataloom();
|
12
12
|
await dataloom.service.session.signOut();
|
13
13
|
} catch (error) {
|
14
|
-
console.error(
|
14
|
+
console.error('登出失败', error);
|
15
15
|
} finally{
|
16
16
|
setIsLoading(false);
|
17
17
|
}
|
@@ -24,7 +24,7 @@ function useLogout() {
|
|
24
24
|
});
|
25
25
|
window.location.reload();
|
26
26
|
} catch (error) {
|
27
|
-
console.error(
|
27
|
+
console.error('登出失败', error);
|
28
28
|
} finally{
|
29
29
|
setIsLoading(false);
|
30
30
|
}
|
package/lib/hooks/useTheme.js
CHANGED
@@ -2,7 +2,7 @@ import { useContext } from "react";
|
|
2
2
|
import { ThemeProviderContext } from "../components/theme/index.js";
|
3
3
|
const useTheme = ()=>{
|
4
4
|
const context = useContext(ThemeProviderContext);
|
5
|
-
if (void 0 === context) throw new Error(
|
5
|
+
if (void 0 === context) throw new Error('useTheme 必须在 ThemeProvider 内使用');
|
6
6
|
return context;
|
7
7
|
};
|
8
8
|
export { useTheme };
|
@@ -43,7 +43,7 @@ async function generateTextStream(options, onChunk) {
|
|
43
43
|
});
|
44
44
|
if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
|
45
45
|
const reader = response.body?.getReader();
|
46
|
-
if (!reader) throw new Error(
|
46
|
+
if (!reader) throw new Error('无法获取响应流');
|
47
47
|
let fullContent = '';
|
48
48
|
let fullReasoningContent = '';
|
49
49
|
const decoder = new TextDecoder();
|
@@ -62,7 +62,7 @@ async function generateTextStream(options, onChunk) {
|
|
62
62
|
content: '',
|
63
63
|
reasoning_content: '',
|
64
64
|
success: false,
|
65
|
-
error: data.msg ||
|
65
|
+
error: data.msg || '生成失败'
|
66
66
|
};
|
67
67
|
if (data.data.content) fullContent += data.data.content;
|
68
68
|
if (data.data.reasoning_content) fullReasoningContent += data.data.reasoning_content;
|
@@ -77,7 +77,7 @@ async function generateTextStream(options, onChunk) {
|
|
77
77
|
success: true
|
78
78
|
};
|
79
79
|
} catch (parseError) {
|
80
|
-
console.error(
|
80
|
+
console.error(`解析JSON失败: ${jsonStr}`);
|
81
81
|
}
|
82
82
|
}
|
83
83
|
}
|
@@ -91,7 +91,7 @@ async function generateTextStream(options, onChunk) {
|
|
91
91
|
content: '',
|
92
92
|
reasoning_content: '',
|
93
93
|
success: false,
|
94
|
-
error: error instanceof Error ? error.message :
|
94
|
+
error: error instanceof Error ? error.message : '未知错误'
|
95
95
|
};
|
96
96
|
}
|
97
97
|
}
|
@@ -6,7 +6,7 @@ async function copyToClipboard(text) {
|
|
6
6
|
}
|
7
7
|
return fallbackCopyToClipboard(text);
|
8
8
|
} catch (error) {
|
9
|
-
console.error(
|
9
|
+
console.error('复制到剪切板失败:', error);
|
10
10
|
return false;
|
11
11
|
}
|
12
12
|
}
|
@@ -25,7 +25,7 @@ function fallbackCopyToClipboard(text) {
|
|
25
25
|
document.body.removeChild(textArea);
|
26
26
|
return successful;
|
27
27
|
} catch (error) {
|
28
|
-
console.error(
|
28
|
+
console.error('降级复制方案失败:', error);
|
29
29
|
return false;
|
30
30
|
}
|
31
31
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@lark-apaas/miaoda-core",
|
3
|
-
"version": "0.1.0-alpha.
|
3
|
+
"version": "0.1.0-alpha.18",
|
4
4
|
"types": "./lib/index.d.ts",
|
5
5
|
"main": "./lib/index.js",
|
6
6
|
"files": [
|
@@ -93,7 +93,7 @@
|
|
93
93
|
"@changesets/cli": "^2.29.5",
|
94
94
|
"@rsbuild/core": "~1.4.13",
|
95
95
|
"@rsbuild/plugin-react": "^1.3.4",
|
96
|
-
"@rslib/core": "^0.
|
96
|
+
"@rslib/core": "^0.15.0",
|
97
97
|
"@storybook/addon-essentials": "^8.6.14",
|
98
98
|
"@storybook/addon-interactions": "^8.6.14",
|
99
99
|
"@storybook/addon-links": "^8.6.14",
|