dsh-workbench-message 0.1.2 → 0.1.6

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 CHANGED
@@ -1267,6 +1267,7 @@ var require_notifier = __commonJS({
1267
1267
  var state = {
1268
1268
  running: false,
1269
1269
  source: null,
1270
+ listeners: /* @__PURE__ */ new Set(),
1270
1271
  cfg: { at: 0, values: null },
1271
1272
  audio: null,
1272
1273
  lastKey: "",
@@ -1385,8 +1386,32 @@ var require_notifier = __commonJS({
1385
1386
  if (isQuiet(values, /* @__PURE__ */ new Date()) && !passQuiet(values, level)) return false;
1386
1387
  return playTone(level, values["sound.volume"]);
1387
1388
  }
1389
+ function subscribe(fn) {
1390
+ if (typeof fn !== "function") return function() {
1391
+ };
1392
+ state.listeners.add(fn);
1393
+ return function() {
1394
+ state.listeners.delete(fn);
1395
+ };
1396
+ }
1397
+ function broadcast(event, data) {
1398
+ state.listeners.forEach(function(fn) {
1399
+ try {
1400
+ fn(event, data);
1401
+ } catch (e) {
1402
+ }
1403
+ });
1404
+ }
1388
1405
  function handleEvent(payload) {
1389
- if (!payload || payload.domainId !== DOMAIN || payload.event !== "message.created") return;
1406
+ if (!payload || payload.domainId !== DOMAIN) return;
1407
+ if (payload.event === "message.created") {
1408
+ var created = payload.data && payload.data.message;
1409
+ if (created && created.id) broadcast("message.created", { message: created });
1410
+ } else if (payload.event === "message.read") {
1411
+ broadcast("message.read", payload.data || {});
1412
+ return;
1413
+ }
1414
+ if (payload.event !== "message.created") return;
1390
1415
  var message = payload.data && payload.data.message;
1391
1416
  if (!message || !message.id) return;
1392
1417
  var now = Date.now();
@@ -1426,9 +1451,18 @@ var require_notifier = __commonJS({
1426
1451
  return playTone(lv, values["sound.volume"] === void 0 ? 0.4 : values["sound.volume"]);
1427
1452
  });
1428
1453
  }
1429
- module2.exports = { start, stop, preview, refreshConfig: function() {
1430
- return loadConfig(true);
1431
- } };
1454
+ module2.exports = {
1455
+ start,
1456
+ stop,
1457
+ subscribe,
1458
+ preview,
1459
+ refreshConfig: function() {
1460
+ return loadConfig(true).then(function(values) {
1461
+ broadcast("config", { values: values || {} });
1462
+ return values;
1463
+ });
1464
+ }
1465
+ };
1432
1466
  }
1433
1467
  });
1434
1468
 
@@ -3862,6 +3896,347 @@ var require_actions = __commonJS({
3862
3896
  }
3863
3897
  });
3864
3898
 
