@linkdesk/plugin-sdk 0.1.69 → 0.1.70
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/README.md
CHANGED
|
@@ -18,7 +18,7 @@ npm install -D @linkdesk/plugin-sdk
|
|
|
18
18
|
> 自动生成,**勿手改**——由 `scripts/generate-api-cheatsheet.mjs` 从 `@linkdesk/contracts` 的 `linkdesk.d.ts` 现读产出,
|
|
19
19
|
> `npm run check` 机械盯漂。完整签名与逐方法说明见 `linkdesk.d.ts` 本体(IDE 里可直接跳转)。
|
|
20
20
|
|
|
21
|
-
**
|
|
21
|
+
**16 个域接口 → 47 个命名空间 / 254 个方法**,全部经 `window.linkdesk.<命名空间>.<方法>` 调用。 (plus 1 deprecated alias/es `config`, not counted twice)
|
|
22
22
|
|
|
23
23
|
| Namespace | Methods | Method | Notes |
|
|
24
24
|
|:--|:--:|:--|:--|
|
|
@@ -28,6 +28,7 @@ npm install -D @linkdesk/plugin-sdk
|
|
|
28
28
|
| `theme` | 11 | `getCurrent` `getAvailable` `apply` `listRecipes` `getActive` `getEffectiveTokens` `setRecipe` `setColorway` `resetAppearance` `resetMix` `getBaselineSeeds` | —— |
|
|
29
29
|
| `language` | 5 | `getCurrent` `getAvailable` `set` `getInitial` `onChange` | —— |
|
|
30
30
|
| `appearance` | 2 | `importImage` `revealStorage` | 外观资产——本地选图拷贝入库(受控来源——用户任选路径不能 file:// 直读) |
|
|
31
|
+
| `storage` ⚠️ | 2 | `revealCache` `cacheDir` | —— |
|
|
31
32
|
| `tabs` | 9 | `create` `openOrFocus` `focus` `close` `focusBySourceId` `updateLabelBySourceId` `closeBySourceId` `onDidChangeActiveTab` `list` | —— |
|
|
32
33
|
| `keybindings` | 12 | `getKeybindings` `getConflicts` `registerKeybinding` `saveUserKeybindings` `removeKeybindingForCommand` `resetKeybindingToDefault` `findKeybindingForCommand` `setKeybindingCaptureActive` `keyboardEventToKeyString` `onChange` `syncToMainProcess`° `onForwardedEvent`° | —— |
|
|
33
34
|
| `notifications` | 3 | `show` `list` `subscribe` | 通知——插件弹通知(唯一通知面 = 铃铛宽通知面板,右下窄卡链路已整删),对标 VS Code vscode.wind… |
|
|
@@ -69,7 +70,7 @@ npm install -D @linkdesk/plugin-sdk
|
|
|
69
70
|
| `app` | 1 | `getVersion` | app 命名空间——只读产品身份 |
|
|
70
71
|
| `update` | 1 | `getState` | update 命名空间——只读更新状态(供「关于」类插件读宿主版本/更新态) |
|
|
71
72
|
|
|
72
|
-
⚠️ = optional namespace in the contract (injected on one side only): `bridge` `hotExit` — check for existence before calling; on the other side it is undefined.
|
|
73
|
+
⚠️ = optional namespace in the contract (injected on one side only): `storage` `bridge` `hotExit` — check for existence before calling; on the other side it is undefined.
|
|
73
74
|
° = member marked `?` in the contract: injected in one side's preload only (almost always shell-side). **Your plugin runs in the pool** — check for existence before calling.
|
|
74
75
|
|
|
75
76
|
<!-- END API-CHEATSHEET -->
|
package/dev-host/index.html
CHANGED
|
@@ -28,8 +28,9 @@
|
|
|
28
28
|
--border: #3C3C3C;
|
|
29
29
|
--separator: #474747;
|
|
30
30
|
--icon-inactive: #858585;
|
|
31
|
-
--icon-
|
|
32
|
-
--icon-
|
|
31
|
+
--icon-ink: color-mix(in srgb, var(--text-primary) 78%, transparent);
|
|
32
|
+
--icon-ink-hover: color-mix(in srgb, var(--text-primary) 92%, transparent);
|
|
33
|
+
--icon-ink-active: var(--text-primary);
|
|
33
34
|
--system-log: #6A6A6A;
|
|
34
35
|
--sent-echo: #0078D4;
|
|
35
36
|
--status-connected: #4EC9B0;
|
|
@@ -81,6 +81,10 @@ export const linkdeskMock: Record<string, unknown> = {
|
|
|
81
81
|
importImage: async (..._args: unknown[]) => { console.info("[linkdesk-mock] appearance.importImage", ..._args); return ""; },
|
|
82
82
|
revealStorage: async (..._args: unknown[]) => { console.info("[linkdesk-mock] appearance.revealStorage", ..._args); },
|
|
83
83
|
},
|
|
84
|
+
storage: {
|
|
85
|
+
revealCache: async (..._args: unknown[]) => { console.info("[linkdesk-mock] storage.revealCache", ..._args); },
|
|
86
|
+
cacheDir: async (..._args: unknown[]) => { console.info("[linkdesk-mock] storage.cacheDir", ..._args); return ""; },
|
|
87
|
+
},
|
|
84
88
|
tabs: {
|
|
85
89
|
create: async (..._args: unknown[]) => { console.info("[linkdesk-mock] tabs.create", ..._args); },
|
|
86
90
|
openOrFocus: async (..._args: unknown[]) => { console.info("[linkdesk-mock] tabs.openOrFocus", ..._args); },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@linkdesk/plugin-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.70",
|
|
4
4
|
"description": "@linkdesk/plugin-sdk——LinkDesk 插件作者 SDK(对标 @types/vscode):window.linkdesk.* 类型 + 一键 build(.linkdesk-plugin) + dev 宿主 + plugin.json 验证 + eslint 门禁(E6#54d)。作者 npm i 后零壳源码依赖。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -757,6 +757,10 @@
|
|
|
757
757
|
"ldk-dialog-host-title",
|
|
758
758
|
"ldk-drop-glass-zone",
|
|
759
759
|
"ldk-dropdown-card",
|
|
760
|
+
"ldk-effective-badge",
|
|
761
|
+
"ldk-effective-badge-label",
|
|
762
|
+
"ldk-effective-badge-value",
|
|
763
|
+
"ldk-effective-swatch",
|
|
760
764
|
"ldk-empty-stage",
|
|
761
765
|
"ldk-empty-stage-mark",
|
|
762
766
|
"ldk-empty-stage-sr",
|
|
@@ -795,10 +799,13 @@
|
|
|
795
799
|
"ldk-icon-bar",
|
|
796
800
|
"ldk-icon-bar-bottom",
|
|
797
801
|
"ldk-icon-bar-item-wrapper",
|
|
802
|
+
"ldk-icon-bar-plugin-icon",
|
|
798
803
|
"ldk-icon-bar-top",
|
|
799
804
|
"ldk-icon-btn",
|
|
800
805
|
"ldk-icon-drag-preview",
|
|
801
806
|
"ldk-icon-drop-indicator",
|
|
807
|
+
"ldk-image-picker",
|
|
808
|
+
"ldk-image-picker__path",
|
|
802
809
|
"ldk-inline-input",
|
|
803
810
|
"ldk-inline-input--compact",
|
|
804
811
|
"ldk-inline-input--normal",
|
|
@@ -866,6 +873,7 @@
|
|
|
866
873
|
"ldk-notif-task-section-rule",
|
|
867
874
|
"ldk-number-input",
|
|
868
875
|
"ldk-number-input-btn",
|
|
876
|
+
"ldk-number-input-cell",
|
|
869
877
|
"ldk-number-input-field",
|
|
870
878
|
"ldk-number-input-unit",
|
|
871
879
|
"ldk-panel-content",
|
|
@@ -990,6 +998,12 @@
|
|
|
990
998
|
"ldk-rn-w90",
|
|
991
999
|
"ldk-scroll-y",
|
|
992
1000
|
"ldk-section-subtitle",
|
|
1001
|
+
"ldk-segment-preview",
|
|
1002
|
+
"ldk-segment-preview--accent",
|
|
1003
|
+
"ldk-segment-preview--split",
|
|
1004
|
+
"ldk-segment-preview__half",
|
|
1005
|
+
"ldk-segment-preview__half--deep",
|
|
1006
|
+
"ldk-segment-preview__half--light",
|
|
993
1007
|
"ldk-segmented-radio",
|
|
994
1008
|
"ldk-segmented-radio__label",
|
|
995
1009
|
"ldk-segmented-radio__option",
|
|
@@ -1048,6 +1062,9 @@
|
|
|
1048
1062
|
"ldk-slider-root",
|
|
1049
1063
|
"ldk-slider-step",
|
|
1050
1064
|
"ldk-slider-value",
|
|
1065
|
+
"ldk-source-badge",
|
|
1066
|
+
"ldk-source-badge--mix",
|
|
1067
|
+
"ldk-source-badge--user",
|
|
1051
1068
|
"ldk-split-handle",
|
|
1052
1069
|
"ldk-status-bar",
|
|
1053
1070
|
"ldk-status-bar-btn",
|
|
@@ -36,6 +36,8 @@
|
|
|
36
36
|
"app.osIntegration.fileAssoc",
|
|
37
37
|
"app.osIntegration.fileMenu",
|
|
38
38
|
"app.schemaVersion",
|
|
39
|
+
"app.storage.cacheDir",
|
|
40
|
+
"app.storage.openCacheDir",
|
|
39
41
|
"app.surfaceRadius",
|
|
40
42
|
"app.theme",
|
|
41
43
|
"app.themeColor",
|
|
@@ -57,6 +59,7 @@
|
|
|
57
59
|
"editorCount",
|
|
58
60
|
"editorHasSelection",
|
|
59
61
|
"inputFocus",
|
|
62
|
+
"settingsActiveIsBuiltin",
|
|
60
63
|
"settingsSlotFilled",
|
|
61
64
|
"sidebarPosition",
|
|
62
65
|
"updateActionable",
|
|
@@ -126,6 +129,15 @@
|
|
|
126
129
|
"replacedBy": "(无——关闭即当帧消失,无退场动画;关闭前 120ms 等待同笔删除)",
|
|
127
130
|
"landing": "src/pool/shared/group-tab-bar/GroupTabBar.css",
|
|
128
131
|
"approvedBy": "用户 · 2026-09-27"
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"name": "app.storage.cacheDir",
|
|
135
|
+
"kind": "configKey",
|
|
136
|
+
"since": "2026-10-04",
|
|
137
|
+
"why": "04-软件更新〔设置行-控制只读同行〕D3(2026-10-03 用户拍板「合并回一行」):缓存目录两行并成一行——主件 app.storage.openCacheDir 同载 actionCommand + statusCommand(伴生声明正交化,01 §1.2 表第 ③ 行 `[按钮][只读路径]`)。本键的「缓存在哪」只读语义改由主键的**伴生只读**承载;描述串「缓存目录——缓存文件实际存放的位置(只读,软件内不可改)」一并退役(合并行的按钮文案与行说明**共用主键 description**,长句会把按钮撑成横条)",
|
|
138
|
+
"replacedBy": "app.storage.openCacheDir(同键伴生 statusCommand: storage.cacheDirStatus)",
|
|
139
|
+
"landing": "electron/ipc/handlers/storage-handlers.ts:26(resolveEffectiveCacheDir 仍读 settings.json 平键;界面侧改读 storage.cacheDirStatus 命令)",
|
|
140
|
+
"approvedBy": "用户 · 2026-10-03"
|
|
129
141
|
}
|
|
130
142
|
]
|
|
131
143
|
}
|
|
@@ -371,11 +371,11 @@
|
|
|
371
371
|
"enum": { "type": "array" },
|
|
372
372
|
"enumDescriptions": { "type": "object", "description": "enum value → display name mapping" },
|
|
373
373
|
"description": { "type": "string" },
|
|
374
|
-
"uiHint": { "type": "string", "description": "Settings editor rendering hint
|
|
375
|
-
"renderHint": { "type": "string", "description": "Rendering hint for special rows — \"action\" renders a button (its text comes from description, clicking runs actionCommand); \"readonly\" renders a read-only status line whose value comes from executing statusCommand.
|
|
376
|
-
"actionCommand": { "type": "string", "description": "Command executed when an \"action\" button is clicked — a shell command id or one of your own (resolved when clicked)" },
|
|
374
|
+
"uiHint": { "type": "string", "description": "Settings editor rendering hint — SettingsView picks the control from the hint. Known hints: slider, fontSize, color, fontFamily, file, directory, image, segmented, fontTone, accentSource, themePicker, select, stringList. A hint the installed renderer does not know is shown read-only — the current value plus a tooltip saying the declared control is unsupported (no editable fallback control, no error thrown). The value is an open string, so third parties may declare new hint names." },
|
|
375
|
+
"renderHint": { "type": "string", "description": "Rendering hint for special rows — \"action\" renders a button (its text comes from description, clicking runs actionCommand); \"readonly\" renders a read-only status line whose value comes from executing statusCommand; \"color\" renders a read-only color row (swatch + value). \"readonly\"/\"action\" are shorthands meaning the row's primary control IS the status line/button: statusCommand and actionCommand may also be declared alongside any primary control, rendering as companions to its right ([primary control][companion button][companion readonly]). Known hints: readonly, action, color. An unknown hint is shown read-only (current value + explanatory tooltip). Open string." },
|
|
376
|
+
"actionCommand": { "type": "string", "description": "Command executed when an \"action\" button is clicked — a shell command id or one of your own (resolved when clicked). May be declared alongside any primary control: it then renders as a companion button to the right of that control, with its text taken from description." },
|
|
377
377
|
"actionDisabledAll": { "type": "array", "description": "Disable the \"action\" button while every entry matches the current configuration value (omit the field entirely — or pass an empty list — to keep the button always enabled)", "items": { "type": "object", "required": ["key", "value"], "properties": { "key": { "type": "string" }, "value": {} }, "additionalProperties": false } },
|
|
378
|
-
"statusCommand": { "type": "string", "description": "Command whose return value (a string) is shown by a \"readonly\" status line — the value comes from the command, not from configuration storage, so a status row can show live runtime state. Shell command id or one of your own." },
|
|
378
|
+
"statusCommand": { "type": "string", "description": "Command whose return value (a string) is shown by a \"readonly\" status line — the value comes from the command, not from configuration storage, so a status row can show live runtime state. The settings view polls it (every 3s by default; polling pauses while the window is hidden). Shell command id or one of your own. The command must be cheap, idempotent and side-effect free — it may be called repeatedly in the background. May be declared alongside any primary control: it then renders as a companion read-only line to the right of that control. Without a primary control, declare renderHint \"readonly\" so the status line becomes the row's main control." },
|
|
379
379
|
"monoOnly": { "type": "boolean", "description": "Monospace only — meaningful only with uiHint \"fontFamily\". true/omitted = list monospace families only (editor fonts); false = all families (UI fonts)." },
|
|
380
380
|
"minimum": { "type": "number", "description": "Numeric lower bound — applies when type is number (range of the slider/numeric control)" },
|
|
381
381
|
"maximum": { "type": "number", "description": "Numeric upper bound — applies when type is number (range of the slider/numeric control)" },
|