npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@waytohealth/inbox-component

v0.4.9

Published

A Vue frontend for interacting with a Way to Health participant

Downloads

234

Readme

vue-inbox

A Vue frontend for interacting with a Way to Health participant

Dependencies

This component has a peer dependency on Bootstrap 4. By default, it uses several bootstrap styles on its components. If you are unable to use bootstrap 4, the styles prop provides a limited ability to override the default styling by allowing you to override them and insert your own classes onto most elements

Properties

auth

This property defines how the component will authorize its requests for ifs API calls. There are two supported modes: Session and API Key.

{
  "method": "session"
}
{
  "method": "apiKey",
  "apiKey": "API KEY GOES HERE"
}

If an API Key is being used, it should have authorization scopes for the following API endpoints:

  1. getTextMessages
  2. createTextMessageForParticipant

If session auth is being used, the component will expect a valid session cookie, using the {credentials: "include"} setting on fetch

apiBaseUrl

This required property is the API base for a given environment. In production (against the core platform) this should be https://app.waytohealth.org

studyId

The ID of the study that the participant is in

participantId

The Way to Health ID of the participant

styles

This optional property lets you override the class value of certain items in the Inbox UI. It should be an object with any of the following keys. Below are the default values:

{
  "inboxSubmit": "btn px-4 btn-primary"
}

Image upload

This component does not include an image uploader, but provides the hooks for a consuming application to integrate one.

When you load the InboxComponent, pass a prop of :image-upload-enabled="true" to show the invoker within the textarea. In addition, pass a named imagePicker template containing the actual image picker/uploader component.

The slot is passed the following props:

| Name | Type | Description | |---------------|-----------------------|----------------------------------------------------------------------------------------------------------------------------------| | isOpen | Boolean | Will be false initially, will be flipped to true when the image picker should open | | attachImage | Function(url, name) | Call this with the URL (and optionally name) of the image when done. This must be a publicly accessible URL reachable by Twilio. | | onClose | Function | Call this when the image picker is closed. Sets isOpen to false. This is necessary, otherwise the image picker can't reopen. |

You can find an example of usage in InboxWrapper.vue and ImagePicker.vue.

Development

If you want to hack on this repo while having your changes show up quickly within w2h core (or some other UI), here's a workflow to make that happen:

  1. Within this repo, run yarn link
  2. Within the main app (e.g. w2h core), run yarn link @waytohealth/inbox-component. That will make ./node_modules/@waytohealth/inbox-component a symlink to this repo.
    • You may need to restart webpack dev server after doing this.
  3. Set up a File Watcher in your IDE to run yarn build after each modification. (This will make sure that changes make their way into dist/ and not just src/).