0.5.2 • Published 6 years ago

meas-ui v0.5.2

Weekly downloads
72
License
-
Repository
-
Last release
6 years ago

meas-ui

NPM version NPM Downloads

Measure UI for making PSD/SVG/HTML to be measurable

Demo

npm.io

Installation

npm install meas-ui react react-dom mobx@3 mobx-react@4 react-mobx-vm@^0.2.0
# or use yarn
yarn add meas-ui react react-dom mobx@3 mobx-react@4 react-mobx-vm@^0.2.0

Usage

// Commonjs
import MeasureUI from 'meas-ui'
// Umd (react / react / mobx / mobx-react / react-mobx-vm are packed)
import MeasureUI from 'meas-ui/dist/meas-ui.umd'
import 'meas-ui/dist/style.css'

MeasureUI.render(
  {
    pages: [
      {
        key: 'psd', // url
        title: 'My PSD',
        html: '<div>My PSD</div>' // or an async or a sync function that resolved html string
      }
    ],
    language: 'zh' // 'zh' or 'en'
  },
  window.root,
  () => {
    console.log('rendered')
  }
)

Enable psd importing

  • Import button supports psd file
  • Drag file supports psd

npm.io

  • commonjs (webpack)

    npm install @moyuyc/psd-html
  • umd

    <html>
      <head>
        <script src="//unpkg.com/@moyuyc/psd-html"></script>
        <script src="//unpkg.com/meas-ui"></script>
      </head>
      <body>
        <script>
          MeasureUI.render(/* ... */)
        </script>
      </body>
    </html>

Todo

    • zoom style has bug on firefox.

Related

Authors

This library is written and maintained by imcuttle, moyuyc95@gmail.com.

License

MIT