3899
+ // packages/addons/message/client/float/style.cjs
3900
+ var require_style = __commonJS({
3901
+ "packages/addons/message/client/float/style.cjs"(exports2, module2) {
3902
+ "use strict";
3903
+ module2.exports = function floatStyles() {
3904
+ return [
3905
+ ".wbm-float-root{position:fixed;left:0;right:0;bottom:0;height:0;z-index:860;pointer-events:none;-webkit-app-region:no-drag}",
3906
+ ".wbm-float-root .wbm-float-btn{position:absolute;right:20px;bottom:20px;display:inline-flex;align-items:center;justify-content:center;",
3907
+ "box-sizing:border-box;width:46px;height:46px;padding:0;flex:0 0 auto;border-radius:50%;",
3908
+ "--wbm-float-bg:var(--dsw-alias-button-floating-fill,var(--wb-card,#2c2c2e));",
3909
+ "--wbm-float-ink:var(--dsw-alias-label-primary,var(--wb-muted,currentColor));",
3910
+ "--wbm-float-line:var(--dsw-alias-border-l2,var(--wb-border,rgba(255,255,255,.14)));",
3911
+ "--wbm-float-danger:var(--dsw-alias-state-error-primary,var(--wb-danger,#dc2626));",
3912
+ "border:1px solid var(--wbm-float-line);background:var(--wbm-float-bg);color:var(--wbm-float-ink);",
3913
+ "cursor:pointer;pointer-events:auto;-webkit-app-region:no-drag;overflow:visible;",
3914
+ "box-shadow:0 8px 22px rgba(0,0,0,.24),0 1px 3px rgba(0,0,0,.18);",
3915
+ "transition:transform .18s ease,box-shadow .18s ease,background .18s ease,border-color .18s ease}",
3916
+ ".wbm-float-root .wbm-float-btn:hover{transform:translateY(-1px);box-shadow:0 12px 26px rgba(0,0,0,.28),0 1px 3px rgba(0,0,0,.2);",
3917
+ "background:var(--dsw-alias-button-floating-hover,var(--wbm-float-bg))}",
3918
+ ".wbm-float-root .wbm-float-btn:active{transform:translateY(0)}",
3919
+ ".wbm-float-root .wbm-float-btn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,var(--wb-accent,#2563eb));outline-offset:2px}",
3920
+ ".wbm-float-root .wbm-float-btn[data-pos=bottom-left]{left:20px;right:auto}",
3921
+ // 页面底部有输入框时抬到它上面,避免压在发送按钮上(没有输入框就贴右下角)。
3922
+ ".wbm-float-root .wbm-float-btn[data-lift]{bottom:var(--wbm-float-lift,76px)}",
3923
+ ".wbm-float-root .wbm-float-btn svg{display:block;width:21px;height:21px;flex:0 0 auto}",
3924
+ ".wbm-float-root .wbm-float-badge{position:absolute;top:-5px;right:-5px;min-width:18px;height:18px;padding:0 5px;",
3925
+ "box-sizing:border-box;border-radius:999px;display:none;align-items:center;justify-content:center;",
3926
+ "background:var(--wbm-float-danger,#dc2626);color:var(--dsw-alias-label-on-color,#fff);",
3927
+ "font-size:11px;font-weight:650;line-height:1;font-variant-numeric:tabular-nums;",
3928
+ "box-shadow:0 0 0 2px var(--wbm-float-bg)}",
3929
+ ".wbm-float-root .wbm-float-btn[data-unread] .wbm-float-badge{display:inline-flex}",
3930
+ ".wbm-float-root .wbm-float-btn[data-pulse=1]{animation:wbm-float-bounce .6s cubic-bezier(.34,1.56,.64,1)}",
3931
+ "@keyframes wbm-float-bounce{0%{transform:translateY(0)}35%{transform:translateY(-7px)}70%{transform:translateY(0)}100%{transform:translateY(0)}}",
3932
+ "@media (max-width:640px){.wbm-float-root .wbm-float-btn{width:40px;height:40px;right:12px;bottom:12px}",
3933
+ ".wbm-float-root .wbm-float-btn[data-pos=bottom-left]{left:12px;right:auto}",
3934
+ ".wbm-float-root .wbm-float-btn svg{width:18px;height:18px}}",
3935
+ // 降低动态偏好:不做位移,只让描边闪一次颜色。
3936
+ "@media (prefers-reduced-motion: reduce){.wbm-float-root .wbm-float-btn[data-pulse=1]{animation:none;",
3937
+ "border-color:var(--dsw-alias-brand-primary,var(--wb-accent,#2563eb))}",
3938
+ ".wbm-float-root .wbm-float-btn{transition:none}}"
3939
+ ];
3940
+ };
3941
+ }
3942
+ });
3943
+
3944
+ // packages/addons/message/client/float/button.cjs
3945
+ var require_button = __commonJS({
3946
+ "packages/addons/message/client/float/button.cjs"(exports2, module2) {
3947
+ "use strict";
3948
+ var ICON_PATH = "M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z";
3949
+ var PULSE_MS = 600;
3950
+ function label(lang, count) {
3951
+ var n = count > 0 ? count : 0;
3952
+ if (lang === "en") return n > 0 ? "Messages, " + n + " unread" : "Messages, no unread";
3953
+ return n > 0 ? "\u6D88\u606F\uFF0C" + n + " \u6761\u672A\u8BFB" : "\u6D88\u606F\uFF0C\u65E0\u672A\u8BFB";
3954
+ }
3955
+ function text(count) {
3956
+ return count > 99 ? "99+" : String(count);
3957
+ }
3958
+ function createButton(options) {
3959
+ var doc = options.doc || document;
3960
+ var lang = options.lang === "en" ? "en" : "zh";
3961
+ var onActivate = typeof options.onActivate === "function" ? options.onActivate : function() {
3962
+ };
3963
+ var count = 0;
3964
+ var pulseTimer = null;
3965
+ var btn = doc.createElement("button");
3966
+ btn.type = "button";
3967
+ btn.className = "wbm-float-btn";
3968
+ btn.style.borderRadius = "50%";
3969
+ btn.style.pointerEvents = "auto";
3970
+ btn.setAttribute("data-pos", "bottom-right");
3971
+ btn.setAttribute("aria-label", label(lang, 0));
3972
+ btn.setAttribute("title", label(lang, 0));
3973
+ var svg = doc.createElementNS("http://www.w3.org/2000/svg", "svg");
3974
+ svg.setAttribute("viewBox", "0 0 24 24");
3975
+ svg.setAttribute("fill", "none");
3976
+ svg.setAttribute("stroke", "currentColor");
3977
+ svg.setAttribute("stroke-width", "1.7");
3978
+ svg.setAttribute("stroke-linecap", "round");
3979
+ svg.setAttribute("stroke-linejoin", "round");
3980
+ svg.setAttribute("aria-hidden", "true");
3981
+ var path = doc.createElementNS("http://www.w3.org/2000/svg", "path");
3982
+ path.setAttribute("d", ICON_PATH);
3983
+ svg.appendChild(path);
3984
+ btn.appendChild(svg);
3985
+ var badge = doc.createElement("span");
3986
+ badge.className = "wbm-float-badge";
3987
+ badge.setAttribute("aria-hidden", "true");
3988
+ btn.appendChild(badge);
3989
+ function announce(next) {
3990
+ var text_ = label(lang, next);
3991
+ btn.setAttribute("aria-label", text_);
3992
+ btn.setAttribute("title", text_);
3993
+ }
3994
+ function setCount(next) {
3995
+ var n = Number(next);
3996
+ count = isFinite(n) && n > 0 ? Math.floor(n) : 0;
3997
+ badge.textContent = text(count);
3998
+ if (count > 0) btn.setAttribute("data-unread", "1");
3999
+ else btn.removeAttribute("data-unread");
4000
+ announce(count);
4001
+ return count;
4002
+ }
4003
+ function pulse() {
4004
+ if (!btn || typeof btn.setAttribute !== "function") return;
4005
+ if (btn.getAttribute("data-pulse") === "1") return;
4006
+ btn.setAttribute("data-pulse", "1");
4007
+ if (typeof setTimeout !== "function") return;
4008
+ pulseTimer = setTimeout(function() {
4009
+ pulseTimer = null;
4010
+ btn.removeAttribute("data-pulse");
4011
+ }, PULSE_MS);
4012
+ }
4013
+ function setPosition(pos) {
4014
+ btn.setAttribute("data-pos", pos === "bottom-left" ? "bottom-left" : "bottom-right");
4015
+ }
4016
+ function setLang(next) {
4017
+ lang = next === "en" ? "en" : "zh";
4018
+ announce(count);
4019
+ }
4020
+ btn.addEventListener("click", function(event) {
4021
+ if (event && typeof event.preventDefault === "function") event.preventDefault();
4022
+ onActivate();
4023
+ });
4024
+ function destroy() {
4025
+ if (pulseTimer && typeof clearTimeout === "function") clearTimeout(pulseTimer);
4026
+ pulseTimer = null;
4027
+ if (btn.parentNode) btn.parentNode.removeChild(btn);
4028
+ }
4029
+ return { el: btn, setCount, pulse, setPosition, setLang, destroy };
4030
+ }
4031
+ module2.exports = { createButton, ICON_PATH, PULSE_MS };
4032
+ }
4033
+ });
4034
+
4035
+ // packages/addons/message/client/float/mount.cjs
4036
+ var require_mount = __commonJS({
4037
+ "packages/addons/message/client/float/mount.cjs"(exports2, module2) {
4038
+ "use strict";
4039
+ var styles = require_style();
4040
+ var buttons = require_button();
4041
+ var DOMAIN = "wb-addon-message";
4042
+ var BASE = "/workbench/api";
4043
+ var STYLE_ID = "wb-message-float-style";
4044
+ var ADDON_ID = "wb-addon-message";
4045
+ var INBOX_VIEW = "inbox";
4046
+ function readLang(doc) {
4047
+ var attr = doc && doc.documentElement && doc.documentElement.getAttribute("lang");
4048
+ return attr && attr.toLowerCase().indexOf("en") === 0 ? "en" : "zh";
4049
+ }
4050
+ function injectStyles(doc) {
4051
+ if (!doc || !doc.head || doc.getElementById(STYLE_ID)) return;
4052
+ var style = doc.createElement("style");
4053
+ style.id = STYLE_ID;
4054
+ style.textContent = styles().join("");
4055
+ doc.head.appendChild(style);
4056
+ }
4057
+ function makeCall(fetchImpl) {
4058
+ return function call(action, args) {
4059
+ return fetchImpl(BASE + "/domains/" + DOMAIN + "/actions/" + action, {
4060
+ method: "POST",
4061
+ headers: { "content-type": "application/json" },
4062
+ body: JSON.stringify(args || {})
4063
+ }).then(function(res) {
4064
+ return res.json();
4065
+ }).then(function(body) {
4066
+ return body && body.result !== void 0 ? body.result : body;
4067
+ });
4068
+ };
4069
+ }
4070
+ function createMount(options) {
4071
+ var opts = options || {};
4072
+ var doc = opts.doc || (typeof document !== "undefined" ? document : null);
4073
+ var win = opts.win || (typeof window !== "undefined" ? window : null);
4074
+ var host = opts.host || win && win.__WB_HOST__ || null;
4075
+ var notifier = opts.notifier || null;
4076
+ var fetchImpl = opts.fetchImpl || (win && win.fetch ? win.fetch.bind(win) : null);
4077
+ var call = fetchImpl ? makeCall(fetchImpl) : null;
4078
+ var state = {
4079
+ mounted: false,
4080
+ root: null,
4081
+ btn: null,
4082
+ unsubscribe: null,
4083
+ seen: /* @__PURE__ */ new Set(),
4084
+ count: 0,
4085
+ enabled: true,
4086
+ position: "bottom-right",
4087
+ onVisible: null
4088
+ };
4089
+ function hostOverlay() {
4090
+ return doc && doc.querySelector ? doc.querySelector("[data-shell-overlay]") : null;
4091
+ }
4092
+ function liftAboveComposer() {
4093
+ if (!state.btn || !doc || typeof doc.querySelector !== "function") return;
4094
+ var composer = doc.querySelector("[data-shell-composer], .dsh-composer, [contenteditable=true], .wb-composer");
4095
+ if (!composer || typeof composer.getBoundingClientRect !== "function") {
4096
+ state.btn.el.removeAttribute("data-lift");
4097
+ return;
4098
+ }
4099
+ var rect = composer.getBoundingClientRect();
4100
+ var height = rect && rect.height > 0 ? rect.height : 0;
4101
+ if (!height) {
4102
+ state.btn.el.removeAttribute("data-lift");
4103
+ return;
4104
+ }
4105
+ var lift = Math.min(Math.max(Math.round(height + 12), 48), 140);
4106
+ state.btn.el.setAttribute("data-lift", "1");
4107
+ state.btn.el.style.setProperty("--wbm-float-lift", lift + "px");
4108
+ }
4109
+ function place() {
4110
+ if (!state.root || !doc) return;
4111
+ var target = hostOverlay() || doc.body;
4112
+ if (target && state.root.parentNode !== target) target.appendChild(state.root);
4113
+ }
4114
+ function applyConfig(values) {
4115
+ if (!values) return;
4116
+ if (values["float.enabled"] !== void 0) state.enabled = values["float.enabled"] !== false;
4117
+ if (values["float.position"]) state.position = values["float.position"];
4118
+ if (!state.btn) return;
4119
+ state.btn.setPosition(state.position);
4120
+ liftAboveComposer();
4121
+ state.btn.el.style.display = state.enabled ? "" : "none";
4122
+ if (!state.enabled) {
4123
+ state.count = 0;
4124
+ state.btn.setCount(0);
4125
+ }
4126
+ place();
4127
+ }
4128
+ function applyCount(next) {
4129
+ state.count = next > 0 ? Math.floor(next) : 0;
4130
+ if (state.btn) state.btn.setCount(state.count);
4131
+ return state.count;
4132
+ }
4133
+ function activate() {
4134
+ if (host && typeof host.navigateAddon === "function") {
4135
+ try {
4136
+ if (host.navigateAddon(ADDON_ID, INBOX_VIEW) !== false) return;
4137
+ } catch (e) {
4138
+ }
4139
+ }
4140
+ if (typeof console !== "undefined" && console.info) {
4141
+ console.info("[dsh-workbench-message] \u5F53\u524D\u5BBF\u4E3B\u4E0D\u652F\u6301\u8DF3\u8F6C\u5230\u6D88\u606F\u6536\u4EF6\u7BB1\uFF0C\u8BF7\u5728\u5DE6\u4FA7\u5BFC\u822A\u6253\u5F00\u300C\u6D88\u606F\u300D");
4142
+ }
4143
+ }
4144
+ function onEvent(event, data) {
4145
+ if (!state.btn || !state.mounted) return;
4146
+ if (event === "config") {
4147
+ applyConfig(data && data.values);
4148
+ return;
4149
+ }
4150
+ if (event === "message.read") {
4151
+ if (data && typeof data.unread === "number") applyCount(data.unread);
4152
+ return;
4153
+ }
4154
+ if (event !== "message.created") return;
4155
+ var message = data && data.message;
4156
+ if (!message || !message.id) return;
4157
+ if (state.seen.has(message.id)) return;
4158
+ state.seen.add(message.id);
4159
+ if (state.seen.size > 500) state.seen.clear();
4160
+ applyCount(state.count + 1);
4161
+ if (state.btn) state.btn.pulse();
4162
+ }
4163
+ function refreshCount() {
4164
+ if (!call) return Promise.resolve(state.count);
4165
+ return call("message.unreadCount", {}).then(function(body) {
4166
+ var unread = body && typeof body.unread === "number" ? body.unread : null;
4167
+ return unread === null ? state.count : applyCount(unread);
4168
+ }).catch(function() {
4169
+ return state.count;
4170
+ });
4171
+ }
4172
+ function loadConfig() {
4173
+ if (!call) return Promise.resolve(state.enabled);
4174
+ return call("message.configGet", {}).then(function(body) {
4175
+ applyConfig(body && body.values);
4176
+ return state.enabled;
4177
+ }).catch(function() {
4178
+ return state.enabled;
4179
+ });
4180
+ }
4181
+ function mount() {
4182
+ if (state.mounted || !doc) return state;
4183
+ injectStyles(doc);
4184
+ var root = doc.createElement("div");
4185
+ root.className = "wbm-float-root";
4186
+ root.setAttribute("data-message-float", "1");
4187
+ root.style.pointerEvents = "none";
4188
+ var btn = buttons.createButton({ doc, lang: readLang(doc), onActivate: activate });
4189
+ root.appendChild(btn.el);
4190
+ state.root = root;
4191
+ state.btn = btn;
4192
+ state.mounted = true;
4193
+ place();
4194
+ liftAboveComposer();
4195
+ if (notifier && typeof notifier.subscribe === "function") state.unsubscribe = notifier.subscribe(onEvent);
4196
+ if (win && typeof win.addEventListener === "function") {
4197
+ state.onVisible = function() {
4198
+ if (doc.visibilityState === "visible") refreshCount();
4199
+ };
4200
+ win.addEventListener("visibilitychange", state.onVisible);
4201
+ }
4202
+ loadConfig().then(function() {
4203
+ if (state.enabled) refreshCount();
4204
+ });
4205
+ return state;
4206
+ }
4207
+ function destroy() {
4208
+ if (state.unsubscribe) state.unsubscribe();
4209
+ state.unsubscribe = null;
4210
+ if (win && state.onVisible && typeof win.removeEventListener === "function") {
4211
+ win.removeEventListener("visibilitychange", state.onVisible);
4212
+ }
4213
+ state.onVisible = null;
4214
+ if (state.btn) state.btn.destroy();
4215
+ if (state.root && state.root.parentNode) state.root.parentNode.removeChild(state.root);
4216
+ state.btn = null;
4217
+ state.root = null;
4218
+ state.mounted = false;
4219
+ }
4220
+ return {
4221
+ mount,
4222
+ destroy,
4223
+ refreshCount,
4224
+ applyConfig,
4225
+ readState: function() {
4226
+ return {
4227
+ mounted: state.mounted,
4228
+ count: state.count,
4229
+ enabled: state.enabled,
4230
+ position: state.position,
4231
+ seen: state.seen.size
4232
+ };
4233
+ }
4234
+ };
4235
+ }
4236
+ module2.exports = { createMount, STYLE_ID, DOMAIN };
4237
+ }
4238
+ });
4239
+
3865
4240
  // packages/addons/message/client/client.src.cjs
