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

react-image-marker

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-image-marker - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

10

build/index.d.ts
import * as React from 'react';
import './image-marker.scss';
declare type Marker = {
export declare type Marker = {
top: Number;
left: Number;
};
export declare type MarkerComponentProps = {
top: Number;
left: Number;
itemNumber: Number;
};
declare type Props = {
src: string;
markers: Array<Marker>;
onAddMarker: (marker: Marker) => void;
onAddMarker?: (marker: Marker) => void;
markerComponent?: React.FC<MarkerComponentProps>;
};
declare const ImageMarker: React.FC<Props>;
export default ImageMarker;

34

build/index.js

@@ -23,9 +23,35 @@

___$insertStyle(".image-marker {\n position: relative;\n max-width: 500px;\n margin: 0 auto;\n}\n.image-marker__image {\n max-width: 500px;\n margin: 0 auto;\n width: 100%;\n}\n.image-marker__marker {\n width: 25px;\n height: 25px;\n background-color: brown;\n position: absolute;\n border-radius: 50%;\n color: white;\n text-align: center;\n}");
/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var __assign = function() {
__assign = Object.assign || function __assign(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
___$insertStyle(".image-marker {\n position: relative;\n max-width: 500px;\n margin: 0 auto;\n}\n.image-marker__image {\n max-width: 500px;\n margin: 0 auto;\n width: 100%;\n}\n.image-marker__marker {\n position: absolute;\n}\n.image-marker__marker--default {\n width: 25px;\n height: 25px;\n background-color: brown;\n border-radius: 50%;\n color: white;\n text-align: center;\n}");
var ImageMarker = function (_a) {
var src = _a.src, markers = _a.markers, onAddMarker = _a.onAddMarker;
var src = _a.src, markers = _a.markers, onAddMarker = _a.onAddMarker, MarkerComponent = _a.markerComponent;
var imageRef = React.useRef(null);
var handleImageClick = function (event) {
if (!imageRef.current) {
if (!imageRef.current || !onAddMarker) {
return;

@@ -58,3 +84,3 @@ }

React.createElement("img", { src: src, alt: "Blueprint", onClick: handleImageClick, className: "image-marker__image", ref: imageRef }),
markers.map(function (marker, itemNumber) { return (React.createElement("div", { className: "image-marker__marker", style: getItemPosition(marker), key: itemNumber }, itemNumber + 1)); })));
markers.map(function (marker, itemNumber) { return (React.createElement("div", { className: "image-marker__marker image-marker__marker--default", style: getItemPosition(marker), key: itemNumber }, MarkerComponent ? (React.createElement(MarkerComponent, __assign({}, marker, { itemNumber: itemNumber }))) : (itemNumber + 1))); })));
};

@@ -61,0 +87,0 @@

{
"name": "react-image-marker",
"version": "1.0.3",
"version": "1.0.4",
"description": "Allows to add markers to an image",

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

Sorry, the diff of this file is not supported yet

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