@goflowstate/widget-sdk 0.3.0 → 0.3.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
@@ -156,6 +156,42 @@ Claims are only ever the reader's own, and they are context, not
156
156
  authorization. `session.claims` is `null` for members, for PWA guests and
157
157
  before the first state arrives.
158
158
 
159
+ ## Flow feedback (the bug icon)
160
+
161
+ A flow that calls `CanvasWidget.initSession()` carries the feedback icon with no code of its own.
162
+ While the ring has feedback switched on, the session state says so and the SDK puts a round
163
+ button in the corner of the page. A tap takes a screenshot of the page, then opens a sheet with
164
+ one field. The note is sent through the flow's session to `POST /api/w/:slug/feedback`.
165
+
166
+ The icon and the sheet take the look of the page they sit on: its fonts, ground, ink, the fill
167
+ and shape of its main button, and its corner radius. To pin a role, set a custom property on
168
+ `:root`:
169
+
170
+ ```css
171
+ :root {
172
+ --fs-feedback-cta: #5136c4; /* also -cta-ink, -ground, -ink, -font, -font-display, -radius */
173
+ --fs-feedback-bottom: 96px; /* where the icon sits; also -right */
174
+ }
175
+ ```
176
+
177
+ The button floats over the flow and belongs to the person using it. They can drag it anywhere,
178
+ and it settles on the nearer side. A flick at an edge, or a drag into one, docks it there as a
179
+ slim tab with the bug still showing; a tap on the tab opens the sheet, and pulling the tab
180
+ inward floats it again. The sheet also has a "Tuck the button to the side" link. Where a person
181
+ leaves the button is remembered.
182
+
183
+ Until a person moves it, the button keeps clear of the page's own controls. It starts in the bottom corner and, whenever
184
+ the page changes, resizes or stops scrolling, looks up the right edge for the lowest spot that is empty. It sits over a line of text only
185
+ when empty space is far above it, and on a control only when the whole edge is controls. Pinning
186
+ `--fs-feedback-bottom` turns that off and holds the icon where the flow puts it.
187
+
188
+ To take the icon off one screen of a flow (a film, a full-screen picture), set
189
+ `--fs-feedback-display: none` from the flow's stylesheet while that screen is up, for example
190
+ `:root:has(.film) { --fs-feedback-display: none; }`.
191
+
192
+ Name each screen so a report says where it came from: `document.body.dataset.pageKey = 'question-2'`.
193
+ A page that must not show the icon (a projected wall) sets `<html data-fs-feedback="off">`.
194
+
159
195
  ## Full API Reference
160
196
 
161
197
  See the [Flowstate developer docs](https://developer.goflowstate.com/docs/) for the complete API reference, the manifest format, the AI integration guide, and the submission pipeline.