3866
4241
  (function() {
3867
4242
  var root = typeof window !== "undefined" ? window : null;
@@ -3883,6 +4258,7 @@ var require_actions = __commonJS({
3883
4258
  var DataView = require_data().DataView;
3884
4259
  var ActionSchemaView = require_actions().ActionSchemaView;
3885
4260
  var notifier = require_notifier();
4261
+ var floatMount = require_mount();
3886
4262
  var InboxView = inboxFactory({ React });
3887
4263
  var StatsView = statsFactory({ React });
3888
4264
  function langOf(props) {
@@ -3912,7 +4288,7 @@ var require_actions = __commonJS({
3912
4288
  ensureStyles();
3913
4289
  host.registerAddon({
3914
4290
  id: "wb-addon-message",
3915
- version: "0.1.2",
4291
+ version: "0.1.6",
3916
4292
  icon: ICONS["message-square"],
3917
4293
  views: [
3918
4294
  { id: "stats", icon: tabIcon("chart"), title: { zh: "\u7EDF\u8BA1", en: "Stats" }, component: Stats },
@@ -3927,6 +4303,11 @@ var require_actions = __commonJS({
3927
4303
  } catch (e) {
3928
4304
  if (typeof console !== "undefined") console.warn("[dsh-workbench-message] \u63D0\u793A\u97F3\u542F\u52A8\u5931\u8D25", e);
3929
4305
  }
4306
+ try {
4307
+ floatMount.createMount({ doc: typeof document !== "undefined" ? document : null, win: root, host, notifier }).mount();
4308
+ } catch (e) {
4309
+ if (typeof console !== "undefined") console.warn("[dsh-workbench-message] \u60AC\u6D6E\u5165\u53E3\u542F\u52A8\u5931\u8D25", e);
4310
+ }
3930
4311
  module.exports = {
3931
4312
  name: "dsh-workbench-message",
3932
4313
  inject: [],
package/lib/index.js CHANGED
@@ -82,7 +82,8 @@ export function apply(ctx) {
82
82
  id: "wb-addon-message",
83
83
  title: "消息",
84
84
  description: "统一消息入口:子插件与 agent 都能发消息,含未读计数、提示音与保留期清理;含统计、收件箱、配置、数据与 Action 五个视图",
85
- version: "0.1.2",
85
+ version: "0.1.6",
86
+ category: "comm",
86
87
  tables: ["message"],
87
88
  // 只在本机保存:显式声明不同步任何表(不写 sync 时宿主默认按行同步)。
88
89
  sync: { tables: [] },
@@ -16,6 +16,7 @@ const GROUPS = [
16
16
  { id: "quiet", zh: "免打扰", en: "Quiet hours" },
17
17
  { id: "retention", zh: "保留期", en: "Retention" },
18
18
  { id: "list", zh: "列表", en: "List" },
19
+ { id: "float", zh: "悬浮入口", en: "Floating button" },
19
20
  ];
20
21
 
21
22
  const ITEMS = [
@@ -65,6 +66,20 @@ const ITEMS = [
65
66
  zh: "已读保留天数", en: "Keep read messages (days)",
66
67
  hintZh: "已读消息超过该天数自动清理;未读永不按时间清理,0 表示不按时间清理", hintEn: "Read messages older than this are pruned; unread never expires by time, 0 disables",
67
68
  },
69
+ {
70
+ id: "float.enabled", group: "float", type: "bool", surface: "ui", apply: "mount", default: true,
71
+ zh: "显示消息悬浮入口", en: "Show floating message button",
72
+ hintZh: "任意页面右下角常驻消息按钮,带未读角标;关闭后该按钮立即隐藏", hintEn: "A persistent message button in the corner with unread badge; turning it off hides it",
73
+ },
74
+ {
75
+ id: "float.position", group: "float", type: "enum", surface: "ui", apply: "mount", default: "bottom-right",
76
+ zh: "悬浮入口位置", en: "Floating position",
77
+ hintZh: "右下角默认避开输入区;与其它浮层冲突时可换到左下角", hintEn: "Bottom right avoids the input area; switch to bottom left when it collides",
78
+ values: [
79
+ { value: "bottom-right", zh: "右下角", en: "Bottom right" },
80
+ { value: "bottom-left", zh: "左下角", en: "Bottom left" },
81
+ ],
82
+ },
68
83
  {
69
84
  id: "list.pageSize", group: "list", type: "enum", surface: "ui", apply: "mount", default: 20,
70
85
  zh: "每页条数", en: "Page size",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-workbench-message",
3
- "version": "0.1.2",
3
+ "version": "0.1.6",
4
4
  "description": "个人工作台消息插件:统一消息发送入口、收件箱、未读统计与提示音",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -16,7 +16,7 @@
16
16
  "id": "wb-addon-message",
17
17
  "title": "消息",
18
18
  "description": "统一消息入口 + 统计/收件箱/配置/数据四个视图:子插件与 agent 都能发消息,带未读计数与提示音",
19
- "version": "0.1.2",
19
+ "version": "0.1.6",
20
20
  "minShell": "0.8.0",
21
21
  "tables": [
22
22
  "message"
@@ -49,7 +49,7 @@
49
49
  "./package.json": "./package.json"
50
50
  },
51
51
  "dependencies": {
52
- "dsh-workbench-host": "^0.8.1"
52
+ "dsh-workbench-host": "^0.8.3"
53
53
  },
54
54
  "dsh": {
55
55
  "bundle": {