0.0.17 • Published 10 months ago

contember-echo v0.0.17

Weekly downloads
-
License
-
Repository
-
Last release
10 months ago

Echo Widget

A lightweight feedback widget built with Solid.js that allows users to capture screenshots, annotate them, and submit feedback.

Usage

Using as an NPM Package

import { initEcho } from 'contember-echo';

initEcho({
  // Optional: widget position (default: 'bottom-right')
  position: 'bottom-right',
  
  // Optional: primary color for buttons and UI elements
  primaryColor: '#007AFF',

  // Optional: customize all text elements in the widget
  textConfig: {
    welcomeMessage: {
      text: 'Click here to leave feedback',
      closeAriaLabel: 'Close welcome message',
    },
    feedbackForm: {
      title: 'Send Feedback',
      placeholder: "What's on your mind? We'd love to hear your feedback...",
      screenshotAlt: 'Screenshot Preview',
      submitButton: 'Send Feedback',
      minimizeTitle: 'Minimize',
      expandTitle: 'Expand',
      closeTitle: 'Close',
      showFormTitle: 'Show Feedback Form',
    },
    notification: {
      successTitle: 'Thank you for your feedback!',
      errorTitle: 'Something went wrong.',
      errorMessage: 'Failed to send feedback. Please try again.',
      hideTitle: 'Hide notification',
    },
    drawingTooltip: {
      text: 'Click & drag to draw',
    },
  },
  
  // Required: callback function when feedback is submitted
  onSubmit: async (data) => {
    console.log('Feedback submitted:', data);
    // Handle the feedback data (send to server, etc.)
  }
});

Using Directly in HTML

<script type="module">
  import { initEcho } from "https://esm.sh/contember-echo";

  initEcho({
    // Optional: widget position (default: 'bottom-right')
    position: 'bottom-right',
    
    // Optional: primary color for buttons and UI elements
    primaryColor: '#007AFF',

    // Optional: customize all text elements in the widget
    textConfig: {
      welcomeMessage: {
        text: 'Click here to leave feedback',
        closeAriaLabel: 'Close welcome message',
      },
      feedbackForm: {
        title: 'Send Feedback',
        placeholder: "What's on your mind? We'd love to hear your feedback...",
        screenshotAlt: 'Screenshot Preview',
        submitButton: 'Send Feedback',
        minimizeTitle: 'Minimize',
        expandTitle: 'Expand',
        closeTitle: 'Close',
        showFormTitle: 'Show Feedback Form',
      },
      notification: {
        successTitle: 'Thank you for your feedback!',
        errorTitle: 'Something went wrong.',
        errorMessage: 'Failed to send feedback. Please try again.',
        hideTitle: 'Hide notification',
      },
      drawingTooltip: {
        text: 'Click & drag to draw',
      },
    },

    // Required: callback function when feedback is submitted
    onSubmit: async (data) => {
      console.log('Feedback submitted:', data);
      // Handle the feedback data (send to server, etc.)
    }
  });
</script>
0.0.10

10 months ago

0.0.11

10 months ago

0.0.12

10 months ago

0.0.13

10 months ago

0.0.14

10 months ago

0.0.15

10 months ago

0.0.16

10 months ago

0.0.17

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.9

10 months ago

0.0.5

10 months ago

0.0.4

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.1

11 months ago