@dsh-workbench/shared 0.1.7 → 0.1.9
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/dist/api/dsh-client.d.ts +11 -0
- package/dist/components/Activity.css +69 -0
- package/dist/components/Activity.d.ts +23 -0
- package/dist/components/Activity.js +23 -0
- package/dist/components/ApprovalPlan.css +41 -0
- package/dist/components/ApprovalPlan.d.ts +13 -0
- package/dist/components/ApprovalPlan.js +11 -0
- package/dist/components/Card.css +20 -0
- package/dist/components/Card.d.ts +13 -0
- package/dist/components/Card.js +8 -0
- package/dist/components/Note.css +14 -0
- package/dist/components/Note.d.ts +8 -0
- package/dist/components/Note.js +6 -0
- package/dist/components/ResourceStates.css +5 -1
- package/dist/components/Rows.css +30 -0
- package/dist/components/Rows.d.ts +11 -0
- package/dist/components/Rows.js +10 -0
- package/dist/components/SettingsSection.css +26 -0
- package/dist/components/SettingsSection.d.ts +9 -0
- package/dist/components/SettingsSection.js +9 -0
- package/dist/components/Stack.css +7 -0
- package/dist/components/Stack.d.ts +6 -0
- package/dist/components/Stack.js +5 -0
- package/dist/components/StateBlock.css +36 -0
- package/dist/components/StateBlock.d.ts +11 -0
- package/dist/components/StateBlock.js +12 -0
- package/dist/components/icons.d.ts +1 -0
- package/dist/components/icons.js +4 -0
- package/dist/config/constants.d.ts +2 -0
- package/dist/config/constants.js +2 -0
- package/dist/i18n/en.js +5 -2
- package/dist/i18n/index.d.ts +6 -3
- package/dist/i18n/zh.d.ts +5 -2
- package/dist/i18n/zh.js +5 -2
- package/dist/index.d.ts +8 -0
- package/dist/index.js +8 -0
- package/dist/lib/react.d.ts +1 -0
- package/dist/lib/react.js +1 -0
- package/package.json +1 -1
- package/src/api/dsh-client.ts +13 -0
- package/src/components/Activity.css +69 -0
- package/src/components/Activity.tsx +76 -0
- package/src/components/ApprovalPlan.css +41 -0
- package/src/components/ApprovalPlan.tsx +33 -0
- package/src/components/Card.css +20 -0
- package/src/components/Card.tsx +28 -0
- package/src/components/Note.css +14 -0
- package/src/components/Note.tsx +14 -0
- package/src/components/ResourceStates.css +5 -1
- package/src/components/Rows.css +30 -0
- package/src/components/Rows.tsx +25 -0
- package/src/components/SettingsSection.css +26 -0
- package/src/components/SettingsSection.tsx +22 -0
- package/src/components/Stack.css +7 -0
- package/src/components/Stack.tsx +11 -0
- package/src/components/StateBlock.css +36 -0
- package/src/components/StateBlock.tsx +29 -0
- package/src/components/icons.tsx +16 -0
- package/src/config/constants.ts +4 -0
- package/src/i18n/en.ts +5 -2
- package/src/i18n/zh.ts +5 -2
- package/src/index.ts +8 -0
- package/src/lib/react.test.ts +2 -1
- package/src/lib/react.ts +1 -0
package/src/components/icons.tsx
CHANGED
|
@@ -66,3 +66,19 @@ export function IconModules({ size = 16 }: IconProps) {
|
|
|
66
66
|
</svg>
|
|
67
67
|
);
|
|
68
68
|
}
|
|
69
|
+
|
|
70
|
+
export function IconPanelScreen({ size = 16 }: IconProps) {
|
|
71
|
+
return (
|
|
72
|
+
<svg
|
|
73
|
+
width={size}
|
|
74
|
+
height={size}
|
|
75
|
+
viewBox="0 0 1024 1024"
|
|
76
|
+
fill="currentColor"
|
|
77
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
78
|
+
aria-hidden="true"
|
|
79
|
+
style={{ display: 'block', overflow: 'hidden' }}
|
|
80
|
+
>
|
|
81
|
+
<path d="M939 112c17.673 0 32 14.327 32 32v554.667c0 17.673-14.327 32-32 32l-394.5-0.001v96c0 3.74-0.642 7.331-1.82 10.668H768.4c17.673 0 32 14.326 32 32 0 17.496-14.042 31.712-31.47 31.995l-0.53 0.004H256.6c-17.673 0-32-14.327-32-32 0-17.496 14.042-31.713 31.47-31.995l0.53-0.005h225.721a31.923 31.923 0 0 1-1.817-10.137l-0.004-0.53v-96H86c-17.496 0-31.713-14.041-31.996-31.47l-0.004-0.53V144c0-17.673 14.327-32 32-32z m-32 64H118v490.666h789V176zM341.9 432c17.496 0 31.713 14.042 31.996 31.47l0.004 0.53v85.333c0 17.673-14.327 32-32 32-17.496 0-31.713-14.041-31.996-31.47l-0.004-0.53V464c0-17.673 14.327-32 32-32z m170.6-85.333c17.496 0 31.713 14.041 31.996 31.47l0.004 0.53v170.666c0 17.673-14.327 32-32 32-17.496 0-31.713-14.041-31.996-31.47l-0.004-0.53V378.667c0-17.673 14.327-32 32-32z m170.6-85.334c17.496 0 31.713 14.042 31.996 31.471l0.004 0.53v256c0 17.672-14.327 32-32 32-17.496 0-31.713-14.042-31.996-31.471l-0.004-0.53v-256c0-17.673 14.327-32 32-32z" />
|
|
82
|
+
</svg>
|
|
83
|
+
);
|
|
84
|
+
}
|
package/src/config/constants.ts
CHANGED
|
@@ -47,6 +47,10 @@ export const STORAGE_KEY_PROJECT = "dsh-workbench.project";
|
|
|
47
47
|
|
|
48
48
|
export const STORAGE_KEY_RIGHTBAR = "dsh-workbench.rightbar.expanded";
|
|
49
49
|
|
|
50
|
+
export const STORAGE_KEY_RIGHTBAR_COLUMN = "dsh-workbench.rightbar.column";
|
|
51
|
+
|
|
52
|
+
export const RIGHTBAR_FULLSCREEN_WIDTH = 768;
|
|
53
|
+
|
|
50
54
|
export const LOCALE_NS = "workbench";
|
|
51
55
|
|
|
52
56
|
export const LOCALES = ["zh", "en"] as const;
|
package/src/i18n/en.ts
CHANGED
|
@@ -86,7 +86,7 @@ export const en: Record<keyof WorkbenchMessages, string> = {
|
|
|
86
86
|
'panels.market.empty': 'No modules available',
|
|
87
87
|
'panels.market.installedSection': 'Installed',
|
|
88
88
|
'panels.market.moduleOutdated': 'update available',
|
|
89
|
-
'panels.market.moduleRestartHint': '
|
|
89
|
+
'panels.market.moduleRestartHint': 'installed but not active — restart dsh once to bring it up',
|
|
90
90
|
'panels.market.restartNeeded': 'The new version is installed — restart once to pick it up.',
|
|
91
91
|
'panels.market.foot': 'After installing, enable it in the panel page of that project.',
|
|
92
92
|
'panels.market.recheck': 'Check for updates',
|
|
@@ -282,6 +282,9 @@ export const en: Record<keyof WorkbenchMessages, string> = {
|
|
|
282
282
|
'rightbar.label': 'Data panels',
|
|
283
283
|
'rightbar.expand': 'Expand the data panel',
|
|
284
284
|
'rightbar.collapse': 'Collapse the data panel',
|
|
285
|
+
'rightbar.column.label': 'Right column',
|
|
286
|
+
'rightbar.column.workbench': 'Workbench panel',
|
|
287
|
+
'rightbar.column.dsh': 'dsh panel',
|
|
285
288
|
'rightbar.refresh': 'Refresh',
|
|
286
289
|
'rightbar.refreshing': 'Refreshing…',
|
|
287
290
|
'rightbar.updatedAt': 'updated {time}',
|
|
@@ -289,7 +292,7 @@ export const en: Record<keyof WorkbenchMessages, string> = {
|
|
|
289
292
|
'coding.notARepo.title': 'This workspace is not a Coding repository',
|
|
290
293
|
'error.unknown': 'Something went wrong',
|
|
291
294
|
|
|
292
|
-
'board.title': '
|
|
295
|
+
'board.title': 'Workbench panel',
|
|
293
296
|
|
|
294
297
|
'panel.conversation': 'Conversation',
|
|
295
298
|
'panels.label': 'Global panels',
|
package/src/i18n/zh.ts
CHANGED
|
@@ -82,7 +82,7 @@ export const zh = {
|
|
|
82
82
|
'panels.market.empty': '暂无可用模块',
|
|
83
83
|
'panels.market.installedSection': '已装',
|
|
84
84
|
'panels.market.moduleOutdated': '有新版',
|
|
85
|
-
'panels.market.moduleRestartHint': '
|
|
85
|
+
'panels.market.moduleRestartHint': '装好了但还没生效 —— 重启一次 dsh 就会出来',
|
|
86
86
|
'panels.market.restartNeeded': '新版装好了,重启一次才生效。',
|
|
87
87
|
'panels.market.foot': '装好后到那个项目的面板页勾选它,模块才会出现。',
|
|
88
88
|
'panels.market.recheck': '重新检查更新',
|
|
@@ -278,6 +278,9 @@ export const zh = {
|
|
|
278
278
|
'rightbar.label': '数据面板',
|
|
279
279
|
'rightbar.expand': '展开数据面板',
|
|
280
280
|
'rightbar.collapse': '收起数据面板',
|
|
281
|
+
'rightbar.column.label': '右侧栏',
|
|
282
|
+
'rightbar.column.workbench': '工作台面板',
|
|
283
|
+
'rightbar.column.dsh': 'dsh 面板',
|
|
281
284
|
'rightbar.refresh': '刷新',
|
|
282
285
|
'rightbar.refreshing': '刷新中…',
|
|
283
286
|
'rightbar.updatedAt': '更新于 {time}',
|
|
@@ -285,7 +288,7 @@ export const zh = {
|
|
|
285
288
|
'coding.notARepo.title': '这个项目不是 Coding 仓库',
|
|
286
289
|
'error.unknown': '出错了',
|
|
287
290
|
|
|
288
|
-
'board.title': '
|
|
291
|
+
'board.title': '工作台面板',
|
|
289
292
|
|
|
290
293
|
'panel.conversation': '对话',
|
|
291
294
|
'panels.label': '全局面板',
|
package/src/index.ts
CHANGED
|
@@ -10,13 +10,21 @@ export * from './api/unit-board.js';
|
|
|
10
10
|
export * from './api/unit.js';
|
|
11
11
|
export * from './api/workbench-client.js';
|
|
12
12
|
export * from './api/workbench-contract.js';
|
|
13
|
+
export * from './components/Activity.js';
|
|
13
14
|
export * from './components/ApprovalDetail.js';
|
|
15
|
+
export * from './components/ApprovalPlan.js';
|
|
16
|
+
export * from './components/Card.js';
|
|
14
17
|
export * from './components/CardHead.js';
|
|
15
18
|
export * from './components/ChoiceGroup.js';
|
|
16
19
|
export * from './components/LongTaskRow.js';
|
|
17
20
|
export * from './components/MockStrip.js';
|
|
21
|
+
export * from './components/Note.js';
|
|
18
22
|
export * from './components/ResourceStates.js';
|
|
23
|
+
export * from './components/Rows.js';
|
|
19
24
|
export * from './components/SaveBar.js';
|
|
25
|
+
export * from './components/SettingsSection.js';
|
|
26
|
+
export * from './components/Stack.js';
|
|
27
|
+
export * from './components/StateBlock.js';
|
|
20
28
|
export * from './components/TextField.js';
|
|
21
29
|
export * from './components/board-module.js';
|
|
22
30
|
export * from './components/icons.js';
|
package/src/lib/react.test.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { describe, expect, it } from 'vitest';
|
|
3
|
-
import { Fragment, h, useCallback, useEffect, useMemo, useRef, useState } from './react.js';
|
|
3
|
+
import { Fragment, h, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from './react.js';
|
|
4
4
|
|
|
5
5
|
describe('react 入口', () => {
|
|
6
6
|
it('h 就是 React.createElement(同一个引用,不是包装)', () => {
|
|
@@ -19,6 +19,7 @@ describe('react 入口', () => {
|
|
|
19
19
|
expect(Fragment).toBe(React.Fragment);
|
|
20
20
|
expect(useState).toBe(React.useState);
|
|
21
21
|
expect(useEffect).toBe(React.useEffect);
|
|
22
|
+
expect(useLayoutEffect).toBe(React.useLayoutEffect);
|
|
22
23
|
expect(useMemo).toBe(React.useMemo);
|
|
23
24
|
expect(useCallback).toBe(React.useCallback);
|
|
24
25
|
expect(useRef).toBe(React.useRef);
|
package/src/lib/react.ts
CHANGED
|
@@ -8,6 +8,7 @@ export const Fragment = react.Fragment;
|
|
|
8
8
|
|
|
9
9
|
export const useState = react.useState;
|
|
10
10
|
export const useEffect = react.useEffect;
|
|
11
|
+
export const useLayoutEffect = react.useLayoutEffect;
|
|
11
12
|
export const useMemo = react.useMemo;
|
|
12
13
|
export const useCallback = react.useCallback;
|
|
13
14
|
export const useRef = react.useRef;
|