Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

a-frame-components

Package Overview
Dependencies
Maintainers
1
Versions
321
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

a-frame-components - npm Package Compare versions

Comparing version 1.0.249 to 1.0.250

18

dist/react/components/canvas-image.js

@@ -51,2 +51,3 @@ var __assign = (this && this.__assign) || function () {

import { AFRAME } from '../systems/brush';
import { GrabAndDropEvents } from '../systems/grabanddrop';
import { drawTextureOnCanvas, raiseCustomEvent } from '../util';

@@ -57,5 +58,7 @@ var THREE = window.THREE;

AFRAME.registerComponent('canvasimage', __assign(__assign({ schema: {
category: { type: 'string' },
url: { type: 'string' },
height: { type: 'number', default: 1 } // Provide a default value for height
} }, mixin), { init: function () {
var _this = this;
var me = this;

@@ -71,2 +74,14 @@ var plane = document.createElement('a-plane');

this.loadImage();
plane.addEventListener(GrabAndDropEvents.DROPPED_GRABBED_DATA, function (evt) { return __awaiter(_this, void 0, void 0, function () {
var _a, data, category;
return __generator(this, function (_b) {
_a = evt.detail, data = _a.data, category = _a.category;
if (me.data.category === category) {
if (data === null || data === void 0 ? void 0 : data.url) {
me.el.setAttribute('url', data === null || data === void 0 ? void 0 : data.url);
}
}
return [2 /*return*/];
});
}); });
}, update: function (oldData) {

@@ -132,5 +147,6 @@ // Only update if url has changed

url: 'canvasimage.url',
height: 'canvasimage.height'
height: 'canvasimage.height',
category: 'canvasimage.category'
}
});
}

2

package.json
{
"name": "a-frame-components",
"version": "1.0.249",
"version": "1.0.250",
"description": "",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -12,2 +12,3 @@ import mixin from '../../gui/components/mixin';

schema: {
category: { type: 'string' },
url: { type: 'string' },

@@ -28,2 +29,11 @@ height: { type: 'number', default: 1 } // Provide a default value for height

this.loadImage();
plane.addEventListener(GrabAndDropEvents.DROPPED_GRABBED_DATA, async (evt) => {
const { data, category } = evt.detail;
if (me.data.category === category) {
if (data?.url) {
me.el.setAttribute('url', data?.url);
}
}
})
},

@@ -91,5 +101,6 @@ update: function (oldData) {

url: 'canvasimage.url',
height: 'canvasimage.height'
height: 'canvasimage.height',
category: 'canvasimage.category'
}
});
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc