@linkdesk/ui 0.2.43 → 0.2.45

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.
@@ -0,0 +1,3 @@
1
+ import type { OpenWithPickerProps } from "./types";
2
+ declare function OpenWithPicker({ request, handlers, onOpenOnce, onSetDefault, onSearchMarket, onClose, }: OpenWithPickerProps): import("react").JSX.Element;
3
+ export default OpenWithPicker;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * OpenWithPicker 类型面——共享件(`@linkdesk/ui` 单实例供给,硬约束 16)。
3
+ *
4
+ * 户口 = **共享件**(案 10/01 §三):本件消费的全是**宿主声明**(插件清单 / 文件关联声明 /
5
+ * 覆盖表),按判据 A「一个控件的用途若是消费宿主声明,必须住在声明方与渲染方都够得着的地方」
6
+ * 它属于壳 + 共享层,⛔ 不得住在任何可被用户卸载的插件里(原住 file-tree ⇒ 卸载 file-tree 后
7
+ * 设置页入口与编辑器按钮一并消失——本纠正案的命门 C1.5)。
8
+ *
9
+ * 🔴 数据形状的**唯一真相源在 `@linkdesk/contracts`**(`OpenWithRequest`/`OpenWithHandler`
10
+ * 同时是壳命令 `SHELL_COMMANDS.openWith` 的公开入参/出参面,见案 04 §二)——此处只再导出,
11
+ * ⛔ 不在共享件里另立一份(防漂移重演)。
12
+ */
13
+ import type { OpenWithHandler, OpenWithRequest } from "@linkdesk/contracts";
14
+ export type { OpenWithHandler, OpenWithRequest };
15
+ /**
16
+ * 面板 props——**纯 props in / events out**(照 `PluginCard`:零 `@/core` import、零数据知识)。
17
+ * 数据由调用方(壳命令 `workbench.action.openWith`)组装后喂入;面板 ⛔ 不查 registry、
18
+ * ⛔ 不取插件表、⛔ 不解析 uri(`ext` 由壳侧 `normalizeExt` 单一真相源算好)。
19
+ */
20
+ export interface OpenWithPickerProps {
21
+ /** 文件身份:`uri`(右键/编辑器入口)与 `ext`(设置页「按类型打开」)至少给一个 */
22
+ request: OpenWithRequest;
23
+ /** 处理器行——壳侧装配产出(含 `title` 处理器名 / `typeLabel` 类型名 / `manifest` 身份图) */
24
+ handlers: OpenWithHandler[];
25
+ /** 「打开(仅此一次)」 */
26
+ onOpenOnce: (pluginId: string) => void;
27
+ /** 「设为默认」/「恢复自动」——`null` = 恢复自动(删覆盖表该键) */
28
+ onSetDefault: (pluginId: string | null) => void;
29
+ /** 空态那颗「在市场搜索阅读器」 */
30
+ onSearchMarket: () => void;
31
+ onClose: () => void;
32
+ }
@@ -0,0 +1,26 @@
1
+ import type { ReactNode } from "react";
2
+ import type { MenuItemDescriptor } from "@linkdesk/contracts";
3
+ import type { ManifestIconShape } from "../plugin-icon/iconUtils";
4
+ interface PluginCardProps {
5
+ /** 插件身份+副文本第二行(title 过长 / 重名时 id 是唯一稳定识别物)。 */
6
+ pluginId: string;
7
+ /** 透传 `PluginIcon`——图标唯一裁决源;缺省 ⇒ `PluginIcon` 自兜底(E6#54b 纯 props)。 */
8
+ manifest?: ManifestIconShape;
9
+ /** 显示名。**调用方 `t()` 后传入**(共享件零中文,SourceBadge 先例)。 */
10
+ title: string;
11
+ /** 版本号——副文本显示为「id · v1.2.0」;缺省只显 id。 */
12
+ version?: string;
13
+ /** 常驻摘要(折叠/展开都在),如「声明 45 类 · 竞争 12 类」——管理器组装。 */
14
+ summary?: ReactNode;
15
+ /** 展开态(**受控**:开合策略=管理器策略——搜索命中自动展开、批量开合都要求外部持有)。 */
16
+ expanded: boolean;
17
+ onToggle(next: boolean): void;
18
+ /** 卡头齿轮菜单项(形状=共享 `ContextMenu` 既有契约);缺省或空数组 ⇒ ⛔ 不渲染齿轮。 */
19
+ gearItems?: MenuItemDescriptor[];
20
+ /** 插件停用:卡体降不透明度+「已停用」徽标。行与动作的惰性由管理器组装的 children 承担(03 §1)。 */
21
+ disabled?: boolean;
22
+ /** 展开体(行清单)——管理器自组。 */
23
+ children: ReactNode;
24
+ }
25
+ declare function PluginCard({ pluginId, manifest, title, version, summary, expanded, onToggle, gearItems, disabled, children, }: PluginCardProps): import("react").JSX.Element;
26
+ export default PluginCard;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "shellVersion": "0.2.48",
3
- "commit": "2ec7230ef",
3
+ "commit": "99370fbc5",
4
4
  "cutAt": "2026-10-05"
5
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linkdesk/ui",
3
- "version": "0.2.43",
3
+ "version": "0.2.45",
4
4
  "description": "@linkdesk/ui——LinkDesk 共享 UI 组件的类型契约 + dev 解析体。L9 集中供给:组件代码与样式在运行时由壳池 vendor 单实例供给(壳改一处全生态跟随);npm i 装的是类型与本地解析体,插件源码不 import 本包 css(lint 腿 check-ui-css-import 判红)。版本号自走(E6#166 对货不对号:2026-10-01 起与壳脱钩,壳发版只查作者面货不落后)。",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",