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 🙏

© 2026 – Pkg Stats / Ryan Hefner

hanbiro-react16-sdk

v1.0.12

Published

React 16.2.0 compatible UI components for Hanbiro

Readme

hanbiro-react16-sdk

React 16.2.0 compatible UI components SDK for Hanbiro projects.

Installation

npm install hanbiro-react16-sdk

CSS Import (Required)

You must import the SDK stylesheet at the entry point of your project (or in the HTML file when using UMD).

For npm/ES module projects:

// src/index.tsx or App.tsx
import 'hanbiro-react16-sdk/style.css';

For UMD (script tag):

<link rel="stylesheet" href="path/to/hanbiro-react16-sdk.style.css" />

Exported Components

| Component | Import path | |---|---| | ChatAIDraft | hanbiro-react16-sdk/components | | LoadingCircular | hanbiro-react16-sdk/components | | LoadingContainer | hanbiro-react16-sdk/components |

Exported Utils

| Function | Description | Import path | |---|---|---| | initHanbiroReactSDK | Initialize SDK (baseUrl, signer) | hanbiro-react16-sdk/utils | | getBaseUrl | Get the configured base URL | hanbiro-react16-sdk/utils | | getGroupwareUrl | Get the groupware URL | hanbiro-react16-sdk/utils |


Initialization (Required)

Call initHanbiroReactSDK at the entry point of your project before rendering any components.

import { initHanbiroReactSDK } from 'hanbiro-react16-sdk/utils';

initHanbiroReactSDK({
  baseUrl: 'https://vndev.hanbiro.com',
  signer: null, // Pass your signer instance here if available
});

Usage: ES Module (npm)

import React, { Component } from 'react';
import { ChatAIDraft } from 'hanbiro-react16-sdk/components';
import { getBaseUrl } from 'hanbiro-react16-sdk/utils';
import 'hanbiro-react16-sdk/style.css';

class ChatAIDraftApp extends Component {
  handleApply = (result) => {
    console.log('Applied Output:', result);
  };

  render() {
    return (
      <ChatAIDraft
        baseUrl={getBaseUrl()}
        onApply={this.handleApply}
      />
    );
  }
}

export default ChatAIDraftApp;

Usage: UMD (Script Tag / AngularJS / Legacy Projects)

Load the SDK via <script> and <link> tags directly in your HTML. React and ReactDOM must be loaded first.

<!-- 1. Load peer dependencies -->
<script src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>

<!-- 2. Load SDK stylesheet -->
<link rel="stylesheet" href="path/to/hanbiro-react16-sdk.style.css" />

<!-- 3. Load SDK UMD bundle -->
<script src="path/to/hanbiro-react16-sdk.umd.js"></script>

The SDK is exposed as a global variable HanbiroReact16SDK.

// Initialize
HanbiroReact16SDK.initHanbiroReactSDK({
  baseUrl: 'https://vndev.hanbiro.com',
  signer: null,
});

// Mount a component into a DOM element
ReactDOM.render(
  React.createElement(HanbiroReact16SDK.ChatAIDraft, {
    baseUrl: HanbiroReact16SDK.getBaseUrl(),
    onApply: function(result) {
      console.log('Applied:', result);
    },
  }),
  document.getElementById('chat-ai-container')
);

Example: AngularJS Directive

angular.module('myApp').directive('chatAiDraft', function() {
  return {
    restrict: 'E',
    link: function(scope, element) {
      var container = element[0];

      HanbiroReact16SDK.initHanbiroReactSDK({
        baseUrl: 'https://vndev.hanbiro.com',
        signer: null,
      });

      ReactDOM.render(
        React.createElement(HanbiroReact16SDK.ChatAIDraft, {
          baseUrl: HanbiroReact16SDK.getBaseUrl(),
          onApply: function(result) {
            scope.$apply(function() {
              scope.draftContent = result.html;
            });
          },
        }),
        container
      );

      scope.$on('$destroy', function() {
        ReactDOM.unmountComponentAtNode(container);
      });
    }
  };
});
<!-- In your AngularJS template -->
<chat-ai-draft></chat-ai-draft>

ChatAIDraft — Imperative API (Ref)

ChatAIDraft exposes setAIContext via ref, allowing you to programmatically set the HTML content of the AI Context editor inside the Settings panel.

interface ChatAIDraftRef {
  setAIContext: (html: string) => void;
}

React 18 / React 16.8+ (useRef)

import React, { useRef } from 'react';
import { ChatAIDraft } from 'hanbiro-react16-sdk/components';

function MailComposer() {
  const chatRef = useRef<ChatAIDraft>(null);

  const handleOpenAI = () => {
    chatRef.current?.setAIContext('<p>Original email content...</p>');
  };

  return (
    <>
      <button onClick={handleOpenAI}>Open AI</button>
      <ChatAIDraft
        ref={chatRef}
        onApply={(params) => console.log(params.html)}
      />
    </>
  );
}

AngularJS / UMD (callback ref)

let chatAIInstance = null;

ReactDOM.render(
  React.createElement(HanbiroReact16SDK.ChatAIDraft, {
    ref: function(instance) { chatAIInstance = instance; },
    onApply: function(result) { /* ... */ },
  }),
  document.getElementById('chat-ai-container')
);

// Call anytime — e.g. when opening the AI panel
function setEmailContext(html) {
  if (chatAIInstance) {
    chatAIInstance.setAIContext(html);
  }
}

Development Commands

  • Run playground locally: npm run dev
  • Build library for production: npm run build
  • Build playground for production: npm run build:playground
  • Typecheck: npm run test:typescript