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

oswald-addon

v0.0.28

Published

The default blueprint for ember-cli addons.

Downloads

108

Readme

oswald-addon

This addon is used to implement all supported response types of messages coming from Oswald.

Installation

ember install oswald-addon

Explanation

Supported message types:

| Supported types | Component | | --------------------- |---------------------------| | Text | oswald/text-message | | Url (links) | oswald/url-message | | Button | oswald/button-message | | Image | oswald/image-message | | Video | oswald/video-message | | Map | oswald/map-message | | Carousel | oswald/carousel-message | | Json-pretty | oswald/json-pretty-message|

If the type of the message is not known by the message-balloon, the type will be shown as a JSON-pretty message.

Usage

Using the diffrent responsetypes is simple by using the oswald messenger component in Ember.js.

In template.hbs

{{ oswald-messenger allResults=allResults chatbot=chatbot sendMessage=(action "sendMessage")}}

allResults is an array of objects. These will be returned by the chat-API of Oswald.

The chatbot has this format:

{
  "id":"exampleId",
  "token":"exampleToken",
  "welcomeCommand":false,
  "defaultLocale":"nl",
  "widget": {
    "primaryColor":"rgb(104, 102, 199)",
    "secondaryColor":"rgb(219, 219, 219)"
  }
}

The Action of the component will send the message of a message for example a quick reply or button.

Example template for a widget in your application

<div class="oswald-box primaryColor">
  <div class="oswald-title">
    <div class="oswald-pic">
      <img id="oswaldguy" src={{iconUrl}} width="35"/> 
    </div>
    <p class="sub-title">
      {{subtitle}}
    </p>
    <h3 class="main-title">
      {{title}}
    </h3>
  </div>
  {{ oswald-messenger
    allResults=allResults
    chatbot=chatbot
    sendMessage=(action "sendMessage")
  }}
  <div class="oswald-input">
    <div class="input">
      {{
        input id="message"
        value=message 
        placeholder=placeHolder 
        autofocus="" 
        type=inputType 
        enter=(action "sendMessage" message) 
      }}
      <div class="oswald-button primaryColor" {{action "sendMessage" message}}>
        <i class="fa fa-paper-plane"></i>
      </div>
    </div>
  </div>
</div>

Important

Only if font-awesome is used in your ember application.

"dependencies": {
    "ember-font-awesome": "^4.0.0-rc.4"
  },

Remove the ember-font-awesome from devDependencies and add it to dependencies.