0.0.5 • Published 2 years ago

xshape v0.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

xshape

npm version npm download

Install

NPM

npm install xshape

Usage

import { useXShape, XShapeStage, URLImage, createRootMachine } from 'xshape';

// url is optional
// data format see: https://github.com/tony40508/xshape/blob/main/public/mockData.json
const rootMachine = createRootMachine('initial-shape-data-url');

function App() {
  const {
    componentProps,
    // other props see: https://github.com/tony40508/xshape/blob/main/src/App.tsx
  } = useXShape(rootMachine);

  return (
    <XShapeStage
      {...componentProps}
      // enable to configure finish condition in limited options
      // see: https://github.com/tony40508/xshape/blob/main/src/utils/types.d.ts
      handleMouseDown={(e) => {
        componentProps.handleMouseDown(e, 'ctrl+click');
      }}
    >
      {/* URLImage is optional */}
      <URLImage url="background-image-url" />
    </XShapeStage>
  );
}

Run the example locally

npm install
npm run dev
0.0.5

2 years ago

0.0.4

3 years ago

0.0.3

3 years ago

0.1.22

3 years ago

0.1.19

3 years ago

0.1.18

3 years ago

0.1.17

3 years ago

0.1.14

3 years ago

0.1.13

3 years ago

0.1.12

3 years ago

0.1.11

3 years ago

0.1.10

3 years ago

0.1.9

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.16

3 years ago

0.0.15

3 years ago

0.0.14

3 years ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago