@classic-homes/feedback-core
v0.2.0
Published
Framework-agnostic feedback widget core: payload schema, chapi client, selection capture, screenshots and styles
Readme
@classic-homes/feedback-core
Framework-agnostic core for the Classic Theme feedback widget: payload schema, chapi client, selection capture, screenshots, Turnstile, and the widget stylesheet. Used by @classic-homes/feedback-react and @classic-homes/feedback-svelte.
Installation
npm install @classic-homes/feedback-coreUsage
Import the stylesheet once, in your global CSS or entry file:
@import '@classic-homes/feedback-core/styles.css';Most apps use the framework packages instead of calling the core directly. The core exports the building blocks they share:
import {
openFeedback,
closeFeedback,
submitFeedback,
feedbackPayloadSchema,
} from '@classic-homes/feedback-core';Exports
| Import | Contents |
| ----------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| @classic-homes/feedback-core | Controller (openFeedback, closeFeedback, subscribe, getState), client (submitFeedback, FeedbackError), payload schema (feedbackPayloadSchema, FEEDBACK_LIMITS), page context and selection capture, screenshot helpers, Turnstile loader, UI helpers, and types |
| @classic-homes/feedback-core/styles.css | Stylesheet for both widgets (plain CSS, .chf- classes, themeable with --chf-* variables) |
Config options (apiBase, source, getToken, selection, submit, ...) are documented in the framework READMEs.
Related Packages
@classic-homes/feedback-react:FeedbackWidgetanduseFeedback()for React@classic-homes/feedback-svelte:FeedbackWidgetandfeedbackStatefor Svelte
