0.0.17 • Published 6 months ago

contember-echo v0.0.17

Weekly downloads
-
License
-
Repository
-
Last release
6 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

6 months ago

0.0.11

6 months ago

0.0.12

6 months ago

0.0.13

6 months ago

0.0.14

6 months ago

0.0.15

6 months ago

0.0.16

6 months ago

0.0.17

6 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.9

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.7

6 months ago

0.0.6

6 months ago

0.0.1

6 months ago