@xmanrui/dsh-im 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/client.js +3 -3
- package/lib/index.js +145 -145
- package/package.json +1 -1
- package/plugin-src/client/channels/feishu/styles.js +1 -1
- package/plugin-src/client/styles.js +2 -2
- package/plugin-src/host/index.mjs +27 -10
package/package.json
CHANGED
|
@@ -450,7 +450,7 @@ const CSS = String.raw`
|
|
|
450
450
|
.bxf-connectedFooter { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--dsw-alias-border-l1, #eef0f3); }
|
|
451
451
|
.bxf-healthSummary { min-width: 0; color: var(--dsw-alias-label-secondary, #646a73); font-size: 12px; line-height: 18px; }
|
|
452
452
|
.bxf-healthSummary[data-error="true"] { color: var(--bxf-error); }
|
|
453
|
-
.bxf-botActions { flex: none; flex-wrap:
|
|
453
|
+
.bxf-botActions { flex: none; width: 100%; flex-wrap: wrap; gap: 8px; margin-top: 0; justify-content: flex-end; }
|
|
454
454
|
.bxf-botActions .bxf-button { flex: none; white-space: nowrap; }
|
|
455
455
|
.bxf-botActions .bxf-repairButton { color: var(--bxf-accent); border-color: color-mix(in srgb, var(--bxf-accent) 35%, var(--dsw-alias-border-l2, #dee0e3)); }
|
|
456
456
|
.bxf-botActions .bxf-repairButton:hover:not(:disabled) { background: color-mix(in srgb, var(--bxf-accent) 7%, transparent); }
|
|
@@ -206,9 +206,9 @@ const CSS = String.raw`
|
|
|
206
206
|
.dim-directoryPickerActions button:disabled { cursor: not-allowed; opacity: .52; }
|
|
207
207
|
.dim-panel .dim-cardSummary { min-width: 0; color: var(--dsw-alias-label-secondary, #646a73); font: inherit; font-size: 12px; font-weight: 400; line-height: normal; }
|
|
208
208
|
.dim-panel .dim-cardFooterLayout { min-width: 0; width: 100%; display: flex; flex-direction: column; align-items: stretch; gap: 9px; }
|
|
209
|
-
.dim-panel .dim-cardFooterLayout > .dim-cardActions { align-self:
|
|
209
|
+
.dim-panel .dim-cardFooterLayout > .dim-cardActions { align-self: stretch; }
|
|
210
210
|
.dim-panel .dim-cardFeedback { width: 100%; padding: 8px 10px; border-radius: 8px; color: var(--dsw-alias-label-secondary, #646a73); background: var(--dsw-alias-bg-module-platform, #f7f8fa); font: inherit; font-size: 12px; font-weight: 400; line-height: 18px; overflow-wrap: anywhere; white-space: normal; }
|
|
211
|
-
.dim-panel .dim-cardActions { flex: none; display: flex; align-items: center; flex-wrap:
|
|
211
|
+
.dim-panel .dim-cardActions { flex: none; width: 100%; display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; margin: 0; }
|
|
212
212
|
.dim-panel .dim-cardActions .dim-cardAction { flex: none; min-height: 32px; padding: 0 11px; border: 1px solid var(--dsw-alias-border-l2, #dfe1e5); border-radius: 8px; color: var(--dsw-alias-label-primary, #1f2329); background: var(--dsw-alias-bg-layer-1, #fff); font: inherit; font-size: 13px; font-weight: 560; line-height: normal; white-space: nowrap; }
|
|
213
213
|
.dim-panel .dim-cardActions .dim-cardAction:hover:not(:disabled) { border-color: #aeb3bb; background: var(--dsw-alias-interactive-bg-hover, #f7f8fa); }
|
|
214
214
|
.dim-panel .dim-cardActions .dim-cardAction[data-kind="danger"] { color: var(--dsw-alias-state-error-primary, #d54941); }
|
|
@@ -37,6 +37,18 @@ export function createImHostPlugin(internals = {}) {
|
|
|
37
37
|
const startDiscord = internals.applyDiscord ?? applyDiscord;
|
|
38
38
|
const startOffice = internals.applyOffice ?? applyOffice;
|
|
39
39
|
const startWhatsapp = internals.applyWhatsapp ?? applyWhatsapp;
|
|
40
|
+
const channels = [
|
|
41
|
+
['feishu', startFeishu],
|
|
42
|
+
['weixin', startWeixin],
|
|
43
|
+
['dingtalk', startDingtalk],
|
|
44
|
+
['wecom', startWecom],
|
|
45
|
+
['qq', startQq],
|
|
46
|
+
['slack', startSlack],
|
|
47
|
+
['telegram', startTelegram],
|
|
48
|
+
['discord', startDiscord],
|
|
49
|
+
['whatsapp', startWhatsapp],
|
|
50
|
+
['office', startOffice],
|
|
51
|
+
];
|
|
40
52
|
return Object.freeze({
|
|
41
53
|
name,
|
|
42
54
|
inject,
|
|
@@ -49,16 +61,21 @@ export function createImHostPlugin(internals = {}) {
|
|
|
49
61
|
} else {
|
|
50
62
|
installOutboundArtifactTool(ctx);
|
|
51
63
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
const logger = typeof ctx?.logger === 'function'
|
|
65
|
+
? ctx.logger(name)
|
|
66
|
+
: (ctx?.logger ?? console);
|
|
67
|
+
const failures = [];
|
|
68
|
+
for (const [channel, start] of channels) {
|
|
69
|
+
try {
|
|
70
|
+
await start(ctx, channelConfig(config, channel));
|
|
71
|
+
} catch (error) {
|
|
72
|
+
failures.push(error);
|
|
73
|
+
logger.error?.(`[dsh-im] failed to activate ${channel}; continuing with the remaining channels`, error);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
if (failures.length === channels.length) {
|
|
77
|
+
throw new AggregateError(failures, 'dsh-im failed to activate every channel');
|
|
78
|
+
}
|
|
62
79
|
},
|
|
63
80
|
});
|
|
64
81
|
}
|