@lemoncat7/dsh-partner 2.7.3 → 2.7.5
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 +1 -1
- package/docs/releases/2.7.4.md +12 -0
- package/docs/releases/2.7.5.md +9 -0
- package/docs/weixin-recovery.md +14 -0
- package/lib/api.d.ts.map +1 -1
- package/lib/api.js +15 -17
- package/lib/api.js.map +1 -1
- package/lib/channels/direct/message-format.js +127 -127
- package/lib/channels/direct/message-format.js.map +1 -1
- package/lib/channels/manager.d.ts.map +1 -1
- package/lib/channels/manager.js +6 -0
- package/lib/channels/manager.js.map +1 -1
- package/lib/channels/weixin/connect.d.ts +26 -0
- package/lib/channels/weixin/connect.d.ts.map +1 -0
- package/lib/channels/weixin/connect.js +57 -0
- package/lib/channels/weixin/connect.js.map +1 -0
- package/lib/channels/weixin/login.d.ts +6 -1
- package/lib/channels/weixin/login.d.ts.map +1 -1
- package/lib/channels/weixin/login.js +48 -6
- package/lib/channels/weixin/login.js.map +1 -1
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +713 -603
- package/lib/client.js.map +4 -4
- package/lib/companions/removal.d.ts +1 -0
- package/lib/companions/removal.d.ts.map +1 -1
- package/lib/companions/removal.js +5 -1
- package/lib/companions/removal.js.map +1 -1
- package/lib/ui/companion-deletion.d.ts +8 -0
- package/lib/ui/companion-deletion.d.ts.map +1 -0
- package/lib/ui/companion-deletion.js +43 -0
- package/lib/ui/companion-deletion.js.map +1 -0
- package/lib/ui/identity-editor.d.ts +0 -2
- package/lib/ui/identity-editor.d.ts.map +1 -1
- package/lib/ui/identity-editor.js +6 -37
- package/lib/ui/identity-editor.js.map +1 -1
- package/package.json +4 -1
package/lib/client.js
CHANGED
|
@@ -35,7 +35,7 @@ __export(client_exports, {
|
|
|
35
35
|
inject: () => inject
|
|
36
36
|
});
|
|
37
37
|
module.exports = __toCommonJS(client_exports);
|
|
38
|
-
var
|
|
38
|
+
var import_react52 = require("react");
|
|
39
39
|
|
|
40
40
|
// src/workspace-ownership.ts
|
|
41
41
|
var WORKSPACE_ACTIVATE_EVENT = "@lemoncat7/dsh-plugin-ui/workspace-activate";
|
|
@@ -54,9 +54,9 @@ function observePluginWorkspace(pluginId, close) {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
// src/client.tsx
|
|
57
|
-
var
|
|
57
|
+
var import_dsh_client_ui_primitives25 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
58
58
|
|
|
59
|
-
// node_modules/qrcode.react/lib/esm/index.js
|
|
59
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/qrcode.react/lib/esm/index.js
|
|
60
60
|
var import_react = __toESM(require("react"), 1);
|
|
61
61
|
var __defProp2 = Object.defineProperty;
|
|
62
62
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
@@ -2043,6 +2043,14 @@ body[data-ds-dark-theme] .dsh-partner-workspace {
|
|
|
2043
2043
|
.dsh-partner-qr button { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 11px; border: 1px solid var(--partner-border); border-radius: 9px; color: inherit; background: var(--partner-raised); cursor: pointer; }
|
|
2044
2044
|
.dsh-partner-channel-card { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto auto; align-items: center; gap: 14px; padding: 15px; border: 1px solid var(--partner-border); border-radius: 14px; background: color-mix(in srgb, var(--partner-raised) 72%, transparent); }
|
|
2045
2045
|
.dsh-partner-channel-card > span:nth-child(2) { display: grid; gap: 3px; }
|
|
2046
|
+
.dsh-partner-weixin-actions { display: flex; align-items: center; gap: 12px; }
|
|
2047
|
+
.dsh-partner-weixin-actions > .dsh-partner-switch { flex: none; }
|
|
2048
|
+
.dsh-partner-weixin-actions > .dsh-partner-weixin-rescan { display: inline-flex; align-items: center; justify-content: center; gap: 5px; min-height: 32px; padding: 5px 9px; border: 1px solid var(--partner-border); border-radius: 9px; background: transparent; color: var(--partner-text-secondary); font: inherit; font-size: var(--partner-font-caption); white-space: nowrap; cursor: pointer; }
|
|
2049
|
+
.dsh-partner-weixin-actions > .dsh-partner-weixin-rescan:hover:not(:disabled) { background: var(--partner-raised); color: var(--partner-text); }
|
|
2050
|
+
.dsh-partner-weixin-actions > .dsh-partner-weixin-rescan:disabled { opacity: .5; cursor: wait; }
|
|
2051
|
+
.dsh-partner-weixin-help { margin: 8px 0 0; color: var(--partner-text-secondary); font-size: var(--partner-font-caption); line-height: 1.6; }
|
|
2052
|
+
.dsh-partner-overview-delete { display: flex; justify-content: flex-end; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
|
|
2053
|
+
.dsh-partner-overview-delete > button { display: inline-flex; align-items: center; gap: 6px; }
|
|
2046
2054
|
.dsh-partner-channel-card strong { font-size: var(--partner-font-label); }
|
|
2047
2055
|
.dsh-partner-channel-card p { margin: 0; color: var(--partner-text-tertiary); font: var(--partner-font-caption)/1.4 ui-monospace, monospace; }
|
|
2048
2056
|
.dsh-partner-switch { position: relative; width: 38px; height: 22px; padding: 0; border: 1px solid var(--partner-border); border-radius: 999px; background: color-mix(in srgb, var(--partner-text) 9%, transparent); cursor: pointer; transition: background .16s ease; }
|
|
@@ -2736,6 +2744,8 @@ body[data-ds-dark-theme] .dsh-partner-workspace {
|
|
|
2736
2744
|
.dsh-partner-qr > span { justify-items: center; }
|
|
2737
2745
|
.dsh-partner-channel-card { grid-template-columns: 45px minmax(0, 1fr) auto; }
|
|
2738
2746
|
.dsh-partner-channel-card > .dsh-partner-status { display: none; }
|
|
2747
|
+
.dsh-partner-channel-card:has(> .dsh-partner-weixin-actions) { grid-template-columns: 45px minmax(0, 1fr); }
|
|
2748
|
+
.dsh-partner-weixin-actions { grid-column: 1 / -1; justify-content: flex-end; }
|
|
2739
2749
|
.dsh-partner-library-header { display: grid; gap: 0; }
|
|
2740
2750
|
.dsh-partner-library-header nav { min-height: 38px; }
|
|
2741
2751
|
.dsh-partner-library-tools { display: grid; }
|
|
@@ -5779,7 +5789,7 @@ var import_dsh_client_ui_primitives9 = require("@deepseek-ai/dsh-client-ui-primi
|
|
|
5779
5789
|
// src/pendant/markdown.tsx
|
|
5780
5790
|
var import_react23 = __toESM(require("react"), 1);
|
|
5781
5791
|
|
|
5782
|
-
// node_modules/mdast-util-to-string/lib/index.js
|
|
5792
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/mdast-util-to-string/lib/index.js
|
|
5783
5793
|
var emptyOptions = {};
|
|
5784
5794
|
function toString(value, options) {
|
|
5785
5795
|
const settings = options || emptyOptions;
|
|
@@ -5816,7 +5826,7 @@ function node(value) {
|
|
|
5816
5826
|
return Boolean(value && typeof value === "object");
|
|
5817
5827
|
}
|
|
5818
5828
|
|
|
5819
|
-
// node_modules/decode-named-character-reference/index.dom.js
|
|
5829
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/decode-named-character-reference/index.dom.js
|
|
5820
5830
|
var element = document.createElement("i");
|
|
5821
5831
|
function decodeNamedCharacterReference(value) {
|
|
5822
5832
|
const characterReference2 = "&" + value + ";";
|
|
@@ -5828,7 +5838,7 @@ function decodeNamedCharacterReference(value) {
|
|
|
5828
5838
|
return character === characterReference2 ? false : character;
|
|
5829
5839
|
}
|
|
5830
5840
|
|
|
5831
|
-
// node_modules/micromark-util-chunked/index.js
|
|
5841
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-util-chunked/index.js
|
|
5832
5842
|
function splice(list2, start, remove, items) {
|
|
5833
5843
|
const end = list2.length;
|
|
5834
5844
|
let chunkStart = 0;
|
|
@@ -5862,7 +5872,7 @@ function push(list2, items) {
|
|
|
5862
5872
|
return items;
|
|
5863
5873
|
}
|
|
5864
5874
|
|
|
5865
|
-
// node_modules/micromark-util-combine-extensions/index.js
|
|
5875
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-util-combine-extensions/index.js
|
|
5866
5876
|
var hasOwnProperty = {}.hasOwnProperty;
|
|
5867
5877
|
function combineExtensions(extensions) {
|
|
5868
5878
|
const all2 = {};
|
|
@@ -5902,7 +5912,7 @@ function constructs(existing, list2) {
|
|
|
5902
5912
|
splice(existing, 0, 0, before);
|
|
5903
5913
|
}
|
|
5904
5914
|
|
|
5905
|
-
// node_modules/micromark-util-decode-numeric-character-reference/index.js
|
|
5915
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-util-decode-numeric-character-reference/index.js
|
|
5906
5916
|
function decodeNumericCharacterReference(value, base) {
|
|
5907
5917
|
const code2 = Number.parseInt(value, base);
|
|
5908
5918
|
if (
|
|
@@ -5920,12 +5930,12 @@ function decodeNumericCharacterReference(value, base) {
|
|
|
5920
5930
|
return String.fromCodePoint(code2);
|
|
5921
5931
|
}
|
|
5922
5932
|
|
|
5923
|
-
// node_modules/micromark-util-normalize-identifier/index.js
|
|
5933
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-util-normalize-identifier/index.js
|
|
5924
5934
|
function normalizeIdentifier(value) {
|
|
5925
5935
|
return value.replace(/[\t\n\r ]+/g, " ").replace(/^ | $/g, "").toLowerCase().toUpperCase();
|
|
5926
5936
|
}
|
|
5927
5937
|
|
|
5928
|
-
// node_modules/micromark-util-character/index.js
|
|
5938
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-util-character/index.js
|
|
5929
5939
|
var asciiAlpha = regexCheck(/[A-Za-z]/);
|
|
5930
5940
|
var asciiAlphanumeric = regexCheck(/[\dA-Za-z]/);
|
|
5931
5941
|
var asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/);
|
|
@@ -5957,7 +5967,7 @@ function regexCheck(regex) {
|
|
|
5957
5967
|
}
|
|
5958
5968
|
}
|
|
5959
5969
|
|
|
5960
|
-
// node_modules/micromark-factory-space/index.js
|
|
5970
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-factory-space/index.js
|
|
5961
5971
|
function factorySpace(effects, ok3, type, max) {
|
|
5962
5972
|
const limit = max ? max - 1 : Infinity;
|
|
5963
5973
|
let size2 = 0;
|
|
@@ -6002,7 +6012,7 @@ function factorySpaceMinMax(effects, ok3, nok, type, min, max) {
|
|
|
6002
6012
|
}
|
|
6003
6013
|
}
|
|
6004
6014
|
|
|
6005
|
-
// node_modules/micromark/lib/initialize/content.js
|
|
6015
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark/lib/initialize/content.js
|
|
6006
6016
|
var content = {
|
|
6007
6017
|
tokenize: initializeContent
|
|
6008
6018
|
};
|
|
@@ -6052,7 +6062,7 @@ function initializeContent(effects) {
|
|
|
6052
6062
|
}
|
|
6053
6063
|
}
|
|
6054
6064
|
|
|
6055
|
-
// node_modules/micromark-util-edit-map/index.js
|
|
6065
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-util-edit-map/index.js
|
|
6056
6066
|
var EditMap = class {
|
|
6057
6067
|
/**
|
|
6058
6068
|
* Create a new edit map.
|
|
@@ -6150,7 +6160,7 @@ function addImplementation(editMap, at, remove, add, before) {
|
|
|
6150
6160
|
editMap.index.set(at, change);
|
|
6151
6161
|
}
|
|
6152
6162
|
|
|
6153
|
-
// node_modules/micromark/lib/initialize/document.js
|
|
6163
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark/lib/initialize/document.js
|
|
6154
6164
|
var document2 = {
|
|
6155
6165
|
tokenize: initializeDocument
|
|
6156
6166
|
};
|
|
@@ -6344,7 +6354,7 @@ function tokenizeContainer(effects, ok3, nok) {
|
|
|
6344
6354
|
return factorySpace(effects, effects.attempt(this.parser.constructs.document, ok3, nok), "linePrefix", this.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4);
|
|
6345
6355
|
}
|
|
6346
6356
|
|
|
6347
|
-
// node_modules/micromark-util-classify-character/index.js
|
|
6357
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-util-classify-character/index.js
|
|
6348
6358
|
function classifyCharacter(code2) {
|
|
6349
6359
|
if (code2 === null || markdownLineEndingOrSpace(code2) || unicodeWhitespace(code2)) {
|
|
6350
6360
|
return 1;
|
|
@@ -6354,7 +6364,7 @@ function classifyCharacter(code2) {
|
|
|
6354
6364
|
}
|
|
6355
6365
|
}
|
|
6356
6366
|
|
|
6357
|
-
// node_modules/micromark-util-resolve-all/index.js
|
|
6367
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-util-resolve-all/index.js
|
|
6358
6368
|
function resolveAll(constructs2, events, context) {
|
|
6359
6369
|
const called = [];
|
|
6360
6370
|
let index2 = -1;
|
|
@@ -6368,7 +6378,7 @@ function resolveAll(constructs2, events, context) {
|
|
|
6368
6378
|
return events;
|
|
6369
6379
|
}
|
|
6370
6380
|
|
|
6371
|
-
// node_modules/micromark-core-commonmark/lib/attention.js
|
|
6381
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/attention.js
|
|
6372
6382
|
var attention = {
|
|
6373
6383
|
name: "attention",
|
|
6374
6384
|
resolveAll: resolveAllAttention,
|
|
@@ -6491,7 +6501,7 @@ function movePoint(point4, offset) {
|
|
|
6491
6501
|
point4._bufferIndex += offset;
|
|
6492
6502
|
}
|
|
6493
6503
|
|
|
6494
|
-
// node_modules/micromark-core-commonmark/lib/autolink.js
|
|
6504
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/autolink.js
|
|
6495
6505
|
var autolink = {
|
|
6496
6506
|
name: "autolink",
|
|
6497
6507
|
tokenize: tokenizeAutolink
|
|
@@ -6592,7 +6602,7 @@ function tokenizeAutolink(effects, ok3, nok) {
|
|
|
6592
6602
|
}
|
|
6593
6603
|
}
|
|
6594
6604
|
|
|
6595
|
-
// node_modules/micromark-core-commonmark/lib/blank-line.js
|
|
6605
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/blank-line.js
|
|
6596
6606
|
var blankLine = {
|
|
6597
6607
|
partial: true,
|
|
6598
6608
|
tokenize: tokenizeBlankLine
|
|
@@ -6607,7 +6617,7 @@ function tokenizeBlankLine(effects, ok3, nok) {
|
|
|
6607
6617
|
}
|
|
6608
6618
|
}
|
|
6609
6619
|
|
|
6610
|
-
// node_modules/micromark-core-commonmark/lib/block-quote.js
|
|
6620
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/block-quote.js
|
|
6611
6621
|
var blockQuote = {
|
|
6612
6622
|
continuation: {
|
|
6613
6623
|
tokenize: tokenizeBlockQuoteContinuation
|
|
@@ -6665,7 +6675,7 @@ function exit(effects) {
|
|
|
6665
6675
|
effects.exit("blockQuote");
|
|
6666
6676
|
}
|
|
6667
6677
|
|
|
6668
|
-
// node_modules/micromark-core-commonmark/lib/character-escape.js
|
|
6678
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/character-escape.js
|
|
6669
6679
|
var characterEscape = {
|
|
6670
6680
|
name: "characterEscape",
|
|
6671
6681
|
tokenize: tokenizeCharacterEscape
|
|
@@ -6691,7 +6701,7 @@ function tokenizeCharacterEscape(effects, ok3, nok) {
|
|
|
6691
6701
|
}
|
|
6692
6702
|
}
|
|
6693
6703
|
|
|
6694
|
-
// node_modules/micromark-core-commonmark/lib/character-reference.js
|
|
6704
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/character-reference.js
|
|
6695
6705
|
var characterReference = {
|
|
6696
6706
|
name: "characterReference",
|
|
6697
6707
|
tokenize: tokenizeCharacterReference
|
|
@@ -6756,7 +6766,7 @@ function tokenizeCharacterReference(effects, ok3, nok) {
|
|
|
6756
6766
|
}
|
|
6757
6767
|
}
|
|
6758
6768
|
|
|
6759
|
-
// node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.js
|
|
6769
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/partial-non-lazy-continuation.js
|
|
6760
6770
|
var nonLazyContinuation = {
|
|
6761
6771
|
partial: true,
|
|
6762
6772
|
tokenize: tokenizeNonLazyContinuation
|
|
@@ -6778,7 +6788,7 @@ function tokenizeNonLazyContinuation(effects, ok3, nok) {
|
|
|
6778
6788
|
}
|
|
6779
6789
|
}
|
|
6780
6790
|
|
|
6781
|
-
// node_modules/micromark-core-commonmark/lib/code-fenced.js
|
|
6791
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/code-fenced.js
|
|
6782
6792
|
var codeFenced = {
|
|
6783
6793
|
concrete: true,
|
|
6784
6794
|
name: "codeFenced",
|
|
@@ -6941,7 +6951,7 @@ function tokenizeCodeFenced(effects, ok3, nok) {
|
|
|
6941
6951
|
}
|
|
6942
6952
|
}
|
|
6943
6953
|
|
|
6944
|
-
// node_modules/micromark-core-commonmark/lib/code-indented.js
|
|
6954
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/code-indented.js
|
|
6945
6955
|
var codeIndented = {
|
|
6946
6956
|
name: "codeIndented",
|
|
6947
6957
|
tokenize: tokenizeCodeIndented
|
|
@@ -6999,7 +7009,7 @@ function tokenizeFurtherStart(effects, ok3, nok) {
|
|
|
6999
7009
|
}
|
|
7000
7010
|
}
|
|
7001
7011
|
|
|
7002
|
-
// node_modules/micromark-core-commonmark/lib/code-text.js
|
|
7012
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/code-text.js
|
|
7003
7013
|
var codeText = {
|
|
7004
7014
|
name: "codeText",
|
|
7005
7015
|
previous,
|
|
@@ -7114,7 +7124,7 @@ function tokenizeCodeText(effects, ok3, nok) {
|
|
|
7114
7124
|
}
|
|
7115
7125
|
}
|
|
7116
7126
|
|
|
7117
|
-
// node_modules/micromark-util-subtokenize/lib/splice-buffer.js
|
|
7127
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-util-subtokenize/lib/splice-buffer.js
|
|
7118
7128
|
var SpliceBuffer = class {
|
|
7119
7129
|
/**
|
|
7120
7130
|
* @param {ReadonlyArray<T> | null | undefined} [initial]
|
|
@@ -7307,7 +7317,7 @@ function chunkedPush(list2, right) {
|
|
|
7307
7317
|
}
|
|
7308
7318
|
}
|
|
7309
7319
|
|
|
7310
|
-
// node_modules/micromark-util-subtokenize/index.js
|
|
7320
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-util-subtokenize/index.js
|
|
7311
7321
|
function subtokenize(eventsArray) {
|
|
7312
7322
|
const jumps = {};
|
|
7313
7323
|
let index2 = -1;
|
|
@@ -7460,7 +7470,7 @@ function subcontent(events, eventIndex) {
|
|
|
7460
7470
|
return gaps;
|
|
7461
7471
|
}
|
|
7462
7472
|
|
|
7463
|
-
// node_modules/micromark-core-commonmark/lib/content.js
|
|
7473
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/content.js
|
|
7464
7474
|
var content2 = {
|
|
7465
7475
|
resolve: resolveContent,
|
|
7466
7476
|
tokenize: tokenizeContent
|
|
@@ -7531,7 +7541,7 @@ function tokenizeContinuation(effects, ok3, nok) {
|
|
|
7531
7541
|
}
|
|
7532
7542
|
}
|
|
7533
7543
|
|
|
7534
|
-
// node_modules/micromark-factory-destination/index.js
|
|
7544
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-factory-destination/index.js
|
|
7535
7545
|
function factoryDestination(effects, ok3, nok, type, literalType, literalMarkerType, rawType, stringType, max) {
|
|
7536
7546
|
const limit = max || Number.POSITIVE_INFINITY;
|
|
7537
7547
|
let balance = 0;
|
|
@@ -7623,7 +7633,7 @@ function factoryDestination(effects, ok3, nok, type, literalType, literalMarkerT
|
|
|
7623
7633
|
}
|
|
7624
7634
|
}
|
|
7625
7635
|
|
|
7626
|
-
// node_modules/micromark-factory-label/index.js
|
|
7636
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-factory-label/index.js
|
|
7627
7637
|
function factoryLabel(effects, ok3, nok, type, markerType, stringType) {
|
|
7628
7638
|
const self = this;
|
|
7629
7639
|
let size2 = 0;
|
|
@@ -7684,7 +7694,7 @@ function factoryLabel(effects, ok3, nok, type, markerType, stringType) {
|
|
|
7684
7694
|
}
|
|
7685
7695
|
}
|
|
7686
7696
|
|
|
7687
|
-
// node_modules/micromark-factory-title/index.js
|
|
7697
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-factory-title/index.js
|
|
7688
7698
|
function factoryTitle(effects, ok3, nok, type, markerType, stringType) {
|
|
7689
7699
|
let marker;
|
|
7690
7700
|
return start;
|
|
@@ -7746,7 +7756,7 @@ function factoryTitle(effects, ok3, nok, type, markerType, stringType) {
|
|
|
7746
7756
|
}
|
|
7747
7757
|
}
|
|
7748
7758
|
|
|
7749
|
-
// node_modules/micromark-factory-whitespace/index.js
|
|
7759
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-factory-whitespace/index.js
|
|
7750
7760
|
function factoryWhitespace(effects, ok3) {
|
|
7751
7761
|
let seen;
|
|
7752
7762
|
return start;
|
|
@@ -7765,7 +7775,7 @@ function factoryWhitespace(effects, ok3) {
|
|
|
7765
7775
|
}
|
|
7766
7776
|
}
|
|
7767
7777
|
|
|
7768
|
-
// node_modules/micromark-core-commonmark/lib/definition.js
|
|
7778
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/definition.js
|
|
7769
7779
|
var definition = {
|
|
7770
7780
|
name: "definition",
|
|
7771
7781
|
tokenize: tokenizeDefinition
|
|
@@ -7851,7 +7861,7 @@ function tokenizeTitleBefore(effects, ok3, nok) {
|
|
|
7851
7861
|
}
|
|
7852
7862
|
}
|
|
7853
7863
|
|
|
7854
|
-
// node_modules/micromark-core-commonmark/lib/hard-break-escape.js
|
|
7864
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/hard-break-escape.js
|
|
7855
7865
|
var hardBreakEscape = {
|
|
7856
7866
|
name: "hardBreakEscape",
|
|
7857
7867
|
tokenize: tokenizeHardBreakEscape
|
|
@@ -7872,7 +7882,7 @@ function tokenizeHardBreakEscape(effects, ok3, nok) {
|
|
|
7872
7882
|
}
|
|
7873
7883
|
}
|
|
7874
7884
|
|
|
7875
|
-
// node_modules/micromark-core-commonmark/lib/heading-atx.js
|
|
7885
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/heading-atx.js
|
|
7876
7886
|
var headingAtx = {
|
|
7877
7887
|
name: "headingAtx",
|
|
7878
7888
|
resolve: resolveHeadingAtx,
|
|
@@ -7961,7 +7971,7 @@ function tokenizeHeadingAtx(effects, ok3, nok) {
|
|
|
7961
7971
|
}
|
|
7962
7972
|
}
|
|
7963
7973
|
|
|
7964
|
-
// node_modules/micromark-util-html-tag-name/index.js
|
|
7974
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-util-html-tag-name/index.js
|
|
7965
7975
|
var htmlBlockNames = [
|
|
7966
7976
|
"address",
|
|
7967
7977
|
"article",
|
|
@@ -8028,7 +8038,7 @@ var htmlBlockNames = [
|
|
|
8028
8038
|
];
|
|
8029
8039
|
var htmlRawNames = ["pre", "script", "style", "textarea"];
|
|
8030
8040
|
|
|
8031
|
-
// node_modules/micromark-core-commonmark/lib/html-flow.js
|
|
8041
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/html-flow.js
|
|
8032
8042
|
var htmlFlow = {
|
|
8033
8043
|
concrete: true,
|
|
8034
8044
|
name: "htmlFlow",
|
|
@@ -8387,7 +8397,7 @@ function tokenizeBlankLineBefore(effects, ok3, nok) {
|
|
|
8387
8397
|
}
|
|
8388
8398
|
}
|
|
8389
8399
|
|
|
8390
|
-
// node_modules/micromark-core-commonmark/lib/html-text.js
|
|
8400
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/html-text.js
|
|
8391
8401
|
var htmlText = {
|
|
8392
8402
|
name: "htmlText",
|
|
8393
8403
|
tokenize: tokenizeHtmlText
|
|
@@ -8693,7 +8703,7 @@ function tokenizeHtmlText(effects, ok3, nok) {
|
|
|
8693
8703
|
}
|
|
8694
8704
|
}
|
|
8695
8705
|
|
|
8696
|
-
// node_modules/micromark-core-commonmark/lib/label-end.js
|
|
8706
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/label-end.js
|
|
8697
8707
|
var labelEnd = {
|
|
8698
8708
|
name: "labelEnd",
|
|
8699
8709
|
resolveAll: resolveAllLabelEnd,
|
|
@@ -8919,7 +8929,7 @@ function tokenizeReferenceCollapsed(effects, ok3, nok) {
|
|
|
8919
8929
|
}
|
|
8920
8930
|
}
|
|
8921
8931
|
|
|
8922
|
-
// node_modules/micromark-core-commonmark/lib/label-start-image.js
|
|
8932
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/label-start-image.js
|
|
8923
8933
|
var labelStartImage = {
|
|
8924
8934
|
name: "labelStartImage",
|
|
8925
8935
|
resolveAll: labelEnd.resolveAll,
|
|
@@ -8956,7 +8966,7 @@ function tokenizeLabelStartImage(effects, ok3, nok) {
|
|
|
8956
8966
|
}
|
|
8957
8967
|
}
|
|
8958
8968
|
|
|
8959
|
-
// node_modules/micromark-core-commonmark/lib/label-start-link.js
|
|
8969
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/label-start-link.js
|
|
8960
8970
|
var labelStartLink = {
|
|
8961
8971
|
name: "labelStartLink",
|
|
8962
8972
|
resolveAll: labelEnd.resolveAll,
|
|
@@ -8984,7 +8994,7 @@ function tokenizeLabelStartLink(effects, ok3, nok) {
|
|
|
8984
8994
|
}
|
|
8985
8995
|
}
|
|
8986
8996
|
|
|
8987
|
-
// node_modules/micromark-core-commonmark/lib/line-ending.js
|
|
8997
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/line-ending.js
|
|
8988
8998
|
var lineEnding = {
|
|
8989
8999
|
name: "lineEnding",
|
|
8990
9000
|
tokenize: tokenizeLineEnding
|
|
@@ -8999,7 +9009,7 @@ function tokenizeLineEnding(effects, ok3) {
|
|
|
8999
9009
|
}
|
|
9000
9010
|
}
|
|
9001
9011
|
|
|
9002
|
-
// node_modules/micromark-core-commonmark/lib/thematic-break.js
|
|
9012
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/thematic-break.js
|
|
9003
9013
|
var thematicBreak = {
|
|
9004
9014
|
name: "thematicBreak",
|
|
9005
9015
|
tokenize: tokenizeThematicBreak
|
|
@@ -9038,7 +9048,7 @@ function tokenizeThematicBreak(effects, ok3, nok) {
|
|
|
9038
9048
|
}
|
|
9039
9049
|
}
|
|
9040
9050
|
|
|
9041
|
-
// node_modules/micromark-core-commonmark/lib/list.js
|
|
9051
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/list.js
|
|
9042
9052
|
var list = {
|
|
9043
9053
|
continuation: {
|
|
9044
9054
|
tokenize: tokenizeListContinuation
|
|
@@ -9168,7 +9178,7 @@ function tokenizeListItemPrefixWhitespace(effects, ok3, nok) {
|
|
|
9168
9178
|
}
|
|
9169
9179
|
}
|
|
9170
9180
|
|
|
9171
|
-
// node_modules/micromark-core-commonmark/lib/setext-underline.js
|
|
9181
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-core-commonmark/lib/setext-underline.js
|
|
9172
9182
|
var setextUnderline = {
|
|
9173
9183
|
name: "setextUnderline",
|
|
9174
9184
|
resolveTo: resolveToSetextUnderline,
|
|
@@ -9262,7 +9272,7 @@ function tokenizeSetextUnderline(effects, ok3, nok) {
|
|
|
9262
9272
|
}
|
|
9263
9273
|
}
|
|
9264
9274
|
|
|
9265
|
-
// node_modules/micromark/lib/initialize/flow.js
|
|
9275
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark/lib/initialize/flow.js
|
|
9266
9276
|
var flow = {
|
|
9267
9277
|
tokenize: initializeFlow
|
|
9268
9278
|
};
|
|
@@ -9300,7 +9310,7 @@ function initializeFlow(effects) {
|
|
|
9300
9310
|
}
|
|
9301
9311
|
}
|
|
9302
9312
|
|
|
9303
|
-
// node_modules/micromark/lib/initialize/text.js
|
|
9313
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark/lib/initialize/text.js
|
|
9304
9314
|
var resolver = {
|
|
9305
9315
|
resolveAll: createResolver()
|
|
9306
9316
|
};
|
|
@@ -9442,7 +9452,7 @@ function resolveAllLineSuffixes(events, context) {
|
|
|
9442
9452
|
return events;
|
|
9443
9453
|
}
|
|
9444
9454
|
|
|
9445
|
-
// node_modules/micromark/lib/constructs.js
|
|
9455
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark/lib/constructs.js
|
|
9446
9456
|
var constructs_exports = {};
|
|
9447
9457
|
__export(constructs_exports, {
|
|
9448
9458
|
attentionMarkers: () => attentionMarkers,
|
|
@@ -9517,7 +9527,7 @@ var disable = {
|
|
|
9517
9527
|
null: []
|
|
9518
9528
|
};
|
|
9519
9529
|
|
|
9520
|
-
// node_modules/micromark/lib/create-tokenizer.js
|
|
9530
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark/lib/create-tokenizer.js
|
|
9521
9531
|
function createTokenizer(parser, initialize, from) {
|
|
9522
9532
|
let point4 = {
|
|
9523
9533
|
_bufferIndex: -1,
|
|
@@ -9843,7 +9853,7 @@ function serializeChunks(chunks, expandTabs) {
|
|
|
9843
9853
|
return result.join("");
|
|
9844
9854
|
}
|
|
9845
9855
|
|
|
9846
|
-
// node_modules/micromark/lib/parse.js
|
|
9856
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark/lib/parse.js
|
|
9847
9857
|
function parse(options) {
|
|
9848
9858
|
const settings = options || {};
|
|
9849
9859
|
const constructs2 = (
|
|
@@ -9869,14 +9879,14 @@ function parse(options) {
|
|
|
9869
9879
|
}
|
|
9870
9880
|
}
|
|
9871
9881
|
|
|
9872
|
-
// node_modules/micromark/lib/postprocess.js
|
|
9882
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark/lib/postprocess.js
|
|
9873
9883
|
function postprocess(events) {
|
|
9874
9884
|
while (!subtokenize(events)) {
|
|
9875
9885
|
}
|
|
9876
9886
|
return events;
|
|
9877
9887
|
}
|
|
9878
9888
|
|
|
9879
|
-
// node_modules/micromark/lib/preprocess.js
|
|
9889
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark/lib/preprocess.js
|
|
9880
9890
|
var search = /[\0\t\n\r]/g;
|
|
9881
9891
|
function preprocess() {
|
|
9882
9892
|
let column = 1;
|
|
@@ -9956,7 +9966,7 @@ function preprocess() {
|
|
|
9956
9966
|
}
|
|
9957
9967
|
}
|
|
9958
9968
|
|
|
9959
|
-
// node_modules/micromark-util-decode-string/index.js
|
|
9969
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-util-decode-string/index.js
|
|
9960
9970
|
var characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
|
|
9961
9971
|
function decodeString(value) {
|
|
9962
9972
|
return value.replace(characterEscapeOrReference, decode);
|
|
@@ -9974,7 +9984,7 @@ function decode($0, $1, $2) {
|
|
|
9974
9984
|
return decodeNamedCharacterReference($2) || $0;
|
|
9975
9985
|
}
|
|
9976
9986
|
|
|
9977
|
-
// node_modules/unist-util-stringify-position/lib/index.js
|
|
9987
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/unist-util-stringify-position/lib/index.js
|
|
9978
9988
|
function stringifyPosition(value) {
|
|
9979
9989
|
if (!value || typeof value !== "object") {
|
|
9980
9990
|
return "";
|
|
@@ -10000,7 +10010,7 @@ function index(value) {
|
|
|
10000
10010
|
return value && typeof value === "number" ? value : 1;
|
|
10001
10011
|
}
|
|
10002
10012
|
|
|
10003
|
-
// node_modules/mdast-util-from-markdown/lib/index.js
|
|
10013
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/mdast-util-from-markdown/lib/index.js
|
|
10004
10014
|
var own = {}.hasOwnProperty;
|
|
10005
10015
|
function fromMarkdown(value, encoding, options) {
|
|
10006
10016
|
if (encoding && typeof encoding === "object") {
|
|
@@ -10709,7 +10719,7 @@ function defaultOnError(left, right) {
|
|
|
10709
10719
|
}
|
|
10710
10720
|
}
|
|
10711
10721
|
|
|
10712
|
-
// node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js
|
|
10722
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-extension-gfm-autolink-literal/lib/syntax.js
|
|
10713
10723
|
var wwwPrefix = {
|
|
10714
10724
|
tokenize: tokenizeWwwPrefix,
|
|
10715
10725
|
partial: true
|
|
@@ -11051,7 +11061,7 @@ function previousUnbalanced(events) {
|
|
|
11051
11061
|
return result;
|
|
11052
11062
|
}
|
|
11053
11063
|
|
|
11054
|
-
// node_modules/micromark-extension-gfm-footnote/lib/syntax.js
|
|
11064
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-extension-gfm-footnote/lib/syntax.js
|
|
11055
11065
|
var indent = {
|
|
11056
11066
|
tokenize: tokenizeIndent2,
|
|
11057
11067
|
partial: true
|
|
@@ -11326,7 +11336,7 @@ function tokenizeIndent2(effects, ok3, nok) {
|
|
|
11326
11336
|
}
|
|
11327
11337
|
}
|
|
11328
11338
|
|
|
11329
|
-
// node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js
|
|
11339
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-extension-gfm-strikethrough/lib/syntax.js
|
|
11330
11340
|
function gfmStrikethrough(options) {
|
|
11331
11341
|
const options_ = options || {};
|
|
11332
11342
|
let single = options_.singleTilde;
|
|
@@ -11420,7 +11430,7 @@ function gfmStrikethrough(options) {
|
|
|
11420
11430
|
}
|
|
11421
11431
|
}
|
|
11422
11432
|
|
|
11423
|
-
// node_modules/micromark-extension-gfm-table/lib/edit-map.js
|
|
11433
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-extension-gfm-table/lib/edit-map.js
|
|
11424
11434
|
var EditMap2 = class {
|
|
11425
11435
|
/**
|
|
11426
11436
|
* Create a new edit map.
|
|
@@ -11506,7 +11516,7 @@ function addImplementation2(editMap, at, remove, add) {
|
|
|
11506
11516
|
editMap.index.set(at, change);
|
|
11507
11517
|
}
|
|
11508
11518
|
|
|
11509
|
-
// node_modules/micromark-extension-gfm-table/lib/infer.js
|
|
11519
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-extension-gfm-table/lib/infer.js
|
|
11510
11520
|
function gfmTableAlign(events, index2) {
|
|
11511
11521
|
let inDelimiterRow = false;
|
|
11512
11522
|
const align = [];
|
|
@@ -11533,7 +11543,7 @@ function gfmTableAlign(events, index2) {
|
|
|
11533
11543
|
return align;
|
|
11534
11544
|
}
|
|
11535
11545
|
|
|
11536
|
-
// node_modules/micromark-extension-gfm-table/lib/syntax.js
|
|
11546
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-extension-gfm-table/lib/syntax.js
|
|
11537
11547
|
function gfmTable() {
|
|
11538
11548
|
return {
|
|
11539
11549
|
flow: {
|
|
@@ -11924,7 +11934,7 @@ function getPoint(events, index2) {
|
|
|
11924
11934
|
return event[1][side];
|
|
11925
11935
|
}
|
|
11926
11936
|
|
|
11927
|
-
// node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js
|
|
11937
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-extension-gfm-task-list-item/lib/syntax.js
|
|
11928
11938
|
var tasklistCheck = {
|
|
11929
11939
|
name: "tasklistCheck",
|
|
11930
11940
|
tokenize: tokenizeTasklistCheck
|
|
@@ -11998,7 +12008,7 @@ function spaceThenNonSpace(effects, ok3, nok) {
|
|
|
11998
12008
|
}
|
|
11999
12009
|
}
|
|
12000
12010
|
|
|
12001
|
-
// node_modules/micromark-extension-gfm/index.js
|
|
12011
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/micromark-extension-gfm/index.js
|
|
12002
12012
|
function gfm(options) {
|
|
12003
12013
|
return combineExtensions([
|
|
12004
12014
|
gfmAutolinkLiteral(),
|
|
@@ -12009,7 +12019,7 @@ function gfm(options) {
|
|
|
12009
12019
|
]);
|
|
12010
12020
|
}
|
|
12011
12021
|
|
|
12012
|
-
// node_modules/ccount/index.js
|
|
12022
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/ccount/index.js
|
|
12013
12023
|
function ccount(value, character) {
|
|
12014
12024
|
const source = String(value);
|
|
12015
12025
|
if (typeof character !== "string") {
|
|
@@ -12024,11 +12034,11 @@ function ccount(value, character) {
|
|
|
12024
12034
|
return count;
|
|
12025
12035
|
}
|
|
12026
12036
|
|
|
12027
|
-
// node_modules/devlop/lib/default.js
|
|
12037
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/devlop/lib/default.js
|
|
12028
12038
|
function ok() {
|
|
12029
12039
|
}
|
|
12030
12040
|
|
|
12031
|
-
// node_modules/escape-string-regexp/index.js
|
|
12041
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/escape-string-regexp/index.js
|
|
12032
12042
|
function escapeStringRegexp(string3) {
|
|
12033
12043
|
if (typeof string3 !== "string") {
|
|
12034
12044
|
throw new TypeError("Expected a string");
|
|
@@ -12036,7 +12046,7 @@ function escapeStringRegexp(string3) {
|
|
|
12036
12046
|
return string3.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
12037
12047
|
}
|
|
12038
12048
|
|
|
12039
|
-
// node_modules/unist-util-is/lib/index.js
|
|
12049
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/unist-util-is/lib/index.js
|
|
12040
12050
|
var convert = (
|
|
12041
12051
|
// Note: overloads in JSDoc can’t yet use different `@template`s.
|
|
12042
12052
|
/**
|
|
@@ -12135,12 +12145,12 @@ function looksLikeANode(value) {
|
|
|
12135
12145
|
return value !== null && typeof value === "object" && "type" in value;
|
|
12136
12146
|
}
|
|
12137
12147
|
|
|
12138
|
-
// node_modules/unist-util-visit-parents/lib/color.js
|
|
12148
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/unist-util-visit-parents/lib/color.js
|
|
12139
12149
|
function color(d) {
|
|
12140
12150
|
return d;
|
|
12141
12151
|
}
|
|
12142
12152
|
|
|
12143
|
-
// node_modules/unist-util-visit-parents/lib/index.js
|
|
12153
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/unist-util-visit-parents/lib/index.js
|
|
12144
12154
|
var empty = [];
|
|
12145
12155
|
var CONTINUE = true;
|
|
12146
12156
|
var EXIT = false;
|
|
@@ -12217,7 +12227,7 @@ function toResult(value) {
|
|
|
12217
12227
|
return value === null || value === void 0 ? empty : [value];
|
|
12218
12228
|
}
|
|
12219
12229
|
|
|
12220
|
-
// node_modules/mdast-util-find-and-replace/lib/index.js
|
|
12230
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/mdast-util-find-and-replace/lib/index.js
|
|
12221
12231
|
function findAndReplace(tree, list2, options) {
|
|
12222
12232
|
const settings = options || {};
|
|
12223
12233
|
const ignored = convert(settings.ignore || []);
|
|
@@ -12322,7 +12332,7 @@ function toFunction(replace2) {
|
|
|
12322
12332
|
};
|
|
12323
12333
|
}
|
|
12324
12334
|
|
|
12325
|
-
// node_modules/mdast-util-gfm-autolink-literal/lib/index.js
|
|
12335
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/mdast-util-gfm-autolink-literal/lib/index.js
|
|
12326
12336
|
function gfmAutolinkLiteralFromMarkdown() {
|
|
12327
12337
|
return {
|
|
12328
12338
|
transforms: [transformGfmAutolinkLiterals],
|
|
@@ -12443,7 +12453,7 @@ function previous2(match, email) {
|
|
|
12443
12453
|
(!email || code2 !== 47);
|
|
12444
12454
|
}
|
|
12445
12455
|
|
|
12446
|
-
// node_modules/mdast-util-gfm-footnote/lib/index.js
|
|
12456
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/mdast-util-gfm-footnote/lib/index.js
|
|
12447
12457
|
footnoteReference.peek = footnoteReferencePeek;
|
|
12448
12458
|
function enterFootnoteCallString() {
|
|
12449
12459
|
this.buffer();
|
|
@@ -12517,7 +12527,7 @@ function gfmFootnoteFromMarkdown() {
|
|
|
12517
12527
|
};
|
|
12518
12528
|
}
|
|
12519
12529
|
|
|
12520
|
-
// node_modules/mdast-util-gfm-strikethrough/lib/index.js
|
|
12530
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/mdast-util-gfm-strikethrough/lib/index.js
|
|
12521
12531
|
handleDelete.attention = attentionDelete;
|
|
12522
12532
|
handleDelete.peek = peekDelete;
|
|
12523
12533
|
function gfmStrikethroughFromMarkdown() {
|
|
@@ -12554,7 +12564,7 @@ function peekDelete() {
|
|
|
12554
12564
|
return "~";
|
|
12555
12565
|
}
|
|
12556
12566
|
|
|
12557
|
-
// node_modules/mdast-util-gfm-table/lib/index.js
|
|
12567
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/mdast-util-gfm-table/lib/index.js
|
|
12558
12568
|
function gfmTableFromMarkdown() {
|
|
12559
12569
|
return {
|
|
12560
12570
|
enter: {
|
|
@@ -12614,7 +12624,7 @@ function replace($0, $1) {
|
|
|
12614
12624
|
return $1 === "|" ? $1 : $0;
|
|
12615
12625
|
}
|
|
12616
12626
|
|
|
12617
|
-
// node_modules/mdast-util-gfm-task-list-item/lib/index.js
|
|
12627
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/mdast-util-gfm-task-list-item/lib/index.js
|
|
12618
12628
|
function gfmTaskListItemFromMarkdown() {
|
|
12619
12629
|
return {
|
|
12620
12630
|
exit: {
|
|
@@ -12661,7 +12671,7 @@ function exitParagraphWithTaskListItem(token) {
|
|
|
12661
12671
|
this.exit(token);
|
|
12662
12672
|
}
|
|
12663
12673
|
|
|
12664
|
-
// node_modules/mdast-util-gfm/lib/index.js
|
|
12674
|
+
// ../../home/moye/Online Document/dsh-plugins/dsh-partner/node_modules/mdast-util-gfm/lib/index.js
|
|
12665
12675
|
function gfmFromMarkdown() {
|
|
12666
12676
|
return [
|
|
12667
12677
|
gfmAutolinkLiteralFromMarkdown(),
|
|
@@ -15932,13 +15942,11 @@ var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
|
15932
15942
|
function IdentityEditor(props) {
|
|
15933
15943
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(IdentityEditorForm, { ...props }, props.companion.id);
|
|
15934
15944
|
}
|
|
15935
|
-
function IdentityEditorForm({ companion,
|
|
15945
|
+
function IdentityEditorForm({ companion, onChanged }) {
|
|
15936
15946
|
const [form, setForm] = (0, import_react43.useState)(() => companionDraft(companion));
|
|
15937
15947
|
const [operation, setOperation] = (0, import_react43.useState)();
|
|
15938
15948
|
const [saved, setSaved] = (0, import_react43.useState)(false);
|
|
15939
|
-
const [removed, setRemoved] = (0, import_react43.useState)(false);
|
|
15940
15949
|
const [error, setError] = (0, import_react43.useState)();
|
|
15941
|
-
const [confirmationId, setConfirmationId] = (0, import_react43.useState)();
|
|
15942
15950
|
const locked = (0, import_react43.useRef)(false);
|
|
15943
15951
|
const alive = (0, import_react43.useRef)(true);
|
|
15944
15952
|
(0, import_react43.useEffect)(() => {
|
|
@@ -15950,17 +15958,14 @@ function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
|
|
|
15950
15958
|
(0, import_react43.useEffect)(() => {
|
|
15951
15959
|
setForm(companionDraft(companion));
|
|
15952
15960
|
setSaved(false);
|
|
15953
|
-
setConfirmationId(void 0);
|
|
15954
15961
|
}, [companion.updatedAt]);
|
|
15955
|
-
const
|
|
15956
|
-
const busy = operation !== void 0 || removed;
|
|
15962
|
+
const busy = operation !== void 0;
|
|
15957
15963
|
const submit = async (event) => {
|
|
15958
15964
|
event.preventDefault();
|
|
15959
|
-
if (locked.current
|
|
15965
|
+
if (locked.current) return;
|
|
15960
15966
|
locked.current = true;
|
|
15961
15967
|
setOperation("save");
|
|
15962
15968
|
setError(void 0);
|
|
15963
|
-
setConfirmationId(void 0);
|
|
15964
15969
|
let committed = false;
|
|
15965
15970
|
try {
|
|
15966
15971
|
await api(`/companions/${encodeURIComponent(companion.id)}`, { method: "PUT", body: JSON.stringify({ companion: form }) });
|
|
@@ -15974,26 +15979,6 @@ function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
|
|
|
15974
15979
|
if (alive.current) setOperation(void 0);
|
|
15975
15980
|
}
|
|
15976
15981
|
};
|
|
15977
|
-
const remove = async () => {
|
|
15978
|
-
if (locked.current || removed || !confirming || count <= 1) return;
|
|
15979
|
-
const targetId = confirmationId;
|
|
15980
|
-
locked.current = true;
|
|
15981
|
-
setOperation("remove");
|
|
15982
|
-
setError(void 0);
|
|
15983
|
-
setConfirmationId(void 0);
|
|
15984
|
-
let committed = false;
|
|
15985
|
-
try {
|
|
15986
|
-
await api(`/companions/${encodeURIComponent(targetId)}?removeFiles=1`, { method: "DELETE" });
|
|
15987
|
-
committed = true;
|
|
15988
|
-
if (alive.current) setRemoved(true);
|
|
15989
|
-
await onRemoved(targetId);
|
|
15990
|
-
} catch (reason) {
|
|
15991
|
-
if (alive.current) setError(`${committed ? "\u4F19\u4F34\u5DF2\u5220\u9664\uFF0C\u4F46\u9875\u9762\u5237\u65B0\u5931\u8D25\uFF0C\u8BF7\u5237\u65B0\u9875\u9762\uFF0C\u4E0D\u8981\u518D\u6B21\u5220\u9664\uFF1A" : "\u5220\u9664\u5931\u8D25\uFF1A"}${errorMessage(reason)}`);
|
|
15992
|
-
} finally {
|
|
15993
|
-
locked.current = false;
|
|
15994
|
-
if (alive.current) setOperation(void 0);
|
|
15995
|
-
}
|
|
15996
|
-
};
|
|
15997
15982
|
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)("form", { id: "dsh-partner-identity-editor", className: "dsh-partner-form is-identity", "aria-busy": operation !== void 0, onSubmit: (event) => {
|
|
15998
15983
|
void submit(event);
|
|
15999
15984
|
}, children: [
|
|
@@ -16013,43 +15998,94 @@ function IdentityEditorForm({ companion, count, onChanged, onRemoved }) {
|
|
|
16013
15998
|
] }) }),
|
|
16014
15999
|
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("button", { disabled: busy, children: operation === "save" ? "\u6B63\u5728\u4FDD\u5B58\u2026" : "\u4FDD\u5B58\u8EAB\u4EFD" })
|
|
16015
16000
|
] })
|
|
16001
|
+
] })
|
|
16002
|
+
] });
|
|
16003
|
+
}
|
|
16004
|
+
|
|
16005
|
+
// src/ui/companion-deletion.tsx
|
|
16006
|
+
var import_react44 = require("react");
|
|
16007
|
+
var import_dsh_client_ui_primitives22 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
16008
|
+
var import_jsx_runtime41 = require("react/jsx-runtime");
|
|
16009
|
+
function CompanionDeletion({ companion, count, channelCount, onRemoved }) {
|
|
16010
|
+
const [open, setOpen] = (0, import_react44.useState)(false);
|
|
16011
|
+
const [busy, setBusy] = (0, import_react44.useState)(false);
|
|
16012
|
+
const [removed, setRemoved] = (0, import_react44.useState)(false);
|
|
16013
|
+
const [error, setError] = (0, import_react44.useState)("");
|
|
16014
|
+
const locked = (0, import_react44.useRef)(false), alive = (0, import_react44.useRef)(true);
|
|
16015
|
+
(0, import_react44.useEffect)(() => {
|
|
16016
|
+
alive.current = true;
|
|
16017
|
+
return () => {
|
|
16018
|
+
alive.current = false;
|
|
16019
|
+
};
|
|
16020
|
+
}, []);
|
|
16021
|
+
const remove = async () => {
|
|
16022
|
+
if (!open || locked.current || removed || count <= 1) return;
|
|
16023
|
+
const id = companion.id;
|
|
16024
|
+
locked.current = true;
|
|
16025
|
+
setBusy(true);
|
|
16026
|
+
setError("");
|
|
16027
|
+
let committed = false;
|
|
16028
|
+
try {
|
|
16029
|
+
await api(`/companions/${encodeURIComponent(id)}?removeFiles=1`, { method: "DELETE" });
|
|
16030
|
+
committed = true;
|
|
16031
|
+
if (alive.current) {
|
|
16032
|
+
setRemoved(true);
|
|
16033
|
+
setOpen(false);
|
|
16034
|
+
}
|
|
16035
|
+
await onRemoved(id);
|
|
16036
|
+
} catch (reason) {
|
|
16037
|
+
if (alive.current) setError(`${committed ? "\u4F19\u4F34\u5DF2\u5220\u9664\uFF0C\u9875\u9762\u5237\u65B0\u5931\u8D25\uFF0C\u8BF7\u5237\u65B0\u9875\u9762\uFF1A" : "\u5220\u9664\u5931\u8D25\uFF1A"}${errorMessage(reason)}`);
|
|
16038
|
+
} finally {
|
|
16039
|
+
locked.current = false;
|
|
16040
|
+
if (alive.current) setBusy(false);
|
|
16041
|
+
}
|
|
16042
|
+
};
|
|
16043
|
+
return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-overview-delete", children: [
|
|
16044
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("button", { type: "button", className: "is-danger", disabled: busy || removed || count <= 1, title: count <= 1 ? "\u81F3\u5C11\u4FDD\u7559\u4E00\u4E2A\u4F19\u4F34" : void 0, onClick: () => {
|
|
16045
|
+
setError("");
|
|
16046
|
+
setOpen(true);
|
|
16047
|
+
}, children: [
|
|
16048
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_dsh_client_ui_primitives22.IconTrashOutlineRegular, { size: 16 }),
|
|
16049
|
+
"\u5220\u9664\u4F19\u4F34"
|
|
16016
16050
|
] }),
|
|
16017
|
-
/* @__PURE__ */ (0,
|
|
16018
|
-
|
|
16019
|
-
|
|
16020
|
-
|
|
16021
|
-
|
|
16022
|
-
/* @__PURE__ */ (0,
|
|
16023
|
-
|
|
16024
|
-
|
|
16025
|
-
|
|
16026
|
-
|
|
16027
|
-
|
|
16051
|
+
!open && error && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
|
|
16052
|
+
open && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(WorkspaceDialog, { title: `\u5220\u9664\u300C${companion.name}\u300D\uFF1F`, detail: "\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\uFF0C\u53EA\u5220\u9664\u5F53\u524D\u786E\u8BA4\u7684\u4F19\u4F34\u3002", close: () => {
|
|
16053
|
+
if (!locked.current) setOpen(false);
|
|
16054
|
+
}, children: [
|
|
16055
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { children: "\u5C06\u6E05\u7406\u8EAB\u4EFD\u3001\u8BB0\u5FC6\u3001\u6301\u7EED\u5173\u6CE8\u3001\u80FD\u529B\u7ED1\u5B9A\u3001\u5B9A\u65F6\u4EFB\u52A1\u53CA\u4E13\u5C5E\u76EE\u5F55\u4E2D\u7684\u5168\u90E8\u6587\u4EF6\u3002" }),
|
|
16056
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { children: channelCount ? `\u5DF2\u7ED1\u5B9A ${channelCount} \u4E2A\u6E20\u9053\u3002\u786E\u8BA4\u540E\u4F1A\u81EA\u52A8\u505C\u6B62\u5E76\u5220\u9664\u8FD9\u4E9B\u6E20\u9053\u3001\u767B\u5F55\u51ED\u636E\u548C\u8054\u7CFB\u4EBA\u6388\u6743\uFF0C\u65E0\u9700\u5148\u624B\u52A8\u89E3\u7ED1\u3002` : "\u8BE5\u4F19\u4F34\u6CA1\u6709\u7ED1\u5B9A\u6E20\u9053\u3002" }),
|
|
16057
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { children: "DSH \u539F\u4F1A\u8BDD\u65E5\u5FD7\u7531\u5BBF\u4E3B\u7BA1\u7406\uFF0C\u4E0D\u5728\u6B64\u6B21\u5220\u9664\u8303\u56F4\u3002\u6B63\u5728\u6267\u884C\u7684\u4EFB\u52A1\u53CA\u5171\u4EAB\u6216\u5F02\u5E38\u76EE\u5F55\u4ECD\u4F1A\u62E6\u622A\u5220\u9664\u3002" }),
|
|
16058
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
|
|
16059
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "dsh-partner-form-actions", children: [
|
|
16060
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { type: "button", disabled: busy, onClick: () => setOpen(false), children: "\u53D6\u6D88" }),
|
|
16061
|
+
/* @__PURE__ */ (0, import_jsx_runtime41.jsx)("button", { type: "button", className: "is-danger", disabled: busy, onClick: () => {
|
|
16062
|
+
void remove();
|
|
16063
|
+
}, children: busy ? "\u6B63\u5728\u5220\u9664\u2026" : "\u786E\u8BA4\u5220\u9664" })
|
|
16028
16064
|
] })
|
|
16029
16065
|
] })
|
|
16030
16066
|
] });
|
|
16031
16067
|
}
|
|
16032
16068
|
|
|
16033
16069
|
// src/ui/channels-panel.tsx
|
|
16034
|
-
var
|
|
16070
|
+
var import_react46 = require("react");
|
|
16035
16071
|
|
|
16036
16072
|
// src/ui/notification-settings.tsx
|
|
16037
|
-
var
|
|
16038
|
-
var
|
|
16073
|
+
var import_react45 = require("react");
|
|
16074
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
16039
16075
|
function NotificationSettings({ companion, snapshot, onChanged }) {
|
|
16040
16076
|
const channels = snapshot.channels.filter((c) => c.companionId === companion.id);
|
|
16041
16077
|
const pairings = snapshot.pairings.filter((p) => channels.some((c) => c.id === p.channelId));
|
|
16042
|
-
const [mode, setMode] = (0,
|
|
16043
|
-
const [targets, setTargets] = (0,
|
|
16044
|
-
const [selectedChannels, setSelectedChannels] = (0,
|
|
16045
|
-
const [busy, setBusy] = (0,
|
|
16046
|
-
const saveRef = (0,
|
|
16047
|
-
(0,
|
|
16078
|
+
const [mode, setMode] = (0, import_react45.useState)(companion.notificationDelivery?.mode ?? "recent");
|
|
16079
|
+
const [targets, setTargets] = (0, import_react45.useState)(companion.notificationDelivery?.targets ?? []);
|
|
16080
|
+
const [selectedChannels, setSelectedChannels] = (0, import_react45.useState)(targets.map((t) => t.channelId));
|
|
16081
|
+
const [busy, setBusy] = (0, import_react45.useState)(false), [feedback, setFeedback] = (0, import_react45.useState)(""), [failed, setFailed] = (0, import_react45.useState)(false);
|
|
16082
|
+
const saveRef = (0, import_react45.useRef)(null);
|
|
16083
|
+
(0, import_react45.useEffect)(() => {
|
|
16048
16084
|
if (!busy && feedback && document.activeElement === document.body) saveRef.current?.focus();
|
|
16049
16085
|
}, [busy, feedback]);
|
|
16050
16086
|
const unavailable = targets.filter((t) => !pairings.some((p) => p.channelId === t.channelId && p.userId === t.userId && p.status === "approved") || !channels.some((c) => c.id === t.channelId && c.enabled));
|
|
16051
16087
|
const emptyChannel = selectedChannels.some((id) => !targets.some((t) => t.channelId === id));
|
|
16052
|
-
return /* @__PURE__ */ (0,
|
|
16088
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-channel-form dsh-partner-delivery-form", "aria-busy": busy, onSubmit: (e) => {
|
|
16053
16089
|
e.preventDefault();
|
|
16054
16090
|
if (busy) return;
|
|
16055
16091
|
setBusy(true);
|
|
@@ -16064,41 +16100,41 @@ function NotificationSettings({ companion, snapshot, onChanged }) {
|
|
|
16064
16100
|
setFeedback(errorMessage(error));
|
|
16065
16101
|
}).finally(() => setBusy(false));
|
|
16066
16102
|
}, children: [
|
|
16067
|
-
/* @__PURE__ */ (0,
|
|
16068
|
-
/* @__PURE__ */ (0,
|
|
16069
|
-
/* @__PURE__ */ (0,
|
|
16070
|
-
/* @__PURE__ */ (0,
|
|
16071
|
-
/* @__PURE__ */ (0,
|
|
16103
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("label", { className: "dsh-partner-channel-field", children: [
|
|
16104
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { children: "\u901A\u77E5\u53D1\u9001\u5230" }),
|
|
16105
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("select", { disabled: busy, value: mode, onChange: (e) => setMode(e.target.value), children: [
|
|
16106
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("option", { value: "recent", children: "\u6700\u8FD1\u8054\u7CFB\u7684\u6E20\u9053\u4E0E\u7528\u6237" }),
|
|
16107
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("option", { value: "selected", children: "\u6307\u5B9A\u6E20\u9053\u4E0E\u63A5\u6536\u4EBA" })
|
|
16072
16108
|
] })
|
|
16073
16109
|
] }),
|
|
16074
|
-
/* @__PURE__ */ (0,
|
|
16075
|
-
!companion.notificationDelivery && pairings.some((p) => p.deliveryTarget) && /* @__PURE__ */ (0,
|
|
16076
|
-
mode === "selected" && /* @__PURE__ */ (0,
|
|
16077
|
-
/* @__PURE__ */ (0,
|
|
16078
|
-
!channels.length && /* @__PURE__ */ (0,
|
|
16079
|
-
channels.map((channel) => /* @__PURE__ */ (0,
|
|
16080
|
-
/* @__PURE__ */ (0,
|
|
16081
|
-
/* @__PURE__ */ (0,
|
|
16110
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { children: "\u4EC5\u5F71\u54CD\u4E3B\u52A8\u901A\u77E5\u4E0E\u7ED3\u679C\u4EA4\u4ED8\u3002\u5BF9\u8BDD\u56DE\u590D\u4ECD\u53D1\u9001\u5230\u6D88\u606F\u6765\u6E90\u6E20\u9053\u3002" }),
|
|
16111
|
+
!companion.notificationDelivery && pairings.some((p) => p.deliveryTarget) && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { role: "status", children: "\u5F53\u524D\u4ECD\u4F7F\u7528\u65E7\u7684\u8054\u7CFB\u4EBA\u6295\u9012\u89C4\u5219\uFF0C\u4FDD\u5B58\u540E\u7EDF\u4E00\u4F7F\u7528\u8FD9\u91CC\u7684\u901A\u77E5\u8BBE\u7F6E\u3002" }),
|
|
16112
|
+
mode === "selected" && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-notification-choices", children: [
|
|
16113
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { children: "\u53EF\u9009\u62E9\u591A\u4E2A\u6E20\u9053\uFF1B\u6BCF\u4E2A\u6E20\u9053\u81F3\u5C11\u9009\u62E9\u4E00\u4F4D\u5DF2\u6388\u6743\u63A5\u6536\u4EBA\u3002\u4FDD\u5B58\u540E\u5BF9\u65B0\u901A\u77E5\u751F\u6548\uFF0C\u5F85\u91CD\u8BD5\u901A\u77E5\u4FDD\u7559\u539F\u63A5\u6536\u4EBA\u3002" }),
|
|
16114
|
+
!channels.length && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { children: "\u8BF7\u5148\u6DFB\u52A0\u6E20\u9053\u5E76\u6388\u6743\u8054\u7CFB\u4EBA\u3002" }),
|
|
16115
|
+
channels.map((channel) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("fieldset", { disabled: busy, className: "dsh-partner-notification-channel", children: [
|
|
16116
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("legend", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("label", { children: [
|
|
16117
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("input", { type: "checkbox", checked: selectedChannels.includes(channel.id), onChange: (e) => {
|
|
16082
16118
|
setSelectedChannels((ids) => e.target.checked ? [...ids, channel.id] : ids.filter((id) => id !== channel.id));
|
|
16083
16119
|
if (!e.target.checked) setTargets((items) => items.filter((t) => t.channelId !== channel.id));
|
|
16084
16120
|
} }),
|
|
16085
16121
|
channel.name,
|
|
16086
16122
|
!channel.enabled ? "\uFF08\u5DF2\u505C\u7528\uFF09" : ""
|
|
16087
16123
|
] }) }),
|
|
16088
|
-
selectedChannels.includes(channel.id) && /* @__PURE__ */ (0,
|
|
16089
|
-
!pairings.some((p) => p.channelId === channel.id && p.status === "approved") && /* @__PURE__ */ (0,
|
|
16090
|
-
pairings.filter((p) => p.channelId === channel.id && p.status === "approved").map((p) => /* @__PURE__ */ (0,
|
|
16091
|
-
/* @__PURE__ */ (0,
|
|
16092
|
-
/* @__PURE__ */ (0,
|
|
16124
|
+
selectedChannels.includes(channel.id) && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { className: "dsh-partner-notification-users", children: [
|
|
16125
|
+
!pairings.some((p) => p.channelId === channel.id && p.status === "approved") && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { children: "\u6682\u65E0\u5DF2\u6388\u6743\u63A5\u6536\u4EBA\uFF0C\u8BF7\u5148\u5728\u6E20\u9053\u914D\u7F6E\u4E2D\u6279\u51C6\u8054\u7CFB\u4EBA\u3002" }),
|
|
16126
|
+
pairings.filter((p) => p.channelId === channel.id && p.status === "approved").map((p) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("label", { children: [
|
|
16127
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("input", { type: "checkbox", checked: targets.some((t) => t.channelId === p.channelId && t.userId === p.userId), onChange: (e) => setTargets((items) => e.target.checked ? [...items, { channelId: p.channelId, userId: p.userId }] : items.filter((t) => t.channelId !== p.channelId || t.userId !== p.userId)) }),
|
|
16128
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("span", { children: [
|
|
16093
16129
|
p.displayName,
|
|
16094
|
-
/* @__PURE__ */ (0,
|
|
16130
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("small", { children: p.userId })
|
|
16095
16131
|
] })
|
|
16096
16132
|
] }, p.id))
|
|
16097
16133
|
] })
|
|
16098
16134
|
] }, channel.id)),
|
|
16099
|
-
unavailable.length > 0 && /* @__PURE__ */ (0,
|
|
16100
|
-
/* @__PURE__ */ (0,
|
|
16101
|
-
unavailable.map((t) => /* @__PURE__ */ (0,
|
|
16135
|
+
unavailable.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("div", { role: "alert", children: [
|
|
16136
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { children: "\u90E8\u5206\u5DF2\u9009\u63A5\u6536\u4EBA\u5DF2\u5931\u6548\u6216\u6E20\u9053\u5DF2\u505C\u7528\u3002\u8BF7\u79FB\u9664\u6216\u6062\u590D\u6388\u6743\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u6539\u53D1\u5176\u4ED6\u4EBA\u3002" }),
|
|
16137
|
+
unavailable.map((t) => /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)("button", { type: "button", disabled: busy, onClick: () => {
|
|
16102
16138
|
setTargets((items) => items.filter((x) => x.channelId !== t.channelId || x.userId !== t.userId));
|
|
16103
16139
|
if (!targets.some((x) => x.channelId === t.channelId && x.userId !== t.userId)) setSelectedChannels((ids) => ids.filter((id) => id !== t.channelId));
|
|
16104
16140
|
}, children: [
|
|
@@ -16107,27 +16143,27 @@ function NotificationSettings({ companion, snapshot, onChanged }) {
|
|
|
16107
16143
|
] }, JSON.stringify(t)))
|
|
16108
16144
|
] })
|
|
16109
16145
|
] }),
|
|
16110
|
-
feedback && /* @__PURE__ */ (0,
|
|
16111
|
-
/* @__PURE__ */ (0,
|
|
16146
|
+
feedback && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("p", { role: failed ? "alert" : "status", children: feedback }),
|
|
16147
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("footer", { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("button", { ref: saveRef, className: "is-primary", disabled: busy || mode === "selected" && (!targets.length || unavailable.length > 0 || emptyChannel), children: busy ? "\u4FDD\u5B58\u4E2D\u2026" : "\u4FDD\u5B58\u901A\u77E5\u8BBE\u7F6E" }) })
|
|
16112
16148
|
] });
|
|
16113
16149
|
}
|
|
16114
16150
|
|
|
16115
16151
|
// src/ui/channels-panel.tsx
|
|
16116
|
-
var
|
|
16152
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
16117
16153
|
function ChannelsPanel({ companion, snapshot, onChanged, weixin }) {
|
|
16118
|
-
const [platform, setPlatform] = (0,
|
|
16119
|
-
const [name, setName] = (0,
|
|
16120
|
-
const [baseUrl, setBaseUrl] = (0,
|
|
16121
|
-
const [targetId, setTargetId] = (0,
|
|
16122
|
-
const [botToken, setToken] = (0,
|
|
16123
|
-
const [authMode, setAuthMode] = (0,
|
|
16124
|
-
const [username, setUsername] = (0,
|
|
16125
|
-
const [busy, setBusy] = (0,
|
|
16126
|
-
const [feedback, setFeedback] = (0,
|
|
16127
|
-
const [deleting, setDeleting] = (0,
|
|
16128
|
-
const [adding, setAdding] = (0,
|
|
16129
|
-
const [fixedPlatform, setFixedPlatform] = (0,
|
|
16130
|
-
const [configuring, setConfiguring] = (0,
|
|
16154
|
+
const [platform, setPlatform] = (0, import_react46.useState)("matrix");
|
|
16155
|
+
const [name, setName] = (0, import_react46.useState)("");
|
|
16156
|
+
const [baseUrl, setBaseUrl] = (0, import_react46.useState)("");
|
|
16157
|
+
const [targetId, setTargetId] = (0, import_react46.useState)("");
|
|
16158
|
+
const [botToken, setToken] = (0, import_react46.useState)("");
|
|
16159
|
+
const [authMode, setAuthMode] = (0, import_react46.useState)("password");
|
|
16160
|
+
const [username, setUsername] = (0, import_react46.useState)(""), [password, setPassword] = (0, import_react46.useState)(""), [mfaToken, setMfaToken] = (0, import_react46.useState)("");
|
|
16161
|
+
const [busy, setBusy] = (0, import_react46.useState)(false);
|
|
16162
|
+
const [feedback, setFeedback] = (0, import_react46.useState)("");
|
|
16163
|
+
const [deleting, setDeleting] = (0, import_react46.useState)();
|
|
16164
|
+
const [adding, setAdding] = (0, import_react46.useState)(false);
|
|
16165
|
+
const [fixedPlatform, setFixedPlatform] = (0, import_react46.useState)(false);
|
|
16166
|
+
const [configuring, setConfiguring] = (0, import_react46.useState)();
|
|
16131
16167
|
const closeAdd = () => {
|
|
16132
16168
|
setAdding(false);
|
|
16133
16169
|
setToken("");
|
|
@@ -16171,19 +16207,19 @@ function ChannelsPanel({ companion, snapshot, onChanged, weixin }) {
|
|
|
16171
16207
|
}
|
|
16172
16208
|
setFeedback(save ? "\u8D26\u53F7\u5DF2\u4FDD\u5B58\u3002\u8BF7\u542F\u7528\u6E20\u9053\uFF0C\u518D\u5411\u673A\u5668\u4EBA\u53D1\u9001\u79C1\u804A\u6D88\u606F\uFF0C\u6838\u5BF9\u914D\u5BF9\u7801\u5E76\u6279\u51C6\u8054\u7CFB\u4EBA\u3002" : "\u8D26\u53F7\u9A8C\u8BC1\u901A\u8FC7\uFF0C\u53EF\u4EE5\u4FDD\u5B58\u3002");
|
|
16173
16209
|
});
|
|
16174
|
-
return /* @__PURE__ */ (0,
|
|
16175
|
-
/* @__PURE__ */ (0,
|
|
16176
|
-
/* @__PURE__ */ (0,
|
|
16177
|
-
/* @__PURE__ */ (0,
|
|
16210
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { id: "dsh-partner-channels", className: "dsh-partner-form is-channel dsh-partner-channels", children: [
|
|
16211
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "dsh-partner-channel-toolbar", children: [
|
|
16212
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(SectionHeading, { eyebrow: "CHANNELS", title: "\u6211\u7684\u6E20\u9053", detail: "\u67E5\u770B\u8FDE\u63A5\u72B6\u6001\uFF0C\u7BA1\u7406\u8054\u7CFB\u4EBA\u4E0E\u901A\u77E5\u6295\u9012\u3002" }),
|
|
16213
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { type: "button", onClick: () => openAdd(), children: "\u6DFB\u52A0\u6E20\u9053" })
|
|
16178
16214
|
] }),
|
|
16179
|
-
!adding && feedback && /* @__PURE__ */ (0,
|
|
16180
|
-
adding && /* @__PURE__ */ (0,
|
|
16215
|
+
!adding && feedback && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { role: "status", children: feedback }),
|
|
16216
|
+
adding && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(WorkspaceDialog, { title: fixedPlatform ? `${platform === "matrix" ? "Matrix" : "Mattermost"} \u914D\u7F6E` : "\u6DFB\u52A0\u6E20\u9053", detail: platform === "matrix" ? "\u4EC5\u672A\u52A0\u5BC6\u7684\u53CC\u4EBA\u4F1A\u8BDD\u53EF\u83B7\u53D6\u914D\u5BF9\u7801\u3002\u8BF7\u65B0\u5EFA\u672A\u5F00\u542F\u7AEF\u5230\u7AEF\u52A0\u5BC6\u7684\u4F1A\u8BDD\uFF0C\u9080\u8BF7\u673A\u5668\u4EBA\u540E\u53D1\u9001\u6587\u5B57\u6D88\u606F\u3002" : "\u5148\u767B\u5F55\uFF0C\u518D\u5411\u673A\u5668\u4EBA\u53D1\u79C1\u804A\u6D88\u606F\uFF0C\u6838\u5BF9\u914D\u5BF9\u7801\u540E\u6388\u6743\u3002", close: () => {
|
|
16181
16217
|
if (!busy) closeAdd();
|
|
16182
|
-
}, children: /* @__PURE__ */ (0,
|
|
16218
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-channel-form", "aria-busy": busy, onSubmit: (event) => {
|
|
16183
16219
|
event.preventDefault();
|
|
16184
16220
|
void configure2(true);
|
|
16185
16221
|
}, children: [
|
|
16186
|
-
!fixedPlatform && /* @__PURE__ */ (0,
|
|
16222
|
+
!fixedPlatform && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormField2, { label: "\u5E73\u53F0", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("select", { autoFocus: true, disabled: busy, value: platform, onChange: (e) => {
|
|
16187
16223
|
setPlatform(e.target.value);
|
|
16188
16224
|
setPassword("");
|
|
16189
16225
|
setToken("");
|
|
@@ -16191,150 +16227,150 @@ function ChannelsPanel({ companion, snapshot, onChanged, weixin }) {
|
|
|
16191
16227
|
setTargetId("");
|
|
16192
16228
|
setFeedback("");
|
|
16193
16229
|
}, children: [
|
|
16194
|
-
/* @__PURE__ */ (0,
|
|
16195
|
-
/* @__PURE__ */ (0,
|
|
16230
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("option", { value: "matrix", children: "Matrix" }),
|
|
16231
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("option", { value: "mattermost", children: "Mattermost" })
|
|
16196
16232
|
] }) }),
|
|
16197
|
-
/* @__PURE__ */ (0,
|
|
16198
|
-
/* @__PURE__ */ (0,
|
|
16199
|
-
/* @__PURE__ */ (0,
|
|
16200
|
-
/* @__PURE__ */ (0,
|
|
16201
|
-
/* @__PURE__ */ (0,
|
|
16233
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormField2, { label: "\u6E20\u9053\u540D\u79F0", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("input", { autoFocus: fixedPlatform, disabled: busy, maxLength: 80, value: name, onChange: (e) => setName(e.target.value), placeholder: `\u4F8B\u5982\uFF1A\u6211\u7684 ${platform === "matrix" ? "Matrix" : "Mattermost"}` }) }),
|
|
16234
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormField2, { label: "\u670D\u52A1\u5668\u5730\u5740", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("input", { disabled: busy, required: true, type: "url", value: baseUrl, onChange: (e) => setBaseUrl(e.target.value), placeholder: "https://chat.example.com" }) }),
|
|
16235
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("details", { children: [
|
|
16236
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("summary", { children: "\u9AD8\u7EA7\u914D\u7F6E\uFF08\u53EF\u9009\uFF09" }),
|
|
16237
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormField2, { label: platform === "matrix" ? "\u56FA\u5B9A\u623F\u95F4 ID" : "\u56FA\u5B9A DM \u4F1A\u8BDD ID", hint: "\u7559\u7A7A\u5219\u81EA\u52A8\u53D1\u73B0\u79C1\u804A\uFF0C\u901A\u8FC7\u914D\u5BF9\u6388\u6743\u3002\u586B\u5199\u540E\u4EC5\u76D1\u542C\u6307\u5B9A\u4F1A\u8BDD\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("input", { disabled: busy, value: targetId, onChange: (e) => setTargetId(e.target.value), placeholder: platform === "matrix" ? "!room:example.com" : "DM channel ID" }) })
|
|
16202
16238
|
] }),
|
|
16203
|
-
/* @__PURE__ */ (0,
|
|
16239
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormField2, { label: "\u767B\u5F55\u65B9\u5F0F", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("select", { disabled: busy, value: authMode, onChange: (e) => {
|
|
16204
16240
|
setAuthMode(e.target.value);
|
|
16205
16241
|
setToken("");
|
|
16206
16242
|
setPassword("");
|
|
16207
16243
|
setMfaToken("");
|
|
16208
16244
|
}, children: [
|
|
16209
|
-
/* @__PURE__ */ (0,
|
|
16210
|
-
/* @__PURE__ */ (0,
|
|
16245
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("option", { value: "password", children: "\u8D26\u53F7\u5BC6\u7801" }),
|
|
16246
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("option", { value: "token", children: "Access Token" })
|
|
16211
16247
|
] }) }),
|
|
16212
|
-
authMode === "password" ? /* @__PURE__ */ (0,
|
|
16213
|
-
/* @__PURE__ */ (0,
|
|
16214
|
-
/* @__PURE__ */ (0,
|
|
16215
|
-
platform === "mattermost" && /* @__PURE__ */ (0,
|
|
16216
|
-
] }) : /* @__PURE__ */ (0,
|
|
16217
|
-
feedback && /* @__PURE__ */ (0,
|
|
16218
|
-
/* @__PURE__ */ (0,
|
|
16219
|
-
/* @__PURE__ */ (0,
|
|
16220
|
-
/* @__PURE__ */ (0,
|
|
16221
|
-
/* @__PURE__ */ (0,
|
|
16248
|
+
authMode === "password" ? /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
|
|
16249
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormField2, { label: "\u8D26\u53F7", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("input", { disabled: busy, required: true, autoComplete: "username", value: username, onChange: (e) => setUsername(e.target.value), placeholder: platform === "matrix" ? "@\u8D26\u53F7:\u670D\u52A1\u5668\u57DF\u540D" : "\u7528\u6237\u540D\u6216\u90AE\u7BB1" }) }),
|
|
16250
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormField2, { label: "\u5BC6\u7801", hint: "\u4EC5\u7528\u4E8E\u6362\u53D6\u4EE4\u724C\uFF0C\u4E0D\u4FDD\u5B58\u5BC6\u7801\uFF1B\u8BF7\u4F18\u5148\u4F7F\u7528 HTTPS \u670D\u52A1\u5668\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("input", { disabled: busy, required: true, type: "password", autoComplete: "current-password", value: password, onChange: (e) => setPassword(e.target.value) }) }),
|
|
16251
|
+
platform === "mattermost" && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormField2, { label: "\u53CC\u91CD\u9A8C\u8BC1\u9A8C\u8BC1\u7801\uFF08\u5982\u5DF2\u5F00\u542F\uFF09", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("input", { disabled: busy, autoComplete: "one-time-code", inputMode: "numeric", value: mfaToken, onChange: (e) => setMfaToken(e.target.value) }) })
|
|
16252
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(FormField2, { label: "Access Token", hint: "\u4EC5\u4FDD\u5B58\u81F3 DSH \u51ED\u636E\u5E93\uFF1B\u5EFA\u8BAE HTTPS\uFF0CHTTP \u4F1A\u660E\u6587\u4F20\u8F93\u51ED\u636E\u3002", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("input", { disabled: busy, required: true, type: "password", autoComplete: "new-password", value: botToken, onChange: (e) => setToken(e.target.value) }) }),
|
|
16253
|
+
feedback && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { role: "status", children: feedback }),
|
|
16254
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("footer", { children: [
|
|
16255
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { type: "button", disabled: busy, onClick: closeAdd, children: "\u53D6\u6D88" }),
|
|
16256
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { type: "button", disabled: busy || !(authMode === "password" ? username && password : botToken) || !baseUrl, onClick: () => void configure2(false), children: "\u6D4B\u8BD5\u8FDE\u63A5" }),
|
|
16257
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { className: "is-primary", disabled: busy, children: busy ? "\u5904\u7406\u4E2D\u2026" : "\u4FDD\u5B58\u6E20\u9053" })
|
|
16222
16258
|
] })
|
|
16223
16259
|
] }) }),
|
|
16224
|
-
/* @__PURE__ */ (0,
|
|
16225
|
-
/* @__PURE__ */ (0,
|
|
16226
|
-
/* @__PURE__ */ (0,
|
|
16227
|
-
/* @__PURE__ */ (0,
|
|
16228
|
-
/* @__PURE__ */ (0,
|
|
16260
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "dsh-partner-channel-list", children: [
|
|
16261
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "dsh-partner-channel-row", children: [
|
|
16262
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { children: [
|
|
16263
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("strong", { children: "\u5FAE\u4FE1" }),
|
|
16264
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("small", { children: channels.some((c) => !c.platform || c.platform === "weixin") ? "\u7BA1\u7406\u8FDE\u63A5\u4E0E\u79C1\u804A\u6388\u6743" : "\u5C1A\u672A\u8FDE\u63A5 \xB7 \u626B\u7801\u63A5\u5165" })
|
|
16229
16265
|
] }),
|
|
16230
|
-
channels.find((c) => !c.platform || c.platform === "weixin") && /* @__PURE__ */ (0,
|
|
16231
|
-
/* @__PURE__ */ (0,
|
|
16232
|
-
configuring === "weixin" && /* @__PURE__ */ (0,
|
|
16266
|
+
channels.find((c) => !c.platform || c.platform === "weixin") && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ChannelStatus, { channel: channels.find((c) => !c.platform || c.platform === "weixin") }),
|
|
16267
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { type: "button", "aria-label": "\u914D\u7F6E\u5FAE\u4FE1", onClick: () => setConfiguring("weixin"), children: "\u914D\u7F6E" }),
|
|
16268
|
+
configuring === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(WorkspaceDialog, { title: "\u5FAE\u4FE1\u914D\u7F6E", detail: "\u7BA1\u7406\u626B\u7801\u767B\u5F55\u3001\u8FDE\u63A5\u4E0E\u8054\u7CFB\u4EBA\u6388\u6743\u3002", close: () => setConfiguring(void 0), children: weixin })
|
|
16233
16269
|
] }),
|
|
16234
|
-
["matrix", "mattermost"].filter((platform2) => !channels.some((c) => c.platform === platform2)).map((platform2) => /* @__PURE__ */ (0,
|
|
16235
|
-
/* @__PURE__ */ (0,
|
|
16236
|
-
/* @__PURE__ */ (0,
|
|
16237
|
-
/* @__PURE__ */ (0,
|
|
16270
|
+
["matrix", "mattermost"].filter((platform2) => !channels.some((c) => c.platform === platform2)).map((platform2) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "dsh-partner-channel-row", children: [
|
|
16271
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { children: [
|
|
16272
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("strong", { children: platform2 === "matrix" ? "Matrix" : "Mattermost" }),
|
|
16273
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("small", { children: "\u5C1A\u672A\u8FDE\u63A5" })
|
|
16238
16274
|
] }),
|
|
16239
|
-
/* @__PURE__ */ (0,
|
|
16275
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { type: "button", "aria-label": `\u914D\u7F6E ${platform2}`, onClick: () => openAdd(platform2), children: "\u914D\u7F6E" })
|
|
16240
16276
|
] }, platform2)),
|
|
16241
|
-
channels.filter((c) => c.platform && c.platform !== "weixin").map((channel) => /* @__PURE__ */ (0,
|
|
16242
|
-
/* @__PURE__ */ (0,
|
|
16243
|
-
/* @__PURE__ */ (0,
|
|
16244
|
-
/* @__PURE__ */ (0,
|
|
16277
|
+
channels.filter((c) => c.platform && c.platform !== "weixin").map((channel) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "dsh-partner-channel-row has-notice-slot", children: [
|
|
16278
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { children: [
|
|
16279
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("strong", { children: channel.name }),
|
|
16280
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("small", { children: [
|
|
16245
16281
|
channel.platform,
|
|
16246
16282
|
" \xB7 ",
|
|
16247
16283
|
pairings.filter((p) => p.channelId === channel.id && p.status === "pending").length,
|
|
16248
16284
|
" \u4E2A\u5F85\u6388\u6743"
|
|
16249
16285
|
] })
|
|
16250
16286
|
] }),
|
|
16251
|
-
/* @__PURE__ */ (0,
|
|
16252
|
-
/* @__PURE__ */ (0,
|
|
16287
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ChannelStatus, { channel }),
|
|
16288
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { type: "button", "aria-label": `\u914D\u7F6E ${channel.name}`, onClick: () => {
|
|
16253
16289
|
setFeedback("");
|
|
16254
16290
|
setConfiguring(channel.id);
|
|
16255
16291
|
}, children: "\u914D\u7F6E" }),
|
|
16256
|
-
configuring === channel.id && /* @__PURE__ */ (0,
|
|
16292
|
+
configuring === channel.id && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(WorkspaceDialog, { title: `${channel.name} \xB7 \u914D\u7F6E`, detail: "\u7BA1\u7406\u8FDE\u63A5\u72B6\u6001\u53CA\u8054\u7CFB\u4EBA\u8BBF\u95EE\u6743\u9650\u3002", close: () => {
|
|
16257
16293
|
if (!busy) {
|
|
16258
16294
|
setConfiguring(void 0);
|
|
16259
16295
|
setDeleting(void 0);
|
|
16260
16296
|
}
|
|
16261
|
-
}, children: /* @__PURE__ */ (0,
|
|
16262
|
-
/* @__PURE__ */ (0,
|
|
16263
|
-
/* @__PURE__ */ (0,
|
|
16264
|
-
/* @__PURE__ */ (0,
|
|
16265
|
-
/* @__PURE__ */ (0,
|
|
16266
|
-
channel.direct?.targetId && /* @__PURE__ */ (0,
|
|
16297
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "dsh-partner-channel-detail dsh-partner-channel-manage", children: [
|
|
16298
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "dsh-partner-channel-connection", children: [
|
|
16299
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { children: [
|
|
16300
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("small", { children: "\u767B\u5F55\u8D26\u53F7" }),
|
|
16301
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("strong", { children: channel.accountId }),
|
|
16302
|
+
channel.direct?.targetId && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("small", { children: channel.direct.targetId })
|
|
16267
16303
|
] }),
|
|
16268
|
-
/* @__PURE__ */ (0,
|
|
16304
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(ChannelStatus, { channel })
|
|
16269
16305
|
] }),
|
|
16270
|
-
channel.platform === "matrix" && /* @__PURE__ */ (0,
|
|
16271
|
-
!channel.direct?.targetId && /* @__PURE__ */ (0,
|
|
16272
|
-
channel.lastError && /* @__PURE__ */ (0,
|
|
16273
|
-
/* @__PURE__ */ (0,
|
|
16274
|
-
/* @__PURE__ */ (0,
|
|
16306
|
+
channel.platform === "matrix" && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { children: "\u4EC5\u652F\u6301\u672A\u52A0\u5BC6\u7684\u53CC\u4EBA\u4F1A\u8BDD\u3002\u52A0\u5BC6\u4F1A\u8BDD\u65E0\u6CD5\u8BFB\u53D6\u6D88\u606F\u6216\u53D1\u9001\u914D\u5BF9\u7801\uFF1B\u8BF7\u65B0\u5EFA\u672A\u5F00\u542F\u7AEF\u5230\u7AEF\u52A0\u5BC6\u7684\u4F1A\u8BDD\uFF0C\u9080\u8BF7\u673A\u5668\u4EBA\u540E\u53D1\u9001\u6587\u5B57\u6D88\u606F\u3002\u68C0\u6D4B\u5230\u52A0\u5BC6\u4F1A\u8BDD\u65F6\u4F1A\u5728\u6B64\u63D0\u793A\uFF0C\u4E0D\u5F71\u54CD\u5176\u4ED6\u672A\u52A0\u5BC6\u4F1A\u8BDD\u3002" }),
|
|
16307
|
+
!channel.direct?.targetId && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { children: "\u5411\u673A\u5668\u4EBA\u53D1\u79C1\u804A\u6D88\u606F\uFF0C\u5728\u4E0B\u65B9\u6838\u5BF9\u914D\u5BF9\u7801\u540E\u6279\u51C6\u3002\u8BF7\u6C42\u4F1A\u81EA\u52A8\u66F4\u65B0\u3002" }),
|
|
16308
|
+
channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { role: "alert", children: channel.lastError }),
|
|
16309
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "dsh-partner-form-actions", children: [
|
|
16310
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
|
|
16275
16311
|
await api(`/channels/${channel.id}/enabled`, { method: "POST", body: JSON.stringify({ enabled: !channel.enabled }) });
|
|
16276
16312
|
await onChanged();
|
|
16277
16313
|
}), children: channel.enabled ? "\u505C\u7528" : "\u542F\u7528" }),
|
|
16278
|
-
channel.enabled && channel.runtimeStatus === "error" && /* @__PURE__ */ (0,
|
|
16314
|
+
channel.enabled && channel.runtimeStatus === "error" && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
|
|
16279
16315
|
await api(`/channels/${channel.id}/enabled`, { method: "POST", body: JSON.stringify({ enabled: true }) });
|
|
16280
16316
|
await onChanged();
|
|
16281
16317
|
}), children: "\u91CD\u8FDE" }),
|
|
16282
|
-
/* @__PURE__ */ (0,
|
|
16318
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { disabled: busy, onClick: () => deleting === channel.id ? void run(async () => {
|
|
16283
16319
|
await api(`/channels/${channel.id}`, { method: "DELETE" });
|
|
16284
16320
|
setDeleting(void 0);
|
|
16285
16321
|
await onChanged();
|
|
16286
16322
|
}) : setDeleting(channel.id), children: deleting === channel.id ? "\u786E\u8BA4\u5220\u9664\u914D\u7F6E\u4E0E\u51ED\u636E" : "\u5220\u9664\u6E20\u9053" }),
|
|
16287
|
-
deleting === channel.id && /* @__PURE__ */ (0,
|
|
16323
|
+
deleting === channel.id && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { onClick: () => setDeleting(void 0), children: "\u53D6\u6D88" })
|
|
16288
16324
|
] }),
|
|
16289
|
-
/* @__PURE__ */ (0,
|
|
16290
|
-
/* @__PURE__ */ (0,
|
|
16291
|
-
/* @__PURE__ */ (0,
|
|
16325
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("section", { className: "dsh-partner-channel-access", children: [
|
|
16326
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("h3", { children: "\u8054\u7CFB\u4EBA\u6388\u6743" }),
|
|
16327
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("p", { role: "status", children: [
|
|
16292
16328
|
pairings.filter((p) => p.channelId === channel.id && p.status === "pending").length,
|
|
16293
16329
|
" \u4E2A\u7B49\u5F85\u6279\u51C6 \xB7 \u81EA\u52A8\u5237\u65B0"
|
|
16294
16330
|
] }),
|
|
16295
|
-
pairings.filter((p) => p.channelId === channel.id).map((p) => /* @__PURE__ */ (0,
|
|
16296
|
-
/* @__PURE__ */ (0,
|
|
16297
|
-
/* @__PURE__ */ (0,
|
|
16298
|
-
/* @__PURE__ */ (0,
|
|
16299
|
-
p.status === "pending" && p.pairingCode && /* @__PURE__ */ (0,
|
|
16331
|
+
pairings.filter((p) => p.channelId === channel.id).map((p) => /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "dsh-partner-channel-person", children: [
|
|
16332
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { children: [
|
|
16333
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("strong", { children: p.displayName }),
|
|
16334
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("small", { children: p.status === "approved" ? "\u5DF2\u6388\u6743" : p.status === "pending" ? "\u7B49\u5F85\u6279\u51C6" : "\u5DF2\u963B\u6B62" }),
|
|
16335
|
+
p.status === "pending" && p.pairingCode && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { children: [
|
|
16300
16336
|
"\u914D\u5BF9\u7801 ",
|
|
16301
|
-
/* @__PURE__ */ (0,
|
|
16337
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("code", { children: p.pairingCode })
|
|
16302
16338
|
] })
|
|
16303
16339
|
] }),
|
|
16304
|
-
/* @__PURE__ */ (0,
|
|
16340
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { disabled: busy, onClick: () => void run(async () => {
|
|
16305
16341
|
await api(`/pairings/${p.id}/status`, { method: "POST", body: JSON.stringify({ status: p.status === "approved" ? "blocked" : "approved" }) });
|
|
16306
16342
|
await onChanged();
|
|
16307
16343
|
}), children: p.status === "approved" ? "\u64A4\u9500\u6388\u6743" : "\u6279\u51C6\u8054\u7CFB\u4EBA" })
|
|
16308
16344
|
] }, p.id))
|
|
16309
16345
|
] }),
|
|
16310
|
-
feedback && /* @__PURE__ */ (0,
|
|
16346
|
+
feedback && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { role: "status", children: feedback })
|
|
16311
16347
|
] }) }),
|
|
16312
|
-
channel.lastError && /* @__PURE__ */ (0,
|
|
16313
|
-
/* @__PURE__ */ (0,
|
|
16314
|
-
/* @__PURE__ */ (0,
|
|
16348
|
+
channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "dsh-partner-channel-inline-notice", role: "status", "aria-atomic": "true", children: [
|
|
16349
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("strong", { children: channel.runtimeStatus === "running" ? "\u4F1A\u8BDD\u63D0\u793A" : "\u8FDE\u63A5\u63D0\u793A" }),
|
|
16350
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("p", { children: channel.lastError })
|
|
16315
16351
|
] })
|
|
16316
16352
|
] }, channel.id))
|
|
16317
16353
|
] }),
|
|
16318
|
-
/* @__PURE__ */ (0,
|
|
16319
|
-
/* @__PURE__ */ (0,
|
|
16320
|
-
/* @__PURE__ */ (0,
|
|
16321
|
-
/* @__PURE__ */ (0,
|
|
16354
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("section", { className: "dsh-partner-channel-notifications", "aria-label": "\u901A\u77E5\u8BBE\u7F6E", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "dsh-partner-channel-row", children: [
|
|
16355
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("span", { children: [
|
|
16356
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("strong", { children: "\u901A\u77E5\u4E0E\u4EA4\u4ED8" }),
|
|
16357
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("small", { children: companion.notificationDelivery?.mode === "selected" ? `\u5DF2\u6307\u5B9A ${companion.notificationDelivery.targets.length} \u4F4D\u63A5\u6536\u4EBA` : "\u9ED8\u8BA4\u8DDF\u968F\u6700\u8FD1\u6E20\u9053\u4E0E\u7528\u6237" })
|
|
16322
16358
|
] }),
|
|
16323
|
-
/* @__PURE__ */ (0,
|
|
16359
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("button", { type: "button", onClick: () => setConfiguring("delivery"), children: "\u914D\u7F6E" })
|
|
16324
16360
|
] }) }),
|
|
16325
|
-
configuring === "delivery" && /* @__PURE__ */ (0,
|
|
16361
|
+
configuring === "delivery" && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(WorkspaceDialog, { title: "\u901A\u77E5\u4E0E\u4EA4\u4ED8", detail: "\u9009\u62E9\u901A\u77E5\u6E20\u9053\uFF0C\u518D\u9009\u62E9\u5404\u6E20\u9053\u7684\u63A5\u6536\u4EBA\uFF1B\u652F\u6301\u540C\u65F6\u6295\u9012\u3002", close: () => setConfiguring(void 0), children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(NotificationSettings, { companion, snapshot, onChanged }) })
|
|
16326
16362
|
] });
|
|
16327
16363
|
}
|
|
16328
16364
|
function FormField2({ label, hint, children }) {
|
|
16329
|
-
return /* @__PURE__ */ (0,
|
|
16330
|
-
/* @__PURE__ */ (0,
|
|
16365
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("label", { className: "dsh-partner-channel-field", children: [
|
|
16366
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { children: label }),
|
|
16331
16367
|
children,
|
|
16332
|
-
hint && /* @__PURE__ */ (0,
|
|
16368
|
+
hint && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("small", { children: hint })
|
|
16333
16369
|
] });
|
|
16334
16370
|
}
|
|
16335
16371
|
|
|
16336
16372
|
// src/ui/use-channel-status.ts
|
|
16337
|
-
var
|
|
16373
|
+
var import_react47 = require("react");
|
|
16338
16374
|
var listeners2 = /* @__PURE__ */ new Set();
|
|
16339
16375
|
var timer;
|
|
16340
16376
|
var active;
|
|
@@ -16359,7 +16395,7 @@ async function poll() {
|
|
|
16359
16395
|
}
|
|
16360
16396
|
}
|
|
16361
16397
|
function useChannelStatus(setSnapshot) {
|
|
16362
|
-
(0,
|
|
16398
|
+
(0, import_react47.useEffect)(() => {
|
|
16363
16399
|
const update = (value) => setSnapshot((previous3) => previous3 ? { ...previous3, ...value } : previous3);
|
|
16364
16400
|
listeners2.add(update);
|
|
16365
16401
|
lastValue = "";
|
|
@@ -16513,12 +16549,12 @@ var form_surface_default = `/* Deliberate, local boundary against host themes wi
|
|
|
16513
16549
|
`;
|
|
16514
16550
|
|
|
16515
16551
|
// src/ui/companion-create.tsx
|
|
16516
|
-
var
|
|
16517
|
-
var
|
|
16518
|
-
var
|
|
16552
|
+
var import_react48 = require("react");
|
|
16553
|
+
var import_dsh_client_ui_primitives23 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
16554
|
+
var import_jsx_runtime44 = require("react/jsx-runtime");
|
|
16519
16555
|
function CompanionCreateDialog({ close, create }) {
|
|
16520
|
-
const [busy, setBusy] = (0,
|
|
16521
|
-
const [error, setError] = (0,
|
|
16556
|
+
const [busy, setBusy] = (0, import_react48.useState)(false);
|
|
16557
|
+
const [error, setError] = (0, import_react48.useState)();
|
|
16522
16558
|
const submit = async (event) => {
|
|
16523
16559
|
event.preventDefault();
|
|
16524
16560
|
const data = new FormData(event.currentTarget);
|
|
@@ -16537,30 +16573,30 @@ function CompanionCreateDialog({ close, create }) {
|
|
|
16537
16573
|
setBusy(false);
|
|
16538
16574
|
}
|
|
16539
16575
|
};
|
|
16540
|
-
return /* @__PURE__ */ (0,
|
|
16576
|
+
return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(WorkspaceDialog, { title: "\u65B0\u5EFA\u4F19\u4F34", detail: "\u5148\u5EFA\u7ACB\u6E05\u6670\u7684\u8EAB\u4EFD\u548C\u804C\u8D23\u3002\u6A21\u578B\u3001\u5DE5\u5177\u3001Skill \u4E0E\u534F\u4F5C\u6743\u9650\u4F1A\u5728\u521B\u5EFA\u540E\u5355\u72EC\u914D\u7F6E\u3002", close, width: "wide", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("form", { className: "dsh-partner-feature-form dsh-partner-companion-create-form", "aria-busy": busy, onSubmit: (event) => {
|
|
16541
16577
|
void submit(event);
|
|
16542
16578
|
}, children: [
|
|
16543
|
-
/* @__PURE__ */ (0,
|
|
16544
|
-
/* @__PURE__ */ (0,
|
|
16545
|
-
/* @__PURE__ */ (0,
|
|
16579
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { children: [
|
|
16580
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { children: "\u4F19\u4F34\u540D\u5B57" }),
|
|
16581
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("input", { name: "name", required: true, maxLength: 60, autoFocus: true, placeholder: "\u4F8B\u5982\uFF1A\u5C0F\u9ED1" })
|
|
16546
16582
|
] }),
|
|
16547
|
-
/* @__PURE__ */ (0,
|
|
16548
|
-
/* @__PURE__ */ (0,
|
|
16549
|
-
/* @__PURE__ */ (0,
|
|
16583
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { children: [
|
|
16584
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { children: "\u4E3B\u8981\u89D2\u8272" }),
|
|
16585
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("input", { name: "role", required: true, maxLength: 120, placeholder: "\u4F8B\u5982\uFF1A\u4EA7\u54C1\u4E0E\u5DE5\u7A0B\u534F\u4F5C\u4F19\u4F34" })
|
|
16550
16586
|
] }),
|
|
16551
|
-
/* @__PURE__ */ (0,
|
|
16552
|
-
/* @__PURE__ */ (0,
|
|
16553
|
-
/* @__PURE__ */ (0,
|
|
16587
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { className: "is-wide", children: [
|
|
16588
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { children: "\u4E00\u53E5\u8BDD\u5B9A\u4F4D" }),
|
|
16589
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("input", { name: "description", maxLength: 500, placeholder: "\u5B83\u4E3B\u8981\u8D1F\u8D23\u4EC0\u4E48\uFF0C\u4EC0\u4E48\u65F6\u5019\u5E94\u8BE5\u627E\u5B83" })
|
|
16554
16590
|
] }),
|
|
16555
|
-
/* @__PURE__ */ (0,
|
|
16556
|
-
/* @__PURE__ */ (0,
|
|
16557
|
-
/* @__PURE__ */ (0,
|
|
16591
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("label", { className: "is-wide", children: [
|
|
16592
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { children: "\u521D\u59CB\u884C\u4E3A\u51C6\u5219" }),
|
|
16593
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("textarea", { name: "instructions", maxLength: 12e3, rows: 7, placeholder: "\u5199\u6E05\u804C\u8D23\u3001\u8868\u8FBE\u65B9\u5F0F\u3001\u5DE5\u4F5C\u8FB9\u754C\u548C\u4EA4\u4ED8\u6807\u51C6\uFF1B\u4E5F\u53EF\u4EE5\u521B\u5EFA\u540E\u518D\u5B8C\u5584" })
|
|
16558
16594
|
] }),
|
|
16559
|
-
error && /* @__PURE__ */ (0,
|
|
16560
|
-
/* @__PURE__ */ (0,
|
|
16561
|
-
/* @__PURE__ */ (0,
|
|
16562
|
-
/* @__PURE__ */ (0,
|
|
16563
|
-
/* @__PURE__ */ (0,
|
|
16595
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(WorkspaceNotice, { children: error }),
|
|
16596
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("footer", { children: [
|
|
16597
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)("button", { type: "button", disabled: busy, onClick: close, children: "\u53D6\u6D88" }),
|
|
16598
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsxs)("button", { type: "submit", className: "is-primary", disabled: busy, children: [
|
|
16599
|
+
/* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_dsh_client_ui_primitives23.IconPlusOutlineRegular, { size: 14 }),
|
|
16564
16600
|
busy ? "\u6B63\u5728\u521B\u5EFA\u2026" : "\u521B\u5EFA\u4F19\u4F34"
|
|
16565
16601
|
] })
|
|
16566
16602
|
] })
|
|
@@ -16568,7 +16604,7 @@ function CompanionCreateDialog({ close, create }) {
|
|
|
16568
16604
|
}
|
|
16569
16605
|
|
|
16570
16606
|
// src/main-panel-compat.ts
|
|
16571
|
-
var
|
|
16607
|
+
var import_react49 = require("react");
|
|
16572
16608
|
function registerMainPanel(ctx, id, priority, render, onHidden = () => {
|
|
16573
16609
|
}) {
|
|
16574
16610
|
const layout = ctx.layout;
|
|
@@ -16579,7 +16615,7 @@ function registerMainPanel(ctx, id, priority, render, onHidden = () => {
|
|
|
16579
16615
|
let disposed = false;
|
|
16580
16616
|
let generation = 0;
|
|
16581
16617
|
const Body = (props) => {
|
|
16582
|
-
(0,
|
|
16618
|
+
(0, import_react49.useEffect)(() => {
|
|
16583
16619
|
const current2 = ++generation;
|
|
16584
16620
|
return () => {
|
|
16585
16621
|
queueMicrotask(() => {
|
|
@@ -16686,10 +16722,10 @@ function sessions(ctx) {
|
|
|
16686
16722
|
}
|
|
16687
16723
|
|
|
16688
16724
|
// src/ui/workspace-navigation.tsx
|
|
16689
|
-
var
|
|
16725
|
+
var import_dsh_client_ui_primitives24 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
16690
16726
|
|
|
16691
16727
|
// src/ui/storage-settings.tsx
|
|
16692
|
-
var
|
|
16728
|
+
var import_react51 = require("react");
|
|
16693
16729
|
|
|
16694
16730
|
// src/ui/storage-recovery.ts
|
|
16695
16731
|
var StorageStatusError = class extends Error {
|
|
@@ -16737,16 +16773,16 @@ async function waitForStorage(signal, onWait, options = {}) {
|
|
|
16737
16773
|
}
|
|
16738
16774
|
|
|
16739
16775
|
// src/ui/attachment-storage.tsx
|
|
16740
|
-
var
|
|
16741
|
-
var
|
|
16776
|
+
var import_react50 = require("react");
|
|
16777
|
+
var import_jsx_runtime45 = require("react/jsx-runtime");
|
|
16742
16778
|
var size = (bytes) => `${(bytes / 1048576).toFixed(2)} MiB`;
|
|
16743
16779
|
function AttachmentStoragePanel() {
|
|
16744
|
-
const [view, setView] = (0,
|
|
16745
|
-
const [owner, setOwner] = (0,
|
|
16746
|
-
const [selected, setSelected] = (0,
|
|
16747
|
-
const [error, setError] = (0,
|
|
16748
|
-
const [expanded, setExpanded] = (0,
|
|
16749
|
-
(0,
|
|
16780
|
+
const [view, setView] = (0, import_react50.useState)(), [limit, setLimit] = (0, import_react50.useState)("512");
|
|
16781
|
+
const [owner, setOwner] = (0, import_react50.useState)(""), [days, setDays] = (0, import_react50.useState)("0"), [offset, setOffset] = (0, import_react50.useState)(0);
|
|
16782
|
+
const [selected, setSelected] = (0, import_react50.useState)([]), [busy, setBusy] = (0, import_react50.useState)(false), [confirm, setConfirm] = (0, import_react50.useState)(false);
|
|
16783
|
+
const [error, setError] = (0, import_react50.useState)(""), [notice, setNotice] = (0, import_react50.useState)(""), [revision, setRevision] = (0, import_react50.useState)(0);
|
|
16784
|
+
const [expanded, setExpanded] = (0, import_react50.useState)(false);
|
|
16785
|
+
(0, import_react50.useEffect)(() => {
|
|
16750
16786
|
const controller = new AbortController();
|
|
16751
16787
|
setBusy(true);
|
|
16752
16788
|
setSelected([]);
|
|
@@ -16790,65 +16826,65 @@ function AttachmentStoragePanel() {
|
|
|
16790
16826
|
setBusy(false);
|
|
16791
16827
|
}
|
|
16792
16828
|
};
|
|
16793
|
-
return /* @__PURE__ */ (0,
|
|
16794
|
-
/* @__PURE__ */ (0,
|
|
16795
|
-
/* @__PURE__ */ (0,
|
|
16796
|
-
/* @__PURE__ */ (0,
|
|
16797
|
-
/* @__PURE__ */ (0,
|
|
16798
|
-
/* @__PURE__ */ (0,
|
|
16829
|
+
return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(WorkspaceBlock, { title: "\u9644\u4EF6\u5B58\u50A8", className: "attachment-storage-block", children: [
|
|
16830
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { id: "partner-attachment-storage", className: "dsh-partner-attachment-storage", "aria-busy": busy, children: [
|
|
16831
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "attachment-storage-overview", children: [
|
|
16832
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "attachment-storage-usage", children: [
|
|
16833
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("strong", { children: view ? `${size(view.usedBytes)} / ${view.limitMiB} MiB` : "\u6B63\u5728\u8BFB\u53D6\u2026" }),
|
|
16834
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("small", { children: view ? `${view.count} \u4E2A\u526F\u672C \xB7 \u5168\u90E8\u4F19\u4F34\u5171\u4EAB` : "\u6B63\u5728\u7EDF\u8BA1\u9644\u4EF6\u5360\u7528" })
|
|
16799
16835
|
] }),
|
|
16800
|
-
/* @__PURE__ */ (0,
|
|
16836
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("form", { onSubmit: (e) => {
|
|
16801
16837
|
e.preventDefault();
|
|
16802
16838
|
void save();
|
|
16803
16839
|
}, children: [
|
|
16804
|
-
/* @__PURE__ */ (0,
|
|
16840
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { children: [
|
|
16805
16841
|
"\u989D\u5EA6",
|
|
16806
|
-
/* @__PURE__ */ (0,
|
|
16807
|
-
/* @__PURE__ */ (0,
|
|
16842
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("input", { "aria-label": "\u603B\u989D\u5EA6\uFF08MiB\uFF09", type: "number", min: "64", max: "1048576", step: "1", required: true, value: limit, disabled: busy, onChange: (e) => setLimit(e.target.value) }),
|
|
16843
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("span", { children: "MiB" })
|
|
16808
16844
|
] }),
|
|
16809
|
-
/* @__PURE__ */ (0,
|
|
16845
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("button", { "aria-label": "\u4FDD\u5B58\u989D\u5EA6", disabled: busy || !view || Number(limit) === view.limitMiB, children: "\u4FDD\u5B58" })
|
|
16810
16846
|
] }),
|
|
16811
|
-
/* @__PURE__ */ (0,
|
|
16847
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("button", { type: "button", "aria-expanded": expanded, "aria-controls": "attachment-storage-manager", onClick: () => setExpanded((v) => !v), children: expanded ? "\u6536\u8D77\u660E\u7EC6" : "\u7BA1\u7406\u526F\u672C" })
|
|
16812
16848
|
] }),
|
|
16813
|
-
expanded && /* @__PURE__ */ (0,
|
|
16814
|
-
/* @__PURE__ */ (0,
|
|
16815
|
-
/* @__PURE__ */ (0,
|
|
16849
|
+
expanded && /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { id: "attachment-storage-manager", children: [
|
|
16850
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "attachment-storage-filters", children: [
|
|
16851
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { children: [
|
|
16816
16852
|
"\u4F19\u4F34",
|
|
16817
|
-
/* @__PURE__ */ (0,
|
|
16853
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("select", { value: owner, disabled: busy, onChange: (e) => {
|
|
16818
16854
|
setOwner(e.target.value);
|
|
16819
16855
|
setOffset(0);
|
|
16820
16856
|
}, children: [
|
|
16821
|
-
/* @__PURE__ */ (0,
|
|
16822
|
-
view?.owners.map((o) => /* @__PURE__ */ (0,
|
|
16857
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("option", { value: "", children: "\u5168\u90E8\u4F19\u4F34" }),
|
|
16858
|
+
view?.owners.map((o) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("option", { value: o.id, children: o.name }, o.id))
|
|
16823
16859
|
] })
|
|
16824
16860
|
] }),
|
|
16825
|
-
/* @__PURE__ */ (0,
|
|
16861
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { children: [
|
|
16826
16862
|
"\u521B\u5EFA\u65F6\u95F4",
|
|
16827
|
-
/* @__PURE__ */ (0,
|
|
16863
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("select", { value: days, disabled: busy, onChange: (e) => {
|
|
16828
16864
|
setDays(e.target.value);
|
|
16829
16865
|
setOffset(0);
|
|
16830
16866
|
}, children: [
|
|
16831
|
-
/* @__PURE__ */ (0,
|
|
16832
|
-
/* @__PURE__ */ (0,
|
|
16833
|
-
/* @__PURE__ */ (0,
|
|
16834
|
-
/* @__PURE__ */ (0,
|
|
16867
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("option", { value: "0", children: "\u5168\u90E8\u65F6\u95F4" }),
|
|
16868
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("option", { value: "7", children: "7 \u5929\u4EE5\u524D" }),
|
|
16869
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("option", { value: "30", children: "30 \u5929\u4EE5\u524D" }),
|
|
16870
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("option", { value: "90", children: "90 \u5929\u4EE5\u524D" })
|
|
16835
16871
|
] })
|
|
16836
16872
|
] }),
|
|
16837
|
-
/* @__PURE__ */ (0,
|
|
16873
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("button", { disabled: busy, onClick: () => setRevision((v) => v + 1), children: "\u5237\u65B0" })
|
|
16838
16874
|
] }),
|
|
16839
|
-
/* @__PURE__ */ (0,
|
|
16840
|
-
/* @__PURE__ */ (0,
|
|
16841
|
-
/* @__PURE__ */ (0,
|
|
16875
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "attachment-storage-selection", children: [
|
|
16876
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("button", { disabled: busy || !view?.items.some((i) => !i.protectedReason), onClick: () => setSelected(selected.length ? [] : view.items.filter((i) => !i.protectedReason).map((i) => i.id)), children: selected.length ? "\u53D6\u6D88\u9009\u62E9" : "\u9009\u62E9\u672C\u9875" }),
|
|
16877
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("small", { children: [
|
|
16842
16878
|
"\u53EF\u6E05\u7406 ",
|
|
16843
16879
|
size(view?.eligibleBytes ?? 0),
|
|
16844
16880
|
" \xB7 \u4F7F\u7528\u4E2D\u7684\u526F\u672C\u53D7\u4FDD\u62A4"
|
|
16845
16881
|
] })
|
|
16846
16882
|
] }),
|
|
16847
|
-
/* @__PURE__ */ (0,
|
|
16848
|
-
/* @__PURE__ */ (0,
|
|
16849
|
-
/* @__PURE__ */ (0,
|
|
16850
|
-
/* @__PURE__ */ (0,
|
|
16851
|
-
/* @__PURE__ */ (0,
|
|
16883
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "attachment-storage-list", children: view?.items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("label", { className: "attachment-storage-row", children: [
|
|
16884
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("input", { type: "checkbox", disabled: busy || !!item.protectedReason, checked: selected.includes(item.id), onChange: (e) => setSelected((ids) => e.target.checked ? [...ids, item.id] : ids.filter((id) => id !== item.id)) }),
|
|
16885
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { children: [
|
|
16886
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("strong", { title: item.name, children: item.name }),
|
|
16887
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("small", { children: [
|
|
16852
16888
|
item.companionName,
|
|
16853
16889
|
" \xB7 ",
|
|
16854
16890
|
size(item.size),
|
|
@@ -16859,60 +16895,60 @@ function AttachmentStoragePanel() {
|
|
|
16859
16895
|
] })
|
|
16860
16896
|
] })
|
|
16861
16897
|
] }, item.id)) }),
|
|
16862
|
-
view && !view.items.length && /* @__PURE__ */ (0,
|
|
16863
|
-
/* @__PURE__ */ (0,
|
|
16864
|
-
/* @__PURE__ */ (0,
|
|
16865
|
-
/* @__PURE__ */ (0,
|
|
16898
|
+
view && !view.items.length && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { children: "\u6CA1\u6709\u7B26\u5408\u6761\u4EF6\u7684\u526F\u672C\u3002" }),
|
|
16899
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: "attachment-storage-filters", children: [
|
|
16900
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("button", { disabled: busy || offset === 0, onClick: () => setOffset(Math.max(0, offset - 30)), children: "\u4E0A\u4E00\u9875" }),
|
|
16901
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("span", { children: [
|
|
16866
16902
|
"\u7B2C ",
|
|
16867
16903
|
Math.floor(offset / 30) + 1,
|
|
16868
16904
|
" \u9875 \xB7 \u5171 ",
|
|
16869
16905
|
view?.filteredCount ?? 0,
|
|
16870
16906
|
" \u9879"
|
|
16871
16907
|
] }),
|
|
16872
|
-
/* @__PURE__ */ (0,
|
|
16873
|
-
/* @__PURE__ */ (0,
|
|
16908
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("button", { disabled: busy || !view || offset + 30 >= view.filteredCount, onClick: () => setOffset(offset + 30), children: "\u4E0B\u4E00\u9875" }),
|
|
16909
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("button", { disabled: busy || !selected.length, onClick: () => setConfirm(true), children: [
|
|
16874
16910
|
"\u6E05\u7406\u6240\u9009\uFF08",
|
|
16875
16911
|
selected.length,
|
|
16876
16912
|
"\uFF09"
|
|
16877
16913
|
] })
|
|
16878
16914
|
] }),
|
|
16879
|
-
/* @__PURE__ */ (0,
|
|
16880
|
-
/* @__PURE__ */ (0,
|
|
16881
|
-
/* @__PURE__ */ (0,
|
|
16882
|
-
/* @__PURE__ */ (0,
|
|
16883
|
-
[...new Set(view?.owners.map((o) => o.directory) ?? [])].map((directory) => /* @__PURE__ */ (0,
|
|
16915
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("details", { className: "attachment-storage-help", children: [
|
|
16916
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("summary", { children: "\u5B58\u50A8\u4E0E\u6E05\u7406\u8BF4\u660E" }),
|
|
16917
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { children: "\u526F\u672C\u7EDF\u4E00\u5B58\u653E\uFF0C\u539F\u6587\u4EF6\u4E0D\u53D7\u5F71\u54CD\u3002\u4E0D\u4F1A\u81EA\u52A8\u6E05\u7406\uFF1B\u964D\u4F4E\u989D\u5EA6\u4E0D\u5220\u9664\u65E7\u526F\u672C\uFF0C\u8D85\u989D\u65F6\u505C\u6B62\u65B0\u589E\u3002\u5355\u6587\u4EF6\u4E0A\u9650 64 MiB\u3002" }),
|
|
16918
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { children: "\u53D1\u9001\u4E2D\u3001\u5931\u8D25\u5F85\u91CD\u8BD5\u3001\u6700\u8FD1 5 \u5206\u949F\u521B\u5EFA\u53CA\u672A\u5B8C\u6210\u4EFB\u52A1/\u9700\u6C42\u5F15\u7528\u7684\u526F\u672C\u4E0D\u80FD\u6E05\u7406\u3002\u6E05\u7406\u540E\u5BF9\u5E94\u5386\u53F2\u4E0B\u8F7D\u94FE\u63A5\u5931\u6548\u3002" }),
|
|
16919
|
+
[...new Set(view?.owners.map((o) => o.directory) ?? [])].map((directory) => /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("code", { children: directory }, directory))
|
|
16884
16920
|
] })
|
|
16885
16921
|
] }),
|
|
16886
|
-
error && /* @__PURE__ */ (0,
|
|
16887
|
-
notice && /* @__PURE__ */ (0,
|
|
16922
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { role: "alert", children: error }),
|
|
16923
|
+
notice && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { role: "status", children: notice })
|
|
16888
16924
|
] }),
|
|
16889
|
-
confirm && /* @__PURE__ */ (0,
|
|
16925
|
+
confirm && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(WorkspaceDialog, { eyebrow: "\u9644\u4EF6\u7BA1\u7406", title: "\u6E05\u7406\u4EA4\u4ED8\u526F\u672C", detail: `\u5DF2\u9009\u62E9 ${selected.length} \u4E2A\u526F\u672C\u3002\u6B64\u64CD\u4F5C\u4E0D\u53EF\u64A4\u9500\u3002`, close: () => {
|
|
16890
16926
|
if (!busy) setConfirm(false);
|
|
16891
|
-
}, children: /* @__PURE__ */ (0,
|
|
16927
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("form", { className: "dsh-partner-feature-form", onSubmit: (event) => {
|
|
16892
16928
|
event.preventDefault();
|
|
16893
16929
|
if (!busy) void clean();
|
|
16894
16930
|
}, children: [
|
|
16895
|
-
/* @__PURE__ */ (0,
|
|
16896
|
-
error && /* @__PURE__ */ (0,
|
|
16897
|
-
/* @__PURE__ */ (0,
|
|
16898
|
-
/* @__PURE__ */ (0,
|
|
16899
|
-
/* @__PURE__ */ (0,
|
|
16931
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "is-wide", children: "\u53EA\u5220\u9664\u4EA4\u4ED8\u526F\u672C\uFF0C\u539F\u59CB\u6587\u4EF6\u4FDD\u6301\u4E0D\u53D8\u3002\u5386\u53F2\u4F1A\u8BDD\u548C\u770B\u677F\u4E2D\u7684\u5BF9\u5E94\u9644\u4EF6\u4E0B\u8F7D\u94FE\u63A5\u5C06\u5931\u6548\u3002\u6267\u884C\u65F6\u4F1A\u518D\u6B21\u68C0\u67E5\u4FDD\u62A4\u72B6\u6001\u3002" }),
|
|
16932
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("p", { className: "is-wide", role: "alert", children: error }),
|
|
16933
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("footer", { children: [
|
|
16934
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirm(false), children: "\u53D6\u6D88" }),
|
|
16935
|
+
/* @__PURE__ */ (0, import_jsx_runtime45.jsx)("button", { type: "submit", className: "is-primary", disabled: busy, children: busy ? "\u6E05\u7406\u4E2D\u2026" : "\u786E\u8BA4\u6E05\u7406" })
|
|
16900
16936
|
] })
|
|
16901
16937
|
] }) })
|
|
16902
16938
|
] });
|
|
16903
16939
|
}
|
|
16904
16940
|
|
|
16905
16941
|
// src/ui/storage-settings.tsx
|
|
16906
|
-
var
|
|
16942
|
+
var import_jsx_runtime46 = require("react/jsx-runtime");
|
|
16907
16943
|
function GeneralSettingsPanel() {
|
|
16908
|
-
const [version, setVersion] = (0,
|
|
16909
|
-
const [inspection, setInspection] = (0,
|
|
16910
|
-
const [busy, setBusy] = (0,
|
|
16911
|
-
const [error, setError] = (0,
|
|
16912
|
-
const request = (0,
|
|
16913
|
-
const mounted = (0,
|
|
16914
|
-
const [reconnect, setReconnect] = (0,
|
|
16915
|
-
const [cleanupPending, setCleanupPending] = (0,
|
|
16944
|
+
const [version, setVersion] = (0, import_react51.useState)();
|
|
16945
|
+
const [inspection, setInspection] = (0, import_react51.useState)();
|
|
16946
|
+
const [busy, setBusy] = (0, import_react51.useState)(false), [confirm, setConfirm] = (0, import_react51.useState)(false);
|
|
16947
|
+
const [error, setError] = (0, import_react51.useState)(""), [notice, setNotice] = (0, import_react51.useState)("");
|
|
16948
|
+
const request = (0, import_react51.useRef)();
|
|
16949
|
+
const mounted = (0, import_react51.useRef)(true);
|
|
16950
|
+
const [reconnect, setReconnect] = (0, import_react51.useState)(false);
|
|
16951
|
+
const [cleanupPending, setCleanupPending] = (0, import_react51.useState)(0);
|
|
16916
16952
|
const cleanup = version === 1 && cleanupPending > 0;
|
|
16917
16953
|
const recover = async (expected = pendingStorageRecovery()) => {
|
|
16918
16954
|
request.current?.abort();
|
|
@@ -16943,7 +16979,7 @@ function GeneralSettingsPanel() {
|
|
|
16943
16979
|
if (!controller.signal.aborted) setBusy(false);
|
|
16944
16980
|
}
|
|
16945
16981
|
};
|
|
16946
|
-
(0,
|
|
16982
|
+
(0, import_react51.useEffect)(() => {
|
|
16947
16983
|
mounted.current = true;
|
|
16948
16984
|
void recover();
|
|
16949
16985
|
return () => {
|
|
@@ -16980,17 +17016,17 @@ function GeneralSettingsPanel() {
|
|
|
16980
17016
|
}
|
|
16981
17017
|
if (mounted.current) await recover(expected);
|
|
16982
17018
|
};
|
|
16983
|
-
return /* @__PURE__ */ (0,
|
|
16984
|
-
/* @__PURE__ */ (0,
|
|
16985
|
-
/* @__PURE__ */ (0,
|
|
16986
|
-
/* @__PURE__ */ (0,
|
|
16987
|
-
/* @__PURE__ */ (0,
|
|
17019
|
+
return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("section", { className: "dsh-partner-general-settings", "aria-busy": busy, children: [
|
|
17020
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("h2", { children: "\u57FA\u672C\u8BBE\u7F6E" }),
|
|
17021
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)(AttachmentStoragePanel, {}),
|
|
17022
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(WorkspaceBlock, { className: "is-storage-migration", title: "\u5347\u7EA7\u8FC1\u79FB", detail: "\u624B\u52A8\u6574\u7406\u516C\u5171\u6570\u636E\u548C\u6BCF\u4F4D\u4F19\u4F34\u7684\u79C1\u6709\u76EE\u5F55\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u6267\u884C\u3002", actions: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", disabled: busy, onClick: () => void inspect(), children: busy ? "\u5904\u7406\u4E2D\u2026" : "\u68C0\u67E5\u8FC1\u79FB" }), children: [
|
|
17023
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("p", { children: [
|
|
16988
17024
|
"\u6570\u636E\u5B58\u50A8\u7248\u672C\uFF1A",
|
|
16989
17025
|
version === void 0 ? "\u6B63\u5728\u8BFB\u53D6\u2026" : `v${version}${version === 0 ? " \xB7 \u5F85\u8FC1\u79FB" : " \xB7 \u5DF2\u5347\u7EA7"}`
|
|
16990
17026
|
] }),
|
|
16991
|
-
/* @__PURE__ */ (0,
|
|
16992
|
-
inspection && /* @__PURE__ */ (0,
|
|
16993
|
-
inspection.steps.map((step) => /* @__PURE__ */ (0,
|
|
17027
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: "\u5347\u7EA7\u524D\u8BF7\u7ED3\u675F\u4F19\u4F34\u4F1A\u8BDD\u548C\u540E\u53F0\u6267\u884C\u3002\u5B8C\u6574\u5907\u4EFD\u5E76\u6821\u9A8C\u540E\u624D\u6E05\u7406\u5DF2\u8FC1\u79FB\u7684\u65E7\u8DEF\u5F84\uFF0C\u4E0D\u4FEE\u6539\u7528\u6237\u5DE5\u4F5C\u6587\u6863\uFF1B\u670D\u52A1\u91CD\u8F7D\u540E\u81EA\u52A8\u91CD\u65B0\u8FDE\u63A5\u3002" }),
|
|
17028
|
+
inspection && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
|
|
17029
|
+
inspection.steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("p", { children: [
|
|
16994
17030
|
"v",
|
|
16995
17031
|
step.from,
|
|
16996
17032
|
" \u2192 v",
|
|
@@ -16998,79 +17034,79 @@ function GeneralSettingsPanel() {
|
|
|
16998
17034
|
" \xB7 ",
|
|
16999
17035
|
step.title
|
|
17000
17036
|
] }, step.id)),
|
|
17001
|
-
/* @__PURE__ */ (0,
|
|
17002
|
-
/* @__PURE__ */ (0,
|
|
17003
|
-
/* @__PURE__ */ (0,
|
|
17004
|
-
/* @__PURE__ */ (0,
|
|
17005
|
-
/* @__PURE__ */ (0,
|
|
17006
|
-
/* @__PURE__ */ (0,
|
|
17007
|
-
/* @__PURE__ */ (0,
|
|
17008
|
-
/* @__PURE__ */ (0,
|
|
17037
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("details", { children: [
|
|
17038
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("summary", { children: "\u67E5\u770B\u76EE\u5F55\u4E0E\u68C0\u67E5\u8BE6\u60C5" }),
|
|
17039
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { className: "dsh-partner-migration-paths", children: inspection.items.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { children: [
|
|
17040
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("strong", { children: item.label }),
|
|
17041
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("code", { children: item.source }),
|
|
17042
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("span", { children: "\u8FC1\u79FB\u81F3" }),
|
|
17043
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("code", { children: item.target }),
|
|
17044
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("small", { children: item.exists ? `${item.files} \u4E2A\u6587\u4EF6 \xB7 ${(item.bytes / 1024 / 1024).toFixed(2)} MB` : "\u5F53\u524D\u65E0\u6587\u4EF6" })
|
|
17009
17045
|
] }, i)) }),
|
|
17010
|
-
inspection.notices.map((text4, i) => /* @__PURE__ */ (0,
|
|
17046
|
+
inspection.notices.map((text4, i) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: text4 }, i))
|
|
17011
17047
|
] }),
|
|
17012
|
-
!!inspection.blockers.length && /* @__PURE__ */ (0,
|
|
17013
|
-
/* @__PURE__ */ (0,
|
|
17014
|
-
/* @__PURE__ */ (0,
|
|
17048
|
+
!!inspection.blockers.length && /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("div", { role: "alert", children: [
|
|
17049
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { children: "\u4EE5\u4E0B\u95EE\u9898\u9700\u8981\u5148\u5904\u7406\uFF1A" }),
|
|
17050
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("ul", { children: inspection.blockers.map((text4, i) => /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("li", { children: text4 }, i)) })
|
|
17015
17051
|
] }),
|
|
17016
|
-
inspection.migrationAvailable && /* @__PURE__ */ (0,
|
|
17052
|
+
inspection.migrationAvailable && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", className: "is-primary", disabled: busy, onClick: () => setConfirm(true), children: "\u5347\u7EA7\u8FC1\u79FB" })
|
|
17017
17053
|
] }),
|
|
17018
|
-
error && /* @__PURE__ */ (0,
|
|
17019
|
-
notice && /* @__PURE__ */ (0,
|
|
17020
|
-
reconnect && /* @__PURE__ */ (0,
|
|
17021
|
-
cleanup && /* @__PURE__ */ (0,
|
|
17054
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { role: "alert", children: error }),
|
|
17055
|
+
notice && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { role: "status", children: notice }),
|
|
17056
|
+
reconnect && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", disabled: busy, onClick: () => void recover(), children: "\u91CD\u65B0\u8FDE\u63A5" }),
|
|
17057
|
+
cleanup && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirm(true), children: "\u91CD\u8BD5\u6E05\u7406\u65E7\u8DEF\u5F84" })
|
|
17022
17058
|
] }),
|
|
17023
|
-
confirm && /* @__PURE__ */ (0,
|
|
17059
|
+
confirm && /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(WorkspaceDialog, { title: cleanup ? "\u786E\u8BA4\u6E05\u7406\u65E7\u8DEF\u5F84" : "\u786E\u8BA4\u5347\u7EA7\u8FC1\u79FB", detail: cleanup ? "\u91CD\u65B0\u6838\u5BF9\u5B8C\u6574\u5907\u4EFD\uFF0C\u53EA\u6E05\u7406\u672A\u53D8\u5316\u7684\u65E7\u6587\u4EF6\uFF0C\u4E0D\u91CD\u65B0\u8FC1\u79FB\u6D3B\u52A8\u6570\u636E\u3002" : "\u516C\u5171\u6570\u636E\u4E0E\u6240\u6709\u4F19\u4F34\u79C1\u6709\u6570\u636E\u5C06\u4E00\u8D77\u8FC1\u79FB\uFF0C\u5168\u90E8\u6821\u9A8C\u540E\u624D\u5207\u6362\u76EE\u5F55\u7248\u672C\u3002", close: () => {
|
|
17024
17060
|
if (!busy) setConfirm(false);
|
|
17025
|
-
}, children: /* @__PURE__ */ (0,
|
|
17061
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("form", { className: "dsh-partner-feature-form", onSubmit: (event) => {
|
|
17026
17062
|
event.preventDefault();
|
|
17027
17063
|
void migrate();
|
|
17028
17064
|
}, children: [
|
|
17029
|
-
/* @__PURE__ */ (0,
|
|
17030
|
-
/* @__PURE__ */ (0,
|
|
17031
|
-
/* @__PURE__ */ (0,
|
|
17032
|
-
/* @__PURE__ */ (0,
|
|
17033
|
-
/* @__PURE__ */ (0,
|
|
17065
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "is-wide", children: "\u5148\u5B8C\u6574\u5907\u4EFD\uFF0C\u7248\u672C\u63D0\u4EA4\u540E\u6E05\u7406\u5DF2\u6838\u9A8C\u7684\u65E7\u8DEF\u5F84\uFF1B\u5386\u53F2\u8BB0\u5FC6\u5907\u4EFD\u4F1A\u539F\u6837\u5F52\u6863\u3002\u5907\u4EFD\u4E0D\u4F1A\u81EA\u52A8\u5220\u9664\u3002\u8FC1\u79FB\u671F\u95F4\u8BF7\u52FF\u7F16\u8F91\u6587\u4EF6\u3001\u4FEE\u6539\u63D2\u4EF6\u914D\u7F6E\u6216\u542F\u52A8\u5176\u4ED6\u5B9E\u4F8B\u3002" }),
|
|
17066
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("p", { className: "is-wide", children: "\u8D26\u53F7\u51ED\u636E\u548C\u5BBF\u4E3B\u4F1A\u8BDD\u4E0D\u642C\u52A8\u3002\u5347\u7EA7\u540E\u4E0D\u8981\u76F4\u63A5\u5B89\u88C5\u4E0D\u652F\u6301\u65B0\u7248\u5B58\u50A8\u7684\u65E7\u63D2\u4EF6\u3002" }),
|
|
17067
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsxs)("footer", { children: [
|
|
17068
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirm(false), children: "\u53D6\u6D88" }),
|
|
17069
|
+
/* @__PURE__ */ (0, import_jsx_runtime46.jsx)("button", { type: "submit", className: "is-primary", disabled: busy, children: busy ? "\u6B63\u5728\u5904\u7406\uFF0C\u8BF7\u52FF\u5173\u95ED\u2026" : cleanup ? "\u786E\u8BA4\u6E05\u7406\u5DF2\u5907\u4EFD\u7684\u65E7\u8DEF\u5F84" : "\u786E\u8BA4\u8FC1\u79FB\u76EE\u5F55\u548C\u6570\u636E" })
|
|
17034
17070
|
] })
|
|
17035
17071
|
] }) })
|
|
17036
17072
|
] });
|
|
17037
17073
|
}
|
|
17038
17074
|
|
|
17039
17075
|
// src/ui/workspace-navigation.tsx
|
|
17040
|
-
var
|
|
17076
|
+
var import_jsx_runtime47 = require("react/jsx-runtime");
|
|
17041
17077
|
var workspaceGroups = [
|
|
17042
|
-
{ id: "features", label: "\u529F\u80FD", detail: "\u80FD\u529B\u3001\u534F\u4F5C\u4E0E\u8BA1\u5212", icon:
|
|
17043
|
-
{ id: "skills", label: "Skill \u5E02\u573A", icon:
|
|
17044
|
-
{ id: "mcp", label: "MCP \u670D\u52A1", icon:
|
|
17045
|
-
{ id: "board", label: "\u4EFB\u52A1\u770B\u677F", icon:
|
|
17046
|
-
{ id: "schedules", label: "\u5B9A\u65F6\u4EFB\u52A1", icon:
|
|
17078
|
+
{ id: "features", label: "\u529F\u80FD", detail: "\u80FD\u529B\u3001\u534F\u4F5C\u4E0E\u8BA1\u5212", icon: import_dsh_client_ui_primitives24.IconBrowseOutlineRegular, pages: [
|
|
17079
|
+
{ id: "skills", label: "Skill \u5E02\u573A", icon: import_dsh_client_ui_primitives24.IconBrowseOutlineRegular },
|
|
17080
|
+
{ id: "mcp", label: "MCP \u670D\u52A1", icon: import_dsh_client_ui_primitives24.IconBrowseOutlineRegular },
|
|
17081
|
+
{ id: "board", label: "\u4EFB\u52A1\u770B\u677F", icon: import_dsh_client_ui_primitives24.IconListPenOutlineRegular },
|
|
17082
|
+
{ id: "schedules", label: "\u5B9A\u65F6\u4EFB\u52A1", icon: import_dsh_client_ui_primitives24.IconPlayOutlineRegular }
|
|
17047
17083
|
] },
|
|
17048
|
-
{ id: "settings", label: "\u8BBE\u7F6E", detail: "\u57FA\u672C\u8BBE\u7F6E\u4E0E\u5361\u7247\u5916\u89C2", icon:
|
|
17049
|
-
{ id: "general", label: "\u57FA\u672C\u8BBE\u7F6E", icon:
|
|
17050
|
-
{ id: "pendant", label: "\u5361\u7247\u8BBE\u7F6E", icon:
|
|
17084
|
+
{ id: "settings", label: "\u8BBE\u7F6E", detail: "\u57FA\u672C\u8BBE\u7F6E\u4E0E\u5361\u7247\u5916\u89C2", icon: import_dsh_client_ui_primitives24.IconEditOutlineRegular, pages: [
|
|
17085
|
+
{ id: "general", label: "\u57FA\u672C\u8BBE\u7F6E", icon: import_dsh_client_ui_primitives24.IconEditOutlineRegular },
|
|
17086
|
+
{ id: "pendant", label: "\u5361\u7247\u8BBE\u7F6E", icon: import_dsh_client_ui_primitives24.IconEditOutlineRegular }
|
|
17051
17087
|
] }
|
|
17052
17088
|
];
|
|
17053
17089
|
var workspaceGroup = (page) => workspaceGroups.find((group) => group.pages.some((item) => item.id === page));
|
|
17054
17090
|
function WorkspaceGroupLinks({ view, open, compact = false }) {
|
|
17055
17091
|
const active2 = workspaceGroup(view);
|
|
17056
|
-
return /* @__PURE__ */ (0,
|
|
17092
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_jsx_runtime47.Fragment, { children: workspaceGroups.map((group) => /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)("button", { type: "button", className: active2?.id === group.id ? "is-active" : "", "aria-current": active2?.id === group.id ? "page" : void 0, onClick: () => {
|
|
17057
17093
|
if (active2?.id !== group.id) open(group.pages[0].id);
|
|
17058
17094
|
}, children: [
|
|
17059
|
-
/* @__PURE__ */ (0,
|
|
17060
|
-
compact ? /* @__PURE__ */ (0,
|
|
17061
|
-
/* @__PURE__ */ (0,
|
|
17062
|
-
/* @__PURE__ */ (0,
|
|
17095
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(group.icon, { size: 16 }) }),
|
|
17096
|
+
compact ? /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("span", { children: group.label }) : /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
|
|
17097
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("strong", { children: group.label }),
|
|
17098
|
+
/* @__PURE__ */ (0, import_jsx_runtime47.jsx)("small", { children: group.detail })
|
|
17063
17099
|
] })
|
|
17064
17100
|
] }, group.id)) });
|
|
17065
17101
|
}
|
|
17066
17102
|
function WorkspaceGroupTabs({ view, open }) {
|
|
17067
17103
|
const group = workspaceGroup(view);
|
|
17068
17104
|
if (!group) return null;
|
|
17069
|
-
return /* @__PURE__ */ (0,
|
|
17105
|
+
return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)("nav", { className: "dsh-partner-tabs dsh-partner-group-tabs", "aria-label": `${group.label}\u6807\u7B7E\u9875`, children: group.pages.map((page) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(TabButton, { active: view === page.id, onClick: () => open(page.id), icon: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(page.icon, { size: 16 }), children: page.label }, page.id)) });
|
|
17070
17106
|
}
|
|
17071
17107
|
|
|
17072
17108
|
// src/client.tsx
|
|
17073
|
-
var
|
|
17109
|
+
var import_jsx_runtime48 = require("react/jsx-runtime");
|
|
17074
17110
|
var PLUGIN_ID = "@lemoncat7/dsh-partner";
|
|
17075
17111
|
var STYLE_ID = `${PLUGIN_ID}/client`;
|
|
17076
17112
|
var cssText = `${client_default}
|
|
@@ -17088,26 +17124,26 @@ var WORKSPACE_PAGES = /* @__PURE__ */ new Set(["skills", "mcp", "board", "schedu
|
|
|
17088
17124
|
var inject = ["slots", "layout", "sessions", "uiWorkspace"];
|
|
17089
17125
|
function apply(ctx) {
|
|
17090
17126
|
ctx.effect(installStyles, "dsh-partner: styles");
|
|
17091
|
-
const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0,
|
|
17127
|
+
const controller = createPartnerController(ctx, PLUGIN_ID, (props, current2) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(PartnerWorkspace, { ...props, controller: current2 }));
|
|
17092
17128
|
if (pendingStorageRecovery() !== void 0) controller.open(void 0, { page: "general" });
|
|
17093
|
-
ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0,
|
|
17129
|
+
ctx.slots.inject("shell.overlay", () => ctx.slots.register({ name: "shell.overlay", id: "partner-pendant", order: 30 }, () => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(PartnerPendant, { controller })));
|
|
17094
17130
|
ctx.effect(() => observePluginWorkspace(PLUGIN_ID, controller.close), "dsh-partner: exclusive workspace");
|
|
17095
17131
|
ctx.effect(() => () => controller.close(), "dsh-partner: workspace lifecycle");
|
|
17096
17132
|
ctx.slots.inject("sidebar.footer.action", () => ctx.slots.register({
|
|
17097
17133
|
name: "sidebar.footer.action",
|
|
17098
17134
|
id: "partner",
|
|
17099
17135
|
order: -120
|
|
17100
|
-
}, (props) => /* @__PURE__ */ (0,
|
|
17136
|
+
}, (props) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(PartnerSidebar, { ...props, controller, collapse: () => ctx.layout.toggleSidebar() })));
|
|
17101
17137
|
}
|
|
17102
17138
|
function PartnerSidebar(props) {
|
|
17103
|
-
const ref = (0,
|
|
17139
|
+
const ref = (0, import_react52.useRef)(null);
|
|
17104
17140
|
useWorkspaceTopAnchor(ref);
|
|
17105
|
-
const [open, setOpen] = (0,
|
|
17106
|
-
const [snapshot, setSnapshot] = (0,
|
|
17141
|
+
const [open, setOpen] = (0, import_react52.useState)(true);
|
|
17142
|
+
const [snapshot, setSnapshot] = (0, import_react52.useState)();
|
|
17107
17143
|
useChannelStatus(setSnapshot);
|
|
17108
|
-
const [, update] = (0,
|
|
17109
|
-
(0,
|
|
17110
|
-
(0,
|
|
17144
|
+
const [, update] = (0, import_react52.useState)(0);
|
|
17145
|
+
(0, import_react52.useEffect)(() => props.controller.subscribe(() => update((value) => value + 1)), [props.controller]);
|
|
17146
|
+
(0, import_react52.useEffect)(() => {
|
|
17111
17147
|
void loadPartner().then(setSnapshot).catch(() => {
|
|
17112
17148
|
});
|
|
17113
17149
|
}, [props.controller.isOpen()]);
|
|
@@ -17115,35 +17151,35 @@ function PartnerSidebar(props) {
|
|
|
17115
17151
|
props.controller.open(id);
|
|
17116
17152
|
if (props.wide && window.matchMedia("(max-width: 820px)").matches) props.collapse();
|
|
17117
17153
|
};
|
|
17118
|
-
if (!props.wide) return /* @__PURE__ */ (0,
|
|
17119
|
-
return /* @__PURE__ */ (0,
|
|
17120
|
-
/* @__PURE__ */ (0,
|
|
17121
|
-
/* @__PURE__ */ (0,
|
|
17154
|
+
if (!props.wide) return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("section", { ref, className: "dsh-partner-sidebar is-rail", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { type: "button", className: `dsh-partner-rail${props.controller.isOpen() ? " is-active" : ""}`, title: "\u4F19\u4F34", onClick: () => props.controller.toggle(), children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dsh_client_ui_primitives25.IconAgentPresetOutlineRegular, { size: 18 }) }) });
|
|
17155
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("section", { ref, className: "dsh-partner-sidebar", children: [
|
|
17156
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "dsh-partner-sidebar-heading", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("button", { type: "button", className: "dsh-partner-sidebar-title", "aria-expanded": open, onClick: () => setOpen((value) => !value), children: [
|
|
17157
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { "data-open": open, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dsh_client_ui_primitives25.IconChevronDownOutlineRegular, { size: 14 }) }),
|
|
17122
17158
|
"\u4F19\u4F34"
|
|
17123
17159
|
] }) }),
|
|
17124
|
-
/* @__PURE__ */ (0,
|
|
17125
|
-
/* @__PURE__ */ (0,
|
|
17126
|
-
/* @__PURE__ */ (0,
|
|
17127
|
-
/* @__PURE__ */ (0,
|
|
17128
|
-
/* @__PURE__ */ (0,
|
|
17160
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: `dsh-partner-sidebar-list${open ? " is-open" : ""}`, "aria-hidden": !open, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "dsh-partner-sidebar-list-inner", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("button", { type: "button", tabIndex: open ? 0 : -1, className: `dsh-partner-sidebar-row${props.controller.isOpen() ? " is-active" : ""}`, onClick: () => launch(), children: [
|
|
17161
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "dsh-partner-sidebar-symbol", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dsh_client_ui_primitives25.IconAgentPresetOutlineRegular, { size: 16 }) }),
|
|
17162
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
|
|
17163
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: "\u4F19\u4F34\u9762\u677F" }),
|
|
17164
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("small", { children: snapshot ? `${snapshot.companions.length} \u4F4D\u4F19\u4F34 \xB7 ${snapshot.channels.filter((item) => item.runtimeStatus === "running").length} \u4E2A\u6E20\u9053\u5728\u7EBF` : "\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E\u6E20\u9053" })
|
|
17129
17165
|
] }),
|
|
17130
|
-
/* @__PURE__ */ (0,
|
|
17166
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("i", { className: snapshot?.channels.some((item) => item.runtimeStatus === "running") ? "is-online" : "" })
|
|
17131
17167
|
] }) }) })
|
|
17132
17168
|
] });
|
|
17133
17169
|
}
|
|
17134
17170
|
function PartnerWorkspace({ controller }) {
|
|
17135
|
-
const [snapshot, setSnapshot] = (0,
|
|
17171
|
+
const [snapshot, setSnapshot] = (0, import_react52.useState)();
|
|
17136
17172
|
useChannelStatus(setSnapshot);
|
|
17137
|
-
const [selectedId, setSelectedId] = (0,
|
|
17138
|
-
const [view, setView] = (0,
|
|
17139
|
-
const [requestedDestination, setRequestedDestination] = (0,
|
|
17140
|
-
const [error, setError] = (0,
|
|
17141
|
-
const [loading, setLoading] = (0,
|
|
17142
|
-
const [creatingCompanion, setCreatingCompanion] = (0,
|
|
17143
|
-
const [notice, setNotice] = (0,
|
|
17144
|
-
const selectionRef = (0,
|
|
17173
|
+
const [selectedId, setSelectedId] = (0, import_react52.useState)(controller.selected());
|
|
17174
|
+
const [view, setView] = (0, import_react52.useState)(controller.destination()?.page ?? "home");
|
|
17175
|
+
const [requestedDestination, setRequestedDestination] = (0, import_react52.useState)(controller.destination());
|
|
17176
|
+
const [error, setError] = (0, import_react52.useState)();
|
|
17177
|
+
const [loading, setLoading] = (0, import_react52.useState)(true);
|
|
17178
|
+
const [creatingCompanion, setCreatingCompanion] = (0, import_react52.useState)(false);
|
|
17179
|
+
const [notice, setNotice] = (0, import_react52.useState)();
|
|
17180
|
+
const selectionRef = (0, import_react52.useRef)({ selectedId, companions: snapshot?.companions });
|
|
17145
17181
|
selectionRef.current = { selectedId, companions: snapshot?.companions };
|
|
17146
|
-
const refresh = (0,
|
|
17182
|
+
const refresh = (0, import_react52.useCallback)(async (throwOnError = false) => {
|
|
17147
17183
|
try {
|
|
17148
17184
|
const next = await loadPartner();
|
|
17149
17185
|
setSnapshot(next);
|
|
@@ -17156,10 +17192,10 @@ function PartnerWorkspace({ controller }) {
|
|
|
17156
17192
|
setLoading(false);
|
|
17157
17193
|
}
|
|
17158
17194
|
}, []);
|
|
17159
|
-
(0,
|
|
17195
|
+
(0, import_react52.useEffect)(() => {
|
|
17160
17196
|
void refresh();
|
|
17161
17197
|
}, [refresh]);
|
|
17162
|
-
(0,
|
|
17198
|
+
(0, import_react52.useEffect)(() => controller.subscribe(() => {
|
|
17163
17199
|
const next = controller.selected();
|
|
17164
17200
|
if (next) setSelectedId(next);
|
|
17165
17201
|
const destination = controller.destination();
|
|
@@ -17228,18 +17264,18 @@ function PartnerWorkspace({ controller }) {
|
|
|
17228
17264
|
setSelectedId(id);
|
|
17229
17265
|
setView("home");
|
|
17230
17266
|
};
|
|
17231
|
-
return /* @__PURE__ */ (0,
|
|
17232
|
-
creatingCompanion && /* @__PURE__ */ (0,
|
|
17233
|
-
/* @__PURE__ */ (0,
|
|
17234
|
-
/* @__PURE__ */ (0,
|
|
17235
|
-
/* @__PURE__ */ (0,
|
|
17236
|
-
/* @__PURE__ */ (0,
|
|
17237
|
-
/* @__PURE__ */ (0,
|
|
17238
|
-
/* @__PURE__ */ (0,
|
|
17239
|
-
/* @__PURE__ */ (0,
|
|
17267
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("main", { className: "dsh-partner-workspace", children: [
|
|
17268
|
+
creatingCompanion && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CompanionCreateDialog, { close: () => setCreatingCompanion(false), create }),
|
|
17269
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("header", { className: "dsh-partner-topbar", children: [
|
|
17270
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-topbar-brand", children: [
|
|
17271
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { type: "button", "data-xiaohei-workspace-close": true, onClick: controller.close, "aria-label": "\u8FD4\u56DE\u4F1A\u8BDD", title: "\u8FD4\u56DE\u4F1A\u8BDD", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dsh_client_ui_primitives25.IconChevronLeftOutlineRegular, { size: 15 }) }),
|
|
17272
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dsh_client_ui_primitives25.IconAgentPresetOutlineRegular, { size: 18 }),
|
|
17273
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
|
|
17274
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: "\u4F19\u4F34" }),
|
|
17275
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("small", { children: "\u957F\u671F\u8EAB\u4EFD\u4E0E\u6D88\u606F\u6E20\u9053" })
|
|
17240
17276
|
] })
|
|
17241
17277
|
] }),
|
|
17242
|
-
/* @__PURE__ */ (0,
|
|
17278
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
|
|
17243
17279
|
MobileWorkspaceControls,
|
|
17244
17280
|
{
|
|
17245
17281
|
companions: snapshot?.companions ?? [],
|
|
@@ -17251,87 +17287,90 @@ function PartnerWorkspace({ controller }) {
|
|
|
17251
17287
|
}
|
|
17252
17288
|
)
|
|
17253
17289
|
] }),
|
|
17254
|
-
/* @__PURE__ */ (0,
|
|
17255
|
-
/* @__PURE__ */ (0,
|
|
17256
|
-
/* @__PURE__ */ (0,
|
|
17257
|
-
/* @__PURE__ */ (0,
|
|
17258
|
-
/* @__PURE__ */ (0,
|
|
17259
|
-
/* @__PURE__ */ (0,
|
|
17290
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-grid", children: [
|
|
17291
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("aside", { className: "dsh-partner-roster", children: [
|
|
17292
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-roster-title", children: [
|
|
17293
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
|
|
17294
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("small", { children: "COMPANIONS" }),
|
|
17295
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: "\u4F19\u4F34\u540D\u518C" })
|
|
17260
17296
|
] }),
|
|
17261
|
-
/* @__PURE__ */ (0,
|
|
17297
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { type: "button", onClick: () => setCreatingCompanion(true), "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dsh_client_ui_primitives25.IconPlusOutlineRegular, { size: 16 }) })
|
|
17262
17298
|
] }),
|
|
17263
|
-
/* @__PURE__ */ (0,
|
|
17299
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "dsh-partner-roster-list", children: snapshot?.companions.map((companion) => {
|
|
17264
17300
|
const channel = snapshot.channels.find((item) => item.companionId === companion.id);
|
|
17265
|
-
return /* @__PURE__ */ (0,
|
|
17266
|
-
/* @__PURE__ */ (0,
|
|
17267
|
-
/* @__PURE__ */ (0,
|
|
17268
|
-
/* @__PURE__ */ (0,
|
|
17269
|
-
/* @__PURE__ */ (0,
|
|
17301
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("button", { type: "button", className: !workspacePage && selectedId === companion.id ? "is-active" : "", onClick: () => openCompanion(companion.id), children: [
|
|
17302
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Avatar, { name: companion.name }),
|
|
17303
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
|
|
17304
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: companion.name }),
|
|
17305
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("small", { children: companion.role })
|
|
17270
17306
|
] }),
|
|
17271
|
-
/* @__PURE__ */ (0,
|
|
17307
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("i", { className: channel?.runtimeStatus === "running" ? "is-online" : "", title: channel ? channel.runtimeStatus : "\u672A\u8FDE\u63A5\u6E20\u9053" })
|
|
17272
17308
|
] }, companion.id);
|
|
17273
17309
|
}) }),
|
|
17274
|
-
/* @__PURE__ */ (0,
|
|
17275
|
-
/* @__PURE__ */ (0,
|
|
17276
|
-
/* @__PURE__ */ (0,
|
|
17277
|
-
/* @__PURE__ */ (0,
|
|
17278
|
-
/* @__PURE__ */ (0,
|
|
17279
|
-
/* @__PURE__ */ (0,
|
|
17310
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("nav", { className: "dsh-partner-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(WorkspaceGroupLinks, { view, open: setView }) }),
|
|
17311
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-roster-note", children: [
|
|
17312
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dsh_client_ui_primitives25.IconLinkOutlineRegular, { size: 16 }),
|
|
17313
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
|
|
17314
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: "\u8EAB\u4EFD\u4E0E\u6E20\u9053\u5206\u79BB" }),
|
|
17315
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("small", { children: "\u6E20\u9053\u53EA\u8D1F\u8D23\u6536\u53D1\uFF0C\u6743\u9650\u4ECD\u7531 DSH \u5DE5\u5177\u51B3\u5B9A\u3002" })
|
|
17280
17316
|
] })
|
|
17281
17317
|
] })
|
|
17282
17318
|
] }),
|
|
17283
|
-
/* @__PURE__ */ (0,
|
|
17284
|
-
loading ? /* @__PURE__ */ (0,
|
|
17285
|
-
/* @__PURE__ */ (0,
|
|
17286
|
-
/* @__PURE__ */ (0,
|
|
17287
|
-
/* @__PURE__ */ (0,
|
|
17288
|
-
view === "skills" && /* @__PURE__ */ (0,
|
|
17289
|
-
view === "mcp" && /* @__PURE__ */ (0,
|
|
17290
|
-
view === "board" && /* @__PURE__ */ (0,
|
|
17291
|
-
view === "schedules" && /* @__PURE__ */ (0,
|
|
17292
|
-
view === "pendant" && /* @__PURE__ */ (0,
|
|
17293
|
-
view === "general" && /* @__PURE__ */ (0,
|
|
17319
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("section", { className: `dsh-partner-stage${workspacePage ? " is-workspace-page" : ""}`, children: [
|
|
17320
|
+
loading ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ContentState, { title: "\u6B63\u5728\u8BFB\u53D6\u4F19\u4F34\u2026" }) : workspacePage ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
17321
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "dsh-partner-group-heading", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("h1", { children: workspaceGroup(view)?.label }) }),
|
|
17322
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(WorkspaceGroupTabs, { view, open: setView }),
|
|
17323
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-stage-scroll is-workspace-page", children: [
|
|
17324
|
+
view === "skills" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SkillsPanel, {}),
|
|
17325
|
+
view === "mcp" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(McpPanel, {}),
|
|
17326
|
+
view === "board" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(RequirementBoard, { initialTaskId: requestedDestination?.taskId, openRequest: requestedDestination }),
|
|
17327
|
+
view === "schedules" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SchedulePanel, { companions: snapshot?.companions ?? [] }),
|
|
17328
|
+
view === "pendant" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(PendantSettingsPanel, {}),
|
|
17329
|
+
view === "general" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(GeneralSettingsPanel, {})
|
|
17294
17330
|
] })
|
|
17295
|
-
] }) : selected === void 0 ? /* @__PURE__ */ (0,
|
|
17296
|
-
/* @__PURE__ */ (0,
|
|
17297
|
-
/* @__PURE__ */ (0,
|
|
17298
|
-
/* @__PURE__ */ (0,
|
|
17299
|
-
/* @__PURE__ */ (0,
|
|
17300
|
-
/* @__PURE__ */ (0,
|
|
17301
|
-
/* @__PURE__ */ (0,
|
|
17331
|
+
] }) : selected === void 0 ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ContentState, { title: "\u521B\u5EFA\u7B2C\u4E00\u4E2A\u4F19\u4F34", detail: "\u4F19\u4F34\u4F1A\u4FDD\u5B58\u72EC\u7ACB\u8EAB\u4EFD\u3001\u80FD\u529B\u548C\u5FAE\u4FE1\u4F1A\u8BDD\u3002", action: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { onClick: () => setCreatingCompanion(true), children: "\u65B0\u5EFA\u4F19\u4F34" }) }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
17332
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-identity", children: [
|
|
17333
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Avatar, { name: selected.name }),
|
|
17334
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
|
|
17335
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("small", { children: "ACTIVE COMPANION" }),
|
|
17336
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("h1", { children: selected.name }),
|
|
17337
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { children: selected.description || selected.role })
|
|
17302
17338
|
] }),
|
|
17303
|
-
/* @__PURE__ */ (0,
|
|
17339
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ChannelStatus, { channel: snapshot?.channels.find((item) => item.companionId === selected.id) })
|
|
17304
17340
|
] }),
|
|
17305
|
-
/* @__PURE__ */ (0,
|
|
17306
|
-
/* @__PURE__ */ (0,
|
|
17307
|
-
/* @__PURE__ */ (0,
|
|
17308
|
-
/* @__PURE__ */ (0,
|
|
17309
|
-
/* @__PURE__ */ (0,
|
|
17310
|
-
/* @__PURE__ */ (0,
|
|
17311
|
-
/* @__PURE__ */ (0,
|
|
17341
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("nav", { className: "dsh-partner-tabs", "aria-label": "\u4F19\u4F34\u914D\u7F6E", children: [
|
|
17342
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TabButton, { active: view === "home", onClick: () => setView("home"), icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dsh_client_ui_primitives25.IconAgentPresetOutlineRegular, { size: 16 }), children: "\u603B\u89C8" }),
|
|
17343
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TabButton, { active: view === "identity", onClick: () => setView("identity"), icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dsh_client_ui_primitives25.IconEditOutlineRegular, { size: 16 }), children: "\u8EAB\u4EFD" }),
|
|
17344
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TabButton, { active: view === "capabilities", onClick: () => setView("capabilities"), icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dsh_client_ui_primitives25.IconAgentPresetOutlineRegular, { size: 16 }), children: "\u80FD\u529B" }),
|
|
17345
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TabButton, { active: view === "weixin", onClick: () => setView("weixin"), icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dsh_client_ui_primitives25.IconLinkOutlineRegular, { size: 16 }), children: "\u6E20\u9053" }),
|
|
17346
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TabButton, { active: view === "memory", onClick: () => setView("memory"), icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dsh_client_ui_primitives25.IconDataOutlineRegular, { size: 16 }), children: "\u8BB0\u5FC6" }),
|
|
17347
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(TabButton, { active: view === "concerns", onClick: () => setView("concerns"), icon: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dsh_client_ui_primitives25.IconBrowseOutlineRegular, { size: 16 }), children: "\u6301\u7EED\u5173\u6CE8" })
|
|
17312
17348
|
] }),
|
|
17313
|
-
/* @__PURE__ */ (0,
|
|
17314
|
-
notice && /* @__PURE__ */ (0,
|
|
17315
|
-
view === "home" && /* @__PURE__ */ (0,
|
|
17316
|
-
|
|
17317
|
-
|
|
17318
|
-
|
|
17319
|
-
view === "
|
|
17320
|
-
view === "
|
|
17349
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-stage-scroll", children: [
|
|
17350
|
+
notice && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "dsh-partner-inline-notice", role: "status", children: notice }),
|
|
17351
|
+
view === "home" && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
17352
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CompanionDeletion, { companion: selected, count: snapshot?.companions.length ?? 1, channelCount: snapshot.channels.filter((channel) => channel.companionId === selected.id).length, onRemoved: companionRemoved }, selected.id),
|
|
17353
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(HomePanel, { companion: selected, snapshot, navigate: setView, openSession, startSession, renewSession })
|
|
17354
|
+
] }),
|
|
17355
|
+
view === "identity" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(IdentityEditor, { companion: selected, onChanged: () => refresh(true) }),
|
|
17356
|
+
view === "capabilities" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CapabilityEditor, { companion: selected, presets: snapshot?.presets ?? [], onChanged: () => refresh(true) }, selected.id),
|
|
17357
|
+
view === "weixin" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ChannelsPanel, { companion: selected, snapshot, onChanged: refresh, weixin: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(WeixinPanel, { companion: selected, snapshot, onChanged: refresh }) }, selected.id),
|
|
17358
|
+
view === "memory" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(MemoryPanel, { companion: selected, snapshot, openSession, startSession, renewSession, onChanged: refresh }, selected.id),
|
|
17359
|
+
view === "concerns" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ConcernPanel, { companion: selected, snapshot, onChanged: refresh }, selected.id)
|
|
17321
17360
|
] })
|
|
17322
17361
|
] }),
|
|
17323
|
-
error && /* @__PURE__ */ (0,
|
|
17362
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "dsh-partner-error", role: "alert", children: error })
|
|
17324
17363
|
] })
|
|
17325
17364
|
] })
|
|
17326
17365
|
] });
|
|
17327
17366
|
}
|
|
17328
17367
|
function MobileWorkspaceControls({ companions, selectedId, view, openCompanion, openPage, createCompanion }) {
|
|
17329
|
-
return /* @__PURE__ */ (0,
|
|
17330
|
-
/* @__PURE__ */ (0,
|
|
17331
|
-
/* @__PURE__ */ (0,
|
|
17332
|
-
/* @__PURE__ */ (0,
|
|
17368
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-mobile-controls", children: [
|
|
17369
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-mobile-companion-row", children: [
|
|
17370
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(CompanionPicker, { companions, selectedId, onChange: openCompanion }),
|
|
17371
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { type: "button", className: "dsh-partner-mobile-create", onClick: createCompanion, "aria-label": "\u65B0\u5EFA\u4F19\u4F34", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dsh_client_ui_primitives25.IconPlusOutlineRegular, { size: 17 }) })
|
|
17333
17372
|
] }),
|
|
17334
|
-
/* @__PURE__ */ (0,
|
|
17373
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("nav", { className: "dsh-partner-mobile-workspace-nav", "aria-label": "\u4F19\u4F34\u5DE5\u4F5C\u533A\u5FEB\u6377\u5165\u53E3", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(WorkspaceGroupLinks, { view, open: openPage, compact: true }) })
|
|
17335
17374
|
] });
|
|
17336
17375
|
}
|
|
17337
17376
|
function HomePanel({ companion, snapshot, navigate, openSession, startSession, renewSession }) {
|
|
@@ -17342,94 +17381,128 @@ function HomePanel({ companion, snapshot, navigate, openSession, startSession, r
|
|
|
17342
17381
|
const approved = channel ? snapshot.pairings.filter((item) => item.channelId === channel.id && item.status === "approved").length : 0;
|
|
17343
17382
|
const capabilities = companion.capabilities.map((item) => CAPABILITY_LABELS[item]);
|
|
17344
17383
|
const online = channel?.runtimeStatus === "running";
|
|
17345
|
-
return /* @__PURE__ */ (0,
|
|
17346
|
-
/* @__PURE__ */ (0,
|
|
17347
|
-
/* @__PURE__ */ (0,
|
|
17348
|
-
/* @__PURE__ */ (0,
|
|
17349
|
-
/* @__PURE__ */ (0,
|
|
17384
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-home", children: [
|
|
17385
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("header", { className: "dsh-partner-home-heading", children: [
|
|
17386
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
|
|
17387
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("small", { children: "\u5DE5\u4F5C\u53F0" }),
|
|
17388
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("h2", { children: online ? `${companion.name} \u6B63\u5728\u6E20\u9053\u5F85\u547D` : `${companion.name} \u5DF2\u51C6\u5907\u5C31\u7EEA` })
|
|
17350
17389
|
] }),
|
|
17351
|
-
/* @__PURE__ */ (0,
|
|
17390
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { children: online ? "\u6D88\u606F\u3001\u6388\u6743\u4E0E\u4E0A\u4E0B\u6587\u8FB9\u754C\u90FD\u5728\u8FD9\u91CC\u6C47\u603B\u3002" : "\u4F19\u4F34\u8EAB\u4EFD\u3001\u4F1A\u8BDD\u4E0E\u80FD\u529B\u5DF2\u7ECF\u51C6\u5907\u5B8C\u6210\u3002" })
|
|
17352
17391
|
] }),
|
|
17353
|
-
/* @__PURE__ */ (0,
|
|
17354
|
-
/* @__PURE__ */ (0,
|
|
17355
|
-
/* @__PURE__ */ (0,
|
|
17356
|
-
/* @__PURE__ */ (0,
|
|
17357
|
-
/* @__PURE__ */ (0,
|
|
17392
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("section", { className: `dsh-partner-home-channel${online ? " is-online" : ""}`, children: [
|
|
17393
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-home-route", "aria-hidden": "true", children: [
|
|
17394
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Avatar, { name: companion.name }),
|
|
17395
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "dsh-partner-route-line", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("i", {}) }),
|
|
17396
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "dsh-partner-route-weixin", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(WeixinGlyph, { large: true }) })
|
|
17358
17397
|
] }),
|
|
17359
|
-
/* @__PURE__ */ (0,
|
|
17360
|
-
/* @__PURE__ */ (0,
|
|
17361
|
-
/* @__PURE__ */ (0,
|
|
17398
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-home-channel-copy", children: [
|
|
17399
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { className: "dsh-partner-home-kicker", children: [
|
|
17400
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("i", {}),
|
|
17362
17401
|
"\u6D88\u606F\u6E20\u9053 \xB7 ",
|
|
17363
17402
|
channel?.platform === "matrix" ? "Matrix" : channel?.platform === "mattermost" ? "Mattermost" : "\u5FAE\u4FE1"
|
|
17364
17403
|
] }),
|
|
17365
|
-
/* @__PURE__ */ (0,
|
|
17366
|
-
/* @__PURE__ */ (0,
|
|
17367
|
-
/* @__PURE__ */ (0,
|
|
17368
|
-
/* @__PURE__ */ (0,
|
|
17369
|
-
/* @__PURE__ */ (0,
|
|
17404
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("h3", { children: !channel ? "\u7B49\u5F85\u626B\u7801\u8FDE\u63A5" : online ? "\u8FDE\u63A5\u6B63\u5E38\uFF0C\u6B63\u5728\u63A5\u6536\u6D88\u606F" : channel.runtimeStatus === "error" ? "\u6E20\u9053\u8FDE\u63A5\u9700\u8981\u5904\u7406" : "\u6E20\u9053\u5F53\u524D\u5DF2\u505C\u7528" }),
|
|
17405
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { children: !channel ? "\u8FDE\u63A5\u5FAE\u4FE1\u3001Matrix \u6216 Mattermost\uFF0C\u8054\u7CFB\u4EBA\u9996\u6B21\u53D1\u6D88\u606F\u9700\u6279\u51C6\u3002" : online ? "\u672C\u5730\u4E0E\u6240\u6709\u5DF2\u6388\u6743\u6E20\u9053\u5171\u7528\u4F19\u4F34\u4E3B\u5BF9\u8BDD\uFF0C\u56DE\u590D\u8FD4\u56DE\u6D88\u606F\u6765\u6E90\u3002" : channel.lastError || "\u6E20\u9053\u914D\u7F6E\u4ECD\u7136\u4FDD\u7559\uFF0C\u53EF\u4EE5\u968F\u65F6\u91CD\u65B0\u542F\u7528\u3002" }),
|
|
17406
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-home-channel-actions", children: [
|
|
17407
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { type: "button", className: "is-primary", onClick: () => navigate("weixin"), children: !channel ? "\u8FDE\u63A5\u5FAE\u4FE1" : pending > 0 ? `\u5904\u7406 ${pending} \u4E2A\u8BF7\u6C42` : "\u7BA1\u7406\u6E20\u9053" }),
|
|
17408
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: !channel ? "\u9009\u62E9\u6E20\u9053\u5E76\u8FDE\u63A5\u8D26\u53F7" : `${approved} \u4F4D\u8054\u7CFB\u4EBA \xB7 \u5171\u7528\u4E3B\u5BF9\u8BDD` })
|
|
17370
17409
|
] })
|
|
17371
17410
|
] })
|
|
17372
17411
|
] }),
|
|
17373
|
-
/* @__PURE__ */ (0,
|
|
17374
|
-
/* @__PURE__ */ (0,
|
|
17375
|
-
/* @__PURE__ */ (0,
|
|
17376
|
-
/* @__PURE__ */ (0,
|
|
17377
|
-
/* @__PURE__ */ (0,
|
|
17378
|
-
/* @__PURE__ */ (0,
|
|
17379
|
-
/* @__PURE__ */ (0,
|
|
17412
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-home-details", children: [
|
|
17413
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("section", { className: "dsh-partner-home-profile", children: [
|
|
17414
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("header", { children: [
|
|
17415
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dsh_client_ui_primitives25.IconUserOutlineRegular, { size: 16 }) }),
|
|
17416
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { children: [
|
|
17417
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("small", { children: "\u4F19\u4F34\u5E95\u7A3F" }),
|
|
17418
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: companion.role })
|
|
17380
17419
|
] }),
|
|
17381
|
-
/* @__PURE__ */ (0,
|
|
17420
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { type: "button", onClick: () => navigate("identity"), children: "\u7F16\u8F91" })
|
|
17382
17421
|
] }),
|
|
17383
|
-
/* @__PURE__ */ (0,
|
|
17422
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("blockquote", { children: companion.instructions || companion.description || "\u5C1A\u672A\u8BBE\u7F6E\u957F\u671F\u884C\u4E3A\u51C6\u5219\u3002" })
|
|
17384
17423
|
] }),
|
|
17385
|
-
/* @__PURE__ */ (0,
|
|
17386
|
-
/* @__PURE__ */ (0,
|
|
17387
|
-
/* @__PURE__ */ (0,
|
|
17388
|
-
/* @__PURE__ */ (0,
|
|
17389
|
-
/* @__PURE__ */ (0,
|
|
17390
|
-
/* @__PURE__ */ (0,
|
|
17424
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("section", { className: "dsh-partner-home-runtime", children: [
|
|
17425
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("header", { children: [
|
|
17426
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dsh_client_ui_primitives25.IconAgentPresetOutlineRegular, { size: 16 }) }),
|
|
17427
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { children: [
|
|
17428
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("small", { children: "\u8FD0\u884C\u80FD\u529B" }),
|
|
17429
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: companion.presetId || "DSH \u9ED8\u8BA4 Preset" })
|
|
17391
17430
|
] }),
|
|
17392
|
-
/* @__PURE__ */ (0,
|
|
17431
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { type: "button", onClick: () => navigate("capabilities"), children: "\u8C03\u6574" })
|
|
17393
17432
|
] }),
|
|
17394
|
-
/* @__PURE__ */ (0,
|
|
17433
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "dsh-partner-home-capability-list", children: capabilities.length ? capabilities.map((item) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("em", { children: item }, item)) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("small", { children: "\u5C1A\u672A\u58F0\u660E\u80FD\u529B\u8303\u56F4" }) })
|
|
17395
17434
|
] }),
|
|
17396
|
-
/* @__PURE__ */ (0,
|
|
17397
|
-
/* @__PURE__ */ (0,
|
|
17398
|
-
/* @__PURE__ */ (0,
|
|
17399
|
-
/* @__PURE__ */ (0,
|
|
17400
|
-
/* @__PURE__ */ (0,
|
|
17401
|
-
/* @__PURE__ */ (0,
|
|
17435
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("section", { className: "dsh-partner-home-continuity", children: [
|
|
17436
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("header", { children: [
|
|
17437
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dsh_client_ui_primitives25.IconDataOutlineRegular, { size: 16 }) }),
|
|
17438
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { children: [
|
|
17439
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("small", { children: "\u4F19\u4F34\u5BF9\u8BDD" }),
|
|
17440
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: localSession?.archived ? "\u4F1A\u8BDD\u5DF2\u5F52\u6863" : "\u4F19\u4F34\u4F1A\u8BDD\u5DF2\u5EFA\u7ACB" })
|
|
17402
17441
|
] }),
|
|
17403
|
-
/* @__PURE__ */ (0,
|
|
17442
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { type: "button", onClick: () => localSession === void 0 ? void startSession(companion.id) : localSession.archived ? void renewSession(localSession.id) : void openSession(localSession.id, localSession.sessionId), children: localSession === void 0 ? "\u5F00\u59CB\u5BF9\u8BDD" : localSession.archived ? "\u5F00\u59CB\u65B0\u4F1A\u8BDD" : "\u6253\u5F00\u4F1A\u8BDD" })
|
|
17404
17443
|
] }),
|
|
17405
|
-
/* @__PURE__ */ (0,
|
|
17444
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { children: localSession ? `\u6700\u8FD1\u6D3B\u52A8\u4E8E ${relativeTime(localSession.lastMessageAt)}\uFF1B\u672C\u5730\u4E0E\u6E20\u9053\u5728\u8FD9\u91CC\u63A5\u7740\u804A\u3002` : "\u4F19\u4F34\u4F1A\u8BDD\u6B63\u5728\u521D\u59CB\u5316\uFF0C\u7A0D\u540E\u5373\u53EF\u6253\u5F00\u3002" })
|
|
17406
17445
|
] })
|
|
17407
17446
|
] })
|
|
17408
17447
|
] });
|
|
17409
17448
|
}
|
|
17410
17449
|
function WeixinPanel({ companion, snapshot, onChanged }) {
|
|
17411
|
-
const
|
|
17412
|
-
|
|
17413
|
-
|
|
17414
|
-
|
|
17415
|
-
|
|
17450
|
+
const channels = snapshot.channels.filter((item) => item.companionId === companion.id && (!item.platform || item.platform === "weixin"));
|
|
17451
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
17452
|
+
channels.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("p", { className: "dsh-partner-inline-error", role: "alert", children: [
|
|
17453
|
+
"\u53D1\u73B0 ",
|
|
17454
|
+
channels.length,
|
|
17455
|
+
" \u4E2A\u5386\u53F2\u5FAE\u4FE1\u6E20\u9053\u3002\u8BF7\u5148\u505C\u7528\u4E0D\u4F7F\u7528\u7684\u6E20\u9053\uFF0C\u518D\u5BF9\u9700\u8981\u4FDD\u7559\u7684\u6E20\u9053\u91CD\u65B0\u626B\u7801\uFF1B\u8054\u7CFB\u4EBA\u6388\u6743\u4E0D\u4F1A\u8DE8\u673A\u5668\u4EBA\u8FC1\u79FB\u3002"
|
|
17456
|
+
] }),
|
|
17457
|
+
channels.length ? channels.map((channel) => /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(WeixinChannelPanel, { companion, snapshot, onChanged, channel }, channel.id)) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(WeixinChannelPanel, { companion, snapshot, onChanged })
|
|
17458
|
+
] });
|
|
17459
|
+
}
|
|
17460
|
+
function WeixinChannelPanel({ companion, snapshot, onChanged, channel }) {
|
|
17461
|
+
const [confirmDelete, setConfirmDelete] = (0, import_react52.useState)(false);
|
|
17462
|
+
const [login, setLogin] = (0, import_react52.useState)();
|
|
17463
|
+
const [busy, setBusy] = (0, import_react52.useState)(false);
|
|
17464
|
+
const [error, setError] = (0, import_react52.useState)();
|
|
17465
|
+
const loginGeneration = (0, import_react52.useRef)(0);
|
|
17466
|
+
const changedRef = (0, import_react52.useRef)(onChanged);
|
|
17467
|
+
changedRef.current = onChanged;
|
|
17468
|
+
(0, import_react52.useEffect)(() => {
|
|
17416
17469
|
if (!login || login.phase === "confirmed" || login.phase === "expired" || login.phase === "error") return;
|
|
17417
|
-
|
|
17418
|
-
|
|
17470
|
+
let disposed = false;
|
|
17471
|
+
let timer2;
|
|
17472
|
+
const generation = loginGeneration.current;
|
|
17473
|
+
const poll2 = async () => {
|
|
17474
|
+
try {
|
|
17475
|
+
const result = await api(`/weixin/login/${login.id}`);
|
|
17476
|
+
if (disposed || generation !== loginGeneration.current) return;
|
|
17477
|
+
setError(void 0);
|
|
17419
17478
|
setLogin(result.login);
|
|
17420
17479
|
if (result.channel) {
|
|
17421
17480
|
setLogin(void 0);
|
|
17422
|
-
await
|
|
17481
|
+
await changedRef.current();
|
|
17482
|
+
return;
|
|
17423
17483
|
}
|
|
17424
|
-
}
|
|
17484
|
+
} catch (reason) {
|
|
17485
|
+
if (!disposed && generation === loginGeneration.current) setError(errorMessage(reason));
|
|
17486
|
+
}
|
|
17487
|
+
if (!disposed && generation === loginGeneration.current) timer2 = window.setTimeout(() => {
|
|
17488
|
+
void poll2();
|
|
17489
|
+
}, 2e3);
|
|
17490
|
+
};
|
|
17491
|
+
timer2 = window.setTimeout(() => {
|
|
17492
|
+
void poll2();
|
|
17425
17493
|
}, 2e3);
|
|
17426
|
-
return () =>
|
|
17427
|
-
|
|
17494
|
+
return () => {
|
|
17495
|
+
disposed = true;
|
|
17496
|
+
clearTimeout(timer2);
|
|
17497
|
+
};
|
|
17498
|
+
}, [login?.id, login?.phase]);
|
|
17428
17499
|
const begin = async () => {
|
|
17500
|
+
loginGeneration.current += 1;
|
|
17501
|
+
setLogin(void 0);
|
|
17429
17502
|
setBusy(true);
|
|
17430
17503
|
setError(void 0);
|
|
17431
17504
|
try {
|
|
17432
|
-
setLogin(await api("/weixin/login", { method: "POST", body: JSON.stringify({ companionId: companion.id }) }));
|
|
17505
|
+
setLogin(await api("/weixin/login", { method: "POST", body: JSON.stringify({ companionId: companion.id, channelId: channel?.id }) }));
|
|
17433
17506
|
} catch (reason) {
|
|
17434
17507
|
setError(errorMessage(reason));
|
|
17435
17508
|
} finally {
|
|
@@ -17450,6 +17523,21 @@ function WeixinPanel({ companion, snapshot, onChanged }) {
|
|
|
17450
17523
|
}
|
|
17451
17524
|
};
|
|
17452
17525
|
const pairings = channel ? snapshot.pairings.filter((item) => item.channelId === channel.id) : [];
|
|
17526
|
+
const remove = async () => {
|
|
17527
|
+
if (!channel || !confirmDelete) return;
|
|
17528
|
+
loginGeneration.current += 1;
|
|
17529
|
+
setLogin(void 0);
|
|
17530
|
+
setBusy(true);
|
|
17531
|
+
setError(void 0);
|
|
17532
|
+
try {
|
|
17533
|
+
await api(`/channels/${channel.id}`, { method: "DELETE" });
|
|
17534
|
+
await onChanged();
|
|
17535
|
+
} catch (reason) {
|
|
17536
|
+
setError(errorMessage(reason));
|
|
17537
|
+
} finally {
|
|
17538
|
+
setBusy(false);
|
|
17539
|
+
}
|
|
17540
|
+
};
|
|
17453
17541
|
const actPairing = async (id, status) => {
|
|
17454
17542
|
try {
|
|
17455
17543
|
await api(`/pairings/${id}/status`, { method: "POST", body: JSON.stringify({ status }) });
|
|
@@ -17458,93 +17546,115 @@ function WeixinPanel({ companion, snapshot, onChanged }) {
|
|
|
17458
17546
|
setError(errorMessage(reason));
|
|
17459
17547
|
}
|
|
17460
17548
|
};
|
|
17461
|
-
return /* @__PURE__ */ (0,
|
|
17462
|
-
/* @__PURE__ */ (0,
|
|
17463
|
-
!channel && !login && /* @__PURE__ */ (0,
|
|
17464
|
-
/* @__PURE__ */ (0,
|
|
17465
|
-
/* @__PURE__ */ (0,
|
|
17466
|
-
/* @__PURE__ */ (0,
|
|
17549
|
+
return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-form is-channel", children: [
|
|
17550
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(SectionHeading, { eyebrow: "PRIMARY CHANNEL", title: "\u5FAE\u4FE1\u6E20\u9053", detail: "\u4F7F\u7528\u5FAE\u4FE1 iLink Bot \u626B\u7801\u63A5\u5165\u3002\u6BCF\u4E2A\u673A\u5668\u4EBA\u53EA\u7ED1\u5B9A\u4E00\u4E2A\u4F19\u4F34\uFF0C\u6BCF\u4F4D\u8054\u7CFB\u4EBA\u4FDD\u6301\u72EC\u7ACB DSH \u4F1A\u8BDD\u3002" }),
|
|
17551
|
+
!channel && !login && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-weixin-connect", borderRadius: 15, distortionScale: -10, saturation: 1.06, children: [
|
|
17552
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(WeixinGlyph, { large: true }) }),
|
|
17553
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
|
|
17554
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("strong", { children: [
|
|
17467
17555
|
"\u628A ",
|
|
17468
17556
|
companion.name,
|
|
17469
17557
|
" \u5E26\u5230\u5FAE\u4FE1"
|
|
17470
17558
|
] }),
|
|
17471
|
-
/* @__PURE__ */ (0,
|
|
17472
|
-
/* @__PURE__ */ (0,
|
|
17473
|
-
/* @__PURE__ */ (0,
|
|
17474
|
-
/* @__PURE__ */ (0,
|
|
17475
|
-
/* @__PURE__ */ (0,
|
|
17559
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { children: "\u626B\u7801\u540E\uFF0C\u673A\u5668\u4EBA\u51ED\u636E\u76F4\u63A5\u4FDD\u5B58\u8FDB DSH \u51ED\u636E\u5E93\uFF0C\u4E0D\u4F1A\u663E\u793A\u5728\u6D4F\u89C8\u5668\u6216\u666E\u901A\u914D\u7F6E\u6587\u4EF6\u4E2D\u3002" }),
|
|
17560
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("ul", { children: [
|
|
17561
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("li", { children: "\u79C1\u804A\u9996\u6B21\u8054\u7CFB\u5FC5\u987B\u5BA1\u6279" }),
|
|
17562
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("li", { children: "\u8054\u7CFB\u4EBA\u4E4B\u95F4\u4E0A\u4E0B\u6587\u5B8C\u5168\u9694\u79BB" }),
|
|
17563
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("li", { children: "\u5DE5\u5177\u6743\u9650\u4E0D\u4F1A\u56E0\u5FAE\u4FE1\u8EAB\u4EFD\u81EA\u52A8\u6269\u5927" })
|
|
17476
17564
|
] })
|
|
17477
17565
|
] }),
|
|
17478
|
-
/* @__PURE__ */ (0,
|
|
17566
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { type: "button", disabled: busy, onClick: () => {
|
|
17479
17567
|
void begin();
|
|
17480
17568
|
}, children: busy ? "\u6B63\u5728\u7533\u8BF7\u4E8C\u7EF4\u7801\u2026" : "\u626B\u7801\u8FDE\u63A5\u5FAE\u4FE1" })
|
|
17481
17569
|
] }),
|
|
17482
|
-
login && /* @__PURE__ */ (0,
|
|
17483
|
-
/* @__PURE__ */ (0,
|
|
17484
|
-
/* @__PURE__ */ (0,
|
|
17485
|
-
/* @__PURE__ */ (0,
|
|
17486
|
-
/* @__PURE__ */ (0,
|
|
17487
|
-
/* @__PURE__ */ (0,
|
|
17488
|
-
(login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0,
|
|
17570
|
+
login && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-qr", borderRadius: 16, distortionScale: -10, saturation: 1.06, children: [
|
|
17571
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "dsh-partner-qr-code", children: login.qrContent && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(QRCodeSVG, { value: login.qrContent, size: 176, level: "M" }) }),
|
|
17572
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
|
|
17573
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("small", { children: "WECHAT ILINK BOT" }),
|
|
17574
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: login.phase === "scanned" ? "\u5DF2\u626B\u7801\uFF0C\u8BF7\u5728\u5FAE\u4FE1\u786E\u8BA4" : login.phase === "expired" ? "\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F" : login.phase === "error" ? "\u8FDE\u63A5\u5931\u8D25" : "\u4F7F\u7528\u5FAE\u4FE1\u626B\u7801" }),
|
|
17575
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { children: login.error || (login.phase === "scanned" ? "\u786E\u8BA4\u540E\u4F1A\u81EA\u52A8\u542F\u52A8\u6E20\u9053\uFF0C\u4E0D\u9700\u8981\u590D\u5236 Token\u3002" : "\u4E8C\u7EF4\u7801\u7EA6 5 \u5206\u949F\u6709\u6548\u3002\u6B64\u9875\u9762\u53EF\u4EE5\u5B89\u5168\u5730\u4FDD\u6301\u6253\u5F00\u3002") }),
|
|
17576
|
+
(login.phase === "expired" || login.phase === "error") && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("button", { type: "button", onClick: () => {
|
|
17489
17577
|
setLogin(void 0);
|
|
17490
17578
|
void begin();
|
|
17491
17579
|
}, children: [
|
|
17492
|
-
/* @__PURE__ */ (0,
|
|
17580
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dsh_client_ui_primitives25.IconRefreshOutlineRegular, { size: 16 }),
|
|
17493
17581
|
"\u91CD\u65B0\u751F\u6210"
|
|
17494
17582
|
] })
|
|
17495
17583
|
] })
|
|
17496
17584
|
] }),
|
|
17497
|
-
channel && /* @__PURE__ */ (0,
|
|
17498
|
-
/* @__PURE__ */ (0,
|
|
17499
|
-
/* @__PURE__ */ (0,
|
|
17500
|
-
/* @__PURE__ */ (0,
|
|
17501
|
-
/* @__PURE__ */ (0,
|
|
17502
|
-
/* @__PURE__ */ (0,
|
|
17503
|
-
/* @__PURE__ */ (0,
|
|
17585
|
+
channel && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
17586
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(GlassSurface, { as: "div", interactive: true, className: "dsh-partner-channel-card", borderRadius: 14, distortionScale: -10, saturation: 1.06, children: [
|
|
17587
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "dsh-partner-weixin-mark", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(WeixinGlyph, { large: true }) }),
|
|
17588
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
|
|
17589
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("small", { children: "WECHAT CHANNEL" }),
|
|
17590
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: channel.name }),
|
|
17591
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { children: channel.accountId })
|
|
17504
17592
|
] }),
|
|
17505
|
-
/* @__PURE__ */ (0,
|
|
17506
|
-
/* @__PURE__ */ (0,
|
|
17507
|
-
|
|
17508
|
-
|
|
17593
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ChannelStatus, { channel }),
|
|
17594
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-weixin-actions", children: [
|
|
17595
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { type: "button", className: "dsh-partner-switch", "data-on": channel.enabled, disabled: busy, role: "switch", "aria-checked": channel.enabled, "aria-label": channel.enabled ? "\u505C\u7528\u5FAE\u4FE1\u6E20\u9053" : "\u542F\u7528\u5FAE\u4FE1\u6E20\u9053", onClick: () => {
|
|
17596
|
+
void toggle();
|
|
17597
|
+
}, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("i", {}) }),
|
|
17598
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("button", { type: "button", className: "dsh-partner-weixin-rescan", disabled: busy, title: "\u66F4\u65B0\u5F53\u524D\u673A\u5668\u4EBA\u7684\u767B\u5F55\u51ED\u636E\uFF0C\u4FDD\u7559\u8054\u7CFB\u4EBA\u6388\u6743", onClick: () => {
|
|
17599
|
+
void begin();
|
|
17600
|
+
}, children: [
|
|
17601
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dsh_client_ui_primitives25.IconRefreshOutlineRegular, { size: 16 }),
|
|
17602
|
+
busy ? "\u8BF7\u7A0D\u5019\u2026" : "\u91CD\u65B0\u626B\u7801"
|
|
17603
|
+
] })
|
|
17604
|
+
] })
|
|
17509
17605
|
] }),
|
|
17510
|
-
channel.lastError && /* @__PURE__ */ (0,
|
|
17511
|
-
/* @__PURE__ */ (0,
|
|
17512
|
-
|
|
17513
|
-
|
|
17514
|
-
|
|
17606
|
+
channel.enabled && channel.runtimeStatus === "starting" && !channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "dsh-partner-weixin-help", role: "status", children: "\u767B\u5F55\u51ED\u636E\u5DF2\u4FDD\u5B58\uFF0C\u6B63\u5728\u7B49\u5F85\u5FAE\u4FE1\u63A5\u6536\u901A\u9053\u9996\u6B21\u54CD\u5E94\u3002\u957F\u8F6E\u8BE2\u53EF\u80FD\u9700\u8981\u51E0\u5341\u79D2\uFF1B\u5411\u673A\u5668\u4EBA\u53D1\u9001\u4E00\u6761\u6D88\u606F\u53EF\u5E2E\u52A9\u786E\u8BA4\u6536\u53D1\u662F\u5426\u6B63\u5E38\uFF0C\u65E0\u9700\u91CD\u590D\u626B\u7801\u3002" }),
|
|
17607
|
+
channel.lastError && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: channel.lastError }),
|
|
17608
|
+
confirmDelete ? /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { role: "group", "aria-label": "\u786E\u8BA4\u5220\u9664\u5FAE\u4FE1\u6E20\u9053", children: [
|
|
17609
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("p", { className: "dsh-partner-inline-error", role: "alert", children: [
|
|
17610
|
+
"\u786E\u8BA4\u5220\u9664 ",
|
|
17611
|
+
channel.accountId,
|
|
17612
|
+
"\uFF1F\u5C06\u79FB\u9664\u8BE5\u6E20\u9053\u51ED\u636E\u3001\u8054\u7CFB\u4EBA\u914D\u5BF9\u548C\u6E20\u9053\u4F1A\u8BDD\u5173\u8054\uFF0C\u4E0D\u4F1A\u8FC1\u79FB\u6388\u6743\uFF0C\u4E14\u4E0D\u53EF\u64A4\u9500\u3002"
|
|
17613
|
+
] }),
|
|
17614
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-weixin-actions", children: [
|
|
17615
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirmDelete(false), children: "\u53D6\u6D88" }),
|
|
17616
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { type: "button", disabled: busy, onClick: () => {
|
|
17617
|
+
void remove();
|
|
17618
|
+
}, children: busy ? "\u6B63\u5728\u5220\u9664\u2026" : "\u786E\u8BA4\u5220\u9664" })
|
|
17619
|
+
] })
|
|
17620
|
+
] }) : /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "dsh-partner-weixin-actions", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { type: "button", disabled: busy, onClick: () => setConfirmDelete(true), children: "\u5220\u9664\u6B64\u6E20\u9053" }) }),
|
|
17621
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { className: "dsh-partner-pairing-heading", children: [
|
|
17622
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("span", { children: [
|
|
17623
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("small", { children: "ACCESS" }),
|
|
17624
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: "\u79C1\u804A\u914D\u5BF9" })
|
|
17515
17625
|
] }),
|
|
17516
|
-
/* @__PURE__ */ (0,
|
|
17626
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("em", { children: [
|
|
17517
17627
|
pairings.filter((item) => item.status === "pending").length,
|
|
17518
17628
|
" \u4E2A\u5F85\u5904\u7406"
|
|
17519
17629
|
] })
|
|
17520
17630
|
] }),
|
|
17521
|
-
/* @__PURE__ */ (0,
|
|
17522
|
-
/* @__PURE__ */ (0,
|
|
17523
|
-
/* @__PURE__ */ (0,
|
|
17524
|
-
/* @__PURE__ */ (0,
|
|
17525
|
-
/* @__PURE__ */ (0,
|
|
17631
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "dsh-partner-pairings", children: pairings.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ContentState, { title: "\u7B49\u5F85\u9996\u6B21\u6D88\u606F", detail: "\u626B\u7801\u53EA\u5B8C\u6210\u673A\u5668\u4EBA\u767B\u5F55\uFF0C\u4E0D\u4F1A\u81EA\u52A8\u6388\u6743\u8054\u7CFB\u4EBA\u3002\u8BF7\u5148\u5728\u5FAE\u4FE1\u5411\u673A\u5668\u4EBA\u53D1\u9001\u4E00\u6761\u6D88\u606F\uFF0C\u518D\u56DE\u5230\u8FD9\u91CC\u70B9\u51FB\u300C\u6279\u51C6\u300D\uFF0C\u4E4B\u540E\u5373\u53EF\u5BF9\u8BDD\u3002", compact: true }) : pairings.map((pairing) => /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("article", { children: [
|
|
17632
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: `is-${pairing.status}`, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_dsh_client_ui_primitives25.IconUserOutlineRegular, { size: 16 }) }),
|
|
17633
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("div", { children: [
|
|
17634
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("strong", { children: pairing.displayName }),
|
|
17635
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsxs)("small", { children: [
|
|
17526
17636
|
pairing.status === "pending" ? "\u7B49\u5F85\u5BA1\u6279" : pairing.status === "approved" ? "\u5DF2\u6388\u6743\u72EC\u7ACB\u4F1A\u8BDD" : "\u5DF2\u963B\u6B62",
|
|
17527
17637
|
" \xB7 ",
|
|
17528
17638
|
new Date(pairing.updatedAt).toLocaleString()
|
|
17529
17639
|
] })
|
|
17530
17640
|
] }),
|
|
17531
|
-
pairing.status === "pending" && /* @__PURE__ */ (0,
|
|
17532
|
-
/* @__PURE__ */ (0,
|
|
17641
|
+
pairing.status === "pending" && /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
|
|
17642
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { onClick: () => {
|
|
17533
17643
|
void actPairing(pairing.id, "blocked");
|
|
17534
17644
|
}, children: "\u62D2\u7EDD" }),
|
|
17535
|
-
/* @__PURE__ */ (0,
|
|
17645
|
+
/* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { className: "is-primary", onClick: () => {
|
|
17536
17646
|
void actPairing(pairing.id, "approved");
|
|
17537
17647
|
}, children: "\u6279\u51C6" })
|
|
17538
17648
|
] }),
|
|
17539
|
-
pairing.status === "approved" && /* @__PURE__ */ (0,
|
|
17649
|
+
pairing.status === "approved" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { onClick: () => {
|
|
17540
17650
|
void actPairing(pairing.id, "blocked");
|
|
17541
17651
|
}, children: "\u64A4\u9500" }),
|
|
17542
|
-
pairing.status === "blocked" && /* @__PURE__ */ (0,
|
|
17652
|
+
pairing.status === "blocked" && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("button", { onClick: () => {
|
|
17543
17653
|
void actPairing(pairing.id, "approved");
|
|
17544
17654
|
}, children: "\u91CD\u65B0\u6279\u51C6" })
|
|
17545
17655
|
] }, pairing.id)) })
|
|
17546
17656
|
] }),
|
|
17547
|
-
error && /* @__PURE__ */ (0,
|
|
17657
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("p", { className: "dsh-partner-inline-error", children: error })
|
|
17548
17658
|
] });
|
|
17549
17659
|
}
|
|
17550
17660
|
function installStyles() {
|