feat: update package for A-Frame 1.5.0
compatibility Updated the README.md to reflect changes in usage and installation for the updated A-Frame click-drag component, ensuring compatibility with A-Frame version 1.5.0. The installation instructions now point to a new package name, indicating a shift in the repository and maintenance. Adjustments include a more structured HTML example for better readability and an update in the import paths to align with the new package name. The entry point in package.json was also shifted from `src/index.js` to `lib/index.js`, potentially indicating a change in the build or distribution process to enhance library usage. These changes aim to provide a clear, updated path for users integrating the click-drag functionality with the latest A-Frame version, ensuring continued support and ease of use.
This commit is contained in:
parent
eccccfe620
commit
643d249631
2 changed files with 13 additions and 7 deletions
16
README.md
16
README.md
|
@ -1,6 +1,6 @@
|
|||
# aframe-click-drag-component
|
||||
|
||||
A Click & Drag component for [A-Frame](https://aframe.io). This is a fork of
|
||||
A Click & Drag component for [A-Frame](https://aframe.io). This is a fork of
|
||||
the original [aframe-click-drag-component](https://github.com/jesstelford/aframe-click-drag-component)
|
||||
to make it work in current versions of A-Frame (tested with 1.5.0).
|
||||
|
||||
|
@ -39,6 +39,7 @@ Emitted with the following info:
|
|||
- `clientY` - the final mouse event's `clientY` value
|
||||
|
||||
### Applying click-drag conditionally
|
||||
|
||||
You can conditionally apply `click-drag` behaviors by specifying an `enabled`
|
||||
attribute in your `click-drag` property:
|
||||
|
||||
|
@ -65,7 +66,12 @@ Use directly from the unpkg CDN:
|
|||
|
||||
<body>
|
||||
<a-scene>
|
||||
<a-sphere click-drag position="0 1.25 -5" radius="1.25" color="#EF2D5E"></a-sphere>
|
||||
<a-sphere
|
||||
click-drag
|
||||
position="0 1.25 -5"
|
||||
radius="1.25"
|
||||
color="#EF2D5E"
|
||||
></a-sphere>
|
||||
<a-camera look-controls-enabled="false"></a-camera>
|
||||
</a-scene>
|
||||
</body>
|
||||
|
@ -76,13 +82,13 @@ Use directly from the unpkg CDN:
|
|||
Install via npm:
|
||||
|
||||
```bash
|
||||
npm install aframe-click-drag-component
|
||||
npm install @kumitterer/aframe-click-drag-component
|
||||
```
|
||||
|
||||
Then register and use.
|
||||
|
||||
```javascript
|
||||
import aframe from 'aframe';
|
||||
import registerClickDrag from 'aframe-click-drag-component';
|
||||
import aframe from "aframe";
|
||||
import registerClickDrag from "@kumitterer/aframe-click-drag-component";
|
||||
registerClickDrag(aframe);
|
||||
```
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
{
|
||||
"name": "aframe-click-drag-component",
|
||||
"name": "@kumitterer/aframe-click-drag-component",
|
||||
"version": "4.0.0",
|
||||
"description": "Click & Drag component for A-Frame.",
|
||||
"main": "src/index.js",
|
||||
"main": "lib/index.js",
|
||||
"scripts": {
|
||||
"build-lib": "mkdir -p lib && babel src/index.js -o lib/index.js",
|
||||
"prepublishOnly": "npm run build-lib"
|
||||
|
|
Loading…
Reference in a new issue