feedbackbasket-cli 0.9.0 → 0.9.1
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 +10 -0
- package/dist/src/commands/widget.js +23 -0
- package/dist/src/version.d.ts +2 -2
- package/dist/src/version.js +1 -1
- package/package.json +1 -1
- package/skills/feedbackbasket/SKILL.md +18 -0
package/README.md
CHANGED
|
@@ -141,6 +141,16 @@ feedbackbasket widget flow myapp --config ./feedback-flow.json
|
|
|
141
141
|
feedbackbasket widget script myapp
|
|
142
142
|
```
|
|
143
143
|
|
|
144
|
+
For inline trigger mode, load the widget once and call the public API from your own button:
|
|
145
|
+
|
|
146
|
+
```html
|
|
147
|
+
<button onclick="window.FeedbackWidget.openFeedbackForm({ trigger: event.currentTarget })">
|
|
148
|
+
Feedback
|
|
149
|
+
</button>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Passing the trigger element lets popup mode open beside your custom button. Calling `window.FeedbackWidget.openFeedbackForm()` with no arguments still uses the configured widget position.
|
|
153
|
+
|
|
144
154
|
Use `--email-read-only` and `--hide-email-when-prefilled` with runtime `userEmail` values from your app. These settings do not store visitor emails in FeedbackBasket widget settings.
|
|
145
155
|
|
|
146
156
|
`widget flow --config` accepts either a `feedbackFlow` object or a JSON object with a `feedbackFlow` key. V1 supports guided mode with `text`, `textarea`, and `single_choice` follow-up questions.
|
|
@@ -243,6 +243,7 @@ export function createWidgetCommand(getWriter) {
|
|
|
243
243
|
const projectId = await resolveProjectId(client, projectArg);
|
|
244
244
|
const result = await client.getWidgetScript(projectId);
|
|
245
245
|
if (!writer.isMachineOutput()) {
|
|
246
|
+
const settingsResult = await client.getWidgetSettings(projectId);
|
|
246
247
|
console.log(brand.bold(`Widget embed code for ${result.projectName}`));
|
|
247
248
|
console.log(divider(50));
|
|
248
249
|
console.log();
|
|
@@ -252,6 +253,7 @@ export function createWidgetCommand(getWriter) {
|
|
|
252
253
|
console.log();
|
|
253
254
|
console.log(brand.muted(` Script URL: ${result.scriptUrl}`));
|
|
254
255
|
console.log();
|
|
256
|
+
renderInlineTriggerHelp(settingsResult.settings);
|
|
255
257
|
}
|
|
256
258
|
writer.ok(result, {
|
|
257
259
|
summary: `Embed code for "${result.projectName}"`,
|
|
@@ -341,6 +343,27 @@ function isRecord(value) {
|
|
|
341
343
|
function stringValue(value) {
|
|
342
344
|
return typeof value === 'string' ? value.trim() : '';
|
|
343
345
|
}
|
|
346
|
+
function renderInlineTriggerHelp(settings) {
|
|
347
|
+
if (settings.triggerMode !== 'inline')
|
|
348
|
+
return;
|
|
349
|
+
console.log(brand.bold('Custom inline trigger'));
|
|
350
|
+
console.log(divider(50));
|
|
351
|
+
console.log();
|
|
352
|
+
console.log(brand.muted(' Call this from your own button:'));
|
|
353
|
+
console.log();
|
|
354
|
+
console.log(` ${brand.primary('<button onclick="window.FeedbackWidget.openFeedbackForm({ trigger: event.currentTarget })">')}`);
|
|
355
|
+
console.log(` ${brand.primary(' Feedback')}`);
|
|
356
|
+
console.log(` ${brand.primary('</button>')}`);
|
|
357
|
+
console.log();
|
|
358
|
+
if (settings.displayMode === 'popup') {
|
|
359
|
+
console.log(brand.muted(' Passing the trigger keeps popup mode anchored beside your custom button.'));
|
|
360
|
+
}
|
|
361
|
+
else {
|
|
362
|
+
console.log(brand.muted(' Modal mode stays centered; passing the trigger is safe for future popup changes.'));
|
|
363
|
+
}
|
|
364
|
+
console.log(brand.muted(' Existing calls to window.FeedbackWidget.openFeedbackForm() still work.'));
|
|
365
|
+
console.log();
|
|
366
|
+
}
|
|
344
367
|
function renderWidgetSettings(projectName, settings) {
|
|
345
368
|
console.log(brand.bold(`Widget settings — ${projectName}`));
|
|
346
369
|
console.log(divider(40));
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.9.
|
|
2
|
-
export declare const USER_AGENT = "FeedbackBasket-CLI/0.9.
|
|
1
|
+
export declare const VERSION = "0.9.1";
|
|
2
|
+
export declare const USER_AGENT = "FeedbackBasket-CLI/0.9.1";
|
package/dist/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.9.
|
|
1
|
+
export const VERSION = '0.9.1';
|
|
2
2
|
export const USER_AGENT = `FeedbackBasket-CLI/${VERSION}`;
|
package/package.json
CHANGED
|
@@ -109,6 +109,24 @@ feedbackbasket widget flow <project> --reset-default --enable
|
|
|
109
109
|
feedbackbasket widget flow <project> --config ./feedback-flow.json
|
|
110
110
|
```
|
|
111
111
|
|
|
112
|
+
For inline trigger mode, load the widget once and call the public API from the host app's custom button:
|
|
113
|
+
|
|
114
|
+
```html
|
|
115
|
+
<button onclick="window.FeedbackWidget.openFeedbackForm({ trigger: event.currentTarget })">
|
|
116
|
+
Feedback
|
|
117
|
+
</button>
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
In React:
|
|
121
|
+
|
|
122
|
+
```tsx
|
|
123
|
+
<button onClick={(event) => window.FeedbackWidget.openFeedbackForm({ trigger: event.currentTarget })}>
|
|
124
|
+
Feedback
|
|
125
|
+
</button>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Passing the trigger element lets popup mode open beside the custom button. Calling `window.FeedbackWidget.openFeedbackForm()` with no arguments still uses the configured widget position.
|
|
129
|
+
|
|
112
130
|
`email-read-only` and `hide-email-when-prefilled` control behavior only when the host app passes a runtime `userEmail` value. Do not store visitor emails in widget settings.
|
|
113
131
|
|
|
114
132
|
`widget flow --config` accepts either a `feedbackFlow` object or a JSON object with a `feedbackFlow` key. Use it when an agent needs to customize visitor choices such as Bug report, Feature request, and General feedback. Supported v1 question types are `text`, `textarea`, and `single_choice`.
|