open-index/open-npm huggingface dataset:
npm package: @oasis-end/utils
Description: The end of the oasis is still an oasis. There are some useful utils.
Author: jooies
Latest version: 1.0.6

The end of the oasis is still an oasis. There are some useful utils.

[Docs](https://joo1es.github.io/utils/)

## floatAdd

Avoiding precision problems when adding float numbers.

```typescript
import { floatAdd } from '@oasis-end/utils'

floatAdd(0.1, 0.2) // the result is 0.3
0.1 + 0.2 // the result is 0.30000000000000004
```

## unique

High-performance array unique.

```typescript
import { unique } from '@oasis-end/utils'

unique([1, 2, 1, 2]) // the result is [1, 2]
unique([
    { id: 1 }, { id: 2 },
    { id: 1 }, { id: 2 }
], 'id') // the result is [{ id: 1 }, { id: 2 }]
unique([
    { id: 1 }, { id: 2 },
    { id: 1 }, { id: 2 }
], item => item.id) // the result is [{ id: 1 }, { id: 2 }]
```

## treeMap

Map properties for tree array.

```typescript
import { treeMap } from '@oasis-end/utils'

unique([
    { name: 'A' },
    { name: 'B' },
    { name: 'C' },
    { name: 'D', children: [ { name: 'E' } ] }
], (item) => {
    return { name: `${item.name} is my name` }
})
// the result is
// [
//     { name: 'A is my name' },
//     { name: 'B is my name' },
//     { name: 'C is my name' },
//     { name: 'D is my name', children: [ { name: 'E is my name' } ] }
// ]
```
npm package: @oasis-engine/asset-tools
Description: antg asset tools
Author: Hu Song
Latest version: 0.0.5

# Antg Asset Tools

## Quick Start

Install:

```shell
tnpm install --save @oasis-engine/asset-tools
```

Use `oasis-engine` as an external library: https://gw.alipayobjects.com/os/lib/oasis-engine/0.9.0-beta.68/dist/browser.min.js

Import:

```javascript
import { transformGlTFtoGlB, GlTFViewer } from '@alipay/antg-asset-tools';
```

Usage:

1. transform glTF to glB

```javascript
const json = await fetch("/model/duck.gltf").then((res) => res.json());
const resources: Record<string, Uint8Array> = {};

const items = [...json.buffers, ...json.images];

await Promise.all(
  items.map(async (item) => {
    const ab = await fetch(item.uri).then((res) => res.arrayBuffer());
    resources[item.uri] = new Uint8Array(ab);
  })
);

// transform glTF to glB
const glb = transformGlTFtoGlB({ json, resources });
```

2. glTF viewer

```javascript
const glTFPreview = GlTFPreview.getInstance();

document.getElementById("container")!.appendChild(glTFPreview.canvas);

await glTFPreview.loadAsset(glTFUrlOrGlbBlob);

glTFPreview.startPreview();

/** Get snapshot */
glTFPreview.getSnapshot(300, 300).then((snapshotUrl) => {
  // do something
  ...
});
```

See [functions](./docs/classes/GlTFPreview.md) API documentation for more details.
npm package: @oasis-engine/create-ar-app
Description: 在开始前，你需要先创建一个 `支付宝小程序应用` 或 `微信小程序应用` 备用，因为所有的效果都需要使用手机才能预览到。
Latest version: 0.0.3

## 前言

在开始前，你需要先创建一个 `支付宝小程序应用` 或 `微信小程序应用` 备用，因为所有的效果都需要使用手机才能预览到。

## 使用方式

> 检查自己的 NodeJS 版本: Node.js version >=12.0.0.

### 初始化一个 AR 应用

```shell
npm init @oasis-engine/ar-app@0.0.2
```

根据步骤依次选择 `项目目录`，`项目平台` 与 `应用类型`

![step1](https://mdn.alipayobjects.com/huamei_jvf0dp/afts/img/A*ya4YQ7HY6soAAAAAAAAAAAAADleLAQ/original)

![step2](https://mdn.alipayobjects.com/huamei_jvf0dp/afts/img/A*9tfbQ5MtV7gAAAAAAAAAAAAADleLAQ/original)

![step3](https://mdn.alipayobjects.com/huamei_jvf0dp/afts/img/A*bHd_RaUyr7oAAAAAAAAAAAAADleLAQ/original)

### 调试

此处以 `支付宝小程序` 为例：

![image-20210208112945261](https://mdn.alipayobjects.com/huamei_jvf0dp/afts/img/A*_cw7Ro453bwAAAAAAAAAAAAADleLAQ/original)

此时你的手机上就会出现调试页面：

![image](https://gw.alipayobjects.com/mdn/rms_7c464e/afts/img/A*ThkFSqjC464AAAAAAAAAAAAAARQnAQ)

### 重要

本项目仅为探索尝试，请勿进行线上商用。
npm package: @oasis-engine/create-oasis-app
Description: A tool for creating your oasis application. Currently supported template presets include:
Latest version: 0.8.0

# Create Oasis App

A tool for creating your oasis application. Currently supported template presets include:

- `Vanilla`(Use Vanilla JavaScript/TypeScript)
- `React`(React Template)
- `Vue`(Vue Template)
- `Ali-Mini`(Alibaba Mini Program)
- `Library`(Oasis Library)
- `MiniGame`(Alipay Mini Game)

## Usage

### npm

> Compatibility Note: Node.js version >=12.0.0.

```shell
npm init @oasis-engine/oasis-app
```

### yarn

```shell
yarn create @oasis-engine/oasis-app
```

After creating a template, run:

```shell
npm install
npm run dev
```

Open your browser, you can see:

![image-20210208112945261](https://gw.alipayobjects.com/zos/OasisHub/3dfda7c5-7c65-4976-bc56-6d1f47592a31/image-20210208112945261.png)

Enjoy your exploration of oasis.
npm package: @oasis-engine/editor-components
Description: This library contains all components you need for creating complex graphical user interface on the web.
Latest version: 0.0.4

# @oasis-engine/editor-components

This library contains all components you need for creating complex graphical user interface on the web.

## Install

```bash
npm install @oasis-engine/editor-components --save 
```

or

```bash
yarn add @oasis-engine/editor-components
```

## Usage

```tsx
import { Button } from "@oasis-engine/editor-components";

export default () => <Button variant="primary">Oasis Engine</Button>
```
npm package: @oasis-engine/editor-design-system
Description: Design System for oasis editor
Latest version: 0.0.2

# @oasis-engine/editor-design-system

A subjective design system built using [stitches.js](https://github.com/stitchesjs/stitches) and [radix-ui/colors](https://github.com/radix-ui/colors). The definition of Design Tokens follows [theme-specification](https://github.com/system-ui/theme-specification)


## Install

```bash
npm install @oasis-engine/editor-design-system --save 
```

or

```bash
yarn add @oasis-engine/editor-design-system
```

## Usage

```tsx
import { styled } from "@oasis-engine/editor-design-system";

const Button = styled('button', {
  all: 'unset',
  display: 'flex',
  color: '$slate11',
  height: '$sm',
  width: '$5',
  borderRadius: '$sm',
  backgroundColor:'$slate1',
})
```