Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add npm package #16

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
build/
dist/
node_modules/
.snapshots/
*.min.js
34 changes: 34 additions & 0 deletions EpiResponsivePicture.React/epiresponsivepicture-react/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"parser": "@typescript-eslint/parser",
"extends": [
"standard",
"standard-react",
"plugin:prettier/recommended",
"prettier/standard",
"prettier/react",
"plugin:@typescript-eslint/eslint-recommended"
],
"env": {
"node": true
},
"parserOptions": {
"ecmaVersion": 2020,
"ecmaFeatures": {
"legacyDecorators": true,
"jsx": true
}
},
"settings": {
"react": {
"version": "16"
}
},
"rules": {
"space-before-function-paren": 0,
"react/prop-types": 0,
"react/jsx-handler-names": 0,
"react/jsx-fragments": 0,
"react/no-unused-prop-types": 0,
"import/export": 0
}
}
22 changes: 22 additions & 0 deletions EpiResponsivePicture.React/epiresponsivepicture-react/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

# See https://help.github.com/ignore-files/ for more about ignoring files.

# dependencies
node_modules

# builds
build
dist
.rpt2_cache

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
10 changes: 10 additions & 0 deletions EpiResponsivePicture.React/epiresponsivepicture-react/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"singleQuote": true,
"jsxSingleQuote": true,
"semi": false,
"tabWidth": 2,
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "always",
"trailingComma": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: node_js
node_js:
- 12
- 10
43 changes: 43 additions & 0 deletions EpiResponsivePicture.React/epiresponsivepicture-react/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# epiresponsivepicture-react

> ResponsivePicture React component for Forte.EpiResponsivePicture package

[![NPM](https://img.shields.io/npm/v/epiresponsivepicture-react.svg)](https://www.npmjs.com/package/epiresponsivepicture-react) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save epiresponsivepicture-react
```

## Usage

```tsx
import React, { Component } from 'react'

import ResponsivePicture from 'epiresponsivepicture-react'
import 'epiresponsivepicture-react/dist/index.css'

model: ResponsiveImageViewModel;
profile: PictureProfile;
imgAttributes?: any
class Example extends Component {
render() {
return <ResponsivePicture model={imageModel} profile={pictureProfile} />
}
}
```

## Parameters
ResponsivePicture component accepts numerous parameters:
- `model` (required), having following properties:
- `url` - base URL of the image,
- `focalPoint` - focal point of the image, with `x` and `y` properties. Each property should be number in range of 0..1
- `width` and `height` of the original image,
- `alt` for the `<img>` tag,
- `profile` (required), being serialized picture profile (camel cased)
- `imgAttributes` - set of additional HTML attributes that should be present in `<img>` tag.

## License

MIT © [Forte Digital](https://github.com/fortedigital)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
This example was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

It is linked to the epiresponsivepicture-react package in the parent directory for development purposes.

You can run `npm install` and then `npm start` to test your package.
Loading