@sonicloud/dsh-sonicloud-device 0.1.3 → 0.1.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/CHANGELOG.md +37 -1
- package/CHANGELOG.zh.md +37 -1
- package/README.md +18 -14
- package/README.zh.md +9 -5
- package/dist/build.json +1 -1
- package/dist/client.js +2112 -120
- package/docs/contributing/development.md +7 -5
- package/docs/specs/ci-cd.md +5 -4
- package/docs/specs/mouse-settings.md +1 -1
- package/docs/specs/multilingual.md +98 -0
- package/docs/specs/smart-mouse-plugin.md +6 -3
- package/locale/de.json +7 -0
- package/locale/en.json +7 -0
- package/locale/es.json +7 -0
- package/locale/fr.json +7 -0
- package/locale/ja.json +7 -0
- package/locale/pt.json +7 -0
- package/locale/ru.json +7 -0
- package/locale/zh.json +7 -0
- package/native/desktop/VOICE_SOURCE.json +2 -2
- package/native/desktop/VoicePanel.cs +70 -33
- package/native/desktop/VoicePanel.swift +58 -21
- package/native/desktop/darwin-arm64/Sonicloud Voice.app/Contents/MacOS/sonicloud-voice +0 -0
- package/native/screenshot/README.md +9 -4
- package/native/screenshot/SOURCE.json +48 -17
- package/native/screenshot/darwin-arm64/screentool-macos-1.2.2.zip +0 -0
- package/native/screenshot/helper-i18n/de.json +85 -0
- package/native/screenshot/helper-i18n/es.json +85 -0
- package/native/screenshot/helper-i18n/fr.json +85 -0
- package/native/screenshot/patches/{hide-cloud-actions.patch → macos/hide-cloud-actions.patch} +84 -76
- package/native/screenshot/patches/macos/mac-clang-compat.patch +14 -0
- package/native/screenshot/patches/macos/mac-color-panel.patch +40 -0
- package/native/screenshot/patches/macos/mac-permissions.patch +549 -0
- package/native/screenshot/patches/macos/mac-ui-focus.patch +658 -0
- package/native/screenshot/patches/macos/upstream-files.json +77 -0
- package/native/screenshot/patches/upstream-files.json +12 -8
- package/native/screenshot/win32-x64/i18n/de.json +85 -0
- package/native/screenshot/win32-x64/i18n/es.json +85 -0
- package/native/screenshot/win32-x64/i18n/fr.json +85 -0
- package/native/screenshot/win32-x64/screenhelper.exe +0 -0
- package/package.json +5 -3
- package/src/asr/auth.mjs +9 -8
- package/src/asr/config.mjs +1 -1
- package/src/asr/stream.mjs +25 -24
- package/src/desktop/presentation.mjs +18 -12
- package/src/desktop/screenshot-shortcut-worker.mjs +188 -0
- package/src/desktop/screenshot-shortcut.mjs +266 -0
- package/src/desktop/screenshot-worker.mjs +49 -32
- package/src/desktop/screenshot.mjs +46 -26
- package/src/devices/actions.mjs +7 -6
- package/src/devices/config.mjs +2 -1
- package/src/devices/diagnostics.mjs +4 -3
- package/src/devices/manager.mjs +77 -43
- package/src/devices/native-worker.mjs +4 -3
- package/src/devices/native.mjs +9 -8
- package/src/devices/queue.mjs +4 -3
- package/src/devices/recognition.mjs +5 -4
- package/src/devices/store.mjs +3 -2
- package/src/devices/translate.mjs +11 -10
- package/src/host/ai-conversation.mjs +8 -7
- package/src/host/index.mjs +13 -3
- package/src/host/locale.mjs +44 -0
- package/src/shared/devices.mjs +13 -12
- package/src/shared/i18n.mjs +47 -0
- package/src/shared/locales/de.json +181 -0
- package/src/shared/locales/en.json +181 -0
- package/src/shared/locales/es.json +181 -0
- package/src/shared/locales/fr.json +181 -0
- package/src/shared/locales/ja.json +181 -0
- package/src/shared/locales/pt.json +181 -0
- package/src/shared/locales/ru.json +181 -0
- package/src/shared/locales/zh.json +181 -0
- package/src/shared/remote.mjs +7 -1
- package/src/shared/screenshot-shortcut.mjs +50 -0
package/native/screenshot/patches/{hide-cloud-actions.patch → macos/hide-cloud-actions.patch}
RENAMED
|
@@ -1,55 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
+
|
|
11
|
-
+
|
|
12
|
-
+
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
m_scrollCapture->setVisible(!m_pinEditMode);
|
|
19
|
-
// [R6-UI] 编辑会话先隐藏 翻译/OCR(功能保留,仅不可见;后续按用户指示恢复)
|
|
20
|
-
- m_pTrans->setVisible(!m_pinEditMode);
|
|
21
|
-
+ m_pTrans->setVisible(!m_pinEditMode && HelperConfig::instance().transEnabled());
|
|
22
|
-
m_pOCR->setVisible(!m_pinEditMode && HelperConfig::instance().ocrVisible());
|
|
23
|
-
// [R5-ZOOM] 缩放控件仅编辑会话可见;宽度按可见按钮数自适应
|
|
24
|
-
m_btnZoom->setVisible(m_pinEditMode);
|
|
25
|
-
- const int buttons = m_pinEditMode ? 14 : 18;
|
|
26
|
-
+ const int buttons = m_pinEditMode ? 14 : 16
|
|
27
|
-
+ + int(HelperConfig::instance().transEnabled())
|
|
28
|
-
+ + int(HelperConfig::instance().ocrVisible());
|
|
29
|
-
setFixedSize((FixedWidth + 16) * buttons, FixedHeight + 20);
|
|
30
|
-
// [R3-#4] 编辑模式语义换装:✔=完成编辑(盖章)、✗=取消编辑——沿用截图会话的
|
|
31
|
-
// "完成截图/退出截图"文案会让用户以为按钮无效(功能本身已分别接 confirmPinEdit/
|
|
32
|
-
--- a/core/screen_label.h
|
|
33
|
-
+++ b/core/screen_label.h
|
|
34
|
-
@@ -47,6 +47,7 @@
|
|
35
|
-
// class ScreenLabel : public QLabel
|
|
36
|
-
class ScreenLabel : public QLabel
|
|
37
|
-
{
|
|
38
|
-
+ friend class TestCloudActions;
|
|
39
|
-
Q_OBJECT
|
|
40
|
-
class AddItemCommand : public QUndoCommand
|
|
41
|
-
{
|
|
42
|
-
@@ -169,6 +170,7 @@
|
|
43
|
-
bool eventFilter(QObject *obj, QEvent *event) override;
|
|
44
|
-
private:
|
|
45
|
-
void initScrollCapture();
|
|
46
|
-
+ void refreshScrollActions();
|
|
47
|
-
void initConnectTool();
|
|
48
|
-
void showToolBar();
|
|
49
|
-
// [R3-#3] 贴图编辑模式:工具条切换为独立置顶小窗(贴窗边+跟随)/还原为子部件
|
|
1
|
+
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
|
2
|
+
--- a/CMakeLists.txt
|
|
3
|
+
+++ b/CMakeLists.txt
|
|
4
|
+
@@ -259,6 +259,12 @@ if(SCREENTOOL_BUILD_TESTS)
|
|
5
|
+
add_executable(test_helper_config tests/test_helper_config.cpp)
|
|
6
|
+
target_link_libraries(test_helper_config PRIVATE ${QT_LINK}::Test screentool_core)
|
|
7
|
+
add_test(NAME helper_config COMMAND test_helper_config)
|
|
8
|
+
+ if(TARGET PixPinScrollCapture)
|
|
9
|
+
+ add_executable(test_cloud_actions tests/test_cloud_actions.cpp)
|
|
10
|
+
+ target_link_libraries(test_cloud_actions PRIVATE ${QT_LINK}::Test ${QT_LINK}::Widgets screentool_core)
|
|
11
|
+
+ target_sources(test_cloud_actions PRIVATE res/themes/themes.qrc res/qrc/icons.qrc)
|
|
12
|
+
+ add_test(NAME cloud_actions COMMAND test_cloud_actions)
|
|
13
|
+
+ endif()
|
|
14
|
+
# [I18N-4] 翻译资产门禁:解析入库 res/i18n/ts/*.ts——新增 tr() 未翻译
|
|
15
|
+
# (空 unfinished)/漏语言/漏条目/完成态语言出现 unfinished 即红;
|
|
16
|
+
# .ts 取编译期源码树路径,无需 Linguist 工具
|
|
17
|
+
diff --git a/core/screen_label.cpp b/core/screen_label.cpp
|
|
50
18
|
--- a/core/screen_label.cpp
|
|
51
19
|
+++ b/core/screen_label.cpp
|
|
52
|
-
@@ -
|
|
20
|
+
@@ -922,13 +922,7 @@ void ScreenLabel::mouseReleaseEvent(QMouseEvent *e)
|
|
53
21
|
void ScreenLabel::initScrollCapture()
|
|
54
22
|
{
|
|
55
23
|
#ifdef ENABLE_PIXPIN_SCROLL_CAPTURE
|
|
@@ -64,12 +32,10 @@
|
|
|
64
32
|
m_scrollCaptureParams.hideMoveButton = true;
|
|
65
33
|
// [MAC-RESET-20260920] 回归官方 demo 集成:hideCaptureBorder 不再强制
|
|
66
34
|
// true(demo 默认 false),滚动驱动/窗口干预等全部摘除,行为与官方
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
+}
|
|
72
|
-
+
|
|
35
|
+
@@ -938,6 +932,25 @@ void ScreenLabel::initScrollCapture()
|
|
36
|
+
#endif
|
|
37
|
+
}
|
|
38
|
+
|
|
73
39
|
+void ScreenLabel::refreshScrollActions()
|
|
74
40
|
+{
|
|
75
41
|
+#ifdef ENABLE_PIXPIN_SCROLL_CAPTURE
|
|
@@ -86,10 +52,13 @@
|
|
|
86
52
|
+ action.closeAfterTrigger = true;
|
|
87
53
|
+ m_scrollCaptureParams.actions.append(action);
|
|
88
54
|
+ }
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
55
|
+
+#endif
|
|
56
|
+
+}
|
|
57
|
+
+
|
|
58
|
+
void ScreenLabel::mouseDoubleClickEvent(QMouseEvent *event)
|
|
59
|
+
{
|
|
60
|
+
// [JT-FIX use-after-scope 2026-09-15] 同 mousePressEvent:te 提升函数作用域,
|
|
61
|
+
@@ -1648,6 +1661,7 @@ void ScreenLabel::onScrollCaptureTriggered()
|
|
93
62
|
restoreScrollWindows();
|
|
94
63
|
for (QWidget* w : QApplication::topLevelWidgets()) m_scrollExistingWindows.append(w);
|
|
95
64
|
#endif
|
|
@@ -97,9 +66,61 @@
|
|
|
97
66
|
PixPinScrollCapture* inst = PixPinScrollCapture::createInstance(m_scrollCaptureParams, this);
|
|
98
67
|
if (inst)
|
|
99
68
|
{
|
|
69
|
+
diff --git a/core/screen_label.h b/core/screen_label.h
|
|
70
|
+
--- a/core/screen_label.h
|
|
71
|
+
+++ b/core/screen_label.h
|
|
72
|
+
@@ -48,6 +48,7 @@ enum class DragType {
|
|
73
|
+
// class ScreenLabel : public QLabel
|
|
74
|
+
class ScreenLabel : public QLabel
|
|
75
|
+
{
|
|
76
|
+
+ friend class TestCloudActions;
|
|
77
|
+
Q_OBJECT
|
|
78
|
+
class AddItemCommand : public QUndoCommand
|
|
79
|
+
{
|
|
80
|
+
@@ -174,6 +175,7 @@ protected:
|
|
81
|
+
private:
|
|
82
|
+
friend class TestCaptureSave;
|
|
83
|
+
void initScrollCapture();
|
|
84
|
+
+ void refreshScrollActions();
|
|
85
|
+
void initConnectTool();
|
|
86
|
+
void saveSelection();
|
|
87
|
+
void openSavePanel(QDialog *panel);
|
|
88
|
+
diff --git a/core/screen_tool_bar.cpp b/core/screen_tool_bar.cpp
|
|
89
|
+
--- a/core/screen_tool_bar.cpp
|
|
90
|
+
+++ b/core/screen_tool_bar.cpp
|
|
91
|
+
@@ -111,9 +111,9 @@ void ScreenToolBar::initUI()
|
|
92
|
+
layout->addWidget(m_pExit);
|
|
93
|
+
layout->addWidget(m_pOk);
|
|
94
|
+
|
|
95
|
+
- // [HELPER-IPC] OCR 按钮显隐由 set_config 下发(原渠道宏语义)
|
|
96
|
+
- if (!HelperConfig::instance().ocrVisible())
|
|
97
|
+
- m_pOCR->hide();
|
|
98
|
+
+ // 未接入的云功能同时隐藏入口;滚动截图保持可用。
|
|
99
|
+
+ m_pOCR->setVisible(HelperConfig::instance().ocrVisible());
|
|
100
|
+
+ m_pTrans->setVisible(HelperConfig::instance().transEnabled());
|
|
101
|
+
|
|
102
|
+
// [M4] 底板样式出自主题模板(颜色/圆角 token 化;原内联 qss 已收敛)
|
|
103
|
+
this->setStyleSheet(ThemeManager::instance().dialogCardQss());
|
|
104
|
+
@@ -459,11 +459,13 @@ void ScreenToolBar::applySessionButtons()
|
|
105
|
+
m_pCancel->setVisible(!m_pinEditMode);
|
|
106
|
+
m_scrollCapture->setVisible(!m_pinEditMode);
|
|
107
|
+
// [R6-UI] 编辑会话先隐藏 翻译/OCR(功能保留,仅不可见;后续按用户指示恢复)
|
|
108
|
+
- m_pTrans->setVisible(!m_pinEditMode);
|
|
109
|
+
+ m_pTrans->setVisible(!m_pinEditMode && HelperConfig::instance().transEnabled());
|
|
110
|
+
m_pOCR->setVisible(!m_pinEditMode && HelperConfig::instance().ocrVisible());
|
|
111
|
+
// [R5-ZOOM] 缩放控件仅编辑会话可见;宽度按可见按钮数自适应
|
|
112
|
+
m_btnZoom->setVisible(m_pinEditMode);
|
|
113
|
+
- const int buttons = m_pinEditMode ? 14 : 18;
|
|
114
|
+
+ const int buttons = m_pinEditMode ? 14 : 16
|
|
115
|
+
+ + int(HelperConfig::instance().transEnabled())
|
|
116
|
+
+ + int(HelperConfig::instance().ocrVisible());
|
|
117
|
+
setFixedSize((FixedWidth + 16) * buttons, FixedHeight + 20);
|
|
118
|
+
// [R3-#4] 编辑模式语义换装:✔=完成编辑(盖章)、✗=取消编辑——沿用截图会话的
|
|
119
|
+
// "完成截图/退出截图"文案会让用户以为按钮无效(功能本身已分别接 confirmPinEdit/
|
|
120
|
+
diff --git a/ipc/helper_gateway.cpp b/ipc/helper_gateway.cpp
|
|
100
121
|
--- a/ipc/helper_gateway.cpp
|
|
101
122
|
+++ b/ipc/helper_gateway.cpp
|
|
102
|
-
@@ -
|
|
123
|
+
@@ -496,6 +496,9 @@ void HelperGateway::runOcrRecognition()
|
|
103
124
|
|
|
104
125
|
void HelperGateway::onConvertImage(const QImage& img)
|
|
105
126
|
{
|
|
@@ -109,21 +130,8 @@
|
|
|
109
130
|
// 既有事件:图像交宿主(留档/宿主自行处理),协议不变
|
|
110
131
|
sendEvent(QJsonObject{{"type", "ocr_requested"},
|
|
111
132
|
{"source", QStringLiteral("scroll")}},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
@@ -257,6 +257,12 @@
|
|
115
|
-
add_executable(test_helper_config tests/test_helper_config.cpp)
|
|
116
|
-
target_link_libraries(test_helper_config PRIVATE ${QT_LINK}::Test screentool_core)
|
|
117
|
-
add_test(NAME helper_config COMMAND test_helper_config)
|
|
118
|
-
+ if(TARGET PixPinScrollCapture)
|
|
119
|
-
+ add_executable(test_cloud_actions tests/test_cloud_actions.cpp)
|
|
120
|
-
+ target_link_libraries(test_cloud_actions PRIVATE ${QT_LINK}::Test ${QT_LINK}::Widgets screentool_core)
|
|
121
|
-
+ target_sources(test_cloud_actions PRIVATE res/themes/themes.qrc res/qrc/icons.qrc)
|
|
122
|
-
+ add_test(NAME cloud_actions COMMAND test_cloud_actions)
|
|
123
|
-
+ endif()
|
|
124
|
-
add_executable(test_word_convert tests/test_word_convert.cpp)
|
|
125
|
-
target_link_libraries(test_word_convert PRIVATE ${QT_LINK}::Test screentool_core)
|
|
126
|
-
add_test(NAME word_convert COMMAND test_word_convert)
|
|
133
|
+
diff --git a/tests/test_cloud_actions.cpp b/tests/test_cloud_actions.cpp
|
|
134
|
+
new file mode 100644
|
|
127
135
|
--- /dev/null
|
|
128
136
|
+++ b/tests/test_cloud_actions.cpp
|
|
129
137
|
@@ -0,0 +1,73 @@
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
diff --git a/core/language_manager.cpp b/core/language_manager.cpp
|
|
2
|
+
--- a/core/language_manager.cpp
|
|
3
|
+
+++ b/core/language_manager.cpp
|
|
4
|
+
@@ -354,7 +354,9 @@ QStringList LanguageManager::loadExternal(const QString& dir)
|
|
5
|
+
|
|
6
|
+
const ExternalCatalog* LanguageManager::externalCatalog(const QString& code) const
|
|
7
|
+
{
|
|
8
|
+
- return m_external.contains(code) ? &m_external.value(code) : nullptr;
|
|
9
|
+
+ // QHash::value() 返回副本,对临时对象取地址是悬垂指针;clang 17 起直接报错。
|
|
10
|
+
+ const auto it = m_external.constFind(code);
|
|
11
|
+
+ return it != m_external.cend() ? &it.value() : nullptr;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
QString LanguageManager::catalogSource() const
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
diff --git a/core/screen_tool_bar.cpp b/core/screen_tool_bar.cpp
|
|
2
|
+
--- a/core/screen_tool_bar.cpp
|
|
3
|
+
+++ b/core/screen_tool_bar.cpp
|
|
4
|
+
@@ -10,6 +10,9 @@
|
|
5
|
+
#include <QKeyEvent>
|
|
6
|
+
#include <QFrame>
|
|
7
|
+
#include <QColorDialog>
|
|
8
|
+
+#ifdef Q_OS_MAC
|
|
9
|
+
+#include "mac_native.h"
|
|
10
|
+
+#endif
|
|
11
|
+
#include <QDebug>
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
@@ -204,7 +207,26 @@ void ScreenToolBar::initData()
|
|
15
|
+
void ScreenToolBar::initConnect()
|
|
16
|
+
{
|
|
17
|
+
QObject::connect(m_btnColor, &QPushButton::clicked, this, [=]{
|
|
18
|
+
+#ifdef Q_OS_MAC
|
|
19
|
+
+ // [MAC-COLOR-PANEL] 后台型(LSUIElement)helper 的系统面板不会前置显示,蒙层在
|
|
20
|
+
+ // above-dock 层时还会盖住面板。对齐保存面板(ScreenLabel::openSavePanel):
|
|
21
|
+
+ // 取色期间临时把蒙层降到普通层级、切换为常规应用并激活,结束后还原。
|
|
22
|
+
+ // 截图会话中工具条是蒙层的子部件;贴图编辑时工具条自身是顶层窗,无需降层。
|
|
23
|
+
+ QWidget *overlay = this->window();
|
|
24
|
+
+ const int overlayLevel = overlay != this ? macGetWindowLevel(overlay) : -1;
|
|
25
|
+
+ if (overlayLevel > 0)
|
|
26
|
+
+ macSetWindowLevel(overlay, 0);
|
|
27
|
+
+ // 不切换应用类型:Accessory 下 NSColorPanel(进程内面板)可正常显示,
|
|
28
|
+
+ // 而首次 Accessory→Regular 切换会使在屏窗口被系统重新登记而藏起
|
|
29
|
+
+ // (2026-11-28 实测:首次取色整个蒙层连工具条一起消失)。OCR 结果窗
|
|
30
|
+
+ // 同为进程内窗口,也从未依赖类型切换来显示。
|
|
31
|
+
+ macActivateApp();
|
|
32
|
+
+#endif
|
|
33
|
+
QColor color = QColorDialog::getColor(m_currentColor, this, tr("Select color"));
|
|
34
|
+
+#ifdef Q_OS_MAC
|
|
35
|
+
+ if (overlayLevel > 0)
|
|
36
|
+
+ macSetWindowLevel(overlay, overlayLevel);
|
|
37
|
+
+#endif
|
|
38
|
+
if (color.isValid()) {
|
|
39
|
+
m_currentColor = color;
|
|
40
|
+
// m_btnColor->setStyleSheet(QString("background-image: url(:/color.png);background-color: %1;")
|