{"versions":{"1.0.15":{"name":"hotbox-minder","title":"Hot Box UI","description":"Efficiency And Flexible Editor UI","version":"1.0.15","homepage":"https://github.com/fex-team/hotbox","author":{"name":"Baidu FEX","url":"https://github.com/fex-team"},"repository":{"type":"git","url":"git+https://github.com/fex-team/hotbox.git"},"keywords":["ui","hotbox","efficiency","flexible","javascript","library"],"bugs":{"url":"https://github.com/fex-team/hotbox/issues"},"main":"hotbox.min.js","licenses":[{"type":"BSD","url":"https://github.com/fex-team/hotbox/blob/dev/LICENSE"}],"dependencies":{},"devDependencies":{"grunt":"^0.4.5","grunt-autoprefixer":"^2.0.0","grunt-contrib-concat":"^0.5.0","grunt-contrib-less":"^0.12.0","grunt-contrib-uglify":"~0.4.0","grunt-contrib-watch":"^0.6.1","grunt-module-dependence":"~0.2.0","grunt-replace":"^0.8.0","less":"~2.1.1","watch":"~0.13.0"},"scripts":{"watch-less":"watch \"lessc --source-map less/hotbox.less hotbox.css\" \"less\""},"gitHead":"440e62a01ae48bc0d5d6d6ed5379489a830fa967","_id":"hotbox-minder@1.0.15","_nodeVersion":"12.12.0","_npmVersion":"6.11.3","dist":{"integrity":"sha512-QKkOr39gSWJF5bxvxwa+HMDAWPv8bUuRVu2VXxuz4+1USu15mqzWpX0Oxb4kGLvyz8MxgRCcxVv/clL4gxn8Sg==","shasum":"e56aaf25285ee6da490f4229c0477e9443741db4","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/hotbox-minder/-/hotbox-minder-1.0.15.tgz","fileCount":25,"unpackedSize":295937,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgwXlgCRA9TVsSAnZWagAAkigQAJ3TrHZ1/akrr+T1QbLV\nENC0PmEIVoS+xjzH6HF9QCgWlDEZPTqqiSna+XiKy5jann41zrBnDuj+IMT6\nDXqDeoIfyBHb3dZfV6Y3UKCRM7YV4KC02zkzSy7SuCMGgG8aMXxav35jrz9P\n1aqyynj4N4B5YtFq8hUaXs2TMK8HlmuQ5AEaPQD6Teoh7gUZo0v0cz/IcUxq\n99uotn/FWBlMEtGOcarMeRzUlskVVUaKAYViQn7GhppPZiZ/666Gu9c/omN0\nlF6dGj+SmVPgJ3olFuGc5qsVPJ06hqH/YNHS+RdoxFMmqb0wmZBqStYbYBFB\nzcA8PEN5Lt0pTwWw3OWftwL71bffbbMrFh3Rha++BB+hQ/7d6QjpTUKuNEoB\n3d35psW2PjiivvkMbMI7GepdcYp9NEgYr8xfuWlL4ml4mGMz6ZFSDChBmYYD\n5Ci/XK/xhMYx4RTw0f+bMO0XncQofueuYJKfRn7bQUrYP0nXB8KaMCIGX4yl\nkXPofOy3Ud8Sw/NIYmGpnJjezeWBW4VtutC5tyfT6KYLKQmjBbriWNiYcsVp\nBlrgsDH6wePYHlL6u1+CifZZ98ONaWGLDN970bWhZ5ES+vNV9jl0iCTUuDUS\nFj2i1Agnkj6CF99QG0WE/EncnKWDAgMsGjrqQPVakwBqrNH+bu5RN5LnjScl\nbR0K\r\n=y3Vi\r\n-----END PGP SIGNATURE-----\r\n","size":129240},"_npmUser":{"name":"anonymous","email":"1126017466@qq.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"1126017466@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hotbox-minder_1.0.15_1623292256751_0.3044278389331234"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2021-12-27T16:17:43.207Z","deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.","contributors":[]}},"dist-tags":{"latest":"1.0.15"},"name":"hotbox-minder","time":{"created":"2022-01-27T12:22:36.269Z","modified":"2022-10-10T04:22:14.232Z","1.0.15":"2021-06-10T02:30:56.902Z"},"readme":"热盒 UI fork 版本\r\n====\r\n\r\n热盒 UI 是一种高效的上下文交互方式，在最大化编辑区域的同时（再也不需要臃肿的工具栏了）允许全键盘操作。\r\n\r\n![热盒 UI 截图](snap.png)\r\n\r\n## 使用示例\r\n\r\n```js\r\nvar hotbox = new HotBox('#editor');\r\n\r\nvar main = hotbox.state('main');\r\nmain.button({\r\n    position: 'center',\r\n    action: function() {\r\n        // 编辑动作\r\n    },\r\n    label: '编辑',\r\n    key: 'F2',\r\n    next: 'idle'\r\n});\r\n\r\nhotbox.active('main', { x: 300, y: 300 });\r\n```\r\n\r\n## HotBox 类\r\n\r\n用于构建热盒 UI。\r\n\r\n### 构造函数 `HotBox.constructor`\r\n\r\n直接使用 `new` 关键字创建 HotBox 实例。\r\n\r\n```js\r\nvar hotbox = new HotBox(selector);\r\n```\r\n\r\n构造函数接受一个**「必须」**的参数 `selector`，表示热盒渲染的位置。热盒创建之后的状态是 `idle`，这个状态下热盒是不可见的。\r\n\r\n### 定义和获取状态 `state()` 方法\r\n\r\n热盒在某个时刻有且只有一个状态（`state`），默认状态为 `idle`，此时热盒空闲，不会渲染，并且监听着按键，准备着进行定义的动作。用户需要通过 `state()` 方法来定义状态。\r\n\r\n```js\r\nvar main = hotbox.state('main');\r\n```\r\n\r\n该方法需要指定一个状态名称，返回指定名称的 `HotBoxState` 对象，该对象可以用于进一步定义状态。\r\n\r\n热盒会自动把 `main` 状态作为主要状态，会在 `idle` 状态下监听 `main` 状态定义的按键。建议用户定义并使用 `main` 状态。\r\n\r\n### 设置热盒当前状态 `active()` 方法\r\n\r\n热盒默认在 `idle` 状态上，使用 `active` 方法，使热盒进入指定的状态。\r\n\r\n```js\r\nhotbox.active('main', {x: 400, y: 400});\r\n```\r\n\r\n方法的完整签名为 `active(name, position)`。表示让热盒在 `position` 焦点位置渲染指定的状态。`position` 需要有 `x` 和 `y` 属性。\r\n\r\n## HotBoxState 类\r\n\r\n`HotBoxState` 类用户无法创建，调用 `HotBox` 的 `.state()` 方法时返回。\r\n\r\n### 为状态添加按钮 `button()`\r\n\r\n使用 `button()` 方法为状态添加一个按钮。\r\n\r\n```js\r\nvar main = hotbox.state('main');\r\nmain.button({\r\n    label: '编辑',\r\n    key: 'F2',\r\n    action: function() { /* 执行的动作 */ }\r\n    next: 'idle'\r\n});\r\n```\r\n\r\n下面是 `option` 对象支持的字段：\r\n\r\n 配置             | 类型       | 说明\r\n ---             | ---        | ---\r\n option.position | `String`   | 按钮的位置。允许在以下位置：<br>`center` - 按钮在圆心处，只能定义一个<br>`ring` - 按钮在圆环处，能定义多个<br>`top` - 按钮在上栏，能定义多个 <br>`bottom` - 按钮在下栏，能定义多个\r\n option.label    | `String`   | 按钮的标签文本\r\n option.key      | `String`   | 按钮的快捷键\r\n option.render   | `Function` | 按钮的渲染器，如果指定，将使用指定的渲染器。如果不指定，将渲染标签。<br>渲染器需要返回按钮的 HTML 代码。\r\n option.enable   | `Function` | 按钮是否可用的查询函数，如果不指定，则按钮始终可用。函数需要返回一个 `bool` 类型的值，来决定按钮是否可用。\r\n option.action   | `Function` | 按钮执行的操作\r\n option.next     | `string`   | 操作执行之后热盒到达的状态。如不指定，默认到达 `idle`。可使用该参数来跳转到多级热盒。可以取值为 `back`","users":{}}