@baojiliu/iris-plugin-client 0.1.3 → 0.1.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/README.md CHANGED
@@ -82,6 +82,10 @@ npm install @baojiliu/iris-plugin-client
82
82
 
83
83
  `package.json` 的 `peerDependencies` 写上 `react` 和 `react-dom` 的范围。`irisPlugin()` 会把这份范围写进入口的 `peers`。版本对不对,要等插件被打开时由宿主检查。
84
84
 
85
+ ## 和宿主共用 UI(`@baojiliu/iris-plugin-ui`)
86
+
87
+ 插件可 `import { Button } from "@baojiliu/iris-plugin-ui/button"`。`irisPlugin()` 同样会改写成宿主注入的 shadcn 组件。薄包只提供类型与占位;真正实现只在 Iris 宿主。
88
+
85
89
  ## 调用示例
86
90
 
87
91
  把一行放进宿主左栏,标题随置顶切换:
@@ -1,4 +1,4 @@
1
- export type SharedField = "react" | "reactDOM" | "jsxRuntime";
1
+ export type SharedField = "react" | "reactDOM" | "jsxRuntime" | "uiButton";
2
2
  export declare function sharedModuleSource(field: SharedField, exportNames: readonly string[]): string;
3
3
  export declare function peersExportSource(peerDependencies: unknown): string | null;
4
4
  export declare function appendPeersExport(code: string, peersSource: string): string;
package/dist/sidebar.d.ts CHANGED
@@ -27,8 +27,8 @@ export interface SidebarSlotMeta {
27
27
  */
28
28
  label: () => string;
29
29
  /**
30
- * Lucide React 组件导出名(PascalCase),如 `"Smile"`、`"Puzzle"`。
31
- * 宿主按名渲染;若同时传了 `register` 的 `render`,以 `render` 为准。
30
+ * Lucide React 组件导出名(PascalCase),如 `"Smile"`、`"ArrowLeft"`。
31
+ * 宿主按名按需加载并渲染(任意 Lucide 图标均可);若同时传了 `register` 的 `render`,以 `render` 为准。
32
32
  */
33
33
  icon?: string;
34
34
  }
package/dist/vite.js CHANGED
@@ -14,6 +14,7 @@ const sharedFields = {
14
14
  react: "react",
15
15
  "react-dom": "reactDOM",
16
16
  "react/jsx-runtime": "jsxRuntime",
17
+ "@baojiliu/iris-plugin-ui/button": "uiButton",
17
18
  };
18
19
  const prefix = "\0iris-shared:";
19
20
  export function irisPlugin() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baojiliu/iris-plugin-client",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Iris 前端插件与宿主共用的契约,以及插件构建时使用的 Vite 插件。",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",