@open-file-viewer/core 0.1.1 → 0.1.3

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
@@ -90,13 +90,45 @@ Import the stylesheet once in your app:
90
90
  import "@open-file-viewer/core/style.css";
91
91
  ```
92
92
 
93
- React and Vue adapters are available as separate packages:
93
+ React, Vue and Svelte adapters are available as separate packages:
94
94
 
95
95
  ```bash
96
96
  npm install @open-file-viewer/react
97
97
  npm install @open-file-viewer/vue
98
+ npm install @open-file-viewer/svelte
98
99
  ```
99
100
 
101
+ ## Toolbar Customization
102
+
103
+ The toolbar can be configured from simple feature toggles to a fully custom renderer:
104
+
105
+ ```ts
106
+ createViewer({
107
+ container: "#viewer",
108
+ file,
109
+ toolbar: {
110
+ labels: {
111
+ download: "下载",
112
+ fullscreen: "全屏",
113
+ search: "搜索"
114
+ },
115
+ order: ["search", "download", "approve", "fullscreen"],
116
+ actions: [
117
+ {
118
+ id: "approve",
119
+ label: "审批",
120
+ onClick(ctx) {
121
+ openApprovalDialog(ctx.file);
122
+ }
123
+ }
124
+ ]
125
+ },
126
+ plugins
127
+ });
128
+ ```
129
+
130
+ Use `toolbar.render(ctx)` when you need to replace the toolbar completely. The context exposes file metadata, queue navigation, preview commands, download, fullscreen, print and search helpers.
131
+
100
132
  ## License
101
133
 
102
134
  MIT