dsh-dock 0.23.1 → 0.24.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/README.md +32 -40
- package/client.js +599 -236
- package/features/animation/host.js +3 -2
- package/features/balance/host.js +3 -3
- package/features/dshtools/host.js +306 -0
- package/features/dshtools/view.jsx +403 -0
- package/features/mcpconfig/host.js +3 -3
- package/features/mcpconfig/view.js +8 -8
- package/features/mobile-relay/host.js +42 -9
- package/features/modelconfig/host.js +3 -3
- package/features/notify/host.js +3 -2
- package/features/notify/view.jsx +38 -46
- package/features/providerconfig/host.js +3 -3
- package/features/runstate/host.js +3 -2
- package/features/tokenlog/host.js +3 -2
- package/features/tts/host.js +3 -2
- package/index.js +5 -2
- package/package.json +5 -6
- package/src/client.jsx +5 -2
- package/src/host-core.js +52 -13
- package/screenshots/dock-animation.png +0 -0
- package/screenshots/dock-balance.png +0 -0
- package/screenshots/dock-games.png +0 -0
- package/screenshots/dock-home.png +0 -0
- package/screenshots/dock-modelconfig-provider-create.png +0 -0
- package/screenshots/dock-modelconfig-provider-edit.png +0 -0
- package/screenshots/dock-modelconfig-providers.png +0 -0
- package/screenshots/dock-modelconfig.png +0 -0
- package/screenshots/dock-notify.png +0 -0
- package/screenshots/dock-runstate.png +0 -0
- package/screenshots/dock-settings.png +0 -0
- package/screenshots/dock-tokenlog-charts-2.png +0 -0
- package/screenshots/dock-tokenlog-charts-3.png +0 -0
- package/screenshots/dock-tokenlog-charts.png +0 -0
- package/screenshots/dock-tokenlog.png +0 -0
package/client.js
CHANGED
|
@@ -40,18 +40,18 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
40
40
|
));
|
|
41
41
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
42
42
|
|
|
43
|
-
// node_modules/qrcode/lib/can-promise.js
|
|
43
|
+
// .devdeps/node_modules/qrcode/lib/can-promise.js
|
|
44
44
|
var require_can_promise = __commonJS({
|
|
45
|
-
"node_modules/qrcode/lib/can-promise.js"(exports, module2) {
|
|
45
|
+
".devdeps/node_modules/qrcode/lib/can-promise.js"(exports, module2) {
|
|
46
46
|
module2.exports = function() {
|
|
47
47
|
return typeof Promise === "function" && Promise.prototype && Promise.prototype.then;
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
50
|
});
|
|
51
51
|
|
|
52
|
-
// node_modules/qrcode/lib/core/utils.js
|
|
52
|
+
// .devdeps/node_modules/qrcode/lib/core/utils.js
|
|
53
53
|
var require_utils = __commonJS({
|
|
54
|
-
"node_modules/qrcode/lib/core/utils.js"(exports) {
|
|
54
|
+
".devdeps/node_modules/qrcode/lib/core/utils.js"(exports) {
|
|
55
55
|
var toSJISFunction;
|
|
56
56
|
var CODEWORDS_COUNT = [
|
|
57
57
|
0,
|
|
@@ -128,9 +128,9 @@ var require_utils = __commonJS({
|
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
|
|
131
|
-
// node_modules/qrcode/lib/core/error-correction-level.js
|
|
131
|
+
// .devdeps/node_modules/qrcode/lib/core/error-correction-level.js
|
|
132
132
|
var require_error_correction_level = __commonJS({
|
|
133
|
-
"node_modules/qrcode/lib/core/error-correction-level.js"(exports) {
|
|
133
|
+
".devdeps/node_modules/qrcode/lib/core/error-correction-level.js"(exports) {
|
|
134
134
|
exports.L = { bit: 1 };
|
|
135
135
|
exports.M = { bit: 0 };
|
|
136
136
|
exports.Q = { bit: 3 };
|
|
@@ -173,9 +173,9 @@ var require_error_correction_level = __commonJS({
|
|
|
173
173
|
}
|
|
174
174
|
});
|
|
175
175
|
|
|
176
|
-
// node_modules/qrcode/lib/core/bit-buffer.js
|
|
176
|
+
// .devdeps/node_modules/qrcode/lib/core/bit-buffer.js
|
|
177
177
|
var require_bit_buffer = __commonJS({
|
|
178
|
-
"node_modules/qrcode/lib/core/bit-buffer.js"(exports, module2) {
|
|
178
|
+
".devdeps/node_modules/qrcode/lib/core/bit-buffer.js"(exports, module2) {
|
|
179
179
|
function BitBuffer() {
|
|
180
180
|
this.buffer = [];
|
|
181
181
|
this.length = 0;
|
|
@@ -208,9 +208,9 @@ var require_bit_buffer = __commonJS({
|
|
|
208
208
|
}
|
|
209
209
|
});
|
|
210
210
|
|
|
211
|
-
// node_modules/qrcode/lib/core/bit-matrix.js
|
|
211
|
+
// .devdeps/node_modules/qrcode/lib/core/bit-matrix.js
|
|
212
212
|
var require_bit_matrix = __commonJS({
|
|
213
|
-
"node_modules/qrcode/lib/core/bit-matrix.js"(exports, module2) {
|
|
213
|
+
".devdeps/node_modules/qrcode/lib/core/bit-matrix.js"(exports, module2) {
|
|
214
214
|
function BitMatrix(size) {
|
|
215
215
|
if (!size || size < 1) {
|
|
216
216
|
throw new Error("BitMatrix size must be defined and greater than 0");
|
|
@@ -237,9 +237,9 @@ var require_bit_matrix = __commonJS({
|
|
|
237
237
|
}
|
|
238
238
|
});
|
|
239
239
|
|
|
240
|
-
// node_modules/qrcode/lib/core/alignment-pattern.js
|
|
240
|
+
// .devdeps/node_modules/qrcode/lib/core/alignment-pattern.js
|
|
241
241
|
var require_alignment_pattern = __commonJS({
|
|
242
|
-
"node_modules/qrcode/lib/core/alignment-pattern.js"(exports) {
|
|
242
|
+
".devdeps/node_modules/qrcode/lib/core/alignment-pattern.js"(exports) {
|
|
243
243
|
var getSymbolSize = require_utils().getSymbolSize;
|
|
244
244
|
exports.getRowColCoords = function getRowColCoords(version) {
|
|
245
245
|
if (version === 1) return [];
|
|
@@ -272,9 +272,9 @@ var require_alignment_pattern = __commonJS({
|
|
|
272
272
|
}
|
|
273
273
|
});
|
|
274
274
|
|
|
275
|
-
// node_modules/qrcode/lib/core/finder-pattern.js
|
|
275
|
+
// .devdeps/node_modules/qrcode/lib/core/finder-pattern.js
|
|
276
276
|
var require_finder_pattern = __commonJS({
|
|
277
|
-
"node_modules/qrcode/lib/core/finder-pattern.js"(exports) {
|
|
277
|
+
".devdeps/node_modules/qrcode/lib/core/finder-pattern.js"(exports) {
|
|
278
278
|
var getSymbolSize = require_utils().getSymbolSize;
|
|
279
279
|
var FINDER_PATTERN_SIZE = 7;
|
|
280
280
|
exports.getPositions = function getPositions(version) {
|
|
@@ -291,9 +291,9 @@ var require_finder_pattern = __commonJS({
|
|
|
291
291
|
}
|
|
292
292
|
});
|
|
293
293
|
|
|
294
|
-
// node_modules/qrcode/lib/core/mask-pattern.js
|
|
294
|
+
// .devdeps/node_modules/qrcode/lib/core/mask-pattern.js
|
|
295
295
|
var require_mask_pattern = __commonJS({
|
|
296
|
-
"node_modules/qrcode/lib/core/mask-pattern.js"(exports) {
|
|
296
|
+
".devdeps/node_modules/qrcode/lib/core/mask-pattern.js"(exports) {
|
|
297
297
|
exports.Patterns = {
|
|
298
298
|
PATTERN000: 0,
|
|
299
299
|
PATTERN001: 1,
|
|
@@ -433,9 +433,9 @@ var require_mask_pattern = __commonJS({
|
|
|
433
433
|
}
|
|
434
434
|
});
|
|
435
435
|
|
|
436
|
-
// node_modules/qrcode/lib/core/error-correction-code.js
|
|
436
|
+
// .devdeps/node_modules/qrcode/lib/core/error-correction-code.js
|
|
437
437
|
var require_error_correction_code = __commonJS({
|
|
438
|
-
"node_modules/qrcode/lib/core/error-correction-code.js"(exports) {
|
|
438
|
+
".devdeps/node_modules/qrcode/lib/core/error-correction-code.js"(exports) {
|
|
439
439
|
var ECLevel = require_error_correction_level();
|
|
440
440
|
var EC_BLOCKS_TABLE = [
|
|
441
441
|
// L M Q H
|
|
@@ -794,9 +794,9 @@ var require_error_correction_code = __commonJS({
|
|
|
794
794
|
}
|
|
795
795
|
});
|
|
796
796
|
|
|
797
|
-
// node_modules/qrcode/lib/core/galois-field.js
|
|
797
|
+
// .devdeps/node_modules/qrcode/lib/core/galois-field.js
|
|
798
798
|
var require_galois_field = __commonJS({
|
|
799
|
-
"node_modules/qrcode/lib/core/galois-field.js"(exports) {
|
|
799
|
+
".devdeps/node_modules/qrcode/lib/core/galois-field.js"(exports) {
|
|
800
800
|
var EXP_TABLE = new Uint8Array(512);
|
|
801
801
|
var LOG_TABLE = new Uint8Array(256);
|
|
802
802
|
(function initTables() {
|
|
@@ -827,9 +827,9 @@ var require_galois_field = __commonJS({
|
|
|
827
827
|
}
|
|
828
828
|
});
|
|
829
829
|
|
|
830
|
-
// node_modules/qrcode/lib/core/polynomial.js
|
|
830
|
+
// .devdeps/node_modules/qrcode/lib/core/polynomial.js
|
|
831
831
|
var require_polynomial = __commonJS({
|
|
832
|
-
"node_modules/qrcode/lib/core/polynomial.js"(exports) {
|
|
832
|
+
".devdeps/node_modules/qrcode/lib/core/polynomial.js"(exports) {
|
|
833
833
|
var GF = require_galois_field();
|
|
834
834
|
exports.mul = function mul(p1, p2) {
|
|
835
835
|
const coeff = new Uint8Array(p1.length + p2.length - 1);
|
|
@@ -863,9 +863,9 @@ var require_polynomial = __commonJS({
|
|
|
863
863
|
}
|
|
864
864
|
});
|
|
865
865
|
|
|
866
|
-
// node_modules/qrcode/lib/core/reed-solomon-encoder.js
|
|
866
|
+
// .devdeps/node_modules/qrcode/lib/core/reed-solomon-encoder.js
|
|
867
867
|
var require_reed_solomon_encoder = __commonJS({
|
|
868
|
-
"node_modules/qrcode/lib/core/reed-solomon-encoder.js"(exports, module2) {
|
|
868
|
+
".devdeps/node_modules/qrcode/lib/core/reed-solomon-encoder.js"(exports, module2) {
|
|
869
869
|
var Polynomial = require_polynomial();
|
|
870
870
|
function ReedSolomonEncoder(degree) {
|
|
871
871
|
this.genPoly = void 0;
|
|
@@ -895,18 +895,18 @@ var require_reed_solomon_encoder = __commonJS({
|
|
|
895
895
|
}
|
|
896
896
|
});
|
|
897
897
|
|
|
898
|
-
// node_modules/qrcode/lib/core/version-check.js
|
|
898
|
+
// .devdeps/node_modules/qrcode/lib/core/version-check.js
|
|
899
899
|
var require_version_check = __commonJS({
|
|
900
|
-
"node_modules/qrcode/lib/core/version-check.js"(exports) {
|
|
900
|
+
".devdeps/node_modules/qrcode/lib/core/version-check.js"(exports) {
|
|
901
901
|
exports.isValid = function isValid(version) {
|
|
902
902
|
return !isNaN(version) && version >= 1 && version <= 40;
|
|
903
903
|
};
|
|
904
904
|
}
|
|
905
905
|
});
|
|
906
906
|
|
|
907
|
-
// node_modules/qrcode/lib/core/regex.js
|
|
907
|
+
// .devdeps/node_modules/qrcode/lib/core/regex.js
|
|
908
908
|
var require_regex = __commonJS({
|
|
909
|
-
"node_modules/qrcode/lib/core/regex.js"(exports) {
|
|
909
|
+
".devdeps/node_modules/qrcode/lib/core/regex.js"(exports) {
|
|
910
910
|
var numeric = "[0-9]+";
|
|
911
911
|
var alphanumeric = "[A-Z $%*+\\-./:]+";
|
|
912
912
|
var kanji = "(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";
|
|
@@ -932,9 +932,9 @@ var require_regex = __commonJS({
|
|
|
932
932
|
}
|
|
933
933
|
});
|
|
934
934
|
|
|
935
|
-
// node_modules/qrcode/lib/core/mode.js
|
|
935
|
+
// .devdeps/node_modules/qrcode/lib/core/mode.js
|
|
936
936
|
var require_mode = __commonJS({
|
|
937
|
-
"node_modules/qrcode/lib/core/mode.js"(exports) {
|
|
937
|
+
".devdeps/node_modules/qrcode/lib/core/mode.js"(exports) {
|
|
938
938
|
var VersionCheck = require_version_check();
|
|
939
939
|
var Regex = require_regex();
|
|
940
940
|
exports.NUMERIC = {
|
|
@@ -1013,9 +1013,9 @@ var require_mode = __commonJS({
|
|
|
1013
1013
|
}
|
|
1014
1014
|
});
|
|
1015
1015
|
|
|
1016
|
-
// node_modules/qrcode/lib/core/version.js
|
|
1016
|
+
// .devdeps/node_modules/qrcode/lib/core/version.js
|
|
1017
1017
|
var require_version = __commonJS({
|
|
1018
|
-
"node_modules/qrcode/lib/core/version.js"(exports) {
|
|
1018
|
+
".devdeps/node_modules/qrcode/lib/core/version.js"(exports) {
|
|
1019
1019
|
var Utils = require_utils();
|
|
1020
1020
|
var ECCode = require_error_correction_code();
|
|
1021
1021
|
var ECLevel = require_error_correction_level();
|
|
@@ -1108,9 +1108,9 @@ var require_version = __commonJS({
|
|
|
1108
1108
|
}
|
|
1109
1109
|
});
|
|
1110
1110
|
|
|
1111
|
-
// node_modules/qrcode/lib/core/format-info.js
|
|
1111
|
+
// .devdeps/node_modules/qrcode/lib/core/format-info.js
|
|
1112
1112
|
var require_format_info = __commonJS({
|
|
1113
|
-
"node_modules/qrcode/lib/core/format-info.js"(exports) {
|
|
1113
|
+
".devdeps/node_modules/qrcode/lib/core/format-info.js"(exports) {
|
|
1114
1114
|
var Utils = require_utils();
|
|
1115
1115
|
var G15 = 1 << 10 | 1 << 8 | 1 << 5 | 1 << 4 | 1 << 2 | 1 << 1 | 1 << 0;
|
|
1116
1116
|
var G15_MASK = 1 << 14 | 1 << 12 | 1 << 10 | 1 << 4 | 1 << 1;
|
|
@@ -1126,9 +1126,9 @@ var require_format_info = __commonJS({
|
|
|
1126
1126
|
}
|
|
1127
1127
|
});
|
|
1128
1128
|
|
|
1129
|
-
// node_modules/qrcode/lib/core/numeric-data.js
|
|
1129
|
+
// .devdeps/node_modules/qrcode/lib/core/numeric-data.js
|
|
1130
1130
|
var require_numeric_data = __commonJS({
|
|
1131
|
-
"node_modules/qrcode/lib/core/numeric-data.js"(exports, module2) {
|
|
1131
|
+
".devdeps/node_modules/qrcode/lib/core/numeric-data.js"(exports, module2) {
|
|
1132
1132
|
var Mode = require_mode();
|
|
1133
1133
|
function NumericData(data) {
|
|
1134
1134
|
this.mode = Mode.NUMERIC;
|
|
@@ -1161,9 +1161,9 @@ var require_numeric_data = __commonJS({
|
|
|
1161
1161
|
}
|
|
1162
1162
|
});
|
|
1163
1163
|
|
|
1164
|
-
// node_modules/qrcode/lib/core/alphanumeric-data.js
|
|
1164
|
+
// .devdeps/node_modules/qrcode/lib/core/alphanumeric-data.js
|
|
1165
1165
|
var require_alphanumeric_data = __commonJS({
|
|
1166
|
-
"node_modules/qrcode/lib/core/alphanumeric-data.js"(exports, module2) {
|
|
1166
|
+
".devdeps/node_modules/qrcode/lib/core/alphanumeric-data.js"(exports, module2) {
|
|
1167
1167
|
var Mode = require_mode();
|
|
1168
1168
|
var ALPHA_NUM_CHARS = [
|
|
1169
1169
|
"0",
|
|
@@ -1240,9 +1240,9 @@ var require_alphanumeric_data = __commonJS({
|
|
|
1240
1240
|
}
|
|
1241
1241
|
});
|
|
1242
1242
|
|
|
1243
|
-
// node_modules/qrcode/lib/core/byte-data.js
|
|
1243
|
+
// .devdeps/node_modules/qrcode/lib/core/byte-data.js
|
|
1244
1244
|
var require_byte_data = __commonJS({
|
|
1245
|
-
"node_modules/qrcode/lib/core/byte-data.js"(exports, module2) {
|
|
1245
|
+
".devdeps/node_modules/qrcode/lib/core/byte-data.js"(exports, module2) {
|
|
1246
1246
|
var Mode = require_mode();
|
|
1247
1247
|
function ByteData(data) {
|
|
1248
1248
|
this.mode = Mode.BYTE;
|
|
@@ -1270,9 +1270,9 @@ var require_byte_data = __commonJS({
|
|
|
1270
1270
|
}
|
|
1271
1271
|
});
|
|
1272
1272
|
|
|
1273
|
-
// node_modules/qrcode/lib/core/kanji-data.js
|
|
1273
|
+
// .devdeps/node_modules/qrcode/lib/core/kanji-data.js
|
|
1274
1274
|
var require_kanji_data = __commonJS({
|
|
1275
|
-
"node_modules/qrcode/lib/core/kanji-data.js"(exports, module2) {
|
|
1275
|
+
".devdeps/node_modules/qrcode/lib/core/kanji-data.js"(exports, module2) {
|
|
1276
1276
|
var Mode = require_mode();
|
|
1277
1277
|
var Utils = require_utils();
|
|
1278
1278
|
function KanjiData(data) {
|
|
@@ -1309,9 +1309,9 @@ var require_kanji_data = __commonJS({
|
|
|
1309
1309
|
}
|
|
1310
1310
|
});
|
|
1311
1311
|
|
|
1312
|
-
// node_modules/dijkstrajs/dijkstra.js
|
|
1312
|
+
// .devdeps/node_modules/dijkstrajs/dijkstra.js
|
|
1313
1313
|
var require_dijkstra = __commonJS({
|
|
1314
|
-
"node_modules/dijkstrajs/dijkstra.js"(exports, module2) {
|
|
1314
|
+
".devdeps/node_modules/dijkstrajs/dijkstra.js"(exports, module2) {
|
|
1315
1315
|
"use strict";
|
|
1316
1316
|
var dijkstra = {
|
|
1317
1317
|
single_source_shortest_paths: function(graph, s, d) {
|
|
@@ -1410,9 +1410,9 @@ var require_dijkstra = __commonJS({
|
|
|
1410
1410
|
}
|
|
1411
1411
|
});
|
|
1412
1412
|
|
|
1413
|
-
// node_modules/qrcode/lib/core/segments.js
|
|
1413
|
+
// .devdeps/node_modules/qrcode/lib/core/segments.js
|
|
1414
1414
|
var require_segments = __commonJS({
|
|
1415
|
-
"node_modules/qrcode/lib/core/segments.js"(exports) {
|
|
1415
|
+
".devdeps/node_modules/qrcode/lib/core/segments.js"(exports) {
|
|
1416
1416
|
var Mode = require_mode();
|
|
1417
1417
|
var NumericData = require_numeric_data();
|
|
1418
1418
|
var AlphanumericData = require_alphanumeric_data();
|
|
@@ -1596,9 +1596,9 @@ var require_segments = __commonJS({
|
|
|
1596
1596
|
}
|
|
1597
1597
|
});
|
|
1598
1598
|
|
|
1599
|
-
// node_modules/qrcode/lib/core/qrcode.js
|
|
1599
|
+
// .devdeps/node_modules/qrcode/lib/core/qrcode.js
|
|
1600
1600
|
var require_qrcode = __commonJS({
|
|
1601
|
-
"node_modules/qrcode/lib/core/qrcode.js"(exports) {
|
|
1601
|
+
".devdeps/node_modules/qrcode/lib/core/qrcode.js"(exports) {
|
|
1602
1602
|
var Utils = require_utils();
|
|
1603
1603
|
var ECLevel = require_error_correction_level();
|
|
1604
1604
|
var BitBuffer = require_bit_buffer();
|
|
@@ -1857,9 +1857,9 @@ var require_qrcode = __commonJS({
|
|
|
1857
1857
|
}
|
|
1858
1858
|
});
|
|
1859
1859
|
|
|
1860
|
-
// node_modules/qrcode/lib/renderer/utils.js
|
|
1860
|
+
// .devdeps/node_modules/qrcode/lib/renderer/utils.js
|
|
1861
1861
|
var require_utils2 = __commonJS({
|
|
1862
|
-
"node_modules/qrcode/lib/renderer/utils.js"(exports) {
|
|
1862
|
+
".devdeps/node_modules/qrcode/lib/renderer/utils.js"(exports) {
|
|
1863
1863
|
function hex2rgba(hex) {
|
|
1864
1864
|
if (typeof hex === "number") {
|
|
1865
1865
|
hex = hex.toString();
|
|
@@ -1937,9 +1937,9 @@ var require_utils2 = __commonJS({
|
|
|
1937
1937
|
}
|
|
1938
1938
|
});
|
|
1939
1939
|
|
|
1940
|
-
// node_modules/qrcode/lib/renderer/canvas.js
|
|
1940
|
+
// .devdeps/node_modules/qrcode/lib/renderer/canvas.js
|
|
1941
1941
|
var require_canvas = __commonJS({
|
|
1942
|
-
"node_modules/qrcode/lib/renderer/canvas.js"(exports) {
|
|
1942
|
+
".devdeps/node_modules/qrcode/lib/renderer/canvas.js"(exports) {
|
|
1943
1943
|
var Utils = require_utils2();
|
|
1944
1944
|
function clearCanvas(ctx, canvas, size) {
|
|
1945
1945
|
ctx.clearRect(0, 0, canvas.width, canvas.height);
|
|
@@ -1990,9 +1990,9 @@ var require_canvas = __commonJS({
|
|
|
1990
1990
|
}
|
|
1991
1991
|
});
|
|
1992
1992
|
|
|
1993
|
-
// node_modules/qrcode/lib/renderer/svg-tag.js
|
|
1993
|
+
// .devdeps/node_modules/qrcode/lib/renderer/svg-tag.js
|
|
1994
1994
|
var require_svg_tag = __commonJS({
|
|
1995
|
-
"node_modules/qrcode/lib/renderer/svg-tag.js"(exports) {
|
|
1995
|
+
".devdeps/node_modules/qrcode/lib/renderer/svg-tag.js"(exports) {
|
|
1996
1996
|
var Utils = require_utils2();
|
|
1997
1997
|
function getColorAttrib(color, attrib) {
|
|
1998
1998
|
const alpha = color.a / 255;
|
|
@@ -2048,9 +2048,9 @@ var require_svg_tag = __commonJS({
|
|
|
2048
2048
|
}
|
|
2049
2049
|
});
|
|
2050
2050
|
|
|
2051
|
-
// node_modules/qrcode/lib/browser.js
|
|
2051
|
+
// .devdeps/node_modules/qrcode/lib/browser.js
|
|
2052
2052
|
var require_browser = __commonJS({
|
|
2053
|
-
"node_modules/qrcode/lib/browser.js"(exports) {
|
|
2053
|
+
".devdeps/node_modules/qrcode/lib/browser.js"(exports) {
|
|
2054
2054
|
var canPromise = require_can_promise();
|
|
2055
2055
|
var QRCode2 = require_qrcode();
|
|
2056
2056
|
var CanvasRenderer = require_canvas();
|
|
@@ -2126,7 +2126,7 @@ __export(client_exports, {
|
|
|
2126
2126
|
inject: () => inject
|
|
2127
2127
|
});
|
|
2128
2128
|
module.exports = __toCommonJS(client_exports);
|
|
2129
|
-
var
|
|
2129
|
+
var import_react23 = __toESM(require("react"), 1);
|
|
2130
2130
|
|
|
2131
2131
|
// src/shared.js
|
|
2132
2132
|
var import_react = __toESM(require("react"), 1);
|
|
@@ -7759,24 +7759,22 @@ function endBroadcastText(success, record, task, cfg) {
|
|
|
7759
7759
|
const reason = record && record.endReason || "";
|
|
7760
7760
|
const title = record && record.title || task && task.title || "";
|
|
7761
7761
|
const sub = !!(record && record.isSubtask || task && task.isSubtask);
|
|
7762
|
+
const role = sub ? "\u5B50\u4EFB\u52A1" : "\u4E3B\u4EFB\u52A1";
|
|
7762
7763
|
const parentTitle = record && record.parentTitle || task && task.parentTitle || "";
|
|
7763
|
-
|
|
7764
|
-
|
|
7765
|
-
return success ? "\u4EFB\u52A1\u5B8C\u6210" : "\u4EFB\u52A1\u505C\u6B62\u4E86";
|
|
7766
|
-
}
|
|
7764
|
+
const head = role + (success ? "\u5B8C\u6210\u4E86" : "\u505C\u6B62\u4E86") + (title ? "\u300C" + truncate2(title, 30) + "\u300D" : "");
|
|
7765
|
+
if (mode === "brief") return head;
|
|
7767
7766
|
if (mode === "medium") {
|
|
7768
|
-
const
|
|
7769
|
-
const parts2 = [success ? who + "\u5B8C\u6210\u4E86" : who + "\u505C\u6B62\u4E86"];
|
|
7767
|
+
const parts2 = [head];
|
|
7770
7768
|
if (!success) parts2.push("\uFF0C\u539F\u56E0\uFF1A" + endReasonSpeech(reason));
|
|
7769
|
+
if (sub && parentTitle) parts2.push("\uFF08\u4E3B\u4EFB\u52A1\u300C" + truncate2(parentTitle, 20) + "\u300D\uFF09");
|
|
7771
7770
|
const dur2 = record && record.duration || 0;
|
|
7772
7771
|
if (dur2 > 0) parts2.push("\uFF0C\u8017\u65F6" + fmtDur(dur2));
|
|
7773
7772
|
parts2.push("\u3002");
|
|
7774
7773
|
return parts2.join("");
|
|
7775
7774
|
}
|
|
7776
|
-
const parts = [];
|
|
7775
|
+
const parts = [head + "\u3002"];
|
|
7777
7776
|
if (sub && parentTitle) parts.push("\u4E3B\u4EFB\u52A1\uFF1A" + truncate2(parentTitle, 30) + "\u3002");
|
|
7778
|
-
if (
|
|
7779
|
-
parts.push(success ? "\u5DF2\u5B8C\u6210\u3002" : "\u7ED3\u675F\uFF0C\u539F\u56E0\uFF1A" + endReasonSpeech(reason) + "\u3002");
|
|
7777
|
+
if (!success) parts.push("\u539F\u56E0\uFF1A" + endReasonSpeech(reason) + "\u3002");
|
|
7780
7778
|
const dur = record && record.duration || 0;
|
|
7781
7779
|
if (dur > 0) parts.push("\u8017\u65F6" + fmtDur(dur) + "\u3002");
|
|
7782
7780
|
const turns = record && record.turns || task && task.turns || 0;
|
|
@@ -7792,32 +7790,32 @@ function endBroadcastText(success, record, task, cfg) {
|
|
|
7792
7790
|
}
|
|
7793
7791
|
function confirmBroadcastText(task, approval, cfg) {
|
|
7794
7792
|
const mode = voiceTone(cfg);
|
|
7795
|
-
|
|
7793
|
+
const role = task && task.isSubtask ? "\u5B50\u4EFB\u52A1" : "\u4E3B\u4EFB\u52A1";
|
|
7794
|
+
const title = task && task.title || "";
|
|
7795
|
+
const head = role + "\u9700\u8981\u6388\u6743" + (title ? "\u300C" + truncate2(title, 30) + "\u300D" : "");
|
|
7796
7796
|
const tool = approval && approval.toolName || "\u5DE5\u5177";
|
|
7797
7797
|
const scene = toolLabel(tool);
|
|
7798
|
-
if (mode === "
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
}
|
|
7802
|
-
const parts = [];
|
|
7803
|
-
if (task && task.title) parts.push("\u4EFB\u52A1\uFF1A" + truncate2(task.title, 30) + "\u3002");
|
|
7798
|
+
if (mode === "brief") return head;
|
|
7799
|
+
if (mode === "medium") return head + "\uFF0C\u6B63\u5728\u7B49\u4F60\u6279\u51C6" + (scene || "\u5DE5\u5177 " + tool) + "\u3002";
|
|
7800
|
+
const parts = [head + "\u3002"];
|
|
7804
7801
|
parts.push("\u6B63\u5728\u7B49\u5F85\u4F60\u6279\u51C6" + (scene ? "\u6267\u884C" + scene : "") + "\uFF0C\u5DE5\u5177\u662F" + tool + "\uFF0C\u8BF7\u56DE\u5230\u4F1A\u8BDD\u5904\u7406\u3002");
|
|
7805
7802
|
return parts.join("");
|
|
7806
7803
|
}
|
|
7807
7804
|
function questionBroadcastText(task, question, cfg) {
|
|
7808
7805
|
const mode = voiceTone(cfg);
|
|
7809
|
-
|
|
7810
|
-
const
|
|
7811
|
-
const head =
|
|
7806
|
+
const role = task && task.isSubtask ? "\u5B50\u4EFB\u52A1" : "\u4E3B\u4EFB\u52A1";
|
|
7807
|
+
const title = task && task.title || "";
|
|
7808
|
+
const head = role + "\u9700\u8981\u4F60\u56DE\u7B54" + (title ? "\u300C" + truncate2(title, 30) + "\u300D" : "");
|
|
7809
|
+
const qhead = question && question.header || "";
|
|
7812
7810
|
const body = question && question.question || "";
|
|
7813
7811
|
const what = body ? truncate2(body.replace(/[#*_`>\[\]()!]/g, ""), 40) : "";
|
|
7812
|
+
if (mode === "brief") return head;
|
|
7814
7813
|
if (mode === "medium") {
|
|
7815
|
-
const tail = what ? "\uFF1A" + what :
|
|
7816
|
-
return
|
|
7814
|
+
const tail = what ? "\uFF1A" + what : qhead ? "\uFF1A" + qhead : "";
|
|
7815
|
+
return head + tail + "\u3002";
|
|
7817
7816
|
}
|
|
7818
|
-
const parts = [];
|
|
7819
|
-
|
|
7820
|
-
parts.push(what ? "\u6B63\u5728\u7B49\u4F60\u56DE\u7B54\u95EE\u9898\uFF1A" + what + "\u3002" : "\u6B63\u5728\u7B49\u4F60\u56DE\u7B54\u95EE\u9898\u3002");
|
|
7817
|
+
const parts = [head + "\u3002"];
|
|
7818
|
+
parts.push(what ? "\u95EE\u9898\uFF1A" + what + "\u3002" : qhead ? "\u95EE\u9898\uFF1A" + qhead + "\u3002" : "\u6B63\u5728\u7B49\u4F60\u56DE\u7B54\u95EE\u9898\u3002");
|
|
7821
7819
|
const count = question && question.count || 0;
|
|
7822
7820
|
if (count > 1) parts.push("\u5171 " + count + " \u4E2A\u95EE\u9898\u3002");
|
|
7823
7821
|
parts.push("\u8BF7\u56DE\u5230\u4F1A\u8BDD\u9009\u62E9\u7B54\u6848\u3002");
|
|
@@ -7825,12 +7823,14 @@ function questionBroadcastText(task, question, cfg) {
|
|
|
7825
7823
|
}
|
|
7826
7824
|
function stuckBroadcastText(task, cfg) {
|
|
7827
7825
|
const mode = voiceTone(cfg);
|
|
7828
|
-
const
|
|
7829
|
-
|
|
7826
|
+
const role = task && task.isSubtask ? "\u5B50\u4EFB\u52A1" : "\u4E3B\u4EFB\u52A1";
|
|
7827
|
+
const title = task && task.title || "";
|
|
7828
|
+
const head = role + "\u5361\u4F4F\u4E86" + (title ? "\u300C" + truncate2(title, 30) + "\u300D" : "");
|
|
7829
|
+
if (mode === "brief") return head;
|
|
7830
7830
|
if (mode === "medium") {
|
|
7831
|
-
return
|
|
7831
|
+
return head + "\uFF0C\u5DF2\u7ECF" + fmtDur(Math.max(0, cfg && cfg.stuckMs || STUCK_MS)) + "\u6CA1\u6709\u4EFB\u4F55\u52A8\u9759\u3002";
|
|
7832
7832
|
}
|
|
7833
|
-
const parts = [
|
|
7833
|
+
const parts = [head + "\u3002"];
|
|
7834
7834
|
parts.push("\u7F16\u7A0B\u9636\u6BB5\u5DF2\u7ECF" + fmtDur(Math.max(0, cfg && cfg.stuckMs || STUCK_MS)) + "\u6CA1\u6709\u4EFB\u4F55\u52A8\u9759\uFF0C");
|
|
7835
7835
|
const tool = task && task.lastToolName || "";
|
|
7836
7836
|
const scene = tool ? toolLabel(tool) : "";
|
|
@@ -9996,11 +9996,11 @@ function drainQueue() {
|
|
|
9996
9996
|
}
|
|
9997
9997
|
function closingMarkdown(owner) {
|
|
9998
9998
|
const turn = owner && owner.turn;
|
|
9999
|
-
const
|
|
10000
|
-
if (!
|
|
9999
|
+
const store2 = turn && turn.data;
|
|
10000
|
+
if (!store2 || typeof store2.get !== "function") return "";
|
|
10001
10001
|
let tail = null;
|
|
10002
10002
|
try {
|
|
10003
|
-
tail =
|
|
10003
|
+
tail = store2.get("turn-tail");
|
|
10004
10004
|
} catch {
|
|
10005
10005
|
return "";
|
|
10006
10006
|
}
|
|
@@ -14413,7 +14413,7 @@ function RemoteCard() {
|
|
|
14413
14413
|
const [messageKind, setMessageKind] = (0, import_react20.useState)("error");
|
|
14414
14414
|
const [changing, setChanging] = (0, import_react20.useState)(false);
|
|
14415
14415
|
const [remote, setRemote] = (0, import_react20.useState)(false);
|
|
14416
|
-
const
|
|
14416
|
+
const notify2 = (0, import_react20.useCallback)((text, kind) => {
|
|
14417
14417
|
setMessage(text);
|
|
14418
14418
|
setMessageKind(kind || "error");
|
|
14419
14419
|
}, []);
|
|
@@ -14424,9 +14424,9 @@ function RemoteCard() {
|
|
|
14424
14424
|
setAddress((prev) => prev || (data.addresses && data.addresses[0] ? data.addresses[0].address : ""));
|
|
14425
14425
|
setUsername((prev) => prev || (data.username || ""));
|
|
14426
14426
|
} catch (e) {
|
|
14427
|
-
|
|
14427
|
+
notify2(e && e.message ? e.message : String(e));
|
|
14428
14428
|
}
|
|
14429
|
-
}, [
|
|
14429
|
+
}, [notify2]);
|
|
14430
14430
|
(0, import_react20.useEffect)(() => {
|
|
14431
14431
|
refresh();
|
|
14432
14432
|
const timer = setInterval(refresh, 3e3);
|
|
@@ -14456,9 +14456,9 @@ function RemoteCard() {
|
|
|
14456
14456
|
};
|
|
14457
14457
|
}, [lanLink]);
|
|
14458
14458
|
async function enable() {
|
|
14459
|
-
|
|
14459
|
+
notify2("");
|
|
14460
14460
|
if (!lan.accountSet && (!username.trim() || password.length < 6)) {
|
|
14461
|
-
|
|
14461
|
+
notify2("\u9996\u6B21\u5F00\u542F\u8BF7\u8BBE\u7F6E\u8D26\u53F7\u548C\u81F3\u5C11 6 \u4F4D\u7684\u5BC6\u7801\u3002");
|
|
14462
14462
|
return;
|
|
14463
14463
|
}
|
|
14464
14464
|
setBusy("start");
|
|
@@ -14478,30 +14478,30 @@ function RemoteCard() {
|
|
|
14478
14478
|
setPassword("");
|
|
14479
14479
|
setNewPassword("");
|
|
14480
14480
|
setChanging(false);
|
|
14481
|
-
|
|
14481
|
+
notify2("\u8FDC\u7A0B\u8BBF\u95EE\u5DF2\u5F00\u542F\uFF1A\u8BBE\u5907\u8BBF\u95EE\u4E0B\u65B9\u5730\u5740\u5E76\u7528\u8D26\u53F7\u5BC6\u7801\u767B\u5F55\u3002" + (data.needsRestart ? "\uFF08\u5DE5\u4F5C\u533A\u76EE\u5F55\u7684\u6D4F\u89C8\u9009\u62E9\u9700\u91CD\u542F dsh web \u540E\u53EF\u7528\uFF09" : ""), "success");
|
|
14482
14482
|
} catch (e) {
|
|
14483
|
-
|
|
14483
|
+
notify2(e && e.message ? e.message : String(e));
|
|
14484
14484
|
} finally {
|
|
14485
14485
|
setBusy("");
|
|
14486
14486
|
}
|
|
14487
14487
|
}
|
|
14488
14488
|
async function disable() {
|
|
14489
|
-
|
|
14489
|
+
notify2("");
|
|
14490
14490
|
setBusy("stop");
|
|
14491
14491
|
try {
|
|
14492
14492
|
const data = await rpc("lan/stop", {});
|
|
14493
14493
|
setLan(data);
|
|
14494
|
-
|
|
14494
|
+
notify2("\u8FDC\u7A0B\u8BBF\u95EE\u5DF2\u5173\u95ED\uFF0C\u5DF2\u767B\u5F55\u8BBE\u5907\u5168\u90E8\u9000\u51FA\u3002" + (data.needsRestart ? "\u91CD\u542F dsh web \u540E\u6062\u590D\u5DE5\u4F5C\u533A\u539F\u751F\u9009\u62E9\u5668\u3002" : ""), "success");
|
|
14495
14495
|
} catch (e) {
|
|
14496
|
-
|
|
14496
|
+
notify2(e && e.message ? e.message : String(e));
|
|
14497
14497
|
} finally {
|
|
14498
14498
|
setBusy("");
|
|
14499
14499
|
}
|
|
14500
14500
|
}
|
|
14501
14501
|
async function saveAuth() {
|
|
14502
|
-
|
|
14502
|
+
notify2("");
|
|
14503
14503
|
if (!username.trim() || newPassword.length < 6) {
|
|
14504
|
-
|
|
14504
|
+
notify2("\u8BF7\u586B\u5199\u8D26\u53F7\u548C\u81F3\u5C11 6 \u4F4D\u7684\u65B0\u5BC6\u7801\u3002");
|
|
14505
14505
|
return;
|
|
14506
14506
|
}
|
|
14507
14507
|
setBusy("auth");
|
|
@@ -14511,15 +14511,15 @@ function RemoteCard() {
|
|
|
14511
14511
|
setPassword("");
|
|
14512
14512
|
setNewPassword("");
|
|
14513
14513
|
setChanging(false);
|
|
14514
|
-
|
|
14514
|
+
notify2("\u8D26\u53F7\u5BC6\u7801\u5DF2\u66F4\u65B0\uFF0C\u6240\u6709\u8BBE\u5907\u9700\u91CD\u65B0\u767B\u5F55\u3002", "success");
|
|
14515
14515
|
} catch (e) {
|
|
14516
|
-
|
|
14516
|
+
notify2(e && e.message ? e.message : String(e));
|
|
14517
14517
|
} finally {
|
|
14518
14518
|
setBusy("");
|
|
14519
14519
|
}
|
|
14520
14520
|
}
|
|
14521
14521
|
function copyLink() {
|
|
14522
|
-
copy(lanLink).then(() =>
|
|
14522
|
+
copy(lanLink).then(() => notify2("\u5730\u5740\u5DF2\u590D\u5236\u3002", "success")).catch((e) => notify2(e.message));
|
|
14523
14523
|
}
|
|
14524
14524
|
function logout() {
|
|
14525
14525
|
const info = typeof window !== "undefined" ? window.__DSH_REMOTE__ : null;
|
|
@@ -14918,7 +14918,7 @@ function ServerForm(props) {
|
|
|
14918
14918
|
hint: "\u5DE5\u5177\u540D\u524D\u7F00\uFF1A\u6A21\u578B\u770B\u5230\u7684\u662F mcp__<serverName>__<tool>\uFF1B\u987B\u5339\u914D " + SERVER_NAME_RE
|
|
14919
14919
|
}, input({
|
|
14920
14920
|
value: form.serverName,
|
|
14921
|
-
placeholder: "
|
|
14921
|
+
placeholder: "demo_ocr",
|
|
14922
14922
|
disabled: isEdit,
|
|
14923
14923
|
onChange: (e) => patch({ serverName: e.target.value })
|
|
14924
14924
|
})),
|
|
@@ -14958,7 +14958,7 @@ function ServerForm(props) {
|
|
|
14958
14958
|
rows: 4,
|
|
14959
14959
|
spellCheck: false,
|
|
14960
14960
|
value: form.argsText,
|
|
14961
|
-
placeholder: "/
|
|
14961
|
+
placeholder: "/home/me/work/demo-service/mcp_ocr.py",
|
|
14962
14962
|
onChange: (e) => patch({ argsText: e.target.value })
|
|
14963
14963
|
})
|
|
14964
14964
|
),
|
|
@@ -14975,7 +14975,7 @@ function ServerForm(props) {
|
|
|
14975
14975
|
),
|
|
14976
14976
|
Field(
|
|
14977
14977
|
{ label: "cwd\uFF08\u53EF\u9009\uFF09" },
|
|
14978
|
-
input({ value: form.cwd, placeholder: "/
|
|
14978
|
+
input({ value: form.cwd, placeholder: "/home/me/work/demo-service", onChange: (e) => patch({ cwd: e.target.value }) })
|
|
14979
14979
|
)
|
|
14980
14980
|
),
|
|
14981
14981
|
import_react21.default.createElement(
|
|
@@ -15128,16 +15128,16 @@ function McpConfigView() {
|
|
|
15128
15128
|
commit(next, "\u5DF2\u5220\u9664\u300C" + draft.serverName + "\u300D");
|
|
15129
15129
|
};
|
|
15130
15130
|
const fillXiaomiExample = () => {
|
|
15131
|
-
if (drafts.some((d) => d.serverName === "
|
|
15132
|
-
setMsg({ tone: "warn", text: "\u5217\u8868\u91CC\u5DF2\u7ECF\u6709
|
|
15131
|
+
if (drafts.some((d) => d.serverName === "demo_ocr")) {
|
|
15132
|
+
setMsg({ tone: "warn", text: "\u5217\u8868\u91CC\u5DF2\u7ECF\u6709 demo_ocr\uFF08\u53EF\u76F4\u63A5\u70B9\u8BE5\u5361\u7247\u7684\u300C\u7F16\u8F91\u300D\u67E5\u770B/\u4FEE\u6539\uFF09" });
|
|
15133
15133
|
return;
|
|
15134
15134
|
}
|
|
15135
15135
|
setForm(Object.assign(emptyForm(), {
|
|
15136
|
-
serverName: "
|
|
15136
|
+
serverName: "demo_ocr",
|
|
15137
15137
|
transport: "stdio",
|
|
15138
15138
|
command: "/usr/bin/python3",
|
|
15139
|
-
argsText: "/
|
|
15140
|
-
cwd: "/
|
|
15139
|
+
argsText: "/home/me/work/demo-service/mcp_ocr.py",
|
|
15140
|
+
cwd: "/home/me/work/demo-service",
|
|
15141
15141
|
envText: "",
|
|
15142
15142
|
toolCallTimeoutMs: "300000",
|
|
15143
15143
|
failOnStartupError: false
|
|
@@ -15402,9 +15402,371 @@ var feature11 = {
|
|
|
15402
15402
|
].join("\n")
|
|
15403
15403
|
};
|
|
15404
15404
|
|
|
15405
|
+
// features/dshtools/view.jsx
|
|
15406
|
+
var import_react22 = __toESM(require("react"), 1);
|
|
15407
|
+
var ENDPOINT2 = "dsh-dock/dshtools";
|
|
15408
|
+
var LARGE_FILE_BYTES = 32 * 1024 * 1024;
|
|
15409
|
+
var store = {
|
|
15410
|
+
/** 宿主 /dsh-dock/dshtools 是否已成功读过一次:没读过就绝不接管菜单。 */
|
|
15411
|
+
ready: false,
|
|
15412
|
+
error: "",
|
|
15413
|
+
groups: [],
|
|
15414
|
+
listeners: /* @__PURE__ */ new Set(),
|
|
15415
|
+
loading: null
|
|
15416
|
+
};
|
|
15417
|
+
function notify() {
|
|
15418
|
+
for (const fn of store.listeners) {
|
|
15419
|
+
try {
|
|
15420
|
+
fn();
|
|
15421
|
+
} catch (e) {
|
|
15422
|
+
console.error("[dsh-dock] DSH\u529F\u80FD\u8BA2\u9605\u8005\u51FA\u9519\uFF1A", e);
|
|
15423
|
+
}
|
|
15424
|
+
}
|
|
15425
|
+
}
|
|
15426
|
+
function subscribe(fn) {
|
|
15427
|
+
store.listeners.add(fn);
|
|
15428
|
+
return () => {
|
|
15429
|
+
store.listeners.delete(fn);
|
|
15430
|
+
};
|
|
15431
|
+
}
|
|
15432
|
+
function applyPayload(data) {
|
|
15433
|
+
const groups = data && data.ok === true && Array.isArray(data.groups) ? data.groups : null;
|
|
15434
|
+
if (!groups) {
|
|
15435
|
+
store.error = data && data.error || "\u5BBF\u4E3B\u8FD4\u56DE\u7684\u914D\u7F6E\u683C\u5F0F\u4E0D\u6B63\u786E";
|
|
15436
|
+
notify();
|
|
15437
|
+
return false;
|
|
15438
|
+
}
|
|
15439
|
+
store.groups = groups;
|
|
15440
|
+
store.error = "";
|
|
15441
|
+
store.ready = true;
|
|
15442
|
+
notify();
|
|
15443
|
+
return true;
|
|
15444
|
+
}
|
|
15445
|
+
function ensureLoaded() {
|
|
15446
|
+
if (store.ready) return Promise.resolve(true);
|
|
15447
|
+
if (store.loading) return store.loading;
|
|
15448
|
+
if (typeof fetch !== "function") {
|
|
15449
|
+
store.error = "\u5F53\u524D\u73AF\u5883\u4E0D\u652F\u6301 fetch";
|
|
15450
|
+
notify();
|
|
15451
|
+
return Promise.resolve(false);
|
|
15452
|
+
}
|
|
15453
|
+
store.loading = fetch(ENDPOINT2, { headers: { accept: "application/json" } }).then(async (res) => {
|
|
15454
|
+
if (!res.ok) throw new Error("HTTP " + res.status);
|
|
15455
|
+
return res.json();
|
|
15456
|
+
}).then((data) => applyPayload(data)).catch(() => {
|
|
15457
|
+
store.error = "\u5BBF\u4E3B\u6CA1\u6709\u300CDSH\u529F\u80FD\u300D\u63A5\u53E3\uFF1A\u5BBF\u4E3B\u8FDB\u7A0B\u53EF\u80FD\u662F\u65E7\u7248\u672C\uFF0C\u6216\u8BE5\u529F\u80FD\u5728\u5BBF\u4E3B\u4FA7\u672A\u542F\u7528\uFF08\u91CD\u542F dsh web\uFF0C\u6216\u5728\u529F\u80FD\u575E\u91CC\u5173\u6389\u518D\u6253\u5F00\u672C\u529F\u80FD\uFF09";
|
|
15458
|
+
notify();
|
|
15459
|
+
return false;
|
|
15460
|
+
}).finally(() => {
|
|
15461
|
+
store.loading = null;
|
|
15462
|
+
});
|
|
15463
|
+
return store.loading;
|
|
15464
|
+
}
|
|
15465
|
+
function valueOf(groupId, key) {
|
|
15466
|
+
const group = store.groups.find((g) => g.id === groupId);
|
|
15467
|
+
const item = group && Array.isArray(group.items) ? group.items.find((i) => i.key === key) : void 0;
|
|
15468
|
+
return item ? item.value === true : void 0;
|
|
15469
|
+
}
|
|
15470
|
+
async function setValue(groupId, key, value) {
|
|
15471
|
+
const res = await fetch(ENDPOINT2, {
|
|
15472
|
+
method: "POST",
|
|
15473
|
+
headers: { "content-type": "application/json" },
|
|
15474
|
+
body: JSON.stringify({ group: groupId, key, value: value === true })
|
|
15475
|
+
});
|
|
15476
|
+
const data = await res.json().catch(() => null);
|
|
15477
|
+
if (!res.ok || !data || data.ok !== true) {
|
|
15478
|
+
throw new Error(data && data.error || "HTTP " + res.status);
|
|
15479
|
+
}
|
|
15480
|
+
applyPayload(data);
|
|
15481
|
+
}
|
|
15482
|
+
function filePathOf(url) {
|
|
15483
|
+
if (typeof url !== "string" || url.length === 0) return void 0;
|
|
15484
|
+
let parsed;
|
|
15485
|
+
try {
|
|
15486
|
+
parsed = new URL(url, document.baseURI);
|
|
15487
|
+
} catch (e) {
|
|
15488
|
+
return void 0;
|
|
15489
|
+
}
|
|
15490
|
+
if (typeof location !== "undefined" && parsed.origin !== location.origin) return void 0;
|
|
15491
|
+
if (!/\/api\/file$/.test(parsed.pathname)) return void 0;
|
|
15492
|
+
const path = parsed.searchParams.get("path");
|
|
15493
|
+
return path && path.length > 0 ? path : void 0;
|
|
15494
|
+
}
|
|
15495
|
+
var routeReady = false;
|
|
15496
|
+
var routeProbe = null;
|
|
15497
|
+
function ensureRoute() {
|
|
15498
|
+
if (routeReady) return Promise.resolve(true);
|
|
15499
|
+
if (routeProbe) return routeProbe;
|
|
15500
|
+
if (typeof fetch !== "function") return Promise.resolve(false);
|
|
15501
|
+
routeProbe = fetch("dsh-dock/download?probe=1", { method: "HEAD", cache: "no-store" }).then((res) => {
|
|
15502
|
+
routeReady = res.status === 204 || res.ok === true;
|
|
15503
|
+
return routeReady;
|
|
15504
|
+
}).catch(() => false).finally(() => {
|
|
15505
|
+
routeProbe = null;
|
|
15506
|
+
});
|
|
15507
|
+
return routeProbe;
|
|
15508
|
+
}
|
|
15509
|
+
function shouldTakeover() {
|
|
15510
|
+
const state = stateOf("dshtools");
|
|
15511
|
+
if (!state || state.enabled !== true) return false;
|
|
15512
|
+
if (valueOf("fileContextMenu", "streamingDownload") === false) return false;
|
|
15513
|
+
if (!routeReady) {
|
|
15514
|
+
void ensureRoute();
|
|
15515
|
+
return false;
|
|
15516
|
+
}
|
|
15517
|
+
return true;
|
|
15518
|
+
}
|
|
15519
|
+
function installDownloadTakeover(actions) {
|
|
15520
|
+
if (!actions || typeof actions.save !== "function" || actions.__dshDockStreamingDownload === true) return;
|
|
15521
|
+
const original = actions.save;
|
|
15522
|
+
const wrapped = async function(source, mode) {
|
|
15523
|
+
if (mode === "download" && actions.canSaveAs !== true && shouldTakeover()) {
|
|
15524
|
+
const path = filePathOf(source && source.url);
|
|
15525
|
+
if (path !== void 0) {
|
|
15526
|
+
try {
|
|
15527
|
+
startDownload(path);
|
|
15528
|
+
return { status: "requested" };
|
|
15529
|
+
} catch (e) {
|
|
15530
|
+
}
|
|
15531
|
+
}
|
|
15532
|
+
}
|
|
15533
|
+
return original.call(actions, source, mode);
|
|
15534
|
+
};
|
|
15535
|
+
wrapped.__original = original;
|
|
15536
|
+
try {
|
|
15537
|
+
actions.save = wrapped;
|
|
15538
|
+
actions.__dshDockStreamingDownload = true;
|
|
15539
|
+
} catch (e) {
|
|
15540
|
+
}
|
|
15541
|
+
}
|
|
15542
|
+
function startDownload(absolutePath) {
|
|
15543
|
+
if (typeof document === "undefined" || !document.body) return;
|
|
15544
|
+
const base = document.baseURI || (typeof location !== "undefined" ? location.href : "http://localhost/");
|
|
15545
|
+
const url = new URL("dsh-dock/download?path=" + encodeURIComponent(absolutePath), base);
|
|
15546
|
+
const anchor = document.createElement("a");
|
|
15547
|
+
anchor.href = url.href;
|
|
15548
|
+
anchor.download = "";
|
|
15549
|
+
anchor.rel = "noopener";
|
|
15550
|
+
document.body.append(anchor);
|
|
15551
|
+
anchor.click();
|
|
15552
|
+
anchor.remove();
|
|
15553
|
+
}
|
|
15554
|
+
async function resolveFileMenu(remote, target, signal) {
|
|
15555
|
+
const state = stateOf("dshtools");
|
|
15556
|
+
if (!state || state.enabled !== true) return [];
|
|
15557
|
+
if (!store.ready) {
|
|
15558
|
+
void ensureLoaded();
|
|
15559
|
+
return [];
|
|
15560
|
+
}
|
|
15561
|
+
if (valueOf("fileContextMenu", "streamingDownload") !== true) return [];
|
|
15562
|
+
let result;
|
|
15563
|
+
try {
|
|
15564
|
+
result = await remote.workspaceFiles.stat(target.sessionId, target.path, signal);
|
|
15565
|
+
} catch (e) {
|
|
15566
|
+
return [];
|
|
15567
|
+
}
|
|
15568
|
+
if (!result || result.ok !== true || !result.value) return [];
|
|
15569
|
+
const bytes = typeof result.value.bytes === "number" ? result.value.bytes : void 0;
|
|
15570
|
+
if (bytes === void 0 || bytes <= LARGE_FILE_BYTES) return [];
|
|
15571
|
+
const absolutePath = result.value.absolutePath;
|
|
15572
|
+
if (typeof absolutePath !== "string" || absolutePath.length === 0) return [];
|
|
15573
|
+
return [{
|
|
15574
|
+
id: "download-large",
|
|
15575
|
+
label: "\u4E0B\u8F7D\uFF08\u5927\u6587\u4EF6\uFF09",
|
|
15576
|
+
icon: { key: "dsh-dock.download" },
|
|
15577
|
+
run: () => startDownload(absolutePath)
|
|
15578
|
+
}];
|
|
15579
|
+
}
|
|
15580
|
+
function DownloadIcon() {
|
|
15581
|
+
return import_react22.default.createElement(
|
|
15582
|
+
"svg",
|
|
15583
|
+
{
|
|
15584
|
+
width: 14,
|
|
15585
|
+
height: 14,
|
|
15586
|
+
viewBox: "0 0 16 16",
|
|
15587
|
+
fill: "none",
|
|
15588
|
+
"aria-hidden": "true"
|
|
15589
|
+
},
|
|
15590
|
+
import_react22.default.createElement("path", {
|
|
15591
|
+
d: "M8 2.5v7.2m0 0 2.8-2.8M8 9.7 5.2 6.9M3 13h10",
|
|
15592
|
+
stroke: "currentColor",
|
|
15593
|
+
strokeWidth: 1.4,
|
|
15594
|
+
strokeLinecap: "round",
|
|
15595
|
+
strokeLinejoin: "round"
|
|
15596
|
+
})
|
|
15597
|
+
);
|
|
15598
|
+
}
|
|
15599
|
+
function serviceOf(scope, name) {
|
|
15600
|
+
if (!scope) return void 0;
|
|
15601
|
+
const direct = scope[name];
|
|
15602
|
+
if (direct !== void 0) return direct;
|
|
15603
|
+
return typeof scope.get === "function" ? scope.get(name) : void 0;
|
|
15604
|
+
}
|
|
15605
|
+
function onServices(ctx, names, run) {
|
|
15606
|
+
if (typeof ctx.inject === "function") {
|
|
15607
|
+
try {
|
|
15608
|
+
ctx.inject(names, (scope) => run(scope));
|
|
15609
|
+
return;
|
|
15610
|
+
} catch (e) {
|
|
15611
|
+
}
|
|
15612
|
+
}
|
|
15613
|
+
run(ctx);
|
|
15614
|
+
}
|
|
15615
|
+
function installClient(ctx) {
|
|
15616
|
+
if (!ctx || typeof ctx !== "object") return;
|
|
15617
|
+
ensureLoaded();
|
|
15618
|
+
onServices(ctx, ["slots"], (scope) => {
|
|
15619
|
+
const slots = serviceOf(scope, "slots");
|
|
15620
|
+
if (!slots || typeof slots.inject !== "function" || typeof slots.register !== "function") return;
|
|
15621
|
+
slots.inject("contextMenu.icon", function* () {
|
|
15622
|
+
yield slots.register({ name: "contextMenu.icon", key: "dsh-dock.download" }, DownloadIcon);
|
|
15623
|
+
});
|
|
15624
|
+
});
|
|
15625
|
+
onServices(ctx, ["contextMenus", "remote.workspaceFiles"], (scope) => {
|
|
15626
|
+
const menus = serviceOf(scope, "contextMenus");
|
|
15627
|
+
const remote = serviceOf(scope, "remote");
|
|
15628
|
+
if (!menus || typeof menus.register !== "function") return;
|
|
15629
|
+
if (!remote || !remote.workspaceFiles || typeof remote.workspaceFiles.stat !== "function") return;
|
|
15630
|
+
const register = () => menus.register({
|
|
15631
|
+
id: "dsh-dock.dshtools.file",
|
|
15632
|
+
target: "file",
|
|
15633
|
+
// 排在 DSH 自带 file-actions(order 200)之后:同菜单里我们的是补充项。
|
|
15634
|
+
order: 210,
|
|
15635
|
+
resolve: (target, signal) => resolveFileMenu(remote, target, signal)
|
|
15636
|
+
});
|
|
15637
|
+
if (typeof scope.effect === "function") scope.effect(register, "dsh-dock: DSH\u529F\u80FD \xB7 \u6587\u4EF6\u53F3\u952E");
|
|
15638
|
+
else register();
|
|
15639
|
+
});
|
|
15640
|
+
ensureRoute();
|
|
15641
|
+
onServices(ctx, ["fileActions"], (scope) => {
|
|
15642
|
+
const actions = serviceOf(scope, "fileActions");
|
|
15643
|
+
if (!actions) return;
|
|
15644
|
+
installDownloadTakeover(actions);
|
|
15645
|
+
if (typeof scope.effect === "function") {
|
|
15646
|
+
scope.effect(() => () => {
|
|
15647
|
+
if (actions.__dshDockStreamingDownload !== true) return;
|
|
15648
|
+
const restore = actions.save && actions.save.__original;
|
|
15649
|
+
if (typeof restore === "function") {
|
|
15650
|
+
try {
|
|
15651
|
+
actions.save = restore;
|
|
15652
|
+
} catch (e) {
|
|
15653
|
+
}
|
|
15654
|
+
}
|
|
15655
|
+
delete actions.__dshDockStreamingDownload;
|
|
15656
|
+
}, "dsh-dock: DSH\u529F\u80FD \xB7 \u4E0B\u8F7D\u63A5\u7BA1");
|
|
15657
|
+
}
|
|
15658
|
+
});
|
|
15659
|
+
}
|
|
15660
|
+
var CSS2 = [
|
|
15661
|
+
".dkht{display:flex;flex-direction:column;gap:12px;}",
|
|
15662
|
+
".dkht-intro{color:var(--dsw-alias-label-secondary);font-size:12px;line-height:1.7;border:1px dashed var(--dsw-alias-border-l1);border-radius:8px;padding:8px 10px;}",
|
|
15663
|
+
".dkht-group{border:1px solid var(--dsw-alias-border-l1);border-radius:10px;padding:10px 12px;display:flex;flex-direction:column;gap:6px;background:var(--dsw-alias-bg-layer-1);}",
|
|
15664
|
+
".dkht-group-head{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;}",
|
|
15665
|
+
".dkht-group-name{font-weight:600;font-size:13px;}",
|
|
15666
|
+
".dkht-group-desc{font-size:11px;color:var(--dsw-alias-label-tertiary);}",
|
|
15667
|
+
".dkht-item{display:flex;gap:10px;align-items:flex-start;padding:8px 10px;border-radius:8px;cursor:pointer;border:1px solid transparent;transition:background .12s,border-color .12s;}",
|
|
15668
|
+
".dkht-item:hover{background:var(--dsw-alias-interactive-bg-hover);}",
|
|
15669
|
+
".dkht-item.on{border-color:color-mix(in srgb,var(--dk-accent) 35%,transparent);background:var(--dk-hover-tint);}",
|
|
15670
|
+
".dkht-item.busy{opacity:.6;cursor:progress;}",
|
|
15671
|
+
".dkht-check{width:15px;height:15px;margin:2px 0 0;accent-color:var(--dk-accent);flex:none;cursor:pointer;}",
|
|
15672
|
+
".dkht-text{display:flex;flex-direction:column;gap:2px;min-width:0;}",
|
|
15673
|
+
".dkht-name{font-size:12px;font-weight:600;}",
|
|
15674
|
+
".dkht-desc{font-size:11px;line-height:1.6;color:var(--dsw-alias-label-secondary);}",
|
|
15675
|
+
".dkht-error{color:var(--dsw-alias-state-error-primary);font-size:12px;line-height:1.6;}",
|
|
15676
|
+
".dkht-empty{color:var(--dsw-alias-label-tertiary);font-size:12px;}",
|
|
15677
|
+
".dkht-note{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:1.6;}"
|
|
15678
|
+
].join("\n");
|
|
15679
|
+
function DshToolsView(props) {
|
|
15680
|
+
const [, force] = import_react22.default.useReducer((n) => n + 1, 0);
|
|
15681
|
+
const [busy, setBusy] = import_react22.default.useState("");
|
|
15682
|
+
const [error, setError] = import_react22.default.useState("");
|
|
15683
|
+
import_react22.default.useEffect(() => {
|
|
15684
|
+
const off = subscribe(() => force());
|
|
15685
|
+
ensureLoaded().then(() => force());
|
|
15686
|
+
return off;
|
|
15687
|
+
}, []);
|
|
15688
|
+
const toggle = async (group, item) => {
|
|
15689
|
+
const id = group.id + "/" + item.key;
|
|
15690
|
+
if (busy) return;
|
|
15691
|
+
setBusy(id);
|
|
15692
|
+
setError("");
|
|
15693
|
+
try {
|
|
15694
|
+
await setValue(group.id, item.key, item.value !== true);
|
|
15695
|
+
} catch (e) {
|
|
15696
|
+
setError(e && e.message ? e.message : String(e));
|
|
15697
|
+
} finally {
|
|
15698
|
+
setBusy("");
|
|
15699
|
+
}
|
|
15700
|
+
};
|
|
15701
|
+
const groups = store.groups;
|
|
15702
|
+
return import_react22.default.createElement(
|
|
15703
|
+
"div",
|
|
15704
|
+
{ className: "dkht" },
|
|
15705
|
+
import_react22.default.createElement(
|
|
15706
|
+
"div",
|
|
15707
|
+
{ className: "dkht-intro" },
|
|
15708
|
+
"\u8FD9\u91CC\u7ED9 DSH \u81EA\u5E26\u754C\u9762\u8865\u5145\u80FD\u529B\uFF0C\u6309\u5206\u7EC4\u9010\u9879\u52FE\u9009\uFF1B\u52FE\u9009\u72B6\u6001\u4FDD\u5B58\u5728\u529F\u80FD\u575E\u8BBE\u7F6E\u91CC\uFF0C\u6362\u6D4F\u89C8\u5668\u4E5F\u4E00\u81F4\u3002",
|
|
15709
|
+
"\u53D6\u6D88\u52FE\u9009\u5373\u5B8C\u5168\u64A4\u6389\u5BF9\u5E94\u5165\u53E3\uFF0C\u4E0D\u5F71\u54CD DSH \u539F\u6709\u529F\u80FD\u3002"
|
|
15710
|
+
),
|
|
15711
|
+
error ? import_react22.default.createElement("div", { className: "dkht-error" }, error) : null,
|
|
15712
|
+
store.error ? import_react22.default.createElement("div", { className: "dkht-error" }, store.error) : null,
|
|
15713
|
+
!store.ready && !store.error ? import_react22.default.createElement("div", { className: "dkht-empty" }, "\u6B63\u5728\u8BFB\u53D6\u914D\u7F6E\u2026") : null,
|
|
15714
|
+
groups.map((group) => import_react22.default.createElement(
|
|
15715
|
+
"div",
|
|
15716
|
+
{ className: "dkht-group", key: group.id },
|
|
15717
|
+
import_react22.default.createElement(
|
|
15718
|
+
"div",
|
|
15719
|
+
{ className: "dkht-group-head" },
|
|
15720
|
+
import_react22.default.createElement("span", { className: "dkht-group-name" }, group.name),
|
|
15721
|
+
group.description ? import_react22.default.createElement("span", { className: "dkht-group-desc" }, group.description) : null
|
|
15722
|
+
),
|
|
15723
|
+
group.items.map((item) => {
|
|
15724
|
+
const id = group.id + "/" + item.key;
|
|
15725
|
+
return import_react22.default.createElement(
|
|
15726
|
+
"label",
|
|
15727
|
+
{
|
|
15728
|
+
key: item.key,
|
|
15729
|
+
className: "dkht-item" + (item.value === true ? " on" : "") + (busy === id ? " busy" : "")
|
|
15730
|
+
},
|
|
15731
|
+
import_react22.default.createElement("input", {
|
|
15732
|
+
type: "checkbox",
|
|
15733
|
+
className: "dkht-check",
|
|
15734
|
+
checked: item.value === true,
|
|
15735
|
+
disabled: busy !== "",
|
|
15736
|
+
onChange: () => {
|
|
15737
|
+
void toggle(group, item);
|
|
15738
|
+
}
|
|
15739
|
+
}),
|
|
15740
|
+
import_react22.default.createElement(
|
|
15741
|
+
"span",
|
|
15742
|
+
{ className: "dkht-text" },
|
|
15743
|
+
import_react22.default.createElement("span", { className: "dkht-name" }, item.name),
|
|
15744
|
+
item.description ? import_react22.default.createElement("span", { className: "dkht-desc" }, item.description) : null
|
|
15745
|
+
)
|
|
15746
|
+
);
|
|
15747
|
+
})
|
|
15748
|
+
)),
|
|
15749
|
+
import_react22.default.createElement(
|
|
15750
|
+
"div",
|
|
15751
|
+
{ className: "dkht-note" },
|
|
15752
|
+
"\u540E\u7EED\u65B0\u589E\u7684 DSH \u589E\u5F3A\u80FD\u529B\u4F1A\u4EE5\u65B0\u5206\u7EC4/\u65B0\u52FE\u9009\u9879\u51FA\u73B0\u5728\u8FD9\u91CC\uFF0C\u65E0\u9700\u53E6\u5916\u914D\u7F6E\u3002"
|
|
15753
|
+
)
|
|
15754
|
+
);
|
|
15755
|
+
}
|
|
15756
|
+
var feature12 = {
|
|
15757
|
+
id: "dshtools",
|
|
15758
|
+
name: "DSH\u529F\u80FD",
|
|
15759
|
+
order: 170,
|
|
15760
|
+
accent: "#8b5cf6",
|
|
15761
|
+
description: "\u7ED9 DSH \u81EA\u5E26\u754C\u9762\u8865\u5145\u80FD\u529B\uFF08\u6587\u4EF6\u53F3\u952E\u7B49\uFF09\uFF0C\u6309\u5206\u7EC4\u52FE\u9009\u542F\u7528",
|
|
15762
|
+
defaultEnabled: true,
|
|
15763
|
+
css: CSS2,
|
|
15764
|
+
View: DshToolsView
|
|
15765
|
+
};
|
|
15766
|
+
|
|
15405
15767
|
// src/client.jsx
|
|
15406
|
-
var DOCK_VERSION = "0.
|
|
15407
|
-
var BUILTIN_FEATURES = [feature, feature2, feature3, feature11, feature4, feature5, feature6, feature7, feature8, feature9, feature10];
|
|
15768
|
+
var DOCK_VERSION = "0.24.0";
|
|
15769
|
+
var BUILTIN_FEATURES = [feature, feature2, feature3, feature11, feature4, feature5, feature6, feature7, feature8, feature9, feature10, feature12];
|
|
15408
15770
|
var PLANNED_FEATURES = [];
|
|
15409
15771
|
var PLANNED_NOTES = {};
|
|
15410
15772
|
var externalDefs = [];
|
|
@@ -15647,8 +16009,8 @@ function ensureCss() {
|
|
|
15647
16009
|
}
|
|
15648
16010
|
}
|
|
15649
16011
|
function useExternalVersion() {
|
|
15650
|
-
const [, bump] =
|
|
15651
|
-
|
|
16012
|
+
const [, bump] = import_react23.default.useReducer((n) => n + 1, 0);
|
|
16013
|
+
import_react23.default.useEffect(() => {
|
|
15652
16014
|
externalListeners.add(bump);
|
|
15653
16015
|
return () => {
|
|
15654
16016
|
externalListeners.delete(bump);
|
|
@@ -15658,25 +16020,25 @@ function useExternalVersion() {
|
|
|
15658
16020
|
var lastGeom = { x: null, y: null, w: null, h: null };
|
|
15659
16021
|
function DockIcon(props) {
|
|
15660
16022
|
const size = props && props.size || 16;
|
|
15661
|
-
return
|
|
16023
|
+
return import_react23.default.createElement(
|
|
15662
16024
|
"svg",
|
|
15663
16025
|
{ width: size, height: size, viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: 1.3, "aria-hidden": true },
|
|
15664
|
-
|
|
15665
|
-
|
|
15666
|
-
|
|
15667
|
-
|
|
16026
|
+
import_react23.default.createElement("rect", { x: 2.5, y: 2.5, width: 4.4, height: 4.4, rx: 1.2 }),
|
|
16027
|
+
import_react23.default.createElement("rect", { x: 9, y: 2.5, width: 4.4, height: 4.4, rx: 1.2 }),
|
|
16028
|
+
import_react23.default.createElement("rect", { x: 2.5, y: 9, width: 4.4, height: 4.4, rx: 1.2 }),
|
|
16029
|
+
import_react23.default.createElement("rect", { x: 9, y: 9, width: 4.4, height: 4.4, rx: 1.2 })
|
|
15668
16030
|
);
|
|
15669
16031
|
}
|
|
15670
16032
|
function DockWorkspace() {
|
|
15671
|
-
const [nav, setNav] =
|
|
15672
|
-
|
|
16033
|
+
const [nav, setNav] = import_react23.default.useState({ open: panelNav.open, active: panelNav.active, params: panelNav.params });
|
|
16034
|
+
import_react23.default.useEffect(() => subscribePanel(() => setNav({ open: panelNav.open, active: panelNav.active, params: panelNav.params })), []);
|
|
15673
16035
|
const active = nav.active;
|
|
15674
16036
|
const navParams = nav.params;
|
|
15675
16037
|
const setActive = navigatePanel;
|
|
15676
|
-
const [, force] =
|
|
16038
|
+
const [, force] = import_react23.default.useReducer((n) => n + 1, 0);
|
|
15677
16039
|
useExternalVersion();
|
|
15678
|
-
const contentRef =
|
|
15679
|
-
|
|
16040
|
+
const contentRef = import_react23.default.useRef(null);
|
|
16041
|
+
import_react23.default.useEffect(() => {
|
|
15680
16042
|
if (contentRef.current) contentRef.current.scrollTop = 0;
|
|
15681
16043
|
}, [active]);
|
|
15682
16044
|
const MODULES = allModules();
|
|
@@ -15684,26 +16046,26 @@ function DockWorkspace() {
|
|
|
15684
16046
|
const mod = isHome ? null : MODULES.find((m) => m.id === active) || MODULES[0];
|
|
15685
16047
|
const st = mod ? stateOf(mod.id) : null;
|
|
15686
16048
|
const View = mod ? mod.View : null;
|
|
15687
|
-
const viewNode = mod && View ?
|
|
16049
|
+
const viewNode = mod && View ? import_react23.default.createElement(
|
|
15688
16050
|
"div",
|
|
15689
16051
|
{ className: "dockm-view" },
|
|
15690
|
-
|
|
16052
|
+
import_react23.default.createElement(
|
|
15691
16053
|
FeatureBoundary,
|
|
15692
16054
|
{ key: mod.id, label: mod.name },
|
|
15693
|
-
|
|
16055
|
+
import_react23.default.createElement(View, { ctx: ctxRef.current, feature: mod, params: navParams })
|
|
15694
16056
|
)
|
|
15695
16057
|
) : null;
|
|
15696
16058
|
const enabledCount = MODULES.filter((m) => {
|
|
15697
16059
|
const s = stateOf(m.id);
|
|
15698
16060
|
return !!(s && s.enabled);
|
|
15699
16061
|
}).length;
|
|
15700
|
-
return
|
|
16062
|
+
return import_react23.default.createElement(
|
|
15701
16063
|
"div",
|
|
15702
16064
|
{ className: "dockm-body" },
|
|
15703
|
-
|
|
16065
|
+
import_react23.default.createElement(
|
|
15704
16066
|
"nav",
|
|
15705
16067
|
{ className: "dockm-nav", "aria-label": "\u529F\u80FD\u6A21\u5757" },
|
|
15706
|
-
|
|
16068
|
+
import_react23.default.createElement(
|
|
15707
16069
|
"button",
|
|
15708
16070
|
{
|
|
15709
16071
|
type: "button",
|
|
@@ -15711,10 +16073,10 @@ function DockWorkspace() {
|
|
|
15711
16073
|
className: "dockm-nav-item" + (isHome ? " on" : ""),
|
|
15712
16074
|
onClick: () => setActive("home")
|
|
15713
16075
|
},
|
|
15714
|
-
|
|
15715
|
-
|
|
16076
|
+
import_react23.default.createElement("span", { className: "dockm-navhome" }, import_react23.default.createElement(DockIcon, null)),
|
|
16077
|
+
import_react23.default.createElement("span", null, "\u9996\u9875")
|
|
15716
16078
|
),
|
|
15717
|
-
MODULES.map((m) =>
|
|
16079
|
+
MODULES.map((m) => import_react23.default.createElement(
|
|
15718
16080
|
"button",
|
|
15719
16081
|
{
|
|
15720
16082
|
type: "button",
|
|
@@ -15722,42 +16084,42 @@ function DockWorkspace() {
|
|
|
15722
16084
|
className: "dockm-nav-item" + (m.id === active ? " on" : ""),
|
|
15723
16085
|
onClick: () => setActive(m.id)
|
|
15724
16086
|
},
|
|
15725
|
-
|
|
15726
|
-
|
|
15727
|
-
m.planned ?
|
|
15728
|
-
m.external ?
|
|
16087
|
+
import_react23.default.createElement("span", { className: "dockm-dot", style: { background: m.accent } }),
|
|
16088
|
+
import_react23.default.createElement("span", null, m.name),
|
|
16089
|
+
m.planned ? import_react23.default.createElement("span", { className: "dockm-badge" }, "\u89C4\u5212\u4E2D") : null,
|
|
16090
|
+
m.external ? import_react23.default.createElement("span", { className: "dockm-badge" }, "\u5916\u90E8") : null
|
|
15729
16091
|
))
|
|
15730
16092
|
),
|
|
15731
|
-
|
|
16093
|
+
import_react23.default.createElement(
|
|
15732
16094
|
"div",
|
|
15733
16095
|
{ className: "dockm-content", ref: contentRef },
|
|
15734
|
-
|
|
16096
|
+
import_react23.default.createElement(
|
|
15735
16097
|
"div",
|
|
15736
16098
|
{ className: "dockm-content-head" },
|
|
15737
|
-
|
|
16099
|
+
import_react23.default.createElement(
|
|
15738
16100
|
"div",
|
|
15739
16101
|
{ className: "dockm-name" },
|
|
15740
|
-
isHome ?
|
|
16102
|
+
isHome ? import_react23.default.createElement("span", { className: "dockm-navhome" }, import_react23.default.createElement(DockIcon, null)) : import_react23.default.createElement("span", { className: "dockm-dot", style: { background: mod.accent } }),
|
|
15741
16103
|
isHome ? "\u9996\u9875" : mod.name,
|
|
15742
|
-
!isHome && mod.planned ?
|
|
15743
|
-
!isHome && mod.external ?
|
|
16104
|
+
!isHome && mod.planned ? import_react23.default.createElement("span", { className: "dockm-badge" }, "\u89C4\u5212\u4E2D") : null,
|
|
16105
|
+
!isHome && mod.external ? import_react23.default.createElement("span", { className: "dockm-badge" }, "\u5916\u90E8\u5305" + (mod.package ? " \xB7 " + mod.package : "")) : null
|
|
15744
16106
|
),
|
|
15745
|
-
|
|
16107
|
+
import_react23.default.createElement(
|
|
15746
16108
|
"div",
|
|
15747
16109
|
{ className: "dockm-desc" },
|
|
15748
16110
|
isHome ? "\u6240\u6709\u5B50\u529F\u80FD\u603B\u63FD\uFF1A\u8FD0\u884C\u72B6\u6001\u3001\u6982\u8981\u4E0E\u5FEB\u6377\u5F00\u5173\uFF0C\u70B9\u51FB\u5361\u7247\u8FDB\u5165\u5BF9\u5E94\u529F\u80FD\u9875\u3002" : mod.description
|
|
15749
16111
|
)
|
|
15750
16112
|
),
|
|
15751
|
-
isHome ?
|
|
15752
|
-
|
|
16113
|
+
isHome ? import_react23.default.createElement("div", { className: "dockm-view" }, import_react23.default.createElement(HomeView, { ctx: ctxRef.current, onOpen: setActive, onToggle: force })) : mod.planned ? import_react23.default.createElement("div", { className: "dockm-note" }, PLANNED_NOTES[mod.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : st && st.enabled && viewNode ? viewNode : st && st.error ? import_react23.default.createElement("div", { className: "dockm-note dockm-err" }, "\u529F\u80FD\u51FA\u9519\uFF1A" + st.error) : import_react23.default.createElement("div", { className: "dockm-note" }, "\u8BE5\u529F\u80FD\u5F53\u524D\u4E3A\u505C\u7528\u72B6\u6001\uFF08\u5F00\u5173\u5DF2\u6301\u4E45\u5316\uFF0C\u91CD\u542F\u540E\u4FDD\u6301\uFF09"),
|
|
16114
|
+
import_react23.default.createElement(
|
|
15753
16115
|
"div",
|
|
15754
16116
|
{ className: "dockm-foot" },
|
|
15755
|
-
|
|
15756
|
-
!isHome && mod && !mod.planned && st ?
|
|
16117
|
+
import_react23.default.createElement("span", null, isHome ? "\u529F\u80FD\u575E v" + DOCK_VERSION + " \xB7 \u5171 " + MODULES.length + " \u4E2A\u529F\u80FD\u6A21\u5757\uFF0C" + enabledCount + " \u4E2A\u5DF2\u542F\u7528" : "\u529F\u80FD\u575E v" + DOCK_VERSION + " \xB7 \u65B0\u529F\u80FD\u6309\u8DEF\u7EBF\u56FE\u8FFD\u52A0"),
|
|
16118
|
+
!isHome && mod && !mod.planned && st ? import_react23.default.createElement(
|
|
15757
16119
|
"span",
|
|
15758
16120
|
{ className: "dockm-foot-sw" },
|
|
15759
|
-
|
|
15760
|
-
|
|
16121
|
+
import_react23.default.createElement("span", { className: "dockm-foot-swlabel" + (st.enabled ? " on" : "") }, st.enabled ? "\u5DF2\u542F\u7528" : "\u5DF2\u505C\u7528"),
|
|
16122
|
+
import_react23.default.createElement("button", {
|
|
15761
16123
|
type: "button",
|
|
15762
16124
|
className: "dock-sw" + (st.enabled ? " on" : ""),
|
|
15763
16125
|
role: "switch",
|
|
@@ -15770,11 +16132,11 @@ function DockWorkspace() {
|
|
|
15770
16132
|
}
|
|
15771
16133
|
})
|
|
15772
16134
|
) : null,
|
|
15773
|
-
!isHome && mod && typeof mod.Chip === "function" ?
|
|
16135
|
+
!isHome && mod && typeof mod.Chip === "function" ? import_react23.default.createElement(
|
|
15774
16136
|
"span",
|
|
15775
16137
|
{ className: "dockm-foot-sw" },
|
|
15776
|
-
|
|
15777
|
-
|
|
16138
|
+
import_react23.default.createElement("span", { className: "dockm-foot-swlabel" + (chipShown(mod.id) ? " on" : "") }, "\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6"),
|
|
16139
|
+
import_react23.default.createElement("button", {
|
|
15778
16140
|
type: "button",
|
|
15779
16141
|
className: "dock-sw" + (chipShown(mod.id) ? " on" : ""),
|
|
15780
16142
|
role: "switch",
|
|
@@ -15792,12 +16154,12 @@ function DockWorkspace() {
|
|
|
15792
16154
|
);
|
|
15793
16155
|
}
|
|
15794
16156
|
function DockModal() {
|
|
15795
|
-
const [nav, setNav] =
|
|
15796
|
-
|
|
16157
|
+
const [nav, setNav] = import_react23.default.useState({ open: panelNav.open });
|
|
16158
|
+
import_react23.default.useEffect(() => subscribePanel(() => setNav({ open: panelNav.open })), []);
|
|
15797
16159
|
const open = nav.open || typeof document === "undefined";
|
|
15798
|
-
const [win, setWin] =
|
|
15799
|
-
const dlgRef =
|
|
15800
|
-
|
|
16160
|
+
const [win, setWin] = import_react23.default.useState(() => ({ mode: "normal", x: null, y: null, w: null, h: null }));
|
|
16161
|
+
const dlgRef = import_react23.default.useRef(null);
|
|
16162
|
+
import_react23.default.useEffect(() => {
|
|
15801
16163
|
if (lastGeom.w) setWin({ mode: "normal", x: lastGeom.x, y: lastGeom.y, w: lastGeom.w, h: lastGeom.h });
|
|
15802
16164
|
}, []);
|
|
15803
16165
|
function beginDrag(e, type) {
|
|
@@ -15837,10 +16199,10 @@ function DockModal() {
|
|
|
15837
16199
|
width: win.w != null ? win.w : void 0,
|
|
15838
16200
|
height: win.mode === "min" ? "auto" : win.h != null ? win.h : void 0
|
|
15839
16201
|
} : null;
|
|
15840
|
-
return
|
|
16202
|
+
return import_react23.default.createElement(
|
|
15841
16203
|
"div",
|
|
15842
16204
|
{ className: "dockm-backdrop", onClick: () => setPanelOpen(false) },
|
|
15843
|
-
|
|
16205
|
+
import_react23.default.createElement(
|
|
15844
16206
|
"div",
|
|
15845
16207
|
{
|
|
15846
16208
|
className: "dockm-dialog" + (win.mode === "max" ? " dockm-max" : "") + (win.mode === "min" ? " dockm-min" : ""),
|
|
@@ -15848,59 +16210,59 @@ function DockModal() {
|
|
|
15848
16210
|
ref: dlgRef,
|
|
15849
16211
|
onClick: (e) => e.stopPropagation()
|
|
15850
16212
|
},
|
|
15851
|
-
|
|
16213
|
+
import_react23.default.createElement(
|
|
15852
16214
|
"div",
|
|
15853
16215
|
{
|
|
15854
16216
|
className: "dockm-head",
|
|
15855
16217
|
onPointerDown: (e) => beginDrag(e, "move"),
|
|
15856
16218
|
onDoubleClick: () => setWin((s) => Object.assign({}, s, { mode: s.mode === "max" ? "normal" : "max" }))
|
|
15857
16219
|
},
|
|
15858
|
-
|
|
15859
|
-
|
|
15860
|
-
|
|
15861
|
-
|
|
16220
|
+
import_react23.default.createElement(DockIcon, null),
|
|
16221
|
+
import_react23.default.createElement("span", { className: "dockm-title" }, "\u529F\u80FD\u575E"),
|
|
16222
|
+
import_react23.default.createElement("span", { className: "dockm-sub" }, "dsh-dock \xB7 \u4E5F\u53EF\u5728 \u8BBE\u7F6E \u2192 \u529F\u80FD\u575E \u6253\u5F00\u7BA1\u7406\u9875"),
|
|
16223
|
+
import_react23.default.createElement(
|
|
15862
16224
|
"span",
|
|
15863
16225
|
{ className: "dockm-ctrls" },
|
|
15864
|
-
|
|
16226
|
+
import_react23.default.createElement("button", {
|
|
15865
16227
|
type: "button",
|
|
15866
16228
|
className: "dockm-win",
|
|
15867
16229
|
title: win.mode === "min" ? "\u8FD8\u539F" : "\u6700\u5C0F\u5316",
|
|
15868
16230
|
onClick: () => setWin((s) => Object.assign({}, s, { mode: s.mode === "min" ? "normal" : "min" }))
|
|
15869
16231
|
}, "\u2581"),
|
|
15870
|
-
|
|
16232
|
+
import_react23.default.createElement("button", {
|
|
15871
16233
|
type: "button",
|
|
15872
16234
|
className: "dockm-win",
|
|
15873
16235
|
title: win.mode === "max" ? "\u8FD8\u539F" : "\u6700\u5927\u5316",
|
|
15874
16236
|
onClick: () => setWin((s) => Object.assign({}, s, { mode: s.mode === "max" ? "normal" : "max" }))
|
|
15875
16237
|
}, win.mode === "max" ? "\u2750" : "\u25A2"),
|
|
15876
|
-
|
|
16238
|
+
import_react23.default.createElement("button", { type: "button", className: "dockm-close", "aria-label": "\u5173\u95ED", title: "\u5173\u95ED", onClick: () => setPanelOpen(false) }, "\u2715")
|
|
15877
16239
|
)
|
|
15878
16240
|
),
|
|
15879
|
-
|
|
15880
|
-
win.mode === "normal" ?
|
|
16241
|
+
import_react23.default.createElement(DockWorkspace, null),
|
|
16242
|
+
win.mode === "normal" ? import_react23.default.createElement("div", { className: "dockm-resize", onPointerDown: (e) => beginDrag(e, "size") }) : null
|
|
15881
16243
|
)
|
|
15882
16244
|
);
|
|
15883
16245
|
}
|
|
15884
16246
|
function HomeView(props) {
|
|
15885
16247
|
const ctx = props && props.ctx;
|
|
15886
|
-
const [, force] =
|
|
16248
|
+
const [, force] = import_react23.default.useReducer((n) => n + 1, 0);
|
|
15887
16249
|
useExternalVersion();
|
|
15888
16250
|
const open = (id) => {
|
|
15889
16251
|
if (props && typeof props.onOpen === "function") props.onOpen(id);
|
|
15890
16252
|
};
|
|
15891
|
-
return
|
|
16253
|
+
return import_react23.default.createElement(
|
|
15892
16254
|
"div",
|
|
15893
16255
|
{ className: "dockh-grid" },
|
|
15894
16256
|
allModules().map((m) => {
|
|
15895
16257
|
const st = stateOf(m.id);
|
|
15896
16258
|
const enabled = !!(st && st.enabled);
|
|
15897
16259
|
const Stat = m.HomeStat;
|
|
15898
|
-
const statNode = m.planned ?
|
|
16260
|
+
const statNode = m.planned ? import_react23.default.createElement("span", null, PLANNED_NOTES[m.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : enabled && Stat ? import_react23.default.createElement(
|
|
15899
16261
|
FeatureBoundary,
|
|
15900
16262
|
{ key: m.id, label: m.name },
|
|
15901
|
-
|
|
15902
|
-
) :
|
|
15903
|
-
return
|
|
16263
|
+
import_react23.default.createElement(Stat, { ctx })
|
|
16264
|
+
) : import_react23.default.createElement("span", null, "\u5DF2\u505C\u7528\uFF0C\u542F\u7528\u540E\u5728\u6B64\u5C55\u793A\u8FD0\u884C\u6982\u8981");
|
|
16265
|
+
return import_react23.default.createElement(
|
|
15904
16266
|
"div",
|
|
15905
16267
|
{
|
|
15906
16268
|
key: m.id,
|
|
@@ -15915,21 +16277,21 @@ function HomeView(props) {
|
|
|
15915
16277
|
}
|
|
15916
16278
|
}
|
|
15917
16279
|
},
|
|
15918
|
-
|
|
16280
|
+
import_react23.default.createElement(
|
|
15919
16281
|
"div",
|
|
15920
16282
|
{ className: "dockh-head" },
|
|
15921
|
-
|
|
15922
|
-
|
|
15923
|
-
m.external ?
|
|
16283
|
+
import_react23.default.createElement("span", { className: "dockm-dot", style: { background: m.accent } }),
|
|
16284
|
+
import_react23.default.createElement("span", { className: "dockh-name" }, m.name),
|
|
16285
|
+
m.external ? import_react23.default.createElement("span", { className: "dockh-badge", title: m.package || void 0 }, "\u5916\u90E8") : null,
|
|
15924
16286
|
// 状态标识:圆点 + 文字(纯展示,与开关视觉区分)
|
|
15925
|
-
|
|
16287
|
+
import_react23.default.createElement(
|
|
15926
16288
|
"span",
|
|
15927
16289
|
{ className: "dockh-status" + (m.planned ? " plan" : enabled ? "" : " off") },
|
|
15928
|
-
|
|
15929
|
-
|
|
16290
|
+
import_react23.default.createElement("span", { className: "dockh-sdot" }),
|
|
16291
|
+
import_react23.default.createElement("span", null, m.planned ? "\u89C4\u5212\u4E2D" : enabled ? "\u8FD0\u884C\u4E2D" : "\u5DF2\u505C\u7528")
|
|
15930
16292
|
),
|
|
15931
16293
|
// 启停开关(规划中的功能不显示)
|
|
15932
|
-
m.planned ? null :
|
|
16294
|
+
m.planned ? null : import_react23.default.createElement("button", {
|
|
15933
16295
|
type: "button",
|
|
15934
16296
|
className: "dock-sw" + (enabled ? " on" : ""),
|
|
15935
16297
|
role: "switch",
|
|
@@ -15944,12 +16306,12 @@ function HomeView(props) {
|
|
|
15944
16306
|
}
|
|
15945
16307
|
})
|
|
15946
16308
|
),
|
|
15947
|
-
|
|
15948
|
-
|
|
15949
|
-
|
|
16309
|
+
import_react23.default.createElement("div", { className: "dockh-desc" }, m.description),
|
|
16310
|
+
import_react23.default.createElement("div", { className: "dockh-stat" }, statNode),
|
|
16311
|
+
import_react23.default.createElement(
|
|
15950
16312
|
"div",
|
|
15951
16313
|
{ className: "dockh-foot" },
|
|
15952
|
-
|
|
16314
|
+
import_react23.default.createElement("span", { className: "dockh-go" }, "\u67E5\u770B\u8BE6\u60C5 \u2192")
|
|
15953
16315
|
)
|
|
15954
16316
|
);
|
|
15955
16317
|
})
|
|
@@ -15957,16 +16319,16 @@ function HomeView(props) {
|
|
|
15957
16319
|
}
|
|
15958
16320
|
function DockPanel(props) {
|
|
15959
16321
|
const ctx = ctxRef.current;
|
|
15960
|
-
const [, force] =
|
|
16322
|
+
const [, force] = import_react23.default.useReducer((n) => n + 1, 0);
|
|
15961
16323
|
useExternalVersion();
|
|
15962
16324
|
const toggle = (id) => {
|
|
15963
16325
|
toggleFeature(id);
|
|
15964
16326
|
force();
|
|
15965
16327
|
};
|
|
15966
|
-
return
|
|
16328
|
+
return import_react23.default.createElement(
|
|
15967
16329
|
"div",
|
|
15968
16330
|
{ className: "dock-root" },
|
|
15969
|
-
|
|
16331
|
+
import_react23.default.createElement(
|
|
15970
16332
|
"div",
|
|
15971
16333
|
{ className: "dock-intro" },
|
|
15972
16334
|
"\u529F\u80FD\u575E\uFF08dsh-dock\uFF09\xB7 \u6240\u6709\u5C0F\u529F\u80FD\u96C6\u4E2D\u5728\u8FD9\u4E00\u4E2A\u9762\u677F\u91CC\u7BA1\u7406\u3002v0.4.0 \u8D77\u6BCF\u4E2A\u529F\u80FD\u662F\u72EC\u7ACB\u6A21\u5757\uFF08features/<id>/\uFF09\uFF0C",
|
|
@@ -15975,25 +16337,25 @@ function DockPanel(props) {
|
|
|
15975
16337
|
allModules().map((f) => {
|
|
15976
16338
|
const st = stateOf(f.id);
|
|
15977
16339
|
const View = f.View;
|
|
15978
|
-
const viewNode = !f.planned && st.enabled && View ?
|
|
16340
|
+
const viewNode = !f.planned && st.enabled && View ? import_react23.default.createElement(
|
|
15979
16341
|
"div",
|
|
15980
16342
|
{ className: "dock-body" },
|
|
15981
|
-
|
|
16343
|
+
import_react23.default.createElement(
|
|
15982
16344
|
FeatureBoundary,
|
|
15983
16345
|
{ key: f.id, label: f.name },
|
|
15984
|
-
|
|
16346
|
+
import_react23.default.createElement(View, { ctx, feature: f, params: props && props.params })
|
|
15985
16347
|
)
|
|
15986
16348
|
) : null;
|
|
15987
|
-
return
|
|
16349
|
+
return import_react23.default.createElement(
|
|
15988
16350
|
"div",
|
|
15989
16351
|
{ className: "dock-card", key: f.id },
|
|
15990
|
-
|
|
16352
|
+
import_react23.default.createElement(
|
|
15991
16353
|
"div",
|
|
15992
16354
|
{ className: "dock-card-head" },
|
|
15993
|
-
|
|
15994
|
-
|
|
15995
|
-
|
|
15996
|
-
f.planned ?
|
|
16355
|
+
import_react23.default.createElement("span", { className: "dock-dot" + (st.error ? " err" : st.enabled ? " on" : "") }),
|
|
16356
|
+
import_react23.default.createElement("span", { className: "dock-name" }, f.name),
|
|
16357
|
+
import_react23.default.createElement("span", { className: "dock-desc" }, f.description + (f.external ? "\uFF08\u6765\u81EA\u5916\u90E8\u5305" + (f.package ? " " + f.package : "") + "\uFF09" : "")),
|
|
16358
|
+
f.planned ? import_react23.default.createElement("span", { className: "dock-badge" }, "\u89C4\u5212\u4E2D") : import_react23.default.createElement("button", {
|
|
15997
16359
|
type: "button",
|
|
15998
16360
|
className: "dock-sw" + (st.enabled ? " on" : ""),
|
|
15999
16361
|
role: "switch",
|
|
@@ -16002,11 +16364,11 @@ function DockPanel(props) {
|
|
|
16002
16364
|
title: st.enabled ? "\u505C\u7528\u300C" + f.name + "\u300D" : "\u542F\u7528\u300C" + f.name + "\u300D",
|
|
16003
16365
|
onClick: () => toggle(f.id)
|
|
16004
16366
|
}),
|
|
16005
|
-
!f.planned && typeof f.Chip === "function" ?
|
|
16367
|
+
!f.planned && typeof f.Chip === "function" ? import_react23.default.createElement(
|
|
16006
16368
|
"span",
|
|
16007
16369
|
{ className: "dockm-foot-sw" },
|
|
16008
|
-
|
|
16009
|
-
|
|
16370
|
+
import_react23.default.createElement("span", { className: "dockm-foot-swlabel" + (chipShown(f.id) ? " on" : "") }, "\u4F1A\u8BDD\u9875\u5C0F\u63A7\u4EF6"),
|
|
16371
|
+
import_react23.default.createElement("button", {
|
|
16010
16372
|
type: "button",
|
|
16011
16373
|
className: "dock-sw" + (chipShown(f.id) ? " on" : ""),
|
|
16012
16374
|
role: "switch",
|
|
@@ -16020,7 +16382,7 @@ function DockPanel(props) {
|
|
|
16020
16382
|
})
|
|
16021
16383
|
) : null
|
|
16022
16384
|
),
|
|
16023
|
-
f.planned ?
|
|
16385
|
+
f.planned ? import_react23.default.createElement("div", { className: "dock-body" }, PLANNED_NOTES[f.id] || "\u5F85\u63A5\u5165\uFF1A\u89C1 README \u8DEF\u7EBF\u56FE") : st.error ? import_react23.default.createElement("div", { className: "dock-body dockm-err" }, "\u529F\u80FD\u51FA\u9519\uFF1A" + st.error) : null,
|
|
16024
16386
|
viewNode
|
|
16025
16387
|
);
|
|
16026
16388
|
})
|
|
@@ -16028,7 +16390,7 @@ function DockPanel(props) {
|
|
|
16028
16390
|
}
|
|
16029
16391
|
function DockPage() {
|
|
16030
16392
|
const ctx = ctxRef.current;
|
|
16031
|
-
const [wide, setWide] =
|
|
16393
|
+
const [wide, setWide] = import_react23.default.useState(false);
|
|
16032
16394
|
const toggleWide = () => {
|
|
16033
16395
|
try {
|
|
16034
16396
|
const layout = ctx && typeof ctx.get === "function" ? ctx.get("layout") : null;
|
|
@@ -16039,20 +16401,20 @@ function DockPage() {
|
|
|
16039
16401
|
} catch (e) {
|
|
16040
16402
|
}
|
|
16041
16403
|
};
|
|
16042
|
-
return
|
|
16404
|
+
return import_react23.default.createElement(
|
|
16043
16405
|
"div",
|
|
16044
16406
|
{ className: "dockm-page" + (wide ? " dockm-page-wide" : "") },
|
|
16045
|
-
|
|
16407
|
+
import_react23.default.createElement(
|
|
16046
16408
|
"div",
|
|
16047
16409
|
{ className: "dockm-page-head" },
|
|
16048
|
-
|
|
16049
|
-
|
|
16410
|
+
import_react23.default.createElement("span", { className: "dockm-page-icon" }, import_react23.default.createElement(DockIcon, { size: 20 })),
|
|
16411
|
+
import_react23.default.createElement(
|
|
16050
16412
|
"div",
|
|
16051
16413
|
{ className: "dockm-page-titles" },
|
|
16052
|
-
|
|
16053
|
-
|
|
16414
|
+
import_react23.default.createElement("div", { className: "dockm-page-title" }, "\u529F\u80FD\u575E"),
|
|
16415
|
+
import_react23.default.createElement("div", { className: "dockm-page-sub" }, "\u6240\u6709\u5C0F\u529F\u80FD\u96C6\u4E2D\u5728\u8FD9\u91CC\u7BA1\u7406\u3002\u4FA7\u680F\u56FE\u6807\u53EF\u5728\u300C\u66F4\u591A\u300D\u83DC\u5355\u91CC Pin \u5230\u9876\u90E8\uFF0C\u6216\u53D6\u6D88\u56FA\u5B9A\u6536\u8FDB\u66F4\u591A\u3002")
|
|
16054
16416
|
),
|
|
16055
|
-
|
|
16417
|
+
import_react23.default.createElement("button", {
|
|
16056
16418
|
type: "button",
|
|
16057
16419
|
className: "dockm-page-wide-btn",
|
|
16058
16420
|
title: wide ? "\u8FD8\u539F\u4FA7\u680F\u5BBD\u5EA6" : "\u6536\u8D77\u5DE6\u4FA7\u680F\uFF0C\u5168\u5C4F\u663E\u793A\u529F\u80FD\u575E",
|
|
@@ -16060,19 +16422,19 @@ function DockPage() {
|
|
|
16060
16422
|
onClick: toggleWide
|
|
16061
16423
|
}, wide ? "\u2750 \u8FD8\u539F" : "\u25A2 \u5168\u5C4F")
|
|
16062
16424
|
),
|
|
16063
|
-
|
|
16425
|
+
import_react23.default.createElement("div", { className: "dockm-page-body" }, import_react23.default.createElement(DockWorkspace, null))
|
|
16064
16426
|
);
|
|
16065
16427
|
}
|
|
16066
16428
|
function DockChips(props) {
|
|
16067
|
-
const [, force] =
|
|
16068
|
-
|
|
16429
|
+
const [, force] = import_react23.default.useReducer((n) => n + 1, 0);
|
|
16430
|
+
import_react23.default.useEffect(() => subscribeFeatureState(() => force()), []);
|
|
16069
16431
|
const items = [];
|
|
16070
16432
|
for (const f of allModules()) {
|
|
16071
16433
|
if (f.planned || !stateOf(f.id).enabled || !chipShown(f.id) || typeof f.Chip !== "function") continue;
|
|
16072
|
-
items.push(
|
|
16434
|
+
items.push(import_react23.default.createElement(
|
|
16073
16435
|
FeatureBoundary,
|
|
16074
16436
|
{ key: f.id, label: f.name },
|
|
16075
|
-
|
|
16437
|
+
import_react23.default.createElement(f.Chip, {
|
|
16076
16438
|
ctx: props.ctx,
|
|
16077
16439
|
feature: f,
|
|
16078
16440
|
session: props.session,
|
|
@@ -16082,38 +16444,38 @@ function DockChips(props) {
|
|
|
16082
16444
|
));
|
|
16083
16445
|
}
|
|
16084
16446
|
if (items.length === 0) return null;
|
|
16085
|
-
return
|
|
16447
|
+
return import_react23.default.createElement("div", { className: "dockchip-row" }, items);
|
|
16086
16448
|
}
|
|
16087
16449
|
function FeatureOverlays() {
|
|
16088
|
-
const [, force] =
|
|
16450
|
+
const [, force] = import_react23.default.useReducer((n) => n + 1, 0);
|
|
16089
16451
|
useExternalVersion();
|
|
16090
|
-
|
|
16452
|
+
import_react23.default.useEffect(() => subscribeFeatureState(() => force()), []);
|
|
16091
16453
|
const items = [];
|
|
16092
16454
|
for (const f of allModules()) {
|
|
16093
16455
|
if (f.planned || !stateOf(f.id).enabled || typeof f.Overlay !== "function") continue;
|
|
16094
|
-
items.push(
|
|
16456
|
+
items.push(import_react23.default.createElement(
|
|
16095
16457
|
FeatureBoundary,
|
|
16096
16458
|
{ key: f.id, label: f.name },
|
|
16097
|
-
|
|
16459
|
+
import_react23.default.createElement(f.Overlay, { ctx: ctxRef.current, feature: f })
|
|
16098
16460
|
));
|
|
16099
16461
|
}
|
|
16100
16462
|
if (items.length === 0) return null;
|
|
16101
|
-
return
|
|
16463
|
+
return import_react23.default.createElement(import_react23.default.Fragment, null, items);
|
|
16102
16464
|
}
|
|
16103
16465
|
function FeatureTurnTail(props) {
|
|
16104
|
-
const [, force] =
|
|
16105
|
-
|
|
16466
|
+
const [, force] = import_react23.default.useReducer((n) => n + 1, 0);
|
|
16467
|
+
import_react23.default.useEffect(() => subscribeFeatureState(() => force()), []);
|
|
16106
16468
|
const items = [];
|
|
16107
16469
|
for (const f of allModules()) {
|
|
16108
16470
|
if (f.planned || !stateOf(f.id).enabled || typeof f.TurnTail !== "function") continue;
|
|
16109
|
-
items.push(
|
|
16471
|
+
items.push(import_react23.default.createElement(
|
|
16110
16472
|
FeatureBoundary,
|
|
16111
16473
|
{ key: f.id, label: f.name },
|
|
16112
|
-
|
|
16474
|
+
import_react23.default.createElement(f.TurnTail, Object.assign({}, props, { ctx: ctxRef.current, feature: f }))
|
|
16113
16475
|
));
|
|
16114
16476
|
}
|
|
16115
16477
|
if (items.length === 0) return null;
|
|
16116
|
-
return
|
|
16478
|
+
return import_react23.default.createElement(import_react23.default.Fragment, null, items);
|
|
16117
16479
|
}
|
|
16118
16480
|
var ctxRef = { current: null };
|
|
16119
16481
|
function apply(ctx) {
|
|
@@ -16124,32 +16486,33 @@ function apply(ctx) {
|
|
|
16124
16486
|
if (slots === void 0) return;
|
|
16125
16487
|
slots.inject("sidebar.panellist", () => slots.register(
|
|
16126
16488
|
{ name: "sidebar.panellist", id: "dsh-dock", order: 30, label: "\u529F\u80FD\u575E" },
|
|
16127
|
-
(props) =>
|
|
16489
|
+
(props) => import_react23.default.createElement(DockIcon, { size: props && props.size || 18 })
|
|
16128
16490
|
));
|
|
16129
16491
|
slots.inject("main", () => slots.register(
|
|
16130
16492
|
{ name: "main", key: "dsh-dock", label: "\u529F\u80FD\u575E" },
|
|
16131
|
-
() =>
|
|
16493
|
+
() => import_react23.default.createElement(DockPage, null)
|
|
16132
16494
|
));
|
|
16133
16495
|
slots.inject("shell.overlay", () => slots.register(
|
|
16134
16496
|
{ name: "shell.overlay", id: "dsh-dock-panel", order: 21, label: "\u529F\u80FD\u575E\u9762\u677F" },
|
|
16135
|
-
() =>
|
|
16497
|
+
() => import_react23.default.createElement(DockModal, null)
|
|
16136
16498
|
));
|
|
16137
16499
|
slots.inject("shell.overlay", () => slots.register(
|
|
16138
16500
|
{ name: "shell.overlay", id: "dsh-dock-feature-overlays", order: 22, label: "\u529F\u80FD\u575E\u5168\u5C40\u6D6E\u5C42" },
|
|
16139
|
-
() =>
|
|
16501
|
+
() => import_react23.default.createElement(FeatureOverlays, null)
|
|
16140
16502
|
));
|
|
16141
16503
|
slots.inject("settings.section", () => slots.register(
|
|
16142
16504
|
{ name: "settings.section", id: "dsh-dock", order: 90, label: "\u529F\u80FD\u575E" },
|
|
16143
|
-
(props) =>
|
|
16505
|
+
(props) => import_react23.default.createElement(DockPanel, props)
|
|
16144
16506
|
));
|
|
16145
16507
|
slots.inject("conversation.input.left", () => slots.register(
|
|
16146
16508
|
{ name: "conversation.input.left", id: "dsh-dock-chips", order: 10, label: "\u529F\u80FD\u575E" },
|
|
16147
|
-
(zone) =>
|
|
16509
|
+
(zone) => import_react23.default.createElement(DockChips, Object.assign({}, zone, { ctx: ctxRef.current }))
|
|
16148
16510
|
));
|
|
16149
16511
|
slots.inject("conversation.chat.turnTail", () => slots.register(
|
|
16150
16512
|
{ name: "conversation.chat.turnTail", id: "dsh-dock-turn-tail", order: 40, label: "\u529F\u80FD\u575E" },
|
|
16151
|
-
(owner) =>
|
|
16513
|
+
(owner) => import_react23.default.createElement(FeatureTurnTail, owner)
|
|
16152
16514
|
));
|
|
16515
|
+
installClient(ctx);
|
|
16153
16516
|
}
|
|
16154
16517
|
var inject = ["timer"];
|
|
16155
16518
|
|