# web_view_sdk_test

> Neosmartpen_view typescript library

Latest version **2.5.8** (published 2022-07-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install web_view_sdk_test
pnpm add web_view_sdk_test
yarn add web_view_sdk_test
bun add web_view_sdk_test
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.5.8 |
| Published | 2022-07-28 |
| First published | 2022-06-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 16 |
| Unpacked size | 3.4 MB |
| Known vulnerabilities | 0 (+3 in 2 direct dependencies) |
| Install scripts | no |
| Author | Wonho Seo |
| Maintainers | mminhou, wonhoneo |

## Links

- npm: https://www.npmjs.com/package/web_view_sdk_test
- Repository: https://github.com/Wonho-Neo/webViewSDK
- Homepage: https://github.com/Wonho-Neo/webViewSDK#readme
- Issues: https://github.com/Wonho-Neo/webViewSDK/issues
- npm.io page: https://npm.io/package/web_view_sdk_test

## Dependencies (16)

- [react](https://npm.io/package/react.md) ^18.1.0
- [fabric](https://npm.io/package/fabric.md) ^5.2.1
- [jquery](https://npm.io/package/jquery.md) ^3.6.0
- [pdf-lib](https://npm.io/package/pdf-lib.md) ^1.17.1
- [hammerjs](https://npm.io/package/hammerjs.md) ^2.0.8
- [react-dom](https://npm.io/package/react-dom.md) ^18.1.0
- [file-saver](https://npm.io/package/file-saver.md) ^2.0.5
- [pdfjs-dist](https://npm.io/package/pdfjs-dist.md) 2.5.207
- [sprintf-js](https://npm.io/package/sprintf-js.md) ^1.1.2
- [typescript](https://npm.io/package/typescript.md) ^4.7.2
- [web-bluetooth](https://npm.io/package/web-bluetooth.md) ^0.1.2
- [webpack-merge](https://npm.io/package/webpack-merge.md) ^5.8.0
- [@babel/polyfill](https://npm.io/package/@babel/polyfill.md) ^7.12.1
- [path-intersection](https://npm.io/package/path-intersection.md) ^2.2.1
- [react-resize-detector](https://npm.io/package/react-resize-detector.md) ^7.1.1
- [@babel/preset-typescript](https://npm.io/package/@babel/preset-typescript.md) ^7.17.12

## Recent versions

- 2.5.8 (latest) — 2022-07-28
- 2.5.7 — 2022-07-28
- 2.5.6 — 2022-07-27
- 2.5.5 — 2022-07-25
- 2.5.4 — 2022-07-20
- 2.5.3 — 2022-07-20
- 2.5.2 — 2022-07-19
- 2.5.1 — 2022-07-19
- 2.5.0 — 2022-07-18
- 2.4.9 — 2022-07-18
- 2.4.8 — 2022-07-18
- 2.4.7 — 2022-07-18
- 2.4.6 — 2022-07-18
- 2.4.5 — 2022-07-18
- 2.4.4 — 2022-07-18
- … 162 more at https://npm.io/package/web_view_sdk_test/versions

## README

# Neo smartpen View SDK for Web Platform

# Web View SDK
This document is written to be used the web_view_sdk for NeoSmartPen. <br />
( Caution! ViewSDK require web_pen_sdk )
<br />

## Installation 
``` sh
# web_view_sdk setting

$ npm install web_view_sdk
$ yarn add web_view_sdk
```

## 전체적인 Flow
### Library Set
```ts
import { MainViewFC, RenderHelper, PenManager, savePDF, appendPdfToStorage, ViewMessageType } from 'web_view_sdk';
```

### Step1: View에 해당하는 MainViewFC를 렌더 영역에 추가합니다.
```ts
/** Add MainView Component */
<div>
  <MainViewFC/>
</div>
```

### Step2: PenManager.registerPen()을 사용하여 BLE 접속이 성공된 pen을 ViewSDK에 연결합니다.
```ts
/** Connect SmartPen to ViewSDK */
const controller = PenHelper.pens.filter((c) => c.info.MacAddress === mac)[0]; 
PenManager.registerPen(controller);
```

### Step3: 펜에서 전송되는 Dot 정보를 ViewSDK에 연결합니다.
```ts
/** Send Dot Data to ViewSDK*/
useEffect(() => {
  PenHelper.dotCallback = async (mac, dot) => {
    penManager.passingDot(dot);
  }
});
```

### Step4: ViewSDK로부터 콜백을 받아옵니다.
```ts
/** Get a callback from the ViewSDK. */
useEffect(() => {
  renderHelper.current.messageCallback = async (type, args) => {
    viewMessage(type, args);
  }
});

const viewMessage = (type, args) => {
  switch(type){
    case ViewMessageType.T:
    ...
    case OptionMessageType.T:
    ...
  }
}
```

<br />

## 🐾 Sample Page
> https://github.com/neostudio-team/WebSDKSample

## 📑 web_view_sdk 공식문서
> ### [Google Docs](https://docs.google.com/document/d/1vWLjIEvvSFO8_1KsnHw3_G6UW82ydzYBuIt5zGylx3g/edit?usp=sharing)

## 📜 License
#### **Copyright(c) 2022, NeoLAB Convergence INC. No license allowed.**

<br />

Release Note
=====
**~2022. 06. 30.** (WONHO, MHCHOI)
-----
### Updates
- Pen Connect+Render, Zoom, PDF Load
- Sample page 구성

=====
**~2022. 07. 29.** (WONHO)
-----
### Updates
- Replay, paperHub

=====
**~** (???)
-----
### ToDo
- Print(POD), NDP

---
_Source: https://npm.io/package/web_view_sdk_test · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
