Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@netology-group/wc-chat

Package Overview
Dependencies
Maintainers
4
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@netology-group/wc-chat

Messenger's webcomponents

  • 0.9.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by33.33%
Maintainers
4
Weekly downloads
 
Created
Source

@netology-group/wc-chat

Usage

Dependencies

Chat relies on dependencies described at peerDependencies section.

They should be included according your pipeline or like that.

Initialization

Chat in a nutshell can be accessed like this:

<script src="<path/to>/dist/chat.min.js"></script>
<script>
  window.customElements.define('wc-chat', window.WcChat.Chat);
</script>

Customization

Enhance

Chat is able to be enhanced. It provides some mixins and utilities.

An example can be seen here.

I18n

Chat supports internationalization and contains basic dictionary within. You have to specify language attribute to make it work (uses en-US locale by default).

For instance:

<script src="https://cdn.jsdelivr.net/npm/intl-messageformat@2.2.0/dist/intl-messageformat-with-locales.min.js"></script>
<wc-chat
  language="en-US"
  placeholder="Write something…"
  placeholderdisabled="Chat is blocked now"
/>
Dependencies
Using parsers

Chat supports parsers to render a message.

Here are built-in ones:

No parser

Chat renders string as is unless parser is defined.

HTML Entities parser

This parser just encodes a string with HTML entities.

For instance:

<wc-chat parser='html-entities' />

Result

:s/Scotch & Soda/Scotch &amp; Soda/
Markdown parser

This parser renders any string according to Markdown markup.

For instance:

<script src="https://cdn.jsdelivr.net/npm/markdown-it@8.4.2/dist/markdown-it.min.js"></script>
<wc-chat parser='markdown' />
Dependencies

FAQs

Package last updated on 11 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc