Socket
Book a DemoInstallSign in
Socket

@spencerlepine/connect-chat-frontend-components

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

@spencerlepine/connect-chat-frontend-components

This package houses the shared frontend components, used across the Amazon Connect messaging products.

1.1.4
unpublished
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Amazon Connect Chat Frontend Components Node.js CI npm version

This package houses the shared frontend components, used across the Amazon Connect messaging products.

Exports CommonJS bundle file, with React 16 components.

Usage

npm install @spencer/amazon-connect-chat-frontend-components@^1.0.0

<RichTextEditor />

import { RichTextEditor } from '@spencer/amazon-connect-chat-frontend-components';

export default function ChatComposer(props) {
  function sendMarkdownMessage(markdownMessage) {
    if (markdownMessage.trim()) {
      addMessage(contactId, {
        text: markdownMessage,
        type: ContentType.MESSAGE_CONTENT_TYPE.TEXT_MARKDOWN
      });
    }
  }

  return (
    <ChatComposerWrapper>
      <RichTextEditor
        allowedFileContentTypes={ATTACHMENT_ACCEPT_CONTENT_TYPES}
        attachmentsEnabled={composerConfig && composerConfig.attachmentsEnabled}
        sendMessage={sendMarkdownMessage}
        sendAttachment={sendAttachmentGivenFile}
        placeholder={placeholder}
        onTyping={throttledOnTyping}
      ></RichTextEditor>
    </ChatComposerWrapper>
  );
}

<RichMessageRenderer />

import { RichMessageRenderer } from '@spencer/amazon-connect-chat-frontend-components';

export class ParticipantMessage extends PureComponent {
  renderContent(textContent, contentType) {
    // ...
    if (contentType === ContentType.MESSAGE_CONTENT_TYPE.TEXT_MARKDOWN) {
      return <RichMessageRenderer content={textContent} />;
    }
    return <PlainTextMessage content={textContent} />;
  }

  render() {
    return (
      <div data-testid="main-message">
        {this.renderContent('**bold message**', 'text/markdown')}
      </div>
    );
  }
}

Keywords

amazon

FAQs

Package last updated on 09 May 2023

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.