voice-page-agent 3.0.0 → 3.0.2

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
@@ -51,7 +51,18 @@ Use this shape:
51
51
  commandMaxWindowMs: 22000, // max command listening window
52
52
  recognitionLang: "zh-CN", // SpeechRecognition language
53
53
  showAgentWhenWake: true, // auto-open panel when wake hit
54
- autoStart: false // start wake on init
54
+ autoStart: false, // start wake on init
55
+ buttonText: {
56
+ startText: "开始唤醒",
57
+ wakeOnText: "语音唤醒中",
58
+ openText: "打开助手",
59
+ },
60
+ buttonStyle: {
61
+ wakeButtonBackground: "linear-gradient(135deg, #22c1ff, #3366ff)",
62
+ wakeButtonTextColor: "#ffffff",
63
+ openButtonBackground: "linear-gradient(135deg, #ffa84a, #ff5f6d)",
64
+ openButtonTextColor: "#ffffff",
65
+ }
55
66
  }
56
67
  ```
57
68
 
@@ -72,6 +83,15 @@ app.use(VoicePageAgentPlugin, {
72
83
  },
73
84
  wakeWord: "布丁布丁",
74
85
  enableHomophoneMatch: true,
86
+ buttonText: {
87
+ startText: "开始语音",
88
+ wakeOnText: "语音进行中",
89
+ openText: "网页助手",
90
+ },
91
+ buttonStyle: {
92
+ wakeButtonBackground: "linear-gradient(135deg, #38bdf8, #2563eb)",
93
+ openButtonBackground: "linear-gradient(135deg, #f59e0b, #ef4444)",
94
+ },
75
95
  });
76
96
  app.mount("#app");
77
97
  ```
@@ -101,6 +121,15 @@ Vue.use(VoicePageAgentPlugin, {
101
121
  language: "zh-CN",
102
122
  },
103
123
  wakeWord: "布丁布丁",
124
+ buttonText: {
125
+ startText: "开始语音",
126
+ wakeOnText: "语音进行中",
127
+ openText: "网页助手",
128
+ },
129
+ buttonStyle: {
130
+ wakeButtonBackground: "linear-gradient(135deg, #38bdf8, #2563eb)",
131
+ openButtonBackground: "linear-gradient(135deg, #f59e0b, #ef4444)",
132
+ },
104
133
  });
105
134
  ```
106
135
 
@@ -120,6 +149,15 @@ Vue.use(VoicePageAgentPlugin, {
120
149
  language: "zh-CN",
121
150
  },
122
151
  wakeWord: "布丁布丁",
152
+ buttonText: {
153
+ startText: "开始语音",
154
+ wakeOnText: "语音进行中",
155
+ openText: "网页助手",
156
+ },
157
+ buttonStyle: {
158
+ wakeButtonBackground: "linear-gradient(135deg, #38bdf8, #2563eb)",
159
+ openButtonBackground: "linear-gradient(135deg, #f59e0b, #ef4444)",
160
+ },
123
161
  });
124
162
  ```
125
163
 
@@ -137,6 +175,25 @@ You can use `VoicePageAgentButton` globally after plugin install:
137
175
  <VoicePageAgentButton />
138
176
  ```
139
177
 
178
+ The component injects a built-in gradient style (same visual direction across Vue2 / Vue2.7 / Vue3).
179
+
180
+ You can override by props:
181
+
182
+ - `startText`
183
+ - `wakeOnText`
184
+ - `openText`
185
+ - `wakeButtonBackground`
186
+ - `wakeButtonTextColor`
187
+ - `openButtonBackground`
188
+ - `openButtonTextColor`
189
+
190
+ You can also override these classes in your app:
191
+
192
+ - `.voice-page-agent-root`
193
+ - `.voice-page-agent-actions`
194
+ - `.voice-page-agent-btn`
195
+ - `.voice-page-agent-status`
196
+
140
197
  It renders:
141
198
  - wake button (only when mic permission is not granted)
142
199
  - open page-agent button
@@ -0,0 +1,9 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __export = (target, all) => {
4
+ for (var name in all)
5
+ __defProp(target, name, { get: all[name], enumerable: true });
6
+ };
7
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
8
+
9
+ export { __export, __publicField };