dsh-workbench-danmaku 0.2.2 → 0.2.4
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 +13 -4
- package/lib/index.js +2 -1
- package/package.json +3 -3
package/lib/client.js
CHANGED
|
@@ -1275,6 +1275,7 @@ var require_mount = __commonJS({
|
|
|
1275
1275
|
var overlayStyle = require_style();
|
|
1276
1276
|
var layerModule = require_layer();
|
|
1277
1277
|
var DOMAIN = "wb-addon-danmaku";
|
|
1278
|
+
var ACTION_PREFIX = "danmaku.";
|
|
1278
1279
|
var STYLE_ID2 = "wbdm-dm-styles";
|
|
1279
1280
|
var THEME_DEBOUNCE = 700;
|
|
1280
1281
|
var DEFAULTS = {
|
|
@@ -1306,7 +1307,7 @@ var require_mount = __commonJS({
|
|
|
1306
1307
|
(document.head || document.documentElement).appendChild(style);
|
|
1307
1308
|
}
|
|
1308
1309
|
function call(action, args) {
|
|
1309
|
-
return fetch("/workbench/api/domains/" + DOMAIN + "/actions/" + action, {
|
|
1310
|
+
return fetch("/workbench/api/domains/" + DOMAIN + "/actions/" + encodeURIComponent(ACTION_PREFIX + action), {
|
|
1310
1311
|
method: "POST",
|
|
1311
1312
|
headers: { "content-type": "application/json" },
|
|
1312
1313
|
body: JSON.stringify(args || {})
|
|
@@ -1359,6 +1360,7 @@ var require_mount = __commonJS({
|
|
|
1359
1360
|
var surface = null;
|
|
1360
1361
|
var sse = null;
|
|
1361
1362
|
var retries = 0;
|
|
1363
|
+
var configLoaded = false;
|
|
1362
1364
|
var themeTimer = null;
|
|
1363
1365
|
var lastThemeKey = "";
|
|
1364
1366
|
var typingTimer = null;
|
|
@@ -1391,6 +1393,7 @@ var require_mount = __commonJS({
|
|
|
1391
1393
|
var result = res && res.result ? res.result : res;
|
|
1392
1394
|
if (res && res.ok && result && result.values) {
|
|
1393
1395
|
retries = 0;
|
|
1396
|
+
configLoaded = true;
|
|
1394
1397
|
apply(result.values);
|
|
1395
1398
|
return;
|
|
1396
1399
|
}
|
|
@@ -1419,7 +1422,7 @@ var require_mount = __commonJS({
|
|
|
1419
1422
|
return target.closest('input, textarea, [contenteditable=""], [contenteditable="true"], [contenteditable="plaintext-only"]');
|
|
1420
1423
|
}
|
|
1421
1424
|
function onTyping(event) {
|
|
1422
|
-
if (!config.pauseOnInput) return;
|
|
1425
|
+
if (!configLoaded || !config.pauseOnInput) return;
|
|
1423
1426
|
if (!editableFrom(event.target)) return;
|
|
1424
1427
|
window.clearTimeout(typingTimer);
|
|
1425
1428
|
layer.pause(true);
|
|
@@ -1429,7 +1432,7 @@ var require_mount = __commonJS({
|
|
|
1429
1432
|
}, TYPING_IDLE_MS);
|
|
1430
1433
|
}
|
|
1431
1434
|
function onFocusOut(event) {
|
|
1432
|
-
if (!config.pauseOnInput) return;
|
|
1435
|
+
if (!configLoaded || !config.pauseOnInput) return;
|
|
1433
1436
|
if (!editableFrom(event.target)) return;
|
|
1434
1437
|
window.clearTimeout(typingTimer);
|
|
1435
1438
|
typingTimer = null;
|
|
@@ -1461,6 +1464,12 @@ var require_mount = __commonJS({
|
|
|
1461
1464
|
refresh();
|
|
1462
1465
|
}
|
|
1463
1466
|
});
|
|
1467
|
+
sse.onopen = function() {
|
|
1468
|
+
if (!configLoaded) {
|
|
1469
|
+
retries = 0;
|
|
1470
|
+
refresh();
|
|
1471
|
+
}
|
|
1472
|
+
};
|
|
1464
1473
|
sse.onerror = function() {
|
|
1465
1474
|
};
|
|
1466
1475
|
}
|
|
@@ -4843,7 +4852,7 @@ function definition(host) {
|
|
|
4843
4852
|
var tab = makeTab(host.react);
|
|
4844
4853
|
return {
|
|
4845
4854
|
id: ADDON_ID,
|
|
4846
|
-
version: "0.2.
|
|
4855
|
+
version: "0.2.4",
|
|
4847
4856
|
icon: tab("megaphone"),
|
|
4848
4857
|
views: [
|
|
4849
4858
|
{
|
package/lib/index.js
CHANGED
|
@@ -110,7 +110,8 @@ export function apply(ctx) {
|
|
|
110
110
|
title: "弹幕",
|
|
111
111
|
description:
|
|
112
112
|
"把自建弹幕轮播在整个 DSH 界面,并可叠加到整个桌面;单一宿主调度、SSE 与 Electron helper 双投递,含弹幕库/配置/数据/Action 四个视图",
|
|
113
|
-
version: "0.2.
|
|
113
|
+
version: "0.2.4",
|
|
114
|
+
category: "comm",
|
|
114
115
|
tables: TABLES,
|
|
115
116
|
sync: { tables: [] },
|
|
116
117
|
views: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-workbench-danmaku",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "个人工作台弹幕插件:把自建弹幕轮播在整个 DSH 界面,并可叠加到整个桌面",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"id": "wb-addon-danmaku",
|
|
18
18
|
"title": "弹幕",
|
|
19
19
|
"description": "在整个 DSH 界面(含工作台业务页与宿主弹窗之外的所有区域)与桌面透明层轮播自建弹幕;含弹幕库、配置、数据与 Action 四个视图",
|
|
20
|
-
"version": "0.2.
|
|
20
|
+
"version": "0.2.4",
|
|
21
21
|
"minShell": "0.8.0",
|
|
22
22
|
"tables": [
|
|
23
23
|
"danmaku"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"./package.json": "./package.json"
|
|
54
54
|
},
|
|
55
55
|
"dependencies": {
|
|
56
|
-
"dsh-workbench-host": "^0.8.
|
|
56
|
+
"dsh-workbench-host": "^0.8.2"
|
|
57
57
|
},
|
|
58
58
|
"dsh": {
|
|
59
59
|
"bundle": {
|